model

package
v0.0.0-...-22bb83e Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorAutoMove = errors.New("创建代码成功并移动文件成功")

Functions

This section is empty.

Types

type Admin

type Admin struct {
	global.Model
	Uuid        string    `orm:"uuid" json:"uuid" gorm:"comment:用户UUID"`
	Avatar      string    `orm:"avatar" json:"headerImg" gorm:"default:http://qmplusimg.henrongyi.top/head.png;comment:用户头像"`
	Nickname    string    `orm:"nickname" json:"nickName" gorm:"comment:用户登录名"`
	Username    string    `orm:"username" json:"userName" gorm:"default:系统用户;comment:用户昵称" `
	Password    string    `orm:"password" json:"-" gorm:"comment:用户登录密码"`
	AuthorityId string    `orm:"authority_id" json:"authorityId" gorm:"default:888;comment:用户角色ID"`
	Authority   Authority `orm:"-" json:"authority" gorm:"foreignKey:AuthorityId;references:AuthorityId;comment:用户角色"`
}

func (*Admin) CompareHashAndPassword

func (a *Admin) CompareHashAndPassword(password string) bool

@author: SliverHorn @description: 密码检查(工具类) @return: bool(false 校验失败, true 校验成功)

func (*Admin) EncryptedPassword

func (a *Admin) EncryptedPassword() error

@author: SliverHorn @description: 加密密码(工具类)

func (*Admin) TableName

func (a *Admin) TableName() string

type Api

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

func (*Api) TableName

func (a *Api) TableName() string

type AuthoritiesMenus

type AuthoritiesMenus struct {
	MenuId      uint   `orm:"menu_id"`
	AuthorityId string `orm:"authority_id"`
}

func (*AuthoritiesMenus) TableName

func (a *AuthoritiesMenus) TableName() string

type Authority

type Authority struct {
	CreatedAt time.Time      `orm:"created_at" json:"CreatedAt"`
	UpdatedAt time.Time      `orm:"updated_at" json:"UpdatedAt"`
	DeletedAt gorm.DeletedAt `orm:"deleted_at" json:"-" gorm:"index"`

	ParentId      string `orm:"parent_id" json:"parentId" gorm:"comment:父角色ID"`
	AuthorityId   string `orm:"authority_id" json:"authorityId" gorm:"not null;unique;primary_key;comment:角色ID;size:90"`
	AuthorityName string `orm:"authority_name" json:"authorityName" gorm:"comment:角色名"`
	DefaultRouter string `orm:"default_router" json:"defaultRouter" gorm:"comment:默认菜单;default:dashboard"`

	Menus         []Menu      `` /* 141-byte string literal not displayed */
	Children      []Authority `orm:"-" json:"children" gorm:"-"`
	DataAuthority []Authority `` /* 166-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:SysBaseMenuID;references:MenuId"`
}

func (*AuthorityMenu) TableName

func (a *AuthorityMenu) TableName() string

type AutoCode

type AutoCode struct {
	TableName          string  `p:"tableName" json:"tableName"`
	StructName         string  `p:"structName" json:"structName"`
	PackageName        string  `p:"packageName" json:"packageName"`
	Description        string  `p:"description" json:"description"`
	Abbreviation       string  `p:"abbreviation" json:"abbreviation"`
	AutoMoveFile       bool    `p:"autoMoveFile" json:"autoMoveFile"`
	AutoCreateApiToSql bool    `p:"autoCreateApiToSql" json:"autoCreateApiToSql"`
	Fields             []Field `p:"fields" json:"fields"`
}

type Casbin

type Casbin struct {
	Path        string `orm:"v1" json:"path" gorm:"column:v1"`
	PType       string `orm:"p_type" json:"ptype" gorm:"column:p_type"`
	Method      string `orm:"v2" json:"method" gorm:"column:v2"`
	AuthorityId string `orm:"v0" json:"rolename" gorm:"column:v0"`
}

func (*Casbin) TableName

func (c *Casbin) TableName() string

type DataAuthorities

type DataAuthorities struct {
	AuthorityId   string `orm:"authority_id" gorm:"comment:角色id"`
	DataAuthority string `orm:"data_authority" gorm:"comment:资源id"`
}

func (*DataAuthorities) TableName

func (d *DataAuthorities) TableName() string

type Dictionary

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

func (*Dictionary) TableName

func (d *Dictionary) TableName() string

type DictionaryDetail

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

func (*DictionaryDetail) TableName

func (d *DictionaryDetail) TableName() string

type Field

type Field struct {
	Comment         string `p:"comment" json:"comment"`
	DataType        string `p:"dataType" json:"dataType"`
	DictType        string `p:"dictType" json:"dictType"`
	FieldName       string `p:"fieldName" json:"fieldName"`
	FieldDesc       string `p:"fieldDesc" json:"fieldDesc"`
	FieldType       string `p:"fieldType" json:"fieldType"`
	FieldJson       string `p:"fieldJson" json:"fieldJson"`
	ColumnName      string `p:"columnName" json:"columnName"`
	DataTypeLong    string `p:"dataTypeLong" json:"dataTypeLong"`
	FieldSearchType string `p:"fieldSearchType" json:"fieldSearchType"`
}

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
	Path      string `json:"path" gorm:"comment:路由path"`
	Name      string `json:"name" gorm:"comment:路由name"`
	ParentId  string `json:"parentId" gorm:"comment:父菜单ID"`
	Component string `json:"component" gorm:"comment:对应前端文件路径"`
	Sort      int    `json:"sort" gorm:"comment:排序标记"`
	MenuLevel uint   `json:"-"`
	Hidden    bool   `json:"hidden" gorm:"comment:是否在列表隐藏"`

	Meta `json:"meta" gorm:"comment:附加属性"`

	Children    []Menu          `orm:"-" json:"children" gorm:"-"`
	Parameters  []MenuParameter `` /* 140-byte string literal not displayed */
	Authorities []Authority     `` /* 146-byte string literal not displayed */
}
func (b *Menu) TableName() string
type MenuParameter struct {
	global.Model
	Key    string `orm:"key" json:"key" gorm:"comment:地址栏携带参数的key"`
	Type   string `orm:"type" json:"type" gorm:"comment:地址栏携带参数为params还是query"`
	Value  string `orm:"value" json:"value" gorm:"comment:地址栏携带参数的值"`
	MenuID uint   `orm:"menu_id" json:"menuId" gorm:"comment:menu的id"`
}
func (b *MenuParameter) TableName() string
type MenusParameters struct {
	MenuId      uint
	ParameterId uint
}
func (m *MenusParameters) TableName() string

