package com.xiaoniu.system.platformsettings.region.controller;

import com.xiaoniu.common.core.resdata.Result;
import com.xiaoniu.system.platformsettings.region.service.ITbRegionService;
import com.xiaoniu.system.platformsettings.region.vo.RegionTreeVO;
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.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 省市区 前端控制器
 * </p>
 *
 * @author haoxuyang
 * @since 2024-11-01 02:12:51
 */
@Tag(name = "区域信息管理")
@RestController
@RequestMapping("/region")
@RequiredArgsConstructor(onConstructor_ = @Autowired)
public class TbRegionController {

    private final ITbRegionService tbRegionService;

    @Operation(summary = "查询省市级联列表")
    @GetMapping("/selectRegionTreeList")
    public Result<List<RegionTreeVO>> selectRegionTreeList() {
        return Result.success("查询成功", tbRegionService.selectRegionTreeList());
    }

}
