package svc import ( "applet/app/db" "applet/app/utils/cache" "applet/app/utils/logx" "code.fnuoos.com/EggPlanet/egg_models.git/src/implement" "strings" ) // 简单的recover func Rev() { if err := recover(); err != nil { _ = logx.Error(err) } } func GetOssUrl(img string) string { redisConn := cache.GetPool().Get() sysCfgDb := implement.NewSysCfgDb(db.Db, redisConn) sysCfg := sysCfgDb.SysCfgFindWithDb("file_bucket_scheme", "file_bucket_host") if strings.Contains(img, "http") == false && img != "" { img = sysCfg["file_bucket_scheme"] + "://" + sysCfg["file_bucket_host"] + img } return img } func GetSysCfgStr(key string) string { redisConn := cache.GetPool().Get() sysCfgDb := implement.NewSysCfgDb(db.Db, redisConn) return sysCfgDb.SysCfgGetWithDb(key) }