package cd.casic.module.terminal.define.cache;

import cd.casic.module.terminal.controller.dto.TerminalAccessDTO;
import cd.casic.module.terminal.controller.dto.TerminalTransferDTO;
import cd.casic.module.terminal.host.terminal.dto.SftpGetContentCacheDTO;
import cd.casic.module.terminal.host.terminal.dto.SftpSetContentCacheDTO;
import cn.orionsec.kit.lang.define.cache.key.CacheKeyBuilder;
import cn.orionsec.kit.lang.define.cache.key.CacheKeyDefine;
import cn.orionsec.kit.lang.define.cache.key.struct.RedisCacheStruct;
import java.util.concurrent.TimeUnit;

/**
 *
 * 终端服务缓存 key
 *
 * @author Yuru Pu
 * @version 1.0
 * @since 2025/7/9 14:17
 */
public interface TerminalCacheKeyDefine {

    CacheKeyDefine TERMINAL_ACCESS = new CacheKeyBuilder()
            .key("terminal:access:{}")
            .desc("终端访问token ${token}")
            .type(TerminalAccessDTO.class)
            .struct(RedisCacheStruct.STRING)
            .timeout(3, TimeUnit.MINUTES)
            .build();

    CacheKeyDefine TERMINAL_TRANSFER = new CacheKeyBuilder()
            .key("terminal:transfer:{}")
            .desc("终端传输token ${token}")
            .type(TerminalTransferDTO.class)
            .struct(RedisCacheStruct.STRING)
            .timeout(3, TimeUnit.MINUTES)
            .build();

    CacheKeyDefine TERMINAL_SFTP_GET_CONTENT = new CacheKeyBuilder()
            .key("terminal:sftp:gc:{}")
            .desc("sftp 获取文件内容 ${token}")
            .type(SftpGetContentCacheDTO.class)
            .struct(RedisCacheStruct.STRING)
            .timeout(5, TimeUnit.MINUTES)
            .build();

    CacheKeyDefine TERMINAL_SFTP_SET_CONTENT = new CacheKeyBuilder()
            .key("terminal:sftp:sc:{}")
            .desc("sftp 设置文件内容 ${token}")
            .type(SftpSetContentCacheDTO.class)
            .struct(RedisCacheStruct.STRING)
            .timeout(5, TimeUnit.MINUTES)
            .build();

}
