5.23
package com.example.baoli.controller;
import com.example.baoli.service.ApprovalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/api/operators")
public class OperatorController {
@Autowired
private ApprovalService approvalService;
/**
* 获取所有操作人列表(从审批记录中提取)
*/
@GetMapping
public ResponseEntity<List<String>> getAllOperators() {
List<String> operators = approvalService.getDistinctOperators();
return ResponseEntity.ok(operators);
}
/**
* 获取所有申请人列表
*/
@GetMapping("/applicants")
public ResponseEntity<List<String>> getAllApplicants() {
List<String> applicants = approvalService.getDistinctApplicants();
return ResponseEntity.ok(applicants);
}
/**
* 获取所有审核人列表
*/
@GetMapping("/approvers")
public ResponseEntity<List<String>> getAllApprovers() {
List<String> approvers = approvalService.getDistinctApprovers();
return ResponseEntity.ok(approvers);
}
/**
* 获取所有部门列表
*/
@GetMapping("/departments")
public ResponseEntity<List<String>> getAllDepartments() {
List<String> departments = approvalService.getDistinctDepartments();
return ResponseEntity.ok(departments);
}
}
浙公网安备 33010602011771号