-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
526c47b
commit 1431444
Showing
7 changed files
with
151 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# cn.kzoj.dbConvertor | ||
|
||
dbConvertor模块用于从hoj数据库迁移到kzoj数据库 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
plugins { | ||
kotlin("jvm") version libs.versions.kotlin | ||
} | ||
|
||
group = "cn.kzoj" | ||
version = "0.0.1" | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
dependencies { | ||
implementation(project(":dto")) | ||
implementation(project(":persistence")) | ||
|
||
implementation(libs.bundles.exposed) | ||
implementation(libs.hikaricp) | ||
implementation(libs.kotlinx.datetime) | ||
implementation(libs.logback.classic) | ||
implementation(libs.mysql.connector) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package cn.kzoj.dbConvertor | ||
|
||
fun main(args: Array<String>) { | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
dbConvertor/src/main/kotlin/cn/kzoj/dbConvertor/hojData/Database.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package cn.kzoj.dbConvertor.hojData | ||
|
||
fun configureDatabase() { | ||
|
||
} |
42 changes: 42 additions & 0 deletions
42
dbConvertor/src/main/kotlin/cn/kzoj/dbConvertor/hojData/problem/ProblemDAO.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package cn.kzoj.dbConvertor.hojData.problem | ||
|
||
import org.jetbrains.exposed.dao.IntEntity | ||
import org.jetbrains.exposed.dao.IntEntityClass | ||
import org.jetbrains.exposed.dao.id.EntityID | ||
|
||
@Suppress("Unused") | ||
class ProblemDAO(id: EntityID<Int>) : IntEntity(id) { | ||
companion object: IntEntityClass<ProblemDAO>(ProblemTable) | ||
|
||
var problemId by ProblemTable.problemId | ||
var title by ProblemTable.title | ||
var author by ProblemTable.author | ||
var problemType by ProblemTable.problemType | ||
var timeLimit by ProblemTable.timeLimit | ||
var memoryLimit by ProblemTable.memoryLimit | ||
var stackLimit by ProblemTable.stackLimit | ||
var problemDescription by ProblemTable.problemDescription | ||
var inputDescription by ProblemTable.inputDescription | ||
var outputDescription by ProblemTable.outputDescription | ||
var examples by ProblemTable.examples | ||
var isRemoteJudge by ProblemTable.isRemoteJudge | ||
var problemSource by ProblemTable.problemSource | ||
var difficulty by ProblemTable.difficulty | ||
var hint by ProblemTable.hint | ||
var authority by ProblemTable.authority | ||
var oiScore by ProblemTable.oiScore | ||
var isCodeSharable by ProblemTable.isCodeSharable | ||
var judgeMode by ProblemTable.judgeMode | ||
var judgeCaseMode by ProblemTable.judgeCaseMode | ||
var spjCode by ProblemTable.spjCode | ||
var spjLanguage by ProblemTable.spjLanguage | ||
var removeEndBlankChar by ProblemTable.removeEndBlankChar | ||
var openCaseResult by ProblemTable.openCaseResult | ||
var isCaseUploaded by ProblemTable.isCaseUploaded | ||
var caseVersion by ProblemTable.caseVersion | ||
var lastModifiedByUser by ProblemTable.lastModifiedByUser | ||
var isInGroup by ProblemTable.isInGroup | ||
var groupId by ProblemTable.groupId | ||
var dateCreated by ProblemTable.dateCreated | ||
var dateLastModified by ProblemTable.dateLastModified | ||
} |
71 changes: 71 additions & 0 deletions
71
dbConvertor/src/main/kotlin/cn/kzoj/dbConvertor/hojData/problem/ProblemTable.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package cn.kzoj.dbConvertor.hojData.problem | ||
|
||
import kotlinx.datetime.LocalDateTime | ||
import org.jetbrains.exposed.dao.id.IntIdTable | ||
import org.jetbrains.exposed.sql.Column | ||
import org.jetbrains.exposed.sql.kotlin.datetime.datetime | ||
|
||
object ProblemTable: IntIdTable("problem_") { | ||
|
||
val problemId: Column<String> = text("problem_id") | ||
|
||
val title: Column<String> = text("title") | ||
|
||
val author: Column<String> = text("author") | ||
|
||
val problemType: Column<Int> = integer("problem_type") | ||
|
||
val timeLimit: Column<Long> = long("time_limit") | ||
|
||
val memoryLimit: Column<Long> = long("memory_limit") | ||
|
||
val stackLimit: Column<Long> = long("stack_limit") | ||
|
||
val problemDescription: Column<String> = text("problem_description") | ||
|
||
val inputDescription: Column<String> = text("input_description") | ||
|
||
val outputDescription: Column<String> = text("output_description") | ||
|
||
val examples: Column<String> = text("examples") | ||
|
||
val isRemoteJudge: Column<Boolean> = bool("is_remote_judge") | ||
|
||
val problemSource: Column<String> = text("problem_source") | ||
|
||
val difficulty: Column<Int> = integer("difficulty") | ||
|
||
val hint: Column<String> = text("hint") | ||
|
||
val authority: Column<Int> = integer("authority") | ||
|
||
val oiScore: Column<Int> = integer("oi_score") | ||
|
||
val isCodeSharable: Column<Boolean> = bool("is_code_sharable") | ||
|
||
val judgeMode: Column<String> = text("judge_mode") | ||
|
||
val judgeCaseMode: Column<String> = text("judge_case_mode") | ||
|
||
val spjCode: Column<String?> = text("spj_code").nullable() | ||
|
||
val spjLanguage: Column<String?> = text("spj_language").nullable() | ||
|
||
val removeEndBlankChar: Column<Boolean> = bool("remove_end_blank_char") | ||
|
||
val openCaseResult: Column<Boolean> = bool("open_case_result") | ||
|
||
val isCaseUploaded: Column<Boolean> = bool("is_case_uploaded") | ||
|
||
val caseVersion: Column<String> = text("case_version") | ||
|
||
val lastModifiedByUser: Column<String> = text("last_modified_by_user") | ||
|
||
val isInGroup: Column<Boolean> = bool("is_in_group") | ||
|
||
val groupId: Column<Int?> = integer("group_id").nullable() | ||
|
||
val dateCreated: Column<LocalDateTime> = datetime("date_created") | ||
|
||
val dateLastModified: Column<LocalDateTime> = datetime("date_last_modified") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters