Commit 8a3abdeb authored by ysongq's avatar ysongq

commit

parent b2b3b68e
......@@ -65,7 +65,7 @@ public class AuthFilter extends AbstractFilter {
protected void internalDoFilter(GatewayRequest request, GatewayResponse response,
FilterChain chain) {
try {
ApiInterface apiInterface = apiInterfaceService.getApiInfo(request.getAppKey());
ApiInterface apiInterface = apiInterfaceService.getApiInfo(request.getApiKey());
if (null == apiInterface) {
throw new GatewayException(GatewayResultCode.ILLEGAL_REQUEST);
}
......@@ -111,7 +111,7 @@ public class AuthFilter extends AbstractFilter {
}
//查询数据银行银行余额是否充足
try { //记录请求次数(每天限制请求次数)
String limitKey = request.getAppKey() + LoggingConstants.AND_SPILT + authCode;
String limitKey = request.getApiKey() + LoggingConstants.AND_SPILT + authCode;
String reqKey = redisUtils.get(limitKey);
long timeOut = DateUtil.calculateNowResidueTime();
if (null != reqKey) {
......
......@@ -31,7 +31,7 @@ public class CheckArgsFilter extends AbstractFilter {
protected void internalDoFilter(GatewayRequest request, GatewayResponse response,
FilterChain chain) {
// 校验参数非空
if (StringUtil.isEmpty(request.getAppKey()) || StringUtil.isEmpty(request.getMethod())
if (StringUtil.isEmpty(request.getApiKey()) || 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); //无效参数
......
......@@ -54,7 +54,7 @@ public class InvokeRouteFilter extends AbstractFilter {
//}
DispatchContext context = new DispatchContext();
context.setAppKey(request.getAppKey());//apiKey
context.setAppKey(request.getApiKey());//apiKey
context.setOpenApiMethod(request.getMethod()); //方法 例如:tradd.add
context.setOpenApiParams(request.getParams());//入参
context.setOpenApiVersion(request.getVersion()); //版本号
......
......@@ -50,7 +50,7 @@ public class VerifySignFilter extends AbstractFilter {
if (CollectionUtils.isNotEmpty(signParams)){
JSONObject jsonObject = JSONObject.parseObject(request.getParams());
//需要传入授权码
ApiAuth apiAuthInfo = apiInterfaceService.getApiAuthInfo(request.getAppKey(), jsonObject.getString("authCode"));
ApiAuth apiAuthInfo = apiInterfaceService.getApiAuthInfo(request.getApiKey(), jsonObject.getString("authCode"));
if (null == apiAuthInfo){
throw new GatewayException(GatewayResultCode.ILLEGAL_REQUEST);
}
......
......@@ -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());
......
......@@ -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"))){
......
# 测试环境配置
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
......@@ -67,7 +67,7 @@ public class FinanceCustomerBalanceController extends BaseController {
* @author Bellamy
* @since 2020-12-06
*/
@PostMapping(value = "/balanceInfoById")
@GetMapping(value = "/balanceInfoById")
@ApiOperation(value = "充值管理--充值详情", notes = "充值详情")
public Result<BalanceInfoDto> getFinanceBalanceInfoById(@RequestParam(value = "customerBalanceId") String customerBalanceId, HttpServletRequest httpRequest) throws Exception {
Result<BalanceInfoDto> result = new Result<>();
......
......@@ -45,4 +45,5 @@ public class DataGoodsApiController extends BaseController {
return new Result<>(false, "查询商品详情失败!", StatusCode.ERROR);
}
}
\ No newline at end of file
......@@ -55,8 +55,10 @@ public class DataGoodsController extends BaseController {
return pageInfo;
}
/**主键查询数据商品
* @param DataGoodsRequest
* @return
......
......@@ -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"))){
......
# 测试环境配置
server:
port: 8082
#contextPath: /resource
contextPath: /manage
management:
port: 54001
port: 54002
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
......@@ -69,4 +69,7 @@ mybatis:
logging:
level:
com.jz.manage: debug
\ No newline at end of file
com.jz.manage: debug
domain:
apigateway: http://47.115.53.1:8088/api/producer/addDataBankApiInfo
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment