fix: 小说封面图修改

This commit is contained in:
xiongxiaoyang
2025-04-21 21:47:01 +08:00
parent 0e156c04b4
commit 3f009dc1f9
5 changed files with 55 additions and 28 deletions

View File

@ -238,6 +238,14 @@ public class AuthorController extends BaseController {
}
/**
* 查询AI生成图片
*/
@GetMapping("queryAiGenPic")
public RestResult<String> queryAiGenPic(@RequestParam("bookId") Long bookId) {
return RestResult.ok(bookService.queryAiGenPic(bookId));
}
/**
* AI扩写
*/

View File

@ -290,4 +290,9 @@ public interface BookService {
* @param authorId
*/
void updateBookPic(Long bookId, String bookPic, Long authorId);
/**
* 查询AI生成图片
*/
String queryAiGenPic(Long bookId);
}

View File

@ -559,6 +559,7 @@ public class BookServiceImpl implements BookService {
.where(id, isEqualTo(book.getId()))
.build()
.render(RenderingStrategies.MYBATIS3));
cacheService.set(CacheKey.AI_GEN_PIC + book.getId(), picUrl, 60 * 60);
});
}
}
@ -882,5 +883,10 @@ public class BookServiceImpl implements BookService {
.render(RenderingStrategies.MYBATIS3));
}
@Override
public String queryAiGenPic(Long bookId) {
return cacheService.get(CacheKey.AI_GEN_PIC + bookId);
}
}