-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
Signed-off-by: zhiheng123 <903292776@qq.com>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package io.github.protocol.mtconnect.server; | ||
|
||
|
||
public interface MtHandler { | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package io.github.protocol.mtconnect.server; | ||
|
||
|
||
|
||
public class MtHandlerImpl implements MtHandler { | ||
Check warning on line 5 in mtconnect-server/src/main/java/io/github/protocol/mtconnect/server/MtHandlerImpl.java Codecov / codecov/patchmtconnect-server/src/main/java/io/github/protocol/mtconnect/server/MtHandlerImpl.java#L5
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package io.github.protocol.mtconnect.server; | ||
|
||
import io.github.shoothzj.http.facade.core.HttpRequest; | ||
import io.github.shoothzj.http.facade.core.HttpResponse; | ||
import io.github.shoothzj.http.facade.server.RequestHandler; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.concurrent.CompletableFuture; | ||
|
||
@Getter | ||
@Setter | ||
public class MtRequestProcessor implements RequestHandler { | ||
private MtConnectServerConfiguration serverCfg; | ||
|
||
private Map<String, MtHandler> handlerMap = new HashMap<>(); | ||
Check warning on line 18 in mtconnect-server/src/main/java/io/github/protocol/mtconnect/server/MtRequestProcessor.java Codecov / codecov/patchmtconnect-server/src/main/java/io/github/protocol/mtconnect/server/MtRequestProcessor.java#L18
|
||
|
||
public MtRequestProcessor(MtConnectServerConfiguration serverCfg) { | ||
this.serverCfg = serverCfg; | ||
Check warning on line 21 in mtconnect-server/src/main/java/io/github/protocol/mtconnect/server/MtRequestProcessor.java Codecov / codecov/patchmtconnect-server/src/main/java/io/github/protocol/mtconnect/server/MtRequestProcessor.java#L20-L21
|
||
|
||
handlerMap.put("/asset", new MtHandlerImpl()); | ||
handlerMap.put("/current", new MtHandlerImpl()); | ||
} | ||
Check warning on line 25 in mtconnect-server/src/main/java/io/github/protocol/mtconnect/server/MtRequestProcessor.java Codecov / codecov/patchmtconnect-server/src/main/java/io/github/protocol/mtconnect/server/MtRequestProcessor.java#L23-L25
|
||
|
||
@Override | ||
public CompletableFuture<HttpResponse> handle(HttpRequest request) { | ||
return null; | ||
Check warning on line 29 in mtconnect-server/src/main/java/io/github/protocol/mtconnect/server/MtRequestProcessor.java Codecov / codecov/patchmtconnect-server/src/main/java/io/github/protocol/mtconnect/server/MtRequestProcessor.java#L29
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package io.github.protocol.mtconnect.server; | ||
|
||
class MtConnectServerTest { | ||
} |