feat: some refactoring

This commit is contained in:
2025-11-22 22:23:49 +03:00
parent a247e6213e
commit 51f30b516e
29 changed files with 1094 additions and 129 deletions

View File

@@ -0,0 +1,25 @@
package models
// Response represents a standard API response
type Response struct {
Success bool `json:"success"`
Data interface{} `json:"data,omitempty"`
Error string `json:"error,omitempty"`
RequestID string `json:"request_id,omitempty"`
}
// NewSuccessResponse creates a successful response
func NewSuccessResponse(data interface{}) *Response {
return &Response{
Success: true,
Data: data,
}
}
// NewErrorResponse creates an error response
func NewErrorResponse(err error) *Response {
return &Response{
Success: false,
Error: err.Error(),
}
}