working on project settings update:
adding/updating members not implemented
This commit is contained in:
@@ -11,6 +11,7 @@ import static de.srsoftware.umbrella.core.ResponseCode.HTTP_NOT_IMPLEMENTED;
|
||||
import static de.srsoftware.umbrella.core.Util.mapValues;
|
||||
import static de.srsoftware.umbrella.core.exceptions.UmbrellaException.forbidden;
|
||||
import static de.srsoftware.umbrella.core.exceptions.UmbrellaException.missingFieldException;
|
||||
import static de.srsoftware.umbrella.project.Constants.PERMISSIONS;
|
||||
import static de.srsoftware.umbrella.task.Constants.*;
|
||||
|
||||
import com.sun.net.httpserver.HttpExchange;
|
||||
@@ -56,6 +57,7 @@ public class TaskModule extends BaseHandler implements TaskService {
|
||||
if (user.isEmpty()) return unauthorized(ex);
|
||||
var head = path.pop();
|
||||
return switch (head) {
|
||||
case PERMISSIONS -> getPermissionList(ex);
|
||||
case STATES -> getStateList(ex);
|
||||
default -> super.doGet(path,ex);
|
||||
};
|
||||
@@ -104,6 +106,12 @@ public class TaskModule extends BaseHandler implements TaskService {
|
||||
return sendContent(ex,result);
|
||||
}
|
||||
|
||||
private boolean getPermissionList(HttpExchange ex) throws IOException {
|
||||
var map = new HashMap<Integer,String>();
|
||||
for (var permission : Permission.values()) map.put(permission.code(),permission.name());
|
||||
return sendContent(ex,map);
|
||||
}
|
||||
|
||||
private boolean getStateList(HttpExchange ex) throws IOException {
|
||||
var map = new HashMap<Integer,String>();
|
||||
for (var status : Status.values()) map.put(status.code(),status.name());
|
||||
|
||||
Reference in New Issue
Block a user