package com.ruoyi.web.controller.dxp.customer;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.dxp.dto.customer.SearchParam;
import com.ruoyi.dxp.dto.customer.SearchResultDto;
import com.ruoyi.dxp.service.ISearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/customer/search")
public class SearchController extends BaseController {

    @Autowired
    private ISearchService searchService;

    /**
     * 搜索
     *
     * @param param
     * @return
     */
    @GetMapping()
    public TableDataInfo selectList(SearchParam param) {
        startPage();
        List<SearchResultDto> searchResultDtos = searchService.selectList(param);
        return getDataTable(searchResultDtos);
    }
}
