热词功能处理,提供redis自定义增加权重值的方法

This commit is contained in:
Chopper
2021-07-25 17:45:46 +08:00
parent 280c5dec39
commit e99aeeede5
9 changed files with 134 additions and 45 deletions

View File

@@ -0,0 +1,47 @@
package cn.lili.controller.setting;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.search.service.EsGoodsSearchService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 管理端,app版本控制器
*
* @author Chopper
* @since 2018-07-04 21:50:52
*/
@RestController
@Api(tags = "管理端,系统设置扩展接口")
@RequestMapping("/manager/hotwords")
public class HotWordsManagerController {
@Autowired
private EsGoodsSearchService esGoodsSearchService;
@ApiOperation(value = "获取热词")
@GetMapping
public ResultMessage getHotWords() {
return ResultUtil.data(esGoodsSearchService.getHotWords(0, 99));
}
@ApiOperation(value = "设置热词")
@ApiImplicitParams({
@ApiImplicitParam(name = "keywords", value = "关键字"),
@ApiImplicitParam(name = "point", value = "权重值")
})
@PostMapping
public ResultMessage paymentForm(String keywords, Integer point) {
esGoodsSearchService.setHotWords(keywords, point);
return ResultUtil.success();
}
}

View File

@@ -39,7 +39,6 @@ public class InstantDeliveryManagerController {
IPage<InstantDelivery> data = instantDeliveryService.page(PageUtil.initPage(page));
//组织数据结构
IPage<InstantDeliveryVO> newData = instantDeliveryService.getInstantDeliveryPage(data, page);
System.out.println();
//返回数据
return ResultUtil.data(newData);
}