新增客服一键交接功能
This commit is contained in:
@@ -99,6 +99,28 @@ func (h *Handler) AdminPlatformHandoff(c *gin.Context) {
|
||||
response.Created(c, record)
|
||||
}
|
||||
|
||||
func (h *Handler) AdminForceHandoff(c *gin.Context) {
|
||||
adminID, ok := currentAdminID(c)
|
||||
if !ok {
|
||||
response.Unauthorized(c, "缺少管理员上下文")
|
||||
return
|
||||
}
|
||||
id, ok := parseID(c)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
var req ForceHandoffRequest
|
||||
if err := c.ShouldBindJSON(&req); err != nil {
|
||||
response.BadRequest(c, "操作原因不能为空")
|
||||
return
|
||||
}
|
||||
if err := h.service.AdminForceHandoff(c.Request.Context(), adminID, id, req, auditMeta(c)); err != nil {
|
||||
writeOrderError(c, err)
|
||||
return
|
||||
}
|
||||
response.OK(c, gin.H{"received": true})
|
||||
}
|
||||
|
||||
func (h *Handler) AdminPlatformCheckoutConfirm(c *gin.Context) {
|
||||
h.adminAction(c, h.service.AdminPlatformCheckoutConfirm, gin.H{"confirmed": true})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user