|
|
package com.yoho.search.consumer.index.fullbuild;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import com.yoho.search.consumer.index.common.IIndexBuilder;
|
|
|
import com.yoho.search.consumer.service.base.SknImageVectorsService;
|
|
|
import com.yoho.search.dal.model.SknImageVectors;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* Created by wangnan on 2017/7/27.
|
...
|
...
|
@@ -30,18 +28,18 @@ public class ImageVectorsIndexBuilder extends IIndexBuilder { |
|
|
public List<?> getPageLists(int offset, int limit) throws Exception {
|
|
|
List<Map<String,Object>> results = new ArrayList<Map<String,Object>>();
|
|
|
List<SknImageVectors> sknImageVectorsList = sknImageVectorsService.getPageLists(offset,limit);
|
|
|
for (SknImageVectors sknImageVectors : sknImageVectorsList) {
|
|
|
Map<String,Object> result = new HashMap<String, Object>();
|
|
|
result.put("productSkn",sknImageVectors.getProductSkn());
|
|
|
result.put("imgUrl",sknImageVectors.getImgUrl());
|
|
|
result.put("vectors",sknImageVectors.getVectors());
|
|
|
result.put("createTime",sknImageVectors.getCreateTime());
|
|
|
long random = 145770520 + (int)(10000 * Math.random());
|
|
|
result.put("vectors_32",random + ",3064349452,335806560,2181435200,671088930,304636988,286271040,1073741872,78792072,302262276,275415572,2152317976,2501484562,201606178,2477789697,1898189440,2181070873,562179,1143500865,681618177,570429440,419433157,2634376384,33894424,260046852,134754372,1309983506,327765,1114475,4751954,1353801744,139879026,549471617");
|
|
|
result.put("vectors_128",random + ",145770520,3064349452,335806560,2181435200,671088930,304636988,286271040,1073741872,78792072,302262276,275415572,2152317976,2501484562,201606178,2477789697,1898189440,2181070873,562179,1143500865,681618177,570429440,419433157,2634376384,33894424,260046852,134754372,1309983506,327765,1114475,4751954,1353801744,139879026,549471617,2491464322,1216608388,2249850888,536936961,1275183104,1679425556,146802912,17064578,985666161,2693863958,90720896,2315346182,1342769216,1077021157,411044198,1275757661,268634178,28377159,146354724,555754625,9439360,1249378,2517762067,276832513,339969674,67633187,2416766034,705206816,3238108736,3323996166,48255525,67152905,738644232,3355443282,847249547,2151816497,2416551620,3230152256,153315984,945373320,1159730176,17080355,2198110342,55198214,3289513993,1175749760,34213921,583618724,168312976,2165311811,204522048,180390282,1212663092,1351124312,34606016,706806272,100734720,1630732425,1073823908,563384330,536873053,2963308608,1074270241,337646622,3240230912,2875229798,2349404172,552112153,1329152,805963786,2172994050,1153434112,69360641,1412171537,1216881732,34613286,2177368840,2619490304,590464,127026387,847390820,337670664,1380327625,390079202,1535432836,3305349121,723751402,3240178208,2151744513,18874372,1142981696,1487227220,3250944274,262236,2483257479");
|
|
|
results.add(result);
|
|
|
}
|
|
|
return results;
|
|
|
// for (SknImageVectors sknImageVectors : sknImageVectorsList) {
|
|
|
// Map<String,Object> result = new HashMap<String, Object>();
|
|
|
// result.put("productSkn",sknImageVectors.getProductSkn());
|
|
|
// result.put("imgUrl",sknImageVectors.getImgUrl());
|
|
|
// result.put("vectors",sknImageVectors.getVectors());
|
|
|
// result.put("createTime",sknImageVectors.getCreateTime());
|
|
|
// long random = 145770520 + (int)(10000 * Math.random());
|
|
|
// result.put("vectors_32",random + ",3064349452,335806560,2181435200,671088930,304636988,286271040,1073741872,78792072,302262276,275415572,2152317976,2501484562,201606178,2477789697,1898189440,2181070873,562179,1143500865,681618177,570429440,419433157,2634376384,33894424,260046852,134754372,1309983506,327765,1114475,4751954,1353801744,139879026,549471617");
|
|
|
// result.put("vectors_128",random + ",145770520,3064349452,335806560,2181435200,671088930,304636988,286271040,1073741872,78792072,302262276,275415572,2152317976,2501484562,201606178,2477789697,1898189440,2181070873,562179,1143500865,681618177,570429440,419433157,2634376384,33894424,260046852,134754372,1309983506,327765,1114475,4751954,1353801744,139879026,549471617,2491464322,1216608388,2249850888,536936961,1275183104,1679425556,146802912,17064578,985666161,2693863958,90720896,2315346182,1342769216,1077021157,411044198,1275757661,268634178,28377159,146354724,555754625,9439360,1249378,2517762067,276832513,339969674,67633187,2416766034,705206816,3238108736,3323996166,48255525,67152905,738644232,3355443282,847249547,2151816497,2416551620,3230152256,153315984,945373320,1159730176,17080355,2198110342,55198214,3289513993,1175749760,34213921,583618724,168312976,2165311811,204522048,180390282,1212663092,1351124312,34606016,706806272,100734720,1630732425,1073823908,563384330,536873053,2963308608,1074270241,337646622,3240230912,2875229798,2349404172,552112153,1329152,805963786,2172994050,1153434112,69360641,1412171537,1216881732,34613286,2177368840,2619490304,590464,127026387,847390820,337670664,1380327625,390079202,1535432836,3305349121,723751402,3240178208,2151744513,18874372,1142981696,1487227220,3250944274,262236,2483257479");
|
|
|
// results.add(result);
|
|
|
// }
|
|
|
return sknImageVectorsList;
|
|
|
}
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
...
|
...
|
|