package com.hz.pm.api.user.convert;

import com.hz.pm.api.user.security.model.UserFullInfoDTO;
import com.hz.pm.api.user.security.model.UserInfoDetails;

/**
 * <p>
 * UserInfoConvertor
 * </p>
 *
 * @author WendyYang
 * @since 2023/5/5
 **/
public class UserInfoConvertor {

    private UserInfoConvertor() {

    }

    public static UserInfoDetails convert(UserFullInfoDTO userFullInfo) {
        UserInfoDetails userInfoDetails = new UserInfoDetails();
        userInfoDetails.setUserId(userFullInfo.getUserId());
        userInfoDetails.setUsername(userFullInfo.getUsername());
        userInfoDetails.setRealName(userFullInfo.getRealName());
        userInfoDetails.setUserRoleList(userFullInfo.getUserRoleList());
        userInfoDetails.setIdentifier(userFullInfo.getIdentifier());
        userInfoDetails.setPassword(userFullInfo.getCredential());
        userInfoDetails.setMhUnitId(userFullInfo.getMhUnitId());
        userInfoDetails.setMhUnitName(userFullInfo.getMhUnitName());
        userInfoDetails.setMobile(userFullInfo.getMobile());
        userInfoDetails.setMhUserId(userFullInfo.getMhUserId());
        return userInfoDetails;
    }

}
