// Path: app/src/main/java/com/yuqirong/rxnews/event/NewsDetailEvent.java
// public class NewsDetailEvent extends BaseEvent {
// 
//     private String id;
//     private NewsDetail newsDetail;
// 
//     public NewsDetailEvent(String id, NewsDetail newsDetail) {
//         this.id = id;
//         this.newsDetail = newsDetail;
//     }
// 
//     public String getId() {
//         return id;
//     }
// 
//     public void setId(String id) {
//         this.id = id;
//     }
// 
//     public NewsDetail getNewsDetail() {
//         return newsDetail;
//     }
// 
//     public void setNewsDetail(NewsDetail newsDetail) {
//         this.newsDetail = newsDetail;
//     }
// }
// 
// Path: app/src/main/java/com/yuqirong/rxnews/module/news/model/NewsDetailInteractor.java
// public interface NewsDetailInteractor {
// 
//     public void showNewsDetail(int taskId, String id, String postId);
// 
// }
// 
// Path: app/src/main/java/com/yuqirong/rxnews/module/news/model/impl/NewsDetailInteractorImpl.java
// public class NewsDetailInteractorImpl implements NewsDetailInteractor {
// 
//     @Override
//     public void showNewsDetail(int taskId, String id, String postId) {
//         AppService.getInstance().getRxCollection().getNewsDetail(taskId, id, postId);
//     }
// 
// }
// 
// Path: app/src/main/java/com/yuqirong/rxnews/module/news/view/INewsDetailView.java
// public interface INewsDetailView {
// 
//     public void showLoading();
// 
//     public void closeLoading();
// 
//     public void showSuccess(NewsDetailEvent event);
// 
//     public void showError();
// }


import com.yuqirong.rxnews.event.NewsDetailEvent;
import com.yuqirong.rxnews.module.news.model.NewsDetailInteractor;
import com.yuqirong.rxnews.module.news.model.impl.NewsDetailInteractorImpl;
import com.yuqirong.rxnews.module.news.view.INewsDetailView;
package com.yuqirong.rxnews.module.news.presenter;


/**
 * Created by Anyway on 2016/3/9.
 */
public class NewsDetailPresenter {

    private INewsDetailView mINewsDetailView;
    private NewsDetailInteractor mNewsDetailInteractor;

    public NewsDetailPresenter(INewsDetailView mINewsDetailView) {
        this.mINewsDetailView = mINewsDetailView;
        mNewsDetailInteractor = new NewsDetailInteractorImpl();
    }

    public void showNewsDetail(int taskId, String id, String postId) {
        showLoading();
        mNewsDetailInteractor.showNewsDetail(taskId, id, postId);
    }

    public void showLoading() {
        mINewsDetailView.showLoading();
    }

    public void closeLoading() {
        mINewsDetailView.closeLoading();
    }

    public void showSuccess(NewsDetailEvent event) {
        closeLoading();
        mINewsDetailView.showSuccess(event);
    }

// Path: app/src/main/java/com/yuqirong/rxnews/event/NewsDetailEvent.java
// public class NewsDetailEvent extends BaseEvent {
// 
//     private String id;
//     private NewsDetail newsDetail;
// 
//     public NewsDetailEvent(String id, NewsDetail newsDetail) {
//         this.id = id;
//         this.newsDetail = newsDetail;
//     }
// 
//     public String getId() {
//         return id;
//     }
// 
//     public void setId(String id) {
//         this.id = id;
//     }
// 
//     public NewsDetail getNewsDetail() {
//         return newsDetail;
//     }
// 
//     public void setNewsDetail(NewsDetail newsDetail) {
//         this.newsDetail = newsDetail;
//     }
// }
// 
// Path: app/src/main/java/com/yuqirong/rxnews/module/news/model/NewsDetailInteractor.java
// public interface NewsDetailInteractor {
// 
//     public void showNewsDetail(int taskId, String id, String postId);
// 
// }
// 
// Path: app/src/main/java/com/yuqirong/rxnews/module/news/model/impl/NewsDetailInteractorImpl.java
// public class NewsDetailInteractorImpl implements NewsDetailInteractor {
// 
//     @Override
//     public void showNewsDetail(int taskId, String id, String postId) {
//         AppService.getInstance().getRxCollection().getNewsDetail(taskId, id, postId);
//     }
// 
// }
// 
// Path: app/src/main/java/com/yuqirong/rxnews/module/news/view/INewsDetailView.java
// public interface INewsDetailView {
// 
//     public void showLoading();
// 
//     public void closeLoading();
// 
//     public void showSuccess(NewsDetailEvent event);
// 
//     public void showError();
// }


// Path: app/src/main/java/com/yuqirong/rxnews/module/news/presenter/NewsDetailPresenter.java
import com.yuqirong.rxnews.event.NewsDetailEvent;
import com.yuqirong.rxnews.module.news.model.NewsDetailInteractor;
import com.yuqirong.rxnews.module.news.model.impl.NewsDetailInteractorImpl;
import com.yuqirong.rxnews.module.news.view.INewsDetailView;

package com.yuqirong.rxnews.module.news.presenter;


/**
 * Created by Anyway on 2016/3/9.
 */
public class NewsDetailPresenter {

    private INewsDetailView mINewsDetailView;
    private NewsDetailInteractor mNewsDetailInteractor;

    public NewsDetailPresenter(INewsDetailView mINewsDetailView) {
        this.mINewsDetailView = mINewsDetailView;
        mNewsDetailInteractor = new NewsDetailInteractorImpl();
    }

    public void showNewsDetail(int taskId, String id, String postId) {
        showLoading();
        mNewsDetailInteractor.showNewsDetail(taskId, id, postId);
    }

    public void showLoading() {
        mINewsDetailView.showLoading();
    }

    public void closeLoading() {
        mINewsDetailView.closeLoading();
    }

    public void showSuccess(NewsDetailEvent event) {
        closeLoading();
        mINewsDetailView.showSuccess(event);
    }

    public void showError() {