entinfologic.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package logic
  2. import (
  3. "context"
  4. "log"
  5. "bp.jydev.jianyu360.cn/BaseService/userCenter/api/internal/svc"
  6. "bp.jydev.jianyu360.cn/BaseService/userCenter/api/internal/types"
  7. "bp.jydev.jianyu360.cn/BaseService/userCenter/entity"
  8. "bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/pb"
  9. "github.com/zeromicro/go-zero/core/logx"
  10. )
  11. type EntInfoLogic struct {
  12. logx.Logger
  13. ctx context.Context
  14. svcCtx *svc.ServiceContext
  15. }
  16. func NewEntInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *EntInfoLogic {
  17. return &EntInfoLogic{
  18. Logger: logx.WithContext(ctx),
  19. ctx: ctx,
  20. svcCtx: svcCtx,
  21. }
  22. }
  23. func (l *EntInfoLogic) EntInfo(req *types.CheckEntReq) (resp *types.EntInfoResp, err error) {
  24. // todo: add your logic here and delete this line
  25. log.Println("----------<", req)
  26. res, err := entity.UserCenterRpc.EntInfo(l.ctx, &pb.CheckEntReq{
  27. EntId: req.EntId,
  28. })
  29. data := &types.EntInfo{
  30. Name: res.Data.Name,
  31. OrganizationType: res.Data.OrganizationType,
  32. CreditCode: res.Data.CreditCode,
  33. CompanyType: res.Data.CompanyType,
  34. AreaNumber: res.Data.AreaNumber,
  35. Business: res.Data.Business,
  36. OfficialLetter: res.Data.OfficialLetter,
  37. AuthStartTime: res.Data.AuthStartTime,
  38. AuthEndTime: res.Data.AuthEndTime,
  39. ForzenStatus: res.Data.ForzenStatus,
  40. AuthState: res.Data.AuthState,
  41. ContactPerson: res.Data.ContactPerson,
  42. ContactPhone: res.Data.ContactPhone,
  43. AuthType: res.Data.AuthType,
  44. }
  45. return &types.EntInfoResp{
  46. Error_code: res.ErrorCode,
  47. Error_msg: res.ErrorMsg,
  48. Data: data,
  49. }, err
  50. }