|
@@ -213,10 +213,10 @@ public class BookServiceImpl implements BookService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<Chapter> getChaptersByBookId(String bookId) {
|
|
|
+ public List<Chapter> getChaptersByBookId(Long bookId) {
|
|
|
List<Chapter> list = new ArrayList<>();
|
|
|
|
|
|
- if (StringUtils.isEmpty(bookId)) {
|
|
|
+ if (bookId == null) {
|
|
|
throw new IllegalArgumentException("bookId cannot be null or empty");
|
|
|
}
|
|
|
final String chaptersUrl = "http://new.emeixs.com/index.php/Home/Interface/chapters/bid/" + bookId;
|
|
@@ -226,7 +226,7 @@ public class BookServiceImpl implements BookService {
|
|
|
}
|
|
|
JsonParser parser = new JsonParser();
|
|
|
JsonArray jsonArray = parser.parse(result).getAsJsonArray();
|
|
|
- Book book = bookMapper.selectByPrimaryKey(Long.parseLong(bookId));
|
|
|
+ Book book = bookMapper.selectByPrimaryKey(bookId);
|
|
|
if (book == null) {
|
|
|
return list;
|
|
|
}
|