|
|
@@ -6,9 +6,15 @@ package kr.co.zumo.app.lifeplus.network.api;
|
|
|
import io.reactivex.Single;
|
|
|
import kr.co.zumo.app.lifeplus.bean.BlankBean;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.BannerResultBean;
|
|
|
+import kr.co.zumo.app.lifeplus.bean.api.FAQResultBean;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.LifeplusAPIBean;
|
|
|
+import kr.co.zumo.app.lifeplus.bean.api.MemberJoinRequestBean;
|
|
|
+import kr.co.zumo.app.lifeplus.bean.api.MemberJoinResultBean;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.MobileAuthorizationRequestBean;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.MobileAuthorizationConfirmRequestBean;
|
|
|
+import kr.co.zumo.app.lifeplus.bean.api.PolicyConfirmRequestBean;
|
|
|
+import kr.co.zumo.app.lifeplus.bean.api.PolicyResultBean;
|
|
|
+import kr.co.zumo.app.lifeplus.bean.api.UserNumberBean;
|
|
|
import kr.co.zumo.app.lifeplus.config.NetworkConfig;
|
|
|
|
|
|
/**
|
|
|
@@ -21,12 +27,11 @@ import kr.co.zumo.app.lifeplus.config.NetworkConfig;
|
|
|
* @history 민효동 [2018. 9. 19.] [최초 작성]
|
|
|
* @since 2018. 9. 19.
|
|
|
*/
|
|
|
-public class LifeplusAPIService extends RetrofitService {
|
|
|
+public class LifeplusAPIService extends RetrofitService implements LifeplusAPI {
|
|
|
|
|
|
private static final String AUTH_URL = NetworkConfig.HOST_URL + ":" + NetworkConfig.HOST_PORT + "/";
|
|
|
- private static final String METHOD_GET = "GET";
|
|
|
|
|
|
- private static LifeplusAPI api(String url) {
|
|
|
+ private LifeplusAPI api(String url) {
|
|
|
return retrofit(url, LifeplusAPI.class, 2000);
|
|
|
}
|
|
|
|
|
|
@@ -36,7 +41,8 @@ public class LifeplusAPIService extends RetrofitService {
|
|
|
* @param bean MobileAuthorizationRequestBean
|
|
|
* @return rx single with LifeplusAPIBean
|
|
|
*/
|
|
|
- public static Single<LifeplusAPIBean> requestMobileAuthorizationNumber(MobileAuthorizationRequestBean bean) {
|
|
|
+ @Override
|
|
|
+ public Single<LifeplusAPIBean> requestMobileAuth(MobileAuthorizationRequestBean bean) {
|
|
|
return api(AUTH_URL).requestMobileAuth(bean);
|
|
|
}
|
|
|
|
|
|
@@ -46,7 +52,8 @@ public class LifeplusAPIService extends RetrofitService {
|
|
|
* @param bean MobileAuthorizationConfirmRequestBean
|
|
|
* @return rx single with LifeplusAPIBean
|
|
|
*/
|
|
|
- public static Single<LifeplusAPIBean> requestMobileAuthorization(MobileAuthorizationConfirmRequestBean bean) {
|
|
|
+ @Override
|
|
|
+ public Single<LifeplusAPIBean> confirmMobileAuth(MobileAuthorizationConfirmRequestBean bean) {
|
|
|
return api(AUTH_URL).confirmMobileAuth(bean);
|
|
|
}
|
|
|
|
|
|
@@ -56,7 +63,62 @@ public class LifeplusAPIService extends RetrofitService {
|
|
|
* @param bean
|
|
|
* @return
|
|
|
*/
|
|
|
- public static Single<BannerResultBean> getBannerList(BlankBean bean) {
|
|
|
+ public Single<BannerResultBean> getBannerList(BlankBean bean) {
|
|
|
return api(AUTH_URL).getBannerList(bean);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 약관 리스트 가져오기
|
|
|
+ *
|
|
|
+ * @param bean
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Single<PolicyResultBean> getPolicyList(BlankBean bean) {
|
|
|
+ return api(AUTH_URL).getPolicyList(bean);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 약관 확인
|
|
|
+ *
|
|
|
+ * @param bean
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Single<LifeplusAPIBean> confirmPolicy(PolicyConfirmRequestBean bean) {
|
|
|
+ return api(AUTH_URL).confirmPolicy(bean);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 회원 가입
|
|
|
+ *
|
|
|
+ * @param bean
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Single<MemberJoinResultBean> insertMember(MemberJoinRequestBean bean) {
|
|
|
+ return api(AUTH_URL).insertMember(bean);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 회원 탈퇴
|
|
|
+ *
|
|
|
+ * @param bean
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Single<LifeplusAPIBean> deleteMember(UserNumberBean bean) {
|
|
|
+ return api(AUTH_URL).deleteMember(bean);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * FAQ 리스트 가져오기
|
|
|
+ *
|
|
|
+ * @param bean
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Single<FAQResultBean> getFaqList(BlankBean bean) {
|
|
|
+ return api(AUTH_URL).getFaqList(bean);
|
|
|
+ }
|
|
|
}
|