package com.test.musichouduan.entity;

import jakarta.persistence.*;
import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import java.time.LocalDateTime;

/**
 * 轮播图实体类
 */
@Data
@Entity
@Table(name = "banner")
public class Banner {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 标题
     */
    @Column(length = 100)
    private String title;

    /**
     * 图片URL
     */
    @Column(nullable = false, length = 255)
    private String imageUrl;

    /**
     * 链接URL
     */
    @Column(length = 255)
    private String linkUrl;

    /**
     * 目标ID
     */
    @Column
    private Long targetId;

    /**
     * 目标类型：1-音乐，2-歌单，3-歌手
     */
    @Column
    private Integer targetType;

    /**
     * 排序号
     */
    @Column
    private Integer orderNum;

    /**
     * 状态：0-禁用，1-正常
     */
    @Column
    private Integer status;

    /**
     * 创建时间
     */
    @CreationTimestamp
    @Column(nullable = false, updatable = false)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @UpdateTimestamp
    @Column(nullable = false)
    private LocalDateTime updateTime;
}
