blog, tags, archives

This commit is contained in:
life
2014-11-10 23:56:15 +08:00
parent 6555384e5c
commit d979a0c3e2
11 changed files with 233 additions and 125 deletions

View File

@ -7,7 +7,7 @@ import (
. "github.com/leanote/leanote/app/lea"
"github.com/leanote/leanote/app/info"
"os/exec"
"time"
// "time"
// "github.com/leanote/leanote/app/types"
// "io/ioutil"
// "fmt"
@ -358,19 +358,6 @@ func (c Note) Html2Image(noteId string) revel.Result {
// 设置/取消Blog; 置顶
func (c Note) SetNote2Blog(noteId string, isBlog, isTop bool) revel.Result {
noteUpdate := bson.M{}
if isTop {
isBlog = true
}
if !isBlog {
isTop = false
}
noteUpdate["IsBlog"] = isBlog
noteUpdate["IsTop"] = isTop
if isBlog {
noteUpdate["PublicTime"] = time.Now()
}
re := noteService.UpdateNote(c.GetUserId(), c.GetUserId(),
noteId, noteUpdate)
re := noteService.ToBlog(c.GetUserId(), noteId, isBlog, isTop)
return c.RenderJson(re)
}