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
use crate::Request;

use serde::{Deserialize, Serialize};


/// 修改商品sku价格
#[derive(Serialize, Deserialize, Debug, Default)]
pub struct PddGoodsSkuPriceUpdate {
    
    /// 商品id
    #[serde(rename = "goods_id")]
    pub goods_id: Option<i64>,
    
    /// 是否获取商品发布警告信息,默认为忽略
    #[serde(rename = "ignore_edit_warn")]
    pub ignore_edit_warn: Option<bool>,
    
    /// 参考价 (单位分)
    #[serde(rename = "market_price")]
    pub market_price: Option<i64>,
    
    /// 参考价 (单位元)
    #[serde(rename = "market_price_in_yuan")]
    pub market_price_in_yuan: Option<String>,
    
    /// 待修改的sku价格
    #[serde(rename = "sku_price_list")]
    pub sku_price_list: Option<Vec<SkuPriceList>>,
    
    /// 提交后上架状态,0:上架,1:保持原样
    #[serde(rename = "sync_goods_operate")]
    pub sync_goods_operate: Option<i32>,
    
    /// 满2件折扣,可选范围0-100, 0表示取消,95表示95折,设置需先查询规则接口获取实际可填范围
    #[serde(rename = "two_pieces_discount")]
    pub two_pieces_discount: Option<i32>,
    
}

/// 修改商品sku价格
#[derive(Serialize, Deserialize, Debug, Default)]
pub struct SkuPriceList {
    
    /// 拼团购买价格(单位分)
    #[serde(rename = "group_price")]
    pub group_price: Option<i64>,
    
    /// sku上架状态,0-已下架,1-上架中
    #[serde(rename = "is_onsale")]
    pub is_onsale: Option<i32>,
    
    /// 单独购买价格(单位分)
    #[serde(rename = "single_price")]
    pub single_price: Option<i64>,
    
    /// sku标识
    #[serde(rename = "sku_id")]
    pub sku_id: Option<i64>,
    
}


impl Request for PddGoodsSkuPriceUpdate {
    fn get_type() -> String {
        "pdd.goods.sku.price.update".to_string()
    }

    fn get_response_name() -> String {
        "goods_update_sku_price_response".to_string()
    }
}