installments.js 1.0 KB

123456789101112131415161718192021222324252627
  1. define([ 'ngResource' ], function() {
  2. angular.module('installmentServices', [ 'ngResource' ]).factory('Installment', ['$resource', 'BaseService', function($resource, BaseService) {
  3. var rootPath = BaseService.getRootPath();
  4. return $resource('/trade/installments', {}, {
  5. // 新增分期信息
  6. addInstallment: {
  7. url: rootPath + '/trade/installments',
  8. method: 'POST'
  9. },
  10. // 更新分期信息
  11. updateInstallment: {
  12. url: rootPath + '/trade/installments',
  13. method: 'PUT'
  14. },
  15. // 删除分期信息
  16. deleteInstallment: {
  17. url: rootPath + '/trade/installments/:purchaseId',
  18. method: 'DELETE'
  19. },
  20. // 验证是否能启用分期信息
  21. validationCount: {
  22. url: rootPath + '/trade/installments/:purchaseId/validate',
  23. method: 'GET'
  24. }
  25. });
  26. }])
  27. });