models

package
v0.0.0-...-cfb18d5 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScopeWhole     = "1" // 全部权限
	ScopeCustomize = "2" // 自定义权限
	ScopeDept      = "3" // 仅部门权限
	ScopeDeptBelow = "4" // 仅部门及以下权限
	ScopeMyself    = "5" // 仅本人数据权限
)
View Source
const (
	StatusEnable  = "0"
	StatusDisable = "1"
)
View Source
const (
	MenuTypeToc  = "toc" // 菜单      M
	MenuTypeMenu = "mem" // 菜单项    C
	// MenuTypeLay  = "lay" // 布局 lay
	MenuTypeBtn = "btn" // 按钮       F
	MenuTypeIfc = "ifc" // 接口       A
)

目录类型

View Source
const (
	SuperRoot  = "root"
	SuperAdmin = "admin"
)

SuperRoot 超级管理员

View Source
const UserSaltLength = 6

UserSaltLength 用户密码随机盐的长度

Variables

View Source
var CCasbinRule = cCasbinRule{}

CCasbinRule 实例

View Source
var CCategory = cCategory{}
View Source
var CConfig = cConfig{}

CConfig 实例

View Source
var CContent = cContent{}

CContent 实例

View Source
var CDept = cDept{}

CDept 实例

View Source
var CDictData = cDictData{}

CDictData 实例

View Source
var CDictType = cDictType{}

CDictType 实例

View Source
var CFileDir = cFileDir{}

CFileDir 实例

View Source
var CFileInfo = cFileInfo{}

CFileInfo 实例

View Source
var CJob = cJob{}

实例

View Source
var CLoginLog = cLoginLog{}

CLoginLog 实例

View Source
var CMenu = cMenu{}

CMenu 实例

View Source
var COperLog = cOperLog{}

COperLog 实例

View Source
var CPost = cPost{}

CPost post 实例

View Source
var CRole = cRole{}

CRole role实例

View Source
var CRoleDept = cRoleDept{}

CRoleDept 实例

View Source
var CRoleMenu = cRoleMenu{}

CRoleMenu 实例

View Source
var CSetting = cSetting{}

CSetting 实例

View Source
var CUser = cUser{}

CUser 实例

Functions

func CasbinRuleDB

func CasbinRuleDB(ctx context.Context) func(db *gorm.DB) *gorm.DB

CasbinRuleDB casbin rule db scope

func CategoryDB

func CategoryDB(ctx context.Context) func(db *gorm.DB) *gorm.DB

func ConfigDB

func ConfigDB(ctx context.Context) func(db *gorm.DB) *gorm.DB

ConfigDB config db scope

func ContentDB

func ContentDB(ctx context.Context) func(db *gorm.DB) *gorm.DB

ContentDB content db scopes

func DataScope

func DataScope(tabler schema.Tabler, userId int) func(db *gorm.DB) *gorm.DB

func DeptDB

func DeptDB(ctx context.Context) func(db *gorm.DB) *gorm.DB

DeptDB scope dept model

func DictDataDB

func DictDataDB(ctx context.Context) func(db *gorm.DB) *gorm.DB

DictDataDB dict data db

func DictTypeDB

func DictTypeDB(ctx context.Context) func(db *gorm.DB) *gorm.DB

DictTypeDB dict type db

func ExecSql

func ExecSql(db *gorm.DB, filePath string) error

func FileDirDB

func FileDirDB(ctx context.Context) func(db *gorm.DB) *gorm.DB

FileDirDB file dir db scopes

func FileInfoDB

func FileInfoDB(ctx context.Context) func(db *gorm.DB) *gorm.DB

FileInfoDB file info db scopes

func GetMigrationCount

func GetMigrationCount(ctx context.Context, db *gorm.DB, ver int) (count int64, err error)

func InitDb

func InitDb(db *gorm.DB) (err error)

func Ioutil

func Ioutil(filePath string) (string, error)

func JobDB

func JobDB(ctx context.Context) func(db *gorm.DB) *gorm.DB

JobDB job db scope

func LoginLogDB

