Search in sources :

Example 1 with AbstractOssStrategy

use of com.ruoyi.oss.service.abstractd.AbstractOssStrategy in project RuoYi-Flowable-Plus by KonBAI-Q.

the class OssFactory method init.

/**
 * 初始化工厂
 */
public static void init() {
    log.info("初始化OSS工厂");
    RedisUtils.subscribe(OssConstant.CACHE_CONFIG_KEY, String.class, type -> {
        AbstractOssStrategy strategy = getStrategy(type);
        // 未初始化不处理
        if (strategy.isInit) {
            refresh(type);
            log.info("订阅刷新OSS配置 => " + type);
        }
    });
}
Also used : AbstractOssStrategy(com.ruoyi.oss.service.abstractd.AbstractOssStrategy)

Example 2 with AbstractOssStrategy

use of com.ruoyi.oss.service.abstractd.AbstractOssStrategy in project RuoYi-Flowable-Plus by KonBAI-Q.

the class OssFactory method instance.

/**
 * 根据类型获取实例
 */
public static IOssStrategy instance(String type) {
    OssEnumd enumd = OssEnumd.find(type);
    if (enumd == null) {
        throw new OssException("文件存储服务类型无法找到!");
    }
    AbstractOssStrategy strategy = getStrategy(type);
    if (!strategy.isInit) {
        refresh(type);
    }
    return strategy;
}
Also used : OssEnumd(com.ruoyi.oss.enumd.OssEnumd) AbstractOssStrategy(com.ruoyi.oss.service.abstractd.AbstractOssStrategy) OssException(com.ruoyi.oss.exception.OssException)

Example 3 with AbstractOssStrategy

use of com.ruoyi.oss.service.abstractd.AbstractOssStrategy in project RuoYi-Vue-Plus by JavaLionLi.

the class OssFactory method instance.

/**
 * 根据类型获取实例
 */
public static IOssStrategy instance(String type) {
    OssEnumd enumd = OssEnumd.find(type);
    if (enumd == null) {
        throw new OssException("文件存储服务类型无法找到!");
    }
    AbstractOssStrategy strategy = getStrategy(type);
    if (!strategy.isInit) {
        refresh(type);
    }
    return strategy;
}
Also used : OssEnumd(com.ruoyi.oss.enumd.OssEnumd) AbstractOssStrategy(com.ruoyi.oss.service.abstractd.AbstractOssStrategy) OssException(com.ruoyi.oss.exception.OssException)

Example 4 with AbstractOssStrategy

use of com.ruoyi.oss.service.abstractd.AbstractOssStrategy in project RuoYi-Vue-Plus by JavaLionLi.

the class OssFactory method init.

/**
 * 初始化工厂
 */
public static void init() {
    log.info("初始化OSS工厂");
    RedisUtils.subscribe(OssConstant.CACHE_CONFIG_KEY, String.class, type -> {
        AbstractOssStrategy strategy = getStrategy(type);
        // 未初始化不处理
        if (strategy.isInit) {
            refresh(type);
            log.info("订阅刷新OSS配置 => " + type);
        }
    });
}
Also used : AbstractOssStrategy(com.ruoyi.oss.service.abstractd.AbstractOssStrategy)

Aggregations

AbstractOssStrategy (com.ruoyi.oss.service.abstractd.AbstractOssStrategy)4 OssEnumd (com.ruoyi.oss.enumd.OssEnumd)2 OssException (com.ruoyi.oss.exception.OssException)2