|
@@ -0,0 +1,109 @@
|
|
|
+package com.miaxis.app.controller;
|
|
|
+
|
|
|
+import com.miaxis.common.annotation.Log;
|
|
|
+import com.miaxis.common.core.controller.BaseController;
|
|
|
+import com.miaxis.common.core.domain.Response;
|
|
|
+import com.miaxis.common.core.page.ResponsePageInfo;
|
|
|
+import com.miaxis.common.enums.BusinessTypeEnum;
|
|
|
+import com.miaxis.common.utils.poi.ExcelUtil;
|
|
|
+import com.miaxis.score.domain.ScoreInfo;
|
|
|
+import com.miaxis.score.service.IScoreInfoService;
|
|
|
+import io.swagger.annotations.*;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 【模拟考成绩】Controller
|
|
|
+ *
|
|
|
+ * @author miaxis
|
|
|
+ * @date 2021-08-23
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/score/info")
|
|
|
+@Api(tags={"【app-模拟考成绩】"})
|
|
|
+public class ScoreInfoController extends BaseController{
|
|
|
+ @Autowired
|
|
|
+ private IScoreInfoService scoreInfoService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询模拟考成绩列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('score:info:list')")
|
|
|
+ @GetMapping("/list")
|
|
|
+ @ApiOperation("查询模拟考成绩列表")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
|
|
|
+ @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
|
|
|
+ })
|
|
|
+ public ResponsePageInfo<ScoreInfo> list(@ModelAttribute ScoreInfo scoreInfo){
|
|
|
+ startPage();
|
|
|
+ List<ScoreInfo> list = scoreInfoService.selectScoreInfoList(scoreInfo);
|
|
|
+ return toResponsePageInfo(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出模拟考成绩列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('score:info:export')")
|
|
|
+ @Log(title = "模拟考成绩", businessType = BusinessTypeEnum.EXPORT)
|
|
|
+ @GetMapping("/export")
|
|
|
+ @ApiOperation("导出模拟考成绩列表Excel")
|
|
|
+ public Response<String> export(@ModelAttribute ScoreInfo scoreInfo){
|
|
|
+ List<ScoreInfo> list = scoreInfoService.selectScoreInfoList(scoreInfo);
|
|
|
+ ExcelUtil<ScoreInfo> util = new ExcelUtil<ScoreInfo>(ScoreInfo.class);
|
|
|
+ return util.exportExcel(list, "info");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取模拟考成绩详细信息
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('score:info:query')")
|
|
|
+ @GetMapping(value = "/{id}")
|
|
|
+ @ApiOperation("获取模拟考成绩详细信息")
|
|
|
+ public Response<ScoreInfo> getInfo(
|
|
|
+ @ApiParam(name = "id", value = "模拟考成绩参数", required = true)
|
|
|
+ @PathVariable("id") Long id
|
|
|
+ ){
|
|
|
+ return Response.success(scoreInfoService.getById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增模拟考成绩
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('score:info:add')")
|
|
|
+ @Log(title = "模拟考成绩", businessType = BusinessTypeEnum.INSERT)
|
|
|
+ @PostMapping
|
|
|
+ @ApiOperation("新增模拟考成绩")
|
|
|
+ public Response<Integer> add(@RequestBody ScoreInfo scoreInfo){
|
|
|
+ return toResponse(scoreInfoService.save(scoreInfo) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改模拟考成绩
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('score:info:edit')")
|
|
|
+ @Log(title = "模拟考成绩", businessType = BusinessTypeEnum.UPDATE)
|
|
|
+ @PutMapping
|
|
|
+ @ApiOperation("修改模拟考成绩")
|
|
|
+ public Response<Integer> edit(@RequestBody ScoreInfo scoreInfo){
|
|
|
+ return toResponse(scoreInfoService.updateById(scoreInfo) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除模拟考成绩
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('score:info:remove')")
|
|
|
+ @Log(title = "模拟考成绩", businessType = BusinessTypeEnum.DELETE)
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ @ApiOperation("删除模拟考成绩")
|
|
|
+ public Response<Integer> remove(
|
|
|
+ @ApiParam(name = "ids", value = "模拟考成绩ids参数", required = true)
|
|
|
+ @PathVariable Long[] ids
|
|
|
+ ){
|
|
|
+ return toResponse(scoreInfoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
|
|
|
+ }
|
|
|
+}
|