mirror of
https://github.com/201206030/novel.git
synced 2025-07-17 01:36:37 +00:00
文档/日志/优化
This commit is contained in:
@ -8,6 +8,7 @@ import io.github.xxyopen.novel.service.HomeService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@ -24,6 +25,7 @@ import java.util.List;
|
||||
@RestController
|
||||
@RequestMapping(ApiRouterConsts.API_FRONT_HOME_URL_PREFIX)
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class HomeController {
|
||||
|
||||
private final HomeService homeService;
|
||||
@ -34,6 +36,8 @@ public class HomeController {
|
||||
@Operation(summary = "首页小说推荐查询接口")
|
||||
@GetMapping("books")
|
||||
public RestResp<List<HomeBookRespDto>> listHomeBooks() {
|
||||
// 测试虚拟线程处理请求
|
||||
log.debug("处理请求的线程:{}", Thread.currentThread());
|
||||
return homeService.listHomeBooks();
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,10 @@ spring:
|
||||
threads:
|
||||
virtual:
|
||||
enabled: true
|
||||
# 即使所有的用户线程(包括虚拟线程)都是守护线程的情况下,JVM 也不会立即退出,
|
||||
# Spring Boot 官方建议在开启虚拟线程时设置该属性
|
||||
main:
|
||||
keep-alive: true
|
||||
|
||||
flyway:
|
||||
# 是否开启 Flyway
|
||||
@ -38,7 +42,7 @@ server:
|
||||
spring:
|
||||
ai:
|
||||
openai:
|
||||
api-key:
|
||||
api-key: sk-rrrupturhdofbiqzjutduuiceecpvfqlnvmgcyiaipbdikoi
|
||||
base-url: https://api.siliconflow.cn
|
||||
chat:
|
||||
options:
|
||||
|
Reference in New Issue
Block a user