swirl/dao/bolt/setting.go
2018-04-28 14:13:43 +08:00

24 lines
423 B
Go

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)
}