Files
junhong_cmp_fiber/pkg/openapi/handlers.go
邹进 42e881576d
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 9m33s
feat: 卡网关按运营商账户限流并记录停复机调用
- 新增网关限流:按本系统运营商账户(卡 carrier_id)→ 限流组 → 操作限制每秒请求数,每次 HTTP 尝试计量,默认限流、仅后台人工点击/通道阈值/自动续费/手动刷新豁免;支持只统计与拦截两种模式,默认只统计
- Asynq 遇限流不计失败、固定短延迟重试;轮询任务与停复机业务重试遇限流短延迟重排
- 停机、复机不再使用网关内部重试,只发一次请求
- 网关返回结构化错误;新增上游错误分类规则表与测试接口
- 新增按月分区的停复机记录表:系统自动停复机只写记录,不再写统一审计与集成日志;普通轮询查询不再写集成日志
- 新增限流组、错误分类、停复机记录、按账户调用统计与枚举后台接口
- 迁移 000243~000246;同步 OpenSpec 提案(含后续 6 个 change)与技术方案、工程约束
2026-10-24 15:06:41 +09:00

98 lines
6.6 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package openapi
import (
"github.com/break/junhong_cmp_fiber/internal/bootstrap"
"github.com/break/junhong_cmp_fiber/internal/handler/admin"
"github.com/break/junhong_cmp_fiber/internal/handler/app"
authHandler "github.com/break/junhong_cmp_fiber/internal/handler/auth"
"github.com/break/junhong_cmp_fiber/internal/handler/callback"
openapiHandler "github.com/break/junhong_cmp_fiber/internal/handler/openapi"
)
// BuildDocHandlers 构造文档生成用的 handlers(所有依赖传 nil)
func BuildDocHandlers() *bootstrap.Handlers {
return &bootstrap.Handlers{
Auth: authHandler.NewHandler(nil, nil),
Account: admin.NewAccountHandler(nil),
Role: admin.NewRoleHandler(nil, nil),
Permission: admin.NewPermissionHandler(nil),
PersonalCustomer: app.NewPersonalCustomerHandler(nil, nil),
ClientAuth: app.NewClientAuthHandler(nil, nil),
ClientAsset: app.NewClientAssetHandler(nil, nil, nil, nil, nil, nil, nil, nil, nil),
ClientWallet: app.NewClientWalletHandler(nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil),
ClientOrder: app.NewClientOrderHandler(nil, nil),
ClientExchange: app.NewClientExchangeHandler(nil),
ClientRealname: app.NewClientRealnameHandler(nil, nil, nil, nil, nil, nil, nil, nil),
ClientDevice: app.NewClientDeviceHandler(nil, nil, nil, nil, nil, nil, nil),
ClientRechargeOrder: app.NewClientRechargeOrderHandler(nil, nil, nil),
ClientNotification: app.NewClientNotificationHandler(nil, nil, nil),
ClientPopup: app.NewClientPopupHandler(nil, nil, nil),
Shop: admin.NewShopHandler(nil, nil),
ShopRole: admin.NewShopRoleHandler(nil),
AdminAuth: admin.NewAuthHandler(nil, nil),
ShopCommission: admin.NewShopCommissionHandler(nil, nil),
WithdrawalQualification: admin.NewWithdrawalQualificationHandler(nil, nil, nil),
AgentDistributionRegistration: admin.NewAgentDistributionRegistrationHandler(nil, nil, nil),
AgentDistribution: app.NewAgentDistributionHandler(nil, nil),
CommissionWithdrawal: admin.NewCommissionWithdrawalHandler(nil, nil),
CommissionWithdrawalSetting: admin.NewCommissionWithdrawalSettingHandler(nil),
Enterprise: admin.NewEnterpriseHandler(nil),
EnterpriseCard: admin.NewEnterpriseCardHandler(nil),
EnterpriseDevice: admin.NewEnterpriseDeviceHandler(nil),
Authorization: admin.NewAuthorizationHandler(nil),
IotCard: admin.NewIotCardHandler(nil),
IotCardImport: admin.NewIotCardImportHandler(nil),
ExportTask: admin.NewExportTaskHandler(nil),
Notification: admin.NewNotificationHandler(nil, nil, nil),
H5PopupConfiguration: admin.NewH5PopupConfigurationHandler(nil, nil, nil),
Device: admin.NewDeviceHandler(nil),
DeviceImport: admin.NewDeviceImportHandler(nil),
AssetAllocationRecord: admin.NewAssetAllocationRecordHandler(nil),
Storage: admin.NewStorageHandler(nil),
Carrier: admin.NewCarrierHandler(nil),
PackageSeries: admin.NewPackageSeriesHandler(nil),
Package: admin.NewPackageHandler(nil),
PackageUsage: admin.NewPackageUsageHandler(nil),
ShopPackageBatchAllocation: admin.NewShopPackageBatchAllocationHandler(nil),
ShopPackageBatchPricing: admin.NewShopPackageBatchPricingHandler(nil),
ShopSeriesGrant: admin.NewShopSeriesGrantHandler(nil),
AdminOrder: admin.NewOrderHandler(nil, nil),
AdminExchange: admin.NewExchangeHandler(nil, nil, nil),
PaymentCallback: callback.NewPaymentHandler(nil, nil, nil, nil, nil, nil, nil, nil, nil, nil),
CTCCRealnameCallback: callback.NewCTCCRealnameHandler(nil, nil, nil, nil, nil, nil, nil),
CMCCRealnameCallback: callback.NewCMCCRealnameHandler(nil, nil, nil, nil, nil, nil, nil),
CUCCRealnameCallback: callback.NewCUCCRealnameHandler(nil, nil, nil, nil, nil, nil, nil),
CUCCRealnameRemovalCallback: callback.NewCUCCRealnameRemovalHandler(nil, nil, nil, nil, nil),
PollingConfig: admin.NewPollingConfigHandler(nil),
GatewayRateLimit: admin.NewGatewayRateLimitHandler(nil, nil, nil),
PollingConcurrency: admin.NewPollingConcurrencyHandler(nil),
PollingMonitoring: admin.NewPollingMonitoringHandler(nil),
PollingAlert: admin.NewPollingAlertHandler(nil),
PollingCleanup: admin.NewPollingCleanupHandler(nil),
PollingManualTrigger: admin.NewPollingManualTriggerHandler(nil),
PollingPriority: admin.NewPriorityPollingHandler(nil, nil, nil),
Asset: admin.NewAssetHandler(nil, nil, nil, nil, nil, nil, nil),
AssetLifecycle: admin.NewAssetLifecycleHandler(nil),
AssetWallet: admin.NewAssetWalletHandler(nil),
WechatConfig: admin.NewWechatConfigHandler(nil),
PaymentMerchant: admin.NewPaymentMerchantHandler(nil),
EmployeeCollection: admin.NewEmployeeCollectionHandler(nil, nil, nil),
AgentRecharge: admin.NewAgentRechargeHandler(nil, nil),
Refund: admin.NewRefundHandler(nil),
OrderPackageInvalidate: admin.NewOrderPackageInvalidateHandler(nil),
AssetPackageBatchOrder: admin.NewAssetPackageBatchOrderHandler(nil, nil),
BusinessUserGroup: admin.NewBusinessUserGroupHandler(nil, nil),
ShopBusinessOwnerImport: admin.NewShopBusinessOwnerImportHandler(nil),
PhoneAssetAssociation: admin.NewPhoneAssetAssociationHandler(nil, nil),
PackageTrafficAlert: admin.NewPackageTrafficAlertHandler(nil, nil, nil, nil),
AssetAutoRenewal: admin.NewAssetAutoRenewalConfigHandler(nil, nil),
OperationsReport: admin.NewOperationsReportHandler(nil, nil, nil),
ClientWechat: app.NewClientWechatHandler(nil, nil, nil),
SuperAdmin: admin.NewSuperAdminHandler(nil),
SystemConfig: admin.NewSystemConfigHandler(nil, nil),
Audit: admin.NewAuditHandler(nil, nil),
WeCom: admin.NewWeComHandler(nil, nil),
AgentOpenAPI: openapiHandler.NewHandler(nil, nil),
}
}