|
|
@@ -3,15 +3,18 @@
|
|
|
*/
|
|
|
package kr.co.zumo.app.lifeplus.model.module;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
import io.reactivex.Single;
|
|
|
+import kr.co.zumo.app.lifeplus.bean.api.ContentsDetailImageBean;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.ContentsDetailListBean;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.ContentsDetailResultBean;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.ContentsItemBean;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.ItemNoRequestBean;
|
|
|
+import kr.co.zumo.app.lifeplus.bean.api.LifeplusImageBean;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.SeriesItemBean;
|
|
|
import kr.co.zumo.app.lifeplus.network.api.LifeplusAPIRepository;
|
|
|
import kr.co.zumo.app.lifeplus.util.StringUtil;
|
|
|
@@ -68,6 +71,36 @@ public class APIContentsDetailModule extends LifeplusAPIModule<ItemNoRequestBean
|
|
|
// 시리즈 정보 반영
|
|
|
contentsDetailListBean.setupSeriesInfo();
|
|
|
|
|
|
+ // movie/html 페이지의 공유/전체보기 이미지를 커버(0번째 item) 으로 맵핑
|
|
|
+ for (ContentsItemBean contentsItemBean : contentsItemBeans) {
|
|
|
+ if (LifeplusImageBean.TYPE_HTML.equals(contentsItemBean.getImageType())
|
|
|
+ || LifeplusImageBean.TYPE_MOVIE.equals(contentsItemBean.getImageType())) {
|
|
|
+ // html 일 경우 커버 이미지를 사용한다.
|
|
|
+ ContentsItemBean coverBean = contentsItemBeans.get(0);
|
|
|
+ String imageUrl = coverBean.getImageUrl();
|
|
|
+ String overviewImageUrl = coverBean.getOverviewImageUrl();
|
|
|
+ if (StringUtil.isFull(imageUrl) && StringUtil.isEmpty(overviewImageUrl)) {
|
|
|
+ overviewImageUrl = imageUrl;
|
|
|
+ }
|
|
|
+ ContentsDetailImageBean imageBean;
|
|
|
+ List<ContentsDetailImageBean> list = contentsItemBean.getItemImageList();
|
|
|
+ if (null != list && list.size() > 0) {
|
|
|
+ imageBean = list.get(0); // 이미지 bean 을 그대로 사용해야 html url 이 사라지지 않는다. 사라지면 콘텐츠로 돌아갔을 때 페이지가 표시되지않는다.
|
|
|
+ imageBean.setImageUrl(imageUrl);
|
|
|
+ imageBean.setImageUrlForOverview(overviewImageUrl);
|
|
|
+ list.set(0, imageBean);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ imageBean = new ContentsDetailImageBean();
|
|
|
+ imageBean.setImageUrl(imageUrl);
|
|
|
+ imageBean.setImageUrlForOverview(overviewImageUrl);
|
|
|
+ list = new ArrayList<>();
|
|
|
+ list.add(imageBean);
|
|
|
+ }
|
|
|
+ contentsItemBean.setItemImageList(list);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return contentsDetailResultBean;
|
|
|
});
|
|
|
}
|