package com.ningdatech.carapi.open.controller;

import java.util.List;

import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ningdatech.carapi.sys.entity.vo.RegionTreeVO;
import com.ningdatech.carapi.sys.manage.RegionManage;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author PoffyZhang
 * @since 2022-10-09
 */
@Slf4j
@Validated
@RestController
@RequestMapping("/open/api/region/")
@Api(value = "archives", tags = "对外联调接口")
@RequiredArgsConstructor
public class OpenApiRegionController {

    private final RegionManage regionManage;

    @PostMapping("/tree")
    @ApiOperation("获取区域编码的树状结构")
    public List<RegionTreeVO> getRegionTree() {
        return regionManage.getRegionInfo();
    }

}
