feat: add some feature
This commit is contained in:
21 files changed
+333
-24
No files matched your search
@@ -2,3 +2,4 @@
|
|||||||
/.idea
|
/.idea
|
||||||
/build
|
/build
|
||||||
/.kotlin
|
/.kotlin
|
||||||
|
/data
|
||||||
+4
-5
@@ -1,8 +1,8 @@
|
|||||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm") version "2.0.0"
|
alias(libs.plugins.kotlin)
|
||||||
id("com.gradleup.shadow") version "8.3.0"
|
alias(libs.plugins.shadow)
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "cn.rtast"
|
group = "cn.rtast"
|
||||||
@@ -27,9 +27,8 @@ tasks.compileJava {
|
|||||||
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("cn.rtast:ROneBot:1.2.2")
|
implementation(libs.rOneBot)
|
||||||
implementation("com.google.code.gson:gson:2.11.0")
|
implementation(libs.okhttp)
|
||||||
implementation("com.squareup.okhttp3:okhttp:5.0.0-alpha.14")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.build {
|
tasks.build {
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
[versions]
|
||||||
|
kotlinVersion = "2.0.10"
|
||||||
|
ronebotVersion = "1.2.4"
|
||||||
|
shadowVersion = "8.3.0"
|
||||||
|
okhttpVersion = "5.0.0-alpha.14"
|
||||||
|
|
||||||
|
[libraries]
|
||||||
|
rOneBot = { group = "cn.rtast", name = "ROneBot", version.ref = "ronebotVersion" }
|
||||||
|
okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okhttpVersion" }
|
||||||
|
|
||||||
|
[bundles]
|
||||||
|
|
||||||
|
[plugins]
|
||||||
|
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlinVersion" }
|
||||||
|
shadow = { id = "com.gradleup.shadow", version.ref = "shadowVersion" }
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
package cn.rtast.fancybot
|
package cn.rtast.fancybot
|
||||||
|
|
||||||
|
import cn.rtast.fancybot.entity.Config
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import com.google.gson.GsonBuilder
|
import com.google.gson.GsonBuilder
|
||||||
|
|
||||||
@@ -15,3 +16,9 @@ val gson: Gson = GsonBuilder()
|
|||||||
.disableHtmlEscaping()
|
.disableHtmlEscaping()
|
||||||
.serializeNulls()
|
.serializeNulls()
|
||||||
.create()
|
.create()
|
||||||
|
|
||||||
|
const val ROOT_PATH = "./data"
|
||||||
|
|
||||||
|
val DEFAULT_CONFIG = Config(
|
||||||
|
cnmApi = "https://ncm.rtast.cn"
|
||||||
|
)
|
||||||
@@ -10,6 +10,9 @@ package cn.rtast.fancybot
|
|||||||
import cn.rtast.fancybot.commands.EchoCommand
|
import cn.rtast.fancybot.commands.EchoCommand
|
||||||
import cn.rtast.fancybot.commands.JrrpCommand
|
import cn.rtast.fancybot.commands.JrrpCommand
|
||||||
import cn.rtast.fancybot.commands.MusicCommand
|
import cn.rtast.fancybot.commands.MusicCommand
|
||||||
|
import cn.rtast.fancybot.commands.MyPointCommand
|
||||||
|
import cn.rtast.fancybot.commands.SignCommand
|
||||||
|
import cn.rtast.fancybot.util.file.ConfigManager
|
||||||
import cn.rtast.rob.ROneBotFactory
|
import cn.rtast.rob.ROneBotFactory
|
||||||
import cn.rtast.rob.entity.GroupMessage
|
import cn.rtast.rob.entity.GroupMessage
|
||||||
import cn.rtast.rob.util.ob.OBMessage
|
import cn.rtast.rob.util.ob.OBMessage
|
||||||
@@ -21,13 +24,11 @@ class FancyBot : OBMessage {
|
|||||||
override suspend fun onGroupMessage(websocket: WebSocket, message: GroupMessage, json: String) {
|
override suspend fun onGroupMessage(websocket: WebSocket, message: GroupMessage, json: String) {
|
||||||
println(message.rawMessage)
|
println(message.rawMessage)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
val commands = listOf(
|
override suspend fun onWebsocketError(webSocket: WebSocket, ex: Exception) {
|
||||||
EchoCommand(),
|
println(ex.message)
|
||||||
JrrpCommand(),
|
}
|
||||||
MusicCommand()
|
}
|
||||||
)
|
|
||||||
|
|
||||||
fun createFakeServer() {
|
fun createFakeServer() {
|
||||||
val server = HttpServer.create(InetSocketAddress(8000), 0)
|
val server = HttpServer.create(InetSocketAddress(8000), 0)
|
||||||
@@ -42,6 +43,15 @@ fun createFakeServer() {
|
|||||||
println("Server is running on port 8000...")
|
println("Server is running on port 8000...")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val commands = listOf(
|
||||||
|
EchoCommand(),
|
||||||
|
JrrpCommand(),
|
||||||
|
MusicCommand(),
|
||||||
|
SignCommand(),
|
||||||
|
MyPointCommand()
|
||||||
|
)
|
||||||
|
|
||||||
|
val configManager = ConfigManager()
|
||||||
|
|
||||||
fun main() {
|
fun main() {
|
||||||
val address = System.getenv("WS_ADDRESS")
|
val address = System.getenv("WS_ADDRESS")
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024 RTAkland
|
||||||
|
* Author: RTAkland
|
||||||
|
* Date: 2024/8/30
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package cn.rtast.fancybot.cmd
|
||||||
|
|
||||||
|
import cn.rtast.fancybot.DEFAULT_CONFIG
|
||||||
|
import cn.rtast.fancybot.util.toJson
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
|
fun main() {
|
||||||
|
val file = File("src/main/resources/config.json")
|
||||||
|
file.writeText(DEFAULT_CONFIG.toJson())
|
||||||
|
println("Generated default config")
|
||||||
|
}
|
||||||
@@ -7,23 +7,29 @@
|
|||||||
|
|
||||||
package cn.rtast.fancybot.commands
|
package cn.rtast.fancybot.commands
|
||||||
|
|
||||||
|
import cn.rtast.fancybot.util.file.JrrpManager
|
||||||
import cn.rtast.rob.entity.GroupMessage
|
import cn.rtast.rob.entity.GroupMessage
|
||||||
import cn.rtast.rob.util.BaseCommand
|
import cn.rtast.rob.util.BaseCommand
|
||||||
import cn.rtast.rob.util.ob.OBMessage
|
import cn.rtast.rob.util.ob.OBMessage
|
||||||
import kotlin.random.Random
|
|
||||||
|
|
||||||
class JrrpCommand : BaseCommand() {
|
class JrrpCommand : BaseCommand() {
|
||||||
override val commandName = "/今日人品"
|
override val commandName = "/jrrp"
|
||||||
|
|
||||||
|
private val jrrpManager = JrrpManager()
|
||||||
|
|
||||||
override suspend fun executeGroup(listener: OBMessage, message: GroupMessage, args: List<String>) {
|
override suspend fun executeGroup(listener: OBMessage, message: GroupMessage, args: List<String>) {
|
||||||
val randomNumber = Random.nextInt(0, 101)
|
if (jrrpManager.isJrrped(message.sender.userId)) {
|
||||||
val scoreDesc = when (randomNumber) {
|
listener.sendGroupMessage(message.groupId, "你今天已经今日人品过啦, 明天再来吧~")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
val randomPoint = jrrpManager.jrrp(message.sender.userId)
|
||||||
|
val scoreDesc = when (randomPoint) {
|
||||||
in 0..10 -> "人品不太好呢"
|
in 0..10 -> "人品不太好呢"
|
||||||
in 30..50 -> "人品一般般"
|
in 30..50 -> "人品一般般"
|
||||||
in 70..90 -> "人品还不错哦"
|
in 70..90 -> "人品还不错哦"
|
||||||
in 90..100 -> "人品超级好呢!"
|
in 90..100 -> "人品超级好呢!"
|
||||||
else -> "人品还行哦"
|
else -> "人品还行哦"
|
||||||
}
|
}
|
||||||
listener.sendGroupMessage(message.groupId, "$scoreDesc($randomNumber)")
|
listener.sendGroupMessage(message.groupId, "$scoreDesc($randomPoint)")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,9 +7,10 @@
|
|||||||
|
|
||||||
package cn.rtast.fancybot.commands
|
package cn.rtast.fancybot.commands
|
||||||
|
|
||||||
import cn.rtast.fancybot.entity.Search
|
import cn.rtast.fancybot.configManager
|
||||||
import cn.rtast.fancybot.entity.SearchedResult
|
import cn.rtast.fancybot.entity.music.Search
|
||||||
import cn.rtast.fancybot.entity.SongUrl
|
import cn.rtast.fancybot.entity.music.SearchedResult
|
||||||
|
import cn.rtast.fancybot.entity.music.SongUrl
|
||||||
import cn.rtast.fancybot.util.Http
|
import cn.rtast.fancybot.util.Http
|
||||||
import cn.rtast.rob.entity.GroupMessage
|
import cn.rtast.rob.entity.GroupMessage
|
||||||
import cn.rtast.rob.util.BaseCommand
|
import cn.rtast.rob.util.BaseCommand
|
||||||
@@ -44,7 +45,7 @@ class MusicCommand : BaseCommand() {
|
|||||||
}
|
}
|
||||||
val keyword = args.drop(1).joinToString(" ")
|
val keyword = args.drop(1).joinToString(" ")
|
||||||
val result = Http.get<Search>(
|
val result = Http.get<Search>(
|
||||||
"https://music.api.yhdzz.cn/search",
|
"${configManager.ncmAPI}/search",
|
||||||
mapOf("keywords" to keyword),
|
mapOf("keywords" to keyword),
|
||||||
)
|
)
|
||||||
val tempResults = mutableListOf<SearchedResult>()
|
val tempResults = mutableListOf<SearchedResult>()
|
||||||
@@ -67,7 +68,10 @@ class MusicCommand : BaseCommand() {
|
|||||||
val searchedResultGet = searchedResult[message.sender.userId]!!
|
val searchedResultGet = searchedResult[message.sender.userId]!!
|
||||||
val finalResult = searchedResultGet[index]
|
val finalResult = searchedResultGet[index]
|
||||||
val url =
|
val url =
|
||||||
Http.get<SongUrl>("https://music.api.yhdzz.cn/song/url?id=${finalResult.id}").data.first().url
|
Http.get<SongUrl>(
|
||||||
|
"${configManager.ncmAPI}/song/url",
|
||||||
|
mapOf("id" to finalResult.id)
|
||||||
|
).data.first().url
|
||||||
val cqCode = "[CQ:music,type=custom,url=https://music.163.com/#/song?id=${finalResult.id}," +
|
val cqCode = "[CQ:music,type=custom,url=https://music.163.com/#/song?id=${finalResult.id}," +
|
||||||
"audio=$url,title=《${finalResult.name}》-- ${finalResult.artists}]"
|
"audio=$url,title=《${finalResult.name}》-- ${finalResult.artists}]"
|
||||||
listener.sendGroupMessage(message.groupId, cqCode)
|
listener.sendGroupMessage(message.groupId, cqCode)
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024 RTAkland
|
||||||
|
* Author: RTAkland
|
||||||
|
* Date: 2024/8/30
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package cn.rtast.fancybot.commands
|
||||||
|
|
||||||
|
import cn.rtast.fancybot.util.file.SignManager
|
||||||
|
import cn.rtast.rob.entity.GroupMessage
|
||||||
|
import cn.rtast.rob.util.BaseCommand
|
||||||
|
import cn.rtast.rob.util.ob.OBMessage
|
||||||
|
|
||||||
|
private val signManager = SignManager()
|
||||||
|
|
||||||
|
class SignCommand : BaseCommand() {
|
||||||
|
override val commandName = "/签到"
|
||||||
|
|
||||||
|
override suspend fun executeGroup(listener: OBMessage, message: GroupMessage, args: List<String>) {
|
||||||
|
if (signManager.isSigned(message.sender.userId)) {
|
||||||
|
listener.sendGroupMessage(message.groupId, "你今天已经签到, 明天再来吧~")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
val randomPoint = signManager.sign(message.sender.userId)
|
||||||
|
listener.sendGroupMessage(message.groupId, "你获得了 $randomPoint 点分数!\n发送‘/我的分数’ 即可查看当前的分数")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class MyPointCommand: BaseCommand() {
|
||||||
|
override val commandName = "/我的分数"
|
||||||
|
|
||||||
|
override suspend fun executeGroup(listener: OBMessage, message: GroupMessage, args: List<String>) {
|
||||||
|
val status = signManager.getStatus(message.sender.userId)
|
||||||
|
if (status == null) {
|
||||||
|
listener.sendGroupMessage(message.groupId, "你还没有签到过呢! 先发送‘/签到’再来查询吧~")
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
listener.sendGroupMessage(message.groupId, "你当前的分数为: ${status.points}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024 RTAkland
|
||||||
|
* Author: RTAkland
|
||||||
|
* Date: 2024/8/30
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package cn.rtast.fancybot.entity
|
||||||
|
|
||||||
|
data class Config(
|
||||||
|
val cnmApi: String,
|
||||||
|
)
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024 RTAkland
|
||||||
|
* Author: RTAkland
|
||||||
|
* Date: 2024/8/29
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package cn.rtast.fancybot.entity.jrrp
|
||||||
|
|
||||||
|
data class JrrpRecord(
|
||||||
|
val id: Long,
|
||||||
|
val timestamp: Long,
|
||||||
|
var points: Long,
|
||||||
|
)
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024 RTAkland
|
||||||
|
* Author: RTAkland
|
||||||
|
* Date: 2024/8/30
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package cn.rtast.fancybot.entity.jrrp
|
||||||
|
|
||||||
|
class SignRecord {
|
||||||
|
}
|
||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package cn.rtast.fancybot.entity
|
package cn.rtast.fancybot.entity.music
|
||||||
|
|
||||||
data class Search(
|
data class Search(
|
||||||
val result: Result,
|
val result: Result,
|
||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package cn.rtast.fancybot.entity
|
package cn.rtast.fancybot.entity.music
|
||||||
|
|
||||||
data class SearchedResult(
|
data class SearchedResult(
|
||||||
val id: Long,
|
val id: Long,
|
||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package cn.rtast.fancybot.entity
|
package cn.rtast.fancybot.entity.music
|
||||||
|
|
||||||
data class SongUrl(
|
data class SongUrl(
|
||||||
val data: List<Data>
|
val data: List<Data>
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024 RTAkland
|
||||||
|
* Author: RTAkland
|
||||||
|
* Date: 2024/8/29
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package cn.rtast.fancybot.util
|
||||||
|
|
||||||
|
import java.time.Instant
|
||||||
|
import java.time.LocalDate
|
||||||
|
import java.time.ZoneId
|
||||||
|
|
||||||
|
fun Long.isSameDay(other: Long): Boolean {
|
||||||
|
val currentDate = LocalDate.now()
|
||||||
|
val dateToCompare = Instant.ofEpochSecond(other)
|
||||||
|
.atZone(ZoneId.systemDefault())
|
||||||
|
.toLocalDate()
|
||||||
|
return currentDate == dateToCompare
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024 RTAkland
|
||||||
|
* Author: RTAkland
|
||||||
|
* Date: 2024/8/29
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package cn.rtast.fancybot.util
|
||||||
|
|
||||||
|
import cn.rtast.fancybot.ROOT_PATH
|
||||||
|
import cn.rtast.fancybot.gson
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
|
abstract class JsonFileHandler<T> {
|
||||||
|
|
||||||
|
val file: File
|
||||||
|
|
||||||
|
constructor(filename: String) {
|
||||||
|
this.file = File(ROOT_PATH, filename)
|
||||||
|
initFile(null)
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor(filename: String, defaultConfig: T) {
|
||||||
|
this.file = File(ROOT_PATH, filename)
|
||||||
|
initFile(defaultConfig)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun initFile(defaultConfig: T?) {
|
||||||
|
val configPath = File(ROOT_PATH)
|
||||||
|
configPath.mkdirs()
|
||||||
|
|
||||||
|
if (this.file.createNewFile()) {
|
||||||
|
if (defaultConfig != null) {
|
||||||
|
this.write(defaultConfig)
|
||||||
|
} else {
|
||||||
|
val resourceConfig = this::class.java.classLoader
|
||||||
|
.getResourceAsStream(file.name)
|
||||||
|
?.reader()?.readText()!!
|
||||||
|
this.write(resourceConfig)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun write(data: String) {
|
||||||
|
this.file.writeText(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun write(data: T) {
|
||||||
|
this.write(gson.toJson(data))
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fun <reified T> read(): T {
|
||||||
|
val content = this.file.readText()
|
||||||
|
return content.fromJson()
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fun <reified T> readArray(): T {
|
||||||
|
val content = this.file.readText()
|
||||||
|
return content.fromArrayJson<T>()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024 RTAkland
|
||||||
|
* Author: RTAkland
|
||||||
|
* Date: 2024/8/30
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package cn.rtast.fancybot.util.file
|
||||||
|
|
||||||
|
import cn.rtast.fancybot.entity.Config
|
||||||
|
import cn.rtast.fancybot.util.JsonFileHandler
|
||||||
|
|
||||||
|
class ConfigManager : JsonFileHandler<Config>("config.json") {
|
||||||
|
|
||||||
|
val ncmAPI get() = this.read<Config>().cnmApi
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024 RTAkland
|
||||||
|
* Author: RTAkland
|
||||||
|
* Date: 2024/8/29
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package cn.rtast.fancybot.util.file
|
||||||
|
|
||||||
|
import cn.rtast.fancybot.entity.jrrp.JrrpRecord
|
||||||
|
import cn.rtast.fancybot.util.JsonFileHandler
|
||||||
|
import cn.rtast.fancybot.util.isSameDay
|
||||||
|
import java.time.Instant
|
||||||
|
import kotlin.random.Random
|
||||||
|
|
||||||
|
class JrrpManager : JsonFileHandler<List<JrrpRecord>>("jrrp.json", listOf()) {
|
||||||
|
|
||||||
|
fun isJrrped(id: Long): Boolean {
|
||||||
|
val allJrrp = this.readArray<List<JrrpRecord>>()
|
||||||
|
val user = allJrrp.find { it.id == id } ?: return false
|
||||||
|
return user.timestamp.isSameDay(Instant.now().epochSecond)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun jrrp(id: Long): Int {
|
||||||
|
val allJrrp = this.readArray<MutableList<JrrpRecord>>()
|
||||||
|
allJrrp.removeAll { it.id == id }
|
||||||
|
allJrrp.add(JrrpRecord(id, Instant.now().epochSecond, 0))
|
||||||
|
this.write(allJrrp)
|
||||||
|
return Random.nextInt(0, 101)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024 RTAkland
|
||||||
|
* Author: RTAkland
|
||||||
|
* Date: 2024/8/30
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package cn.rtast.fancybot.util.file
|
||||||
|
|
||||||
|
import cn.rtast.fancybot.entity.jrrp.JrrpRecord
|
||||||
|
import cn.rtast.fancybot.util.JsonFileHandler
|
||||||
|
import cn.rtast.fancybot.util.isSameDay
|
||||||
|
import java.time.Instant
|
||||||
|
import kotlin.random.Random
|
||||||
|
|
||||||
|
class SignManager : JsonFileHandler<List<JrrpRecord>>("sign.json", listOf()) {
|
||||||
|
|
||||||
|
fun isSigned(id: Long): Boolean {
|
||||||
|
val allSign = this.readArray<List<JrrpRecord>>()
|
||||||
|
val user = allSign.find { it.id == id } ?: return false
|
||||||
|
return user.timestamp.isSameDay(Instant.now().epochSecond)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun sign(id: Long): Long {
|
||||||
|
val allSign = this.readArray<MutableList<JrrpRecord>>()
|
||||||
|
val randomPoint = Random.nextLong(0, 101)
|
||||||
|
val current = allSign.find { it.id == id } ?: JrrpRecord(id, Instant.now().epochSecond, 0)
|
||||||
|
current.points = randomPoint + current.points
|
||||||
|
allSign.remove(current)
|
||||||
|
allSign.add(current)
|
||||||
|
this.write(allSign)
|
||||||
|
return randomPoint + current.points
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getStatus(id: Long): JrrpRecord? {
|
||||||
|
val allSign = this.readArray<List<JrrpRecord>>()
|
||||||
|
return allSign.find { it.id == id }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"cnmApi": "https://ncm.rtast.cn"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user