Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dm_project
Project
Project
Details
Activity
Releases
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
姚本章
dm_project
Commits
8a3abdeb
Commit
8a3abdeb
authored
Jan 06, 2021
by
ysongq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
b2b3b68e
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
62 additions
and
43 deletions
+62
-43
AuthFilter.java
...apigateway/src/main/java/com/jz/dm/filter/AuthFilter.java
+2
-2
CheckArgsFilter.java
...teway/src/main/java/com/jz/dm/filter/CheckArgsFilter.java
+1
-1
InvokeRouteFilter.java
...way/src/main/java/com/jz/dm/filter/InvokeRouteFilter.java
+1
-1
VerifySignFilter.java
...eway/src/main/java/com/jz/dm/filter/VerifySignFilter.java
+1
-1
MallCustomerServiceImpl.java
.../dm/mall/moduls/service/impl/MallCustomerServiceImpl.java
+4
-4
PayServiceImpl.java
...va/com/jz/dm/mall/moduls/service/impl/PayServiceImpl.java
+7
-2
application-test.yml
jz-dm-mall/src/main/resources/application-test.yml
+15
-12
FinanceCustomerBalanceController.java
.../controller/finance/FinanceCustomerBalanceController.java
+1
-1
DataGoodsApiController.java
...anage/moduls/controller/goods/DataGoodsApiController.java
+1
-0
DataGoodsController.java
...z/manage/moduls/controller/goods/DataGoodsController.java
+4
-2
DataGoodsServiceImpl.java
...m/jz/manage/moduls/service/impl/DataGoodsServiceImpl.java
+7
-2
application-test.yml
jz-dm-manage/src/main/resources/application-test.yml
+18
-15
No files found.
jz-dm-apigateway/src/main/java/com/jz/dm/filter/AuthFilter.java
View file @
8a3abdeb
...
...
@@ -65,7 +65,7 @@ public class AuthFilter extends AbstractFilter {
protected
void
internalDoFilter
(
GatewayRequest
request
,
GatewayResponse
response
,
FilterChain
chain
)
{
try
{
ApiInterface
apiInterface
=
apiInterfaceService
.
getApiInfo
(
request
.
getAp
p
Key
());
ApiInterface
apiInterface
=
apiInterfaceService
.
getApiInfo
(
request
.
getAp
i
Key
());
if
(
null
==
apiInterface
)
{
throw
new
GatewayException
(
GatewayResultCode
.
ILLEGAL_REQUEST
);
}
...
...
@@ -111,7 +111,7 @@ public class AuthFilter extends AbstractFilter {
}
//查询数据银行银行余额是否充足
try
{
//记录请求次数(每天限制请求次数)
String
limitKey
=
request
.
getAp
p
Key
()
+
LoggingConstants
.
AND_SPILT
+
authCode
;
String
limitKey
=
request
.
getAp
i
Key
()
+
LoggingConstants
.
AND_SPILT
+
authCode
;
String
reqKey
=
redisUtils
.
get
(
limitKey
);
long
timeOut
=
DateUtil
.
calculateNowResidueTime
();
if
(
null
!=
reqKey
)
{
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/filter/CheckArgsFilter.java
View file @
8a3abdeb
...
...
@@ -31,7 +31,7 @@ public class CheckArgsFilter extends AbstractFilter {
protected
void
internalDoFilter
(
GatewayRequest
request
,
GatewayResponse
response
,
FilterChain
chain
)
{
// 校验参数非空
if
(
StringUtil
.
isEmpty
(
request
.
getAp
p
Key
())
||
StringUtil
.
isEmpty
(
request
.
getMethod
())
if
(
StringUtil
.
isEmpty
(
request
.
getAp
i
Key
())
||
StringUtil
.
isEmpty
(
request
.
getMethod
())
||
StringUtil
.
isEmpty
(
request
.
getSignType
())||
StringUtil
.
isEmpty
(
request
.
getSign
())
||
StringUtil
.
isEmpty
(
request
.
getTimestamp
())||
StringUtil
.
isEmpty
(
request
.
getParams
()))
{
throw
new
GatewayException
(
GatewayResultCode
.
ILLEGAL_ARGUMENT
);
//无效参数
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/filter/InvokeRouteFilter.java
View file @
8a3abdeb
...
...
@@ -54,7 +54,7 @@ public class InvokeRouteFilter extends AbstractFilter {
//}
DispatchContext
context
=
new
DispatchContext
();
context
.
setAppKey
(
request
.
getAp
p
Key
());
//apiKey
context
.
setAppKey
(
request
.
getAp
i
Key
());
//apiKey
context
.
setOpenApiMethod
(
request
.
getMethod
());
//方法 例如:tradd.add
context
.
setOpenApiParams
(
request
.
getParams
());
//入参
context
.
setOpenApiVersion
(
request
.
getVersion
());
//版本号
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/filter/VerifySignFilter.java
View file @
8a3abdeb
...
...
@@ -50,7 +50,7 @@ public class VerifySignFilter extends AbstractFilter {
if
(
CollectionUtils
.
isNotEmpty
(
signParams
)){
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
request
.
getParams
());
//需要传入授权码
ApiAuth
apiAuthInfo
=
apiInterfaceService
.
getApiAuthInfo
(
request
.
getAp
p
Key
(),
jsonObject
.
getString
(
"authCode"
));
ApiAuth
apiAuthInfo
=
apiInterfaceService
.
getApiAuthInfo
(
request
.
getAp
i
Key
(),
jsonObject
.
getString
(
"authCode"
));
if
(
null
==
apiAuthInfo
){
throw
new
GatewayException
(
GatewayResultCode
.
ILLEGAL_REQUEST
);
}
...
...
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/service/impl/MallCustomerServiceImpl.java
View file @
8a3abdeb
...
...
@@ -107,10 +107,10 @@ public class MallCustomerServiceImpl implements MallCustomerService {
String
telephone
=
customerRequest
.
getTelephone
();
// 从redis获取验证码
//
String key = RedisMessageConstant.SENDTYPE_LOGIN + "_" + telephone;
String
key
=
"18179617425"
;
//
String codeInRedis = (String) redisTemplate.opsForValue().get(key);
String
codeInRedis
=
"147826"
;
String
key
=
RedisMessageConstant
.
SENDTYPE_LOGIN
+
"_"
+
telephone
;
//
String key = "18179617425";
String
codeInRedis
=
(
String
)
redisTemplate
.
opsForValue
().
get
(
key
);
//
String codeInRedis = "147826";
if
(
codeInRedis
.
equals
(
vailCode
))
{
mallCustomer
.
setCustomerAccount
(
username
);
mallCustomer
.
setPassword
(
customerRequest
.
getPassword
());
...
...
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/service/impl/PayServiceImpl.java
View file @
8a3abdeb
...
...
@@ -18,6 +18,7 @@ import com.jz.dm.mall.moduls.mapper.*;
import
com.jz.dm.mall.moduls.service.PayService
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -56,6 +57,10 @@ public class PayServiceImpl implements PayService {
@Autowired
private
RestTemplate
restTemplate
;
@Value
(
"${domain.apigateway}"
)
private
String
apiGateway
;
/**
* 新增订单
*
...
...
@@ -126,7 +131,7 @@ public class PayServiceImpl implements PayService {
}
BigDecimal
subtract
=
bigDecimal
.
subtract
(
bigDecima2
);
String
uri
=
"http://47.115.53.1:8088/api/auth/mall-user-auth-api"
;
// TODO
AuthMallUserApiReq
apiReq
=
new
AuthMallUserApiReq
();
if
(
"04"
.
equals
(
payDto
.
getPurchaseMethod
()))
{
apiReq
.
setAuthMode
(
AuthModeEnum
.
RECORD_TIME_MODE
);
...
...
@@ -140,7 +145,7 @@ public class PayServiceImpl implements PayService {
apiReq
.
setUserId
(
payDto
.
getCustomerId
()
+
""
);
apiReq
.
setValidStartTime
(
order
.
getTakeEffectTime
());
apiReq
.
setValidEndTime
(
order
.
getInvalidTime
());
String
post
=
RestTemplateUtils
.
post
(
uri
,
JSON
.
toJSONString
(
apiReq
));
String
post
=
RestTemplateUtils
.
post
(
apiGateway
,
JSON
.
toJSONString
(
apiReq
));
JSONObject
params
=
JSONObject
.
parseObject
(
post
);
if
(!
params
.
get
(
"code"
).
equals
(
200
)
||
StringUtils
.
isEmpty
(
params
.
get
(
"data"
))){
...
...
jz-dm-mall/src/main/resources/application-test.yml
View file @
8a3abdeb
# 测试环境配置
server
:
port
:
8081
#contextPath: /resource
contextPath
:
/mall
management
:
port
:
54001
...
...
@@ -45,18 +45,18 @@ spring:
public-key
:
rajZdV0xpCox+2vEHFLsKq2o2XVdMaQq
redis
:
# database: 0
host
:
47.115.53.1
port
:
6379
password
:
123456
#
host: 47.115.53.1
#
port: 6379
#
password: 123456
# timeout: 5000
#
cluster:
#
nodes:
# - 192.168.31.167
:6379
# - 192.168.31.167
:6380
# - 192.168.31.167
:6381
# - 192.168.31.167
:6382
# - 192.168.31.167
:6383
# - 192.168.31.167
:6384
cluster
:
nodes
:
-
192.168.1.146
:6379
-
192.168.1.146
:6380
-
192.168.1.146
:6381
-
192.168.1.146
:6382
-
192.168.1.146
:6383
-
192.168.1.146
:6384
#mybatis的配置
mybatis
:
...
...
@@ -68,3 +68,6 @@ mybatis:
logging
:
level
:
com.jz.dm.mall
:
debug
domain
:
apigateway
:
http://47.115.53.1:8088/api/auth/mall-user-auth-api
\ No newline at end of file
jz-dm-manage/src/main/java/com/jz/manage/moduls/controller/finance/FinanceCustomerBalanceController.java
View file @
8a3abdeb
...
...
@@ -67,7 +67,7 @@ public class FinanceCustomerBalanceController extends BaseController {
* @author Bellamy
* @since 2020-12-06
*/
@
Pos
tMapping
(
value
=
"/balanceInfoById"
)
@
Ge
tMapping
(
value
=
"/balanceInfoById"
)
@ApiOperation
(
value
=
"充值管理--充值详情"
,
notes
=
"充值详情"
)
public
Result
<
BalanceInfoDto
>
getFinanceBalanceInfoById
(
@RequestParam
(
value
=
"customerBalanceId"
)
String
customerBalanceId
,
HttpServletRequest
httpRequest
)
throws
Exception
{
Result
<
BalanceInfoDto
>
result
=
new
Result
<>();
...
...
jz-dm-manage/src/main/java/com/jz/manage/moduls/controller/goods/DataGoodsApiController.java
View file @
8a3abdeb
...
...
@@ -45,4 +45,5 @@ public class DataGoodsApiController extends BaseController {
return
new
Result
<>(
false
,
"查询商品详情失败!"
,
StatusCode
.
ERROR
);
}
}
\ No newline at end of file
jz-dm-manage/src/main/java/com/jz/manage/moduls/controller/goods/DataGoodsController.java
View file @
8a3abdeb
...
...
@@ -57,6 +57,8 @@ public class DataGoodsController extends BaseController {
}
/**主键查询数据商品
* @param DataGoodsRequest
* @return
...
...
jz-dm-manage/src/main/java/com/jz/manage/moduls/service/impl/DataGoodsServiceImpl.java
View file @
8a3abdeb
...
...
@@ -39,6 +39,7 @@ import javax.servlet.http.HttpServletRequest;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
...
...
@@ -69,6 +70,10 @@ public class DataGoodsServiceImpl implements DataGoodsService {
@Autowired
private
HttpsUtils
httpsUtils
;
@Value
(
"${domain.apigateway}"
)
private
String
apiGateway
;
/**
* 条件分页查询数据列表
*
...
...
@@ -297,10 +302,10 @@ public class DataGoodsServiceImpl implements DataGoodsService {
}
apiReq
.
setApiExample
(
dataApiUpReq
.
getReturnDataExample
());
String
url
=
"http://47.115.53.1:8088/api/producer/addDataBankApiInfo"
;
//
String url= "http://47.115.53.1:8088/api/producer/addDataBankApiInfo";
// String url= "http://127.0.0.1:8088/api/producer/addDataBankApiInfo";
String
post
=
httpsUtils
.
submitPost
(
url
,
JSON
.
toJSONString
(
apiReq
));
String
post
=
httpsUtils
.
submitPost
(
apiGateway
,
JSON
.
toJSONString
(
apiReq
));
System
.
out
.
println
(
post
);
JSONObject
result
=
JSON
.
parseObject
(
post
);
if
(!
result
.
get
(
"code"
).
equals
(
200
)
||
org
.
springframework
.
util
.
StringUtils
.
isEmpty
(
result
.
get
(
"data"
))){
...
...
jz-dm-manage/src/main/resources/application-test.yml
View file @
8a3abdeb
# 测试环境配置
server
:
port
:
8082
#contextPath: /resourc
e
contextPath
:
/manag
e
management
:
port
:
5400
1
port
:
5400
2
health
:
mail
:
enabled
:
false
...
...
@@ -45,18 +45,18 @@ spring:
public-key
:
rajZdV0xpCox+2vEHFLsKq2o2XVdMaQq
redis
:
#database: 0
host
:
47.115.53.1
port
:
6379
timeout
:
5000
password
:
123456
#
cluster:
#
nodes:
# - 192.168.31.167
:6379
# - 192.168.31.167
:6380
# - 192.168.31.167
:6381
# - 192.168.31.167
:6382
# - 192.168.31.167
:6383
# - 192.168.31.167
:6384
#
host: 47.115.53.1
#
port: 6379
#
timeout: 5000
#
password: 123456
cluster
:
nodes
:
-
192.168.1.146
:6379
-
192.168.1.146
:6380
-
192.168.1.146
:6381
-
192.168.1.146
:6382
-
192.168.1.146
:6383
-
192.168.1.146
:6384
#使用redis管理session设置为redis,否则none
session
:
store-type
:
none
...
...
@@ -70,3 +70,6 @@ mybatis:
logging
:
level
:
com.jz.manage
:
debug
domain
:
apigateway
:
http://47.115.53.1:8088/api/producer/addDataBankApiInfo
\ No newline at end of file
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