/* * @description: rpc 实例 * @Author: CP * @Date: 2020-11-12 22:49:59 * @FilePath: \construction_management\web\api\rpc_api.go */ package api import ( "github.com/kataras/iris/v12" "go.mod/services" ) type RpcApi struct { //框架-web应用上下文环境 Ctx iris.Context // 需要用的service ServiceRpc services.RpcService } // 实例1 func (c *RpcApi) Get() { c.ServiceRpc.Test() }