|
1234567891011121314151617181920212223242526272829303132 |
- package svc
-
- import (
- "applet/app/db"
- "applet/app/utils/cache"
- "code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
- "strings"
- )
-
- func GetOssUrl(img string) string {
- redisConn := cache.GetPool().Get()
- sysCfgDb := implement.NewSysCfgDb(db.Db, redisConn)
- sysCfg := sysCfgDb.SysCfgFindWithDb("oss_domain", "oss_bucket_scheme")
- if strings.Contains(img, "http") == false && img != "" {
- http := sysCfg["oss_bucket_scheme"]
- img = http + "://" + sysCfg["oss_domain"] + "/" + img
- }
- return img
- }
- func GetOssDomain() string {
- redisConn := cache.GetPool().Get()
- sysCfgDb := implement.NewSysCfgDb(db.Db, redisConn)
- sysCfg := sysCfgDb.SysCfgFindWithDb("oss_domain", "oss_bucket_scheme")
- http := sysCfg["oss_bucket_scheme"]
- return http + "://" + sysCfg["oss_domain"] + "/"
- }
- func GetSysCfgStr(key string) string {
- redisConn := cache.GetPool().Get()
- sysCfgDb := implement.NewSysCfgDb(db.Db, redisConn)
- return sysCfgDb.SysCfgGetWithDb(key)
-
- }
|