feat: 添加举报功能支持
Some checks failed
Build Backend / build (push) Failing after 5m19s
Build Backend / build-docker (push) Has been skipped

- 新增 Report 数据模型、DTO、Repository、Service 层
- 实现用户端举报 API (POST /api/v1/reports)
- 实现管理端举报管理 API (列表、详情、处理、批量处理)
- 添加举报自动隐藏机制(达到阈值自动隐藏内容)
- 集成系统通知(举报处理结果通知)
- 更新路由和 Wire 依赖注入配置

Made-with: Cursor
This commit is contained in:
lafay
2026-03-29 20:18:36 +08:00
parent 2205b8ad04
commit 5f7b02ee8e
16 changed files with 1426 additions and 0 deletions

View File

@@ -30,6 +30,7 @@ type Config struct {
Encryption EncryptionConfig `mapstructure:"encryption"`
HotRank HotRankConfig `mapstructure:"hot_rank"`
WebRTC WebRTCConfig `mapstructure:"webrtc"`
Report ReportConfig `mapstructure:"report"`
}
// Load 加载配置文件
@@ -155,6 +156,8 @@ func Load(configPath string) (*Config, error) {
viper.SetDefault("webrtc.ice_servers", []map[string]interface{}{
{"urls": []string{"stun:stun.l.google.com:19302"}},
})
// Report 默认值
viper.SetDefault("report.auto_hide_threshold", 3)
if err := viper.ReadInConfig(); err != nil {
return nil, fmt.Errorf("failed to read config: %w", err)

View File

@@ -0,0 +1,7 @@
package config
// ReportConfig 举报配置
type ReportConfig struct {
// AutoHideThreshold 自动隐藏阈值(举报次数达到此数值时自动隐藏内容)
AutoHideThreshold int `mapstructure:"auto_hide_threshold"`
}