-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add nacos-client
- Loading branch information
Marcher
committed
Aug 8, 2022
1 parent
07cc337
commit 1c21ac5
Showing
21 changed files
with
530 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<?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>rms-mall</artifactId> | ||
<groupId>com.wyb.rms</groupId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>rms-mall-authority-center</artifactId> | ||
|
||
<properties> | ||
<maven.compiler.source>8</maven.compiler.source> | ||
<maven.compiler.target>8</maven.compiler.target> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.wyb.rms</groupId> | ||
<artifactId>rms-mall-mvc-config</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
</dependency> | ||
|
||
<!-- nacos config --> | ||
<dependency> | ||
<groupId>com.alibaba.cloud</groupId> | ||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> | ||
</dependency> | ||
|
||
<!-- spring cloud alibaba nacos discovery 依赖 --> | ||
<dependency> | ||
<groupId>com.alibaba.cloud</groupId> | ||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-data-jpa</artifactId> | ||
</dependency> | ||
|
||
<!-- MySQL 驱动, 注意, 这个需要与 MySQL 版本对应 --> | ||
<dependency> | ||
<groupId>mysql</groupId> | ||
<artifactId>mysql-connector-java</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
|
||
<!-- zipkin = spring-cloud-starter-sleuth + spring-cloud-sleuth-zipkin--> | ||
<!-- <dependency>--> | ||
<!-- <groupId>org.springframework.cloud</groupId>--> | ||
<!-- <artifactId>spring-cloud-starter-zipkin</artifactId>--> | ||
<!-- </dependency>--> | ||
|
||
<dependency> | ||
<groupId>org.springframework.kafka</groupId> | ||
<artifactId>spring-kafka</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.projectlombok</groupId> | ||
<artifactId>lombok</artifactId> | ||
<optional>true</optional> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-test</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<!-- | ||
SpringBoot的Maven插件, 能够以Maven的方式为应用提供SpringBoot的支持,可以将 | ||
SpringBoot应用打包为可执行的jar或war文件, 然后以通常的方式运行SpringBoot应用 | ||
--> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>repackage</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
20 changes: 20 additions & 0 deletions
20
rms-mall-authority-center/src/main/java/com.wyb.rms/AuthorityCenterApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.wyb.rms; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient; | ||
import org.springframework.data.jpa.repository.config.EnableJpaAuditing; | ||
|
||
/** | ||
* <h1>授权中心启动入口</h1> | ||
*/ | ||
@EnableJpaAuditing // 允许 Jpa 自动审计 | ||
@EnableDiscoveryClient | ||
@SpringBootApplication | ||
public class AuthorityCenterApplication { | ||
|
||
public static void main(String[] args) { | ||
|
||
SpringApplication.run(AuthorityCenterApplication.class, args); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
rms-mall-authority-center/src/main/resources/bootstrap.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
server: | ||
port: 7000 | ||
servlet: | ||
context-path: /rms-mall-authority-center | ||
|
||
spring: | ||
application: | ||
name: rms-mall-authority-center | ||
cloud: | ||
nacos: | ||
config: | ||
server-addr: 127.0.0.1:8848 | ||
namespace: | ||
file-extension: yml | ||
shared-configs: | ||
- dataId: db.yml | ||
group: e-commerce | ||
refresh: true | ||
discovery: | ||
enabled: true # 如果不想使用 Nacos 进行服务注册和发现, 设置为 false 即可 | ||
server-addr: 127.0.0.1:8848 # Nacos 服务器地址 | ||
# server-addr: 127.0.0.1:8848,127.0.0.1:8849,127.0.0.1:8850 # Nacos 服务器地址 | ||
namespace: | ||
metadata: | ||
management: | ||
context-path: ${server.servlet.context-path}/actuator | ||
|
||
# 暴露端点 | ||
management: | ||
endpoints: | ||
web: | ||
exposure: | ||
include: '*' | ||
endpoint: | ||
health: | ||
show-details: always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 0 additions & 32 deletions
32
rms-mall-common/src/main/java/com/wyb/rms/common/controller/ServerController.java
This file was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
rms-mall-common/src/main/java/com/wyb/rms/common/vo/CommonResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.wyb.rms.common.vo; | ||
|
||
import lombok.Data; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* Description: | ||
* | ||
* @author Marcher丶 | ||
* @date 2022-08-08 22:25 | ||
**/ | ||
@Data | ||
public class CommonResponse<T> implements Serializable { | ||
|
||
private static final long serialVersionUID = -1L; | ||
|
||
private Integer code; | ||
private Boolean success; | ||
private String msg; | ||
private T data; | ||
|
||
public CommonResponse(Integer code, String msg) { | ||
this.code = code; | ||
this.msg = msg; | ||
} | ||
} |
Empty file.
13 changes: 0 additions & 13 deletions
13
rms-mall-common/src/test/java/com/wyb/rms/common/RmsCommonApplicationTests.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?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>rms-mall</artifactId> | ||
<groupId>com.wyb.rms</groupId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>rms-mall-mvc-config</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
|
||
<name>rms-mall-mvc-config</name> | ||
<description>通用配置模块</description> | ||
|
||
<properties> | ||
<maven.compiler.source>8</maven.compiler.source> | ||
<maven.compiler.target>8</maven.compiler.target> | ||
</properties> | ||
|
||
<dependencies> | ||
<!-- 引入 Web 功能 --> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.wyb.rms</groupId> | ||
<artifactId>rms-mall-common</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
Oops, something went wrong.