commit 0440330226b51088385a18125f213a392cb50696
Author: Syliang <1439806354@qq.com>
Date: Fri Apr 24 17:05:31 2026 +0800
項目初始化+三方接口對接
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..ca90681
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,116 @@
+
+
+ 4.0.0
+
+ com.bim
+ api
+ 1.0.0
+ jar
+
+ BIM API
+ BIM项目管理后端接口服务
+
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 3.2.0
+
+
+
+
+ 17
+ UTF-8
+ UTF-8
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ org.springframework.boot
+ spring-boot-starter-data-jpa
+
+
+ com.mysql
+ mysql-connector-j
+ runtime
+
+
+ org.projectlombok
+ lombok
+ true
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+ org.apache.httpcomponents.client5
+ httpclient5
+ 5.2.1
+
+
+ org.springframework.boot
+ spring-boot-starter-data-redis
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+
+
+ cn.hutool
+ hutool-http
+ 5.8.22
+
+
+
+ org.springframework.boot
+ spring-boot-starter-validation
+
+
+ cn.hutool
+ hutool-all
+ 5.8.25
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
+ org.projectlombok
+ lombok
+
+
+
+
+
+
+
+
+
+ dev
+
+ true
+
+
+ dev
+
+
+
+ prod
+
+ prod
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/com/bim/api/BimApiApplication.java b/src/main/java/com/bim/api/BimApiApplication.java
new file mode 100644
index 0000000..01ddde4
--- /dev/null
+++ b/src/main/java/com/bim/api/BimApiApplication.java
@@ -0,0 +1,12 @@
+package com.bim.api;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class BimApiApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(BimApiApplication.class, args);
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/bim/api/config/CorsConfig.java b/src/main/java/com/bim/api/config/CorsConfig.java
new file mode 100644
index 0000000..9d08e33
--- /dev/null
+++ b/src/main/java/com/bim/api/config/CorsConfig.java
@@ -0,0 +1,20 @@
+package com.bim.api.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.CorsRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+@Configuration
+public class CorsConfig implements WebMvcConfigurer {
+
+ @Override
+ public void addCorsMappings(CorsRegistry registry) {
+ registry.addMapping("/**")
+ .allowedOrigins("*")
+ .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
+ .allowedHeaders("*")
+ .allowCredentials(false)
+ .maxAge(3600);
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/bim/api/config/RedisConfig.java b/src/main/java/com/bim/api/config/RedisConfig.java
new file mode 100644
index 0000000..0ee4195
--- /dev/null
+++ b/src/main/java/com/bim/api/config/RedisConfig.java
@@ -0,0 +1,38 @@
+package com.bim.api.config;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.PropertyAccessor;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator;
+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.serializer.Jackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+
+@Configuration
+public class RedisConfig {
+
+ @Bean
+ public RedisTemplate redisTemplate(RedisConnectionFactory factory) {
+ RedisTemplate template = new RedisTemplate<>();
+ template.setConnectionFactory(factory);
+
+ Jackson2JsonRedisSerializer