Skip to content
This repository was archived by the owner on Apr 9, 2024. It is now read-only.

Commit 954cf72

Browse files
committed
Added creator codes endpoints
1 parent 843a187 commit 954cf72

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

com/thoo/api/FortniteAPI.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ class FortniteAPI constructor(val key: String) {
6262

6363
fun getNewsCreative(language: Language): BaseResponse<NewsTab>? = service?.getNewsCreative(language.toString().toLowerCase())?.execute()?.body();
6464

65+
fun getCreator(slug: String): BaseResponse<CreatorCode>? = service?.getCreator(slug)?.execute()?.body()
66+
67+
fun getMatchingCreator(slug: String): BaseResponse<CreatorCode>? = service?.getMatchingCreator(slug)?.execute()?.body()
68+
69+
fun getMatchingCreators(slug: String): BaseResponse<Array<CreatorCode>>? = service?.getMatchingCreators(slug)?.execute()?.body()
70+
6571
fun getMatchedCosmetics(matchBuilder: MatchBuilder): BaseResponse<Array<BRCosmeticData>>? {
6672
val fields: Array<Field> = matchBuilder.javaClass.declaredFields
6773
val queryMapString: HashMap<String, String> = HashMap()

com/thoo/api/model/CreatorCode.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.thoo.api.model
2+
3+
class CreatorCode {
4+
5+
val id: String = ""
6+
val slug: String = ""
7+
val displayName: String = ""
8+
val status: String = ""
9+
val verified: Boolean = false
10+
11+
}

com/thoo/api/service/FortniteAPIService.kt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ import retrofit2.http.GET
66
import retrofit2.http.Path
77
import retrofit2.http.Query
88
import retrofit2.http.QueryMap
9-
import okhttp3.ResponseBody
10-
11-
129

1310
interface FortniteAPIService {
1411

@@ -65,4 +62,13 @@ interface FortniteAPIService {
6562

6663
@GET("/cosmetics/br/search/all")
6764
fun matchCosmetics(@QueryMap map: Map<String, String>, @QueryMap map2: Map<String, Boolean>, @Query("language") language: String): Call<BaseResponse<Array<BRCosmeticData>>>
65+
66+
@GET("creatorcode")
67+
fun getCreator(@Query("slug") slug: String): Call<BaseResponse<CreatorCode>>
68+
69+
@GET("creatorcode/search")
70+
fun getMatchingCreator(@Query("slug") slug: String): Call<BaseResponse<CreatorCode>>
71+
72+
@GET("creatorcode/search/all")
73+
fun getMatchingCreators(@Query("slug") slug: String): Call<BaseResponse<Array<CreatorCode>>>
6874
}

0 commit comments

Comments
 (0)