types.go 606 Bytes
Newer Older
qiuqunfeng's avatar
qiuqunfeng committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
package utils

type ResponseDataOptionFunc func(ev *SuccessResponse)

type SuccessResponse struct {
	APIVersion string      `json:"apiVersion"`
	Data       interface{} `json:"data"`
}

type FailResponse struct {
	APIVersion string  `json:"apiVersion"`
	Error      RespErr `json:"error"`
}

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"`
}