storeInfo.js 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. define([ 'ngResource' ], function() {
  2. 'use strict';
  3. angular.module('storeInfoServices', [ 'ngResource' ]).factory('StoreInfo', ['$resource', 'BaseService', function($resource, BaseService) {
  4. return $resource('api/store-service/stores', {}, {
  5. /**
  6. * 根据店铺UUID获取店铺信息
  7. */
  8. findByUuid: {
  9. url: 'api/store-service/stores',
  10. method: 'GET'
  11. },
  12. /**
  13. * 获取当前企业的上一条开铺申请信息
  14. */
  15. findLastUnPassApplyByEnuu: {
  16. url: 'store-service/applications',
  17. method: 'GET',
  18. params: {
  19. name: 'findLastUnPass'
  20. }
  21. },
  22. /**
  23. * 申请开店铺
  24. */
  25. applyToOpenStore: {
  26. url : 'store-service/applications',
  27. method: 'POST'
  28. },
  29. /**
  30. * 通过器件uuid获取店铺信息
  31. */
  32. findStoreByUuid: {
  33. url: 'api/store-service/stores/uuid/:uuid',
  34. method: 'GET',
  35. isArray: true
  36. },
  37. getUmallStoreId: {
  38. url: 'api/store-service/stores/UmallStore',
  39. method: 'GET'
  40. },
  41. /**
  42. * 分页获取待处理的店铺申请
  43. * @Deprecated
  44. */
  45. getPrepareHandlerApplications: {
  46. url: 'store-service/applications',
  47. method: 'GET',
  48. params: {
  49. operate : 'page'
  50. }
  51. },
  52. /**
  53. * 分页获取店铺审核信息
  54. *
  55. * @param params 分页参数
  56. * @param status 店铺审核状态
  57. * @param type 店铺类型
  58. * @param keyword 搜索关键字,主要是公司名称
  59. */
  60. pageStoreApplications: {
  61. url: 'store-service/applications',
  62. method: 'GET',
  63. params: {
  64. operate: 'authPage'
  65. }
  66. },
  67. /**
  68. * 保存店铺申请信息
  69. *
  70. * @param uuid 店铺申请UUID
  71. * @param apply 待更新店铺申请信息
  72. */
  73. saveUpdateOfApply: {
  74. url: 'store-service/applications',
  75. method: 'PUT',
  76. params: {
  77. operate: 'OnlyUpdate'
  78. }
  79. },
  80. handlerApply: {
  81. url: 'store-service/applications',
  82. method: 'PUT'
  83. },
  84. getStoreInfoByEnuu: {
  85. url: 'store-service/stores',
  86. method: 'GET',
  87. params : {
  88. filter : 'enUU'
  89. }
  90. },
  91. getUuidByEnuu: {
  92. url: 'store-service/byEnUU/uuid',
  93. method: 'GET'
  94. },
  95. // 分页获取店铺信息
  96. findStoresByPage : {
  97. url : 'api/store-service/stores',
  98. method : 'GET',
  99. params : {
  100. op : 'page'
  101. }
  102. },
  103. // 分页获取店铺信息,根据店铺名称过滤
  104. findStoresPageByKeyword : {
  105. url : 'store-service/stores/page',
  106. method : 'GET'
  107. },
  108. // 检测当前企业是否已开店铺
  109. existStore : {
  110. url : 'store-service/stores',
  111. method : 'GET',
  112. params : {
  113. op : 'check'
  114. }
  115. },
  116. // 查询当前企业的店铺申请状态信息
  117. checkShopOwnerApplyStatus : {
  118. url : 'store-service/applications',
  119. method : 'GET',
  120. params : {
  121. operator : 'owner'
  122. }
  123. },
  124. // 获取一个新开的推荐店铺信息
  125. getNewStore : {
  126. url : 'store-service/stores/new',
  127. method : 'GET'
  128. },
  129. // 根据店铺申请UUID获取店铺申请信息
  130. findApplyByUuid : {
  131. url : 'store-service/applications',
  132. method : 'GET'
  133. },
  134. // 获取当前店铺的待处理和已通过申请信息,应当有且只有一条记录
  135. findShopOwnerApplyByNormalStatus : {
  136. url : 'store-service/applications',
  137. method : 'GET',
  138. params : {
  139. status : 'normal'
  140. }
  141. },
  142. // 卖家确认开铺
  143. confirmOpenStore : {
  144. url : 'store-service/applications',
  145. method : 'PUT',
  146. params : {
  147. operate : 'confirm'
  148. }
  149. },
  150. // 店家维护店铺的基础信息
  151. updateStoreInfo : {
  152. url : 'store-service/stores/:uuid',
  153. method : 'PUT'
  154. },
  155. //根据店铺类型获取前5的店铺信息
  156. fiveStoresByTypes : {
  157. url : 'api/store-service/stores/five',
  158. method : 'GET',
  159. isArray : true
  160. },
  161. // 根据店铺的类型统计店铺数量信息
  162. countByStatusType : {
  163. url : 'api/store-service/stores/type/count',
  164. method : 'GET'
  165. },
  166. // 根据店铺类型和关键字信息分页获取店铺信息
  167. pageStoresByTypesAndKeyword : {
  168. url : 'api/store-service/stores',
  169. method : 'GET',
  170. params : {
  171. op : 'pageByType'
  172. }
  173. },
  174. // 获取最近开店的店铺信息
  175. findNewStore : {
  176. url : 'api/store-service/stores',
  177. method : 'GET',
  178. params : {
  179. filter : 'newStore'
  180. }
  181. },
  182. // 获取交易量前几的店铺的信息
  183. findTopStoreBySales : {
  184. url : 'api/store-service/stores',
  185. method : 'GET',
  186. isArray : true,
  187. params : {
  188. filter : 'topBySales'
  189. }
  190. },
  191. // 店铺管理员管理店铺时,分页获取店铺信息
  192. pageStoreInfoWhenAdminQuery: {
  193. url: 'store-service/stores',
  194. method: 'GET',
  195. params: {
  196. op: 'admin_page_query'
  197. }
  198. },
  199. /**
  200. * 批量获取店铺的信息
  201. */
  202. getContactInfo: {
  203. url: 'store-service/storeids',
  204. method: 'GET',
  205. }
  206. });
  207. }]).factory('ConsignmentAgreementRecord', ['$resource', 'BaseService', function ($resource, BaseService) {
  208. // 自营转寄售协议,同意操作记录
  209. return $resource('auth/store/consignment/record', {}, {
  210. /**
  211. * 用户自营转寄售时,获取寄售协议
  212. */
  213. obtainAConsignmentAgreement: {
  214. url: 'http://www.usoftmall.com/api/help-service/issues/16',
  215. method: 'GET'
  216. },
  217. /**
  218. * 用户自营转寄售时,查询用户同意寄售协议的记录
  219. */
  220. findRecordOfUser: {
  221. url: 'auth/store/consignment/record/findByUser',
  222. method: 'GET'
  223. },
  224. /**
  225. * 用户第一次同意自营转寄售时,保存用户的操作记录信息
  226. *
  227. * @param record 操作记录信息
  228. */
  229. saveRecordWhenUserAgree: {
  230. url: 'auth/store/consignment/record',
  231. method: 'POST'
  232. },
  233. /**
  234. * 管理员在管理后台查看店铺信息时,按操作时间降序获取操作记录信息
  235. *
  236. * @param pageParams 分页参数
  237. * @param enUU 企业UU
  238. */
  239. pageRecordWhenAdminQueryInfo: {
  240. url: 'auth/store/consignment/record/pageByAdmin',
  241. method: 'GET'
  242. },
  243. /**
  244. * 后台管理员分页获取同意寄售协议的企业信息
  245. *
  246. * @param page 页码,默认从0开始,第一页页码为0
  247. * @param size 每页记录数目,默认10条
  248. */
  249. pageEnterpriseWhenAdminQueryRecord: {
  250. url: 'auth/store/consignment/record/pageEnterprise',
  251. method: 'GET'
  252. }
  253. });
  254. }]).factory('StoreAdsInformation', ['$resource', function ($resource) {
  255. return $resource('auth/api/store', {}, {
  256. /**
  257. * 当管理员推荐店铺的时候,保存店铺的广告信息
  258. *
  259. * @param type 店铺广告类型
  260. * @param store 店铺信息
  261. */
  262. tagStoreInWhenAdminRecommend: {
  263. url: 'auth/api/store/tag-store',
  264. method: 'PUT'
  265. },
  266. /**
  267. * 当管理员推荐店铺的时候,取消推荐店铺
  268. *
  269. * @param type 店铺广告类型
  270. * @param store 店铺信息
  271. */
  272. cancelStoreTagsWhenAdminCancel: {
  273. url: 'auth/api/store/cancel-tag',
  274. method: 'PUT'
  275. },
  276. /**
  277. * 用户获取热销店铺列表信息
  278. *
  279. * @param page 页面,默认从0开始
  280. * @param size 页面大小
  281. * @param types 店铺类型
  282. */
  283. showSalesListWhenUserQuery: {
  284. url: 'api/ads/store/sales-list',
  285. method: 'GET',
  286. isArray: true
  287. },
  288. /**
  289. * 用户获取优秀店铺列表信息
  290. *
  291. * @param page 页面,默认从0开始
  292. * @param size 页面大小
  293. * @param types 店铺类型
  294. */
  295. showExcellenceListWhenUserQuery: {
  296. url: 'api/ads/store/excellence-list',
  297. method: 'GET',
  298. isArray: true
  299. }
  300. });
  301. }]);
  302. });