实现角色接口增删改查

This commit is contained in:
2025-06-03 16:04:00 +08:00
parent bcd274c750
commit fedcd288e8
35 changed files with 596 additions and 57 deletions

View File

@ -11,6 +11,7 @@ import (
// Admins is the golang structure for table admins.
type Admins struct {
Id int64 `json:"id" orm:"id" description:"管理员ID"` // 管理员ID
RoleId int64 `json:"roleId" orm:"role_id" description:"角色ID"` // 角色ID
Username string `json:"username" orm:"username" description:"管理员用户名"` // 管理员用户名
PasswordHash string `json:"passwordHash" orm:"password_hash" description:"密码哈希"` // 密码哈希
RealName string `json:"realName" orm:"real_name" description:"真实姓名"` // 真实姓名

View File

@ -10,12 +10,13 @@ import (
// Roles is the golang structure for table roles.
type Roles struct {
Id int64 `json:"id" orm:"id" description:"角色ID"` // 角色ID
Name string `json:"name" orm:"name" description:"角色名称"` // 角色名称
Code string `json:"code" orm:"code" description:"角色编码"` // 角色编码
Description string `json:"description" orm:"description" description:"角色描述"` // 角色描述
Status int `json:"status" orm:"status" description:"状态1=启用2=禁用"` // 状态1=启用2=禁用
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"` // 创建时间
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"` // 更新时间
DeletedAt *gtime.Time `json:"deletedAt" orm:"deleted_at" description:"软删除时间戳"` // 软删除时间戳
Id int64 `json:"id" orm:"id" description:"角色ID"` // 角色ID
Name string `json:"name" orm:"name" description:"角色名称"` // 角色名称
Code string `json:"code" orm:"code" description:"角色编码"` // 角色编码
Description string `json:"description" orm:"description" description:"角色描述"` // 角色描述
Status int `json:"status" orm:"status" description:"状态1=启用2=禁用"` // 状态1=启用2=禁用
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"` // 创建时间
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"` // 更新时间
DeletedAt *gtime.Time `json:"deletedAt" orm:"deleted_at" description:"软删除时间戳"` // 软删除时间戳
IsDeletable bool `json:"isDeletable" orm:"is_deletable" description:"是否可删除0=不可删除1=可删除"` // 是否可删除0=不可删除1=可删除
}

View File

@ -25,4 +25,5 @@ type Users struct {
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"` // 创建时间
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"` // 更新时间
DeletedAt *gtime.Time `json:"deletedAt" orm:"deleted_at" description:"软删除时间"` // 软删除时间
RoleId int64 `json:"roleId" orm:"role_id" description:"角色ID"` // 角色ID
}