homeservice.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. (function (app) {
  2. app.factory('homeService', ['$http', 'config', "util", function ($http, config, util) {
  3. return {
  4. sent_list: function (filter) {
  5. return $http({
  6. url: config.server + 'api/service/sent_list?q=' + filter.q + "&status=" + filter.status+ "&page=" + filter.page+"&f="+filter.f,
  7. method: "get"
  8. })
  9. },
  10. supportDream:function(data){
  11. return $http({
  12. url:config.server + "api/dream/support",
  13. method:"post",
  14. data:data
  15. })
  16. },
  17. collectionDream:function(id,is_collection){
  18. return $http({
  19. url:config.server + "api/dream/collection?id=" + id+"&is_collection="+is_collection,
  20. method:"get"
  21. })
  22. },
  23. search:function (keyword){
  24. return $http({
  25. url: config.server + 'api/index/search?keyword='+keyword,
  26. method:"get"
  27. })
  28. },
  29. dreamDetail: function (id,dream_user_id,interaction_id) {
  30. return $http({
  31. url: config.server + 'api/dream/show?id=' + id + '&dream_user_id=' + dream_user_id + '&interaction_id=' + interaction_id,
  32. method: "get"
  33. })
  34. },
  35. destroyInter: function(id){
  36. return $http({
  37. url: config.server + 'api/interaction/destroy?id=' + id,
  38. method: "get"
  39. })
  40. },
  41. index: function (type, page) {
  42. var url = util.format('{0}api/index/home?type={1}&page={2}', config.server,type,page);
  43. return $http({
  44. url: url,
  45. method: "get"
  46. })
  47. },
  48. news_info: function (id) {
  49. return $http({
  50. url: config.server + 'api/index/news_info?id='+id,
  51. method: "get"
  52. })
  53. },
  54. user_search: function (keyword) {
  55. return $http({
  56. url: config.server + 'api/index/user_search?keyword='+keywords,
  57. method: "get"
  58. })
  59. },
  60. add_interaction: function (data) {
  61. return $http({
  62. url: config.server + 'api/interaction/store',
  63. method:"post",
  64. data:data
  65. })
  66. },
  67. add_comment: function (data) {
  68. return $http({
  69. url: config.server + '/api/interaction/comment',
  70. method:"post",
  71. data:data
  72. })
  73. },
  74. myInfo:function(){
  75. return $http({
  76. url:config.server + "api/my/show",
  77. method:"get"
  78. })
  79. },
  80. toUserDetail:function(id){
  81. return $http({
  82. url:config.server + "api/user/show?user_id=" + id ,
  83. method:"get"
  84. })
  85. },
  86. attentionUser:function(id,is_care){
  87. return $http({
  88. url:config.server + "api/user/care?id=" + id+"&is_care="+is_care,
  89. method:"get"
  90. })
  91. },
  92. messageInfo:function(){
  93. return $http({
  94. url:config.server + "api/my/info",
  95. method:"get"
  96. })
  97. },
  98. doFilter:function(sex,age,area){
  99. return $http({
  100. url:config.server + "api/index/filter?sex=" + sex+"&age="+age + "&area="+area,
  101. method:"get"
  102. })
  103. },
  104. share:function(id){
  105. return $http({
  106. url:config.server + "api/dream/share?id=" + id,
  107. method:"get"
  108. })
  109. },
  110. testcharge:function(number,type){
  111. return $http({
  112. url:config.server + "api/my/recharge?coin="+number,
  113. method:"post"
  114. })
  115. },
  116. charge:function(number,type){
  117. return $http({
  118. url:config.server + "api/pay/charge",
  119. method:"post",
  120. data: { number:number,goods:1,type:type}
  121. })
  122. },
  123. deleteComment:function(id){
  124. return $http({
  125. url:config.server + "api/comment/delete?id=" + id,
  126. method:"get"
  127. })
  128. },
  129. changeStep:function(){
  130. return $http({
  131. url:config.server + "api/my/step",
  132. method:"get"
  133. })
  134. },
  135. report:function(dream_id,interaction_id,user_id){
  136. return $http({
  137. url:config.server + "api/interaction/add_comment_blackList?dream_id=" + dream_id + '&interaction_id=' + interaction_id + '&user_id=' + user_id,
  138. method:"get"
  139. })
  140. }
  141. };
  142. }]);
  143. })(angular.module('app.services'));