mirror of https://github.com/elunez/eladmin
restructure
parent
a47af368e5
commit
009714e38b
|
@ -0,0 +1,4 @@
|
||||||
|
alter table event
|
||||||
|
add column status varchar(255),
|
||||||
|
add column is_public bit default 0,
|
||||||
|
add column allow_wait_list bit default 0;
|
|
@ -15,6 +15,7 @@
|
||||||
*/
|
*/
|
||||||
package com.srr.domain;
|
package com.srr.domain;
|
||||||
|
|
||||||
|
import com.srr.enumeration.EventStatus;
|
||||||
import com.srr.enumeration.Format;
|
import com.srr.enumeration.Format;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
@ -114,6 +115,17 @@ public class Event implements Serializable {
|
||||||
@ApiModelProperty(value = "createBy")
|
@ApiModelProperty(value = "createBy")
|
||||||
private Long createBy;
|
private Long createBy;
|
||||||
|
|
||||||
|
@Column(name = "`status`")
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
@ApiModelProperty(value = "status")
|
||||||
|
private EventStatus status;
|
||||||
|
|
||||||
|
@Column(name = "`is_public`")
|
||||||
|
private boolean isPublic;
|
||||||
|
|
||||||
|
@Column(name = "`allow_wait_list`")
|
||||||
|
private boolean allowWaitList;
|
||||||
|
|
||||||
public void copy(Event source){
|
public void copy(Event source){
|
||||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.srr.domain;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "`team`")
|
||||||
|
public class Team implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@Column(name = "`id`")
|
||||||
|
@ApiModelProperty(value = "id", hidden = true)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Column(name = "`name`")
|
||||||
|
@ApiModelProperty(value = "Name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Column(name = "`team_size`")
|
||||||
|
@ApiModelProperty(value = "Team size")
|
||||||
|
private int teamSize;
|
||||||
|
|
||||||
|
@OneToMany(mappedBy = "team")
|
||||||
|
@JoinTable(name = "team_players",
|
||||||
|
joinColumns = {@JoinColumn(name = "team_id",referencedColumnName = "id")})
|
||||||
|
@ApiModelProperty(value = "Players")
|
||||||
|
private List<Player> players; // <Player>
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.srr.domain;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Entity
|
||||||
|
@Table(name = "`team_player`")
|
||||||
|
public class TeamPlayer implements Serializable {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@Column(name = "`id`")
|
||||||
|
@ApiModelProperty(value = "id", hidden = true)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "team_id")
|
||||||
|
private Team team;
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "player_id")
|
||||||
|
private Player player;
|
||||||
|
|
||||||
|
@Column(name = "`is_checked_in`")
|
||||||
|
private boolean isCheckedIn;
|
||||||
|
}
|
|
@ -15,6 +15,7 @@
|
||||||
*/
|
*/
|
||||||
package com.srr.dto;
|
package com.srr.dto;
|
||||||
|
|
||||||
|
import com.srr.enumeration.EventStatus;
|
||||||
import com.srr.enumeration.Format;
|
import com.srr.enumeration.Format;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -78,4 +79,10 @@ public class EventDto implements Serializable {
|
||||||
|
|
||||||
@ApiModelProperty(value = "createBy")
|
@ApiModelProperty(value = "createBy")
|
||||||
private Long createBy;
|
private Long createBy;
|
||||||
|
|
||||||
|
private EventStatus status;
|
||||||
|
|
||||||
|
private boolean isPublic;
|
||||||
|
|
||||||
|
private boolean allowWaitList;
|
||||||
}
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package com.srr.enumeration;
|
||||||
|
|
||||||
|
public enum EventStatus {
|
||||||
|
OPEN,
|
||||||
|
IN_PROGRESS,
|
||||||
|
CLOSED
|
||||||
|
}
|
Loading…
Reference in New Issue