first commit
This commit is contained in:
17
models/jsonResponse.go
Normal file
17
models/jsonResponse.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package models
|
||||
|
||||
type JsonResponse struct {
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
func NewJsonErrorResponse(err error) JsonResponse {
|
||||
return JsonResponse{
|
||||
Message: err.Error(),
|
||||
}
|
||||
}
|
||||
|
||||
func NewJsonMessageResponse(msg string) JsonResponse {
|
||||
return JsonResponse{
|
||||
Message: msg,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user