- 做了什么: - 新增客服手动录单数据库迁移 000084 及对应模型,支持编号唯一校验、客服快照绑定与 CRUD 操作; - 后端提供 csmanualentry 业务模块及相关 API,并在仪表盘摘要中聚合今日各客服录单数量; - 前端增加客服手动录单视图页面、路由与侧边栏导航,支持录单二次确认与细粒度权限控制; - 管理后台仪表盘增加今日客服手动录单卡片展示。 - 为什么: - 满足客服在后台手动登记外部业务编号需求,并便于运营按客服统计今日录单业绩和追溯对账。 - 验证方式: - 执行后端全量测试 go test ./... 与静态检查 go vet ./... 全部通过; - 执行前端代码门禁 npm run check 与 vite build 全部通过; - 执行 goose down/up 迁移回滚与应用测试通过,角色权限分配正确; - 本地 dev 联调 POST /api/admin/manual-entries 录单成功返回 201。
59 lines
1.5 KiB
Go
59 lines
1.5 KiB
Go
package csmanualentry
|
|
|
|
import "time"
|
|
|
|
// CreateRequest 客服手动录单请求。
|
|
type CreateRequest struct {
|
|
EntryNo string `json:"entry_no" binding:"required"`
|
|
Remark string `json:"remark"`
|
|
}
|
|
|
|
// UpdateRequest 管理员修正录单请求。
|
|
type UpdateRequest struct {
|
|
EntryNo string `json:"entry_no" binding:"required"`
|
|
Remark string `json:"remark"`
|
|
}
|
|
|
|
// EntryDTO 录单记录。
|
|
type EntryDTO struct {
|
|
ID uint64 `json:"id"`
|
|
EntryNo string `json:"entry_no"`
|
|
AdminID uint64 `json:"admin_id"`
|
|
AdminName string `json:"admin_name"`
|
|
AdminUsername string `json:"admin_username"`
|
|
Remark string `json:"remark"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
}
|
|
|
|
// ListQuery 录单查询条件。
|
|
type ListQuery struct {
|
|
EntryNo string
|
|
Keyword string
|
|
AdminID uint64
|
|
StartDate string // YYYY-MM-DD(北京时间,闭区间)
|
|
EndDate string // YYYY-MM-DD(北京时间,闭区间)
|
|
Page int
|
|
PageSize int
|
|
}
|
|
|
|
// PaginatedResult 分页结果。
|
|
type PaginatedResult struct {
|
|
Items []EntryDTO `json:"items"`
|
|
Total int64 `json:"total"`
|
|
Page int `json:"page"`
|
|
PageSize int `json:"page_size"`
|
|
}
|
|
|
|
// AgentDayStatsDTO 某客服某日录单统计。
|
|
type AgentDayStatsDTO struct {
|
|
Date string `json:"date"` // YYYY-MM-DD(北京时间)
|
|
AdminID uint64 `json:"admin_id"`
|
|
AdminName string `json:"admin_name"`
|
|
Count int64 `json:"count"`
|
|
}
|
|
|
|
// CreateResult 录单结果。
|
|
type CreateResult struct {
|
|
Entry EntryDTO `json:"entry"`
|
|
}
|