Add rate gallery

This commit is contained in:
seven332 committed 2016-02-05 02:10:23 +08:00
1 parent f7b443e0fa
commit dfbe3767fe
12 files changed
+395 -3

No files matched your search

@@ -41,6 +41,7 @@ public class EhClient {
public static final int METHOD_GET_GALLERY_LIST = 1;
public static final int METHOD_GET_GALLERY_DETAIL = 2;
public static final int METHOD_GET_LARGE_PREVIEW_SET = 3;
public static final int METHOD_GET_RATE_GALLERY = 4;
private final ThreadPoolExecutor mRequestThreadPool;
private final OkHttpClient mOkHttpClient;
@@ -149,6 +150,17 @@ public class EhClient {
}
}
private Object rateGallery(EhConfig ehConfig, Object... params) throws Exception {
Call call = EhEngine.prepareRateGallery(mOkHttpClient, ehConfig,
(Integer) params[0], (String) params[1], (Float) params[2]);
if (!mStop) {
mCall = call;
return EhEngine.doRateGallery(call);
} else {
throw new CancelledException();
}
}
@Override
protected Object doInBackground(Object... params) {
try {
@@ -161,6 +173,8 @@ public class EhClient {
return getGalleryDetail(mEhConfig, params);
case METHOD_GET_LARGE_PREVIEW_SET:
return getLargePreviewSet(mEhConfig, params);
case METHOD_GET_RATE_GALLERY:
return rateGallery(mEhConfig, params);
default:
return new IllegalStateException("Can't detect method " + mMethod);
}