View on GitHub

optical_graph_recognition_mobApp

Mobile application for optical graph recognition

app / com.pzpg.ogr.api.request / RequestServer

RequestServer

class RequestServer

Class responsible for request to server

Constructors

Name Summary
<init> Class responsible for request to serverRequestServer(serverUrl: String)

Functions

Name Summary
authorize Authorizes a user on the server to use the APIsuspend fun authorize(account: GoogleSignInAccount): JSONObject
deleteAll Suspend method to delete all entities with processed graphs includes image, graphMl, g6 filessuspend fun deleteAll(jwtToken: String): Int
deleteData Suspend method to delete one of entities with processed graphs includes image, graphMl, g6 filessuspend fun deleteData(guid: String, jwtToken: String): Int
downloadGraph Suspend method to download a file which representations a graph which has been recognitions by the serversuspend fun downloadGraph(guid: String, format: GraphFormat?, jwtToken: String): File?
getHistory Suspend method to get history from the server about the user activitysuspend fun getHistory(jwtToken: String): JSONArray
processImage Suspend method to process a image for graph recognitionsuspend fun processImage(guid: String, jwtToken: String, mode: ProcessMode?): Int
refreshToken Suspend method to refresh token method to refresh the access token “jwtToken” when the time of the token has expired.suspend fun refreshToken(rToken: String): JSONObject
revokeToken Suspend method to revoke token when user logged outsuspend fun revokeToken(jwtToken: String, rToken: String): Int
uploadImage Suspend method to upload an image which will processed to the serversuspend fun uploadImage(dir: String, name: String, jwtToken: String): String