Documentation
¶
Index ¶
- type Note
- func (m *Note) ClassifyNotes(serverNotes []*Note, clientNotes []*pb.Note, syncLocal *bool) ([]*Note, []*Note, []*Note, []*Note)
- func (m *Note) DeleteAllChildNodes() (err error)
- func (m *Note) GetLatestNotes(notes []*Note) []*Note
- func (m *Note) GetNotesForSync(in *pb.SyncNotesRequest) ([]*Note, error)
- func (m *Note) HasInvalidNotes(in *pb.SyncNotesRequest) bool
- func (m *Note) List(parentID string, uid int64) (list []*Note, err error)
- func (m *Note) ListToMap(notes []*Note) map[string]*Note
- func (m *Note) Sorts(notes []*Note) []*Note
- func (m *Note) TableName() string
- func (m *Note) ToNotePB() *pb.Note
- func (m *Note) ToNotePBs(data []*Note) []*pb.Note
- func (m *Note) UpdateNotes(notes []*Note) error
- type NoteHistory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Note ¶
type Note struct {
base.Model
ID string `gorm:"column:id;size:36;NOT NULL;PRIMARY_KEY"`
ParentID string `gorm:"column:parent_id;size:36;NOT NULL;index:parent_id"`
UID int64 `gorm:"NOT NULL;index:uid"`
NoteType int8 `gorm:"NOT NULL"`
Level int8 `gorm:"NOT NULL"`
Title string `gorm:"size:50;NOT NULL;"`
State int8 `gorm:"NOT NULL"`
Version int32 `gorm:"NOT NULL"`
Color string `gorm:"size:7;NOT NULL;default:''"`
Content string `gorm:"NOT NULL"`
Tags pq.StringArray `gorm:"type:varchar(10)[]"`
SHA1 string `gorm:"column:sha1;size:40;NOT NULL"`
CreatedAt time.Time
UpdatedAt time.Time
}
Note ...
func (*Note) ClassifyNotes ¶
func (m *Note) ClassifyNotes(serverNotes []*Note, clientNotes []*pb.Note, syncLocal *bool) ([]*Note, []*Note, []*Note, []*Note)
ClassifyNotes classify notes for create,update,delete and client should sync
func (*Note) DeleteAllChildNodes ¶
DeleteAllChildNodes ...
func (*Note) GetLatestNotes ¶
GetLatestNotes ..
func (*Note) GetNotesForSync ¶
func (m *Note) GetNotesForSync(in *pb.SyncNotesRequest) ([]*Note, error)
GetNotesForSync ...
func (*Note) HasInvalidNotes ¶
func (m *Note) HasInvalidNotes(in *pb.SyncNotesRequest) bool
HasInvalidNotes check if uid inconsistent or level error
type NoteHistory ¶
type NoteHistory struct {
base.Model
ID int64 `gorm:"column:id;size:36;NOT NULL;PRIMARY_KEY"`
NoteID string `gorm:"column:note_id;size:36;NOT NULL;index:note_id"`
UID int64 `gorm:"NOT NULL;index:note_uid"`
Title string `gorm:"size:50;NOT NULL"`
Content string `gorm:"NOT NULL"`
Version int32 `gorm:"NOT NULL"`
SHA1 string `gorm:"column:sha1;size:40;NOT NULL"`
CreatedAt time.Time `gorm:"NOT NULL"`
}
NoteHistory ...
Click to show internal directories.
Click to hide internal directories.