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/feature/request/feature_upsert_request.go

37 lines
777 B

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