|
@@ -1,25 +1,25 @@
|
|
package svc
|
|
package svc
|
|
|
|
|
|
import (
|
|
import (
|
|
- "github.com/zeromicro/go-zero/zrpc"
|
|
|
|
"app.yhyue.com/moapp/jyInfo/api/internal/config"
|
|
"app.yhyue.com/moapp/jyInfo/api/internal/config"
|
|
- "app.yhyue.com/moapp/jyInfo/rpc/common/common"
|
|
|
|
- "app.yhyue.com/moapp/jyInfo/rpc/consumer/consumer"
|
|
|
|
- "app.yhyue.com/moapp/jyInfo/rpc/manager/manager"
|
|
|
|
|
|
+ "app.yhyue.com/moapp/jyInfo/rpc/common/commonclient"
|
|
|
|
+ "app.yhyue.com/moapp/jyInfo/rpc/consumer/consumerclient"
|
|
|
|
+ "app.yhyue.com/moapp/jyInfo/rpc/manager/managerclient"
|
|
|
|
+ "github.com/zeromicro/go-zero/zrpc"
|
|
)
|
|
)
|
|
|
|
|
|
type ServiceContext struct {
|
|
type ServiceContext struct {
|
|
Config config.Config
|
|
Config config.Config
|
|
- Common common.Common
|
|
|
|
- Manager manager.Manager
|
|
|
|
- Consumer consumer.Consumer
|
|
|
|
|
|
+ Common commonclient.CommonClient
|
|
|
|
+ Manager managerclient.ManagerClient
|
|
|
|
+ Consumer consumerclient.ConsumerClient
|
|
}
|
|
}
|
|
|
|
|
|
func NewServiceContext(c config.Config) *ServiceContext {
|
|
func NewServiceContext(c config.Config) *ServiceContext {
|
|
return &ServiceContext{
|
|
return &ServiceContext{
|
|
- Config: c,
|
|
|
|
- Common: common.NewCommon(zrpc.MustNewClient(c.Common)),
|
|
|
|
- Manager: manager.NewManager(zrpc.MustNewClient(c.Manager)),
|
|
|
|
- Consumer: consumer.NewConsumer(zrpc.MustNewClient(c.Consumer)),
|
|
|
|
|
|
+ Config: c,
|
|
|
|
+ Common: commonclient.NewCommonClient(zrpc.MustNewClient(c.Common)),
|
|
|
|
+ Manager: managerclient.NewManagerClient(zrpc.MustNewClient(c.Manager)),
|
|
|
|
+ Consumer: consumerclient.NewConsumerClient(zrpc.MustNewClient(c.Consumer)),
|
|
}
|
|
}
|
|
}
|
|
}
|