mirror of
https://github.com/flipped-aurora/gin-vue-admin.git
synced 2026-09-21 20:35:16 +00:00
调整角色ID为uint格式,增加embed打包,更改日志格式。 (#1144)
* feature: 根据 #377 pr进行修改embed, 打包静态文件夹与配置文件 * 修改角色id为uint * 修改日志格式 Co-authored-by: SliverHorn <503551462@qq.com> Co-authored-by: cg81344 <cg831344@126.com>
This commit is contained in:
committed by
GitHub
co-authored by
SliverHorn
cg81344
parent
cd68d1f198
commit
0610419e38
@@ -2,8 +2,8 @@ package request
|
||||
|
||||
// PageInfo Paging common input parameter structure
|
||||
type PageInfo struct {
|
||||
Page int `json:"page" form:"page"` // 页码
|
||||
PageSize int `json:"pageSize" form:"pageSize"` // 每页大小
|
||||
Page int `json:"page" form:"page"` // 页码
|
||||
PageSize int `json:"pageSize" form:"pageSize"` // 每页大小
|
||||
Keyword string `json:"keyword" form:"keyword"` //关键字
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ type IdsReq struct {
|
||||
|
||||
// GetAuthorityId Get role by id structure
|
||||
type GetAuthorityId struct {
|
||||
AuthorityId string `json:"authorityId" form:"authorityId"` // 角色ID
|
||||
AuthorityId uint `json:"authorityId" form:"authorityId"` // 角色ID
|
||||
}
|
||||
|
||||
type Empty struct{}
|
||||
|
||||
@@ -10,6 +10,6 @@ type ExaCustomer struct {
|
||||
CustomerName string `json:"customerName" form:"customerName" gorm:"comment:客户名"` // 客户名
|
||||
CustomerPhoneData string `json:"customerPhoneData" form:"customerPhoneData" gorm:"comment:客户手机号"` // 客户手机号
|
||||
SysUserID uint `json:"sysUserId" form:"sysUserId" gorm:"comment:管理ID"` // 管理ID
|
||||
SysUserAuthorityID string `json:"sysUserAuthorityID" form:"sysUserAuthorityID" gorm:"comment:管理角色ID"` // 管理角色ID
|
||||
SysUserAuthorityID uint `json:"sysUserAuthorityID" form:"sysUserAuthorityID" gorm:"comment:管理角色ID"` // 管理角色ID
|
||||
SysUser system.SysUser `json:"sysUser" form:"sysUser" gorm:"comment:管理详情"` // 管理详情
|
||||
}
|
||||
|
||||
@@ -17,5 +17,5 @@ type BaseClaims struct {
|
||||
ID uint
|
||||
Username string
|
||||
NickName string
|
||||
AuthorityId string
|
||||
AuthorityId uint
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ package request
|
||||
|
||||
type SysAuthorityBtnReq struct {
|
||||
MenuID uint `json:"menuID"`
|
||||
AuthorityId string `json:"authorityId"`
|
||||
AuthorityId uint `json:"authorityId"`
|
||||
Selected []uint `json:"selected"`
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ type CasbinInfo struct {
|
||||
|
||||
// Casbin structure for input parameters
|
||||
type CasbinInReceive struct {
|
||||
AuthorityId string `json:"authorityId"` // 权限id
|
||||
AuthorityId uint `json:"authorityId"` // 权限id
|
||||
CasbinInfos []CasbinInfo `json:"casbinInfos"`
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
// Add menu authority info structure
|
||||
type AddMenuAuthorityInfo struct {
|
||||
Menus []system.SysBaseMenu `json:"menus"`
|
||||
AuthorityId string `json:"authorityId"` // 角色ID
|
||||
AuthorityId uint `json:"authorityId"` // 角色ID
|
||||
}
|
||||
|
||||
func DefaultMenu() []system.SysBaseMenu {
|
||||
|
||||
@@ -4,13 +4,13 @@ import model "github.com/flipped-aurora/gin-vue-admin/server/model/system"
|
||||
|
||||
// User register structure
|
||||
type Register struct {
|
||||
Username string `json:"userName"`
|
||||
Password string `json:"passWord"`
|
||||
NickName string `json:"nickName" gorm:"default:'QMPlusUser'"`
|
||||
HeaderImg string `json:"headerImg" gorm:"default:'https://qmplusimg.henrongyi.top/gva_header.jpg'"`
|
||||
AuthorityId string `json:"authorityId" gorm:"default:888"`
|
||||
Enable int `json:"enable"`
|
||||
AuthorityIds []string `json:"authorityIds"`
|
||||
Username string `json:"userName"`
|
||||
Password string `json:"passWord"`
|
||||
NickName string `json:"nickName" gorm:"default:'QMPlusUser'"`
|
||||
HeaderImg string `json:"headerImg" gorm:"default:'https://qmplusimg.henrongyi.top/gva_header.jpg'"`
|
||||
AuthorityId uint `json:"authorityId" gorm:"default:888"`
|
||||
Enable int `json:"enable"`
|
||||
AuthorityIds []uint `json:"authorityIds"`
|
||||
}
|
||||
|
||||
// User login structure
|
||||
@@ -30,20 +30,20 @@ type ChangePasswordStruct struct {
|
||||
|
||||
// Modify user's auth structure
|
||||
type SetUserAuth struct {
|
||||
AuthorityId string `json:"authorityId"` // 角色ID
|
||||
AuthorityId uint `json:"authorityId"` // 角色ID
|
||||
}
|
||||
|
||||
// Modify user's auth structure
|
||||
type SetUserAuthorities struct {
|
||||
ID uint
|
||||
AuthorityIds []string `json:"authorityIds"` // 角色ID
|
||||
AuthorityIds []uint `json:"authorityIds"` // 角色ID
|
||||
}
|
||||
|
||||
type ChangeUserInfo struct {
|
||||
ID uint `gorm:"primarykey"` // 主键ID
|
||||
NickName string `json:"nickName" gorm:"default:系统用户;comment:用户昵称"` // 用户昵称
|
||||
Phone string `json:"phone" gorm:"comment:用户手机号"` // 用户角色ID
|
||||
AuthorityIds []string `json:"authorityIds" gorm:"-"` // 角色ID
|
||||
AuthorityIds []uint `json:"authorityIds" gorm:"-"` // 角色ID
|
||||
Email string `json:"email" gorm:"comment:用户邮箱"` // 用户邮箱
|
||||
HeaderImg string `json:"headerImg" gorm:"default:https://qmplusimg.henrongyi.top/gva_header.jpg;comment:用户头像"` // 用户头像
|
||||
SideMode string `json:"sideMode" gorm:"comment:用户侧边主题"` // 用户侧边主题
|
||||
|
||||
@@ -8,5 +8,5 @@ type SysAuthorityResponse struct {
|
||||
|
||||
type SysAuthorityCopyResponse struct {
|
||||
Authority system.SysAuthority `json:"authority"`
|
||||
OldAuthorityId string `json:"oldAuthorityId"` // 旧角色ID
|
||||
OldAuthorityId uint `json:"oldAuthorityId"` // 旧角色ID
|
||||
}
|
||||
|
||||
@@ -8,9 +8,9 @@ type SysAuthority struct {
|
||||
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
|
||||
AuthorityId uint `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
|
||||
ParentId uint `json:"parentId" gorm:"comment:父角色ID"` // 父角色ID
|
||||
DataAuthorityId []*SysAuthority `json:"dataAuthorityId" gorm:"many2many:sys_data_authority_id;"`
|
||||
Children []SysAuthority `json:"children" gorm:"-"`
|
||||
SysBaseMenus []SysBaseMenu `json:"menus" gorm:"many2many:sys_authority_menus;"`
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package system
|
||||
|
||||
type SysAuthorityBtn struct {
|
||||
AuthorityId string `gorm:"comment:角色ID"`
|
||||
AuthorityId uint `gorm:"comment:角色ID"`
|
||||
SysMenuID uint `gorm:"comment:菜单ID"`
|
||||
SysBaseMenuBtnID uint `gorm:"comment:菜单按钮ID"`
|
||||
SysBaseMenuBtn SysBaseMenuBtn ` gorm:"comment:按钮详情"`
|
||||
|
||||
@@ -3,10 +3,10 @@ package system
|
||||
type SysMenu struct {
|
||||
SysBaseMenu
|
||||
MenuId string `json:"menuId" gorm:"comment:菜单ID"`
|
||||
AuthorityId string `json:"-" gorm:"comment:角色ID"`
|
||||
AuthorityId uint `json:"-" gorm:"comment:角色ID"`
|
||||
Children []SysMenu `json:"children" gorm:"-"`
|
||||
Parameters []SysBaseMenuParameter `json:"parameters" gorm:"foreignKey:SysBaseMenuID;references:MenuId"`
|
||||
Btns map[string]string `json:"btns" gorm:"-"`
|
||||
Btns map[string]uint `json:"btns" gorm:"-"`
|
||||
}
|
||||
|
||||
type SysAuthorityMenu struct {
|
||||
|
||||
@@ -15,7 +15,7 @@ type SysUser struct {
|
||||
HeaderImg string `json:"headerImg" gorm:"default:https://qmplusimg.henrongyi.top/gva_header.jpg;comment:用户头像"` // 用户头像
|
||||
BaseColor string `json:"baseColor" gorm:"default:#fff;comment:基础颜色"` // 基础颜色
|
||||
ActiveColor string `json:"activeColor" gorm:"default:#1890ff;comment:活跃颜色"` // 活跃颜色
|
||||
AuthorityId string `json:"authorityId" gorm:"default:888;comment:用户角色ID"` // 用户角色ID
|
||||
AuthorityId uint `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;"`
|
||||
Phone string `json:"phone" gorm:"comment:用户手机号"` // 用户手机号
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package system
|
||||
|
||||
type SysUseAuthority struct {
|
||||
SysUserId uint `gorm:"column:sys_user_id"`
|
||||
SysAuthorityAuthorityId string `gorm:"column:sys_authority_authority_id"`
|
||||
SysUserId uint `gorm:"column:sys_user_id"`
|
||||
SysAuthorityAuthorityId uint `gorm:"column:sys_authority_authority_id"`
|
||||
}
|
||||
|
||||
func (s *SysUseAuthority) TableName() string {
|
||||
|
||||
Reference in New Issue
Block a user