55 lines
1.5 KiB
Go
55 lines
1.5 KiB
Go
package permission
|
|
|
|
import "time"
|
|
|
|
type PermissionDTO struct {
|
|
Id int64 `json:"id"`
|
|
Code string `json:"code"`
|
|
Name string `json:"name"`
|
|
GuardName string `json:"guardName"`
|
|
Module string `json:"module"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
}
|
|
|
|
type CreatePermissionDTO struct {
|
|
Code string `json:"code" binding:"required"`
|
|
Name string `json:"name" binding:"required"`
|
|
GuardName string `json:"guardName" binding:"required,oneof=web operator admin"`
|
|
Module string `json:"module" binding:"required"`
|
|
}
|
|
|
|
type UpdatePermissionDTO struct {
|
|
Code string `json:"code" binding:"required"`
|
|
Name string `json:"name" binding:"required"`
|
|
GuardName string `json:"guardName" binding:"required,oneof=web operator admin"`
|
|
Module string `json:"module" binding:"required"`
|
|
}
|
|
|
|
type ListFilter struct {
|
|
PermissionName string
|
|
GuardName string
|
|
Module string
|
|
Page int
|
|
Limit int
|
|
}
|
|
|
|
type ListPermissionDTO struct {
|
|
Count int64 `json:"count"`
|
|
Permissions []PermissionDTO `json:"permissions"`
|
|
}
|
|
|
|
type PermissionTreeDTO struct {
|
|
Guards []GuardModulesDTO `json:"guards"`
|
|
}
|
|
|
|
type GuardModulesDTO struct {
|
|
GuardName string `json:"guardName"`
|
|
Modules []ModulePermissionsDTO `json:"modules"`
|
|
}
|
|
|
|
type ModulePermissionsDTO struct {
|
|
Module string `json:"module"`
|
|
Permissions []PermissionDTO `json:"permissions"`
|
|
}
|