api docs update and order list users by user_id

This commit is contained in:
John Woodlock
2012-05-28 14:07:44 +10:00
parent c14a46a167
commit 74a94a09bc
3 changed files with 29 additions and 29 deletions
+23 -28
View File
@@ -3094,20 +3094,22 @@ No Request Body
<div class="method-section">
<div class="method-description">
<h4>Create new user</h4>
<p>Adds new application user to the platform.</p>
<p>Adds new application user.</p>
</div>
<div class="method-example">
<code class="method-declaration">POST https://thedomainname/api/v1/users</code>
<code class="method-request">POST https://localhost:8443/mifosng-provider/api/v1/users
Content-Type: application/json
Request body:
{
"officeId": 1,
"username": "newuser1",
"firstname": "Test",
"lastname": "User",
"email": "demomfi@mifos.org",
"selectedItems": ["1"]
{
"username": "Another New User zll",
"firstname": "Test",
"lastname": "User",
"password": "window75",
"repeatPassword": "window75f",
"email": "whatever@mifos.org",
"officeId": 1,
"roles": ["2","3"]
}
</code>
<code class="method-response">
@@ -3122,25 +3124,20 @@ Request body:
<div class="method-section">
<div class="method-description">
<h4>Update existing user</h4>
<p>Update details of an existing application user.</p>
</div>
<div class="method-example">
<code class="method-declaration">PUT https://thedomainname/api/v1/users/11</code>
<code class="method-request">PUT https://localhost:8443/mifosng-provider/api/v1/users/11
<code class="method-declaration">PUT https://thedomainname/api/v1/users/{userId)</code>
<code class="method-request">PUT https://localhost:8443/mifosng-provider/api/v1/users/3
Content-Type: application/json
Request body:
{
"officeId": 1,
"username": "newuser123",
"firstname": "Test",
"lastname": "User",
"email": "demomfi@mifos.org",
"selectedItems": ["1"]
Request body:{
"firstname": "Test",
"roles": ["2"]
}
</code>
<code class="method-response">
{
"entityId": 11
"entityId": 3
}
</code>
</div>
@@ -3149,18 +3146,16 @@ Request body:
<a id="users_delete" name="users_delete" class="old-syle-anchor">&nbsp;</a>
<div class="method-section">
<div class="method-description">
<h4>Delete existing user</h4>
<p>Delete reference to application user on platform.</p>
<h4>Delete a User</h4>
<p>Removes the user and the associated roles and permissions.</p>
</div>
<div class="method-example">
<code class="method-declaration">DELETE https://thedomainname/api/v1/users/11</code>
<code class="method-request">DELETE https://localhost:8443/mifosng-provider/api/v1/users/11
<code class="method-declaration">DELETE https://thedomainname/api/v1/users/{userId}</code>
<code class="method-request">DELETE https://localhost:8443/mifosng-provider/api/v1/users/20
Content-Type: application/json
No Request Body
</code>
<code class="method-response">
{
"entityId": 11
}
<code class="method-response">Question outstanding
</code>
</div>
</div>
+5
View File
@@ -19,4 +19,9 @@ hierarchy update results in exception (prob solved by using unrecognized parame
Users
template: allowedOffices (only id 1 came back)... does allowedOffices and available Roles depending on requested permissions?
Retrieve a user: selectedRoles- possible json prob availablePermissions is blank... is it always?
create new user... didn't check repeatPassword (see example in docs) but does in update
and msg shown on duplicate username isn't useful.
takes 4/5 seconds!
update: give hardtofigureout error msg when using equivalent to create parameters...worked ok with ones in docs tho.
delete: does delete (I delete super1), no 200 ok returned, "org.springframework.dao.InvalidDataAccessApiUsageException: attempt to create merge event with null entity; " if delete a non-existant user
@@ -58,7 +58,7 @@ public class AppUserReadPlatformServiceImpl implements AppUserReadPlatformServic
AppUserMapper mapper = new AppUserMapper(offices);
String sql = "select " + mapper.schema()
+ " where u.org_id = ? and u.office_id in (" + officeIdsList
+ ")";
+ ") order by u.id";
return this.jdbcTemplate.query(sql, mapper, new Object[] { currentUser
.getOrganisation().getId() });