|
|
|
|
@ -0,0 +1,62 @@
|
|
|
|
|
/**
|
|
|
|
|
* 证书管理接口
|
|
|
|
|
* 体现接口隔离原则
|
|
|
|
|
* 定义证书管理的核心功能
|
|
|
|
|
*/
|
|
|
|
|
package com.employeetraining.certificate;
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDate;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Optional;
|
|
|
|
|
|
|
|
|
|
public interface CertificateManager {
|
|
|
|
|
/**
|
|
|
|
|
* 颁发证书
|
|
|
|
|
*/
|
|
|
|
|
void issueCertificate(Certificate certificate);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 更新证书状态
|
|
|
|
|
*/
|
|
|
|
|
boolean updateCertificateStatus(String certificateId, Certificate.CertificateStatus status);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 吊销证书
|
|
|
|
|
*/
|
|
|
|
|
boolean revokeCertificate(String certificateId, String reason);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 续期证书
|
|
|
|
|
*/
|
|
|
|
|
boolean renewCertificate(String certificateId, LocalDate newExpiryDate);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据ID查找证书
|
|
|
|
|
*/
|
|
|
|
|
Optional<Certificate> findCertificateById(String certificateId);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据员工ID查找证书
|
|
|
|
|
*/
|
|
|
|
|
List<Certificate> findCertificatesByEmployeeId(String employeeId);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据课程ID查找证书
|
|
|
|
|
*/
|
|
|
|
|
List<Certificate> findCertificatesByCourseId(String courseId);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查找过期的证书
|
|
|
|
|
*/
|
|
|
|
|
List<Certificate> findExpiredCertificates();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查找即将过期的证书(在指定天数内)
|
|
|
|
|
*/
|
|
|
|
|
List<Certificate> findCertificatesExpiringSoon(int days);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取所有证书
|
|
|
|
|
*/
|
|
|
|
|
List<Certificate> getAllCertificates();
|
|
|
|
|
}
|