Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
1095071913 committed Sep 1, 2022
1 parent 41534c2 commit 2962266
Show file tree
Hide file tree
Showing 9 changed files with 117 additions and 77 deletions.
90 changes: 36 additions & 54 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.zhongshi</groupId>
<artifactId>zhongshi-etc-parent</artifactId>
<groupId>com.jiumao</groupId>
<artifactId>jiumao-saas-parent</artifactId>
<version>1.5.0-SNAPSHOT</version>
</parent>
<version>1.6.0-ZHONGSHI-SNAPSHOT</version>
<artifactId>zhongshi-etc-basics-bootadmin</artifactId>
<artifactId>jiumao-saas-basics-bootadmin</artifactId>
<version>1.0.0-SNAPSHOT</version>

<properties>
<application-run>com.zhongshi.BootAdminApplication</application-run>
<application-run>com.jiumao.BootAdminApplication</application-run>
</properties>

<dependencies>




<dependencies>

<!-- SpringBoot Begin -->
<dependency>
<groupId>de.codecentric</groupId>
Expand All @@ -30,6 +31,11 @@
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>

<!-- <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency> -->
<!-- SpringBoot End -->


Expand All @@ -46,17 +52,20 @@
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- SpringCloud End -->

<!-- SpringCloud End -->


<dependency>
<groupId>org.codehaus.janino</groupId>
<artifactId>janino</artifactId>
</dependency>


