mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-11-04 20:28:44 +08:00 
			
		
		
		
	mall + trade:code review 快递客户端的实现,没啥问题咧,搞下单测就 ok 拉
This commit is contained in:
		@@ -8,13 +8,14 @@ import org.springframework.context.annotation.Configuration;
 | 
			
		||||
import org.springframework.web.client.RestTemplate;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 快递客户端端配置类, 提供快递客户端工厂,默认的快递客户端实现
 | 
			
		||||
 * 快递客户端端配置类:
 | 
			
		||||
 *
 | 
			
		||||
 * 1. 快递客户端工厂 {@link ExpressClientFactory}
 | 
			
		||||
 * 2. 默认的快递客户端实现 {@link ExpressClient}
 | 
			
		||||
 *
 | 
			
		||||
 * @author jason
 | 
			
		||||
 */
 | 
			
		||||
@Configuration(
 | 
			
		||||
        proxyBeanMethods = false
 | 
			
		||||
)
 | 
			
		||||
@Configuration(proxyBeanMethods = false)
 | 
			
		||||
public class ExpressClientConfig {
 | 
			
		||||
 | 
			
		||||
    @Bean
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
package cn.iocoder.yudao.module.trade.framework.delivery.config;
 | 
			
		||||
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.ExpressClientEnum;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.enums.ExpressClientEnum;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import org.springframework.boot.context.properties.ConfigurationProperties;
 | 
			
		||||
import org.springframework.stereotype.Component;
 | 
			
