upd
This commit is contained in:
parent
f531f4e1e9
commit
7468644622
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>kenaito-config</artifactId>
|
||||
<groupId>cn.odboy</groupId>
|
||||
<version>1.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>kenaito-config-common</artifactId>
|
||||
<name>子模块-配置中心-公共依赖</name>
|
||||
</project>
|
|
@ -0,0 +1,9 @@
|
|||
### IDEA ###
|
||||
~/*
|
||||
.idea/*
|
||||
*.iml
|
||||
*/target/*
|
||||
*/*.iml
|
||||
/.gradle/
|
||||
/application.pid
|
||||
/logs/application.log
|
|
@ -0,0 +1,48 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>kenaito-config</artifactId>
|
||||
<groupId>cn.odboy</groupId>
|
||||
<version>1.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>kenaito-config-demo</artifactId>
|
||||
<name>子系统-配置使用Demo</name>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
|
||||
<java.version>11</java.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.odboy</groupId>
|
||||
<artifactId>kenaito-config-core</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<!-- 打包 -->
|
||||
<build>
|
||||
<finalName>kenaito-config-demo</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<!-- 跳过单元测试 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<skipTests>true</skipTests>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
|
@ -0,0 +1,46 @@
|
|||
package cn.odboy;
|
||||
|
||||
|
||||
import cn.odboy.util.GenCmdHelper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 代码生成入口
|
||||
*
|
||||
* @date 2024-04-27
|
||||
*/
|
||||
public class GenCode {
|
||||
public static void main(String[] args) {
|
||||
GenCmdHelper generator = new GenCmdHelper();
|
||||
generator.setDatabaseUrl(String.format("jdbc:mysql://%s:%s/%s", "kenaito-mysql.odboy.local", 13306, "kenaito_devops"));
|
||||
generator.setDatabaseUsername("root");
|
||||
generator.setDatabasePassword("root");
|
||||
genCareer(generator);
|
||||
}
|
||||
|
||||
private static void genCareer(GenCmdHelper generator) {
|
||||
generator.gen("devops_", List.of(
|
||||
// 应用
|
||||
// "devops_app",
|
||||
// "devops_app_user",
|
||||
// "devops_product_line",
|
||||
// 应用迭代
|
||||
// "devops_app_iteration",
|
||||
// "devops_app_iteration_change",
|
||||
// 容器
|
||||
// "devops_containerd_cluster_config",
|
||||
// "devops_containerd_cluster_node",
|
||||
// "devops_ops_config",
|
||||
// "devops_containerd_spec_config",
|
||||
// 网络
|
||||
// "devops_network_service",
|
||||
// "devops_network_ingress",
|
||||
// 流水线
|
||||
"devops_pipeline_template_type",
|
||||
"devops_pipeline_template_language",
|
||||
"devops_pipeline_template_language_config",
|
||||
"devops_pipeline_template_app"
|
||||
));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package cn.odboy;
|
||||
|
||||
import cn.odboy.infra.context.EasyBootApplication;
|
||||
import cn.odboy.infra.context.SpringContextHolder;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
@EnableAsync
|
||||
@SpringBootApplication
|
||||
@EnableTransactionManagement
|
||||
public class KenaitoConfigDemoRun extends EasyBootApplication {
|
||||
@Bean
|
||||
public SpringContextHolder springContextHolder() {
|
||||
return new SpringContextHolder();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication springApplication = new SpringApplication(KenaitoConfigDemoRun.class);
|
||||
initd(springApplication.run(args));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package cn.odboy.rest;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/demo")
|
||||
public class DemoController {
|
||||
|
||||
@PostMapping("/test")
|
||||
public ResponseEntity<Object> test() {
|
||||
return ResponseEntity.ok("success");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
_ _ _____ __ _ ___ _ _____ _____ _____ _____ __ _ _____ _ _____
|
||||
| | / / | ____| | \ | | / | | | |_ _| / _ \ / ___| / _ \ | \ | | | ___| | | / ___|
|
||||
| |/ / | |__ | \| | / /| | | | | | | | | | | | | | | | | \| | | |__ | | | |
|
||||
| |\ \ | __| | |\ | / / | | | | | | | | | | | | | | | | | |\ | | __| | | | | _
|
||||
| | \ \ | |___ | | \ | / / | | | | | | | |_| | | |___ | |_| | | | \ | | | | | | |_| |
|
||||
|_| \_\ |_____| |_| \_| /_/ |_| |_| |_| \_____/ \_____| \_____/ |_| \_| |_| |_| \_____/
|
||||
|
||||
:: Spring Boot :: (v2.7.18)
|
|
@ -0,0 +1,7 @@
|
|||
kenaito:
|
||||
config-center:
|
||||
server: 127.0.0.1
|
||||
port: 28002
|
||||
data-id: kenaito-config-service
|
||||
cache-dir: c:\\data
|
||||
env: daily
|
|
@ -0,0 +1,7 @@
|
|||
kenaito:
|
||||
config-center:
|
||||
server: 127.0.0.1
|
||||
port: 28002
|
||||
data-id: kenaito-config-service
|
||||
cache-dir: /home/admin/data
|
||||
env: production
|
|
@ -0,0 +1,7 @@
|
|||
kenaito:
|
||||
config-center:
|
||||
server: 127.0.0.1
|
||||
port: 28002
|
||||
data-id: kenaito-config-service
|
||||
cache-dir: /home/admin/data
|
||||
env: stage
|
|
@ -0,0 +1,4 @@
|
|||
spring:
|
||||
profiles:
|
||||
# 激活哪个配置文件, application-{active}.yml
|
||||
active: daily
|
|
@ -0,0 +1,4 @@
|
|||
# If you use SLF4J. First, you need to tell log4jdbc-log4j2 that you want to use the SLF4J logger
|
||||
log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator
|
||||
log4jdbc.auto.load.popular.drivers=false
|
||||
log4jdbc.drivers=com.mysql.cj.jdbc.Driver
|
|
@ -0,0 +1,62 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="30 seconds" debug="false">
|
||||
<!-- 定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径 -->
|
||||
<property name="APP_NAME" value="kenaito-config-service"/>
|
||||
<!-- linux -->
|
||||
<!-- <property name="LOG_HOME" value="/home/kenaito-config-service/logs"/>-->
|
||||
<!-- windows -->
|
||||
<property name="LOG_HOME" value="C:/Users/Administrator/kenaito-config-service/logs"/>
|
||||
<property name="LOG_PATTERN"
|
||||
value="%red(%d{yyyy-MM-dd HH:mm:ss.SSS}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{50}) - %msg%n"/>
|
||||
|
||||
<!--控制台日志-->
|
||||
<appender name="Console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<!--格式化输出:%d表示日期, %thread表示线程名, %-5level:级别从左显示5个字符宽度%msg:日志消息, %n是换行符-->
|
||||
<!-- <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %X{tl} [%thread] %-5level %logger{50} - %msg%n</pattern> -->
|
||||
<pattern>${LOG_PATTERN}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
<!--文件日志-->
|
||||
<appender name="SyncLogFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<!-- <File>${LOG_HOME}/${APP_NAME}/logback-async-rolling.log</File>-->
|
||||
<File>${LOG_HOME}/application.log</File>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--日志文件输出的文件名-->
|
||||
<FileNamePattern>${LOG_HOME}/application.log.%d{yyyy-MM-dd}.%i.log</FileNamePattern>
|
||||
<!--日志文件保留天数-->
|
||||
<MaxHistory>30</MaxHistory>
|
||||
<!--日志文件大小-->
|
||||
<maxFileSize>1000MB</maxFileSize>
|
||||
</rollingPolicy>
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<!--格式化输出:%d表示日期, %thread表示线程名, %-5level:级别从左显示5个字符宽度%msg:日志消息, %n是换行符-->
|
||||
<!-- <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %X{tl} [%thread] %-5level %logger{50} - %msg%n</pattern> -->
|
||||
<pattern>${LOG_PATTERN}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
<logger name="jdbc.resultset" level="ERROR" additivity="false">
|
||||
<appender-ref ref="Console"/>
|
||||
</logger>
|
||||
<logger name="jdbc.sqlonly" level="OFF" additivity="false">
|
||||
<appender-ref ref="Console"/>
|
||||
</logger>
|
||||
<!-- 如想看到表格数据, 将OFF改为INFO -->
|
||||
<logger name="jdbc.resultsettable" level="OFF" additivity="false">
|
||||
<appender-ref ref="Console"/>
|
||||
</logger>
|
||||
<logger name="jdbc.connection" level="OFF" additivity="false">
|
||||
<appender-ref ref="Console"/>
|
||||
</logger>
|
||||
<logger name="jdbc.sqltiming" level="OFF" additivity="false">
|
||||
<appender-ref ref="Console"/>
|
||||
</logger>
|
||||
<logger name="jdbc.audit" level="OFF" additivity="false">
|
||||
<appender-ref ref="Console"/>
|
||||
</logger>
|
||||
<!-- 日志输出级别 -->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="Console"/>
|
||||
<!-- <appender-ref ref="SyncLogFile"/>-->
|
||||
</root>
|
||||
</configuration>
|
Loading…
Reference in New Issue