发送订阅消息增加token
This commit is contained in:
parent
7425f0a4d5
commit
af1d4faa03
|
|
@ -2,6 +2,7 @@ package cn.ysk.cashier.controller.product;
|
|||
|
||||
import cn.ysk.cashier.annotation.AnonymousAccess;
|
||||
import cn.ysk.cashier.annotation.Log;
|
||||
import cn.ysk.cashier.config.security.security.TokenProvider;
|
||||
import cn.ysk.cashier.dto.shoptable.*;
|
||||
import cn.ysk.cashier.pojo.order.TbCashierCart;
|
||||
import cn.ysk.cashier.service.product.TbProductService;
|
||||
|
|
@ -13,6 +14,8 @@ import org.springframework.http.ResponseEntity;
|
|||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@RestController
|
||||
|
|
@ -21,6 +24,8 @@ public class TbPlaceController {
|
|||
private final TbShopTableService tbShopTableService;
|
||||
private final TbProductService tbProductService;
|
||||
private final RabbitMsgUtils rabbitMsgUtils;
|
||||
@Resource
|
||||
private TokenProvider tokenProvider;
|
||||
|
||||
@GetMapping("/activate")
|
||||
@ApiOperation("查询/product")
|
||||
|
|
@ -138,7 +143,9 @@ public class TbPlaceController {
|
|||
|
||||
@PutMapping("/pay")
|
||||
@ApiOperation("代客下单 支付订单")
|
||||
public ResponseEntity<Object> pay(@Validated @RequestBody PayDTO payDTO) {
|
||||
public ResponseEntity<Object> pay(HttpServletRequest request, @Validated @RequestBody PayDTO payDTO) {
|
||||
String token = tokenProvider.getToken(request);
|
||||
payDTO.setToken(token);
|
||||
return ResponseEntity.ok(tbShopTableService.pay(payDTO));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,4 +20,6 @@ public class PayDTO {
|
|||
private Double discount;
|
||||
private Integer vipUserId;
|
||||
private String code;
|
||||
|
||||
private String token;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1602,7 +1602,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||
.set(TbOrderDetail::getStatus, "closed"));
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("token", null);
|
||||
jsonObject.put("token", payDTO.getToken());
|
||||
jsonObject.put("type", "create");
|
||||
jsonObject.put("orderId", orderInfo.getId());
|
||||
rabbitMsgUtils.sendOrderCollectMsg(jsonObject,3);
|
||||
|
|
|
|||
Loading…
Reference in New Issue