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
* @throws SQLException
*/
int add(Train train);
/** /**
* *
* @return 1 * @param train
* @throws SQLException * @return 1
*/ * @throws SQLException SQLException
int delete(Integer trainId); */
int add(Train train);
/** /**
* * ID
* @return 1 * @param trainId ID
* @throws SQLException * @return 1
*/ * @throws SQLException SQLException
int update(Train train); */
int delete(Integer trainId);
/** /**
* *
* @return Trainlist * @param train
* @throws SQLException * @return 1
*/ * @throws SQLException SQLException
List<Train> getAll(); */
int update(Train train);
/** /**
* id *
* @return Train * @return ListTrain
* @throws SQLException * @throws SQLException SQLException
*/ */
Train getById(Integer trainId); List<Train> getAll();
/** /**
* * ID
* @return Trainlist * @param trainId ID
* @throws SQLException * @return Train
*/ * @throws SQLException SQLException
List<Train> getByTrainNumber(String trainNumber); */
Train getById(Integer trainId);
/** /**
* *
* @param startStation * @param trainNumber
* @param endStation * @return ListTrain
* @param startTime * @throws SQLException SQLException
* @return Trainlist */
* @throws SQLException List<Train> getByTrainNumber(String trainNumber);
*/
List<Train> getByStartEndStation(String startStation, String endStation, String startTime);
/** /**
* *
* @return * @param startStation
* @throws SQLException * @param endStation
*/ * @param startTime
List<Train> getAllStartStation(); * @return ListTrain
* @throws SQLException SQLException
*/
List<Train> getByStartEndStation(String startStation, String endStation, String startTime);
/** /**
* *
* @return * @return ListTrain
* @throws SQLException * @throws SQLException SQLException
*/ */
List<Train> getAllEndStation(); List<Train> getAllStartStation();
/**
*
* @return ListTrain
* @throws SQLException SQLException
*/
List<Train> getAllEndStation();
} }
Loading…
Cancel
Save