package com.gxwebsoft.common.core.dto.qr;

import io.swagger.v3.oas.annotations.media.Schema;

import javax.validation.constraints.*;

/**
 * 创建加密二维码请求DTO
 *
 * @author WebSoft
 * @since 2025-08-18
 */
@Schema(description = "创建加密二维码请求")
public class CreateEncryptedQrCodeRequest {

    @Schema(description = "要加密的数据", required = true, example = "用户ID:12345")
    @NotBlank(message = "数据不能为空")
    private String data;

    @Schema(description = "二维码宽度", example = "200")
    @Min(value = 50, message = "宽度不能小于50像素")
    @Max(value = 1000, message = "宽度不能大于1000像素")
    private Integer width = 200;

    @Schema(description = "二维码高度", example = "200")
    @Min(value = 50, message = "高度不能小于50像素")
    @Max(value = 1000, message = "高度不能大于1000像素")
    private Integer height = 200;

    @Schema(description = "过期时间（分钟）", example = "30")
    @Min(value = 1, message = "过期时间不能小于1分钟")
    @Max(value = 1440, message = "过期时间不能大于1440分钟")
    private Long expireMinutes = 30L;

    @Schema(description = "业务类型（可选）", example = "LOGIN")
    private String businessType;

    // 构造函数
    public CreateEncryptedQrCodeRequest() {}

    public CreateEncryptedQrCodeRequest(String data, Integer width, Integer height, Long expireMinutes, String businessType) {
        this.data = data;
        this.width = width;
        this.height = height;
        this.expireMinutes = expireMinutes;
        this.businessType = businessType;
    }

    // Getter和Setter方法
    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    public Integer getWidth() {
        return width;
    }

    public void setWidth(Integer width) {
        this.width = width;
    }

    public Integer getHeight() {
        return height;
    }

    public void setHeight(Integer height) {
        this.height = height;
    }

    public Long getExpireMinutes() {
        return expireMinutes;
    }

    public void setExpireMinutes(Long expireMinutes) {
        this.expireMinutes = expireMinutes;
    }

    public String getBusinessType() {
        return businessType;
    }

    public void setBusinessType(String businessType) {
        this.businessType = businessType;
    }

    @Override
    public String toString() {
        return "CreateEncryptedQrCodeRequest{" +
                "data='" + data + '\'' +
                ", width=" + width +
                ", height=" + height +
                ", expireMinutes=" + expireMinutes +
                ", businessType='" + businessType + '\'' +
                '}';
    }
}
