model

package
v1.0.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Art

type Art struct {
	Id          int64  `xorm:"int(10)" json:"id"`
	Uuid        string `xorm:"char(32)" json:"uuid"`
	CateId      int64  `xorm:"int(10)" json:"cate_id"`
	UserId      int64  `xorm:"int(10)" json:"user_id"`
	Cover       string `xorm:"char(32)" json:"cover"`
	Title       string `xorm:"varchar(150)" json:"title"`
	Keywords    string `xorm:"varchar(100)" json:"keywords"`
	Description string `xorm:"varchar(200)" json:"description"`
	Content     string `xorm:"longtext" json:"content"`
	Tags        string `xorm:"varchar(250)" json:"tags"`
	From        string `xorm:"varchar(200)" json:"from"`
	Views       int64  `xorm:"bigint(20)" json:"views"`
	IsTop       int    `xorm:"tinyint(1)" json:"is_top"`
	Status      int    `xorm:"tinyint(1)" json:"status"`
	AddTime     int64  `xorm:"created" json:"add_time"`
	AddIp       string `xorm:"varchar(50)" json:"add_ip"`
}

文章

type ArtCate

type ArtCate struct {
	Art  `xorm:"extends""`
	Cate `xorm:"extends""`
}

文章带分类

type ArtCatename

type ArtCatename struct {
	Art
	CateName string
	CateSlug string
}

文章带分类

type Attach

type Attach struct {
	Id      string `xorm:"char(32)" json:"id"`
	Name    string `xorm:"text" json:"name"`
	Path    string `xorm:"varchar(250)" json:"path"`
	Ext     string `xorm:"varchar(10)" json:"ext"`
	Size    int64  `xorm:"int(10)" json:"size"`
	Md5     string `xorm:"char(32)" json:"md5"`
	Status  int    `xorm:"tinyint(1)" json:"status"`
	AddTime int64  `xorm:"created" json:"add_time"`
	AddIp   string `xorm:"varchar(50)" json:"add_ip"`
}

附件

type Cate

type Cate struct {
	Id      int64  `xorm:"int(10)" json:"id"`
	Pid     int64  `xorm:"int(10)" json:"pid"`
	Name    string `xorm:"varchar(50)" json:"name"`
	Slug    string `xorm:"varchar(50)" json:"slug"`
	Desc    string `xorm:"varchar(200)" json:"desc"`
	Sort    int    `xorm:"int(5)" json:"sort"`
	Tpl     string `xorm:"varchar(200)" json:"tpl"`
	ViewTpl string `xorm:"varchar(200)" json:"view_tpl"`
	Status  int    `xorm:"tinyint(1)" json:"status"`
	AddTime int64  `xorm:"created" json:"add_time"`
	AddIp   string `xorm:"varchar(50)" json:"add_ip"`
}

分类

type CateTree

type CateTree struct {
	Cate
	Children []CateTree
}

分类树

func ToCateTree

func ToCateTree(data []Cate, pid int64) []CateTree

转换为树形结构

type Config

type Config struct {
	Id    int64  `xorm:"int(10)" json:"id"`
	Key   string `xorm:"varchar(100)" json:"key"`
	Value string `xorm:"text" json:"value"`
	Desc  string `xorm:"varchar(200)" json:"desc"`
}

配置

type Page

type Page struct {
	Id          int64  `xorm:"int(10)" json:"id"`
	UserId      int64  `xorm:"int(10)" json:"user_id"`
	Slug        string `xorm:"varchar(150)" json:"slug"`
	Title       string `xorm:"varchar(200)" json:"title"`
	Keywords    string `xorm:"varchar(100)" json:"keywords"`
	Description string `xorm:"varchar(200)" json:"description"`
	Content     string `xorm:"longtext" json:"content"`
	Tpl         string `xorm:"varchar(200)" json:"tpl"`
	Status      int    `xorm:"tinyint(1)" json:"status"`
	AddTime     int64  `xorm:"created" json:"add_time"`
	AddIp       string `xorm:"varchar(50)" json:"add_ip"`
}

单页

type Tag

type Tag struct {
	Id      int64  `xorm:"int(10)" json:"id"`
	Name    string `xorm:"varchar(50)" json:"name"`
	Desc    string `xorm:"varchar(200)" json:"desc"`
	Sort    int    `xorm:"int(5)" json:"sort"`
	Status  int    `xorm:"tinyint(1)" json:"status"`
	AddTime int64  `xorm:"created" json:"add_time"`
	AddIp   string `xorm:"varchar(50)" json:"add_ip"`
}

标签

type User

type User struct {
	Id       int64  `xorm:"int(10)" json:"id"`
	Username string `xorm:"varchar(50)" json:"username"`
	Password string `xorm:"char(32)" json:"password"`
	Nickname string `xorm:"varchar(100)" json:"nickname"`
	Avatar   string `xorm:"char(32)" json:"avatar"`
	Sign     string `xorm:"varchar(200)" json:"sign"`
	Status   int    `xorm:"tinyint(1)" json:"status"`
	AddTime  int64  `xorm:"created" json:"add_time"`
	AddIp    string `xorm:"varchar(50)" json:"add_ip"`
}

用户

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL