myservice.js 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. (function (app) {
  2. app.factory('myService', ['$http', 'config', "util", function ($http, config, util) {
  3. return {
  4. setPassword: function (password) {
  5. return $http({
  6. url: config.server + '/api/auth/password',
  7. method: "post",
  8. data: { password: password }
  9. })
  10. },
  11. add:function (data){
  12. return $http({
  13. url:config.server + 'api/my/add_dream',
  14. method:"post",
  15. data:data
  16. })
  17. },
  18. recharge:function(money){
  19. return $http({
  20. url:config.server + "api/my/recharge?money="+money,
  21. method:"get"
  22. })
  23. },
  24. setting:function(){
  25. return $http({
  26. url:config.server + "api/my/setting",
  27. method:"get"
  28. })
  29. },
  30. systemInfo:function(){
  31. return $http({
  32. url:config.server + "api/my/system_info",
  33. method:"get"
  34. })
  35. },
  36. replyMy:function(){
  37. return $http({
  38. url:config.server + "api/my/reply_my",
  39. method:"get"
  40. })
  41. },
  42. collect:function(){
  43. return $http({
  44. url:config.server + "api/my/collection",
  45. method:"get"
  46. })
  47. },
  48. myDream:function(){
  49. return $http({
  50. url:config.server + "api/my/dream",
  51. method:"get"
  52. })
  53. },
  54. myReplay:function(data){
  55. return $http({
  56. url: config.server + '/api/my/my_reply',
  57. method: "post",
  58. data: data
  59. })
  60. },
  61. myMes:function(){
  62. return $http({
  63. url:config.server + "api/my/persona",
  64. method:"get"
  65. })
  66. },
  67. myInfo:function(){
  68. return $http({
  69. url:config.server + "api/my/show",
  70. method:"get"
  71. })
  72. },
  73. toprofile:function(){
  74. return $http({
  75. url:config.server + "api/my/persona",
  76. method:"get"
  77. })
  78. },
  79. myMaterial:function(){
  80. return $http({
  81. url:config.server + "api/my/edit_user_info",
  82. method:"get"
  83. })
  84. },
  85. saveMaterial:function(data){
  86. return $http({
  87. url:config.server + "api/my/update_user_info",
  88. method:"post",
  89. data:data
  90. })
  91. }
  92. };
  93. }]);
  94. })(angular.module('app.services'));