コード例 #1
0
  @Override
  public User createUser(User user) throws HttpException {
    Gson gson = getGsonWithAdapters();
    String responseJson =
        restClient.postForJson(openmrsInstance.toInstancePath("/user"), gson.toJson(user));

    return (User) JsonUtils.readJson(responseJson, User.class);
  }
コード例 #2
0
  @Override
  public UserListResult queryForUsersByUsername(String username) throws HttpException {
    String responseJson =
        restClient.getJson(
            openmrsInstance.toInstancePathWithParams("/user?q={username}&v=full", username));

    return (UserListResult) JsonUtils.readJson(responseJson, UserListResult.class);
  }
コード例 #3
0
 @Override
 public RoleListResult getAllRoles() throws HttpException {
   String responseJson = restClient.getJson(openmrsInstance.toInstancePath("/role?v=full"));
   return (RoleListResult) JsonUtils.readJson(responseJson, RoleListResult.class);
 }