refactor(sis): 1
All checks were successful
Build and Push to Target Registry / 构建并推送镜像到目标仓库 (push) Successful in 6m26s

This commit is contained in:
2025-08-21 15:10:54 +08:00
parent f01d28b21e
commit 37966e73c1
2 changed files with 7 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ import cn.hutool.crypto.digest.DigestUtil;
import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpResponse;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;
import org.dromara.sis.sdk.e8.domain.ApiResp; import org.dromara.sis.sdk.e8.domain.ApiResp;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@@ -20,6 +21,7 @@ import java.util.stream.Collectors;
* @apiNote E8ApiUtil * @apiNote E8ApiUtil
* @since 2025/6/20 * @since 2025/6/20
*/ */
@Slf4j
@Component @Component
public class E8ApiUtil { public class E8ApiUtil {
@@ -63,7 +65,7 @@ public class E8ApiUtil {
// 对请求体进行Base64加密指定UTF-8编码避免乱码 // 对请求体进行Base64加密指定UTF-8编码避免乱码
String base64Body = Base64.getEncoder().encodeToString(jsonBody.getBytes(StandardCharsets.UTF_8)); String base64Body = Base64.getEncoder().encodeToString(jsonBody.getBytes(StandardCharsets.UTF_8));
log.info("请求地址url: {}", url);
// 发送请求获取响应 // 发送请求获取响应
// 使用 try-with-resources 确保资源释放 // 使用 try-with-resources 确保资源释放
try (HttpResponse response = HttpRequest.post(url) try (HttpResponse response = HttpRequest.post(url)
@@ -91,6 +93,7 @@ public class E8ApiUtil {
String sign = getGetSign(api, timestamp); String sign = getGetSign(api, timestamp);
// url // url
String url = BASE_URL + api; String url = BASE_URL + api;
log.info("请求地址url: {}", url);
if (isDelete) { if (isDelete) {
// 发送请求获取响应 // 发送请求获取响应

View File

@@ -255,6 +255,9 @@ public class SisAccessControlServiceImpl implements ISisAccessControlService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Boolean syncE8() { public Boolean syncE8() {
List<AuthDoorDeviceFindRes> authDoorDeviceFindRes = e8PlatformApi.getPageAuthDoorDeviceList(); List<AuthDoorDeviceFindRes> authDoorDeviceFindRes = e8PlatformApi.getPageAuthDoorDeviceList();
if (CollUtil.isEmpty(authDoorDeviceFindRes)) {
return false;
}
LambdaQueryWrapper<SisAccessControl> lqw = Wrappers.lambdaQuery(); LambdaQueryWrapper<SisAccessControl> lqw = Wrappers.lambdaQuery();
lqw.eq(true, SisAccessControl::getControlType, 2); lqw.eq(true, SisAccessControl::getControlType, 2);