本文整理匯總了Golang中github.com/blackmady/NoneCMS/app/models.Article.Relation方法的典型用法代碼示例。如果您正苦於以下問題:Golang Article.Relation方法的具體用法?Golang Article.Relation怎麽用?Golang Article.Relation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/blackmady/NoneCMS/app/models.Article
的用法示例。
在下文中一共展示了Article.Relation方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Edit
//.........這裏部分代碼省略.........
var keywords string = c.Params.Get("keywords")
if len(keywords) > 0 {
article.Keywords = keywords
} else {
article.Keywords = ""
}
var description string = c.Params.Get("description")
if len(description) > 0 {
article.Description = description
} else {
//是否截取內容
var add_introduce string = c.Params.Get("add_introduce")
if add_introduce == "1" {
var introcude_length string = c.Params.Get("introcude_length")
Introcude_length, err := strconv.ParseInt(introcude_length, 10, 64)
if err != nil {
revel.WARN.Println(err)
}
description = utils.Html2str(content)
article.Description = utils.Substr(description, Introcude_length)
} else {
article.Description = ""
}
}
var relation string = c.Params.Get("relation")
if len(relation) > 0 {
article.Relation = relation
} else {
article.Relation = ""
}
var pagetype string = c.Params.Get("pagetype")
if len(pagetype) > 0 {
Pagetype, err := strconv.ParseInt(pagetype, 10, 64)
if err != nil {
revel.WARN.Println(err)
}
article.Pagetype = Pagetype
} else {
article.Pagetype = 0
}
var maxcharperpage string = c.Params.Get("maxcharperpage")
if len(maxcharperpage) > 0 {
Maxcharperpage, err := strconv.ParseInt(maxcharperpage, 10, 64)
if err != nil {
revel.WARN.Println(err)
}
article.Maxcharperpage = Maxcharperpage
} else {
article.Maxcharperpage = 10000
}
var istop string = c.Params.Get("istop")
if len(istop) > 0 {
Istop, err := strconv.ParseInt(istop, 10, 64)