package cn.com.ty.lift.ud.searchHistory.service.impl;

import cn.com.ty.lift.ud.searchHistory.mapper.SearchHistoryMapper;
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 com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


/**
 * 搜索历史表-ServiceImpl
 *
 * @author tw
 * @date 2020-11-17
 */
@Service
@Transactional
public class SearchHistoryServiceImpl extends ServiceImpl<SearchHistoryMapper,SearchHistoryEntity>
    implements ISearchHistoryService {

    @Autowired
    private SearchHistoryMapper searchHistoryMapper;


    /**
     * 获取热门搜索
     * @return
     */
    @Override
    public RestResponse getHotSearch() {
        List<SearchHistoryEntity> list =  searchHistoryMapper.getHotSearch();
        return RestResponse.success(list);
    }
}
