package com.xindazhou.business.controller.admin.community.ban.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

import static com.xindazhou.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - 封禁保存 Request VO")
@Data
public class BanSaveReqVO {

    @Schema(description = "用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "用户ID不能为空")
    private Long userId;

    @Schema(description = "封禁原因", requiredMode = Schema.RequiredMode.REQUIRED, example = "违规行为")
    @NotBlank(message = "封禁原因不能为空")
    private String banReason;

    @Schema(description = "封禁开始时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "封禁开始时间不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime banStartTime;

    @Schema(description = "封禁结束时间（无限期时为空）")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime banEndTime;

    @Schema(description = "是否无限期封禁", example = "false")
    private Boolean isIndefinite;

}