func LoginLogDB(ctx context.Context) func(db *gorm.DB) *gorm.DB

LoginLogDB login log db scopes

func MenuDB(ctx context.Context) func(db *gorm.DB) *gorm.DB

MenuDB menu db scopes

func MigrationDB

func MigrationDB(ctx context.Context) func(db *gorm.DB) *gorm.DB

MigrationDB migration db scopes

func OperLogDB

func OperLogDB(ctx context.Context) func(db *gorm.DB) *gorm.DB

OperLogDB openate log db scope

func PostDB

func PostDB(ctx context.Context) func(db *gorm.DB) *gorm.DB

PostDB post db scope

func RoleDB

func RoleDB(ctx context.Context) func(db *gorm.DB) *gorm.DB

RoleDB role db scope

func RoleDeptDB

func RoleDeptDB(ctx context.Context) func(db *gorm.DB) *gorm.DB

RoleDeptDB role dept db scopes

func RoleMenuDB

func RoleMenuDB(ctx context.Context) func(db *gorm.DB) *gorm.DB

RoleMenuDB role mene db scope

func SettingDB

func SettingDB(ctx context.Context) func(db *gorm.DB) *gorm.DB

SettingDB setting db scopes

func UserDB

func UserDB(ctx context.Context) func(db *gorm.DB) *gorm.DB

UserDB user db scopes

Types

type CasbinRule

type CasbinRule struct {
	ID    uint   `gorm:"primaryKey;autoIncrement"`
	Ptype string `gorm:"size:100;uniqueIndex:unique_index"` // type
	V0    string `gorm:"size:100;uniqueIndex:unique_index"` // role key
	V1    string `gorm:"size:100;uniqueIndex:unique_index"` // path
	V2    string `gorm:"size:100;uniqueIndex:unique_index"` // method
	V3    string `gorm:"size:100;uniqueIndex:unique_index"`
	V4    string `gorm:"size:100;uniqueIndex:unique_index"`
	V5    string `gorm:"size:100;uniqueIndex:unique_index"`
}

CasbinRule casbin rule

func (CasbinRule) TableName

func (CasbinRule) TableName() string

TableName implement schema.Tabler interface

type Category

type Category struct {
	Id      int    `json:"id" gorm:"type:int(11);primary_key;AUTO_INCREMENT"` // 主键
	Name    string `json:"name" gorm:"type:varchar(255);"`                    // 名称
	Img     string `json:"img" gorm:"type:varchar(255);"`                     // 图片
	Sort    string `json:"sort" gorm:"type:int(4);"`                          // 排序
	Status  string `json:"status" gorm:"type:int(1);"`                        // 状态
	Remark  string `json:"remark" gorm:"type:varchar(255);"`                  // 备注
	Creator string `json:"creator" gorm:"type:varchar(64);"`                  // 创建者
	Updator string `json:"updator" gorm:"type:varchar(64);"`                  // 更新者
	Model

	DataScope string `json:"dataScope" gorm:"-"`
	Params    string `json:"params"  gorm:"-"`
}

func (Category) TableName

func (Category) TableName() string

type CategoryQueryParam

type CategoryQueryParam struct {
	Name   string `form:"name"`
	Status string `form:"status"`
	paginator.Param
}

type Config

type Config struct {
	ConfigId    int    `json:"configId" gorm:"primary_key;auto_increment;"` // 主键
	ConfigName  string `json:"configName" gorm:"size:128;"`                 // 名称
	ConfigKey   string `json:"configKey" gorm:"size:128;"`                  // 键名
	ConfigValue string `json:"configValue" gorm:"size:255;"`                // 键值
	ConfigType  string `json:"configType" gorm:"size:64;"`                  // 是否系统内置(Y/N) 字典sys_yes_no
	Remark      string `json:"remark" gorm:"size:128;"`                     // 备注
	Creator     string `json:"creator" gorm:"size:128;"`                    // 创建者
	Updator     string `json:"updator" gorm:"size:128;"`                    // 更新者
	Model

	DataScope string `json:"-" gorm:"-"`
	Params    string `json:"-"  gorm:"-"`
}

