package com.ningdatech.pmapi.user.convert;

import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO;
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails;

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

    private UserInfoConvertor() {

    }

    public static UserInfoDetails toUserInfoDetails(UserFullInfoDTO userFullInfo) {
        UserInfoDetails userInfoDetails = new UserInfoDetails();
        userInfoDetails.setUserId(userFullInfo.getUserId());
        userInfoDetails.setUsername(userFullInfo.getUsername());
        userInfoDetails.setRealName(userFullInfo.getRealName());
        userInfoDetails.setUserRoleList(userFullInfo.getUserRoleList());
        userInfoDetails.setRegionCode(userFullInfo.getRegionCode());
        userInfoDetails.setRegionLevel(userFullInfo.getRegionLevel());
        userInfoDetails.setIdentifier(userFullInfo.getIdentifier());
        userInfoDetails.setPassword(userFullInfo.getCredential());
        userInfoDetails.setEmployeeCode(userFullInfo.getEmployeeCode());
        userInfoDetails.setOrganizationCode(userFullInfo.getOrganizationCode());
        userInfoDetails.setOrganizationName(userFullInfo.getOrganizationName());
        userInfoDetails.setEmpPosUnitCode(userFullInfo.getEmpPosUnitCode());
        userInfoDetails.setEmpPosUnitName(userFullInfo.getEmpPosUnitName());
        userInfoDetails.setMobile(userFullInfo.getMobile());
        return userInfoDetails;
    }

}
