Commit 7321f5e1 by songyinghui

feature: 好办评论

parent 40ac1a1a
package com.gic.haoban.manage.web.controller.content;
import cn.hutool.core.util.ObjectUtil;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.PageHelperUtils;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.content.api.dto.comment.ListCommentDTO;
import com.gic.content.api.dto.comment.ListSonCommentDTO;
import com.gic.content.api.enums.MaterialPurposeEnum;
import com.gic.content.api.enums.UserTypeEnum;
import com.gic.content.api.qdto.comment.ListMobileCommentQDTO;
import com.gic.content.api.qdto.comment.SaveCommentQDTO;
......@@ -56,7 +59,7 @@ public class CommentController {
ListMobileCommentQDTO mobileCommentQDTO = new ListMobileCommentQDTO();
mobileCommentQDTO.setEnterpriseId(commentCountQO.getEnterpriseId());
mobileCommentQDTO.setContentMaterialCommentId(commentCountQO.getContentMaterialId());
mobileCommentQDTO.setContentMaterialId(commentCountQO.getContentMaterialId());
mobileCommentQDTO.setMemberId(commentCountQO.getClerkId());
mobileCommentQDTO.setMaterialPurpose(3);
ServiceResponse<Integer> serviceResponse = contentMaterialCommentApiService.countCommentForWechat(mobileCommentQDTO);
......@@ -72,12 +75,15 @@ public class CommentController {
public RestResponse<Page<CommentInfoVO>> listCommentInfoVo(CommentCountQO commentCountQO) {
ListMobileCommentQDTO mobileCommentQDTO = new ListMobileCommentQDTO();
mobileCommentQDTO.setEnterpriseId(commentCountQO.getEnterpriseId());
mobileCommentQDTO.setContentMaterialCommentId(commentCountQO.getContentMaterialId());
mobileCommentQDTO.setContentMaterialId(commentCountQO.getContentMaterialId());
mobileCommentQDTO.setMemberId(commentCountQO.getClerkId());
mobileCommentQDTO.setMaterialPurpose(3);
mobileCommentQDTO.setMaterialPurpose(MaterialPurposeEnum.KNOWLEDGE.code);
ServiceResponse<Page<ListCommentDTO>> serviceResponse = contentMaterialCommentApiService.listComment(mobileCommentQDTO);
return RestResponse.successResult();
if (!serviceResponse.isSuccess()) {
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
}
Page<CommentInfoVO> commentInfoVOPage = PageHelperUtils.changePageToCurrentPage(serviceResponse.getResult(), CommentInfoVO.class);
return RestResponse.successResult(commentInfoVOPage);
}
/**
......@@ -86,7 +92,19 @@ public class CommentController {
*/
@RequestMapping(path = "/list-son-comment")
public RestResponse<Page<SonCommentInfoVO>> listSonComment(CommentCountQO commentCountQO) {
return RestResponse.successResult();
if (ObjectUtil.isEmpty(commentCountQO.getNextContentMaterialCommentId())){
commentCountQO.setNextContentMaterialCommentId(0L);
}
ListMobileCommentQDTO listMobileCommentQDTO = EntityUtil.changeEntityByJSON(ListMobileCommentQDTO.class, commentCountQO);
listMobileCommentQDTO.setMemberId(commentCountQO.getClerkId());
listMobileCommentQDTO.setMaterialPurpose(MaterialPurposeEnum.KNOWLEDGE.code);
ServiceResponse<Page<ListSonCommentDTO>> serviceResponse = contentMaterialCommentApiService.listSonCommentForWechat(listMobileCommentQDTO);
if (!serviceResponse.isSuccess()) {
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
}
Page<SonCommentInfoVO> commentInfoVOPage = PageHelperUtils.changePageToCurrentPage(serviceResponse.getResult(), SonCommentInfoVO.class);
return RestResponse.successResult(commentInfoVOPage);
}
/**
......
......@@ -28,4 +28,9 @@ public class CommentCountQO extends BasePageInfo {
* 导购id
*/
private String clerkId;
/**
* 滚动查询,评论ID
*/
private Long nextContentMaterialCommentId;
}
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