|
|
@ -46,12 +46,13 @@ object BookSourceController { |
|
|
|
val okSources = arrayListOf<BookSource>() |
|
|
|
val okSources = arrayListOf<BookSource>() |
|
|
|
val bookSources = GSON.fromJsonArray<BookSource>(postData) |
|
|
|
val bookSources = GSON.fromJsonArray<BookSource>(postData) |
|
|
|
if (bookSources != null) { |
|
|
|
if (bookSources != null) { |
|
|
|
for (bookSource in bookSources) { |
|
|
|
bookSources.forEach { bookSource -> |
|
|
|
if (bookSource.bookSourceName.isBlank() || bookSource.bookSourceUrl.isBlank()) { |
|
|
|
if (bookSource.bookSourceName.isNotBlank() |
|
|
|
continue |
|
|
|
&& bookSource.bookSourceUrl.isNotBlank() |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
appDb.bookSourceDao.insert(bookSource) |
|
|
|
|
|
|
|
okSources.add(bookSource) |
|
|
|
} |
|
|
|
} |
|
|
|
appDb.bookSourceDao.insert(bookSource) |
|
|
|
|
|
|
|
okSources.add(bookSource) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return ReturnData().setErrorMsg("转换源失败") |
|
|
|
return ReturnData().setErrorMsg("转换源失败") |
|
|
|