added query params
This commit is contained in:
parent
7a6f95d466
commit
b7169b101c
|
@ -14,6 +14,7 @@ import javax.validation.Valid;
|
|||
import javax.validation.ValidationException;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.DefaultValue;
|
||||
import javax.ws.rs.GET;
|
||||
|
@ -156,9 +157,10 @@ public class Notifications {
|
|||
@ResponseCode ( code = 200, condition = "Users with silenced notifications are reported in the 'result' field of the returned object"),
|
||||
@ResponseCode ( code = 500, condition = ErrorMessages.ERROR_IN_API_RESULT)
|
||||
})
|
||||
@QueryParam("username")
|
||||
@AuthorizationControl(allowedRoles={INFRASTRUCTURE_MANAGER_ROLE}, exception=AuthException.class)
|
||||
public Response isUserDisabled(String usernameToCheck) throws ValidationException{
|
||||
public Response isUserDisabled(
|
||||
@QueryParam("usernameToCheck") @NotNull(message="username cannot be null") @Size(min=2, message="username cannot be empty")
|
||||
String usernameToCheck) throws ValidationException{
|
||||
ResponseBean responseBean = new ResponseBean();
|
||||
Status status = Status.OK;
|
||||
try{
|
||||
|
@ -192,9 +194,10 @@ public class Notifications {
|
|||
})
|
||||
@AuthorizationControl(allowedRoles={INFRASTRUCTURE_MANAGER_ROLE}, exception=AuthException.class)
|
||||
public Response setUserNotifications(
|
||||
@NotNull(message="input is missing")
|
||||
@Valid
|
||||
String username, boolean disable) throws ValidationException{
|
||||
@QueryParam("username") @NotNull(message="username cannot be null") @Size(min=2, message="username cannot be empty")
|
||||
String username,
|
||||
@QueryParam("disable") @NotNull(message="must specify the disable parameter")
|
||||
boolean disable) throws ValidationException{
|
||||
|
||||
Caller caller = AuthorizationProvider.instance.get();
|
||||
String context = ScopeProvider.instance.get();
|
||||
|
|
Loading…
Reference in New Issue