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.
|
- // http_result
- package utils
-
- type HttpResult struct {
- Code int8
- Msg string
- Data interface{}
- }
-
- func BuildSuccess() (httpResult HttpResult) {
- httpResult.Code = 0
- return httpResult
- }
-
- func BuildFail(msg string) (httpResult HttpResult) {
- httpResult.Code = -1
- httpResult.Msg = msg
- return httpResult
- }
-
- func BuildSuccessData(data interface{}) (httpResult HttpResult) {
- httpResult.Code = 0
- httpResult.Data = data
- return httpResult
- }
|