Skip to content

Commit

Permalink
feat: record every ua
Browse files Browse the repository at this point in the history
  • Loading branch information
Aliothmoon committed Jan 18, 2025
1 parent 8ab899a commit 1dc61a0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/main/kotlin/biz/cdkey.kt
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ fun validateCDK(params: ValidateParams): Resp {
DB.insert(OperationLog) {
set(OperationLog.cdk, cdk)
set(OperationLog.source, params.source)
set(OperationLog.ua, params.ua)
set(OperationLog.specificationId, specId)
set(OperationLog.type, "validate")
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/kotlin/model/entity/entities.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ object CDK : Table<Nothing>("mirrorc_cdk") {
object OperationLog : Table<Nothing>("mirrorc_operation_log") {
val id = int("id").primaryKey()
val cdk = varchar("cdk")
val source = varchar("source")
val specificationId = varchar("specification_id")
val ua = varchar("ua")
val source = varchar("source")
val type = varchar("type")
val createdAt = datetime("created_at")
}
Expand Down
5 changes: 5 additions & 0 deletions src/main/kotlin/model/param.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ class ValidateParams {
* 来源
* */
var source: String? = null

/**
* user-agent
* */
var ua: String? = null
}


Expand Down
10 changes: 9 additions & 1 deletion src/main/kotlin/model/transfer.kt
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
package model
package model


data class LogRecord(
val cdk: String,
val source: String?,
val spId: String,
val type: String,
)

0 comments on commit 1dc61a0

Please sign in to comment.