Config 参数配置 主要用于系统参数配置,包含名称,键名,键值,是否系统内置 可用于web一些系统化配置,如框架样式,主框架侧边主题,用户管理默认密码等 由开发者动态决定,以适配不同的需求.

func (Config) TableName

func (Config) TableName() string

TableName implement schema.Tabler interface

type ConfigQueryParam

type ConfigQueryParam struct {
	ConfigName string `form:"configName"`
	ConfigKey  string `form:"configKey"`
	ConfigType string `form:"configType"`
	paginator.Param
}

ConfigQueryParam 查询参数

type Content

type Content struct {
	Id      int    `json:"id" gorm:"type:int(11);primary_key;auto_increment"` // 主键
	CateId  string `json:"cateId" gorm:"type:int(11);"`                       // 分类id
	Name    string `json:"name" gorm:"type:varchar(255);"`                    // 名称
	Status  string `json:"status" gorm:"type:int(1);"`                        // 状态
	Img     string `json:"img" gorm:"type:varchar(255);"`                     // 图片
	Content string `json:"content" gorm:"type:text;"`                         // 内容
	Remark  string `json:"remark" gorm:"type:varchar(255);"`                  // 备注
	Sort    string `json:"sort" gorm:"type:int(4);"`                          // 排序
	Creator string `json:"creator" gorm:"type:varchar(128);"`                 // 创建者
	Updator string `json:"updator" gorm:"type:varchar(128);"`                 // 更新者
	Model

	DataScope string `json:"dataScope" gorm:"-"`
	Params    string `json:"params"  gorm:"-"`
}

Content 内容

func (Content) TableName

func (Content) TableName() string

TableName implement schema.Tabler interface

type ContentQueryParam

type ContentQueryParam struct {
	CateId string `form:"cateId"`
	Name   string `form:"name"`
	Status string `form:"status"`
	paginator.Param
}

ContentQueryParam 查询参数

type Dept

type Dept struct {
	DeptId   int    `json:"deptId" gorm:"primary_key;auto_increment;"` // 主键
	ParentId int    `json:"parentId" gorm:""`                          // 上级主键
	DeptPath string `json:"deptPath" gorm:"size:255;"`                 // 路径树
	DeptName string `json:"deptName"  gorm:"size:128;"`                // 名称
	Sort     int    `json:"sort"`                                      // 排序
	Leader   string `json:"leader" gorm:"size:128;"`                   // 负责人
	Phone    string `json:"phone" gorm:"size:11;"`                     // 负责人联系手机
	Email    string `json:"email" gorm:"size:64;"`                     // 负责人联系邮箱
	Status   string `json:"status" gorm:"size:4;"`                     // 状态
	Creator  string `json:"creator" gorm:"size:64;"`                   // 创建者
	Updator  string `json:"updator" gorm:"size:64;"`                   // 更新者
	Model

	Children []Dept `json:"children" gorm:"-"` // 子列表

	DataScope string `json:"dataScope" gorm:"-"`
	Params    string `json:"params" gorm:"-"`
}

Dept 部门

func (Dept) TableName

func (Dept) TableName() string

TableName 实现schema.Tabler接口

type DeptIdList

type DeptIdList struct {
	DeptId int `json:"deptId"`
}

DeptIdList ...

type DeptNameLabel

type DeptNameLabel struct {
	Id       int             `json:"id"`
	Label    string          `json:"label"`
	Children []DeptNameLabel `json:"children"`
}

DeptNameLabel dept name label tree

type DeptQueryParam

type DeptQueryParam struct {
	DeptId   int    `form:"deptId"`
	DeptName string `form:"deptName"`
	DeptPath string `form:"deptPath"`
	Status   string `form:"status"`
}

DeptQueryParam 查询参数

type DictData

