first commit

This commit is contained in:
2025-08-12 21:51:41 +07:00
commit f1efac98a0
27 changed files with 2170 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
package models
// ExampleGetResponse represents the response for the GET example service
type ExampleGetResponse struct {
Message string `json:"message"`
}
// ExamplePostRequest represents the request body for the POST example service
type ExamplePostRequest struct {
Name string `json:"name" binding:"required"`
Age int `json:"age" binding:"required"`
}
// ExamplePostResponse represents the response for the POST example service
type ExamplePostResponse struct {
ID string `json:"id"`
Message string `json:"message"`
}

42
internal/models/health.go Normal file
View File

@@ -0,0 +1,42 @@
package models
// HealthResponse represents the health check response
type HealthResponse struct {
Status string `json:"status"`
Timestamp string `json:"timestamp"`
Details map[string]string `json:"details"`
}
// HelloWorldResponse represents the hello world response
type HelloWorldResponse struct {
Message string `json:"message"`
Version string `json:"version"`
}
// ErrorResponse represents an error response
type ErrorResponse struct {
Error string `json:"error"`
Message string `json:"message"`
Code int `json:"code"`
}
// SuccessResponse represents a generic success response
type SuccessResponse struct {
Success bool `json:"success"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}
// Pagination represents pagination metadata
type Pagination struct {
Page int `json:"page"`
Limit int `json:"limit"`
Total int `json:"total"`
TotalPages int `json:"total_pages"`
}
// PaginatedResponse represents a paginated response
type PaginatedResponse struct {
Data interface{} `json:"data"`
Pagination Pagination `json:"pagination"`
}