package org.dromara.system.controller;

import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.web.core.BaseController;
import org.dromara.system.domain.bo.CozeChatBo;
import org.dromara.system.service.ICozeChatService;
import org.springframework.validation.annotation.Validated;
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("/system/dzbc/coze")
@RequiredArgsConstructor
public class CozeChatController extends BaseController {

    private final ICozeChatService cozeChatService;

    @Log(title = "扣子AI流式对话", businessType = BusinessType.OTHER)
    @PostMapping("/chat/stream")
    public void chatStream(@RequestBody CozeChatBo bo, HttpServletResponse response) {
        cozeChatService.chatStream(bo, response);
    }
}