type DictData struct {
	DictId    int    `gorm:"primary_key;auto_increment;" json:"dictId" example:"1"` // 主键
	DictLabel string `gorm:"size:128;" json:"dictLabel"`                            // 标签
	DictValue string `gorm:"size:255;" json:"dictValue"`                            // 值
	DictType  string `gorm:"size:64;" json:"dictType"`                              // 类型
	Sort      int    `gorm:"" json:"sort"`                                          // 排序
	CssClass  string `gorm:"size:128;" json:"cssClass"`                             // (未用)
	ListClass string `gorm:"size:128;" json:"listClass"`                            // (未用)
	IsDefault string `gorm:"size:8;" json:"isDefault"`                              // (未用)
	Default   string `gorm:"size:8;" json:"default"`                                // (未用)
	Status    string `gorm:"size:4;" json:"status"`                                 // 状态
	Remark    string `gorm:"size:255;" json:"remark"`                               // 备注
	Creator   string `gorm:"size:64;" json:"creator"`                               // 创建者
	Updator   string `gorm:"size:64;" json:"updator"`                               // 更新者
	Model

	DataScope string `gorm:"-" json:"dataScope"`
	Params    string `gorm:"-" json:"params"`
}

DictData 字典数据, 字典类型下的实际字典数据

func (DictData) TableName

func (DictData) TableName() string

TableName implement schema.Tabler interface

type DictDataQueryParam

type DictDataQueryParam struct {
	DictLabel string `form:"dictLabel"`
	DictType  string `form:"dictType"`
	Status    string `form:"status"`
	paginator.Param
}

DictDataQueryParam 查询参数

type DictType

type DictType struct {
	DictId   int    `gorm:"primary_key;auto_increment;" json:"dictId"` // 主键
	DictName string `gorm:"size:128;" json:"dictName"`                 // 名称
	DictType string `gorm:"size:128;" json:"dictType"`                 // 类型
	Status   string `gorm:"size:4;" json:"status"`                     // 状态
	Remark   string `gorm:"size:255;" json:"remark"`                   // 备注
	Creator  string `gorm:"size:11;" json:"creator"`                   // 创建者
	Updator  string `gorm:"size:11;" json:"updator"`                   // 更新者
	Model

	DataScope string `gorm:"-" json:"dataScope"`
	Params    string `gorm:"-" json:"params"`
}

DictType 字典类型, 用于字典数据的管理.

func (DictType) TableName

func (DictType) TableName() string

TableName implement schema.Tabler interface

type DictTypeQueryParam

type DictTypeQueryParam struct {
	DictName string `form:"dictName"`
	DictType string `form:"dictType"`
	Status   string `form:"status"`
	paginator.Param
}

DictTypeQueryParam 查询参数

type FileDir

type FileDir struct {
	Id      int    `json:"id"`                                // 主键
	Label   string `json:"label" gorm:"type:varchar(255);"`   // 名称
	Pid     int    `json:"pid" gorm:"type:int(11);"`          // 父id
	Path    string `json:"path" gorm:"size:255;"`             // 路径树
	Sort    int    `json:"sort" gorm:""`                      // 排序
	Creator string `json:"creator" gorm:"type:varchar(128);"` // 创建者
	Updator string `json:"updator" gorm:"type:varchar(128);"` // 更新者
	Model

	Children []FileDir `json:"children" gorm:"-"`

	DataScope string `json:"dataScope" gorm:"-"`
	Params    string `json:"params"  gorm:"-"`
}

func (FileDir) TableName

func (FileDir) TableName() string

TableName implement schema.Tabler interface

type FileDirQueryParam

type FileDirQueryParam struct {
	Id    int    `form:"id"`
	Label string `form:"label"`
	Pid   int    `form:"pid"`
}

FileDirQueryParam 文件查询

type FileInfo

type FileInfo struct {
	Id      int    `json:"id"`                                // 主键
	Type    string `json:"type" gorm:"type:varchar(255);"`    // 类型
	Name    string `json:"name" gorm:"type:varchar(255);"`    // 名称
	Size    string `json:"size" gorm:"type:int(11);"`         // 大小
	Pid     int    `json:"pid" gorm:"type:int(11);"`          // 父级id
	Source  string `json:"source" gorm:"type:varchar(255);"`  // 源
	Url     string `json:"url" gorm:"type:varchar(255);"`     // 路径
	FullUrl string `json:"fullUrl" gorm:"type:varchar(255);"` // 全路径
	Creator string `json:"creator" gorm:"type:varchar(128);"` // 创建者
	Updator string `json:"updator" gorm:"type:varchar(128);"` // 更新者
	Model

	DataScope string `json:"dataScope" gorm:"-"`
	Params    string `json:"params"  gorm:"-"`
}

