package com.yidianling.dynamic.modular.service

import android.app.Activity
import android.content.Context
import android.content.Intent
import com.alibaba.android.arouter.facade.annotation.Route
import com.yidianling.dynamic.activity.TrendsReplyInfoActivity
import com.yidianling.dynamic.api.IDynamicService
import com.yidianling.dynamic.members.MembersActivity
import com.yidianling.dynamic.publishTrend.PublishTrendActivity
import com.yidianling.dynamic.topic.topicDetail.TopicDetailActivity
import com.yidianling.dynamic.trendsDetail.TrendsDetailActivity

/**
 * Created by haorui on 2019-12-17 .
 * Des:
 */
@Route(path = "/dynamic/DynamicService")
class DynamicServiceImp : IDynamicService {

    override fun init(context: Context?) {

    }

    override fun membersIntent(activity: Activity, userId: String): Intent {
        return MembersActivity.newIntent(activity, userId)
    }

    override fun replyInfoIntent(activity: Activity, replyId: String, aid: String): Intent {
        return TrendsReplyInfoActivity.newIntent(activity, replyId, aid)
    }

    override fun trendsDetailIntent(activity: Activity, trendId: Int): Intent {
        return TrendsDetailActivity.newIntent(activity, trendId)
    }

    override fun trendsDetailIntent(activity: Activity, trendId: Int, isScrollToZan: Boolean): Intent {
        return TrendsDetailActivity.newIntent(activity, trendId, isScrollToZan)
    }

    override fun trendsDetailIntent(activity: Activity, trendId: Int, isScrollToZan: Boolean, lastId: Int): Intent {
        return TrendsDetailActivity.newIntent(activity, trendId, isScrollToZan, lastId)
    }

    override fun publishTrendIntent(activity: Activity, url: String, cover: String, title: String): Intent {
        return PublishTrendActivity.newIntent(activity, url, cover, title)
    }

    override fun publishFmToTrend(activity: Activity, url: String, cover: String, title: String): Intent {
        return PublishTrendActivity.newIntentForFm(activity, url, cover, title, 1)
    }

    override fun publishArticleToTrend(activity: Activity, url: String, cover: String, title: String): Intent {
        return PublishTrendActivity.newIntentForArticle(activity, url, cover, title)
    }

    override fun topicDetailIntent(context: Context, isSplash: Boolean, topicId: String): Intent {
        return TopicDetailActivity.newIntent(context, isSplash, topicId)
    }
}