From 1a7b99515d005d274e17264e1c3ec65cff8278d9 Mon Sep 17 00:00:00 2001 From: linfeng <2445465217@qq.com> Date: Mon, 14 Nov 2022 13:48:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85swagger=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/app/controller/AppCommentController.java | 12 ++++++++++++ .../app/controller/AppSystemConfigController.java | 5 ++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/linfeng/modules/app/controller/AppCommentController.java b/src/main/java/io/linfeng/modules/app/controller/AppCommentController.java index 9075c23..32634c3 100644 --- a/src/main/java/io/linfeng/modules/app/controller/AppCommentController.java +++ b/src/main/java/io/linfeng/modules/app/controller/AppCommentController.java @@ -20,6 +20,10 @@ import io.linfeng.modules.app.annotation.Login; import io.linfeng.modules.app.annotation.LoginUser; import io.linfeng.modules.app.form.AddThumbsForm; import io.linfeng.modules.app.service.CommentThumbsService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -29,6 +33,7 @@ import org.springframework.web.bind.annotation.*; * @date 2022/7/27 15:35 * */ +@Api(tags = "用户端——评论") @RestController @RequestMapping("app/comment") public class AppCommentController { @@ -42,6 +47,11 @@ public class AppCommentController { * 评论列表 */ @GetMapping("/list") + @ApiOperation("评论列表") + @ApiImplicitParams({ + @ApiImplicitParam(name = "postId", value = "帖子id", paramType = "query",dataType = "Integer", required = true), + @ApiImplicitParam(name = "page", value = "分页页码",paramType = "query", dataType = "Integer", required = true) + }) public R list(@RequestParam("postId")Integer postId,@RequestParam("page")Integer page){ AppPageUtils pages =commentService.queryCommentPage(postId,page); @@ -54,6 +64,7 @@ public class AppCommentController { */ @Login @PostMapping("/thumbs") + @ApiOperation("评论区的点赞") public R thumbs(@RequestBody AddThumbsForm request, @LoginUser AppUserEntity user){ commentThumbsService.addThumbs(request,user); @@ -65,6 +76,7 @@ public class AppCommentController { */ @Login @PostMapping("/cancelThumbs") + @ApiOperation("取消评论区的点赞") public R cancelThumbs(@RequestBody AddThumbsForm request,@LoginUser AppUserEntity user){ commentThumbsService.cancelThumbs(request,user); diff --git a/src/main/java/io/linfeng/modules/app/controller/AppSystemConfigController.java b/src/main/java/io/linfeng/modules/app/controller/AppSystemConfigController.java index fa871f7..d4cfe05 100644 --- a/src/main/java/io/linfeng/modules/app/controller/AppSystemConfigController.java +++ b/src/main/java/io/linfeng/modules/app/controller/AppSystemConfigController.java @@ -14,6 +14,8 @@ package io.linfeng.modules.app.controller; import io.linfeng.common.utils.R; import io.linfeng.modules.admin.entity.SystemEntity; import io.linfeng.modules.admin.service.SystemService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -23,7 +25,7 @@ import org.springframework.web.bind.annotation.RestController; * @author linfeng * @date 2022/8/17 12:07 */ - +@Api(tags = "用户端——系统配置") @RestController @RequestMapping("app/system") public class AppSystemConfigController { @@ -31,6 +33,7 @@ public class AppSystemConfigController { @Autowired private SystemService systemService; + @ApiOperation("logo配置") @GetMapping("/miniConfig") public R miniConfig(){ SystemEntity system = systemService.lambdaQuery()