【解决todo】AI Music:同类变量同行,避免过长

This commit is contained in:
xiaoxin 2024-06-26 22:55:04 +08:00
parent 8bbd2257f2
commit 44a0b04d0e

View File

@ -93,19 +93,12 @@ public class AiMusicServiceImpl implements AiMusicService {
* @return AiMusicDO 集合 * @return AiMusicDO 集合
*/ */
private static List<AiMusicDO> buildMusicDOList(List<SunoApi.MusicData> musicTaskList) { private static List<AiMusicDO> buildMusicDOList(List<SunoApi.MusicData> musicTaskList) {
// TODO @xin想通的变量放在同一行避免过长
return CollectionUtils.convertList(musicTaskList, musicData -> new AiMusicDO() return CollectionUtils.convertList(musicTaskList, musicData -> new AiMusicDO()
.setTaskId(musicData.id()) .setTaskId(musicData.id())
.setPrompt(musicData.prompt()) .setPrompt(musicData.prompt()).setGptDescriptionPrompt(musicData.gptDescriptionPrompt())
.setGptDescriptionPrompt(musicData.gptDescriptionPrompt()) .setAudioUrl(musicData.audioUrl()).setVideoUrl(musicData.videoUrl()).setImageUrl(musicData.imageUrl())
.setAudioUrl(musicData.audioUrl()) .setTitle(musicData.title()).setLyric(musicData.lyric()).setTags(StrUtil.split(musicData.tags(), StrPool.COMMA))
.setVideoUrl(musicData.videoUrl()) .setModel(musicData.modelName()).setStatus(Objects.equals("complete", musicData.status()) ? AiMusicStatusEnum.COMPLETE.getStatus() : AiMusicStatusEnum.STREAMING.getStatus()));
.setImageUrl(musicData.imageUrl())
.setLyric(musicData.lyric())
.setTitle(musicData.title())
.setStatus(Objects.equals("complete", musicData.status()) ? AiMusicStatusEnum.COMPLETE.getStatus() : AiMusicStatusEnum.STREAMING.getStatus())
.setModel(musicData.modelName())
.setTags(StrUtil.split(musicData.tags(), StrPool.COMMA)));
}
}
} }