puzhibing
2024-12-26 e93aad02d2dd2a6e624e81ea0adb3611a8fc43e5
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/RegionController.java
@@ -7,10 +7,7 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@@ -31,5 +28,16 @@
        return R.ok(regionService.list(new LambdaQueryWrapper<Region>()
                .eq(Region::getParentId, parentId)));
    }
    /**
     * 根据城市编号获取数据
     * @param code
     * @return
     */
    @PostMapping("/getRegionBiCode")
    public R<Region> getRegionBiCode(@RequestParam("code") String code){
        Region one = regionService.getOne(new LambdaQueryWrapper<Region>().eq(Region::getCode, code));
        return R.ok(one);
    }
}