优化线下提号利润修改
This commit is contained in:
@@ -64,6 +64,30 @@ func (h *Handler) Complete(c *gin.Context) {
|
||||
response.OK(c, item)
|
||||
}
|
||||
|
||||
// UpdateProfit 修改提号中的线下利润(管理员)
|
||||
func (h *Handler) UpdateProfit(c *gin.Context) {
|
||||
adminID, ok := currentAdminID(c)
|
||||
if !ok {
|
||||
response.Unauthorized(c, "缺少管理员上下文")
|
||||
return
|
||||
}
|
||||
id, ok := parseID(c)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
var req UpdateProfitRequest
|
||||
if err := c.ShouldBindJSON(&req); err != nil {
|
||||
response.BadRequest(c, "利润金额不正确")
|
||||
return
|
||||
}
|
||||
item, err := h.service.UpdateProfit(c.Request.Context(), id, req, adminID, auditMeta(c))
|
||||
if err != nil {
|
||||
writePickupError(c, err)
|
||||
return
|
||||
}
|
||||
response.OK(c, item)
|
||||
}
|
||||
|
||||
// Cancel 取消提号(管理员)
|
||||
func (h *Handler) Cancel(c *gin.Context) {
|
||||
adminID, ok := currentAdminID(c)
|
||||
|
||||
Reference in New Issue
Block a user