mirror of
https://github.com/hpd840321/starRiverProperty.git
synced 2026-06-11 01:10:29 +08:00
chore(v0.11): 全路径纳入版本库与走查整改
- .gitignore:显式放行全部 maven-*、scripts、dev-support、frontend、反1、artifacts、历史导出目录 - 新增跟踪:device-manager/device-sdk/legacy-public、davinci-manager、cwos-*、cwos-resource 等源码与附属资源 - davinci FileStorageManagerImpl:Feign Response 关闭、绝对 URL 拉流 SSRF 校验(协议/主机/解析地址) - davinci OuterCallFeignClient:补充契约说明 - cwos-common-aks AksConstant:final 类 + 私有构造防误实例化 - device-manager DeviceConstant:沿用 DEFAULT_APPLICATIONID 拼写修正 Made-with: Cursor
This commit is contained in:
+6
@@ -0,0 +1,6 @@
|
||||
Manifest-Version: 1.0
|
||||
Archiver-Version: Plexus Archiver
|
||||
Built-By: hechunjie
|
||||
Created-By: Apache Maven 3.6.0
|
||||
Build-Jdk: 1.8.0_191
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
artifactId=cloudwalk-common-service
|
||||
groupId=cn.cloudwalk.cloud
|
||||
version=3.7.2-Brussels-SRX
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>cloudwalk-common-service</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<description>云从科技-公共组件service通用层</description>
|
||||
|
||||
<parent>
|
||||
<artifactId>cloudwalk-cloud-common</artifactId>
|
||||
<groupId>cn.cloudwalk.cloud</groupId>
|
||||
<version>3.7.2-Brussels-SRX</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.cloudwalk.cloud</groupId>
|
||||
<artifactId>cloudwalk-common-result</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-validator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-aop</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-aspects</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-beans</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-webmvc</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
/* */ package cn.cloudwalk.service.aop;
|
||||
/* */
|
||||
/* */ import cn.cloudwalk.cloud.annotation.CloudwalkParamsValidate;
|
||||
/* */ import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
/* */ import java.lang.reflect.Method;
|
||||
/* */ import java.util.Iterator;
|
||||
/* */ import java.util.Set;
|
||||
/* */ import javax.validation.ConstraintViolation;
|
||||
/* */ import javax.validation.Validator;
|
||||
/* */ import javax.validation.groups.Default;
|
||||
/* */ import org.aspectj.lang.ProceedingJoinPoint;
|
||||
/* */ import org.aspectj.lang.annotation.Around;
|
||||
/* */ import org.aspectj.lang.annotation.Aspect;
|
||||
/* */ import org.aspectj.lang.annotation.Pointcut;
|
||||
/* */ import org.aspectj.lang.reflect.MethodSignature;
|
||||
/* */ import org.slf4j.Logger;
|
||||
/* */ import org.slf4j.LoggerFactory;
|
||||
/* */ import org.springframework.beans.factory.annotation.Autowired;
|
||||
/* */ import org.springframework.context.MessageSource;
|
||||
/* */ import org.springframework.context.i18n.LocaleContextHolder;
|
||||
/* */ import org.springframework.core.annotation.Order;
|
||||
/* */ import org.springframework.stereotype.Component;
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */ @Aspect
|
||||
/* */ @Order(-100)
|
||||
/* */ @Component
|
||||
/* */ public class CloudwalkParamsValidateAspect
|
||||
/* */ {
|
||||
/* 43 */ private final Logger logger = LoggerFactory.getLogger(getClass());
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */ @Autowired
|
||||
/* */ private Validator validator;
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */ @Autowired
|
||||
/* */ private MessageSource messageSource;
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */ public String getMessage(String code) {
|
||||
/* 64 */ return this.messageSource.getMessage(code, null, LocaleContextHolder.getLocale());
|
||||
/* */ }
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */ @Pointcut("@annotation(cn.cloudwalk.cloud.annotation.CloudwalkParamsValidate)")
|
||||
/* */ public void validatePointcat() {}
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */ @Around("validatePointcat()")
|
||||
/* */ public Object around(ProceedingJoinPoint joinPoint) throws Throwable {
|
||||
/* 80 */ MethodSignature methodSignature = (MethodSignature)joinPoint.getSignature();
|
||||
/* 81 */ Method targetMethod = joinPoint.getTarget().getClass().getMethod(methodSignature
|
||||
/* 82 */ .getName(), methodSignature.getParameterTypes());
|
||||
/* */
|
||||
/* 84 */ this.logger.debug("正在进行对类{}中方法{}进行参数检查开始", joinPoint.getTarget().getClass().getName(), targetMethod.getName());
|
||||
/* */
|
||||
/* */
|
||||
/* 87 */ CloudwalkParamsValidate paramsValidate = targetMethod.<CloudwalkParamsValidate>getAnnotation(CloudwalkParamsValidate.class);
|
||||
/* 88 */ if (paramsValidate == null) {
|
||||
/* 89 */ return joinPoint.proceed();
|
||||
/* */ }
|
||||
/* */
|
||||
/* */
|
||||
/* 93 */ int[] needCheckParamIndexs = paramsValidate.argsIndexs();
|
||||
/* 94 */ if (needCheckParamIndexs == null) {
|
||||
/* 95 */ return joinPoint.proceed();
|
||||
/* */ }
|
||||
/* */
|
||||
/* */
|
||||
/* 99 */ Class<?>[] groupsClazz = paramsValidate.groups();
|
||||
/* 100 */ if (groupsClazz == null) {
|
||||
/* 101 */ groupsClazz = new Class[] { Default.class };
|
||||
/* */ }
|
||||
/* */
|
||||
/* 104 */ Object[] args = joinPoint.getArgs();
|
||||
/* 105 */ for (int index : needCheckParamIndexs) {
|
||||
/* 106 */ Object arg = args[index];
|
||||
/* */
|
||||
/* 108 */ Set<ConstraintViolation<Object>> constraintViolationSet = this.validator.validate(arg, groupsClazz);
|
||||
/* 109 */ if (constraintViolationSet != null && constraintViolationSet.size() > 0) {
|
||||
/* 110 */ Iterator<ConstraintViolation<Object>> iterator = constraintViolationSet.iterator(); if (iterator.hasNext()) { ConstraintViolation<Object> constraintViolation = iterator.next();
|
||||
/* 111 */ String code = constraintViolation.getMessage();
|
||||
/* 112 */ return CloudwalkResult.fail(code, getMessage(code)); }
|
||||
/* */
|
||||
/* */ }
|
||||
/* */ }
|
||||
/* */
|
||||
/* 117 */ this.logger.debug("正在进行对类{}中方法{}进行参数检查通过", joinPoint.getTarget().getClass().getName(), targetMethod.getName());
|
||||
/* */
|
||||
/* 119 */ return joinPoint.proceed();
|
||||
/* */ }
|
||||
/* */ }
|
||||
|
||||
|
||||
/* Location: D:\星中心\cw-elevator-application-V1.0.0.20211103\cw-elevator-application-V1.0.0.20211103\lib\cloudwalk-common-service-3.7.2-Brussels-SRX.jar!\cn\cloudwalk\service\aop\CloudwalkParamsValidateAspect.class
|
||||
* Java compiler version: 7 (51.0)
|
||||
* JD-Core Version: 1.1.3
|
||||
*/
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
/* */ package cn.cloudwalk.service.config;
|
||||
/* */
|
||||
/* */ import javax.validation.Validation;
|
||||
/* */ import javax.validation.Validator;
|
||||
/* */ import javax.validation.ValidatorFactory;
|
||||
/* */ import org.hibernate.validator.HibernateValidator;
|
||||
/* */ import org.hibernate.validator.HibernateValidatorConfiguration;
|
||||
/* */ import org.springframework.context.annotation.Bean;
|
||||
/* */ import org.springframework.context.annotation.Configuration;
|
||||
/* */ import org.springframework.validation.beanvalidation.MethodValidationPostProcessor;
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */ @Configuration
|
||||
/* */ public class ValidatorConfig
|
||||
/* */ {
|
||||
/* */ @Bean
|
||||
/* */ public Validator validator() {
|
||||
/* 33 */ ValidatorFactory validatorFactory = ((HibernateValidatorConfiguration)Validation.byProvider(HibernateValidator.class).configure()).failFast(true).buildValidatorFactory();
|
||||
/* */
|
||||
/* 35 */ return validatorFactory.getValidator();
|
||||
/* */ }
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */ @Bean
|
||||
/* */ public MethodValidationPostProcessor methodValidationPostProcessor() {
|
||||
/* 44 */ MethodValidationPostProcessor postProcessor = new MethodValidationPostProcessor();
|
||||
/* 45 */ postProcessor.setValidator(validator());
|
||||
/* 46 */ return postProcessor;
|
||||
/* */ }
|
||||
/* */ }
|
||||
|
||||
|
||||
/* Location: D:\星中心\cw-elevator-application-V1.0.0.20211103\cw-elevator-application-V1.0.0.20211103\lib\cloudwalk-common-service-3.7.2-Brussels-SRX.jar!\cn\cloudwalk\service\config\ValidatorConfig.class
|
||||
* Java compiler version: 7 (51.0)
|
||||
* JD-Core Version: 1.1.3
|
||||
*/
|
||||
Reference in New Issue
Block a user