package cn.com.ty.lift.ud.searchIndex.controller;

import cn.com.ty.lift.ud.common.BaseController;
import cn.com.ty.lift.ud.searchIndex.controller.query.SearchIndexQuery;
import cn.com.ty.lift.ud.searchIndex.mapper.entity.SearchIndexEntity;
import cn.com.ty.lift.ud.searchIndex.service.ISearchIndexService;
import cn.com.xwy.boot.web.dto.RestResponse;
import com.baomidou.mybatisplus.extension.service.IService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 搜索索引表API
 * 
 * @author Xson
 * @date 2020-05-09
 */
@Api(tags = "搜索索引表API  - 小陶")
@RestController
@RequestMapping("/api/searchIndexs")
public class SearchIndexController extends BaseController<SearchIndexEntity, SearchIndexQuery> {

    private final Logger log = LoggerFactory.getLogger(SearchIndexController.class);
    
    private @Autowired ISearchIndexService searchIndexService;

    @Override
    protected IService<SearchIndexEntity> getService() {
        return searchIndexService;
    }

    /**
     * 全文搜索
     * @param request
     * @return
     */
    @ApiOperation(value = "全文搜索")
    @PostMapping("/search-index/{request}")
    public RestResponse searchIndex(@PathVariable("request") String request) {
        return searchIndexService.searchIndex(request);
    }

}