type Meta

type Meta struct {
	KeepAlive   bool   `json:"keepAlive" gorm:"comment:是否缓存"`
	DefaultMenu bool   `json:"defaultMenu" gorm:"comment:是否是基础路由(开发中)"`
	Icon        string `json:"icon" gorm:"comment:菜单图标"`
	Title       string `json:"title" gorm:"comment:菜单名"`
}

type OperationRecord

type OperationRecord struct {
	global.Model
	Ip           string `json:"ip" form:"ip" gorm:"column:ip;comment:请求ip"`
	Path         string `json:"path" form:"path" gorm:"column:path;comment:请求路径"`
	Agent        string `json:"agent" form:"agent" gorm:"column:agent;comment:代理"`
	Method       string `json:"method" form:"method" gorm:"column:method;comment:请求方法"`
	Request      string `json:"body" form:"body" gorm:"type:longtext;column:body;comment:请求Body"`
	Response     string `json:"resp" form:"resp" gorm:"type:longtext;column:resp;comment:响应Body"`
	ErrorMessage string `json:"error_message" form:"error_message" gorm:"column:error_message;comment:错误信息"`

	Status  int   `json:"status" form:"status" gorm:"column:status;comment:请求状态"`
	UserID  int   `json:"user_id" form:"user_id" gorm:"column:user_id;comment:用户id"`
	Latency int64 `json:"latency" form:"latency" gorm:"column:latency;comment:延迟"`

	Admin Admin `orm:"-" json:"user" gorm:"foreignkey:ID;references:UserID"`
}

func (*OperationRecord) TableName

func (o *OperationRecord) TableName() string

type TemplateData

type TemplateData struct {
	Template         *template.Template
	LocationPath     string // 模板位置路径
	AutoCodePath     string // 生成代码文件路径
	AutoMoveFilePath string // 移动代码路径
}

Jump to

Keyboard shortcuts

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