优化内容
This commit is contained in:
@@ -244,6 +244,31 @@ public class AdminController {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除普通用户
|
||||
*/
|
||||
@Operation(summary = "删除普通用户")
|
||||
@DeleteMapping("/users/{id}")
|
||||
public ResponseEntity<Map<String, Object>> deleteUser(@PathVariable Long id) {
|
||||
try {
|
||||
adminService.deleteUser(id);
|
||||
|
||||
Map<String, Object> response = new HashMap<>();
|
||||
response.put("success", true);
|
||||
response.put("message", "用户删除成功");
|
||||
|
||||
return ResponseEntity.ok(response);
|
||||
} catch (Exception e) {
|
||||
log.error("删除用户失败", e);
|
||||
|
||||
Map<String, Object> response = new HashMap<>();
|
||||
response.put("success", false);
|
||||
response.put("message", "删除用户失败: " + e.getMessage());
|
||||
|
||||
return ResponseEntity.badRequest().body(response);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单列表
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user