base.go 634 B

1234567891011121314151617181920212223
  1. // Copyright 2019 github.com. All rights reserved.
  2. // Use of this source code is governed by github.com.
  3. package base
  4. // HTTPError http请求出错时的数据结构
  5. type HTTPError struct {
  6. Code int `json:"code" example:"500" format:"int"`
  7. Message string `json:"message" example:"status bad request"`
  8. }
  9. type Header struct {
  10. UserId int64 `header:"user_id" binding:"gte=0"` // 用户id
  11. Token string `header:"Token"` // token
  12. }
  13. type Result struct {
  14. Code int `json:"code" default:"0" format:"int"` // 返回码
  15. Message string `json:"message" default:"success"` // 消息
  16. }
  17. type Empty struct {
  18. }