commodity.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. define([ 'ngResource' ], function() {
  2. 'use strict';
  3. angular.module('commodityServices', [ 'ngResource' ]).factory('Commodity', ['$resource', 'BaseService', function($resource, BaseService) {
  4. var rootPath = BaseService.getRootPath();
  5. return $resource('/api/commodity-service/commodities', {}, {
  6. /**
  7. * 获取库存列表信息
  8. */
  9. pageStoreCommoditiesByEnInfos: {
  10. url: rootPath + '/api/commodity/commodities',
  11. method: 'GET',
  12. params : { origin : 'store'}
  13. },
  14. /**
  15. * 根据批次号获取商品信息
  16. */
  17. findByBatchCode: {
  18. url: rootPath + '/api/commodity/:batchCode/detail',
  19. method: 'GET'
  20. },
  21. /**
  22. * 根据商品器件UUID获取器件信息
  23. */
  24. findComponentByUuid: {
  25. url: rootPath + '/api/commodity/component/:componentUuid',
  26. method: 'GET'
  27. },
  28. /**
  29. * 获取店铺所有商品的列表结构信息
  30. */
  31. getAllKindsInfoByStoreUuid: {
  32. url: rootPath + '/api/commodity/components/kinds',
  33. method: 'GET',
  34. isArray: true
  35. },
  36. // 分页获取批次信息
  37. findPageGoods: {
  38. url : rootPath + '/api/commodity/goods/page',
  39. method : 'GET'
  40. },
  41. /**
  42. * 返回所有类目信息
  43. */
  44. getAllKindInfo: {
  45. url : rootPath + '/commodity-service/kinds',
  46. method: 'GET',
  47. isArray: true
  48. }
  49. });
  50. }]);
  51. });