-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore: rename old addContext/request to addContext/notify
Signed-off-by: Daniel Hu <[email protected]>
- Loading branch information
1 parent
3863d21
commit affc7e1
Showing
4 changed files
with
45 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/main/java/ai/devchat/devchat/handler/AddContextNotifyHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package ai.devchat.devchat.handler; | ||
|
||
import ai.devchat.devchat.ActionHandler; | ||
import ai.devchat.devchat.DevChatActionHandler; | ||
import ai.devchat.devchat.DevChatActions; | ||
|
||
import com.alibaba.fastjson.JSONObject; | ||
|
||
public class AddContextNotifyHandler implements ActionHandler { | ||
private JSONObject metadata; | ||
private JSONObject payload; | ||
private final DevChatActionHandler devChatActionHandler; | ||
|
||
public final String RESPONSE_FUNC = "AddContextFromEditor"; | ||
|
||
public AddContextNotifyHandler(DevChatActionHandler devChatActionHandler) { | ||
this.devChatActionHandler = devChatActionHandler; | ||
} | ||
|
||
@Override | ||
public void executeAction() { | ||
devChatActionHandler.sendResponse(DevChatActions.ADD_CONTEXT_NOTIFY, RESPONSE_FUNC, (metadata, payload) -> { | ||
metadata.put("status", "success"); | ||
metadata.put("error", ""); | ||
|
||
payload.put("path", this.payload.getString("path")); | ||
payload.put("content", this.payload.getString("content")); | ||
payload.put("languageId", this.payload.getString("languageId")); | ||
payload.put("startLine", this.payload.getInteger("startLine")); | ||
}); | ||
} | ||
|
||
public void setMetadata(JSONObject metadata) { | ||
this.metadata = metadata; | ||
} | ||
|
||
public void setPayload(JSONObject payload) { | ||
this.payload = payload; | ||
} | ||
} |
32 changes: 0 additions & 32 deletions
32
src/main/java/ai/devchat/devchat/handler/AddContextRequestHandler.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters