replyService.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. angular.module('push')
  2. .factory('replyService', function (ConfigService, $q, UtilService, UserService) {
  3. return {
  4. //加载评论的回复列表
  5. replyList: function(Id){
  6. var deferred = $q.defer();
  7. var params = {
  8. Id: Id
  9. };
  10. UtilService.post(ConfigService.server + "getReplyList.action?", params).success(function (response) {
  11. deferred.resolve(response);
  12. }).error(function (response) {
  13. deferred.reject(response);
  14. });
  15. return deferred.promise;
  16. },
  17. //内页回复提交
  18. appreply: function(infoId,infoType,content,parentId,parentUserId,source){
  19. var deferred = $q.defer();
  20. var params = {
  21. infoId: infoId,
  22. infoType: infoType,
  23. userId: UserService.id,
  24. type:1,
  25. content:content,
  26. parentId:parentId,
  27. parentUserId:parentUserId,
  28. source:source
  29. };
  30. UtilService.post(ConfigService.server + "appComment.action?", params).success(function (response) {
  31. deferred.resolve(response);
  32. }).error(function (response) {
  33. deferred.reject(response);
  34. });
  35. return deferred.promise;
  36. }
  37. }
  38. });