response.go 591 B

1234567891011121314151617181920212223242526272829
  1. package libs
  2. type Response struct {
  3. }
  4. func NewResponse()*Response {
  5. return new(Response)
  6. }
  7. //ajax返回
  8. func (self *Response) AjaxMsg( msgno int,msg interface{},data interface{})map[string]interface{} {
  9. out := make(map[string]interface{})
  10. out["code"] = msgno
  11. out["message"] = msg
  12. out["data"] = data
  13. return out
  14. }
  15. //ajax返回 列表
  16. func (self *Response) AjaxList( msgno int,msg interface{}, count int64, data interface{})map[string]interface{} {
  17. out := make(map[string]interface{})
  18. out["code"] = msgno
  19. out["msg"] = msg
  20. out["count"] = count
  21. out["data"] = data
  22. return out
  23. }