system

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

type Api struct {
	global.Model
	Path        string `json:"path" gorm:"column:path;comment:api路径"`
	Method      string `json:"method" gorm:"column:method;default:POST;comment:方法"`
	ApiGroup    string `json:"apiGroup" gorm:"column:api_group;comment:api组"`
	Description string `json:"description" gorm:"column:description;comment:api中文描述"`
}

func (*Api) BeforeCreate

func (a *Api) BeforeCreate(tx *gorm.DB) error

BeforeCreate api创建前钩子函数 Author [SliverHorn](https://github.com/SliverHorn)

func (*Api) TableName

func (a *Api) TableName() string

type AuthoritiesMenus

type AuthoritiesMenus struct {
	MenuId      uint   `json:"menuId" gorm:"column:menu_id" swaggertype:"string" example:"uint 菜单ID"`
	AuthorityId string `json:"authorityId" gorm:"column:authority_id" example:"角色ID"`
}

AuthoritiesMenus 角色按钮关联表

func (*AuthoritiesMenus) TableName

func (a *AuthoritiesMenus) TableName() string

type AuthoritiesResources

type AuthoritiesResources struct {
	AuthorityId string `gorm:"column:authority_id"`
	ResourcesId string `gorm:"column:resources_id"`
}

AuthoritiesResources 角色资源表

func (*AuthoritiesResources) TableName

func (a *AuthoritiesResources) TableName() string

type Authority

type Authority struct {
	CreatedAt     time.Time      `json:"CreatedAt" gorm:"column:created_at;comment:创建时间" example:"创建时间"`
	UpdatedAt     time.Time      `json:"UpdatedAt" gorm:"column:updated_at;comment:更新时间" example:"更新时间"`
	DeletedAt     gorm.DeletedAt `json:"-" gorm:"index;column:deleted_at;comment:删除时间" example:"删除时间"`
	ParentId      string         `json:"parentId" gorm:"comment:父角色ID"`                                       // 父角色ID
	AuthorityId   string         `json:"authorityId" gorm:"not null;unique;primary_key;comment:角色ID;size:90"` // 角色ID
	AuthorityName string         `json:"authorityName" gorm:"comment:角色名"`                                    // 角色名
	DefaultRouter string         `json:"defaultRouter" gorm:"comment:默认菜单;default:dashboard"`                 // 默认菜单(默认dashboard)
	Menus         []Menu         ``                                                                           /* 140-byte string literal not displayed */
	Children      []Authority    `json:"children" gorm:"-"`
	Resources     []Authority    `` /* 168-byte string literal not displayed */
}

func (*Authority) TableName

func (a *Authority) TableName() string

type AuthorityMenu

type AuthorityMenu struct {
	Menu
	MenuId      string          `json:"menuId" gorm:"comment:菜单ID"`
	AuthorityId string          `json:"-" gorm:"comment:角色ID"`
	Children    []AuthorityMenu `json:"children" gorm:"-"`
	Parameters  []MenuParameter `json:"parameters" gorm:"foreignKey:MenuID;references:MenuId"`
}

func (*AuthorityMenu) TableName

func (s *AuthorityMenu) TableName() string

type AutoCodeApis

type AutoCodeApis []Api

func (*AutoCodeApis) Scan

func (a *AutoCodeApis) Scan(value interface{}) error

Scan 扫描 Author [SliverHorn](https://github.com/SliverHorn)

func (*AutoCodeApis) ToCommonGetByID

func (a *AutoCodeApis) ToCommonGetByID() *common.GetByIDs

func (AutoCodeApis) Value

func (a AutoCodeApis) Value() (driver.Value, error)

Value 值 Author [SliverHorn](https://github.com/SliverHorn)

type AutoCodeHistory

type AutoCodeHistory struct {
	global.Model
	Flag          int    `json:"flag" gorm:"column:flag;comment:表示对应状态 0 代表创建, 1 代表回滚 ..."`
	TablesName    string `json:"table_name" gorm:"column:table_name;comment:表名"`
	StructName    string `json:"structName" gorm:"column:struct_name;comment:结构体名"`
	StructCNName  string `json:"structCNName" gorm:"column:struct_cn_name;comment:结构体中文名"`
	InjectionMeta string `json:"injectionMeta" gorm:"column:injection_meta;comment:注入的内容 RouterPath@functionName@RouterString;"`

	Apis          AutoCodeApis       `json:"apis" gorm:"type:json;column:apis;comment:api表注册内容"`
	Request       AutoCodeStruct     `json:"requestMeta" gorm:"type:json;column:request;comment:前端传入的结构化信息"`
	Injection     AutoCodeInjections `json:"injection" gorm:"type:json;column:injection;comment:注入的内容结构体"`
	AutoCodePaths AutoCodePaths      `json:"autoCodePath" gorm:"type:json;column:auto_code_path;comment:其他meta信息 path;path"`
}

func (*AutoCodeHistory) TableName

func (a *AutoCodeHistory) TableName() string

type AutoCodeInjection

type AutoCodeInjection struct {
	Filepath       string `json:"filepath" gorm:"column:filepath;comment:注入的文件绝对路径"`
	CodeData       string `json:"codeData" gorm:"column:code_data;comment:注入代码"`
	StructName     string `json:"structName" gorm:"column:struct_name;comment:注入的结构体名"`
	FunctionName   string `json:"functionName" gorm:"column:function_name;comment:注入的函数名"`
	CodeDataFormat string `json:"codeDataFormat" gorm:"column:code_data_format;comment:注入代码带格式化"`
}

type AutoCodeInjections

type AutoCodeInjections []AutoCodeInjection

func (*AutoCodeInjections) Scan

func (a *AutoCodeInjections) Scan(value interface{}) error

Scan 扫描 Author [SliverHorn](https://github.com/SliverHorn)

func (AutoCodeInjections) Value

func (a AutoCodeInjections) Value() (driver.Value, error)

Value 值 Author [SliverHorn](https://github.com/SliverHorn)

type AutoCodePath

type AutoCodePath struct {
	Filepath string `json:"filepath"`
}

func (*AutoCodePath) RmFilePath

func (a *AutoCodePath) RmFilePath() string

type AutoCodePaths

type AutoCodePaths []AutoCodePath

func (*AutoCodePaths) Scan

func (a *AutoCodePaths) Scan(value interface{}) error

Scan 扫描 Author [SliverHorn](https://github.com/SliverHorn)

func (AutoCodePaths) Value

func (a AutoCodePaths) Value() (driver.Value, error)

Value 值 Author [SliverHorn](https://github.com/SliverHorn)

type AutoCodeStruct

type AutoCodeStruct struct {
	TableName          string   `json:"tableName"`          // 表名
	StructName         string   `json:"structName"`         // Struct名称
	PackageName        string   `json:"packageName"`        // 文件名称
	Description        string   `json:"description"`        // Struct中文名称
	Abbreviation       string   `json:"abbreviation"`       // Struct简称
	HumpPackageName    string   `json:"humpPackageName"`    // go文件名称
	AutoMoveFile       bool     `json:"autoMoveFile"`       // 是否自动移动文件
	AutoCreateApiToSql bool     `json:"autoCreateApiToSql"` // 是否自动创建api
	Fields             []*Field `json:"fields"`

	Injection []AutoCodeInjection `json:"-" gorm:"-"`
}

func (*AutoCodeStruct) GenerateInjection

func (a *AutoCodeStruct) GenerateInjection() []AutoCodeInjection

GenerateInjection 生成注入内容 Author [SliverHorn](https://github.com/SliverHorn)

func (*AutoCodeStruct) Scan

func (a *AutoCodeStruct) Scan(value interface{}) error

Scan 扫描 Author [SliverHorn](https://github.com/SliverHorn)

func (*AutoCodeStruct) TrimSpace

func (a *AutoCodeStruct) TrimSpace()

TrimSpace 结构体去空格 Author [SliverHorn](https://github.com/SliverHorn)

func (AutoCodeStruct) Value

func (a AutoCodeStruct) Value() (driver.Value, error)

Value 值 Author [SliverHorn](https://github.com/SliverHorn)

type Casbin

type Casbin struct {
	PType       string `gorm:"column:p_type"`
	AuthorityId string `gorm:"column:v0"`
	Path        string `gorm:"column:v1"`
	Method      string `gorm:"column:v2"`
}

func (*Casbin) BeforeCreate

func (c *Casbin) BeforeCreate(tx *gorm.DB) error

func (*Casbin) TableName

func (c *Casbin) TableName() string

type Dictionary

type Dictionary struct {
	global.Model
	Desc              string             `json:"desc" gorm:"column:desc;comment:描述"`
	Name              string             `json:"name" gorm:"column:name;comment:字典名(中)"`
	Type              string             `json:"type" gorm:"column:type;comment:字典名(英)"`
	Status            *bool              `json:"status" gorm:"column:status;comment:状态"`
	DictionaryDetails []DictionaryDetail `json:"sysDictionaryDetails"`
}

func (*Dictionary) TableName

func (s *Dictionary) TableName() string

type DictionaryDetail

type DictionaryDetail struct {
	global.Model
	Sort         int    `json:"sort" gorm:"column:sort;comment:排序标记"`
	Value        int    `json:"value" gorm:"column:value;comment:字典值"`
	Label        string `json:"label" gorm:"column:label;comment:展示值"`
	Status       *bool  `json:"status" gorm:"column:status;comment:启用状态"`
	DictionaryID int    `json:"sysDictionaryID" gorm:"column:dictionary_id;comment:关联标记"`
}

func (*DictionaryDetail) TableName

func (d *DictionaryDetail) TableName() string

type Field

type Field struct {
	FieldName       string `json:"fieldName"`       // Field名
	FieldDesc       string `json:"fieldDesc"`       // 中文名
	FieldType       string `json:"fieldType"`       // Field数据类型
	FieldJson       string `json:"fieldJson"`       // FieldJson
	DataType        string `json:"dataType"`        // 数据库字段类型
	DataTypeLong    string `json:"dataTypeLong"`    // 数据库字段长度
	Comment         string `json:"comment"`         // 数据库字段描述
	ColumnName      string `json:"columnName"`      // 数据库字段
	FieldSearchType string `json:"fieldSearchType"` // 搜索条件
	DictType        string `json:"dictType"`        // 字典
}

type JwtBlacklist

type JwtBlacklist struct {
	global.Model
	Jwt string `gorm:"type:text;comment:jwt"`
}

func (*JwtBlacklist) TableName

func (j *JwtBlacklist) TableName() string
type Menu struct {
	global.Model
	Sort        int    `json:"sort" gorm:"column:sort;comment:排序标记"`
	Hidden      bool   `json:"hidden" gorm:"column:hidden;comment:是否在列表隐藏"`
	MenuLevel   uint   `json:"-"`
	Path        string `json:"path" gorm:"column:path;comment:路由path"`
	Name        string `json:"name" gorm:"column:name;comment:路由name"`
	Component   string `json:"component" gorm:"column:component;comment:对应前端文件路径"`
	ParentId    string `json:"parentId" gorm:"column:parent_id;comment:父菜单ID"`
	Meta        `json:"meta" gorm:"comment:附加属性"`
	Children    []Menu          `json:"children" gorm:"-"`
	Parameters  []MenuParameter `` /* 139-byte string literal not displayed */
	Authorities []Authority     `` /* 145-byte string literal not displayed */
}
func (m *Menu) TableName() string
type MenuParameter struct {
	global.Model
	MenuID uint   `json:"menu_id,omitempty" gorm:"column:menu_id;comment:menu ID"` // menu ID
	Key    string `json:"key" gorm:"comment:地址栏携带参数的key"`                          // 地址栏携带参数的key
	Type   string `json:"type" gorm:"comment:地址栏携带参数为params还是query"`               // 地址栏携带参数为params还是query
	Value  string `json:"value" gorm:"comment:地址栏携带参数的值"`                          // 地址栏携带参数的值
}
func (m *MenuParameter) TableName() string

type Meta

type Meta struct {
	Icon        string `json:"icon" gorm:"column:icon;comment:菜单图标"`
	Title       string `json:"title" gorm:"column:title;comment:菜单名"`
	CloseTab    bool   `json:"closeTab" gorm:"column:close_tab;comment:自动关闭tab"`
	KeepAlive   bool   `json:"keepAlive" gorm:"column:keep_alive;comment:是否缓存"`
	DefaultMenu bool   `json:"defaultMenu" gorm:"column:default_menu;comment:是否是基础路由(开发中)"`
}

type OperationRecord

type OperationRecord struct {
	global.Model
	Status int `json:"status" gorm:"column:status;comment:请求状态"`
	UserID int `json:"user_id" gorm:"column:user_id;comment:用户id"`

	Ip           string        `json:"ip" gorm:"column:ip;comment:请求ip"`
	Path         string        `json:"path" gorm:"column:path;comment:请求路径"`
	Method       string        `json:"method" gorm:"column:method;comment:请求方法"`
	Agent        string        `json:"agent" gorm:"column:agent;comment:代理"`
	Latency      time.Duration `json:"latency" gorm:"column:latency;comment:延迟" swaggertype:"string"`
	Request      string        `json:"body" gorm:"type:text;column:request;comment:请求body"`
	Response     string        `json:"resp" gorm:"type:text;column:response;comment:响应Body"`
	ErrorMessage string        `json:"error_message" gorm:"column:error_message;comment:错误信息"`
	User         User          `json:"user"`
}

func (*OperationRecord) TableName

func (o *OperationRecord) TableName() string

type UseAuthority

type UseAuthority struct {
	UserId      uint   `gorm:"column:user_id"`
	AuthorityId string `gorm:"column:authority_id"`
}

func (*UseAuthority) TableName

func (s *UseAuthority) TableName() string

type User

type User struct {
	global.Model
	Uuid        string `json:"uuid" gorm:"comment:用户UUID"`                                                    // 用户UUID
	Avatar      string `json:"headerImg" gorm:"default:http://qmplusimg.henrongyi.top/head.png;comment:用户头像"` // 用户头像
	Username    string `json:"userName" gorm:"comment:用户登录名"`                                                 // 用户登录名
	Password    string `json:"-"  gorm:"comment:用户登录密码"`                                                      // 用户登录密码
	Nickname    string `json:"nickName" gorm:"default:系统用户;comment:用户昵称"`                                     // 用户昵称
	SideMode    string `json:"sideMode" gorm:"default:dark;comment:用户侧边主题"`                                   // 用户侧边主题
	BaseColor   string `json:"baseColor" gorm:"default:#fff;comment:基础颜色"`                                    // 基础颜色
	ActiveColor string `json:"activeColor" gorm:"default:#1890ff;comment:用户角色ID"`                             // 活跃颜色
	AuthorityId string `json:"authorityId" gorm:"default:888;comment:用户角色ID"`                                 // 用户角色ID

	Authority   Authority   `json:"authority" gorm:"foreignKey:AuthorityId;references:AuthorityId;comment:用户角色"`
	Authorities []Authority `` /* 146-byte string literal not displayed */
}

func (*User) CompareHashAndPassword

func (u *User) CompareHashAndPassword(password string) bool

CompareHashAndPassword 密码检查 false 校验失败, true 校验成功 Author [SliverHorn](https://github.com/SliverHorn)

func (*User) EncryptedPassword

func (u *User) EncryptedPassword() error

EncryptedPassword 加密密码 Author [SliverHorn](https://github.com/SliverHorn)

func (*User) TableName

func (u *User) TableName() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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