feat: sale manager

This commit is contained in:
zzw
2026-08-28 10:49:09 +08:00
parent 97eba7ad48
commit 6f567319be
82 changed files with 4491 additions and 182 deletions
+10 -1
View File
@@ -5,21 +5,30 @@ import (
"lone-services/services/chore/internal/config"
"github.com/zeromicro/go-zero/core/logx"
"gorm.io/gorm"
)
type ServiceContext struct {
Config config.Config
DB *gorm.DB
ProductSvcName string
SaleSvcName string
}
func NewServiceContext(c config.Config) *ServiceContext {
func NewServiceContext(c config.Config, db *gorm.DB) *ServiceContext {
productSvc := utils.GetConfigString("services.product")
if productSvc == utils.StringEmpty {
logx.Error("config services.product empty")
}
saleSvc := utils.GetConfigString("services.sale")
if saleSvc == utils.StringEmpty {
logx.Error("config services.sale empty")
}
return &ServiceContext{
Config: c,
DB: db,
ProductSvcName: productSvc,
SaleSvcName: saleSvc,
}
}