
com.nbsaas.boot.pay.rest.convert.PayConfigResponseConvert Maven / Gradle / Ivy
package com.nbsaas.boot.pay.rest.convert;
import com.nbsaas.boot.pay.data.entity.PayConfig;
import com.nbsaas.boot.pay.api.domain.response.PayConfigResponse;
import com.nbsaas.boot.utils.BeanDataUtils;
import com.nbsaas.boot.rest.api.Converter;
/**
* 实体对象转化成响应对象
*/
public class PayConfigResponseConvert implements Converter {
@Override
public PayConfigResponse convert(PayConfig source) {
PayConfigResponse result = new PayConfigResponse();
BeanDataUtils.copyProperties(source, result);
if(source.getPayProvider()!=null){
result.setPayProvider(source.getPayProvider().getId());
}
if(source.getCreator()!=null){
result.setCreator(source.getCreator().getId());
}
if(source.getPayProvider()!=null){
result.setPayProviderName(source.getPayProvider().getName());
}
if(source.getPayType()!=null){
result.setPayTypeName(String.valueOf(source.getPayType()));
}
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy