summary_rs/
types.rs

1use serde::{Serialize, Deserialize};
2
3
4#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5#[serde(rename_all = "camelCase")]
6pub struct SummaryModel {
7    /// 项目ID
8    pub id: String,
9    /// 项目ID
10    pub project_id: String,
11
12    /// 委托方
13    pub consignor: String,
14    /// 委托方信息
15    pub consignor_info: String,
16
17    /// 制造商
18    pub manufacturer: String,
19    /// 制造商信息
20    pub manufacturer_info: String,
21
22    /// 测试实验室
23    pub test_lab: String,
24    /// 测试实验室信息
25    pub test_lab_info: String,
26
27    /// 中文名称
28    pub cn_name: String,
29    /// 英文名称
30    pub en_name: String,
31    /// 电池/电芯类别
32    pub classification: String,
33
34    /// 型号
35    #[serde(rename = "type")]
36    pub model: String,
37    /// 商标
38    pub trademark: String,
39
40    /// 电压
41    pub voltage: String,
42    /// 容量
43    pub capacity: String,
44
45    /// 瓦数
46    pub watt: String,
47    /// 颜色
48    pub color: String,
49    /// 形状
50    pub shape: String,
51
52    /// 质量
53    pub mass: String,
54    /// 锂含量
55    #[serde(rename = "licontent")]
56    pub li_content: String,
57
58    /// 测试报告编号
59    pub test_report_no: String,
60    /// 测试日期
61    pub test_date: String,
62    
63
64    /// 测试标准
65    pub test_manual: String,
66
67    /// 测试项目
68    pub test1: String,
69    pub test2: String,
70    pub test3: String,
71
72    pub test4: String,
73    pub test5: String,
74    pub test6: String,
75
76    pub test7: String,
77    pub test8: String,
78
79    #[serde(rename = "un38f")]
80    pub un38_f: String,
81    #[serde(rename = "un38g")]
82    pub un38_g: String,
83
84    /// 备注
85    pub note: String,
86}
87
88impl SummaryModel {
89    pub fn default() -> Self {
90        Self {
91            id: "".to_string(),
92            project_id: "".to_string(),
93            consignor: "".to_string(),
94            consignor_info: "".to_string(),
95            manufacturer: "".to_string(),
96            manufacturer_info: "".to_string(),
97            test_lab: "".to_string(),
98            test_lab_info: "".to_string(),
99            cn_name: "".to_string(),
100            en_name: "".to_string(),
101            classification: "".to_string(),
102            model: "".to_string(),
103            trademark: "".to_string(),
104            voltage: "".to_string(),
105            capacity: "".to_string(),
106            watt: "".to_string(),
107            color: "".to_string(),
108            shape: "".to_string(),
109            mass: "".to_string(),
110            li_content: "".to_string(),
111            test_report_no: "".to_string(),
112            test_date: "".to_string(),
113            test_manual: "".to_string(),
114            test1: "".to_string(),
115            test2: "".to_string(),
116            test3: "".to_string(),
117            test4: "".to_string(),
118            test5: "".to_string(),
119            test6: "".to_string(),
120            test7: "".to_string(),
121            test8: "".to_string(),
122            un38_f: "".to_string(),
123            un38_g: "".to_string(),
124            note: "".to_string(),
125        }
126    }
127}
128
129#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
130#[serde(rename_all = "camelCase")]
131pub struct SummaryModelDocx {
132    #[serde(flatten)]
133    pub base: SummaryModel,
134    // 标题
135    pub title: String,
136    // 项目编号
137    pub project_no: String,
138    // 签发日期
139    pub issue_date: String,
140}
141
142
143impl SummaryModelDocx {
144    pub fn default() -> Self {
145        Self {
146            base: SummaryModel::default(),
147            title: "".to_string(),
148            project_no: "".to_string(),
149            issue_date: "".to_string(),
150        }
151    }
152}