package com.bcxin.wps.entity;

import cn.wps.solution.weboffice.provider.v3.model.UserInfo;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("wps_users")
public class User {
    private long id;

    private String nickname;

    private String avatar;

    public UserInfo toUserInfo() {
        return UserInfo.builder()
                .id(String.valueOf(this.id))
                .name(this.nickname)
                .avatarUrl(this.avatar)
                .build();
    }
}
