helper.go 626 B

12345678910111213141516171819202122232425262728
  1. package base
  2. import "fmt"
  3. const (
  4. //ReturnCodeSuccess success
  5. ReturnCodeSuccess = "SUCCESS"
  6. //ReturnCodeFail fail
  7. ReturnCodeFail = "FAIL"
  8. )
  9. const (
  10. //ResultCodeSuccess success
  11. ResultCodeSuccess = "SUCCESS"
  12. //ResultCodeFail fail
  13. ResultCodeFail = "FAIL"
  14. )
  15. //Error error
  16. type Error struct {
  17. XMLName struct{} `xml:"xml" json:"-"`
  18. ReturnCode string `xml:"return_code" json:"return_code"`
  19. ReturnMsg string `xml:"return_msg,omitempty" json:"return_msg,omitempty"`
  20. }
  21. func (e *Error) Error() string {
  22. return fmt.Sprintf("return_code: %q, return_msg: %q", e.ReturnCode, e.ReturnMsg)
  23. }