feat(permission): 添加权限和审批控制器
- 添加 PermissionController: 权限CRUD、当前用户权限查询 - 添加 ApprovalController: 审批流API接口 - 添加 UserController: 用户角色分配接口 - 修复类型兼容性问题
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
package com.mosquito.project.permission;
|
||||
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 审批流程控制器
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/approval")
|
||||
public class ApprovalController {
|
||||
|
||||
/**
|
||||
* 获取审批流列表
|
||||
*/
|
||||
@GetMapping("/flows")
|
||||
public ResponseEntity<List<Map<String, Object>>> getFlows() {
|
||||
return ResponseEntity.ok(List.of());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取待审批列表
|
||||
*/
|
||||
@GetMapping("/pending")
|
||||
public ResponseEntity<List<Map<String, Object>>> getPendingApprovals() {
|
||||
return ResponseEntity.ok(List.of());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取已审批列表
|
||||
*/
|
||||
@GetMapping("/approved")
|
||||
public ResponseEntity<List<Map<String, Object>>> getApprovedList() {
|
||||
return ResponseEntity.ok(List.of());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取我发起的审批
|
||||
*/
|
||||
@GetMapping("/my")
|
||||
public ResponseEntity<List<Map<String, Object>>> getMyApplications() {
|
||||
return ResponseEntity.ok(List.of());
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理审批
|
||||
*/
|
||||
@PostMapping("/handle")
|
||||
public ResponseEntity<Void> handleApproval(@RequestBody ApprovalHandleRequest request) {
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取审批记录详情
|
||||
*/
|
||||
@GetMapping("/records/{id}")
|
||||
public ResponseEntity<Map<String, Object>> getRecordById(@PathVariable Long id) {
|
||||
return ResponseEntity.ok(Map.of());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取审批历史
|
||||
*/
|
||||
@GetMapping("/records/{recordId}/history")
|
||||
public ResponseEntity<List<Map<String, Object>>> getApprovalHistory(@PathVariable Long recordId) {
|
||||
return ResponseEntity.ok(List.of());
|
||||
}
|
||||
|
||||
/**
|
||||
* 审批请求体
|
||||
*/
|
||||
public static class ApprovalHandleRequest {
|
||||
private Long recordId;
|
||||
private String action; // approve, reject, transfer
|
||||
private String comment;
|
||||
|
||||
public Long getRecordId() { return recordId; }
|
||||
public void setRecordId(Long recordId) { this.recordId = recordId; }
|
||||
public String getAction() { return action; }
|
||||
public void setAction(String action) { this.action = action; }
|
||||
public String getComment() { return comment; }
|
||||
public void setComment(String comment) { this.comment = comment; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user