This commit is contained in:
Sergio De la torre 2023-05-03 13:48:31 +02:00
parent ee8527f6a3
commit 8fc79a4d5d
4 changed files with 13 additions and 29 deletions

View File

@ -11,7 +11,7 @@ class ApiSalixUtils {
companion object { companion object {
//const val BASE_URL:String = "http://192.168.1.155:9009/" //const val BASE_URL:String = "http://192.168.1.155:9009/"
//const val BASE_URL: String = "https://test-salix.verdnatura.es/api/" //const val BASE_URL: String = "https://test-salix.verdnatura.es/api/"
const val BASE_URL: String = "https://salix.verdnatura.es/api/" const val BASE_URL: String = "https://salix.verdnatura.es"
fun getApiService(context: Context): SalixService { fun getApiService(context: Context): SalixService {
@ -51,7 +51,7 @@ class ApiSalixUtils {
url = "https://" + url url = "https://" + url
} }
} }
return if (url.isNullOrEmpty()) BASE_URL else url return if (url.isNullOrEmpty()) "$BASE_URL/api/" else "$url/api/"
} }
fun getDefaults(key: String?, context: Context?): String? { fun getDefaults(key: String?, context: Context?): String? {
@ -60,20 +60,3 @@ class ApiSalixUtils {
} }
} }
} }
class ApiSalixUtilsSend {
companion object {
const val BASE_URL: String = "https://salix.verdnatura.es/api/"
fun getApiService(context: Context): SalixServiceSend {
val salixRetrofit = Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory(
GsonConverterFactory.create()
).build()
//d("VERDNATURA::","El server Salix es "+getBaseUrlLocal(context = context))
return salixRetrofit.create(SalixServiceSend::class.java)
}
}
}

View File

@ -644,23 +644,23 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
WorkForms( WorkForms(
"Producción", "Producción",
"https://app.verdnatura.es", "https://app.verdnatura.es",
"https://salix.verdnatura.es/api/" "https://salix.verdnatura.es"
) )
) )
saveWorkForm( saveWorkForm(
WorkForms( WorkForms(
"Test", "Test",
"https://test-app.verdnatura.es", "https://test-app.verdnatura.es",
urlSalix = "https://test-salix.verdnatura.es/api/" urlSalix = "https://test-salix.verdnatura.es"
) )
) )
var working_in_test = true var working_in_test = false
if (working_in_test) { if (working_in_test) {
saveWorkForm( saveWorkForm(
WorkForms( WorkForms(
"TestLocalhost", "TestLocalhost",
"http://10.1.4.42:9000", "http://10.1.4.42:9000",
urlSalix = "https://test-salix.verdnatura.es/api/" urlSalix = "https://test-salix.verdnatura.es"
) )
) )
@ -668,23 +668,25 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
WorkForms( WorkForms(
"TestHome", "TestHome",
"http://192.168.1.37:9000", "http://192.168.1.37:9000",
urlSalix = "https://test-salix.verdnatura.es/api/" urlSalix = "https://test-salix.verdnatura.es"
) )
) )
saveWorkForm( saveWorkForm(
WorkForms( WorkForms(
"TestLOCAL", "TestLOCAL",
"http://10.1.4.42:9000", "http://10.1.4.42:9000",
urlSalix = "http://localhost:3000/api/" urlSalix = "http://localhost:3000"
) )
) )
saveWorkForm( saveWorkForm(
WorkForms( WorkForms(
"TestLOCALHOME", "TestLOCALHOME",
"http://192.168.1.37:9000", "http://192.168.1.37:9000",
urlSalix = "http://localhost:3000/api/" urlSalix = "http://localhost:3000"
) )
) )
}else{
deleteWorkForm("all")
} }
saveWorkForm( saveWorkForm(
WorkForms( WorkForms(

View File

@ -128,7 +128,7 @@ class ItemCardFragment(
var entryPoint = Gson().toJson( var entryPoint = Gson().toJson(
mutableMapOf( mutableMapOf(
"entryPoint" to itemId, "entryPoint" to itemId,
"web" to "https://salix.verdnatura.es/#!/item/$itemId/summary" "web" to "${getData("base_urlSalix")}/#!/item/$itemId/summary"
) )
) )
ma.onPasillerosItemClickListener( ma.onPasillerosItemClickListener(

View File

@ -144,7 +144,6 @@ class shelvingLogFragment(
} else { } else {
val itemId = it.list[0].id val itemId = it.list[0].id
//val entrypoint = mutableMapOf("entryPoint" to itemScan, "web" to "https://test-salix.verdnatura.es/#!/shelving/$itemId/log")
ma.onPasillerosItemClickListener( ma.onPasillerosItemClickListener(
PasillerosItemVO( PasillerosItemVO(
title = getString(R.string.titleWebViewer), title = getString(R.string.titleWebViewer),
@ -152,7 +151,7 @@ class shelvingLogFragment(
entryPoint = Gson().toJson( entryPoint = Gson().toJson(
mutableMapOf( mutableMapOf(
"entryPoint" to itemId, "entryPoint" to itemId,
"web" to "https://salix.verdnatura.es/#!/shelving/$itemId/log" "web" to "${getData("base_urlSalix")}/#!/shelving/$itemId/log"
) )
) )
) )