mirror of
https://github.com/JeffLi1993/springboot-learning-example.git
synced 2026-03-14 22:23:54 +08:00
Springboot 整合 Mybatis 的完整 Web 案例
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package org.spring.springboot.service;
|
||||
|
||||
import org.spring.springboot.domain.City;
|
||||
|
||||
/**
|
||||
* 城市业务逻辑接口类
|
||||
*
|
||||
* Created by bysocket on 07/02/2017.
|
||||
*/
|
||||
public interface CityService {
|
||||
|
||||
/**
|
||||
* 根据城市名称,查询城市信息
|
||||
* @param cityName
|
||||
*/
|
||||
City findCityByName(String cityName);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package org.spring.springboot.service.impl;
|
||||
|
||||
import org.spring.springboot.dao.CityDao;
|
||||
import org.spring.springboot.domain.City;
|
||||
import org.spring.springboot.service.CityService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 城市业务逻辑实现类
|
||||
*
|
||||
* Created by bysocket on 07/02/2017.
|
||||
*/
|
||||
@Service
|
||||
public class CityServiceImpl implements CityService {
|
||||
|
||||
@Autowired
|
||||
private CityDao cityDao;
|
||||
|
||||
public City findCityByName(String cityName) {
|
||||
return cityDao.findByName(cityName);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user