From da47fdfddc46e35a939b7771eda21debec50c094 Mon Sep 17 00:00:00 2001 From: Jeffrey Armstrong Date: Thu, 1 Apr 2021 20:41:13 -0400 Subject: Started work on API implementation --- captain/api.f90 | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 captain/api.f90 (limited to 'captain/api.f90') diff --git a/captain/api.f90 b/captain/api.f90 new file mode 100644 index 0000000..025251d --- /dev/null +++ b/captain/api.f90 @@ -0,0 +1,51 @@ +module api_handling +implicit none + +contains + + function api_request_gemini(req) result(resp) + use server_response + implicit none + + type(request), intent(in)::req + type(response)::resp + + integer::i + + ! Complete - "/api/player/{name}/job/{jobid}/complete" + ! Failed - "/api/player/{name}/job/{jobid}/failed" + ! Task - "/api/player/{name}/job/{jobid}/task/{task num}" + if(trim(req%component(2)) == "player" .and. trim(req%component(4)) == "job") then + if(trim(req%component(6)) == "complete") then + + end if + end if + + + end function api_request_gemini + + function api_request_titan(req) result(resp) + use server_response + implicit none + + type(request), intent(in)::req + type(response)::resp + + end function api_request_titan + + function api_request(req) result(resp) + use server_response + implicit none + + type(request), intent(in)::req + type(response)::resp + + if(req%protocol == "gemini") then + resp = api_request_gemini(req) + else if(req%protocol == "titan") then + resp = api_request_titan(req) + end if + + end function api_request + +end module api_handling \ No newline at end of file -- cgit v1.2.3