整理项目结构
This commit is contained in:
parent
70977e76fa
commit
1fe6ae1de0
|
|
@ -166,13 +166,13 @@ oms主功能微服务,主要功能包括:
|
|||
1. 启动MySQL8
|
||||
2. 启动Redis7
|
||||
3. 启动Sentinel1.8.7控制台
|
||||
4. 启动Nacos2.2.0
|
||||
4. 启动Nacos
|
||||
5. 启动Kafka
|
||||
|
||||
#### 3.2、导入数据库
|
||||
+ 创建数据库`qihang-erp`
|
||||
+ 1、导入数据库结构:sql脚本`docs\qihang-erp.sql`
|
||||
+ 2、导入系统数据:sql脚本`docs\qihang-erp-sys.sql`
|
||||
+ 创建数据库`qihang-oms`
|
||||
+ 导入数据库结构:sql脚本`docs\qihang-oms.sql`
|
||||
|
||||
|
||||
#### 3.3、启动服务(项目)
|
||||
1. 启动开放平台微服务(open-api)
|
||||
|
|
|
|||
|
|
@ -2,12 +2,11 @@
|
|||
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.qihang</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<groupId>cn.qihangerp</groupId>
|
||||
<artifactId>qihangerp-cloud</artifactId>
|
||||
<version>2.0.6</version>
|
||||
</parent>
|
||||
|
||||
<!-- <groupId>com.qihang</groupId>-->
|
||||
<artifactId>common</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
27
core/pom.xml
27
core/pom.xml
|
|
@ -1,27 +0,0 @@
|
|||
<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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.qihang</groupId>
|
||||
<artifactId>qihangerp-oms</artifactId>
|
||||
<version>2.0.6</version>
|
||||
</parent>
|
||||
|
||||
<!-- <groupId>com.qihang</groupId>-->
|
||||
<artifactId>core</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>core</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
<modules>
|
||||
<module>security</module>
|
||||
<module>common</module>
|
||||
</modules>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea/modules.xml
|
||||
.idea/jarRepositories.xml
|
||||
.idea/compiler.xml
|
||||
.idea/libraries/
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### Eclipse ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Mac OS ###
|
||||
.DS_Store
|
||||
8279
docs/qihang-erp.sql
8279
docs/qihang-erp.sql
File diff suppressed because one or more lines are too long
|
|
@ -1,45 +0,0 @@
|
|||
spring:
|
||||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
# host: 8.130.98.215
|
||||
host: 127.0.0.1
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
database: 0
|
||||
# 密码
|
||||
# password: 123321
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
lettuce:
|
||||
pool:
|
||||
# 连接池中的最小空闲连接
|
||||
min-idle: 0
|
||||
# 连接池中的最大空闲连接
|
||||
max-idle: 8
|
||||
# 连接池的最大数据库连接数
|
||||
max-active: 8
|
||||
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: -1ms
|
||||
datasource:
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/qihang-erp?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: Andy_123
|
||||
|
||||
|
||||
|
||||
# mybatis 日志
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 开启sql日志
|
||||
|
||||
|
||||
# minio配置
|
||||
minio:
|
||||
endpoint: http://127.0.0.1:9000 #换成自己的minio服务端地址
|
||||
accessKey: 0AksAWDtI20Lpb4qxq5S
|
||||
secretKey: yOAZkOVwrhPooBRel5PB0GwS5uw8VAgmqYykHl3T
|
||||
secure: false
|
||||
bucketName: ecerp
|
||||
|
|
@ -7,6 +7,7 @@
|
|||
<version>3.0.2</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
<groupId>cn.qihangerp</groupId>
|
||||
<artifactId>gateway</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>2.0.0</version>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package com.qihang.api;
|
||||
package cn.qihangerp.gateway;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package cn.qihangerp.gateway;
|
||||
|
||||
public class RestResult<T> {
|
||||
private int status;
|
||||
private String message;
|
||||
private T data; // 可选字段,根据需要返回数据
|
||||
|
||||
public RestResult(int status, String message) {
|
||||
this.status = status;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
// getter 和 setter
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(T data) {
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.qihang.api;
|
||||
package cn.qihangerp.gateway;
|
||||
|
||||
|
||||
import com.alibaba.nacos.common.model.RestResult;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
|
||||
|
|
@ -49,17 +49,17 @@
|
|||
<artifactId>spring-kafka</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.alibaba.cloud</groupId>-->
|
||||
<!-- <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<!--SpringCloud Alibaba nacos 服务发现依赖-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.qihang</groupId>
|
||||
<groupId>cn.qihangerp</groupId>
|
||||
<artifactId>security</artifactId>
|
||||
<version>2.0.6</version>
|
||||
</dependency>
|
||||
|
|
|
|||
|
|
@ -1,16 +1,43 @@
|
|||
server:
|
||||
port: 8083
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
# serverAddr: 127.0.0.1:8848
|
||||
discovery:
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
import:
|
||||
- nacos:qihang-oms.yaml?refresh=true
|
||||
|
||||
application:
|
||||
name: oms-api
|
||||
data:
|
||||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
# host: 8.130.98.215
|
||||
host: 127.0.0.1
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
database: 0
|
||||
# 密码
|
||||
# password: 123321
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
lettuce:
|
||||
pool:
|
||||
# 连接池中的最小空闲连接
|
||||
min-idle: 0
|
||||
# 连接池中的最大空闲连接
|
||||
max-idle: 8
|
||||
# 连接池的最大数据库连接数
|
||||
max-active: 8
|
||||
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: -1ms
|
||||
datasource:
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/qihang-oms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: Andy_123
|
||||
kafka:
|
||||
bootstrap-servers: localhost:9092
|
||||
producer:
|
||||
|
|
@ -47,8 +74,7 @@ spring:
|
|||
ms: 18000 # 消费请求的超时时间
|
||||
|
||||
|
||||
server:
|
||||
port: 8081
|
||||
|
||||
|
||||
|
||||
mybatis-plus:
|
||||
|
|
|
|||
|
|
@ -51,17 +51,17 @@
|
|||
<groupId>org.springframework.kafka</groupId>
|
||||
<artifactId>spring-kafka</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.alibaba.cloud</groupId>-->
|
||||
<!-- <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<!--SpringCloud Alibaba nacos 服务发现依赖-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.qihang</groupId>
|
||||
<groupId>cn.qihangerp</groupId>
|
||||
<artifactId>security</artifactId>
|
||||
<version>2.0.6</version>
|
||||
</dependency>
|
||||
|
|
|
|||
|
|
@ -1,16 +1,44 @@
|
|||
server:
|
||||
port: 8081
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: open-api
|
||||
cloud:
|
||||
nacos:
|
||||
# serverAddr: 127.0.0.1:8848
|
||||
discovery:
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
import:
|
||||
- nacos:qihang-oms.yaml?refresh=true
|
||||
application:
|
||||
name: open-api
|
||||
data:
|
||||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
# host: 8.130.98.215
|
||||
host: 127.0.0.1
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
database: 0
|
||||
# 密码
|
||||
# password: 123321
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
lettuce:
|
||||
pool:
|
||||
# 连接池中的最小空闲连接
|
||||
min-idle: 0
|
||||
# 连接池中的最大空闲连接
|
||||
max-idle: 8
|
||||
# 连接池的最大数据库连接数
|
||||
max-active: 8
|
||||
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: -1ms
|
||||
datasource:
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/qihang-oms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: Andy_123
|
||||
|
||||
kafka:
|
||||
bootstrap-servers: localhost:9092
|
||||
producer:
|
||||
|
|
@ -47,9 +75,6 @@ spring:
|
|||
ms: 18000 # 消费请求的超时时间
|
||||
|
||||
|
||||
server:
|
||||
port: 8089
|
||||
|
||||
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath*:mapper/**/*Mapper.xml
|
||||
|
|
|
|||
9
pom.xml
9
pom.xml
|
|
@ -2,17 +2,18 @@
|
|||
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>
|
||||
|
||||
<groupId>com.qihang</groupId>
|
||||
<artifactId>qihangerp-oms</artifactId>
|
||||
<groupId>cn.qihangerp</groupId>
|
||||
<artifactId>qihangerp-cloud</artifactId>
|
||||
<version>2.0.6</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>qihangerp-oms</name>
|
||||
<name>qihangerp-cloud</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
<modules>
|
||||
<module>sys-api</module>
|
||||
<module>gateway</module>
|
||||
<module>core</module>
|
||||
<module>common</module>
|
||||
<module>security</module>
|
||||
<module>oms-api</module>
|
||||
<module>open-api</module>
|
||||
</modules>
|
||||
|
|
|
|||
|
|
@ -2,12 +2,11 @@
|
|||
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.qihang</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<groupId>cn.qihangerp</groupId>
|
||||
<artifactId>qihangerp-cloud</artifactId>
|
||||
<version>2.0.6</version>
|
||||
</parent>
|
||||
|
||||
<!-- <groupId>com.qihang</groupId>-->
|
||||
<artifactId>security</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
|
|
@ -70,7 +69,7 @@
|
|||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.qihang</groupId>
|
||||
<groupId>cn.qihangerp</groupId>
|
||||
<artifactId>common</artifactId>
|
||||
<version>2.0.6</version>
|
||||
</dependency>
|
||||
|
|
@ -51,10 +51,10 @@
|
|||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.alibaba.cloud</groupId>-->
|
||||
<!-- <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<!--SpringCloud Alibaba nacos 服务发现依赖-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
|
|
@ -172,7 +172,7 @@
|
|||
<version>3.12.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.qihang</groupId>
|
||||
<groupId>cn.qihangerp</groupId>
|
||||
<artifactId>security</artifactId>
|
||||
<version>2.0.6</version>
|
||||
</dependency>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,9 @@
|
|||
mybatis-plus:
|
||||
mapper-locations: classpath*:mapper/**/*Mapper.xml
|
||||
type-aliases-package: com.qihang.sys.api.domain;com.qihang.security.entity;
|
||||
configuration:
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 开启sql日志
|
||||
#mybatis:
|
||||
# mapper-locations: classpath*:mappers/user/*.xml
|
||||
server:
|
||||
port: 8082
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: sys-api
|
||||
messages:
|
||||
# 国际化资源文件路径
|
||||
basename: i18n/messages
|
||||
|
|
@ -20,19 +17,43 @@ spring:
|
|||
server-addr: 127.0.0.1:8848
|
||||
usename: nacos
|
||||
passowrd: nacos
|
||||
config:
|
||||
server-addr: 127.0.0.1:8848
|
||||
# gateway:
|
||||
# discovery:
|
||||
# locator:
|
||||
# enabled: true # gateway 可以从 nacos 发现微服务
|
||||
config:
|
||||
import:
|
||||
- nacos:qihang-oms.yaml?refresh=true
|
||||
application:
|
||||
name: sys-api
|
||||
server:
|
||||
port: 8082
|
||||
data:
|
||||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
# host: 8.130.98.215
|
||||
host: 127.0.0.1
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
database: 0
|
||||
# 密码
|
||||
# password: 123321
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
lettuce:
|
||||
pool:
|
||||
# 连接池中的最小空闲连接
|
||||
min-idle: 0
|
||||
# 连接池中的最大空闲连接
|
||||
max-idle: 8
|
||||
# 连接池的最大数据库连接数
|
||||
max-active: 8
|
||||
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: -1ms
|
||||
datasource:
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/qihang-oms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: Andy_123
|
||||
|
||||
|
||||
|
||||
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath*:mapper/**/*Mapper.xml
|
||||
type-aliases-package: com.qihang.sys.api.domain;com.qihang.security.entity;
|
||||
configuration:
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 开启sql日志
|
||||
#mybatis:
|
||||
# mapper-locations: classpath*:mappers/user/*.xml
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
<select id="selectMenuTreeAll" resultMap="BaseResultMap">
|
||||
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
||||
from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0 and m.system_id='oms'
|
||||
from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0
|
||||
order by m.parent_id, m.order_num
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -24,4 +24,17 @@ export function pullLogisticsJd(data) {
|
|||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function getTaoOAuthUrl(query) {
|
||||
return request({
|
||||
url: '/api/tao-api/tao/oauth',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
export function saveSessionKey(data) {
|
||||
return request({
|
||||
url: '/api/open-api/tao/saveSessionKey',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue