| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | } |
| | | return ApiResult.success(storeService.pageList(query)); |
| | | } |
| | | @ApiOperation(value = "省市区三级联动 获取省传0 市区传上级id") |
| | | @ApiOperation(value = "省市区三级联动 获取省不传值 市区县传上级code") |
| | | @GetMapping(value = "/list") |
| | | public ApiResult<List<Region>> add(Integer parentId) { |
| | | return ApiResult.success(regionService.lambdaQuery().eq(Region::getParentId,parentId).list()); |
| | | public ApiResult<List<Region>> add(String code) { |
| | | if (!StringUtils.hasLength(code)){ |
| | | return ApiResult.success(regionService.lambdaQuery().eq(Region::getParentId,0).list()); |
| | | }else{ |
| | | return ApiResult.success(regionService.lambdaQuery().eq(Region::getParentId,regionService.lambdaQuery().eq(Region::getCode,code).one().getId()).list()); |
| | | |
| | | } |
| | | } |
| | | /** |
| | | * 添加门店 |