From 5e39ea7fd2a8e113938fab7246de8c650da534c4 Mon Sep 17 00:00:00 2001 From: yanghanbin Date: Thu, 22 Feb 2024 17:35:11 +0800 Subject: [PATCH] * #01 init code --- .../com/afe/ai/data/AiDataApplication.java | 22 ++++ src/main/resources/application.yml | 21 ++++ src/main/resources/banner.txt | 24 +++++ src/main/resources/bootstrap.yml | 102 ++++++++++++++++++ src/main/resources/logback.xml | 74 +++++++++++++ .../com/afe/ai/data/AiDataApplication.class | Bin 0 -> 1084 bytes 6 files changed, 243 insertions(+) create mode 100644 src/main/java/com/afe/ai/data/AiDataApplication.java create mode 100644 src/main/resources/application.yml create mode 100644 src/main/resources/banner.txt create mode 100644 src/main/resources/bootstrap.yml create mode 100644 src/main/resources/logback.xml create mode 100644 target/classes/com/afe/ai/data/AiDataApplication.class diff --git a/src/main/java/com/afe/ai/data/AiDataApplication.java b/src/main/java/com/afe/ai/data/AiDataApplication.java new file mode 100644 index 0000000..5111818 --- /dev/null +++ b/src/main/java/com/afe/ai/data/AiDataApplication.java @@ -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("(♥◠‿◠)ノ゙ 数据中心启动成功 ლ(´ڡ`ლ)゙ "); + } +} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..39c4e02 --- /dev/null +++ b/src/main/resources/application.yml @@ -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 \ No newline at end of file diff --git a/src/main/resources/banner.txt b/src/main/resources/banner.txt new file mode 100644 index 0000000..fd1bd4c --- /dev/null +++ b/src/main/resources/banner.txt @@ -0,0 +1,24 @@ +Spring Boot Version: ${spring-boot.version} +Spring Application Name: ${spring.application.name} +//////////////////////////////////////////////////////////////////// +// _ooOoo_ // +// o8888888o // +// 88" . "88 // +// (| ^_^ |) // +// O\ = /O // +// ____/`---'\____ // +// .' \\| |// `. // +// / \\||| : |||// \ // +// / _||||| -:- |||||- \ // +// | | \\\ - /// | | // +// | \_| ''\---/'' | | // +// \ .-\__ `-` ___/-. / // +// ___`. .' /--.--\ `. . ___ // +// ."" '< `.___\_<|>_/___.' >'"". // +// | | : `- \`.;`\ _ /`;.`/ - ` : | | // +// \ \ `-. \_ __\ /__ _/ .-` / / // +// ========`-.____`-.___\_____/___.-`____.-'======== // +// `=---=' // +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // +// 佛祖保佑 永不宕机 永无BUG // +//////////////////////////////////////////////////////////////////// \ No newline at end of file diff --git a/src/main/resources/bootstrap.yml b/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..a4b27b3 --- /dev/null +++ b/src/main/resources/bootstrap.yml @@ -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} + + + + + diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml new file mode 100644 index 0000000..3b5db2b --- /dev/null +++ b/src/main/resources/logback.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + ${log.pattern} + + + + + + ${log.path}/info.log + + + + ${log.path}/info.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/error.log + + + + ${log.path}/error.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + ERROR + + ACCEPT + + DENY + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/classes/com/afe/ai/data/AiDataApplication.class b/target/classes/com/afe/ai/data/AiDataApplication.class new file mode 100644 index 0000000000000000000000000000000000000000..8f4e0cb6a8232fbac8b8cc8af58bbbf5a7a81b81 GIT binary patch literal 1084 zcma)5OHUL*5dM0346G}x%R}+Gh>zX%(HCzJl4X^|WTS>Pc;I61(5#I!(`2Sc;by`` zNldsHqX!=c6E8kvlz4!|qd&nL#O2CAFxKo6SRzK}P(58${ngiBRe%5Wbs4|~oQuQ4 zK?{fCIE*9hIErI!NXOBS;}!-OT8EUU%rHY!COgj1T+ow}p|hwwc_nnq(!Vas4tY{V zZ3|~y_$u0OI-AWc6)+4GZS8U~CAm<1QW(MW>LM-qnHfjf!YJ(x60|Fn$IzRZC{Bwz zf;+;i@RISBR~f987Jh}mx^@XO#7jE#Z8@qUF1>%ipN|k3`o==fC|8cFKoQHl=V?|)~Sn{KpWZ_ z`u{1vg%b&!#3>7>6UZRTP{^!3dA0WV#oE0Uve}L02OG=J(&_a_@7Eu`{kim}x-wr~ zd{S4cg&NeM z;qyZpjdG@8G763eg27#eA-k)5)Bq!A4c`(d>i_oqkvj@gBO9oe<^m&Ks;)yK+*2>E zG`~hoHZ+-1xOAYacDJ2w1}kc_afo$KBkQesrUw?Imlu68u&7UD