代码拉取完成,页面将自动刷新
package opslogic
import (
"context"
"gitee.com/unitedrhino/core/service/syssvr/internal/logic"
"gitee.com/unitedrhino/core/service/syssvr/internal/repo/relationDB"
"gitee.com/unitedrhino/core/service/syssvr/internal/svc"
"gitee.com/unitedrhino/core/service/syssvr/pb/sys"
"gitee.com/unitedrhino/share/stores"
"gitee.com/unitedrhino/share/utils"
"github.com/zeromicro/go-zero/core/logx"
)
type OpsWorkOrderIndexLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewOpsWorkOrderIndexLogic(ctx context.Context, svcCtx *svc.ServiceContext) *OpsWorkOrderIndexLogic {
return &OpsWorkOrderIndexLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *OpsWorkOrderIndexLogic) OpsWorkOrderIndex(in *sys.OpsWorkOrderIndexReq) (*sys.OpsWorkOrderIndexResp, error) {
f := relationDB.OpsWorkOrderFilter{Status: in.Status, AreaID: in.AreaID, Type: in.Type, Number: in.Number}
total, err := relationDB.NewOpsWorkOrderRepo(l.ctx).CountByFilter(l.ctx, f)
if err != nil {
return nil, err
}
list, err := relationDB.NewOpsWorkOrderRepo(l.ctx).FindByFilter(l.ctx, f, logic.ToPageInfo(in.Page).WithDefaultOrder(stores.OrderBy{
Field: "createdTime",
Sort: stores.OrderDesc,
}))
if err != nil {
return nil, err
}
return &sys.OpsWorkOrderIndexResp{List: utils.CopySlice[sys.OpsWorkOrder](list), Total: total}, nil
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。