瀏覽代碼

Merge branch 'develop' of https://github.com/swict/LifePlusAndroid into develop

Hasemi 7 年之前
父節點
當前提交
f1c1ea5c3b

+ 23 - 1
app/src/common/java/kr/co/zumo/app/lifeplus/network/api/LifeplusAPIService.java

@@ -239,7 +239,7 @@ public class LifeplusAPIService extends RetrofitService implements LifeplusAPI {
   }
 
   /**
-   * 카테고리 메인 - 컨텐츠
+   * 카테고리 메인 - 컨텐츠, 최신 순
    *
    * @param bean
    * @return
@@ -249,6 +249,28 @@ public class LifeplusAPIService extends RetrofitService implements LifeplusAPI {
     return api().getCategoryContents(bean);
   }
 
+  /**
+   * 카테고리 메인 - 컨텐츠, 좋아요 순
+   *
+   * @param bean
+   * @return
+   */
+  @Override
+  public Single<CategoryContentsResultBean> getCategoryContentsOrderByLike(CategoryRequestBean bean) {
+    return api().getCategoryContentsOrderByLike(bean);
+  }
+
+  /**
+   * 카테고리 메인 - 컨텐츠, 북마크 순
+   *
+   * @param bean
+   * @return
+   */
+  @Override
+  public Single<CategoryContentsResultBean> getCategoryContentsOrderByBookmark(CategoryRequestBean bean) {
+    return api().getCategoryContentsOrderByBookmark(bean);
+  }
+
   /**
    * 나의 북마크 리스트
    *

+ 1 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/bean/api/FAQBean.java

@@ -37,7 +37,7 @@ public class FAQBean extends JsonBeanBase {
   private int id;
   @SerializedName("cate")
   private String category;
-  @SerializedName("faqTitle")
+  @SerializedName("faqTitl")
   private String title;
   @SerializedName("faqContents")
   private String contents;

+ 35 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/model/module/APICategoryContentsLoadModule.java

@@ -3,6 +3,11 @@
  */
 package kr.co.zumo.app.lifeplus.model.module;
 
+import android.support.annotation.IntDef;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
 import io.reactivex.Single;
 import kr.co.zumo.app.lifeplus.bean.api.CategoryContentsResultBean;
 import kr.co.zumo.app.lifeplus.bean.api.CategoryRequestBean;
@@ -19,8 +24,37 @@ import kr.co.zumo.app.lifeplus.network.api.LifeplusAPIRepository;
  * @since 2018. 10. 26.
  */
 public class APICategoryContentsLoadModule extends APIModule<CategoryRequestBean, CategoryContentsResultBean> {
+
+  public static final int ORDER_BY_LATEST = 0;
+  public static final int ORDER_BY_LIKE = 1;
+  public static final int ORDER_BY_BOOKMARK = 2;
+
+  @Retention(RetentionPolicy.SOURCE)
+  @IntDef({
+    ORDER_BY_LATEST, ORDER_BY_LIKE, ORDER_BY_BOOKMARK
+  })
+  public @interface Order {}
+
+  private final int order;
+
+  public APICategoryContentsLoadModule() {
+    this.order = ORDER_BY_LATEST;
+  }
+
+  public APICategoryContentsLoadModule(@Order int order) {
+    this.order = order;
+  }
+
   @Override
   protected Single<CategoryContentsResultBean> getAPI(CategoryRequestBean requestBean) {
-    return new LifeplusAPIRepository().getCategoryContents(requestBean);
+    if (order == ORDER_BY_LIKE) {
+      return new LifeplusAPIRepository().getCategoryContentsOrderByLike(requestBean);
+    }
+    else if (order == ORDER_BY_BOOKMARK) {
+      return new LifeplusAPIRepository().getCategoryContentsOrderByBookmark(requestBean);
+    }
+    else {
+      return new LifeplusAPIRepository().getCategoryContents(requestBean);
+    }
   }
 }

+ 9 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/network/api/LifeplusAPI.java

@@ -102,10 +102,18 @@ public interface LifeplusAPI {
   @POST("mapi/categorys/banner.plus")
   Single<CategoryBannerResultBean> getCategoryBanner(@Body CategoryRequestBean bean);
 
-  // 카테고리 별 콘텐츠 목록, ctgrCntsCtlg
+  // 카테고리 별 콘텐츠 목록, 최신 순
   @POST("mapi/categorys/contents.plus")
   Single<CategoryContentsResultBean> getCategoryContents(@Body CategoryRequestBean bean);
 
+  // 카테고리 별 콘텐츠 목록, 좋아요 순
+  @POST("mapi/categorys/cntslike.plus")
+  Single<CategoryContentsResultBean> getCategoryContentsOrderByLike(@Body CategoryRequestBean bean);
+
+  // 카테고리 별 콘텐츠 목록, 북마크 순
+  @POST("mapi/categorys/cntsbookmark.plus")
+  Single<CategoryContentsResultBean> getCategoryContentsOrderByBookmark(@Body CategoryRequestBean bean);
+
   /***********************************
    * Bookmark
    ***********************************/

+ 10 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/network/api/LifeplusAPIRepository.java

@@ -120,6 +120,16 @@ public class LifeplusAPIRepository implements LifeplusAPI {
     return new LifeplusAPIService().getCategoryContents(bean);
   }
 
+  @Override
+  public Single<CategoryContentsResultBean> getCategoryContentsOrderByLike(CategoryRequestBean bean) {
+    return new LifeplusAPIService().getCategoryContentsOrderByLike(bean);
+  }
+
+  @Override
+  public Single<CategoryContentsResultBean> getCategoryContentsOrderByBookmark(CategoryRequestBean bean) {
+    return new LifeplusAPIService().getCategoryContentsOrderByBookmark(bean);
+  }
+
   @Override
   public Single<BookmarkResultBean> getMyBookmarkList(UserNoRequestBean bean) {
     return new LifeplusAPIService().getMyBookmarkList(bean);
@@ -263,7 +273,6 @@ public class LifeplusAPIRepository implements LifeplusAPI {
     return new LifeplusAPIService().getCoins(bean);
   }
 
-
   @Override
   public Single<NotificationResultBean> getNotification(RequestBean bean) {
     return new LifeplusAPIService().getNotification(bean);

+ 2 - 2
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/category/CategoryMainModel.java

@@ -145,8 +145,8 @@ public class CategoryMainModel extends Model {
   }
 
 
-  public void loadContents(String categoryNumber) {
-    disposableContents = new APICategoryContentsLoadModule().call(new CategoryRequestBean(categoryNumber), new IAPIModuleListener<CategoryContentsResultBean>() {
+  public void loadContents(String categoryNumber, @APICategoryContentsLoadModule.Order int order) {
+    disposableContents = new APICategoryContentsLoadModule(order).call(new CategoryRequestBean(categoryNumber), new IAPIModuleListener<CategoryContentsResultBean>() {
       @Override
       public void onApiSuccess(CategoryContentsResultBean resultBean) {
         contentsBeans = resultBean.getData();

+ 2 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/category/CategoryMainPresenter.java

@@ -6,6 +6,7 @@ import android.util.Log;
 import kr.co.zumo.app.lifeplus.bean.ContentsBean;
 import kr.co.zumo.app.lifeplus.bean.api.LifeplusContentsBean;
 import kr.co.zumo.app.lifeplus.helper.DeliveryHelper;
+import kr.co.zumo.app.lifeplus.model.module.APICategoryContentsLoadModule;
 import kr.co.zumo.app.lifeplus.supervisor.ScreenID;
 import kr.co.zumo.app.lifeplus.view.DoubleChecker;
 import kr.co.zumo.app.lifeplus.view.Event;
@@ -60,7 +61,7 @@ public abstract class CategoryMainPresenter<M extends CategoryMainModel, V exten
   private void init() {
     String categoryNumber = getCategoryNumber();
     model.loadRecommendContents(categoryNumber);
-    model.loadContents(categoryNumber);
+    model.loadContents(categoryNumber, APICategoryContentsLoadModule.ORDER_BY_LATEST);
     model.loadBanner(categoryNumber);
   }
 

+ 26 - 26
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/signup/SignUpAgreeModel.java

@@ -15,7 +15,6 @@ import kr.co.zumo.app.lifeplus.bean.api.LoginResultBean;
 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.PolicyBean;
-import kr.co.zumo.app.lifeplus.bean.api.PolicyConfirmRequestBean;
 import kr.co.zumo.app.lifeplus.bean.api.PolicyListResultBean;
 import kr.co.zumo.app.lifeplus.bean.api.UserNoRequestBean;
 import kr.co.zumo.app.lifeplus.model.Model;
@@ -23,7 +22,6 @@ import kr.co.zumo.app.lifeplus.model.SuperModel;
 import kr.co.zumo.app.lifeplus.model.module.APIMemberInsertModule;
 import kr.co.zumo.app.lifeplus.model.module.APIMemberPolicyLoadModule;
 import kr.co.zumo.app.lifeplus.model.module.APIMemberSelectModule;
-import kr.co.zumo.app.lifeplus.model.module.APIPolicyConfirmModule;
 import kr.co.zumo.app.lifeplus.model.module.IAPIModuleListener;
 import kr.co.zumo.app.lifeplus.model.module.LoginModuleParser;
 import kr.co.zumo.app.lifeplus.supervisor.ScreenIDMapper;
@@ -262,32 +260,34 @@ public class SignUpAgreeModel extends Model {
    * 동의한 약관 전송
    */
   public void sendPolicy() {
+    // 동의 내역은 가입 api 에 추가됨
+    onResult(new Event.Builder(Event.RESULT).integer(Event.POLICY_CONFIRM).build());
 
     // userNo 가 지금은 없음.
-    PolicyConfirmRequestBean policyConfirmRequestBean = new PolicyConfirmRequestBean("");
-
-    List<PolicyBean> agreeBean = getAgreeItems();
-    for (PolicyBean bean : agreeBean) {
-      policyConfirmRequestBean.addBean(bean);
-    }
-
-    disposable.add(new APIPolicyConfirmModule().call(policyConfirmRequestBean, new IAPIModuleListener<LifeplusAPIBean>() {
-        @Override
-        public void onApiSuccess(LifeplusAPIBean resultBean) {
-          onResult(new Event.Builder(Event.RESULT).integer(Event.POLICY_CONFIRM).build());
-        }
-
-        @Override
-        public void onApiReason(LifeplusAPIBean resultBean) {
-          onResult(new Event.Builder(Event.ERROR).string(resultBean.getReturnMessage()).build());
-        }
-
-        @Override
-        public void onApiError(String errorMessage) {
-          onResult(new Event.Builder(Event.ERROR).integer(Event.POLICY_CONFIRM).string(errorMessage).build());
-        }
-      })
-    );
+//    PolicyConfirmRequestBean policyConfirmRequestBean = new PolicyConfirmRequestBean("");
+//
+//    List<PolicyBean> agreeBean = getAgreeItems();
+//    for (PolicyBean bean : agreeBean) {
+//      policyConfirmRequestBean.addBean(bean);
+//    }
+//
+//    disposable.add(new APIPolicyConfirmModule().call(policyConfirmRequestBean, new IAPIModuleListener<LifeplusAPIBean>() {
+//        @Override
+//        public void onApiSuccess(LifeplusAPIBean resultBean) {
+//          onResult(new Event.Builder(Event.RESULT).integer(Event.POLICY_CONFIRM).build());
+//        }
+//
+//        @Override
+//        public void onApiReason(LifeplusAPIBean resultBean) {
+//          onResult(new Event.Builder(Event.ERROR).string(resultBean.getReturnMessage()).build());
+//        }
+//
+//        @Override
+//        public void onApiError(String errorMessage) {
+//          onResult(new Event.Builder(Event.ERROR).integer(Event.POLICY_CONFIRM).string(errorMessage).build());
+//        }
+//      })
+//    );
   }
 
   public int getBackwardWarnStringId() {

+ 8 - 6
app/src/main/res/layout/main_contents_category_image.xml

@@ -2,6 +2,7 @@
 <android.support.constraint.ConstraintLayout
   xmlns:android="http://schemas.android.com/apk/res/android"
   xmlns:app="http://schemas.android.com/apk/res-auto"
+  xmlns:tools="http://schemas.android.com/tools"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:paddingEnd="12dp">
@@ -10,9 +11,9 @@
     android:id="@+id/image_contents"
     android:layout_width="@dimen/main_contents_image_width"
     android:layout_height="@dimen/main_contents_image_height"
-    android:src="@drawable/img_bestbucket_1"
     android:background="@color/CFFFFFF"
     android:scaleType="matrix"
+    android:src="@drawable/img_bestbucket_1"
     />
 
   <TextView
@@ -20,13 +21,14 @@
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_marginStart="32dp"
-    android:layout_marginBottom="10dp"
+    android:layout_marginTop="218dp"
     android:lineSpacingExtra="7.5sp"
-    android:text="며느리도 모르는\n신당동 핫플"
     android:textColor="#ffffff"
     android:textSize="19sp"
     android:textStyle="bold"
-    app:layout_constraintStart_toStartOf="parent"/>
+    app:layout_constraintStart_toStartOf="parent"
+    app:layout_constraintTop_toTopOf="parent"
+    tools:text="며느리도 모르는\n신당동 핫플"/>
 
   <TextView
     android:id="@+id/text_small"
@@ -35,9 +37,9 @@
     android:layout_marginStart="32dp"
     android:layout_marginBottom="25dp"
     android:lineSpacingExtra="9.5sp"
-    android:text="신당동 JMT 리스트"
     android:textColor="#ffffff"
     android:textSize="12sp"
     app:layout_constraintBottom_toBottomOf="parent"
-    app:layout_constraintStart_toStartOf="parent"/>
+    app:layout_constraintStart_toStartOf="parent"
+    tools:text="신당동 JMT 리스트"/>
 </android.support.constraint.ConstraintLayout>

文件差異過大導致無法顯示
+ 18 - 0
app/src/sandbox/java/kr/co/zumo/app/lifeplus/network/api/LifeplusAPIService.java