pdd/requests/
pdd_goods_logistics_ser_template_update.rs

1use crate::Request;
2
3use serde::{Deserialize, Serialize};
4
5
6/// 商品送装服务模版更新
7#[derive(Serialize, Deserialize, Debug, Default)]
8pub struct List {
9    
10    /// 按属性收取费用时配置的内容:按属性限价时设置;按件限价时不用传,value和content必须设置一个
11    #[serde(rename = "content")]
12    pub content: Option<Vec<Content>>,
13    
14    /// 分类目收取服务费用方式:1-按件收取费用,2-按属性收取费用
15    #[serde(rename = "limit_type")]
16    pub limit_type: Option<i32>,
17    
18    /// 按“件”收取费用时配置的内容:按件限价时输入数字,表示每件商品附加费用$value分;按属性限价时不用传value和content必须设置一个
19    #[serde(rename = "value")]
20    pub value: Option<i64>,
21    
22}
23
24/// 商品送装服务模版更新
25#[derive(Serialize, Deserialize, Debug, Default)]
26pub struct CatList {
27    
28    /// 三级类目id
29    #[serde(rename = "cat_id3")]
30    pub cat_id3: Option<i64>,
31    
32    /// 四级类目id
33    #[serde(rename = "cat_id4")]
34    pub cat_id4: Option<i64>,
35    
36    /// 类目规则配置
37    #[serde(rename = "list")]
38    pub list: Option<Vec<List>>,
39    
40}
41
42/// 商品送装服务模版更新
43#[derive(Serialize, Deserialize, Debug, Default)]
44pub struct ServiceAreaList {
45    
46    /// 市id,如果是全省选中,则市id为0
47    #[serde(rename = "city_id")]
48    pub city_id: Option<i32>,
49    
50    /// 区id,如果是全省或全市选中,则区id为0
51    #[serde(rename = "district_id")]
52    pub district_id: Option<i32>,
53    
54    /// 省id
55    #[serde(rename = "province_id")]
56    pub province_id: Option<i32>,
57    
58    /// 溢价值:按分溢价时,输入价格分的数字,表示value分;按百分比溢价时,输入0-500之间的数字,表示0%——500%备注:买家自提服务类型时,不用传该字段
59    #[serde(rename = "value")]
60    pub value: Option<i32>,
61    
62}
63
64/// 商品送装服务模版更新
65#[derive(Serialize, Deserialize, Debug, Default)]
66pub struct PddGoodsLogisticsSerTemplateUpdate {
67    
68    /// 分类目基础价格配置,入参为string,[{ "cat_id4": 1, "cat_id3": 2, "list": [{ "limit_type": 1, "value": 1, "content": [{ "price": 1, "max_pro": 1, "min_pro": 1 }] }] }]
69    #[serde(rename = "cat_list")]
70    pub cat_list: Option<Vec<CatList>>,
71    
72    /// 分地区配置溢价时使用的计价单位:0:价格分,按价格分计算费用;1:百分比,按照基础价格乘以百分比计算费用,除了"买家自提"服务,其他服务类型必传
73    #[serde(rename = "price_unit")]
74    pub price_unit: Option<i32>,
75    
76    /// 服务地区范围配置,此入参为string,[{ "value": 1, "district_id": 2, "city_id": 2, "province_id": 2 }]
77    #[serde(rename = "service_area_list")]
78    pub service_area_list: Option<Vec<ServiceAreaList>>,
79    
80    /// 模版id
81    #[serde(rename = "template_id")]
82    pub template_id: Option<String>,
83    
84    /// 服务模板名称(不超过50字)
85    #[serde(rename = "template_name")]
86    pub template_name: Option<String>,
87    
88    /// 服务模板类型:2:送货上门 3:送货上门并安装 4:上门安装 5: 买家自提
89    #[serde(rename = "template_type")]
90    pub template_type: Option<i32>,
91    
92}
93
94/// 商品送装服务模版更新
95#[derive(Serialize, Deserialize, Debug, Default)]
96pub struct Content {
97    
98    /// 属性区间大值,-1表示"其他"示例:要配置区间"100-200"的费用,则maxPro输入"200"要配置区间"其他"的费用,则maxPro输入"-1"备注:表示长度时单位为:mm
99    #[serde(rename = "max_pro")]
100    pub max_pro: Option<i64>,
101    
102    /// 属性区间小值,-1表示"其他"示例:要配置区间"100-200"的费用,则minPro输入"100"要配置区间"其他"的费用,则minPro输入"-1"备注:表示长度时单位为:mm
103    #[serde(rename = "min_pro")]
104    pub min_pro: Option<i64>,
105    
106    /// 价格。单位:分
107    #[serde(rename = "price")]
108    pub price: Option<i64>,
109    
110}
111
112
113/// 商品送装服务模版更新
114impl Request for PddGoodsLogisticsSerTemplateUpdate {
115    fn get_type() -> String {
116        "pdd.goods.logistics.ser.template.update".to_string()
117    }
118
119    fn get_response_name() -> String {
120        "goods_logistics_ser_template_update_response".to_string()
121    }
122}