设置DNS

This commit is contained in:
wujifei
2021-01-27 16:29:27 +08:00
parent facad1158f
commit a356490cb6
9 changed files with 147 additions and 86 deletions

View File

@@ -34,6 +34,9 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
import static com.mogo.cloud.commons.network.NetConstants.GEOFENCE_HOST;
import static com.mogo.cloud.commons.network.NetConstants.REALTIME_LOCATION_HOST;
/**
* created by wujifei on 2021/1/21 12:26
* describe:
@@ -51,18 +54,17 @@ public class NetworkActivity extends AppCompatActivity {
setContentView(R.layout.activity_network);
btn = (Button) findViewById(R.id.btn);
tvResult = (TextView) findViewById(R.id.tv_result);
apiService = RetrofitFactory.INSTANCE.getInstance("http://dzt-test.zhidaozhixing.com")
.create(ApiService.class);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
tvResult.setText("结果显示");
queryRoadData("ZD802C1938L10797");
// queryHelpSignal("ZD802C1938L10797");
// queryHelpSignal("F803EB2046PZD00006");
//上报路况到服务端
// uploadRoadInfo();
// uploadRoadInfo();
//查询路况
// queryRoad();
}
@@ -154,6 +156,8 @@ public class NetworkActivity extends AppCompatActivity {
}
public void queryRoadData(String sn) {
apiService = RetrofitFactory.INSTANCE.getInstance(GEOFENCE_HOST)
.create(ApiService.class);
if (apiService != null) {
Map<String, Object> map = new HashMap<>();
map.put("sn", sn);
@@ -187,6 +191,8 @@ public class NetworkActivity extends AppCompatActivity {
}
public void queryHelpSignal(String sn) {
apiService = RetrofitFactory.INSTANCE.getInstance("http://dzt-realtimeLocation.zhidaozhixing.com")
.create(ApiService.class);
if (apiService != null) {
Map<String, Object> map = new HashMap<>();
map.put("sn", sn);