123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- package logic
- import (
- "context"
- "bp.jydev.jianyu360.cn/BaseService/userCenter/api/internal/svc"
- "bp.jydev.jianyu360.cn/BaseService/userCenter/api/internal/types"
- "bp.jydev.jianyu360.cn/BaseService/userCenter/entity"
- . "bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/usercenter"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type UserIdentityLogic struct {
- logx.Logger
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- func NewUserIdentityLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserIdentityLogic {
- return &UserIdentityLogic{
- Logger: logx.WithContext(ctx),
- ctx: ctx,
- svcCtx: svcCtx,
- }
- }
- func (l *UserIdentityLogic) UserIdentity(req *types.UserIdentityReq) (resp *types.Resp, err error) {
- res, err := entity.UserCenterRpc.UserIdentity(l.ctx, &UserIdentityReq{
- AppId: req.AppId,
- EntId: req.EntId,
- BaseUserId: req.NewUserId,
- })
- status := 0
- if res != nil && res.ErrorMsg == "" {
- status = 1
- }
- return &types.Resp{
- Error_code: res.ErrorCode,
- Error_msg: res.ErrorMsg,
- Data: map[string]interface{}{
- "personId": res.PersonId,
- "userName": res.UserName,
- "userAccountId": res.UserAccountId,
- "entAccountId": res.EntAccountId,
- "entUserAccountId": res.EntUserAccountId,
- "userPositionId": res.UserPositionId,
- "entUserPositionId": res.EntUserPositionId,
- "status": status,
- },
- }, err
- }
|