package cn.com.poc.ai_software_copyright.aggregate;

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.contant.AiSoftWareCopyRightEnum;
import cn.com.poc.ai_software_copyright.domian.BaseInfo;
import cn.com.poc.ai_software_copyright.domian.TechnicalContent;
import cn.com.poc.ai_software_copyright.dto.SoftwareCopyRightFilesDto;
import cn.com.poc.ai_software_copyright.entity.BizSoftwareCopyrightDocRecordEntity;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

/**
 * AI软著-聚合服务
 *
 * @author alex.yao
 * @date 2025/12/26
 */
public interface SoftwareCopyRightService {

    /**
     * 软著AI助手
     *
     * @param type     助手类型
     * @param fileUrls 文件地址
     * @param question 对话 内容
     * @param data     输入参数
     */
    void softwareCopyRightAssistant(
            AiSoftWareCopyRightEnum.AI_ASSISTANT_TYPE type,
            List<String> fileUrls,
            String question,
            Map<String, Object> data
    ) throws InterruptedException, DifyApiException, IOException;


    /**
     * AI-生成技术内容
     *
     * @param fileUrls
     * @param baseInfo
     * @return
     */
    TechnicalContent createTechnicalContent(List<String> fileUrls, BaseInfo baseInfo) throws IOException;


    /**
     * AI软著-文件列表
     *
     * @param id biz_software_copyright 主键id
     */
    BizSoftwareCopyrightDocRecordEntity listFile(Long id) throws Exception;

    /**
     * 获取下载地址
     *
     * @param id biz_software_copyright 主键id
     * @return 文件下载地址
     */
    String getDownloadUrl(Long id) throws Exception;


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

    /**
     * 压缩文件并更新记录
     *
     * @param recordEntity
     * @return 压缩文件地址
     */
    String zipFilesAndUpdateRecord(BizSoftwareCopyrightDocRecordEntity recordEntity);

}
