pull/25/merge
lifei6671 2017-05-01 20:08:03 +08:00
parent 0fc6fbdc9c
commit c36faea699
2 changed files with 10 additions and 13 deletions

View File

@ -52,18 +52,15 @@ func RegisterModel() {
func Initialization() { func Initialization() {
(&models.Option{ options := []models.Option {
OptionName: "ENABLED_CAPTCHA", OptionValue: "false", OptionTitle:"是否启用验证码", { OptionName: "ENABLED_CAPTCHA", OptionValue: "false", OptionTitle:"是否启用验证码"},
}).InsertOrUpdate() { OptionName: "ENABLED_REGISTER",OptionValue:"false",OptionTitle:"是否启用注册"},
(&models.Option{ { OptionName: "ENABLE_ANONYMOUS" , OptionValue:"false", OptionTitle:"启用匿名访问"},
OptionName: "ENABLED_REGISTER",OptionValue:"false",OptionTitle:"是否启用注册", { OptionName: "SITE_NAME", OptionValue:"MinDoc", OptionTitle: "站点名称"},
}).InsertOrUpdate() }
(&models.Option{
OptionName: "ENABLE_ANONYMOUS" , OptionValue:"false", OptionTitle:"启用匿名访问",
}).InsertOrUpdate() models.NewOption().InsertMulti(options...)
(&models.Option{
OptionName: "SITE_NAME", OptionValue:"MinDoc", OptionTitle: "站点名称",
}).InsertOrUpdate()
member := models.NewMember() member := models.NewMember()
member.Account = "admin" member.Account = "admin"

View File

@ -8,7 +8,7 @@ import (
// Option struct . // Option struct .
type Option struct { type Option struct {
OptionId int `orm:"pk;auto;unique;column(option_id)" json:"option_id"` OptionId int `orm:"column(option_id);pk;auto;unique;" json:"option_id"`
OptionTitle string `orm:"column(option_title);size(500)" json:"option_title"` OptionTitle string `orm:"column(option_title);size(500)" json:"option_title"`
OptionName string `orm:"column(option_name);unique;size(80)" json:"option_name"` OptionName string `orm:"column(option_name);unique;size(80)" json:"option_name"`
OptionValue string `orm:"column(option_value);type(text);null" json:"option_value"` OptionValue string `orm:"column(option_value);type(text);null" json:"option_value"`