123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- (function (app) {
- app.factory('homeService', ['$http', 'config', "util", function ($http, config, util) {
- return {
- sent_list: function (filter) {
- return $http({
- url: config.server + 'api/service/sent_list?q=' + filter.q + "&status=" + filter.status+ "&page=" + filter.page+"&f="+filter.f,
- method: "get"
- })
- },
- supportDream:function(data){
- return $http({
- url:config.server + "api/dream/support",
- method:"post",
- data:data
- })
- },
- collectionDream:function(id,is_collection){
- return $http({
- url:config.server + "api/dream/collection?id=" + id+"&is_collection="+is_collection,
- method:"get"
- })
- },
- search:function (keyword){
- return $http({
- url: config.server + 'api/index/search?keyword='+keyword,
- method:"get"
- })
- },
- dreamDetail: function (id,dream_user_id,interaction_id) {
- return $http({
- url: config.server + 'api/dream/show?id=' + id + '&dream_user_id=' + dream_user_id + '&interaction_id=' + interaction_id,
- method: "get"
- })
- },
- destroyInter: function(id){
- return $http({
- url: config.server + 'api/interaction/destroy?id=' + id,
- method: "get"
- })
- },
- index: function (type, page) {
- var url = util.format('{0}api/index/home?type={1}&page={2}', config.server,type,page);
- return $http({
- url: url,
- method: "get"
- })
- },
- news_info: function (id) {
- return $http({
- url: config.server + 'api/index/news_info?id='+id,
- method: "get"
- })
- },
- user_search: function (keyword) {
- return $http({
- url: config.server + 'api/index/user_search?keyword='+keywords,
- method: "get"
- })
- },
- add_interaction: function (data) {
- return $http({
- url: config.server + 'api/interaction/store',
- method:"post",
- data:data
- })
- },
- add_comment: function (data) {
- return $http({
- url: config.server + '/api/interaction/comment',
- method:"post",
- data:data
- })
- },
- myInfo:function(){
- return $http({
- url:config.server + "api/my/show",
- method:"get"
- })
- },
- toUserDetail:function(id){
- return $http({
- url:config.server + "api/user/show?user_id=" + id ,
- method:"get"
- })
- },
- attentionUser:function(id,is_care){
- return $http({
- url:config.server + "api/user/care?id=" + id+"&is_care="+is_care,
- method:"get"
- })
- },
- messageInfo:function(){
- return $http({
- url:config.server + "api/my/info",
- method:"get"
- })
- },
- doFilter:function(sex,age,area){
- return $http({
- url:config.server + "api/index/filter?sex=" + sex+"&age="+age + "&area="+area,
- method:"get"
- })
- },
- share:function(id){
- return $http({
- url:config.server + "api/dream/share?id=" + id,
- method:"get"
- })
- },
- testcharge:function(number,type){
- return $http({
- url:config.server + "api/my/recharge?coin="+number,
- method:"post"
- })
- },
- charge:function(number,type){
- return $http({
- url:config.server + "api/pay/charge",
- method:"post",
- data: { number:number,goods:1,type:type}
- })
- },
- deleteComment:function(id){
- return $http({
- url:config.server + "api/comment/delete?id=" + id,
- method:"get"
- })
- },
- changeStep:function(){
- return $http({
- url:config.server + "api/my/step",
- method:"get"
- })
- },
- report:function(dream_id,interaction_id,user_id){
- return $http({
- url:config.server + "api/interaction/add_comment_blackList?dream_id=" + dream_id + '&interaction_id=' + interaction_id + '&user_id=' + user_id,
- method:"get"
- })
- }
- };
- }]);
- })(angular.module('app.services'));
|