AA-24 | Shashidhara | Add base URL object

This commit is contained in:
Shashidhara Gopal
2019-11-14 19:33:33 +05:30
parent f97bd248e5
commit 546e50e380
9 changed files with 15 additions and 40 deletions

View File

@@ -0,0 +1,7 @@
package com.navi.medici.androidCustomerApp.api
object BaseURL {
const val AUTH_SERVICE = "https://auth-service.np.navi-tech.in"
const val LOAN_ORIGINATION_SERVICE = "https://loan-origination-service.np.navi-tech.in"
const val LOAN_ACCOUNTS_SERVICE = "https://loan-accounts-service.np.navi-tech.in"
}

View File

@@ -9,16 +9,13 @@ import retrofit2.http.PATCH
import retrofit2.http.POST
import retrofit2.http.Path
private const val BASE_URL = "https://b73c209f-908f-4019-b6ae-6f9f58bcaf16.mock.pstmn.io"
//private const val BASE_URL = "https://auth-service.np.navi-tech.in"
interface InputPanApi {
@PATCH("/loan-origination-manager/loan-applications/{loanApplicationId}/POI")
suspend fun submitPan(@Path("loanApplicationId") loanApplicationId: String, @Body inputPanRequest: InputPanRequest): Response<InputPanResponse>
companion object {
operator fun invoke(): InputPanApi {
return RetrofitService.build(BASE_URL).create(InputPanApi::class.java)
return RetrofitService.build(BaseURL.AUTH_SERVICE).create(InputPanApi::class.java)
}
}
}

View File

@@ -16,11 +16,8 @@ interface KycDocumentUploadApi {
suspend fun submitPoaDocument(@Path("loanApplicationId") loanApplicationId: String, @Part("type") type: RequestBody, @Part poaDocument: MultipartBody.Part): Response<KycDocumentUploadResponse>
companion object {
// private const val BASE_URL = "https://loan-origination-service.np.navi-tech.in"
private const val BASE_URL = "https://b73c209f-908f-4019-b6ae-6f9f58bcaf16.mock.pstmn.io"
operator fun invoke(): KycDocumentUploadApi {
return RetrofitService.build(BASE_URL).create(KycDocumentUploadApi::class.java)
return RetrofitService.build(BaseURL.LOAN_ORIGINATION_SERVICE).create(KycDocumentUploadApi::class.java)
}
}
}

View File

@@ -11,11 +11,6 @@ import com.navi.medici.androidCustomerApp.models.response.UpdateLoanApplicationR
import retrofit2.Response
import retrofit2.http.*
private const val BASE_URL = "https://b73c209f-908f-4019-b6ae-6f9f58bcaf16.mock.pstmn.io"
//private const val BASE_URL = "https://loan-origination-service.np.navi-tech.in"
//private const val BASE_URL = "https://loan-origination-service.np.navi-tech.in"
//private const val BASE_URL = "http://192.168.31.220:3020"
interface LoanApplicationApi {
@PUT("loan-application-service/loan-applications/{loanApplicationId}/confirm")
suspend fun acceptOffer(
@@ -44,7 +39,7 @@ interface LoanApplicationApi {
companion object {
operator fun invoke(): LoanApplicationApi {
return RetrofitService.build(BASE_URL).create(
return RetrofitService.build(BaseURL.LOAN_ORIGINATION_SERVICE).create(
LoanApplicationApi::class.java
)
}

View File

@@ -7,17 +7,13 @@ import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.POST
//private const val BASE_URL = "https://auth-service.np.navi-tech.in"
//private const val BASE_URL = "http://192.168.31.220:3020"
private const val BASE_URL = "https://b73c209f-908f-4019-b6ae-6f9f58bcaf16.mock.pstmn.io"
interface LoginApi {
@POST("/auth/otps/generate")
suspend fun submitPhoneNumber(@Body loginRequest: LoginRequest): Response<LoginResponse>
companion object {
operator fun invoke(): LoginApi {
return RetrofitService.build(BASE_URL).create(
return RetrofitService.build(BaseURL.AUTH_SERVICE).create(
LoginApi::class.java)
}
}

View File

@@ -6,17 +6,13 @@ import retrofit2.Response
import retrofit2.http.GET
import retrofit2.http.Query
private const val BASE_URL = "https://b73c209f-908f-4019-b6ae-6f9f58bcaf16.mock.pstmn.io"
//private const val BASE_URL = "https://loan-accounts-service.np.navi-tech.in"
//private const val BASE_URL = "http://192.168.31.220:3020"
interface MyLoansApi {
@GET("/v1/loan-account-service/loan-accounts")
suspend fun fetchMyLoans(@Query("customerId") customerId: String?): Response<List<MyLoansResponse>>
companion object {
operator fun invoke(): MyLoansApi {
return RetrofitService.build(BASE_URL).create(
return RetrofitService.build(BaseURL.LOAN_ACCOUNTS_SERVICE).create(
MyLoansApi::class.java)
}
}

View File

@@ -7,18 +7,13 @@ import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.POST
//private const val BASE_URL = "https://auth-service.np.navi-tech.in"
//private const val BASE_URL = "http://192.168.31.220:3020"
//private const val BASE_URL = "https://auth-service.np.navi-tech.in"
private const val BASE_URL = "https://b73c209f-908f-4019-b6ae-6f9f58bcaf16.mock.pstmn.io"
interface OtpApi {
@POST("/auth/tokens")
suspend fun submitPhoneNumber(@Body otpRequest: OtpRequest): Response<OtpResponse>
companion object {
operator fun invoke(): OtpApi {
return RetrofitService.build(BASE_URL).create(
return RetrofitService.build(BaseURL.AUTH_SERVICE).create(
OtpApi::class.java)
}
}

View File

@@ -7,18 +7,13 @@ import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.PUT
//private const val BASE_URL = "https://auth-service.np.navi-tech.in"
//private const val BASE_URL = "http://192.168.31.220:3020"
//private const val BASE_URL = "https://auth-service.np.navi-tech.in"
private const val BASE_URL = "https://b73c209f-908f-4019-b6ae-6f9f58bcaf16.mock.pstmn.io"
interface RegisterApi {
@PUT("/app-installations/register")
suspend fun checkDevice(@Body registerRequest: RegisterRequest): Response<RegisterResponse>
companion object {
operator fun invoke(): RegisterApi {
return RetrofitService.build(BASE_URL).create(
return RetrofitService.build(BaseURL.AUTH_SERVICE).create(
RegisterApi::class.java
)
}

View File

@@ -10,9 +10,6 @@ import retrofit2.http.Part
import okhttp3.MultipartBody
import retrofit2.http.Path
private const val BASE_URL = "https://b73c209f-908f-4019-b6ae-6f9f58bcaf16.mock.pstmn.io"
//private const val BASE_URL = "https://auth-service.np.navi-tech.in"
interface UploadPanApi {
@Multipart
@POST("/loan-origination-manager/loan-applications/{loanApplicationId}/POI")
@@ -20,7 +17,7 @@ interface UploadPanApi {
companion object {
operator fun invoke(): UploadPanApi {
return RetrofitService.build(BASE_URL).create(UploadPanApi::class.java)
return RetrofitService.build(BaseURL.AUTH_SERVICE).create(UploadPanApi::class.java)
}
}
}