package com.dsk.web.controller.system;


import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.system.service.SysRegionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 地区信息
 *
 * @author lcl
 * @create 2023/6/28
 */
@RestController
@RequestMapping("/system/region")
public class SysRegionController extends BaseController {

    @Autowired
    private SysRegionService baseService;

    /**
     * 通过父id获取下级地区信息
     */
    @GetMapping("/list/{parentId}")
    public AjaxResult listByParentId(@PathVariable Integer parentId) {
        return AjaxResult.success(baseService.selectByParentId(parentId));
    }
}
