Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
civil-bigdata
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
civil
civil-bigdata
Commits
b880f187
Commit
b880f187
authored
Jun 25, 2021
by
袁伟铭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户模块添加多数据源
parent
670439a5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
4 deletions
+17
-4
api-server/src/main/java/com/zq/api/constant/ApiCodeEnum.java
+2
-0
api-server/src/main/java/com/zq/api/controller/ApiController.java
+2
-0
api-server/src/main/java/com/zq/api/utils/ApiUtils.java
+11
-0
portal-server/src/main/resources/application.yml
+1
-1
user-server/src/main/resources/application.yml
+1
-3
No files found.
api-server/src/main/java/com/zq/api/constant/ApiCodeEnum.java
View file @
b880f187
...
...
@@ -25,6 +25,8 @@ public enum ApiCodeEnum {
CHECK_SIGN_VALID_ERROR
(
"108"
,
"签名校验失败"
),
SERVICE_NOT_AVAILABLE
(
"109"
,
"服务不可用"
),
BUSINESS_ERROR
(
"400"
,
"业务处理失败"
),
SERVER_ERROR
(
"500"
,
"服务器繁忙"
),
...
...
api-server/src/main/java/com/zq/api/controller/ApiController.java
View file @
b880f187
...
...
@@ -89,6 +89,8 @@ public class ApiController {
// 判断指定异常是否来自或者包含指定异常
if
(
ExceptionUtil
.
isFromOrSuppressedThrowable
(
e
,
FeignException
.
Unauthorized
.
class
))
{
resp
=
ApiUtils
.
toApiResp
(
form
,
ResultVo
.
fail
(
401
,
"Unauthorized"
));
}
else
if
(
stackTrace
.
contains
(
"Load balancer does not have available server for client"
))
{
resp
=
ApiUtils
.
getServiceNotAvailableError
(
form
);
}
else
{
resp
=
ApiUtils
.
getMethodHandlerError
(
form
);
}
...
...
api-server/src/main/java/com/zq/api/utils/ApiUtils.java
View file @
b880f187
...
...
@@ -144,6 +144,17 @@ public class ApiUtils {
return
new
ApiResp
(
form
,
ApiCodeEnum
.
CHECK_SIGN_VALID_ERROR
);
}
/**
* 服务不可用resp
* <p>
* 2016年9月29日 上午11:44:38
*
* @return
*/
public
static
ApiResp
getServiceNotAvailableError
(
ApiForm
form
)
{
return
new
ApiResp
(
form
,
ApiCodeEnum
.
SERVICE_NOT_AVAILABLE
);
}
public
static
ApiResp
toApiResp
(
ApiForm
form
,
ResultVo
resultVo
)
{
ApiResp
apiResp
=
new
ApiResp
(
form
);
if
(
resultVo
.
isSuccess
())
{
...
...
portal-server/src/main/resources/application.yml
View file @
b880f187
...
...
@@ -59,7 +59,7 @@ spring:
username
:
root
password
:
rooT123!321
driver-class-name
:
com.mysql.cj.jdbc.Driver
shzz
:
gx
shzz
:
type
:
com.alibaba.druid.pool.DruidDataSource
url
:
jdbc:mysql://192.168.0.193:3306/shzz?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
username
:
root
...
...
user-server/src/main/resources/application.yml
View file @
b880f187
...
...
@@ -33,7 +33,7 @@ spring:
username
:
${jdbc.username}
password
:
${jdbc.password}
driver-class-name
:
${jdbc.driver-class-name}
shzz
:
gx
shzz
:
type
:
com.alibaba.druid.pool.DruidDataSource
url
:
jdbc:mysql://192.168.0.193:3306/shzz?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
username
:
root
...
...
@@ -71,5 +71,3 @@ mybatis-plus:
db-config
:
select-strategy
:
not_empty
update-strategy
:
not_empty
#logging.level.com.zq.drug.dao: debug
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