package com.kidgrow.searchcenter.controller;
|
|
import com.alibaba.fastjson.JSONObject;
|
import com.kidgrow.common.model.*;
|
|
import com.kidgrow.searchcenter.model.SearchDto;
|
import com.kidgrow.searchcenter.service.ISearchService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
import io.swagger.annotations.Api;
|
import lombok.extern.slf4j.Slf4j;
|
|
/**
|
* 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br>
|
*
|
* @Description: 通用搜索<br>
|
* @Project: <br>
|
* @CreateDate: Created in 2020/2/24 13:47 <br>
|
* @Author: <a href="4345453@kidgrow.com">liuke</a>
|
*/
|
@Slf4j
|
@RestController
|
@Api(tags = "搜索模块api")
|
@RequestMapping("/search")
|
public class SearchController {
|
@Autowired
|
private ISearchService searchService;
|
|
/**
|
* 查询文档列表
|
* @param indexName 索引名
|
* @param searchDto 搜索Dto
|
*/
|
@PostMapping("/{indexName}")
|
public PageResult<JSONObject> strQuery(@PathVariable String indexName, @RequestBody(required = false) SearchDto searchDto) {
|
if (searchDto == null) {
|
searchDto = new SearchDto();
|
}
|
return searchService.strQuery(indexName, searchDto);
|
}
|
}
|