Commit a98f658f authored by 万成波's avatar 万成波

动态查询

parent 50292010
...@@ -2,11 +2,15 @@ package com.tangguo.controller.mobile; ...@@ -2,11 +2,15 @@ package com.tangguo.controller.mobile;
import com.tangguo.common.core.domain.AjaxResult; import com.tangguo.common.core.domain.AjaxResult;
import com.tangguo.common.mauth.MobileAuth; import com.tangguo.common.mauth.MobileAuth;
import com.tangguo.common.mauth.MobileTokenHelper;
import com.tangguo.common.utils.PageUtils;
import com.tangguo.domain.bo.CreateMomentBO; import com.tangguo.domain.bo.CreateMomentBO;
import com.tangguo.domain.vo.BbsMomentListVO;
import com.tangguo.service.IBbsMomentService; import com.tangguo.service.IBbsMomentService;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
/** /**
* 移动端动态控制器 * 移动端动态控制器
...@@ -22,6 +26,21 @@ public class MBbsMomentController { ...@@ -22,6 +26,21 @@ public class MBbsMomentController {
private IBbsMomentService momentService; private IBbsMomentService momentService;
/**
* 查询动态列表
*
* @return 动态
*/
@MobileAuth
@GetMapping("/moments")
public AjaxResult getUserMoments(String content) {
String username = MobileTokenHelper.getUsername();
PageUtils.clearPage();
List<BbsMomentListVO> moments = this.momentService.getMoments(username, content);
return AjaxResult.success(moments);
}
/** /**
* 创建动态 * 创建动态
* *
......
...@@ -59,9 +59,9 @@ public class MBbsUserController { ...@@ -59,9 +59,9 @@ public class MBbsUserController {
/** /**
* 查询用户动态相关统计数据 * 查询用户动态统计
* *
* @return 动态统计数据 * @return 动态统计
*/ */
@MobileAuth @MobileAuth
@GetMapping("/moment/count") @GetMapping("/moment/count")
...@@ -73,7 +73,7 @@ public class MBbsUserController { ...@@ -73,7 +73,7 @@ public class MBbsUserController {
/** /**
* 查询动态列表 * 查询用户动态列表
* *
* @return 动态 * @return 动态
*/ */
...@@ -82,7 +82,7 @@ public class MBbsUserController { ...@@ -82,7 +82,7 @@ public class MBbsUserController {
public AjaxResult getUserMoments(String content) { public AjaxResult getUserMoments(String content) {
String username = MobileTokenHelper.getUsername(); String username = MobileTokenHelper.getUsername();
PageUtils.clearPage(); PageUtils.clearPage();
List<BbsMomentListVO> moments = this.momentService.getMoments(username, content); List<BbsMomentListVO> moments = this.momentService.getUserMoments(username, content);
return AjaxResult.success(moments); return AjaxResult.success(moments);
} }
......
...@@ -77,4 +77,7 @@ public class BbsMomentListDTO { ...@@ -77,4 +77,7 @@ public class BbsMomentListDTO {
/** 当前是否投票:0 未投票、1 已投票 */ /** 当前是否投票:0 未投票、1 已投票 */
private Integer isVote; private Integer isVote;
/** 是否本人动态:0 否、1 是 */
private Integer isSelf;
} }
...@@ -34,10 +34,9 @@ public interface IBbsMomentService extends IService<BbsMoment> { ...@@ -34,10 +34,9 @@ public interface IBbsMomentService extends IService<BbsMoment> {
/** /**
* 查询用户动态相关统计数据 * 查询用户动态统计
* *
* @param userName 用户名 * @return 动态统计
* @return 动态统计数据
*/ */
BbsUserMomentCountVO getUserMomentCount(String userName); BbsUserMomentCountVO getUserMomentCount(String userName);
......
...@@ -72,10 +72,9 @@ public class BbsMomentServiceImpl extends ServiceImpl<BbsMomentMapper, BbsMoment ...@@ -72,10 +72,9 @@ public class BbsMomentServiceImpl extends ServiceImpl<BbsMomentMapper, BbsMoment
/** /**
* 查询用户动态相关统计数据 * 查询用户动态统计
* *
* @param userName 用户名 * @return 动态统计
* @return 动态统计数据
*/ */
@Override @Override
public BbsUserMomentCountVO getUserMomentCount(String userName) { public BbsUserMomentCountVO getUserMomentCount(String userName) {
...@@ -275,6 +274,7 @@ public class BbsMomentServiceImpl extends ServiceImpl<BbsMomentMapper, BbsMoment ...@@ -275,6 +274,7 @@ public class BbsMomentServiceImpl extends ServiceImpl<BbsMomentMapper, BbsMoment
moment.setVoteCount(dbMoment.getVoteCount()); moment.setVoteCount(dbMoment.getVoteCount());
moment.setIsLike(dbMoment.getIsLike()); moment.setIsLike(dbMoment.getIsLike());
moment.setIsVote(dbMoment.getIsVote()); moment.setIsVote(dbMoment.getIsVote());
moment.setIsSelf(dbMoment.getIsSelf());
moments.add(moment); moments.add(moment);
} }
return moments; return moments;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment