AA-24 | Shashidhara | Add base URL object
This commit is contained in:
@@ -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"
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user