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

import com.jeesharp.framework.pojo.dto.BaseSaveDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 运营弹窗保存 DTO，用于后台新增/编辑。
 *
 * @author jeesharp
 * @since 2026-05-13
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "运营弹窗保存请求")
public class OperationPopupSaveDTO extends BaseSaveDTO {

    @NotBlank(message = "端类型不能为空")
    @Schema(description = "端：WECHAT_MINI/APP/H5", requiredMode = Schema.RequiredMode.REQUIRED)
    private String platform;

    @Size(max = 200, message = "标题过长")
    @Schema(description = "标题")
    private String title;

    @Size(max = 500, message = "副标题过长")
    @Schema(description = "副标题")
    private String subtitle;

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

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

    @Size(max = 1000, message = "配图地址过长")
    @Schema(description = "配图 URL")
    private String imageUrl;

    @Size(max = 1000, message = "跳转路径过长")
    @Schema(description = "点击跳转路径")
    private String linkPath;

    @NotNull(message = "是否可关闭不能为空")
    @Schema(description = "是否允许关闭：0-否 1-是", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer closable;

    @Schema(description = "展示开始时间，空不限制")
    private LocalDateTime displayBegin;

    @Schema(description = "展示结束时间，空不限制")
    private LocalDateTime displayEnd;

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

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