package com.wansenai.api.support;

import com.wansenai.dto.support.BasAreaDto;
import com.wansenai.service.support.BasAreaService;
import com.wansenai.utils.response.Response;
import com.wansenai.vo.support.BasAreaVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>区域档案</p>
 * @author clunt
 */
@RestController
@RequestMapping("basArea")
@Tag(name = "区域档案", description = "系统内置四级区域档案")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class BasAreaController {

    private final BasAreaService basAreaService;

    @PostMapping("getList")
    @Operation(summary = "区域查询", description = "区域查询")
    public Response<List<BasAreaVo>> getList(@RequestBody BasAreaDto basAreaDto) {
        return Response.responseData(basAreaService.getList(basAreaDto));
    }

    @GetMapping("getDetail")
    @Operation(summary = "详情查询", description = "详情查询")
    public Response<BasAreaVo> getDetail(@RequestParam(value = "id") Long id){
        return Response.responseData(basAreaService.getDetail(id));
    }

}
