1
0

feat(all): 搭建基本框架和模块

This commit is contained in:
2024-11-15 15:35:08 +08:00
commit 1900265075
174 changed files with 87868 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
package com.eshore.gringotts.configuration;
import com.fasterxml.jackson.datatype.eclipsecollections.EclipseCollectionsModule;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* Jackson 自定义设置
*
* @author lanyuanxiaoyao
* @date 2023-04-21
*/
@Configuration
public class JacksonConfiguration {
private static final Logger logger = LoggerFactory.getLogger(JacksonConfiguration.class);
@Bean
public Jackson2ObjectMapperBuilderCustomizer jackson2ObjectMapperBuilderCustomizer() {
return builder -> {
builder.modules(
new EclipseCollectionsModule(),
new JavaTimeModule()
);
};
}
}

View File

@@ -0,0 +1,49 @@
package com.eshore.gringotts.configuration;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* @author lanyuanxiaoyao
* @date 2023-07-03
*/
@ConfigurationProperties("spring.security.meta")
@Component
public class SecurityProperties {
private String authority;
private String username;
private String darkcode;
public String getAuthority() {
return authority;
}
public void setAuthority(String authority) {
this.authority = authority;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getDarkcode() {
return darkcode;
}
public void setDarkcode(String darkcode) {
this.darkcode = darkcode;
}
@Override
public String toString() {
return "SecurityProperties{" +
"authority='" + authority + '\'' +
", username='" + username + '\'' +
", darkcode='" + darkcode + '\'' +
'}';
}
}

View File

@@ -0,0 +1,24 @@
package com.eshore.gringotts.configuration;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
* web配置
*
* @author lanyuanxiaoyao
* @date 2024-11-14
*/
@Configuration
public class WebConfiguration implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
// 避免跨域影响调试
registry.addMapping("/**")
.allowedOriginPatterns("*")
.allowCredentials(true)
.allowedMethods("*")
.maxAge(3600);
}
}

View File

@@ -0,0 +1,8 @@
spring:
main:
banner-mode: off
jackson:
default-property-inclusion: non_null
deserialization:
fail-on-ignored-properties: false
fail-on-unknown-properties: false

View File

@@ -0,0 +1,6 @@
spring:
datasource:
url: jdbc:mysql://132.121.204.217:17906/hudi_collect_build_2?useSSL=false
username: odcp
password: wFg_fR492#&
driver-class-name: com.mysql.jdbc.Driver

View File

@@ -0,0 +1,6 @@
spring:
security:
meta:
username: ENC(moIO5mO39V1Z+RDwROK9JXY4GfM8ZjDgM6Si7wRZ1MPVjbhTpmLz3lz28rAiw7c2LeCmizfJzHkEXIwGlB280g==)
authority: ENC(GXKnbq1LS11U2HaONspvH+D/TkIx13aWTaokdkzaF7HSvq6Z0Rv1+JUWFnYopVXu)
darkcode: ENC(0jzpQ7T6S+P7bZrENgYsUoLhlqGvw7DA2MN3BRqEOwq7plhtg72vuuiPQNnr3DaYz0CpyTvxInhpx11W3VZ1trD6NINh7O3LN70ZqO5pWXk=)

View File

@@ -0,0 +1,13 @@
management:
endpoints:
web:
exposure:
include: "*"
enabled-by-default: false
endpoint:
prometheus:
enabled: true
jmx:
metrics:
export:
enabled: false

View File

@@ -0,0 +1,5 @@
server:
port: 0
sa-token:
is-print: false
token-name: token