30 lines
805 B
Go
30 lines
805 B
Go
// Code scaffolded by goctl. Safe to edit.
|
|
// goctl 1.10.1
|
|
|
|
package svc
|
|
|
|
import (
|
|
"sundynix-micro-go/app/file/rpc/fileservice"
|
|
"sundynix-micro-go/app/plant/api/internal/config"
|
|
"sundynix-micro-go/app/plant/rpc/plantservice"
|
|
"sundynix-micro-go/app/system/rpc/systemservice"
|
|
|
|
"github.com/zeromicro/go-zero/zrpc"
|
|
)
|
|
|
|
type ServiceContext struct {
|
|
Config config.Config
|
|
PlantRpc plantservice.PlantService
|
|
UserRpc systemservice.SystemService
|
|
FileRpc fileservice.FileService
|
|
}
|
|
|
|
func NewServiceContext(c config.Config) *ServiceContext {
|
|
return &ServiceContext{
|
|
Config: c,
|
|
PlantRpc: plantservice.NewPlantService(zrpc.MustNewClient(c.PlantRpc)),
|
|
UserRpc: systemservice.NewSystemService(zrpc.MustNewClient(c.UserRpc)),
|
|
FileRpc: fileservice.NewFileService(zrpc.MustNewClient(c.FileRpc)),
|
|
}
|
|
}
|