feat(server): 短篇小说 SSE 代理 Controller
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
package com.emotion.controller;
|
||||
|
||||
import com.emotion.dto.request.ShortNovelFollowupRequest;
|
||||
import com.emotion.dto.request.ShortNovelStreamRequest;
|
||||
import com.emotion.service.ShortNovelService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 短篇小说外部服务代理 Controller
|
||||
*
|
||||
* @author huazhongmin
|
||||
* @date 2026-07-19
|
||||
*/
|
||||
@Tag(name = "短篇小说管理", description = "短篇小说生成 SSE 代理接口")
|
||||
@RestController
|
||||
@RequestMapping("/shortNovel")
|
||||
public class ShortNovelController {
|
||||
|
||||
@Autowired
|
||||
private ShortNovelService shortNovelService;
|
||||
|
||||
@Operation(summary = "首次发起短篇小说生成", description = "用户输入心愿文本,发起流式生成")
|
||||
@PostMapping("/stream")
|
||||
public SseEmitter stream(@Valid @RequestBody ShortNovelStreamRequest request) {
|
||||
return shortNovelService.stream(request);
|
||||
}
|
||||
|
||||
@Operation(summary = "短篇小说后续轮次", description = "处理澄清回答、大纲确认/修改、重试等")
|
||||
@PostMapping("/followup")
|
||||
public SseEmitter followup(@Valid @RequestBody ShortNovelFollowupRequest request) {
|
||||
return shortNovelService.followup(request);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user