package com.designhub.controller; import com.designhub.service.ExportService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; import java.io.IOException; /** * 数据导出Controller */ @Tag(name = "数据导出", description = "数据导出相关API") @RestController @RequestMapping("/api/export") @RequiredArgsConstructor public class ExportController { private final ExportService exportService; @Operation(summary = "导出任务列表") @GetMapping("/tasks") public void exportTasks( HttpServletResponse response, @RequestParam(required = false) String status, @RequestParam(required = false) Long publisherId ) throws IOException { exportService.exportTasks(response, status, publisherId); } @Operation(summary = "导出用户列表") @GetMapping("/users") public void exportUsers( HttpServletResponse response, @RequestParam(required = false) Long deptId, @RequestParam(required = false) Integer status ) throws IOException { exportService.exportUsers(response, deptId, status); } @Operation(summary = "导出部门列表") @GetMapping("/departments") public void exportDepartments(HttpServletResponse response) throws IOException { exportService.exportDepartments(response); } @Operation(summary = "导出设计师统计") @GetMapping("/designer-stats") public void exportDesignerStats(HttpServletResponse response) throws IOException { exportService.exportDesignerStats(response); } }