lrj
2 天以前 93eb6b470773bc49ea6e1a9d4cbd914eb95d525b
backend/src/main/java/com/rongyichuang/activity/entity/Activity.java
@@ -1,9 +1,9 @@
package com.rongyichuang.activity.entity;
import com.rongyichuang.common.entity.BaseEntity;
import com.rongyichuang.rating.entity.RatingScheme;
import jakarta.persistence.*;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import org.hibernate.annotations.Where;
import java.time.LocalDateTime;
import java.util.ArrayList;
@@ -11,11 +11,7 @@
@Entity
@Table(name = "t_activity")
public class Activity {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
public class Activity extends BaseEntity {
    
    @Column(name = "pid", nullable = false)
    private Long pid = 0L;
@@ -44,26 +40,17 @@
    @Column(name = "player_max")
    private Integer playerMax;
    
    /**
     * 阶段排序,从1开始连续
     */
    @Column(name = "sort_order")
    private Integer sortOrder;
    /**
     * 状态:0-未发布,1-发布,2-关闭
     */
    @Column(name = "state", nullable = false)
    private Integer state = 1;
    @Column(name = "create_time", nullable = false, updatable = false)
    @CreationTimestamp
    private LocalDateTime createTime;
    @Column(name = "create_user_id")
    private Long createUserId;
    @Column(name = "update_time", nullable = false)
    @UpdateTimestamp
    private LocalDateTime updateTime;
    @Column(name = "update_user_id")
    private Long updateUserId;
    @Version
    @Column(name = "version", nullable = false)
    private Long version = 0L;
    
    // 关联评分模板
    @ManyToOne(fetch = FetchType.LAZY)
@@ -96,13 +83,6 @@
    }
    
    // Getters and Setters
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    
    public Long getPid() {
        return pid;
@@ -176,52 +156,12 @@
        this.playerMax = playerMax;
    }
    
    public Integer getState() {
        return state;
    public Integer getSortOrder() {
        return sortOrder;
    }
    
    public void setState(Integer state) {
        this.state = state;
    }
    public LocalDateTime getCreateTime() {
        return createTime;
    }
    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }
    public Long getCreateUserId() {
        return createUserId;
    }
    public void setCreateUserId(Long createUserId) {
        this.createUserId = createUserId;
    }
    public LocalDateTime getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }
    public Long getUpdateUserId() {
        return updateUserId;
    }
    public void setUpdateUserId(Long updateUserId) {
        this.updateUserId = updateUserId;
    }
    public Long getVersion() {
        return version;
    }
    public void setVersion(Long version) {
        this.version = version;
    public void setSortOrder(Integer sortOrder) {
        this.sortOrder = sortOrder;
    }
    
    public RatingScheme getRatingScheme() {
@@ -248,8 +188,16 @@
        this.parent = parent;
    }
    
    public Integer getState() {
        return state;
    }
    public void setState(Integer state) {
        this.state = state;
    }
    // 业务方法
    public boolean isCompetition() {
    public boolean isMainActivity() {
        return pid == 0;
    }