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>> getFlows() { return ResponseEntity.ok(List.of()); } /** * 获取待审批列表 */ @GetMapping("/pending") public ResponseEntity>> getPendingApprovals() { return ResponseEntity.ok(List.of()); } /** * 获取已审批列表 */ @GetMapping("/approved") public ResponseEntity>> getApprovedList() { return ResponseEntity.ok(List.of()); } /** * 获取我发起的审批 */ @GetMapping("/my") public ResponseEntity>> getMyApplications() { return ResponseEntity.ok(List.of()); } /** * 处理审批 */ @PostMapping("/handle") public ResponseEntity handleApproval(@RequestBody ApprovalHandleRequest request) { return ResponseEntity.ok().build(); } /** * 获取审批记录详情 */ @GetMapping("/records/{id}") public ResponseEntity> getRecordById(@PathVariable Long id) { return ResponseEntity.ok(Map.of()); } /** * 获取审批历史 */ @GetMapping("/records/{recordId}/history") public ResponseEntity>> 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; } } }