daily pastebin goal
70%
SHARE
TWEET

Untitled

a guest Apr 21st, 2017 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. count: function (resources, period) {
  2.             var request = {
  3.               period: period,
  4.               queries: resources
  5.             };
  6.             return StatusForPeriodsRes._count({}, request);
  7.           },
  8.    
  9. var StatusForPeriodsRes = $resource(
  10.             Url.forSys('my-app').api('statuses/:id/:action'), {},{
  11.               _count: {
  12.                 method: 'PUT',
  13.                 params: {
  14.                   action: 'count'
  15.                 }
  16.               }
  17.             }
  18.         );
  19.    
  20. @RequestMapping(value = "/statuses/count", method = PUT)
  21.     public Long countStatuses(@RequestBody Req req){
  22. ...
  23. return longVal;
  24. }
  25.    
  26. var str =  myApi.count(resources, period);
  27.       str.$promise.then(function(response){
  28.       console.log(response);
  29.       });
RAW Paste Data
Top