package com.fs.hisStore.param;

import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

@Data
public class FsUserEditParam implements Serializable
{

    @NotNull(message = "用户昵称不能为空！")
    private String nickname;
    // 兼容前端 因为大小写传值问题 先取nickName再取nickname
    private String nickName;

//    @NotBlank(message = "用户头像不能为空！")
    private String avatar;

    private Long userId;

    // 添加兼容方法
    public String getNickName() {
        return this.nickName != null ? this.nickName : this.nickname;
    }

    public String getNickname() {
        return this.nickname != null ? this.nickname : this.nickName;
    }

    // 也可以统一设置器
    public void setNickName(String nickName) {
        this.nickName = nickName;
        this.nickname = nickName;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
        this.nickName = nickname;
    }
}
