| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.models.auth.In; |
| | | import org.checkerframework.checker.units.qual.A; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private UserCouponService userCouponService; |
| | | @ResponseBody |
| | | @PostMapping("/coupon/queryCouponByUid") |
| | | public List<Coupon> queryCouponByUid(@RequestBody Integer uid){ |
| | | try { |
| | | LocalDateTime currentTime = LocalDateTime.now(); |
| | | LocalDateTime oneMinuteAgo = currentTime.minusSeconds(20); |
| | | |
| | | List<UserCoupon> list = userCouponService.list(new QueryWrapper<UserCoupon>().eq("userId", uid).ge("insertTime", oneMinuteAgo)); |
| | | List<Integer> ids = new ArrayList<>(); |
| | | for (UserCoupon userCoupon : list) { |
| | | ids.add(userCoupon.getCouponId()); |
| | | } |
| | | |
| | | if (ids.size()>0){ |
| | | List<Coupon> userId = couponService.list(new QueryWrapper<Coupon>().in("id",ids)); |
| | | return userId; |
| | | |
| | | } |
| | | |
| | | return null; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 我的券包列表 |
| | | * @param req |