Package org.springside.examples.miniservice.ws.result

Examples of org.springside.examples.miniservice.ws.result.CreateUserResult.buildResult()


      Assert.notNull(user, "用户参数为空");
      Assert.hasText(user.getLoginName(), "新建用户登录名参数为空");
      Assert.isNull(user.getId(), "新建用户ID参数必须为空");
    } catch (IllegalArgumentException e) {
      logger.error(e.getMessage());
      return result.buildResult(WSResult.PARAMETER_ERROR, e.getMessage());
    }

    //保存用户
    try {
      User userEntity = dozer.map(user, User.class);
View Full Code Here


      result.setUserId(userEntity.getId());
      return result;
    } catch (ConstraintViolationException e) {
      String message = "新建用户参数存在唯一性冲突(用户:" + user + ")";
      logger.error(message, e);
      return result.buildResult(WSResult.PARAMETER_ERROR, message);
    } catch (RuntimeException e) {
      logger.error(e.getMessage(), e);
      return result.buildDefaultErrorResult();
    }
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.