提交 3b82c973 作者: zhenjie

Merge branch 'develop'

package com.mmc.csf.release.forum.vo; package com.mmc.csf.release.forum.vo;
import com.mmc.csf.release.gambit.dto.ForumGambitDTO;
import com.mmc.csf.release.gambit.vo.ForumGambitVO;
import com.mmc.csf.release.model.group.Create; import com.mmc.csf.release.model.group.Create;
import com.mmc.csf.release.model.group.Update; import com.mmc.csf.release.model.group.Update;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -79,5 +81,15 @@ public class DynamicVO implements Serializable { ...@@ -79,5 +81,15 @@ public class DynamicVO implements Serializable {
@ApiModelProperty("评论") @ApiModelProperty("评论")
private ForumReviewVO forumReviewVO; private ForumReviewVO forumReviewVO;
@ApiModelProperty(value = "话题列表")
private List<ForumGambitDTO> forumGambitDTOList;
@ApiModelProperty(value = "转发数")
private Integer transpond;
@ApiModelProperty(value = "关注状态")
private Boolean status;
} }
package com.mmc.csf.release.forum.vo; package com.mmc.csf.release.forum.vo;
import com.mmc.csf.user.vo.UserAccountVO;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
...@@ -47,6 +48,12 @@ public class ForumReviewVO implements Serializable { ...@@ -47,6 +48,12 @@ public class ForumReviewVO implements Serializable {
@ApiModelProperty(value = "pid") @ApiModelProperty(value = "pid")
private Integer pid; private Integer pid;
@ApiModelProperty(value = "status")
private Boolean status;
@ApiModelProperty(value = "用户信息")
private UserAccountVO userAccountVO;
} }
package com.mmc.csf.release.gambit.dto;
import com.mmc.csf.release.forum.vo.DynamicVO;
import com.mmc.csf.release.forum.vo.ForumReviewVO;
import com.mmc.csf.release.forum.vo.MediaVO;
import com.mmc.csf.release.forum.vo.UserBaseInfoVO;
import com.mmc.csf.release.model.group.Create;
import com.mmc.csf.release.model.group.Update;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @Author small
* @Date 2023/9/26 15:32
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class ForumDynamicGambitDTO {
@ApiModelProperty(value = "话题名称",example = "#深圳暴雨,#深圳大雨")
private List<String> gambitName;
@ApiModelProperty(value = "话题图标",example = "小程序给默认值")
@NotBlank(message = "话题图标不能为空",groups = {Create.class, Update.class})
private String gambitIcon;
@ApiModelProperty(value = "话题封面",example = "小程序给默认封面")
@NotBlank(message = "话题封面不能为空",groups = {Create.class,Update.class})
private String gambitCover;
@ApiModelProperty(value = "发布动态用户信息")
private UserBaseInfoVO userBaseInfo;
@ApiModelProperty(value = "用户id")
private Integer userAccountId;
@ApiModelProperty(value = "动态id")
private Integer id;
@ApiModelProperty(value = "动态描述")
private String description;
@ApiModelProperty(value = "位置信息")
private String location;
@ApiModelProperty(value = "纬度")
private BigDecimal lat;
@ApiModelProperty(value = "经度")
private BigDecimal lon;
@ApiModelProperty(value = "媒体资源")
private List<MediaVO> mediaVO;
@ApiModelProperty(value = "点赞数")
private Integer likesCount;
@ApiModelProperty(value = "评论数")
private Integer commentCount;
@ApiModelProperty(value = "是否点赞")
private Boolean likes;
@ApiModelProperty(value = "动态发布时间")
private Date dynamicPublishTime;
@ApiModelProperty(value = "评论信息")
private List<DynamicVO> commentAndReplyVO;
@ApiModelProperty("评论")
private ForumReviewVO forumReviewVO;
@ApiModelProperty(value = "话题列表")
private List<ForumGambitDTO> forumGambitDTOList;
@ApiModelProperty(value = "转发数")
private Integer transpond;
}
...@@ -33,6 +33,8 @@ public class AllReviewQO { ...@@ -33,6 +33,8 @@ public class AllReviewQO {
@ApiModelProperty(value = "动态id",example = "1") @ApiModelProperty(value = "动态id",example = "1")
private String dynamicId; private String dynamicId;
@ApiModelProperty(value = "用户id",example = "1",hidden = true)
private Integer userAccountId;
/** /**
* 初始化起始查询行并返回当前页 * 初始化起始查询行并返回当前页
......
...@@ -36,6 +36,9 @@ public class AppReplyQO { ...@@ -36,6 +36,9 @@ public class AppReplyQO {
@ApiModelProperty(value = "动态id",example = "1") @ApiModelProperty(value = "动态id",example = "1")
private Integer dynamicId; private Integer dynamicId;
@ApiModelProperty(value = "用户id",example = "1")
private Integer userAccountId;
/** /**
* 初始化起始查询行并返回当前页 * 初始化起始查询行并返回当前页
......
...@@ -18,4 +18,4 @@ patches: ...@@ -18,4 +18,4 @@ patches:
images: images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG - name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/ims newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/ims
newTag: ea6c7437234915d2d68ef26d6d066727a096f273 newTag: 0ca0dcbbec31cd245461403e1df6bc03bd0380df
...@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.List;
/** /**
* @Author LW * @Author LW
...@@ -81,10 +82,14 @@ public class DynamicController extends BaseController { ...@@ -81,10 +82,14 @@ public class DynamicController extends BaseController {
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = DynamicVO.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = DynamicVO.class)})
@GetMapping("/dynamicList") @GetMapping("/dynamicList")
public ResultBody<DynamicVO> dynamicList( public ResultBody<DynamicVO> dynamicList(
@RequestParam Integer pageNo, @RequestParam Integer pageSize, HttpServletRequest request) { @RequestParam Integer pageNo, @RequestParam Integer pageSize, HttpServletRequest request,
@RequestParam(required = false) Integer gambitId, @RequestParam(required = false) Integer id,
@RequestParam(required = false) Integer userAccountId,
@RequestParam(required = false) String description,
@RequestParam(required = false) List<String> gambitName) {
return ResultBody.success( return ResultBody.success(
dynamicService.dynamicList( dynamicService.dynamicList(
pageNo, pageSize, this.getUserLoginInfoFromRedis(request).getUserAccountId(), request)); pageNo, pageSize, this.getUserLoginInfoFromRedis(request).getUserAccountId(), request,gambitId,id,userAccountId,description,gambitName));
} }
......
...@@ -2,6 +2,8 @@ package com.mmc.csf.release.controller; ...@@ -2,6 +2,8 @@ package com.mmc.csf.release.controller;
import com.mmc.csf.common.util.web.ResultBody; import com.mmc.csf.common.util.web.ResultBody;
import com.mmc.csf.release.entity.forum.*; import com.mmc.csf.release.entity.forum.*;
import com.mmc.csf.release.forum.vo.DynamicVO;
import com.mmc.csf.release.gambit.dto.ForumDynamicGambitDTO;
import com.mmc.csf.release.gambit.dto.ForumGambitDTO; import com.mmc.csf.release.gambit.dto.ForumGambitDTO;
import com.mmc.csf.release.gambit.qo.*; import com.mmc.csf.release.gambit.qo.*;
import com.mmc.csf.release.gambit.vo.ForumGambitVO; import com.mmc.csf.release.gambit.vo.ForumGambitVO;
...@@ -105,12 +107,16 @@ public class GambitController extends BaseController{ ...@@ -105,12 +107,16 @@ public class GambitController extends BaseController{
@ApiOperation(value = "动态对应的所有评论") @ApiOperation(value = "动态对应的所有评论")
@PostMapping("/allCommentList") @PostMapping("/allCommentList")
public ResultBody<ForumReviewDO> allCommentList(HttpServletRequest request, @RequestBody AllReviewQO allReviewQO){ public ResultBody<ForumReviewDO> allCommentList(HttpServletRequest request, @RequestBody AllReviewQO allReviewQO){
Integer userAccountId = this.getUserLoginInfoFromRedis(request).getUserAccountId();
allReviewQO.setUserAccountId(userAccountId);
return ResultBody.success(gambitService.allCommentList(allReviewQO)); return ResultBody.success(gambitService.allCommentList(allReviewQO));
} }
@ApiOperation(value = "动态下某一条评论下面所有回复") @ApiOperation(value = "动态下某一条评论下面所有回复")
@PostMapping("/replyList") @PostMapping("/replyList")
public ResultBody<ForumReviewDO> replyList(HttpServletRequest request, @RequestBody AppReplyQO replyQO){ public ResultBody<ForumReviewDO> replyList(HttpServletRequest request, @RequestBody AppReplyQO replyQO){
Integer userAccountId = this.getUserLoginInfoFromRedis(request).getUserAccountId();
replyQO.setUserAccountId(userAccountId);
return ResultBody.success(gambitService.replyList(replyQO)); return ResultBody.success(gambitService.replyList(replyQO));
} }
...@@ -122,8 +128,8 @@ public class GambitController extends BaseController{ ...@@ -122,8 +128,8 @@ public class GambitController extends BaseController{
@ApiOperation(value = "赞过") @ApiOperation(value = "赞过")
@PostMapping("/liked") @PostMapping("/liked")
public ResultBody<ForumDynamicGambitDO> liked(HttpServletRequest request, @RequestBody UserTopicDynamicsQO userTopicDynamicsQO){ public ResultBody<DynamicVO> liked(HttpServletRequest request, @RequestBody UserTopicDynamicsQO userTopicDynamicsQO){
return ResultBody.success(gambitService.liked(userTopicDynamicsQO)); return ResultBody.success(gambitService.liked(userTopicDynamicsQO,request));
} }
@ApiOperation(value = "我的关注") @ApiOperation(value = "我的关注")
...@@ -142,7 +148,8 @@ public class GambitController extends BaseController{ ...@@ -142,7 +148,8 @@ public class GambitController extends BaseController{
@ApiOperation(value = "单个用户信息") @ApiOperation(value = "单个用户信息")
@GetMapping("/userMessage") @GetMapping("/userMessage")
public ResultBody<ForumCountDO> userMessage(HttpServletRequest request, @ApiParam(value = "userAccountId") @RequestParam Integer userAccountId){ public ResultBody<ForumCountDO> userMessage(HttpServletRequest request, @ApiParam(value = "userAccountId") @RequestParam Integer userAccountId){
return gambitService.userMessage(userAccountId); Integer userId = this.getUserLoginInfoFromRedis(request).getUserAccountId();
return gambitService.userMessage(userAccountId,userId);
} }
......
...@@ -4,6 +4,7 @@ import java.util.List; ...@@ -4,6 +4,7 @@ import java.util.List;
import com.mmc.csf.release.entity.forum.*; import com.mmc.csf.release.entity.forum.*;
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.PostingLeaderboardDTO; import com.mmc.csf.release.gambit.dto.PostingLeaderboardDTO;
import com.mmc.csf.release.gambit.qo.ForumGambitQO; import com.mmc.csf.release.gambit.qo.ForumGambitQO;
import com.mmc.csf.release.gambit.qo.PostingLeaderboardQO; import com.mmc.csf.release.gambit.qo.PostingLeaderboardQO;
...@@ -83,7 +84,7 @@ public interface DynamicDao { ...@@ -83,7 +84,7 @@ public interface DynamicDao {
* *
* @return int * @return int
*/ */
int countDynamicList(); int countDynamicList(Integer id,Integer userAccountIds,String description);
/** /**
* 动态列表 * 动态列表
...@@ -92,7 +93,9 @@ public interface DynamicDao { ...@@ -92,7 +93,9 @@ public interface DynamicDao {
* @param pageSize 页面大小 * @param pageSize 页面大小
* @return {@link List}<{@link ForumDynamicDO}> * @return {@link List}<{@link ForumDynamicDO}>
*/ */
List<ForumDynamicDO> dynamicList(int itemIndex, Integer pageSize); List<ForumDynamicDO> dynamicList(int itemIndex, Integer pageSize,Integer id,Integer userAccountIds,String description);
List<ForumDynamicDO> dynamicListGambit(int itemIndex, Integer pageSize,Integer id,Integer userAccountIds,Integer gambitId);
/** /**
* 列表动态图片 * 列表动态图片
...@@ -197,4 +200,10 @@ public interface DynamicDao { ...@@ -197,4 +200,10 @@ public interface DynamicDao {
void deleteReview(Integer id, Integer userAccountId); void deleteReview(Integer id, Integer userAccountId);
List<PostingLeaderboardDTO> postingLeaderboardCount(PostingLeaderboardQO postingLeaderboardQO); List<PostingLeaderboardDTO> postingLeaderboardCount(PostingLeaderboardQO postingLeaderboardQO);
List<ForumGambitDTO> selectGambitDTO(Integer id);
void updateDiscussionCounts(Integer id);
Integer gambitName(String gambitName);
} }
...@@ -121,4 +121,18 @@ public interface GambitDao { ...@@ -121,4 +121,18 @@ public interface GambitDao {
ForumCountDO userMessage(Integer userAccountId); ForumCountDO userMessage(Integer userAccountId);
ForumReviewVO selectForumReviewMessage(Integer dynamicId); ForumReviewVO selectForumReviewMessage(Integer dynamicId);
int replyCount(ForumReviewDO forumReviewDO);
int selectCountAttention(Integer userId);
int selectCountAttentions(Integer userAccountId,Integer userId);
int selectGambitAndDynamic(Integer id);
Integer selectStatus(Integer id, Integer userId);
List<DynamicGambitDO> selectDynamicGambit(Integer dynamicId);
void updateGambits(Integer gambitId);
} }
...@@ -38,6 +38,9 @@ public class ForumCountDO implements Serializable { ...@@ -38,6 +38,9 @@ public class ForumCountDO implements Serializable {
@ApiModelProperty(value = "修改时间") @ApiModelProperty(value = "修改时间")
private String updateTime; private String updateTime;
@ApiModelProperty(value = "是否关注",example = "true表示已关注 null没有关注")
private Boolean status;
} }
...@@ -7,6 +7,7 @@ import com.mmc.csf.release.entity.common.BaseDO; ...@@ -7,6 +7,7 @@ import com.mmc.csf.release.entity.common.BaseDO;
import com.mmc.csf.release.forum.dto.DynamicInfoDTO; import com.mmc.csf.release.forum.dto.DynamicInfoDTO;
import com.mmc.csf.release.forum.vo.DynamicVO; import com.mmc.csf.release.forum.vo.DynamicVO;
import com.mmc.csf.release.forum.vo.ForumReviewVO; import com.mmc.csf.release.forum.vo.ForumReviewVO;
import com.mmc.csf.release.gambit.dto.ForumGambitDTO;
import com.mmc.csf.release.model.group.Create; import com.mmc.csf.release.model.group.Create;
import com.mmc.csf.release.model.group.Update; import com.mmc.csf.release.model.group.Update;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -84,6 +85,12 @@ public class ForumDynamicDO extends BaseDO implements Serializable { ...@@ -84,6 +85,12 @@ public class ForumDynamicDO extends BaseDO implements Serializable {
@ApiModelProperty("评论") @ApiModelProperty("评论")
private ForumReviewVO forumReviewVO; private ForumReviewVO forumReviewVO;
@ApiModelProperty("话题列表")
private List<ForumGambitDTO> gambitDTOList;
@ApiModelProperty("")
private Integer transpond;
public ForumDynamicDO(DynamicVO dynamicVO) { public ForumDynamicDO(DynamicVO dynamicVO) {
this.gambitIcon=dynamicVO.getGambitIcon(); this.gambitIcon=dynamicVO.getGambitIcon();
this.gambitCover=dynamicVO.getGambitCover(); this.gambitCover=dynamicVO.getGambitCover();
...@@ -107,6 +114,8 @@ public class ForumDynamicDO extends BaseDO implements Serializable { ...@@ -107,6 +114,8 @@ public class ForumDynamicDO extends BaseDO implements Serializable {
.dynamicPublishTime(this.getCreateTime()) .dynamicPublishTime(this.getCreateTime())
.gambitName(this.gambitName) .gambitName(this.gambitName)
.forumReviewVO(this.forumReviewVO) .forumReviewVO(this.forumReviewVO)
.forumGambitDTOList(this.gambitDTOList)
.transpond(this.transpond)
.build(); .build();
} }
......
package com.mmc.csf.release.entity.forum; package com.mmc.csf.release.entity.forum;
import com.mmc.csf.release.entity.gambit.ForumGambitDO; import com.mmc.csf.release.entity.gambit.ForumGambitDO;
import com.mmc.csf.release.forum.vo.DynamicVO;
import com.mmc.csf.release.forum.vo.ForumReviewVO;
import com.mmc.csf.release.forum.vo.MediaVO;
import com.mmc.csf.release.gambit.dto.ForumDynamicGambitDTO;
import com.mmc.csf.release.gambit.dto.ForumGambitDTO;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
...@@ -41,10 +46,30 @@ public class ForumDynamicGambitDO implements Serializable { ...@@ -41,10 +46,30 @@ public class ForumDynamicGambitDO implements Serializable {
private List<ForumResourceDO> forumResourceDOList; private List<ForumResourceDO> forumResourceDOList;
@ApiModelProperty("话题") @ApiModelProperty("话题")
private List<ForumGambitDO> forumGambitDOList; private List<ForumGambitDTO> forumGambitDOList;
@ApiModelProperty("评论") @ApiModelProperty("评论")
private ForumReviewDO forumReviewDO; private ForumReviewVO ForumReviewDO;
@ApiModelProperty(value = "媒体资源")
private List<MediaVO> mediaVO;
public DynamicVO buildForumDynamicGambitDTO(){
return DynamicVO.builder()
.description(this.description)
.userAccountId(this.userAccountId)
.likesCount(this.likesCount)
.commentCount(this.commentsCount)
.transpond(this.transpond)
.mediaVO(this.mediaVO)
.forumReviewVO(this.ForumReviewDO)
.forumGambitDTOList(this.forumGambitDOList)
.build();
}
......
package com.mmc.csf.release.entity.forum; package com.mmc.csf.release.entity.forum;
import com.mmc.csf.user.vo.UserAccountVO;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
...@@ -47,6 +48,15 @@ public class ForumReviewDO implements Serializable { ...@@ -47,6 +48,15 @@ public class ForumReviewDO implements Serializable {
@ApiModelProperty(value = "pid") @ApiModelProperty(value = "pid")
private Integer pid; private Integer pid;
@ApiModelProperty(value = "status",example = "true表示已评论 null 就没有评论")
private Boolean status;
@ApiModelProperty(value = "回复数量")
private Integer replyCount;
@ApiModelProperty(value = "用户信息")
private UserAccountVO userAccountVO;
} }
...@@ -51,6 +51,8 @@ public class ForumGambitDO { ...@@ -51,6 +51,8 @@ public class ForumGambitDO {
@ApiModelProperty(value = "话题参与讨论数量",example = "1") @ApiModelProperty(value = "话题参与讨论数量",example = "1")
private Integer discussionCount; private Integer discussionCount;
private Integer checkStatus;
public ForumGambitDO(ForumGambitVO forumGambitVO){ public ForumGambitDO(ForumGambitVO forumGambitVO){
......
...@@ -6,11 +6,9 @@ import com.mmc.csf.common.util.page.PageResult; ...@@ -6,11 +6,9 @@ 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.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.gambit.qo.ForumGambitQO; import com.mmc.csf.release.gambit.qo.ForumGambitQO;
import com.mmc.csf.release.gambit.qo.PostingLeaderboardQO; import com.mmc.csf.release.gambit.qo.PostingLeaderboardQO;
import com.mmc.csf.release.gambit.vo.ForumGambitVO; import java.util.List;
/** /**
* @Author LW 测试合并 * @Author LW 测试合并
* @date 2023/5/15 10:29 概要:动态信息service层 * @date 2023/5/15 10:29 概要:动态信息service层
...@@ -59,7 +57,7 @@ public interface DynamicService { ...@@ -59,7 +57,7 @@ public interface DynamicService {
ResultBody dynamicDetails(Integer dynamicId, Integer userId, HttpServletRequest request); ResultBody dynamicDetails(Integer dynamicId, Integer userId, HttpServletRequest request);
PageResult dynamicList( PageResult dynamicList(
Integer pageNo, Integer pageSize, Integer userAccountId, HttpServletRequest request); Integer pageNo, Integer pageSize, Integer userAccountId, HttpServletRequest request, Integer gambitId, Integer id, Integer userId, String description, List<String> gambitName);
ResultBody recentNewsList(Integer userAccountId); ResultBody recentNewsList(Integer userAccountId);
......
...@@ -5,6 +5,8 @@ import com.mmc.csf.common.util.web.ResultBody; ...@@ -5,6 +5,8 @@ import com.mmc.csf.common.util.web.ResultBody;
import com.mmc.csf.release.gambit.qo.*; import com.mmc.csf.release.gambit.qo.*;
import com.mmc.csf.release.gambit.vo.ForumGambitVO; import com.mmc.csf.release.gambit.vo.ForumGambitVO;
import javax.servlet.http.HttpServletRequest;
/** /**
* @Author small * @Author small
* @Date 2023/9/13 15:30 * @Date 2023/9/13 15:30
...@@ -35,11 +37,11 @@ public interface GambitService { ...@@ -35,11 +37,11 @@ public interface GambitService {
PageResult userDynamicList(UserTopicDynamicsQO userTopicDynamicsQO); PageResult userDynamicList(UserTopicDynamicsQO userTopicDynamicsQO);
PageResult liked(UserTopicDynamicsQO userTopicDynamicsQO); PageResult liked(UserTopicDynamicsQO userTopicDynamicsQO, HttpServletRequest request);
PageResult myInterestList(UserTopicDynamicsQO userTopicDynamicsQO); PageResult myInterestList(UserTopicDynamicsQO userTopicDynamicsQO);
PageResult myFansList(UserTopicDynamicsQO userTopicDynamicsQO); PageResult myFansList(UserTopicDynamicsQO userTopicDynamicsQO);
ResultBody userMessage(Integer userAccountId); ResultBody userMessage(Integer userAccountId,Integer userId);
} }
package com.mmc.csf.release.service.gambit.impl; package com.mmc.csf.release.service.gambit.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
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.infomation.dto.UserAccountSimpleDTO;
import com.mmc.csf.release.auth.qo.UserAccountQO;
import com.mmc.csf.release.constant.TokenConstant;
import com.mmc.csf.release.dao.DynamicDao; import com.mmc.csf.release.dao.DynamicDao;
import com.mmc.csf.release.dao.gambit.GambitDao; import com.mmc.csf.release.dao.gambit.GambitDao;
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.ForumAttentionDO;
import com.mmc.csf.release.entity.gambit.ForumGambitDO; import com.mmc.csf.release.entity.gambit.ForumGambitDO;
import com.mmc.csf.release.feign.UserAppApi;
import com.mmc.csf.release.forum.vo.DynamicVO;
import com.mmc.csf.release.forum.vo.ForumReviewVO;
import com.mmc.csf.release.forum.vo.UserBaseInfoVO;
import com.mmc.csf.release.gambit.dto.ForumDynamicGambitDTO;
import com.mmc.csf.release.gambit.dto.ForumGambitDTO; import com.mmc.csf.release.gambit.dto.ForumGambitDTO;
import com.mmc.csf.release.gambit.qo.*; import com.mmc.csf.release.gambit.qo.*;
import com.mmc.csf.release.gambit.vo.ForumGambitVO; import com.mmc.csf.release.gambit.vo.ForumGambitVO;
import com.mmc.csf.release.service.gambit.GambitService; import com.mmc.csf.release.service.gambit.GambitService;
import com.mmc.csf.user.vo.UserAccountVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.*;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -32,6 +49,15 @@ public class GambitServiceImpl implements GambitService { ...@@ -32,6 +49,15 @@ public class GambitServiceImpl implements GambitService {
@Autowired @Autowired
private DynamicDao dynamicDao; private DynamicDao dynamicDao;
@Autowired
private RestTemplate restTemplate;
@Value("${iuav.userapp.url}")
private String userApp;
@Autowired
private UserAppApi userAppApi;
/** /**
* 添加话题 * 添加话题
* @param forumGambitVO * @param forumGambitVO
...@@ -87,6 +113,11 @@ public class GambitServiceImpl implements GambitService { ...@@ -87,6 +113,11 @@ public class GambitServiceImpl implements GambitService {
@Override @Override
public ResultBody deleteGambit(Integer id) { public ResultBody deleteGambit(Integer id) {
int count= gambitDao.selectGambitAndDynamic(id);
if (count!=0){
return ResultBody.error("话题关联了动态无法删除");
}
gambitDao.deleteGambit(id); gambitDao.deleteGambit(id);
gambitDao.forumDynamicGambit(id); gambitDao.forumDynamicGambit(id);
return ResultBody.success(); return ResultBody.success();
...@@ -127,14 +158,16 @@ public class GambitServiceImpl implements GambitService { ...@@ -127,14 +158,16 @@ public class GambitServiceImpl implements GambitService {
} }
}else{ }else{
ForumAttentionDO forumAttentionDO = gambitDao.selectAttentionMessage(userAccountId, attentionUserAccountId); ForumAttentionDO forumAttentionDO = gambitDao.selectAttentionMessage(userAccountId, attentionUserAccountId);
if (forumAttentionDO.getMutualAttention().equals(false)){ if (forumAttentionDO!=null){
gambitDao.removeAttention(userAccountId,attentionUserAccountId); if (forumAttentionDO.getMutualAttention().equals(false)){
gambitDao.forumCountFansNO(userAccountId); gambitDao.removeAttention(userAccountId,attentionUserAccountId);
gambitDao.forumCountAttentionNO(attentionUserAccountId); gambitDao.forumCountFansNO(userAccountId);
}else{ gambitDao.forumCountAttentionNO(attentionUserAccountId);
gambitDao.updateAttentionExchange(userAccountId,attentionUserAccountId); }else{
gambitDao.forumCountFansNO(userAccountId); gambitDao.updateAttentionExchange(userAccountId,attentionUserAccountId);
gambitDao.forumCountAttentionNO(attentionUserAccountId); gambitDao.forumCountFansNO(userAccountId);
gambitDao.forumCountAttentionNO(attentionUserAccountId);
}
} }
} }
return ResultBody.success(); return ResultBody.success();
...@@ -160,6 +193,12 @@ public class GambitServiceImpl implements GambitService { ...@@ -160,6 +193,12 @@ public class GambitServiceImpl implements GambitService {
if (i!=0){ if (i!=0){
return ResultBody.error("只能删除自己的贴子"); return ResultBody.error("只能删除自己的贴子");
} }
List<DynamicGambitDO> dynamicGambitDOS = gambitDao.selectDynamicGambit(dynamicId);
if (dynamicGambitDOS!=null){
for (DynamicGambitDO dynamicGambitDO : dynamicGambitDOS) {
gambitDao.updateGambits(dynamicGambitDO.getGambitId());
}
}
gambitDao.appRemove(dynamicId); gambitDao.appRemove(dynamicId);
gambitDao.RemoveDynamicGambit(dynamicId); gambitDao.RemoveDynamicGambit(dynamicId);
...@@ -186,14 +225,50 @@ public class GambitServiceImpl implements GambitService { ...@@ -186,14 +225,50 @@ public class GambitServiceImpl implements GambitService {
} }
@Override @Override
public PageResult liked(UserTopicDynamicsQO userTopicDynamicsQO) { public PageResult liked(UserTopicDynamicsQO userTopicDynamicsQO, HttpServletRequest request) {
Integer pageNo = userTopicDynamicsQO.getPageNo(); Integer pageNo = userTopicDynamicsQO.getPageNo();
userTopicDynamicsQO.buildCurrentPage(); userTopicDynamicsQO.buildCurrentPage();
int count = gambitDao.likedCount(userTopicDynamicsQO); int count = gambitDao.likedCount(userTopicDynamicsQO);
List<ForumDynamicGambitDO> forumDynamicGambitDOS = gambitDao.likedList(userTopicDynamicsQO); List<ForumDynamicGambitDO> forumDynamicGambitDOS = gambitDao.likedList(userTopicDynamicsQO);
return PageResult.buildPage(pageNo, userTopicDynamicsQO.getPageSize(),count,forumDynamicGambitDOS); List<DynamicVO> collect = forumDynamicGambitDOS.stream().map(ForumDynamicGambitDO::buildForumDynamicGambitDTO).collect(Collectors.toList());
}
List<Integer> userAccountIds =
collect.stream().map(DynamicVO::getUserAccountId).collect(Collectors.toList());
UserAccountQO bUserAccountQO = new UserAccountQO();
bUserAccountQO.setUserIds(userAccountIds);
bUserAccountQO.setPageNo(1);
bUserAccountQO.setPageSize(999);
// 获取用户的信息
List<UserAccountSimpleDTO> userAccountSimpleDTOS =
userAppApi.feignListAppUserAccount(bUserAccountQO, request.getHeader(TokenConstant.TOKEN));
for (DynamicVO dynamicVO : collect) {
for (UserAccountSimpleDTO userAccountSimpleDTO : userAccountSimpleDTOS) {
if (dynamicVO.getUserAccountId().equals(userAccountSimpleDTO.getId())) {
UserBaseInfoVO userBaseInfoVO = new UserBaseInfoVO();
userBaseInfoVO.setNickName(userAccountSimpleDTO.getNickName());
userBaseInfoVO.setUserImg(userAccountSimpleDTO.getUserImg());
userBaseInfoVO.setUserName(userAccountSimpleDTO.getUserName());
userBaseInfoVO.setPhone(userAccountSimpleDTO.getPhoneNum());
userBaseInfoVO.setUid(userAccountSimpleDTO.getUid());
dynamicVO.setUserBaseInfo(userBaseInfoVO);
break;
}
}
}
for (DynamicVO dynamicVO : collect) {
ForumReviewVO forumReviewVO = dynamicVO.getForumReviewVO();
if (forumReviewVO!=null){
Integer userAccountId = forumReviewVO.getUserAccountId();
UserAccountVO info = info(userAccountId);
forumReviewVO.setUserAccountVO(info);
}
}
return PageResult.buildPage(pageNo, userTopicDynamicsQO.getPageSize(),count,collect);
}
@Override @Override
public PageResult myInterestList(UserTopicDynamicsQO userTopicDynamicsQO) { public PageResult myInterestList(UserTopicDynamicsQO userTopicDynamicsQO) {
...@@ -215,8 +290,13 @@ public class GambitServiceImpl implements GambitService { ...@@ -215,8 +290,13 @@ public class GambitServiceImpl implements GambitService {
} }
@Override @Override
public ResultBody userMessage(Integer userAccountId) { public ResultBody userMessage(Integer userAccountId,Integer userId) {
ForumCountDO forumCountDO= gambitDao.userMessage(userAccountId); ForumCountDO forumCountDO= gambitDao.userMessage(userAccountId);
int i= gambitDao.selectCountAttentions(userAccountId,userId);
// int i = gambitDao.selectCountAttention(userId);
if (i!=0){
forumCountDO.setStatus(true);
}
return ResultBody.success(forumCountDO); return ResultBody.success(forumCountDO);
} }
...@@ -226,6 +306,14 @@ public class GambitServiceImpl implements GambitService { ...@@ -226,6 +306,14 @@ public class GambitServiceImpl implements GambitService {
allReviewQO.buildCurrentPage(); allReviewQO.buildCurrentPage();
int count = gambitDao.allCommentListCount(allReviewQO); int count = gambitDao.allCommentListCount(allReviewQO);
List<ForumReviewDO> forumReviewDOS = gambitDao.allCommentList(allReviewQO); List<ForumReviewDO> forumReviewDOS = gambitDao.allCommentList(allReviewQO);
for (ForumReviewDO forumReviewDO : forumReviewDOS) {
UserAccountVO info = info(forumReviewDO.getUserAccountId());
forumReviewDO.setUserAccountVO(info);
}
for (ForumReviewDO forumReviewDO : forumReviewDOS) {
int counts = gambitDao.replyCount(forumReviewDO);
forumReviewDO.setReplyCount(counts);
}
return PageResult.buildPage(pageNo,allReviewQO.getPageSize(),count,forumReviewDOS); return PageResult.buildPage(pageNo,allReviewQO.getPageSize(),count,forumReviewDOS);
} }
...@@ -235,16 +323,28 @@ public class GambitServiceImpl implements GambitService { ...@@ -235,16 +323,28 @@ public class GambitServiceImpl implements GambitService {
allReviewQO.buildCurrentPage(); allReviewQO.buildCurrentPage();
int count = gambitDao.replyListCount(allReviewQO); int count = gambitDao.replyListCount(allReviewQO);
List<ForumReviewDO> forumReviewDOS = gambitDao.replyList(allReviewQO); List<ForumReviewDO> forumReviewDOS = gambitDao.replyList(allReviewQO);
for (ForumReviewDO forumReviewDO : forumReviewDOS) {
UserAccountVO info = info(forumReviewDO.getUserAccountId());
forumReviewDO.setUserAccountVO(info);
}
return PageResult.buildPage(pageNo,allReviewQO.getPageSize(),count,forumReviewDOS); return PageResult.buildPage(pageNo,allReviewQO.getPageSize(),count,forumReviewDOS);
} }
public UserAccountVO info(Integer userAccountId) {
String token = null;
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
headers.add("token", token);
HttpEntity<String> entity = new HttpEntity<>(userAccountId.toString(), headers);
ResponseEntity<String> exchange = restTemplate.exchange(userApp + "/userapp/user-account/interiorInfo?userAccountId=" + userAccountId , HttpMethod.GET, entity, String.class);
Object body = exchange.getBody();
JSONObject jsonObject = JSONObject.parseObject((String) body);
JSONObject result1 = (JSONObject) jsonObject.get("result");
UserAccountVO userAccountVO = JSON.parseObject(result1.toJSONString(), UserAccountVO.class);
return userAccountVO;
}
} }
...@@ -137,7 +137,14 @@ public class BackstageForumServiceImpl implements BackstageForumService { ...@@ -137,7 +137,14 @@ public class BackstageForumServiceImpl implements BackstageForumService {
@Override @Override
public ResultBody deleteDynamic(Integer dynamicId) { public ResultBody deleteDynamic(Integer dynamicId) {
List<DynamicGambitDO> dynamicGambitDOS = gambitDao.selectDynamicGambit(dynamicId);
if (dynamicGambitDOS!=null){
for (DynamicGambitDO dynamicGambitDO : dynamicGambitDOS) {
gambitDao.updateGambits(dynamicGambitDO.getGambitId());
}
}
dynamicDao.deleteDynamic(dynamicId); dynamicDao.deleteDynamic(dynamicId);
gambitDao.deleteForumGambit(dynamicId);
return ResultBody.success(); return ResultBody.success();
} }
......
...@@ -67,14 +67,14 @@ ...@@ -67,14 +67,14 @@
</insert> </insert>
<insert id="insertforumGambit" parameterType="com.mmc.csf.release.entity.gambit.ForumGambitDO" keyProperty="id" useGeneratedKeys="true"> <insert id="insertforumGambit" parameterType="com.mmc.csf.release.entity.gambit.ForumGambitDO" keyProperty="id" useGeneratedKeys="true">
insert into forum_gambit(gambit_name,gambit_icon,gambit_cover, insert into forum_gambit(gambit_name,gambit_icon,gambit_cover,
user_account_id,create_time,update_time) user_account_id,create_time,update_time,check_status)
values (#{gambitName},#{gambitIcon},#{gambitCover}, values (#{gambitName},#{gambitIcon},#{gambitCover},
#{userAccountId},NOW(),NOW()) #{userAccountId},NOW(),NOW(),#{checkStatus})
</insert> </insert>
<insert id="insertDynamicGambit" parameterType="com.mmc.csf.release.entity.forum.DynamicGambitDO"> <insert id="insertDynamicGambit" parameterType="com.mmc.csf.release.entity.forum.DynamicGambitDO">
insert into forum_dynamic_gambit(dynamic_id,gambit_id,user_account_id,create_time,update_time) insert into forum_dynamic_gambit(dynamic_id,gambit_id,user_account_id,create_time,update_time,check_status)
values (#{dynamicId},#{gambitId},#{userAccountId},NOW(),NOW()) values (#{dynamicId},#{gambitId},#{userAccountId},NOW(),NOW(),#{checkStatus})
</insert> </insert>
<update id="updateDynamic" > <update id="updateDynamic" >
...@@ -90,6 +90,20 @@ ...@@ -90,6 +90,20 @@
where id=#{gambitId} where id=#{gambitId}
</update> </update>
<update id="updateDiscussionCounts">
update forum_gambit
set discussion_count=discussion_count+1,
update_time=NOW()
where id=#{gambitId}
</update>
<select id="gambitName" resultType="java.lang.Integer">
select id from forum_gambit where
<if test="gambitName!='' and gambitName!=null">
gambit_name=#{gambitName}
</if>
</select>
<update id="updateDiscussionCount"> <update id="updateDiscussionCount">
update forum_gambit update forum_gambit
set discussion_count=#{count}, set discussion_count=#{count},
...@@ -173,6 +187,7 @@ ...@@ -173,6 +187,7 @@
FROM FROM
forum_dynamic fd forum_dynamic fd
LEFT JOIN forum_dynamic_gambit fdg ON fd.id = fdg.dynamic_id LEFT JOIN forum_dynamic_gambit fdg ON fd.id = fdg.dynamic_id
INNER JOIN forum_resource fr ON fr.dynamic_id = fd.id
WHERE WHERE
fd.check_status = 1 fd.check_status = 1
<if test="userAccountId!=null"> <if test="userAccountId!=null">
...@@ -217,7 +232,13 @@ ...@@ -217,7 +232,13 @@
<select id="selectGambit" resultType="com.mmc.csf.release.entity.gambit.ForumGambitDO"> <select id="selectGambit" resultType="com.mmc.csf.release.entity.gambit.ForumGambitDO">
SELECT DISTINCT SELECT DISTINCT
gf.id, gf.id,
gf.gambit_name gf.gambit_name,
gf.gambit_icon,
gf.gambit_cover,
gf.post_count,
gf.gambit_property,
gf.user_account_id,
gf.discussion_count
FROM FROM
forum_dynamic_gambit fdg forum_dynamic_gambit fdg
INNER JOIN forum_gambit gf INNER JOIN forum_gambit gf
...@@ -227,6 +248,29 @@ ...@@ -227,6 +248,29 @@
AND fdg.dynamic_id = #{id} AND fdg.dynamic_id = #{id}
</select> </select>
<select id="selectGambitDTO" resultType="com.mmc.csf.release.gambit.dto.ForumGambitDTO">
SELECT DISTINCT
gf.id,
gf.gambit_name,
gf.gambit_icon,
gf.gambit_cover,
gf.post_count,
gf.gambit_property,
gf.user_account_id,
gf.discussion_count
FROM
forum_dynamic_gambit fdg
INNER JOIN forum_gambit gf
WHERE
fdg.gambit_id = gf.id
AND fdg.check_status = 1
AND fdg.dynamic_id = #{id}
</select>
<insert id="insertforumFirstLevelReview" parameterType="com.mmc.csf.release.entity.forum.ForumFirstLevelReviewDO"> <insert id="insertforumFirstLevelReview" parameterType="com.mmc.csf.release.entity.forum.ForumFirstLevelReviewDO">
insert into forum_review(user_account_id,dynamic_id,content,review_id,pid,create_time,update_time) insert into forum_review(user_account_id,dynamic_id,content,review_id,pid,create_time,update_time)
values(#{userAccountId},#{dynamicId},#{content},#{reviewId},#{pid},NOW(),NOW()) values(#{userAccountId},#{dynamicId},#{content},#{reviewId},#{pid},NOW(),NOW())
...@@ -304,6 +348,17 @@ ...@@ -304,6 +348,17 @@
select count(*) select count(*)
from forum_dynamic from forum_dynamic
where is_deleted = 0 where is_deleted = 0
AND root_path IS NULL
AND check_status = 1
<if test="id">
and id=#{id}
</if>
<if test="userAccountIds">
and user_account_id=#{userAccountIds}
</if>
<if test="description!=null and description!=''">
and description like concat('%',#{description},'%')
</if>
</select> </select>
<select id="dynamicList" resultType="com.mmc.csf.release.entity.forum.ForumDynamicDO"> <select id="dynamicList" resultType="com.mmc.csf.release.entity.forum.ForumDynamicDO">
select id, select id,
...@@ -316,15 +371,58 @@ ...@@ -316,15 +371,58 @@
likes_count, likes_count,
comments_count, comments_count,
create_time, create_time,
id AS dynamicId id AS dynamicId,
transpond
from forum_dynamic from forum_dynamic
where is_deleted = 0 where is_deleted = 0
and root_path is null and root_path is null
and check_status = 1 and check_status = 1
<if test="id!=null" >
and id=#{id}
</if>
<if test="userAccountIds!=null">
and user_account_id=#{userAccountIds}
</if>
<if test="description!=null and description!='' ">
and description like concat('%',#{description},'%')
</if>
order by create_time desc order by create_time desc
LIMIT #{itemIndex}, #{pageSize} LIMIT #{itemIndex}, #{pageSize}
</select> </select>
<select id="dynamicListGambit" resultType="com.mmc.csf.release.entity.forum.ForumDynamicDO">
SELECT
fd.id,
fd.version,
fd.user_account_id,
fd.description,
fd.location,
fd.lat,
fd.lon,
fd.likes_count,
fd.comments_count,
fd.create_time,
fd.id AS dynamicId,
fdg.gambit_id
FROM
forum_dynamic fd
INNER JOIN forum_dynamic_gambit fdg ON fd.id = fdg.dynamic_id
AND fdg.gambit_id = #{gambitId}
WHERE
fd.is_deleted = 0
AND fd.root_path IS NULL
AND fd.check_status = 1
<if test="id!=null" >
and fd.id=#{id}
</if>
<if test="userAccountIds!=null">
and fd.user_account_id=#{userAccountIds}
</if>
ORDER BY
fd.create_time DESC
LIMIT #{itemIndex}, #{pageSize}
</select>
<select id="listDynamicPicture" resultType="com.mmc.csf.release.entity.forum.ForumResourceDO"> <select id="listDynamicPicture" resultType="com.mmc.csf.release.entity.forum.ForumResourceDO">
select dynamic_id, select dynamic_id,
resource_url, resource_url,
......
...@@ -54,11 +54,14 @@ ...@@ -54,11 +54,14 @@
<collection property="forumResourceDOList" ofType="com.mmc.csf.release.entity.forum.ForumResourceDO" <collection property="forumResourceDOList" ofType="com.mmc.csf.release.entity.forum.ForumResourceDO"
select="selectResourceList" column="{dynamicId=id}"> select="selectResourceList" column="{dynamicId=id}">
</collection> </collection>
<collection property="forumGambitDOList" ofType="com.mmc.csf.release.entity.gambit.ForumGambitDO" <collection property="forumGambitDOList" ofType="com.mmc.csf.release.gambit.dto.ForumGambitDTO"
select="selectGambitLists" column="{dynamicId=id}"> select="selectGambitListsVO" column="{dynamicId=id}">
</collection> </collection>
<collection property="forumReviewDO" ofType="com.mmc.csf.release.entity.forum.ForumReviewDO" <collection property="forumReviewDO" ofType="com.mmc.csf.release.forum.vo.ForumReviewVO"
select="selectForumReview" column="{dynamicId=id}"> select="selectForumReviewVO" column="{dynamicId=id}">
</collection>
<collection property="mediaVO" ofType="com.mmc.csf.release.forum.vo.MediaVO"
select="selectMediaVO" column="{dynamicId=id}">
</collection> </collection>
</resultMap> </resultMap>
...@@ -134,6 +137,26 @@ ...@@ -134,6 +137,26 @@
</select> </select>
<select id="selectForumReviewVO" resultType="com.mmc.csf.release.forum.vo.ForumReviewVO">
SELECT
id,
content,
user_account_id,
like_count,
dynamic_id,
create_time,
update_time,
pid,
review_id
FROM
forum_review
WHERE
dynamic_id = #{dynamicId}
GROUP BY
id
LIMIT 0,1
</select>
<select id="selectForumReviewMessage" resultType="com.mmc.csf.release.forum.vo.ForumReviewVO"> <select id="selectForumReviewMessage" resultType="com.mmc.csf.release.forum.vo.ForumReviewVO">
SELECT SELECT
id, id,
...@@ -154,10 +177,45 @@ ...@@ -154,10 +177,45 @@
LIMIT 0,1 LIMIT 0,1
</select> </select>
<select id="replyCount" resultType="java.lang.Integer" parameterType="com.mmc.csf.release.entity.forum.ForumReviewDO">
SELECT
count(*)
FROM
forum_review fr
WHERE
fr.dynamic_id = #{dynamicId}
AND fr.review_id = #{id}
</select>
<select id="selectCountAttention" resultType="java.lang.Integer">
select count(*) from forum_attention where attention_user_account_id=#{userId}
</select>
<select id="selectCountAttentions" resultType="java.lang.Integer">
select count(*) from forum_attention where attention_user_account_id=#{userId} and user_account_id=#{userAccountId}
</select>
<select id="selectGambitAndDynamic" resultType="java.lang.Integer">
select count(*) from forum_dynamic_gambit where gambit_id=#{id}
</select>
<select id="selectStatus" resultType="java.lang.Integer">
select `status` from forum_review_likes where user_account_id=#{userId} and review_id=#{id}
</select>
<select id="selectDynamicGambit" resultType="com.mmc.csf.release.entity.forum.DynamicGambitDO">
select dynamic_id,gambit_id,user_account_id from forum_dynamic_gambit where dynamic_id=#{dynamicId}
</select>
<select id="selectResourceList" resultType="com.mmc.csf.release.entity.forum.ForumResourceDO"> <select id="selectResourceList" resultType="com.mmc.csf.release.entity.forum.ForumResourceDO">
select dynamic_id,resource_url,create_time,update_time,`type` from forum_resource where dynamic_id=#{dynamicId} select dynamic_id,resource_url,create_time,update_time,`type` from forum_resource where dynamic_id=#{dynamicId}
</select> </select>
<select id="selectMediaVO" resultType="com.mmc.csf.release.forum.vo.MediaVO">
select resource_url as url ,`type` from forum_resource where dynamic_id=#{dynamicId}
</select>
<select id="selectGambitLists" resultType="com.mmc.csf.release.entity.gambit.ForumGambitDO"> <select id="selectGambitLists" resultType="com.mmc.csf.release.entity.gambit.ForumGambitDO">
SELECT SELECT
fdg.dynamic_id, fdg.dynamic_id,
...@@ -170,6 +228,17 @@ ...@@ -170,6 +228,17 @@
fdg.dynamic_id = #{dynamicId} fdg.dynamic_id = #{dynamicId}
</select> </select>
<select id="selectGambitListsVO" resultType="com.mmc.csf.release.gambit.dto.ForumGambitDTO">
SELECT
fdg.dynamic_id,
fdg.gambit_id AS id,
fg.gambit_name
FROM
forum_dynamic_gambit fdg
LEFT JOIN forum_gambit fg ON fdg.gambit_id = fg.id
WHERE
fdg.dynamic_id = #{dynamicId}
</select>
<insert id="insertGambit" parameterType="com.mmc.csf.release.entity.gambit.ForumGambitDO" keyProperty="id" useGeneratedKeys="true"> <insert id="insertGambit" parameterType="com.mmc.csf.release.entity.gambit.ForumGambitDO" keyProperty="id" useGeneratedKeys="true">
insert into forum_gambit(gambit_name,gambit_icon,gambit_cover,gambit_property, insert into forum_gambit(gambit_name,gambit_icon,gambit_cover,gambit_property,
...@@ -213,6 +282,14 @@ ...@@ -213,6 +282,14 @@
where id=#{id} where id=#{id}
</update> </update>
<update id="updateGambits" >
update forum_gambit
set post_count=post_count-1,
update_time=NOW()
where id=#{gambitId}
</update>
<delete id="appRemove" parameterType="java.lang.Integer"> <delete id="appRemove" parameterType="java.lang.Integer">
delete from forum_dynamic where id =#{dynamicId} delete from forum_dynamic where id =#{dynamicId}
</delete> </delete>
...@@ -390,22 +467,25 @@ ...@@ -390,22 +467,25 @@
<select id="allCommentList" resultType="com.mmc.csf.release.entity.forum.ForumReviewDO"> <select id="allCommentList" resultType="com.mmc.csf.release.entity.forum.ForumReviewDO">
SELECT SELECT
id, fr.id,
user_account_id, fr.user_account_id,
dynamic_id, fr.dynamic_id,
content, fr.content,
review_id, fr.review_id,
like_count, fr.like_count,
create_time, fr.create_time,
update_time, fr.update_time,
pid fr.pid,
frl.`status`
FROM FROM
forum_review forum_review fr
LEFT JOIN forum_review_likes frl ON fr.id = frl.review_id
AND frl.user_account_id = #{userAccountId}
WHERE WHERE
dynamic_id = #{dynamicId} fr.dynamic_id = #{dynamicId}
AND pid =0 AND fr.pid = 0
ORDER BY ORDER BY
create_time DESC fr.create_time DESC
limit #{pageNo}, #{pageSize} limit #{pageNo}, #{pageSize}
</select> </select>
...@@ -421,22 +501,25 @@ ...@@ -421,22 +501,25 @@
<select id="replyList" resultType="com.mmc.csf.release.entity.forum.ForumReviewDO"> <select id="replyList" resultType="com.mmc.csf.release.entity.forum.ForumReviewDO">
SELECT SELECT
id, fr.id,
user_account_id, fr.user_account_id,
dynamic_id, fr.dynamic_id,
content, fr.content,
review_id, fr.review_id,
like_count, fr.like_count,
create_time, fr.create_time,
update_time, fr.update_time,
pid fr.pid,
frl.`status`
FROM FROM
forum_review forum_review fr
LEFT JOIN forum_review_likes frl ON fr.id = frl.review_id
AND frl.user_account_id = #{userAccountId}
WHERE WHERE
dynamic_id = #{dynamicId} fr.dynamic_id = #{dynamicId}
AND review_id =#{id} AND fr.review_id =#{id}
ORDER BY ORDER BY
create_time DESC fr.create_time DESC
limit #{pageNo}, #{pageSize} limit #{pageNo}, #{pageSize}
</select> </select>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论