Skip to content

Commit

Permalink
Fix the api & help to prevent captcha
Browse files Browse the repository at this point in the history
  • Loading branch information
zvyap committed Aug 31, 2023
1 parent 531671f commit 6bb0978
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,22 @@ public static class Data{
@JsonProperty("first_bind")
private boolean isFirstBind;

public boolean isSub(){
@JsonProperty("month_last_day")
private boolean isMonthLastDay;

public boolean isMonthLastDay() {
return isMonthLastDay;
}

public boolean isSub() {
return isSub;
}

public String getToday(){
public String getToday() {
return today;
}

public int getShortSignDay(){
public int getShortSignDay() {
return shortSignDay;
}

Expand All @@ -82,15 +89,16 @@ public int getTotalSignDay(){
@Override
public String toString(){
return
"Data{" +
"is_sub = '" + isSub + '\'' +
",today = '" + today + '\'' +
",short_sign_day = '" + shortSignDay + '\'' +
",sign_cnt_missed = '" + signCntMissed + '\'' +
",region = '" + region + '\'' +
",is_sign = '" + isSign + '\'' +
",total_sign_day = '" + totalSignDay + '\'' +
"}";
"Data{" +
"is_sub = '" + isSub + '\'' +
",today = '" + today + '\'' +
",short_sign_day = '" + shortSignDay + '\'' +
",sign_cnt_missed = '" + signCntMissed + '\'' +
",region = '" + region + '\'' +
",is_sign = '" + isSign + '\'' +
",total_sign_day = '" + totalSignDay + '\'' +
",month_last_day = '" + isMonthLastDay + '\'' +
"}";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,20 @@ public Data getData(){
}

@Override
public String toString(){
return
"HoyoDailyCheckInSignResponse{" +
"data = '" + data + '\'' +
",message = '" + message + '\'' +
",retcode = '" + retcode + '\'' +
"}";
}
public String toString() {
return
"HoyoDailyCheckInSignResponse{" +
"data = '" + data + '\'' +
",message = '" + message + '\'' +
",retcode = '" + retcode + '\'' +
"}";
}

public boolean isCaptcha() {
return isSuccess() ? getData().isRisk() : false;
}

public static class Data{
public static class Data {

@JsonProperty("gt_result")
private GtResult gtResult;
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/zvyap/hoyoapi/util/JsonUtils.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.zvyap.hoyoapi.util;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
Expand All @@ -9,6 +10,10 @@
public class JsonUtils {
public static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();

static {
OBJECT_MAPPER.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}

@NotNull
public static ObjectMapper getObjectMapper() {
return OBJECT_MAPPER;
Expand Down

0 comments on commit 6bb0978

Please sign in to comment.