Merge remote-tracking branch 'origin/V1.00' into V1.00
# Conflicts: # src/main/java/com/cisd/tms/modules/datamac/interceptor/MacValidationInterceptor.java
This commit is contained in:
commit
b6928978de
@ -1,42 +0,0 @@
|
||||
//package com.cisd.tms.modules.datamac.interceptor;
|
||||
//
|
||||
//
|
||||
//import com.cisd.tms.modules.datamac.entity.ImportantDataEntity;
|
||||
//import com.cisd.tms.modules.datamac.helper.Sm3MacCalculator;
|
||||
//import org.apache.ibatis.executor.resultset.ResultSetHandler;
|
||||
//import org.apache.ibatis.plugin.Interceptor;
|
||||
//import org.apache.ibatis.plugin.Intercepts;
|
||||
//import org.apache.ibatis.plugin.Invocation;
|
||||
//import org.apache.ibatis.plugin.Signature;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
//import java.sql.Statement;
|
||||
//import java.util.List;
|
||||
//
|
||||
//
|
||||
//@Intercepts(@Signature(type = ResultSetHandler.class, method = "handleResultSets", args = {Statement.class}))
|
||||
//@Component
|
||||
//public class MacValidationInterceptor implements Interceptor {
|
||||
//
|
||||
// @Override
|
||||
// public Object intercept(Invocation invocation) throws Throwable {
|
||||
// Object result = invocation.proceed();
|
||||
// if (result instanceof List) {
|
||||
// ((List<?>) result).forEach(this::validateEntity);
|
||||
// } else {
|
||||
// validateEntity(result);
|
||||
// }
|
||||
// return result;
|
||||
// }
|
||||
//
|
||||
// private void validateEntity(Object obj) {
|
||||
// if (obj instanceof ImportantDataEntity) {
|
||||
// ImportantDataEntity entity = (ImportantDataEntity) obj;
|
||||
// String storedMac = entity.getMac();
|
||||
// String calculatedMac = Sm3MacCalculator.calculateForEntity(entity);
|
||||
// if (!storedMac.equals(calculatedMac)) {
|
||||
// throw new RuntimeException("Data integrity validation failed. The data has been tampered with.");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@ -1,13 +1,8 @@
|
||||
package com.cisd.tms.modules.device.controller;
|
||||
|
||||
|
||||
import com.cisd.tms.common.api.ApiResponse;
|
||||
import com.cisd.tms.modules.device.dto.network.*;
|
||||
import com.cisd.tms.modules.device.entity.PageResult;
|
||||
import com.cisd.tms.modules.device.service.NetworkConfigService;
|
||||
import com.cisd.tms.modules.log.annotation.AuditedOperation;
|
||||
import com.cisd.tms.modules.log.enums.ActionType;
|
||||
import com.cisd.tms.modules.log.enums.ModuleCode;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
@ -84,7 +79,6 @@ public class NetworkConfigController {
|
||||
|
||||
@Operation(summary = "创建Bond", description = "创建一个新的Bond聚合接口,需指定名称、模式和从属接口")
|
||||
@PostMapping("/bond/create")
|
||||
@AuditedOperation(module = ModuleCode.NETWORK, action = ActionType.CREATE, summary = "创建Bond")
|
||||
public ApiResponse<Void> createBond(@Valid @RequestBody BondCreateRequest req) {
|
||||
networkConfigService.createBond(req);
|
||||
return ApiResponse.success();
|
||||
|
||||
@ -240,18 +240,18 @@ public class OperationAuditService {
|
||||
|
||||
|
||||
private static String buildSignValueSource(OperationAuditLogEntity existLog, AuditResult auditResult) {
|
||||
String signValueSource = trim(existLog.getLogId()) +
|
||||
existLog.getOperatorRoleCode() +
|
||||
existLog.getOperatorAuthLevel() +
|
||||
existLog.getModuleCode() +
|
||||
existLog.getActionType() +
|
||||
trim(existLog.getRemoteIp()) +
|
||||
existLog.getOperationResult() +
|
||||
trim(existLog.getSummary()) +
|
||||
trim(existLog.getErrorMessage()) +
|
||||
existLog.getAuditStatus() +
|
||||
auditResult +
|
||||
trim(existLog.getSignValue()) +
|
||||
String signValueSource = trim(existLog.getLogId()) + "_" +
|
||||
existLog.getOperatorRoleCode() + "_" +
|
||||
existLog.getOperatorAuthLevel() + "_" +
|
||||
existLog.getModuleCode() + "_" +
|
||||
existLog.getActionType() + "_" +
|
||||
trim(existLog.getRemoteIp()) + "_" +
|
||||
existLog.getOperationResult() + "_" +
|
||||
trim(existLog.getSummary()) + "_" +
|
||||
trim(existLog.getErrorMessage()) + "_" +
|
||||
existLog.getAuditStatus() + "_" +
|
||||
auditResult + "_" +
|
||||
trim(existLog.getSignValue()) + "_" +
|
||||
existLog.getOccurredAt();
|
||||
|
||||
return signValueSource;
|
||||
|
||||
@ -163,6 +163,7 @@ public class MasterKeyActivateServiceImpl implements MasterKeyActivateService {
|
||||
request.setHash(hash);
|
||||
|
||||
String json = OBJECT_MAPPER.writeValueAsString(request);
|
||||
//todo 抛异常
|
||||
// System.out.print(json);
|
||||
HttpRequest httpRequest = HttpRequest.newBuilder()
|
||||
.uri(URI.create(masterKeyActivateProperties.getPlatformUrl()))
|
||||
|
||||
@ -336,7 +336,7 @@ tms:
|
||||
new-pin-base64: ${TMS_MK_INIT_IDENTIFY_NEW_PIN_BASE64:NjY2NjY2}
|
||||
activate:
|
||||
# 激活服务平台路径
|
||||
platform-url: ${TMS_MK_ACTIVATE_PLATFORM_URL:http://127.0.0.1:8080/device/active}
|
||||
platform-url: ${TMS_MK_ACTIVATE_PLATFORM_URL:http://172.16.18.195:8170/device/active}
|
||||
security:
|
||||
# 内部接口鉴权 token(前后端内部调用需一致)。
|
||||
internal-token: ${TMS_INTERNAL_TOKEN:change-me-internal-token}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user