蛋蛋星球 后台端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

пре 1 дан
пре 1 дан
пре 1 дан
1234567891011121314151617181920212223242526272829303132
  1. package svc
  2. import (
  3. "applet/app/db"
  4. "applet/app/utils/cache"
  5. "code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
  6. "strings"
  7. )
  8. func GetOssUrl(img string) string {
  9. redisConn := cache.GetPool().Get()
  10. sysCfgDb := implement.NewSysCfgDb(db.Db, redisConn)
  11. sysCfg := sysCfgDb.SysCfgFindWithDb("oss_domain", "oss_bucket_scheme")
  12. if strings.Contains(img, "http") == false && img != "" {
  13. http := sysCfg["oss_bucket_scheme"]
  14. img = http + "://" + sysCfg["oss_domain"] + "/" + img
  15. }
  16. return img
  17. }
  18. func GetOssDomain() string {
  19. redisConn := cache.GetPool().Get()
  20. sysCfgDb := implement.NewSysCfgDb(db.Db, redisConn)
  21. sysCfg := sysCfgDb.SysCfgFindWithDb("oss_domain", "oss_bucket_scheme")
  22. http := sysCfg["oss_bucket_scheme"]
  23. return http + "://" + sysCfg["oss_domain"] + "/"
  24. }
  25. func GetSysCfgStr(key string) string {
  26. redisConn := cache.GetPool().Get()
  27. sysCfgDb := implement.NewSysCfgDb(db.Db, redisConn)
  28. return sysCfgDb.SysCfgGetWithDb(key)
  29. }