new create admin order,express add company

This commit is contained in:
2026-09-02 18:02:57 +08:00
parent 02819d159a
commit e0a63bbef9
38 changed files with 3023 additions and 265 deletions
+15 -4
View File
@@ -74,26 +74,37 @@ func GetRpcClient(serviceName string) (zrpc.Client, error) {
}
type ServiceContext struct {
Config config.Config
DB *gorm.DB
Prefix string
Config config.Config
DB *gorm.DB
Prefix string
ProductSvcName string //服务名
ExpressSvcName string
ChoreSvcName string
}
func NewServiceContext(c config.Config, db *gorm.DB) *ServiceContext {
//启动仅读取配置,不建立rpc连接 多个服务就多个
productSvc := utils.GetConfigString("services.product")
ExpressSvc := utils.GetConfigString("services.express")
ChoreSvc := utils.GetConfigString("services.chore")
if productSvc == utils.StringEmpty {
logx.Error("config services.product empty")
}
if ExpressSvc == utils.StringEmpty {
logx.Error("config services.express empty")
}
if ChoreSvc == utils.StringEmpty {
logx.Error("config services.chore empty")
}
svcCtx := &ServiceContext{
Config: c,
DB: db,
Prefix: utils.GetConfigString("mysql.prefix"),
ProductSvcName: productSvc,
ExpressSvcName: ExpressSvc,
ChoreSvcName: ChoreSvc,
}
return svcCtx