package org.cmh.backend.UserManagement.adpter;

import org.cmh.backend.UserManagement.model.User;
import org.cmh.backend.authentication.model.UserHS;

import java.time.LocalDateTime;

public class User2UserHS {
    private String tenant;
    public static UserHS convert(User user,String tenant) {
        UserHS userHS = new UserHS();
        userHS.setUsername(user.getAccount());
        userHS.setPassword(user.getPassword());
        userHS.setNickname(user.getName());
        userHS.setDepartment(user.getOrganization());
        userHS.setGender(user.getGender());
        userHS.setEmail(user.getEmail());
        userHS.setPhoneNumber(user.getPhone());
        userHS.setRole("用户");
        userHS.setCreatedAt(LocalDateTime.now());
        userHS.setTenant(tenant);
        return userHS;
   }

}
