package rd.data.db.table;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.google.common.base.Objects;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

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

@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Major implements Serializable {
    /**
     * 专业id
     */
    @TableId(type = IdType.INPUT)
    private Long id;

    /**
     * 专业名称
     */
    private String name;

    /**
     * create_time
     */
    private LocalDateTime createTime;

    /**
     * edit_time
     */
    private LocalDateTime editTime;

    /**
     * delete
     */
    private Boolean deleted;

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

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