feat: add component_types management functionality
This commit is contained in:
15
internal/models/component_type_model.go
Normal file
15
internal/models/component_type_model.go
Normal 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"`
|
||||
}
|
||||
15
internal/models/requests/component_type_request.go
Normal file
15
internal/models/requests/component_type_request.go
Normal 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"`
|
||||
}
|
||||
11
internal/models/responses/component_type_response.go
Normal file
11
internal/models/responses/component_type_response.go
Normal 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"`
|
||||
}
|
||||
Reference in New Issue
Block a user