nickchange
2023-10-28 edb2fff00f6990217f7c39ebc2adb611a1c60478
cloud-server-competition/src/main/java/com/dsh/competition/controller/CompetitionController.java
@@ -251,6 +251,10 @@
    @Autowired
    private CompetitionService competitionService;
    @ResponseBody
    @PostMapping("/api/competition/paymentCompetition")
    @ApiOperation(value = "赛事报名", tags = {"APP-赛事活动列表"})
@@ -260,10 +264,28 @@
    })
    public ResultUtil paymentCompetition(PaymentCompetitionVo paymentCompetitionVo){
        try {
            Competition byId = competitionService.getById(paymentCompetitionVo.getId());
            Date date = byId.getEndTime(); // Assuming you have a Date object
            // Check if the date is past the current time
            boolean isPast = date.after(new Date());
            if (!isPast) {
                return new ResultUtil(0,"已超过截至报名时间");
            }
            Integer uid = tokenUtil.getUserIdFormRedis();
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            return cttService.paymentCompetition(uid, paymentCompetitionVo);
        }catch (Exception e){
            e.printStackTrace();