init
This commit is contained in:
65 files changed
+5782
No files matched your search
@@ -0,0 +1,68 @@
|
||||
package com.androidsmsgateway.data.local
|
||||
|
||||
import androidx.room.Entity
|
||||
import androidx.room.Index
|
||||
import androidx.room.PrimaryKey
|
||||
|
||||
@Entity(tableName = "incoming_sms", indices = [Index("receivedAt"), Index("sender")])
|
||||
data class IncomingSmsEntity(
|
||||
@PrimaryKey val id: String,
|
||||
val sender: String,
|
||||
val message: String,
|
||||
val receivedAt: Long,
|
||||
val status: String,
|
||||
val createdAt: Long,
|
||||
)
|
||||
|
||||
@Entity(tableName = "outgoing_sms", indices = [Index("requestedAt"), Index("recipient")])
|
||||
data class OutgoingSmsEntity(
|
||||
@PrimaryKey val id: String,
|
||||
val recipient: String,
|
||||
val message: String,
|
||||
val requestedAt: Long,
|
||||
val status: String,
|
||||
val errorCode: String? = null,
|
||||
val updatedAt: Long,
|
||||
)
|
||||
|
||||
@Entity(tableName = "request_logs", indices = [Index("timestamp")])
|
||||
data class RequestLogEntity(
|
||||
@PrimaryKey(autoGenerate = true) val id: Long = 0,
|
||||
val timestamp: Long,
|
||||
val method: String,
|
||||
val path: String,
|
||||
val statusCode: Int,
|
||||
val clientIp: String,
|
||||
val durationMs: Long,
|
||||
val success: Boolean,
|
||||
)
|
||||
|
||||
@Entity(tableName = "app_settings")
|
||||
data class AppSettingsEntity(
|
||||
@PrimaryKey val id: Int = SINGLETON_ID,
|
||||
val deviceId: String,
|
||||
val port: Int = DEFAULT_PORT,
|
||||
val bindAddress: String = DEFAULT_BIND_ADDRESS,
|
||||
val serverEnabled: Boolean = false,
|
||||
val startOnBoot: Boolean = false,
|
||||
val authenticationEnabled: Boolean = true,
|
||||
val apiKeyHash: String = "",
|
||||
val allowlistEnabled: Boolean = false,
|
||||
val allowedIps: String = "",
|
||||
) {
|
||||
companion object {
|
||||
const val SINGLETON_ID = 1
|
||||
const val DEFAULT_PORT = 8080
|
||||
const val DEFAULT_BIND_ADDRESS = "0.0.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
data class MessageRecord(
|
||||
val id: String,
|
||||
val direction: String,
|
||||
val address: String,
|
||||
val message: String,
|
||||
val timestamp: Long,
|
||||
val status: String,
|
||||
val errorCode: String?,
|
||||
)
|
||||
Reference in new issue
Block a user