
diff --git a/app/controllers/BlogController.go b/app/controllers/BlogController.go index 1ccf16f..fc5a662 100644 --- a/app/controllers/BlogController.go +++ b/app/controllers/BlogController.go @@ -481,7 +481,7 @@ func (c Blog) Cate(userIdOrEmail string, notebookId string) (re revel.Result) { return c.e404(userBlog.ThemePath) // 404 TODO 使用用户的404 } if !notebook.IsBlog { - return c.e404("") + panic("") } // 分页的话, 需要分页信息, totalPage, curPage diff --git a/app/service/NotebookService.go b/app/service/NotebookService.go index 686f82a..3ec77ea 100644 --- a/app/service/NotebookService.go +++ b/app/service/NotebookService.go @@ -185,6 +185,10 @@ func (this *NotebookService) UpdateNotebook(userId, notebookId string, needUpdat // ToBlog or Not func (this *NotebookService) ToBlog(userId, notebookId string, isBlog bool) (bool) { + // 笔记本 + db.UpdateByIdAndUserIdMap(db.Notebooks, notebookId, userId, bson.M{"IsBlog": isBlog}) + + // 更新笔记 q := bson.M{"UserId": bson.ObjectIdHex(userId), "NotebookId": bson.ObjectIdHex(notebookId)} data := bson.M{"IsBlog": isBlog} @@ -194,7 +198,7 @@ func (this *NotebookService) ToBlog(userId, notebookId string, isBlog bool) (boo data["HasSelfDefined"] = false } db.UpdateByQMap(db.Notes, q, data) - + // noteContents也更新, 这个就麻烦了, noteContents表没有NotebookId // 先查该notebook下所有notes, 得到id notes := []info.Note{} diff --git a/app/views/member/blog/update_theme.html b/app/views/member/blog/update_theme.html index 9495550..d49b089 100644 --- a/app/views/member/blog/update_theme.html +++ b/app/views/member/blog/update_theme.html @@ -39,7 +39,7 @@ }