entinfologic.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package logic
  2. import (
  3. "context"
  4. "userCenter/api/internal/svc"
  5. "userCenter/api/internal/types"
  6. "userCenter/entity"
  7. "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. SubmitTime: res.Data.CreateTime,
  43. AuthReason: res.Data.AuthReason,
  44. }
  45. return &types.EntInfoResp{
  46. Error_code: res.ErrorCode,
  47. Error_msg: res.ErrorMsg,
  48. Data: data,
  49. }, err
  50. }