feat: 听书问题修改
- 百度文字转语音传参 - 过滤内容为空的书籍目录
This commit is contained in:
@@ -194,7 +194,7 @@ public class BaiduVoicesUtils {
|
||||
private static String cuid = "0322java";
|
||||
|
||||
public static String run(String content) throws Exception {
|
||||
TokenHolder holder = new TokenHolder(appKey, secretKey, TokenHolder.ASR_SCOPE);
|
||||
TokenHolder holder = new TokenHolder(appKey, secretKey, TokenHolder.TTS_SCOPE);
|
||||
holder.resfresh();
|
||||
String token = holder.getToken();
|
||||
String url2 = url + "?tex=" + ConnUtil.urlEncode(content);
|
||||
|
||||
@@ -330,13 +330,14 @@ public class HomeController {
|
||||
return R.ok().put("languageList",languageList);
|
||||
}
|
||||
|
||||
//图书章节
|
||||
//图书章节(仅返回在 book_chapter_content 中有实际正文的目录)
|
||||
@RequestMapping("/getBookChapter")
|
||||
public R getBookChapter(@RequestBody Map<String,Object> params) {
|
||||
String language = params.containsKey("language")?params.get("language").toString():"中文";
|
||||
List<BookChapterEntity> chapterList = bookChapterService.list(new LambdaQueryWrapper<BookChapterEntity>()
|
||||
.eq(BookChapterEntity::getBookId,params.get("bookId"))
|
||||
.eq(BookChapterEntity::getLanguage,language)
|
||||
.exists("select 1 from book_chapter_content where book_chatper_id = book_chapter.id and content is not null and content != ''")
|
||||
.orderByAsc(BookChapterEntity::getId));
|
||||
return R.ok().put("chapterList",chapterList);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user