func (FileInfo) TableName

func (FileInfo) TableName() string

TableName implement schema.Tabler interface

type FileInfoQueryParam

type FileInfoQueryParam struct {
	Pid int `form:"pid"`
	paginator.Param
}

FileInfoQueryParam 查询参数

type Job

type Job struct {
	JobId          uint   `json:"jobId" gorm:"primary_key;AUTO_INCREMENT"` // 主键
	JobName        string `json:"jobName" gorm:"size:255;"`                // 名称
	JobGroup       string `json:"jobGroup" gorm:"size:255;"`               // 分组
	JobType        int    `json:"jobType" gorm:"size:1;"`                  // 类型
	CronExpression string `json:"cronExpression" gorm:"size:255;"`         // cron表达式
	InvokeTarget   string `json:"invokeTarget" gorm:"size:255;"`           // 调用目标
	Args           string `json:"args" gorm:"size:255;"`                   // 目标参数
	MisfirePolicy  int    `json:"misfirePolicy" gorm:"size:255;"`          // 执行策略
	Concurrent     int    `json:"concurrent" gorm:"size:1;"`               // 是否并发
	Status         int    `json:"status" gorm:"size:1;"`                   // 状态
	EntryId        int    `json:"entry_id" gorm:"size:11;"`                // job启动时cron返回的条目id
	Creator        string `json:"creator" gorm:"size:128;"`                // 创建者
	Updator        string `json:"updator" gorm:"size:128;"`                // 更新者
	Model

	DataScope string `json:"dataScope" gorm:"-"`
}

Job job

func (*Job) Generate

func (e *Job) Generate() dto.ActiveRecord

func (*Job) GetId

func (e *Job) GetId() uint

func (*Job) SetCreator

func (e *Job) SetCreator(createBy uint)

func (*Job) SetUpdator

func (e *Job) SetUpdator(updateBy uint)

func (Job) TableName

func (Job) TableName() string

TableName implement schema.Tabler interface

type Login

type Login struct {
	Username string `form:"username" json:"username" binding:"required"` // 用户名
	Password string `form:"password" json:"password" binding:"required"` // 密码
	CID      string `form:"cid" json:"cid" binding:"required"`           // 验证码id
	CCode    string `form:"code" json:"ccode" binding:"required"`        // 验证码
}

Login 登录

func (*Login) Get

func (sf *Login) Get() (jwtauth.Identities, bool, error)

Get 获取 user 和 role 和用户是否已使能

type LoginLog

type LoginLog struct {
	InfoId    int       `json:"infoId" gorm:"primary_key;auto_increment;"` // 主键
	Username  string    `json:"username" gorm:"size:128;"`                 // 用户名
	Status    string    `json:"status" gorm:"size:4;"`                     // 登录状态
	Ip        string    `json:"ip" gorm:"size:255;"`                       // 登录ip地址
	Location  string    `json:"location" gorm:"size:255;"`                 // 登录ip归属地
	Browser   string    `json:"browser" gorm:"size:255;"`                  // 浏览器
	Os        string    `json:"os" gorm:"size:255;"`                       // 操作系统
	Platform  string    `json:"platform" gorm:"size:255;"`                 // 系统平台
	LoginTime time.Time `json:"loginTime" gorm:"type:timestamp;"`          // 登录时间
	Remark    string    `json:"remark" gorm:"size:255;"`                   // 备注
	Msg       string    `json:"msg" gorm:"size:255;"`                      // 登录信息
	Creator   string    `json:"creator" gorm:"size:128;"`                  // 创建人
	Updator   string    `json:"updator" gorm:"size:128;"`                  // 更新者
	Model

	DataScope string `json:"dataScope" gorm:"-"` // 数据
	Params    string `json:"params" gorm:"-"`    //
}

