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.
40 lines
1.2 KiB
40 lines
1.2 KiB
package request
|
|
|
|
import (
|
|
"sorbet/internal/entities"
|
|
)
|
|
|
|
type FeatureConfigUpsertRequest struct {
|
|
ID uint `json:"id" xml:"id" form:"id" path:"id"`
|
|
FeatureID uint `json:"feature_id" xml:"feature_id" form:"feature_id"`
|
|
Status bool `json:"status" xml:"status" form:"status"`
|
|
Categorizable bool `json:"categorizable" xml:"categorizable" form:"categorizable"`
|
|
CategoryDepth int64 `json:"category_depth" xml:"category_depth" form:"category_depth"`
|
|
ContentTypes []string `json:"content_types" xml:"content_types" form:"content_types"`
|
|
}
|
|
|
|
func (f *FeatureConfigUpsertRequest) GetID() any {
|
|
return f.ID
|
|
}
|
|
|
|
func (f *FeatureConfigUpsertRequest) ToMap() map[string]any {
|
|
return map[string]any{
|
|
"id": f.ID,
|
|
"feature_id": f.FeatureID,
|
|
"status": f.Status,
|
|
"categorizable": f.Categorizable,
|
|
"category_depth": f.CategoryDepth,
|
|
"content_types": f.ContentTypes,
|
|
}
|
|
}
|
|
|
|
func (f *FeatureConfigUpsertRequest) ToEntity() any {
|
|
return &entities.FeatureConfig{
|
|
ID: f.ID,
|
|
FeatureID: f.FeatureID,
|
|
Status: f.Status,
|
|
Categorizable: f.Categorizable,
|
|
CategoryDepth: f.CategoryDepth,
|
|
ContentTypes: f.ContentTypes,
|
|
}
|
|
}
|
|
|