Package com.mossle.core.util

Examples of com.mossle.core.util.BaseDTO


    public BaseDTO unreadCount() {
        String userId = SpringSecurityUtils.getCurrentUserId();
        Integer count = msgInfoManager.getCount(
                "select count(*) from MsgInfo where receiverId=? and status=0",
                userId);
        BaseDTO result = new BaseDTO();
        result.setData(count);

        return result;
    }
View Full Code Here


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

            BaseDTO result = new BaseDTO();

            if (userBase == null) {
                logger.error("user is not exists : [{}]", username);
                result.setCode(404);
                result.setMessage("user is not exists : [" + username + "]");

                return result;
            }

            UserBaseWrapper userBaseWrapper = new UserBaseWrapper(userBase);

            result.setCode(200);
            result.setData(userBaseWrapper.toMap());

            return result;
        } catch (Exception ex) {
            logger.error(ex.getMessage(), ex);

            BaseDTO result = new BaseDTO();
            result.setCode(500);
            result.setMessage(ex.getMessage());

            return result;
        }
    }
View Full Code Here

        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);

            return baseDto;
        } catch (Exception ex) {
            logger.error(ex.getMessage(), ex);

            BaseDTO baseDto = new BaseDTO();
            baseDto.setCode(500);
            baseDto.setMessage(ex.getMessage());

            return baseDto;
        }
    }
View Full Code Here

        try {
            Map<String, Object> map = jsonMapper.fromJson(data, Map.class);
            UserBase userBase = jsonMapper.fromJson(data, UserBase.class);
            userService.updateUser(userBase, defaultUserRepoId, map);

            BaseDTO baseDto = new BaseDTO();
            baseDto.setCode(200);

            return baseDto;
        } catch (Exception ex) {
            logger.error(ex.getMessage(), ex);

            BaseDTO baseDto = new BaseDTO();
            baseDto.setCode(500);
            baseDto.setMessage(ex.getMessage());

            return baseDto;
        }
    }
View Full Code Here

TOP

Related Classes of com.mossle.core.util.BaseDTO

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.