preparing document module
This commit is contained in:
5
documents/build.gradle.kts
Normal file
5
documents/build.gradle.kts
Normal file
@@ -0,0 +1,5 @@
|
||||
description = "Umbrella : Documents"
|
||||
|
||||
dependencies{
|
||||
implementation(project(":core"))
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/* © SRSoftware 2025 */
|
||||
package de.srsoftware.umbrella.documents;
|
||||
|
||||
public class Constants {
|
||||
private Constants(){}
|
||||
|
||||
public static final String COMPANIES = "companies";
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
/* © SRSoftware 2025 */
|
||||
package de.srsoftware.umbrella.documents;
|
||||
|
||||
import static de.srsoftware.umbrella.core.ResponseCode.HTTP_NOT_IMPLEMENTED;
|
||||
import static de.srsoftware.umbrella.documents.Constants.COMPANIES;
|
||||
|
||||
import com.sun.net.httpserver.HttpExchange;
|
||||
import de.srsoftware.tools.Path;
|
||||
import de.srsoftware.umbrella.core.BaseHandler;
|
||||
import java.io.IOException;
|
||||
|
||||
public class DocumentApi extends BaseHandler {
|
||||
@Override
|
||||
public boolean doGet(Path path, HttpExchange ex) throws IOException {
|
||||
addCors(ex);
|
||||
var head = path.pop();
|
||||
return switch (head){
|
||||
case COMPANIES -> getCompanies(ex);
|
||||
case null, default -> super.doGet(path,ex);
|
||||
};
|
||||
}
|
||||
|
||||
private boolean getCompanies(HttpExchange ex) throws IOException {
|
||||
return sendEmptyResponse(HTTP_NOT_IMPLEMENTED,ex);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user