You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
621 B
31 lines
621 B
package dto |
|
|
|
type JSendResponse struct { |
|
Status string `json:"status"` |
|
Data interface{} `json:"data,omitempty"` |
|
Message string `json:"message,omitempty"` |
|
Code int `json:"code,omitempty"` |
|
} |
|
|
|
func JSendSuccess(data interface{}) JSendResponse { |
|
return JSendResponse{ |
|
Status: "success", |
|
Data: data, |
|
} |
|
} |
|
|
|
func JSendError(message string, code int) JSendResponse { |
|
return JSendResponse{ |
|
Status: "error", |
|
Message: message, |
|
Code: code, |
|
} |
|
} |
|
|
|
func JSendFail(message string, code int) JSendResponse { |
|
return JSendResponse{ |
|
Status: "fail", |
|
Message: message, |
|
Code: code, |
|
} |
|
} |