|
|
@ -46,10 +46,11 @@ func (this *BlogController) Save() { |
|
|
|
} |
|
|
|
title := this.GetString("title") |
|
|
|
blogHtml := this.GetString("blogHtml") |
|
|
|
blogDesc := this.GetString("blogDesc") |
|
|
|
catory := this.GetString("catory") |
|
|
|
catoryId, _ := strconv.ParseInt(catory, 10, 64) |
|
|
|
labels := this.GetStrings("labels[]") |
|
|
|
blog := &models.Blog{Title: title, BlogHtml: blogHtml, CategoryId: catoryId, UserId: uid.(int64)} |
|
|
|
blog := &models.Blog{Title: title, BlogHtml: blogHtml, CategoryId: catoryId, UserId: uid.(int64), BlogDesc: blogDesc} |
|
|
|
err := blogService.SaveBlog(blog, labels) |
|
|
|
if err == nil { |
|
|
|
this.Data["json"] = models.ReurnData("", blog.Id) |
|
|
@ -73,6 +74,7 @@ func (this *BlogController) Edit() { |
|
|
|
id, _ := this.GetInt64("id") |
|
|
|
title := this.GetString("title") |
|
|
|
blogHtml := this.GetString("blogHtml") |
|
|
|
blogDesc := this.GetString("blogDesc") |
|
|
|
catory := this.GetString("catory") |
|
|
|
catoryId, _ := strconv.ParseInt(catory, 10, 64) |
|
|
|
labels := this.GetStrings("labels[]") |
|
|
@ -84,6 +86,7 @@ func (this *BlogController) Edit() { |
|
|
|
} |
|
|
|
blog.Title = title |
|
|
|
blog.BlogHtml = blogHtml |
|
|
|
blog.BlogDesc = blogDesc |
|
|
|
blog.CategoryId = catoryId |
|
|
|
blog.Utime = time.Now() |
|
|
|
err = blogService.EditBlog(blog, labels) |
|
|
@ -227,4 +230,3 @@ func (this *BlogController) Search() { |
|
|
|
this.Data["json"] = models.ReurnData("", blog) |
|
|
|
this.ServeJSON() |
|
|
|
} |
|
|
|
|
|
|
|