init
This commit is contained in:
21
app/service/SuggestionService.go
Normal file
21
app/service/SuggestionService.go
Normal file
@ -0,0 +1,21 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"github.com/leanote/leanote/app/info"
|
||||
"github.com/leanote/leanote/app/db"
|
||||
// . "github.com/leanote/leanote/app/lea"
|
||||
"labix.org/v2/mgo/bson"
|
||||
// "time"
|
||||
// "sort"
|
||||
)
|
||||
|
||||
type SuggestionService struct {
|
||||
}
|
||||
|
||||
// 得到某博客具体信息
|
||||
func (this *SuggestionService) AddSuggestion(suggestion info.Suggestion) bool {
|
||||
if suggestion.Id == "" {
|
||||
suggestion.Id = bson.NewObjectId()
|
||||
}
|
||||
return db.Insert(db.Suggestions, suggestion)
|
||||
}
|
Reference in New Issue
Block a user