Documentation
¶
Index ¶
- Constants
- func AllGetTest()
- func CateAdd(mod *Cate) error
- func CateCount() int
- func CateDrop(id int) error
- func CateEdit(mod *Cate, cols ...string) error
- func CateIds(ids []int) map[int]*Cate
- func DictAdd(mod *Dict) error
- func DictCount() int
- func DictDrop(key string) error
- func DictEdit(mod *Dict, cols ...string) error
- func GlobalEdit(mod *Global, cols ...string) error
- func Init()
- func InitMysql()
- func InitSqlite()
- func PostAdd(mod *Post) error
- func PostCount(cateId int, kind int) int
- func PostDrop(id int) error
- func PostEdit(mod *Post, cols ...string) error
- func PostExist(ptah string) bool
- func PostIds(ids []int) map[int]*Post
- func PostPath(path string) (*Post, *Naver, error)
- func PostTagDrop(postId int) error
- func PostTagDrops(postId int, tagIds []int) error
- func TagAdd(mod *Tag) error
- func TagCount() int
- func TagDrop(id int) error
- func TagEdit(mod *Tag, cols ...string) error
- func TagPostAdds(mods *[]PostTag) error
- func TagPostCount(tagId int) int
- func TagPostDrop(tagId int) error
- func UserEdit(mod *User, cols ...string) error
- type Archive
- type Cate
- type Dict
- type Global
- type Goinfo
- type IptId
- type Naver
- type Page
- type Post
- type PostTag
- type Reply
- type State
- type Tag
- type TagState
- type User
Constants ¶
View Source
const ( PostKindPost = 1 //文章 PostKindPage = 2 //页面 )
View Source
const ( PostStatusDraft = 1 //草稿 PostStatusFinish = 2 //完成 )
Variables ¶
This section is empty.
Functions ¶
func AllGetTest ¶
func AllGetTest()
func InitSqlite ¶
func InitSqlite()
func PostTagDrops ¶
PostTagDrops 修改文章时候 删除对应的标签_文章
Types ¶
type Archive ¶
------------------------------------------------------ 归档使用 ------------------------------------------------------ Archive 归档
type Cate ¶
type Cate struct { Id int `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"` Name string `gorm:"column:name;type:varchar(255);comment:分类名" json:"name"` Intro string `gorm:"column:intro;type:varchar(255);comment:描述" json:"intro"` }
Cate 分类
type Dict ¶
type Dict struct { Key string `gorm:"column:key;type:varchar(64);primary_key;comment:唯一Key" json:"key"` Value string `gorm:"column:value;type:varchar(255);comment:值" json:"value"` Inner bool `gorm:"column:inner;type:tinyint(4);comment:内部禁止删除" json:"inner"` Intro string `gorm:"column:intro;type:varchar(255);comment:说明" json:"intro"` }
Dict 配置
type Global ¶
type Global struct { Id int `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT;comment:主键" json:"id"` SiteUrl string `gorm:"column:site_url;type:varchar(255);comment:网站地址" json:"site_url"` LogoUrl string `gorm:"column:logo_url;type:varchar(255);comment:Logo地址" json:"logo_url"` Title string `gorm:"column:title;type:varchar(255);comment:网站标题" json:"title"` Keywords string `gorm:"column:keywords;type:varchar(255);comment:网站关键词" json:"keywords"` Description string `gorm:"column:description;type:varchar(255);comment:网站描述" json:"description"` FaviconUrl string `gorm:"column:favicon_url;type:varchar(255);comment:Favicon地址" json:"favicon_url"` BeianMiit string `gorm:"column:beian_miit;type:varchar(255);comment:ICP备案" json:"beian_miit"` BeianNism string `gorm:"column:beian_nism;type:varchar(255);comment:公安备案" json:"beian_nism"` Copyright string `gorm:"column:copyright;type:varchar(255);comment:版权" json:"copyright"` SiteJs string `gorm:"column:site_js;type:varchar(512);comment:全局js" json:"site_js"` SiteCss string `gorm:"column:site_css;type:varchar(512);comment:全局css" json:"site_css"` PageSize int `gorm:"column:page_size;type:int(11);default:6;comment:分页大小" json:"page_size"` Comment string `gorm:"column:comment;type:varchar(1024);comment:评论脚本" json:"comment"` GithubUrl string `gorm:"column:github_url;type:varchar(255);comment:githu地址" json:"github_url"` WeiboUrl string `gorm:"column:weibo_url;type:varchar(255);comment:微博地址" json:"weibo_url"` Analytic string `gorm:"column:analytic;type:varchar(1024);comment:统计脚本" json:"analytic"` Author string `gorm:"column:author;type:varchar(255);comment:网站作者" json:"author"` }
Global 全局配置
type Goinfo ¶
type Goinfo struct { ARCH string `json:"arch"` OS string `json:"os"` Version string `json:"version"` NumCPU int `json:"num_cpu"` }
Goinfo go information
type IptId ¶
type IptId struct {
Id int `form:"id" binding:"required" query:"id" json:"id"` //仅包含Id的请求
}
type Page ¶
type Page struct { Pi int `json:"pi" form:"pi" query:"pi"` //分页页码 Ps int `json:"ps" form:"ps" query:"ps"` //分页大小 Mult string `json:"mult" form:"mult" query:"mult"` //多条件信息 }
Page 分页基本数据
type Post ¶
type Post struct { Id int `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"` CateId int `gorm:"column:cate_id;type:int(11);comment:分类Id" json:"cate_id"` Kind int `gorm:"column:kind;type:int(11);comment:类型1-文章,2-页面" json:"kind"` Status int `gorm:"column:status;type:int(11);comment:状态1-草稿,2-已发布" json:"status"` Title string `gorm:"column:title;type:varchar(255);comment:标题" json:"title"` Path string `gorm:"column:path;type:varchar(255);comment:访问路径" json:"path"` Summary string `gorm:"column:summary;type:text;comment:摘要" json:"summary"` Markdown string `gorm:"column:markdown;type:mediumtext;comment:markdown内容" json:"markdown"` Richtext string `gorm:"column:richtext;type:mediumtext;comment:富文本内容" json:"richtext"` Allow bool `gorm:"column:allow;type:tinyint(4);default:1;comment:允许评论" json:"allow"` Created time.Time `gorm:"column:created;type:datetime;comment:创建时间" json:"created"` Updated time.Time `gorm:"column:updated;type:datetime;comment:修改时间" json:"updated"` Tags []Tag `gorm:"-" json:"tags"` //标签 Cate *Cate `gorm:"-" json:"cate"` }
func PostSingle ¶
------------------------------------------------------ 页面使用 ------------------------------------------------------ PostSingle 单页面 page
type PostTag ¶
type PostTag struct { Id int `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"` PostId int `gorm:"column:post_id;type:int(11)" json:"post_id"` TagId int `gorm:"column:tag_id;type:int(11)" json:"tag_id"` Post *Post `gorm:"-" swaggerignore:"true" json:"post"` //文章 Tag *Tag `gorm:"-" swaggerignore:"true" json:"tag"` //标签 }
PostTag 文章标签
type State ¶
type State struct { Post int `json:"post"` Page int `json:"page"` Cate int `json:"cate"` Tag int `json:"tag"` }
State 统计信息
type Tag ¶
type TagState ¶
type TagState struct { Name string `json:"name"` Count int `json:"count"` Intro string `json:"intro"` }
TagState 统计
type User ¶
type User struct { Id int `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT;comment:主键" json:"id"` Name string `gorm:"column:name;type:varchar(255);comment:姓名" json:"name"` Num string `gorm:"column:num;type:varchar(255);comment:账号" json:"num"` Passwd string `gorm:"column:passwd;type:varchar(255);comment:密码" json:"passwd"` Email string `gorm:"column:email;type:varchar(255);comment:邮箱" json:"email"` Phone string `gorm:"column:phone;type:varchar(255);comment:电话" json:"phone"` Ecount int `gorm:"column:ecount;type:int(11);default:0;comment:错误次数" json:"ecount"` Ltime time.Time `gorm:"column:ltime;type:datetime;comment:上次登录时间" json:"ltime"` Ctime time.Time `gorm:"column:ctime;type:datetime;comment:创建时间" json:"ctime"` OpenidQq string `gorm:"column:openid_qq;type:varchar(64);comment:qq_openid" json:"openid_qq"` }
User 用户
Click to show internal directories.
Click to hide internal directories.