Package com.dream.domain.user

Examples of com.dream.domain.user.User


* Time: 下午7:58
*/
public class SecurityUtil {

    public static String currentUserGuid() {
        User user = currentUser();
        if (user == null) {
            return null;
        }
        return user.guid();
    }
View Full Code Here


    public boolean isNew() {
        return ValidateUtil.isEmptyText(this.guid);
    }

    public Article toNewArticle() {
        User user = SecurityUtil.currentUser();
        return new Article(this.title, this.content, this.category, user);
    }
View Full Code Here

        List<ProjectExperience> projectExperiences = new ArrayList<ProjectExperience>();
        for (ProjectExperienceDTO projectExperienceDTO : projectExperienceDTOs) {
            ProjectExperience projectExperience = projectExperienceDTO.toProjectExperience();
            projectExperiences.add(projectExperience);
        }
        User user = SecurityUtil.currentUser();
        return new Resume(basicInfo, educationExperiences, workExperiences, projectExperiences, user);
    }
View Full Code Here

        this.nickname = nickname;
    }

    public User toNewUser(PasswordEncoder passwordEncoder) {
        String password = passwordEncoder.encodePassword(this.password, null);
        return new User(this.username, password, this.nickname, this.email);
    }
View Full Code Here

        return userDao.findUserByUsername(username);
    }

    @Override
    public void createUser(RegistrationDTO registrationDTO) {
        User user = registrationDTO.toNewUser(passwordEncoder);
        userDao.saveOrUpdate(user);
    }
View Full Code Here

TOP

Related Classes of com.dream.domain.user.User

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.