mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 02:48:34 +08:00
项目目录优化,任务模块后端代码
This commit is contained in:
11
apps/system/entity/api.go
Normal file
11
apps/system/entity/api.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package entity
|
||||
|
||||
import "pandax/base/model"
|
||||
|
||||
type SysApi struct {
|
||||
model.BaseAutoModel
|
||||
Path string `json:"path" gorm:"comment:api路径" binding:"required"` // api路径
|
||||
Description string `json:"description" gorm:"comment:api中文描述"` // api中文描述
|
||||
ApiGroup string `json:"apiGroup" gorm:"comment:api组"` // api组
|
||||
Method string `json:"method" gorm:"comment:方法"` // 方法:创建POST(默认)|查看GET|更新PUT|删除DELETE
|
||||
}
|
||||
14
apps/system/entity/config.go
Normal file
14
apps/system/entity/config.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package entity
|
||||
|
||||
import "pandax/base/model"
|
||||
|
||||
type SysConfig struct {
|
||||
ConfigId int64 `json:"configId" gorm:"primaryKey;AUTO_INCREMENT;comment:主键编码"`
|
||||
ConfigName string `json:"configName" gorm:"type:varchar(128);comment:ConfigName"`
|
||||
ConfigKey string `json:"configKey" gorm:"type:varchar(128);comment:ConfigKey"`
|
||||
ConfigValue string `json:"configValue" gorm:"type:varchar(255);comment:ConfigValue"`
|
||||
ConfigType string `json:"configType" gorm:"type:varchar(64);comment:是否系统内置0,1"`
|
||||
IsFrontend int `json:"isFrontend" gorm:"type:varchar(64);comment:是否前台"`
|
||||
Remark string `json:"remark" gorm:"type:varchar(128);comment:Remark"`
|
||||
model.BaseModel
|
||||
}
|
||||
25
apps/system/entity/dept.go
Normal file
25
apps/system/entity/dept.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package entity
|
||||
|
||||
import "pandax/base/model"
|
||||
|
||||
type SysDept struct {
|
||||
DeptId int64 `json:"deptId" gorm:"primary_key;AUTO_INCREMENT"` //部门编码
|
||||
ParentId int64 `json:"parentId" gorm:"type:int(11);comment:上级部门"`
|
||||
DeptPath string `json:"deptPath" gorm:"type:varchar(255);comment:部门路径"`
|
||||
DeptName string `json:"deptName" gorm:"type:varchar(128);comment:部门名称"`
|
||||
Sort int64 `json:"sort" gorm:"type:int(4);comment:排序"`
|
||||
Leader string `json:"leader" gorm:"type:varchar(64);comment:负责人"` // userId
|
||||
Phone string `json:"phone" gorm:"type:varchar(11);comment:手机"`
|
||||
Email string `json:"email" gorm:"type:varchar(64);comment:邮箱"`
|
||||
Status string `json:"status" gorm:"type:varchar(1);comment:状态"`
|
||||
CreateBy string `json:"createBy" gorm:"type:varchar(64);comment:创建人"`
|
||||
UpdateBy string `json:"updateBy" gorm:"type:varchar(64);comment:修改人"`
|
||||
Children []SysDept `json:"children" gorm:"-"`
|
||||
model.BaseModel
|
||||
}
|
||||
|
||||
type DeptLable struct {
|
||||
DeptId int64 `gorm:"-" json:"deptId"`
|
||||
DeptName string `gorm:"-" json:"deptName"`
|
||||
Children []DeptLable `gorm:"-" json:"children"`
|
||||
}
|
||||
30
apps/system/entity/dict.go
Normal file
30
apps/system/entity/dict.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package entity
|
||||
|
||||
import "pandax/base/model"
|
||||
|
||||
type SysDictData struct {
|
||||
DictCode int64 `json:"dictCode" gorm:"primary_key;AUTO_INCREMENT"`
|
||||
DictSort int `json:"dictSort" gorm:"type:int(11);comment:排序"`
|
||||
DictLabel string `json:"dictLabel" gorm:"type:varchar(64);comment:标签"`
|
||||
DictValue string `json:"dictValue" gorm:"type:varchar(64);comment:值"`
|
||||
DictType string `json:"dictType" gorm:"type:varchar(64);comment:字典类型"`
|
||||
Status string `json:"status" gorm:"type:varchar(1);comment:状态(0正常 1停用)"`
|
||||
CssClass string `json:"cssClass" gorm:"type:varchar(128);comment:CssClass"`
|
||||
ListClass string `json:"listClass" gorm:"type:varchar(128);comment:ListClass"`
|
||||
IsDefault string `json:"isDefault" gorm:"type:varchar(8);comment:IsDefault"`
|
||||
CreateBy string `json:"createBy"`
|
||||
UpdateBy string `json:"updateBy"`
|
||||
Remark string `json:"remark" gorm:"type:varchar(256);comment:备注"`
|
||||
model.BaseModel
|
||||
}
|
||||
|
||||
type SysDictType struct {
|
||||
DictId int64 `json:"dictId" gorm:"primary_key;AUTO_INCREMENT"`
|
||||
DictName string `json:"dictName" gorm:"type:varchar(64);comment:名称"`
|
||||
DictType string `json:"dictType" gorm:"type:varchar(64);comment:类型"`
|
||||
Status string `json:"status" gorm:"type:varchar(1);comment:状态"`
|
||||
CreateBy string `json:"createBy"`
|
||||
UpdateBy string `json:"updateBy"`
|
||||
Remark string `json:"remark" gorm:"type:varchar(256);comment:备注"`
|
||||
model.BaseModel
|
||||
}
|
||||
38
apps/system/entity/menu.go
Normal file
38
apps/system/entity/menu.go
Normal file
@@ -0,0 +1,38 @@
|
||||
package entity
|
||||
|
||||
import "pandax/base/model"
|
||||
|
||||
type SysMenu struct {
|
||||
MenuId int64 `json:"menuId" gorm:"primary_key;AUTO_INCREMENT"`
|
||||
MenuName string `json:"menuName" gorm:"type:varchar(128);"`
|
||||
Title string `json:"title" gorm:"type:varchar(64);"`
|
||||
ParentId int64 `json:"parentId" gorm:"type:int(11);"`
|
||||
Sort int64 `json:"sort" gorm:"type:int(4);"`
|
||||
Icon string `json:"icon" gorm:"type:varchar(128);"`
|
||||
Path string `json:"path" gorm:"type:varchar(128);"`
|
||||
Component string `json:"component" gorm:"type:varchar(255);"` // 组件路径
|
||||
IsFrame string `json:"isFrame" gorm:"type:varchar(1);"` //是否为外链
|
||||
IsLink string `json:"isLink" gorm:"type:varchar(11);"` //是否超链接菜单
|
||||
MenuType string `json:"menuType" gorm:"type:varchar(1);"` //菜单类型(M目录 C菜单 F按钮)
|
||||
IsHide string `json:"isHide" gorm:"type:varchar(1);"` //显示状态(0显示 1隐藏)
|
||||
IsKeepAlive string `json:"isKeepAlive" gorm:"type:varchar(1);"` //是否缓存组件状态(0是 1否)
|
||||
IsAffix string `json:"isAffix" gorm:"type:varchar(1);"` //是否固定在 tagsView 栏上(0是 1否)
|
||||
Permission string `json:"permission" gorm:"type:varchar(32);"` //权限标识
|
||||
Status string `json:"status" gorm:"type:varchar(1);` // 菜单状态(0正常 1停用)
|
||||
CreateBy string `json:"createBy" gorm:"type:varchar(128);"`
|
||||
UpdateBy string `json:"updateBy" gorm:"type:varchar(128);"`
|
||||
Remark string `json:"remark" gorm:"type:varchar(256);` // 备注
|
||||
Children []SysMenu `json:"children" gorm:"-"`
|
||||
model.BaseModel
|
||||
}
|
||||
|
||||
type MenuLable struct {
|
||||
MenuId int64 `json:"menuId" gorm:"-"`
|
||||
MenuName string `json:"menuName" gorm:"-"`
|
||||
Children []MenuLable `json:"children" gorm:"-"`
|
||||
}
|
||||
|
||||
type MenuRole struct {
|
||||
SysMenu
|
||||
IsSelect bool `json:"is_select" gorm:"-"`
|
||||
}
|
||||
15
apps/system/entity/post.go
Normal file
15
apps/system/entity/post.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package entity
|
||||
|
||||
import "pandax/base/model"
|
||||
|
||||
type SysPost struct {
|
||||
PostId int64 `gorm:"primary_key;AUTO_INCREMENT" json:"postId"`
|
||||
PostName string `gorm:"type:varchar(128);comment:岗位名称" json:"postName"`
|
||||
PostCode string `gorm:"type:varchar(128);comment:岗位代码" json:"postCode"`
|
||||
Sort int64 `gorm:"type:int(4);comment:岗位排序" json:"sort"`
|
||||
Status string `gorm:"type:varchar(1);comment:状态" json:"status"`
|
||||
Remark string `gorm:"type:varchar(255);comment:描述" json:"remark"`
|
||||
CreateBy string `gorm:"type:varchar(128);" json:"createBy"`
|
||||
UpdateBy string `gorm:"type:varchar(128);" json:"updateBy"`
|
||||
model.BaseModel
|
||||
}
|
||||
31
apps/system/entity/role.go
Normal file
31
apps/system/entity/role.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"pandax/base/casbin"
|
||||
"pandax/base/model"
|
||||
)
|
||||
|
||||
type SysRole struct {
|
||||
RoleId int64 `json:"roleId" gorm:"primary_key;AUTO_INCREMENT"`
|
||||
RoleName string `json:"roleName" gorm:"type:varchar(128);comment:角色名称"`
|
||||
Status string `json:"status" gorm:"type:varchar(1);comment:状态"`
|
||||
RoleKey string `json:"roleKey" gorm:"type:varchar(128);comment:角色代码"`
|
||||
RoleSort int64 `json:"roleSort" gorm:"type:int(4);comment:角色排序"`
|
||||
DataScope string `json:"dataScope" gorm:"type:varchar(1);comment:数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)"`
|
||||
Flag string `json:"flag" gorm:"type:varchar(128);comment:删除标识"`
|
||||
CreateBy string `json:"createBy" gorm:"type:varchar(128);"`
|
||||
UpdateBy string `json:"updateBy" gorm:"type:varchar(128);"`
|
||||
Remark string `json:"remark" gorm:"type:varchar(255);"`
|
||||
ApiIds []casbin.CasbinRule `json:"apiIds" gorm:"-"`
|
||||
MenuIds []int64 `json:"menuIds" gorm:"-"`
|
||||
DeptIds []int64 `json:"deptIds" gorm:"-"`
|
||||
model.BaseModel
|
||||
}
|
||||
|
||||
type MenuIdList struct {
|
||||
MenuId int64 `json:"menuId"`
|
||||
}
|
||||
|
||||
type DeptIdList struct {
|
||||
DeptId int64 `json:"deptId"`
|
||||
}
|
||||
7
apps/system/entity/role_dept.go
Normal file
7
apps/system/entity/role_dept.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package entity
|
||||
|
||||
type SysRoleDept struct {
|
||||
RoleId int64 `gorm:"type:int(11)"`
|
||||
DeptId int64 `gorm:"type:int(11)"`
|
||||
Id int64 `gorm:"primary_key;AUTO_INCREMENT;column:id" json:"id" form:"id"`
|
||||
}
|
||||
12
apps/system/entity/role_menu.go
Normal file
12
apps/system/entity/role_menu.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package entity
|
||||
|
||||
type SysRoleMenu struct {
|
||||
RoleId int64 `gorm:"type:int(11)"`
|
||||
MenuId int64 `gorm:"type:int(11)"`
|
||||
RoleName string `gorm:"type:varchar(128)"`
|
||||
Id int64 `gorm:"primary_key;AUTO_INCREMENT;column:id" json:"id" form:"id"`
|
||||
}
|
||||
|
||||
type MenuPath struct {
|
||||
Path string `json:"path"`
|
||||
}
|
||||
72
apps/system/entity/user.go
Normal file
72
apps/system/entity/user.go
Normal file
@@ -0,0 +1,72 @@
|
||||
package entity
|
||||
|
||||
import "pandax/base/model"
|
||||
|
||||
type UserName struct {
|
||||
Username string `gorm:"type:varchar(64)" json:"username"`
|
||||
}
|
||||
|
||||
type PassWord struct {
|
||||
// 密码
|
||||
Password string `gorm:"type:varchar(128)" json:"password"`
|
||||
}
|
||||
|
||||
type LoginM struct {
|
||||
UserName
|
||||
PassWord
|
||||
}
|
||||
|
||||
type SysUserId struct {
|
||||
UserId int64 `gorm:"primary_key;AUTO_INCREMENT" json:"userId"` // 编码
|
||||
}
|
||||
|
||||
type SysUserB struct {
|
||||
NickName string `gorm:"type:varchar(128)" json:"nickName"` // 昵称
|
||||
Phone string `gorm:"type:varchar(11)" json:"phone"` // 手机号
|
||||
RoleId int64 `gorm:"type:int(11)" json:"roleId"` // 角色编码
|
||||
Salt string `gorm:"type:varchar(255)" json:"salt"` //盐
|
||||
Avatar string `gorm:"type:varchar(255)" json:"avatar"` //头像
|
||||
Sex string `gorm:"type:varchar(255)" json:"sex"` //性别
|
||||
Email string `gorm:"type:varchar(128)" json:"email"` //邮箱
|
||||
DeptId int64 `gorm:"type:int(11)" json:"deptId"` //部门编码
|
||||
PostId int64 `gorm:"type:int(11)" json:"postId"` //职位编码
|
||||
RoleIds string `gorm:"type:varchar(255)" json:"roleIds"` //多角色
|
||||
PostIds string `gorm:"type:varchar(255)" json:"postIds"` // 多岗位
|
||||
CreateBy string `gorm:"type:varchar(128)" json:"createBy"` //
|
||||
UpdateBy string `gorm:"type:varchar(128)" json:"updateBy"` //
|
||||
Remark string `gorm:"type:varchar(255)" json:"remark"` //备注
|
||||
Status string `gorm:"type:varchar(1);" json:"status"`
|
||||
model.BaseModel
|
||||
}
|
||||
|
||||
type SysUser struct {
|
||||
SysUserId
|
||||
SysUserB
|
||||
LoginM
|
||||
}
|
||||
|
||||
type SysUserPwd struct {
|
||||
OldPassword string `json:"oldPassword" form:"oldPassword"`
|
||||
NewPassword string `json:"newPassword" form:"newPassword"`
|
||||
}
|
||||
|
||||
type SysUserPage struct {
|
||||
SysUserId
|
||||
SysUserB
|
||||
LoginM
|
||||
DeptName string `gorm:"-" json:"deptName"`
|
||||
}
|
||||
|
||||
type Login struct {
|
||||
Username string `form:"username" json:"username" binding:"required"`
|
||||
Password string `form:"password" json:"password" binding:"required"`
|
||||
Code string `form:"code" json:"code" binding:"required"`
|
||||
UUID string `form:"UUID" json:"uuid" binding:"required"`
|
||||
}
|
||||
|
||||
type SysUserView struct {
|
||||
SysUserId
|
||||
SysUserB
|
||||
LoginM
|
||||
RoleName string `gorm:"column:role_name" json:"role_name"`
|
||||
}
|
||||
Reference in New Issue
Block a user