package com.jeesharp.business.modules.setting.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.jeesharp.business.modules.setting.enums.SplashMediaTypeEnum;
import com.jeesharp.framework.mybatis.core.dataobject.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 开屏广告配置，映射表 {@code cfg_app_splash}；同端可配置多条做轮播。
 *
 * @author jeesharp
 * @since 2026-04-21
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("cfg_app_splash")
@Schema(description = "开屏广告")
public class AppSplashAd extends BaseEntity<AppSplashAd> {

    @Schema(description = "端：WECHAT_MINI/APP/H5 等")
    private String platform;

    /**
     * 媒体类型，见 {@link SplashMediaTypeEnum}
     */
    @Schema(description = "媒体类型：1-图片 2-视频")
    private Integer mediaType;

    @Schema(description = "图片或视频 URL")
    private String mediaUrl;

    @Schema(description = "视频封面图 URL")
    private String posterUrl;

    @Schema(description = "叠字标题")
    private String title;

    @Schema(description = "叠字副标题")
    private String subtitle;

    @Schema(description = "点击跳转链接")
    private String linkUrl;

    @Schema(description = "停留倒计时秒数")
    private Integer durationSec;

    @Schema(description = "是否可跳过：0-否 1-是")
    private Integer skippable;

    @Schema(description = "展示开始时间")
    private LocalDateTime displayBegin;

    @Schema(description = "展示结束时间")
    private LocalDateTime displayEnd;

    @Schema(description = "排序号")
    private Integer sortOrder;

    @Schema(description = "状态：0-禁用 1-启用")
    private Integer status;
}
