Skip to content

Commit

Permalink
配合请求响应模式更改,调整响应类
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheedon committed Feb 17, 2022
1 parent 334844b commit 7fdd5bd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions mqtt/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ dependencies {
api 'org.eclipse.paho:org.eclipse.paho.android.service:1.1.1'

// 请求响应模式
api 'com.github.Sheedon.RequestResponseBinder:rr-dispatcher:0.2.7.a-alpha'
api 'com.github.Sheedon.RequestResponseBinder:rr-dispatcher:0.2.7.b-alpha'
// api 'org.sheedon.requestresponsebinder:rr-dispatcher:1.0-SNAPSHOT'
// android 环境下的超时处理者,java环境下正在开发中
api 'com.github.Sheedon.RequestResponseBinder:rr-timeout-android:0.2.7.a-alpha'
api 'com.github.Sheedon.RequestResponseBinder:rr-timeout-android:0.2.7.b-alpha'
// api 'org.sheedon.requestresponsebinder:rr-timeout-android:1.0-SNAPSHOT'
}

Expand Down
18 changes: 11 additions & 7 deletions mqtt/src/main/kotlin/org/sheedon/mqtt/Response.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package org.sheedon.mqtt

import org.sheedon.rr.dispatcher.model.BaseResponse
import org.sheedon.rr.core.IResponse

/**
* Basic feedback class, the content to be included includes "feedback subject" and "feedback message body"
Expand All @@ -25,17 +25,21 @@ import org.sheedon.rr.dispatcher.model.BaseResponse
* @Date: 2022/1/30 11:01 上午
*/
class Response @JvmOverloads constructor(
backTopic: String? = "",
message: String? = "",
body: ResponseBody? = null
) : BaseResponse<String, ResponseBody>(backTopic, message, body) {
private val backTopic: String? = "",
private val message: String? = "",
private val body: ResponseBody? = null
) : IResponse<String, ResponseBody> {

override fun backTopic(): String {
return super.backTopic() ?: ""
return backTopic ?: ""
}

override fun message(): String {
return super.message() ?: ""
return message ?: ""
}

override fun body(): ResponseBody {
return body ?: ResponseBody()
}

}

0 comments on commit 7fdd5bd

Please sign in to comment.