From 0dc9fa6018be59785836358aa58991598a6f3fb7 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Mon, 13 Feb 2023 11:24:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=99=BA=E6=85=A7=E7=8E=AF=E4=BF=9D=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hbt-ep/.gitignore | 1 + hbt-ep/Dockerfile | 4 + hbt-ep/hbt-ep.iml | 231 ++++++++++++++++++ hbt-ep/pom.xml | 100 ++++++++ .../wit/park/backend/ep/EpApplication.java | 23 ++ .../ep/controller/CommonController.java | 24 ++ hbt-ep/src/main/resources/banner.txt | 8 + hbt-ep/src/main/resources/bootstrap-dev.yml | 16 ++ hbt-ep/src/main/resources/bootstrap.yml | 14 ++ pom.xml | 151 ++++++++++++ 10 files changed, 572 insertions(+) create mode 100644 hbt-ep/.gitignore create mode 100644 hbt-ep/Dockerfile create mode 100644 hbt-ep/hbt-ep.iml create mode 100644 hbt-ep/pom.xml create mode 100644 hbt-ep/src/main/java/com/hbt/wit/park/backend/ep/EpApplication.java create mode 100644 hbt-ep/src/main/java/com/hbt/wit/park/backend/ep/controller/CommonController.java create mode 100644 hbt-ep/src/main/resources/banner.txt create mode 100644 hbt-ep/src/main/resources/bootstrap-dev.yml create mode 100644 hbt-ep/src/main/resources/bootstrap.yml create mode 100644 pom.xml diff --git a/hbt-ep/.gitignore b/hbt-ep/.gitignore new file mode 100644 index 0000000..07a21b5 --- /dev/null +++ b/hbt-ep/.gitignore @@ -0,0 +1 @@ +./**/target diff --git a/hbt-ep/Dockerfile b/hbt-ep/Dockerfile new file mode 100644 index 0000000..e0394be --- /dev/null +++ b/hbt-ep/Dockerfile @@ -0,0 +1,4 @@ +FROM 119.45.158.12:5000/mini-java8:latest +COPY target/hbt-ep-1.0-SNAPSHOT.jar /app/app.jar +ENV NACOSIP="" +ENTRYPOINT ["sh","-c","java -Dnacos.ip=$NACOSIP -jar /app/app.jar"] \ No newline at end of file diff --git a/hbt-ep/hbt-ep.iml b/hbt-ep/hbt-ep.iml new file mode 100644 index 0000000..31ef613 --- /dev/null +++ b/hbt-ep/hbt-ep.iml @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/hbt-ep/pom.xml b/hbt-ep/pom.xml new file mode 100644 index 0000000..7d9a62c --- /dev/null +++ b/hbt-ep/pom.xml @@ -0,0 +1,100 @@ + + + + wit-park-backend + com.hbt + 1.0-SNAPSHOT + + 4.0.0 + + hbt-ep + + + + + 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 + + + + com.hbt + hbt-common-security + + + + org.springframework.boot + spring-boot-configuration-processor + true + + + + + com.hbt + hbt-common-datasource + + + + + com.hbt + hbt-common-swagger + + + + com.hbt + hbt-common-log + + + + io.springfox + springfox-swagger-ui + ${swagger.fox.version} + + + + + mysql + mysql-connector-java + + + org.springframework.boot + spring-boot-starter-test + test + + + org.projectlombok + lombok + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + + \ No newline at end of file diff --git a/hbt-ep/src/main/java/com/hbt/wit/park/backend/ep/EpApplication.java b/hbt-ep/src/main/java/com/hbt/wit/park/backend/ep/EpApplication.java new file mode 100644 index 0000000..f2cdecc --- /dev/null +++ b/hbt-ep/src/main/java/com/hbt/wit/park/backend/ep/EpApplication.java @@ -0,0 +1,23 @@ +package com.hbt.wit.park.backend.ep; + +import com.hbt.common.security.annotation.EnableCustomConfig; +import com.hbt.common.security.annotation.EnableRyFeignClients; +import com.hbt.common.swagger.annotation.EnableCustomSwagger2; +import org.springframework.boot.SpringApplication; +import org.springframework.cloud.client.SpringCloudApplication; + +/** + * 入口类, 扫描并注入其他配置类和服务 + */ +@EnableCustomConfig +@SpringCloudApplication +@EnableCustomSwagger2 +@EnableRyFeignClients +public class EpApplication { + + public static void main(String[] args) + { + SpringApplication.run(com.hbt.wit.park.backend.ep.EpApplication.class, args); + System.out.println("(♥◠‿◠)ノ゙ 智慧环保知识server启动成功 ლ(´ڡ`ლ)゙ "); + } +} diff --git a/hbt-ep/src/main/java/com/hbt/wit/park/backend/ep/controller/CommonController.java b/hbt-ep/src/main/java/com/hbt/wit/park/backend/ep/controller/CommonController.java new file mode 100644 index 0000000..9b1eddd --- /dev/null +++ b/hbt-ep/src/main/java/com/hbt/wit/park/backend/ep/controller/CommonController.java @@ -0,0 +1,24 @@ +package com.hbt.wit.park.backend.ep.controller; + +import com.hbt.common.core.domain.R; +import com.hbt.common.core.web.controller.BaseController; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/ep") +@Api(tags = "ep common", description = "ep 通用接口") +public class CommonController extends BaseController { + + @Autowired + @GetMapping("/action") + @ApiOperation("通用接口") + public R action() { + return R.ok("success"); + } + +} \ No newline at end of file diff --git a/hbt-ep/src/main/resources/banner.txt b/hbt-ep/src/main/resources/banner.txt new file mode 100644 index 0000000..33e2030 --- /dev/null +++ b/hbt-ep/src/main/resources/banner.txt @@ -0,0 +1,8 @@ +Spring Boot Version: ${spring-boot.version} +Spring Application Name: ${spring.application.name} + __ __ __ + / /_ / /_ / /_ ___ ____ + / __ \/ __ \/ __/_____/ _ \/ __ \ + / / / / /_/ / /_/_____/ __/ /_/ / +/_/ /_/_.___/\__/ \___/ .___/ + /_/ \ No newline at end of file diff --git a/hbt-ep/src/main/resources/bootstrap-dev.yml b/hbt-ep/src/main/resources/bootstrap-dev.yml new file mode 100644 index 0000000..78a8fbc --- /dev/null +++ b/hbt-ep/src/main/resources/bootstrap-dev.yml @@ -0,0 +1,16 @@ +# Spring +spring: + cloud: + nacos: + username: nacos + password: zkhbt888 + discovery: + # 服务注册地址 + server-addr: ${nacos.ip}:8848 + config: + # 配置中心地址 + server-addr: ${nacos.ip}:8848 + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-dataids: application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} diff --git a/hbt-ep/src/main/resources/bootstrap.yml b/hbt-ep/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..8199fc1 --- /dev/null +++ b/hbt-ep/src/main/resources/bootstrap.yml @@ -0,0 +1,14 @@ +# Tomcat +server: + port: 9528 +# Spring +spring: + application: + # 应用名称 + name: hbt-ep + profiles: + # 环境配置 + active: dev + +nacos: + ip: 119.45.158.12 diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..37dce19 --- /dev/null +++ b/pom.xml @@ -0,0 +1,151 @@ + + + 4.0.0 + + com.hbt + wit-park-backend + 1.0-SNAPSHOT + 智慧园区体系 + + hbt-ep + + pom + + + 3.6.1 + UTF-8 + UTF-8 + 1.8 + 2.7.3 + 2021.0.4 + 2021.0.4.0 + 2.7.5 + 3.0.0 + 1.6.2 + 1.27.2 + 2.3.3 + 1.4.6 + 1.2.15 + 3.5.2 + 2.11.0 + 1.4 + 2.3 + 2.0.20 + 0.9.1 + 8.2.2 + 4.1.2 + 3.2.2 + 2.13.2 + 6.0.8 + 1.18.12 + 2.9.9 + 2.4.0-SNAPSHOT + + + + + central + https://maven.aliyun.com/repository/public + + false + always + + + true + always + warn + + + + maven-public + http://81.70.119.104:8081/repository/maven-public/ + + false + always + + + true + always + warn + + + + + + maven-public + http://81.70.119.104:8081/repository/maven-public/ + + true + + + true + + + + + + maven-public + http://81.70.119.104:8081/repository/maven-releases/ + + + maven-public + http://81.70.119.104:8081/repository/maven-snapshots/ + + + + + + + + + com.hbt + hbt + ${hbt-cloud.version} + pom + import + + + + + com.alibaba.cloud + spring-cloud-alibaba-dependencies + ${spring-cloud-alibaba.version} + pom + import + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.version} + ${java.version} + ${project.build.sourceEncoding} + + + + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + + + repackage + + + + + + + + \ No newline at end of file