Skip to content

Commit

Permalink
汽车全部完成
Browse files Browse the repository at this point in the history
  • Loading branch information
maning committed Jun 7, 2017
1 parent d510e1c commit e969afd
Show file tree
Hide file tree
Showing 15 changed files with 915 additions and 5 deletions.
2 changes: 2 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@
</activity>
<activity android:name=".ui.activity.mob.CarItemsActivity">
</activity>
<activity android:name=".ui.activity.mob.CarDetailActivity">
</activity>
</application>

</manifest>
279 changes: 279 additions & 0 deletions app/src/main/java/com/maning/gankmm/bean/mob/MobCarDetailsEntity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,279 @@
package com.maning.gankmm.bean.mob;

import java.util.ArrayList;
import java.util.List;

/**
* Created by maning on 2017/6/7.
* 车型详细信息
*/

public class MobCarDetailsEntity {

private String brand;//品牌名称
private String brandName; //车系名称
private String carImage; // 图片地址
private String seriesName; //车型名称
private String sonBrand; //子品牌或合资品牌

private List<DetailItem> baseInfo = new ArrayList<>(); //车型基本配置信息
private List<DetailItem> airConfig = new ArrayList<>(); //空调/冰箱配置信息
private List<DetailItem> carbody = new ArrayList<>(); //车身配置信息
private List<DetailItem> chassis = new ArrayList<>(); //底盘配置信息
private List<DetailItem> controlConfig = new ArrayList<>(); //操控配置信息
private List<DetailItem> engine = new ArrayList<>(); //发动机配置信息
private List<DetailItem> exterConfig = new ArrayList<>(); //外部配置信息
private List<DetailItem> glassConfig = new ArrayList<>(); //玻璃/后视镜配置信息
private List<DetailItem> interConfig = new ArrayList<>(); //内部配置信息
private List<DetailItem> lightConfig = new ArrayList<>(); //灯光配置信息
private List<DetailItem> mediaConfig = new ArrayList<>(); //多媒体配置信息
private List<DetailItem> safetyDevice = new ArrayList<>(); //安全装置信息
private List<DetailItem> seatConfig = new ArrayList<>(); //座椅配置信息
private List<DetailItem> techConfig = new ArrayList<>(); //高科技配置信息
private List<DetailItem> transmission = new ArrayList<>(); //变速箱信息
private List<DetailItem> wheelInfo = new ArrayList<>(); // 车轮制动信息
private List<DetailItem> motorList = new ArrayList<>(); //电动机配置信息

public String getBrand() {
return brand;
}

public void setBrand(String brand) {
this.brand = brand;
}

public String getBrandName() {
return brandName;
}

public void setBrandName(String brandName) {
this.brandName = brandName;
}

public String getCarImage() {
return carImage;
}

public void setCarImage(String carImage) {
this.carImage = carImage;
}

public String getSeriesName() {
return seriesName;
}

public void setSeriesName(String seriesName) {
this.seriesName = seriesName;
}

public String getSonBrand() {
return sonBrand;
}

public void setSonBrand(String sonBrand) {
this.sonBrand = sonBrand;
}

public List<DetailItem> getBaseInfo() {
return baseInfo;
}

public void setBaseInfo(List<DetailItem> baseInfo) {
this.baseInfo = baseInfo;
}

public List<DetailItem> getAirConfig() {
return airConfig;
}

public void setAirConfig(List<DetailItem> airConfig) {
this.airConfig = airConfig;
}

public List<DetailItem> getCarbody() {
return carbody;
}

public void setCarbody(List<DetailItem> carbody) {
this.carbody = carbody;
}

public List<DetailItem> getChassis() {
return chassis;
}

public void setChassis(List<DetailItem> chassis) {
this.chassis = chassis;
}

public List<DetailItem> getControlConfig() {
return controlConfig;
}

public void setControlConfig(List<DetailItem> controlConfig) {
this.controlConfig = controlConfig;
}

public List<DetailItem> getEngine() {
return engine;
}

public void setEngine(List<DetailItem> engine) {
this.engine = engine;
}

public List<DetailItem> getExterConfig() {
return exterConfig;
}

public void setExterConfig(List<DetailItem> exterConfig) {
this.exterConfig = exterConfig;
}

public List<DetailItem> getGlassConfig() {
return glassConfig;
}

public void setGlassConfig(List<DetailItem> glassConfig) {
this.glassConfig = glassConfig;
}

public List<DetailItem> getInterConfig() {
return interConfig;
}

public void setInterConfig(List<DetailItem> interConfig) {
this.interConfig = interConfig;
}

public List<DetailItem> getLightConfig() {
return lightConfig;
}

public void setLightConfig(List<DetailItem> lightConfig) {
this.lightConfig = lightConfig;
}

public List<DetailItem> getMediaConfig() {
return mediaConfig;
}

public void setMediaConfig(List<DetailItem> mediaConfig) {
this.mediaConfig = mediaConfig;
}

public List<DetailItem> getSafetyDevice() {
return safetyDevice;
}

public void setSafetyDevice(List<DetailItem> safetyDevice) {
this.safetyDevice = safetyDevice;
}

public List<DetailItem> getSeatConfig() {
return seatConfig;
}

public void setSeatConfig(List<DetailItem> seatConfig) {
this.seatConfig = seatConfig;
}

public List<DetailItem> getTechConfig() {
return techConfig;
}

public void setTechConfig(List<DetailItem> techConfig) {
this.techConfig = techConfig;
}

public List<DetailItem> getTransmission() {
return transmission;
}

public void setTransmission(List<DetailItem> transmission) {
this.transmission = transmission;
}

public List<DetailItem> getWheelInfo() {
return wheelInfo;
}

public void setWheelInfo(List<DetailItem> wheelInfo) {
this.wheelInfo = wheelInfo;
}

public List<DetailItem> getMotorList() {
return motorList;
}

public void setMotorList(List<DetailItem> motorList) {
this.motorList = motorList;
}

public static class DetailItem {
private String name;
private String value;
private String type;

public String getType() {
return type;
}

public void setType(String type) {
this.type = type;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getValue() {
return value;
}

public void setValue(String value) {
this.value = value;
}

@Override
public String toString() {
return "DetailItem{" +
"name='" + name + '\'' +
", value='" + value + '\'' +
", type='" + type + '\'' +
'}';
}
}

@Override
public String toString() {
return "MobCarDetailsEntity{" +
"brand='" + brand + '\'' +
", brandName='" + brandName + '\'' +
", carImage='" + carImage + '\'' +
", seriesName='" + seriesName + '\'' +
", sonBrand='" + sonBrand + '\'' +
", baseInfo=" + baseInfo +
", airConfig=" + airConfig +
", carbody=" + carbody +
", chassis=" + chassis +
", controlConfig=" + controlConfig +
", engine=" + engine +
", exterConfig=" + exterConfig +
", glassConfig=" + glassConfig +
", interConfig=" + interConfig +
", lightConfig=" + lightConfig +
", mediaConfig=" + mediaConfig +
", safetyDevice=" + safetyDevice +
", seatConfig=" + seatConfig +
", techConfig=" + techConfig +
", transmission=" + transmission +
", wheelInfo=" + wheelInfo +
", motorList=" + motorList +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package com.maning.gankmm.bean.mob;

import java.io.Serializable;

/**
* Created by maning on 2017/6/6.
* 车型信息
*/

public class MobCarItemEntity {
public class MobCarItemEntity implements Serializable{


/**
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/java/com/maning/gankmm/http/APIService.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.maning.gankmm.bean.SearchBean;
import com.maning.gankmm.bean.WeatherBeseEntity;
import com.maning.gankmm.bean.mob.MobBankCard;
import com.maning.gankmm.bean.mob.MobCarDetailsEntity;
import com.maning.gankmm.bean.mob.MobCarEntity;
import com.maning.gankmm.bean.mob.MobCarItemEntity;
import com.maning.gankmm.bean.mob.MobDictEntity;
Expand Down Expand Up @@ -238,4 +239,11 @@ Call<MobBaseEntity<ArrayList<MobCarItemEntity>>> queryCarItems(@Query("key") Str
@Query("name") String name
);

//车型详细信息查询
//http://apicloud.mob.com/car/series/query?key=appkey&cid=1060133
@GET(Constants.URL_Mob + "car/series/query")
Call<MobBaseEntity<ArrayList<MobCarDetailsEntity>>> queryCarDetails(@Query("key") String appkey,
@Query("cid") String cid
);

}
38 changes: 38 additions & 0 deletions app/src/main/java/com/maning/gankmm/http/MobApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.maning.gankmm.app.MyApplication;
import com.maning.gankmm.bean.MobBaseEntity;
import com.maning.gankmm.bean.mob.MobBankCard;
import com.maning.gankmm.bean.mob.MobCarDetailsEntity;
import com.maning.gankmm.bean.mob.MobCarEntity;
import com.maning.gankmm.bean.mob.MobCarItemEntity;
import com.maning.gankmm.bean.mob.MobDictEntity;
Expand Down Expand Up @@ -607,6 +608,8 @@ public void onFailure(Call<MobBaseEntity<ArrayList<MobCarEntity>>> call, Throwab
}




public static Call<MobBaseEntity<ArrayList<MobCarItemEntity>>> queryCarItems(String carName, final int what, final MyCallBack myCallBack) {

Call<MobBaseEntity<ArrayList<MobCarItemEntity>>> call = BuildApi.getAPIService().queryCarItems(Constants.URL_APP_Key, carName);
Expand Down Expand Up @@ -642,4 +645,39 @@ public void onFailure(Call<MobBaseEntity<ArrayList<MobCarItemEntity>>> call, Thr

}

public static Call<MobBaseEntity<ArrayList<MobCarDetailsEntity>>> queryCarDetails(String cid, final int what, final MyCallBack myCallBack) {

Call<MobBaseEntity<ArrayList<MobCarDetailsEntity>>> call = BuildApi.getAPIService().queryCarDetails(Constants.URL_APP_Key, cid);
call.enqueue(new Callback<MobBaseEntity<ArrayList<MobCarDetailsEntity>>>() {
@Override
public void onResponse(Call<MobBaseEntity<ArrayList<MobCarDetailsEntity>>> call, Response<MobBaseEntity<ArrayList<MobCarDetailsEntity>>> response) {
if (response.isSuccessful()) {
MobBaseEntity<ArrayList<MobCarDetailsEntity>> body = response.body();
if (body != null) {
if (body.getMsg().equals("success")) {
KLog.i("queryCarDetails---success:" + body.toString());
myCallBack.onSuccessList(what, body.getResult());
} else {
myCallBack.onFail(what, body.getMsg());
}
} else {
myCallBack.onFail(what, GET_DATA_FAIL);
}
} else {
myCallBack.onFail(what, GET_DATA_FAIL);
}
}

@Override
public void onFailure(Call<MobBaseEntity<ArrayList<MobCarDetailsEntity>>> call, Throwable t) {
KLog.e("queryCarDetails-----onFailure:" + t.toString());
//数据错误
myCallBack.onFail(what, NET_FAIL);
}
});

return call;

}

}
Loading

0 comments on commit e969afd

Please sign in to comment.