package com.dsk.web.controller.system;


import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.core.domain.R;
import com.dsk.system.domain.SysRegion;
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;

import java.util.List;

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

    @Autowired
    private SysRegionService baseService;

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