mirror of
https://github.com/cuigh/swirl
synced 2024-12-31 16:23:13 +00:00
24 lines
423 B
Go
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)
|
|
}
|