Commit 3765c74edd0a9557faff60bf8e2f9ac828d8cb6d
Merge remote-tracking branch 'origin/master'
# Conflicts: # lib_network/src/main/java/com/cnlive/strike/data/network/api/ApiServiceDaren.java
Showing
15 changed files
with
458 additions
and
21 deletions
lib_network/src/main/java/com/cnlive/strike/data/network/api/ApiServiceDaren.java
| ... | ... | @@ -7,7 +7,9 @@ import com.cnlive.strike.data.network.model.CheckTransferInfo; |
| 7 | 7 | import com.cnlive.strike.data.network.model.DarenApplyModel; |
| 8 | 8 | import com.cnlive.strike.data.network.model.GifEmojiItemData; |
| 9 | 9 | import com.cnlive.strike.data.network.model.GifListData; |
| 10 | +import com.cnlive.strike.data.network.model.RaceRecordInfo; | |
| 10 | 11 | import com.cnlive.strike.data.network.model.ShortLinkInfo; |
| 12 | +import com.cnlive.strike.data.network.model.TakePartPeopleInfo; | |
| 11 | 13 | import com.cnlive.strike.data.network.model.runAbout.RunRaceDetailInfo; |
| 12 | 14 | |
| 13 | 15 | import java.util.List; |
| ... | ... | @@ -89,7 +91,23 @@ public interface ApiServiceDaren { |
| 89 | 91 | @POST("Daren/group/userAddGroup.action") |
| 90 | 92 | Observable<Result<BaseInfo>> userAddGroup(@QueryMap Map<String, String> map); |
| 91 | 93 | |
| 94 | + /** | |
| 95 | + * 参与约跑人员列表 | |
| 96 | + */ | |
| 97 | + @POST("Daren/event/getSignUpList.action") | |
| 98 | + Observable<Result<BaseInfo<TakePartPeopleInfo>>> getTakePartPeople(@QueryMap() Map<String, String> maps); | |
| 92 | 99 | |
| 100 | + /** | |
| 101 | + * 约跑报名 | |
| 102 | + */ | |
| 103 | + @POST("Daren/event/signUp.action") | |
| 104 | + Observable<Result<BaseInfo>> getRegisterInfo(@QueryMap() Map<String, String> maps); | |
| 105 | + | |
| 106 | + /** | |
| 107 | + * 约跑全部成绩 | |
| 108 | + */ | |
| 109 | + @POST("Daren/event/getByEventGetRecord.action") | |
| 110 | + Observable<Result<BaseInfo<RaceRecordInfo>>> getAllRaceRecordInfo(@QueryMap() Map<String, String> maps); | |
| 93 | 111 | /************************************体育中国跑步相关网络接口**********************************************************/ |
| 94 | 112 | /** |
| 95 | 113 | * http://bj.gitlab.cnlive.com/cnlive/BOSS-Wiki/wikis/getEventDetails | ... | ... |
lib_network/src/main/java/com/cnlive/strike/data/network/model/RaceRecordInfo.java
0 → 100644
| 1 | +package com.cnlive.strike.data.network.model; | |
| 2 | + | |
| 3 | + | |
| 4 | +import java.util.List; | |
| 5 | + | |
| 6 | +/** | |
| 7 | + * Created by hanyayun 019/06/14. | |
| 8 | + */ | |
| 9 | +public class RaceRecordInfo { | |
| 10 | + /** | |
| 11 | + * eventRouteRecordBeanVoList : [{"createTime":1559722967000,"employTime":"00:88","eventTitle":"2018国际网络徒步大赛黄金海岸站","latLongitude":"[\"39.74788,116.14294\",\"39.74888,116.14394\"]","mileage":"5.4","pace":"22.33","recordId":4,"roadmap":"http://wjjtest.ys2.cnliveimg.com/802/img/2018/1205/ff80808166c2a45201677ce7aff652e9/000001.jpg","step":"10000"},{"createTime":1559722832000,"employTime":"00:0:55","eventTitle":"2018国际网络徒步大赛黄金海岸站","latLongitude":"[\"39.74788,116.14294\",\"39.74888,116.14394\"]","mileage":"5.3","pace":"22.33","recordId":3,"roadmap":"http://wjjtest.ys2.cnliveimg.com/802/img/2018/1205/ff80808166c2a45201677ce7aff652e9/000001.jpg","step":"10003"}] | |
| 12 | + * bestResult : {"employTime":"88","eventTitle":"2018国际网络徒步大赛黄金海岸站","latLongitude":"[{\"latitude\":88.88,\"longitude\":88.88}]","mileage":"5","pace":"22.33","recordId":32,"roadmap":"http://wjjtest.ys2.cnliveimg.com/802/img/2018/1205/ff80808166c2a45201677ce7aff652e9/000001.jpg","step":"10000"} | |
| 13 | + */ | |
| 14 | + | |
| 15 | + private BestResultBean bestResult; | |
| 16 | + private List<EventRouteRecordBeanVoListBean> eventRouteRecordBeanVoList; | |
| 17 | + | |
| 18 | + public BestResultBean getBestResult() { | |
| 19 | + return bestResult; | |
| 20 | + } | |
| 21 | + | |
| 22 | + public void setBestResult(BestResultBean bestResult) { | |
| 23 | + this.bestResult = bestResult; | |
| 24 | + } | |
| 25 | + | |
| 26 | + public List<EventRouteRecordBeanVoListBean> getEventRouteRecordBeanVoList() { | |
| 27 | + return eventRouteRecordBeanVoList; | |
| 28 | + } | |
| 29 | + | |
| 30 | + public void setEventRouteRecordBeanVoList(List<EventRouteRecordBeanVoListBean> eventRouteRecordBeanVoList) { | |
| 31 | + this.eventRouteRecordBeanVoList = eventRouteRecordBeanVoList; | |
| 32 | + } | |
| 33 | + | |
| 34 | + public static class BestResultBean { | |
| 35 | + /** | |
| 36 | + * employTime : 88 | |
| 37 | + * eventTitle : 2018国际网络徒步大赛黄金海岸站 | |
| 38 | + * latLongitude : [{"latitude":88.88,"longitude":88.88}] | |
| 39 | + * mileage : 5 | |
| 40 | + * pace : 22.33 | |
| 41 | + * recordId : 32 | |
| 42 | + * roadmap : http://wjjtest.ys2.cnliveimg.com/802/img/2018/1205/ff80808166c2a45201677ce7aff652e9/000001.jpg | |
| 43 | + * step : 10000 | |
| 44 | + */ | |
| 45 | + | |
| 46 | + private String employTime; | |
| 47 | + private String eventTitle; | |
| 48 | + private String latLongitude; | |
| 49 | + private String mileage; | |
| 50 | + private String pace; | |
| 51 | + private int recordId; | |
| 52 | + private String roadmap; | |
| 53 | + private String step; | |
| 54 | + | |
| 55 | + public String getEmployTime() { | |
| 56 | + return employTime; | |
| 57 | + } | |
| 58 | + | |
| 59 | + public void setEmployTime(String employTime) { | |
| 60 | + this.employTime = employTime; | |
| 61 | + } | |
| 62 | + | |
| 63 | + public String getEventTitle() { | |
| 64 | + return eventTitle; | |
| 65 | + } | |
| 66 | + | |
| 67 | + public void setEventTitle(String eventTitle) { | |
| 68 | + this.eventTitle = eventTitle; | |
| 69 | + } | |
| 70 | + | |
| 71 | + public String getLatLongitude() { | |
| 72 | + return latLongitude; | |
| 73 | + } | |
| 74 | + | |
| 75 | + public void setLatLongitude(String latLongitude) { | |
| 76 | + this.latLongitude = latLongitude; | |
| 77 | + } | |
| 78 | + | |
| 79 | + public String getMileage() { | |
| 80 | + return mileage; | |
| 81 | + } | |
| 82 | + | |
| 83 | + public void setMileage(String mileage) { | |
| 84 | + this.mileage = mileage; | |
| 85 | + } | |
| 86 | + | |
| 87 | + public String getPace() { | |
| 88 | + return pace; | |
| 89 | + } | |
| 90 | + | |
| 91 | + public void setPace(String pace) { | |
| 92 | + this.pace = pace; | |
| 93 | + } | |
| 94 | + | |
| 95 | + public int getRecordId() { | |
| 96 | + return recordId; | |
| 97 | + } | |
| 98 | + | |
| 99 | + public void setRecordId(int recordId) { | |
| 100 | + this.recordId = recordId; | |
| 101 | + } | |
| 102 | + | |
| 103 | + public String getRoadmap() { | |
| 104 | + return roadmap; | |
| 105 | + } | |
| 106 | + | |
| 107 | + public void setRoadmap(String roadmap) { | |
| 108 | + this.roadmap = roadmap; | |
| 109 | + } | |
| 110 | + | |
| 111 | + public String getStep() { | |
| 112 | + return step; | |
| 113 | + } | |
| 114 | + | |
| 115 | + public void setStep(String step) { | |
| 116 | + this.step = step; | |
| 117 | + } | |
| 118 | + } | |
| 119 | + | |
| 120 | + public static class EventRouteRecordBeanVoListBean { | |
| 121 | + /** | |
| 122 | + * createTime : 1559722967000 | |
| 123 | + * employTime : 00:88 | |
| 124 | + * eventTitle : 2018国际网络徒步大赛黄金海岸站 | |
| 125 | + * latLongitude : ["39.74788,116.14294","39.74888,116.14394"] | |
| 126 | + * mileage : 5.4 | |
| 127 | + * pace : 22.33 | |
| 128 | + * recordId : 4 | |
| 129 | + * roadmap : http://wjjtest.ys2.cnliveimg.com/802/img/2018/1205/ff80808166c2a45201677ce7aff652e9/000001.jpg | |
| 130 | + * step : 10000 | |
| 131 | + */ | |
| 132 | + | |
| 133 | + private long createTime; | |
| 134 | + private String employTime; | |
| 135 | + private String eventTitle; | |
| 136 | + private String latLongitude; | |
| 137 | + private String mileage; | |
| 138 | + private String pace; | |
| 139 | + private int recordId; | |
| 140 | + private String roadmap; | |
| 141 | + private String step; | |
| 142 | + | |
| 143 | + public long getCreateTime() { | |
| 144 | + return createTime; | |
| 145 | + } | |
| 146 | + | |
| 147 | + public void setCreateTime(long createTime) { | |
| 148 | + this.createTime = createTime; | |
| 149 | + } | |
| 150 | + | |
| 151 | + public String getEmployTime() { | |
| 152 | + return employTime; | |
| 153 | + } | |
| 154 | + | |
| 155 | + public void setEmployTime(String employTime) { | |
| 156 | + this.employTime = employTime; | |
| 157 | + } | |
| 158 | + | |
| 159 | + public String getEventTitle() { | |
| 160 | + return eventTitle; | |
| 161 | + } | |
| 162 | + | |
| 163 | + public void setEventTitle(String eventTitle) { | |
| 164 | + this.eventTitle = eventTitle; | |
| 165 | + } | |
| 166 | + | |
| 167 | + public String getLatLongitude() { | |
| 168 | + return latLongitude; | |
| 169 | + } | |
| 170 | + | |
| 171 | + public void setLatLongitude(String latLongitude) { | |
| 172 | + this.latLongitude = latLongitude; | |
| 173 | + } | |
| 174 | + | |
| 175 | + public String getMileage() { | |
| 176 | + return mileage; | |
| 177 | + } | |
| 178 | + | |
| 179 | + public void setMileage(String mileage) { | |
| 180 | + this.mileage = mileage; | |
| 181 | + } | |
| 182 | + | |
| 183 | + public String getPace() { | |
| 184 | + return pace; | |
| 185 | + } | |
| 186 | + | |
| 187 | + public void setPace(String pace) { | |
| 188 | + this.pace = pace; | |
| 189 | + } | |
| 190 | + | |
| 191 | + public int getRecordId() { | |
| 192 | + return recordId; | |
| 193 | + } | |
| 194 | + | |
| 195 | + public void setRecordId(int recordId) { | |
| 196 | + this.recordId = recordId; | |
| 197 | + } | |
| 198 | + | |
| 199 | + public String getRoadmap() { | |
| 200 | + return roadmap; | |
| 201 | + } | |
| 202 | + | |
| 203 | + public void setRoadmap(String roadmap) { | |
| 204 | + this.roadmap = roadmap; | |
| 205 | + } | |
| 206 | + | |
| 207 | + public String getStep() { | |
| 208 | + return step; | |
| 209 | + } | |
| 210 | + | |
| 211 | + public void setStep(String step) { | |
| 212 | + this.step = step; | |
| 213 | + } | |
| 214 | + } | |
| 215 | +} | ... | ... |
lib_network/src/main/java/com/cnlive/strike/data/network/model/TakePartPeopleInfo.java
0 → 100644
| 1 | +package com.cnlive.strike.data.network.model; | |
| 2 | + | |
| 3 | + | |
| 4 | +import java.util.List; | |
| 5 | + | |
| 6 | +/** | |
| 7 | + * Created by hanyayun 019/06/13. | |
| 8 | + */ | |
| 9 | +public class TakePartPeopleInfo { | |
| 10 | + | |
| 11 | + /** | |
| 12 | + * nextPage : 0 | |
| 13 | + * userMsgs : [{"image":"http://yweb0.cnliveimg.com/images/headImg/2018/0918/1537236207514_small.jpg","nickName":"啦啦","userId":"10510277"},{"image":"http://yweb0.cnliveimg.com/images/headImg/2018/1123/1542944785266_small.jpg","nickName":"道健","userId":"10504908"},{"image":"http://yweb0.cnliveimg.com/images/headImg/2018/0902/1535858459612_small.jpg","nickName":"朱亚轩@崇学向善","userId":"10504407"}] | |
| 14 | + */ | |
| 15 | + | |
| 16 | + private int nextPage; | |
| 17 | + private List<UserMsgsBean> userMsgs; | |
| 18 | + | |
| 19 | + public int getNextPage() { | |
| 20 | + return nextPage; | |
| 21 | + } | |
| 22 | + | |
| 23 | + public void setNextPage(int nextPage) { | |
| 24 | + this.nextPage = nextPage; | |
| 25 | + } | |
| 26 | + | |
| 27 | + public List<UserMsgsBean> getUserMsgs() { | |
| 28 | + return userMsgs; | |
| 29 | + } | |
| 30 | + | |
| 31 | + public void setUserMsgs(List<UserMsgsBean> userMsgs) { | |
| 32 | + this.userMsgs = userMsgs; | |
| 33 | + } | |
| 34 | + | |
| 35 | + public static class UserMsgsBean { | |
| 36 | + /** | |
| 37 | + * image : http://yweb0.cnliveimg.com/images/headImg/2018/0918/1537236207514_small.jpg | |
| 38 | + * nickName : 啦啦 | |
| 39 | + * userId : 10510277 | |
| 40 | + */ | |
| 41 | + | |
| 42 | + private String image; | |
| 43 | + private String nickName; | |
| 44 | + private String userId; | |
| 45 | + | |
| 46 | + public String getImage() { | |
| 47 | + return image; | |
| 48 | + } | |
| 49 | + | |
| 50 | + public void setImage(String image) { | |
| 51 | + this.image = image; | |
| 52 | + } | |
| 53 | + | |
| 54 | + public String getNickName() { | |
| 55 | + return nickName; | |
| 56 | + } | |
| 57 | + | |
| 58 | + public void setNickName(String nickName) { | |
| 59 | + this.nickName = nickName; | |
| 60 | + } | |
| 61 | + | |
| 62 | + public String getUserId() { | |
| 63 | + return userId; | |
| 64 | + } | |
| 65 | + | |
| 66 | + public void setUserId(String userId) { | |
| 67 | + this.userId = userId; | |
| 68 | + } | |
| 69 | + } | |
| 70 | +} | ... | ... |
moudle_pedometer/build.gradle
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/RaceRecorPresenter.java
| 1 | 1 | package com.cnlive.moudle.pedometer.frame.presenter; |
| 2 | 2 | |
| 3 | +import android.content.Context; | |
| 4 | +import android.widget.Toast; | |
| 5 | + | |
| 6 | +import com.cnlive.libs.base.logic.Logic; | |
| 7 | +import com.cnlive.libs.base.logic.callback.DataCallback; | |
| 8 | +import com.cnlive.libs.base.logic.callback.FailureCallback; | |
| 9 | +import com.cnlive.libs.base.logic.callback.SuccessCallback; | |
| 3 | 10 | import com.cnlive.moudle.pedometer.frame.view.RaceRecorView; |
| 11 | +import com.cnlive.strike.data.network.api.ApiRequest; | |
| 12 | +import com.cnlive.strike.data.network.api.ApiServiceDaren; | |
| 13 | +import com.cnlive.strike.data.network.model.BaseInfo; | |
| 14 | +import com.cnlive.strike.data.network.model.RaceRecordInfo; | |
| 4 | 15 | import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter; |
| 5 | 16 | |
| 17 | +import java.util.HashMap; | |
| 18 | +import java.util.Map; | |
| 19 | + | |
| 20 | +import io.reactivex.disposables.Disposable; | |
| 21 | + | |
| 6 | 22 | /** |
| 7 | 23 | * Created by hanyayun 019/05/30. |
| 8 | 24 | */ |
| 9 | 25 | public class RaceRecorPresenter extends MvpBasePresenter<RaceRecorView> { |
| 10 | 26 | |
| 11 | - public void getData(){ | |
| 12 | - getView().setData(); | |
| 27 | + public void getData(Context context,String eventId,String sid,String pageNo,String pageSize){ | |
| 28 | + HashMap<String, String> map = new HashMap<>(); | |
| 29 | + map.put("eventId", eventId); | |
| 30 | + map.put("sid", sid); | |
| 31 | + map.put("pageNo", pageNo); | |
| 32 | + map.put("pageSize", pageSize); | |
| 33 | + Logic.create(map).action(new Logic.Action<Map<String, String>, BaseInfo<RaceRecordInfo>>() { | |
| 34 | + @Override | |
| 35 | + public Disposable action(Map<String, String> stringStringMap, DataCallback<BaseInfo<RaceRecordInfo>> dataCallback) { | |
| 36 | + return ApiRequest.observable(ApiServiceDaren.class, api -> api.getAllRaceRecordInfo(stringStringMap)).subscribe(context, dataCallback); | |
| 37 | + } | |
| 38 | + }).<BaseInfo<RaceRecordInfo>>event().setFailureCallback(new FailureCallback() { | |
| 39 | + @Override | |
| 40 | + public void onFailure(int code, String message) { | |
| 41 | + getView().showEmpty(); | |
| 42 | + } | |
| 43 | + }).setSuccessCallback(new SuccessCallback<BaseInfo<RaceRecordInfo>>() { | |
| 44 | + @Override | |
| 45 | + public void onSuccess(BaseInfo<RaceRecordInfo> registerInfo) { | |
| 46 | + if (getView() != null){ | |
| 47 | + getView().setData(registerInfo); | |
| 48 | + } | |
| 49 | + } | |
| 50 | + }).start(); | |
| 51 | + | |
| 13 | 52 | } |
| 14 | 53 | } | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/RegistrationInfoPresenter.java
| 1 | 1 | package com.cnlive.moudle.pedometer.frame.presenter; |
| 2 | 2 | |
| 3 | +import android.content.Context; | |
| 4 | +import android.widget.Toast; | |
| 5 | + | |
| 6 | +import com.cnlive.libs.base.logic.Logic; | |
| 7 | +import com.cnlive.libs.base.logic.callback.DataCallback; | |
| 8 | +import com.cnlive.libs.base.logic.callback.FailureCallback; | |
| 9 | +import com.cnlive.libs.base.logic.callback.SuccessCallback; | |
| 3 | 10 | import com.cnlive.moudle.pedometer.frame.view.RegistrationInfoView; |
| 11 | +import com.cnlive.strike.data.network.api.ApiRequest; | |
| 12 | +import com.cnlive.strike.data.network.api.ApiServiceDaren; | |
| 13 | +import com.cnlive.strike.data.network.model.BaseInfo; | |
| 4 | 14 | import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter; |
| 5 | 15 | |
| 16 | +import java.util.HashMap; | |
| 17 | +import java.util.Map; | |
| 18 | + | |
| 19 | +import io.reactivex.disposables.Disposable; | |
| 20 | + | |
| 6 | 21 | |
| 7 | 22 | /** |
| 8 | 23 | * Created by hanyayun 019/05/29. |
| 9 | 24 | */ |
| 10 | 25 | public class RegistrationInfoPresenter extends MvpBasePresenter<RegistrationInfoView> { |
| 11 | - public void commitInfo(){ | |
| 12 | - getView().toResult(); | |
| 26 | + | |
| 27 | + public void commitInfo(Context context,String eventId,String sid,String mobile,String sex,String birthday){ | |
| 28 | + HashMap<String, String> map = new HashMap<>(); | |
| 29 | + map.put("eventId", eventId); | |
| 30 | + map.put("sid", sid); | |
| 31 | + map.put("mobile", mobile); | |
| 32 | + map.put("sex", ""); | |
| 33 | + map.put("birthday", ""); | |
| 34 | + Logic.create(map).action(new Logic.Action<Map<String, String>, BaseInfo>() { | |
| 35 | + @Override | |
| 36 | + public Disposable action(Map<String, String> stringStringMap, DataCallback<BaseInfo> dataCallback) { | |
| 37 | + return ApiRequest.observable(ApiServiceDaren.class, api -> api.getRegisterInfo(stringStringMap)).subscribe(context, dataCallback); | |
| 38 | + } | |
| 39 | + }).<BaseInfo>event().setFailureCallback(new FailureCallback() { | |
| 40 | + @Override | |
| 41 | + public void onFailure(int code, String message) { | |
| 42 | + Toast.makeText(context,"报名失败",Toast.LENGTH_LONG).show(); | |
| 43 | + } | |
| 44 | + }).setSuccessCallback(new SuccessCallback<BaseInfo>() { | |
| 45 | + @Override | |
| 46 | + public void onSuccess(BaseInfo registerInfo) { | |
| 47 | + if (getView() != null){ | |
| 48 | + getView().toResult(); | |
| 49 | + } | |
| 50 | + } | |
| 51 | + }).start(); | |
| 13 | 52 | } |
| 14 | 53 | } | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/TakePartPresenter.java
| 1 | 1 | package com.cnlive.moudle.pedometer.frame.presenter; |
| 2 | 2 | |
| 3 | +import android.content.Context; | |
| 4 | + | |
| 5 | +import com.cnlive.libs.base.logic.Logic; | |
| 6 | +import com.cnlive.libs.base.logic.callback.DataCallback; | |
| 7 | +import com.cnlive.libs.base.logic.callback.FailureCallback; | |
| 8 | +import com.cnlive.libs.base.logic.callback.SuccessCallback; | |
| 3 | 9 | import com.cnlive.moudle.pedometer.frame.view.TakePartView; |
| 10 | +import com.cnlive.strike.data.network.api.ApiRequest; | |
| 11 | +import com.cnlive.strike.data.network.api.ApiServiceCms; | |
| 12 | +import com.cnlive.strike.data.network.api.ApiServiceDaren; | |
| 13 | +import com.cnlive.strike.data.network.model.AudioAlbumDetailsInfo; | |
| 14 | +import com.cnlive.strike.data.network.model.BaseInfo; | |
| 15 | +import com.cnlive.strike.data.network.model.TakePartPeopleInfo; | |
| 4 | 16 | import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter; |
| 5 | 17 | |
| 18 | +import java.util.HashMap; | |
| 19 | +import java.util.Map; | |
| 20 | + | |
| 21 | +import io.reactivex.disposables.Disposable; | |
| 22 | + | |
| 6 | 23 | /** |
| 7 | 24 | * Created by hanyayun 019/06/03. |
| 8 | 25 | */ |
| 9 | 26 | public class TakePartPresenter extends MvpBasePresenter<TakePartView> { |
| 10 | 27 | |
| 28 | + public void setData(Context context,String eventId, long pageNo, long pageSize){ | |
| 29 | + HashMap<String, String> map = new HashMap<>(); | |
| 30 | + map.put("eventId", eventId); | |
| 31 | + map.put("pageNo", pageNo+""); | |
| 32 | + map.put("pageSize", pageSize+""); | |
| 33 | + Logic.create(map).action(new Logic.Action<Map<String, String>, BaseInfo<TakePartPeopleInfo>>() { | |
| 34 | + @Override | |
| 35 | + public Disposable action(Map<String, String> stringStringMap, DataCallback<BaseInfo<TakePartPeopleInfo>> dataCallback) { | |
| 36 | + return ApiRequest.observable(ApiServiceDaren.class, api -> api.getTakePartPeople(stringStringMap)).subscribe(context, dataCallback); | |
| 37 | + } | |
| 38 | + }).<BaseInfo<TakePartPeopleInfo>>event().setFailureCallback(new FailureCallback() { | |
| 39 | + @Override | |
| 40 | + public void onFailure(int code, String message) { | |
| 41 | + if (getView() != null) getView().showErr(message); | |
| 42 | + } | |
| 43 | + }).setSuccessCallback(new SuccessCallback<BaseInfo<TakePartPeopleInfo>>() { | |
| 44 | + @Override | |
| 45 | + public void onSuccess(BaseInfo<TakePartPeopleInfo> takePartPeopleInfoBaseInfo) { | |
| 46 | + if (getView() != null) getView().onSuccess(takePartPeopleInfoBaseInfo); | |
| 47 | + } | |
| 48 | + }).start(); | |
| 49 | + } | |
| 11 | 50 | } | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RaceRecorView.java
| ... | ... | @@ -7,6 +7,8 @@ import com.cnlive.libs.base.util.StatusBarUtil; |
| 7 | 7 | import com.cnlive.moudle.pedometer.ui.activity.ShareRecordActivity; |
| 8 | 8 | import com.cnlive.moudle.pedometer.ui.adapter.RaceRecordAdapter; |
| 9 | 9 | import com.cnlive.moudle.pedometer.ui.fragment.RaceRecorFragment; |
| 10 | +import com.cnlive.strike.data.network.model.BaseInfo; | |
| 11 | +import com.cnlive.strike.data.network.model.RaceRecordInfo; | |
| 10 | 12 | import com.example.moudle_pedometer.R; |
| 11 | 13 | import com.hannesdorfmann.mosby3.mvp.MvpView; |
| 12 | 14 | |
| ... | ... | @@ -24,7 +26,7 @@ public class RaceRecorView implements MvpView { |
| 24 | 26 | this.fragment = fragment; |
| 25 | 27 | } |
| 26 | 28 | |
| 27 | - public void setData(){ | |
| 29 | + public void setData(BaseInfo<RaceRecordInfo> registerInfo){ | |
| 28 | 30 | List<String> raceRecordModels = new ArrayList<>(); |
| 29 | 31 | raceRecordModels.add("0"); |
| 30 | 32 | raceRecordModels.add("0"); |
| ... | ... | @@ -46,7 +48,7 @@ public class RaceRecorView implements MvpView { |
| 46 | 48 | }); |
| 47 | 49 | } |
| 48 | 50 | |
| 49 | - private void showEmpty(){ | |
| 51 | + public void showEmpty(){ | |
| 50 | 52 | fragment.binding.recordRecy.setVisibility(View.GONE); |
| 51 | 53 | fragment.binding.empty.setVisibility(View.VISIBLE); |
| 52 | 54 | } | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/SelfRecordView.java
| ... | ... | @@ -39,7 +39,7 @@ public class SelfRecordView implements MvpView{ |
| 39 | 39 | fragment.binding.topbar.addLeftImageButton(R.drawable.top_back_black, R.id.fragment_back).setOnClickListener(v -> { |
| 40 | 40 | fragment.getActivity().finish(); |
| 41 | 41 | }); |
| 42 | - fragment.binding.topbar.setTitle("奥森跑道全部成绩"); | |
| 42 | + fragment.binding.topbar.setTitle("我的记录"); | |
| 43 | 43 | fragment.binding.topbar.addRightImageButton(R.drawable.share_img, R.id.fragment_more) |
| 44 | 44 | .setOnClickListener(v -> { |
| 45 | 45 | //分享 | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/TakePartView.java
| ... | ... | @@ -4,6 +4,8 @@ import android.support.v7.widget.LinearLayoutManager; |
| 4 | 4 | |
| 5 | 5 | import com.cnlive.moudle.pedometer.ui.adapter.TakePartAdapter; |
| 6 | 6 | import com.cnlive.moudle.pedometer.ui.fragment.TakePartFragment; |
| 7 | +import com.cnlive.strike.data.network.model.BaseInfo; | |
| 8 | +import com.cnlive.strike.data.network.model.TakePartPeopleInfo; | |
| 7 | 9 | import com.example.moudle_pedometer.R; |
| 8 | 10 | import com.hannesdorfmann.mosby3.mvp.MvpView; |
| 9 | 11 | |
| ... | ... | @@ -27,10 +29,14 @@ public class TakePartView implements MvpView { |
| 27 | 29 | }); |
| 28 | 30 | fragment.binding.topbar.setTitle("已参与"); |
| 29 | 31 | fragment.binding.takePartRecy.setLayoutManager(new LinearLayoutManager(fragment.getActivity())); |
| 30 | - List<String> list = new ArrayList<>(); | |
| 31 | - for(int i = 0;i < 6;i++){ | |
| 32 | - list.add("ss"); | |
| 33 | - } | |
| 34 | - fragment.binding.takePartRecy.setAdapter(new TakePartAdapter(list,fragment.getActivity())); | |
| 32 | + | |
| 33 | + } | |
| 34 | + | |
| 35 | + public void onSuccess(BaseInfo<TakePartPeopleInfo> partPeopleInfoBaseInfo){ | |
| 36 | + fragment.binding.takePartRecy.setAdapter(new TakePartAdapter(partPeopleInfoBaseInfo.getData().getUserMsgs(),fragment.getActivity())); | |
| 37 | + } | |
| 38 | + | |
| 39 | + public void showErr(String msg){ | |
| 40 | + | |
| 35 | 41 | } |
| 36 | 42 | } | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/adapter/TakePartAdapter.java
| ... | ... | @@ -6,9 +6,14 @@ import android.support.v7.widget.RecyclerView; |
| 6 | 6 | import android.view.LayoutInflater; |
| 7 | 7 | import android.view.View; |
| 8 | 8 | import android.view.ViewGroup; |
| 9 | +import android.widget.ImageView; | |
| 10 | +import android.widget.TextView; | |
| 9 | 11 | |
| 12 | +import com.cnlive.strike.application.GlideApp; | |
| 13 | +import com.cnlive.strike.data.network.model.TakePartPeopleInfo; | |
| 10 | 14 | import com.example.moudle_pedometer.R; |
| 11 | 15 | |
| 16 | +import java.time.temporal.Temporal; | |
| 12 | 17 | import java.util.List; |
| 13 | 18 | |
| 14 | 19 | /** |
| ... | ... | @@ -16,10 +21,10 @@ import java.util.List; |
| 16 | 21 | */ |
| 17 | 22 | public class TakePartAdapter extends RecyclerView.Adapter<TakePartAdapter.MyHolder> { |
| 18 | 23 | |
| 19 | - private List<String> list; | |
| 24 | + private List<TakePartPeopleInfo.UserMsgsBean> list; | |
| 20 | 25 | private Context context; |
| 21 | 26 | |
| 22 | - public TakePartAdapter(List<String> list, Context context) { | |
| 27 | + public TakePartAdapter(List<TakePartPeopleInfo.UserMsgsBean> list, Context context) { | |
| 23 | 28 | this.list = list; |
| 24 | 29 | this.context = context; |
| 25 | 30 | } |
| ... | ... | @@ -33,7 +38,8 @@ public class TakePartAdapter extends RecyclerView.Adapter<TakePartAdapter.MyHold |
| 33 | 38 | |
| 34 | 39 | @Override |
| 35 | 40 | public void onBindViewHolder(@NonNull TakePartAdapter.MyHolder myViewHolder, int i) { |
| 36 | - | |
| 41 | + GlideApp.with(context).load(list.get(i).getImage()).into(myViewHolder.icon_img); | |
| 42 | + myViewHolder.nickname.setText(list.get(i).getNickName()); | |
| 37 | 43 | } |
| 38 | 44 | |
| 39 | 45 | @Override |
| ... | ... | @@ -43,8 +49,12 @@ public class TakePartAdapter extends RecyclerView.Adapter<TakePartAdapter.MyHold |
| 43 | 49 | |
| 44 | 50 | class MyHolder extends RecyclerView.ViewHolder{ |
| 45 | 51 | |
| 52 | + ImageView icon_img; | |
| 53 | + TextView nickname; | |
| 46 | 54 | public MyHolder(@NonNull View itemView) { |
| 47 | 55 | super(itemView); |
| 56 | + icon_img = itemView.findViewById(R.id.icon_img); | |
| 57 | + nickname = itemView.findViewById(R.id.nickname); | |
| 48 | 58 | } |
| 49 | 59 | } |
| 50 | 60 | } | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/RegistrationInfoFragment.java
| ... | ... | @@ -10,6 +10,7 @@ import android.view.View; |
| 10 | 10 | import android.view.ViewGroup; |
| 11 | 11 | |
| 12 | 12 | import com.cnlive.libs.base.frame.fragment.MvpBindingFragment; |
| 13 | +import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; | |
| 13 | 14 | import com.cnlive.moudle.pedometer.frame.presenter.RegistrationInfoPresenter; |
| 14 | 15 | import com.cnlive.moudle.pedometer.frame.view.RegistrationInfoView; |
| 15 | 16 | import com.example.moudle_pedometer.R; |
| ... | ... | @@ -40,6 +41,6 @@ public class RegistrationInfoFragment extends MvpBindingFragment<RegistrationInf |
| 40 | 41 | } |
| 41 | 42 | |
| 42 | 43 | public void commitInfo(){ |
| 43 | - getPresenter().commitInfo(); | |
| 44 | + getPresenter().commitInfo(getActivity(),"116", "10514343","15210479774","",""); | |
| 44 | 45 | } |
| 45 | 46 | } | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/SelfRecordFragment.java
| ... | ... | @@ -3,15 +3,10 @@ package com.cnlive.moudle.pedometer.ui.fragment; |
| 3 | 3 | |
| 4 | 4 | import android.os.Bundle; |
| 5 | 5 | import android.support.annotation.Nullable; |
| 6 | -import android.support.v4.app.Fragment; | |
| 7 | -import android.view.LayoutInflater; | |
| 8 | 6 | import android.view.View; |
| 9 | -import android.view.ViewGroup; | |
| 10 | 7 | |
| 11 | 8 | import com.cnlive.libs.base.frame.fragment.MvpBindingFragment; |
| 12 | -import com.cnlive.moudle.pedometer.frame.presenter.RaceRecorPresenter; | |
| 13 | 9 | import com.cnlive.moudle.pedometer.frame.presenter.SelfRecordPresenter; |
| 14 | -import com.cnlive.moudle.pedometer.frame.view.RaceRecorView; | |
| 15 | 10 | import com.cnlive.moudle.pedometer.frame.view.SelfRecordView; |
| 16 | 11 | import com.example.moudle_pedometer.R; |
| 17 | 12 | import com.example.moudle_pedometer.databinding.FragmentSelfRecordBinding; | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/TakePartFragment.java
| ... | ... | @@ -32,6 +32,7 @@ public class TakePartFragment extends MvpBindingFragment<TakePartView, TakePartP |
| 32 | 32 | @Override |
| 33 | 33 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { |
| 34 | 34 | super.onViewCreated(view, savedInstanceState); |
| 35 | + getPresenter().setData(getActivity(),"116",0,10); | |
| 35 | 36 | if(getMvpView() != null)getMvpView().initView(); |
| 36 | 37 | } |
| 37 | 38 | } | ... | ... |