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