f
This commit is contained in:
@@ -78,8 +78,16 @@ type ServiceContext struct {
|
||||
GlobalNotificationsModel model.GlobalNotificationsModel
|
||||
AuthorizationDocumentModel model.AuthorizationDocumentModel
|
||||
|
||||
// 白名单与天元API调用记录
|
||||
UserFeatureWhitelistModel model.UserFeatureWhitelistModel
|
||||
WhitelistOrderModel model.WhitelistOrderModel
|
||||
WhitelistOrderItemModel model.WhitelistOrderItemModel
|
||||
TianyuanapiCallLogModel model.TianyuanapiCallLogModel
|
||||
|
||||
// 服务
|
||||
AlipayService *service.AliPayService
|
||||
WhitelistService *service.WhitelistService
|
||||
TianyuanapiCallLogService *service.TianyuanapiCallLogService
|
||||
AlipayService *service.AliPayService
|
||||
WechatPayService *service.WechatPayService
|
||||
ApplePayService *service.ApplePayService
|
||||
ApiRequestService *service.ApiRequestService
|
||||
@@ -159,6 +167,12 @@ func NewServiceContext(c config.Config) *ServiceContext {
|
||||
globalNotificationsModel := model.NewGlobalNotificationsModel(db, cacheConf)
|
||||
authorizationDocumentModel := model.NewAuthorizationDocumentModel(db, cacheConf)
|
||||
|
||||
// ============================== 白名单与天元API调用记录 ==============================
|
||||
userFeatureWhitelistModel := model.NewUserFeatureWhitelistModel(db, cacheConf)
|
||||
whitelistOrderModel := model.NewWhitelistOrderModel(db, cacheConf)
|
||||
whitelistOrderItemModel := model.NewWhitelistOrderItemModel(db, cacheConf)
|
||||
tianyuanapiCallLogModel := model.NewTianyuanapiCallLogModel(db, cacheConf)
|
||||
|
||||
// ============================== 第三方服务初始化 ==============================
|
||||
tianyuanapi, err := tianyuanapi.NewClient(tianyuanapi.Config{
|
||||
AccessID: c.Tianyuanapi.AccessID,
|
||||
@@ -260,8 +274,16 @@ func NewServiceContext(c config.Config) *ServiceContext {
|
||||
GlobalNotificationsModel: globalNotificationsModel,
|
||||
AuthorizationDocumentModel: authorizationDocumentModel,
|
||||
|
||||
// 白名单与天元API调用记录
|
||||
UserFeatureWhitelistModel: userFeatureWhitelistModel,
|
||||
WhitelistOrderModel: whitelistOrderModel,
|
||||
WhitelistOrderItemModel: whitelistOrderItemModel,
|
||||
TianyuanapiCallLogModel: tianyuanapiCallLogModel,
|
||||
|
||||
// 服务
|
||||
AlipayService: alipayService,
|
||||
WhitelistService: service.NewWhitelistService(c, userFeatureWhitelistModel, whitelistOrderModel, whitelistOrderItemModel, queryModel, featureModel),
|
||||
TianyuanapiCallLogService: service.NewTianyuanapiCallLogService(tianyuanapiCallLogModel, featureModel),
|
||||
AlipayService: alipayService,
|
||||
WechatPayService: wechatPayService,
|
||||
ApplePayService: applePayService,
|
||||
ApiRequestService: apiRequestService,
|
||||
|
||||
Reference in New Issue
Block a user