MCPcopy Create free account
hub / github.com/TruthHun/DocHub / UpdateGlobalConfig

Method UpdateGlobalConfig

models/ConfigModel.go:307–316  ·  view source on GitHub ↗

更新全局config配置

()

Source from the content-addressed store, hash-verified

305
306//更新全局config配置
307func (this *Config) UpdateGlobalConfig() {
308 cfgs := this.All()
309 if len(cfgs) == 0 {
310 helper.Logger.Error("查询全局配置失败,config表中全局配置信息为空")
311 }
312 beego.Info(time.Now(), "更新全局配置")
313 for _, cfg := range cfgs {
314 helper.ConfigMap.Store(fmt.Sprintf("%v.%v", cfg.Category, cfg.Key), cfg.Value)
315 }
316}
317
318func (this *Config) GetByCate(cate helper.ConfigCate) (configs []Config) {
319 orm.NewOrm().QueryTable(GetTableConfig()).Filter("Category", cate).All(&configs)

Callers 1

UpdateCloudStoreMethod · 0.95

Calls 1

AllMethod · 0.95

Tested by

no test coverage detected