rpc_api.go 405 B

123456789101112131415161718192021222324
  1. /*
  2. * @description: rpc 实例
  3. * @Author: CP
  4. * @Date: 2020-11-12 22:49:59
  5. * @FilePath: \construction_management\web\api\rpc_api.go
  6. */
  7. package api
  8. import (
  9. "github.com/kataras/iris/v12"
  10. "go.mod/services"
  11. )
  12. type RpcApi struct {
  13. //框架-web应用上下文环境
  14. Ctx iris.Context
  15. // 需要用的service
  16. ServiceRpc services.RpcService
  17. }
  18. // 实例1
  19. func (c *RpcApi) Get() {
  20. c.ServiceRpc.Test()
  21. }