help.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. define([ 'ngResource' ], function() {
  2. angular.module('helpServices', ['ngResource']).factory('Help', ['$resource', 'BaseService', function ($resource, BaseService) {
  3. //获取ComponentSubmit的分页数据
  4. return $resource('help-service', {}, {
  5. deleteById: {
  6. url: 'help-service/:id',
  7. method: 'DELETE'
  8. },
  9. updateNav: {
  10. url: 'help-service',
  11. method: 'PUT'
  12. },
  13. exchangeDetno: {
  14. url: 'help-service/exchange',
  15. method: 'POST'
  16. }
  17. });
  18. }]).factory('HelpAPI', ['$resource', 'BaseService', function ($resource, BaseService) {
  19. //获取ComponentSubmit的分页数据
  20. return $resource('api/help-service/issue', {}, {
  21. //取得完整的消息
  22. findAllChildren: {
  23. url: 'api/help-service/helps',
  24. method: 'GET',
  25. isArray: true
  26. },
  27. findByLevel: {
  28. url: 'api/help-service/level/:level',
  29. method: 'GET',
  30. isArray: true
  31. },
  32. findChildren: {
  33. url: 'api/help-service/children',
  34. method: 'GET',
  35. isArray: true
  36. },
  37. findStructingNav: {
  38. url: 'api/help-service/parents/:id',
  39. method: 'GET',
  40. isArray: true,
  41. params: {
  42. _status : 'structing'
  43. }
  44. },
  45. get: {
  46. url: 'api/help-service/:id',
  47. method: 'GET'
  48. }
  49. })
  50. }]).factory('HelpIssue', ['$resource', 'BaseService', function ($resource, BaseService) {
  51. //获取ComponentSubmit的分页数据
  52. return $resource('help-service/issue', {}, {
  53. //取得完整的消息
  54. saveAndPublish: {
  55. url: 'help-service/issue/publish',
  56. method: 'POST'
  57. },
  58. getAll: {
  59. url: 'help-service/issue/issues',
  60. method: 'GET',
  61. params: {
  62. _state : 'all'
  63. }
  64. },
  65. getPublished: {
  66. url: 'help-service/issue/issues',
  67. method: 'GET',
  68. params: {
  69. _state : 'publish'
  70. }
  71. },
  72. getInputing: {
  73. url: 'help-service/issue/issues',
  74. method: 'GET',
  75. params: {
  76. _state : 'inputing'
  77. }
  78. },
  79. get: {
  80. url: 'help-service/issue/:id',
  81. method: 'GET'
  82. },
  83. deleteById: {
  84. url: 'help-service/issue/:id',
  85. method: 'DELETE'
  86. },
  87. publish: {
  88. url: 'help-service/issue/publish',
  89. method: 'PUT'
  90. },
  91. publishAndFlush: {
  92. url: 'help-service/issue/publishAndFlush/:id',
  93. method: 'PUT'
  94. },
  95. update: {
  96. url: 'help-service/issue/update',
  97. method: 'PUT'
  98. },
  99. exchangeDetno: {
  100. url: 'help-service/issue/exchange',
  101. method: 'POST'
  102. }
  103. })
  104. }]).factory('HelpIssueAPI', ['$resource', 'BaseService', function ($resource, BaseService) {
  105. //获取ComponentSubmit的分页数据
  106. return $resource('api/help-service/issues', {}, {
  107. //取得完整的消息
  108. getIssues: {
  109. url: 'api/help-service/issues',
  110. method: 'GET',
  111. isArray: true
  112. },
  113. getIssue: {
  114. url: 'api/help-service/issues/:num',
  115. method: 'GET'
  116. }
  117. })
  118. }]).factory('HelpUpload', ['$resource', 'BaseService', function ($resource) {
  119. //文章编辑图片处理
  120. return $resource('file', {}, {
  121. upload: {
  122. url: 'file',
  123. method: 'POST',
  124. headers : {'Content-Type' : undefined},
  125. isArray: true
  126. }
  127. })
  128. }]);
  129. });