Skip to content

Commit cd983e9

Browse files
committed
fix(recorder): 保存当日指令执行统计
1 parent f2e233e commit cd983e9

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

arona/arona-plugin/user-recorder/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
val projectMainClass = "com.diyigemt.arona.user.recorder.PluginMain"
8-
version = "1.2.5"
8+
version = "1.2.7"
99
dependencies {
1010
compileOnly(project(":arona-core"))
1111
testImplementation(kotlin("test"))

arona/arona-plugin/user-recorder/src/main/kotlin/com/diyigemt/arona/user/recorder/Main.kt

+6-6
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ object PluginMain : AronaPlugin(
3636
id = "com.diyigemt.arona.user.recorder",
3737
name = "user-recorder",
3838
author = "diyigemt",
39-
version = "1.2.5",
39+
version = "1.2.7",
4040
description = "record user data"
4141
)
4242
) {
@@ -203,15 +203,12 @@ class DauClCommand : CommandLineSubCommand, CliktCommand(name = "dau", help = "
203203
DailyActiveUser.findById(date)!!
204204
}
205205
echo(dau)
206-
dau.commands.entries.sortedBy { it.value }.forEach {
207-
echo("${it.key}: ${it.value}")
208-
}
209206
// 指令执行次数
210207
dbQuery {
211208
Command.all()
212209
.sortedBy { it.count }
213210
.forEach {
214-
echo("${it.name}: ${it.count}")
211+
echo("${it.name}: ${dau.commands[it.name] ?: 0}/${it.count}")
215212
}
216213
}
217214
}
@@ -240,14 +237,17 @@ class DauCommand : AbstractCommand(
240237
}
241238
DailyActiveUser.findById(date)!!
242239
}
240+
val total = dbQuery {
241+
Command.all().toList().associateBy { it.name }
242+
}
243243
md append tencentCustomMarkdown {
244244
+"dau: ${dau.count}"
245245
+"contact: ${dau.contact}"
246246
+"message: ${dau.message}"
247247
+"commands:"
248248
indexedList {
249249
dau.commands.entries.sortedBy { it.value }.forEach {
250-
+"${it.key}: ${it.value}"
250+
+"${it.key}: ${it.value}/${total[it.key]?.count ?: "-"}"
251251
}
252252
}
253253
}

0 commit comments

Comments
 (0)