This repository has been archived by the owner on Aug 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for searching threads and nodes
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
- Loading branch information
1 parent
8444d54
commit 62d008f
Showing
12 changed files
with
255 additions
and
42 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
8 changes: 8 additions & 0 deletions
8
app/src/main/java/io/aayush/relabs/network/data/search/Order.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,8 @@ | ||
package io.aayush.relabs.network.data.search | ||
|
||
enum class Order(val value: String) { | ||
RELEVANCE("relevance"), | ||
DATE("date"), | ||
MOST_RECENT("last_update"), | ||
MOST_REPLIES("replies") | ||
} |
5 changes: 5 additions & 0 deletions
5
app/src/main/java/io/aayush/relabs/network/data/search/PostSearch.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,5 @@ | ||
package io.aayush.relabs.network.data.search | ||
|
||
data class PostSearch( | ||
val search: Search = Search() | ||
) |
12 changes: 12 additions & 0 deletions
12
app/src/main/java/io/aayush/relabs/network/data/search/Search.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,12 @@ | ||
package io.aayush.relabs.network.data.search | ||
|
||
import io.aayush.relabs.network.data.common.DateTime | ||
|
||
data class Search( | ||
val created_at: DateTime = DateTime(), | ||
val id: Int = 0, | ||
val result_count: Int = 0, | ||
val search_constraints: List<String> = emptyList(), | ||
val search_order: String = String(), | ||
val search_type: String = String() | ||
) |
6 changes: 6 additions & 0 deletions
6
app/src/main/java/io/aayush/relabs/network/data/search/SearchConstraints.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,6 @@ | ||
package io.aayush.relabs.network.data.search | ||
|
||
data class SearchConstraints( | ||
val container_only: Int = 0, | ||
val title_only: Int = 0 | ||
) |
10 changes: 10 additions & 0 deletions
10
app/src/main/java/io/aayush/relabs/network/data/search/SearchResultNode.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,10 @@ | ||
package io.aayush.relabs.network.data.search | ||
|
||
import io.aayush.relabs.network.data.common.Pagination | ||
import io.aayush.relabs.network.data.node.Node | ||
|
||
data class SearchResultNode( | ||
val search: Search = Search(), | ||
val results: List<Node> = emptyList(), | ||
val pagination: Pagination = Pagination() | ||
) |
10 changes: 10 additions & 0 deletions
10
app/src/main/java/io/aayush/relabs/network/data/search/SearchResultThread.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,10 @@ | ||
package io.aayush.relabs.network.data.search | ||
|
||
import io.aayush.relabs.network.data.common.Pagination | ||
import io.aayush.relabs.network.data.thread.Thread | ||
|
||
data class SearchResultThread( | ||
val search: Search = Search(), | ||
val results: List<Thread> = emptyList(), | ||
val pagination: Pagination = Pagination() | ||
) |
6 changes: 6 additions & 0 deletions
6
app/src/main/java/io/aayush/relabs/network/data/search/Type.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,6 @@ | ||
package io.aayush.relabs.network.data.search | ||
|
||
enum class Type(val value: String) { | ||
NODE("node"), | ||
THREAD("post") | ||
} |
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.