1.歌曲搜索传入特殊编码字符报错问题修复
This commit is contained in:
@@ -21,6 +21,8 @@ import com.fasterxml.jackson.core.JsonProcessingException;
|
|||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -38,6 +40,7 @@ import java.util.*;
|
|||||||
@Service
|
@Service
|
||||||
public class TbShopSongServiceImpl implements TbShopSongService{
|
public class TbShopSongServiceImpl implements TbShopSongService{
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(TbShopSongServiceImpl.class);
|
||||||
private final RedisTemplate<String, Object> redisTemplate;
|
private final RedisTemplate<String, Object> redisTemplate;
|
||||||
|
|
||||||
private final TbShopSongOrderService shopSongOrderService;
|
private final TbShopSongOrderService shopSongOrderService;
|
||||||
@@ -64,7 +67,13 @@ public class TbShopSongServiceImpl implements TbShopSongService{
|
|||||||
@Override
|
@Override
|
||||||
public PageInfo<TbShopSong> all(Integer shopId, Integer page, Integer size, String keyWord, boolean isDesc) {
|
public PageInfo<TbShopSong> all(Integer shopId, Integer page, Integer size, String keyWord, boolean isDesc) {
|
||||||
PageHelper.startPage(page, size);
|
PageHelper.startPage(page, size);
|
||||||
List<TbShopSong> shopSongs = shopSongMapper.selectAllAndSearch(shopId, keyWord);
|
List<TbShopSong> shopSongs;
|
||||||
|
try {
|
||||||
|
shopSongs = shopSongMapper.selectAllAndSearch(shopId, keyWord);
|
||||||
|
}catch (Exception e) {
|
||||||
|
log.warn("查询歌曲列表出现异常", e);
|
||||||
|
shopSongs = new ArrayList<>();
|
||||||
|
}
|
||||||
return new PageInfo<>(shopSongs);
|
return new PageInfo<>(shopSongs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user