提交 a8472f4d 编写于 作者: minghao.wu's avatar minghao.wu

feature: 增加下一回复

上级 5d3b7ab8
...@@ -180,9 +180,6 @@ public class AnalysisController { ...@@ -180,9 +180,6 @@ public class AnalysisController {
/** /**
* 未认证用户直接返回 * 未认证用户直接返回
*/ */
if (!(doctor.getStatus().equals(CommonConstants.DOCTOR_STATUS_3) ||
doctor.getStatus().equals(CommonConstants.DOCTOR_STATUS_6) ||
doctor.getStatus().equals(CommonConstants.DOCTOR_STATUS_7) )) {
if (!(doctor.getStatus().equals(CommonConstants.DOCTOR_STATUS_3) || if (!(doctor.getStatus().equals(CommonConstants.DOCTOR_STATUS_3) ||
doctor.getStatus().equals(CommonConstants.DOCTOR_STATUS_6) || doctor.getStatus().equals(CommonConstants.DOCTOR_STATUS_6) ||
doctor.getStatus().equals(CommonConstants.DOCTOR_STATUS_7)) ) { doctor.getStatus().equals(CommonConstants.DOCTOR_STATUS_7)) ) {
...@@ -256,5 +253,39 @@ public class AnalysisController { ...@@ -256,5 +253,39 @@ public class AnalysisController {
return builder.build(); return builder.build();
} }
@ApiOperation(value = "获取某一道题目的下一道题", response = PicaResponse.class)
@RequestMapping(value = "/nextReply/{replyId}", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
public PicaResponse<ExamTitleReplyDto> nextReplyDetail(@PathVariable("replyId") Integer replyId,
@RequestHeader(required = false) String token) {
PICAUser user = null;
if (token != null) {
user = CommonUtils.getUserByToken(redisClient, token);
}
PicaResponse.Builder<ExamTitleReplyDetailDto> builder = new PicaResponse.Builder<>();
try {
ExamTitleReplyDetailDto examTitleReplyDetailDto = new ExamTitleReplyDetailDto();
Reply reply = analysisService.getNextReplyById(replyId);
AnalysisRoundExamTitle analysisRoundExamTitle = analysisService.getAnanlysisRoundExamTitleById(reply.getAnalysisRoundExamTitleId());
ExamTitleDto examTitleDto = analysisService.getExamTitleDtoById(reply.getAnalysisRoundExamTitleId());
ReplyDto replyDto = analysisService.getReplyDtoByReply(reply, user != null ? user.getId() : 0);
examTitleReplyDetailDto.setAnalysisId(analysisRoundExamTitle.getAnalysisId());
examTitleReplyDetailDto.setRoundId(analysisRoundExamTitle.getRoundId());
examTitleReplyDetailDto.setExamTitle(examTitleDto);
examTitleReplyDetailDto.setReply(replyDto);
builder.setData(examTitleReplyDetailDto);
} catch (Exception e) {
e.printStackTrace();
return ReturnUtil.getPicaResponse(PicaResultCode.SYSTEM_INNER_ERROR);
}
return builder.build();
}
} }
...@@ -54,6 +54,14 @@ public interface CHCAnalysisService { ...@@ -54,6 +54,14 @@ public interface CHCAnalysisService {
*/ */
ExamTitleDto getExamTitleDtoById(Integer analysisRoundExamTitleId); ExamTitleDto getExamTitleDtoById(Integer analysisRoundExamTitleId);
/**
* 获取当前题目的下一题目
* @param roundId 当前轮的id
* @param analysisRoundExamTitleId 当前题目的id
* @return 下一题目的id
*/
ExamTitleDto getNextExamTitleDtoById(Integer roundId, Integer analysisRoundExamTitleId);
/** /**
* 根据题目id获取回复信息 * 根据题目id获取回复信息
* @param analysisRoundExamTitleId * @param analysisRoundExamTitleId
...@@ -69,6 +77,13 @@ public interface CHCAnalysisService { ...@@ -69,6 +77,13 @@ public interface CHCAnalysisService {
*/ */
Reply getReplyById(Integer replyId); Reply getReplyById(Integer replyId);
/**
* 根据id获取下一条reply
* @param replyId
* @return
*/
Reply getNextReplyById(Integer replyId);
/** /**
* 根据reply获取replydto * 根据reply获取replydto
* @param reply * @param reply
...@@ -95,11 +110,4 @@ public interface CHCAnalysisService { ...@@ -95,11 +110,4 @@ public interface CHCAnalysisService {
*/ */
Integer removeStarRecord(Integer replyId, Integer userId); Integer removeStarRecord(Integer replyId, Integer userId);
/**
* 获取当前题目的下一题目
* @param roundId 当前轮的id
* @param analysisRoundExamTitleId 当前题目的id
* @return 下一题目的id
*/
ExamTitleDto getNextExamTitleDtoById(Integer roundId, Integer analysisRoundExamTitleId);
} }
...@@ -216,6 +216,12 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService { ...@@ -216,6 +216,12 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
return replyMapper.selectByPrimaryKey(replyId); return replyMapper.selectByPrimaryKey(replyId);
} }
@Override
public Reply getNextReplyById(Integer replyId) {
return null;
}
@Override @Override
public ReplyDto getReplyDtoByReply(Reply reply, Integer userId) { public ReplyDto getReplyDtoByReply(Reply reply, Integer userId) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册