实现markdown编辑器

This commit is contained in:
Minho
2017-04-26 18:17:38 +08:00
parent f91ad51e3f
commit 8c85227c30
614 changed files with 80785 additions and 70030 deletions

View File

@@ -24,6 +24,11 @@ func (m *Option) TableEngine() string {
return "INNODB"
}
func (m *Option)TableNameWithPrefix() string {
return conf.GetDatabasePrefix() + m.TableName()
}
func NewOption() *Option {
return &Option{}
}
@@ -79,11 +84,11 @@ func (p *Option) InsertMulti(option... Option ) (error){
return err
}
func (p *Option) All() ([]Option,error) {
func (p *Option) All() ([]*Option,error) {
o := orm.NewOrm()
var options []Option
var options []*Option
_,err := o.QueryTable(conf.GetDatabasePrefix() + p.TableName()).All(&options)
_,err := o.QueryTable(p.TableNameWithPrefix()).All(&options)
if err != nil {
return options,err