Skip to content

Commit

Permalink
添加垃圾分类
Browse files Browse the repository at this point in the history
  • Loading branch information
maning0303 committed Oct 15, 2020
1 parent 0a964ed commit 1699427
Show file tree
Hide file tree
Showing 42 changed files with 542 additions and 411 deletions.
48 changes: 24 additions & 24 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -243,41 +243,41 @@
android:name=".ui.activity.SupportPayActivity"
android:screenOrientation="portrait"/>
<activity android:name=".ui.activity.MoreActivity"/>
<activity android:name=".ui.activity.mob.PhoneAddressActivity"/>
<activity android:name=".ui.activity.mob.PostCodeActivity"/>
<activity android:name=".ui.activity.mob.IDCardQueryActivity"/>
<activity android:name=".ui.activity.mob.IPQueryActivity"/>
<activity android:name=".ui.activity.mob.WXArticleActivity"/>
<activity android:name=".ui.activity.mob.BankCardActivity"/>
<activity android:name=".ui.activity.mob.ChineseCalendarActivity"/>
<activity android:name=".ui.activity.mob.OilPriceActivity"/>
<activity android:name=".ui.activity.mob.DictionaryActivity"/>
<activity android:name=".ui.activity.mob.IdiomActivity"/>
<activity android:name=".ui.activity.mob.HistoryTodayActivity"/>
<activity android:name=".ui.activity.mob.HealthActivity"/>
<activity android:name=".ui.activity.mob.TrainActivity"/>
<activity android:name=".ui.activity.mob.TrainListActivity"/>
<activity android:name=".ui.activity.mob.FlightActivity"/>
<activity android:name=".ui.activity.mob.FlightListActivity"/>
<activity android:name=".ui.activity.tools.PhoneAddressActivity"/>
<activity android:name=".ui.activity.tools.PostCodeActivity"/>
<activity android:name=".ui.activity.tools.IDCardQueryActivity"/>
<activity android:name=".ui.activity.tools.IPQueryActivity"/>
<activity android:name=".ui.activity.tools.WXArticleActivity"/>
<activity android:name=".ui.activity.tools.BankCardActivity"/>
<activity android:name=".ui.activity.tools.ChineseCalendarActivity"/>
<activity android:name=".ui.activity.tools.OilPriceActivity"/>
<activity android:name=".ui.activity.tools.DictionaryActivity"/>
<activity android:name=".ui.activity.tools.IdiomActivity"/>
<activity android:name=".ui.activity.tools.HistoryTodayActivity"/>
<activity android:name=".ui.activity.tools.RubbishActivity"/>
<activity android:name=".ui.activity.tools.TrainActivity"/>
<activity android:name=".ui.activity.tools.TrainListActivity"/>
<activity android:name=".ui.activity.tools.FlightActivity"/>
<activity android:name=".ui.activity.tools.FlightListActivity"/>
<activity
android:name=".ui.imagebrowser.MNImageBrowserActivity2"
android:screenOrientation="portrait"
android:theme="@style/ImageBrowserTheme"/>
<activity android:name=".ui.activity.mob.CarListActivity">
<activity android:name=".ui.activity.tools.CarListActivity">
</activity>
<activity android:name=".ui.activity.mob.CarItemsActivity">
<activity android:name=".ui.activity.tools.CarItemsActivity">
</activity>
<activity android:name=".ui.activity.mob.CarDetailActivity">
<activity android:name=".ui.activity.tools.CarDetailActivity">
</activity>
<activity android:name=".ui.activity.mob.CookMenuActivity">
<activity android:name=".ui.activity.tools.CookMenuActivity">
</activity>
<activity android:name=".ui.activity.mob.CookListActivity">
<activity android:name=".ui.activity.tools.CookListActivity">
</activity>
<activity android:name=".ui.activity.mob.CookDetailsActivity">
<activity android:name=".ui.activity.tools.CookDetailsActivity">
</activity>
<activity android:name=".ui.activity.mob.LotteryCategoryActivity">
<activity android:name=".ui.activity.tools.LotteryCategoryActivity">
</activity>
<activity android:name=".ui.activity.mob.LotteryDetailActivity">
<activity android:name=".ui.activity.tools.LotteryDetailActivity">
</activity>
<activity android:name=".ui.activity.login.LoginActivity">
</activity>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
package com.maning.gankmm.bean.rolltools;

