api docs update and order list users by user_id
This commit is contained in:
+23
-28
@@ -3094,20 +3094,22 @@ No Request Body
|
|||||||
<div class="method-section">
|
<div class="method-section">
|
||||||
<div class="method-description">
|
<div class="method-description">
|
||||||
<h4>Create new user</h4>
|
<h4>Create new user</h4>
|
||||||
<p>Adds new application user to the platform.</p>
|
<p>Adds new application user.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="method-example">
|
<div class="method-example">
|
||||||
<code class="method-declaration">POST https://thedomainname/api/v1/users</code>
|
<code class="method-declaration">POST https://thedomainname/api/v1/users</code>
|
||||||
<code class="method-request">POST https://localhost:8443/mifosng-provider/api/v1/users
|
<code class="method-request">POST https://localhost:8443/mifosng-provider/api/v1/users
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
Request body:
|
Request body:
|
||||||
{
|
{
|
||||||
"officeId": 1,
|
"username": "Another New User zll",
|
||||||
"username": "newuser1",
|
"firstname": "Test",
|
||||||
"firstname": "Test",
|
"lastname": "User",
|
||||||
"lastname": "User",
|
"password": "window75",
|
||||||
"email": "demomfi@mifos.org",
|
"repeatPassword": "window75f",
|
||||||
"selectedItems": ["1"]
|
"email": "whatever@mifos.org",
|
||||||
|
"officeId": 1,
|
||||||
|
"roles": ["2","3"]
|
||||||
}
|
}
|
||||||
</code>
|
</code>
|
||||||
<code class="method-response">
|
<code class="method-response">
|
||||||
@@ -3122,25 +3124,20 @@ Request body:
|
|||||||
<div class="method-section">
|
<div class="method-section">
|
||||||
<div class="method-description">
|
<div class="method-description">
|
||||||
<h4>Update existing user</h4>
|
<h4>Update existing user</h4>
|
||||||
<p>Update details of an existing application user.</p>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="method-example">
|
<div class="method-example">
|
||||||
<code class="method-declaration">PUT https://thedomainname/api/v1/users/11</code>
|
<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/11
|
<code class="method-request">PUT https://localhost:8443/mifosng-provider/api/v1/users/3
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
Request body:
|
Request body:{
|
||||||
{
|
"firstname": "Test",
|
||||||
"officeId": 1,
|
"roles": ["2"]
|
||||||
"username": "newuser123",
|
|
||||||
"firstname": "Test",
|
|
||||||
"lastname": "User",
|
|
||||||
"email": "demomfi@mifos.org",
|
|
||||||
"selectedItems": ["1"]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</code>
|
</code>
|
||||||
<code class="method-response">
|
<code class="method-response">
|
||||||
{
|
{
|
||||||
"entityId": 11
|
"entityId": 3
|
||||||
}
|
}
|
||||||
</code>
|
</code>
|
||||||
</div>
|
</div>
|
||||||
@@ -3149,18 +3146,16 @@ Request body:
|
|||||||
<a id="users_delete" name="users_delete" class="old-syle-anchor"> </a>
|
<a id="users_delete" name="users_delete" class="old-syle-anchor"> </a>
|
||||||
<div class="method-section">
|
<div class="method-section">
|
||||||
<div class="method-description">
|
<div class="method-description">
|
||||||
<h4>Delete existing user</h4>
|
<h4>Delete a User</h4>
|
||||||
<p>Delete reference to application user on platform.</p>
|
<p>Removes the user and the associated roles and permissions.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="method-example">
|
<div class="method-example">
|
||||||
<code class="method-declaration">DELETE https://thedomainname/api/v1/users/11</code>
|
<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/11
|
<code class="method-request">DELETE https://localhost:8443/mifosng-provider/api/v1/users/20
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
|
No Request Body
|
||||||
</code>
|
</code>
|
||||||
<code class="method-response">
|
<code class="method-response">Question outstanding
|
||||||
{
|
|
||||||
"entityId": 11
|
|
||||||
}
|
|
||||||
</code>
|
</code>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -19,4 +19,9 @@ hierarchy update results in exception (prob solved by using unrecognized parame
|
|||||||
Users
|
Users
|
||||||
template: allowedOffices (only id 1 came back)... does allowedOffices and available Roles depending on requested permissions?
|
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?
|
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
|
||||||
+1
-1
@@ -58,7 +58,7 @@ public class AppUserReadPlatformServiceImpl implements AppUserReadPlatformServic
|
|||||||
AppUserMapper mapper = new AppUserMapper(offices);
|
AppUserMapper mapper = new AppUserMapper(offices);
|
||||||
String sql = "select " + mapper.schema()
|
String sql = "select " + mapper.schema()
|
||||||
+ " where u.org_id = ? and u.office_id in (" + officeIdsList
|
+ " where u.org_id = ? and u.office_id in (" + officeIdsList
|
||||||
+ ")";
|
+ ") order by u.id";
|
||||||
|
|
||||||
return this.jdbcTemplate.query(sql, mapper, new Object[] { currentUser
|
return this.jdbcTemplate.query(sql, mapper, new Object[] { currentUser
|
||||||
.getOrganisation().getId() });
|
.getOrganisation().getId() });
|
||||||
|
|||||||
Reference in New Issue
Block a user