This commit is contained in:
2026-08-12 10:20:45 +08:00
parent dae0b973c7
commit aa20f9e9f0
22 changed files with 2002 additions and 82 deletions
+23 -29
View File
@@ -1,38 +1,32 @@
package dao
import "pkg.local/utils"
// Role 岗位表
type Role struct {
Id int `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT;comment:ID" json:"id"`
Name string `gorm:"column:name;type:varchar(255);comment:名称;NOT NULL" json:"name"`
ServiceId int `gorm:"column:service_id;type:int(11);comment:项目ID;NOT NULL" json:"service_id"`
Status uint8 `gorm:"column:status;type:tinyint(1);default:1;comment:状态,1为正常,2为禁用;NOT NULL" json:"status"`
Rules string `gorm:"column:rules;type:text;comment:权限内容" json:"rules"`
Reason string `gorm:"column:reason;type:varchar(255);comment:原因" json:"reason"`
AdminId int `gorm:"column:admin_id;type:int(11)" json:"admin_id"`
AdminName string `gorm:"column:admin_name;type:varchar(255);comment:操作人员姓名" json:"admin_name"`
CreateTime utils.CustomTime `gorm:"column:create_time;default:NULL;type:datetime" json:"create_time"`
UpdateTime utils.CustomTime `gorm:"column:update_time;default:NULL;type:datetime" json:"update_time"`
Id int64 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT;comment:ID" json:"id"`
Name string `gorm:"column:name;type:varchar(255);comment:名称;NOT NULL" json:"name"`
ServiceId int64 `gorm:"column:service_id;type:int(11);comment:项目ID;NOT NULL" json:"service_id"`
Status uint8 `gorm:"column:status;type:tinyint(1);default:1;comment:状态,1为正常,2为禁用;NOT NULL" json:"status"`
Rules string `gorm:"column:rules;type:text;comment:权限内容" json:"rules"`
Reason string `gorm:"column:reason;type:varchar(255);comment:原因" json:"reason"`
AdminId int64 `gorm:"column:admin_id;type:int(11)" json:"admin_id"`
AdminName string `gorm:"column:admin_name;type:varchar(255);comment:操作人员姓名" json:"admin_name"`
}
// RoleStatus 修改状态
type RoleStatus struct {
Id int `json:"id"`
Status uint8 `json:"status"`
Reason string `gorm:"column:reason;type:varchar(255);comment:原因" json:"reason"`
AdminId int `json:"admin_id"`
AdminName string `gorm:"column:admin_name;type:varchar(100);comment:操作人姓名" json:"admin_name"`
UpdateTime utils.CustomTime `gorm:"column:update_time;type:datetime;default:NULL;comment:更新时间" json:"update_time"`
Id int64 `json:"id"`
Status uint8 `json:"status"`
Reason string `gorm:"column:reason;type:varchar(255);comment:原因" json:"reason"`
AdminId int64 `json:"admin_id"`
AdminName string `gorm:"column:admin_name;type:varchar(100);comment:操作人姓名" json:"admin_name"`
}
// RoleRule 修改状态
type RoleRule struct {
Id int `json:"id"`
Rules string `json:"rules"`
AdminId int `json:"admin_id"`
AdminName string `gorm:"column:admin_name;type:varchar(100);comment:操作人姓名" json:"admin_name"`
UpdateTime utils.CustomTime `gorm:"column:update_time;type:datetime;default:NULL;comment:更新时间" json:"update_time"`
Id int64 `json:"id"`
Rules string `json:"rules"`
AdminId int64 `json:"admin_id"`
AdminName string `gorm:"column:admin_name;type:varchar(100);comment:操作人姓名" json:"admin_name"`
}
type RoleItems struct {
@@ -41,27 +35,27 @@ type RoleItems struct {
}
type RoleNameItems struct {
Id int `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
Id int64 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
Name string `gorm:"column:name;type:varchar(255);comment:项目描述;NOT NULL" json:"name"`
ServiceId int `json:"service_id"`
ServiceId int64 `json:"service_id"`
}
type RoleServiceNameItems struct {
Id int `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
Id int64 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
Name string `gorm:"column:name;type:varchar(255);comment:项目描述;NOT NULL" json:"name"`
Items []RoleNameItems `json:"items"`
}
type RoleRulesItems struct {
Id int `json:"id"`
Id int64 `json:"id"`
Name string `json:"name"`
Rules string `json:"rules"`
}
type RoleInfo struct {
Id int `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT;comment:ID" json:"id"`
Id int64 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT;comment:ID" json:"id"`
Name string `gorm:"column:name;type:varchar(255);comment:名称;NOT NULL" json:"name"`
ServiceId int `gorm:"column:service_id;type:int(11);comment:项目ID;NOT NULL" json:"service_id"`
ServiceId int64 `gorm:"column:service_id;type:int(11);comment:项目ID;NOT NULL" json:"service_id"`
Status uint8 `gorm:"column:status;type:tinyint(1);default:1;comment:状态,1为正常,2为禁用;NOT NULL" json:"status"`
Rules []int `gorm:"column:rules;type:text;comment:权限内容" json:"rules"`
Reason string `gorm:"column:reason;type:varchar(255);comment:原因" json:"reason"`