package ink.wgink.interfaces.manager;

import ink.wgink.pojo.bos.files.FilesShowCode;

/**
 * @ClassName: IFilesShowCodeService
 * @Description: 文件查看码业务
 * @Author: wanggeng
 * @Date: 2022/8/1 17:12
 * @Version: 1.0
 */
public interface IFilesShowCodeService {

    String FILE_SHOW_CODE_KEY = "files:showCode:";
    long SHOW_CODE_TIMEOUT_MILLIS = 1 * 60 * 1000L;

    /**
     * 添加展示码
     *
     * @param code
     * @param fileId
     * @param fileName
     */
    void addShowCode(String code, String fileId, String fileName);

    /**
     * 清除超时的展示码
     */
    void clearTimeoutShowCode();

    /**
     * 获取文件展示码
     *
     * @param fileId
     * @param code
     * @return
     */
    FilesShowCode getShowCode(String fileId, String code);

    /**
     * 获取文件展示码
     *
     * @param fileId
     * @return
     */
    FilesShowCode getShowCode(String fileId);
}
