Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddToOption ¶
AddToOption will add option to DB `option` table, return boolean value. If result returned is `true`, insert option data to DB successful.
func DeleteOptionByName ¶
DeleteOptionByName will delete an Option by 'option_name'. If result returned is `true`, delete option data successful.
func OptionExist ¶
OptionExist if the option_name of option exist If `true`, this option already exists.
func UpdateOptionByName ¶
UpdateOptionByName will update an option by 'option_name' If result returned is `true`, update option data successful.
Types ¶
type Article ¶
type Article struct { ID uint64 `json:"ID" xorm:"bigint(20) notnull autoincr pk 'ID'"` Title string `json:"title" xorm:"text notnull 'title'"` Content string `json:"content" xorm:"longtext notnull 'content'"` Views uint64 `json:"article_views" xorm:"bigint(20) notnull default(0) 'article_views'"` Status int `json:"article_status,omitempty" xorm:"tinyint(4) notnull default(0) 'article_status'"` CreateTime *time.Time `json:"create_time,omitempty" xorm:"datetime created notnull default('0000-00-00 00:00:00') 'create_time'"` UpdateTime *time.Time `json:"update_time,omitempty" xorm:"datetime updated notnull default('0000-00-00 00:00:00') 'update_time'"` DeleteTime *time.Time `json:"delete_time,omitempty" xorm:"datetime notnull default('0000-00-00 00:00:00') 'delete_time'"` }
Article model
func ArticleByID ¶
ArticleByID will return article by ID
func ArticlesByPage ¶
ArticlesByPage handle articles by page number
type Option ¶
type Option struct { ID uint64 `json:"option_id,omitempty" xorm:"bigint(20) notnull autoincr pk 'option_id'"` Name string `json:"option_name" xorm:"varvhar(255) notnull unique 'option_name'"` Value string `json:"option_value" xorm:"longtext notnull 'option_value'"` }
Option model, optional informations
func GetOptionByName ¶
GetOptionByName return an Option by 'option_name' if it exist Not including 'option_id'