base.go 859 B

12345678910111213141516171819202122232425262728293031323334353637
  1. package models
  2. type BaseResponse struct {
  3. Ret int
  4. Msg string
  5. ErrMsg string
  6. ErrCode string
  7. Data interface{}
  8. Success bool `description:"true 执行成功,false 执行失败"`
  9. }
  10. type BaseResponseRef struct {
  11. Ret int
  12. Msg string
  13. ErrMsg string
  14. ErrCode string
  15. Data string
  16. }
  17. type BaseResponseResult struct {
  18. Ret int `description:"状态:200 成功,408 重新登录,403:为失败"`
  19. Msg string `description:"提示信息,对用户展示"`
  20. ErrMsg string `description:"错误信息,供开发定位问题"`
  21. ErrCode string `description:"错误编码,预留"`
  22. Data string `description:"返回数据,json格式字符串"`
  23. }
  24. func (r *BaseResponse) Init() *BaseResponse {
  25. return &BaseResponse{Ret: 403}
  26. }
  27. type BaseRequest struct {
  28. }
  29. func (br *BaseRequest) Init() *BaseRequest {
  30. return &BaseRequest{}
  31. }