|
|
@@ -6,6 +6,11 @@ package kr.co.zumo.app.lifeplus.network.api;
|
|
|
import io.reactivex.Single;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.AuthConfirmBean;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.AuthNumberBean;
|
|
|
+import kr.co.zumo.app.lifeplus.bean.api.BookmarkResultBean;
|
|
|
+import kr.co.zumo.app.lifeplus.bean.api.BucketBestListResultBean;
|
|
|
+import kr.co.zumo.app.lifeplus.bean.api.BucketListRequestBean;
|
|
|
+import kr.co.zumo.app.lifeplus.bean.api.BucketListResultBean;
|
|
|
+import kr.co.zumo.app.lifeplus.bean.api.BucketMyListResultBean;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.CategoryBannerResultBean;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.CategoryContentsResultBean;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.CategoryRecommendResultBean;
|
|
|
@@ -44,10 +49,22 @@ import kr.co.zumo.app.lifeplus.config.NetworkConfig;
|
|
|
*/
|
|
|
public class LifeplusAPIService extends RetrofitService implements LifeplusAPI {
|
|
|
|
|
|
- private static final String AUTH_URL = NetworkConfig.HOST_URL + ":" + NetworkConfig.HOST_PORT + "/";
|
|
|
+ private final String API_URL;
|
|
|
|
|
|
- private LifeplusAPI api(String url) {
|
|
|
- return retrofit(url, LifeplusAPI.class, 2000);
|
|
|
+ public LifeplusAPIService() {
|
|
|
+ API_URL = NetworkConfig.HOST_URL + ":" + NetworkConfig.HOST_PORT + "/";
|
|
|
+ }
|
|
|
+
|
|
|
+ public LifeplusAPIService(String apiUrl) {
|
|
|
+ API_URL = apiUrl;
|
|
|
+ }
|
|
|
+
|
|
|
+ private String getApiUrl() {
|
|
|
+ return API_URL;
|
|
|
+ }
|
|
|
+
|
|
|
+ private LifeplusAPI api() {
|
|
|
+ return retrofit(getApiUrl(), LifeplusAPI.class, 2000);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -58,7 +75,7 @@ public class LifeplusAPIService extends RetrofitService implements LifeplusAPI {
|
|
|
*/
|
|
|
@Override
|
|
|
public Single<LifeplusAPIBean> requestMobileAuth(AuthNumberBean bean) {
|
|
|
- return api(AUTH_URL).requestMobileAuth(bean);
|
|
|
+ return api().requestMobileAuth(bean);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -69,7 +86,7 @@ public class LifeplusAPIService extends RetrofitService implements LifeplusAPI {
|
|
|
*/
|
|
|
@Override
|
|
|
public Single<LifeplusAPIBean> confirmMobileAuth(AuthConfirmBean bean) {
|
|
|
- return api(AUTH_URL).confirmMobileAuth(bean);
|
|
|
+ return api().confirmMobileAuth(bean);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -80,7 +97,7 @@ public class LifeplusAPIService extends RetrofitService implements LifeplusAPI {
|
|
|
*/
|
|
|
@Override
|
|
|
public Single<PolicyResultBean> getPolicyList(RequestBean bean) {
|
|
|
- return api(AUTH_URL).getPolicyList(bean);
|
|
|
+ return api().getPolicyList(bean);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -91,7 +108,7 @@ public class LifeplusAPIService extends RetrofitService implements LifeplusAPI {
|
|
|
*/
|
|
|
@Override
|
|
|
public Single<LifeplusAPIBean> confirmPolicy(PolicyConfirmRequestBean bean) {
|
|
|
- return api(AUTH_URL).confirmPolicy(bean);
|
|
|
+ return api().confirmPolicy(bean);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -102,7 +119,7 @@ public class LifeplusAPIService extends RetrofitService implements LifeplusAPI {
|
|
|
*/
|
|
|
@Override
|
|
|
public Single<MemberJoinResultBean> insertMember(MemberJoinRequestBean bean) {
|
|
|
- return api(AUTH_URL).insertMember(bean);
|
|
|
+ return api().insertMember(bean);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -113,7 +130,7 @@ public class LifeplusAPIService extends RetrofitService implements LifeplusAPI {
|
|
|
*/
|
|
|
@Override
|
|
|
public Single<LifeplusAPIBean> deleteMember(UserNoBean bean) {
|
|
|
- return api(AUTH_URL).deleteMember(bean);
|
|
|
+ return api().deleteMember(bean);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -124,7 +141,7 @@ public class LifeplusAPIService extends RetrofitService implements LifeplusAPI {
|
|
|
*/
|
|
|
@Override
|
|
|
public Single<FAQResultBean> getFaqList(RequestBean bean) {
|
|
|
- return api(AUTH_URL).getFaqList(bean);
|
|
|
+ return api().getFaqList(bean);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -135,7 +152,7 @@ public class LifeplusAPIService extends RetrofitService implements LifeplusAPI {
|
|
|
*/
|
|
|
@Override
|
|
|
public Single<LoginResultBean> selectMember(UserNoBean bean) {
|
|
|
- return api(AUTH_URL).selectMember(bean);
|
|
|
+ return api().selectMember(bean);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -146,7 +163,7 @@ public class LifeplusAPIService extends RetrofitService implements LifeplusAPI {
|
|
|
*/
|
|
|
@Override
|
|
|
public Single<LifeplusAPIBean> updateUnRestMember(UserNoBean bean) {
|
|
|
- return api(AUTH_URL).updateUnRestMember(bean);
|
|
|
+ return api().updateUnRestMember(bean);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -157,7 +174,7 @@ public class LifeplusAPIService extends RetrofitService implements LifeplusAPI {
|
|
|
*/
|
|
|
@Override
|
|
|
public Single<MainContentsResultBean> getMainContents(RequestBean bean) {
|
|
|
- return api(AUTH_URL).getMainContents(bean);
|
|
|
+ return api().getMainContents(bean);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -168,7 +185,7 @@ public class LifeplusAPIService extends RetrofitService implements LifeplusAPI {
|
|
|
*/
|
|
|
@Override
|
|
|
public Single<CategoryRecommendResultBean> getCategoryRecommendContents(CategoryRequestBean bean) {
|
|
|
- return api(AUTH_URL).getCategoryRecommendContents(bean);
|
|
|
+ return api().getCategoryRecommendContents(bean);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -179,7 +196,7 @@ public class LifeplusAPIService extends RetrofitService implements LifeplusAPI {
|
|
|
*/
|
|
|
@Override
|
|
|
public Single<CategoryBannerResultBean> getCategoryBanner(CategoryRequestBean bean) {
|
|
|
- return api(AUTH_URL).getCategoryBanner(bean);
|
|
|
+ return api().getCategoryBanner(bean);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -190,7 +207,62 @@ public class LifeplusAPIService extends RetrofitService implements LifeplusAPI {
|
|
|
*/
|
|
|
@Override
|
|
|
public Single<CategoryContentsResultBean> getCategoryContents(CategoryRequestBean bean) {
|
|
|
- return api(AUTH_URL).getCategoryContents(bean);
|
|
|
+ return api().getCategoryContents(bean);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 나의 북마크 리스트
|
|
|
+ *
|
|
|
+ * @param bean
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Single<BookmarkResultBean> getMyBookmarkList(UserNoBean bean) {
|
|
|
+ return api().getMyBookmarkList(bean);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 최근 많이 북마크 된 리스트
|
|
|
+ *
|
|
|
+ * @param bean
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Single<BookmarkResultBean> getLatsBookmarkList(UserNoBean bean) {
|
|
|
+ return api().getLatsBookmarkList(bean);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 베스트 버킷 리스트
|
|
|
+ *
|
|
|
+ * @param bean
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Single<BucketBestListResultBean> getBestBucketList(RequestBean bean) {
|
|
|
+ return api().getBestBucketList(bean);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 버킷 리스트 목록
|
|
|
+ *
|
|
|
+ * @param bean
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Single<BucketListResultBean> getBucketList(BucketListRequestBean bean) {
|
|
|
+ return api().getBucketList(bean);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 나의 버킷 리스트
|
|
|
+ *
|
|
|
+ * @param bean
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Single<BucketMyListResultBean> getMyBucketList(UserNoBean bean) {
|
|
|
+ return api().getMyBucketList(bean);
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -204,7 +276,7 @@ public class LifeplusAPIService extends RetrofitService implements LifeplusAPI {
|
|
|
*/
|
|
|
@Override
|
|
|
public Single<CodeResultBean> getCodes(RequestBean bean) {
|
|
|
- return api(AUTH_URL).getCodes(bean);
|
|
|
+ return api().getCodes(bean);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -215,42 +287,42 @@ public class LifeplusAPIService extends RetrofitService implements LifeplusAPI {
|
|
|
*/
|
|
|
@Override
|
|
|
public Single<CodeResultBean> setCodes(CodeRequestBean bean) {
|
|
|
- return api(AUTH_URL).setCodes(bean);
|
|
|
+ return api().setCodes(bean);
|
|
|
}
|
|
|
|
|
|
|
|
|
@Override
|
|
|
public Single<SettingResultBean> getSettings(RequestBean bean) {
|
|
|
- return api(AUTH_URL).getSettings(bean);
|
|
|
+ return api().getSettings(bean);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public Single<SettingMemberResultBean> getMemberInfo(RequestBean bean) {
|
|
|
- return api(AUTH_URL).getMemberInfo(bean);
|
|
|
+ return api().getMemberInfo(bean);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public Single<SettingMemberEmailResultBean> setMemberEmail(SettingMemberEmailRequestBean bean) {
|
|
|
- return api(AUTH_URL).setMemberEmail(bean);
|
|
|
+ return api().setMemberEmail(bean);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public Single<CoinResultBean> getCoins(RequestBean bean) {
|
|
|
- return api(AUTH_URL).getCoins(bean);
|
|
|
+ return api().getCoins(bean);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public Single<NotificationResultBean> getNotification(RequestBean bean) {
|
|
|
- return api(AUTH_URL).getNotification(bean);
|
|
|
+ return api().getNotification(bean);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public Single<QuestionResultBean> getQuestionList(RequestBean bean) {
|
|
|
- return api(AUTH_URL).getQuestionList(bean);
|
|
|
+ return api().getQuestionList(bean);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public Single<LifeplusAPIBean> registerQuestion(QuestionRequestBean bean) {
|
|
|
- return api(AUTH_URL).registerQuestion(bean);
|
|
|
+ return api().registerQuestion(bean);
|
|
|
}
|
|
|
}
|