feat(ops): 总部可按百分比限制接口放行并开关企微通知

线上需要按账户、用户和功能控制登录与加载成功率,同时单独停发订单、核销和账单通知。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-26 12:04:16 +08:00
parent 674b6ac31b
commit cb63d382ad
29 changed files with 1888 additions and 18 deletions
+19
View File
@@ -469,6 +469,25 @@ model SystemConfig {
@@map("system_config")
}
/// HQ 接口访问:成功百分比与企微通知总开关(v4.0.21)
model ApiAccessPolicy {
id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
kind String @db.VarChar(16)
featureKey String @default("") @map("feature_key") @db.VarChar(32)
scopeType String @map("scope_type") @db.VarChar(16)
actorType String @default("") @map("actor_type") @db.VarChar(16)
actorId BigInt @default(0) @map("actor_id") @db.UnsignedBigInt
successPercent Int? @map("success_percent")
errorKind String? @map("error_kind") @db.VarChar(32)
enabled Boolean @default(true)
createdAt DateTime @default(now()) @map("created_at") @db.DateTime(3)
updatedAt DateTime @updatedAt @map("updated_at") @db.DateTime(3)
@@unique([kind, featureKey, scopeType, actorType, actorId], map: "api_access_policy_key")
@@index([kind, scopeType])
@@map("api_access_policy")
}
/// 企业微信智能机器人(HQ 可创建多实例,长连接)
model WecomBot {
id BigInt @id @default(autoincrement()) @db.UnsignedBigInt