证书管理
This commit is contained in:
+5
-5
@@ -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;
|
||||
+3
-2
@@ -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;
|
||||
Reference in New Issue
Block a user