forked from proxer/ProxerLibJava
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/TrueMB/ProxerLibJava
� Conflicts: � gradle/versions.gradle � gradle/wrapper/gradle-wrapper.properties � library/src/main/kotlin/me/proxer/library/internal/adapter/DelimitedEnumSetAdapterFactory.kt
- Loading branch information
Showing
35 changed files
with
774 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
library/src/main/kotlin/me/proxer/library/api/info/PersonEndpoint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package me.proxer.library.api.info | ||
|
||
import me.proxer.library.ProxerCall | ||
import me.proxer.library.api.Endpoint | ||
import me.proxer.library.entity.info.Person | ||
|
||
/** | ||
* Endpoint for retrieving all information of a [Person]. | ||
* | ||
* @author TrueMB | ||
*/ | ||
class PersonEndpoint internal constructor( | ||
private val internalApi: InternalApi, | ||
private val id: String | ||
) : Endpoint<Person> { | ||
|
||
override fun build(): ProxerCall<Person> { | ||
return internalApi.person(id) | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
library/src/main/kotlin/me/proxer/library/api/info/PersonsCoreEndpoint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package me.proxer.library.api.info | ||
|
||
import me.proxer.library.ProxerCall | ||
import me.proxer.library.api.Endpoint | ||
import me.proxer.library.entity.info.PersonCore | ||
|
||
/** | ||
* Endpoint for retrieving multiple [PersonCore] Objects for a medium entry. | ||
* | ||
* @author TrueMB | ||
*/ | ||
class PersonsCoreEndpoint internal constructor( | ||
private val internalApi: InternalApi, | ||
private val id: String | ||
) : Endpoint<List<PersonCore>> { | ||
|
||
override fun build(): ProxerCall<List<PersonCore>> { | ||
return internalApi.persons(id) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
library/src/main/kotlin/me/proxer/library/api/list/PersonSearchEndpoint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package me.proxer.library.api.list | ||
|
||
import me.proxer.library.ProxerCall | ||
import me.proxer.library.api.PagingLimitEndpoint | ||
import me.proxer.library.entity.list.PersonListEntry | ||
import me.proxer.library.enums.PersonDescriptionType | ||
|
||
/** | ||
* Endpoint for retrieving a list of Persons. Features various filter and uses paging. | ||
* | ||
* @author TrueMB | ||
*/ | ||
class PersonSearchEndpoint internal constructor( | ||
private val internalApi: InternalApi | ||
) : PagingLimitEndpoint<List<PersonListEntry>> { | ||
|
||
private var page: Int? = null | ||
private var limit: Int? = null | ||
|
||
private var searchStart: String? = null | ||
private var contains: String? = null | ||
private var search: String? = null | ||
private var subject: PersonDescriptionType? = null | ||
|
||
override fun page(page: Int?) = this.apply { this.page = page } | ||
override fun limit(limit: Int?) = this.apply { this.limit = limit } | ||
|
||
/** | ||
* Sets the query to search for only from the start. | ||
*/ | ||
fun searchStart(searchStart: String?) = this.apply { this.searchStart = searchStart } | ||
|
||
/** | ||
* Sets the contains String to search for. | ||
*/ | ||
fun contains(contains: String?) = this.apply { this.contains = contains } | ||
|
||
/** | ||
* Sets the query to search for. | ||
*/ | ||
fun search(search: String?) = this.apply { this.search = search } | ||
|
||
/** | ||
* Sets the subject (description) in which should be searched. (default: intro) | ||
*/ | ||
fun subject(subject: PersonDescriptionType?) = this.apply { this.subject = subject } | ||
|
||
override fun build(): ProxerCall<List<PersonListEntry>> { | ||
return internalApi.personList(searchStart, contains, search, subject, page, limit) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
library/src/main/kotlin/me/proxer/library/entity/info/CharacterCore.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package me.proxer.library.entity.info | ||
|
||
import com.squareup.moshi.Json | ||
import com.squareup.moshi.JsonClass | ||
import me.proxer.library.entity.ProxerIdItem | ||
import me.proxer.library.enums.Language | ||
import me.proxer.library.enums.OccupationType | ||
|
||
/** | ||
* Entity with basic Information from a Character. | ||
* | ||
* @property name The name. | ||
* @property type The type | ||
* @property language The language | ||
* | ||
* @author TrueMB | ||
*/ | ||
@JsonClass(generateAdapter = true) | ||
data class CharacterCore( | ||
@Json(name = "cid") override val id: String, | ||
@Json(name = "type") val type: OccupationType, | ||
@Json(name = "language") val language: Language, | ||
@Json(name = "name") val name: String | ||
) : ProxerIdItem |
20 changes: 20 additions & 0 deletions
20
library/src/main/kotlin/me/proxer/library/entity/info/CharacterDescription.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package me.proxer.library.entity.info | ||
|
||
import com.squareup.moshi.Json | ||
import com.squareup.moshi.JsonClass | ||
import me.proxer.library.enums.CharacterDescriptionType | ||
import me.proxer.library.enums.Language | ||
|
||
/** | ||
* Entity holding the description Info from [Character]. | ||
* | ||
* @property characterDescriptionType The description type | ||
* @property text The text to the description | ||
* @property language The language in which the text was written | ||
*/ | ||
@JsonClass(generateAdapter = true) | ||
data class CharacterDescription( | ||
@Json(name = "subject") val characterDescriptionType: CharacterDescriptionType, | ||
@Json(name = "text") val text: String, | ||
@Json(name = "language") val language: Language | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.