权限管理接口实现

This commit is contained in:
2026-03-18 18:09:32 +08:00
parent 9d996acf5f
commit bb895eccdf
44 changed files with 1958 additions and 161 deletions

View File

@@ -130,3 +130,8 @@ func Query(in any) url.Values {
return out
}
// 数据请求
type IdReq struct {
Id int32 `json:"id"`
}

View File

@@ -15,7 +15,7 @@ type Model struct {
ID int32 `json:"id" gorm:"column:id;primaryKey"`
CreatedAt time.Time `json:"created_at" gorm:"column:created_at"`
UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at"`
DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"column:deleted_at"`
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at"`
}
func (m *Model) GetID() int32 {

10
web/core/scopes.go Normal file
View File

@@ -0,0 +1,10 @@
package core
const (
ScopePermissionRead = string("permission:read")
ScopePermissionWrite = string("permission:write")
ScopeAdminRoleRead = string("admin_role:read")
ScopeAdminRoleWrite = string("admin_role:write")
ScopeAdminRead = string("admin:read")
ScopeAdminWrite = string("admin:write")
)