BaseController.java 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. package com.ym.adminap.controller;
  2. import com.ym.adminap.enity.AppResultJson;
  3. public class BaseController
  4. {
  5. /**
  6. * 接口返回体
  7. * @param status 状态编码
  8. * @param info 返回消息
  9. * @param data 数据包
  10. * @param other 附加数据包
  11. * @return
  12. */
  13. public AppResultJson ResultController(String status, String messge, Object data, Object other)
  14. {
  15. AppResultJson result = new AppResultJson();
  16. result.status = "1";
  17. result.messge = messge;
  18. result.data = data;
  19. result.other = other;
  20. return result;
  21. }
  22. /**
  23. * 接口返回体
  24. * @param status 状态编码
  25. * @param info 返回消息
  26. * @param data 数据包
  27. * @return
  28. */
  29. public AppResultJson ResultController(String status, String messge, Object data)
  30. {
  31. AppResultJson result = new AppResultJson();
  32. result.status = "1";
  33. result.messge = messge;
  34. result.data = data;
  35. return result;
  36. }
  37. /**
  38. * 接口返回体
  39. * @param status 状态编码
  40. * @param data 数据包
  41. * @return
  42. */
  43. public AppResultJson ResultController(String status, Object data)
  44. {
  45. AppResultJson result = new AppResultJson();
  46. result.status = "1";
  47. result.data = data;
  48. return result;
  49. }
  50. /**
  51. * 接口返回体
  52. * @param status 状态编码
  53. * @param info 返回消息
  54. * @return
  55. */
  56. public AppResultJson ResultController(String status, String messge)
  57. {
  58. AppResultJson result = new AppResultJson();
  59. result.status = "1";
  60. result.messge = messge;
  61. return result;
  62. }
  63. }