types.go 803 Bytes
Newer Older
qiuqunfeng's avatar
qiuqunfeng committed
1 2 3 4 5 6
package utils

type ResponseDataOptionFunc func(ev *SuccessResponse)

type SuccessResponse struct {
	APIVersion string      `json:"apiVersion"`
7 8 9
	Code       string      `json:"code"`
	Message    string      `json:"message"`
	StatusCode int         `json:"status_code"`
qiuqunfeng's avatar
qiuqunfeng committed
10 11 12 13
	Data       interface{} `json:"data"`
}

type FailResponse struct {
14 15 16 17
	APIVersion string `json:"apiVersion"`
	Code       string `json:"code"`
	Message    string `json:"message"`
	StatusCode int    `json:"status_code"`
qiuqunfeng's avatar
qiuqunfeng committed
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
}

type RespErr struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type ListRespData struct {
	Items        interface{} `json:"items"`
	ItemsPerPage int         `json:"itemsPerPage"`
	TotalItems   int         `json:"totalItems"`
}

type SingleRespData struct {
	Item interface{} `json:"item"`
}