package com.wonderland.stardewvalley.controller; import com.wonderland.stardewvalley.ai.ChatUtil; import com.wonderland.stardewvalley.entity.AIChatRequest; import com.wonderland.stardewvalley.entity.BaseResponse; import com.wonderland.stardewvalley.util.ResultUtil; import jakarta.annotation.Resource; 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; @RestController @RequestMapping("chat") public class ChatController { @Resource private ChatUtil chatUtil; @PostMapping public BaseResponse chat(@RequestBody AIChatRequest aiChatRequest) { return ResultUtil.success(chatUtil.doChat(aiChatRequest.getBackGround(), aiChatRequest.getContent())); } }