71 lines
2.4 KiB
Go
71 lines
2.4 KiB
Go
package api
|
|
|
|
// Use db package types directly for API responses - no duplication needed
|
|
// Request models are kept below as they're different (input DTOs)
|
|
|
|
// Element context for backend ID generation
|
|
type ElementContext struct {
|
|
Tag string `json:"tag"`
|
|
Classes []string `json:"classes"`
|
|
OriginalContent string `json:"original_content"`
|
|
ParentContext string `json:"parent_context"`
|
|
Purpose string `json:"purpose"`
|
|
}
|
|
|
|
// Request models
|
|
type CreateContentRequest struct {
|
|
HTMLMarkup string `json:"html_markup"` // HTML markup of the element
|
|
FilePath string `json:"file_path"` // File path for consistent ID generation
|
|
HTMLContent string `json:"html_content"` // HTML content value
|
|
OriginalTemplate string `json:"original_template"` // Original template markup
|
|
SiteID string `json:"site_id,omitempty"` // Site identifier
|
|
CreatedBy string `json:"created_by,omitempty"` // User who created the content
|
|
}
|
|
|
|
type RollbackContentRequest struct {
|
|
VersionID int64 `json:"version_id"`
|
|
RolledBackBy string `json:"rolled_back_by,omitempty"`
|
|
}
|
|
|
|
// Collection response types also use db package directly
|
|
|
|
// Collection request models
|
|
type CreateCollectionRequest struct {
|
|
ContainerHTML string `json:"container_html"`
|
|
SiteID string `json:"site_id,omitempty"`
|
|
CreatedBy string `json:"created_by,omitempty"`
|
|
}
|
|
|
|
type CreateCollectionTemplateRequest struct {
|
|
Name string `json:"name"`
|
|
HTMLTemplate string `json:"html_template"`
|
|
IsDefault bool `json:"is_default"`
|
|
CollectionID string `json:"collection_id,omitempty"`
|
|
SiteID string `json:"site_id,omitempty"`
|
|
}
|
|
|
|
type CreateCollectionItemRequest struct {
|
|
TemplateID int `json:"template_id"`
|
|
HTMLContent string `json:"html_content"`
|
|
Position int `json:"position"`
|
|
CollectionID string `json:"collection_id,omitempty"`
|
|
SiteID string `json:"site_id,omitempty"`
|
|
CreatedBy string `json:"created_by,omitempty"`
|
|
}
|
|
|
|
type UpdateCollectionItemRequest struct {
|
|
HTMLContent string `json:"html_content"`
|
|
Position int `json:"position"`
|
|
UpdatedBy string `json:"updated_by,omitempty"`
|
|
}
|
|
|
|
type CollectionItemPosition struct {
|
|
ItemID string `json:"itemId"`
|
|
Position int `json:"position"`
|
|
}
|
|
|
|
type ReorderCollectionRequest struct {
|
|
Items []CollectionItemPosition `json:"items"`
|
|
UpdatedBy string `json:"updated_by,omitempty"`
|
|
}
|