pull/1/head
puxcofief 8 months ago
parent 2b893282b8
commit 991c3418a0

@ -1,74 +1,83 @@
package com.cn.service; package com.cn.service;
import java.sql.SQLException; import java.sql.SQLException; // 导入SQLException类用于处理数据库操作时可能遇到的异常
import java.util.List; import java.util.List; // 导入List接口用于返回列表类型的数据
import com.cn.domain.Train; import com.cn.domain.Train; // 导入Train类该类代表车次的实体
/**
*
*/
public interface TrainService { public interface TrainService {
/** /**
* *
* @return 1 * @param train
* @throws SQLException * @return 1
* @throws SQLException SQLException
*/ */
int add(Train train); int add(Train train);
/** /**
* * ID
* @return 1 * @param trainId ID
* @throws SQLException * @return 1
* @throws SQLException SQLException
*/ */
int delete(Integer trainId); int delete(Integer trainId);
/** /**
* *
* @return 1 * @param train
* @throws SQLException * @return 1
* @throws SQLException SQLException
*/ */
int update(Train train); int update(Train train);
/** /**
* *
* @return Trainlist * @return ListTrain
* @throws SQLException * @throws SQLException SQLException
*/ */
List<Train> getAll(); List<Train> getAll();
/** /**
* id * ID
* @return Train * @param trainId ID
* @throws SQLException * @return Train
* @throws SQLException SQLException
*/ */
Train getById(Integer trainId); Train getById(Integer trainId);
/** /**
* *
* @return Trainlist * @param trainNumber
* @throws SQLException * @return ListTrain
* @throws SQLException SQLException
*/ */
List<Train> getByTrainNumber(String trainNumber); List<Train> getByTrainNumber(String trainNumber);
/** /**
* *
* @param startStation * @param startStation
* @param endStation * @param endStation
* @param startTime * @param startTime
* @return Trainlist * @return ListTrain
* @throws SQLException * @throws SQLException SQLException
*/ */
List<Train> getByStartEndStation(String startStation, String endStation, String startTime); List<Train> getByStartEndStation(String startStation, String endStation, String startTime);
/** /**
* *
* @return * @return ListTrain
* @throws SQLException * @throws SQLException SQLException
*/ */
List<Train> getAllStartStation(); List<Train> getAllStartStation();
/** /**
* *
* @return * @return ListTrain
* @throws SQLException * @throws SQLException SQLException
*/ */
List<Train> getAllEndStation(); List<Train> getAllEndStation();
} }
Loading…
Cancel
Save