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

import cn.com.ty.lift.ud.common.BaseController;
import cn.com.ty.lift.ud.searchHistory.controller.query.SearchHistoryQuery;
import cn.com.ty.lift.ud.searchHistory.mapper.entity.SearchHistoryEntity;
import cn.com.ty.lift.ud.searchHistory.service.ISearchHistoryService;
import cn.com.xwy.boot.web.dto.RestResponse;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


import com.baomidou.mybatisplus.extension.service.IService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 搜索历史表API
 * 
 * @author tw
 * @date 2020-11-17
 */
@Api(tags = "搜索历史表  API - 陶威")
@RestController
@RequestMapping("/api/searchHistorys")
public class SearchHistoryController extends BaseController<SearchHistoryEntity,SearchHistoryQuery> {

    private final Logger log = LoggerFactory.getLogger(SearchHistoryController.class);
    
    private @Autowired
    ISearchHistoryService searchHistoryService;

    @Override
    protected IService<SearchHistoryEntity> getService() {
        return searchHistoryService;
    }

    /**
     * 热门搜索
     * @return
     */
    @ApiOperation(value = "热门搜索")
    @PostMapping("/getHotSearch")
    public RestResponse getHotSearch() {
        return searchHistoryService.getHotSearch();
    }

}