base.go 977 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. IsSendEmail bool `description:"true 发送邮件,false 不发送邮件"`
  10. }
  11. type BaseResponseRef struct {
  12. Ret int
  13. Msg string
  14. ErrMsg string
  15. ErrCode string
  16. Data string
  17. }
  18. type BaseResponseResult struct {
  19. Ret int `description:"状态:200 成功,408 重新登录,403:为失败"`
  20. Msg string `description:"提示信息,对用户展示"`
  21. ErrMsg string `description:"错误信息,供开发定位问题"`
  22. ErrCode string `description:"错误编码,预留"`
  23. Data string `description:"返回数据,json格式字符串"`
  24. }
  25. func (r *BaseResponse) Init() *BaseResponse {
  26. return &BaseResponse{Ret: 403,IsSendEmail: true}
  27. }
  28. type BaseRequest struct {
  29. }
  30. func (br *BaseRequest) Init() *BaseRequest {
  31. return &BaseRequest{}
  32. }