package com.nokia.hb.controller;

import com.nokia.common.R;
import com.nokia.hb.pojo.TreeNode;
import com.nokia.hb.service.AreaService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Tag(name = "地区")
@RestController
public class AreaController {
    private final AreaService areaService;

    public AreaController(AreaService areaService) {
        this.areaService = areaService;
    }

    /**
     * 查询地市树形结构
     */
    @Operation(summary = "查询地市树形结构")
    @PostMapping("/api/initTreeCitys")
    public R<List<TreeNode>> initTreeCitys() {
        return areaService.initTreeCitys();
    }
}
