models

package
v0.0.0-...-7bbf2bb Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

判断package是否加载过

Index

Constants

View Source
const (
	TABLE_SG_BLOG_TAGS  = "sg_blog_tags"  //
	TABLE_SG_BLOGS      = "sg_blogs"      //
	TABLE_SG_CONFIGS    = "sg_configs"    //
	TABLE_SG_MIGRATIONS = "sg_migrations" //
	TABLE_SG_TAGS       = "sg_tags"       //
	TABLE_SG_USERS      = "sg_users"      //
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SgBlogTags

type SgBlogTags struct {
	Id        int64
	BlogId    int64 //文章ID,与blogs表相关
	TagId     int64 //标签ID,与tags表相关
	CreatedAt int64 //创建时间
	UpdatedAt int64 //更新时间

}

type SgBlogTagsModel

type SgBlogTagsModel struct {
	DB *sql.DB
}

func NewSgBlogTags

func NewSgBlogTags(db *sql.DB) *SgBlogTagsModel

func (*SgBlogTagsModel) Count

func (m *SgBlogTagsModel) Count() (count int64, err error)

获取行数

func (*SgBlogTagsModel) Create

func (m *SgBlogTagsModel) Create(value *SgBlogTags) (lastId int64, err error)

新增信息

func (*SgBlogTagsModel) Find

func (m *SgBlogTagsModel) Find(value *SgBlogTags) (resList []*SgBlogTags, err error)

查询多行数据

func (*SgBlogTagsModel) First

func (m *SgBlogTagsModel) First(value *SgBlogTags) (result *SgBlogTags, err error)

获取单行数据

func (*SgBlogTagsModel) Last

func (m *SgBlogTagsModel) Last(value *SgBlogTags) (result *SgBlogTags, err error)

获取单行数据

func (*SgBlogTagsModel) Save

func (m *SgBlogTagsModel) Save(sqlTxt string, value ...interface{}) (b bool, err error)

_更新数据

func (*SgBlogTagsModel) Update

func (m *SgBlogTagsModel) Update(value *SgBlogTags) (b bool, err error)

更新数据

type SgBlogTagsNull

type SgBlogTagsNull struct {
	Id        sql.NullInt64
	BlogId    sql.NullInt64 //文章ID,与blogs表相关
	TagId     sql.NullInt64 //标签ID,与tags表相关
	CreatedAt sql.NullInt64 //创建时间
	UpdatedAt sql.NullInt64 //更新时间

}

type SgBlogs

type SgBlogs struct {
	Id         int64
	UserId     int64  //用户ID,与users表相关
	Title      string //标题
	Content    string
	Type       int64 //文章类型,1为原创,2为转载
	IsPush     int64 //是否推送,0未,1是
	Status     int64 //文章状态:1发布,2草稿
	FirstTagId int64 //首标签ID
	ReadCount  int64 //阅读次数
	StarCount  int64 //点赞次数
	CreatedAt  int64 //创建时间
	UpdatedAt  int64 //更新时间

}

type SgBlogsModel

type SgBlogsModel struct {
	DB *sql.DB
}

func NewSgBlogs

func NewSgBlogs(db *sql.DB) *SgBlogsModel

func (*SgBlogsModel) Count

func (m *SgBlogsModel) Count() (count int64, err error)

获取行数

func (*SgBlogsModel) Create

func (m *SgBlogsModel) Create(value *SgBlogs) (lastId int64, err error)

新增信息

func (*SgBlogsModel) Find

func (m *SgBlogsModel) Find(value *SgBlogs) (resList []*SgBlogs, err error)

查询多行数据

func (*SgBlogsModel) First

func (m *SgBlogsModel) First(value *SgBlogs) (result *SgBlogs, err error)

获取单行数据

func (*SgBlogsModel) Last

func (m *SgBlogsModel) Last(value *SgBlogs) (result *SgBlogs, err error)

获取单行数据

func (*SgBlogsModel) Save

func (m *SgBlogsModel) Save(sqlTxt string, value ...interface{}) (b bool, err error)

_更新数据

func (*SgBlogsModel) Update

func (m *SgBlogsModel) Update(value *SgBlogs) (b bool, err error)

更新数据

type SgBlogsNull

type SgBlogsNull struct {
	Id         sql.NullInt64
	UserId     sql.NullInt64  //用户ID,与users表相关
	Title      sql.NullString //标题
	Content    sql.NullString
	Type       sql.NullInt64 //文章类型,1为原创,2为转载
	IsPush     sql.NullInt64 //是否推送,0未,1是
	Status     sql.NullInt64 //文章状态:1发布,2草稿
	FirstTagId sql.NullInt64 //首标签ID
	ReadCount  sql.NullInt64 //阅读次数
	StarCount  sql.NullInt64 //点赞次数
	CreatedAt  sql.NullInt64 //创建时间
	UpdatedAt  sql.NullInt64 //更新时间

}

type SgConfigs

type SgConfigs struct {
	Id         int64
	Name       string //名称
	Key        string //键
	Value      string //值
	ConfigType string //变量类型:system 系统内置/user 用户定义
	Remark     string
	CreatedAt  int64 //创建时间
	UpdatedAt  int64 //更新时间

}

type SgConfigsModel

type SgConfigsModel struct {
	DB *sql.DB
}

func NewSgConfigs

func NewSgConfigs(db *sql.DB) *SgConfigsModel

func (*SgConfigsModel) Count

func (m *SgConfigsModel) Count() (count int64, err error)

获取行数

func (*SgConfigsModel) Create

func (m *SgConfigsModel) Create(value *SgConfigs) (lastId int64, err error)

新增信息

func (*SgConfigsModel) Find

func (m *SgConfigsModel) Find(value *SgConfigs) (resList []*SgConfigs, err error)

查询多行数据

func (*SgConfigsModel) First

func (m *SgConfigsModel) First(value *SgConfigs) (result *SgConfigs, err error)

获取单行数据

func (*SgConfigsModel) Last

func (m *SgConfigsModel) Last(value *SgConfigs) (result *SgConfigs, err error)

获取单行数据

func (*SgConfigsModel) Save

func (m *SgConfigsModel) Save(sqlTxt string, value ...interface{}) (b bool, err error)

_更新数据

func (*SgConfigsModel) Update

func (m *SgConfigsModel) Update(value *SgConfigs) (b bool, err error)

更新数据

type SgConfigsNull

type SgConfigsNull struct {
	Id         sql.NullInt64
	Name       sql.NullString //名称
	Key        sql.NullString //键
	Value      sql.NullString //值
	ConfigType sql.NullString //变量类型:system 系统内置/user 用户定义
	Remark     sql.NullString
	CreatedAt  sql.NullInt64 //创建时间
	UpdatedAt  sql.NullInt64 //更新时间

}

type SgMigrations

type SgMigrations struct {
	Id        int64
	Migration string
	Batch     int64
}

type SgMigrationsModel

type SgMigrationsModel struct {
	DB *sql.DB
}

func NewSgMigrations

func NewSgMigrations(db *sql.DB) *SgMigrationsModel

func (*SgMigrationsModel) Count

func (m *SgMigrationsModel) Count() (count int64, err error)

获取行数

func (*SgMigrationsModel) Create

func (m *SgMigrationsModel) Create(value *SgMigrations) (lastId int64, err error)

新增信息

func (*SgMigrationsModel) Find

func (m *SgMigrationsModel) Find(value *SgMigrations) (resList []*SgMigrations, err error)

查询多行数据

func (*SgMigrationsModel) First

func (m *SgMigrationsModel) First(value *SgMigrations) (result *SgMigrations, err error)

获取单行数据

func (*SgMigrationsModel) Last

func (m *SgMigrationsModel) Last(value *SgMigrations) (result *SgMigrations, err error)

获取单行数据

func (*SgMigrationsModel) Save

func (m *SgMigrationsModel) Save(sqlTxt string, value ...interface{}) (b bool, err error)

_更新数据

func (*SgMigrationsModel) Update

func (m *SgMigrationsModel) Update(value *SgMigrations) (b bool, err error)

更新数据

type SgMigrationsNull

type SgMigrationsNull struct {
	Id        sql.NullInt64
	Migration sql.NullString
	Batch     sql.NullInt64
}

type SgTags

type SgTags struct {
	Id        int64
	Name      string //名称
	Remark    string //备注
	CreatedAt int64  //创建时间
	UpdatedAt int64  //更新时间

}

type SgTagsModel

type SgTagsModel struct {
	DB *sql.DB
}

func NewSgTags

func NewSgTags(db *sql.DB) *SgTagsModel

func (*SgTagsModel) Count

func (m *SgTagsModel) Count() (count int64, err error)

获取行数

func (*SgTagsModel) Create

func (m *SgTagsModel) Create(value *SgTags) (lastId int64, err error)

新增信息

func (*SgTagsModel) Find

func (m *SgTagsModel) Find(value *SgTags) (resList []*SgTags, err error)

查询多行数据

func (*SgTagsModel) First

func (m *SgTagsModel) First(value *SgTags) (result *SgTags, err error)

获取单行数据

func (*SgTagsModel) Last

func (m *SgTagsModel) Last(value *SgTags) (result *SgTags, err error)

获取单行数据

func (*SgTagsModel) Save

func (m *SgTagsModel) Save(sqlTxt string, value ...interface{}) (b bool, err error)

_更新数据

func (*SgTagsModel) Update

func (m *SgTagsModel) Update(value *SgTags) (b bool, err error)

更新数据

type SgTagsNull

type SgTagsNull struct {
	Id        sql.NullInt64
	Name      sql.NullString //名称
	Remark    sql.NullString //备注
	CreatedAt sql.NullInt64  //创建时间
	UpdatedAt sql.NullInt64  //更新时间

}

type SgUsers

type SgUsers struct {
	Id           int64
	Name         string //用户名
	Pass         string //密码
	Salt         string //盐
	Google2faKey string //谷歌两步验证密钥
	LoginCount   int64  //登陆次数
	Token        string //记住密码生成的随机数
	LoginIp      string //登陆IP
	CreatedAt    int64  //创建时间
	UpdatedAt    int64  //更新时间

}

type SgUsersModel

type SgUsersModel struct {
	DB *sql.DB
}

func NewSgUsers

func NewSgUsers(db *sql.DB) *SgUsersModel

func (*SgUsersModel) Count

func (m *SgUsersModel) Count() (count int64, err error)

获取行数

func (*SgUsersModel) Create

func (m *SgUsersModel) Create(value *SgUsers) (lastId int64, err error)

新增信息

func (*SgUsersModel) Find

func (m *SgUsersModel) Find(value *SgUsers) (resList []*SgUsers, err error)

查询多行数据

func (*SgUsersModel) First

func (m *SgUsersModel) First(value *SgUsers) (result *SgUsers, err error)

获取单行数据

func (*SgUsersModel) Last

func (m *SgUsersModel) Last(value *SgUsers) (result *SgUsers, err error)

获取单行数据

func (*SgUsersModel) Save

func (m *SgUsersModel) Save(sqlTxt string, value ...interface{}) (b bool, err error)

_更新数据

func (*SgUsersModel) Update

func (m *SgUsersModel) Update(value *SgUsers) (b bool, err error)

更新数据

type SgUsersNull

type SgUsersNull struct {
	Id           sql.NullInt64
	Name         sql.NullString //用户名
	Pass         sql.NullString //密码
	Salt         sql.NullString //盐
	Google2faKey sql.NullString //谷歌两步验证密钥
	LoginCount   sql.NullInt64  //登陆次数
	Token        sql.NullString //记住密码生成的随机数
	LoginIp      sql.NullString //登陆IP
	CreatedAt    sql.NullInt64  //创建时间
	UpdatedAt    sql.NullInt64  //更新时间

}

Jump to

Keyboard shortcuts

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