system

package
v0.0.0-...-38e5134 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package system @program: arco-design-pro-gin @author: [lliuhuan](https://github.com/lliuhuan) @create: 2021-12-14 10:34 @desc: api表

Package system @program: arco-design-pro-gin @author: [lliuhuan](https://github.com/lliuhuan) @create: 2021-12-14 10:34 @desc: 角色表

Package system @program: arco-design-pro-gin @author: [lliuhuan](https://github.com/lliuhuan) @create: 2021-12-10 17:59 @desc: 角色菜单关联视图

Package system @program: arco-design-pro-gin @author: [lliuhuan](https://github.com/lliuhuan) @create: 2021-12-10 17:59 @desc: 菜单表

Package system @program: arco-design-pro-gin @author: [lliuhuan](https://github.com/lliuhuan) @create: 2021-12-10 17:59 @desc: casbin api鉴权表

Package system @program: arco-design-pro-gin @author: [lliuhuan](https://github.com/lliuhuan) @create: 2021-12-14 10:47 @desc: 字典表

Package system @program: arco-design-pro-gin @author: [lliuhuan](https://github.com/lliuhuan) @create: 2021-12-14 10:48 @desc: 字典详情表

Package system @program: arco-design-pro-gin @author: [lliuhuan](https://github.com/lliuhuan) @create: 2021-12-14 10:22 @desc: 初始化数据表

Package system @program: arco-design-pro-gin @author: [lliuhuan](https://github.com/lliuhuan) @create: 2021-12-14 10:22 @desc: token 黑名单表

Package system @program: arco-design-pro-gin @author: [lliuhuan](https://github.com/lliuhuan) @create: 2021-12-14 10:22 @desc: 记录接口请求信息

Package system @program: arco-design-pro-gin @author: [lliuhuan](https://github.com/lliuhuan) @create: 2021-12-14 10:22 @desc: 用户表

Package system @program: arco-design-pro-gin @author: [lliuhuan](https://github.com/lliuhuan) @create: 2021-12-10 17:49 @desc: 用户角色关联表

Index

Constants

View Source
const (
	Mysql           = "mysql"
	Pgsql           = "pgsql"
	InitSuccess     = "\n[%v] --> 初始数据成功!\n"
	AuthorityMenu   = "\n[%v] --> %v 视图已存在!\n"
	InitDataExist   = "\n[%v] --> %v 表的初始数据已存在!\n"
	InitDataFailed  = "\n[%v] --> %v 表初始数据失败! \nerr: %+v\n"
	InitDataSuccess = "\n[%v] --> %v 表初始数据成功!\n"
)

Variables

This section is empty.

Functions

func MysqlDataInitialize

func MysqlDataInitialize(inits ...InitData) error

MysqlDataInitialize Mysql 初始化接口使用封装 @author: [lliuhuan](https://github.com/lliuhuan)

Types

type CasbinModel

type CasbinModel struct {
	Ptype       string `json:"ptype" gorm:"column:ptype"`
	AuthorityId string `json:"rolename" gorm:"column:v0"`
	Path        string `json:"path" gorm:"column:v1"`
	Method      string `json:"method" gorm:"column:v2"`
}

type InitDBFunc

type InitDBFunc interface {
	Init() (err error)
}

type InitData

type InitData interface {
	TableName() string
	Initialize() error
	CheckDataExist() bool
}

type JwtBlacklist

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

type Meta

type Meta struct {
	Hidden      bool   `json:"hidden" gorm:"comment:是否在列表隐藏"`           // 是否在列表隐藏
	KeepAlive   bool   `json:"keepAlive" gorm:"comment:是否缓存"`           // 是否缓存
	DefaultMenu bool   `json:"defaultMenu" gorm:"comment:是否是基础路由(开发中)"` // 是否是基础路由(开发中)
	Title       string `json:"title" gorm:"comment:菜单名"`                // 菜单名
	Icon        string `json:"icon" gorm:"comment:菜单图标"`                // 菜单图标
	CloseTab    bool   `json:"closeTab" gorm:"comment:自动关闭tab"`         // 自动关闭tab
	Permissions string `json:"permissions" gorm:"comment:路由权限标识"`       // 路由权限标识
}

type SysApi

type SysApi struct {
	global.AdpModel
	Path        string `json:"path" gorm:"comment:api路径"`             // api路径
	Description string `json:"description" gorm:"comment:api中文描述"`    // api中文描述
	ApiGroup    string `json:"apiGroup" gorm:"comment:api组"`          // api组
	Method      string `json:"method" gorm:"default:POST;comment:方法"` // 方法:创建POST(默认)|查看GET|更新PUT|删除DELETE
}

type SysAuthority

type SysAuthority struct {
	Key             string         `json:"key" gorm:"-"`
	CreatedAt       time.Time      // 创建时间
	UpdatedAt       time.Time      // 更新时间
	DeletedAt       *time.Time     `sql:"index"`
	AuthorityId     string         `json:"authorityId" gorm:"not null;unique;primary_key;comment:角色ID;size:90"` // 角色ID
	AuthorityName   string         `json:"authorityName" gorm:"comment:角色名"`                                    // 角色名
	ParentId        string         `json:"parentId" gorm:"comment:父角色ID"`                                       // 父角色ID
	DataAuthorityId []SysAuthority `json:"dataAuthorityId" gorm:"many2many:sys_data_authority_id"`
	Children        []SysAuthority `json:"children,omitempty" gorm:"-"`
	SysBaseMenus    []SysBaseMenu  `json:"menus" gorm:"many2many:sys_authority_menus;"`
	DefaultRouter   string         `json:"defaultRouter" gorm:"comment:默认菜单;default:dashboard"` // 默认菜单(默认dashboard)
}

type SysBaseMenu

type SysBaseMenu struct {
	global.AdpModel
	MenuLevel     uint                              `json:"-"`
	ParentId      string                            `json:"parentId" gorm:"comment:父菜单ID"`     // 父菜单ID
	Path          string                            `json:"path" gorm:"comment:路由path"`        // 路由path
	Name          string                            `json:"name" gorm:"comment:路由name"`        // 路由name
	Component     string                            `json:"component" gorm:"comment:对应前端文件路径"` // 对应前端文件路径
	Sort          int                               `json:"sort" gorm:"comment:排序标记"`          // 排序标记
	Redirect      string                            `json:"redirect" gorm:"comment:重定向"`       // 重定向
	Meta          `json:"meta" gorm:"comment:附加属性"` // 附加属性
	MenuType      uint8                             `json:"menu_type" gorm:"comment:路由类型"` // 路由类型
	SysAuthoritys []SysAuthority                    `json:"authoritys" gorm:"many2many:sys_authority_menus;"`
	Children      []SysBaseMenu                     `json:"children" gorm:"-"`
}

type SysBaseMenuParameter

type SysBaseMenuParameter struct {
	global.AdpModel
	SysBaseMenuID uint
	Type          string `json:"type" gorm:"comment:地址栏携带参数为params还是query"` // 地址栏携带参数为params还是query
	Key           string `json:"key" gorm:"comment:地址栏携带参数的key"`            // 地址栏携带参数的key
	Value         string `json:"value" gorm:"comment:地址栏携带参数的值"`            // 地址栏携带参数的值
}

type SysDictionary

type SysDictionary struct {
	global.AdpModel
	Name                 string                `json:"name" form:"name" gorm:"column:name;comment:字典名(中)"`   // 字典名(中)
	Type                 string                `json:"type" form:"type" gorm:"column:type;comment:字典名(英)"`   // 字典名(英)
	Status               *bool                 `json:"status" form:"status" gorm:"column:status;comment:状态"` // 状态
	Desc                 string                `json:"desc" form:"desc" gorm:"column:desc;comment:描述"`       // 描述
	SysDictionaryDetails []SysDictionaryDetail `json:"sysDictionaryDetails" form:"sysDictionaryDetails"`
}

如果含有time.Time 请自行import time包

type SysDictionaryDetail

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

如果含有time.Time 请自行import time包

type SysMenu

type SysMenu struct {
	SysBaseMenu
	MenuId      string    `json:"menuId" gorm:"comment:菜单ID"`
	AuthorityId string    `json:"-" gorm:"comment:角色ID"`
	Children    []SysMenu `json:"children" gorm:"-"`
}

func (SysMenu) TableName

func (s SysMenu) TableName() string

type SysOperationRecord

type SysOperationRecord struct {
	global.AdpModel
	Ip           string        `json:"ip" form:"ip" gorm:"column:ip;comment:请求ip"`                                   // 请求ip
	Method       string        `json:"method" form:"method" gorm:"column:method;comment:请求方法"`                       // 请求方法
	Path         string        `json:"path" form:"path" gorm:"column:path;comment:请求路径"`                             // 请求路径
	Status       int           `json:"status" form:"status" gorm:"column:status;comment:请求状态"`                       // 请求状态
	Latency      time.Duration `json:"latency" form:"latency" gorm:"column:latency;comment:延迟" swaggertype:"string"` // 延迟
	Agent        string        `json:"agent" form:"agent" gorm:"column:agent;comment:代理"`                            // 代理
	ErrorMessage string        `json:"error_message" form:"error_message" gorm:"column:error_message;comment:错误信息"`  // 错误信息
	Body         string        `json:"body" form:"body" gorm:"type:text;column:body;comment:请求Body"`                 // 请求Body
	Resp         string        `json:"resp" form:"resp" gorm:"type:text;column:resp;comment:响应Body"`                 // 响应Body
	UserID       int           `json:"user_id" form:"user_id" gorm:"column:user_id;comment:用户id"`                    // 用户id
	User         SysUser       `json:"user"`
}

SysOperationRecord 接口请求信息 如果含有time.Time 请自行import time包

type SysUseAuthority

type SysUseAuthority struct {
	SysUserId               uint   `gorm:"column:sys_user_id"`
	SysAuthorityAuthorityId string `gorm:"column:sys_authority_authority_id"`
}

func (*SysUseAuthority) TableName

func (s *SysUseAuthority) TableName() string

type SysUser

type SysUser struct {
	global.AdpModel
	UUID        uuid.UUID      `json:"uuid" gorm:"comment:用户UUID"`                                                           // 用户UUID
	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:用户主题"`                                            // 用户侧边主题
	HeaderImg   string         `json:"headerImg" gorm:"default:https://qmplusimg.henrongyi.top/gva_header.jpg;comment:用户头像"` // 用户头像
	BaseColor   string         `json:"baseColor" gorm:"default:5, 160, 69;comment:基础颜色"`                                     // 基础颜色
	ActiveColor string         `json:"activeColor" gorm:"default:#1890ff;comment:活跃颜色"`                                      // 活跃颜色
	Language    string         `json:"language" gorm:"default:zh-CN;commit:用户语言"`
	AuthorityId string         `json:"authorityId" gorm:"default:888;comment:用户角色ID"` // 用户角色ID
	Authority   SysAuthority   `json:"authority" gorm:"foreignKey:AuthorityId;references:AuthorityId;comment:用户角色"`
	Authorities []SysAuthority `json:"authorities" gorm:"many2many:sys_user_authority;"`
	Permissions []string       `json:"permissions" gorm:"-"`
}

Directories

Path Synopsis
Package request @program: arco-design-pro-gin @author: [lliuhuan](https://github.com/lliuhuan) @create: 2022-01-09 21:38
Package request @program: arco-design-pro-gin @author: [lliuhuan](https://github.com/lliuhuan) @create: 2022-01-09 21:38
Package response @program: arco-design-pro-gin @author: [lliuhuan](https://github.com/lliuhuan) @create: 2021-12-10 17:38
Package response @program: arco-design-pro-gin @author: [lliuhuan](https://github.com/lliuhuan) @create: 2021-12-10 17:38

Jump to

Keyboard shortcuts

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