myservice.js 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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/dream_info",
  39. method:"get"
  40. })
  41. },
  42. replyMy:function(){
  43. return $http({
  44. url:config.server + "api/my/sup_info",
  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. sendLetter:function(data){
  68. return $http({
  69. url: config.server + '/api/my/letter/store',
  70. method: "post",
  71. data: data
  72. })
  73. },
  74. letterDetail:function(id){
  75. return $http({
  76. url: config.server + 'api/my/letter/show?id=' + id,
  77. method: "get"
  78. })
  79. },
  80. myMes:function(){
  81. return $http({
  82. url:config.server + "api/my/persona",
  83. method:"get"
  84. })
  85. },
  86. myInfo:function(){
  87. return $http({
  88. url:config.server + "api/my/show",
  89. method:"get"
  90. })
  91. },
  92. replayMes:function(data){
  93. return $http({
  94. url:config.server + "api/interaction/comment",
  95. method:"post",
  96. data:data
  97. })
  98. },
  99. toprofile:function(){
  100. return $http({
  101. url:config.server + "api/my/persona",
  102. method:"get"
  103. })
  104. },
  105. myMaterial:function(){
  106. return $http({
  107. url:config.server + "api/my/update",
  108. method:"get"
  109. })
  110. },
  111. saveMaterial:function(data){
  112. return $http({
  113. url:config.server + "api/my/update",
  114. method:"post",
  115. data:data
  116. })
  117. },
  118. attention:function(){
  119. return $http({
  120. url:config.server + "api/my/care",
  121. method:"get"
  122. })
  123. },
  124. careMe:function(){
  125. return $http({
  126. url:config.server + "api/my/careme",
  127. method:"get"
  128. })
  129. },
  130. toMyUserDetail:function(id){
  131. return $http({
  132. url:config.server + "api/user/show?user_id=" + id ,
  133. method:"get"
  134. })
  135. },
  136. addAccount:function(data){
  137. return $http({
  138. url:config.server + "api/my/bank/create",
  139. method:"post",
  140. data:data
  141. })
  142. },
  143. showAccount:function(){
  144. return $http({
  145. url:config.server + "api/my/bank/list",
  146. method:"get"
  147. })
  148. },
  149. destroyAccount:function(id){
  150. return $http({
  151. url:config.server + "api/my/bank/delete?id=" + id ,
  152. method:"get"
  153. })
  154. },
  155. withdraw:function(data){
  156. return $http({
  157. url:config.server + "api/my/cash",
  158. method:"post",
  159. data:data
  160. })
  161. },
  162. contact:function(data){
  163. return $http({
  164. url:config.server + "api/my/suggest",
  165. method:"post",
  166. data:data
  167. })
  168. },
  169. payExplain:function(){
  170. return $http({
  171. url:config.server + "api/my/pay/article",
  172. method:"get"
  173. })
  174. },
  175. addQrcode:function(data){
  176. return $http({
  177. url:config.server + "api/my/bank/qrcode",
  178. method:"post",
  179. data:data
  180. })
  181. },
  182. aboutMiao:function(){
  183. return $http({
  184. url:config.server + "api/my/miao",
  185. method:"get"
  186. })
  187. },
  188. messageInfo:function(){
  189. return $http({
  190. url:config.server + "api/my/info",
  191. method:"get"
  192. })
  193. },
  194. notRead:function(){
  195. return $http({
  196. url:config.server + "api/my/read",
  197. method:"get"
  198. })
  199. },
  200. letter:function(){
  201. return $http({
  202. url:config.server + "api/my/system_info",
  203. method:"get"
  204. })
  205. }
  206. };
  207. }]);
  208. })(angular.module('app.services'));