diff --git a/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/controller/AppDynamicCommentController.java b/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/controller/AppDynamicCommentController.java index f5034af..1087e35 100644 --- a/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/controller/AppDynamicCommentController.java +++ b/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/controller/AppDynamicCommentController.java @@ -5,6 +5,8 @@ import java.io.IOException; import javax.servlet.http.HttpServletResponse; import com.ruoyi.app.domain.vo.AppDynamicCommentVo; +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.PostMapping; @@ -32,6 +34,7 @@ import com.ruoyi.common.core.web.page.TableDataInfo; */ @RestController @RequestMapping("/comment") +@Api(tags = "动态评论" , description = "动态评论") public class AppDynamicCommentController extends BaseController { @Autowired @@ -42,6 +45,7 @@ public class AppDynamicCommentController extends BaseController */ @RequiresPermissions("app:comment:list") @GetMapping("/list") + @ApiOperation(value = "动态评论列表", notes = "动态评论列表", httpMethod = "GET") public TableDataInfo list(AppDynamicComment appDynamicComment) { startPage(); @@ -55,6 +59,7 @@ public class AppDynamicCommentController extends BaseController @RequiresPermissions("app:comment:export") @Log(title = "动态评论", businessType = BusinessType.EXPORT) @PostMapping("/export") + @ApiOperation(value = "导出动态评论列表", notes = "导出动态评论列表", httpMethod = "POST") public void export(HttpServletResponse response, AppDynamicComment appDynamicComment) { List list = appDynamicCommentService.selectAppDynamicCommentList(appDynamicComment); @@ -67,6 +72,7 @@ public class AppDynamicCommentController extends BaseController */ @RequiresPermissions("app:comment:query") @GetMapping(value = "/{id}") + @ApiOperation(value = "获取动态评论详细信息", notes = "获取动态评论详细信息", httpMethod = "GET") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(appDynamicCommentService.selectAppDynamicCommentById(id)); @@ -77,7 +83,8 @@ public class AppDynamicCommentController extends BaseController */ @RequiresPermissions("app:comment:add") @Log(title = "动态评论", businessType = BusinessType.INSERT) - @PostMapping + @PostMapping(value = "add") + @ApiOperation(value = "新增动态评论", notes = "新增动态评论", httpMethod = "POST") public AjaxResult add(@RequestBody AppDynamicComment appDynamicComment) { return toAjax(appDynamicCommentService.insertAppDynamicComment(appDynamicComment)); @@ -88,7 +95,8 @@ public class AppDynamicCommentController extends BaseController */ @RequiresPermissions("app:comment:edit") @Log(title = "动态评论", businessType = BusinessType.UPDATE) - @PutMapping + @PutMapping(value = "edit") + @ApiOperation(value = "修改动态评论", notes = "修改动态评论", httpMethod = "PUT") public AjaxResult edit(@RequestBody AppDynamicComment appDynamicComment) { return toAjax(appDynamicCommentService.updateAppDynamicComment(appDynamicComment)); @@ -100,6 +108,7 @@ public class AppDynamicCommentController extends BaseController @RequiresPermissions("app:comment:remove") @Log(title = "动态评论", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") + @ApiOperation(value = "删除动态评论", notes = "删除动态评论", httpMethod = "DELETE") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(appDynamicCommentService.deleteAppDynamicCommentByIds(ids)); @@ -107,6 +116,7 @@ public class AppDynamicCommentController extends BaseController @RequiresPermissions("app:comment:list") @GetMapping("/treeList") + @ApiOperation(value = "评论树列表", notes = "评论树列表", httpMethod = "GET") public TableDataInfo treeList(AppDynamicComment appDynamicComment) { startPage(); diff --git a/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/controller/AppDynamicLikeController.java b/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/controller/AppDynamicLikeController.java index c361667..84cb1cd 100644 --- a/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/controller/AppDynamicLikeController.java +++ b/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/controller/AppDynamicLikeController.java @@ -3,6 +3,9 @@ package com.ruoyi.app.controller; import java.util.List; import java.io.IOException; import javax.servlet.http.HttpServletResponse; + +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.PostMapping; @@ -30,6 +33,7 @@ import com.ruoyi.common.core.web.page.TableDataInfo; */ @RestController @RequestMapping("/like") +@Api(tags = "动态点赞" , description = "动态点赞") public class AppDynamicLikeController extends BaseController { @Autowired @@ -40,6 +44,7 @@ public class AppDynamicLikeController extends BaseController */ @RequiresPermissions("app:like:list") @GetMapping("/list") + @ApiOperation(value = "查询动态点赞列表", notes = "查询动态点赞列表", httpMethod = "GET") public TableDataInfo list(AppDynamicLike appDynamicLike) { startPage(); @@ -53,6 +58,7 @@ public class AppDynamicLikeController extends BaseController @RequiresPermissions("app:like:export") @Log(title = "动态点赞", businessType = BusinessType.EXPORT) @PostMapping("/export") + @ApiOperation(value = "导出动态点赞列表", notes = "导出动态点赞列表", httpMethod = "POST") public void export(HttpServletResponse response, AppDynamicLike appDynamicLike) { List list = appDynamicLikeService.selectAppDynamicLikeList(appDynamicLike); @@ -65,6 +71,7 @@ public class AppDynamicLikeController extends BaseController */ @RequiresPermissions("app:like:query") @GetMapping(value = "/{id}") + @ApiOperation(value = "获取动态点赞详细信息", notes = "获取动态点赞详细信息", httpMethod = "GET") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(appDynamicLikeService.selectAppDynamicLikeById(id)); @@ -75,7 +82,8 @@ public class AppDynamicLikeController extends BaseController */ @RequiresPermissions("app:like:add") @Log(title = "动态点赞", businessType = BusinessType.INSERT) - @PostMapping + @PostMapping(value = "/add") + @ApiOperation(value = "新增动态点赞", notes = "新增动态点赞", httpMethod = "POST") public AjaxResult add(@RequestBody AppDynamicLike appDynamicLike) { return toAjax(appDynamicLikeService.insertAppDynamicLike(appDynamicLike)); @@ -86,7 +94,8 @@ public class AppDynamicLikeController extends BaseController */ @RequiresPermissions("app:like:edit") @Log(title = "动态点赞", businessType = BusinessType.UPDATE) - @PutMapping + @PutMapping(value = "/edit") + @ApiOperation(value = "修改动态点赞", notes = "修改动态点赞", httpMethod = "PUT") public AjaxResult edit(@RequestBody AppDynamicLike appDynamicLike) { return toAjax(appDynamicLikeService.updateAppDynamicLike(appDynamicLike)); @@ -98,6 +107,7 @@ public class AppDynamicLikeController extends BaseController @RequiresPermissions("app:like:remove") @Log(title = "动态点赞", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") + @ApiOperation(value = "删除动态点赞", notes = "删除动态点赞", httpMethod = "DELETE") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(appDynamicLikeService.deleteAppDynamicLikeByIds(ids)); diff --git a/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/controller/AppUserFriendController.java b/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/controller/AppUserFriendController.java index aad215f..372e253 100644 --- a/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/controller/AppUserFriendController.java +++ b/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/controller/AppUserFriendController.java @@ -3,6 +3,9 @@ package com.ruoyi.app.controller; import java.util.List; import java.io.IOException; import javax.servlet.http.HttpServletResponse; + +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.PostMapping; @@ -30,6 +33,7 @@ import com.ruoyi.common.core.web.page.TableDataInfo; */ @RestController @RequestMapping("/friend") +@Api(tags = "用户好友" , description = "用户好友") public class AppUserFriendController extends BaseController { @Autowired @@ -40,6 +44,7 @@ public class AppUserFriendController extends BaseController */ @RequiresPermissions("app:friend:list") @GetMapping("/list") + @ApiOperation(value = "查询用户好友列表", notes = "查询用户好友列表", httpMethod = "GET") public TableDataInfo list(AppUserFriend appUserFriend) { startPage(); @@ -53,6 +58,7 @@ public class AppUserFriendController extends BaseController @RequiresPermissions("app:friend:export") @Log(title = "用户好友", businessType = BusinessType.EXPORT) @PostMapping("/export") + @ApiOperation(value = "导出用户好友列表", notes = "导出用户好友列表", httpMethod = "POST") public void export(HttpServletResponse response, AppUserFriend appUserFriend) { List list = appUserFriendService.selectAppUserFriendList(appUserFriend); @@ -65,6 +71,7 @@ public class AppUserFriendController extends BaseController */ @RequiresPermissions("app:friend:query") @GetMapping(value = "/{id}") + @ApiOperation(value = "获取用户好友详细信息", notes = "获取用户好友详细信息", httpMethod = "GET") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(appUserFriendService.selectAppUserFriendById(id)); @@ -75,7 +82,8 @@ public class AppUserFriendController extends BaseController */ @RequiresPermissions("app:friend:add") @Log(title = "用户好友", businessType = BusinessType.INSERT) - @PostMapping + @PostMapping(value = "/add") + @ApiOperation(value = "新增用户好友", notes = "新增用户好友", httpMethod = "POST") public AjaxResult add(@RequestBody AppUserFriend appUserFriend) { return toAjax(appUserFriendService.insertAppUserFriend(appUserFriend)); @@ -86,7 +94,8 @@ public class AppUserFriendController extends BaseController */ @RequiresPermissions("app:friend:edit") @Log(title = "用户好友", businessType = BusinessType.UPDATE) - @PutMapping + @PutMapping(value = "/edit") + @ApiOperation(value = "修改用户好友", notes = "修改用户好友", httpMethod = "PUT") public AjaxResult edit(@RequestBody AppUserFriend appUserFriend) { return toAjax(appUserFriendService.updateAppUserFriend(appUserFriend)); @@ -98,6 +107,7 @@ public class AppUserFriendController extends BaseController @RequiresPermissions("app:friend:remove") @Log(title = "用户好友", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") + @ApiOperation(value = "删除用户好友", notes = "删除用户好友", httpMethod = "DELETE") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(appUserFriendService.deleteAppUserFriendByIds(ids)); diff --git a/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/service/impl/AppDynamicCommentServiceImpl.java b/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/service/impl/AppDynamicCommentServiceImpl.java index 3cc5126..7e3bb6b 100644 --- a/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/service/impl/AppDynamicCommentServiceImpl.java +++ b/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/service/impl/AppDynamicCommentServiceImpl.java @@ -62,7 +62,10 @@ public class AppDynamicCommentServiceImpl implements IAppDynamicCommentService { if (appDynamicComment.getParentId() > 0) { AppDynamicComment entity = appDynamicCommentMapper.selectAppDynamicCommentById(appDynamicComment.getId()); - appDynamicComment.setParentIds(entity.getParentIds() + "," + appDynamicComment.getParentId()); + appDynamicComment.setParentIds(appDynamicComment.getParentId() + ","); + if (StringUtils.isNotBlank(entity.getParentIds())) { + appDynamicComment.setParentIds(entity.getParentIds() + appDynamicComment.getParentId() + ","); + } } appDynamicComment.setCreateTime(DateUtils.getNowDate()); return appDynamicCommentMapper.insertAppDynamicComment(appDynamicComment);