You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
967 B
37 lines
967 B
package request
|
|
|
|
import (
|
|
"sorbet/internal/entities"
|
|
)
|
|
|
|
type SystemPermissionUpsertRequest struct {
|
|
ID uint `json:"id" xml:"id" form:"id" path:"id"`
|
|
PID uint `json:"pid" xml:"pid" form:"pid"`
|
|
Name string `json:"name" xml:"name" form:"name"`
|
|
Type string `json:"type" xml:"type" form:"type"`
|
|
Identifier string `json:"identifier" xml:"identifier" form:"identifier"`
|
|
}
|
|
|
|
func (s *SystemPermissionUpsertRequest) GetID() any {
|
|
return s.ID
|
|
}
|
|
|
|
func (s *SystemPermissionUpsertRequest) ToMap() map[string]any {
|
|
return map[string]any{
|
|
"id": s.ID,
|
|
"pid": s.PID,
|
|
"name": s.Name,
|
|
"type": s.Type,
|
|
"identifier": s.Identifier,
|
|
}
|
|
}
|
|
|
|
func (s *SystemPermissionUpsertRequest) ToEntity() any {
|
|
return &entities.SystemPermission{
|
|
ID: s.ID,
|
|
PID: &s.PID,
|
|
Name: s.Name,
|
|
Type: s.Type,
|
|
Identifier: s.Identifier,
|
|
}
|
|
}
|
|
|