		||||
@@ -27,6 +27,7 @@ public class TradeExpressProperties {
 | 
			
		||||
     * 默认不提供,需要提醒用户配置一个快递服务商。
 | 
			
		||||
     */
 | 
			
		||||
    private ExpressClientEnum client = ExpressClientEnum.NOT_PROVIDE;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 快递鸟配置
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
package cn.iocoder.yudao.module.trade.framework.delivery.core.client;
 | 
			
		||||
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.ExpressQueryReqDTO;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.ExpressQueryRespDTO;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.ExpressTrackQueryReqDTO;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.ExpressTrackRespDTO;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
@@ -18,6 +18,6 @@ public interface ExpressClient {
 | 
			
		||||
     * @param reqDTO 查询请求参数
 | 
			
		||||
     */
 | 
			
		||||
    // TODO @jason:返回字段可以参考 https://doc.youzanyun.com/detail/API/0/5 响应的 data
 | 
			
		||||
    List<ExpressQueryRespDTO> getExpressTrackList(ExpressQueryReqDTO reqDTO);
 | 
			
		||||
    List<ExpressTrackRespDTO> getExpressTrackList(ExpressTrackQueryReqDTO reqDTO);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,9 @@
 | 
			
		||||
package cn.iocoder.yudao.module.trade.framework.delivery.core.client;
 | 
			
		||||
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.enums.ExpressClientEnum;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 快递客户端工厂接口,快递客户端工厂:用于创建和缓存快递客户端
 | 
			
		||||
 * 快递客户端工厂接口:用于创建和缓存快递客户端
 | 
			
		||||
 *
 | 
			
		||||
 * @author jason
 | 
			
		||||
 */
 | 
			
		||||
@@ -19,5 +21,4 @@ public interface ExpressClientFactory {
 | 
			
		||||
     */
 | 
			
		||||
    ExpressClient getOrCreateExpressClient(ExpressClientEnum clientEnum);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
package cn.iocoder.yudao.module.trade.framework.delivery.core.client.convert;
 | 
			
		||||
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.ExpressQueryReqDTO;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.ExpressQueryRespDTO;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.ExpressTrackQueryReqDTO;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.ExpressTrackRespDTO;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.kd100.Kd100ExpressQueryReqDTO;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.kd100.Kd100ExpressQueryRespDTO;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.kdniao.KdNiaoExpressQueryReqDTO;
 | 
			
		||||
@@ -16,12 +16,12 @@ public interface ExpressQueryConvert {
 | 
			
		||||
 | 
			
		||||
    ExpressQueryConvert INSTANCE = Mappers.getMapper(ExpressQueryConvert.class);
 | 
			
		||||
 | 
			
		||||
    List<ExpressQueryRespDTO> convertList(List<KdNiaoExpressQueryRespDTO.ExpressTrack> expressTrackList);
 | 
			
		||||
    List<ExpressTrackRespDTO> convertList(List<KdNiaoExpressQueryRespDTO.ExpressTrack> expressTrackList);
 | 
			
		||||
 | 
			
		||||
    List<ExpressQueryRespDTO> convertList2(List<Kd100ExpressQueryRespDTO.ExpressTrack> expressTrackList);
 | 
			
		||||
    List<ExpressTrackRespDTO> convertList2(List<Kd100ExpressQueryRespDTO.ExpressTrack> expressTrackList);
 | 
			
		||||
 | 
			
		||||
    KdNiaoExpressQueryReqDTO convert(ExpressQueryReqDTO dto);
 | 
			
		||||
    KdNiaoExpressQueryReqDTO convert(ExpressTrackQueryReqDTO dto);
 | 
			
		||||
 | 
			
		||||
    Kd100ExpressQueryReqDTO convert2(ExpressQueryReqDTO dto);
 | 
			
		||||
    Kd100ExpressQueryReqDTO convert2(ExpressTrackQueryReqDTO dto);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -4,12 +4,12 @@ import cn.iocoder.yudao.module.trade.dal.dataobject.delivery.DeliveryExpressDO;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 快递查询 Req DTO
 | 
			
		||||
 * 快递轨迹的查询 Req DTO
 | 
			
		||||
 *
 | 
			
		||||
 * @author jason
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
public class ExpressQueryReqDTO {
 | 
			
		||||
public class ExpressTrackQueryReqDTO {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 快递公司编码
 | 
			
		||||
@@ -8,7 +8,7 @@ import lombok.Data;
 | 
			
		||||
 * @author jason
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
public class ExpressQueryRespDTO {
 | 
			
		||||
public class ExpressTrackRespDTO {
 | 
			
		||||
 | 
			
		||||
    // TODO @jason:LocalDateTime
 | 
			
		||||
    /**
 | 
			
		||||
@@ -2,9 +2,12 @@ package cn.iocoder.yudao.module.trade.framework.delivery.core.client.impl;
 | 
			
		||||
 | 
			
		||||
import cn.hutool.core.lang.Assert;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.config.TradeExpressProperties;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.ExpressClientEnum;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.ExpressClient;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.impl.kd100.Kd100ExpressClient;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.impl.kdniao.KdNiaoExpressClient;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.enums.ExpressClientEnum;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.ExpressClientFactory;
 | 
			
		||||
import lombok.AllArgsConstructor;
 | 
			
		||||
import org.springframework.web.client.RestTemplate;
 | 
			
		||||
 | 
			
		||||
import java.util.Map;
 | 
			
		||||
@@ -15,6 +18,7 @@ import java.util.concurrent.ConcurrentHashMap;
 | 
			
		||||
 *
 | 
			
		||||
 * @author jason
 | 
			
		||||
 */
 | 
			
		||||
@AllArgsConstructor
 | 
			
		||||
public class ExpressClientFactoryImpl implements ExpressClientFactory {
 | 
			
		||||
 | 
			
		||||
    private final Map<ExpressClientEnum, ExpressClient> clientMap = new ConcurrentHashMap<>(8);
 | 
			
		||||
@@ -22,12 +26,6 @@ public class ExpressClientFactoryImpl implements ExpressClientFactory {
 | 
			
		||||
    private final TradeExpressProperties tradeExpressProperties;
 | 
			
		||||
    private final RestTemplate restTemplate;
 | 
			
		||||
 | 
			
		||||
    public ExpressClientFactoryImpl(TradeExpressProperties tradeExpressProperties,
 | 
			
		||||
                                    RestTemplate restTemplate) {
 | 
			
		||||
        this.tradeExpressProperties = tradeExpressProperties;
 | 
			
		||||
        this.restTemplate = restTemplate;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public ExpressClient getDefaultExpressClient() {
 | 
			
		||||
        ExpressClient defaultClient = getOrCreateExpressClient(tradeExpressProperties.getClient());
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
package cn.iocoder.yudao.module.trade.framework.delivery.core.client.impl;
 | 
			
		||||
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.ExpressClient;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.ExpressQueryReqDTO;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.ExpressQueryRespDTO;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.ExpressTrackQueryReqDTO;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.ExpressTrackRespDTO;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
@@ -15,8 +15,10 @@ import static cn.iocoder.yudao.module.trade.enums.ErrorCodeConstants.EXPRESS_CLI
 | 
			
		||||
 * @author jason
 | 
			
		||||
 */
 | 
			
		||||
public class NoProvideExpressClient implements ExpressClient {
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<ExpressQueryRespDTO> getExpressTrackList(ExpressQueryReqDTO reqDTO) {
 | 
			
		||||
    public List<ExpressTrackRespDTO> getExpressTrackList(ExpressTrackQueryReqDTO reqDTO) {
 | 
			
		||||
        throw exception(EXPRESS_CLIENT_NOT_PROVIDE);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
package cn.iocoder.yudao.module.trade.framework.delivery.core.client.impl;
 | 
			
		||||
package cn.iocoder.yudao.module.trade.framework.delivery.core.client.impl.kd100;
 | 
			
		||||
 | 
			
		||||
import cn.hutool.core.collection.CollUtil;
 | 
			
		||||
import cn.hutool.core.util.HexUtil;
 | 
			
		||||
@@ -6,8 +6,8 @@ import cn.hutool.crypto.digest.DigestUtil;
 | 
			
		||||
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.config.TradeExpressProperties;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.ExpressClient;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.ExpressQueryReqDTO;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.ExpressQueryRespDTO;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.ExpressTrackQueryReqDTO;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.ExpressTrackRespDTO;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.kd100.Kd100ExpressQueryReqDTO;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.kd100.Kd100ExpressQueryRespDTO;
 | 
			
		||||
import lombok.AllArgsConstructor;
 | 
			
		||||
@@ -36,29 +36,28 @@ import static cn.iocoder.yudao.module.trade.framework.delivery.core.client.conve
 | 
			
		||||
public class Kd100ExpressClient implements ExpressClient {
 | 
			
		||||
 | 
			
		||||
    private static final String REAL_TIME_QUERY_URL = "https://poll.kuaidi100.com/poll/query.do";
 | 
			
		||||
 | 
			
		||||
    private final RestTemplate restTemplate;
 | 
			
		||||
    private final TradeExpressProperties.Kd100Config config;
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<ExpressQueryRespDTO> getExpressTrackList(ExpressQueryReqDTO reqDTO) {
 | 
			
		||||
    public List<ExpressTrackRespDTO> getExpressTrackList(ExpressTrackQueryReqDTO reqDTO) {
 | 
			
		||||
        // 发起查询
 | 
			
		||||
        Kd100ExpressQueryReqDTO kd100ReqParam = INSTANCE.convert2(reqDTO);
 | 
			
		||||
        kd100ReqParam.setExpressCode(kd100ReqParam.getExpressCode().toLowerCase()); // 快递公司编码需要转成小写
 | 
			
		||||
        Kd100ExpressQueryRespDTO respDTO = requestExpressQuery(REAL_TIME_QUERY_URL, kd100ReqParam,
 | 
			
		||||
                Kd100ExpressQueryRespDTO.class);
 | 
			
		||||
        log.debug("[getExpressTrackList][快递 100 接口 查询接口返回 {}]", respDTO);
 | 
			
		||||
 | 
			
		||||
        // 处理结果
 | 
			
		||||
        if (Objects.equals("false", respDTO.getResult())) {
 | 
			
		||||
            log.error("[getExpressTrackList][快递 100 接口 返回失败 {}]", respDTO.getMessage());
 | 
			
		||||
            throw exception(EXPRESS_API_QUERY_FAILED, respDTO.getMessage());
 | 
			
		||||
        }
 | 
			
		||||
        // TODO @jason:convertList2 如果空,应该返回 list 了; @芋艿 为了避免返回 null
 | 
			
		||||
        if (CollUtil.isNotEmpty(respDTO.getTracks())) {
 | 
			
		||||
            return INSTANCE.convertList2(respDTO.getTracks());
 | 
			
		||||
        } else {
 | 
			
		||||
        if (CollUtil.isEmpty(respDTO.getTracks())) {
 | 
			
		||||
            return Collections.emptyList();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return INSTANCE.convertList2(respDTO.getTracks());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -85,7 +84,6 @@ public class Kd100ExpressClient implements ExpressClient {
 | 
			
		||||
        log.debug("[sendExpressQueryReq][快递 100 接口的请求参数: {}]", requestBody);
 | 
			
		||||
        // 发送请求
 | 
			
		||||
        HttpEntity<MultiValueMap<String, String>> requestEntity = new HttpEntity<>(requestBody, headers);
 | 
			
		||||
        // TODO @jason:可以使用 restTemplate 的 post 方法哇 @芋艿 为了获取接口的原始返回。用exchange 便于查问题。
 | 
			
		||||
        ResponseEntity<String> responseEntity = restTemplate.exchange(url, HttpMethod.POST, requestEntity, String.class);
 | 
			
		||||
        log.debug("[sendExpressQueryReq][快递 100 接口响应结果 {}]", responseEntity);
 | 
			
		||||
 | 
			
		||||
@@ -98,7 +96,6 @@ public class Kd100ExpressClient implements ExpressClient {
 | 
			
		||||
 | 
			
		||||
    private String generateReqSign(String param, String key, String customer) {
 | 
			
		||||
        String plainText = String.format("%s%s%s", param, key, customer);
 | 
			
		||||
        // TODO @芋艿。 这里需要转换成大写, 没有对应方法
 | 
			
		||||
        return HexUtil.encodeHexStr(DigestUtil.md5(plainText), false);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
package cn.iocoder.yudao.module.trade.framework.delivery.core.client.impl;
 | 
			
		||||
package cn.iocoder.yudao.module.trade.framework.delivery.core.client.impl.kdniao;
 | 
			
		||||
 | 
			
		||||
import cn.hutool.core.codec.Base64;
 | 
			
		||||
import cn.hutool.core.collection.CollUtil;
 | 
			
		||||
@@ -7,8 +7,8 @@ import cn.hutool.crypto.digest.DigestUtil;
 | 
			
		||||
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.config.TradeExpressProperties;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.ExpressClient;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.ExpressQueryReqDTO;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.ExpressQueryRespDTO;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.ExpressTrackQueryReqDTO;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.ExpressTrackRespDTO;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.kdniao.KdNiaoExpressQueryReqDTO;
 | 
			
		||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.kdniao.KdNiaoExpressQueryRespDTO;
 | 
			
		||||
import lombok.AllArgsConstructor;
 | 
			
		||||
@@ -51,25 +51,27 @@ public class KdNiaoExpressClient implements ExpressClient {
 | 
			
		||||
     * @param reqDTO 查询请求参数
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<ExpressQueryRespDTO> getExpressTrackList(ExpressQueryReqDTO reqDTO) {
 | 
			
		||||
    public List<ExpressTrackRespDTO> getExpressTrackList(ExpressTrackQueryReqDTO reqDTO) {
 | 
			
		||||
        KdNiaoExpressQueryReqDTO kdNiaoReqData = INSTANCE.convert(reqDTO);
 | 
			
		||||
        // 快递公司编码需要转成大写
 | 
			
		||||
        kdNiaoReqData.setExpressCode(reqDTO.getExpressCode().toUpperCase());
 | 
			
		||||
        KdNiaoExpressQueryRespDTO respDTO = requestKdNiaoApi(REAL_TIME_QUERY_URL, REAL_TIME_FREE_REQ_TYPE,
 | 
			
		||||
                kdNiaoReqData, KdNiaoExpressQueryRespDTO.class);
 | 
			
		||||
        log.debug("[getExpressTrackList][快递鸟即时查询接口返回 {}]", respDTO);
 | 
			
		||||
 | 
			
		||||
        // 处理结果
 | 
			
		||||
        if (respDTO == null || !respDTO.getSuccess()) {
 | 
			
		||||
            throw exception(EXPRESS_API_QUERY_FAILED, respDTO == null ? "" : respDTO.getReason());
 | 
			
		||||
        }
 | 
			
		||||
        if (CollUtil.isNotEmpty(respDTO.getTracks())) {
 | 
			
		||||
            return INSTANCE.convertList(respDTO.getTracks());
 | 
			
		||||
        } else {
 | 
			
		||||
            return Collections.emptyList();
 | 
			
		||||
        }
 | 
			
		||||
        return INSTANCE.convertList(respDTO.getTracks());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 快递鸟 通用的 API 请求, 暂时没有其他应用场景, 暂时放这里
 | 
			
		||||
     * 快递鸟 通用的 API 请求,暂时没有其他应用场景, 暂时放这里
 | 
			
		||||
     *
 | 
			
		||||
     * @param url 请求 url
 | 
			
		||||
     * @param requestType 对应的请求指令 (快递鸟的RequestType)
 | 
			
		||||
     * @param req  对应请求的请求参数
 | 
			
		||||
@@ -77,8 +79,8 @@ public class KdNiaoExpressClient implements ExpressClient {
 | 
			
		||||
     * @param <Req> 每个请求的请求结构 Req DTO
 | 
			
		||||
     * @param <Resp> 每个请求的响应结构 Resp DTO
 | 
			
		||||
     */
 | 
			
		||||
    private  <Req, Resp> Resp requestKdNiaoApi(String url, String requestType, Req req,
 | 
			
		||||
                                               Class<Resp> respClass){
 | 
			
		||||
    private <Req, Resp> Resp requestKdNiaoApi(String url, String requestType, Req req,
 | 
			
		||||
                                              Class<Resp> respClass){
 | 
			
		||||
        // 请求头
 | 
			
		||||
        HttpHeaders headers = new HttpHeaders();
 | 
			
		||||
        headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
 | 
			
		||||
@@ -1,5 +1,6 @@
 | 
			
		||||
package cn.iocoder.yudao.module.trade.framework.delivery.core.client;
 | 
			
		||||
package cn.iocoder.yudao.module.trade.framework.delivery.core.enums;
 | 
			
		||||
 | 
			
		||||
import lombok.AllArgsConstructor;
 | 
			
		||||
import lombok.Getter;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@@ -8,7 +9,9 @@ import lombok.Getter;
 | 
			
		||||
 * @author jason
 | 
			
		||||
 */
 | 
			
		||||
@Getter
 | 
			
		||||
@AllArgsConstructor
 | 
			
		||||
public enum ExpressClientEnum {
 | 
			
		||||
 | 
			
		||||
    NOT_PROVIDE("not-provide","未提供"),
 | 
			
		||||
    KD_NIAO("kd-niao", "快递鸟"),
 | 
			
		||||
    KD_100("kd-100", "快递100");
 | 
			
		||||
@@ -17,14 +20,9 @@ public enum ExpressClientEnum {
 | 
			
		||||
     * 快递服务商唯一编码
 | 
			
		||||
     */
 | 
			
		||||
    private final String code;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 快递服务商名称
 | 
			
		||||
     */
 | 
			
		||||
    private final String name;
 | 
			
		||||
 | 
			
		||||
    ExpressClientEnum(String code, String name) {
 | 
			
		||||
        this.code = code;
 | 
			
		||||
        this.name = name;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user