Quellcode durchsuchen

更新文章代码

fangqing vor 4 Tagen
Ursprung
Commit
3fe1190422

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java

@@ -347,7 +347,7 @@ public class SysProfileController extends BaseController {
     @PostMapping("/blockUser")
     @Transactional
     //@Anonymous
-    public AjaxResult blockTag(@RequestBody CommunityUserBlock communityUserBlock) {
+    public AjaxResult blockUser(@RequestBody CommunityUserBlock communityUserBlock) {
         if (Objects.isNull(communityUserBlock.getUserId()) || Objects.isNull(communityUserBlock.getPeerId())) {
             return AjaxResult.error("参数异常!");
         }

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

@@ -354,7 +354,8 @@ public class CommunityArticleServiceImpl extends ServiceImpl<CommunityArticleMap
                 //判断当前标签是否被当前登录用户拉黑
                 List<CommunityTagBlock> communityTagBlocks = communityTagBlockMapper.selectList(new QueryWrapper<CommunityTagBlock>()
                         .in("tag_id", tagList)
-                        .eq("user_id", userId));
+                        .eq("user_id", userId)
+                        .eq("is_block", 1));
 
                 for (CommunityTagBlock tagBlock : communityTagBlocks) {
                     if (tagBlock.isBlock()) {
@@ -514,7 +515,7 @@ public class CommunityArticleServiceImpl extends ServiceImpl<CommunityArticleMap
         //文章标签拉黑数据
         List<CommunityTagBlock> communityTagBlocks = redisCache.getCacheList(CacheConstants.COMMUNITY_TAG_BLOCK);
         if (communityTagBlocks.isEmpty()) {
-            communityTagBlocks = communityTagBlockMapper.selectList(new QueryWrapper<CommunityTagBlock>());
+            communityTagBlocks = communityTagBlockMapper.selectList(new QueryWrapper<CommunityTagBlock>().eq("is_block", 1));
             redisCache.setCacheList(CacheConstants.COMMUNITY_TAG_BLOCK, communityTagBlocks);
             redisCache.expire(CacheConstants.COMMUNITY_TAG_BLOCK, 24, TimeUnit.HOURS);
         }