Documentation ¶
Index ¶
- type ThinkNote
- func (tn *ThinkNote) Insert(data *model.ThinkingNote) error
- func (tn *ThinkNote) QueryFirst(condition string, params ...interface{}) (note *model.ThinkingNote, err error)
- func (tn *ThinkNote) QueryPageByWriter(pageSize int, pageNum int, userID string) (notes []*model.ThinkingNote, count int, err error)
- func (tn *ThinkNote) QueryPageInPublic(pageSize int, pageNum int, userID string) (notes []*model.ThinkingNote, count int, err error)
- func (tn *ThinkNote) UpdateColumnsByNoteID(data *model.ThinkingNote, columns ...string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ThinkNote ¶
type ThinkNote model.ThinkingNote
func GetThinkingNote ¶
func GetThinkingNote() *ThinkNote
func (*ThinkNote) QueryFirst ¶
func (tn *ThinkNote) QueryFirst(condition string, params ...interface{}) (note *model.ThinkingNote, err error)
QueryFirst 仅选择未删除的笔记
func (*ThinkNote) QueryPageByWriter ¶
func (tn *ThinkNote) QueryPageByWriter( pageSize int, pageNum int, userID string, ) (notes []*model.ThinkingNote, count int, err error)
QueryPageByWriter 不查询已删除的记录,按照更新时间降序
func (*ThinkNote) QueryPageInPublic ¶
func (tn *ThinkNote) QueryPageInPublic( pageSize int, pageNum int, userID string, ) (notes []*model.ThinkingNote, count int, err error)
QueryPageInPublic 获取公开笔记列表,要求编辑者权限等级不高于指定用户(通过userID指定),分页,不查询已删除的记录,按照更新时间降序 * Core: sub-query
select * from thinking_note tn where tn.write_by in ( select "user_id" from users u where "permission" <= ( select "permission" from users u2 where user_id = 'user id' ) );
func (*ThinkNote) UpdateColumnsByNoteID ¶
func (tn *ThinkNote) UpdateColumnsByNoteID(data *model.ThinkingNote, columns ...string) error
UpdateColumnsByNoteID 仅可操作未删除的笔记
Click to show internal directories.
Click to hide internal directories.