package com.sonic.cow.controller.api;

import com.sonic.common.rpc.Result;
import com.sonic.cow.domain.input.CheckImageIsAIGeneratedInput;
import com.sonic.cow.service.GenImageTaskRecordService;
import com.sonic.sdk.api.annotation.IgnoreAuth;
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;

/**
 * AI接口
 *
 * @author code
 */
@RestController
@Slf4j
public class ImageApi {

    @Autowired
    private GenImageTaskRecordService genImageTaskRecordService;

    @IgnoreAuth
    @ApiOperation(value = "添加相册图片，背景图片，ai形象图时，检查图片是否是AI生成的", tags = {"API-接口"})
    @PostMapping("/api/checkImageIsAIGenerated")
    public Result<Void> checkImageIsAIGenerated(@RequestBody CheckImageIsAIGeneratedInput input) {
        genImageTaskRecordService.checkImageIsAIGenerated(input.getUserId(), input.getImgUrlList());
        return Result.success();
    }

}

