Procházet zdrojové kódy

新增收藏接口

fangzhen před 9 měsíci
rodič
revize
fcc1631aec

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

@@ -88,7 +88,7 @@ public class CommunityArticleController extends BaseController {
         CommunityArticleCollect collect = communityArticleService.selectCommunityCollectById(communityArticleCollect);
         if (Objects.isNull(collect)) {
             //新增收藏
-            isSuccess = communityArticleService.insertCommunityCollectById(collect);
+            isSuccess = communityArticleService.insertCommunityCollectById(communityArticleCollect);
             message = "收藏成功";
         } else {
             //删除收藏

+ 1 - 1
ruoyi-generator/src/main/java/com/ruoyi/generator/service/CommunityArticleServiceImpl.java

@@ -110,7 +110,7 @@ public class CommunityArticleServiceImpl implements ICommunityArticleService {
      */
     @Override
     public CommunityArticleCollect selectCommunityCollectById(CommunityArticleCollect collect) {
-        return null;
+        return communityArticleMapper.selectCommunityCollectById(collect);
     }
 
     /**

+ 1 - 1
ruoyi-generator/src/main/resources/mapper/community/ArticleMapper.xml

@@ -177,7 +177,7 @@
     </delete>
 
     <!--收藏-->
-    <select id="selectCommunityCollectById" resultMap="CommunityCollectResult">
+    <select id="selectCommunityCollectById" resultMap="CommunityCollectResult" parameterType="communityArticleCollect">
         select collect_id, article_id, user_id, create_by, create_time, update_by, update_time from
         community_article_collect
         <where>