Explorar o código

新增更新合集信息接口

fangqing hai 5 meses
pai
achega
f2a091f197

+ 26 - 0
ruoyi-generator/src/main/java/com/ruoyi/generator/controller/CommunityArticleController.java

@@ -862,6 +862,32 @@ public class CommunityArticleController extends BaseController {
         return AjaxResult.success("删除成功!");
     }
 
+    /**
+     * 更新合集信息
+     * @param communityCollection
+     * @return
+     */
+    @ApiOperation("更新合集信息")
+    @PostMapping("/updateCollection")
+    @Transactional
+    public AjaxResult updateCollection(@RequestBody CommunityCollection communityCollection) {
+        if (Objects.isNull(communityCollection.getId())) {
+            return AjaxResult.error("合集ID不能为空");
+        }
+        Long userId = SecurityUtils.getLoginUser().getUserId();
+        try {
+            communityCollection.setUpdateBy(userId);
+            communityCollection.setUpdateTime(DateUtils.parseDate(DateUtils.getTime()));
+            communityCollectionMapper.updateById(communityCollection);
+        } catch (Exception e) {
+            System.out.println(e.getMessage());
+            throw new ProjectException();
+        }
+        return AjaxResult.success("文章更新成功!");
+    }
+
+
+
     /**
      * 合集内新增文章
      *