admin
2022-04-09 ce3420676d9ccf4a2bdf87aeb7ad1494b5e5d26c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.yeshi.makemoney.app.utils;
 
import com.yeshi.makemoney.app.Application;
 
import java.util.Properties;
 
/**
 * @author hxh
 * @title: ImageUtil
 * @description: 图片帮助类
 * @date 2022/4/9 14:15
 */
public class ImageUtil {
 
    private static String domain;
 
    private static String getVisitDomain() {
        if (domain == null) {
            Properties ps = org.yeshi.utils.PropertiesUtil
                    .getProperties(Application.class.getClassLoader().getResourceAsStream("cos.properties"));
            domain = ps.getProperty("domain");
        }
        return domain;
    }
 
 
    /**
     * @author hxh 
     * @description 获取cos的图片访问路径
     * @date 14:17 2022/4/9
     * @param: key
     * @return java.lang.String
     **/
    public static String getCOSImageUrl(String key) {
        return getVisitDomain() + key;
 
    }
 
}