广汽安道拓Acura项目MES后台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
670 B

  1. // Copyright (c) Shenyang Leading Edge Intelligent Technology Co., Ltd. All rights reserved.
  2. package container
  3. import (
  4. "errors"
  5. "fmt"
  6. )
  7. // 服务方法句柄
  8. type ServiceMethodHandler struct {
  9. // 调用器
  10. caller Caller
  11. }
  12. // 创建服务方法句柄
  13. // 参数
  14. // 1.调用器
  15. // 返回值:
  16. // 1.服务方法句柄
  17. // 2.错误
  18. func NewServiceMethodHandler(caller Caller) (*ServiceMethodHandler, error) {
  19. if caller == nil {
  20. return nil, errors.New(fmt.Sprintf("调用器不能为空!"))
  21. }
  22. return &ServiceMethodHandler{caller}, nil
  23. }
  24. // 获取调用器
  25. // 返回值:
  26. // 1.调用器
  27. func (broker *ServiceMethodHandler) Caller() Caller {
  28. return broker.caller
  29. }