优化内容

This commit is contained in:
2026-05-02 17:45:58 +08:00
parent bcd30ae5de
commit da2053c520
38 changed files with 364 additions and 133 deletions

View File

@@ -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);
}
}
/**
* 获取订单列表
*/