|
@@ -28,11 +28,10 @@ func NewGetApiSopTaskListLogic(ctx context.Context, svcCtx *svc.ServiceContext)
|
|
|
return &GetApiSopTaskListLogic{
|
|
|
Logger: logx.WithContext(ctx),
|
|
|
ctx: ctx,
|
|
|
- svcCtx: svcCtx,
|
|
|
- }
|
|
|
+ svcCtx: svcCtx}
|
|
|
}
|
|
|
|
|
|
-func (l *GetApiSopTaskListLogic) GetApiSopTaskList(r *http.Request) (*types.SopTaskListResp, error) {
|
|
|
+func (l *GetApiSopTaskListLogic) GetApiSopTaskList(req *types.SopApiListReq, r *http.Request) (*types.SopTaskListResp, error) {
|
|
|
tokenStr := r.Header.Get("Authorization")
|
|
|
token, err := hook.CheckDesktopAuth(tokenStr, l.svcCtx.DB)
|
|
|
if err != nil {
|
|
@@ -42,7 +41,7 @@ func (l *GetApiSopTaskListLogic) GetApiSopTaskList(r *http.Request) (*types.SopT
|
|
|
var predicates []predicate.SopTask
|
|
|
predicates = append(predicates, soptask.OrganizationIDEQ(token.OrganizationID))
|
|
|
predicates = append(predicates, soptask.StatusEQ(uint8(3)))
|
|
|
- data, err := l.svcCtx.DB.SopTask.Query().Where(predicates...).Page(l.ctx, 1, 1000)
|
|
|
+ data, err := l.svcCtx.DB.SopTask.Query().Where(predicates...).Page(l.ctx, req.Page, req.PageSize)
|
|
|
|
|
|
if err != nil {
|
|
|
return nil, dberrorhandler.DefaultEntError(l.Logger, err, nil)
|