commit 9cae163ca9f1e3b1738d5afee4b528ae740da76d
Author: jia <2744404105@qq.com>
Date: Sat Apr 20 19:02:58 2024 +0800
框架
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..5ff6309
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,38 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store
\ No newline at end of file
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..13566b8
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 0000000..1f8c663
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..5755a99
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
\ 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/bwie-auth/pom.xml b/bwie-auth/pom.xml
new file mode 100644
index 0000000..0480ead
--- /dev/null
+++ b/bwie-auth/pom.xml
@@ -0,0 +1,31 @@
+
+
+ 4.0.0
+
+ com.bwie
+ shopping_project
+ 1.0-SNAPSHOT
+
+
+ bwie-auth
+
+
+ 8
+ 8
+ UTF-8
+
+
+
+
+ com.bwie
+ bwie-common
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+
diff --git a/bwie-auth/src/main/resources/bootstrap.yml b/bwie-auth/src/main/resources/bootstrap.yml
new file mode 100644
index 0000000..37058db
--- /dev/null
+++ b/bwie-auth/src/main/resources/bootstrap.yml
@@ -0,0 +1,31 @@
+# Tomcat
+server:
+ port: 9001
+# Spring
+spring:
+ main:
+ allow-circular-references: true
+ allow-bean-definition-overriding: true
+ jackson:
+ date-format: yyyy-MM-dd HH:mm:ss
+ time-zone: GMT+8
+ application:
+ # 应用名称
+ name: bwie-auth
+ profiles:
+ # 环境配置
+ active: dev
+ cloud:
+ nacos:
+ discovery:
+ # 服务注册地址
+ server-addr: 124.221.30.134:8848
+ config:
+ # 配置中心地址
+ server-addr: 124.221.30.134:8848
+ # 配置文件格式
+ file-extension: yml
+ # 共享配置
+ shared-configs:
+ - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
+
diff --git a/bwie-common/pom.xml b/bwie-common/pom.xml
new file mode 100644
index 0000000..45ac5af
--- /dev/null
+++ b/bwie-common/pom.xml
@@ -0,0 +1,114 @@
+
+
+ 4.0.0
+
+ com.bwie
+ shopping_project
+ 1.0-SNAPSHOT
+
+
+ bwie-common
+
+
+ 8
+ 8
+ UTF-8
+
+
+
+
+ org.springframework.cloud
+ spring-cloud-starter-bootstrap
+
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-nacos-discovery
+
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-nacos-config
+
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-sentinel
+
+
+
+ org.springframework.cloud
+ spring-cloud-starter-loadbalancer
+
+
+
+ org.springframework.cloud
+ spring-cloud-starter-openfeign
+
+
+
+ io.jsonwebtoken
+ jjwt
+ 0.9.1
+
+
+
+ com.alibaba
+ fastjson
+ 1.2.80
+
+
+
+ org.springframework.boot
+ spring-boot-starter-data-redis
+
+
+
+ org.springframework.boot
+ spring-boot-starter-validation
+
+
+
+ org.apache.commons
+ commons-lang3
+
+
+
+ org.projectlombok
+ lombok
+
+
+
+ cn.hutool
+ hutool-all
+ 5.8.3
+
+
+
+ com.aliyun
+ dysmsapi20170525
+ 2.0.1
+
+
+
+ org.springframework.boot
+ spring-boot-starter-amqp
+
+
+
+
+ com.baomidou
+ mybatis-plus-boot-starter
+ 3.5.4.1
+
+
+
+
+ com.alibaba.fastjson2
+ fastjson2
+ 2.0.42
+
+
+
diff --git a/bwie-common/src/main/java/com/bwie/common/config/FastJson2JsonRedisSerializer.java b/bwie-common/src/main/java/com/bwie/common/config/FastJson2JsonRedisSerializer.java
new file mode 100644
index 0000000..584566b
--- /dev/null
+++ b/bwie-common/src/main/java/com/bwie/common/config/FastJson2JsonRedisSerializer.java
@@ -0,0 +1,48 @@
+package com.bwie.common.config;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONReader;
+import com.alibaba.fastjson2.JSONWriter;
+import com.alibaba.fastjson2.filter.Filter;
+import org.springframework.data.redis.serializer.RedisSerializer;
+import org.springframework.data.redis.serializer.SerializationException;
+
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+
+/**
+ * Redis使用FastJson序列化
+ *
+ * @author ruoyi
+ */
+public class FastJson2JsonRedisSerializer implements RedisSerializer {
+ public static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8;
+
+ static final Filter AUTO_TYPE_FILTER = JSONReader.autoTypeFilter(
+ "org.springframework", "com");
+
+ private Class clazz;
+
+ public FastJson2JsonRedisSerializer(Class clazz) {
+ super();
+ this.clazz = clazz;
+ }
+
+ @Override
+ public byte[] serialize (T t) throws SerializationException {
+ if (t == null) {
+ return new byte[0];
+ }
+ return JSON.toJSONString(t, JSONWriter.Feature.WriteClassName).getBytes(DEFAULT_CHARSET);
+ }
+
+ @Override
+ public T deserialize (byte[] bytes) throws SerializationException {
+ if (bytes == null || bytes.length <= 0) {
+ return null;
+ }
+ String str = new String(bytes, DEFAULT_CHARSET);
+
+ return JSON.parseObject(str, clazz, AUTO_TYPE_FILTER);
+ }
+}
diff --git a/bwie-common/src/main/java/com/bwie/common/config/MybatisPlusConfig.java b/bwie-common/src/main/java/com/bwie/common/config/MybatisPlusConfig.java
new file mode 100644
index 0000000..1983b7e
--- /dev/null
+++ b/bwie-common/src/main/java/com/bwie/common/config/MybatisPlusConfig.java
@@ -0,0 +1,30 @@
+package com.bwie.common.config;
+
+import com.baomidou.mybatisplus.annotation.DbType;
+import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * @author DongZl
+ * @description: Mybatis-Plus配置
+ * @Date 2024-1-10 下午 05:12
+ */
+@Configuration
+public class MybatisPlusConfig {
+
+ public MybatisPlusConfig () {
+ System.out.println("初始化-----------");
+ }
+
+ /**
+ * 添加分页插件
+ */
+ @Bean
+ public MybatisPlusInterceptor mybatisPlusInterceptor() {
+ MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
+ interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
+ return interceptor;
+ }
+}
diff --git a/bwie-common/src/main/java/com/bwie/common/config/RedisConfig.java b/bwie-common/src/main/java/com/bwie/common/config/RedisConfig.java
new file mode 100644
index 0000000..5d3ecc0
--- /dev/null
+++ b/bwie-common/src/main/java/com/bwie/common/config/RedisConfig.java
@@ -0,0 +1,65 @@
+package com.bwie.common.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.connection.RedisConnectionFactory;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.core.script.DefaultRedisScript;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+
+/**
+ * redis配置
+ *
+ * @author ruoyi
+ */
+@Configuration
+@EnableCaching
+public class RedisConfig extends CachingConfigurerSupport {
+ @Bean
+ @SuppressWarnings(value = {"unchecked", "rawtypes"})
+ public RedisTemplate