lrj
昨天 9f8395fab13ca4b230a0f7d62636e209745c91d4
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,8 @@
@Entity
@Table(name = "t_activity")
public class Activity {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
@Where(clause = "state = 1")
public class Activity extends BaseEntity {
    
    @Column(name = "pid", nullable = false)
    private Long pid = 0L;
@@ -44,26 +41,11 @@
    @Column(name = "player_max")
    private Integer playerMax;
    
    /**
     * 状态:1-正常,0-删除
     */
    @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 +78,6 @@
    }
    
    // Getters and Setters
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    
    public Long getPid() {
        return pid;
@@ -176,54 +151,6 @@
        this.playerMax = playerMax;
    }
    
    public Integer getState() {
        return state;
    }
    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 RatingScheme getRatingScheme() {
        return ratingScheme;
    }
@@ -248,8 +175,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;
    }