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/pb" "github.com/zeromicro/go-zero/core/logx" ) type ExamineListLogic struct { logx.Logger ctx context.Context svcCtx *svc.ServiceContext } func NewExamineListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ExamineListLogic { return &ExamineListLogic{ Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx, } } func (l *ExamineListLogic) ExamineList(req *types.ExamineListReq) (resp *types.ExamineListResp, err error) { // todo: add your logic here and delete this line res, err := entity.UserCenterRpc.ExamineList(l.ctx, &pb.ExamineListReq{ Name: req.Name, AuthPhone: req.AuthPhone, RegPhone: req.RegPhone, AuthType: req.AuthType, AuthStartTime: req.AuthStartTime, AuthEndTime: req.AuthEndTime, PageNum: req.PageNum, PageSize: req.PageSize, }) list := []*types.ExamineList{} for _, v := range res.Data.List { list = append(list, &types.ExamineList{ Id: v.Id, //机构id EntId: v.EntId, //企业id ComPanyType: v.ComPanyType, // 机构性质 1企业 2党政机关事业单位及其他 Name: v.Name, //机构名称 CreditCode: v.CreditCode, //统一社会信用代码 AuthPhone: v.AuthPhone, //联系人手机号 ApplyTime: v.ApplyTime, //申请时间戳 AuthType: v.AuthType, //审核状态 1:待审核 2:审核通过 3:审核不通过 RegPhone: v.RegPhone, }) } data := types.ExamineListData{ Count: res.Data.Count, PageSize: res.Data.PageSize, List: list, } return &types.ExamineListResp{ Error_code: res.ErrorCode, Error_msg: res.ErrorMsg, Data: data, }, err }