迁移探路模块和tanlulib代码至此
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package com.zhidao.roadcondition.base
|
||||
|
||||
import android.app.IntentService
|
||||
import android.content.Intent
|
||||
import android.os.IBinder
|
||||
|
||||
|
||||
open class BaseIntentService : IntentService("BaseIntentService") {
|
||||
|
||||
protected var tag: String = this.javaClass.simpleName
|
||||
|
||||
override fun onHandleIntent(p0: Intent?) {
|
||||
tag = this.javaClass.simpleName
|
||||
}
|
||||
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
return super.onStartCommand(intent, flags, startId)
|
||||
}
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
}
|
||||
|
||||
override fun onStart(intent: Intent?, startId: Int) {
|
||||
super.onStart(intent, startId)
|
||||
}
|
||||
|
||||
override fun onBind(intent: Intent?): IBinder? {
|
||||
return super.onBind(intent)
|
||||
}
|
||||
|
||||
override fun setIntentRedelivery(enabled: Boolean) {
|
||||
super.setIntentRedelivery(enabled)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.zhidao.roadcondition.base
|
||||
|
||||
import com.zhidao.roadcondition.model.BaseResponse
|
||||
|
||||
open class BaseRepository {
|
||||
|
||||
suspend fun <T : Any> apiCall(call: suspend () -> BaseResponse<T>): BaseResponse<T> {
|
||||
return call.invoke()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user