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

Method UpdateByKey

models/ConfigModel.go:328–333  ·  view source on GitHub ↗

根据key更新配置 @param cate 配置分类 @param key 配置项 @param val 配置项的值 @return err 错误

(cate helper.ConfigCate, key, val string)

Source from the content-addressed store, hash-verified

326//@param val 配置项的值
327//@return err 错误
328func (this *Config) UpdateByKey(cate helper.ConfigCate, key, val string) (err error) {
329 _, err = orm.NewOrm().QueryTable(GetTableConfig()).Filter("Category", cate).Filter("Key", key).Update(orm.Params{
330 "Value": val,
331 })
332 return
333}
334
335func NewEmail(config ...ConfigEmail) *ConfigEmail {
336 if len(config) > 0 {

Callers

nothing calls this directly

Calls 2

GetTableConfigFunction · 0.85
UpdateMethod · 0.80

Tested by

no test coverage detected