| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneOffset; |
| | | import java.util.List; |
| | | |
| | |
| | | Goods goods) |
| | | { |
| | | IPage<SeckillActivityVO> IPage = seckillActivityInfoMapper.querySeckillActivity(Page.of(pageNum, pageSize), goods); |
| | | for (SeckillActivityVO record : IPage.getRecords()) { |
| | | LocalDateTime startTime = record.getStartTime(); |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | LocalDateTime endTime = record.getEndTime(); |
| | | if (endTime.isBefore(now)){ |
| | | record.setStatus(2); //已结束 |
| | | }else if (startTime.isBefore(now)){ |
| | | record.setStatus(1); // 已开始 |
| | | }else { |
| | | record.setStatus(0); // 未开始 |
| | | } |
| | | } |
| | | return R.ok(IPage); |
| | | } |
| | | |