修复FastJSON大版本更新后API变动
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
package com.yutou.qqbot.models.setu;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
|
||||
import com.yutou.qqbot.Annotations.UseModel;
|
||||
import com.yutou.qqbot.QQBotManager;
|
||||
@@ -35,8 +36,8 @@ public class QQSetu extends Model {
|
||||
Log.i("今日涩图 redisKey = " + redisKey);
|
||||
String js = RedisTools.get(redisKey, db_print);
|
||||
if (js != null) {
|
||||
JSONObject json = JSONObject.parseObject(js);
|
||||
if(json.containsKey("isPrint")&&json.getBoolean("isPrint")){
|
||||
JSONObject json = JSON.parseObject(js);
|
||||
if(json.containsKey("isPrint")&&json.getBooleanValue("isPrint")){
|
||||
return;
|
||||
}
|
||||
Map<String,Float> groupAverage=new HashMap<>();
|
||||
@@ -128,7 +129,7 @@ public class QQSetu extends Model {
|
||||
}
|
||||
|
||||
private void printSetu(long group) {
|
||||
JSONObject jt = JSONObject.parseObject(RedisTools.get(group+"setu", db_user));
|
||||
JSONObject jt = JSON.parseObject(RedisTools.get(group+"setu", db_user));
|
||||
String id = jt.getString("id");
|
||||
float average = 0;
|
||||
float max = 0;
|
||||
@@ -169,7 +170,7 @@ public class QQSetu extends Model {
|
||||
if (st == null) {
|
||||
json = new JSONObject();
|
||||
} else {
|
||||
json = JSONObject.parseObject(st);
|
||||
json = JSON.parseObject(st);
|
||||
}
|
||||
if (!json.containsKey(id)) {
|
||||
JSONObject item;
|
||||
|
||||
Reference in New Issue
Block a user