证书管理

This commit is contained in:
liulu
2024-11-08 10:42:14 +08:00
parent fdcc750eee
commit e4af8ecbf4
10 changed files with 221 additions and 66 deletions
@@ -2,7 +2,7 @@ package com.sunyard.chsm.mapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sunyard.chsm.model.entity.Cert;
import com.sunyard.chsm.model.entity.AppCert;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
@@ -14,13 +14,13 @@ import java.util.List;
* @since 2024/11/6
*/
@Mapper
public interface CertMapper extends BaseMapper<Cert> {
public interface AppCertMapper extends BaseMapper<AppCert> {
default Cert selectBySN(String sn) {
default AppCert selectBySN(String sn) {
Assert.hasText(sn, "证书序列号不能为空");
List<Cert> certs = selectList(new LambdaQueryWrapper<Cert>()
.eq(Cert::getSerialNumber, sn)
List<AppCert> certs = selectList(new LambdaQueryWrapper<AppCert>()
.eq(AppCert::getSerialNumber, sn)
);
if (CollectionUtils.isEmpty(certs)) {
return null;
@@ -11,8 +11,8 @@ import java.util.Date;
* @since 2024/11/6
*/
@Data
@TableName("sp_cert")
public class Cert {
@TableName("sp_app_cert")
public class AppCert {
private Long id;
private Long applicationId;
@@ -22,6 +22,7 @@ public class Cert {
private String keyAlg;
// ENC, SIGN, CERT_CHAIN
private String certType;
private String status;
private Boolean single;
private String version;
private String subject;