models

package
v0.0.0-...-88540c7 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecSql

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

func InitDb

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

func Ioutil

func Ioutil(filePath string) (string, error)

func SaveLoginLog

func SaveLoginLog(message storage.Messager) (err error)

SaveLoginLog 从队列中获取登录日志

func SaveOperaLog

func SaveOperaLog(message storage.Messager) (err error)

SaveOperaLog 从队列中获取操作日志

func SaveSysApi

func SaveSysApi(message storage.Messager) (err error)

Types

type BaseModel

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

type CasbinRule

type CasbinRule struct {
	ID    uint   `gorm:"primaryKey;autoIncrement"`
	Ptype string `gorm:"size:512;uniqueIndex:unique_index"`
	V0    string `gorm:"size:512;uniqueIndex:unique_index"`
	V1    string `gorm:"size:512;uniqueIndex:unique_index"`
	V2    string `gorm:"size:512;uniqueIndex:unique_index"`
	V3    string `gorm:"size:512;uniqueIndex:unique_index"`
	V4    string `gorm:"size:512;uniqueIndex:unique_index"`
	V5    string `gorm:"size:512;uniqueIndex:unique_index"`
}

func (CasbinRule) TableName

func (CasbinRule) TableName() string

type DataPermission

type DataPermission struct {
	DataScope string
	UserId    int
	DeptId    int
	RoleId    int
}

func (*DataPermission) GetDataScope

func (e *DataPermission) GetDataScope(tableName string, db *gorm.DB) (*gorm.DB, error)

type SysApi

type SysApi struct {
	Id     int    `json:"id" gorm:"primaryKey;autoIncrement;comment:主键编码"`
	Handle string `json:"handle" gorm:"size:128;comment:handle"`
	Title  string `json:"title" gorm:"size:128;comment:标题"`
	Path   string `json:"path" gorm:"size:128;comment:地址"`
	Action string `json:"action" gorm:"size:16;comment:请求类型"`
	Type   string `json:"type" gorm:"size:16;comment:接口类型"`
	models.ModelTime
	models.ControlBy
}

func (*SysApi) Generate

func (e *SysApi) Generate() models.ActiveRecord

func (*SysApi) GetId

func (e *SysApi) GetId() interface{}

func (*SysApi) TableName

func (*SysApi) TableName() string

type SysConfig

type SysConfig struct {
	models.Model
	ConfigName  string `json:"configName" gorm:"size:128;comment:ConfigName"`   //
	ConfigKey   string `json:"configKey" gorm:"size:128;comment:ConfigKey"`     //
	ConfigValue string `json:"configValue" gorm:"size:255;comment:ConfigValue"` //
	ConfigType  string `json:"configType" gorm:"size:64;comment:ConfigType"`
	IsFrontend  string `json:"isFrontend" gorm:"size:64;comment:是否前台"` //
	Remark      string `json:"remark" gorm:"size:128;comment:Remark"`  //
	models.ControlBy
	models.ModelTime
}

func (*SysConfig) Generate

func (e *SysConfig) Generate() models.ActiveRecord

func (*SysConfig) GetId

func (e *SysConfig) GetId() interface{}

func (*SysConfig) TableName

func (*SysConfig) TableName() string

type SysDept

type SysDept struct {
	DeptId   int    `json:"deptId" gorm:"primaryKey;autoIncrement;"` //部门编码
	ParentId int    `json:"parentId" gorm:""`                        //上级部门
	DeptPath string `json:"deptPath" gorm:"size:255;"`               //
	DeptName string `json:"deptName"  gorm:"size:128;"`              //部门名称
	Sort     int    `json:"sort" gorm:"size:4;"`                     //排序
	Leader   string `json:"leader" gorm:"size:128;"`                 //负责人
	Phone    string `json:"phone" gorm:"size:11;"`                   //手机
	Email    string `json:"email" gorm:"size:64;"`                   //邮箱
	Status   int    `json:"status" gorm:"size:4;"`                   //状态
	models.ControlBy
	models.ModelTime
	DataScope string    `json:"dataScope" gorm:"-"`
	Params    string    `json:"params" gorm:"-"`
	Children  []SysDept `json:"children" gorm:"-"`
}

