Package com.mossle.user.persistence.domain

Examples of com.mossle.user.persistence.domain.UserBase


                    "user.user.input.passwordnotequals", "两次输入密码不符");

            return "redirect:/user/change-password-input.do";
        }

        UserBase userBase = userBaseManager.findUniqueBy("username",
                SpringSecurityUtils.getCurrentUsername());

        if (!isPasswordValid(oldPassword, userBase.getPassword())) {
            messageHelper.addFlashMessage(redirectAttributes,
                    "user.user.input.passwordnotcorrect", "密码错误");

            return "redirect:/user/change-password-input.do";
        }

        userBase.setPassword(encodePassword(newPassword));
        userBaseManager.save(userBase);
        messageHelper.addFlashMessage(redirectAttributes, "core.success.save",
                "保存成功");

        return "redirect:/user/change-password-input.do";
View Full Code Here


    }

    @RequestMapping("user-base-input")
    public String input(@RequestParam(value = "id", required = false) Long id,
            Model model) {
        UserBase userBase = null;

        if (id != null) {
            userBase = userBaseManager.get(id);
        } else {
            userBase = new UserBase();

            UserRepo userRepo = userRepoManager.findUniqueBy("code",
                    ScopeHolder.getScopeCode());
            userBase.setUserRepo(userRepo);
        }

        UserBaseWrapper userBaseWrapper = new UserBaseWrapper(userBase);
        model.addAttribute("model", userBase);
        model.addAttribute("userBaseWrapper", userBaseWrapper);
View Full Code Here

        Map<String, Object> parameters = ServletUtils
                .getParametersStartingWith(parameterMap, "_user_attr_");

        // 再进行数据复制
        UserBase dest = null;
        Long id = userBase.getId();

        if (id != null) {
            dest = userBaseManager.get(id);
            dest.setStatus(0);
            beanMapper.copy(userBase, dest);
            userService.updateUser(dest, userRepoId, parameters);
        } else {
            dest = userBase;
            dest.setAvatar((String) httpSession.getAttribute("temporaryAvatar"));
            userService.insertUser(dest, userRepoId, parameters);
            httpSession.removeAttribute("temporaryAvatar");
        }

        messageHelper.addFlashMessage(redirectAttributes, "core.success.save",
                "保存成功");

        UserDTO userDto = new UserDTO();
        userDto.setId(Long.toString(dest.getId()));
        userDto.setUsername(dest.getUsername());
        userDto.setRef(dest.getRef());
        userDto.setUserRepoRef(Long.toString(userRepoId));
        userCache.removeUser(userDto);

        return "redirect:/user/user-base-list.do";
    }
View Full Code Here

        StoreDTO storeDto = storeConnector
                .save("avatar", new MultipartFileResource(avatar),
                        avatar.getOriginalFilename());

        if (id != null) {
            UserBase userBase = userBaseManager.get(id);
            userBase.setAvatar(storeDto.getKey());
            userBaseManager.save(userBase);
        } else {
            httpSession.setAttribute("temporaryAvatar", storeDto.getKey());
        }
View Full Code Here

    @RequestMapping("user-base-avatar")
    @ResponseBody
    public void avatar(@RequestParam(value = "id", required = false) Long id,
            OutputStream os, HttpSession httpSession) throws Exception {
        if (id != null) {
            UserBase userBase = userBaseManager.get(id);
            StoreDTO storeDto = storeConnector.get("avatar",
                    userBase.getAvatar());

            IoUtils.copyStream(storeDto.getResource().getInputStream(), os);
        } else {
            StoreDTO storeDto = storeConnector.get("avatar",
                    (String) httpSession.getAttribute("temporaryAvatar"));
View Full Code Here

    private UserBaseWrapper userBaseWrapper;
    private UserService userService;

    @RequestMapping("profile-list")
    public String list(Model model) {
        UserBase userBase = userBaseManager.findUniqueBy("username",
                SpringSecurityUtils.getCurrentUsername());
        UserBaseWrapper userBaseWrapper = new UserBaseWrapper(userBase);
        model.addAttribute("model", userBase);
        model.addAttribute("userBaseWrapper", userBaseWrapper);
View Full Code Here

        Map<String, Object> parameters = ServletUtils
                .getParametersStartingWith(parameterMap, "_user_attr_");
        Long id = userBase.getId();

        // 再进行数据复制
        UserBase dest = null;

        if (id != null) {
            dest = userBaseManager.get(id);
            beanMapper.copy(userBase, dest);
            userService.updateUser(dest, userRepoId, parameters);
View Full Code Here

    @GET
    @Path("exists")
    @Produces(MediaType.APPLICATION_JSON)
    public boolean exists(@QueryParam("username") String username) {
        UserBase userBase = userBaseManager.findUniqueBy("username", username);

        return userBase != null;
    }
View Full Code Here

            return null;
        }

        try {
            UserBase userBase = userBaseManager.findUniqueBy("username",
                    username);

            BaseDTO result = new BaseDTO();

            if (userBase == null) {
View Full Code Here

    @Path("insert")
    @Produces(MediaType.APPLICATION_JSON)
    public BaseDTO insertUser(@FormParam("data") String data) {
        try {
            Map<String, Object> map = jsonMapper.fromJson(data, Map.class);
            UserBase userBase = jsonMapper.fromJson(data, UserBase.class);
            userService.insertUser(userBase, defaultUserRepoId, map);

            BaseDTO baseDto = new BaseDTO();
            baseDto.setCode(200);
View Full Code Here

TOP

Related Classes of com.mossle.user.persistence.domain.UserBase

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.