package logic import ( "context" "git.i2edu.net/i2/i2-bill-erp/internal/svc" "git.i2edu.net/i2/i2-bill-erp/transform" "git.i2edu.net/i2/go-zero/core/logx" ) type GetErpUserLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } func NewGetErpUserLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetErpUserLogic { return &GetErpUserLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } // 查看erp用户是否正常 func (l *GetErpUserLogic) GetErpUser(in *transform.ErpUserReq) (*transform.ErpUserRes, error) { findOne, err := l.svcCtx.SysUserModel.FindOrgById(in.ErpId) if err != nil { return nil, err } res := &transform.ErpUserRes{} if findOne == nil { return res, nil } if findOne.OsId != 0 { res.OsId = findOne.OsId res.OsName = findOne.OsName } return res, nil }