Documentation ¶
Overview ¶
个人笔记模块
Index ¶
- func CreateMenu(c *NoteMenu) error
- func CreateMenuId(id, uid, mid uint) error
- func DeleteMenu(id, uid uint) error
- func DeleteMenuId(id, uid, mid uint) error
- func GetContent(id uint) (string, error)
- func Regedit(c *Config)
- func SaveContent(id uint, cont string) error
- type Config
- type MenuTree
- type NoteContent
- type NoteMenu
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { DB *gorm.DB NoteContentName string // 笔记内容存储表名 MenuName string // 笔记标签/目录存储表明 }
配置项信息
type MenuTree ¶
type MenuTree struct { Id uint `json:"id" form:"id"` // 菜单ID Expert string `json:"expert" form:"expert"` // 多级目录分隔符 Value string `json:"value" form:"value"` // 拼接完成的目录结构 }
获取菜单的目录树结构
type NoteContent ¶
type NoteContent struct { Id uint `gorm:"column:id;primary_key;not null;comment:笔记ID,等同node_menu.id" form:"id" json:"id"` //笔记ID,等同node.id Content string `gorm:"column:content;type:longtext;comment:笔记内容" form:"content" json:"content"` //笔记内容 }
笔记内容存储表
type NoteMenu ¶
type NoteMenu struct { Id uint `gorm:"column:id;primary_key;autoIncrement;not null" form:"id" json:"id"` Fid uint `gorm:"column:fid;comment:上级ID" form:"fid" json:"fid"` //上级ID UserId uint `gorm:"column:user_id;comment:所属用户ID" form:"user_id" json:"user_id"` //所属用户ID Name string `gorm:"column:name;type:varchar(200);comment:标签/目录名称" form:"name" json:"name"` //标签/目录名称 Type uint8 `gorm:"column:type;comment:所属分类 1-菜单 2-内容" form:"type" json:"type"` //所属分类 1-菜单 2-内容 MenuId string `gorm:"column:menu_id;type:varchar(200);comment:所属目录/标签,关联menu" form:"menu_id" json:"menu_id"` //所属目录/标签,关联menu IsDeleted uint8 `gorm:"column:is_deleted;type:tinyint unsigned;comment:是否删除" form:"-" json:"-"` //是否删除 CreatedAt string `gorm:"column:created_at;type:datetime;comment:添加时间" form:"created_at" json:"created_at"` //添加时间 UpdatedAt string `gorm:"column:updated_at;type:datetime;comment:修改时间" form:"updated_at" json:"updated_at"` //修改时间 }
笔记菜单/标签名称表
Click to show internal directories.
Click to hide internal directories.