|
@@ -12,8 +12,10 @@ import com.ruoyi.common.utils.SecurityUtils;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.generator.domain.Community.CommunityTag;
|
|
|
import com.ruoyi.generator.domain.Community.CommunityTagBlock;
|
|
|
+import com.ruoyi.generator.domain.Community.CommunityUserCircle;
|
|
|
import com.ruoyi.generator.mapper.community.CommunityTagBlockMapper;
|
|
|
import com.ruoyi.generator.mapper.community.CommunityTagMapper;
|
|
|
+import com.ruoyi.generator.mapper.community.CommunityUserCircleMapper;
|
|
|
import com.ruoyi.generator.service.ICommunityTagService;
|
|
|
import com.ruoyi.generator.vo.CommunityTagVo;
|
|
|
import io.swagger.annotations.Api;
|
|
@@ -51,6 +53,9 @@ public class CommunityTagController extends BaseController {
|
|
|
@Autowired
|
|
|
private RedisCache redisCache;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private CommunityUserCircleMapper communityUserCircleMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 获取标签信息
|
|
|
*/
|
|
@@ -77,6 +82,71 @@ public class CommunityTagController extends BaseController {
|
|
|
return AjaxResult.success(communityTags);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取我创建的标签
|
|
|
+ */
|
|
|
+ @ApiOperation("我创建的标签")
|
|
|
+ @GetMapping("/createdTags")
|
|
|
+ @Transactional
|
|
|
+ //@Anonymous
|
|
|
+ public AjaxResult createdTags(String tagName,Long userId) {
|
|
|
+ if (userId == null) {
|
|
|
+ userId = SecurityUtils.getUserId();
|
|
|
+ }
|
|
|
+ List<CommunityTag> communityTags = null;
|
|
|
+ try {
|
|
|
+ Page<CommunityTag> page = new Page<>(1, 20);
|
|
|
+ communityTags = communityTagService.page(page, new QueryWrapper<CommunityTag>().and((wrapper) -> {
|
|
|
+ wrapper.ne("is_delete", 1)
|
|
|
+ .or()
|
|
|
+ .isNull("is_delete");
|
|
|
+ })
|
|
|
+ .like("tag_name", tagName)
|
|
|
+ .eq("create_by", userId)
|
|
|
+ .orderByDesc("tag_hot")).getRecords();
|
|
|
+ } catch (Exception e) {
|
|
|
+ System.out.println(e.getMessage());
|
|
|
+ throw new ProjectException();
|
|
|
+ }
|
|
|
+
|
|
|
+ return AjaxResult.success(communityTags);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /* *//**
|
|
|
+ * 获取我创建的标签
|
|
|
+ *//*
|
|
|
+ @ApiOperation("我关注的标签")
|
|
|
+ @GetMapping("/likeTags")
|
|
|
+ @Transactional
|
|
|
+ //@Anonymous
|
|
|
+ public AjaxResult likeTags(String tagName,Long userId) {
|
|
|
+ if (userId == null) {
|
|
|
+ userId = SecurityUtils.getUserId();
|
|
|
+ }
|
|
|
+ List<CommunityTag> communityTags = null;
|
|
|
+ try {
|
|
|
+ //获取关注的圈子ID
|
|
|
+ List<CommunityUserCircle> communityUserCircles = communityUserCircleMapper
|
|
|
+ .selectList(new QueryWrapper<CommunityUserCircle>()
|
|
|
+ .eq("user_id", userId)
|
|
|
+ .eq("is_delete", 0));
|
|
|
+ System.out.println(communityUserCircles);
|
|
|
+
|
|
|
+ List<CommunityUserCircle> communityUserCircles = communityUserCircleMapper.selectList(new QueryWrapper<CommunityUserCircle>()
|
|
|
+ .eq("user_id", userId)
|
|
|
+ .and((wrapper) -> {
|
|
|
+ wrapper.ne("is_delete", 1).or().isNull("is_delete");
|
|
|
+ }));
|
|
|
+
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ System.out.println(e.getMessage());
|
|
|
+ throw new ProjectException();
|
|
|
+ }
|
|
|
+
|
|
|
+ return AjaxResult.success(communityTags);
|
|
|
+ }*/
|
|
|
|
|
|
/**
|
|
|
* 获取标签信息(当前用户是否已拉黑)
|