|
|
|
@ -37,6 +37,7 @@ import constants.Constants;
|
|
|
|
|
import dto.UserLoginDto;
|
|
|
|
|
import enums.CollectTypeEnum;
|
|
|
|
|
import util.JwtUtil;
|
|
|
|
|
import util.StringTools;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 控制器层
|
|
|
|
@ -139,6 +140,27 @@ public class JournalController {
|
|
|
|
|
return songController.getCollectSongs(user.getUserId(), queryReq.getUserId(),objectIds, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "2.2 获取用户收藏最新一期的期刊封面")
|
|
|
|
|
@GetMapping("/collectLatestImage/{userId}")
|
|
|
|
|
@GlobalInterceptor(checkAppUserLogin = true)
|
|
|
|
|
public Result<String> collectLatestImage(
|
|
|
|
|
@RequestHeader(value = "Authorization", required = true) String authorization,
|
|
|
|
|
@PathVariable @VerifyParam(required = true) String userId) {
|
|
|
|
|
String objectId=getCollectLatest(userId);
|
|
|
|
|
if (StringTools.isEmpty(objectId)) {
|
|
|
|
|
return Result.success(null);
|
|
|
|
|
}
|
|
|
|
|
JournalRespDTO journalRespDTO=journalService.queryJournalById(objectId);
|
|
|
|
|
if(null==journalRespDTO) {
|
|
|
|
|
return Result.success(null);
|
|
|
|
|
}
|
|
|
|
|
return Result.success(journalRespDTO.getImage());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String getCollectLatest(String userId) {
|
|
|
|
|
return userCollectInfoService.getCollectLatest(userId, CollectTypeEnum.JOURNAL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<String> getJournalObjectIds(CollectQueryReq queryReq) {
|
|
|
|
|
List<String> jouranlIds=userCollectInfoService.findByUserIdAndCollectType(queryReq.getUserId(), CollectTypeEnum.JOURNAL);
|
|
|
|
|
return journalService.orderByJournalIdField(jouranlIds);
|
|
|
|
|