feat: 添加客服在线状态和聊天粘贴图片功能

**客服在线状态:**
- 后端:添加 admin_users.support_status 字段(online/offline/busy)
- 接口:PUT /admin/me/support-status 更新状态
- 前端:管理员顶部导航显示状态切换器(仅客服权限可见)
- 转接对话框显示客服在线状态和智能排序(在线优先)

**聊天粘贴图片:**
- 用户端、移动端、管理端聊天输入框支持 Ctrl+V/Cmd+V 直接粘贴图片
- 自动调用图片压缩和上传逻辑,与文件选择上传保持一致
- 最多支持粘贴9张图片

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
yml
2026-06-05 19:23:34 +08:00
co-authored by Claude Opus 4.6
parent b380817940
commit 59093f8fd5
18 changed files with 308 additions and 36 deletions
+9 -8
View File
@@ -3,14 +3,15 @@ package model
import "time"
type AdminUser struct {
ID uint64 `gorm:"primaryKey" json:"id"`
Username string `gorm:"size:64;not null;uniqueIndex" json:"username"`
PasswordHash string `gorm:"size:255;not null" json:"-"`
Nickname string `gorm:"size:64;not null;default:''" json:"nickname"`
Status string `gorm:"size:32;not null;default:'active'" json:"status"`
LastLoginAt *time.Time `json:"last_login_at"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ID uint64 `gorm:"primaryKey" json:"id"`
Username string `gorm:"size:64;not null;uniqueIndex" json:"username"`
PasswordHash string `gorm:"size:255;not null" json:"-"`
Nickname string `gorm:"size:64;not null;default:''" json:"nickname"`
Status string `gorm:"size:32;not null;default:'active'" json:"status"`
SupportStatus string `gorm:"size:16;not null;default:'offline';index" json:"support_status"`
LastLoginAt *time.Time `json:"last_login_at"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func (AdminUser) TableName() string {