**客服在线状态:** - 后端:添加 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>
47 lines
1.2 KiB
Go
47 lines
1.2 KiB
Go
package adminauth
|
|
|
|
import (
|
|
"time"
|
|
|
|
"hfb_sys/backend/internal/modules/auth"
|
|
)
|
|
|
|
type AdminDTO struct {
|
|
ID uint64 `json:"id"`
|
|
Username string `json:"username"`
|
|
Nickname string `json:"nickname"`
|
|
Status string `json:"status"`
|
|
SupportStatus string `json:"support_status"`
|
|
Roles []RoleDTO `json:"roles"`
|
|
Permissions []string `json:"permissions"`
|
|
LastLoginAt *time.Time `json:"last_login_at"`
|
|
}
|
|
|
|
type RoleDTO struct {
|
|
ID uint64 `json:"id"`
|
|
Code string `json:"code"`
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
type LoginRequest struct {
|
|
Username string `json:"username" binding:"required"`
|
|
Password string `json:"password" binding:"required"`
|
|
CaptchaID string `json:"captcha_id" binding:"required"`
|
|
CaptchaCode string `json:"captcha_code" binding:"required"`
|
|
}
|
|
|
|
type LoginResult struct {
|
|
Admin AdminDTO `json:"admin"`
|
|
Tokens auth.TokenPair `json:"tokens"`
|
|
}
|
|
|
|
type CaptchaDTO struct {
|
|
CaptchaID string `json:"captcha_id"`
|
|
Image string `json:"image"`
|
|
ExpiresIn int64 `json:"expires_in"`
|
|
}
|
|
|
|
type UpdateSupportStatusRequest struct {
|
|
Status string `json:"status" binding:"required,oneof=online offline busy"`
|
|
}
|