go项目脚手架
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.
sorbet/internal/services/system/request/system_role_upsert_request.go

29 lines
509 B

1 year ago
package request
import (
"sorbet/internal/entities"
)
type SystemRoleUpsertRequest struct {
ID uint `json:"id" xml:"id" form:"id" path:"id"`
Name string `json:"name" xml:"name" form:"name"`
}
func (s *SystemRoleUpsertRequest) GetID() any {
return s.ID
}
func (s *SystemRoleUpsertRequest) ToMap() map[string]any {
return map[string]any{
"id": s.ID,
"name": s.Name,
}
}
func (s *SystemRoleUpsertRequest) ToEntity() any {
return &entities.SystemRole{
ID: s.ID,
Name: s.Name,
}
}