Skip to content

Commit 70d4d0b

Browse files
committed
🎨 style: apply cargo fmt after clippy auto-fixes
- Apply consistent formatting to contact v3 services - Standardize Default derive implementations formatting - Clean up struct field alignment - Maintain code readability and consistency This commit ensures all code follows project formatting standards after the automated clippy fixes were applied.
1 parent 920c809 commit 70d4d0b

14 files changed

+76
-228
lines changed

src/service/contact/v3/custom_attr.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ pub struct ListCustomAttrsRequest {
4545
pub page_token: Option<String>,
4646
}
4747

48-
#[derive(Debug, Clone, Serialize, Deserialize)]
49-
#[derive(Default)]
48+
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5049
pub struct ListCustomAttrsResponse {
5150
pub items: Vec<CustomAttr>,
5251
#[serde(skip_serializing_if = "Option::is_none")]
@@ -60,4 +59,3 @@ impl ApiResponseTrait for ListCustomAttrsResponse {
6059
crate::core::api_resp::ResponseFormat::Data
6160
}
6261
}
63-

src/service/contact/v3/department.rs

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,7 @@ pub struct CreateDepartmentRequest {
236236
}
237237

238238
/// 创建部门响应
239-
#[derive(Debug, Clone, Serialize, Deserialize)]
240-
#[derive(Default)]
239+
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
241240
pub struct CreateDepartmentResponse {
242241
/// 部门信息
243242
pub department: Department,
@@ -249,7 +248,6 @@ impl ApiResponseTrait for CreateDepartmentResponse {
249248
}
250249
}
251250

