feat: add component_types management functionality

This commit is contained in:
Tran Anh Tuan
2026-05-11 10:15:02 +07:00
parent 7c9a0d4670
commit 50564e9b78
14 changed files with 1468 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
package models
import (
"encoding/json"
"time"
)
type ComponentType struct {
ID int64 `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Metadata json.RawMessage `json:"metadata"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}

View File

@@ -0,0 +1,15 @@
package requests
import "encoding/json"
type CreateComponentTypeRequest struct {
Name string `json:"name" binding:"required"`
Description string `json:"description"`
Metadata json.RawMessage `json:"metadata"`
}
type UpdateComponentTypeRequest struct {
Name string `json:"name"`
Description string `json:"description"`
Metadata json.RawMessage `json:"metadata"`
}

View File

@@ -0,0 +1,11 @@
package responses
type CreateComponentTypeResponse struct {
ID int64 `json:"id"`
}
type UpdateComponentTypeResponse struct {
ID int64 `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
}