for safety image v1.0 #14

This commit is contained in:
iiuazz committed 2014-09-19 17:18:53 +08:00
1 parent c142568a56
commit 6f4ba8313c
22 files changed
+402 -83

No files matched your search

+5 -3
View File
@@ -11,9 +11,11 @@ type File struct {
AlbumId bson.ObjectId `bson:"AlbumId"`
Name string `Name` // file name
Title string `Title` // file name or user defined for search
Size int64 `Size` // file size (byte)
Type string `Type` // file type, such as image/jpg
Path string `Path` // the file path, based on /upload
Size int64 `Size` // file size (byte)
Type string `Type` // file type, "" = image, "doc" = word
Path string `Path` // the file path
IsDefaultAlbum bool `IsDefaultAlbum`
CreatedTime time.Time `CreatedTime`
FromFileId bson.ObjectId `bson:"FromFileId,omitempty"` // copy from fileId, for collaboration
}
+12
View File
@@ -0,0 +1,12 @@
package info
import (
"gopkg.in/mgo.v2/bson"
)
// 笔记内部图片
type NoteImage struct {
NoteImageId bson.ObjectId `bson:"_id,omitempty"` // 必须要设置bson:"_id" 不然mgo不会认为是主键
NoteId bson.ObjectId `bson:"NoteId"` // 笔记
ImageId bson.ObjectId `bson:"ImageId"` // 图片fileId
}
+8 -6
View File
@@ -24,6 +24,8 @@ type Note struct {
IsMarkdown bool `IsMarkdown` // 是否是markdown笔记, 默认是false
AttachIds []string `FileIds,omitempty` // 2014/9/18, attachments
CreatedTime time.Time `CreatedTime`
UpdatedTime time.Time `UpdatedTime`
UpdatedUserId bson.ObjectId `bson:"UpdatedUserId"` // 如果共享了, 并可写, 那么可能是其它他修改了
@@ -54,11 +56,11 @@ type NoteAndContent struct {
// 每一个历史记录对象
type EachHistory struct {
UpdatedUserId bson.ObjectId `UpdatedUserId`
UpdatedTime time.Time `UpdatedTime`
Content string `Content`
UpdatedTime time.Time `UpdatedTime`
Content string `Content`
}
type NoteContentHistory struct {
NoteId bson.ObjectId `bson:"_id,omitempty"`
UserId bson.ObjectId `bson:"UserId"` // 所属者
Histories []EachHistory `Histories`
}
NoteId bson.ObjectId `bson:"_id,omitempty"`
UserId bson.ObjectId `bson:"UserId"` // 所属者
Histories []EachHistory `Histories`
}