package com.ruoyi.vo;

import com.ruoyi.enums.user.UserEnums;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @author liwenlong
 * @date 2022/1/14 11:07
 */
@Data
public class UserVo {

    @ApiModelProperty(value = "用户类型 1 用户 对应枚举 UserEnums")
    private Integer userType;

    @ApiModelProperty(value = "用户id")
    private Long userId;

    public static UserVo customerUserVo(Long customerId) {
        UserVo userVo = new UserVo();
        userVo.setUserType(UserEnums.customer.getCode());
        userVo.setUserId(customerId);
        return userVo;
    }

    public static UserVo storeUserVo(Long storeId) {
        UserVo userVo = new UserVo();
        userVo.setUserType(UserEnums.store.getCode());
        userVo.setUserId(storeId);
        return userVo;
    }

    public UserVo() {

    }

    public UserVo(Integer userType, Long userId) {
        this.userId = userId;
        this.userType = userType;
    }

    public UserVo(UserEnums userEnums,Long userId) {
        this.userId = userId;
        this.userType = userEnums.getCode();
    }
}
