package com.sonic.cow.controller.web;

import com.sonic.common.rpc.Result;
import com.sonic.cow.client.ContextChatClient;
import com.sonic.cow.lib.input.NsfwCheckInput;
import io.swagger.annotations.ApiOperation;
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;

/**
 * 敏感词校验
 *
 * @author code
 */
@RestController
@Slf4j
public class NsfwCheckWeb {

    @Autowired
    private ContextChatClient contextChatClient;

    @ApiOperation(value = "校验敏感词", tags = {"WEB-敏感词校验"})
    @PostMapping("/web/content/check")
    public Result<String> contentCheck(@RequestBody NsfwCheckInput input) {
        return Result.success(contextChatClient.nsfwCheckV2(input.getContent()));
    }

}

