Files
sundynix-micro-be/app/plant/api/internal/svc/serviceContext.go
T
2026-04-27 21:23:13 +08:00

30 lines
793 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/user/rpc/userservice"
"github.com/zeromicro/go-zero/zrpc"
)
type ServiceContext struct {
Config config.Config
PlantRpc plantservice.PlantService
UserRpc userservice.UserService
FileRpc fileservice.FileService
}
func NewServiceContext(c config.Config) *ServiceContext {
return &ServiceContext{
Config: c,
PlantRpc: plantservice.NewPlantService(zrpc.MustNewClient(c.PlantRpc)),
UserRpc: userservice.NewUserService(zrpc.MustNewClient(c.UserRpc)),
FileRpc: fileservice.NewFileService(zrpc.MustNewClient(c.FileRpc)),
}
}