com.dahuatech.icc.face.model.v202207.SDK.ItcPersonFeaturePageSDK Maven / Gradle / Ivy
The newest version!
package com.dahuatech.icc.face.model.v202207.SDK;
import com.dahuatech.hutool.log.Log;
import com.dahuatech.hutool.log.LogFactory;
import com.dahuatech.icc.exception.ClientException;
import com.dahuatech.icc.face.model.v202207.itcPersonFeature.ItcPersonFeaturePageRequest;
import com.dahuatech.icc.face.model.v202207.itcPersonFeature.ItcPersonFeaturePageResponse;
import com.dahuatech.icc.oauth.exception.BusinessException;
import com.dahuatech.icc.oauth.http.IccClient;
import com.dahuatech.icc.oauth.model.v202010.OauthConfigBaseInfo;
import com.dahuatech.icc.oauth.model.v202010.OauthConfigUserPwdInfo;
import com.dahuatech.icc.oauth.model.v202010.oSDK.OauthParamConstant;
/**
* program:java-sdk
*
* Author: 355079
* Date:2022-07-28 11:09
* Description: 人体特征记录分页查询
*/
public class ItcPersonFeaturePageSDK {
private static final Log logger = LogFactory.get();
/**
* 人像库修改
**/
public ItcPersonFeaturePageResponse ItcPersonFeaturePage(ItcPersonFeaturePageRequest request) {
ItcPersonFeaturePageResponse response = null;
try{
//基本校验
request.valid();
//业务校验
request.businessValid();
setUrl(request);
//业务逻辑处理
response = new IccClient(request.getOauthConfigBaseInfo()).doAction(request, request.getResponseClass());
}catch (BusinessException businessException){
logger.error("人体特征记录分页查询:{}",businessException,businessException.getMessage());
response = new ItcPersonFeaturePageResponse();
response.setCode(businessException.getCode());
response.setErrMsg(businessException.getErrorMsg());
response.setArgs(businessException.getArgs());
response.setSuccess(false);
}catch (Exception e){
logger.error("人体特征记录分页查询:{}",e,e.getMessage());
response = new ItcPersonFeaturePageResponse();
response.setErrMsg(OauthParamConstant.SYSTEME_RROR.getErrMsg());
response.setCode(OauthParamConstant.SYSTEME_RROR.getCode());
response.setSuccess(false);
}
return response;
}
public void setUrl(ItcPersonFeaturePageRequest request){
request.setUrl(request.getOauthConfigBaseInfo().getHttpConfigInfo().getPrefixUrl() + request.getUrl().substring(8));
request.setUrl(request.getUrl() + "?searchType=" + request.getSearchType());
if(request.getPageNum() != null){
request.setUrl(request.getUrl() + "&pageNum=" + request.getPageNum());
}
if(request.getPageSize() != null){
request.setUrl(request.getUrl() + "&pageSize=" + request.getPageSize());
}
if(request.getSearchKey() != null){
request.setUrl(request.getUrl() + "&searchKey=" + request.getSearchKey());
}
if(request.getStartTime() != null){
request.setUrl(request.getUrl() + "&startTime=" + request.getStartTime());
}
if(request.getEndTime() != null){
request.setUrl(request.getUrl() + "&endTime=" + request.getEndTime());
}
if(request.getChnIds() != null){
request.setUrl(request.getUrl() + "&chnIds=" + request.getChnIds());
}
if(request.getCoatColor() != null){
request.setUrl(request.getUrl() + "&coatColor=" + request.getCoatColor());
}
if(request.getCoatType() != null){
request.setUrl(request.getUrl() + "&coatType=" + request.getCoatType());
}
if(request.getTrousersColor() != null){
request.setUrl(request.getUrl() + "&trousersColor=" + request.getTrousersColor());
}
if(request.getTrousersType() != null){
request.setUrl(request.getUrl() + "&trousersType=" + request.getTrousersType());
}
if(request.getHasHat() != null){
request.setUrl(request.getUrl() + "&hasHat=" + request.getHasHat());
}
if(request.getHasBag() != null){
request.setUrl(request.getUrl() + "&hasBag=" + request.getHasBag());
}
if(request.getFeatures() != null){
request.setUrl(request.getUrl() + "&features=" + request.getFeatures());
}
if(request.getSex() != null){
request.setUrl(request.getUrl() + "&sex=" + request.getSex());
}
if(request.getAge() != null){
request.setUrl(request.getUrl() + "&age=" + request.getAge() );
}
if(request.getComplexion() != null){
request.setUrl(request.getUrl() + "&complexion=" + request.getComplexion());
}
if(request.getEye() != null){
request.setUrl(request.getUrl() + "&eye=" + request.getEye());
}
if(request.getMouth() != null){
request.setUrl(request.getUrl() + "&mouth=" + request.getMouth());
}
if(request.getMask() != null){
request.setUrl(request.getUrl() + "&mask=" + request.getMask());
}
if(request.getBeard() != null){
request.setUrl(request.getUrl() + "&beard=" + request.getBeard());
}
if(request.getAttractive() != null){
request.setUrl(request.getUrl() + "&attractive=" + request.getAttractive());
}
}
}