loading tasks

This commit is contained in:
2025-07-26 22:56:40 +02:00
parent 91aa421ae9
commit 6599b08990
10 changed files with 177 additions and 18 deletions

View File

@@ -4,6 +4,7 @@ package de.srsoftware.umbrella.project;
import static de.srsoftware.umbrella.core.ConnectionProvider.connect;
import static de.srsoftware.umbrella.core.Constants.*;
import static de.srsoftware.umbrella.core.Paths.LIST;
import static de.srsoftware.umbrella.core.Paths.STATES;
import static de.srsoftware.umbrella.core.Util.mapValues;
import static de.srsoftware.umbrella.core.exceptions.UmbrellaException.*;
import static de.srsoftware.umbrella.core.model.Permission.*;
@@ -65,7 +66,11 @@ public class ProjectModule extends BaseHandler implements ProjectService {
default -> {
var projectId = Long.parseLong(head);
head = path.pop();
yield head == null ? getProject(ex,projectId,user.get()) : super.doGet(path,ex);
yield switch (head) {
case null -> getProject(ex, projectId, user.get());
case STATES -> getStateList(ex);
default -> super.doGet(path, ex);
};
}
};
} catch (UmbrellaException e){
@@ -128,6 +133,12 @@ public class ProjectModule extends BaseHandler implements ProjectService {
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());
return sendContent(ex,map);
}
public Map<Long, Project> listCompanyProjects(long companyId, boolean includeClosed) throws UmbrellaException {
var projectList = projects.ofCompany(companyId, includeClosed);
loadMembers(projectList.values());