<!-- Project Begin -->
<dependency>
<groupId>com.zhongshi</groupId>
<artifactId>zhongshi-etc-config-mvc</artifactId>
<version>${zhongshi-etc-config-mvc.version}</version>
<groupId>com.jiumao</groupId>
<artifactId>jiumao-saas-config-mvc</artifactId>
<version>${jiumao-saas-config-mvc.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework.cloud</groupId>
Expand All @@ -66,9 +75,9 @@
</dependency>

<dependency>
<groupId>com.zhongshi</groupId>
<artifactId>zhongshi-etc-service-base-run</artifactId>
<version>${zhongshi-etc-service-base-run.version}</version>
<groupId>com.jiumao</groupId>
<artifactId>jiumao-saas-service-base-run</artifactId>
<version>${jiumao-saas-service-base-run.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework.cloud</groupId>
Expand All @@ -90,54 +99,23 @@




<profiles>
<profile>
<id>local</id>
<properties>
<!--suppress UnresolvedMavenProperty -->
<nacos.config.server-addr>${NACOS_CONFIG_SERVER:localhost:8848}</nacos.config.server-addr>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>dev</id>
<properties>
<!--suppress UnresolvedMavenProperty -->
<nacos.config.server-addr>${NACOS_CONFIG_SERVER:47.115.156.57:8848}</nacos.config.server-addr>
</properties>
</profile>
<profile>
<id>test</id>
<properties>
<!--suppress UnresolvedMavenProperty -->
<nacos.config.server-addr>${NACOS_CONFIG_SERVER:120.24.24.164:8848}</nacos.config.server-addr>
</properties>

</profile>
</profiles>


<!-- <distributionManagement>
<distributionManagement>
<repository>
<id>maven-releases</id>
<name>Nexus Release Repository</name>
<url>http://{ip}/repository/maven-releases/</url>
<url>http://175.178.52.106:8081/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>maven-snapshots</id>
<name>Nexus Snapshot Repository</name>
<url>http://{ip}/repository/maven-snapshots/</url>
<url>http://175.178.52.106:8081/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
<repositories>
<repository>
<id>nexus</id>
<id>maven-public</id>
<name>Nexus Repository</name>
<url>http://{ip}/repository/maven-public/</url>
<url>http://175.178.52.106:8081/repository/maven-public/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
Expand All @@ -146,20 +124,22 @@
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<id>maven-public</id>
<name>Nexus Plugin Repository</name>
<url>http://{ip}/repository/maven-public/</url>
<url>http://175.178.52.106:8081/repository/maven-public/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories> -->
</pluginRepositories>






Expand Down Expand Up @@ -200,4 +180,6 @@
</build>
<!-- boot打包 End -->



</project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
*
*/

package com.zhongshi;

import de.codecentric.boot.admin.server.config.EnableAdminServer;
package com.jiumao;

/**
*
Expand All @@ -33,7 +31,6 @@
*
*/

@EnableAdminServer
public class BootAdminApplication extends BaseApplication {

public static void main(String[] args) {
Expand Down
39 changes: 39 additions & 0 deletions src/main/java/com/jiumao/config/Config.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

package com.jiumao.config;

import org.springframework.context.annotation.Configuration;
import de.codecentric.boot.admin.server.config.EnableAdminServer;

/**
*
* Specifications:功能
*
* Author:彭晋龙
*
* Creation Date:2021-12-18:16:32:34
*
* Copyright Ownership:xiao mao zi
*
* Agreement That:Apache 2.0
*
*/

@Configuration
@EnableAdminServer
public class Config {}
14 changes: 14 additions & 0 deletions src/main/java/com/jiumao/config/SecurityPermitAllConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//package com.jiumao.config;
//
//import org.springframework.context.annotation.Configuration;
//import org.springframework.security.config.annotation.web.builders.HttpSecurity;
//import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
//
//@Configuration
//public class SecurityPermitAllConfig extends WebSecurityConfigurerAdapter {
// @Override
// protected void configure(HttpSecurity http) throws Exception {
// http.authorizeRequests().anyRequest().permitAll()
// .and().csrf().disable();
// }
//}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//package com.zhongshi.config;
//package com.jiumao.config;
//
//import java.util.UUID;
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.zhongshi.log.convert;
package com.jiumao.log.convert;

import com.zhongshi.factory.BaseResultFactory;
import com.zhongshi.tool.ApplicationEnvironmentConfig;
import com.jiumao.tool.ApplicationEnvironmentConfig;

import ch.qos.logback.classic.pattern.MessageConverter;
import ch.qos.logback.classic.spi.ILoggingEvent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.zhongshi.log.convert;
package com.jiumao.log.convert;

import com.zhongshi.tool.ApplicationEnvironmentConfig;
import com.jiumao.tool.ApplicationEnvironmentConfig;

import ch.qos.logback.classic.pattern.MessageConverter;
import ch.qos.logback.classic.spi.ILoggingEvent;
Expand Down
12 changes: 5 additions & 7 deletions src/main/resources/bootstrap.properties
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
spring.application.name=zhongshi-etc-bootadmin
spring.application.name=jiumao-saas-bootadmin
spring.cloud.nacos.config.file-extension=yml
spring.cloud.nacos.config.server-addr=localhost:8848
spring.cloud.nacos.config.server-addr=${NACOS_CONFIG_SERVER:localhost:8848}
spring.cloud.nacos.config.shared-dataids=cloud-default.yml,cloud-nacos.yml,boot-admin.yml
#spring.cloud.nacos.config.refreshable-dataids

spring.main.allow-bean-definition-overriding=true

logging.level.root=ERROR
logging.level.com.zhongshi=INFO
logging.config=classpath:log.xml
logging.file.name=${LOG_PATH:log.log}
logging.level.com.jiumao=INFO
logging.file.name=log/log.log
logging.config=classpath:log.xml
23 changes: 17 additions & 6 deletions src/main/resources/log.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
<conversionRule conversionWord="environment" converterClass="com.zhongshi.log.convert.EnvironmentMessageConverter" />
<conversionRule conversionWord="applicationName" converterClass="com.zhongshi.log.convert.ApplicationNameMessageConverter" />
<conversionRule conversionWord="environment" converterClass="com.jiumao.log.convert.EnvironmentMessageConverter" />
<conversionRule conversionWord="applicationName" converterClass="com.jiumao.log.convert.ApplicationNameMessageConverter" />
<springProperty scope="context" name="project.environment" source="project.environment"/>
<springProperty scope="context" name="spring.application.name" source="spring.application.name"/>



Expand Down Expand Up @@ -42,10 +44,10 @@
<!-- ALL -->
<appender name="all-log" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 文件路径 ,注意LOG_PATH是默认值,它的配置对应application.properties里的logging.path值-->
<file>${LOG_PATH:-./log.log}</file>
<file>log/log.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 文件名称 -->
<fileNamePattern>log-%d{yyyy-MM-dd}.log</fileNamePattern>
<fileNamePattern>log/%d{yyyy-MM-dd}-log.log</fileNamePattern>
<!-- 文件最大保存历史数量 -->
<MaxHistory>30</MaxHistory>
</rollingPolicy>
Expand Down Expand Up @@ -219,9 +221,18 @@


<logger name="root" >
<appender-ref ref="all-log-async" />
<appender-ref ref="console-log-async" />

<if condition='property("project.environment").contains("localhost")'>
<then>
<appender-ref ref="console-log-async" />
</then>
<else>
<appender-ref ref="all-log-async" />
</else>
</if>

<appender-ref ref="grpc-log" />

</logger>

<!-- <logger name="com" level="INFO">
Expand Down

0 comments on commit 2962266

Please sign in to comment.