| | |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.Problems; |
| | | import com.doumee.service.business.ProblemsService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author 江蹄蹄 |
| | | * @date 2023/11/23 18:16 |
| | | * @date 2023/11/30 15:33 |
| | | */ |
| | | @Api(tags = "试题信息表") |
| | | @RestController |
| | |
| | | |
| | | @ApiOperation("根据ID修改") |
| | | @PostMapping("/updateById") |
| | | @RequiresPermissions("business:problems:update") |
| | | @RequiresPermissions("business:problems:updateById") |
| | | public ApiResponse updateById(@RequestBody Problems problems) { |
| | | problemsService.updateById(problems); |
| | | return ApiResponse.success(null); |
| | |
| | | |
| | | @ApiOperation("导出Excel") |
| | | @PostMapping("/exportExcel") |
| | | @RequiresPermissions("business:problems:exportExcel") |
| | | //@RequiresPermissions("business:problems:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<Problems> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(Problems.class).export(problemsService.findPage(pageWrap).getRecords(), "试题信息表", response); |
| | | } |
| | | |
| | | @ApiOperation("根据ID查询") |
| | | @GetMapping("/{id}") |
| | | @RequiresPermissions("business:problems:query") |
| | | //@RequiresPermissions("business:problems:query") |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(problemsService.findById(id)); |
| | | } |