feat: add friend add and curfew controls

This commit is contained in:
richjohnrambo
2026-09-18 10:55:33 +08:00
parent 348cbcaf96
commit 7c8b4d9b7c
12 changed files with 270 additions and 1 deletions
@@ -93,6 +93,38 @@ type ModerationPolicyRes struct {
BlockMessage string `json:"block_message"`
}
type SecurityPolicyReq struct {
g.Meta `path:"/internal/im-config/tenants/{code}/security-policy" method:"get" tags:"IM内部配置" summary:"获取商户安全策略"`
Code string `json:"code" in:"path" dc:"商户编码"`
}
type SecurityPolicyRes struct {
TenantID int64 `json:"tenant_id"`
TenantCode string `json:"tenant_code"`
PolicyVersion uint `json:"policy_version"`
GlobalFriendEnabled bool `json:"global_friend_enabled"`
FriendDisabledPolicy map[string]interface{} `json:"friend_disabled_policy"`
MessageCurfewEnabled bool `json:"message_curfew_enabled"`
CurfewRules []*SecurityCurfewRuleRes `json:"curfew_rules"`
}
type SecurityCurfewRuleRes struct {
RuleCode string `json:"rule_code"`
RuleName string `json:"rule_name"`
DateType string `json:"date_type"`
CustomDates []string `json:"custom_dates"`
Weekdays []int `json:"weekdays"`
Timezone string `json:"timezone"`
StartTime string `json:"start_time"`
EndTime string `json:"end_time"`
Scope string `json:"scope"`
WhitelistUserIds []string `json:"whitelist_user_ids"`
WhitelistGroupIds []string `json:"whitelist_group_ids"`
Message string `json:"message"`
Status int `json:"status"`
Sort int `json:"sort"`
}
type SensitiveWordsReq struct {
g.Meta `path:"/internal/im-config/tenants/{code}/sensitive-words" method:"get" tags:"IM内部配置" summary:"获取商户有效敏感词"`
Code string `json:"code" in:"path" dc:"商户编码"`