examinelistlogic.go 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 ExamineListLogic struct {
  11. logx.Logger
  12. ctx context.Context
  13. svcCtx *svc.ServiceContext
  14. }
  15. func NewExamineListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ExamineListLogic {
  16. return &ExamineListLogic{
  17. Logger: logx.WithContext(ctx),
  18. ctx: ctx,
  19. svcCtx: svcCtx,
  20. }
  21. }
  22. func (l *ExamineListLogic) ExamineList(req *types.ExamineListReq) (resp *types.ExamineListResp, err error) {
  23. // todo: add your logic here and delete this line
  24. res, err := entity.UserCenterRpc.ExamineList(l.ctx, &pb.ExamineListReq{
  25. Name: req.Name,
  26. AuthPhone: req.AuthPhone,
  27. RegPhone: req.RegPhone,
  28. AuthType: req.AuthType,
  29. AuthStartTime: req.AuthStartTime,
  30. AuthEndTime: req.AuthEndTime,
  31. PageNum: req.PageNum,
  32. PageSize: req.PageSize,
  33. })
  34. list := []*types.ExamineList{}
  35. for _, v := range res.Data.List {
  36. list = append(list, &types.ExamineList{
  37. Id: v.Id, //机构id
  38. EntId: v.EntId, //企业id
  39. ComPanyType: v.ComPanyType, // 机构性质 1企业 2党政机关事业单位及其他
  40. Name: v.Name, //机构名称
  41. CreditCode: v.CreditCode, //统一社会信用代码
  42. AuthPhone: v.AuthPhone, //联系人手机号
  43. ApplyTime: v.ApplyTime, //申请时间戳
  44. AuthType: v.AuthType, //审核状态 1:待审核 2:审核通过 3:审核不通过
  45. RegPhone: v.RegPhone,
  46. })
  47. }
  48. data := types.ExamineListData{
  49. Count: res.Data.Count,
  50. PageSize: res.Data.PageSize,
  51. List: list,
  52. }
  53. return &types.ExamineListResp{
  54. Error_code: res.ErrorCode,
  55. Error_msg: res.ErrorMsg,
  56. Data: data,
  57. }, err
  58. }