Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
2775a7d5
Commit
2775a7d5
authored
May 26, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
6f43d9c5
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
179 additions
and
156 deletions
+179
-156
application.yml
yifu-auth/src/main/resources/application.yml
+5
-29
pom.xml
yifu-consumer/consumer-api/pom.xml
+4
-4
package-info.java
.../yifu/cloud/plus/v1/yifu/consumer/feign/package-info.java
+0
-1
pom.xml
yifu-consumer/consumer-biz/pom.xml
+8
-8
ConsumerApplication.java
.../com/yifu/cloud/plus/v1/consumer/ConsumerApplication.java
+0
-7
ConsumerServiceImpl.java
...ud/plus/v1/consumer/service/impl/ConsumerServiceImpl.java
+1
-4
application.yml
...-consumer/consumer-biz/src/main/resources/application.yml
+71
-9
RemoteProviderService.java
...u/cloud/plus/v1/provider/feign/RemoteProviderService.java
+1
-3
RemoteProviderServiceFallbackFactory.java
...r/feign/factory/RemoteProviderServiceFallbackFactory.java
+0
-17
RemoteProviderServiceFallbackImpl.java
...der/feign/fallback/RemoteProviderServiceFallbackImpl.java
+0
-21
package-info.java
...a/com/yifu/cloud/plus/v1/provider/feign/package-info.java
+0
-1
spring.factories.txt
...ider-api/src/main/resources/META-INF/spring.factories.txt
+0
-0
pom.xml
yifu-provider/provider-biz/pom.xml
+8
-8
ProviderApplication.java
.../com/yifu/cloud/plus/v1/provider/ProviderApplication.java
+0
-8
application.yml
...-provider/provider-biz/src/main/resources/application.yml
+74
-9
pom.xml
yifu-upms/yifu-upms-api/pom.xml
+2
-2
application.yml
yifu-upms/yifu-upms-biz/src/main/resources/application.yml
+5
-25
No files found.
yifu-auth/src/main/resources/application.yml
View file @
2775a7d5
...
...
@@ -14,26 +14,6 @@ management:
health
:
show-details
:
ALWAYS
# feign 配置
feign
:
sentinel
:
enabled
:
true
okhttp
:
enabled
:
true
httpclient
:
enabled
:
false
client
:
config
:
default
:
connectTimeout
:
10000
readTimeout
:
10000
compression
:
request
:
enabled
:
true
response
:
enabled
:
true
# mybaits-plus配置
mybatis-plus
:
mapper-locations
:
classpath:/mapper/*Mapper.xml
...
...
@@ -50,6 +30,10 @@ mybatis-plus:
# spring security 配置
security
:
oauth2
:
client
:
client-id
:
ENC(27v1agvAug87ANOVnbKdsw==)
client-secret
:
ENC(VbnkopxrwgbFVKp+UxJ2pg==)
scope
:
server
resource
:
loadBalanced
:
true
token-info-uri
:
http://yifu-auth/oauth/check_token
...
...
@@ -59,15 +43,7 @@ security:
-
/v3/api-docs
-
/actuator/**
# swagger 配置
swagger
:
enabled
:
true
title
:
Yifu Swagger API
gateway
:
http://${GATEWAY_HOST:yifu-gateway}:${GATEWAY-PORT:9999}
token-url
:
${swagger.gateway}/auth/oauth/token
services
:
yifu-upms-biz
:
admin
yifu-codegen
:
gen
# Spring 相关
spring
:
application
:
...
...
yifu-consumer/consumer-api/pom.xml
View file @
2775a7d5
...
...
@@ -22,16 +22,16 @@
<artifactId>
yifu-common-core
</artifactId>
</dependency>
<!--swagger 注解-->
<dependency>
<
!--<
dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
</dependency>
</dependency>
-->
<!--feign 注解依赖-->
<dependency>
<
!--<
dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-openfeign-core</artifactId>
<optional>true</optional>
</dependency>
</dependency>
-->
<!--mybatis 依赖-->
<dependency>
<groupId>
com.yifu.cloud.plus.v1
</groupId>
...
...
yifu-consumer/consumer-api/src/main/java/com/yifu/cloud/plus/v1/yifu/consumer/feign/package-info.java
deleted
100644 → 0
View file @
6f43d9c5
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
consumer
.
feign
;
\ No newline at end of file
yifu-consumer/consumer-biz/pom.xml
View file @
2775a7d5
...
...
@@ -43,30 +43,30 @@
<artifactId>
yifu-common-security
</artifactId>
</dependency>
<!--必备:服务处理-->
<dependency>
<
!--<
dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-feign</artifactId>
</dependency>
</dependency>
-->
<!--必备:日志处理-->
<dependency>
<groupId>
com.yifu.cloud.plus.v1
</groupId>
<artifactId>
yifu-common-log
</artifactId>
</dependency>
<!--必备:swagger-->
<dependency>
<
!--<
dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-swagger</artifactId>
</dependency>
</dependency>
-->
<!--必备: 注册中心客户端-->
<dependency>
<!--
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
</dependency>
-->
<!--必备: 配置中心客户端-->
<dependency>
<
!--<
dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
</dependency>
-->
<!--必备:undertow容器-->
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
yifu-consumer/consumer-biz/src/main/java/com/yifu/cloud/plus/v1/consumer/ConsumerApplication.java
View file @
2775a7d5
package
com
.
yifu
.
cloud
.
plus
.
v1
.
consumer
;
import
com.yifu.cloud.plus.v1.yifu.common.feign.annotation.EnableYifuFeignClients
;
import
com.yifu.cloud.plus.v1.yifu.common.security.annotation.EnableYifuResourceServer
;
import
com.yifu.cloud.plus.v1.yifu.common.swagger.annotation.EnableYifuDoc
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
/**
* @author pig archetype
* <p>
* 项目启动类
*/
@EnableYifuDoc
@EnableYifuFeignClients
@EnableYifuResourceServer
@EnableDiscoveryClient
@SpringBootApplication
public
class
ConsumerApplication
{
...
...
yifu-consumer/consumer-biz/src/main/java/com/yifu/cloud/plus/v1/consumer/service/impl/ConsumerServiceImpl.java
View file @
2775a7d5
...
...
@@ -21,8 +21,6 @@ import com.yifu.cloud.plus.v1.consumer.entity.Consumer;
import
com.yifu.cloud.plus.v1.consumer.mapper.ConsumerMapper
;
import
com.yifu.cloud.plus.v1.consumer.service.ConsumerService
;
import
com.yifu.cloud.plus.v1.provider.entity.Provider
;
import
com.yifu.cloud.plus.v1.provider.feign.RemoteProviderService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Service
;
...
...
@@ -38,7 +36,6 @@ import org.springframework.transaction.annotation.Transactional;
@Service
public
class
ConsumerServiceImpl
extends
ServiceImpl
<
ConsumerMapper
,
Consumer
>
implements
ConsumerService
{
private
final
RemoteProviderService
remoteProviderService
;
@GlobalTransactional
// 分布式seata事务
...
...
@@ -52,7 +49,7 @@ public class ConsumerServiceImpl extends ServiceImpl<ConsumerMapper, Consumer> i
provider
.
setCreateTime
(
consumer
.
getCreateTime
());
provider
.
setUpdateBy
(
consumer
.
getUpdateBy
());
provider
.
setUpdateTime
(
consumer
.
getUpdateTime
());
remoteProviderService
.
testSeata
(
provider
,
SecurityConstants
.
FROM_IN
);
//
remoteProviderService.testSeata(provider, SecurityConstants.FROM_IN);
baseMapper
.
insert
(
consumer
);
return
true
;
}
...
...
yifu-consumer/consumer-biz/src/main/resources/application.yml
View file @
2775a7d5
server
:
port
:
7002
# 加解密根密码
jasypt
:
encryptor
:
password
:
pig
#根密码
# 暴露监控端点
management
:
endpoints
:
web
:
exposure
:
include
:
"
*"
endpoint
:
health
:
show-details
:
ALWAYS
## spring security 配置
security
:
oauth2
:
client
:
client-id
:
ENC(27v1agvAug87ANOVnbKdsw==)
client-secret
:
ENC(VbnkopxrwgbFVKp+UxJ2pg==)
scope
:
server
resource
:
loadBalanced
:
true
token-info-uri
:
http://yifu-auth/oauth/check_token
# mybaits-plus配置
mybatis-plus
:
mapper-locations
:
classpath:/mapper/*Mapper.xml
global-config
:
banner
:
false
db-config
:
id-type
:
auto
table-underline
:
true
logic-delete-value
:
1
logic-not-delete-value
:
0
configuration
:
map-underscore-to-camel-case
:
true
# 直接放行URL
ignore
:
urls
:
-
/v2/api-docs
-
/actuator/**
spring
:
application
:
name
:
@
artifactId@
cloud
:
nacos
:
discovery
:
server-addr
:
${NACOS_HOST:yifu-register}:${NACOS_PORT:8848}
config
:
server-addr
:
${spring.cloud.nacos.discovery.server-addr}
---
# 数据源配置
spring
:
redis
:
host
:
yifu-redis
password
:
'
@yf_2017'
datasource
:
type
:
com.zaxxer.hikari.HikariDataSource
driver-class-name
:
com.mysql.cj.jdbc.Driver
username
:
root
password
:
yf_zsk
url
:
jdbc:mysql://192.168.1.65:22306/consumer?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
config
:
activate
:
on-profile
:
test
---
# 数据源配置
spring
:
redis
:
host
:
yifu-redis
password
:
'
@yf_2017'
datasource
:
type
:
com.zaxxer.hikari.HikariDataSource
driver-class-name
:
com.mysql.cj.jdbc.Driver
username
:
root
password
:
yf_zsk
url
:
jdbc:mysql://192.168.1.65:22306/consumer?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
config
:
import
:
-
nacos:application-@profiles.active@.yml
-
nacos:${spring.application.name}-@profiles.active@.yml
activate
:
on-profile
:
dev
yifu-provider/provider-api/src/main/java/com/yifu/cloud/plus/v1/provider/feign/RemoteProviderService.java
View file @
2775a7d5
...
...
@@ -2,9 +2,7 @@ package com.yifu.cloud.plus.v1.provider.feign;
import
com.yifu.cloud.plus.v1.provider.entity.Provider
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ServiceNameConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestHeader
;
...
...
@@ -13,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestHeader;
* @author fxj
* @Date 2022-05-14
*/
@FeignClient
(
contextId
=
"remoteProviderService"
,
value
=
ServiceNameConstants
.
PROVIDER_SERVICE
)
//
@FeignClient(contextId="remoteProviderService",value = ServiceNameConstants.PROVIDER_SERVICE)
public
interface
RemoteProviderService
{
@PostMapping
(
"/provider/inner/save"
)
R
<
Boolean
>
testSeata
(
@RequestBody
Provider
provider
,
@RequestHeader
(
SecurityConstants
.
FROM
)
String
from
);
...
...
yifu-provider/provider-api/src/main/java/com/yifu/cloud/plus/v1/provider/feign/factory/RemoteProviderServiceFallbackFactory.java
deleted
100644 → 0
View file @
6f43d9c5
package
com
.
yifu
.
cloud
.
plus
.
v1
.
provider
.
feign
.
factory
;
import
com.yifu.cloud.plus.v1.provider.feign.RemoteProviderService
;
import
com.yifu.cloud.plus.v1.provider.feign.fallback.RemoteProviderServiceFallbackImpl
;
import
org.springframework.cloud.openfeign.FallbackFactory
;
import
org.springframework.stereotype.Component
;
//异常回调工厂
@Component
public
class
RemoteProviderServiceFallbackFactory
implements
FallbackFactory
<
RemoteProviderService
>
{
@Override
public
RemoteProviderService
create
(
Throwable
cause
)
{
RemoteProviderServiceFallbackImpl
remoteProviderServiceFallback
=
new
RemoteProviderServiceFallbackImpl
();
remoteProviderServiceFallback
.
setCause
(
cause
);
return
remoteProviderServiceFallback
;
}
}
yifu-provider/provider-api/src/main/java/com/yifu/cloud/plus/v1/provider/feign/fallback/RemoteProviderServiceFallbackImpl.java
deleted
100644 → 0
View file @
6f43d9c5
package
com
.
yifu
.
cloud
.
plus
.
v1
.
provider
.
feign
.
fallback
;
import
com.yifu.cloud.plus.v1.provider.entity.Provider
;
import
com.yifu.cloud.plus.v1.provider.feign.RemoteProviderService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
lombok.Setter
;
import
lombok.extern.log4j.Log4j2
;
import
org.springframework.stereotype.Component
;
@Log4j2
@Component
public
class
RemoteProviderServiceFallbackImpl
implements
RemoteProviderService
{
@Setter
private
Throwable
cause
;
@Override
public
R
<
Boolean
>
testSeata
(
Provider
provider
,
String
from
)
{
log
.
error
(
"测试seata异常"
,
provider
,
cause
);
return
null
;
}
}
yifu-provider/provider-api/src/main/java/com/yifu/cloud/plus/v1/provider/feign/package-info.java
deleted
100644 → 0
View file @
6f43d9c5
package
com
.
yifu
.
cloud
.
plus
.
v1
.
provider
.
feign
;
\ No newline at end of file
yifu-provider/provider-api/src/main/resources/META-INF/spring.factories
→
yifu-provider/provider-api/src/main/resources/META-INF/spring.factories
.txt
View file @
2775a7d5
File moved
yifu-provider/provider-biz/pom.xml
View file @
2775a7d5
...
...
@@ -43,30 +43,30 @@
<artifactId>
yifu-common-security
</artifactId>
</dependency>
<!--必备:服务处理-->
<dependency>
<
!--<
dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-feign</artifactId>
</dependency>
</dependency>
-->
<!--必备:日志处理-->
<dependency>
<groupId>
com.yifu.cloud.plus.v1
</groupId>
<artifactId>
yifu-common-log
</artifactId>
</dependency>
<!--必备:swagger-->
<dependency>
<
!--<
dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-swagger</artifactId>
</dependency>
</dependency>
-->
<!--必备: 注册中心客户端-->
<dependency>
<
!--<
dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
</dependency>
-->
<!--必备: 配置中心客户端-->
<dependency>
<
!--<
dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
</dependency>
-->
<!--必备:undertow容器-->
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
yifu-provider/provider-biz/src/main/java/com/yifu/cloud/plus/v1/provider/ProviderApplication.java
View file @
2775a7d5
package
com
.
yifu
.
cloud
.
plus
.
v1
.
provider
;
import
com.yifu.cloud.plus.v1.yifu.common.feign.annotation.EnableYifuFeignClients
;
import
com.yifu.cloud.plus.v1.yifu.common.security.annotation.EnableYifuResourceServer
;
import
com.yifu.cloud.plus.v1.yifu.common.swagger.annotation.EnableYifuDoc
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.context.annotation.ComponentScan
;
/**
* @author pig archetype
* <p>
* 项目启动类
*/
@EnableYifuDoc
@EnableYifuFeignClients
@EnableYifuResourceServer
@EnableDiscoveryClient
//@ComponentScan(basePackages = {"com.yifu.cloud.plus.v1"})
@SpringBootApplication
public
class
ProviderApplication
{
...
...
yifu-provider/provider-biz/src/main/resources/application.yml
View file @
2775a7d5
server
:
port
:
7001
# 加解密根密码
jasypt
:
encryptor
:
password
:
pig
#根密码
# 暴露监控端点
management
:
endpoints
:
web
:
exposure
:
include
:
"
*"
endpoint
:
health
:
show-details
:
ALWAYS
security
:
oauth2
:
client
:
client-id
:
ENC(27v1agvAug87ANOVnbKdsw==)
client-secret
:
ENC(VbnkopxrwgbFVKp+UxJ2pg==)
scope
:
server
resource
:
loadBalanced
:
true
token-info-uri
:
http://yifu-auth/oauth/check_token
# mybaits-plus配置
mybatis-plus
:
mapper-locations
:
classpath:/mapper/*Mapper.xml
global-config
:
banner
:
false
db-config
:
id-type
:
auto
table-underline
:
true
logic-delete-value
:
1
logic-not-delete-value
:
0
configuration
:
map-underscore-to-camel-case
:
true
# 直接放行URL
ignore
:
urls
:
-
/v2/api-docs
-
/actuator/**
#spring 配置
spring
:
application
:
name
:
@
artifactId@
cloud
:
nacos
:
discovery
:
server-addr
:
${NACOS_HOST:yifu-register}:${NACOS_PORT:8848}
config
:
server-addr
:
${spring.cloud.nacos.discovery.server-addr}
---
# 数据源配置
spring
:
redis
:
host
:
yifu-redis
password
:
'
@yf_2017'
datasource
:
type
:
com.zaxxer.hikari.HikariDataSource
driver-class-name
:
com.mysql.cj.jdbc.Driver
username
:
root
password
:
yf_zsk
url
:
jdbc:mysql://192.168.1.65:22306/provider?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
config
:
activate
:
on-profile
:
test
---
# 数据源配置
spring
:
redis
:
host
:
yifu-redis
password
:
'
@yf_2017'
datasource
:
type
:
com.zaxxer.hikari.HikariDataSource
driver-class-name
:
com.mysql.cj.jdbc.Driver
username
:
root
password
:
yf_zsk
url
:
jdbc:mysql://192.168.1.65:22306/provider?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
config
:
import
:
-
nacos:application-@profiles.active@.yml
-
nacos:${spring.application.name}-@profiles.active@.yml
activate
:
on-profile
:
dev
yifu-upms/yifu-upms-api/pom.xml
View file @
2775a7d5
...
...
@@ -37,10 +37,10 @@
<artifactId>
yifu-common-core
</artifactId>
</dependency>
<!--swagger-->
<dependency>
<
!--<
dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
</dependency>
</dependency>
-->
<!--feign 注解依赖-->
<!--<dependency>
<groupId>org.springframework.cloud</groupId>
...
...
yifu-upms/yifu-upms-biz/src/main/resources/application.yml
View file @
2775a7d5
...
...
@@ -14,26 +14,6 @@ management:
health
:
show-details
:
ALWAYS
# feign 配置
feign
:
sentinel
:
enabled
:
true
okhttp
:
enabled
:
true
httpclient
:
enabled
:
false
client
:
config
:
default
:
connectTimeout
:
10000
readTimeout
:
10000
compression
:
request
:
enabled
:
true
response
:
enabled
:
true
# mybaits-plus配置
mybatis-plus
:
mapper-locations
:
classpath:/mapper/*Mapper.xml
...
...
@@ -53,11 +33,11 @@ security:
resource
:
loadBalanced
:
true
token-info-uri
:
http://yifu-auth/oauth/check_token
# 通用放行URL,服务个性化,请在对应配置文件覆盖
ignore
:
urls
:
-
/v3/api-docs
-
/actuator/**
# 通用放行URL,服务个性化,请在对应配置文件覆盖
ignore
:
urls
:
-
/v3/api-docs
-
/actuator/**
# 文件上传相关 支持阿里云、华为云、腾讯、minio
oss
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment