url.go 724 Bytes
Newer Older
hujiebin's avatar
hujiebin committed
1 2 3 4 5 6 7 8
package utils

import (
	"git.hilo.cn/hilo-common/resource/config"
	"strings"
)

const DefaultAvatarMan = "hilo/manager/ea48b62d54a24a709de3c38702c89995.png"
hujiebin's avatar
hujiebin committed
9
const DefaultAvatarWoman = "hilo/manager/ea48b62d54a24a709de3c38702c89995.png"
hujiebin's avatar
hujiebin committed
10
const DEFAULT_NICK = "Hilo No.%s"
hujiebin's avatar
hujiebin committed
11 12 13 14 15 16 17 18 19 20 21 22 23

// 补全url,区分处理oss和aws两种情况
func MakeFullUrl(url string) string {
	if strings.HasPrefix(url, config.GetConfigOss().OSS_CDN) || strings.HasPrefix(url, config.GetConfigAws().AWS_CDN) {
		return url
	} else if strings.HasPrefix(url, "nextvideo/") {
		return config.GetConfigOss().OSS_CDN + url
	} else if strings.HasPrefix(url, config.GetConfigAws().AWS_DIR) {
		return config.GetConfigAws().AWS_CDN + url
	} else {
		return url
	}
}