Initial commit
This commit is contained in:
19
app/utils/res/http.go
Normal file
19
app/utils/res/http.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package res
|
||||
|
||||
type HTTPResponse struct {
|
||||
Code int `json:"code"`
|
||||
Body interface{} `json:"body"`
|
||||
ODataContext string `json:"@odata.context"`
|
||||
ODataCount int `json:"@odata.count"`
|
||||
ODataNextLink string `json:"@odata.nextLink"`
|
||||
}
|
||||
|
||||
func (res *HTTPResponse) JSON() map[string]interface{} {
|
||||
return map[string]interface{}{
|
||||
"code": res.Code,
|
||||
"body": res.Body,
|
||||
"@odata.context": res.ODataContext,
|
||||
"@odata.count": res.ODataCount,
|
||||
"@odata.nextLink": res.ODataNextLink,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user