LoginLog 登录记录

func (LoginLog) TableName

func (LoginLog) TableName() string

TableName implement schema.Tabler interface

type LoginLogQueryParam

type LoginLogQueryParam struct {
	Username string `form:"username"` // 用户名
	Ip       string `form:"ip"`       // ip地址
	Status   string `form:"status"`   // 状态
	paginator.Param
}

LoginLogQueryParam 查询参数

type Menu struct {
	MenuId     int    `json:"menuId" gorm:"primary_key;AUTO_INCREMENT"` // 主键
	MenuName   string `json:"menuName" gorm:"size:128;"`                // 名称
	Title      string `json:"title" gorm:"size:128;"`                   // 标题
	Icon       string `json:"icon" gorm:"size:128;"`                    // 图标
	Path       string `json:"path" gorm:"size:128;"`                    // 路径
	Paths      string `json:"paths" gorm:"size:128;"`                   // 路径树
	MenuType   string `json:"menuType" gorm:"size:3;"`                  // 类型
	Method     string `json:"method" gorm:"size:16;"`                   // 请求方法,仅<接口>使用
	Permission string `json:"permission" gorm:"size:255;"`              // 权限标识,仅在<菜单项,按钮>使用
	ParentId   int    `json:"parentId" gorm:"size:11;"`                 // 父级主键
	NoCache    bool   `json:"noCache" gorm:"size:8;"`                   // 不缓存
	Breadcrumb string `json:"breadcrumb" gorm:"size:255;"`              // 面包屑
	Component  string `json:"component" gorm:"size:255;"`               // 组件路径,仅在<菜单,菜单项>使用
	Sort       int    `json:"sort"`                                     // 排序
	Visible    string `json:"visible" gorm:"size:1;"`                   // 显示/隐藏
	IsFrame    string `json:"isFrame" gorm:"size:1;DEFAULT:0;"`         // 是否外链
	Creator    string `json:"creator" gorm:"size:128;"`                 // 创建者
	Updator    string `json:"updator" gorm:"size:128;"`                 // 更新者
	Model

	Children []Menu `json:"children" gorm:"-"`

	DataScope string `json:"dataScope" gorm:"-"`
	Params    string `json:"params" gorm:"-"`
}

Menu菜单 MenuType = toc 菜单权限, 菜单功能,里面仅含有菜单项 MenuType = men 菜单项权限, 菜单项功能,为实际页面

MenuType == btn 按钮权限, 主要用于按钮权限控制,由permission设置

title, paths, permission, visible
标题, 路径树, 权限标识, 排序, 显示

MenuType == ifc接口权限,主要用于角色权限路由method,path的设置.

title, path, paths, method, sort, visible
标题, 路径, 路径树, 方法, 排序, 显示
func (Menu) TableName() string

TableName implement schema.Tabler interface

type MenuIdList struct {
	MenuId int `json:"menuId"`
}

MenuIdList ...

type MenuPath struct {
	Path string `json:"path"`
}
type MenuQueryParam struct {
	Title    string `form:"title"`
	MenuName string `form:"menuName"`
	Path     string `form:"path"`
	Method   string `form:"method"`
	MenuType string `form:"menuType"`
	Visible  string `form:"visible"`
}

MenuQueryParam 查询参数

type MenuTitleLabel struct {
	Id       int              `json:"id"`
	Label    string           `json:"label"`
	Children []MenuTitleLabel `json:"children"`
}

MenuTitleLabel title树

type Migration

type Migration struct {
	Version   string    `gorm:"primary_key"`
	ApplyTime time.Time `gorm:"autoCreateTime"`
}

func (Migration) TableName

func (Migration) TableName() string

TableName implement schema.Tabler interface

type Model

type Model struct {
	CreatedAt time.Time  `json:"createdAt"`
	UpdatedAt time.Time  `json:"updatedAt"`
	DeletedAt *time.Time `json:"deletedAt"`
}

Model 模型

type OperLog

