package com.snack.server.module.banner.dto.req;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 创建/更新轮播图请求
 */
@Data
@Schema(description = "创建/更新轮播图")
public class BannerSaveReq implements Serializable {

    @Schema(description = "轮播图 ID（更新时必填）")
    private Long id;

    @NotBlank(message = "图片 URL 不能为空")
    @Schema(description = "图片 URL")
    private String image;

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

    @Schema(description = "跳转类型：0-不跳转 1-商品 2-分类 3-外链", example = "0")
    private Integer linkType = 0;

    @Schema(description = "跳转目标值")
    private String linkValue;

    @Schema(description = "排序号（升序）", example = "0")
    private Integer sort = 0;

    @Schema(description = "状态：0-下线 1-上线", example = "1")
    private Integer status = 1;

    @Schema(description = "生效时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startTime;

    @Schema(description = "失效时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endTime;
}
