@ -17,6 +17,7 @@ import com.luoo.music.dto.request.JournalQueryReq;
import com.luoo.music.dto.response.CommentDTO ;
import com.luoo.music.dto.response.CommentDTO ;
import com.luoo.music.dto.response.JournalFilterDTO ;
import com.luoo.music.dto.response.JournalFilterDTO ;
import com.luoo.music.dto.response.JournalRespDTO ;
import com.luoo.music.dto.response.JournalRespDTO ;
import com.luoo.music.dto.response.SongRespDTO ;
import com.luoo.music.dto.response.TagDTO ;
import com.luoo.music.dto.response.TagDTO ;
import io.swagger.annotations.* ;
import io.swagger.annotations.* ;
import org.springframework.beans.factory.annotation.Autowired ;
import org.springframework.beans.factory.annotation.Autowired ;
@ -28,6 +29,7 @@ import org.springframework.web.bind.annotation.*;
import com.luoo.music.pojo.Journal ;
import com.luoo.music.pojo.Journal ;
import com.luoo.music.pojo.Tag ;
import com.luoo.music.pojo.Tag ;
import com.luoo.music.service.JournalService ;
import com.luoo.music.service.JournalService ;
import com.luoo.music.service.SongInfoService ;
import com.luoo.music.service.TagService ;
import com.luoo.music.service.TagService ;
import com.luoo.music.service.UserCollectInfoService ;
import com.luoo.music.service.UserCollectInfoService ;
import annotation.GlobalInterceptor ;
import annotation.GlobalInterceptor ;
@ -58,6 +60,9 @@ public class JournalController {
@Autowired
@Autowired
private JournalService journalService ;
private JournalService journalService ;
@Autowired
private SongController songController ;
@Autowired
@Autowired
private TagService tagService ;
private TagService tagService ;
@ -143,6 +148,22 @@ public class JournalController {
return Result . success ( new PageResult < JournalRespDTO > ( Long . valueOf ( list . size ( ) ) , list ) ) ;
return Result . success ( new PageResult < JournalRespDTO > ( Long . valueOf ( list . size ( ) ) , list ) ) ;
}
}
@ApiOperation ( value = "2.1 查询所有收藏期刊的歌曲信息" , notes = "pageNum/pageSize不传或者小于1, 则返回所有收藏刊的歌曲" )
@GetMapping ( "/collect/song" )
@GlobalInterceptor ( checkAppUserLogin = true )
public Result < PageResult < SongRespDTO > > collectJournalSongs (
@RequestHeader ( value = "Authorization" , required = true ) String authorization ,
@VerifyParam CollectQueryReq queryReq ) {
List < String > objectIds = getJournalObjectIds ( queryReq ) ;
UserLoginDto user = jwtUtil . getUserLoginDto ( authorization ) ;
return songController . getCollectSongs ( user . getUserId ( ) , queryReq . getUserId ( ) , objectIds ) ;
}
private List < String > getJournalObjectIds ( CollectQueryReq queryReq ) {
List < String > jouranlIds = userCollectInfoService . findByUserIdAndCollectType ( queryReq . getUserId ( ) , CollectTypeEnum . JOURNAL ) ;
return journalService . orderByJournalIdField ( jouranlIds ) ;
}
private Set < String > getMyCollectSet ( String loginUser , String checkUser , List < String > objectIds ) {
private Set < String > getMyCollectSet ( String loginUser , String checkUser , List < String > objectIds ) {
if ( loginUser . equals ( checkUser ) ) {
if ( loginUser . equals ( checkUser ) ) {
return new HashSet < > ( objectIds ) ;
return new HashSet < > ( objectIds ) ;