func (*SysDept) Generate

func (e *SysDept) Generate() models.ActiveRecord

func (*SysDept) GetId

func (e *SysDept) GetId() interface{}

func (*SysDept) TableName

func (*SysDept) TableName() string

type SysDictData

type SysDictData struct {
	DictCode  int    `json:"dictCode" gorm:"primaryKey;column:dict_code;autoIncrement;comment:主键编码"`
	DictSort  int    `json:"dictSort" gorm:"size:20;comment:DictSort"`
	DictLabel string `json:"dictLabel" gorm:"size:128;comment:DictLabel"`
	DictValue string `json:"dictValue" gorm:"size:255;comment:DictValue"`
	DictType  string `json:"dictType" gorm:"size:64;comment:DictType"`
	CssClass  string `json:"cssClass" gorm:"size:128;comment:CssClass"`
	ListClass string `json:"listClass" gorm:"size:128;comment:ListClass"`
	IsDefault string `json:"isDefault" gorm:"size:8;comment:IsDefault"`
	Status    int    `json:"status" gorm:"size:4;comment:Status"`
	Default   string `json:"default" gorm:"size:8;comment:Default"`
	Remark    string `json:"remark" gorm:"size:255;comment:Remark"`
	models.ControlBy
	models.ModelTime
}

func (*SysDictData) Generate

func (e *SysDictData) Generate() models.ActiveRecord

func (*SysDictData) GetId

func (e *SysDictData) GetId() interface{}

func (*SysDictData) TableName

func (*SysDictData) TableName() string

type SysDictType

type SysDictType struct {
	ID       int    `json:"id" gorm:"primaryKey;column:dict_id;autoIncrement;comment:主键编码"`
	DictName string `json:"dictName" gorm:"size:128;comment:DictName"`
	DictType string `json:"dictType" gorm:"size:128;comment:DictType"`
	Status   int    `json:"status" gorm:"size:4;comment:Status"`
	Remark   string `json:"remark" gorm:"size:255;comment:Remark"`
	models.ControlBy
	models.ModelTime
}

func (*SysDictType) Generate

func (e *SysDictType) Generate() models.ActiveRecord

func (*SysDictType) GetId

func (e *SysDictType) GetId() interface{}

func (*SysDictType) TableName

func (*SysDictType) TableName() string

type SysLoginLog

type SysLoginLog struct {
	models.Model
	Username      string    `json:"username" gorm:"size:128;comment:用户名"`
	Status        string    `json:"status" gorm:"size:4;comment:状态"`
	Ipaddr        string    `json:"ipaddr" gorm:"size:255;comment:ip地址"`
	LoginLocation string    `json:"loginLocation" gorm:"size:255;comment:归属地"`
	Browser       string    `json:"browser" gorm:"size:255;comment:浏览器"`
	Os            string    `json:"os" gorm:"size:255;comment:系统"`
	Platform      string    `json:"platform" gorm:"size:255;comment:固件"`
	LoginTime     time.Time `json:"loginTime" gorm:"comment:登录时间"`
	Remark        string    `json:"remark" gorm:"size:255;comment:备注"`
	Msg           string    `json:"msg" gorm:"size:255;comment:信息"`
	CreatedAt     time.Time `json:"createdAt" gorm:"comment:创建时间"`
	UpdatedAt     time.Time `json:"updatedAt" gorm:"comment:最后更新时间"`
	models.ControlBy
}

func (*SysLoginLog) Generate

func (e *SysLoginLog) Generate() models.ActiveRecord

func (*SysLoginLog) GetId

func (e *SysLoginLog) GetId() interface{}

func (*SysLoginLog) TableName

func (*SysLoginLog) TableName() string

type SysMenu