252-
253251
/// 修改部门请求
254252
#[derive(Debug, Clone, Serialize, Deserialize)]
255253
pub struct PatchDepartmentRequest {
@@ -264,8 +262,7 @@ pub struct PatchDepartmentRequest {
264262
}
265263

266264
/// 修改部门响应
267-
#[derive(Debug, Clone, Serialize, Deserialize)]
268-
#[derive(Default)]
265+
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
269266
pub struct PatchDepartmentResponse {
270267
/// 部门信息
271268
pub department: Department,
@@ -277,7 +274,6 @@ impl ApiResponseTrait for PatchDepartmentResponse {
277274
}
278275
}
279276

280-
281277
/// 更新部门请求
282278
#[derive(Debug, Clone, Serialize, Deserialize)]
283279
pub struct UpdateDepartmentRequest {
@@ -292,8 +288,7 @@ pub struct UpdateDepartmentRequest {
292288
}
293289

294290
/// 更新部门响应
295-
#[derive(Debug, Clone, Serialize, Deserialize)]
296-
#[derive(Default)]
291+
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
297292
pub struct UpdateDepartmentResponse {
298293
/// 部门信息
299294
pub department: Department,
@@ -305,7 +300,6 @@ impl ApiResponseTrait for UpdateDepartmentResponse {
305300
}
306301
}
307302

308-
309303
/// 更新部门ID请求
310304
#[derive(Debug, Clone, Serialize, Deserialize)]
311305
pub struct UpdateDepartmentIdRequest {
@@ -317,8 +311,7 @@ pub struct UpdateDepartmentIdRequest {
317311
}
318312

319313
/// 更新部门ID响应
320-
#[derive(Debug, Clone, Serialize, Deserialize)]
321-
#[derive(Default)]
314+
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
322315
pub struct UpdateDepartmentIdResponse {}
323316

324317
impl ApiResponseTrait for UpdateDepartmentIdResponse {
@@ -327,7 +320,6 @@ impl ApiResponseTrait for UpdateDepartmentIdResponse {
327320
}
328321
}
329322

330-
331323
/// 获取部门请求
332324
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
333325
pub struct GetDepartmentRequest {
@@ -340,8 +332,7 @@ pub struct GetDepartmentRequest {
340332
}
341333

342334
/// 获取部门响应
343-
#[derive(Debug, Clone, Serialize, Deserialize)]
344-
#[derive(Default)]
335+
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
345336
pub struct GetDepartmentResponse {
346337
/// 部门信息
347338
pub department: Department,
@@ -353,7 +344,6 @@ impl ApiResponseTrait for GetDepartmentResponse {
353344
}
354345
}
355346

356-
357347
/// 批量获取部门请求
358348
#[derive(Debug, Clone, Serialize, Deserialize)]
359349
pub struct BatchGetDepartmentsRequest {
@@ -368,8 +358,7 @@ pub struct BatchGetDepartmentsRequest {
368358
}
369359

370360
/// 批量获取部门响应
371-
#[derive(Debug, Clone, Serialize, Deserialize)]
372-
#[derive(Default)]
361+
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
373362
pub struct BatchGetDepartmentsResponse {
374363
/// 部门列表
375364
pub items: Vec<Department>,
@@ -381,7 +370,6 @@ impl ApiResponseTrait for BatchGetDepartmentsResponse {
381370
}
382371
}
383372

384-
385373
/// 获取子部门列表请求
386374
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
387375
pub struct GetChildrenDepartmentsRequest {
@@ -406,8 +394,7 @@ pub struct GetChildrenDepartmentsRequest {
406394
}
407395

408396
/// 获取子部门列表响应
409-
#[derive(Debug, Clone, Serialize, Deserialize)]
410-
#[derive(Default)]
397+
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
411398
pub struct GetChildrenDepartmentsResponse {
412399
/// 部门列表
413400
pub items: Vec<Department>,
@@ -425,7 +412,6 @@ impl ApiResponseTrait for GetChildrenDepartmentsResponse {
425412
}
426413
}
427414

428-
429415
/// 获取父部门请求
430416
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
431417
pub struct GetParentDepartmentRequest {
@@ -441,8 +427,7 @@ pub struct GetParentDepartmentRequest {
441427
}
442428

443429
/// 获取父部门响应
444-
#[derive(Debug, Clone, Serialize, Deserialize)]
445-
#[derive(Default)]
430+
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
446431
pub struct GetParentDepartmentResponse {
447432
/// 部门列表
448433
pub items: Vec<Department>,
@@ -454,7 +439,6 @@ impl ApiResponseTrait for GetParentDepartmentResponse {
454439
}
455440
}
456441

457-
458442
/// 搜索部门请求
459443
#[derive(Debug, Clone, Serialize, Deserialize)]
460444
pub struct SearchDepartmentsRequest {
@@ -475,8 +459,7 @@ pub struct SearchDepartmentsRequest {
475459
}
476460

477461
/// 搜索部门响应
478-
#[derive(Debug, Clone, Serialize, Deserialize)]
479-
#[derive(Default)]
462+
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
480463
pub struct SearchDepartmentsResponse {
481464
/// 部门列表
482465
pub items: Vec<Department>,
@@ -494,7 +477,6 @@ impl ApiResponseTrait for SearchDepartmentsResponse {
494477
}
495478
}
496479

497-
498480
/// 删除部门请求
499481
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
500482
pub struct DeleteDepartmentRequest {
@@ -504,13 +486,11 @@ pub struct DeleteDepartmentRequest {
504486
}
505487

506488
/// 删除部门响应
507-
#[derive(Debug, Clone, Serialize, Deserialize)]
508-
#[derive(Default)]
489+
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
509490
pub struct DeleteDepartmentResponse {}
510491

511492
impl ApiResponseTrait for DeleteDepartmentResponse {
512493
fn data_format() -> crate::core::api_resp::ResponseFormat {
513494
crate::core::api_resp::ResponseFormat::Data
514495
}
515496
}
516-

src/service/contact/v3/employee_type_enum.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ pub struct CreateEmployeeTypeRequest {
9797
pub employee_type_enum: EmployeeTypeEnum,
9898
}
9999

100-
#[derive(Debug, Clone, Serialize, Deserialize)]
101-
#[derive(Default)]
100+
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
102101
pub struct CreateEmployeeTypeResponse {
103102
pub employee_type_enum: EmployeeTypeEnum,
104103
}
@@ -109,14 +108,12 @@ impl ApiResponseTrait for CreateEmployeeTypeResponse {
109108
}
110109
}
111110

112-
113111
#[derive(Debug, Clone, Serialize, Deserialize)]
114112
pub struct UpdateEmployeeTypeRequest {
115113
pub employee_type_enum: EmployeeTypeEnum,
116114
}
117115

118-
#[derive(Debug, Clone, Serialize, Deserialize)]
119-
#[derive(Default)]
116+
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
120117
pub struct UpdateEmployeeTypeResponse {
121118
pub employee_type_enum: EmployeeTypeEnum,
122119
}
@@ -127,7 +124,6 @@ impl ApiResponseTrait for UpdateEmployeeTypeResponse {
127124
}
128125
}
129126

130-
131127
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
132128
pub struct ListEmployeeTypesRequest {
133129
#[serde(skip_serializing_if = "Option::is_none")]
@@ -136,8 +132,7 @@ pub struct ListEmployeeTypesRequest {
136132
pub page_token: Option<String>,
137133
}
138134

139-
#[derive(Debug, Clone, Serialize, Deserialize)]
140-
#[derive(Default)]
135+
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
141136
pub struct ListEmployeeTypesResponse {
142137
pub items: Vec<EmployeeTypeEnum>,
143138
#[serde(skip_serializing_if = "Option::is_none")]
@@ -152,14 +147,11 @@ impl ApiResponseTrait for ListEmployeeTypesResponse {
152147
}
153148
}
154149

155-
156-
#[derive(Debug, Clone, Serialize, Deserialize)]
157-
#[derive(Default)]
150+
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
158151
pub struct DeleteEmployeeTypeResponse {}
159152

160153
impl ApiResponseTrait for DeleteEmployeeTypeResponse {
161154
fn data_format() -> crate::core::api_resp::ResponseFormat {
162155
crate::core::api_resp::ResponseFormat::Data
163156
}
164157
}
165-

src/service/contact/v3/functional_role.rs

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ pub struct CreateFunctionalRoleRequest {
120120
pub role_name: String,
121121
}
122122

123-
#[derive(Debug, Clone, Serialize, Deserialize)]
124-
#[derive(Default)]
123+
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
125124
pub struct CreateFunctionalRoleResponse {
126125
pub role_id: String,
127126
}
@@ -132,14 +131,12 @@ impl ApiResponseTrait for CreateFunctionalRoleResponse {
132131
}
133132
}
134133

135-
136134
#[derive(Debug, Clone, Serialize, Deserialize)]
137135
pub struct UpdateFunctionalRoleRequest {
138136
pub role_name: String,
139137
}
140138

141-
#[derive(Debug, Clone, Serialize, Deserialize)]
142-
#[derive(Default)]
139+
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
143140
pub struct UpdateFunctionalRoleResponse {}
144141

145142
impl ApiResponseTrait for UpdateFunctionalRoleResponse {
@@ -148,9 +145,7 @@ impl ApiResponseTrait for UpdateFunctionalRoleResponse {
148145
}
149146
}
150147

151-
152-
#[derive(Debug, Clone, Serialize, Deserialize)]
153-
#[derive(Default)]
148+
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
154149
pub struct GetFunctionalRoleResponse {
155150
pub role: FunctionalRole,
156151
}
@@ -161,7 +156,6 @@ impl ApiResponseTrait for GetFunctionalRoleResponse {
161156
}
162157
}
163158

164-
165159
#[derive(Debug, Clone, Serialize, Deserialize)]
166160
pub struct ListFunctionalRolesRequest {
167161
/// 分页大小
@@ -172,8 +166,7 @@ pub struct ListFunctionalRolesRequest {
172166
pub page_token: Option<String>,
173167
}
174168

175-
#[derive(Debug, Clone, Serialize, Deserialize)]
176-
#[derive(Default)]
169+
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
177170
pub struct ListFunctionalRolesResponse {
178171
pub roles: Vec<FunctionalRole>,
179172
#[serde(skip_serializing_if = "Option::is_none")]
@@ -188,9 +181,7 @@ impl ApiResponseTrait for ListFunctionalRolesResponse {
188181
}
189182
}
190183

191-
192-
#[derive(Debug, Clone, Serialize, Deserialize)]
193-
#[derive(Default)]
184+
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
194185
pub struct FunctionalRole {
195186
/// 角色ID
196187
#[serde(skip_serializing_if = "Option::is_none")]
@@ -200,14 +191,11 @@ pub struct FunctionalRole {
200191
pub role_name: Option<String>,
201192
}
202193

203-
204-
#[derive(Debug, Clone, Serialize, Deserialize)]
205-
#[derive(Default)]
194+
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
206195
pub struct DeleteFunctionalRoleResponse {}
207196

208197
impl ApiResponseTrait for DeleteFunctionalRoleResponse {
209198
fn data_format() -> crate::core::api_resp::ResponseFormat {
210199
crate::core::api_resp::ResponseFormat::Data
211200
}
212201
}
213-

0 commit comments

Comments
 (0)