package cn.com.poc.ai_software_copyright.rest;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import cn.com.gsst.dify_client.exception.DifyApiException;
import cn.com.poc.ai_software_copyright.dto.CallbackDto;
import cn.com.poc.ai_software_copyright.dto.SoftwareCopyRightAssistantDto;
import cn.com.poc.ai_software_copyright.dto.SoftwareCopyRightDto;
import cn.com.poc.ai_software_copyright.dto.SoftwareCopyRightFilesDto;
import cn.com.yict.framemax.core.rest.BaseRest;
import cn.com.yict.framemax.data.model.PagingInfo;
import cn.com.yict.framemax.web.permission.Access;
import cn.com.yict.framemax.web.permission.Permission;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

@Permission(Access.Anonymous)
public interface BizSoftwareCopyrightRest extends BaseRest {

    SoftwareCopyRightDto getById(@RequestParam java.lang.Long id) throws Exception;

    SoftwareCopyRightDto save(@RequestBody SoftwareCopyRightDto dto) throws Exception;

    void deletedById(@RequestParam java.lang.Long id) throws Exception;

    List<SoftwareCopyRightDto> querySoftwareCopyRight(@RequestParam(required = false) String query
            , @RequestParam(required = false) String generatedStatus, PagingInfo pagingInfo);

    void softwareCopyRightAssistant(@RequestBody SoftwareCopyRightAssistantDto dto)
            throws DifyApiException, IOException, InterruptedException;

    /**
     * AI软著-生成技术内容
     */
    SoftwareCopyRightDto createTechnicalContent(@RequestBody SoftwareCopyRightDto dto) throws IOException;


    /**
     * 文件上传
     *
     * @param file 文件
     * @return
     */
    String upload(@RequestParam MultipartFile file) throws IOException;


    /**
     * AI软著-文件列表
     */
    List<SoftwareCopyRightFilesDto> listFile(@RequestParam Long id) throws Exception;

    /**
     * 获取下载地址
     */
    String getDownloadUrl(@RequestParam Long id) throws Exception;


    /**
     * 回调-生成基础文件任务
     */
    void callbackGeneratedBaseDoc(@RequestParam String taskId,
                                  @RequestParam String type,
                                  @RequestBody CallbackDto callbackDto);
}