Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

实现判题模块&用户表&题目表等核心功能 #7

Merged
merged 112 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
2813f74
docs:README
shaoyuanyu Jan 19, 2024
ce0db7b
chore:引入ktorm和mysql-connector-j
shaoyuanyu Jan 19, 2024
1573ede
chore:.gitignore
shaoyuanyu Jan 19, 2024
5667dfe
feat:搭建基本Route结构并完成测试
shaoyuanyu Jan 19, 2024
147d68a
feat:初步搭建数据框架,初步实现向前兼容的Problem数据结构
shaoyuanyu Jan 19, 2024
a70d741
refactor:重构Problem实体类和Problems表以对接新数据库
shaoyuanyu Jan 21, 2024
a388d90
refactor:Problem
shaoyuanyu Jan 22, 2024
b242369
feat:ProblemDetail
shaoyuanyu Jan 22, 2024
b37e7b0
refactor:Problem & Problems & ProblemDetail
shaoyuanyu Jan 23, 2024
a6cc354
feat:实现ProblemDAO,完成题目获取api
shaoyuanyu Jan 23, 2024
1c4150b
chore:增加CORS依赖
shaoyuanyu Jan 23, 2024
bf96d65
feat:CORS配置
shaoyuanyu Jan 23, 2024
a4ff9f3
feat:题目获取api实现异常判断和抛出
shaoyuanyu Jan 23, 2024
3ea7095
feat:初步构建User表
shaoyuanyu Jan 25, 2024
3e3543c
feat:构建DatabaseProvider和ProblemServer体系
shaoyuanyu Feb 28, 2024
48446d7
docs:README
shaoyuanyu Feb 28, 2024
f437c37
refactor:数据库配置的driver项设置为选填
shaoyuanyu Feb 28, 2024
5a08411
feat:初步实现Judge框架
shaoyuanyu Feb 28, 2024
d5aae16
feat:完善判题和查询流程,规整数据结构,增加API,时间数据方面转向kotlinx-datetime
shaoyuanyu Mar 2, 2024
e7a6877
feat:创建Ktor的GithubActions工作流
shaoyuanyu Mar 2, 2024
cb24d0e
fix:删除test工作流
shaoyuanyu Mar 2, 2024
1d490f4
feat:Create LICENSE
shaoyuanyu Mar 4, 2024
d9c011d
doc:README
shaoyuanyu Mar 4, 2024
2c54208
feat:搭建client,接通go-judge模块
shaoyuanyu Mar 5, 2024
e144c04
refactor:将RoutesGraph并入configureRouting
shaoyuanyu Jul 10, 2024
6011b76
feat:接通c语言判题流程
shaoyuanyu Oct 2, 2024
e3d799b
fix:修复worker协程冲突
shaoyuanyu Oct 2, 2024
7d0ae64
chore:删除样例代码
shaoyuanyu Oct 3, 2024
433c419
feat:完善判题模块流程,封装SandboxRun
shaoyuanyu Oct 3, 2024
c67d454
feat:配置docker-compose
shaoyuanyu Oct 5, 2024
0ec9257
upgrade to kotlin 2.0.20
shaoyuanyu Oct 5, 2024
a164e6b
chore:规范gradle配置
shaoyuanyu Oct 5, 2024
401d0b1
移除Ktorm;增加Exposed;更新Ktor到2.3.12,该版本修复了一个本项目遇到的冲突
shaoyuanyu Oct 5, 2024
b8752b6
feat:使用Exposed初步构建Problem表
shaoyuanyu Oct 5, 2024
8619794
更新kotlinx-datetime到0.6.1
shaoyuanyu Oct 5, 2024
eb8c505
feat: 使用HiKariCP
shaoyuanyu Oct 5, 2024
ed5e492
refactor:去除problemId
shaoyuanyu Oct 6, 2024
9901d6e
feat:引入StatusPages插件
shaoyuanyu Oct 6, 2024
6b7f655
feat:实现Problem的完整CRUD
shaoyuanyu Oct 6, 2024
2c5698c
feat:准备接入testCase
shaoyuanyu Oct 6, 2024
6fd0ed5
Merge pull request #1 from shaoyuanyu/migrate/fromKtormToExposed
shaoyuanyu Oct 6, 2024
27de0c7
feat:实现读取本地testCase
shaoyuanyu Oct 6, 2024
98c8dca
feat:通过ProblemCase表,从本地读取测试样例
shaoyuanyu Oct 6, 2024
23c5b8b
feat:集成go-judge到docker-compose
shaoyuanyu Oct 7, 2024
5e7260d
fix:修正了GET方法中附有body的错误
shaoyuanyu Oct 9, 2024
f0a49e8
feat:初步实现按页查询题目的接口
shaoyuanyu Oct 10, 2024
595143d
refactor:封装List<ProblemDAO>的expose方法
shaoyuanyu Oct 10, 2024
492b9e7
feat:在docker-compose中引入minio服务
shaoyuanyu Oct 15, 2024
196dffe
feat:引入minio SDK并初步封装
shaoyuanyu Oct 15, 2024
1e5affe
feat:将本地文件服务迁移到MinIO
shaoyuanyu Oct 15, 2024
2951079
Merge pull request #2 from shaoyuanyu/migrate/MinIO
shaoyuanyu Oct 15, 2024
cf4d32f
refactor:隔离data层,封装data service,独立judge路由
shaoyuanyu Oct 17, 2024
414cfda
feat:配置logging
shaoyuanyu Oct 17, 2024
b2c1f09
refactor:将MinIO服务并入data层
shaoyuanyu Oct 18, 2024
909c82b
refactor:统一时区为UTC,调整时间逻辑
shaoyuanyu Oct 18, 2024
98f6cc8
chore:升级Ktor到3.0.0,更新依赖
shaoyuanyu Oct 19, 2024
35eec53
feat:初步实现User的data层,封装部分service
shaoyuanyu Oct 19, 2024
2cb02eb
feat:完善异常和HTTP status管理;将参数检验统一到route层
shaoyuanyu Oct 26, 2024
3f00d34
refactor:User.username调整为unique
shaoyuanyu Oct 26, 2024
61b4e85
feat:新增exception
shaoyuanyu Oct 27, 2024
ff81c0b
feat:基本完成权限、session和账号验证功能,实现登录登出
shaoyuanyu Oct 27, 2024
9c55b0f
feat:完成头像上传下载工作流
shaoyuanyu Oct 27, 2024
2356df1
chore:调整LOGGER包名
shaoyuanyu Oct 27, 2024
2ece2d6
feat:完成用户注册功能,重构创建用户服务
shaoyuanyu Oct 27, 2024
f54714e
feat:完善User接口,设置Problem的身份验证
shaoyuanyu Oct 27, 2024
668c669
完成docker运行验证
shaoyuanyu Oct 27, 2024
31cf854
fix:CORS
shaoyuanyu Oct 29, 2024
f670f2b
fix:为开发环境配置CORS
shaoyuanyu Oct 29, 2024
1279712
feat:新增Problem API
shaoyuanyu Oct 29, 2024
1ba5918
fix:createProblem()时createdByUser项改从session读出
shaoyuanyu Oct 29, 2024
d45429f
feat:为Judge路由增加身份验证
shaoyuanyu Oct 29, 2024
d53e4cf
(破坏性更新)更改一些路由命名
shaoyuanyu Oct 29, 2024
c972492
refactor:将项目拆分为api/judge/persistence/web四个模块
shaoyuanyu Oct 31, 2024
93ca2b6
refactor:拆分封装minio方法
shaoyuanyu Nov 1, 2024
7afe84b
Merge pull request #3 from shaoyuanyu/switch2multi-module
shaoyuanyu Nov 1, 2024
6edc284
feat: 更新用户路由,添加查询当前用户的接口
doowzs Nov 1, 2024
cb3f1d4
Merge pull request #4 from doowzs/develop
shaoyuanyu Nov 1, 2024
8905d9f
chore: 更新gitignore配置
doowzs Nov 1, 2024
e51580d
chore:gradle配置
shaoyuanyu Nov 1, 2024
daf1ae8
Merge remote-tracking branch 'origin/develop' into develop
shaoyuanyu Nov 1, 2024
2ef86e4
Merge pull request #5 from shaoyuanyu/update-gitignore
shaoyuanyu Nov 1, 2024
38da433
chore:README
shaoyuanyu Nov 1, 2024
7930112
feat: 更新docker-compose和环境变量配置
doowzs Nov 1, 2024
43203f2
Merge pull request #6 from shaoyuanyu/update-docker-compose
shaoyuanyu Nov 1, 2024
e5dce67
chore:补充README
shaoyuanyu Nov 1, 2024
c64b737
feat:规范模块命名以消除歧义,现有模块为app/dto/judge/persistence
shaoyuanyu Nov 1, 2024
f08fdf5
chore:README
shaoyuanyu Nov 1, 2024
0decad4
fix:环境变量设置
shaoyuanyu Nov 1, 2024
526c47b
feat:修正User路由中uuid和userId命名混用的问题
shaoyuanyu Nov 1, 2024
1431444
feat:增加dbConvertor模块,实现hoj-problem表
shaoyuanyu Nov 1, 2024
54ab292
chore:更新Dockerfile
shaoyuanyu Nov 1, 2024
4899b28
feat:实现hoj的problem/problem_case/user_info表
shaoyuanyu Nov 2, 2024
abf7fac
feat:修改适配hoj的user_info表,增加hoj的database配置函数
shaoyuanyu Nov 2, 2024
12b97dd
refactor:规范DAO和Entity命名
shaoyuanyu Nov 2, 2024
191d04e
refactor:优化dto模块代码格式,删除冗余样例
shaoyuanyu Nov 2, 2024
604c015
refactor:修改表单名和部分Column名
shaoyuanyu Nov 2, 2024
2e6916e
feat:实现ProblemStatus
shaoyuanyu Nov 2, 2024
9818bdc
fix:适配hoj的Problem表项存在null的情况
shaoyuanyu Nov 2, 2024
a05c75b
feat:增加连接池数量,设置hoj数据库只读
shaoyuanyu Nov 2, 2024
8a24b0f
feat:实现从hoj迁移适配Problem表
shaoyuanyu Nov 2, 2024
4e5ed1b
feat:实现User表初次创建时初始化管理员账户
shaoyuanyu Nov 2, 2024
4f9e2bb
feat:实现从hoj迁移适配User表
shaoyuanyu Nov 2, 2024
308ba75
feat:实现BCrypt算法的密码加密存储/校验,以及对老系统中MD5算法存储的密码的兼容
shaoyuanyu Nov 2, 2024
bbe8d2f
chore:README
shaoyuanyu Nov 2, 2024
e065be1
feat:实现hoj的ProblemCase表及文件迁移
shaoyuanyu Nov 2, 2024
03df4ea
format:优化代码格式,增加一些log
shaoyuanyu Nov 2, 2024
eee3682
chore:更新Dockerfile
shaoyuanyu Nov 3, 2024
0c5fd50
fix:修复遗漏未修改的包名
shaoyuanyu Nov 3, 2024
c09317d
feat:按照buildSrc方式组织gradle结构
shaoyuanyu Nov 3, 2024
9642fa3
feat:补全dbConvertor模块
shaoyuanyu Nov 3, 2024
f8ae7eb
fix:删除测试代码
shaoyuanyu Nov 3, 2024
e994aa4
chore:设置版本号
shaoyuanyu Nov 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .env.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
KZOJ_APP_PORT=8080
KZOJ_WEB_PORT=3000

