2026-06-24 f4bd1f3c89d906131495a0aca5aaf82966378510
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package cn.iocoder.yudao.module.trade.framework.delivery.config;
 
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;
import org.springframework.validation.annotation.Validated;
 
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotEmpty;
 
// TODO @芋艿:未来要不要放数据库中?考虑 saas 多租户时,不同租户使用不同的配置?
/**
 * 交易运费快递的配置项
 *
 * @author jason
 */
@Component
@ConfigurationProperties(prefix = "yudao.trade.express")
@Data
@Validated
public class TradeExpressProperties {
 
    /**
     * 快递客户端
     *
     * 默认不提供,需要提醒用户配置一个快递服务商。
     */
    private ExpressClientEnum client = ExpressClientEnum.NOT_PROVIDE;
 
    /**
     * 快递鸟配置
     */
    @Valid
    private KdNiaoConfig kdNiao;
    /**
     * 快递 100 配置
     */
    @Valid
    private Kd100Config kd100;
 
    /**
     * 快递鸟配置项目
     */
    @Data
    public static class KdNiaoConfig {
 
        /**
         * 快递鸟用户 ID
         */
        @NotEmpty(message = "快递鸟用户 ID 配置项不能为空")
        private String businessId;
        /**
         * 快递鸟 API Key
         */
        @NotEmpty(message = "快递鸟 Api Key 配置项不能为空")
        private String apiKey;
 
        /**
         * 接口指令
         *
         * 1. 1002:免费版(只能查询申通、圆通快递)
         * 2. 8001:付费版
         */
        @NotEmpty(message = "RequestType 配置项不能为空")
        private String requestType = "1002";
 
    }
 
    /**
     * 快递 100 配置项
     */
    @Data
    public static class Kd100Config {
 
        /**
         * 快递 100 授权码
         */
        @NotEmpty(message = "快递 100 授权码配置项不能为空")
        private String customer;
        /**
         * 快递 100 授权 key
         */
        @NotEmpty(message = "快递 100 授权 Key 配置项不能为空")
        private String key;
 
    }
 
}