package com.wtkj.controller; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.wtkj.service.ICommonService; import com.wtkj.service.ITaskService; import com.wtkj.util.Workload; import com.wtkj.vo.AuthUserInfo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; import org.springblade.core.secure.annotation.PreAuth; import org.springblade.core.tool.api.R; import org.springblade.core.tool.constant.RoleConstant; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.List; /** * @author Blizzard * @create at 2023-09-14 11:13 * @describe */ @RestController @AllArgsConstructor @RequestMapping("/common") @Api(value = "公共模块", tags = "公共模块") public class CommonController { private final ITaskService taskService; private final ICommonService commonService; /** * 当前登录用户信息 */ @GetMapping("/user-info") @ApiOperation(value = "当前登录用户信息", notes = "") @ApiOperationSupport(order = 1) public R userInfo() { return R.data(commonService.userInfo()); } /** * 导出工作量 */ @GetMapping("/export-task") @ApiOperation(value = "工作量导出", notes = "") @ApiOperationSupport(order = 2) @PreAuth(RoleConstant.HAS_ROLE_ADMIN) public void export(@RequestParam String date, HttpServletResponse response) throws IOException { List list = taskService.exportList(date); taskService.export(list, response); } }