提交1: 数据层改造 - 发布群与企业微信群二维码

- 新增数据库迁移 000008: chat_conversations 增加 listing_id, 新建 chat_qrcode_pool 表
- 更新 GORM 模型: ChatConversation 新增 ListingID 字段, 新增 ChatQrCode 模型
- 实现二维码池管理后端 API: 创建/列表/统计/更新/删除
- 新增管理后台路由: /api/admin/chats/qrcodes
- 新增系统配置: chat.listing_group_welcome, chat.qrcode_low_stock_threshold
- 更新优化方案文档: 废弃双群方案, 采用单群方案

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
yml
2026-06-17 15:57:10 +08:00
co-authored by Claude Opus 4.8
parent 87483ea6a8
commit 423c142967
7 changed files with 989 additions and 1 deletions
+7
View File
@@ -546,6 +546,13 @@ func New(cfg config.Config, deps Dependencies, logger *zap.Logger) *gin.Engine {
adminRoutes.GET("/chats/auto-welcome", requirePerm("system_config:view"), chatHandler.AdminGetAutoWelcome)
adminRoutes.PUT("/chats/auto-welcome", requirePerm("system_config:update"), chatHandler.AdminUpdateAutoWelcome)
// 二维码池管理
adminRoutes.POST("/chats/qrcodes", requirePerm("chat:manage"), chatHandler.CreateQrCodeHandler)
adminRoutes.GET("/chats/qrcodes", requirePerm("chat:view"), chatHandler.ListQrCodesHandler)
adminRoutes.GET("/chats/qrcodes/stats", requirePerm("chat:view"), chatHandler.GetQrCodeStatsHandler)
adminRoutes.PATCH("/chats/qrcodes/:id", requirePerm("chat:manage"), chatHandler.UpdateQrCodeHandler)
adminRoutes.DELETE("/chats/qrcodes/:id", requirePerm("chat:manage"), chatHandler.DeleteQrCodeHandler)
// 角色管理
adminRoutes.GET("/roles", requirePerm("role:manage"), adminRoleHandler.List)
adminRoutes.GET("/roles/:id", requirePerm("role:manage"), adminRoleHandler.FindByID)