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<BaseSiteRespVo> queryBaseSiteList(Integer city, Integer type);
/**
* 获取code
* @return
*/
ResultBody getCode();
}
---------是故无冥冥之志者----------
---------无昭昭之明----------
---------无惛惛之事者----------
---------无赫赫之功----------
本文来自博客园,作者:|是吴啊|,转载请注明原文链接:https://www.cnblogs.com/wuguofeng/p/15668387.html

浙公网安备 33010602011771号