update
This commit is contained in:
parent
a317767ae7
commit
9b70685949
@ -30,12 +30,13 @@ public class ApplicationInit implements ApplicationRunner {
|
|||||||
if (time.equals(oldTime)) {
|
if (time.equals(oldTime)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
BaiduGPTManager.getManager().clear();
|
||||||
oldTime = time;
|
oldTime = time;
|
||||||
for (Class<?> model : Model.classList) {
|
for (Class<?> model : Model.classList) {
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
try {
|
try {
|
||||||
Bot bot = QQBotManager.getInstance().getBot();
|
Bot bot = QQBotManager.getInstance().getBot();
|
||||||
if(bot==null){
|
if (bot == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Model useModel = (Model) model.getDeclaredConstructor().newInstance();
|
Model useModel = (Model) model.getDeclaredConstructor().newInstance();
|
||||||
|
@ -63,6 +63,10 @@ public class BaiduGPTManager {
|
|||||||
String post = HttpTools.post(url + "?access_token=" + getToken()
|
String post = HttpTools.post(url + "?access_token=" + getToken()
|
||||||
, json.toJSONString().getBytes(StandardCharsets.UTF_8));
|
, json.toJSONString().getBytes(StandardCharsets.UTF_8));
|
||||||
System.out.println("post = " + post);
|
System.out.println("post = " + post);
|
||||||
|
if(StringUtils.isEmpty(post)){
|
||||||
|
clear();
|
||||||
|
return sendMessage(user, message);
|
||||||
|
}
|
||||||
ResponseMessage response = JSONObject.parseObject(post, ResponseMessage.class);
|
ResponseMessage response = JSONObject.parseObject(post, ResponseMessage.class);
|
||||||
messages.add(Message.create(response.getResult(), true));
|
messages.add(Message.create(response.getResult(), true));
|
||||||
msgMap.put(user, messages);
|
msgMap.put(user, messages);
|
||||||
|
Loading…
Reference in New Issue
Block a user