package com.gxwebsoft.common.system.result;

import com.gxwebsoft.common.system.entity.User;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
 * 登录返回结果
 *
 * @author WebSoft
 * @since 2021-08-30 17:35:16
 */
@Data
@NoArgsConstructor
@Schema(description = "登录返回结果")
public class LoginResult implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(description = "access_token")
    private String access_token;

    @Schema(description = "用户信息")
    private User user;

    @Schema(description = "租户列表（多租户场景下返回，此时不返回access_token）")
    private List<TenantOption> tenants;

    public LoginResult(String access_token, User user) {
        this.access_token = access_token;
        this.user = user;
    }

    public LoginResult(List<TenantOption> tenants) {
        this.tenants = tenants;
    }

}
