service/app/mix/controller/textaudittask_op.go

51 lines
1.2 KiB
Go
Raw Permalink Normal View History

2023-12-21 22:17:40 +08:00
package controller
import (
"service/api/consts"
"service/api/errcode"
textaudittaskproto "service/api/proto/textaudittask/proto"
"service/app/mix/service"
"service/bizcommon/util"
"service/library/logger"
"github.com/gin-gonic/gin"
)
func OpGetTextAuditTaskList(ctx *gin.Context) {
req := ctx.MustGet("client_req").(*textaudittaskproto.OpListReq)
//设置默认页长
if req.Limit == 0 {
req.Limit = consts.DefaultPageSize
}
list, ec := service.DefaultService.OpGetTextAuditTaskVOList(ctx, req)
if ec != errcode.ErrCodeTextAuditTaskSrvOk {
logger.Error("OpGetTextAuditTaskList fail, req: %v, ec: %v", util.ToJson(req), ec)
ReplyErrCodeMsg(ctx, ec)
return
}
data := &textaudittaskproto.OpListData{
List: list,
Offset: req.Offset + len(list),
}
if len(list) >= req.Limit {
data.More = 1
}
ReplyOk(ctx, data)
}
2024-07-17 12:01:56 +08:00
func OpReviewTextAuditTaskBatch(ctx *gin.Context) {
req := ctx.MustGet("client_req").(*textaudittaskproto.OpReviewBatchReq)
2023-12-21 22:17:40 +08:00
2024-07-17 12:01:56 +08:00
ec := service.DefaultService.OpReviewTextAuditTaskBatch(ctx, req)
2023-12-21 22:17:40 +08:00
if ec != errcode.ErrCodeTextAuditTaskSrvOk {
logger.Error("OpPassTextAuditTaskBatch fail, req: %v, ec: %v", util.ToJson(req), ec)
ReplyErrCodeMsg(ctx, ec)
return
}
ReplyOk(ctx, nil)
}