提交 f8ca6db7 作者: 张小凤

Dynamic(update)

上级 50be5e18
...@@ -4,6 +4,7 @@ import com.mmc.csf.common.util.page.PageResult; ...@@ -4,6 +4,7 @@ import com.mmc.csf.common.util.page.PageResult;
import com.mmc.csf.common.util.web.ResultBody; import com.mmc.csf.common.util.web.ResultBody;
import com.mmc.csf.release.dao.gambit.GambitDao; import com.mmc.csf.release.dao.gambit.GambitDao;
import com.mmc.csf.release.entity.forum.ForumDynamicUserDO; import com.mmc.csf.release.entity.forum.ForumDynamicUserDO;
import com.mmc.csf.release.entity.gambit.ForumAttentionDO;
import com.mmc.csf.release.forum.vo.CommentVO; import com.mmc.csf.release.forum.vo.CommentVO;
import com.mmc.csf.release.forum.vo.DynamicVO; import com.mmc.csf.release.forum.vo.DynamicVO;
import com.mmc.csf.release.forum.vo.ReplyToAReviewVO; import com.mmc.csf.release.forum.vo.ReplyToAReviewVO;
...@@ -112,5 +113,13 @@ public class DynamicController extends BaseController { ...@@ -112,5 +113,13 @@ public class DynamicController extends BaseController {
} }
@ApiOperation(value = "new飞手列表是否关注")
@GetMapping("/getPilot")
public ResultBody<ForumAttentionDO> getPilot(@RequestParam Integer userAccountId){
return ResultBody.success(dynamicService.getPilot(userAccountId));
}
} }
package com.mmc.csf.release.dao; package com.mmc.csf.release.dao;
import com.mmc.csf.release.entity.forum.*; import com.mmc.csf.release.entity.forum.*;
import com.mmc.csf.release.entity.gambit.ForumAttentionDO;
import com.mmc.csf.release.entity.gambit.ForumGambitDO; import com.mmc.csf.release.entity.gambit.ForumGambitDO;
import com.mmc.csf.release.gambit.dto.ForumGambitDTO; import com.mmc.csf.release.gambit.dto.ForumGambitDTO;
import com.mmc.csf.release.gambit.dto.PostingLeaderboardDTO; import com.mmc.csf.release.gambit.dto.PostingLeaderboardDTO;
...@@ -204,4 +205,8 @@ public interface DynamicDao { ...@@ -204,4 +205,8 @@ public interface DynamicDao {
void updateDiscussionCounts(Integer id); void updateDiscussionCounts(Integer id);
Integer gambitName(String gambitName); Integer gambitName(String gambitName);
List<ForumAttentionDO> getPilot(Integer userAccountId);
List<ForumAttentionDO> getPilots(Integer userAccountId);
} }
...@@ -2,6 +2,7 @@ package com.mmc.csf.release.service; ...@@ -2,6 +2,7 @@ package com.mmc.csf.release.service;
import com.mmc.csf.common.util.page.PageResult; import com.mmc.csf.common.util.page.PageResult;
import com.mmc.csf.common.util.web.ResultBody; import com.mmc.csf.common.util.web.ResultBody;
import com.mmc.csf.release.entity.gambit.ForumAttentionDO;
import com.mmc.csf.release.forum.vo.CommentVO; import com.mmc.csf.release.forum.vo.CommentVO;
import com.mmc.csf.release.forum.vo.DynamicVO; import com.mmc.csf.release.forum.vo.DynamicVO;
import com.mmc.csf.release.forum.vo.ReplyToAReviewVO; import com.mmc.csf.release.forum.vo.ReplyToAReviewVO;
...@@ -70,4 +71,6 @@ public interface DynamicService { ...@@ -70,4 +71,6 @@ public interface DynamicService {
ResultBody reviewLikes(Integer id, Integer userAccountId, Boolean status); ResultBody reviewLikes(Integer id, Integer userAccountId, Boolean status);
PageResult postingLeaderboard(PostingLeaderboardQO postingLeaderboardQO); PageResult postingLeaderboard(PostingLeaderboardQO postingLeaderboardQO);
List<ForumAttentionDO> getPilot(Integer userAccountId);
} }
...@@ -38,10 +38,7 @@ import org.springframework.web.client.RestTemplate; ...@@ -38,10 +38,7 @@ import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
...@@ -539,6 +536,21 @@ public class DynamicServiceImpl implements DynamicService { ...@@ -539,6 +536,21 @@ public class DynamicServiceImpl implements DynamicService {
return PageResult.buildPage(pageNo, postingLeaderboardQO.getPageSize(),postingLeaderboardDTOS.size(),postingLeaderboardDTOS); return PageResult.buildPage(pageNo, postingLeaderboardQO.getPageSize(),postingLeaderboardDTOS.size(),postingLeaderboardDTOS);
} }
@Override
public List<ForumAttentionDO> getPilot(Integer userAccountId) {
List<ForumAttentionDO> list = new ArrayList<>();
List<ForumAttentionDO> forumAttentionDOS=dynamicDao.getPilot(userAccountId);
for (ForumAttentionDO forumAttentionDO : forumAttentionDOS) {
list.add(forumAttentionDO);
}
List<ForumAttentionDO> forumAttentionList=dynamicDao.getPilots(userAccountId);
for (ForumAttentionDO forumAttentionDO : forumAttentionList) {
list.add(forumAttentionDO);
}
List<ForumAttentionDO> collect = list.stream().distinct().collect(Collectors.toList());
return collect;
}
public UserAccountVO info( Integer userAccountId) { public UserAccountVO info( Integer userAccountId) {
String token = null; String token = null;
......
...@@ -104,6 +104,30 @@ ...@@ -104,6 +104,30 @@
</if> </if>
</select> </select>
<select id="getPilot" resultType="com.mmc.csf.release.entity.gambit.ForumAttentionDO">
select id,user_account_id,create_time,update_time,attention_user_account_id,`status`,mutual_attention
from forum_attention where attention_user_account_id=#{userAccountId}
</select>
<select id="getPilots" resultType="com.mmc.csf.release.entity.gambit.ForumAttentionDO">
SELECT
id,
user_account_id,
create_time,
update_time,
attention_user_account_id,
`status`,
mutual_attention
FROM
forum_attention
WHERE
mutual_attention = 1
AND attention_user_account_id IN ( #{userAccountId} )
OR user_account_id IN (
#{userAccountId}
)
</select>
<update id="updateDiscussionCount"> <update id="updateDiscussionCount">
update forum_gambit update forum_gambit
set discussion_count=#{count}, set discussion_count=#{count},
...@@ -421,7 +445,8 @@ ...@@ -421,7 +445,8 @@
fd.comments_count, fd.comments_count,
fd.create_time, fd.create_time,
fd.id AS dynamicId, fd.id AS dynamicId,
fdg.gambit_id fdg.gambit_id,
fd.transpond
FROM FROM
forum_dynamic fd forum_dynamic fd
INNER JOIN forum_dynamic_gambit fdg ON fd.id = fdg.dynamic_id INNER JOIN forum_dynamic_gambit fdg ON fd.id = fdg.dynamic_id
......
...@@ -41,3 +41,4 @@ data-filter: ...@@ -41,3 +41,4 @@ data-filter:
- /release/dynamic/recentNews - /release/dynamic/recentNews
- /release/curriculum/getCurriculumCount - /release/curriculum/getCurriculumCount
- /release/report/getReleaseReportData - /release/report/getReleaseReportData
- /release/dynamic/getPilot
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论