Initial commit
This commit is contained in:
@@ -0,0 +1,109 @@
|
||||
package com.ubt.jimu.community.activity.repository;
|
||||
|
||||
import com.ubt.jimu.JimuApplication;
|
||||
import com.ubt.jimu.base.entities.Act;
|
||||
import com.ubt.jimu.base.entities.ApiRecord;
|
||||
import com.ubt.jimu.base.entities.Award;
|
||||
import com.ubt.jimu.base.entities.AwardItem;
|
||||
import com.ubt.jimu.base.entities.InfoStatus;
|
||||
import com.ubt.jimu.base.entities.JoinArticle;
|
||||
import com.ubt.jimu.base.entities.Push;
|
||||
import com.ubt.jimu.base.entities.UComment;
|
||||
import com.ubt.jimu.base.http.ApiClient;
|
||||
import com.ubt.jimu.base.http.service.CommunityService;
|
||||
import com.unity3d.ads.adunit.AdUnitActivity;
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.functions.BiFunction;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ActivityRepository {
|
||||
public static Observable<List<Act>> a(int i, int i2) {
|
||||
HashMap hashMap = new HashMap();
|
||||
hashMap.put("pageIndex", String.valueOf(i));
|
||||
hashMap.put("pageSize", String.valueOf(i2));
|
||||
hashMap.put("systemLanguage", JimuApplication.l().g());
|
||||
hashMap.put("systemArea", JimuApplication.l().c());
|
||||
return ((CommunityService) ApiClient.getService(CommunityService.class)).getActivityList(hashMap);
|
||||
}
|
||||
|
||||
public static Observable<String> b(Map<String, String> map) {
|
||||
return ((CommunityService) ApiClient.getService(CommunityService.class)).postLike(map);
|
||||
}
|
||||
|
||||
public static Observable<List<Award>> c(long j) {
|
||||
return ((CommunityService) ApiClient.getService(CommunityService.class)).getAwardSettingList(j);
|
||||
}
|
||||
|
||||
public static Observable<List<AwardItem>> b(long j) {
|
||||
return ((CommunityService) ApiClient.getService(CommunityService.class)).getAwardList(j);
|
||||
}
|
||||
|
||||
public static Observable<UComment> c(Map<String, String> map) {
|
||||
return ((CommunityService) ApiClient.getService(CommunityService.class)).postReply(map);
|
||||
}
|
||||
|
||||
public static Observable<Act> a(long j) {
|
||||
return ((CommunityService) ApiClient.getService(CommunityService.class)).getActivityById(j);
|
||||
}
|
||||
|
||||
public static Observable<List<UComment>> a(Map<String, String> map) {
|
||||
return ((CommunityService) ApiClient.getService(CommunityService.class)).getActivityCommentList(map);
|
||||
}
|
||||
|
||||
public static Observable<ApiRecord<JoinArticle>> a(long j, int i, int i2) {
|
||||
return ((CommunityService) ApiClient.getService(CommunityService.class)).getJoinActivityArticleList(j, i, i2, 1);
|
||||
}
|
||||
|
||||
public static Observable<List<Push>> a(String str, long j) {
|
||||
HashMap hashMap = new HashMap();
|
||||
hashMap.put("userId", str);
|
||||
hashMap.put(AdUnitActivity.EXTRA_ACTIVITY_ID, String.valueOf(j));
|
||||
hashMap.put("activityType", "3");
|
||||
hashMap.put("systemLanguage", JimuApplication.l().g());
|
||||
hashMap.put("systemArea", JimuApplication.l().c());
|
||||
return ((CommunityService) ApiClient.getService(CommunityService.class)).getUserAwardInfo(hashMap);
|
||||
}
|
||||
|
||||
public static Observable<InfoStatus> a(int i) {
|
||||
return ((CommunityService) ApiClient.getService(CommunityService.class)).setUserRewards(i);
|
||||
}
|
||||
|
||||
public static Observable<List<Push>> a() {
|
||||
HashMap hashMap = new HashMap();
|
||||
hashMap.put("activityType", String.valueOf(1));
|
||||
hashMap.put("systemLanguage", JimuApplication.l().g());
|
||||
hashMap.put("systemArea", JimuApplication.l().c());
|
||||
Observable<List<Push>> activityByType = ((CommunityService) ApiClient.getService(CommunityService.class)).getActivityByType(hashMap);
|
||||
HashMap hashMap2 = new HashMap();
|
||||
hashMap2.put("activityType", String.valueOf(2));
|
||||
hashMap2.put("systemLanguage", JimuApplication.l().g());
|
||||
hashMap2.put("systemArea", JimuApplication.l().c());
|
||||
return Observable.zip(activityByType, ((CommunityService) ApiClient.getService(CommunityService.class)).getActivityByType(hashMap2), new BiFunction<List<Push>, List<Push>, List<Push>>() { // from class: com.ubt.jimu.community.activity.repository.ActivityRepository.1
|
||||
@Override // io.reactivex.functions.BiFunction
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public List<Push> apply(List<Push> list, List<Push> list2) throws Exception {
|
||||
ArrayList arrayList = new ArrayList();
|
||||
if (list != null && list.size() > 0) {
|
||||
Iterator<Push> it = list.iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().setType(1);
|
||||
}
|
||||
arrayList.addAll(list);
|
||||
}
|
||||
if (list2 != null && list2.size() > 0) {
|
||||
Iterator<Push> it2 = list2.iterator();
|
||||
while (it2.hasNext()) {
|
||||
it2.next().setType(2);
|
||||
}
|
||||
arrayList.addAll(list2);
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user