v1.0 beta init
This commit is contained in:
27
app/service/UpgradeService.go
Normal file
27
app/service/UpgradeService.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"github.com/leanote/leanote/app/info"
|
||||
. "github.com/leanote/leanote/app/lea"
|
||||
"github.com/leanote/leanote/app/db"
|
||||
"gopkg.in/mgo.v2/bson"
|
||||
// "time"
|
||||
)
|
||||
|
||||
|
||||
type UpgradeService struct {
|
||||
}
|
||||
|
||||
// 添加了PublicTime, RecommendTime
|
||||
func (this *UpgradeService) UpgradeBlog() bool {
|
||||
notes := []info.Note{}
|
||||
db.ListByQ(db.Notes, bson.M{"IsBlog": true}, ¬es)
|
||||
|
||||
// PublicTime, RecommendTime = UpdatedTime
|
||||
for _, note := range notes {
|
||||
db.UpdateByIdAndUserIdMap2(db.Notes, note.NoteId, note.UserId, bson.M{"PublicTime": note.UpdatedTime, "RecommendTime": note.UpdatedTime})
|
||||
Log(note.NoteId.Hex())
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
Reference in New Issue
Block a user