GO_JUDGE_PORT=5050

MYSQL_PORT=3306
MYSQL_DATABASE=kzoj
MYSQL_USER=kzoj
MYSQL_PASSWORD=kzoj
MYSQL_ROOT_PASSWORD=kzoj_mysql_password_very_long

MINIO_API_PORT=9000
MINIO_CONSOLE_PORT=9001
MINIO_ROOT_USER=kzoj
MINIO_ROOT_PASSWORD=kzoj_minio_password_very_long
7 changes: 7 additions & 0 deletions .env.docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
##########################################
### DO NOT MODIFY THE FOLLOWING VALUES ###
##########################################

GO_JUDGE_URL=http://sandbox:${GO_JUDGE_PORT}
MYSQL_JDBC_URL=jdbc:mysql://mysql:${MYSQL_PORT}/${MYSQL_DATABASE}
MINIO_SERVER_URL=http://minio:${MINIO_API_PORT}
30 changes: 30 additions & 0 deletions .github/workflows/ktor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Ktor Build

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "master", "develop" ]


jobs:

build:
name: Ktor build
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'oracle'

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Build Ktor application
run: ./gradlew assemble
314 changes: 287 additions & 27 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,36 +1,296 @@
# Imported from: https://github.com/ktorio/ktor/blob/main/.gitignore
build
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/
.gradletasknamecache
.idea/*
!.idea/runConfigurations
!.idea/runConfigurations/*
!.idea/vcs.xml
!.idea/dictionaries
!.idea/dictionaries/*
!.idea/copyright
!.idea/copyright/*
!.idea/icon.svg
out
*.iml
.vscode

*.versionsBackup
*.releaseBackup
release.properties
local.properties
*.swp

.video
.attach_pid*
apidoc


### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/
.settings
.project
.classpath
.konan

### IntelliJ IDEA ###
.idea
*.iws
.DS_Store

hs_err_pid*.log

gradle-user-home

.fleet
.kotlin

scan-journal.log

.env


# Created by https://www.toptal.com/developers/gitignore/api/linux,macos,windows,kotlin,intellij+all,gradle,visualstudiocode,netbeans
# Edit at https://www.toptal.com/developers/gitignore?templates=linux,macos,windows,kotlin,intellij+all,gradle,visualstudiocode,netbeans

### Intellij+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
.idea/artifacts
.idea/compiler.xml
.idea/jarRepositories.xml
.idea/modules.xml
.idea/*.iml
.idea/modules
*.iml
*.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/
!**/src/main/**/out/
!**/src/test/**/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# SonarLint plugin
.idea/sonarlint/

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### Intellij+all Patch ###
# Ignore everything but code style settings and run configurations
# that are supposed to be shared within teams.

.idea/*

!.idea/codeStyles
!.idea/runConfigurations

### Kotlin ###
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### macOS Patch ###
# iCloud generated files
*.icloud

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/
**/nbproject/private/
**/nbproject/Makefile-*.mk
**/nbproject/Package-*.bash
build/
nbbuild/
dist/
nbdist/
.nb-gradle/

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/

# Built Visual Studio Code Extensions
*.vsix

### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

### Gradle ###
.gradle
**/build/
!src/**/build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Avoid ignore Gradle wrappper properties
!gradle-wrapper.properties

# Cache of project
.gradletasknamecache

# Eclipse Gradle plugin generated files
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath

### Gradle Patch ###
# Java heap dump
*.hprof

# End of https://www.toptal.com/developers/gitignore/api/linux,macos,windows,kotlin,intellij+all,gradle,visualstudiocode,netbeans
Loading
Loading