Skip to content
This repository has been archived by the owner on Mar 26, 2021. It is now read-only.

Commit

Permalink
demo, delete notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
lealife committed Sep 17, 2015
1 parent 11647cc commit 09e7b2f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (c Auth) Logout() revel.Result {

// 体验一下
func (c Auth) Demo() revel.Result {
email := configService.GetGlobalStringConfig("demoPassword")
email := configService.GetGlobalStringConfig("demoUsername")
pwd := configService.GetGlobalStringConfig("demoPassword");
userInfo, err := authService.Login(email, pwd)
if err != nil {
Expand Down
10 changes: 7 additions & 3 deletions src/github.com/leanote/leanote/app/service/NotebookService.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,15 @@ func (this *NotebookService) ToBlog(userId, notebookId string, isBlog bool) (boo
// 查看是否有子notebook
// 先查看该notebookId下是否有notes, 没有则删除
func (this *NotebookService) DeleteNotebook(userId, notebookId string) (bool, string) {
if db.Count(db.Notebooks, bson.M{"ParentNotebookId": bson.ObjectIdHex(notebookId),
"UserId": bson.ObjectIdHex(userId)}) == 0 { // 无
if db.Count(db.Notebooks, bson.M{
"ParentNotebookId": bson.ObjectIdHex(notebookId),
"UserId": bson.ObjectIdHex(userId),
"IsDeleted": false,
}) == 0 { // 无
if db.Count(db.Notes, bson.M{"NotebookId": bson.ObjectIdHex(notebookId),
"UserId": bson.ObjectIdHex(userId),
"IsTrash": false}) == 0 { // 不包含trash
"IsTrash": false,
"IsDeleted": false}) == 0 { // 不包含trash
// 不是真删除 1/20, 为了同步笔记本
ok := db.UpdateByQMap(db.Notebooks, bson.M{"_id": bson.ObjectIdHex(notebookId)}, bson.M{"IsDeleted": true, "Usn": userService.IncrUsn(userId)})
return ok, ""
Expand Down
2 changes: 1 addition & 1 deletion src/github.com/leanote/leanote/bin/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SP=$(cd "$(dirname "$0")"; pwd)
tmp="/Users/life/Desktop/leanote_release"

# version
V="v1.0"
V="v1.0.1"

##=================================
# 1. 先build 成 3个平台, 2种bit = 6种
Expand Down

0 comments on commit 09e7b2f

Please sign in to comment.