homeservice.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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){
  18. return $http({
  19. url:config.server + "api/dream/collection?id=" + id,
  20. method:"get",
  21. })
  22. },
  23. searchContent:function (data){
  24. return $http({
  25. url: config.server + 'api/index/search?' + data,
  26. method:"get"
  27. })
  28. },
  29. dreamDetail: function (id) {
  30. return $http({
  31. url: config.server + 'api/dream/show?id=' + id,
  32. method: "get"
  33. })
  34. },
  35. index: function (type, page) {
  36. var url = util.format('{0}/api/index/index?type={1}&page={2}', config.server,type,page);
  37. return $http({
  38. url: url,
  39. method: "get"
  40. })
  41. },
  42. news_info: function (id) {
  43. return $http({
  44. url: config.server + 'api/index/news_info?id='+id,
  45. method: "get"
  46. })
  47. },
  48. user_search: function (keyword) {
  49. return $http({
  50. url: config.server + 'api/index/user_search?keyword='+keywords,
  51. method: "get"
  52. })
  53. },
  54. news_info: function (id) {
  55. return $http({
  56. url: config.server + 'api/index/news_info?id=' + id,
  57. method: "get"
  58. })
  59. },
  60. };
  61. }]);
  62. })(angular.module('app.services'));