Perbaikan pembacaan data base

This commit is contained in:
2025-08-18 08:45:49 +07:00
parent a7d6005649
commit 6192a64f0a
23 changed files with 1833 additions and 743 deletions

View File

@@ -1,42 +0,0 @@
package model
import "time"
// Product represents the product domain model
type Product struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Price float64 `json:"price"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
// ProductCreateRequest represents the request for creating a product
type ProductCreateRequest struct {
Name string `json:"name" binding:"required"`
Description string `json:"description"`
Price float64 `json:"price" binding:"required,gt=0"`
}
// ProductUpdateRequest represents the request for updating a product
type ProductUpdateRequest struct {
Name string `json:"name" binding:"required"`
Description string `json:"description"`
Price float64 `json:"price" binding:"required,gt=0"`
}
// ProductResponse represents the response for product operations
type ProductResponse struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Price float64 `json:"price"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
// ProductsResponse represents the response for listing products
type ProductsResponse struct {
Data []*Product `json:"data"`
}