This commit is contained in:
2024-10-12 20:41:55 +08:00
parent 8c09120db6
commit 597e4f1b89
75 changed files with 5009 additions and 823 deletions

View File

@@ -15,7 +15,11 @@ type ServiceContext struct {
UserModel model.UsersModel // 用户表的模型
EnterpriseModel model.EnterpriseInfoModel
EnterpriseAuthModel model.EnterpriseAuthModel
WalletsModel model.WalletsModel
DeductionsModel model.DeductionsModel
ApiRequestsModel model.ApiRequestsModel
SecretRpc sentinel.SecretClient
ProductRpc sentinel.ProductClient
}
func NewServiceContext(c config.Config) *ServiceContext {
@@ -34,6 +38,10 @@ func NewServiceContext(c config.Config) *ServiceContext {
UserModel: model.NewUsersModel(db, c.CacheRedis), // 注入UserModel
EnterpriseModel: model.NewEnterpriseInfoModel(db, c.CacheRedis),
EnterpriseAuthModel: model.NewEnterpriseAuthModel(db, c.CacheRedis),
WalletsModel: model.NewWalletsModel(db, c.CacheRedis),
DeductionsModel: model.NewDeductionsModel(db, c.CacheRedis),
ApiRequestsModel: model.NewApiRequestsModel(db, c.CacheRedis),
SecretRpc: sentinel.NewSecretClient(zrpc.MustNewClient(c.SentinelRpc).Conn()),
ProductRpc: sentinel.NewProductClient(zrpc.MustNewClient(c.SentinelRpc).Conn()),
}
}