javajavajava
在目前公认的项目规范中,
controller层(具体类)调用service层(接口和实现类),
service层调用dao层(接口),
dao层(接口)配合实体类,mapper.xml,
application.yml跟数据库交换数据。
@Autowired //自动注入。controller层,把,service层的接口自动注入到controller层
private CommonService commonService; //大写的是service里的接口名,小写的就是起了个别名。然后用这个别名来调用。
return commonService.queryBaseSiteList(Integer.parseInt(dto.getCity()), Integer.parseInt(dto.getType()));
接口CommonService代码
public interface CommonService {
/**
* 查询站点列表
*
* @param city
* @param type
* @return
*/
ResultBody queryBaseSiteList(Integer city, Integer type);
/**
* 获取code
* @return
*/
ResultBody getCode();
}