51 lines
1.2 KiB
Go
51 lines
1.2 KiB
Go
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)
|
|
}
|
|
|
|
func OpReviewTextAuditTaskBatch(ctx *gin.Context) {
|
|
req := ctx.MustGet("client_req").(*textaudittaskproto.OpReviewBatchReq)
|
|
|
|
ec := service.DefaultService.OpReviewTextAuditTaskBatch(ctx, req)
|
|
if ec != errcode.ErrCodeTextAuditTaskSrvOk {
|
|
logger.Error("OpPassTextAuditTaskBatch fail, req: %v, ec: %v", util.ToJson(req), ec)
|
|
ReplyErrCodeMsg(ctx, ec)
|
|
return
|
|
}
|
|
|
|
ReplyOk(ctx, nil)
|
|
}
|