|
@@ -90,7 +90,11 @@ public class ServiceRoleApplicationController {
|
|
|
|
|
|
|
|
@PostMapping("/admin/list")
|
|
@PostMapping("/admin/list")
|
|
|
@Operation(summary = "管理端: 获取申请列表")
|
|
@Operation(summary = "管理端: 获取申请列表")
|
|
|
- public Result adminList(@RequestParam(required = false, defaultValue = "0") Integer status) {
|
|
|
|
|
|
|
+ public Result adminList(@RequestParam(required = false, defaultValue = "0") Integer status,
|
|
|
|
|
+ @RequestAttribute("role") String role) {
|
|
|
|
|
+ if (!"admin".equals(role) && !"operator".equals(role)) {
|
|
|
|
|
+ return Result.error("无权限:仅管理员/运营可查看服务角色申请列表");
|
|
|
|
|
+ }
|
|
|
List<ServiceRoleApplication> list = serviceRoleApplicationService.listApplications(status);
|
|
List<ServiceRoleApplication> list = serviceRoleApplicationService.listApplications(status);
|
|
|
return Result.success(list);
|
|
return Result.success(list);
|
|
|
}
|
|
}
|
|
@@ -98,7 +102,11 @@ public class ServiceRoleApplicationController {
|
|
|
@PostMapping("/admin/approve")
|
|
@PostMapping("/admin/approve")
|
|
|
@Operation(summary = "管理端: 批准申请")
|
|
@Operation(summary = "管理端: 批准申请")
|
|
|
public Result adminApprove(@RequestBody Map<String, Object> params,
|
|
public Result adminApprove(@RequestBody Map<String, Object> params,
|
|
|
- @RequestAttribute("userId") Long adminId) {
|
|
|
|
|
|
|
+ @RequestAttribute("userId") Long adminId,
|
|
|
|
|
+ @RequestAttribute("role") String role) {
|
|
|
|
|
+ if (!"admin".equals(role) && !"operator".equals(role)) {
|
|
|
|
|
+ return Result.error("无权限:仅管理员/运营可审批服务角色申请");
|
|
|
|
|
+ }
|
|
|
Long id = ParamUtils.getLong(params.get("id"));
|
|
Long id = ParamUtils.getLong(params.get("id"));
|
|
|
return serviceRoleApplicationService.approve(id, adminId);
|
|
return serviceRoleApplicationService.approve(id, adminId);
|
|
|
}
|
|
}
|
|
@@ -106,7 +114,11 @@ public class ServiceRoleApplicationController {
|
|
|
@PostMapping("/admin/reject")
|
|
@PostMapping("/admin/reject")
|
|
|
@Operation(summary = "管理端: 驳回申请")
|
|
@Operation(summary = "管理端: 驳回申请")
|
|
|
public Result adminReject(@RequestBody Map<String, Object> params,
|
|
public Result adminReject(@RequestBody Map<String, Object> params,
|
|
|
- @RequestAttribute("userId") Long adminId) {
|
|
|
|
|
|
|
+ @RequestAttribute("userId") Long adminId,
|
|
|
|
|
+ @RequestAttribute("role") String role) {
|
|
|
|
|
+ if (!"admin".equals(role) && !"operator".equals(role)) {
|
|
|
|
|
+ return Result.error("无权限:仅管理员/运营可审批服务角色申请");
|
|
|
|
|
+ }
|
|
|
Long id = ParamUtils.getLong(params.get("id"));
|
|
Long id = ParamUtils.getLong(params.get("id"));
|
|
|
String reason = params.get("reason") != null ? params.get("reason").toString() : "";
|
|
String reason = params.get("reason") != null ? params.get("reason").toString() : "";
|
|
|
return serviceRoleApplicationService.reject(id, reason, adminId);
|
|
return serviceRoleApplicationService.reject(id, reason, adminId);
|