package cn.com.qmth.stmms.biz.file.service;

import cn.com.qmth.stmms.biz.file.enums.FormatType;

import java.io.InputStream;
import java.util.List;

public interface FileService {

    String getFileServer();

    String getRandomFileServer();

    byte[] downloadSheet(int examId, String examNumber, int index) throws Exception;

    byte[] downloadSlice(int examId, String secretNumber, int index) throws Exception;

    byte[] downloadPackage(int examId, String packageCode, int index) throws Exception;

    void uploadSheet(InputStream ins, String md5, int examId, String examNumber, int index) throws Exception;

    void uploadSlice(InputStream ins, String md5, int examId, String secretNumber, int index) throws Exception;

    void uploadJson(InputStream ins, String md5, int examId, String secretNumber) throws Exception;

    void uploadPackage(InputStream ins, String md5, int examId, String packageCode, int index) throws Exception;

    void uploadPaper(InputStream ins, String md5, int examId, String subjectCode, FormatType type) throws Exception;

    void uploadAnswer(InputStream ins, String md5, int examId, String subjectCode, FormatType type) throws Exception;

    void uploadCard(InputStream ins, String md5, int examId, FormatType type) throws Exception;

    void uploadCard(InputStream ins, String md5, int examId, String subjectCode, FormatType type) throws Exception;

    void uploadExchange(InputStream ins, String md5, String name) throws Exception;

    void uploadReport(InputStream ins, String md5, int examId, String subjectCode, String name, FormatType type)
            throws Exception;

    String getSheetUri(int examId, String examNumber, int index);

    List<String> getSheetUris(int examId, String examNumber, int start, int end);

    String getSliceUri(int examId, String secretNumber, int index);

    List<String> getSliceUris(int examId, String secretNumber, int start, int end);

    String getJsonUri(int examId, String secretNumber);

    String getPackageUri(int examId, String packageCode, int index);

    List<String> getPackageUris(int examId, String packageCode, int start, int end);

    String getPaperUri(int examId, String subjectCode, FormatType type);

    String getAnswerUri(int examId, String subjectCode, FormatType type);

    String getCardUri(int examId, FormatType type);

    String getCardUri(int examId, String subjectCode, FormatType type);

    String getExchangeUri(String name);

    boolean sheetExist(int examId, String examNumber, int index);

    boolean sliceExist(int examId, String secretNumber, int index);

    boolean jsonExist(int examId, String secretNumber);

    byte[] downloadJson(int examId, String secretNumber) throws Exception;

    void uploadAnswerCard(InputStream inputStream, String md5, int examId, int number) throws Exception;

    String getAnswerCardUri(int examId, int number);

    String getReportUri(int examId, String subjectName, String reportTitle, FormatType type);

    byte[] downloadReport(int examId, String subjectName, String reportTitle, FormatType type) throws Exception;

    boolean reportExist(int examId, String subjectName, String reportTitle, FormatType type);

    void uploadIncomplete(InputStream inputStream, String md5, Integer examId, String name) throws Exception;

    String getIncompleteUri(Integer examId, String name);

}
