From aed297a5fbc8df9dab01b28da21f872ee546b43c Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期一, 13 十月 2025 16:15:11 +0800
Subject: [PATCH] 2025.10.13 1. 统一调整controller层的返回类型,通过添加全局响应增强器GlobalResponseAdvice来管理返回结果; 2. 新增mybatis-generator自定义插件,实现给数据库实体entity自动添加swagger注解@ApiModel和@ApiModelProperty
---
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ProblemlistController.kt | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ProblemlistController.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ProblemlistController.kt
index dac5f41..64dbbce 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ProblemlistController.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ProblemlistController.kt
@@ -2,6 +2,7 @@
import cn.flightfeather.supervision.common.log.BizLog
import cn.flightfeather.supervision.common.log.WorkStreamLogInfo
+import cn.flightfeather.supervision.config.IgnoreResponseAdvice
import cn.flightfeather.supervision.domain.ds1.entity.Problemlist
import cn.flightfeather.supervision.lightshare.service.ProblemlistService
import cn.flightfeather.supervision.lightshare.service.SubtaskService
@@ -21,12 +22,15 @@
val problemlistService: ProblemlistService,
val subtaskService: SubtaskService, private val bizLog: BizLog,
) {
+ @IgnoreResponseAdvice
@GetMapping
fun getAll() = problemlistService.findAll()
+ @IgnoreResponseAdvice
@PutMapping
fun add(@RequestBody problemlist: Problemlist) = problemlistService.save(problemlist)
+ @IgnoreResponseAdvice
@PostMapping
fun update(@RequestBody problemlist: Problemlist):Int{
val res = problemlistService.update(problemlist)
@@ -38,46 +42,57 @@
return res
}
+ @IgnoreResponseAdvice
@GetMapping("/{id}")
fun getById(@PathVariable id: String) = problemlistService.findByID(id)
+ @IgnoreResponseAdvice
@DeleteMapping("/{id}")
fun delete(@PathVariable id: String) = problemlistService.delete(id)
+
@PostMapping("/{id}")
fun setDeleteStatus(@PathVariable id: String) = problemlistService.setDeleteStatus(id)
+ @IgnoreResponseAdvice
@PostMapping("/add")
fun addProblem(@RequestBody problemlistVo: ProblemListVo) {
problemlistService.addProblem(problemlistVo)
}
+ @IgnoreResponseAdvice
@PostMapping("/getbyarea")
fun getByArea(@RequestBody areaVo: AreaVo): List<ProblemListVo> = problemlistService.getByArea(areaVo)
+ @IgnoreResponseAdvice
@GetMapping("/getbytoptask")
fun getByTopTask(@RequestParam(value = "tguid", required = true) tguid: String): List<ProblemListVo> =
problemlistService.getByTopTask(tguid)
+ @IgnoreResponseAdvice
@PostMapping("/getStatisticalResult")
fun getStatisticalResult(@RequestBody areaVo: AreaVo): List<StatisticsVo> =
problemlistService.getStatisticalResult(areaVo)
+ @IgnoreResponseAdvice
@PostMapping("/getStatisticalResultById")
fun getStatisticalResult(
@RequestParam(value = "id", required = true) topTaskId: String,
@RequestParam(value = "curSceneTypeId", required = true) sceneTypeId: String,
): List<StatisticsVo> = problemlistService.getStatisticalResultById(topTaskId, sceneTypeId)
+ @IgnoreResponseAdvice
@PostMapping("/getChargeResult")
fun getChargeResult(@RequestBody areaVo: AreaVo): ChargeInfoVo = problemlistService.getChargeResult(areaVo)
+ @IgnoreResponseAdvice
@GetMapping("/getProblemsByScene")
fun getProblemsByScene(
@RequestParam(value = "sceneId", required = true) sceneId: String,
@RequestParam date: String,
): List<ProblemListVo> = problemlistService.getProblemByScene(sceneId, date)
+ @IgnoreResponseAdvice
@GetMapping("/month_anlysis")
fun getMonthProblemsById(
@RequestParam(value = "taskId", required = true) taskId: String,
@@ -127,6 +142,7 @@
@ApiParam("鏂板鏁存敼鍥剧墖") @RequestPart("images") images: Array<MultipartFile>,
) = resPack { problemlistService.updateChange(problemId, deleteImg, images) }
+ @IgnoreResponseAdvice
@ApiOperation(value = "閫氳繃浠诲姟鏌ユ壘闂")
@GetMapping("/subtask")
fun getBySubTask(
--
Gitblit v1.9.3