swirl/dao/bolt/setting.go

24 lines
423 B
Go
Raw Normal View History

2018-04-27 13:17:00 +00:00
package bolt
import (
"github.com/cuigh/swirl/model"
)
const settingID = "0"
func (d *Dao) SettingGet() (setting *model.Setting, err error) {
var v Value
v, err = d.get("setting", settingID)
if err == nil {
setting = &model.Setting{}
if v != nil {
err = v.Unmarshal(setting)
}
}
return
}
func (d *Dao) SettingUpdate(setting *model.Setting) (err error) {
return d.update("setting", settingID, setting)
}