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.
31 lines
535 B
31 lines
535 B
|
2 months ago
|
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
|
||
|
|
}
|