diff --git a/CertificateManager.java b/CertificateManager.java new file mode 100644 index 0000000..e27f301 --- /dev/null +++ b/CertificateManager.java @@ -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 findCertificateById(String certificateId); + + /** + * 根据员工ID查找证书 + */ + List findCertificatesByEmployeeId(String employeeId); + + /** + * 根据课程ID查找证书 + */ + List findCertificatesByCourseId(String courseId); + + /** + * 查找过期的证书 + */ + List findExpiredCertificates(); + + /** + * 查找即将过期的证书(在指定天数内) + */ + List findCertificatesExpiringSoon(int days); + + /** + * 获取所有证书 + */ + List getAllCertificates(); +} \ No newline at end of file