From f992c0982a644c032e73f2f398a88478e1bc6c6a Mon Sep 17 00:00:00 2001 From: wenjy Date: Fri, 12 Jul 2024 11:13:56 +0800 Subject: [PATCH] =?UTF-8?q?add=20-=20=E6=B7=BB=E5=8A=A0=E8=83=BD=E6=BA=90?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mesnac-modules/mesnac-ems/pom.xml | 105 ++++++++++++++++++ .../java/com/mesnac/ems/EmsApplication.java | 34 ++++++ .../mesnac-ems/src/main/resources/banner.txt | 9 ++ .../src/main/resources/bootstrap.yml | 27 +++++ .../mesnac-ems/src/main/resources/logback.xml | 74 ++++++++++++ mesnac-modules/pom.xml | 1 + 6 files changed, 250 insertions(+) create mode 100644 mesnac-modules/mesnac-ems/pom.xml create mode 100644 mesnac-modules/mesnac-ems/src/main/java/com/mesnac/ems/EmsApplication.java create mode 100644 mesnac-modules/mesnac-ems/src/main/resources/banner.txt create mode 100644 mesnac-modules/mesnac-ems/src/main/resources/bootstrap.yml create mode 100644 mesnac-modules/mesnac-ems/src/main/resources/logback.xml diff --git a/mesnac-modules/mesnac-ems/pom.xml b/mesnac-modules/mesnac-ems/pom.xml new file mode 100644 index 0000000..1ec0558 --- /dev/null +++ b/mesnac-modules/mesnac-ems/pom.xml @@ -0,0 +1,105 @@ + + 4.0.0 + + com.mesnac + mesnac-modules + 3.6.4 + + + com.mesnac.basic + mesnac-modules-ems + + + mesnac-modules-ems 能源管理模块 + + + + UTF-8 + + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-sentinel + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + + io.springfox + springfox-swagger-ui + ${swagger.fox.version} + + + + + com.mysql + mysql-connector-j + + + + + com.mesnac + mesnac-common-datasource + + + + + com.mesnac + mesnac-common-datascope + + + + + com.mesnac + mesnac-common-log + + + + + com.mesnac + mesnac-common-swagger + + + + com.mesnac + mesnac-api-basic + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + + diff --git a/mesnac-modules/mesnac-ems/src/main/java/com/mesnac/ems/EmsApplication.java b/mesnac-modules/mesnac-ems/src/main/java/com/mesnac/ems/EmsApplication.java new file mode 100644 index 0000000..e63a82d --- /dev/null +++ b/mesnac-modules/mesnac-ems/src/main/java/com/mesnac/ems/EmsApplication.java @@ -0,0 +1,34 @@ +package com.mesnac.ems; + +import com.mesnac.common.security.annotation.EnableCustomConfig; +import com.mesnac.common.security.annotation.EnableRyFeignClients; +import com.mesnac.common.swagger.annotation.EnableCustomSwagger2; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Hello world! + * + */ +@EnableCustomConfig +@EnableCustomSwagger2 +@EnableRyFeignClients +@SpringBootApplication +public class EmsApplication +{ + public static void main( String[] args ) + { + SpringApplication.run(EmsApplication.class, args); + + System.out.println("(♥◠‿◠)ノ゙ 能源管理模块启动成功 ლ(´ڡ`ლ)゙ \n" + + " .-------. ____ __ \n" + + " | _ _ \\ \\ \\ / / \n" + + " | ( ' ) | \\ _. / ' \n" + + " |(_ o _) / _( )_ .' \n" + + " | (_,_).' __ ___(_ o _)' \n" + + " | |\\ \\ | || |(_,_)' \n" + + " | | \\ `' /| `-' / \n" + + " | | \\ / \\ / \n" + + " ''-' `'-' `-..-' "); + } +} diff --git a/mesnac-modules/mesnac-ems/src/main/resources/banner.txt b/mesnac-modules/mesnac-ems/src/main/resources/banner.txt new file mode 100644 index 0000000..68f84ce --- /dev/null +++ b/mesnac-modules/mesnac-ems/src/main/resources/banner.txt @@ -0,0 +1,9 @@ +Spring Boot Version: ${spring-boot.version} +Spring Application Name: ${spring.application.name} + +.---. +| +|--- .--.--. .--. +| | | | `--. +'---'' ' `-`--' + diff --git a/mesnac-modules/mesnac-ems/src/main/resources/bootstrap.yml b/mesnac-modules/mesnac-ems/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..38eca68 --- /dev/null +++ b/mesnac-modules/mesnac-ems/src/main/resources/bootstrap.yml @@ -0,0 +1,27 @@ +# Tomcat +server: + port: 9002 + +# Spring +spring: + application: + # 应用名称 + name: mesnac-ems + profiles: + # 环境配置 + active: dev + cloud: + nacos: + discovery: + # 服务注册地址 + server-addr: tencent:8848 + namespace: mesnac-mes + config: + # 配置中心地址 + server-addr: tencent:8848 + namespace: mesnac-mes + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} \ No newline at end of file diff --git a/mesnac-modules/mesnac-ems/src/main/resources/logback.xml b/mesnac-modules/mesnac-ems/src/main/resources/logback.xml new file mode 100644 index 0000000..118cb69 --- /dev/null +++ b/mesnac-modules/mesnac-ems/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/mesnac-modules/pom.xml b/mesnac-modules/pom.xml index 9a4a320..806ed0e 100644 --- a/mesnac-modules/pom.xml +++ b/mesnac-modules/pom.xml @@ -15,6 +15,7 @@ mesnac-file mesnac-prodmgr mesnac-basic + mesnac-ems mesnac-modules