type SysMenu struct {
	MenuId     int       `json:"menuId" gorm:"primaryKey;autoIncrement"`
	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:1;"`
	Action     string    `json:"action" 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" gorm:"size:4;"`
	Visible    string    `json:"visible" gorm:"size:1;"`
	IsFrame    string    `json:"isFrame" gorm:"size:1;DEFAULT:0;"`
	SysApi     []SysApi  `json:"sysApi" gorm:"many2many:sys_menu_api_rule"`
	Apis       []int     `json:"apis" gorm:"-"`
	DataScope  string    `json:"dataScope" gorm:"-"`
	Params     string    `json:"params" gorm:"-"`
	RoleId     int       `gorm:"-"`
	Children   []SysMenu `json:"children,omitempty" gorm:"-"`
	IsSelect   bool      `json:"is_select" gorm:"-"`
	models.ControlBy
	models.ModelTime
}

func (*SysMenu) Generate

func (e *SysMenu) Generate() models.ActiveRecord

func (*SysMenu) GetId

func (e *SysMenu) GetId() interface{}

func (*SysMenu) TableName

func (*SysMenu) TableName() string

type SysMenuSlice

type SysMenuSlice []SysMenu

func (SysMenuSlice) Len

func (x SysMenuSlice) Len() int

func (SysMenuSlice) Less

func (x SysMenuSlice) Less(i, j int) bool

func (SysMenuSlice) Swap

func (x SysMenuSlice) Swap(i, j int)

type SysOperaLog

type SysOperaLog struct {
	models.Model
	Title         string    `json:"title" gorm:"size:255;comment:操作模块"`
	BusinessType  string    `json:"businessType" gorm:"size:128;comment:操作类型"`
	BusinessTypes string    `json:"businessTypes" gorm:"size:128;comment:BusinessTypes"`
	Method        string    `json:"method" gorm:"size:128;comment:函数"`
	RequestMethod string    `json:"requestMethod" gorm:"size:128;comment:请求方式 GET POST PUT DELETE"`
	OperatorType  string    `json:"operatorType" gorm:"size:128;comment:操作类型"`
	OperName      string    `json:"operName" gorm:"size:128;comment:操作者"`
	DeptName      string    `json:"deptName" gorm:"size:128;comment:部门名称"`
	OperUrl       string    `json:"operUrl" gorm:"size:255;comment:访问地址"`
	OperIp        string    `json:"operIp" gorm:"size:128;comment:客户端ip"`
	OperLocation  string    `json:"operLocation" gorm:"size:128;comment:访问位置"`
	OperParam     string    `json:"operParam" gorm:"text;comment:请求参数"`
	Status        string    `json:"status" gorm:"size:4;comment:操作状态 1:正常 2:关闭"`
	OperTime      time.Time `json:"operTime" gorm:"comment:操作时间"`
	JsonResult    string    `json:"jsonResult" gorm:"size:255;comment:返回数据"`
	Remark        string    `json:"remark" gorm:"size:255;comment:备注"`
	LatencyTime   string    `json:"latencyTime" gorm:"size:128;comment:耗时"`
	UserAgent     string    `json:"userAgent" gorm:"size:255;comment:ua"`
	CreatedAt     time.Time `json:"createdAt" gorm:"comment:创建时间"`
	UpdatedAt     time.Time `json:"updatedAt" gorm:"comment:最后更新时间"`
	models.ControlBy
}

func (*SysOperaLog) Generate

func (e *SysOperaLog) Generate() models.ActiveRecord

func (*SysOperaLog) GetId

func (e *SysOperaLog) GetId() interface{}

func (*SysOperaLog) TableName

func (*SysOperaLog) TableName() string

type SysPost

