Commit 0d8c0f07 authored by fallenstardust's avatar fallenstardust Committed by GitHub

Merge pull request #206 from jwyxym/online-deck-id

增加在线卡组id检测
parents d47d4d5e dc24cce4
...@@ -135,6 +135,7 @@ public class DeckSquareApiUtil { ...@@ -135,6 +135,7 @@ public class DeckSquareApiUtil {
String responseBodyString = response.body().string(); String responseBodyString = response.body().string();
Gson gson = new Gson(); Gson gson = new Gson();
result = gson.fromJson(responseBodyString, MyDeckResponse.class); result = gson.fromJson(responseBodyString, MyDeckResponse.class);
result.chkId();
if (result.code == 20) {//用户身份验证失败 if (result.code == 20) {//用户身份验证失败
......
...@@ -45,5 +45,19 @@ public class MyDeckResponse { ...@@ -45,5 +45,19 @@ public class MyDeckResponse {
this.data = data; this.data = data;
} }
public void chkId() {
for (MyOnlineDeckDetail item : this.data) {
String ydk = item.getDeckYdk();
String contains;
contains = "##" + item.getDeckId();
if (!ydk.contains(contains))
ydk += "\n" + contains;
contains = "###" + item.getUserId();
if (!ydk.contains(contains))
ydk += "\n" + contains;
item.setDeckYdk(ydk);
}
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment