package com.greenorange.promotion.model.dto.userInfo;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;

/**
 * 用户更新请求体
 */
@Data
@Schema(description = "用户更新请求体", requiredProperties = {"id", "nickName", "userAvatar",
        "userAccount", "userPassword"})
public class UserInfoUpdateRequest implements Serializable {

    /**
     * 用户ID
     */
    @NotNull(message = "用户ID不能为null")
    @Min(value = 1L, message = "用户ID不能小于1")
    @Schema(description = "用户ID", example = "1")
    private Long id;

    /**
     * 用户昵称
     */
    @NotBlank(message = "用户昵称不能为空")
    @Schema(description = "用户昵称", example = "chenxinzhi")
    private String nickName;

    /**
     * 用户头像URL
     */
    @NotBlank(message = "用户头像URL不能为空")
    @Schema(description = "用户头像URL", example = "3E8U2AM8")
    private String userAvatar;

    /**
     * 账号
     */
    @NotBlank(message = "账号不能为空")
    @Size(min = 6, max = 11, message = "账号长度在 6 到 11 个字符")
    @Schema(description = "账号", example = "qingcheng")
    private String userAccount;

    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空")
    @Size(min = 6, max = 10, message = "密码长度在 6 到 10 个字符")
    @Schema(description = "密码（建议加密存储）", example = "qingcheng")
    private String userPassword;


    @Serial
    private static final long serialVersionUID = 1L;
}
