-
Notifications
You must be signed in to change notification settings - Fork 521
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce a simulated GAE proto endpoint.
This 'simulates' the eventual endpoint that will be added to Oppia web by using internal compatibility checking, proto conversion, and the GAE/GCS JSON endpoints currently available via Oppia web.
- Loading branch information
1 parent
50080af
commit 0d03b75
Showing
3 changed files
with
937 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
scripts/src/java/org/oppia/android/scripts/gae/BUILD.bazel
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,36 @@ | ||
""" | ||
Library for providing access to Oppia's HTTP endpoints. | ||
""" | ||
|
||
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library") | ||
|
||
kt_jvm_library( | ||
name = "gae", | ||
testonly = True, | ||
srcs = [ | ||
"GaeAndroidEndpoint.kt", | ||
], | ||
visibility = ["//scripts:oppia_script_library_visibility"], | ||
deps = [ | ||
"//third_party:oppia_proto_api_java_protos", | ||
"//third_party:org_jetbrains_kotlinx_kotlinx-coroutines-core", | ||
], | ||
) | ||
|
||
kt_jvm_library( | ||
name = "gae_json_impl", | ||
testonly = True, | ||
srcs = [ | ||
"GaeAndroidEndpointJsonImpl.kt", | ||
], | ||
visibility = ["//scripts:oppia_script_library_visibility"], | ||
deps = [ | ||
":gae", | ||
"//scripts/src/java/org/oppia/android/scripts/gae/compat", | ||
"//scripts/src/java/org/oppia/android/scripts/gae/json:api", | ||
"//scripts/src/java/org/oppia/android/scripts/gae/json:model", | ||
"//scripts/src/java/org/oppia/android/scripts/gae/proto:json_to_proto_converter", | ||
"//third_party:oppia_proto_api_java_protos", | ||
"//third_party:org_jetbrains_kotlinx_kotlinx-coroutines-core", | ||
], | ||
) |
19 changes: 19 additions & 0 deletions
19
scripts/src/java/org/oppia/android/scripts/gae/GaeAndroidEndpoint.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,19 @@ | ||
package org.oppia.android.scripts.gae | ||
|
||
import kotlinx.coroutines.Deferred | ||
import org.oppia.proto.v1.api.TopicContentRequestDto | ||
import org.oppia.proto.v1.api.TopicContentResponseDto | ||
import org.oppia.proto.v1.api.TopicListRequestDto | ||
import org.oppia.proto.v1.api.TopicListResponseDto | ||
|
||
interface GaeAndroidEndpoint { | ||
fun fetchTopicListAsync( | ||
request: TopicListRequestDto, | ||
reportProgress: (Int, Int) -> Unit = { _, _ -> } | ||
): Deferred<TopicListResponseDto> | ||
|
||
fun fetchTopicContentAsync( | ||
request: TopicContentRequestDto, | ||
reportProgress: (Int, Int) -> Unit = { _, _ -> } | ||
): Deferred<TopicContentResponseDto> | ||
} |
Oops, something went wrong.