model

package
v0.0.0-...-6d7266f Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LoginTypeEmail  = "email" // 邮箱登录
	LoginTypeMobile = "phone" // 手机登录
	LoginTypeOauth  = "oauth" // 第三方登录
)

登录类型

View Source
const (
	UserStatusDeleted  = -1
	UserStatusNormal   = 0
	UserStatusDisabled = 1
)

用户状态

View Source
const (
	//1公开 2私密 3评论可见
	ArticleStatusPublic  = 1
	ArticleStatusPrivate = 2
	ArticleStatusComment = 3
)
View Source
const (
	//0未删除 1已删除
	ArticleIsDeleteUnused = -1
	ArticleIsDeleteNo     = 2
	ArticleIsDeleteYes    = 1

	//0未置顶 1置顶
	ArticleIsTopUnused = -1
	ArticleIsTopNo     = 2
	ArticleIsTopYes    = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type TAlbum

type TAlbum struct {
	Id         int64     `json:"id" gorm:"column:id" `                   // 主键
	AlbumName  string    `json:"album_name" gorm:"column:album_name" `   // 相册名
	AlbumDesc  string    `json:"album_desc" gorm:"column:album_desc" `   // 相册描述
	AlbumCover string    `json:"album_cover" gorm:"column:album_cover" ` // 相册封面
	IsDelete   int64     `json:"is_delete" gorm:"column:is_delete" `     // 是否删除
	Status     int64     `json:"status" gorm:"column:status" `           // 状态值 1公开 2私密
	CreatedAt  time.Time `json:"created_at" gorm:"column:created_at" `   // 创建时间
	UpdatedAt  time.Time `json:"updated_at" gorm:"column:updated_at" `   // 更新时间
}

表字段定义

type TAlbumModel

type TAlbumModel interface {
	TableName() string
	// 在事务中操作
	WithTransaction(tx *gorm.DB) (out TAlbumModel)
	// 插入
	Insert(ctx context.Context, in *TAlbum) (rows int64, err error)
	Inserts(ctx context.Context, in ...*TAlbum) (rows int64, err error)
	// 删除
	Delete(ctx context.Context, id int64) (rows int64, err error)
	Deletes(ctx context.Context, conditions string, args ...interface{}) (rows int64, err error)
	// 更新
	Update(ctx context.Context, in *TAlbum) (rows int64, err error)
	Updates(ctx context.Context, columns map[string]interface{}, conditions string, args ...interface{}) (rows int64, err error)
	// 保存
	Save(ctx context.Context, in *TAlbum) (rows int64, err error)
	// 查询
	FindOne(ctx context.Context, id int64) (out *TAlbum, err error)
	First(ctx context.Context, conditions string, args ...interface{}) (out *TAlbum, err error)
	FindCount(ctx context.Context, conditions string, args ...interface{}) (count int64, err error)
	FindALL(ctx context.Context, conditions string, args ...interface{}) (list []*TAlbum, err error)
	FindList(ctx context.Context, page int, size int, sorts string, conditions string, args ...interface{}) (list []*TAlbum, err error)
}

接口定义

func NewTAlbumModel

func NewTAlbumModel(db *gorm.DB, cache *redis.Client) TAlbumModel

type TApi

type TApi struct {
	Id        int64     `json:"id" gorm:"column:id" `                 // 主键id
	ParentId  int64     `json:"parent_id" gorm:"column:parent_id" `   // 分组id
	Name      string    `json:"name" gorm:"column:name" `             // api名称
	Path      string    `json:"path" gorm:"column:path" `             // api路径
	Method    string    `json:"method" gorm:"column:method" `         // api请求方法
	Traceable int64     `json:"traceable" gorm:"column:traceable" `   // 是否追溯操作记录 0需要,1是
	IsDisable int64     `json:"is_disable" gorm:"column:is_disable" ` // 是否禁用 0否 1是
	CreatedAt time.Time `json:"created_at" gorm:"column:created_at" ` // 创建时间
	UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at" ` // 更新时间
}

表字段定义

type TApiModel

type TApiModel interface {
	TableName() string
	// 在事务中操作
	WithTransaction(tx *gorm.DB) (out TApiModel)
	// 插入
	Insert(ctx context.Context, in *TApi) (rows int64, err error)
	Inserts(ctx context.Context, in ...*TApi) (rows int64, err error)
	// 删除
	Delete(ctx context.Context, id int64) (rows int64, err error)
	Deletes(ctx context.Context, conditions string, args ...interface{}) (rows int64, err error)
	// 更新
	Update(ctx context.Context, in *TApi) (rows int64, err error)
	Updates(ctx context.Context, columns map[string]interface{}, conditions string, args ...interface{}) (rows int64, err error)
	// 保存
	Save(ctx context.Context, in *TApi) (rows int64, err error)
	// 查询
	FindOne(ctx context.Context, id int64) (out *TApi, err error)
	First(ctx context.Context, conditions string, args ...interface{}) (out *TApi, err error)
	FindCount(ctx context.Context, conditions string, args ...interface{}) (count int64, err error)
	FindALL(ctx context.Context, conditions string, args ...interface{}) (list []*TApi, err error)
	FindList(ctx context.Context, page int, size int, sorts string, conditions string, args ...interface{}) (list []*TApi, err error)
	// add extra method in here
	FindOneByPathMethodName(ctx context.Context, path string, method string, name string) (out *TApi, err error)
}

接口定义

func NewTApiModel

func NewTApiModel(db *gorm.DB, cache *redis.Client) TApiModel

type TArticle

type TArticle struct {
	Id             int64     `json:"id" gorm:"column:id" `                           // id
	UserId         string    `json:"user_id" gorm:"column:user_id" `                 // 作者
	CategoryId     int64     `json:"category_id" gorm:"column:category_id" `         // 文章分类
	ArticleCover   string    `json:"article_cover" gorm:"column:article_cover" `     // 文章缩略图
	ArticleTitle   string    `json:"article_title" gorm:"column:article_title" `     // 标题
	ArticleContent string    `json:"article_content" gorm:"column:article_content" ` // 内容
	ArticleType    int64     `json:"article_type" gorm:"column:article_type" `       // 文章类型 1原创 2转载 3翻译
	OriginalUrl    string    `json:"original_url" gorm:"column:original_url" `       // 原文链接
	IsTop          int64     `json:"is_top" gorm:"column:is_top" `                   // 是否置顶 0否 1是
	IsDelete       int64     `json:"is_delete" gorm:"column:is_delete" `             // 是否删除  0否 1是
	Status         int64     `json:"status" gorm:"column:status" `                   // 状态值 1公开 2私密 3评论可见
	LikeCount      int64     `json:"like_count" gorm:"column:like_count" `           // 点赞数
	CreatedAt      time.Time `json:"created_at" gorm:"column:created_at" `           // 发表时间
	UpdatedAt      time.Time `json:"updated_at" gorm:"column:updated_at" `           // 更新时间
}

表字段定义

type TArticleModel

type TArticleModel interface {
	TableName() string
	// 在事务中操作
	WithTransaction(tx *gorm.DB) (out TArticleModel)
	// 插入
	Insert(ctx context.Context, in *TArticle) (rows int64, err error)
	Inserts(ctx context.Context, in ...*TArticle) (rows int64, err error)
	// 删除
	Delete(ctx context.Context, id int64) (rows int64, err error)
	Deletes(ctx context.Context, conditions string, args ...interface{}) (rows int64, err error)
	// 更新
	Update(ctx context.Context, in *TArticle) (rows int64, err error)
	Updates(ctx context.Context, columns map[string]interface{}, conditions string, args ...interface{}) (rows int64, err error)
	// 保存
	Save(ctx context.Context, in *TArticle) (rows int64, err error)
	// 查询
	FindOne(ctx context.Context, id int64) (out *TArticle, err error)
	First(ctx context.Context, conditions string, args ...interface{}) (out *TArticle, err error)
	FindCount(ctx context.Context, conditions string, args ...interface{}) (count int64, err error)
	FindALL(ctx context.Context, conditions string, args ...interface{}) (list []*TArticle, err error)
	FindList(ctx context.Context, page int, size int, sorts string, conditions string, args ...interface{}) (list []*TArticle, err error)
}

接口定义

func NewTArticleModel

func NewTArticleModel(db *gorm.DB, cache *redis.Client) TArticleModel

type TArticleTag

type TArticleTag struct {
	Id        int64 `json:"id" gorm:"column:id" `                 // id
	ArticleId int64 `json:"article_id" gorm:"column:article_id" ` // 文章id
	TagId     int64 `json:"tag_id" gorm:"column:tag_id" `         // 标签id
}

表字段定义

type TArticleTagModel

type TArticleTagModel interface {
	TableName() string
	// 在事务中操作
	WithTransaction(tx *gorm.DB) (out TArticleTagModel)
	// 插入
	Insert(ctx context.Context, in *TArticleTag) (rows int64, err error)
	Inserts(ctx context.Context, in ...*TArticleTag) (rows int64, err error)
	// 删除
	Delete(ctx context.Context, id int64) (rows int64, err error)
	Deletes(ctx context.Context, conditions string, args ...interface{}) (rows int64, err error)
	// 更新
	Update(ctx context.Context, in *TArticleTag) (rows int64, err error)
	Updates(ctx context.Context, columns map[string]interface{}, conditions string, args ...interface{}) (rows int64, err error)
	// 保存
	Save(ctx context.Context, in *TArticleTag) (rows int64, err error)
	// 查询
	FindOne(ctx context.Context, id int64) (out *TArticleTag, err error)
	First(ctx context.Context, conditions string, args ...interface{}) (out *TArticleTag, err error)
	FindCount(ctx context.Context, conditions string, args ...interface{}) (count int64, err error)
	FindALL(ctx context.Context, conditions string, args ...interface{}) (list []*TArticleTag, err error)
	FindList(ctx context.Context, page int, size int, sorts string, conditions string, args ...interface{}) (list []*TArticleTag, err error)
}

接口定义

func NewTArticleTagModel

func NewTArticleTagModel(db *gorm.DB, cache *redis.Client) TArticleTagModel

type TCategory

type TCategory struct {
	Id           int64     `json:"id" gorm:"column:id" `                       // id
	CategoryName string    `json:"category_name" gorm:"column:category_name" ` // 分类名
	CreatedAt    time.Time `json:"created_at" gorm:"column:created_at" `       // 创建时间
	UpdatedAt    time.Time `json:"updated_at" gorm:"column:updated_at" `       // 更新时间
}

表字段定义

type TCategoryModel

type TCategoryModel interface {
	TableName() string
	// 在事务中操作
	WithTransaction(tx *gorm.DB) (out TCategoryModel)
	// 插入
	Insert(ctx context.Context, in *TCategory) (rows int64, err error)
	Inserts(ctx context.Context, in ...*TCategory) (rows int64, err error)
	// 删除
	Delete(ctx context.Context, id int64) (rows int64, err error)
	Deletes(ctx context.Context, conditions string, args ...interface{}) (rows int64, err error)
	// 更新
	Update(ctx context.Context, in *TCategory) (rows int64, err error)
	Updates(ctx context.Context, columns map[string]interface{}, conditions string, args ...interface{}) (rows int64, err error)
	// 保存
	Save(ctx context.Context, in *TCategory) (rows int64, err error)
	// 查询
	FindOne(ctx context.Context, id int64) (out *TCategory, err error)
	First(ctx context.Context, conditions string, args ...interface{}) (out *TCategory, err error)
	FindCount(ctx context.Context, conditions string, args ...interface{}) (count int64, err error)
	FindALL(ctx context.Context, conditions string, args ...interface{}) (list []*TCategory, err error)
	FindList(ctx context.Context, page int, size int, sorts string, conditions string, args ...interface{}) (list []*TCategory, err error)
	// add extra method in here
	FindOneByCategoryName(ctx context.Context, category_name string) (out *TCategory, err error)
}

接口定义

func NewTCategoryModel

func NewTCategoryModel(db *gorm.DB, cache *redis.Client) TCategoryModel

type TChatMessage

type TChatMessage struct {
	Id          int64     `json:"id" gorm:"column:id" `                       // 主键
	UserId      string    `json:"user_id" gorm:"column:user_id" `             // 用户id
	DeviceId    string    `json:"device_id" gorm:"column:device_id" `         // 设备id
	TopicId     string    `json:"topic_id" gorm:"column:topic_id" `           // 主题id,表示一个群会话
	ReplyMsgId  string    `json:"reply_msg_id" gorm:"column:reply_msg_id" `   // 回复消息id,at消息
	ReplyUserId string    `json:"reply_user_id" gorm:"column:reply_user_id" ` // 回复用户列表,at用户列表
	ChatContent string    `json:"chat_content" gorm:"column:chat_content" `   // 聊天内容
	IpAddress   string    `json:"ip_address" gorm:"column:ip_address" `       // 用户ip 127.0.0.1
	IpSource    string    `json:"ip_source" gorm:"column:ip_source" `         // 用户地址 广东省深圳市
	Type        string    `json:"type" gorm:"column:type" `                   // 类型:chatgpt chatroom
	Status      int64     `json:"status" gorm:"column:status" `               // 状态:0正常 1编辑 2撤回 3删除
	CreatedAt   time.Time `json:"created_at" gorm:"column:created_at" `       // 创建时间
	UpdatedAt   time.Time `json:"updated_at" gorm:"column:updated_at" `       // 更新时间
}

表字段定义

type TChatMessageModel

type TChatMessageModel interface {
	TableName() string
	// 在事务中操作
	WithTransaction(tx *gorm.DB) (out TChatMessageModel)
	// 插入
	Insert(ctx context.Context, in *TChatMessage) (rows int64, err error)
	Inserts(ctx context.Context, in ...*TChatMessage) (rows int64, err error)
	// 删除
	Delete(ctx context.Context, id int64) (rows int64, err error)
	Deletes(ctx context.Context, conditions string, args ...interface{}) (rows int64, err error)
	// 更新
	Update(ctx context.Context, in *TChatMessage) (rows int64, err error)
	Updates(ctx context.Context, columns map[string]interface{}, conditions string, args ...interface{}) (rows int64, err error)
	// 保存
	Save(ctx context.Context, in *TChatMessage) (rows int64, err error)
	// 查询
	FindOne(ctx context.Context, id int64) (out *TChatMessage, err error)
	First(ctx context.Context, conditions string, args ...interface{}) (out *TChatMessage, err error)
	FindCount(ctx context.Context, conditions string, args ...interface{}) (count int64, err error)
	FindALL(ctx context.Context, conditions string, args ...interface{}) (list []*TChatMessage, err error)
	FindList(ctx context.Context, page int, size int, sorts string, conditions string, args ...interface{}) (list []*TChatMessage, err error)
}

接口定义

func NewTChatMessageModel

func NewTChatMessageModel(db *gorm.DB, cache *redis.Client) TChatMessageModel

type TComment

type TComment struct {
	Id             int64     `json:"id" gorm:"column:id" `                           // 主键
	UserId         string    `json:"user_id" gorm:"column:user_id" `                 // 评论用户id
	TopicId        int64     `json:"topic_id" gorm:"column:topic_id" `               // 主题id
	ParentId       int64     `json:"parent_id" gorm:"column:parent_id" `             // 父评论id
	ReplyMsgId     int64     `json:"reply_msg_id" gorm:"column:reply_msg_id" `       // 回复评论id
	ReplyUserId    string    `json:"reply_user_id" gorm:"column:reply_user_id" `     // 评论回复用户id
	CommentContent string    `json:"comment_content" gorm:"column:comment_content" ` // 评论内容
	IpAddress      string    `json:"ip_address" gorm:"column:ip_address" `           // ip地址 127.0.01
	IpSource       string    `json:"ip_source" gorm:"column:ip_source" `             // ip来源 广东省
	Type           int64     `json:"type" gorm:"column:type" `                       // 评论类型 1.文章 2.友链 3.说说
	Status         int64     `json:"status" gorm:"column:status" `                   // 状态 0.正常 1.已编辑 2.已删除
	IsReview       int64     `json:"is_review" gorm:"column:is_review" `             // 是否审核通过
	LikeCount      int64     `json:"like_count" gorm:"column:like_count" `           // 评论点赞数量
	CreatedAt      time.Time `json:"created_at" gorm:"column:created_at" `           // 创建时间
	UpdatedAt      time.Time `json:"updated_at" gorm:"column:updated_at" `           // 更新时间
}

表字段定义

type TCommentModel

type TCommentModel interface {
	TableName() string
	// 在事务中操作
	WithTransaction(tx *gorm.DB) (out TCommentModel)
	// 插入
	Insert(ctx context.Context, in *TComment) (rows int64, err error)
	Inserts(ctx context.Context, in ...*TComment) (rows int64, err error)
	// 删除
	Delete(ctx context.Context, id int64) (rows int64, err error)
	Deletes(ctx context.Context, conditions string, args ...interface{}) (rows int64, err error)
	// 更新
	Update(ctx context.Context, in *TComment) (rows int64, err error)
	Updates(ctx context.Context, columns map[string]interface{}, conditions string, args ...interface{}) (rows int64, err error)
	// 保存
	Save(ctx context.Context, in *TComment) (rows int64, err error)
	// 查询
	FindOne(ctx context.Context, id int64) (out *TComment, err error)
	First(ctx context.Context, conditions string, args ...interface{}) (out *TComment, err error)
	FindCount(ctx context.Context, conditions string, args ...interface{}) (count int64, err error)
	FindALL(ctx context.Context, conditions string, args ...interface{}) (list []*TComment, err error)
	FindList(ctx context.Context, page int, size int, sorts string, conditions string, args ...interface{}) (list []*TComment, err error)
}

接口定义

func NewTCommentModel

func NewTCommentModel(db *gorm.DB, cache *redis.Client) TCommentModel

type TFileFolder

type TFileFolder struct {
	Id         int64     `json:"id" gorm:"column:id" `                   // id
	UserId     string    `json:"user_id" gorm:"column:user_id" `         // 用户id
	FilePath   string    `json:"file_path" gorm:"column:file_path" `     // 文件路径
	FolderName string    `json:"folder_name" gorm:"column:folder_name" ` // 文件夹名称
	FolderDesc string    `json:"folder_desc" gorm:"column:folder_desc" ` // 文件夹描述
	CreatedAt  time.Time `json:"created_at" gorm:"column:created_at" `   // 创建时间
	UpdatedAt  time.Time `json:"updated_at" gorm:"column:updated_at" `   // 更新时间
}

表字段定义

type TFileFolderModel

type TFileFolderModel interface {
	TableName() string
	// 在事务中操作
	WithTransaction(tx *gorm.DB) (out TFileFolderModel)
	// 插入
	Insert(ctx context.Context, in *TFileFolder) (rows int64, err error)
	Inserts(ctx context.Context, in ...*TFileFolder) (rows int64, err error)
	// 删除
	Delete(ctx context.Context, id int64) (rows int64, err error)
	Deletes(ctx context.Context, conditions string, args ...interface{}) (rows int64, err error)
	// 更新
	Update(ctx context.Context, in *TFileFolder) (rows int64, err error)
	Updates(ctx context.Context, columns map[string]interface{}, conditions string, args ...interface{}) (rows int64, err error)
	// 保存
	Save(ctx context.Context, in *TFileFolder) (rows int64, err error)
	// 查询
	FindOne(ctx context.Context, id int64) (out *TFileFolder, err error)
	First(ctx context.Context, conditions string, args ...interface{}) (out *TFileFolder, err error)
	FindCount(ctx context.Context, conditions string, args ...interface{}) (count int64, err error)
	FindALL(ctx context.Context, conditions string, args ...interface{}) (list []*TFileFolder, err error)
	FindList(ctx context.Context, page int, size int, sorts string, conditions string, args ...interface{}) (list []*TFileFolder, err error)
	// add extra method in here
	FindOneByFilePath(ctx context.Context, file_path string) (out *TFileFolder, err error)
}

接口定义

func NewTFileFolderModel

func NewTFileFolderModel(db *gorm.DB, cache *redis.Client) TFileFolderModel

type TFileUpload

type TFileUpload struct {
	Id        int64     `json:"id" gorm:"column:id" `                 // id
	UserId    string    `json:"user_id" gorm:"column:user_id" `       // 用户id
	FilePath  string    `json:"file_path" gorm:"column:file_path" `   // 文件路径
	FileName  string    `json:"file_name" gorm:"column:file_name" `   // 文件名称
	FileType  string    `json:"file_type" gorm:"column:file_type" `   // 文件类型
	FileSize  int64     `json:"file_size" gorm:"column:file_size" `   // 文件大小
	FileMd5   string    `json:"file_md5" gorm:"column:file_md5" `     // 文件md5值
	FileUrl   string    `json:"file_url" gorm:"column:file_url" `     // 上传路径
	CreatedAt time.Time `json:"created_at" gorm:"column:created_at" ` // 创建时间
	UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at" ` // 更新时间
}

表字段定义

type TFileUploadModel

type TFileUploadModel interface {
	TableName() string
	// 在事务中操作
	WithTransaction(tx *gorm.DB) (out TFileUploadModel)
	// 插入
	Insert(ctx context.Context, in *TFileUpload) (rows int64, err error)
	Inserts(ctx context.Context, in ...*TFileUpload) (rows int64, err error)
	// 删除
	Delete(ctx context.Context, id int64) (rows int64, err error)
	Deletes(ctx context.Context, conditions string, args ...interface{}) (rows int64, err error)
	// 更新
	Update(ctx context.Context, in *TFileUpload) (rows int64, err error)
	Updates(ctx context.Context, columns map[string]interface{}, conditions string, args ...interface{}) (rows int64, err error)
	// 保存
	Save(ctx context.Context, in *TFileUpload) (rows int64, err error)
	// 查询
	FindOne(ctx context.Context, id int64) (out *TFileUpload, err error)
	First(ctx context.Context, conditions string, args ...interface{}) (out *TFileUpload, err error)
	FindCount(ctx context.Context, conditions string, args ...interface{}) (count int64, err error)
	FindALL(ctx context.Context, conditions string, args ...interface{}) (list []*TFileUpload, err error)
	FindList(ctx context.Context, page int, size int, sorts string, conditions string, args ...interface{}) (list []*TFileUpload, err error)
}

接口定义

func NewTFileUploadModel

func NewTFileUploadModel(db *gorm.DB, cache *redis.Client) TFileUploadModel

type TFriend

type TFriend struct {
	Id          int64     `json:"id" gorm:"column:id" `                     // id
	LinkName    string    `json:"link_name" gorm:"column:link_name" `       // 链接名
	LinkAvatar  string    `json:"link_avatar" gorm:"column:link_avatar" `   // 链接头像
	LinkAddress string    `json:"link_address" gorm:"column:link_address" ` // 链接地址
	LinkIntro   string    `json:"link_intro" gorm:"column:link_intro" `     // 链接介绍
	CreatedAt   time.Time `json:"created_at" gorm:"column:created_at" `     // 创建时间
	UpdatedAt   time.Time `json:"updated_at" gorm:"column:updated_at" `     // 更新时间
}

表字段定义

type TFriendModel

type TFriendModel interface {
	TableName() string
	// 在事务中操作
	WithTransaction(tx *gorm.DB) (out TFriendModel)
	// 插入
	Insert(ctx context.Context, in *TFriend) (rows int64, err error)
	Inserts(ctx context.Context, in ...*TFriend) (rows int64, err error)
	// 删除
	Delete(ctx context.Context, id int64) (rows int64, err error)
	Deletes(ctx context.Context, conditions string, args ...interface{}) (rows int64, err error)
	// 更新
	Update(ctx context.Context, in *TFriend) (rows int64, err error)
	Updates(ctx context.Context, columns map[string]interface{}, conditions string, args ...interface{}) (rows int64, err error)
	// 保存
	Save(ctx context.Context, in *TFriend) (rows int64, err error)
	// 查询
	FindOne(ctx context.Context, id int64) (out *TFriend, err error)
	First(ctx context.Context, conditions string, args ...interface{}) (out *TFriend, err error)
	FindCount(ctx context.Context, conditions string, args ...interface{}) (count int64, err error)
	FindALL(ctx context.Context, conditions string, args ...interface{}) (list []*TFriend, err error)
	FindList(ctx context.Context, page int, size int, sorts string, conditions string, args ...interface{}) (list []*TFriend, err error)
}

接口定义

func NewTFriendModel

func NewTFriendModel(db *gorm.DB, cache *redis.Client) TFriendModel

type TMenu

type TMenu struct {
	Id         int64     `json:"id" gorm:"column:id" `                   // 主键
	ParentId   int64     `json:"parent_id" gorm:"column:parent_id" `     // 父id
	Path       string    `json:"path" gorm:"column:path" `               // 路由路径
	Name       string    `json:"name" gorm:"column:name" `               // 路由名称
	Component  string    `json:"component" gorm:"column:component" `     // 路由组件
	Redirect   string    `json:"redirect" gorm:"column:redirect" `       // 路由重定向
	Type       int64     `json:"type" gorm:"column:type" `               // 菜单类型
	Title      string    `json:"title" gorm:"column:title" `             // 菜单标题
	Icon       string    `json:"icon" gorm:"column:icon" `               // 菜单图标
	Rank       int64     `json:"rank" gorm:"column:rank" `               // 排序
	Perm       string    `json:"perm" gorm:"column:perm" `               // 权限标识
	Params     string    `json:"params" gorm:"column:params" `           // 路由参数
	KeepAlive  int64     `json:"keep_alive" gorm:"column:keep_alive" `   // 是否缓存
	AlwaysShow int64     `json:"always_show" gorm:"column:always_show" ` // 是否一直显示菜单
	IsHidden   int64     `json:"is_hidden" gorm:"column:is_hidden" `     // 是否隐藏
	IsDisable  int64     `json:"is_disable" gorm:"column:is_disable" `   // 是否禁用
	Extra      string    `json:"extra" gorm:"column:extra" `             // 菜单元数据
	CreatedAt  time.Time `json:"created_at" gorm:"column:created_at" `   // 创建时间
	UpdatedAt  time.Time `json:"updated_at" gorm:"column:updated_at" `   // 更新时间
}

表字段定义

type TMenuModel

type TMenuModel interface {
	TableName() string
	// 在事务中操作
	WithTransaction(tx *gorm.DB) (out TMenuModel)
	// 插入
	Insert(ctx context.Context, in *TMenu) (rows int64, err error)
	Inserts(ctx context.Context, in ...*TMenu) (rows int64, err error)
	// 删除
	Delete(ctx context.Context, id int64) (rows int64, err error)
	Deletes(ctx context.Context, conditions string, args ...interface{}) (rows int64, err error)
	// 更新
	Update(ctx context.Context, in *TMenu) (rows int64, err error)
	Updates(ctx context.Context, columns map[string]interface{}, conditions string, args ...interface{}) (rows int64, err error)
	// 保存
	Save(ctx context.Context, in *TMenu) (rows int64, err error)
	// 查询
	FindOne(ctx context.Context, id int64) (out *TMenu, err error)
	First(ctx context.Context, conditions string, args ...interface{}) (out *TMenu, err error)
	FindCount(ctx context.Context, conditions string, args ...interface{}) (count int64, err error)
	FindALL(ctx context.Context, conditions string, args ...interface{}) (list []*TMenu, err error)
	FindList(ctx context.Context, page int, size int, sorts string, conditions string, args ...interface{}) (list []*TMenu, err error)
	// add extra method in here
	FindOneByPath(ctx context.Context, path string) (out *TMenu, err error)
}

接口定义

func NewTMenuModel

func NewTMenuModel(db *gorm.DB, cache *redis.Client) TMenuModel

type TOperationLog

type TOperationLog struct {
	Id             int64     `json:"id" gorm:"column:id" `                           // 主键id
	UserId         string    `json:"user_id" gorm:"column:user_id" `                 // 用户id
	Nickname       string    `json:"nickname" gorm:"column:nickname" `               // 用户昵称
	IpAddress      string    `json:"ip_address" gorm:"column:ip_address" `           // 操作ip
	IpSource       string    `json:"ip_source" gorm:"column:ip_source" `             // 操作地址
	OptModule      string    `json:"opt_module" gorm:"column:opt_module" `           // 操作模块
	OptHandler     string    `json:"opt_handler" gorm:"column:opt_handler" `         // 操作方法
	OptDesc        string    `json:"opt_desc" gorm:"column:opt_desc" `               // 操作描述
	RequestUrl     string    `json:"request_url" gorm:"column:request_url" `         // 请求地址
	RequestMethod  string    `json:"request_method" gorm:"column:request_method" `   // 请求方式
	RequestHeader  string    `json:"request_header" gorm:"column:request_header" `   // 请求头参数
	RequestData    string    `json:"request_data" gorm:"column:request_data" `       // 请求参数
	ResponseData   string    `json:"response_data" gorm:"column:response_data" `     // 返回数据
	ResponseStatus int64     `json:"response_status" gorm:"column:response_status" ` // 响应状态码
	Cost           string    `json:"cost" gorm:"column:cost" `                       // 耗时(ms)
	CreatedAt      time.Time `json:"created_at" gorm:"column:created_at" `           // 创建时间
	UpdatedAt      time.Time `json:"updated_at" gorm:"column:updated_at" `           // 更新时间
}

表字段定义

type TOperationLogModel

type TOperationLogModel interface {
	TableName() string
	// 在事务中操作
	WithTransaction(tx *gorm.DB) (out TOperationLogModel)
	// 插入
	Insert(ctx context.Context, in *TOperationLog) (rows int64, err error)
	Inserts(ctx context.Context, in ...*TOperationLog) (rows int64, err error)
	// 删除
	Delete(ctx context.Context, id int64) (rows int64, err error)
	Deletes(ctx context.Context, conditions string, args ...interface{}) (rows int64, err error)
	// 更新
	Update(ctx context.Context, in *TOperationLog) (rows int64, err error)
	Updates(ctx context.Context, columns map[string]interface{}, conditions string, args ...interface{}) (rows int64, err error)
	// 保存
	Save(ctx context.Context, in *TOperationLog) (rows int64, err error)
	// 查询
	FindOne(ctx context.Context, id int64) (out *TOperationLog, err error)
	First(ctx context.Context, conditions string, args ...interface{}) (out *TOperationLog, err error)
	FindCount(ctx context.Context, conditions string, args ...interface{}) (count int64, err error)
	FindALL(ctx context.Context, conditions string, args ...interface{}) (list []*TOperationLog, err error)
	FindList(ctx context.Context, page int, size int, sorts string, conditions string, args ...interface{}) (list []*TOperationLog, err error)
}

接口定义

func NewTOperationLogModel

func NewTOperationLogModel(db *gorm.DB, cache *redis.Client) TOperationLogModel

type TPage

type TPage struct {
	Id             int64     `json:"id" gorm:"column:id" `                           // 页面id
	PageName       string    `json:"page_name" gorm:"column:page_name" `             // 页面名
	PageLabel      string    `json:"page_label" gorm:"column:page_label" `           // 页面标签
	PageCover      string    `json:"page_cover" gorm:"column:page_cover" `           // 页面封面
	IsCarousel     int64     `json:"is_carousel" gorm:"column:is_carousel" `         // 是否轮播
	CarouselCovers string    `json:"carousel_covers" gorm:"column:carousel_covers" ` // 轮播图片列表
	CreatedAt      time.Time `json:"created_at" gorm:"column:created_at" `           // 创建时间
	UpdatedAt      time.Time `json:"updated_at" gorm:"column:updated_at" `           // 更新时间
}

表字段定义

type TPageModel

type TPageModel interface {
	TableName() string
	// 在事务中操作
	WithTransaction(tx *gorm.DB) (out TPageModel)
	// 插入
	Insert(ctx context.Context, in *TPage) (rows int64, err error)
	Inserts(ctx context.Context, in ...*TPage) (rows int64, err error)
	// 删除
	Delete(ctx context.Context, id int64) (rows int64, err error)
	Deletes(ctx context.Context, conditions string, args ...interface{}) (rows int64, err error)
	// 更新
	Update(ctx context.Context, in *TPage) (rows int64, err error)
	Updates(ctx context.Context, columns map[string]interface{}, conditions string, args ...interface{}) (rows int64, err error)
	// 保存
	Save(ctx context.Context, in *TPage) (rows int64, err error)
	// 查询
	FindOne(ctx context.Context, id int64) (out *TPage, err error)
	First(ctx context.Context, conditions string, args ...interface{}) (out *TPage, err error)
	FindCount(ctx context.Context, conditions string, args ...interface{}) (count int64, err error)
	FindALL(ctx context.Context, conditions string, args ...interface{}) (list []*TPage, err error)
	FindList(ctx context.Context, page int, size int, sorts string, conditions string, args ...interface{}) (list []*TPage, err error)
}

接口定义

func NewTPageModel

func NewTPageModel(db *gorm.DB, cache *redis.Client) TPageModel

type TPhoto

type TPhoto struct {
	Id        int64     `json:"id" gorm:"column:id" `                 // 主键
	AlbumId   int64     `json:"album_id" gorm:"column:album_id" `     // 相册id
	PhotoName string    `json:"photo_name" gorm:"column:photo_name" ` // 照片名
	PhotoDesc string    `json:"photo_desc" gorm:"column:photo_desc" ` // 照片描述
	PhotoSrc  string    `json:"photo_src" gorm:"column:photo_src" `   // 照片地址
	IsDelete  int64     `json:"is_delete" gorm:"column:is_delete" `   // 是否删除
	CreatedAt time.Time `json:"created_at" gorm:"column:created_at" ` // 创建时间
	UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at" ` // 更新时间
}

表字段定义

type TPhotoModel

type TPhotoModel interface {
	TableName() string
	// 在事务中操作
	WithTransaction(tx *gorm.DB) (out TPhotoModel)
	// 插入
	Insert(ctx context.Context, in *TPhoto) (rows int64, err error)
	Inserts(ctx context.Context, in ...*TPhoto) (rows int64, err error)
	// 删除
	Delete(ctx context.Context, id int64) (rows int64, err error)
	Deletes(ctx context.Context, conditions string, args ...interface{}) (rows int64, err error)
	// 更新
	Update(ctx context.Context, in *TPhoto) (rows int64, err error)
	Updates(ctx context.Context, columns map[string]interface{}, conditions string, args ...interface{}) (rows int64, err error)
	// 保存
	Save(ctx context.Context, in *TPhoto) (rows int64, err error)
	// 查询
	FindOne(ctx context.Context, id int64) (out *TPhoto, err error)
	First(ctx context.Context, conditions string, args ...interface{}) (out *TPhoto, err error)
	FindCount(ctx context.Context, conditions string, args ...interface{}) (count int64, err error)
	FindALL(ctx context.Context, conditions string, args ...interface{}) (list []*TPhoto, err error)
	FindList(ctx context.Context, page int, size int, sorts string, conditions string, args ...interface{}) (list []*TPhoto, err error)
}

接口定义

func NewTPhotoModel

func NewTPhotoModel(db *gorm.DB, cache *redis.Client) TPhotoModel

type TRemark

type TRemark struct {
	Id             int64     `json:"id" gorm:"column:id" `                           // 主键id
	UserId         string    `json:"user_id" gorm:"column:user_id" `                 // 用户id
	MessageContent string    `json:"message_content" gorm:"column:message_content" ` // 留言内容
	IpAddress      string    `json:"ip_address" gorm:"column:ip_address" `           // 用户ip 127.0.0.1
	IpSource       string    `json:"ip_source" gorm:"column:ip_source" `             // 用户地址 广东省深圳市
	Status         int64     `json:"status" gorm:"column:status" `                   // 状态:0正常 1编辑 2撤回 3删除
	IsReview       int64     `json:"is_review" gorm:"column:is_review" `             // 是否审核通过
	CreatedAt      time.Time `json:"created_at" gorm:"column:created_at" `           // 发布时间
	UpdatedAt      time.Time `json:"updated_at" gorm:"column:updated_at" `           // 更新时间
}

表字段定义

type TRemarkModel

type TRemarkModel interface {
	TableName() string
	// 在事务中操作
	WithTransaction(tx *gorm.DB) (out TRemarkModel)
	// 插入
	Insert(ctx context.Context, in *TRemark) (rows int64, err error)
	Inserts(ctx context.Context, in ...*TRemark) (rows int64, err error)
	// 删除
	Delete(ctx context.Context, id int64) (rows int64, err error)
	Deletes(ctx context.Context, conditions string, args ...interface{}) (rows int64, err error)
	// 更新
	Update(ctx context.Context, in *TRemark) (rows int64, err error)
	Updates(ctx context.Context, columns map[string]interface{}, conditions string, args ...interface{}) (rows int64, err error)
	// 保存
	Save(ctx context.Context, in *TRemark) (rows int64, err error)
	// 查询
	FindOne(ctx context.Context, id int64) (out *TRemark, err error)
	First(ctx context.Context, conditions string, args ...interface{}) (out *TRemark, err error)
	FindCount(ctx context.Context, conditions string, args ...interface{}) (count int64, err error)
	FindALL(ctx context.Context, conditions string, args ...interface{}) (list []*TRemark, err error)
	FindList(ctx context.Context, page int, size int, sorts string, conditions string, args ...interface{}) (list []*TRemark, err error)
}

接口定义

func NewTRemarkModel

func NewTRemarkModel(db *gorm.DB, cache *redis.Client) TRemarkModel

type TRole

type TRole struct {
	Id          int64     `json:"id" gorm:"column:id" `                     // 主键id
	ParentId    int64     `json:"parent_id" gorm:"column:parent_id" `       // 父角色id
	RoleName    string    `json:"role_name" gorm:"column:role_name" `       // 角色名
	RoleLabel   string    `json:"role_label" gorm:"column:role_label" `     // 角色标签
	RoleComment string    `json:"role_comment" gorm:"column:role_comment" ` // 角色备注
	IsDisable   int64     `json:"is_disable" gorm:"column:is_disable" `     // 是否禁用  0否 1是
	IsDefault   int64     `json:"is_default" gorm:"column:is_default" `     // 是否默认角色 0否 1是
	CreatedAt   time.Time `json:"created_at" gorm:"column:created_at" `     // 创建时间
	UpdatedAt   time.Time `json:"updated_at" gorm:"column:updated_at" `     // 更新时间
}

表字段定义

type TRoleApi

type TRoleApi struct {
	Id     int64 `json:"id" gorm:"column:id" `           // 主键id
	RoleId int64 `json:"role_id" gorm:"column:role_id" ` // 角色id
	ApiId  int64 `json:"api_id" gorm:"column:api_id" `   // 接口id
}

表字段定义

type TRoleApiModel

type TRoleApiModel interface {
	TableName() string
	// 在事务中操作
	WithTransaction(tx *gorm.DB) (out TRoleApiModel)
	// 插入
	Insert(ctx context.Context, in *TRoleApi) (rows int64, err error)
	Inserts(ctx context.Context, in ...*TRoleApi) (rows int64, err error)
	// 删除
	Delete(ctx context.Context, id int64) (rows int64, err error)
	Deletes(ctx context.Context, conditions string, args ...interface{}) (rows int64, err error)
	// 更新
	Update(ctx context.Context, in *TRoleApi) (rows int64, err error)
	Updates(ctx context.Context, columns map[string]interface{}, conditions string, args ...interface{}) (rows int64, err error)
	// 保存
	Save(ctx context.Context, in *TRoleApi) (rows int64, err error)
	// 查询
	FindOne(ctx context.Context, id int64) (out *TRoleApi, err error)
	First(ctx context.Context, conditions string, args ...interface{}) (out *TRoleApi, err error)
	FindCount(ctx context.Context, conditions string, args ...interface{}) (count int64, err error)
	FindALL(ctx context.Context, conditions string, args ...interface{}) (list []*TRoleApi, err error)
	FindList(ctx context.Context, page int, size int, sorts string, conditions string, args ...interface{}) (list []*TRoleApi, err error)
}

接口定义

func NewTRoleApiModel

func NewTRoleApiModel(db *gorm.DB, cache *redis.Client) TRoleApiModel

type TRoleMenu

type TRoleMenu struct {
	Id     int64 `json:"id" gorm:"column:id" `           // 主键id
	RoleId int64 `json:"role_id" gorm:"column:role_id" ` // 角色id
	MenuId int64 `json:"menu_id" gorm:"column:menu_id" ` // 菜单id
}

表字段定义

type TRoleMenuModel

type TRoleMenuModel interface {
	TableName() string
	// 在事务中操作
	WithTransaction(tx *gorm.DB) (out TRoleMenuModel)
	// 插入
	Insert(ctx context.Context, in *TRoleMenu) (rows int64, err error)
	Inserts(ctx context.Context, in ...*TRoleMenu) (rows int64, err error)
	// 删除
	Delete(ctx context.Context, id int64) (rows int64, err error)
	Deletes(ctx context.Context, conditions string, args ...interface{}) (rows int64, err error)
	// 更新
	Update(ctx context.Context, in *TRoleMenu) (rows int64, err error)
	Updates(ctx context.Context, columns map[string]interface{}, conditions string, args ...interface{}) (rows int64, err error)
	// 保存
	Save(ctx context.Context, in *TRoleMenu) (rows int64, err error)
	// 查询
	FindOne(ctx context.Context, id int64) (out *TRoleMenu, err error)
	First(ctx context.Context, conditions string, args ...interface{}) (out *TRoleMenu, err error)
	FindCount(ctx context.Context, conditions string, args ...interface{}) (count int64, err error)
	FindALL(ctx context.Context, conditions string, args ...interface{}) (list []*TRoleMenu, err error)
	FindList(ctx context.Context, page int, size int, sorts string, conditions string, args ...interface{}) (list []*TRoleMenu, err error)
}

接口定义

func NewTRoleMenuModel

func NewTRoleMenuModel(db *gorm.DB, cache *redis.Client) TRoleMenuModel

type TRoleModel

type TRoleModel interface {
	TableName() string
	// 在事务中操作
	WithTransaction(tx *gorm.DB) (out TRoleModel)
	// 插入
	Insert(ctx context.Context, in *TRole) (rows int64, err error)
	Inserts(ctx context.Context, in ...*TRole) (rows int64, err error)
	// 删除
	Delete(ctx context.Context, id int64) (rows int64, err error)
	Deletes(ctx context.Context, conditions string, args ...interface{}) (rows int64, err error)
	// 更新
	Update(ctx context.Context, in *TRole) (rows int64, err error)
	Updates(ctx context.Context, columns map[string]interface{}, conditions string, args ...interface{}) (rows int64, err error)
	// 保存
	Save(ctx context.Context, in *TRole) (rows int64, err error)
	// 查询
	FindOne(ctx context.Context, id int64) (out *TRole, err error)
	First(ctx context.Context, conditions string, args ...interface{}) (out *TRole, err error)
	FindCount(ctx context.Context, conditions string, args ...interface{}) (count int64, err error)
	FindALL(ctx context.Context, conditions string, args ...interface{}) (list []*TRole, err error)
	FindList(ctx context.Context, page int, size int, sorts string, conditions string, args ...interface{}) (list []*TRole, err error)
}

接口定义

func NewTRoleModel

func NewTRoleModel(db *gorm.DB, cache *redis.Client) TRoleModel

type TTag

type TTag struct {
	Id        int64     `json:"id" gorm:"column:id" `                 // id
	TagName   string    `json:"tag_name" gorm:"column:tag_name" `     // 标签名
	CreatedAt time.Time `json:"created_at" gorm:"column:created_at" ` // 创建时间
	UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at" ` // 更新时间
}

表字段定义

type TTagModel

type TTagModel interface {
	TableName() string
	// 在事务中操作
	WithTransaction(tx *gorm.DB) (out TTagModel)
	// 插入
	Insert(ctx context.Context, in *TTag) (rows int64, err error)
	Inserts(ctx context.Context, in ...*TTag) (rows int64, err error)
	// 删除
	Delete(ctx context.Context, id int64) (rows int64, err error)
	Deletes(ctx context.Context, conditions string, args ...interface{}) (rows int64, err error)
	// 更新
	Update(ctx context.Context, in *TTag) (rows int64, err error)
	Updates(ctx context.Context, columns map[string]interface{}, conditions string, args ...interface{}) (rows int64, err error)
	// 保存
	Save(ctx context.Context, in *TTag) (rows int64, err error)
	// 查询
	FindOne(ctx context.Context, id int64) (out *TTag, err error)
	First(ctx context.Context, conditions string, args ...interface{}) (out *TTag, err error)
	FindCount(ctx context.Context, conditions string, args ...interface{}) (count int64, err error)
	FindALL(ctx context.Context, conditions string, args ...interface{}) (list []*TTag, err error)
	FindList(ctx context.Context, page int, size int, sorts string, conditions string, args ...interface{}) (list []*TTag, err error)
	// add extra method in here
	FindOneByTagName(ctx context.Context, tag_name string) (out *TTag, err error)
}

接口定义

func NewTTagModel

func NewTTagModel(db *gorm.DB, cache *redis.Client) TTagModel

type TTalk

type TTalk struct {
	Id        int64     `json:"id" gorm:"column:id" `                 // 说说id
	UserId    string    `json:"user_id" gorm:"column:user_id" `       // 用户id
	Content   string    `json:"content" gorm:"column:content" `       // 说说内容
	Images    string    `json:"images" gorm:"column:images" `         // 图片
	IsTop     int64     `json:"is_top" gorm:"column:is_top" `         // 是否置顶
	Status    int64     `json:"status" gorm:"column:status" `         // 状态 1.公开 2.私密
	LikeCount int64     `json:"like_count" gorm:"column:like_count" ` // 点赞数
	CreatedAt time.Time `json:"created_at" gorm:"column:created_at" ` // 创建时间
	UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at" ` // 更新时间
}

表字段定义

type TTalkModel

type TTalkModel interface {
	TableName() string
	// 在事务中操作
	WithTransaction(tx *gorm.DB) (out TTalkModel)
	// 插入
	Insert(ctx context.Context, in *TTalk) (rows int64, err error)
	Inserts(ctx context.Context, in ...*TTalk) (rows int64, err error)
	// 删除
	Delete(ctx context.Context, id int64) (rows int64, err error)
	Deletes(ctx context.Context, conditions string, args ...interface{}) (rows int64, err error)
	// 更新
	Update(ctx context.Context, in *TTalk) (rows int64, err error)
	Updates(ctx context.Context, columns map[string]interface{}, conditions string, args ...interface{}) (rows int64, err error)
	// 保存
	Save(ctx context.Context, in *TTalk) (rows int64, err error)
	// 查询
	FindOne(ctx context.Context, id int64) (out *TTalk, err error)
	First(ctx context.Context, conditions string, args ...interface{}) (out *TTalk, err error)
	FindCount(ctx context.Context, conditions string, args ...interface{}) (count int64, err error)
	FindALL(ctx context.Context, conditions string, args ...interface{}) (list []*TTalk, err error)
	FindList(ctx context.Context, page int, size int, sorts string, conditions string, args ...interface{}) (list []*TTalk, err error)
}

接口定义

func NewTTalkModel

func NewTTalkModel(db *gorm.DB, cache *redis.Client) TTalkModel

type TUser

type TUser struct {
	Id        int64     `json:"id" gorm:"column:id" `                 // id
	UserId    string    `json:"user_id" gorm:"column:user_id" `       // 用户id
	Username  string    `json:"username" gorm:"column:username" `     // 用户名
	Password  string    `json:"password" gorm:"column:password" `     // 用户密码
	Nickname  string    `json:"nickname" gorm:"column:nickname" `     // 用户昵称
	Avatar    string    `json:"avatar" gorm:"column:avatar" `         // 用户头像
	Email     string    `json:"email" gorm:"column:email" `           // 邮箱
	Phone     string    `json:"phone" gorm:"column:phone" `           // 手机号
	Info      string    `json:"info" gorm:"column:info" `             // 用户信息
	Status    int64     `json:"status" gorm:"column:status" `         // 状态: -1删除 0正常 1禁用
	LoginType string    `json:"login_type" gorm:"column:login_type" ` // 注册方式
	IpAddress string    `json:"ip_address" gorm:"column:ip_address" ` // 注册ip
	IpSource  string    `json:"ip_source" gorm:"column:ip_source" `   // 注册ip 源
	CreatedAt time.Time `json:"created_at" gorm:"column:created_at" ` // 创建时间
	UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at" ` // 更新时间
}

表字段定义

type TUserLoginHistory

type TUserLoginHistory struct {
	Id        int64     `json:"id" gorm:"column:id" `                 // id
	UserId    string    `json:"user_id" gorm:"column:user_id" `       // 用户id
	LoginType string    `json:"login_type" gorm:"column:login_type" ` // 登录类型
	Agent     string    `json:"agent" gorm:"column:agent" `           // 代理
	IpAddress string    `json:"ip_address" gorm:"column:ip_address" ` // ip host
	IpSource  string    `json:"ip_source" gorm:"column:ip_source" `   // ip 源
	LoginAt   time.Time `json:"login_at" gorm:"column:login_at" `     // 登录时间
	LogoutAt  time.Time `json:"logout_at" gorm:"column:logout_at" `   // 登出时间
	CreatedAt time.Time `json:"created_at" gorm:"column:created_at" ` // 创建时间
	UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at" ` // 更新时间
}

表字段定义

type TUserLoginHistoryModel

type TUserLoginHistoryModel interface {
	TableName() string
	// 在事务中操作
	WithTransaction(tx *gorm.DB) (out TUserLoginHistoryModel)
	// 插入
	Insert(ctx context.Context, in *TUserLoginHistory) (rows int64, err error)
	Inserts(ctx context.Context, in ...*TUserLoginHistory) (rows int64, err error)
	// 删除
	Delete(ctx context.Context, id int64) (rows int64, err error)
	Deletes(ctx context.Context, conditions string, args ...interface{}) (rows int64, err error)
	// 更新
	Update(ctx context.Context, in *TUserLoginHistory) (rows int64, err error)
	Updates(ctx context.Context, columns map[string]interface{}, conditions string, args ...interface{}) (rows int64, err error)
	// 保存
	Save(ctx context.Context, in *TUserLoginHistory) (rows int64, err error)
	// 查询
	FindOne(ctx context.Context, id int64) (out *TUserLoginHistory, err error)
	First(ctx context.Context, conditions string, args ...interface{}) (out *TUserLoginHistory, err error)
	FindCount(ctx context.Context, conditions string, args ...interface{}) (count int64, err error)
	FindALL(ctx context.Context, conditions string, args ...interface{}) (list []*TUserLoginHistory, err error)
	FindList(ctx context.Context, page int, size int, sorts string, conditions string, args ...interface{}) (list []*TUserLoginHistory, err error)
}

接口定义

func NewTUserLoginHistoryModel

func NewTUserLoginHistoryModel(db *gorm.DB, cache *redis.Client) TUserLoginHistoryModel

type TUserModel

type TUserModel interface {
	TableName() string
	// 在事务中操作
	WithTransaction(tx *gorm.DB) (out TUserModel)
	// 插入
	Insert(ctx context.Context, in *TUser) (rows int64, err error)
	Inserts(ctx context.Context, in ...*TUser) (rows int64, err error)
	// 删除
	Delete(ctx context.Context, id int64) (rows int64, err error)
	Deletes(ctx context.Context, conditions string, args ...interface{}) (rows int64, err error)
	// 更新
	Update(ctx context.Context, in *TUser) (rows int64, err error)
	Updates(ctx context.Context, columns map[string]interface{}, conditions string, args ...interface{}) (rows int64, err error)
	// 保存
	Save(ctx context.Context, in *TUser) (rows int64, err error)
	// 查询
	FindOne(ctx context.Context, id int64) (out *TUser, err error)
	First(ctx context.Context, conditions string, args ...interface{}) (out *TUser, err error)
	FindCount(ctx context.Context, conditions string, args ...interface{}) (count int64, err error)
	FindALL(ctx context.Context, conditions string, args ...interface{}) (list []*TUser, err error)
	FindList(ctx context.Context, page int, size int, sorts string, conditions string, args ...interface{}) (list []*TUser, err error)
	// add extra method in here
	FindOneByUsername(ctx context.Context, username string) (out *TUser, err error)
	FindOneByUserId(ctx context.Context, user_id string) (out *TUser, err error)
}

接口定义

func NewTUserModel

func NewTUserModel(db *gorm.DB, cache *redis.Client) TUserModel

type TUserOauth

type TUserOauth struct {
	Id        int64     `json:"id" gorm:"column:id" `                 // id
	UserId    string    `json:"user_id" gorm:"column:user_id" `       // 用户id
	OpenId    string    `json:"open_id" gorm:"column:open_id" `       // 开发平台id,标识唯一用户
	Platform  string    `json:"platform" gorm:"column:platform" `     // 平台:手机号、邮箱、微信、飞书
	CreatedAt time.Time `json:"created_at" gorm:"column:created_at" ` // 创建时间
	UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at" ` // 更新时间
}

表字段定义

type TUserOauthModel

type TUserOauthModel interface {
	TableName() string
	// 在事务中操作
	WithTransaction(tx *gorm.DB) (out TUserOauthModel)
	// 插入
	Insert(ctx context.Context, in *TUserOauth) (rows int64, err error)
	Inserts(ctx context.Context, in ...*TUserOauth) (rows int64, err error)
	// 删除
	Delete(ctx context.Context, id int64) (rows int64, err error)
	Deletes(ctx context.Context, conditions string, args ...interface{}) (rows int64, err error)
	// 更新
	Update(ctx context.Context, in *TUserOauth) (rows int64, err error)
	Updates(ctx context.Context, columns map[string]interface{}, conditions string, args ...interface{}) (rows int64, err error)
	// 保存
	Save(ctx context.Context, in *TUserOauth) (rows int64, err error)
	// 查询
	FindOne(ctx context.Context, id int64) (out *TUserOauth, err error)
	First(ctx context.Context, conditions string, args ...interface{}) (out *TUserOauth, err error)
	FindCount(ctx context.Context, conditions string, args ...interface{}) (count int64, err error)
	FindALL(ctx context.Context, conditions string, args ...interface{}) (list []*TUserOauth, err error)
	FindList(ctx context.Context, page int, size int, sorts string, conditions string, args ...interface{}) (list []*TUserOauth, err error)
	// add extra method in here
	FindOneByOpenIdPlatform(ctx context.Context, open_id string, platform string) (out *TUserOauth, err error)
}

接口定义

func NewTUserOauthModel

func NewTUserOauthModel(db *gorm.DB, cache *redis.Client) TUserOauthModel

type TUserRole

type TUserRole struct {
	Id     int64  `json:"id" gorm:"column:id" `           // 主键id
	UserId string `json:"user_id" gorm:"column:user_id" ` // 用户id
	RoleId int64  `json:"role_id" gorm:"column:role_id" ` // 角色id
}

表字段定义

type TUserRoleModel

type TUserRoleModel interface {
	TableName() string
	// 在事务中操作
	WithTransaction(tx *gorm.DB) (out TUserRoleModel)
	// 插入
	Insert(ctx context.Context, in *TUserRole) (rows int64, err error)
	Inserts(ctx context.Context, in ...*TUserRole) (rows int64, err error)
	// 删除
	Delete(ctx context.Context, id int64) (rows int64, err error)
	Deletes(ctx context.Context, conditions string, args ...interface{}) (rows int64, err error)
	// 更新
	Update(ctx context.Context, in *TUserRole) (rows int64, err error)
	Updates(ctx context.Context, columns map[string]interface{}, conditions string, args ...interface{}) (rows int64, err error)
	// 保存
	Save(ctx context.Context, in *TUserRole) (rows int64, err error)
	// 查询
	FindOne(ctx context.Context, id int64) (out *TUserRole, err error)
	First(ctx context.Context, conditions string, args ...interface{}) (out *TUserRole, err error)
	FindCount(ctx context.Context, conditions string, args ...interface{}) (count int64, err error)
	FindALL(ctx context.Context, conditions string, args ...interface{}) (list []*TUserRole, err error)
	FindList(ctx context.Context, page int, size int, sorts string, conditions string, args ...interface{}) (list []*TUserRole, err error)
}

接口定义

func NewTUserRoleModel

func NewTUserRoleModel(db *gorm.DB, cache *redis.Client) TUserRoleModel

type TVisitHistory

type TVisitHistory struct {
	Id         int64     `json:"id" gorm:"column:id" `                   // id
	Date       string    `json:"date" gorm:"column:date" `               // 日期
	ViewsCount int64     `json:"views_count" gorm:"column:views_count" ` // 访问量
	CreatedAt  time.Time `json:"created_at" gorm:"column:created_at" `   // 创建时间
	UpdatedAt  time.Time `json:"updated_at" gorm:"column:updated_at" `   // 更新时间
}

表字段定义

type TVisitHistoryModel

type TVisitHistoryModel interface {
	TableName() string
	// 在事务中操作
	WithTransaction(tx *gorm.DB) (out TVisitHistoryModel)
	// 插入
	Insert(ctx context.Context, in *TVisitHistory) (rows int64, err error)
	Inserts(ctx context.Context, in ...*TVisitHistory) (rows int64, err error)
	// 删除
	Delete(ctx context.Context, id int64) (rows int64, err error)
	Deletes(ctx context.Context, conditions string, args ...interface{}) (rows int64, err error)
	// 更新
	Update(ctx context.Context, in *TVisitHistory) (rows int64, err error)
	Updates(ctx context.Context, columns map[string]interface{}, conditions string, args ...interface{}) (rows int64, err error)
	// 保存
	Save(ctx context.Context, in *TVisitHistory) (rows int64, err error)
	// 查询
	FindOne(ctx context.Context, id int64) (out *TVisitHistory, err error)
	First(ctx context.Context, conditions string, args ...interface{}) (out *TVisitHistory, err error)
	FindCount(ctx context.Context, conditions string, args ...interface{}) (count int64, err error)
	FindALL(ctx context.Context, conditions string, args ...interface{}) (list []*TVisitHistory, err error)
	FindList(ctx context.Context, page int, size int, sorts string, conditions string, args ...interface{}) (list []*TVisitHistory, err error)
	// add extra method in here
	FindOneByDate(ctx context.Context, date string) (out *TVisitHistory, err error)
}

接口定义

func NewTVisitHistoryModel

func NewTVisitHistoryModel(db *gorm.DB, cache *redis.Client) TVisitHistoryModel

type TWebsiteConfig

type TWebsiteConfig struct {
	Id        int64     `json:"id" gorm:"column:id" `                 // id
	Key       string    `json:"key" gorm:"column:key" `               // 关键词
	Config    string    `json:"config" gorm:"column:config" `         // 配置信息
	CreatedAt time.Time `json:"created_at" gorm:"column:created_at" ` // 创建时间
	UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at" ` // 更新时间
}

表字段定义

type TWebsiteConfigModel

type TWebsiteConfigModel interface {
	TableName() string
	// 在事务中操作
	WithTransaction(tx *gorm.DB) (out TWebsiteConfigModel)
	// 插入
	Insert(ctx context.Context, in *TWebsiteConfig) (rows int64, err error)
	Inserts(ctx context.Context, in ...*TWebsiteConfig) (rows int64, err error)
	// 删除
	Delete(ctx context.Context, id int64) (rows int64, err error)
	Deletes(ctx context.Context, conditions string, args ...interface{}) (rows int64, err error)
	// 更新
	Update(ctx context.Context, in *TWebsiteConfig) (rows int64, err error)
	Updates(ctx context.Context, columns map[string]interface{}, conditions string, args ...interface{}) (rows int64, err error)
	// 保存
	Save(ctx context.Context, in *TWebsiteConfig) (rows int64, err error)
	// 查询
	FindOne(ctx context.Context, id int64) (out *TWebsiteConfig, err error)
	First(ctx context.Context, conditions string, args ...interface{}) (out *TWebsiteConfig, err error)
	FindCount(ctx context.Context, conditions string, args ...interface{}) (count int64, err error)
	FindALL(ctx context.Context, conditions string, args ...interface{}) (list []*TWebsiteConfig, err error)
	FindList(ctx context.Context, page int, size int, sorts string, conditions string, args ...interface{}) (list []*TWebsiteConfig, err error)
	// add extra method in here
	FindOneByKey(ctx context.Context, key string) (out *TWebsiteConfig, err error)
}

接口定义

func NewTWebsiteConfigModel

func NewTWebsiteConfigModel(db *gorm.DB, cache *redis.Client) TWebsiteConfigModel

Jump to

Keyboard shortcuts

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