123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- 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,
- })
- return &types.CommonResp{
- Error_code: res.ErrorCode,
- Error_msg: res.ErrorMsg,
- Data: map[string]interface{}{
- "list": res.Data,
- "num": res.CommonlySize,
- },
- }, err
- }
|