|
|
|
@ -191,7 +191,28 @@ public class JournalController {
|
|
|
|
|
return Result.success(journalRespDTO);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "3.1 根据期刊id查询评论信息")
|
|
|
|
|
@ApiOperation(value = "3.1 根据期刊号查询期刊信息")
|
|
|
|
|
@GetMapping("/journalNo/{journalNo}")
|
|
|
|
|
@GlobalInterceptor
|
|
|
|
|
public Result<JournalRespDTO> findByJournalNo(
|
|
|
|
|
@RequestHeader(value = "Authorization", required = false) String authorization,
|
|
|
|
|
@PathVariable @VerifyParam(required = true) String journalNo) {
|
|
|
|
|
JournalRespDTO journalRespDTO=journalService.queryJournalByJournalNo(journalNo);
|
|
|
|
|
if(null==journalRespDTO) {
|
|
|
|
|
return Result.failed(StatusCode.MUSIC_COMMON_FAILED,"根据期刊号无法找到期刊, 期刊号: "+journalNo);
|
|
|
|
|
}
|
|
|
|
|
UserLoginDto user = jwtUtil.getUserLoginDto(authorization);
|
|
|
|
|
if (null == user && !isLatest10(journalNo)) {
|
|
|
|
|
return Result.unauthorized(null);
|
|
|
|
|
}
|
|
|
|
|
boolean isCollect=null == user ? false:userCollectInfoService.isCollect(user.getUserId(),journalRespDTO.getId(), CollectTypeEnum.JOURNAL);
|
|
|
|
|
journalRespDTO.setHaveCollect(isCollect);
|
|
|
|
|
return Result.success(journalRespDTO);
|
|
|
|
|
}
|
|
|
|
|
private boolean isLatest10(String journalNo) {
|
|
|
|
|
return journalService.isLatest10ByJournalNo(journalNo);
|
|
|
|
|
}
|
|
|
|
|
@ApiOperation(value = "3.2 根据期刊id查询评论信息")
|
|
|
|
|
@GetMapping("/comment/{id}")
|
|
|
|
|
@GlobalInterceptor
|
|
|
|
|
public Result<CommentDTO> findCommentById(
|
|
|
|
|