From 81759ed6c61133d3f58ae28d149fcb3395244fe9 Mon Sep 17 00:00:00 2001 From: liulu Date: Thu, 14 Nov 2024 09:13:52 +0800 Subject: [PATCH] add --- .../java/com/sunyard/chsm/dto/CertDTO.java | 1 + .../java/com/sunyard/chsm/dto/KeyInfoDTO.java | 1 + .../chsm/service/impl/KeyInfoServiceImpl.java | 3 ++- chsm-web-server/pom.xml | 16 ++++++++++++ .../java/com/sunyard/chsm/WebServerApp.java | 25 +++++++++++++++++++ .../com/sunyard/chsm/config/AuthHandler.java | 22 ++++++++++++++++ .../chsm/controller/AppLoginController.java | 17 +++++++++++++ 7 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 chsm-web-server/src/main/java/com/sunyard/chsm/WebServerApp.java create mode 100644 chsm-web-server/src/main/java/com/sunyard/chsm/config/AuthHandler.java create mode 100644 chsm-web-server/src/main/java/com/sunyard/chsm/controller/AppLoginController.java diff --git a/chsm-web-manage/src/main/java/com/sunyard/chsm/dto/CertDTO.java b/chsm-web-manage/src/main/java/com/sunyard/chsm/dto/CertDTO.java index 5f34871..7e291cf 100644 --- a/chsm-web-manage/src/main/java/com/sunyard/chsm/dto/CertDTO.java +++ b/chsm-web-manage/src/main/java/com/sunyard/chsm/dto/CertDTO.java @@ -140,6 +140,7 @@ public abstract class CertDTO { * 证书DN */ private String subject; + private String certText; private String remark; private LocalDateTime createTime; } diff --git a/chsm-web-manage/src/main/java/com/sunyard/chsm/dto/KeyInfoDTO.java b/chsm-web-manage/src/main/java/com/sunyard/chsm/dto/KeyInfoDTO.java index 544d15b..bf7c5eb 100644 --- a/chsm-web-manage/src/main/java/com/sunyard/chsm/dto/KeyInfoDTO.java +++ b/chsm-web-manage/src/main/java/com/sunyard/chsm/dto/KeyInfoDTO.java @@ -21,6 +21,7 @@ public abstract class KeyInfoDTO { @EqualsAndHashCode(callSuper = true) @Data public static class Query extends PageQuery { + private Long appId; private String status; private String keyType; } diff --git a/chsm-web-manage/src/main/java/com/sunyard/chsm/service/impl/KeyInfoServiceImpl.java b/chsm-web-manage/src/main/java/com/sunyard/chsm/service/impl/KeyInfoServiceImpl.java index 01e97ad..b649965 100644 --- a/chsm-web-manage/src/main/java/com/sunyard/chsm/service/impl/KeyInfoServiceImpl.java +++ b/chsm-web-manage/src/main/java/com/sunyard/chsm/service/impl/KeyInfoServiceImpl.java @@ -94,6 +94,7 @@ public class KeyInfoServiceImpl implements KeyInfoService { LocalDateTime now = LocalDateTime.now(); LambdaQueryWrapper wrapper = new LambdaQueryWrapper() .eq(StringUtils.hasText(query.getKeyType()), KeyInfo::getKeyType, query.getKeyType()) + .eq(Objects.nonNull(query.getAppId()), KeyInfo::getApplicationId, query.getAppId()) // .eq(StringUtils.hasText(query.getStatus()), KeyInfo::getStatus, query.getStatus()) // .eq(KeyInfo::getDeleted, false) .orderByDesc(KeyInfo::getCreateTime); @@ -123,7 +124,7 @@ public class KeyInfoServiceImpl implements KeyInfoService { return new Page<>(page.getCurrent(), page.getSize(), page.getTotal()); } - List appIds = records.stream().map(KeyInfo::getId).collect(Collectors.toList()); + List appIds = records.stream().map(KeyInfo::getApplicationId).collect(Collectors.toList()); Map appNameMap = applicationMapper.selectBatchIds(appIds) .stream().collect(Collectors.toMap(Application::getId, Application::getName)); diff --git a/chsm-web-server/pom.xml b/chsm-web-server/pom.xml index 57eb6c7..7592527 100644 --- a/chsm-web-server/pom.xml +++ b/chsm-web-server/pom.xml @@ -17,4 +17,20 @@ UTF-8 + + + + com.sunyard.chsm + chsm-common + ${project.version} + + + com.sunyard.chsm + chsm-params + ${project.version} + + + + + \ No newline at end of file diff --git a/chsm-web-server/src/main/java/com/sunyard/chsm/WebServerApp.java b/chsm-web-server/src/main/java/com/sunyard/chsm/WebServerApp.java new file mode 100644 index 0000000..902c04b --- /dev/null +++ b/chsm-web-server/src/main/java/com/sunyard/chsm/WebServerApp.java @@ -0,0 +1,25 @@ +package com.sunyard.chsm; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * @author liulu + * @since 2024/10/25 + */ +@Slf4j +@SpringBootApplication +public class WebServerApp { + + public static void main(String[] args) { + + + + + + SpringApplication.run(WebServerApp.class, args); + log.info("---------------------WebServerApp 启动完成-------------------"); + } + +} diff --git a/chsm-web-server/src/main/java/com/sunyard/chsm/config/AuthHandler.java b/chsm-web-server/src/main/java/com/sunyard/chsm/config/AuthHandler.java new file mode 100644 index 0000000..906e5e1 --- /dev/null +++ b/chsm-web-server/src/main/java/com/sunyard/chsm/config/AuthHandler.java @@ -0,0 +1,22 @@ +package com.sunyard.chsm.config; + +import org.springframework.web.servlet.HandlerInterceptor; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * @author liulu + * @since 2024/11/13 + */ +public class AuthHandler implements HandlerInterceptor { + + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { + + + + + return true; + } +} diff --git a/chsm-web-server/src/main/java/com/sunyard/chsm/controller/AppLoginController.java b/chsm-web-server/src/main/java/com/sunyard/chsm/controller/AppLoginController.java new file mode 100644 index 0000000..35e73c1 --- /dev/null +++ b/chsm-web-server/src/main/java/com/sunyard/chsm/controller/AppLoginController.java @@ -0,0 +1,17 @@ +package com.sunyard.chsm.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 应用Token服务接口 + * + * @author liulu + * @version V1.0 + * @since 2023/8/4 + */ +@RestController +@RequestMapping +public class AppLoginController { + +}