commit 901691aaeab093a8521f89c9943723625e9699fe
Author: Jerry Yan <792602257@qq.com>
Date: Thu Nov 28 15:10:09 2024 +0800
Init
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..5b8c69d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+.idea/
+logs/
+target/
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..35410ca
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,8 @@
+# 默认忽略的文件
+/shelf/
+/workspace.xml
+# 基于编辑器的 HTTP 客户端请求
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 0000000..d139e29
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 0000000..63e9001
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
new file mode 100644
index 0000000..d83aa6e
--- /dev/null
+++ b/.idea/jarRepositories.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..d5cd614
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..e69de29
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..2371ef3
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,215 @@
+
+
+ 4.0.0
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 2.3.12.RELEASE
+
+
+ com.ycwl
+ basic
+ 0.0.1-SNAPSHOT
+ liuying
+ 流影
+
+
+
+ 8
+ 8
+ 8
+ 3.4.0
+ 5.6.0
+ 1.2.76
+ 2.0.7
+ 5.1.10
+
+ true
+
+
+ 2.17.0
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-aop
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-data-redis
+
+
+ io.lettuce
+ lettuce-core
+
+
+
+
+
+ redis.clients
+ jedis
+
+
+
+
+ mysql
+ mysql-connector-java
+ runtime
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+
+ org.springframework.boot
+ spring-boot-configuration-processor
+
+
+
+
+ com.baomidou
+ mybatis-plus-boot-starter
+ ${mybatisplus.boot.starter.version}
+
+
+
+
+ org.projectlombok
+ lombok
+
+
+
+
+
+ cn.hutool
+ hutool-all
+ ${hutool-all.version}
+
+
+
+ com.google.zxing
+ core
+ 3.3.3
+
+
+
+ com.alibaba
+ fastjson
+ ${fastjson.version}
+
+
+
+
+ org.apache.commons
+ commons-lang3
+
+
+
+
+ com.github.xiaoymin
+ knife4j-spring-boot-starter
+ ${knife4j-spring-boot-starter.version}
+
+
+
+
+ com.github.pagehelper
+ pagehelper
+ ${pagehelper.version}
+
+
+ org.mybatis
+ mybatis
+
+
+ org.mybatis
+ mybatis-spring
+
+
+
+
+
+
+ io.jsonwebtoken
+ jjwt
+ 0.9.0
+
+
+ org.apache.commons
+ commons-text
+ 1.1
+
+
+
+
+ org.apache.commons
+ commons-lang3
+
+
+
+
+ com.aliyun
+ alibaba-dingtalk-service-sdk
+ 2.0.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ org.redisson
+ redisson
+ 3.14.1
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
+
+
+
+
+ spring-milestones
+ Spring Milestones
+ https://repo.spring.io/milestone
+
+ false
+
+
+
+
+
diff --git a/src/main/java/com/ycwl/basic/Application.java b/src/main/java/com/ycwl/basic/Application.java
new file mode 100644
index 0000000..dc94933
--- /dev/null
+++ b/src/main/java/com/ycwl/basic/Application.java
@@ -0,0 +1,15 @@
+package com.ycwl.basic;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+@MapperScan(basePackages = "com.ycwl.basic.mapper")
+public class Application {
+
+ public static void main(String[] args) {
+ SpringApplication.run(Application.class, args);
+ }
+
+}
diff --git a/src/main/java/com/ycwl/basic/annotation/IgnoreToken.java b/src/main/java/com/ycwl/basic/annotation/IgnoreToken.java
new file mode 100644
index 0000000..03020ed
--- /dev/null
+++ b/src/main/java/com/ycwl/basic/annotation/IgnoreToken.java
@@ -0,0 +1,21 @@
+package com.ycwl.basic.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * ignore token validation
+ *
+ * check all req except add this annotation
+ * this annotation could use in method and class type
+ *
+ *
+ * @ahtuor yangchen
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(value = {ElementType.METHOD, ElementType.TYPE})
+public @interface IgnoreToken {
+
+}
diff --git a/src/main/java/com/ycwl/basic/aspectj/RequestParameterAspectj.java b/src/main/java/com/ycwl/basic/aspectj/RequestParameterAspectj.java
new file mode 100644
index 0000000..c90ea17
--- /dev/null
+++ b/src/main/java/com/ycwl/basic/aspectj/RequestParameterAspectj.java
@@ -0,0 +1,69 @@
+package com.ycwl.basic.aspectj;
+
+import com.alibaba.fastjson.JSON;
+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.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+
+/**
+ * @date 2022年10月13日 13:55
+ * 入参参数打印类
+ */
+@Aspect
+@Component
+public class RequestParameterAspectj {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(RequestParameterAspectj.class);
+
+ @Pointcut("execution(* com.ycwl.basic.controller.*.*.*(..))")
+ public void classPackage() {
+
+ }
+
+ @Around("classPackage()")
+ public Object parameterPoint(ProceedingJoinPoint joinPoint) throws Throwable {
+ final ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
+ if (requestAttributes != null) {
+ final HttpServletRequest request = requestAttributes.getRequest();
+ String requestURI = request.getRequestURI();
+ String method = request.getMethod();
+
+ HashSet parameterValueSet = new HashSet<>();
+ Object[] requestParameterValue = joinPoint.getArgs();
+ for (Object o : requestParameterValue) {
+ if (!(o instanceof HttpServletRequest || o instanceof HttpServletResponse)) {
+ parameterValueSet.add(String.valueOf(o));
+ }
+ }
+
+ Enumeration parameterNames = request.getParameterNames();
+ Map parameterUrlMap = new HashMap<>();
+ while (parameterNames.hasMoreElements()) {
+ String parameterName = parameterNames.nextElement();
+ String parameterValue = request.getParameter(parameterName);
+ parameterUrlMap.put(parameterName, parameterValue);
+ }
+
+ if (parameterUrlMap.isEmpty()) {
+ LOGGER.info("当前请求的路径为-> {} 请求方式为-> {} 参数为-> {}", requestURI, method, JSON.toJSONString(parameterValueSet));
+ } else {
+ LOGGER.info("当前请求的路径为-> {} 请求方式为-> {} 参数为-> {} 路径传参为-> {}", requestURI, method,
+ JSON.toJSONString(parameterValueSet), JSON.toJSONString(parameterUrlMap));
+ }
+ }
+ return joinPoint.proceed();
+ }
+}
diff --git a/src/main/java/com/ycwl/basic/config/CustomRedisCacheManager.java b/src/main/java/com/ycwl/basic/config/CustomRedisCacheManager.java
new file mode 100644
index 0000000..69ebc4e
--- /dev/null
+++ b/src/main/java/com/ycwl/basic/config/CustomRedisCacheManager.java
@@ -0,0 +1,56 @@
+package com.ycwl.basic.config;
+
+import org.springframework.cache.annotation.CachingConfigurerSupport;
+import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.redis.cache.RedisCacheConfiguration;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.RedisSerializationContext;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+
+import java.time.Duration;
+
+/**
+ * @author wenshijia
+ * @date 2021年07月05日 18:34
+ * 修改redis缓存序列化器
+ */
+@Configuration
+@EnableCaching
+public class CustomRedisCacheManager extends CachingConfigurerSupport {
+
+ @Bean
+ public RedisCacheConfiguration redisCacheConfiguration() {
+ Jackson2JsonRedisSerializer