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.

40 lines
736 B

package serializer
type Response struct {
Status int `json:"status"`
Data interface{} `json:"data"`
Msg string `json:"msg"`
Error string `json:"error"`
}
type TokenData struct {
User interface{} `json:"user"`
Token string `json:"tokens"`
}
type AdminToken struct {
Admin interface{} `json:"admin"`
Token string `json:"tokens"`
}
type BossToken struct {
Boss interface{} `json:"boss"`
Token string `json:"tokens"`
}
type DataList struct {
Item interface{} `json:"item"`
Total uint `json:"total"`
}
func BuildListResponse(items interface{}, total uint) Response {
return Response{
Status: 200,
Data: DataList{
Item: items,
Total: total,
},
Msg: "ok",
}
}