package com.dsk.web.controller.search.controller;

import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.dtos.ComposeQueryDto;
import com.dsk.web.controller.search.service.BusinessOpportunityRadarService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


/**
 * 查企业
 * @author Administrator
 *
 */
@RequestMapping("/enterprise")
@RestController
public class CompanySearchController {


    @Resource
    BusinessOpportunityRadarService opportunityRadarService;

    /*
     * 模糊查询企业名称
     */
    @RequestMapping("/index")
    public AjaxResult landMarketPage(@RequestBody ComposeQueryDto compose) {
        return opportunityRadarService.enterpriseIndex(compose);
    }

    /*
     * 完全匹配企业名称
     */
    @GetMapping("/findByName/{keyword}")
    public AjaxResult findByName(@PathVariable String keyword) {
        return opportunityRadarService.enterpriseByName(keyword);
    }

    /*
     * 完全匹配企业名称
     */
    @PostMapping("/page")
    public AjaxResult page(@RequestBody ComposeQueryDto compose) {
        compose.getPage().setPage(compose.getPageNum());
        compose.getPage().setLimit(compose.getPageSize());
        return opportunityRadarService.enterprisePage(compose);
    }
}
