package com.sonic.cow.controller.web;

import com.sonic.common.auth.IgnoreAuth;
import com.sonic.common.auth.domains.Session;
import com.sonic.common.rpc.Result;
import com.sonic.cow.domain.input.AiMessageDelInput;
import com.sonic.cow.service.AiMessageService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
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.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * Web-AI消息
 *
 * @author: mzc
 * @date: 2025-07-11 11:43
 **/
@RestController
@Slf4j
public class AiMessageWeb {

    @Autowired
    private AiMessageService aiMessageService;

    @IgnoreAuth
    @ApiOperation(value = "删除ai消息", tags = {"Web-AI消息"})
    @PostMapping(value = "/web/ai-message/del")
    public Result<Void> del(@RequestBody AiMessageDelInput input, @ApiParam(hidden = true)  Session session, @ApiParam(hidden = true) HttpServletRequest request) {
        aiMessageService.aiMessageDelete(input, session.getUserId());
        return Result.success();
    }
}
