myservice.js 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. (function (app) {
  2. app.factory('myService', ['$http', 'config', "util", function ($http, config, util) {
  3. return {
  4. logout:function(){
  5. return $http({
  6. url:config.server + "api/auth/logout",
  7. method:"get"
  8. })
  9. },
  10. setPassword: function (password) {
  11. return $http({
  12. url: config.server + '/api/auth/password',
  13. method: "post",
  14. data: { password: password }
  15. })
  16. },
  17. testcharge:function(number,type){
  18. return $http({
  19. url:config.server + "api/my/recharge?coin="+number,
  20. method:"post"
  21. })
  22. },
  23. charge:function(number,type){
  24. return $http({
  25. url:config.server + "api/pay/charge",
  26. method:"post",
  27. data: { number:number,goods:1,type:type}
  28. })
  29. },
  30. setting:function(){
  31. return $http({
  32. url:config.server + "api/my/setting",
  33. method:"get"
  34. })
  35. },
  36. systemInfo:function(){
  37. return $http({
  38. url:config.server + "api/my/system_info",
  39. method:"get"
  40. })
  41. },
  42. replyMy:function(){
  43. return $http({
  44. url:config.server + "api/my/reply",
  45. method:"get"
  46. })
  47. },
  48. collect:function(){
  49. return $http({
  50. url:config.server + "api/my/collection",
  51. method:"get"
  52. })
  53. },
  54. myDream:function(){
  55. return $http({
  56. url:config.server + "api/my/dream",
  57. method:"get"
  58. })
  59. },
  60. myReplay:function(data){
  61. return $http({
  62. url: config.server + '/api/my/my_reply',
  63. method: "post",
  64. data: data
  65. })
  66. },
  67. myMes:function(){
  68. return $http({
  69. url:config.server + "api/my/persona",
  70. method:"get"
  71. })
  72. },
  73. myInfo:function(){
  74. return $http({
  75. url:config.server + "api/my/show",
  76. method:"get"
  77. })
  78. },
  79. toprofile:function(){
  80. return $http({
  81. url:config.server + "api/my/persona",
  82. method:"get"
  83. })
  84. },
  85. myMaterial:function(){
  86. return $http({
  87. url:config.server + "api/my/update",
  88. method:"get"
  89. })
  90. },
  91. saveMaterial:function(data){
  92. return $http({
  93. url:config.server + "api/my/update",
  94. method:"post",
  95. data:data
  96. })
  97. },
  98. attention:function(){
  99. return $http({
  100. url:config.server + "api/my/care",
  101. method:"get"
  102. })
  103. },
  104. toMyUserDetail:function(id){
  105. return $http({
  106. url:config.server + "api/user/show?user_id=" + id ,
  107. method:"get"
  108. })
  109. },
  110. addAccount:function(data){
  111. return $http({
  112. url:config.server + "api/my/bank/create",
  113. method:"post",
  114. data:data
  115. })
  116. },
  117. showAccount:function(){
  118. return $http({
  119. url:config.server + "api/my/bank/list",
  120. method:"get"
  121. })
  122. },
  123. destroyAccount:function(id){
  124. return $http({
  125. url:config.server + "api/my/bank/delete?id=" + id ,
  126. method:"get"
  127. })
  128. },
  129. withdraw:function(data){
  130. return $http({
  131. url:config.server + "api/my/cash",
  132. method:"post",
  133. data:data
  134. })
  135. },
  136. contact:function(data){
  137. return $http({
  138. url:config.server + "api/my/suggest",
  139. method:"post",
  140. data:data
  141. })
  142. },
  143. payExplain:function(){
  144. return $http({
  145. url:config.server + "api/my/pay/article",
  146. method:"get"
  147. })
  148. },
  149. addQrcode:function(data){
  150. return $http({
  151. url:config.server + "api/my/bank/qrcode",
  152. method:"post",
  153. data:data
  154. })
  155. },
  156. aboutMiao:function(){
  157. return $http({
  158. url:config.server + "api/my/miao",
  159. method:"get"
  160. })
  161. },
  162. messageInfo:function(){
  163. return $http({
  164. url:config.server + "api/my/info",
  165. method:"get"
  166. })
  167. },
  168. notRead:function(){
  169. return $http({
  170. url:config.server + "api/my/read",
  171. method:"get"
  172. })
  173. },
  174. letter:function(){
  175. return $http({
  176. url:config.server + "api/my/letter",
  177. method:"get"
  178. })
  179. }
  180. };
  181. }]);
  182. })(angular.module('app.services'));