package com.cy.guoyan.admin.module.ai.service.chatdocument;

import java.io.IOException;
import java.util.*;
import javax.validation.*;

import com.alibaba.fastjson.JSONObject;
import com.cy.guoyan.admin.module.ai.controller.admin.chatdocument.vo.ChatDocumentPageReqVO;
import com.cy.guoyan.admin.module.ai.controller.admin.chatdocument.vo.ChatDocumentSaveReqVO;
import com.cy.guoyan.admin.module.ai.dal.dataobject.chatdocument.ChatDocumentDO;
import com.cy.guoyan.admin.framework.common.pojo.PageResult;
import org.springframework.web.multipart.MultipartFile;

/**
 * 知识库文档 Service 接口
 *
 * @author 管理员
 */
public interface ChatDocumentService {

    /**
     * 创建知识库文档
     *
     * @return 编号
     */
    JSONObject createChatDocument(ChatDocumentSaveReqVO vo, MultipartFile file)throws IOException;

    /**
     * 更新知识库文档
     *
     * @param updateReqVO 更新信息
     */
    void updateChatDocument(@Valid ChatDocumentSaveReqVO updateReqVO);

    /**
     * 删除知识库文档
     *
     * @param id 编号
     */
    void deleteChatDocument(Long id) throws IOException;

    /**
     * 获得知识库文档
     *
     * @param id 编号
     * @return 知识库文档
     */
    ChatDocumentDO getChatDocument(Long id);

    /**
     * 获得知识库文档分页
     *
     * @param pageReqVO 分页查询
     * @return 知识库文档分页
     */
    PageResult<ChatDocumentDO> getChatDocumentPage(ChatDocumentPageReqVO pageReqVO);







    JSONObject getDocumentIndexingStatus(String datasetId, String batch) throws IOException;

    void deleteDocument(String datasetId, String documentId) throws IOException;

    JSONObject addDocumentSegments(String datasetId, String documentId, List<Map<String, Object>> segments) throws IOException;

    JSONObject listDocuments(String datasetId, String keyword, Integer page, Integer limit) throws IOException;

    JSONObject listDocumentSegments(String datasetId, String documentId, String keyword, String status) throws IOException;

    void deleteDocumentSegment(String datasetId, String documentId, String segmentId) throws IOException;

    JSONObject getUploadedFileInfo(String datasetId, String documentId) throws IOException;

//    JSONObject updateDocumentSegment(String datasetId, String documentId, String segmentId, String content, String answer, List<String> keywords, Boolean enabled) throws IOException;





}