|
|
@@ -238,6 +238,9 @@ public class ContestServiceImpl extends ServiceImpl<ContestMapper, Contest> impl
|
|
|
if (Contest.TYPE_PRIVATE.equals(contest.getType())) {
|
|
|
throw new IllegalArgumentException("私有比赛不可自助报名");
|
|
|
}
|
|
|
+ if (contest.getEndDatetime() != null && !contest.getEndDatetime().isAfter(LocalDateTime.now())) {
|
|
|
+ throw new IllegalArgumentException("比赛已结束,无法报名");
|
|
|
+ }
|
|
|
if (!Contest.STATUS_PENDING.equals(contest.getStatus()) && !Contest.STATUS_RUNNING.equals(contest.getStatus())) {
|
|
|
throw new IllegalArgumentException("比赛未开始或已结束,无法报名");
|
|
|
}
|