-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactored prompts, adding templating engine, added configuration opt…
…ions, refactored package names
- Loading branch information
Showing
81 changed files
with
1,053 additions
and
831 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
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
44 changes: 44 additions & 0 deletions
44
smallville/src/main/java/io/github/nickm980/smallville/Updater.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,44 @@ | ||
package io.github.nickm980.smallville; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import com.google.gson.Gson; | ||
import com.google.gson.JsonObject; | ||
import okhttp3.OkHttpClient; | ||
import okhttp3.Request; | ||
import okhttp3.Response; | ||
|
||
public class Updater { | ||
|
||
private static final String VERSION = "v1.0.0"; | ||
private final static Logger LOG = LoggerFactory.getLogger(Updater.class); | ||
|
||
private Updater() { | ||
|
||
} | ||
|
||
public static void checkLatestVersion() { | ||
OkHttpClient client = new OkHttpClient(); | ||
String url = "https://api.github.com/repos/nickm980/smallville/releases/latest"; | ||
Request request = new Request.Builder().url(url).build(); | ||
|
||
try { | ||
Response response = client.newCall(request).execute(); | ||
// Check if the request was successful | ||
if (response.isSuccessful()) { | ||
String body = response.body().string(); | ||
|
||
Gson gson = new Gson(); | ||
JsonObject jsonObject = gson.fromJson(body, JsonObject.class); | ||
String tag = jsonObject.get("tag_name").getAsString(); | ||
|
||
if (VERSION.compareTo(tag) < 0) { | ||
LOG.warn("Your version of smallville " + VERSION + " is outdated. Latest version: " + tag); | ||
} | ||
} | ||
} catch (Exception e) { | ||
LOG.debug(e.getStackTrace().toString()); | ||
} | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...mallville/api/server/ExceptionRoutes.java → ...km980/smallville/api/ExceptionRoutes.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
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
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
2 changes: 1 addition & 1 deletion
2
...80/smallville/api/AgentStateResponse.java → ...mallville/api/dto/AgentStateResponse.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
2 changes: 1 addition & 1 deletion
2
...80/smallville/api/AskQuestionRequest.java → ...mallville/api/dto/AskQuestionRequest.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
2 changes: 1 addition & 1 deletion
2
.../smallville/api/ConversationResponse.java → ...llville/api/dto/ConversationResponse.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package io.github.nickm980.smallville.api; | ||
package io.github.nickm980.smallville.api.dto; | ||
|
||
import java.util.Map; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...80/smallville/api/CreateAgentRequest.java → ...mallville/api/dto/CreateAgentRequest.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
2 changes: 1 addition & 1 deletion
2
...smallville/api/CreateLocationRequest.java → ...lville/api/dto/CreateLocationRequest.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
2 changes: 1 addition & 1 deletion
2
...0/smallville/api/CreateMemoryRequest.java → ...allville/api/dto/CreateMemoryRequest.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
2 changes: 1 addition & 1 deletion
2
...0/smallville/api/CreateObjectRequest.java → ...allville/api/dto/CreateObjectRequest.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
2 changes: 1 addition & 1 deletion
2
...smallville/api/LocationStateResponse.java → ...lville/api/dto/LocationStateResponse.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
2 changes: 1 addition & 1 deletion
2
...ckm980/smallville/api/MemoryResponse.java → ...80/smallville/api/dto/MemoryResponse.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
20 changes: 10 additions & 10 deletions
20
.../nickm980/smallville/api/ModelMapper.java → ...km980/smallville/api/dto/ModelMapper.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
14 changes: 14 additions & 0 deletions
14
smallville/src/main/java/io/github/nickm980/smallville/api/dto/SetGoalRequest.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,14 @@ | ||
package io.github.nickm980.smallville.api.dto; | ||
|
||
public class SetGoalRequest { | ||
|
||
private String goal; | ||
|
||
public String getGoal() { | ||
return goal; | ||
} | ||
|
||
public void setGoal(String goal) { | ||
this.goal = goal; | ||
} | ||
} |
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
Oops, something went wrong.