| | |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | |
| | | @RequestMapping("/web/orders") |
| | | @Slf4j |
| | | public class OrderApi extends ApiController { |
| | | |
| | | @Autowired |
| | | private RedisTemplate<String, Object> redisTemplate; |
| | | |
| | | @LoginRequired |
| | | @ApiOperation("咖啡计划已订阅列表") |
| | | @PostMapping("/planOrdersPage") |
| | |
| | | }) |
| | | public ApiResponse<PayResponse> orderPay(@Valid @RequestBody ShopOrderPayRequest request) { |
| | | request.setMemberId(getMemberId()); |
| | | return ApiResponse.success("操作成功", goodsorderService.orderPay(request, memberCouponServiceImpl)); |
| | | PayResponse payResponse = goodsorderService.orderPay(request, memberCouponServiceImpl); |
| | | if(Objects.nonNull(payResponse)&&StringUtils.isNotBlank(payResponse.getLockKey())){ |
| | | redisTemplate.delete(payResponse.getLockKey()); |
| | | } |
| | | return ApiResponse.success("操作成功", payResponse); |
| | | } |
| | | |
| | | @LoginRequired |