package com.ruoyi.other.controller; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.other.api.domain.Region; import com.ruoyi.other.service.IRegionService; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.List; /** * @author zhibing.pu * @Date 2024/8/8 12:00 */ @RestController @RequestMapping("/region") public class RegionController { @Resource private IRegionService regionService; @ResponseBody @GetMapping("/getRegion/{pid}") @ApiOperation(value = "获取省市区数据", tags = {"管理后台-站点管理"}) @ApiImplicitParams({ @ApiImplicitParam(value = "父级id,没有传0", name = "pid", required = true) }) public AjaxResult> getRegion(@PathVariable Integer pid){ List list = regionService.list(new LambdaQueryWrapper().eq(Region::getParentId, pid)); return AjaxResult.success(list); } }