易云轻量版服务端
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.

26 line
440 B

  1. // http_result
  2. package utils
  3. type HttpResult struct {
  4. Code int8
  5. Msg string
  6. Data interface{}
  7. }
  8. func BuildSuccess() (httpResult HttpResult) {
  9. httpResult.Code = 0
  10. return httpResult
  11. }
  12. func BuildFail(msg string) (httpResult HttpResult) {
  13. httpResult.Code = -1
  14. httpResult.Msg = msg
  15. return httpResult
  16. }
  17. func BuildSuccessData(data interface{}) (httpResult HttpResult) {
  18. httpResult.Code = 0
  19. httpResult.Data = data
  20. return httpResult
  21. }