feat: add container management functionality
This commit is contained in:
18
internal/models/container_model.go
Normal file
18
internal/models/container_model.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Container struct {
|
||||
ID int64 `json:"id"`
|
||||
ShelfID int64 `json:"shelfId"`
|
||||
Name string `json:"name"`
|
||||
ContainerType string `json:"containerType"`
|
||||
Description string `json:"description"`
|
||||
MaxCapacity int32 `json:"maxCapacity"`
|
||||
Metadata json.RawMessage `json:"metadata"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
20
internal/models/requests/container_request.go
Normal file
20
internal/models/requests/container_request.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package requests
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
type CreateContainerRequest struct {
|
||||
ShelfID int64 `json:"shelfId" binding:"required"`
|
||||
Name string `json:"name" binding:"required"`
|
||||
ContainerType string `json:"containerType" binding:"required"`
|
||||
Description string `json:"description"`
|
||||
MaxCapacity int32 `json:"maxCapacity"`
|
||||
Metadata json.RawMessage `json:"metadata"`
|
||||
}
|
||||
|
||||
type UpdateContainerRequest struct {
|
||||
Name string `json:"name"`
|
||||
ContainerType string `json:"containerType"`
|
||||
Description string `json:"description"`
|
||||
MaxCapacity int32 `json:"maxCapacity"`
|
||||
Metadata json.RawMessage `json:"metadata"`
|
||||
}
|
||||
17
internal/models/responses/container_response.go
Normal file
17
internal/models/responses/container_response.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package responses
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
type CreateContainerResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
}
|
||||
|
||||
type UpdateContainerResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
ShelfID int64 `json:"shelfId"`
|
||||
Name string `json:"name"`
|
||||
ContainerType string `json:"containerType"`
|
||||
Description string `json:"description"`
|
||||
MaxCapacity int32 `json:"maxCapacity"`
|
||||
Metadata json.RawMessage `json:"metadata"`
|
||||
}
|
||||
Reference in New Issue
Block a user