补充swagger注解

This commit is contained in:
linfeng 2022-11-14 13:48:51 +08:00
parent 906f4fb3fa
commit 1a7b99515d
2 changed files with 16 additions and 1 deletions

View File

@ -20,6 +20,10 @@ import io.linfeng.modules.app.annotation.Login;
import io.linfeng.modules.app.annotation.LoginUser; import io.linfeng.modules.app.annotation.LoginUser;
import io.linfeng.modules.app.form.AddThumbsForm; import io.linfeng.modules.app.form.AddThumbsForm;
import io.linfeng.modules.app.service.CommentThumbsService; 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.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -29,6 +33,7 @@ import org.springframework.web.bind.annotation.*;
* @date 2022/7/27 15:35 * @date 2022/7/27 15:35
* *
*/ */
@Api(tags = "用户端——评论")
@RestController @RestController
@RequestMapping("app/comment") @RequestMapping("app/comment")
public class AppCommentController { public class AppCommentController {
@ -42,6 +47,11 @@ public class AppCommentController {
* 评论列表 * 评论列表
*/ */
@GetMapping("/list") @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){ public R list(@RequestParam("postId")Integer postId,@RequestParam("page")Integer page){
AppPageUtils pages =commentService.queryCommentPage(postId,page); AppPageUtils pages =commentService.queryCommentPage(postId,page);
@ -54,6 +64,7 @@ public class AppCommentController {
*/ */
@Login @Login
@PostMapping("/thumbs") @PostMapping("/thumbs")
@ApiOperation("评论区的点赞")
public R thumbs(@RequestBody AddThumbsForm request, @LoginUser AppUserEntity user){ public R thumbs(@RequestBody AddThumbsForm request, @LoginUser AppUserEntity user){
commentThumbsService.addThumbs(request,user); commentThumbsService.addThumbs(request,user);
@ -65,6 +76,7 @@ public class AppCommentController {
*/ */
@Login @Login
@PostMapping("/cancelThumbs") @PostMapping("/cancelThumbs")
@ApiOperation("取消评论区的点赞")
public R cancelThumbs(@RequestBody AddThumbsForm request,@LoginUser AppUserEntity user){ public R cancelThumbs(@RequestBody AddThumbsForm request,@LoginUser AppUserEntity user){
commentThumbsService.cancelThumbs(request,user); commentThumbsService.cancelThumbs(request,user);

View File

@ -14,6 +14,8 @@ package io.linfeng.modules.app.controller;
import io.linfeng.common.utils.R; import io.linfeng.common.utils.R;
import io.linfeng.modules.admin.entity.SystemEntity; import io.linfeng.modules.admin.entity.SystemEntity;
import io.linfeng.modules.admin.service.SystemService; 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.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -23,7 +25,7 @@ import org.springframework.web.bind.annotation.RestController;
* @author linfeng * @author linfeng
* @date 2022/8/17 12:07 * @date 2022/8/17 12:07
*/ */
@Api(tags = "用户端——系统配置")
@RestController @RestController
@RequestMapping("app/system") @RequestMapping("app/system")
public class AppSystemConfigController { public class AppSystemConfigController {
@ -31,6 +33,7 @@ public class AppSystemConfigController {
@Autowired @Autowired
private SystemService systemService; private SystemService systemService;
@ApiOperation("logo配置")
@GetMapping("/miniConfig") @GetMapping("/miniConfig")
public R miniConfig(){ public R miniConfig(){
SystemEntity system = systemService.lambdaQuery() SystemEntity system = systemService.lambdaQuery()