All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 6m35s
实现功能: - 实名状态检查轮询(可配置间隔) - 卡流量检查轮询(支持跨月流量追踪) - 套餐检查与超额自动停机 - 分布式并发控制(Redis 信号量) - 手动触发轮询(单卡/批量/条件筛选) - 数据清理配置与执行 - 告警规则与历史记录 - 实时监控统计(队列/性能/并发) 性能优化: - Redis 缓存卡信息,减少 DB 查询 - Pipeline 批量写入 Redis - 异步流量记录写入 - 渐进式初始化(10万卡/批) 压测工具(scripts/benchmark/): - Mock Gateway 模拟上游服务 - 测试卡生成器 - 配置初始化脚本 - 实时监控脚本 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
96 lines
6.3 KiB
Go
96 lines
6.3 KiB
Go
package bootstrap
|
|
|
|
import (
|
|
"github.com/break/junhong_cmp_fiber/internal/store/postgres"
|
|
)
|
|
|
|
type stores struct {
|
|
Account *postgres.AccountStore
|
|
AccountOperationLog *postgres.AccountOperationLogStore
|
|
Shop *postgres.ShopStore
|
|
Role *postgres.RoleStore
|
|
Permission *postgres.PermissionStore
|
|
AccountRole *postgres.AccountRoleStore
|
|
ShopRole *postgres.ShopRoleStore
|
|
RolePermission *postgres.RolePermissionStore
|
|
PersonalCustomer *postgres.PersonalCustomerStore
|
|
PersonalCustomerPhone *postgres.PersonalCustomerPhoneStore
|
|
Wallet *postgres.WalletStore
|
|
CommissionWithdrawalRequest *postgres.CommissionWithdrawalRequestStore
|
|
CommissionRecord *postgres.CommissionRecordStore
|
|
WalletTransaction *postgres.WalletTransactionStore
|
|
CommissionWithdrawalSetting *postgres.CommissionWithdrawalSettingStore
|
|
Enterprise *postgres.EnterpriseStore
|
|
EnterpriseCardAuthorization *postgres.EnterpriseCardAuthorizationStore
|
|
EnterpriseDeviceAuthorization *postgres.EnterpriseDeviceAuthorizationStore
|
|
IotCard *postgres.IotCardStore
|
|
IotCardImportTask *postgres.IotCardImportTaskStore
|
|
Device *postgres.DeviceStore
|
|
DeviceSimBinding *postgres.DeviceSimBindingStore
|
|
DeviceImportTask *postgres.DeviceImportTaskStore
|
|
AssetAllocationRecord *postgres.AssetAllocationRecordStore
|
|
Carrier *postgres.CarrierStore
|
|
PackageSeries *postgres.PackageSeriesStore
|
|
Package *postgres.PackageStore
|
|
ShopSeriesAllocation *postgres.ShopSeriesAllocationStore
|
|
ShopPackageAllocation *postgres.ShopPackageAllocationStore
|
|
ShopPackageAllocationPriceHistory *postgres.ShopPackageAllocationPriceHistoryStore
|
|
ShopSeriesCommissionStats *postgres.ShopSeriesCommissionStatsStore
|
|
Order *postgres.OrderStore
|
|
OrderItem *postgres.OrderItemStore
|
|
Recharge *postgres.RechargeStore
|
|
PollingConfig *postgres.PollingConfigStore
|
|
PollingConcurrencyConfig *postgres.PollingConcurrencyConfigStore
|
|
PollingAlertRule *postgres.PollingAlertRuleStore
|
|
PollingAlertHistory *postgres.PollingAlertHistoryStore
|
|
DataCleanupConfig *postgres.DataCleanupConfigStore
|
|
DataCleanupLog *postgres.DataCleanupLogStore
|
|
PollingManualTriggerLog *postgres.PollingManualTriggerLogStore
|
|
}
|
|
|
|
func initStores(deps *Dependencies) *stores {
|
|
return &stores{
|
|
Account: postgres.NewAccountStore(deps.DB, deps.Redis),
|
|
AccountOperationLog: postgres.NewAccountOperationLogStore(deps.DB),
|
|
Shop: postgres.NewShopStore(deps.DB, deps.Redis),
|
|
Role: postgres.NewRoleStore(deps.DB),
|
|
Permission: postgres.NewPermissionStore(deps.DB),
|
|
AccountRole: postgres.NewAccountRoleStore(deps.DB, deps.Redis),
|
|
ShopRole: postgres.NewShopRoleStore(deps.DB, deps.Redis),
|
|
RolePermission: postgres.NewRolePermissionStore(deps.DB, deps.Redis),
|
|
PersonalCustomer: postgres.NewPersonalCustomerStore(deps.DB, deps.Redis),
|
|
PersonalCustomerPhone: postgres.NewPersonalCustomerPhoneStore(deps.DB),
|
|
Wallet: postgres.NewWalletStore(deps.DB, deps.Redis),
|
|
CommissionWithdrawalRequest: postgres.NewCommissionWithdrawalRequestStore(deps.DB, deps.Redis),
|
|
CommissionRecord: postgres.NewCommissionRecordStore(deps.DB, deps.Redis),
|
|
WalletTransaction: postgres.NewWalletTransactionStore(deps.DB, deps.Redis),
|
|
CommissionWithdrawalSetting: postgres.NewCommissionWithdrawalSettingStore(deps.DB, deps.Redis),
|
|
Enterprise: postgres.NewEnterpriseStore(deps.DB, deps.Redis),
|
|
EnterpriseCardAuthorization: postgres.NewEnterpriseCardAuthorizationStore(deps.DB, deps.Redis),
|
|
EnterpriseDeviceAuthorization: postgres.NewEnterpriseDeviceAuthorizationStore(deps.DB, deps.Redis),
|
|
IotCard: postgres.NewIotCardStore(deps.DB, deps.Redis),
|
|
IotCardImportTask: postgres.NewIotCardImportTaskStore(deps.DB, deps.Redis),
|
|
Device: postgres.NewDeviceStore(deps.DB, deps.Redis),
|
|
DeviceSimBinding: postgres.NewDeviceSimBindingStore(deps.DB, deps.Redis),
|
|
DeviceImportTask: postgres.NewDeviceImportTaskStore(deps.DB, deps.Redis),
|
|
AssetAllocationRecord: postgres.NewAssetAllocationRecordStore(deps.DB, deps.Redis),
|
|
Carrier: postgres.NewCarrierStore(deps.DB),
|
|
PackageSeries: postgres.NewPackageSeriesStore(deps.DB),
|
|
Package: postgres.NewPackageStore(deps.DB),
|
|
ShopSeriesAllocation: postgres.NewShopSeriesAllocationStore(deps.DB),
|
|
ShopPackageAllocation: postgres.NewShopPackageAllocationStore(deps.DB),
|
|
ShopPackageAllocationPriceHistory: postgres.NewShopPackageAllocationPriceHistoryStore(deps.DB),
|
|
ShopSeriesCommissionStats: postgres.NewShopSeriesCommissionStatsStore(deps.DB),
|
|
Order: postgres.NewOrderStore(deps.DB, deps.Redis),
|
|
OrderItem: postgres.NewOrderItemStore(deps.DB, deps.Redis),
|
|
Recharge: postgres.NewRechargeStore(deps.DB, deps.Redis),
|
|
PollingConfig: postgres.NewPollingConfigStore(deps.DB),
|
|
PollingConcurrencyConfig: postgres.NewPollingConcurrencyConfigStore(deps.DB),
|
|
PollingAlertRule: postgres.NewPollingAlertRuleStore(deps.DB),
|
|
PollingAlertHistory: postgres.NewPollingAlertHistoryStore(deps.DB),
|
|
DataCleanupConfig: postgres.NewDataCleanupConfigStore(deps.DB),
|
|
DataCleanupLog: postgres.NewDataCleanupLogStore(deps.DB),
|
|
PollingManualTriggerLog: postgres.NewPollingManualTriggerLogStore(deps.DB),
|
|
}
|
|
}
|