use of zipkin2.Call in project DVECTN by tanaponudom.
the class NetworkConnectionManager method callSrever_AF_teacher.
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public void callSrever_AF_teacher(final OnNetworkCallback_AF_teacher listener, String member_id) {
Gson gson = new GsonBuilder().setLenient().create();
final Retrofit retrofit = new Retrofit.Builder().baseUrl(Fragment_login.BASE_URL).addConverterFactory(GsonConverterFactory.create(gson)).build();
APISERVER callapi = retrofit.create(APISERVER.class);
Call call = callapi.getDataAF_teacher_company(member_id);
call.enqueue(new Callback<List<POJO_AF_teacher>>() {
@Override
public void onResponse(Call<List<POJO_AF_teacher>> call, Response<List<POJO_AF_teacher>> response) {
try {
List<POJO_AF_teacher> getnite = (List<POJO_AF_teacher>) response.body();
if (response.code() != 200) {
// Log.e("Network connected","Response code = "+response.code());
ResponseBody responseBody = response.errorBody();
if (responseBody != null) {
listener.onBodyError(responseBody);
} else if (responseBody == null) {
listener.onBodyErrorIsNull();
}
// Toast.makeText(, ""+loginRes.getAccesstoken(), Toast.LENGTH_SHORT).show();
// Log.e("Network connected","Response code = "+loginRes.getAccesstoken());
} else {
listener.onResponse(getnite);
}
} catch (Exception e) {
Log.e("Network connect error", e.getMessage());
}
}
@Override
public void onFailure(Call<List<POJO_AF_teacher>> call, Throwable t) {
Log.e("NT", t.getMessage());
try {
listener.onFailure(t);
} catch (Exception e) {
listener.onFailure(t);
// Log.e("Network connectLogin",t.getMessage());
}
}
});
}
use of zipkin2.Call in project DVECTN by tanaponudom.
the class NetworkConnectionManager method callServer_dd_p2.
// /////////////////////////////////////////////////////////////////////////////////////////////////
public void callServer_dd_p2(final OnNetworkCallback_DD_P2 listener, int member_id, int ex22, int ex23, int ex24, int ex25, int ex26, int ex27, int ex28, int ex29) {
Gson gson = new GsonBuilder().setLenient().create();
final Retrofit retrofit = new Retrofit.Builder().baseUrl(Fragment_login.BASE_URL).addConverterFactory(GsonConverterFactory.create(gson)).build();
APISERVER callapi = retrofit.create(APISERVER.class);
Call call = callapi.getDataDDP2(member_id, ex22, ex23, ex24, ex25, ex26, ex27, ex28, ex29);
call.enqueue(new Callback<POJO_DD_P2>() {
@Override
public void onResponse(Call<POJO_DD_P2> call, Response<POJO_DD_P2> response) {
try {
POJO_DD_P2 affective2 = (POJO_DD_P2) response.body();
if (response.code() != 200) {
// Log.e("Network connected","Response code = "+response.code());
ResponseBody responseBody = response.errorBody();
if (responseBody != null) {
listener.onBodyError(responseBody);
} else if (responseBody == null) {
listener.onBodyErrorIsNull();
}
// Toast.makeText(, ""+loginRes.getAccesstoken(), Toast.LENGTH_SHORT).show();
// Log.e("Network connected","Response code = "+loginRes.getAccesstoken());
} else {
listener.onResponse(affective2);
}
} catch (Exception e) {
// Log.e("Network connect error",e.getMessage());
}
}
@Override
public void onFailure(Call<POJO_DD_P2> call, Throwable t) {
Log.e("NT", t.getMessage());
try {
listener.onFailure(t);
} catch (Exception e) {
listener.onFailure(t);
// Log.e("Network connectLogin",t.getMessage());
}
}
});
}
use of zipkin2.Call in project DVECTN by tanaponudom.
the class NetworkConnectionManager method callSrever_suppervision.
// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public void callSrever_suppervision(final OnNetworkCallback_AF_teacher listener, String member_id, int suppervision) {
Gson gson = new GsonBuilder().setLenient().create();
final Retrofit retrofit = new Retrofit.Builder().baseUrl(Fragment_login.BASE_URL).addConverterFactory(GsonConverterFactory.create(gson)).build();
APISERVER callapi = retrofit.create(APISERVER.class);
Call call = callapi.get_dawae_now(member_id, suppervision);
call.enqueue(new Callback<List<POJO_AF_teacher>>() {
@Override
public void onResponse(Call<List<POJO_AF_teacher>> call, Response<List<POJO_AF_teacher>> response) {
try {
List<POJO_AF_teacher> supervision = (List<POJO_AF_teacher>) response.body();
if (response.code() != 200) {
// Log.e("Network connected","Response code = "+response.code());
ResponseBody responseBody = response.errorBody();
if (responseBody != null) {
listener.onBodyError(responseBody);
} else if (responseBody == null) {
listener.onBodyErrorIsNull();
}
// Toast.makeText(, ""+loginRes.getAccesstoken(), Toast.LENGTH_SHORT).show();
// Log.e("Network connected","Response code = "+loginRes.getAccesstoken());
} else {
listener.onResponse(supervision);
}
} catch (Exception e) {
Log.e("Network connect error", e.getMessage());
}
}
@Override
public void onFailure(Call<List<POJO_AF_teacher>> call, Throwable t) {
Log.e("NT", t.getMessage());
try {
listener.onFailure(t);
} catch (Exception e) {
listener.onFailure(t);
// Log.e("Network connectLogin",t.getMessage());
}
}
});
}
use of zipkin2.Call in project DVECTN by tanaponudom.
the class NetworkConnectionManager method callSrever_save_AG.
// ///////////////////////////////////////////////////////////////////////////////////////////////////////////
public void callSrever_save_AG(final OnNetworkCallback_save_AG listener, int member_id, int check_dep) {
Gson gson = new GsonBuilder().setLenient().create();
final Retrofit retrofit = new Retrofit.Builder().baseUrl(Fragment_login.BASE_URL).addConverterFactory(GsonConverterFactory.create(gson)).build();
APISERVER callapi = retrofit.create(APISERVER.class);
Call call = callapi.get_save_ag(member_id, check_dep);
call.enqueue(new Callback<List<POJO_save_AG>>() {
@Override
public void onResponse(Call<List<POJO_save_AG>> call, Response<List<POJO_save_AG>> response) {
try {
List<POJO_save_AG> get_confirm = (List<POJO_save_AG>) response.body();
if (response.code() != 200) {
// Log.e("Network connected","Response code = "+response.code());
ResponseBody responseBody = response.errorBody();
if (responseBody != null) {
listener.onBodyError(responseBody);
} else if (responseBody == null) {
listener.onBodyErrorIsNull();
}
// Toast.makeText(, ""+loginRes.getAccesstoken(), Toast.LENGTH_SHORT).show();
// Log.e("Network connected","Response code = "+loginRes.getAccesstoken());
} else {
listener.onResponse(get_confirm);
}
} catch (Exception e) {
// Log.e("Network connect error",e.getMessage());
}
}
@Override
public void onFailure(Call<List<POJO_save_AG>> call, Throwable t) {
Log.e("NT", t.getMessage());
try {
listener.onFailure(t);
} catch (Exception e) {
listener.onFailure(t);
// Log.e("Network connectLogin",t.getMessage());
}
}
});
}
use of zipkin2.Call in project DVECTN by tanaponudom.
the class NetworkConnectionManager method callSrever_trainer.
// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public void callSrever_trainer(final OnNetworkCallback_trainer listener) {
Gson gson = new GsonBuilder().setLenient().create();
final Retrofit retrofit = new Retrofit.Builder().baseUrl(Fragment_login.BASE_URL).addConverterFactory(GsonConverterFactory.create(gson)).build();
APISERVER callapi = retrofit.create(APISERVER.class);
Call call = callapi.get_trainer();
call.enqueue(new Callback<List<POJO_trainer>>() {
@Override
public void onResponse(Call<List<POJO_trainer>> call, Response<List<POJO_trainer>> response) {
try {
List<POJO_trainer> trainer = (List<POJO_trainer>) response.body();
if (response.code() != 200) {
// Log.e("Network connected","Response code = "+response.code());
ResponseBody responseBody = response.errorBody();
if (responseBody != null) {
listener.onBodyError(responseBody);
} else if (responseBody == null) {
listener.onBodyErrorIsNull();
}
// Toast.makeText(, ""+loginRes.getAccesstoken(), Toast.LENGTH_SHORT).show();
// Log.e("Network connected","Response code = "+loginRes.getAccesstoken());
} else {
listener.onResponse(trainer);
}
} catch (Exception e) {
Log.e("Network connect error", e.getMessage());
}
}
@Override
public void onFailure(Call<List<POJO_trainer>> call, Throwable t) {
Log.e("NT", t.getMessage());
try {
listener.onFailure(t);
} catch (Exception e) {
listener.onFailure(t);
// Log.e("Network connectLogin",t.getMessage());
}
}
});
}
Aggregations