package com.ruoyi.web.controller.system.system;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.web.controller.manager.SysAreaManager;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import static com.ruoyi.common.core.domain.AjaxResult.success;

/**
 * packageName com.ruoyi.web.controller.system.system
 *
 * @author wangxy
 * @version JDK 8
 * @className SysAreaController
 * @date 2024/5/28
 * @description 区划
 */
@Api("区划")
@Controller
@RequestMapping("/system/area")
public class SysAreaController {

    @Resource
    private SysAreaManager sysAreaManager;
    @ApiOperation("查询区划信息")
    @GetMapping("/getSysAreaList")
    @ResponseBody
    public AjaxResult getSysAreaList(@RequestParam(required = false) String parentId) {
        return success(sysAreaManager.getSysAreaList(parentId));
    }
    @ApiOperation("获取区划名称")
    @GetMapping("/getAreaName")
    @ResponseBody
    public AjaxResult getAreaName(@RequestParam String id) {
        return success(sysAreaManager.getAreaName(id));
    }

    @ApiOperation("查询全部区划信息")
    @GetMapping("/getAllList")
    @ResponseBody
    public AjaxResult getAllList() {
        return success(sysAreaManager.getAllList());
    }

}
