18 lines
291 B
Go
18 lines
291 B
Go
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,
|
|
}
|
|
}
|