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

import com.baomidou.mybatisplus.annotation.TableName;
import com.jeesharp.business.modules.setting.enums.OperationPopupClosableEnum;
import com.jeesharp.business.modules.setting.enums.OperationPopupStatusEnum;
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_operation_popup}；按端与展示时段投放。
 *
 * @author jeesharp
 * @since 2026-05-13
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("cfg_operation_popup")
@Schema(description = "运营弹窗")
public class OperationPopup extends BaseEntity<OperationPopup> {

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

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

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

    @Schema(description = "展示方式：IMAGE_H/IMAGE_V/CARD/COUPON_PACK/ACTIVITY")
    private String displayMode;

    @Schema(description = "模式扩展配置 JSON")
    private String extConfig;

    @Schema(description = "配图 URL")
    private String imageUrl;

    @Schema(description = "点击跳转路径")
    private String linkPath;

    /**
     * 是否允许关闭，见 {@link OperationPopupClosableEnum}
     */
    @Schema(description = "是否允许关闭：0-否 1-是")
    private Integer closable;

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

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

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

    /**
     * 状态，见 {@link OperationPopupStatusEnum}
     */
    @Schema(description = "状态：0-禁用 1-启用")
    private Integer status;
}
