修复FastJSON大版本更新后API变动
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
package com.yutou.qqbot.models.setu;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.yutou.qqbot.QQBotManager;
|
||||
import com.yutou.qqbot.interfaces.DownloadInterface;
|
||||
import com.yutou.qqbot.models.Model;
|
||||
@@ -64,7 +65,7 @@ public class GetSeTu extends Model {
|
||||
redis.close();
|
||||
MessageChainBuilder builder = null;
|
||||
if (!StringUtils.isEmpty(ret)) {
|
||||
JSONArray array = JSONArray.parseArray(ret);
|
||||
JSONArray array = JSON.parseArray(ret);
|
||||
builder = new MessageChainBuilder();
|
||||
builder.append("各位老色胚们晚上好,现在公布本群涩图数据!");
|
||||
builder.append("\n");
|
||||
@@ -147,7 +148,7 @@ public class GetSeTu extends Model {
|
||||
String redis = RedisTools.get("Setu_" + qq);
|
||||
JSONArray array = new JSONArray();
|
||||
if (!StringUtils.isEmpty(redis)) {
|
||||
array = JSONArray.parseArray(redis);
|
||||
array = JSON.parseArray(redis);
|
||||
}
|
||||
array.add(data);
|
||||
RedisTools.set("Setu_" + qq, array.toString());
|
||||
@@ -182,7 +183,7 @@ public class GetSeTu extends Model {
|
||||
}
|
||||
System.out.println("url = " + url);
|
||||
String ret = HttpTools.get(url);
|
||||
JSONObject json = JSONObject.parseObject(ret);
|
||||
JSONObject json = JSON.parseObject(ret);
|
||||
if (json.getJSONArray("data").size() == 0) {
|
||||
return false;
|
||||
}
|
||||
@@ -194,7 +195,7 @@ public class GetSeTu extends Model {
|
||||
builder.append(item.getInteger("pid"));
|
||||
builder.append("\n");
|
||||
builder.append("R18:");
|
||||
if (item.getBoolean("r18")) {
|
||||
if (item.getBooleanValue("r18")) {
|
||||
builder.append("YES!");
|
||||
} else {
|
||||
builder.append("NO~");
|
||||
|
||||
@@ -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