Skip to content

Commit

Permalink
Add HoyoFeature.class to all feature class
Browse files Browse the repository at this point in the history
  • Loading branch information
zvyap committed May 11, 2023
1 parent a7aca0b commit fb33b6f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
11 changes: 11 additions & 0 deletions src/main/java/com/zvyap/hoyoapi/feature/HoyoFeature.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
package com.zvyap.hoyoapi.feature;

import com.zvyap.hoyoapi.HoyoverseAPI;

public class HoyoFeature {
protected final HoyoverseAPI api;

public HoyoFeature(HoyoverseAPI api) {
this.api = api;
}

public HoyoverseAPI getAPI() {
return api;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.zvyap.hoyoapi.exception.AlreadyCheckInException;
import com.zvyap.hoyoapi.exception.GameProfileNotFoundException;
import com.zvyap.hoyoapi.exception.HoyoverseHttpRequestException;
import com.zvyap.hoyoapi.feature.HoyoFeature;
import com.zvyap.hoyoapi.http.ContentType;
import com.zvyap.hoyoapi.http.HttpMethod;
import com.zvyap.hoyoapi.http.JsonBodyHandler;
Expand All @@ -24,12 +25,10 @@
import java.util.Map;
import java.util.function.Supplier;

public class DailyCheckInFeature {

private HoyoverseAPI api;
public class DailyCheckInFeature extends HoyoFeature {

public DailyCheckInFeature(HoyoverseAPI api) {
this.api = api;
super(api);
}

private <T> T fetchDailyEndpoint(HoyoToken token, HttpMethod method, GameType type, String endpoint, Class<T> responseClass) {
Expand Down

0 comments on commit fb33b6f

Please sign in to comment.