chore(init): 初始化解忧商行项目并完成 Phase 0 基座
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
package csmanualentry
|
||||
|
||||
import "time"
|
||||
|
||||
// 录单选项类型。
|
||||
const (
|
||||
OptionTypePlatform = "platform" // 平台
|
||||
OptionTypeOperator = "operator" // 操作人
|
||||
)
|
||||
|
||||
// CreateRequest 客服手动录单请求。
|
||||
type CreateRequest struct {
|
||||
EntryNo string `json:"entry_no" binding:"required"`
|
||||
Platform string `json:"platform"`
|
||||
Operator string `json:"operator"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
// UpdateRequest 管理员修正录单请求。
|
||||
type UpdateRequest struct {
|
||||
EntryNo string `json:"entry_no" binding:"required"`
|
||||
Platform string `json:"platform"`
|
||||
Operator string `json:"operator"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
// EntryDTO 录单记录。
|
||||
type EntryDTO struct {
|
||||
ID uint64 `json:"id"`
|
||||
EntryNo string `json:"entry_no"`
|
||||
Platform string `json:"platform"`
|
||||
Operator string `json:"operator"`
|
||||
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"`
|
||||
}
|
||||
|
||||
// OptionDTO 录单可选项(平台 / 操作人)。
|
||||
type OptionDTO struct {
|
||||
ID uint64 `json:"id"`
|
||||
Type string `json:"type"`
|
||||
Name string `json:"name"`
|
||||
SortOrder int `json:"sort_order"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
// OptionListDTO 平台与操作人选项集合,供录单表单下拉直接使用。
|
||||
type OptionListDTO struct {
|
||||
Platforms []OptionDTO `json:"platforms"`
|
||||
Operators []OptionDTO `json:"operators"`
|
||||
}
|
||||
|
||||
// CreateOptionRequest 新增平台 / 操作人选项。
|
||||
type CreateOptionRequest struct {
|
||||
Type string `json:"type" binding:"required"`
|
||||
Name string `json:"name" binding:"required"`
|
||||
}
|
||||
|
||||
// UpdateOptionRequest 重命名平台 / 操作人选项。
|
||||
type UpdateOptionRequest struct {
|
||||
Name string `json:"name" binding:"required"`
|
||||
}
|
||||
Reference in New Issue
Block a user