Showing
9 changed files
with
53 additions
and
51 deletions
@@ -6,6 +6,7 @@ | @@ -6,6 +6,7 @@ | ||
6 | 'use strict'; | 6 | 'use strict'; |
7 | const api = global.yoho.API; | 7 | const api = global.yoho.API; |
8 | const serviceAPI = global.yoho.ServiceAPI; | 8 | const serviceAPI = global.yoho.ServiceAPI; |
9 | +const config = global.yoho.config; | ||
9 | 10 | ||
10 | /** | 11 | /** |
11 | * 分开取数,品牌一览 顶部的轮翻广告及热门品牌数据-PC | 12 | * 分开取数,品牌一览 顶部的轮翻广告及热门品牌数据-PC |
@@ -15,7 +16,7 @@ const serviceAPI = global.yoho.ServiceAPI; | @@ -15,7 +16,7 @@ const serviceAPI = global.yoho.ServiceAPI; | ||
15 | const getBrandTopData = (contentCode) => { | 16 | const getBrandTopData = (contentCode) => { |
16 | return serviceAPI.get('operations/api/v5/resource/get', { | 17 | return serviceAPI.get('operations/api/v5/resource/get', { |
17 | content_code: contentCode | 18 | content_code: contentCode |
18 | - }, {cache: 3600}); | 19 | + }, config.apiCache); |
19 | }; | 20 | }; |
20 | 21 | ||
21 | /** | 22 | /** |
@@ -28,7 +29,7 @@ const getBrandListData = channel => { | @@ -28,7 +29,7 @@ const getBrandListData = channel => { | ||
28 | if (!isNaN(channel)) { | 29 | if (!isNaN(channel)) { |
29 | params.yh_channel = channel; | 30 | params.yh_channel = channel; |
30 | } | 31 | } |
31 | - return api.get('', params); | 32 | + return api.get('', params, config.apiCache); |
32 | }; | 33 | }; |
33 | 34 | ||
34 | /** | 35 | /** |
@@ -48,7 +49,7 @@ const getBrandIntro = (brandId, uid) => { | @@ -48,7 +49,7 @@ const getBrandIntro = (brandId, uid) => { | ||
48 | method: 'app.brand.getBrandIntro', | 49 | method: 'app.brand.getBrandIntro', |
49 | brand_id: brandId, | 50 | brand_id: brandId, |
50 | uid: uid | 51 | uid: uid |
51 | - }, param); | 52 | + }, param, config.apiCache); |
52 | }; | 53 | }; |
53 | 54 | ||
54 | /** | 55 | /** |
@@ -61,7 +62,7 @@ const getProductByBrand = (brandId, limit) => { | @@ -61,7 +62,7 @@ const getProductByBrand = (brandId, limit) => { | ||
61 | method: 'web.search.search', | 62 | method: 'web.search.search', |
62 | brand: brandId, | 63 | brand: brandId, |
63 | limit: limit | 64 | limit: limit |
64 | - }); | 65 | + }, config.apiCache); |
65 | }; | 66 | }; |
66 | 67 | ||
67 | /** | 68 | /** |
@@ -74,7 +75,7 @@ const getBrandInfoByIds = (ids) => { | @@ -74,7 +75,7 @@ const getBrandInfoByIds = (ids) => { | ||
74 | return api.get('', { | 75 | return api.get('', { |
75 | method: 'web.brand.info', | 76 | method: 'web.brand.info', |
76 | ids: ids instanceof Array ? ids.join(',') : parseInt(ids, 10) | 77 | ids: ids instanceof Array ? ids.join(',') : parseInt(ids, 10) |
77 | - }, {cache: 3600}); | 78 | + }, config.apiCache); |
78 | }; | 79 | }; |
79 | 80 | ||
80 | /** | 81 | /** |
@@ -89,7 +90,7 @@ const getPlusstarList = (brandType, gender) => { | @@ -89,7 +90,7 @@ const getPlusstarList = (brandType, gender) => { | ||
89 | return serviceAPI.get('guang/api/v3/plustar/getlist', { | 90 | return serviceAPI.get('guang/api/v3/plustar/getlist', { |
90 | gender: gender, | 91 | gender: gender, |
91 | brand_type: brandType | 92 | brand_type: brandType |
92 | - }, {cache: 3600}); | 93 | + }, config.apiCache); |
93 | }; | 94 | }; |
94 | 95 | ||
95 | module.exports = { | 96 | module.exports = { |
@@ -10,6 +10,7 @@ const _ = require('lodash'); | @@ -10,6 +10,7 @@ const _ = require('lodash'); | ||
10 | const dataMap = require('../../../config/data-map'); | 10 | const dataMap = require('../../../config/data-map'); |
11 | 11 | ||
12 | const helpers = global.yoho.helpers; | 12 | const helpers = global.yoho.helpers; |
13 | +const config = global.yoho.config; | ||
13 | 14 | ||
14 | const processProduct = require(`${global.utils}/product-process`).processProduct; | 15 | const processProduct = require(`${global.utils}/product-process`).processProduct; |
15 | const searchApi = require('../../product/models/search-api'); | 16 | const searchApi = require('../../product/models/search-api'); |
@@ -335,7 +336,7 @@ const _getGirlsSingleHot = (args, type) => { | @@ -335,7 +336,7 @@ const _getGirlsSingleHot = (args, type) => { | ||
335 | page: 1, | 336 | page: 1, |
336 | gender: channelMap[type].gender, | 337 | gender: channelMap[type].gender, |
337 | limit: 60 | 338 | limit: 60 |
338 | - }); | 339 | + }, config.apiCache); |
339 | }; | 340 | }; |
340 | 341 | ||
341 | 342 | ||
@@ -592,18 +593,18 @@ const _processFloorData = (rawData, type) => { | @@ -592,18 +593,18 @@ const _processFloorData = (rawData, type) => { | ||
592 | let queryParam = ''; | 593 | let queryParam = ''; |
593 | 594 | ||
594 | if (data.template_name === 'recommend_content_three' || | 595 | if (data.template_name === 'recommend_content_three' || |
595 | - (data.template_intro === '焦点图' && index === 0)) { // 处理banner | 596 | + (data.template_intro === '焦点图' && index === 0)) { // 处理banner |
596 | floorData = floorMap.slide.call(null, data.data); | 597 | floorData = floorMap.slide.call(null, data.data); |
597 | } else if (data.template_intro === '热门品类') { // 处理热门品类 | 598 | } else if (data.template_intro === '热门品类') { // 处理热门品类 |
598 | floorData = floorMap.hot.call(null, rawData.slice(index, index + hotCategoryLength), type); | 599 | floorData = floorMap.hot.call(null, rawData.slice(index, index + hotCategoryLength), type); |
599 | } else if (data.data && data.data.text) { // 处理一般楼层 | 600 | } else if (data.data && data.data.text) { // 处理一般楼层 |
600 | let text = _getText(data.data.text); | 601 | let text = _getText(data.data.text); |
601 | let lastIndex = index + bigFloorLength < rawData.length ? | 602 | let lastIndex = index + bigFloorLength < rawData.length ? |
602 | - index + bigFloorLength : index + (rawData.length - index - 1); | 603 | + index + bigFloorLength : index + (rawData.length - index - 1); |
603 | 604 | ||
604 | 605 | ||
605 | floorData = floorMap[text] && | 606 | floorData = floorMap[text] && |
606 | - floorMap[text].call(null, rawData.slice(index, lastIndex), type); | 607 | + floorMap[text].call(null, rawData.slice(index, lastIndex), type); |
607 | 608 | ||
608 | if (needQuery[text]) { | 609 | if (needQuery[text]) { |
609 | queryParam = getQuery(rawData.slice(index, lastIndex)); | 610 | queryParam = getQuery(rawData.slice(index, lastIndex)); |
@@ -657,9 +658,7 @@ const _processFloorData = (rawData, type) => { | @@ -657,9 +658,7 @@ const _processFloorData = (rawData, type) => { | ||
657 | }; | 658 | }; |
658 | 659 | ||
659 | const _formatResourceParams = (channel, code) => { | 660 | const _formatResourceParams = (channel, code) => { |
660 | - return serviceApi.get('operations/api/v5/resource/get', {content_code: code}, { | ||
661 | - cache: true | ||
662 | - }).then(data => { | 661 | + return serviceApi.get('operations/api/v5/resource/get', {content_code: code}, config.apiCache).then(data => { |
663 | let result = data && data.data[0] && data.data[0].data[0]; | 662 | let result = data && data.data[0] && data.data[0].data[0]; |
664 | 663 | ||
665 | if (result) { | 664 | if (result) { |
@@ -834,8 +833,6 @@ const getNewArrival = channel => { | @@ -834,8 +833,6 @@ const getNewArrival = channel => { | ||
834 | }; | 833 | }; |
835 | 834 | ||
836 | 835 | ||
837 | - | ||
838 | - | ||
839 | /** | 836 | /** |
840 | * 获取频道页数据 | 837 | * 获取频道页数据 |
841 | * @param {String} type 传入频道页类型,值可以是: boys, girls, kids, lifestyle | 838 | * @param {String} type 传入频道页类型,值可以是: boys, girls, kids, lifestyle |
@@ -956,9 +953,7 @@ const getIndexGuideData = () => { | @@ -956,9 +953,7 @@ const getIndexGuideData = () => { | ||
956 | private_key: '0ed29744ed318fd28d2c07985d3ba633' | 953 | private_key: '0ed29744ed318fd28d2c07985d3ba633' |
957 | }; | 954 | }; |
958 | 955 | ||
959 | - return serviceApi.get('operations/api/v6/category/getCategory', params, { | ||
960 | - cache: true | ||
961 | - }); | 956 | + return serviceApi.get('operations/api/v6/category/getCategory', params, config.apiCache); |
962 | }; | 957 | }; |
963 | 958 | ||
964 | module.exports = { | 959 | module.exports = { |
@@ -5,12 +5,13 @@ | @@ -5,12 +5,13 @@ | ||
5 | 'use strict'; | 5 | 'use strict'; |
6 | 6 | ||
7 | const api = global.yoho.API; | 7 | const api = global.yoho.API; |
8 | +const config = global.yoho.config; | ||
8 | 9 | ||
9 | const getBannerInfoAsync = bid => { | 10 | const getBannerInfoAsync = bid => { |
10 | return api.get('', { | 11 | return api.get('', { |
11 | method: 'web.brand.banner', | 12 | method: 'web.brand.banner', |
12 | brand_id: bid | 13 | brand_id: bid |
13 | - }); | 14 | + }, config.apiCache); |
14 | 15 | ||
15 | }; | 16 | }; |
16 | 17 | ||
@@ -18,7 +19,7 @@ const getBrandLogoByDomainAsync = domain => { | @@ -18,7 +19,7 @@ const getBrandLogoByDomainAsync = domain => { | ||
18 | return api.get('', { | 19 | return api.get('', { |
19 | domain: domain, | 20 | domain: domain, |
20 | method: 'web.brand.byDomain' | 21 | method: 'web.brand.byDomain' |
21 | - }); | 22 | + }, config.apiCache); |
22 | }; | 23 | }; |
23 | 24 | ||
24 | module.exports = { | 25 | module.exports = { |
@@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
5 | 'use strict'; | 5 | 'use strict'; |
6 | 6 | ||
7 | const api = global.yoho.API; | 7 | const api = global.yoho.API; |
8 | +const config = global.yoho.config; | ||
8 | 9 | ||
9 | /** | 10 | /** |
10 | * 获取商品的热区 | 11 | * 获取商品的热区 |
@@ -13,7 +14,7 @@ const indexAsync = pid => { | @@ -13,7 +14,7 @@ const indexAsync = pid => { | ||
13 | return api.get('', { | 14 | return api.get('', { |
14 | method: 'web.productCollocation.list', | 15 | method: 'web.productCollocation.list', |
15 | product_id: pid | 16 | product_id: pid |
16 | - }); | 17 | + }, config.apiCache); |
17 | }; | 18 | }; |
18 | 19 | ||
19 | module.exports = { | 20 | module.exports = { |
@@ -10,6 +10,7 @@ | @@ -10,6 +10,7 @@ | ||
10 | const serviceApi = global.yoho.ServiceAPI; | 10 | const serviceApi = global.yoho.ServiceAPI; |
11 | const api = global.yoho.API; | 11 | const api = global.yoho.API; |
12 | const _ = require('lodash'); | 12 | const _ = require('lodash'); |
13 | +const config = global.yoho.config; | ||
13 | 14 | ||
14 | const yhChannel = { | 15 | const yhChannel = { |
15 | boys: { | 16 | boys: { |
@@ -49,7 +50,7 @@ exports.getOutletsActivityOrigin = (params) => { | @@ -49,7 +50,7 @@ exports.getOutletsActivityOrigin = (params) => { | ||
49 | size: params.size || 0, | 50 | size: params.size || 0, |
50 | yh_channel: yhChannel[tempChannel].channel, | 51 | yh_channel: yhChannel[tempChannel].channel, |
51 | type: params.type || 0 | 52 | type: params.type || 0 |
52 | - }); | 53 | + }, config.apiCache); |
53 | }; | 54 | }; |
54 | 55 | ||
55 | /** | 56 | /** |
@@ -58,7 +59,7 @@ exports.getOutletsActivityOrigin = (params) => { | @@ -58,7 +59,7 @@ exports.getOutletsActivityOrigin = (params) => { | ||
58 | * @return {[type]} | 59 | * @return {[type]} |
59 | */ | 60 | */ |
60 | exports.getChannelResouceData = (params) => { | 61 | exports.getChannelResouceData = (params) => { |
61 | - return serviceApi.get('operations/api/v5/resource/home', params); | 62 | + return serviceApi.get('operations/api/v5/resource/home', params, config.apiCache); |
62 | }; | 63 | }; |
63 | 64 | ||
64 | /** | 65 | /** |
@@ -77,7 +78,7 @@ exports.getOutletsTrendData = (params) => { | @@ -77,7 +78,7 @@ exports.getOutletsTrendData = (params) => { | ||
77 | stocknumber: 1, // 过滤出库存 > 1的商品 | 78 | stocknumber: 1, // 过滤出库存 > 1的商品 |
78 | limit: params.limit || 5, | 79 | limit: params.limit || 5, |
79 | outlets: params.outlets || 1 // 默认取奥莱商品 | 80 | outlets: params.outlets || 1 // 默认取奥莱商品 |
80 | - }); | 81 | + }, config.apiCache); |
81 | }; | 82 | }; |
82 | 83 | ||
83 | 84 | ||
@@ -110,5 +111,5 @@ exports.getOutletsGoodsList = (params) => { | @@ -110,5 +111,5 @@ exports.getOutletsGoodsList = (params) => { | ||
110 | tempParams[paramsName] = params[paramsName]; | 111 | tempParams[paramsName] = params[paramsName]; |
111 | } | 112 | } |
112 | }); | 113 | }); |
113 | - return api.get('', tempParams); | 114 | + return api.get('', tempParams, config.apiCache); |
114 | }; | 115 | }; |
@@ -10,6 +10,7 @@ | @@ -10,6 +10,7 @@ | ||
10 | const serviceAPI = global.yoho.ServiceAPI; | 10 | const serviceAPI = global.yoho.ServiceAPI; |
11 | const api = global.yoho.API; | 11 | const api = global.yoho.API; |
12 | const _ = require('lodash'); | 12 | const _ = require('lodash'); |
13 | +const config = global.yoho.config; | ||
13 | 14 | ||
14 | const yhChannel = { | 15 | const yhChannel = { |
15 | boys: { | 16 | boys: { |
@@ -42,7 +43,7 @@ exports.getSaleGoodsList = (params) => { | @@ -42,7 +43,7 @@ exports.getSaleGoodsList = (params) => { | ||
42 | finalParams.yh_channel = yhChannel[params.channel].channel; | 43 | finalParams.yh_channel = yhChannel[params.channel].channel; |
43 | } | 44 | } |
44 | 45 | ||
45 | - return api.get('', Object.assign(finalParams, params)); | 46 | + return api.get('', Object.assign(finalParams, params), config.apiCache); |
46 | }; | 47 | }; |
47 | 48 | ||
48 | /** | 49 | /** |
@@ -55,7 +56,7 @@ exports.getSalebreakingYardsSortList = (params) => { | @@ -55,7 +56,7 @@ exports.getSalebreakingYardsSortList = (params) => { | ||
55 | return api.get('', { | 56 | return api.get('', { |
56 | method: 'app.sale.getBreakingSort', | 57 | method: 'app.sale.getBreakingSort', |
57 | yh_channel: yhChannel[tempChannel].channel | 58 | yh_channel: yhChannel[tempChannel].channel |
58 | - }); | 59 | + }, config.apiCache); |
59 | }; | 60 | }; |
60 | 61 | ||
61 | /** | 62 | /** |
@@ -71,7 +72,7 @@ exports.getSaleActivityList = (params, channel) => { | @@ -71,7 +72,7 @@ exports.getSaleActivityList = (params, channel) => { | ||
71 | sort: '2', | 72 | sort: '2', |
72 | plateform: '1', | 73 | plateform: '1', |
73 | yh_channel: tempChannel.channel | 74 | yh_channel: tempChannel.channel |
74 | - }); | 75 | + }, config.apiCache); |
75 | }; | 76 | }; |
76 | 77 | ||
77 | /** | 78 | /** |
@@ -81,7 +82,7 @@ exports.getSaleActivityList = (params, channel) => { | @@ -81,7 +82,7 @@ exports.getSaleActivityList = (params, channel) => { | ||
81 | exports.getSaleBannerList = (cCode) => { | 82 | exports.getSaleBannerList = (cCode) => { |
82 | return serviceAPI.get('operations/api/v5/resource/get', { | 83 | return serviceAPI.get('operations/api/v5/resource/get', { |
83 | content_code: cCode | 84 | content_code: cCode |
84 | - }); | 85 | + }, config.apiCache); |
85 | }; | 86 | }; |
86 | 87 | ||
87 | /** | 88 | /** |
@@ -91,7 +92,7 @@ exports.getSaleBannerList = (cCode) => { | @@ -91,7 +92,7 @@ exports.getSaleBannerList = (cCode) => { | ||
91 | exports.getLeftContentList = () => { | 92 | exports.getLeftContentList = () => { |
92 | return api.get('', { | 93 | return api.get('', { |
93 | method: 'app.sort.get' | 94 | method: 'app.sort.get' |
94 | - }); | 95 | + }, config.apiCache); |
95 | }; | 96 | }; |
96 | 97 | ||
97 | /** | 98 | /** |
@@ -7,6 +7,7 @@ const md5 = require('md5'); | @@ -7,6 +7,7 @@ const md5 = require('md5'); | ||
7 | 7 | ||
8 | const api = global.yoho.API; | 8 | const api = global.yoho.API; |
9 | const serviceApi = global.yoho.ServiceAPI; | 9 | const serviceApi = global.yoho.ServiceAPI; |
10 | +const config = global.yoho.config; | ||
10 | 11 | ||
11 | const helpers = global.yoho.helpers; | 12 | const helpers = global.yoho.helpers; |
12 | const cache = global.yoho.cache; | 13 | const cache = global.yoho.cache; |
@@ -17,7 +18,7 @@ const images = require('../../../utils/images.js'); | @@ -17,7 +18,7 @@ const images = require('../../../utils/images.js'); | ||
17 | const getSortByConditionAsync = (condition) => { | 18 | const getSortByConditionAsync = (condition) => { |
18 | return api.get('', Object.assign({ | 19 | return api.get('', Object.assign({ |
19 | method: 'web.regular.groupsort' | 20 | method: 'web.regular.groupsort' |
20 | - }, condition)); | 21 | + }, condition), config.apiCache); |
21 | }; | 22 | }; |
22 | 23 | ||
23 | // 判断用户是否收藏品牌 | 24 | // 判断用户是否收藏品牌 |
@@ -97,7 +98,7 @@ const getProductList = (params) => { | @@ -97,7 +98,7 @@ const getProductList = (params) => { | ||
97 | } | 98 | } |
98 | }; | 99 | }; |
99 | 100 | ||
100 | -const getSortListOrig = (finalParams) => api.get('', finalParams); | 101 | +const getSortListOrig = (finalParams) => api.get('', finalParams, config.apiCache); |
101 | 102 | ||
102 | /** | 103 | /** |
103 | * 获取分类列表 | 104 | * 获取分类列表 |
@@ -153,7 +154,7 @@ const getSortIntro = (params) => { | @@ -153,7 +154,7 @@ const getSortIntro = (params) => { | ||
153 | }; | 154 | }; |
154 | 155 | ||
155 | Object.assign(finalParams, params); | 156 | Object.assign(finalParams, params); |
156 | - return api.get('', finalParams); | 157 | + return api.get('', finalParams, config.apiCache); |
157 | }; | 158 | }; |
158 | 159 | ||
159 | /** | 160 | /** |
@@ -166,7 +167,7 @@ const getSortAds = (params) => { | @@ -166,7 +167,7 @@ const getSortAds = (params) => { | ||
166 | }; | 167 | }; |
167 | 168 | ||
168 | Object.assign(finalParams, params); | 169 | Object.assign(finalParams, params); |
169 | - return api.get('', finalParams); | 170 | + return api.get('', finalParams, config.apiCache); |
170 | }; | 171 | }; |
171 | 172 | ||
172 | /** | 173 | /** |
@@ -181,7 +182,7 @@ const getBrandSeries = (params) => { | @@ -181,7 +182,7 @@ const getBrandSeries = (params) => { | ||
181 | status: params.status || 1 | 182 | status: params.status || 1 |
182 | }; | 183 | }; |
183 | 184 | ||
184 | - return api.get('', finalParams); | 185 | + return api.get('', finalParams, config.apiCache); |
185 | }; | 186 | }; |
186 | 187 | ||
187 | /** | 188 | /** |
@@ -196,7 +197,7 @@ const getBrandFolder = (params) => { | @@ -196,7 +197,7 @@ const getBrandFolder = (params) => { | ||
196 | status: params.status || 1 | 197 | status: params.status || 1 |
197 | }; | 198 | }; |
198 | 199 | ||
199 | - return api.get('', finalParams); | 200 | + return api.get('', finalParams, config.apiCache); |
200 | }; | 201 | }; |
201 | 202 | ||
202 | /** | 203 | /** |
@@ -210,7 +211,7 @@ const getNodeContent = (params) => { | @@ -210,7 +211,7 @@ const getNodeContent = (params) => { | ||
210 | node: params.node || '' | 211 | node: params.node || '' |
211 | }; | 212 | }; |
212 | 213 | ||
213 | - return api.get('', finalParams); | 214 | + return api.get('', finalParams, config.apiCache); |
214 | }; | 215 | }; |
215 | 216 | ||
216 | /** | 217 | /** |
@@ -224,7 +225,7 @@ const getWeekNew = (params) => { | @@ -224,7 +225,7 @@ const getWeekNew = (params) => { | ||
224 | }; | 225 | }; |
225 | 226 | ||
226 | Object.assign(finalParams, params); | 227 | Object.assign(finalParams, params); |
227 | - return api.get('', finalParams); | 228 | + return api.get('', finalParams, config.apiCache); |
228 | }; | 229 | }; |
229 | 230 | ||
230 | /** | 231 | /** |
@@ -427,7 +428,7 @@ const getSuggest = (params) => { | @@ -427,7 +428,7 @@ const getSuggest = (params) => { | ||
427 | keyword: params.keyword || '' | 428 | keyword: params.keyword || '' |
428 | }; | 429 | }; |
429 | 430 | ||
430 | - return api.get('', finalParams); | 431 | + return api.get('', finalParams, config.apiCache); |
431 | }; | 432 | }; |
432 | 433 | ||
433 | 434 | ||
@@ -441,7 +442,7 @@ const getBrandData = (params) => { | @@ -441,7 +442,7 @@ const getBrandData = (params) => { | ||
441 | domain: params.domain || '' | 442 | domain: params.domain || '' |
442 | }; | 443 | }; |
443 | 444 | ||
444 | - return api.get('', finalParams); | 445 | + return api.get('', finalParams, config.apiCache); |
445 | }; | 446 | }; |
446 | 447 | ||
447 | /** | 448 | /** |
@@ -452,7 +453,7 @@ const isFavoriteBrand = (uid, brandId) => { | @@ -452,7 +453,7 @@ const isFavoriteBrand = (uid, brandId) => { | ||
452 | return serviceApi.get(isFavoriteBrandUrl, { | 453 | return serviceApi.get(isFavoriteBrandUrl, { |
453 | uid: uid, | 454 | uid: uid, |
454 | brandId: brandId | 455 | brandId: brandId |
455 | - }); | 456 | + }, config.apiCache); |
456 | }; | 457 | }; |
457 | 458 | ||
458 | /** | 459 | /** |
@@ -4,6 +4,7 @@ | @@ -4,6 +4,7 @@ | ||
4 | 'use strict'; | 4 | 'use strict'; |
5 | 5 | ||
6 | const api = global.yoho.API; | 6 | const api = global.yoho.API; |
7 | +const config = global.yoho.config; | ||
7 | 8 | ||
8 | /** | 9 | /** |
9 | * 获取店铺装修的所有资源接口 | 10 | * 获取店铺装修的所有资源接口 |
@@ -12,5 +13,5 @@ exports.shopsDecoratorListAsync = shopId => { | @@ -12,5 +13,5 @@ exports.shopsDecoratorListAsync = shopId => { | ||
12 | return api.get('', { | 13 | return api.get('', { |
13 | method: 'app.shopsdecorator.getList', | 14 | method: 'app.shopsdecorator.getList', |
14 | shop_id: shopId | 15 | shop_id: shopId |
15 | - }); | 16 | + }, config.apiCache); |
16 | }; | 17 | }; |
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | 'use strict'; | 6 | 'use strict'; |
7 | 7 | ||
8 | const api = global.yoho.API; | 8 | const api = global.yoho.API; |
9 | -const config = require('../../../config/common'); | 9 | +const config = global.yoho.config; |
10 | const searchApi = require('./search-api'); | 10 | const searchApi = require('./search-api'); |
11 | const cache = global.yoho.cache; | 11 | const cache = global.yoho.cache; |
12 | const logger = global.yoho.logger; | 12 | const logger = global.yoho.logger; |
@@ -17,7 +17,7 @@ const logger = global.yoho.logger; | @@ -17,7 +17,7 @@ const logger = global.yoho.logger; | ||
17 | */ | 17 | */ |
18 | exports.getVerifiedTotal = () => { | 18 | exports.getVerifiedTotal = () => { |
19 | 19 | ||
20 | - return api.get('', {method: 'app.student.verifiedStudentTotal'}); | 20 | + return api.get('', {method: 'app.student.verifiedStudentTotal'}, config.apiCache); |
21 | }; | 21 | }; |
22 | 22 | ||
23 | /** | 23 | /** |
@@ -26,7 +26,7 @@ exports.getVerifiedTotal = () => { | @@ -26,7 +26,7 @@ exports.getVerifiedTotal = () => { | ||
26 | */ | 26 | */ |
27 | exports.getEduLevelList = () => { | 27 | exports.getEduLevelList = () => { |
28 | 28 | ||
29 | - return api.get('', {method: 'app.studentMarket.getEducationLevelList'}); | 29 | + return api.get('', {method: 'app.studentMarket.getEducationLevelList'}, config.apiCache); |
30 | }; | 30 | }; |
31 | 31 | ||
32 | /** | 32 | /** |
@@ -38,7 +38,7 @@ exports.getArea = () => { | @@ -38,7 +38,7 @@ exports.getArea = () => { | ||
38 | method: 'app.studentMarket.getAddressList' | 38 | method: 'app.studentMarket.getAddressList' |
39 | }; | 39 | }; |
40 | 40 | ||
41 | - return api.get('', finalParams); | 41 | + return api.get('', finalParams, config.apiCache); |
42 | }; | 42 | }; |
43 | 43 | ||
44 | /** | 44 | /** |
@@ -51,7 +51,7 @@ exports.getSchool = (areaCode) => { | @@ -51,7 +51,7 @@ exports.getSchool = (areaCode) => { | ||
51 | areaCode: areaCode | 51 | areaCode: areaCode |
52 | }; | 52 | }; |
53 | 53 | ||
54 | - return api.get('', finalParams); | 54 | + return api.get('', finalParams, config.apiCache); |
55 | }; | 55 | }; |
56 | 56 | ||
57 | /** | 57 | /** |
@@ -66,7 +66,7 @@ exports.getStuProducts = (params) => { | @@ -66,7 +66,7 @@ exports.getStuProducts = (params) => { | ||
66 | }; | 66 | }; |
67 | 67 | ||
68 | Object.assign(finalParams, params); | 68 | Object.assign(finalParams, params); |
69 | - return api.get('', finalParams); | 69 | + return api.get('', finalParams, config.apiCache); |
70 | }; | 70 | }; |
71 | 71 | ||
72 | /** | 72 | /** |
@@ -82,7 +82,7 @@ exports.verifyIdentity = (uid, certNo, name, pageUrl) => { | @@ -82,7 +82,7 @@ exports.verifyIdentity = (uid, certNo, name, pageUrl) => { | ||
82 | page_url: pageUrl | 82 | page_url: pageUrl |
83 | }; | 83 | }; |
84 | 84 | ||
85 | - return api.get('', finalParams); | 85 | + return api.get('', finalParams, config.apiCache); |
86 | }; | 86 | }; |
87 | 87 | ||
88 | /** | 88 | /** |
@@ -99,7 +99,7 @@ exports.verifyStudent = (uid, collegeName, educationDegree, enrollmentYear) => { | @@ -99,7 +99,7 @@ exports.verifyStudent = (uid, collegeName, educationDegree, enrollmentYear) => { | ||
99 | enrollment_year: enrollmentYear | 99 | enrollment_year: enrollmentYear |
100 | }; | 100 | }; |
101 | 101 | ||
102 | - return api.get('', finalParams); | 102 | + return api.get('', finalParams, config.apiCache); |
103 | }; | 103 | }; |
104 | 104 | ||
105 | /** | 105 | /** |
@@ -117,7 +117,7 @@ exports.userAcquireStatus = (uid, couponIds) => { | @@ -117,7 +117,7 @@ exports.userAcquireStatus = (uid, couponIds) => { | ||
117 | finalParams.uid = uid; | 117 | finalParams.uid = uid; |
118 | } | 118 | } |
119 | 119 | ||
120 | - return api.get('', finalParams); | 120 | + return api.get('', finalParams, config.apiCache); |
121 | }; | 121 | }; |
122 | 122 | ||
123 | 123 |
-
Please register or login to post a comment