|
|
@@ -30,72 +30,36 @@ public class SearchController {
|
|
|
@Autowired
|
|
|
private SearchService searchService;
|
|
|
|
|
|
- /**
|
|
|
- * 搜索产品类目
|
|
|
- *
|
|
|
- * @param keyword
|
|
|
- * @return
|
|
|
- */
|
|
|
@RequestMapping("/kindIds")
|
|
|
@ResponseBody
|
|
|
public List<Long> seachKindIds(String keyword) {
|
|
|
return searchService.getKindIds(keyword);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 搜索产品类目
|
|
|
- *
|
|
|
- * @param keyword
|
|
|
- * @return
|
|
|
- */
|
|
|
@RequestMapping("/kinds")
|
|
|
@ResponseBody
|
|
|
public List<Map<String, Object>> seachKinds(String keyword) {
|
|
|
return searchService.getKinds(keyword);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 搜索产品品牌id
|
|
|
- *
|
|
|
- * @param keyword
|
|
|
- * @return
|
|
|
- */
|
|
|
@RequestMapping("/brandIds")
|
|
|
@ResponseBody
|
|
|
public List<Long> searchBrandIds(String keyword) {
|
|
|
return searchService.getBrandIds(keyword);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 搜索产品品牌
|
|
|
- *
|
|
|
- * @param keyword
|
|
|
- * @return
|
|
|
- */
|
|
|
@RequestMapping("/brands")
|
|
|
@ResponseBody
|
|
|
public List<Map<String, Object>> searchBrand(String keyword) {
|
|
|
return searchService.getBrands(keyword);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 搜索产品id
|
|
|
- *
|
|
|
- * @param keyword
|
|
|
- * @return
|
|
|
- */
|
|
|
@RequestMapping("/componentIds")
|
|
|
@ResponseBody
|
|
|
public Map<String, Object> searchComponentIds(String keyword) {
|
|
|
return searchService.getComponentIds(keyword, new PageParams());
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 搜索产品
|
|
|
- *
|
|
|
- * @param keyword
|
|
|
- * @return
|
|
|
- */
|
|
|
@Autowired
|
|
|
private ComponentSimpleInfoDao componentDao;
|
|
|
|
|
|
@@ -121,105 +85,54 @@ public class SearchController {
|
|
|
return componentDao.findByIdsInOrder(idsLong);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 统计器件的类目id
|
|
|
- *
|
|
|
- * @param keyword
|
|
|
- * @param brandId
|
|
|
- * @return
|
|
|
- */
|
|
|
@RequestMapping("/kindIdsByComponent")
|
|
|
@ResponseBody
|
|
|
public Set<Long> searchKindIdsBySearchComponent(String keyword, String brandId) {
|
|
|
return searchService.getKindIdsBySearchComponent(keyword, brandId);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 统计器件的类目
|
|
|
- *
|
|
|
- * @param keyword
|
|
|
- * @param brandId
|
|
|
- * @return
|
|
|
- */
|
|
|
@RequestMapping("/kindsByComponent")
|
|
|
@ResponseBody
|
|
|
public List<Map<String, Object>> searchKindsBySearchComponent(String keyword, String brandId) {
|
|
|
return searchService.getKindsBySearchComponent(keyword, brandId);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 统计器件的品牌id
|
|
|
- *
|
|
|
- * @param keyword
|
|
|
- * @param brandId
|
|
|
- * @return
|
|
|
- */
|
|
|
@RequestMapping("/brandIdsByComponent")
|
|
|
@ResponseBody
|
|
|
public Set<Long> searchBrandIdsBySearchComponent(String keyword, String kindId) {
|
|
|
return searchService.getBrandIdsBySearchComponent(keyword, kindId);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 统计器件的品牌
|
|
|
- *
|
|
|
- * @param keyword
|
|
|
- * @param brandId
|
|
|
- * @return
|
|
|
- */
|
|
|
@RequestMapping("/brandsByComponent")
|
|
|
@ResponseBody
|
|
|
public List<Map<String, Object>> searchBrandsBySearchComponent(String keyword, String kindId) {
|
|
|
return searchService.getBrandsBySearchComponent(keyword, kindId);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 联想词
|
|
|
- *
|
|
|
- * @param keyword
|
|
|
- * @return
|
|
|
- */
|
|
|
@RequestMapping("/similarKeywords")
|
|
|
@ResponseBody
|
|
|
public List<String> getSimilarKeywords(String keyword) {
|
|
|
return searchService.getSimilarKeywords(keyword);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 器件原厂型号联想词
|
|
|
- *
|
|
|
- * @param componentCode
|
|
|
- * @return
|
|
|
- */
|
|
|
@RequestMapping("/similarComponents")
|
|
|
@ResponseBody
|
|
|
public List<Map<String, Object>> getSimilarComponents(String componentCode) {
|
|
|
return searchService.getSimilarComponents(componentCode);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 品牌联想词
|
|
|
- *
|
|
|
- * @param componentCode
|
|
|
- * @return
|
|
|
- */
|
|
|
@RequestMapping("/similarBrands")
|
|
|
@ResponseBody
|
|
|
public List<Map<String, Object>> getSimilarBrands(String brandName) {
|
|
|
return searchService.getSimilarBrands(brandName);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 根据类目id、属性id、属性值获取联想词
|
|
|
- *
|
|
|
- * @param kindId
|
|
|
- * @param propertyId
|
|
|
- * @param keyword
|
|
|
- * 属性值(部分字符)
|
|
|
- * @param topNum
|
|
|
- * 获取的最大数目
|
|
|
- * @return 相似的属性值
|
|
|
- */
|
|
|
+ @RequestMapping("/similarKinds")
|
|
|
+ @ResponseBody
|
|
|
+ public List<Map<String, Object>> getSimilarKinds(String kindName) {
|
|
|
+ return searchService.getSimilarKinds(kindName);
|
|
|
+ }
|
|
|
+
|
|
|
@RequestMapping("/similarPropertyValues")
|
|
|
@ResponseBody
|
|
|
public List<String> getSimilarPropertyValues(Long kindId, Long propertyId, String keyword, Long topNum) {
|