public ApiResult <IEnumerable <ApplicantResp> > List(SearchApplicantReqs request) { try { SearchApplicantCondition search = Mapper.Map <SearchApplicantReqs, SearchApplicantCondition>(request); IEnumerable <ApplicantInfo> applicants = _applicantQueryService.Query(search); return(new ApiResult <IEnumerable <ApplicantResp> >(ResultStatus.SUCCESS, Mapper.Map <ApplicantInfo, ApplicantResp>(applicants))); } catch (Exception ex) { _logger.LogError("查询报名者异常", ex); return(new ApiResult <IEnumerable <ApplicantResp> >(ResultStatus.EXCEPTION, Enumerable.Empty <ApplicantResp>(), ex.Message)); } }
public ApiResult <PagedData <ApplicantResp> > SearchApplicant(SearchApplicantReqs request) { try { SearchApplicantCondition search = Mapper.Map <SearchApplicantReqs, SearchApplicantCondition>(request); PagedData <ApplicantInfo> applicant = _applicantQueryService.QueryPaged(search); return(new ApiResult <PagedData <ApplicantResp> >(ResultStatus.SUCCESS, Mapper.Map <PagedData <ApplicantInfo>, PagedData <ApplicantResp> >(applicant))); } catch (Exception ex) { _logger.LogError("查询报名者异常", ex); return(new ApiResult <PagedData <ApplicantResp> >(ResultStatus.EXCEPTION, new PagedData <ApplicantResp>(), ex.Message)); } }