All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.flyfish.oauth.utils.UserConvertUtils Maven / Gradle / Ivy

There is a newer version: 1.0.7
Show newest version
package com.flyfish.oauth.utils;

import com.flyfish.oauth.configuration.OAuth2SsoUserService;
import com.flyfish.oauth.domain.raw.SSOUserInfo;

public abstract class UserConvertUtils {

    /**
     * 转换用户
     *
     * @param userService 用户service
     * @param userInfo    用户信息
     * @param          泛型
     * @return 结果
     */
    public static  T convert(OAuth2SsoUserService userService, SSOUserInfo userInfo) {
        if (null == userService) {
            return null;
        }
        if (userService.exists(userInfo)) {
            return userService.getUser(userInfo);
        }
        return userService.completeUser(userInfo);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy