package logic import ( "context" "net/http" "strings" MC "app.yhyue.com/moapp/jybase/common" "bp.jydev.jianyu360.cn/BaseService/userCenter/api/internal/config" "bp.jydev.jianyu360.cn/BaseService/userCenter/entity" "bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/pb" "bp.jydev.jianyu360.cn/BaseService/userCenter/api/internal/svc" "bp.jydev.jianyu360.cn/BaseService/userCenter/api/internal/types" "github.com/zeromicro/go-zero/core/logx" ) type WorkDesktopComprehensiveLogic struct { logx.Logger ctx context.Context svcCtx *svc.ServiceContext r *http.Request } func NewWorkDesktopComprehensiveLogic(ctx context.Context, svcCtx *svc.ServiceContext, r *http.Request) *WorkDesktopComprehensiveLogic { return &WorkDesktopComprehensiveLogic{ Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx, r: r, } } func (l *WorkDesktopComprehensiveLogic) WorkDesktopComprehensive(req *types.WorkDesktopComprehensiveReq) (resp *types.CommonResp, err error) { if req.Platform == "H5" { req.Platform = "APP" } res, err := entity.UserCenterRpc.WorkDesktopComprehensive(l.ctx, &pb.WorkDesktopComprehensiveReq{ AppId: req.AppId, UserId: req.UserId, Phone: req.Phone, Platform: req.Platform, MenuIds: req.MenuIds, MenuMode: req.MenuMode, ActionMode: req.ActionMode, NewUserId: req.NewUserId, EntId: req.EntId, EntUserId: req.EntUserId, IntranetBool: MC.If(config.C.IntranetName != "" && strings.Contains(l.r.Referer(), config.C.IntranetName), true, false).(bool), AccountId: req.AccountId, EntAccountId: req.EntAccountId, PositionId: req.PositionId, PositionType: req.PositionType, MgoUserId: req.MgoUserId, EntNicheDis: req.EntNicheDis, EntUserRole: req.EntUserRole, }) return &types.CommonResp{ Error_code: res.ErrorCode, Error_msg: res.ErrorMsg, Data: map[string]interface{}{ "list": res.Data, "num": res.CommonlySize, }, }, err }