myservice.js 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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. replayMes:function(data){
  80. return $http({
  81. url:config.server + "api/interaction/comment",
  82. method:"post",
  83. data:data
  84. })
  85. },
  86. toprofile:function(){
  87. return $http({
  88. url:config.server + "api/my/persona",
  89. method:"get"
  90. })
  91. },
  92. myMaterial:function(){
  93. return $http({
  94. url:config.server + "api/my/update",
  95. method:"get"
  96. })
  97. },
  98. saveMaterial:function(data){
  99. return $http({
  100. url:config.server + "api/my/update",
  101. method:"post",
  102. data:data
  103. })
  104. },
  105. attention:function(){
  106. return $http({
  107. url:config.server + "api/my/care",
  108. method:"get"
  109. })
  110. },
  111. toMyUserDetail:function(id){
  112. return $http({
  113. url:config.server + "api/user/show?user_id=" + id ,
  114. method:"get"
  115. })
  116. },
  117. addAccount:function(data){
  118. return $http({
  119. url:config.server + "api/my/bank/create",
  120. method:"post",
  121. data:data
  122. })
  123. },
  124. showAccount:function(){
  125. return $http({
  126. url:config.server + "api/my/bank/list",
  127. method:"get"
  128. })
  129. },
  130. destroyAccount:function(id){
  131. return $http({
  132. url:config.server + "api/my/bank/delete?id=" + id ,
  133. method:"get"
  134. })
  135. },
  136. withdraw:function(data){
  137. return $http({
  138. url:config.server + "api/my/cash",
  139. method:"post",
  140. data:data
  141. })
  142. },
  143. contact:function(data){
  144. return $http({
  145. url:config.server + "api/my/suggest",
  146. method:"post",
  147. data:data
  148. })
  149. },
  150. payExplain:function(){
  151. return $http({
  152. url:config.server + "api/my/pay/article",
  153. method:"get"
  154. })
  155. },
  156. addQrcode:function(data){
  157. return $http({
  158. url:config.server + "api/my/bank/qrcode",
  159. method:"post",
  160. data:data
  161. })
  162. },
  163. aboutMiao:function(){
  164. return $http({
  165. url:config.server + "api/my/miao",
  166. method:"get"
  167. })
  168. },
  169. messageInfo:function(){
  170. return $http({
  171. url:config.server + "api/my/info",
  172. method:"get"
  173. })
  174. },
  175. notRead:function(){
  176. return $http({
  177. url:config.server + "api/my/read",
  178. method:"get"
  179. })
  180. },
  181. letter:function(){
  182. return $http({
  183. url:config.server + "api/my/letter",
  184. method:"get"
  185. })
  186. }
  187. };
  188. }]);
  189. })(angular.module('app.services'));