package com.rongyichuang.carousel.entity;
|
|
import com.rongyichuang.common.entity.BaseEntity;
|
import jakarta.persistence.*;
|
import org.hibernate.annotations.Where;
|
|
/**
|
* 轮播图(新闻与推广)实体类
|
*/
|
@Entity
|
@Table(name = "t_carousel")
|
@Where(clause = "state = 1")
|
public class Carousel extends BaseEntity {
|
|
/**
|
* 新闻标题
|
*/
|
@Column(name = "title", nullable = false, length = 100)
|
private String title;
|
|
/**
|
* 新闻内容
|
*/
|
@Column(name = "description", length = 255)
|
private String content;
|
|
/**
|
* 播放顺序
|
*/
|
@Column(name = "sort_order")
|
private Integer sortOrder;
|
|
/**
|
* 创建用户ID
|
*/
|
@Column(name = "create_user_id")
|
private Long createUserId;
|
|
/**
|
* 更新用户ID
|
*/
|
@Column(name = "update_user_id")
|
private Long updateUserId;
|
|
/**
|
* 版本号(乐观锁)
|
*/
|
@Version
|
@Column(name = "version", nullable = false)
|
private Long version = 0L;
|
|
/**
|
* 媒体数量(冗余字段,用于列表显示)
|
*/
|
@Transient
|
private Integer mediaCount;
|
|
// Getters and Setters
|
public String getTitle() {
|
return title;
|
}
|
|
public void setTitle(String title) {
|
this.title = title;
|
}
|
|
public String getContent() {
|
return content;
|
}
|
|
public void setContent(String content) {
|
this.content = content;
|
}
|
|
public Integer getSortOrder() {
|
return sortOrder;
|
}
|
|
public void setSortOrder(Integer sortOrder) {
|
this.sortOrder = sortOrder;
|
}
|
|
public Integer getMediaCount() {
|
return mediaCount;
|
}
|
|
public void setMediaCount(Integer mediaCount) {
|
this.mediaCount = mediaCount;
|
}
|
|
public Long getCreateUserId() {
|
return createUserId;
|
}
|
|
public void setCreateUserId(Long createUserId) {
|
this.createUserId = createUserId;
|
}
|
|
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;
|
}
|
}
|