From 1a9e49d9ff210e39f6297150db758906a4f02e6f Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期五, 19 八月 2022 17:11:51 +0800 Subject: [PATCH] 依赖包版本升级 --- src/main/java/com/genersoft/iot/vmp/vmanager/log/LogController.java | 38 ++++++++++++++------------------------ 1 files changed, 14 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/log/LogController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/log/LogController.java index 65f5f7c..6ad1d9d 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/log/LogController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/log/LogController.java @@ -6,10 +6,10 @@ import com.genersoft.iot.vmp.utils.DateUtil; import com.genersoft.iot.vmp.vmanager.bean.WVPResult; import com.github.pagehelper.PageInfo; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -20,7 +20,7 @@ import java.text.ParseException; -@Api(tags = "鏃ュ織绠$悊") +@Tag(name = "鏃ュ織绠$悊") @CrossOrigin @RestController @RequestMapping("/api/log") @@ -45,16 +45,14 @@ * @param endTime 缁撴潫鏃堕棿 * @return */ - @ApiOperation("鍒嗛〉鏌ヨ鎶ヨ") @GetMapping("/all") - @ApiImplicitParams({ - @ApiImplicitParam(name="query", value = "鏌ヨ鍐呭", dataTypeClass = String.class), - @ApiImplicitParam(name="page", value = "褰撳墠椤�", required = true ,dataTypeClass = Integer.class), - @ApiImplicitParam(name="count", value = "姣忛〉鏌ヨ鏁伴噺", required = true ,dataTypeClass = Integer.class), - @ApiImplicitParam(name="type", value = "绫诲瀷" ,dataTypeClass = String.class), - @ApiImplicitParam(name="startTime", value = "鏌ヨ鍐呭" ,dataTypeClass = String.class), - @ApiImplicitParam(name="endTime", value = "鏌ヨ鍐呭" ,dataTypeClass = String.class), - }) + @Operation(summary = "鍒嗛〉鏌ヨ鎶ヨ") + @Parameter(name = "query", description = "鏌ヨ鍐呭", required = true) + @Parameter(name = "page", description = "褰撳墠椤�", required = true) + @Parameter(name = "count", description = "姣忛〉鏌ヨ鏁伴噺", required = true) + @Parameter(name = "type", description = "绫诲瀷", required = true) + @Parameter(name = "startTime", description = "寮�濮嬫椂闂�", required = true) + @Parameter(name = "endTime", description = "缁撴潫鏃堕棿", required = true) public ResponseEntity<PageInfo<LogDto>> getAll( @RequestParam int page, @RequestParam int count, @@ -76,14 +74,7 @@ logger.warn("鑷姩璁板綍鏃ュ織鍔熻兘宸插叧闂紝鏌ヨ缁撴灉鍙兘涓嶅畬鏁淬��"); } - try { - if (startTime != null) { - DateUtil.format.parse(startTime); - } - if (endTime != null) { - DateUtil.format.parse(endTime); - } - } catch (ParseException e) { + if (!DateUtil.verification(startTime, DateUtil.formatter) || !DateUtil.verification(endTime, DateUtil.formatter)){ return new ResponseEntity<>(null, HttpStatus.BAD_REQUEST); } @@ -95,9 +86,8 @@ * 娓呯┖鏃ュ織 * */ - @ApiOperation("娓呯┖鏃ュ織") + @Operation(summary = "鍋滄瑙嗛鍥炴斁") @DeleteMapping("/clear") - @ApiImplicitParams({}) public ResponseEntity<WVPResult<String>> clear() { int count = logService.clear(); -- Gitblit v1.8.0