entinfologic.go 1.5 KB

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