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_menu_upsert_request.go

40 lines
876 B

package request
import (
"sorbet/internal/entities"
)
type SystemMenuUpsertRequest struct {
ID uint `json:"id" xml:"id" form:"id" path:"id"`
PID uint `json:"pid" xml:"pid" form:"pid"`
Title string `json:"title" xml:"title" form:"title"`
Icon string `json:"icon" xml:"icon" form:"icon"`
Sort int32 `json:"sort" xml:"sort" form:"sort"`
Path string `json:"path" xml:"path" form:"path"`
}
func (s *SystemMenuUpsertRequest) GetID() any {
return s.ID
}
func (s *SystemMenuUpsertRequest) ToMap() map[string]any {
return map[string]any{
"id": s.ID,
"pid": s.PID,
"title": s.Title,
"icon": s.Icon,
"sort": s.Sort,
"path": s.Path,
}
}
func (s *SystemMenuUpsertRequest) ToEntity() any {
return &entities.SystemMenu{
ID: s.ID,
PID: &s.PID,
Title: s.Title,
Icon: s.Icon,
Sort: s.Sort,
Path: s.Path,
}
}