Package org.b3log.latke.user

Examples of org.b3log.latke.user.GeneralUser


     * Gets the current user.
     *
     * @return the current user, {@code null} if not found
     */
    public JSONObject getCurrentUser() {
        final GeneralUser currentUser = userService.getCurrentUser();
        if (null == currentUser) {
            return null;
        }

        final String email = currentUser.getEmail();
        return userRepository.getByEmail(email);
    }
View Full Code Here


        final JSONObject currentUser = Sessions.currentUser(request);
        if (null == currentUser) {
            return null;
        }

        final GeneralUser ret = new GeneralUser();
        ret.setEmail(currentUser.optString(User.USER_EMAIL));
        ret.setId(currentUser.optString(Keys.OBJECT_ID));
        ret.setNickname(currentUser.optString(User.USER_NAME));

        return ret;
    }
View Full Code Here

     *
     * @param user the specified Google App Engine user
     * @return general user
     */
    private static GeneralUser toGeneralUser(final User user) {
        final GeneralUser ret = new GeneralUser();

        ret.setEmail(user.getEmail());
        ret.setId(user.getUserId());
        ret.setNickname(user.getNickname());

        return ret;
    }
View Full Code Here

TOP

Related Classes of org.b3log.latke.user.GeneralUser

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.