type SysPost struct {
	PostId   int    `gorm:"primaryKey;autoIncrement" json:"postId"` //岗位编号
	PostName string `gorm:"size:128;" json:"postName"`              //岗位名称
	PostCode string `gorm:"size:128;" json:"postCode"`              //岗位代码
	Sort     int    `gorm:"size:4;" json:"sort"`                    //岗位排序
	Status   int    `gorm:"size:4;" json:"status"`                  //状态
	Remark   string `gorm:"size:255;" json:"remark"`                //描述
	models.ControlBy
	models.ModelTime

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

func (*SysPost) Generate

func (e *SysPost) Generate() models.ActiveRecord

func (*SysPost) GetId

func (e *SysPost) GetId() interface{}

func (*SysPost) TableName

func (*SysPost) TableName() string

type SysRole

type SysRole struct {
	RoleId    int        `json:"roleId" gorm:"primaryKey;autoIncrement"` // 角色编码
	RoleName  string     `json:"roleName" gorm:"size:128;"`              // 角色名称
	Status    string     `json:"status" gorm:"size:4;"`                  // 状态 1禁用 2正常
	RoleKey   string     `json:"roleKey" gorm:"size:128;"`               //角色代码
	RoleSort  int        `json:"roleSort" gorm:""`                       //角色排序
	Flag      string     `json:"flag" gorm:"size:128;"`                  //
	Remark    string     `json:"remark" gorm:"size:255;"`                //备注
	Admin     bool       `json:"admin" gorm:"size:4;"`
	DataScope string     `json:"dataScope" gorm:"size:128;"`
	Params    string     `json:"params" gorm:"-"`
	MenuIds   []int      `json:"menuIds" gorm:"-"`
	DeptIds   []int      `json:"deptIds" gorm:"-"`
	SysDept   []SysDept  `` /* 128-byte string literal not displayed */
	SysMenu   *[]SysMenu `` /* 128-byte string literal not displayed */
	models.ControlBy
	models.ModelTime
}

func (*SysRole) Generate

func (e *SysRole) Generate() models.ActiveRecord

func (*SysRole) GetId

func (e *SysRole) GetId() interface{}

func (*SysRole) TableName

func (*SysRole) TableName() string

type SysUser

type SysUser struct {
	UserId   int      `gorm:"primaryKey;autoIncrement;comment:编码"  json:"userId"`
	Username string   `json:"username" gorm:"size:64;comment:用户名"`
	Password string   `json:"-" gorm:"size:128;comment:密码"`
	NickName string   `json:"nickName" gorm:"size:128;comment:昵称"`
	Phone    string   `json:"phone" gorm:"size:11;comment:手机号"`
	RoleId   int      `json:"roleId" gorm:"size:20;comment:角色ID"`
	Salt     string   `json:"-" gorm:"size:255;comment:加盐"`
	Avatar   string   `json:"avatar" gorm:"size:255;comment:头像"`
	Sex      string   `json:"sex" gorm:"size:255;comment:性别"`
	Email    string   `json:"email" gorm:"size:128;comment:邮箱"`
	DeptId   int      `json:"deptId" gorm:"size:20;comment:部门"`
	PostId   int      `json:"postId" gorm:"size:20;comment:岗位"`
	Remark   string   `json:"remark" gorm:"size:255;comment:备注"`
	Status   string   `json:"status" gorm:"size:4;comment:状态"`
	DeptIds  []int    `json:"deptIds" gorm:"-"`
	PostIds  []int    `json:"postIds" gorm:"-"`
	RoleIds  []int    `json:"roleIds" gorm:"-"`
	Dept     *SysDept `json:"dept"`
	models.ControlBy
	models.ModelTime
}

func (*SysUser) AfterFind

func (e *SysUser) AfterFind(_ *gorm.DB) error

func (*SysUser) BeforeCreate

func (e *SysUser) BeforeCreate(_ *gorm.DB) error

func (*SysUser) BeforeUpdate

func (e *SysUser) BeforeUpdate(_ *gorm.DB) error

func (*SysUser) Encrypt

func (e *SysUser) Encrypt() (err error)

Encrypt 加密

func (*SysUser) Generate

func (e *SysUser) Generate() models.ActiveRecord

func (*SysUser) GetId

func (e *SysUser) GetId() interface{}

func (*SysUser) TableName

func (*SysUser) TableName() string

Jump to

Keyboard shortcuts

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