package com.dsh.guns.modular.system.controller.code;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.dsh.guns.modular.system.model.TCity;
|
import com.dsh.guns.modular.system.service.ICityService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import java.util.List;
|
|
@RestController
|
@RequestMapping("/base")
|
public class CommontController {
|
@Autowired
|
private ICityService cityService;
|
|
|
/**
|
* 获取所有省份
|
*/
|
@RequestMapping("/region/getProvince")
|
public List<TCity> getProvince() {
|
return cityService.list(new LambdaQueryWrapper<TCity>()
|
.eq(TCity::getParentId, 0));
|
}
|
|
/**
|
* 获取所有城市
|
*/
|
@RequestMapping("/region/getCity")
|
public List<TCity> getCity() {
|
return cityService.list(new LambdaQueryWrapper<TCity>()
|
.isNotNull(TCity::getCitycode));
|
}
|
|
}
|