type OperLog struct {
	OperId        int       `json:"operId" gorm:"primary_key;AUTO_INCREMENT"` // 主鍵
	Title         string    `json:"title" gorm:"size:255;"`                   // 操作模块
	BusinessType  string    `json:"businessType" gorm:"size:128;"`            // 操作类型
	Method        string    `json:"method" gorm:"size:128;"`                  // 函数
	RequestMethod string    `json:"requestMethod" gorm:"size:128;"`           // 请求方式
	OperatorType  string    `json:"operatorType" gorm:"size:128;"`            // 操作类型
	OperName      string    `json:"operName" gorm:"size:128;"`                // 操作者
	DeptName      string    `json:"deptName" gorm:"size:128;"`                // 部门名称
	OperUrl       string    `json:"operUrl" gorm:"size:255;"`                 // 访问地址
	OperIp        string    `json:"operIp" gorm:"size:128;"`                  // 客户端ip
	OperLocation  string    `json:"operLocation" gorm:"size:128;"`            // 访问位置
	OperParam     string    `json:"operParam" gorm:"size:255;"`               // 请求参数
	Status        string    `json:"status" gorm:"size:4;"`                    // 操作状态
	OperTime      time.Time `json:"operTime" gorm:"type:timestamp;"`          // 操作时间
	JsonResult    string    `json:"jsonResult" gorm:"size:255;"`              // 返回数据
	Remark        string    `json:"remark" gorm:"size:255;"`                  // 备注
	LatencyTime   string    `json:"latencyime" gorm:"size:128;"`              // 耗时
	UserAgent     string    `json:"userAgent" gorm:"size:255;"`               // user_agent
	Creator       string    `json:"creator" gorm:"size:128;"`                 // 创建人
	Updator       string    `json:"updator" gorm:"size:128;"`                 // 更新者
	Model

	DataScope string `json:"dataScope" gorm:"-"` // 数据
	Params    string `json:"params" gorm:"-"`    // 参数
}

OperLog operate log

func (OperLog) TableName

func (OperLog) TableName() string

TableName implement schema.Tabler interface

type OperLogQueryParam

type OperLogQueryParam struct {
	Title        string `form:"title"`        // 操作模块
	OperName     string `form:"operName"`     // 操作人员
	OperIp       string `form:"operIp"`       // 客户端ip
	BusinessType string `form:"businessType"` // 操作类型
	Status       string `form:"status"`       // 操作状态
	paginator.Param
}

OperLogQueryParam 查询参数

type Post

type Post struct {
	PostId   int    `gorm:"primary_key;AUTO_INCREMENT" json:"postId"` // 主键
	PostCode string `gorm:"size:128;" json:"postCode"`                // 编码,比如CEO,CTO
	PostName string `gorm:"size:128;" json:"postName"`                // 名称
	Sort     int    `gorm:"" json:"sort"`                             // 排序
	Status   string `gorm:"size:4;" json:"status"`                    // 状态
	Remark   string `gorm:"size:255;" json:"remark"`                  // 备注
	Creator  string `gorm:"size:128;" json:"creator"`                 // 创建者
	Updator  string `gorm:"size:128;" json:"updator"`                 // 更新者
	Model

	DataScope string `gorm:"-" json:"dataScope"`
	Params    string `gorm:"-" json:"params"`
}

Post 岗位

func (Post) TableName

func (Post) TableName() string

TableName implement schema.Tabler interface

type PostQueryParam

type PostQueryParam struct {
	PostName string `form:"postName"`
	PostCode string `form:"postCode"`
	Status   string `form:"status"`
	paginator.Param
}

PostQueryParam 查询参数

type Role

type Role struct {
	RoleId    int    `json:"roleId" gorm:"primary_key;AUTO_INCREMENT"` // 主键
	RoleName  string `json:"roleName" gorm:"size:128;"`                // 名称
	RoleKey   string `json:"roleKey" gorm:"size:128;"`                 // 标识
	Status    string `json:"status" gorm:"size:4;"`                    // 状态
	Sort      int    `json:"sort" gorm:""`                             // 排序
	Flag      string `json:"flag" gorm:"size:128;"`                    // 标记(未用)
	Admin     bool   `json:"admin" gorm:"size:5;"`                     // 超级权限(未用)
	Remark    string `json:"remark" gorm:"size:255;"`                  // 备注
	DataScope string `json:"dataScope" gorm:"size:128;"`               // 数据权限
	Creator   string `json:"creator" gorm:"size:128;"`                 // 创建者
	Updator   string `json:"updator" gorm:"size:128;"`                 // 更新者
	Model

	MenuIds []int `json:"menuIds" gorm:"-"` // 角色目录ID列表
	DeptIds []int `json:"deptIds" gorm:"-"` // 角色部门ID列表

	Params string `json:"params" gorm:"-"` // (未用)
}

