package com.JN.demo.zmquotation.controller;

import com.JN.common.R;
import com.JN.demo.zmquotation.dto.RegionDto;
import com.JN.demo.zmquotation.service.RegionService;
import lombok.experimental.PackagePrivate;
import lombok.extern.slf4j.Slf4j;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName ZMController
 * @Description TODO
 * @Author JIAL
 * @Date 2024/2/19 8:47
 * @Version 1.0
 */
@RestController
@Slf4j
@RequestMapping("/zmquotation")
public class ZMController {
    @Autowired
    RegionService regionService;

    @PostMapping("/regionList")
    public R<List<RegionDto>> queryRegionList(@RequestParam("regionName") String regionName){

        List<RegionDto> regionList = regionService.queryRegionListByName(regionName);

        log.info("查询到的地区列表结果是：{}", regionList);

        return R.success(regionList);
    }
}
