chore: initial commit
This commit is contained in:
206
internal/db/sqlc/models.go
Normal file
206
internal/db/sqlc/models.go
Normal file
@@ -0,0 +1,206 @@
|
||||
// Code generated by sqlc. DO NOT EDIT.
|
||||
// versions:
|
||||
// sqlc v1.31.1
|
||||
|
||||
package db
|
||||
|
||||
import (
|
||||
"net/netip"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Category struct {
|
||||
// 分类ID
|
||||
ID int32 `json:"id"`
|
||||
// 分类名称
|
||||
Name string `json:"name"`
|
||||
// 分类编码
|
||||
Code string `json:"code"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt *time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type File struct {
|
||||
// 主键ID
|
||||
ID int32 `json:"id"`
|
||||
// 文件名 xxx.jpg
|
||||
FileName string `json:"file_name"`
|
||||
// 文件路径 带path /xxx/xxx.jpg
|
||||
FilePath string `json:"file_path"`
|
||||
// 原始文件名
|
||||
OriginalName string `json:"original_name"`
|
||||
// 文件夹名称
|
||||
FolderName string `json:"folder_name"`
|
||||
// mime_type
|
||||
MimeType string `json:"mime_type"`
|
||||
// 文件大小
|
||||
FileSize int64 `json:"file_size"`
|
||||
// 上传时间
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
// 修改时间
|
||||
UpdatedAt *time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type Post struct {
|
||||
// 主键ID
|
||||
ID int32 `json:"id"`
|
||||
// 文章标题
|
||||
Title string `json:"title"`
|
||||
// 文章封面图片id
|
||||
CoverID *int32 `json:"cover_id"`
|
||||
// URL友好地址
|
||||
Slug string `json:"slug"`
|
||||
// 文章正文
|
||||
Content string `json:"content"`
|
||||
// 摘要
|
||||
Summary string `json:"summary"`
|
||||
// 状态 0:草稿 1:已发布 2:已下线
|
||||
Status int16 `json:"status"`
|
||||
// 文章排序
|
||||
Sort *int32 `json:"sort"`
|
||||
// 发布时间
|
||||
PublishedAt time.Time `json:"published_at"`
|
||||
// 创建时间
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
// 修改时间
|
||||
UpdatedAt *time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type PostCategory struct {
|
||||
// 文章ID
|
||||
PostID int32 `json:"post_id"`
|
||||
// 分类ID
|
||||
CategoryID int32 `json:"category_id"`
|
||||
}
|
||||
|
||||
type PostStat struct {
|
||||
// 文章id
|
||||
PostID int32 `json:"post_id"`
|
||||
// 文章阅读量
|
||||
View int32 `json:"view"`
|
||||
}
|
||||
|
||||
type PostViewer struct {
|
||||
// 文章id
|
||||
PostID int32 `json:"post_id"`
|
||||
// 访问ip
|
||||
Ip netip.Addr `json:"ip"`
|
||||
// 最后访问时间
|
||||
LastViewedAt time.Time `json:"last_viewed_at"`
|
||||
}
|
||||
|
||||
type SysApi struct {
|
||||
// 主键ID
|
||||
ID int32 `json:"id"`
|
||||
// 分组名称
|
||||
GroupName string `json:"group_name"`
|
||||
// 接口名称
|
||||
Name string `json:"name"`
|
||||
// api方法
|
||||
Method string `json:"method"`
|
||||
// api路径
|
||||
Path string `json:"path"`
|
||||
// 排序
|
||||
Sort *int32 `json:"sort"`
|
||||
// 创建时间
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
// 更新时间
|
||||
UpdatedAt *time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type SysApiPermission struct {
|
||||
// api ID
|
||||
ApiID int32 `json:"api_id"`
|
||||
// 权限id
|
||||
PermissionID int32 `json:"permission_id"`
|
||||
}
|
||||
|
||||
type SysMenu struct {
|
||||
// 主键ID
|
||||
ID int32 `json:"id"`
|
||||
// 菜单名称
|
||||
Name string `json:"name"`
|
||||
// 菜单路径
|
||||
Path string `json:"path"`
|
||||
// 组件路径
|
||||
Component *string `json:"component"`
|
||||
// 菜单类型 0: 目录 1: 菜单 2: button
|
||||
Type int16 `json:"type"`
|
||||
// 是否隐藏菜单
|
||||
Hidden *bool `json:"hidden"`
|
||||
// 菜单排序
|
||||
Sort *int32 `json:"sort"`
|
||||
// 菜单状态 1: 启用 0: 禁用
|
||||
Status int16 `json:"status"`
|
||||
// 父级id
|
||||
ParentID *int32 `json:"parent_id"`
|
||||
// 菜单icon
|
||||
Icon *int32 `json:"icon"`
|
||||
// 创建时间
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
// 更新时间
|
||||
UpdatedAt *time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type SysMenuPermission struct {
|
||||
// 菜单id
|
||||
MenuID int32 `json:"menu_id"`
|
||||
// 权限id
|
||||
PermissionID int32 `json:"permission_id"`
|
||||
}
|
||||
|
||||
type SysPermission struct {
|
||||
// 主键ID
|
||||
ID int32 `json:"id"`
|
||||
// 权限类型,0: 菜单 1: api
|
||||
Code *string `json:"code"`
|
||||
Type int16 `json:"type"`
|
||||
// 创建时间
|
||||
CreatedAt interface{} `json:"created_at"`
|
||||
// 更新时间
|
||||
UpdatedAt *time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type SysRole struct {
|
||||
// 主键ID
|
||||
ID int32 `json:"id"`
|
||||
// 角色名称
|
||||
Name string `json:"name"`
|
||||
// 角色编码,唯一
|
||||
Code string `json:"code"`
|
||||
// 创建时间
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
// 更新时间
|
||||
UpdatedAt *time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type SysRolePermission struct {
|
||||
// 角色id
|
||||
RoleID int32 `json:"role_id"`
|
||||
// 权限id
|
||||
PermissionID int32 `json:"permission_id"`
|
||||
}
|
||||
|
||||
type SysUser struct {
|
||||
// 主键ID
|
||||
ID int32 `json:"id"`
|
||||
// 用户账号
|
||||
Account string `json:"account"`
|
||||
// 用户名称
|
||||
Username string `json:"username"`
|
||||
// hash密码
|
||||
PasswordHash string `json:"password_hash"`
|
||||
// 头像文件id
|
||||
AvatarID *int32 `json:"avatar_id"`
|
||||
// 创建时间
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
// 更新时间
|
||||
UpdatedAt *time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type SysUserRole struct {
|
||||
// 用户ID
|
||||
UserID int32 `json:"user_id"`
|
||||
// 角色ID
|
||||
RoleID int32 `json:"role_id"`
|
||||
}
|
||||
Reference in New Issue
Block a user