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, } }