Compare commits

...

3 Commits

Author SHA1 Message Date
yanghanbin 0c4ce3568b style 2024-06-04 09:38:32 +08:00
yanghanbin 569e0ff210 * #01 项目工程 2024-03-05 16:46:48 +08:00
yanghanbin 5e39ea7fd2 * #01 init code 2024-02-22 17:35:11 +08:00
10 changed files with 464 additions and 0 deletions

View File

@ -0,0 +1,22 @@
package com.afe.ai.data;
import com.afe.ai.common.security.annotation.EnableRyFeignClients;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
/**
* @author ben.yang
* @description 数据中心
* @date 2024/2/22 17:25
*/
@EnableRyFeignClients
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class })
public class AiDataApplication {
public static void main(String[] args)
{
SpringApplication.run(AiDataApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ 数据中心启动成功 ლ(´ڡ`ლ)゙ ");
}
}

View File

@ -0,0 +1,21 @@
server:
port: 9209
spring:
application:
# 应用名称
name: ai-data
messages:
# 默认 messages, 这里我们多了一层目录i18n
basename: i18n/messages
# 如果默认 false, 则会出现匹配不到就会跑异常NoSuchMessageException的情况
use-code-as-default-message: true
# 是否总是应用MessageFormat规则即使是没有参数的消息也要解析, 默认 false
always-use-message-format: false
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
default-property-inclusion: ALWAYS
baffle:
enabled: true

View File

@ -0,0 +1,24 @@
Spring Boot Version: ${spring-boot.version}
Spring Application Name: ${spring.application.name}
////////////////////////////////////////////////////////////////////
// _ooOoo_ //
// o8888888o //
// 88" . "88 //
// (| ^_^ |) //
// O\ = /O //
// ____/`---'\____ //
// .' \\| |// `. //
// / \\||| : |||// \ //
// / _||||| -:- |||||- \ //
// | | \\\ - /// | | //
// | \_| ''\---/'' | | //
// \ .-\__ `-` ___/-. / //
// ___`. .' /--.--\ `. . ___ //
// ."" '< `.___\_<|>_/___.' >'"". //
// | | : `- \`.;`\ _ /`;.`/ - ` : | | //
// \ \ `-. \_ __\ /__ _/ .-` / / //
// ========`-.____`-.___\_____/___.-`____.-'======== //
// `=---=' //
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //
// 佛祖保佑 永不宕机 永无BUG //
////////////////////////////////////////////////////////////////////

View File

@ -0,0 +1,102 @@
# Nacos帮助文档: https://nacos.io/zh-cn/docs/concepts.html
# Nacos认证信息
# 指定的配置
spring:
profiles:
active: local
---
#默认环境(预生产部署环境)
spring:
config:
activate:
on-profile: pre-production
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: ai-nacos:8848
config:
# 配置中心地址
server-addr: ai-nacos:8848
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application.${spring.cloud.nacos.config.file-extension}
---
#默认环境(jenkins部署环境)
spring:
config:
activate:
on-profile: dev
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: ai-nacos:8848
config:
# 配置中心地址
server-addr: ai-nacos:8848
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
---
#localhost部署环境
spring:
config:
activate:
on-profile: local
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 127.0.0.1:8848
config:
# 配置中心地址
server-addr: 127.0.0.1:8848
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
---
#使用的远程的nacos在本地跑
spring:
config:
activate:
on-profile: remote_nacos
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 192.168.3.210:8848
# # 命名空间
# # 分组名称
# group: LOCAL_GROUP
config:
# 配置中心地址
server-addr: 192.168.3.210:8848
# # 命名空间
# # 分组名称
# group: LOCAL_GROUP
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
#- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
- application.${spring.cloud.nacos.config.file-extension}

View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<!-- 日志存放路径 -->
<property name="log.path" value="/data/logs/ai-auth" />
<!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/info.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>INFO</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/error.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>ERROR</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 系统模块日志级别控制 -->
<logger name="com.afe" level="info" />
<!-- Spring日志级别控制 -->
<logger name="org.springframework" level="warn" />
<root level="info">
<appender-ref ref="console" />
</root>
<!--系统操作日志-->
<root level="info">
<appender-ref ref="file_info" />
<appender-ref ref="file_error" />
</root>
</configuration>

View File

@ -0,0 +1,21 @@
server:
port: 9209
spring:
application:
# 应用名称
name: ai-data
messages:
# 默认 messages, 这里我们多了一层目录i18n
basename: i18n/messages
# 如果默认 false, 则会出现匹配不到就会跑异常NoSuchMessageException的情况
use-code-as-default-message: true
# 是否总是应用MessageFormat规则即使是没有参数的消息也要解析, 默认 false
always-use-message-format: false
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
default-property-inclusion: ALWAYS
baffle:
enabled: true

24
target/classes/banner.txt Normal file
View File

@ -0,0 +1,24 @@
Spring Boot Version: ${spring-boot.version}
Spring Application Name: ${spring.application.name}
////////////////////////////////////////////////////////////////////
// _ooOoo_ //
// o8888888o //
// 88" . "88 //
// (| ^_^ |) //
// O\ = /O //
// ____/`---'\____ //
// .' \\| |// `. //
// / \\||| : |||// \ //
// / _||||| -:- |||||- \ //
// | | \\\ - /// | | //
// | \_| ''\---/'' | | //
// \ .-\__ `-` ___/-. / //
// ___`. .' /--.--\ `. . ___ //
// ."" '< `.___\_<|>_/___.' >'"". //
// | | : `- \`.;`\ _ /`;.`/ - ` : | | //
// \ \ `-. \_ __\ /__ _/ .-` / / //
// ========`-.____`-.___\_____/___.-`____.-'======== //
// `=---=' //
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //
// 佛祖保佑 永不宕机 永无BUG //
////////////////////////////////////////////////////////////////////

View File

@ -0,0 +1,102 @@
# Nacos帮助文档: https://nacos.io/zh-cn/docs/concepts.html
# Nacos认证信息
# 指定的配置
spring:
profiles:
active: local
---
#默认环境(预生产部署环境)
spring:
config:
activate:
on-profile: pre-production
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: ai-nacos:8848
config:
# 配置中心地址
server-addr: ai-nacos:8848
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application.${spring.cloud.nacos.config.file-extension}
---
#默认环境(jenkins部署环境)
spring:
config:
activate:
on-profile: dev
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: ai-nacos:8848
config:
# 配置中心地址
server-addr: ai-nacos:8848
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
---
#localhost部署环境
spring:
config:
activate:
on-profile: local
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 127.0.0.1:8848
config:
# 配置中心地址
server-addr: 127.0.0.1:8848
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
---
#使用的远程的nacos在本地跑
spring:
config:
activate:
on-profile: remote_nacos
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 192.168.3.210:8848
# # 命名空间
# # 分组名称
# group: LOCAL_GROUP
config:
# 配置中心地址
server-addr: 192.168.3.210:8848
# # 命名空间
# # 分组名称
# group: LOCAL_GROUP
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
#- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
- application.${spring.cloud.nacos.config.file-extension}

Binary file not shown.

View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<!-- 日志存放路径 -->
<property name="log.path" value="/data/logs/ai-auth" />
<!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/info.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>INFO</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/error.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>ERROR</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 系统模块日志级别控制 -->
<logger name="com.afe" level="info" />
<!-- Spring日志级别控制 -->
<logger name="org.springframework" level="warn" />
<root level="info">
<appender-ref ref="console" />
</root>
<!--系统操作日志-->
<root level="info">
<appender-ref ref="file_info" />
<appender-ref ref="file_error" />
</root>
</configuration>