增加消息发送借口, 修订query对象名称
This commit is contained in:
@@ -10,6 +10,13 @@ import java.util.*
|
||||
* @tparam T 消息数据类型
|
||||
*/
|
||||
open class Message<T>(var status: Int = Status.Success) {
|
||||
|
||||
/**
|
||||
* 获取状态是否成功
|
||||
*/
|
||||
val success: Boolean
|
||||
get() = this.status == Status.Success
|
||||
|
||||
/**
|
||||
* 传递的业务数据
|
||||
*/
|
||||
@@ -38,6 +45,12 @@ open class Message<T>(var status: Int = Status.Success) {
|
||||
this.message = message
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 从另一对象中复制数据
|
||||
*
|
||||
* @param other 另一消息对象
|
||||
*/
|
||||
open fun from(other: Message<T>) {
|
||||
this.status = other.status
|
||||
this.data = other.data
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.synebula.gaea.io.messager
|
||||
|
||||
interface IEmailMessenger {
|
||||
fun sendMessage(receivers: List<String>, subject: String, content: String)
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.synebula.gaea.test
|
||||
|
||||
import com.synebula.gaea.data.code.SnowflakeCode
|
||||
import junit.framework.TestCase
|
||||
|
||||
class CodeGenerateTest : TestCase() {
|
||||
fun testSnowflake() {
|
||||
val snowflakeCode = SnowflakeCode(1, 1)
|
||||
for (i in 0..10) {
|
||||
Thread.sleep(1000)
|
||||
println(snowflakeCode.generate())
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user