package com.quyunshuo.module.home.fragment.repo

import android.util.Log
import com.module.pay.service.HomeApiService
import com.quyunshuo.androidbaseframemvvm.base.mvvm.m.BaseRepository
import com.quyunshuo.androidbaseframemvvm.common.constant.Heartbeat
import javax.inject.Inject

/**
 * HomeFragment的数据仓库层
 *
 * @author Qu Yunshuo
 * @since 2021/8/5 10:59 下午
 */
class QrCodeFragmentRepo @Inject constructor() : BaseRepository() {

    @Inject
    lateinit var mApi: HomeApiService


    //请求支付二维码
    suspend fun twoPayCode(productName:String)=request<String> {
        var map = HashMap<String,String>()
        map.put("clientId", Heartbeat.deviceId!!)
        map.put("productName", productName)
        mApi.twoPayCode(map).run {
            emit(this)
        }
    }

}