diff --git a/eladmin-common/src/main/java/me/zhengjie/exception/EntityNotFoundException.java b/eladmin-common/src/main/java/me/zhengjie/exception/EntityNotFoundException.java
index 4d9f4d96..2702ede8 100644
--- a/eladmin-common/src/main/java/me/zhengjie/exception/EntityNotFoundException.java
+++ b/eladmin-common/src/main/java/me/zhengjie/exception/EntityNotFoundException.java
@@ -23,12 +23,16 @@ import org.springframework.util.StringUtils;
*/
public class EntityNotFoundException extends RuntimeException {
- public EntityNotFoundException(Class clazz, String field, String val) {
+ public EntityNotFoundException(Class> clazz, String field, String val) {
super(EntityNotFoundException.generateMessage(clazz.getSimpleName(), field, val));
}
+ public EntityNotFoundException(Class> clazz, String field, Long val) {
+ super(EntityNotFoundException.generateMessage(clazz.getSimpleName(), field, "" + val));
+ }
+
private static String generateMessage(String entity, String field, String val) {
return StringUtils.capitalize(entity)
- + " with " + field + " "+ val + " does not exist";
+ + " with " + field + " " + val + " does not exist";
}
}
\ No newline at end of file
diff --git a/eladmin-system/src/main/resources/db/migration/V10__add_rating_history.sql b/eladmin-system/src/main/resources/db/migration/V10__add_rating_history.sql
new file mode 100644
index 00000000..5362845d
--- /dev/null
+++ b/eladmin-system/src/main/resources/db/migration/V10__add_rating_history.sql
@@ -0,0 +1,26 @@
+-- Add rating_history table
+CREATE TABLE rating_history
+(
+ id BIGINT AUTO_INCREMENT PRIMARY KEY,
+ player_id BIGINT NOT NULL COMMENT 'Player ID',
+ rate_score DOUBLE NULL COMMENT 'Rating score',
+ changes DOUBLE NULL COMMENT 'Score changes',
+ create_time TIMESTAMP NULL COMMENT 'Creation time',
+ match_id BIGINT NULL COMMENT 'Match ID',
+ CONSTRAINT fk_rating_history_player FOREIGN KEY (player_id) REFERENCES player (id),
+ CONSTRAINT fk_rating_history_match FOREIGN KEY (match_id) REFERENCES `match` (id)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT 'Rating History';
+
+-- Create index for fast lookup by player and match
+CREATE INDEX idx_rating_history_player ON rating_history (player_id);
+CREATE INDEX idx_rating_history_match ON rating_history (match_id);
+
+-- Update event_organizer table with additional fields
+ALTER TABLE event_organizer
+ ADD COLUMN description VARCHAR(255) NULL COMMENT 'Description',
+ADD COLUMN create_time TIMESTAMP NULL COMMENT 'Creation time',
+ADD COLUMN update_time TIMESTAMP NULL COMMENT 'Update time';
+
+-- Create index for faster lookup by user_id
+CREATE INDEX idx_event_organizer_user ON event_organizer (user_id);
+
diff --git a/eladmin-system/src/main/resources/db/migration/V11__add_event_tags.sql b/eladmin-system/src/main/resources/db/migration/V11__add_event_tags.sql
new file mode 100644
index 00000000..0321b10b
--- /dev/null
+++ b/eladmin-system/src/main/resources/db/migration/V11__add_event_tags.sql
@@ -0,0 +1,6 @@
+-- Add tags column to event table
+ALTER TABLE event
+ ADD COLUMN poster_image VARCHAR(255),
+ ADD COLUMN tags VARCHAR(255) NULL COMMENT 'Tags stored as comma-delimited string',
+ ADD COLUMN current_participants INT DEFAULT 0 COMMENT 'Current number of participants',
+ ADD COLUMN max_participants INT NULL COMMENT 'Maximum number of participants';
diff --git a/eladmin-system/src/main/resources/db/migration/V13__create_wait_list.sql b/eladmin-system/src/main/resources/db/migration/V13__create_wait_list.sql
new file mode 100644
index 00000000..e06f0c77
--- /dev/null
+++ b/eladmin-system/src/main/resources/db/migration/V13__create_wait_list.sql
@@ -0,0 +1,18 @@
+-- Create wait list table for tracking players waiting to join events
+CREATE TABLE IF NOT EXISTS wait_list (
+ id BIGINT AUTO_INCREMENT PRIMARY KEY,
+ event_id BIGINT NOT NULL COMMENT 'Reference to event',
+ player_id BIGINT NOT NULL COMMENT 'Reference to player',
+ notes VARCHAR(255) NULL COMMENT 'Notes',
+ status VARCHAR(20) NOT NULL DEFAULT 'WAITING' COMMENT 'Status (WAITING, PROMOTED, CANCELLED, EXPIRED)',
+ create_time DATETIME NULL COMMENT 'Creation time',
+ update_time DATETIME NULL COMMENT 'Update time',
+ CONSTRAINT fk_wait_list_event FOREIGN KEY (event_id) REFERENCES event (id),
+ CONSTRAINT fk_wait_list_player FOREIGN KEY (player_id) REFERENCES player (id),
+ UNIQUE KEY uk_wait_list_event_player (event_id, player_id)
+) ENGINE = InnoDB COMMENT 'Event wait list';
+
+-- Add index for faster queries
+CREATE INDEX idx_wait_list_event ON wait_list (event_id);
+CREATE INDEX idx_wait_list_player ON wait_list (player_id);
+CREATE INDEX idx_wait_list_status ON wait_list (status);
diff --git a/eladmin-system/src/main/resources/db/migration/V2__event.sql b/eladmin-system/src/main/resources/db/migration/V2__event.sql
index 85a130d0..189df703 100644
--- a/eladmin-system/src/main/resources/db/migration/V2__event.sql
+++ b/eladmin-system/src/main/resources/db/migration/V2__event.sql
@@ -41,7 +41,6 @@ create table event
name varchar(32) not null comment '名称',
description varchar(255) null comment '描述',
format enum ('SINGLE', 'DOUBLE', 'TEAM') not null,
- max_player int null comment '最大人数',
location varchar(255) null comment '位置',
image varchar(255) null comment '图片',
create_time datetime null comment '创建时间',
diff --git a/eladmin-system/src/main/resources/db/migration/V9__add_event_check_in_and_group_count.sql b/eladmin-system/src/main/resources/db/migration/V9__add_event_check_in_and_group_count.sql
new file mode 100644
index 00000000..4cd60ca2
--- /dev/null
+++ b/eladmin-system/src/main/resources/db/migration/V9__add_event_check_in_and_group_count.sql
@@ -0,0 +1,4 @@
+-- Add check_in_at and group_count columns to event table
+ALTER TABLE event
+ADD COLUMN check_in_at TIMESTAMP NULL COMMENT 'Check-in time',
+ADD COLUMN group_count INT NULL COMMENT 'Number of groups';
diff --git a/pom.xml b/pom.xml
index f636015f..2c0ce0c9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
1.2.9UTF-8UTF-8
- 1.8
+ 172.0.541.2.192.11.1
diff --git a/sport/src/main/java/com/srr/converter/StringListConverter.java b/sport/src/main/java/com/srr/converter/StringListConverter.java
new file mode 100644
index 00000000..2d39f80d
--- /dev/null
+++ b/sport/src/main/java/com/srr/converter/StringListConverter.java
@@ -0,0 +1,49 @@
+/*
+* Copyright 2019-2025 Zheng Jie
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package com.srr.converter;
+
+import javax.persistence.AttributeConverter;
+import javax.persistence.Converter;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Converter to store List as a comma-delimited string in database
+ * @author Chanheng
+ * @date 2025-05-26
+ */
+@Converter
+public class StringListConverter implements AttributeConverter, String> {
+
+ private static final String DELIMITER = ",";
+
+ @Override
+ public String convertToDatabaseColumn(List stringList) {
+ if (stringList == null || stringList.isEmpty()) {
+ return null;
+ }
+ return String.join(DELIMITER, stringList);
+ }
+
+ @Override
+ public List convertToEntityAttribute(String string) {
+ if (string == null || string.isEmpty()) {
+ return new ArrayList<>();
+ }
+ return new ArrayList<>(Arrays.asList(string.split(DELIMITER)));
+ }
+}
diff --git a/sport/src/main/java/com/srr/domain/Event.java b/sport/src/main/java/com/srr/domain/Event.java
index 5f8adf97..51fd4113 100644
--- a/sport/src/main/java/com/srr/domain/Event.java
+++ b/sport/src/main/java/com/srr/domain/Event.java
@@ -15,6 +15,7 @@
*/
package com.srr.domain;
+import com.srr.converter.StringListConverter;
import com.srr.enumeration.EventStatus;
import com.srr.enumeration.Format;
import lombok.Data;
@@ -24,6 +25,7 @@ import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.persistence.Entity;
import javax.persistence.Table;
+import javax.persistence.Convert;
import org.hibernate.annotations.*;
import java.sql.Timestamp;
import javax.validation.constraints.NotBlank;
@@ -41,6 +43,8 @@ import java.util.List;
@Entity
@Data
@Table(name="event")
+@SQLDelete(sql = "update event set status = 'DELETED' where id = ?", check = ResultCheckStyle.COUNT)
+@Where(clause = "status != 'DELETED'")
public class Event implements Serializable {
@Id
@@ -64,10 +68,6 @@ public class Event implements Serializable {
@ApiModelProperty(value = "SINGLE, DOUBLE")
private Format format;
- @Column(name = "`max_player`")
- @ApiModelProperty(value = "Maximum number of people")
- private Integer maxPlayer;
-
@Column(name = "`location`")
@ApiModelProperty(value = "Location")
private String location;
@@ -86,6 +86,14 @@ public class Event implements Serializable {
@ApiModelProperty(value = "Update time", hidden = true)
private Timestamp updateTime;
+ @Column(name = "`check_in_at`")
+ @ApiModelProperty(value = "Check in time", hidden = true)
+ private Timestamp checkInAt;
+
+ @Column(name = "`group_count`")
+ @ApiModelProperty(value = "Number of groups")
+ private Integer groupCount;
+
@Column(name = "`sort`")
@ApiModelProperty(value = "Sort")
private Integer sort;
@@ -128,6 +136,21 @@ public class Event implements Serializable {
@Column(name = "`allow_wait_list`")
private boolean allowWaitList;
+ @Column(name = "`current_participants`")
+ @ApiModelProperty(value = "Current number of participants")
+ private Integer currentParticipants = 0;
+
+ @Column(name = "`max_participants`")
+ @ApiModelProperty(value = "Maximum number of participants")
+ private Integer maxParticipants;
+
+ @Column(name = "`poster_image`")
+ private String posterImage;
+
+ @Column(name = "`tags`")
+ @Convert(converter = StringListConverter.class)
+ private List tags = new ArrayList<>();
+
@ManyToMany
@JoinTable(name = "event_co_host_player",
joinColumns = {@JoinColumn(name = "event_id",referencedColumnName = "id")},
diff --git a/sport/src/main/java/com/srr/domain/EventOrganizer.java b/sport/src/main/java/com/srr/domain/EventOrganizer.java
new file mode 100644
index 00000000..a3d74c51
--- /dev/null
+++ b/sport/src/main/java/com/srr/domain/EventOrganizer.java
@@ -0,0 +1,74 @@
+/*
+* Copyright 2019-2025 Zheng Jie
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package com.srr.domain;
+
+import lombok.Data;
+import cn.hutool.core.bean.BeanUtil;
+import io.swagger.annotations.ApiModelProperty;
+import cn.hutool.core.bean.copier.CopyOptions;
+import javax.persistence.*;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import org.hibernate.annotations.*;
+import java.sql.Timestamp;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+/**
+* @website https://eladmin.vip
+* @description Event organizer entity
+* @author Chanheng
+* @date 2025-05-26
+**/
+@Entity
+@Data
+@Table(name="event_organizer")
+public class EventOrganizer implements Serializable {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "`id`")
+ @ApiModelProperty(value = "id", hidden = true)
+ private Long id;
+
+ @Column(name = "`description`")
+ @ApiModelProperty(value = "Description")
+ private String description;
+
+ @Column(name = "`create_time`")
+ @CreationTimestamp
+ @ApiModelProperty(value = "Creation time", hidden = true)
+ private Timestamp createTime;
+
+ @Column(name = "`update_time`")
+ @UpdateTimestamp
+ @ApiModelProperty(value = "Update time", hidden = true)
+ private Timestamp updateTime;
+
+ @Column(name = "`user_id`", nullable = false)
+ @NotNull
+ @ApiModelProperty(value = "userId")
+ private Long userId;
+
+ @ManyToOne
+ @JoinColumn(name = "club_id")
+ private Club club;
+
+ public void copy(EventOrganizer source){
+ BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
+ }
+}
diff --git a/sport/src/main/java/com/srr/domain/RatingHistory.java b/sport/src/main/java/com/srr/domain/RatingHistory.java
new file mode 100644
index 00000000..8f2602dd
--- /dev/null
+++ b/sport/src/main/java/com/srr/domain/RatingHistory.java
@@ -0,0 +1,43 @@
+package com.srr.domain;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+import org.hibernate.annotations.CreationTimestamp;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+@Getter
+@Setter
+@Entity
+public class RatingHistory implements Serializable {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "`id`")
+ @ApiModelProperty(value = "id", hidden = true)
+ private Long id;
+
+ @ManyToOne
+ @JoinColumn(name = "player_id")
+ private Player player;
+
+ @Column(name = "`rate_score`")
+ @ApiModelProperty(value = "Score")
+ private Double rateScore;
+
+ @Column(name = "`changes`")
+ @ApiModelProperty(value = "Changes")
+ private Double changes;
+
+ @Column(name = "`create_time`")
+ @CreationTimestamp
+ @ApiModelProperty(value = "Creation time", hidden = true)
+ private Timestamp createTime;
+
+ @ManyToOne
+ @JoinColumn(name = "match_id")
+ private Match match;
+}
diff --git a/sport/src/main/java/com/srr/domain/WaitList.java b/sport/src/main/java/com/srr/domain/WaitList.java
new file mode 100644
index 00000000..df114701
--- /dev/null
+++ b/sport/src/main/java/com/srr/domain/WaitList.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2019-2025 Zheng Jie
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.srr.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.srr.enumeration.WaitListStatus;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.experimental.Accessors;
+import org.hibernate.annotations.CreationTimestamp;
+import org.hibernate.annotations.UpdateTimestamp;
+
+import javax.persistence.*;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+/**
+ * Event Wait List Entity
+ * @author Chanheng
+ * @date 2025-05-26
+ */
+@Entity
+@Getter
+@Setter
+@Accessors(chain = true)
+@Table(name = "wait_list")
+public class WaitList implements Serializable {
+
+ @Id
+ @Column(name = "id")
+ @ApiModelProperty(value = "ID")
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Long id;
+
+ @Column(name = "event_id", nullable = false)
+ @NotNull
+ @ApiModelProperty(value = "Event ID")
+ private Long eventId;
+
+ @Column(name = "player_id", nullable = false)
+ @NotNull
+ @ApiModelProperty(value = "Player ID")
+ private Long playerId;
+
+ @Column(name = "notes")
+ @ApiModelProperty(value = "Notes")
+ private String notes;
+
+ @Enumerated(EnumType.STRING)
+ @Column(name = "status")
+ @ApiModelProperty(value = "Status (WAITING, PROMOTED, CANCELLED, EXPIRED)")
+ private WaitListStatus status = WaitListStatus.WAITING;
+
+ @Column(name = "create_time")
+ @CreationTimestamp
+ @ApiModelProperty(value = "Creation Time")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ private Timestamp createTime;
+
+ @Column(name = "update_time")
+ @UpdateTimestamp
+ @ApiModelProperty(value = "Update Time")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ private Timestamp updateTime;
+
+ public void copy(WaitList source) {
+ this.notes = source.getNotes();
+ this.status = source.getStatus();
+ }
+}
diff --git a/sport/src/main/java/com/srr/dto/EventDto.java b/sport/src/main/java/com/srr/dto/EventDto.java
index 6e58dc44..3b5b1b7f 100644
--- a/sport/src/main/java/com/srr/dto/EventDto.java
+++ b/sport/src/main/java/com/srr/dto/EventDto.java
@@ -45,9 +45,6 @@ public class EventDto implements Serializable {
@ApiModelProperty(value = "SINGLE, DOUBLE")
private Format format;
- @ApiModelProperty(value = "最大人数")
- private Integer maxPlayer;
-
@ApiModelProperty(value = "位置")
private String location;
@@ -87,6 +84,23 @@ public class EventDto implements Serializable {
private boolean allowWaitList;
+ @ApiModelProperty(value = "Check-in time")
+ private Timestamp checkInAt;
+
+ @ApiModelProperty(value = "Number of groups")
+ private Integer groupCount;
+
+ private String posterImage;
+
+ @ApiModelProperty(value = "Current number of participants")
+ private Integer currentParticipants;
+
+ @ApiModelProperty(value = "Maximum number of participants")
+ private Integer maxParticipants;
+
@ApiModelProperty(value = "Co-host players")
private List coHostPlayers;
+
+ @ApiModelProperty(value = "Tags")
+ private List tags;
}
\ No newline at end of file
diff --git a/sport/src/main/java/com/srr/dto/EventOrganizerDto.java b/sport/src/main/java/com/srr/dto/EventOrganizerDto.java
new file mode 100644
index 00000000..56faf618
--- /dev/null
+++ b/sport/src/main/java/com/srr/dto/EventOrganizerDto.java
@@ -0,0 +1,50 @@
+/*
+* Copyright 2019-2025 Zheng Jie
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package com.srr.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+/**
+* @website https://eladmin.vip
+* @description Event organizer data transfer object
+* @author Chanheng
+* @date 2025-05-26
+**/
+@Data
+public class EventOrganizerDto implements Serializable {
+
+ @ApiModelProperty(value = "id")
+ private Long id;
+
+ @ApiModelProperty(value = "Club")
+ private ClubDto club;
+
+ @ApiModelProperty(value = "Description")
+ private String description;
+
+ @ApiModelProperty(value = "Creation time")
+ private Timestamp createTime;
+
+ @ApiModelProperty(value = "Update time")
+ private Timestamp updateTime;
+
+ @ApiModelProperty(value = "User ID")
+ private Long userId;
+}
diff --git a/sport/src/main/java/com/srr/dto/EventOrganizerQueryCriteria.java b/sport/src/main/java/com/srr/dto/EventOrganizerQueryCriteria.java
new file mode 100644
index 00000000..c127d8ee
--- /dev/null
+++ b/sport/src/main/java/com/srr/dto/EventOrganizerQueryCriteria.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2019-2025 Zheng Jie
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.srr.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import me.zhengjie.annotation.Query;
+
+import java.sql.Timestamp;
+import java.util.List;
+
+/**
+ * @author Chanheng
+ * @date 2025-05-26
+ */
+@Data
+public class EventOrganizerQueryCriteria {
+
+ @Query
+ private Long id;
+
+ @Query
+ @ApiModelProperty(value = "Event ID")
+ private Long eventId;
+
+ @Query
+ @ApiModelProperty(value = "Organizer User ID")
+ private Long userId;
+
+ @Query(type = Query.Type.BETWEEN)
+ @ApiModelProperty(value = "Create time range")
+ private List createTime;
+}
diff --git a/sport/src/main/java/com/srr/dto/JoinEventDto.java b/sport/src/main/java/com/srr/dto/JoinEventDto.java
new file mode 100644
index 00000000..6f9e2675
--- /dev/null
+++ b/sport/src/main/java/com/srr/dto/JoinEventDto.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2019-2025 Zheng Jie
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.srr.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @author Chanheng
+ * @date 2025-05-26
+ */
+@Data
+public class JoinEventDto {
+
+ @ApiModelProperty(value = "Event ID")
+ @NotNull
+ private Long eventId;
+
+ @ApiModelProperty(value = "Player ID")
+ @NotNull
+ private Long playerId;
+
+ @ApiModelProperty(value = "Team ID (optional)")
+ private Long teamId;
+
+ @ApiModelProperty(value = "Join as wait list")
+ private Boolean joinWaitList = false;
+}
diff --git a/sport/src/main/java/com/srr/dto/MatchGroupQueryCriteria.java b/sport/src/main/java/com/srr/dto/MatchGroupQueryCriteria.java
new file mode 100644
index 00000000..38194c21
--- /dev/null
+++ b/sport/src/main/java/com/srr/dto/MatchGroupQueryCriteria.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2019-2025 Zheng Jie
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.srr.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import me.zhengjie.annotation.Query;
+
+import java.sql.Timestamp;
+import java.util.List;
+
+/**
+ * @author Chanheng
+ * @date 2025-05-26
+ */
+@Data
+public class MatchGroupQueryCriteria {
+
+ @Query
+ private Long id;
+
+ @Query
+ @ApiModelProperty(value = "Event ID")
+ private Long eventId;
+
+ @Query
+ @ApiModelProperty(value = "Group Name")
+ private String name;
+
+ @Query
+ @ApiModelProperty(value = "Group Number")
+ private Integer groupNumber;
+
+ @Query(type = Query.Type.BETWEEN)
+ @ApiModelProperty(value = "Create time range")
+ private List createTime;
+}
diff --git a/sport/src/main/java/com/srr/dto/MatchQueryCriteria.java b/sport/src/main/java/com/srr/dto/MatchQueryCriteria.java
new file mode 100644
index 00000000..9a302a83
--- /dev/null
+++ b/sport/src/main/java/com/srr/dto/MatchQueryCriteria.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2019-2025 Zheng Jie
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.srr.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import me.zhengjie.annotation.Query;
+
+import java.sql.Timestamp;
+import java.util.List;
+
+/**
+ * @author Chanheng
+ * @date 2025-05-26
+ */
+@Data
+public class MatchQueryCriteria {
+
+ @Query
+ private Long id;
+
+ @Query
+ @ApiModelProperty(value = "Event ID")
+ private Long eventId;
+
+ @Query
+ @ApiModelProperty(value = "Match Group ID")
+ private Long matchGroupId;
+
+ @Query
+ @ApiModelProperty(value = "Team A ID")
+ private Long teamAId;
+
+ @Query
+ @ApiModelProperty(value = "Team B ID")
+ private Long teamBId;
+
+ @Query
+ @ApiModelProperty(value = "Court Number")
+ private Integer courtNumber;
+
+ @Query
+ @ApiModelProperty(value = "Match Status")
+ private String status;
+
+ @Query(type = Query.Type.BETWEEN)
+ @ApiModelProperty(value = "Match Time Range")
+ private List matchTime;
+
+ @Query(type = Query.Type.BETWEEN)
+ @ApiModelProperty(value = "Create time range")
+ private List createTime;
+}
diff --git a/sport/src/main/java/com/srr/dto/RatingHistoryDto.java b/sport/src/main/java/com/srr/dto/RatingHistoryDto.java
new file mode 100644
index 00000000..d52fc1bf
--- /dev/null
+++ b/sport/src/main/java/com/srr/dto/RatingHistoryDto.java
@@ -0,0 +1,53 @@
+/*
+* Copyright 2019-2025 Zheng Jie
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package com.srr.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+/**
+* @website https://eladmin.vip
+* @description /
+* @author Chanheng
+* @date 2025-05-26
+**/
+@Data
+public class RatingHistoryDto implements Serializable {
+
+ @ApiModelProperty(value = "id")
+ private Long id;
+
+ @ApiModelProperty(value = "Player ID")
+ private Long playerId;
+
+ @ApiModelProperty(value = "Player name")
+ private String playerName;
+
+ @ApiModelProperty(value = "Rating score")
+ private Double rateScore;
+
+ @ApiModelProperty(value = "Score changes")
+ private Double changes;
+
+ @ApiModelProperty(value = "Creation time")
+ private Timestamp createTime;
+
+ @ApiModelProperty(value = "Match ID")
+ private Long matchId;
+}
diff --git a/sport/src/main/java/com/srr/dto/RatingHistoryQueryCriteria.java b/sport/src/main/java/com/srr/dto/RatingHistoryQueryCriteria.java
new file mode 100644
index 00000000..336eacd5
--- /dev/null
+++ b/sport/src/main/java/com/srr/dto/RatingHistoryQueryCriteria.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2019-2025 Zheng Jie
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.srr.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import me.zhengjie.annotation.Query;
+
+import java.sql.Timestamp;
+import java.util.List;
+
+/**
+ * @author Chanheng
+ * @date 2025-05-26
+ */
+@Data
+public class RatingHistoryQueryCriteria {
+
+ @Query
+ private Long id;
+
+ @Query
+ @ApiModelProperty(value = "Player ID")
+ private Long playerId;
+
+ @Query
+ @ApiModelProperty(value = "Sport ID")
+ private Long sportId;
+
+ @Query
+ @ApiModelProperty(value = "Event ID")
+ private Long eventId;
+
+ @Query(type = Query.Type.BETWEEN)
+ @ApiModelProperty(value = "Rating Range")
+ private List rating;
+
+ @Query(type = Query.Type.BETWEEN)
+ @ApiModelProperty(value = "Create time range")
+ private List createTime;
+}
diff --git a/sport/src/main/java/com/srr/dto/TeamPlayerQueryCriteria.java b/sport/src/main/java/com/srr/dto/TeamPlayerQueryCriteria.java
new file mode 100644
index 00000000..24746f66
--- /dev/null
+++ b/sport/src/main/java/com/srr/dto/TeamPlayerQueryCriteria.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2019-2025 Zheng Jie
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.srr.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import me.zhengjie.annotation.Query;
+
+import java.sql.Timestamp;
+import java.util.List;
+
+/**
+ * @author Chanheng
+ * @date 2025-05-26
+ */
+@Data
+public class TeamPlayerQueryCriteria {
+
+ @Query
+ private Long id;
+
+ @Query
+ @ApiModelProperty(value = "Team ID")
+ private Long teamId;
+
+ @Query
+ @ApiModelProperty(value = "Player ID")
+ private Long playerId;
+
+ @Query
+ @ApiModelProperty(value = "Event ID")
+ private Long eventId;
+
+ @Query(type = Query.Type.BETWEEN)
+ @ApiModelProperty(value = "Create time range")
+ private List createTime;
+}
diff --git a/sport/src/main/java/com/srr/dto/TeamQueryCriteria.java b/sport/src/main/java/com/srr/dto/TeamQueryCriteria.java
new file mode 100644
index 00000000..e85907d1
--- /dev/null
+++ b/sport/src/main/java/com/srr/dto/TeamQueryCriteria.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2019-2025 Zheng Jie
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.srr.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import me.zhengjie.annotation.Query;
+
+import java.sql.Timestamp;
+import java.util.List;
+
+/**
+ * @author Chanheng
+ * @date 2025-05-26
+ */
+@Data
+public class TeamQueryCriteria {
+
+ @Query
+ private Long id;
+
+ @Query
+ @ApiModelProperty(value = "Event ID")
+ private Long eventId;
+
+ @Query
+ @ApiModelProperty(value = "Team Name")
+ private String name;
+
+ @Query(type = Query.Type.BETWEEN)
+ @ApiModelProperty(value = "Create time range")
+ private List createTime;
+}
diff --git a/sport/src/main/java/com/srr/dto/WaitListDto.java b/sport/src/main/java/com/srr/dto/WaitListDto.java
new file mode 100644
index 00000000..240d18d9
--- /dev/null
+++ b/sport/src/main/java/com/srr/dto/WaitListDto.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2019-2025 Zheng Jie
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.srr.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.srr.enumeration.WaitListStatus;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+/**
+ * @author Chanheng
+ * @date 2025-05-26
+ * @description Wait list DTO for transferring wait list data
+ */
+@Getter
+@Setter
+public class WaitListDto implements Serializable {
+
+ @ApiModelProperty(value = "id")
+ private Long id;
+
+ @ApiModelProperty(value = "Event ID")
+ private Long eventId;
+
+ @ApiModelProperty(value = "Player ID")
+ private Long playerId;
+
+ @ApiModelProperty(value = "Notes")
+ private String notes;
+
+ @ApiModelProperty(value = "Status (WAITING, PROMOTED, CANCELLED, EXPIRED)")
+ private WaitListStatus status;
+
+ @ApiModelProperty(value = "Creation time")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ private Timestamp createTime;
+
+ @ApiModelProperty(value = "Update time")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ private Timestamp updateTime;
+
+ // Additional relationships can be added if needed
+ @ApiModelProperty(value = "Player")
+ private PlayerDto player;
+
+ @ApiModelProperty(value = "Event")
+ private EventDto event;
+}
diff --git a/sport/src/main/java/com/srr/dto/WaitListQueryCriteria.java b/sport/src/main/java/com/srr/dto/WaitListQueryCriteria.java
new file mode 100644
index 00000000..c16949ab
--- /dev/null
+++ b/sport/src/main/java/com/srr/dto/WaitListQueryCriteria.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2019-2025 Zheng Jie
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.srr.dto;
+
+import com.srr.enumeration.WaitListStatus;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import me.zhengjie.annotation.Query;
+
+import java.sql.Timestamp;
+import java.util.List;
+
+/**
+ * @author Chanheng
+ * @date 2025-05-26
+ */
+@Data
+public class WaitListQueryCriteria {
+
+ @Query
+ private Long id;
+
+ @Query
+ @ApiModelProperty(value = "Event ID")
+ private Long eventId;
+
+ @Query
+ @ApiModelProperty(value = "Player ID")
+ private Long playerId;
+
+ @Query
+ @ApiModelProperty(value = "Status")
+ private WaitListStatus status;
+
+ @Query(type = Query.Type.BETWEEN)
+ @ApiModelProperty(value = "Create time range")
+ private List createTime;
+}
diff --git a/sport/src/main/java/com/srr/dto/mapstruct/EventOrganizerMapper.java b/sport/src/main/java/com/srr/dto/mapstruct/EventOrganizerMapper.java
new file mode 100644
index 00000000..23463861
--- /dev/null
+++ b/sport/src/main/java/com/srr/dto/mapstruct/EventOrganizerMapper.java
@@ -0,0 +1,32 @@
+/*
+* Copyright 2019-2025 Zheng Jie
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package com.srr.dto.mapstruct;
+
+import me.zhengjie.base.BaseMapper;
+import com.srr.domain.EventOrganizer;
+import com.srr.dto.EventOrganizerDto;
+import org.mapstruct.Mapper;
+import org.mapstruct.Mapping;
+import org.mapstruct.ReportingPolicy;
+
+/**
+* @website https://eladmin.vip
+* @author Chanheng
+* @date 2025-05-26
+**/
+@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
+public interface EventOrganizerMapper extends BaseMapper {
+}
diff --git a/sport/src/main/java/com/srr/dto/mapstruct/RatingHistoryMapper.java b/sport/src/main/java/com/srr/dto/mapstruct/RatingHistoryMapper.java
new file mode 100644
index 00000000..d5513f5c
--- /dev/null
+++ b/sport/src/main/java/com/srr/dto/mapstruct/RatingHistoryMapper.java
@@ -0,0 +1,43 @@
+/*
+* Copyright 2019-2025 Zheng Jie
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package com.srr.dto.mapstruct;
+
+import me.zhengjie.base.BaseMapper;
+import com.srr.domain.RatingHistory;
+import com.srr.dto.RatingHistoryDto;
+import org.mapstruct.Mapper;
+import org.mapstruct.Mapping;
+import org.mapstruct.ReportingPolicy;
+
+/**
+* @website https://eladmin.vip
+* @author Chanheng
+* @date 2025-05-26
+**/
+@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
+public interface RatingHistoryMapper extends BaseMapper {
+
+ /**
+ * Entity to DTO mapping with explicit field mappings
+ * @param entity RatingHistory entity
+ * @return RatingHistoryDto
+ */
+ @Override
+ @Mapping(source = "player.id", target = "playerId")
+ @Mapping(source = "player.name", target = "playerName")
+ @Mapping(source = "match.id", target = "matchId")
+ RatingHistoryDto toDto(RatingHistory entity);
+}
diff --git a/sport/src/main/java/com/srr/enumeration/EventStatus.java b/sport/src/main/java/com/srr/enumeration/EventStatus.java
index aa10d100..c354b704 100644
--- a/sport/src/main/java/com/srr/enumeration/EventStatus.java
+++ b/sport/src/main/java/com/srr/enumeration/EventStatus.java
@@ -1,7 +1,10 @@
package com.srr.enumeration;
public enum EventStatus {
+ DRAFT,
OPEN,
+ CHECK_IN,
IN_PROGRESS,
- CLOSED
+ CLOSED,
+ DELETED
}
diff --git a/sport/src/main/java/com/srr/enumeration/WaitListStatus.java b/sport/src/main/java/com/srr/enumeration/WaitListStatus.java
new file mode 100644
index 00000000..c87b79b9
--- /dev/null
+++ b/sport/src/main/java/com/srr/enumeration/WaitListStatus.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2019-2025 Zheng Jie
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.srr.enumeration;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * Enum representing the possible states of a wait list entry
+ * @author Chanheng
+ * @date 2025-05-26
+ */
+@Getter
+@AllArgsConstructor
+public enum WaitListStatus {
+
+ WAITING("Waiting"),
+ PROMOTED("Promoted to participant"),
+ CANCELLED("Cancelled by player"),
+ EXPIRED("Expired due to event start");
+
+ private final String description;
+}
diff --git a/sport/src/main/java/com/srr/repository/EventOrganizerRepository.java b/sport/src/main/java/com/srr/repository/EventOrganizerRepository.java
new file mode 100644
index 00000000..f59e4b94
--- /dev/null
+++ b/sport/src/main/java/com/srr/repository/EventOrganizerRepository.java
@@ -0,0 +1,39 @@
+/*
+* Copyright 2019-2025 Zheng Jie
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package com.srr.repository;
+
+import com.srr.domain.EventOrganizer;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+* @website https://eladmin.vip
+* @author Chanheng
+* @date 2025-05-26
+**/
+@Repository
+public interface EventOrganizerRepository extends JpaRepository, JpaSpecificationExecutor {
+
+ /**
+ * Find event organizers by user id
+ * @param userId the user id
+ * @return list of event organizers
+ */
+ List findByUserId(Long userId);
+}
diff --git a/sport/src/main/java/com/srr/repository/RatingHistoryRepository.java b/sport/src/main/java/com/srr/repository/RatingHistoryRepository.java
new file mode 100644
index 00000000..35354cfb
--- /dev/null
+++ b/sport/src/main/java/com/srr/repository/RatingHistoryRepository.java
@@ -0,0 +1,34 @@
+/*
+* Copyright 2019-2025 Zheng Jie
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package com.srr.repository;
+
+import com.srr.domain.RatingHistory;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+* @website https://eladmin.vip
+* @author Chanheng
+* @date 2025-05-26
+**/
+@Repository
+public interface RatingHistoryRepository extends JpaRepository, JpaSpecificationExecutor {
+
+ List findByPlayerIdOrderByCreateTimeDesc(Long playerId);
+}
\ No newline at end of file
diff --git a/sport/src/main/java/com/srr/repository/WaitListRepository.java b/sport/src/main/java/com/srr/repository/WaitListRepository.java
new file mode 100644
index 00000000..07f26f70
--- /dev/null
+++ b/sport/src/main/java/com/srr/repository/WaitListRepository.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2019-2025 Zheng Jie
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.srr.repository;
+
+import com.srr.domain.WaitList;
+import com.srr.enumeration.WaitListStatus;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+import java.util.List;
+
+/**
+ * @author Chanheng
+ * @date 2025-05-26
+ */
+public interface WaitListRepository extends JpaRepository, JpaSpecificationExecutor {
+
+ /**
+ * Find all wait list entries for an event
+ * @param eventId The event ID
+ * @return List of wait list entries
+ */
+ List findByEventId(Long eventId);
+
+ /**
+ * Find all wait list entries for a player
+ * @param playerId The player ID
+ * @return List of wait list entries
+ */
+ List findByPlayerId(Long playerId);
+
+ /**
+ * Find wait list entry for a specific player and event
+ * @param eventId The event ID
+ * @param playerId The player ID
+ * @return WaitList entry if exists
+ */
+ WaitList findByEventIdAndPlayerId(Long eventId, Long playerId);
+
+ /**
+ * Find wait list entries by status
+ * @param status The status (WAITING, PROMOTED, CANCELLED, EXPIRED)
+ * @return List of wait list entries
+ */
+ List findByStatus(WaitListStatus status);
+
+ /**
+ * Count wait list entries for an event
+ * @param eventId The event ID
+ * @return Count of wait list entries
+ */
+ long countByEventId(Long eventId);
+}
diff --git a/sport/src/main/java/com/srr/rest/EventController.java b/sport/src/main/java/com/srr/rest/EventController.java
index 296520cd..695509f4 100644
--- a/sport/src/main/java/com/srr/rest/EventController.java
+++ b/sport/src/main/java/com/srr/rest/EventController.java
@@ -1,42 +1,47 @@
/*
-* Copyright 2019-2025 Zheng Jie
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright 2019-2025 Zheng Jie
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package com.srr.rest;
-import me.zhengjie.annotation.Log;
import com.srr.domain.Event;
-import com.srr.service.EventService;
+import com.srr.dto.EventDto;
import com.srr.dto.EventQueryCriteria;
-import org.springframework.data.domain.Pageable;
+import com.srr.dto.JoinEventDto;
+import com.srr.enumeration.EventStatus;
+import com.srr.service.EventService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
+import me.zhengjie.annotation.Log;
+import me.zhengjie.utils.PageResult;
+import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
-import io.swagger.annotations.*;
-import java.io.IOException;
+
import javax.servlet.http.HttpServletResponse;
-import me.zhengjie.utils.PageResult;
-import com.srr.dto.EventDto;
+import java.io.IOException;
/**
-* @website https://eladmin.vip
-* @author Chanheng
-* @date 2025-05-18
-**/
+ * @author Chanheng
+ * @website https://eladmin.vip
+ * @date 2025-05-18
+ **/
@RestController
@RequiredArgsConstructor
@Api(tags = "event")
@@ -55,26 +60,48 @@ public class EventController {
@GetMapping
@ApiOperation("Query event")
@PreAuthorize("@el.check('event:list')")
- public ResponseEntity> queryEvent(EventQueryCriteria criteria, Pageable pageable){
- return new ResponseEntity<>(eventService.queryAll(criteria,pageable),HttpStatus.OK);
+ public ResponseEntity> queryEvent(EventQueryCriteria criteria, Pageable pageable) {
+ return new ResponseEntity<>(eventService.queryAll(criteria, pageable), HttpStatus.OK);
}
@PostMapping
@Log("Add event")
@ApiOperation("Add event")
@PreAuthorize("@el.check('event:add')")
- public ResponseEntity