import java.util.List;

/**
* @author : maning
* @date : 2020-10-15
* @desc :
*/
public class DictionaryResultBean extends RollToolsBaseBean {


private List<DataEntity> data;

public List<DataEntity> getData() {
return data;
}

public void setData(List<DataEntity> data) {
this.data = data;
}

public static class DataEntity {
/**
* word : 穆
* traditional : 穆
* pinyin : mù
* radicals : 禾
* explanation : 穆
(形声。本义禾名)
同本义
穆,禾也。--《说文》。段玉裁注盖禾有名穆者也。”
古时宗庙制度,父居左为昭,子居右为穆。参见昭穆”
辩庙祧之昭穆。--《周礼·小宗伯》。注父曰昭,子曰穆。”
代指右边
只见贾府人分了昭穆,排班立定。--《红楼梦》
又如昭穆(左边和右边)
恭敬
于穆清庙。--《诗·周颂·清庙》
穆穆皇皇。--《诗·大雅·假乐》
我其为王穆卜。--《书·金滕》。传
穆mù
⒈和畅,美好~如清风。
⒉和睦不~。
⒊恭敬,严肃静~。肃~。~ ~皇皇(皇皇美好的样子)。
* strokes : 16
*/

private String word;
private String traditional;
private String pinyin;
private String radicals;
private String explanation;
private int strokes;

public String getWord() {
return word;
}

public void setWord(String word) {
this.word = word;
}

public String getTraditional() {
return traditional;
}

public void setTraditional(String traditional) {
this.traditional = traditional;
}

public String getPinyin() {
return pinyin;
}

public void setPinyin(String pinyin) {
this.pinyin = pinyin;
}

public String getRadicals() {
return radicals;
}

public void setRadicals(String radicals) {
this.radicals = radicals;
}

public String getExplanation() {
return explanation;
}

public void setExplanation(String explanation) {
this.explanation = explanation;
}

public int getStrokes() {
return strokes;
}

public void setStrokes(int strokes) {
this.strokes = strokes;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
package com.maning.gankmm.bean.rolltools;

import java.util.List;

/**
* @author : maning
* @date : 2020-10-15
* @desc :
*/
public class RubbishTypeResultBean extends RollToolsBaseBean {


/**
* data : {"aim":{"goodsName":"西瓜","goodsType":"湿垃圾"},"recommendList":[{"goodsName":"西瓜霜含片塑料铝箔包装","goodsType":"有害垃圾"}]}
*/

private DataEntity data;

public DataEntity getData() {
return data;
}

public void setData(DataEntity data) {
this.data = data;
}

public static class DataEntity {
/**
* aim : {"goodsName":"西瓜","goodsType":"湿垃圾"}
* recommendList : [{"goodsName":"西瓜霜含片塑料铝箔包装","goodsType":"有害垃圾"}]
*/

private AimEntity aim;
private List<AimEntity> recommendList;

public AimEntity getAim() {
return aim;
}

public void setAim(AimEntity aim) {
this.aim = aim;
}

public List<AimEntity> getRecommendList() {
return recommendList;
}

public void setRecommendList(List<AimEntity> recommendList) {
this.recommendList = recommendList;
}

public static class AimEntity {
/**
* goodsName : 西瓜
* goodsType : 湿垃圾
*/

private String goodsName;
private String goodsType;

public String getGoodsName() {
return goodsName;
}

public void setGoodsName(String goodsName) {
this.goodsName = goodsName;
}

public String getGoodsType() {
return goodsType;
}

public void setGoodsType(String goodsType) {
this.goodsType = goodsType;
}
}
}
}
2 changes: 2 additions & 0 deletions app/src/main/java/com/maning/gankmm/constant/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public class Constants {

//开源API:https://github.com/MZCretin/RollToolsApi
public static final String BASEURL_ROLL_TOOLS = "https://www.mxnzp.com/api/";
public static final String ROLL_TOOLS_APP_ID = "olkgphoyitdqikvi";
public static final String ROLL_TOOLS_APP_SECRET = "SFdTdFB5aGVoamlXU2dZblpPZTRjQT09";

//干活历史日期
public static final String URL_HistoryDate = "http://gank.io/api/day/history";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
package com.maning.gankmm.http.rolltools;

import com.maning.gankmm.bean.rolltools.DictionaryResultBean;
import com.maning.gankmm.bean.rolltools.HistoryTodayBean;
import com.maning.gankmm.bean.rolltools.HolidaySingleResultBean;
import com.maning.gankmm.bean.rolltools.RubbishTypeResultBean;
import com.maning.gankmm.bean.rolltools.WeatherFuturedaysResultBean;
import com.maning.gankmm.constant.Constants;

import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.Path;
import retrofit2.http.Query;


/**
Expand All @@ -17,8 +21,8 @@ public interface APIRolltoolsService {


@Headers({
"app_id:olkgphoyitdqikvi",
"app_secret:SFdTdFB5aGVoamlXU2dZblpPZTRjQT09"
"app_id:" + Constants.ROLL_TOOLS_APP_ID,
"app_secret:" + Constants.ROLL_TOOLS_APP_SECRET
})
@GET("holiday/single/{date}")
Call<HolidaySingleResultBean> getHolidaySingle(
Expand All @@ -27,19 +31,38 @@ Call<HolidaySingleResultBean> getHolidaySingle(


@Headers({
"app_id:olkgphoyitdqikvi",
"app_secret:SFdTdFB5aGVoamlXU2dZblpPZTRjQT09"
"app_id:" + Constants.ROLL_TOOLS_APP_ID,
"app_secret:" + Constants.ROLL_TOOLS_APP_SECRET
})
@GET("weather/forecast/{cityName}")
Call<WeatherFuturedaysResultBean> getCityWeatherFutureDays(
@Path("cityName") String cityName
);

@Headers({
"app_id:olkgphoyitdqikvi",
"app_secret:SFdTdFB5aGVoamlXU2dZblpPZTRjQT09"
"app_id:" + Constants.ROLL_TOOLS_APP_ID,
"app_secret:" + Constants.ROLL_TOOLS_APP_SECRET
})
@GET("history/today?type=1")
Call<HistoryTodayBean> getHistoryToday();


@Headers({
"app_id:" + Constants.ROLL_TOOLS_APP_ID,
"app_secret:" + Constants.ROLL_TOOLS_APP_SECRET
})
@GET("convert/dictionary")
Call<DictionaryResultBean> convertDictionary(
@Query("content") String content
);

@Headers({
"app_id:" + Constants.ROLL_TOOLS_APP_ID,
"app_secret:" + Constants.ROLL_TOOLS_APP_SECRET
})
@GET("rubbish/type")
Call<RubbishTypeResultBean> getRubbishType(
@Query("name") String name
);

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.maning.gankmm.http.rolltools;

import com.maning.gankmm.bean.rolltools.DictionaryResultBean;
import com.maning.gankmm.bean.rolltools.HistoryTodayBean;
import com.maning.gankmm.bean.rolltools.HolidaySingleResultBean;
import com.maning.gankmm.bean.rolltools.RubbishTypeResultBean;
import com.maning.gankmm.bean.rolltools.WeatherFuturedaysResultBean;
import com.maning.gankmm.http.BuildApi;
import com.maning.gankmm.http.callback.CommonHttpCallback;
Expand Down Expand Up @@ -35,11 +37,31 @@ public static void getCityWeatherFutureDays(String cityName, CommonHttpCallback<

/**
* 历史上的今天
*
* @param httpCallback
*/
public static void getHistoryToday(CommonHttpCallback<HistoryTodayBean> httpCallback) {
BuildApi.getRooltoolsAPIService().getHistoryToday().enqueue(httpCallback);
}

/**
* 查询单个汉字的读音和含义。
*
* @param content
* @param httpCallback
*/
public static void convertDictionary(String content, CommonHttpCallback<DictionaryResultBean> httpCallback) {
BuildApi.getRooltoolsAPIService().convertDictionary(content).enqueue(httpCallback);
}

/**
* 垃圾分类
* @param content
* @param httpCallback
*/
public static void getRubbishType(String content, CommonHttpCallback<RubbishTypeResultBean> httpCallback) {
BuildApi.getRooltoolsAPIService().getRubbishType(content).enqueue(httpCallback);
}


}
Loading

0 comments on commit 1699427

Please sign in to comment.