From 93af1c6ffb9ae0e894689ad3a37b548e57d54cff Mon Sep 17 00:00:00 2001 From: linzhijie <19970921lzj> Date: 星期四, 11 三月 2021 19:10:07 +0800 Subject: [PATCH] 有注释的测评系统业务代码 --- src/main/java/com/ots/project/exam/controller/TExamLevelController.java | 48 ++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 40 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/ots/project/exam/controller/TExamLevelController.java b/src/main/java/com/ots/project/exam/controller/TExamLevelController.java index 169950d..3e8e1f0 100644 --- a/src/main/java/com/ots/project/exam/controller/TExamLevelController.java +++ b/src/main/java/com/ots/project/exam/controller/TExamLevelController.java @@ -1,4 +1,5 @@ package com.ots.project.exam.controller; + import com.ots.common.utils.StringUtils; import com.ots.common.utils.poi.ExcelUtil; import com.ots.framework.aspectj.lang.annotation.Log; @@ -19,31 +20,44 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; + import java.util.List; import java.util.Map; import java.util.stream.Collectors; +/** + * 闂嵎绫诲瀷Controller + * + * @author ots + * @date 2019-12-15 + */ @Controller @RequestMapping("/exam/level") public class TExamLevelController extends BaseController { private String prefix = "exam/level"; + @Autowired private ITExamLevelService tExamLevelService; + @Autowired private DictService dictService; + @RequiresPermissions("exam:level:view") @GetMapping() public String level() { return prefix + "/level"; } - + + /** + * 鏌ヨ闂嵎绫诲瀷鍒楄〃 + */ @RequiresPermissions("exam:level:list") @PostMapping("/list") @ResponseBody public TableDataInfo list(TExamLevel tExamLevel) { startPage(); List<TExamLevel> list = tExamLevelService.selectTExamLevelList(tExamLevel); - + // 缈昏瘧涓�涓� Item Template List<DictData> questionnaireTemplate = dictService.getType("questionnaire_template"); Map<String, String> dictMap = questionnaireTemplate.stream().collect(Collectors.toMap(DictData::getDictValue, DictData::getDictLabel)); list.stream().forEach(t -> { @@ -51,7 +65,10 @@ }); return getDataTable(list); } - + + /** + * 瀵煎嚭闂嵎绫诲瀷鍒楄〃 + */ @RequiresPermissions("exam:level:export") @PostMapping("/export") @ResponseBody @@ -60,7 +77,10 @@ ExcelUtil<TExamLevel> util = new ExcelUtil<TExamLevel>(TExamLevel.class); return util.exportExcel(list, "level"); } - + + /** + * 鏂板闂嵎绫诲瀷 + */ @GetMapping("/add") public String add(String uuid,ModelMap mmap) { if(StringUtils.isNotBlank(uuid)){ @@ -70,7 +90,10 @@ } return prefix + "/add"; } - + + /** + * 鏂板淇濆瓨闂嵎绫诲瀷 + */ @RequiresPermissions("exam:level:add") @Log(title = "闂嵎绫诲瀷", businessType = BusinessType.INSERT) @PostMapping("/add") @@ -82,14 +105,20 @@ } return toAjax(tExamLevelService.insertTExamLevel(tExamLevel)); } - + + /** + * 淇敼闂嵎绫诲瀷 + */ @GetMapping("/edit/{id}") public String edit(@PathVariable("id") Long id, ModelMap mmap) { TExamLevel tExamLevel = tExamLevelService.selectTExamLevelById(id); mmap.put("tExamLevel", tExamLevel); return prefix + "/edit"; } - + + /** + * 淇敼淇濆瓨闂嵎绫诲瀷 + */ @RequiresPermissions("exam:level:edit") @Log(title = "闂嵎绫诲瀷", businessType = BusinessType.UPDATE) @PostMapping("/edit") @@ -97,7 +126,10 @@ public AjaxResult editSave(TExamLevel tExamLevel) { return toAjax(tExamLevelService.updateTExamLevel(tExamLevel)); } - + + /** + * 鍒犻櫎闂嵎绫诲瀷 + */ @RequiresPermissions("exam:level:remove") @Log(title = "闂嵎绫诲瀷", businessType = BusinessType.DELETE) @PostMapping("/remove") -- Gitblit v1.9.1