package rd.data.db.table;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.google.common.base.Objects;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Activity implements Serializable {
    /**
     * 活动id
     */
    private Long id;

    /**
     * 活动名称
     */
    private String name;

    /**
     * 学期,格式如2023-2024-1
     */
    private String term;

    /**
     * 开始时间
     */
    private LocalDateTime startTime;

    /**
     * 结束时间
     */
    private LocalDateTime endTime;

    /**
     * create_time
     */
    private LocalDateTime createTime;

    /**
     * edit_time
     */
    private LocalDateTime editTime;

    /**
     * delete
     */
    private Boolean deleted;

    public Activity() {
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Activity activity = (Activity) o;
        return Objects.equal(id, activity.id);
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(id);
    }
}