Role 角色

func (Role) TableName

func (Role) TableName() string

TableName implement schema.Tabler interface

type RoleDept

type RoleDept struct {
	RoleId int
	DeptId int
}

RoleDept role dept关系表

func (RoleDept) TableName

func (RoleDept) TableName() string

TableName implement schema.Tabler interface

type RoleMenu

type RoleMenu struct {
	RoleId   int    `gorm:""`
	MenuId   int    `gorm:""`
	RoleName string `gorm:"size:128"`
}

RoleMenu role menu 关系表

func (RoleMenu) TableName

func (RoleMenu) TableName() string

TableName implement schema.Tabler interface

type RoleQueryParam

type RoleQueryParam struct {
	RoleName string `form:"roleName"`
	RoleKey  string `form:"roleKey"`
	Status   string `form:"status"`
	paginator.Param
}

RoleQueryParam 查询参数

type Setting

type Setting struct {
	ID   int    `json:"id" gorm:"primary_key;AUTO_INCREMENT"` // 主键
	Name string `json:"name" gorm:"type:varchar(256);"`       // 名称
	Model
}

Setting 系统设置 用于系统设置的名称,logo的值,配置前端显示

func (Setting) TableName

func (Setting) TableName() string

TableName implement schema.Tabler interface

type UpSetting

type UpSetting struct {
	Name string `json:"name" binding:"required"` // 名称
}

UpSetting 更新系统设置

type User

type User struct {
	UserId   int    `gorm:"primary_key;AUTO_INCREMENT"  json:"userId"` // 主键
	Username string `gorm:"size:64" json:"username"`                   // 用户名
	Password string `gorm:"size:128" json:"password"`                  // 密码
	NickName string `gorm:"size:128" json:"nickName"`                  // 昵称
	Phone    string `gorm:"size:11" json:"phone"`                      // 手机号
	Salt     string `gorm:"size:255" json:"salt"`                      // 加密盐
	Avatar   string `gorm:"size:255" json:"avatar"`                    // 头像
	Sex      string `gorm:"size:255" json:"sex"`                       // 性别
	Email    string `gorm:"size:128" json:"email"`                     // 邮箱
	Status   string `gorm:"size:4;" json:"status"`                     // 状态
	Remark   string `gorm:"size:255" json:"remark"`                    // 备注
	RoleId   int    `gorm:"" json:"roleId"`                            // 角色编码
	DeptId   int    `gorm:"" json:"deptId"`                            // 部门编码
	PostId   int    `gorm:"" json:"postId"`                            // 职位编码
	Creator  string `gorm:"size:128" json:"creator"`                   // 创建者
	Updator  string `gorm:"size:128" json:"updator"`                   // 更新者
	Model

	DataScope string `gorm:"-" json:"dataScope"`
	Params    string `gorm:"-" json:"params"`
}

User 用户信息

func (User) TableName

func (User) TableName() string

TableName implement schema.Tabler interface

type UserPage

type UserPage struct {
	User
	DeptName string `json:"deptName"`
}

UserPage 分页查询数据,带部门名

type UserQueryParam

type UserQueryParam struct {
	Username string `form:"username"`
	Status   string `form:"status"`
	Phone    string `form:"phone"`
	DeptId   int    `form:"deptId"`
	// PostId   int    `form:"postId"` // not used
	paginator.Param
}

UserQueryParam 查询参数

type UserView

type UserView struct {
	User
	RoleName string `json:"roleName"`
}

UserView 查询查看数据,带角色名

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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