Merge remote-tracking branch 'origin/master'
# Conflicts: # src/main/java/com/chaozhanggui/system/cashierservice/annotation/LimitSubmit.java # src/main/java/com/chaozhanggui/system/cashierservice/interceptor/LimitSubmitAspect.java # src/main/java/com/chaozhanggui/system/cashierservice/interceptor/WebAppConfigurer.java # src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java # src/main/java/com/chaozhanggui/system/cashierservice/util/RedisConfig.java # src/main/java/com/chaozhanggui/system/cashierservice/util/RedisUtils.java # src/main/resources/generator-mapper/generatorConfig.xml
This commit is contained in:
@@ -4,6 +4,7 @@ import com.chaozhanggui.system.cashierservice.annotation.LimitSubmit;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbOrderDetail;
|
||||
import com.chaozhanggui.system.cashierservice.entity.dto.ReturnGroupOrderDto;
|
||||
import com.chaozhanggui.system.cashierservice.service.PayService;
|
||||
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
|
||||
import com.chaozhanggui.system.cashierservice.sign.Result;
|
||||
import com.chaozhanggui.system.cashierservice.util.IpUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -70,6 +71,7 @@ public class PayController {
|
||||
* @param memberId
|
||||
* @return
|
||||
*/
|
||||
|
||||
@GetMapping("accountPay")
|
||||
@LimitSubmit(key = "accountPay:%s")
|
||||
public Result accountPay(@RequestHeader("token") String token,
|
||||
@@ -94,6 +96,7 @@ public class PayController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("quickPay")
|
||||
@LimitSubmit(key = "quickPay:%s")
|
||||
public Result quickPay(@RequestHeader("token") String token,
|
||||
@RequestHeader("loginName") String loginName,
|
||||
@RequestHeader("clientType") String clientType,
|
||||
@@ -156,6 +159,7 @@ public class PayController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("memberScanPay")
|
||||
@LimitSubmit(key = "memberScanPay:%s")
|
||||
public Result memberScanPay(@RequestHeader("token") String token,
|
||||
@RequestHeader("loginName") String loginName,
|
||||
@RequestHeader("clientType") String clientType,
|
||||
@@ -176,6 +180,7 @@ public class PayController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("cashPay")
|
||||
@LimitSubmit(key = "cashPay:%s")
|
||||
public Result cashPay(@RequestHeader("token") String token,
|
||||
@RequestHeader("loginName") String loginName,
|
||||
@RequestHeader("clientType") String clientType,
|
||||
@@ -195,6 +200,7 @@ public class PayController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("bankPay")
|
||||
@LimitSubmit(key = "bankPay:%s")
|
||||
public Result bankPay(@RequestHeader("token") String token,
|
||||
@RequestHeader("loginName") String loginName,
|
||||
@RequestHeader("clientType") String clientType,
|
||||
@@ -205,6 +211,7 @@ public class PayController {
|
||||
|
||||
|
||||
@RequestMapping("returnOrder")
|
||||
@LimitSubmit(key = "returnOrder:%s")
|
||||
public Result returnOrder(@RequestHeader("token") String token,
|
||||
@RequestHeader("loginName") String loginName,
|
||||
@RequestHeader("clientType") String clientType,
|
||||
@@ -226,4 +233,11 @@ public class PayController {
|
||||
public Result returnOrder(@RequestBody ReturnGroupOrderDto param){
|
||||
return payService.returnGroupOrder(param);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("test")
|
||||
@LimitSubmit(key = "testOrder:%s")
|
||||
public Result testOrder( @RequestParam("orderId") String orderId){
|
||||
return Result.success(CodeEnum.SUCCESS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.chaozhanggui.system.cashierservice.exception;
|
||||
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.sign.Result;
|
||||
import org.springframework.web.bind.annotation.ControllerAdvice;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
/**
|
||||
* 统一异常处理
|
||||
* ControllerAdvice注解的含义是当异常抛到controller层时会拦截下来
|
||||
*/
|
||||
@ControllerAdvice
|
||||
public class GlobalExceptionHandler {
|
||||
|
||||
/**
|
||||
* 使用ExceptionHandler注解声明处理Exception异常
|
||||
*
|
||||
*/
|
||||
@ResponseBody
|
||||
@ExceptionHandler(Exception.class)
|
||||
public Result exception(Exception e) {
|
||||
// 控制台打印异常
|
||||
e.printStackTrace();
|
||||
// 返回错误格式信息
|
||||
return Result.fail("系统内部错误");
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用ExceptionHandler注解声明处理TestException异常
|
||||
*
|
||||
*/
|
||||
@ResponseBody
|
||||
@ExceptionHandler(MsgException.class)
|
||||
public Result exception(MsgException e) {
|
||||
// 控制台打印异常
|
||||
e.printStackTrace();
|
||||
// 返回错误格式信息
|
||||
return Result.fail(e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -569,8 +569,8 @@ public class PayService {
|
||||
TbShopUserFlow flow = new TbShopUserFlow();
|
||||
flow.setShopUserId(user.getId());
|
||||
flow.setBizCode("accountPay");
|
||||
flow.setType("-");
|
||||
flow.setBizName("会员储值卡支付");
|
||||
flow.setType("-");
|
||||
flow.setAmount(orderInfo.getOrderAmount());
|
||||
flow.setBalance(user.getAmount());
|
||||
flow.setCreateTime(new Date());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
server:
|
||||
port: 10587
|
||||
port: 10589
|
||||
spring:
|
||||
application:
|
||||
name: cashierService
|
||||
|
||||
Reference in New Issue
Block a user