parent
3a14ff4352
commit
40c0a7b8d6
1 changed files with 30 additions and 0 deletions
@ -0,0 +1,30 @@ |
|||||||
|
package call |
||||||
|
|
||||||
|
import ( |
||||||
|
"github.com/liangdas/mqant/log" |
||||||
|
"server/common" |
||||||
|
"server/db" |
||||||
|
) |
||||||
|
|
||||||
|
var ( |
||||||
|
ConfigGoods = []*common.SheetGoods_config{} |
||||||
|
) |
||||||
|
|
||||||
|
func LoadGoodsConfig() error { |
||||||
|
ConfigGoods = []*common.SheetGoods_config{} |
||||||
|
err := db.Redis().LRange(common.RedisKeyConfigGoodsConfig, &ConfigGoods) |
||||||
|
if err != nil { |
||||||
|
log.Error("err:%v", err) |
||||||
|
return err |
||||||
|
} |
||||||
|
return nil |
||||||
|
} |
||||||
|
|
||||||
|
func GetGoodsConfig() []*common.SheetGoods_config { |
||||||
|
if len(ConfigGoods) == 0 { |
||||||
|
if err := LoadGoodsConfig(); err != nil { |
||||||
|
return nil |
||||||
|
} |
||||||
|
} |
||||||
|
return ConfigGoods |
||||||
|
} |
||||||
Loading…
Reference in new issue