Compare commits

..

No commits in common. "570cf53f20a39c4bb9a686ef212dd01a12cff014" and "4f9e6ae4cb6cadeb2ed9eddff75a7c2f19ff9e16" have entirely different histories.

137 changed files with 785 additions and 6828 deletions

8
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@ -7,16 +7,16 @@
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="XJ-OJ" />
<module name="oj-spring-boot" />
</profile>
</annotationProcessing>
<bytecodeTargetLevel>
<module name="XJ-OJ" target="1.8" />
<module name="oj-spring-boot" target="1.8" />
</bytecodeTargetLevel>
</component>
<component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
<module name="XJ-OJ" options="-parameters" />
<module name="oj-spring-boot" options="-parameters" />
</option>
</component>
</project>

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="dataSourceStorageLocal" created-in="IU-213.6461.79">
<data-source name="@localhost" uuid="5fb77bb9-18fc-41e1-adf2-ac6fcbf0f222">
<database-info product="" version="" jdbc-version="" driver-name="" driver-version="" dbms="MYSQL" exact-version="0" />
<schema-mapping />
</data-source>
</component>
</project>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="@localhost" uuid="5fb77bb9-18fc-41e1-adf2-ac6fcbf0f222">
<data-source source="LOCAL" name="@localhost" uuid="6aaf03f9-1117-4cce-acf3-09911a21dc79">
<driver-ref>mysql.8</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>

File diff suppressed because it is too large Load Diff

View File

@ -1,2 +0,0 @@
#n:information_schema
!<md> [null, 0, null, null, -2147483648, -2147483648]

View File

@ -1,2 +0,0 @@
#n:mysql
!<md> [null, 0, null, null, -2147483648, -2147483648]

View File

@ -1,2 +0,0 @@
#n:performance_schema
!<md> [null, 0, null, null, -2147483648, -2147483648]

View File

@ -1,2 +0,0 @@
#n:sys
!<md> [null, 0, null, null, -2147483648, -2147483648]

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<component name="Encoding" native2AsciiForPropertiesFiles="true" defaultCharsetForPropertiesFiles="UTF-8">
<file url="file://$PROJECT_DIR$/oj-spring-boot/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/oj-spring-boot/src/main/resources" charset="UTF-8" />
<file url="PROJECT" charset="UTF-8" />
</component>
</project>

View File

@ -1,11 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />

View File

@ -2,8 +2,8 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/oj-spring-boot/XJ-OJ.iml" filepath="$PROJECT_DIR$/oj-spring-boot/XJ-OJ.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/shengchan.iml" filepath="$PROJECT_DIR$/.idea/shengchan.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/XJ-OJ.iml" filepath="$PROJECT_DIR$/.idea/XJ-OJ.iml" />
<module fileurl="file://$PROJECT_DIR$/oj-spring-boot/oj-spring-boot.iml" filepath="$PROJECT_DIR$/oj-spring-boot/oj-spring-boot.iml" />
</modules>
</component>
</project>

View File

@ -1,86 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="TemplatesSettings">
<option name="templateConfigs">
<TemplateContext>
<option name="generateConfig">
<GenerateConfig>
<option name="annotationType" value="MYBATIS_PLUS3" />
<option name="basePackage" value="generator" />
<option name="basePath" value="src/main/java" />
<option name="classNameStrategy" value="camel" />
<option name="encoding" value="UTF-8" />
<option name="extraClassSuffix" value="" />
<option name="ignoreFieldPrefix" value="" />
<option name="ignoreFieldSuffix" value="" />
<option name="ignoreTablePrefix" value="" />
<option name="ignoreTableSuffix" value="" />
<option name="moduleName" value="XJ-OJ" />
<option name="modulePath" value="$PROJECT_DIR$/oj-spring-boot" />
<option name="moduleUIInfoList">
<list>
<ModuleInfoGo>
<option name="basePath" value="${domain.basePath}" />
<option name="configFileName" value="serviceImpl.ftl" />
<option name="configName" value="serviceImpl" />
<option name="encoding" value="${domain.encoding}" />
<option name="fileName" value="${domain.fileName}ServiceImpl" />
<option name="fileNameWithSuffix" value="${domain.fileName}ServiceImpl.java" />
<option name="modulePath" value="$PROJECT_DIR$/oj-spring-boot" />
<option name="packageName" value="${domain.basePackage}.service.impl" />
</ModuleInfoGo>
<ModuleInfoGo>
<option name="basePath" value="${domain.basePath}" />
<option name="configFileName" value="mapperInterface.ftl" />
<option name="configName" value="mapperInterface" />
<option name="encoding" value="${domain.encoding}" />
<option name="fileName" value="${domain.fileName}Mapper" />
<option name="fileNameWithSuffix" value="${domain.fileName}Mapper.java" />
<option name="modulePath" value="$PROJECT_DIR$/oj-spring-boot" />
<option name="packageName" value="${domain.basePackage}.mapper" />
</ModuleInfoGo>
<ModuleInfoGo>
<option name="basePath" value="${domain.basePath}" />
<option name="configFileName" value="serviceInterface.ftl" />
<option name="configName" value="serviceInterface" />
<option name="encoding" value="${domain.encoding}" />
<option name="fileName" value="${domain.fileName}Service" />
<option name="fileNameWithSuffix" value="${domain.fileName}Service.java" />
<option name="modulePath" value="$PROJECT_DIR$/oj-spring-boot" />
<option name="packageName" value="${domain.basePackage}.service" />
</ModuleInfoGo>
<ModuleInfoGo>
<option name="basePath" value="src/main/resources" />
<option name="configFileName" value="mapperXml.ftl" />
<option name="configName" value="mapperXml" />
<option name="encoding" value="${domain.encoding}" />
<option name="fileName" value="${domain.fileName}Mapper" />
<option name="fileNameWithSuffix" value="${domain.fileName}Mapper.xml" />
<option name="modulePath" value="$PROJECT_DIR$/oj-spring-boot" />
<option name="packageName" value="mapper" />
</ModuleInfoGo>
</list>
</option>
<option name="needsComment" value="true" />
<option name="needsModel" value="true" />
<option name="relativePackage" value="domain" />
<option name="superClass" value="" />
<option name="tableUIInfoList">
<list>
<TableUIInfo>
<option name="className" value="User" />
<option name="tableName" value="user" />
</TableUIInfo>
</list>
</option>
<option name="templatesName" value="mybatis-plus3" />
<option name="useLombokPlugin" value="true" />
</GenerateConfig>
</option>
<option name="moduleName" value="XJ-OJ" />
<option name="projectPath" value="$PROJECT_DIR$" />
<option name="templateName" value="mybatis-plus3" />
</TemplateContext>
</option>
</component>
</project>

View File

@ -1,4 +0,0 @@
<changelist name="在进行更新之前于_2024_9_21_22_02_取消提交了变更_[变更]" date="1726927329896" recycled="true" deleted="true">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/在进行更新之前于_2024_9_21_22_02_取消提交了变更_[变更]/shelved.patch" />
<option name="DESCRIPTION" value="在进行更新之前于 2024/9/21 22:02 取消提交了变更 [变更]" />
</changelist>

View File

@ -1,4 +0,0 @@
<changelist name="在进行更新之前于_2024_9_24_15_05_取消提交了更改_[更改]" date="1727161549686" recycled="true" deleted="true">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/在进行更新之前于_2024_9_24_15_05_取消提交了更改_[更改]/shelved.patch" />
<option name="DESCRIPTION" value="在进行更新之前于 2024/9/24 15:05 取消提交了更改 [更改]" />
</changelist>

View File

@ -1,4 +0,0 @@
<changelist name="在进行更新之前于_2024_9_25_15_55_取消提交了变更_[变更]" date="1727250914025" recycled="true" deleted="true">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/在进行更新之前于_2024_9_25_15_55_取消提交了变更_[变更]/shelved.patch" />
<option name="DESCRIPTION" value="在进行更新之前于 2024/9/25 15:55 取消提交了变更 [变更]" />
</changelist>

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@ -1,274 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="2cf2a602-e312-4ccf-b590-3d85bd948e6e" name="变更" comment="第十三次提交&#10;修改.sql文件" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Class" />
</list>
</option>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="GitSEFilterConfiguration">
<file-type-list>
<filtered-out-file-type name="LOCAL_BRANCH" />
<filtered-out-file-type name="REMOTE_BRANCH" />
<filtered-out-file-type name="TAG" />
<filtered-out-file-type name="COMMIT_BY_MESSAGE" />
</file-type-list>
</component>
<component name="GithubDefaultAccount">
<option name="defaultAccountId" value="d92d79e6-0500-448e-a767-15601d9cfea7" />
</component>
<component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" />
</component>
<component name="MavenImportPreferences">
<option name="generalSettings">
<MavenGeneralSettings>
<option name="useMavenConfig" value="true" />
</MavenGeneralSettings>
</option>
</component>
<component name="ProjectId" id="2mNof1kfe6QHqtPzZEcKSCD7PIa" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
<ConfirmationsSetting value="2" id="Add" />
</component>
<component name="ProjectViewState">
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="ASKED_ADD_EXTERNAL_FILES" value="true" />
<property name="ASKED_SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
<property name="DatabaseDriversLRU" value="mysql" />
<property name="RequestMappingsPanelOrder0" value="0" />
<property name="RequestMappingsPanelOrder1" value="1" />
<property name="RequestMappingsPanelWidth0" value="75" />
<property name="RequestMappingsPanelWidth1" value="75" />
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="node.js.detected.package.eslint" value="true" />
<property name="node.js.selected.package.eslint" value="(autodetect)" />
<property name="nodejs_package_manager_path" value="npm" />
<property name="project.structure.last.edited" value="Facet" />
<property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.2" />
<property name="run.code.analysis.last.selected.profile" value="pProject Default" />
<property name="settings.editor.selected.configurable" value="File.Encoding" />
<property name="ts.external.directory.path" value="D:\Program Files\JetBrains\IntelliJ IDEA 2021.3.1\plugins\JavaScriptLanguage\jsLanguageServicesImpl\external" />
<property name="vue.rearranger.settings.migration" value="true" />
</component>
<component name="ReactorSettings">
<option name="notificationShown" value="true" />
</component>
<component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS">
<recent name="D:\JavaCode\XJ-OJ\oj-spring-boot" />
</key>
<key name="CopyClassDialog.RECENTS_KEY">
<recent name="top.weiyuexin.config" />
</key>
</component>
<component name="RunDashboard">
<option name="configurationTypes">
<set>
<option value="SpringBootApplicationConfigurationType" />
</set>
</option>
</component>
<component name="RunManager" selected="Spring Boot.Application (1)">
<configuration name="Application (1)" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<module name="XJ-OJ" />
<option name="SPRING_BOOT_MAIN_CLASS" value="top.weiyuexin.Application" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="serve" type="js.build_tools.npm" temporary="true" nameIsGenerated="true">
<package-json value="$PROJECT_DIR$/oj-vue/package.json" />
<command value="run" />
<scripts>
<script value="serve" />
</scripts>
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
<recent_temporary>
<list>
<item itemvalue="npm.serve" />
</list>
</recent_temporary>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="默认任务">
<changelist id="2cf2a602-e312-4ccf-b590-3d85bd948e6e" name="变更" comment="" />
<created>1726926495267</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1726926495267</updated>
<workItem from="1726926496563" duration="35571000" />
<workItem from="1727021031893" duration="1554000" />
<workItem from="1727052895851" duration="6654000" />
<workItem from="1727060865636" duration="26397000" />
<workItem from="1727139127126" duration="10628000" />
<workItem from="1727250851984" duration="1246000" />
<workItem from="1727334065315" duration="314000" />
</task>
<task id="LOCAL-00001" summary="第一次提交,项目初始化">
<created>1726927114594</created>
<option name="number" value="00001" />
<option name="presentableId" value="LOCAL-00001" />
<option name="project" value="LOCAL" />
<updated>1726927114594</updated>
</task>
<task id="LOCAL-00002" summary="第二次测试">
<created>1726927416919</created>
<option name="number" value="00002" />
<option name="presentableId" value="LOCAL-00002" />
<option name="project" value="LOCAL" />
<updated>1726927416919</updated>
</task>
<task id="LOCAL-00003" summary="第三次提交&#10;完善腾讯云图片存储&#10;完善登录逻辑&#10;完善页面显示">
<created>1727015154706</created>
<option name="number" value="00003" />
<option name="presentableId" value="LOCAL-00003" />
<option name="project" value="LOCAL" />
<updated>1727015154706</updated>
</task>
<task id="LOCAL-00004" summary="第四次提交&#10;解决邮箱登录问题&#10;解决Python运行问题">
<created>1727021542243</created>
<option name="number" value="00004" />
<option name="presentableId" value="LOCAL-00004" />
<option name="project" value="LOCAL" />
<updated>1727021542243</updated>
</task>
<task id="LOCAL-00005" summary="第五次提交&#10;解决退出后界面不跳转问题&#10;解决头像更换后不显示问题">
<created>1727054023550</created>
<option name="number" value="00005" />
<option name="presentableId" value="LOCAL-00005" />
<option name="project" value="LOCAL" />
<updated>1727054023550</updated>
</task>
<task id="LOCAL-00006" summary="第六次提交&#10;解决各页面查询问题&#10;完善判题逻辑&#10;完善后端管理界面登录功能&#10;完善后端管理界面文章预览功能&#10;完善博客功能">
<created>1727086745036</created>
<option name="number" value="00006" />
<option name="presentableId" value="LOCAL-00006" />
<option name="project" value="LOCAL" />
<updated>1727086745036</updated>
</task>
<task id="LOCAL-00007" summary="第七次提交&#10;后端管理界面查询功能优化&#10;后端管理界面修改密码优化">
<created>1727094761508</created>
<option name="number" value="00007" />
<option name="presentableId" value="LOCAL-00007" />
<option name="project" value="LOCAL" />
<updated>1727094761508</updated>
</task>
<task id="LOCAL-00008" summary="第八次提交&#10;修改密码">
<created>1727139362037</created>
<option name="number" value="00008" />
<option name="presentableId" value="LOCAL-00008" />
<option name="project" value="LOCAL" />
<updated>1727139362037</updated>
</task>
<task id="LOCAL-00009" summary="第九次提交&#10;修改密码">
<created>1727145163327</created>
<option name="number" value="00009" />
<option name="presentableId" value="LOCAL-00009" />
<option name="project" value="LOCAL" />
<updated>1727145163327</updated>
</task>
<task id="LOCAL-00010" summary="第九次提交&#10;修改图片">
<created>1727145195612</created>
<option name="number" value="00010" />
<option name="presentableId" value="LOCAL-00010" />
<option name="project" value="LOCAL" />
<updated>1727145195612</updated>
</task>
<task id="LOCAL-00011" summary="第十次提交&#10;分工完善">
<created>1727149029361</created>
<option name="number" value="00011" />
<option name="presentableId" value="LOCAL-00011" />
<option name="project" value="LOCAL" />
<updated>1727149029361</updated>
</task>
<task id="LOCAL-00012" summary="第十三次提交&#10;修改.sql文件">
<created>1727334217442</created>
<option name="number" value="00012" />
<option name="presentableId" value="LOCAL-00012" />
<option name="project" value="LOCAL" />
<updated>1727334217442</updated>
</task>
<option name="localTasksCounter" value="13" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State>
<option name="FILTERS">
<map>
<entry key="branch">
<value>
<list>
<option value="master" />
</list>
</value>
</entry>
</map>
</option>
</State>
</value>
</entry>
</map>
</option>
</component>
<component name="VcsManagerConfiguration">
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
<option name="CHECK_NEW_TODO" value="false" />
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
<MESSAGE value="第一次提交,项目初始化" />
<MESSAGE value="第二次测试" />
<MESSAGE value="第三次提交&#10;完善腾讯云图片存储&#10;完善登录逻辑&#10;完善页面显示" />
<MESSAGE value="第四次提交&#10;解决邮箱登录问题&#10;解决Python运行问题" />
<MESSAGE value="第五次提交&#10;解决退出后界面不跳转问题&#10;解决头像更换后不显示问题" />
<MESSAGE value="第六次提交&#10;解决各页面查询问题&#10;完善判题逻辑&#10;完善后端管理界面登录功能&#10;完善后端管理界面文章预览功能&#10;完善博客功能" />
<MESSAGE value="第七次提交&#10;后端管理界面查询功能优化&#10;后端管理界面修改密码优化" />
<MESSAGE value="第八次提交&#10;修改密码" />
<MESSAGE value="第九次提交&#10;修改密码" />
<MESSAGE value="第九次提交&#10;修改图片" />
<MESSAGE value="第十次提交&#10;分工完善" />
<MESSAGE value="第十三次提交&#10;修改.sql文件" />
<option name="LAST_COMMIT_MESSAGE" value="第十三次提交&#10;修改.sql文件" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/oj-spring-boot/src/main/java/top/weiyuexin/controller/ProblemController.java</url>
<line>91</line>
<option name="timeStamp" value="1" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
</project>

111
README.md
View File

@ -10,14 +10,14 @@
- Spring Boot、MyBatis-Plus、redis
- vue3、Axios、Element Plus
![img.png](img.png)
### 部署运行环境
- Windows
- Centos7
### 系统架构设计
![img](./images/1.gif)
![img](./images/clip_image002.gif)
- 视图层包括网站主站点和后台管理系统主站点负责向用户提供服务是用户看到的系统页面。用户可以在上面进行登录注册、个人信息管理、查看题目、编写代码、提交代码、查看测评状态、查看排名、参加竞赛、查看竞赛结果以及发布文章等主要操作。后台管理系统是专门给系统管理员使用的管理后台管理员可以在上面进行用户管理、题目管理、竞赛管理、日志管理以及查看系统运行状态等操作。视图层通过Ajax与后端接口进行数据交互。
- 网络接口层的主要职责是接收用户的请求根据请求参数的不同做出不同的响应响应数据的格式是JSON数据。
@ -28,11 +28,11 @@
本系统主要分为用户和管理员两个主要的模块。用户模块主要包括登录注册、个人中心、题目浏览、代码评测、竞赛参与、文章发布等多个子功能模块。管理员的功能模块包括用户管理、题目管理、测评管理、竞赛管理、文章管理等。本系统详细的功能模块划分图如图所示。
![img](./images/2.png)
![img](./images/clip_image002-1695122986088-2.gif)
#### 代码测评流程图
![image-20230919193056867](./images/3.png)
![image-20230919193056867](./images/image-20230919193056867.png)
测评结果设计:
@ -72,21 +72,21 @@ System Error系统错误。在进行代码测评时测评机器发送错
注册和登录是系统中其他功能的使用前提进入注册页面后用户需要输入用户名、电子邮箱、邮箱验证码、密码和确认密码只有邮箱验证码和Redis缓存中保存的一致、邮箱未注册、两次输入的密码一致用户才能注册成功。系统注册页面如图4.1所示。
![img](./images/clip002.png)
![img](./images/clip_image002.jpg)
2) 个人中心
个人中心主要用于向用户展示自己的个人信息。同时用户还可以进行个人资料的编辑和重置密码等操作。如图所示是系统个人中心页面。
![img](./images/clip004.png)
![img](./images/clip_image004.jpg)
3) 查看题目
用户可以在题目列表可以分页查看题目列表包括题目名称、难度、提交次数、通过率等等信息。题目详情页可以查看题目详细信息和进行代码提交。如图4.3为题目列表页,图为题目详情页。
![img](./images/clip006.png)
![img](./images/clip_image006.jpg)
![img](./images/clip008.png)
![img](./images/clip_image008.jpg)
4) 代码测评
@ -102,7 +102,7 @@ System Error系统错误。在进行代码测评时测评机器发送错
发布文章页面中用户需要填写标题、分类、正文等内容。发布文章页面如图所示。
![img](./images/clip010.png)
![img](./images/clip_image010.jpg)
(二) 管理员模块
@ -110,31 +110,31 @@ System Error系统错误。在进行代码测评时测评机器发送错
管理员可以对系统中的注册用户进行管理。用户管理页面如图所示。
![img](./images/clip012.png)
![img](./images/clip_image012.jpg)
2) 题目管理
管理员可以对当前系统中的题目进行管理。题目管理页面如图所示。
![img](./images/clip014.png)
![img](./images/clip_image014.jpg)
3) 测评管理
管理员进入测评管理模块后,可以查看题目测评记录。当然这些测评记录都是用户提交代码进行测评时生成的。测评管理页面如图所示。
![img](./images/clip016.png)
![img](./images/clip_image016.jpg)
4) 竞赛管理
管理员是系统中唯一可以对竞赛进行管理的角色。竞赛管理包括查看、创建和删除等操作。创建竞赛时需要设定竞赛的开始和结束时间。竞赛管理页面如图所示。
![img](./images/clip018.png)
![img](./images/clip_image018.jpg)
5) 文章管理
管理员可以对文章进行管理。实现了查看文章列表、删除文章等功能。文章管理页面如图所示。
![img](./images/clip020.png)
![img](./images/clip_image020.jpg)
# 开发过程
@ -167,84 +167,3 @@ System Error系统错误。在进行代码测评时测评机器发送错
- Vue
- 组件库 [Element-plus](https://element-plus.org/zh-CN/component/overview.html)
- 文本编辑器 TODO
## 人员分工(垂直分工)
> 项目整体架构,有三端,前端显示界面,后端管理界面,后端代码逻辑
>
> 分工方式为根据业务功能完成相应三端代码的编写以及MySql表的设计
>
> **每个模块都会用到JavaScript、Css、Html、Vue、Java、Sql、MybatisPlus等技术**
>
> **另外每个模块均由自己完成单元测试**
### 陈佳彬--代码执行
- 各个语言代码的执行逻辑环境和代码编写C、C++、Python、Java、Go已经实现
- 前端首页、关于界面
- 前端、后端代码脚手架编写
- 代码执行逻辑解耦、完成代码沙箱
- 代码执行安全管理
- 接口文档接入
- 功能测试
使用到的技术FileUtils、Runtime、Vue3、Element-Plus、thymeleaf、knife4j
### 陈碧辉--题目测评
- 测评结果Evaluation模块内容
- 解决跨域问题
- 完成腾讯cos服务的接入
- 代码编辑界面
使用到的技术:
<img src="./assets/image-20240924112142857.png" alt="image-20240924112142857" style="zoom:50%;" />
<img src="./assets/image-20240924112223751.png" alt="image-20240924112223751" style="zoom:50%;" />
代码编辑器 https://github.com/koca/vue-prism-editor/blob/master/README.md
### 马岳奇--题目管理
- 题目管理
- 题目创建、题目测试用例添加
使用到的技术:无特别技术
### 夏榆琳--文章管理
- 博客创建
- 个人对自己创建博客的管理(编辑和删除)
- 博客的浏览
- 博客的搜索
使用到的技术:
富文本编辑器 wangEditor 文档地址https://www.wangeditor.com/
### 李柯--登录逻辑
- 前端显示界面登录
- 后端管理界面登录、
- 邮箱验证注册
- 个人信息简介
使用到的技术:
前端登录Cookies、Redis不必要可以不讲
后端登录:拦截器 LoginInterceptor、Cookies
邮箱配置:
<img src="./assets/image-20240924113300957.png" alt="image-20240924113300957" style="zoom:50%;" />
### 罗昊--用户管理
- 用户管理
- 用户排名设计
使用到的技术:无特别技术

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 948 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
images/clip_image002.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
images/clip_image002.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
images/clip_image004.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
images/clip_image006.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
images/clip_image008.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

BIN
images/clip_image012.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
images/clip_image014.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
images/clip_image016.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
images/clip_image018.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
images/clip_image020.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

BIN
img.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

BIN
main.exe

Binary file not shown.

View File

@ -4,9 +4,9 @@ FROM java:8
MAINTAINER wyx
VOLUME /tmp
# 将jar包添加到容器并更名
ADD Online-code-evaluation-system-1.0.0.jar XJ_oj.jar
ADD Online-code-evaluation-system-1.0.0.jar henu_oj.jar
# 运行jar包
RUN bash - C 'touch /XJ_oj.jar'
ENTRYPOINT ["java","-jar","/XJ_oj.jar"]
RUN bash - C 'touch /henu_oj.jar'
ENTRYPOINT ["java","-jar","/henu_oj.jar"]
# 暴露端口
EXPOSE 8080

252
oj-spring-boot/onlineoj.sql Normal file
View File

@ -0,0 +1,252 @@
/*
Navicat Premium Data Transfer
Source Server :
Source Server Type : MySQL
Source Server Version : 80200 (8.2.0)
Source Host : 116.204.21.236:3306
Source Schema : onlineoj
Target Server Type : MySQL
Target Server Version : 80200 (8.2.0)
File Encoding : 65001
Date: 30/11/2023 13:19:41
*/
# 先创建数据库
# CREATE DATABASE XJ_OJ;
# USE XJ_OJ;
# 如果是MySql8.0以上的版本遇到报错可以尝试将 utf8_general_ci替换为utf8mb4_0900_ai_ci
# 同时将utf8替换为utf8mb4
SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for article
-- ----------------------------
DROP TABLE IF EXISTS `article`;
CREATE TABLE `article` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'id',
`author_id` int NOT NULL COMMENT '作者id',
`title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '标题',
`content` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '正文',
`time` datetime NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '发布时间',
`read_num` int NULL DEFAULT 0 COMMENT '阅读量',
`star_num` int NULL DEFAULT 0 COMMENT '点赞量',
`comment_num` int NULL DEFAULT 0 COMMENT '点赞量',
`problem_id` int NULL DEFAULT NULL COMMENT '题目id',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of article
-- ----------------------------
-- ----------------------------
-- Table structure for code
-- ----------------------------
DROP TABLE IF EXISTS `code`;
CREATE TABLE `code` (
`id` int NOT NULL AUTO_INCREMENT COMMENT '代码id',
`user_id` int NOT NULL,
`problem_id` int NOT NULL,
`code_path` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`create_time` datetime NULL DEFAULT NULL,
`language` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of code
-- ----------------------------
-- ----------------------------
-- Table structure for contest
-- ----------------------------
DROP TABLE IF EXISTS `contest`;
CREATE TABLE `contest` (
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`start_time` datetime NULL DEFAULT NULL,
`end_time` datetime NULL DEFAULT NULL,
`num` int NULL DEFAULT NULL,
`status` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of contest
-- ----------------------------
-- ----------------------------
-- Table structure for contest_problem
-- ----------------------------
DROP TABLE IF EXISTS `contest_problem`;
CREATE TABLE `contest_problem` (
`id` int NOT NULL AUTO_INCREMENT,
`contest_id` int NOT NULL,
`problem_id` int NOT NULL,
`submit_num` int NOT NULL DEFAULT 0 COMMENT '提交数',
`solved_num` int NOT NULL DEFAULT 0 COMMENT '通过数',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of contest_problem
-- ----------------------------
-- ----------------------------
-- Table structure for contest_user
-- ----------------------------
DROP TABLE IF EXISTS `contest_user`;
CREATE TABLE `contest_user` (
`id` int NOT NULL AUTO_INCREMENT,
`contest_id` int NOT NULL,
`user_id` int NOT NULL,
`submit_num` int NOT NULL DEFAULT 0,
`solved_num` int NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of contest_user
-- ----------------------------
-- ----------------------------
-- Table structure for evaluation
-- ----------------------------
DROP TABLE IF EXISTS `evaluation`;
CREATE TABLE `evaluation` (
`id` int NOT NULL AUTO_INCREMENT,
`user_id` int NOT NULL,
`problem_id` int NOT NULL,
`create_time` datetime NOT NULL,
`language` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`passed_test_case_num` int NOT NULL DEFAULT 0,
`all_test_case_num` int NOT NULL DEFAULT 0,
`error` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
`is_passed` int NOT NULL DEFAULT 0,
`status` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of evaluation
-- ----------------------------
-- ----------------------------
-- Table structure for file
-- ----------------------------
DROP TABLE IF EXISTS `file`;
CREATE TABLE `file` (
`id` int NOT NULL,
`original_filename` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`new_filename` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`date` datetime NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of file
-- ----------------------------
-- ----------------------------
-- Table structure for problem
-- ----------------------------
DROP TABLE IF EXISTS `problem`;
CREATE TABLE `problem` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '题目id',
`title` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '题目标题',
`description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '题目描述',
`input` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '输入',
`output` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '输出',
`hint` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '提示',
`source` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '来源',
`create_time` datetime NOT NULL COMMENT '创建时间',
`time_limit` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '时间限制(ms)',
`memory_limit` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '内存限制(kb)',
`difficulty` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '难度',
`user_id` bigint NULL DEFAULT NULL COMMENT '上传用户',
`submit_num` int NULL DEFAULT 0 COMMENT '提交次数',
`solved_num` int NULL DEFAULT NULL COMMENT '解决次数',
`describe_input` varchar(255) CHARACTER SET utf16le COLLATE utf16le_general_ci NULL DEFAULT NULL,
`describe_output` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of problem
-- ----------------------------
-- ----------------------------
-- Table structure for solution
-- ----------------------------
DROP TABLE IF EXISTS `solution`;
CREATE TABLE `solution` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
`user_id` bigint NOT NULL COMMENT '用户id',
`problem_id` bigint NOT NULL COMMENT '题目id',
`run_time` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '运行使用时间(ms)',
`memory` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '运行内存',
`language_id` int NULL DEFAULT NULL COMMENT '语言id',
`submit_time` datetime NULL DEFAULT NULL COMMENT '提交时间',
`result` varchar(999) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '运行结果',
`contest_id` int NULL DEFAULT NULL COMMENT '所属竞赛id',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of solution
-- ----------------------------
-- ----------------------------
-- Table structure for test_case
-- ----------------------------
DROP TABLE IF EXISTS `test_case`;
CREATE TABLE `test_case` (
`id` int NOT NULL AUTO_INCREMENT,
`problem_id` int NOT NULL,
`input` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`output` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of test_case
-- ----------------------------
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '用户编号',
`username` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '用户名',
`password` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '密码',
`sex` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '性别',
`introduction` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL COMMENT '个人简介',
`photo` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '头像链接',
`email` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '邮箱',
`submit_num` bigint NULL DEFAULT 0 COMMENT '提交次数',
`solved_num` bigint NULL DEFAULT 0 COMMENT '解决的题数',
`register_time` datetime NULL DEFAULT NULL COMMENT '注册时间',
`access_time` datetime NULL DEFAULT NULL COMMENT '最后登录时间',
`ip` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '登录的ip地址',
`school` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '学校',
`language` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT '0' COMMENT '默认使用的语言',
`is_admin` int NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES (1, 'weiyuexin', 'root', '', '你好我来自henu', '18331361148', '3022422894@qq.com', 0, 0, '2023-02-12 20:09:44', '2023-02-24 20:09:49', NULL, '河南大学', '0', 0);
SET FOREIGN_KEY_CHECKS = 1;

View File

@ -1,6 +1,13 @@
package top.weiyuexin.config;
/**
* @PackageName: top.weiyuexin.config
* @ProjectName: oj-spring-boot
* @ClassName: JwtConfig
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/4/1 17:56
*/
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;

View File

@ -10,7 +10,14 @@ import org.springframework.data.redis.core.script.DefaultRedisScript;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import top.weiyuexin.utils.FastJson2JsonRedisSerializer;
/**
* @PackageName: top.weiyuexin.config
* @ProjectName: oj-spring-boot
* @ClassName: RedisConfig
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/4/1 15:34
*/
@Configuration
@EnableCaching
public class RedisConfig extends CachingConfigurerSupport {

View File

@ -18,7 +18,14 @@ import top.weiyuexin.utils.Time;
import java.util.HashMap;
import java.util.Map;
/**
* @PackageName: top.weiyuexin.controller
* @ProjectName: oj-spring-boot
* @ClassName: AdminController
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/4/10 21:35
*/
@Controller
public class AdminController {
@Autowired

View File

@ -15,7 +15,14 @@ import top.weiyuexin.utils.Time;
import java.util.List;
import java.util.stream.Collectors;
/**
* @PackageName: top.weiyuexin.controller
* @ProjectName: Online-code-evaluation-system
* @ClassName: ArticleController
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/2/7 21:24
*/
@RestController
@RequestMapping("/article")
public class ArticleController {

View File

@ -13,7 +13,14 @@ import top.weiyuexin.service.COSService;
import java.util.HashMap;
import java.util.Map;
/**
* @PackageName: top.weiyuexin.controller
* @ProjectName: Online-code-evaluation-system
* @ClassName: COSController
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/2/11 14:10
*/
@Controller
public class COSController {
@Autowired

View File

@ -12,7 +12,14 @@ import top.weiyuexin.service.*;
import java.util.List;
/**
* @PackageName: top.weiyuexin.controller
* @ProjectName: oj-spring-boot
* @ClassName: ContestController
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/4/19 15:04
*/
@RestController
@RequestMapping("/contest")
public class ContestController {

View File

@ -18,7 +18,14 @@ import top.weiyuexin.service.UserService;
import java.util.List;
import java.util.stream.Collectors;
/**
* @PackageName: top.weiyuexin.controller
* @ProjectName: oj-spring-boot
* @ClassName: EvaluationController
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/4/19 11:48
*/
@RestController
@RequestMapping("/evaluation")
public class EvaluationController {

View File

@ -14,7 +14,14 @@ import java.util.ArrayList;
import java.util.Calendar;
import java.util.Random;
/**
* @PackageName: top.weiyuexin.controller
* @ProjectName: Online-code-evaluation-system
* @ClassName: FileController
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/2/10 21:31
*/
@Controller
public class FileController {
/**

View File

@ -13,7 +13,14 @@ import top.weiyuexin.utils.Time;
import java.util.List;
/**
* @PackageName: top.weiyuexin.controller
* @ProjectName: Online-code-evaluation-system
* @ClassName: ProblemController
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/2/7 21:23
*/
@RestController
@RequestMapping("/problem")
public class ProblemController {

View File

@ -13,7 +13,14 @@ import top.weiyuexin.utils.Time;
import java.util.List;
/**
* @PackageName: top.weiyuexin.controller
* @ProjectName: Online-code-evaluation-system
* @ClassName: RunCodeController
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/2/16 21:05
*/
@RestController
@RequestMapping("/code")
public class RunCodeController {

View File

@ -20,6 +20,14 @@ import java.util.List;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
/**
* @PackageName: top.weiyuexin.controller
* @ProjectName: Online-code-evaluation-system
* @ClassName: UserController
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/2/7 21:21
*/
@RestController
@RequestMapping("/user")

View File

@ -1,96 +0,0 @@
package top.weiyuexin.generator.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
*
* @TableName user
*/
@TableName(value ="user")
@Data
public class User implements Serializable {
/**
* 用户编号
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
* 用户名
*/
private String username;
/**
* 密码
*/
private String password;
/**
* 性别
*/
private String sex;
/**
* 个人简介
*/
private String introduction;
/**
* 头像链接
*/
private String photo;
/**
* 邮箱
*/
private String email;
/**
* 提交次数
*/
private Long submitNum;
/**
* 解决的题数
*/
private Long solvedNum;
/**
* 注册时间
*/
private Date registerTime;
/**
* 最后登录时间
*/
private Date accessTime;
/**
* 登录的ip地址
*/
private String ip;
/**
* 学校
*/
private String school;
/**
* 默认使用的语言
*/
private String language;
/**
*
*/
private Integer isAdmin;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}

View File

@ -1,18 +0,0 @@
package top.weiyuexin.generator.mapper;
import top.weiyuexin.generator.domain.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author 李柯
* @description 针对表user的数据库操作Mapper
* @createDate 2024-09-24 14:09:38
* @Entity generator.domain.User
*/
public interface UserMapper extends BaseMapper<User> {
}

View File

@ -1,13 +0,0 @@
package top.weiyuexin.generator.service;
import top.weiyuexin.generator.domain.User;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author 李柯
* @description 针对表user的数据库操作Service
* @createDate 2024-09-24 14:09:38
*/
public interface UserService extends IService<User> {
}

View File

@ -1,22 +0,0 @@
package top.weiyuexin.generator.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import top.weiyuexin.generator.domain.User;
import top.weiyuexin.generator.service.UserService;
import top.weiyuexin.generator.mapper.UserMapper;
import org.springframework.stereotype.Service;
/**
* @author 李柯
* @description 针对表user的数据库操作Service实现
* @createDate 2024-09-24 14:09:38
*/
//@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User>
implements UserService {
}

View File

@ -11,7 +11,14 @@ import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @PackageName: top.weiyuexin.interceptor
* @ProjectName: oj-spring-boot
* @ClassName: LoginInterceptor
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/4/27 17:19
*/
public class LoginInterceptor implements HandlerInterceptor {

View File

@ -4,7 +4,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import top.weiyuexin.pojo.Article;
/**
* @PackageName: top.weiyuexin.mapper
* @ProjectName: Online-code-evaluation-system
* @ClassName: ArticleMapper
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/2/7 21:23
*/
@Mapper
public interface ArticleMapper extends BaseMapper<Article> {
}

View File

@ -5,7 +5,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import top.weiyuexin.pojo.Code;
/**
* @PackageName: top.weiyuexin.mapper
* @ProjectName: oj-spring-boot
* @ClassName: CodeMapper
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/4/8 1:18
*/
@Mapper
public interface CodeMapper extends BaseMapper<Code> {
}

View File

@ -4,7 +4,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import top.weiyuexin.pojo.Contest;
/**
* @PackageName: top.weiyuexin.mapper
* @ProjectName: oj-spring-boot
* @ClassName: ContestMapper
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/4/19 14:58
*/
@Mapper
public interface ContestMapper extends BaseMapper<Contest> {
}

View File

@ -4,7 +4,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import top.weiyuexin.pojo.Evaluation;
/**
* @PackageName: top.weiyuexin.mapper
* @ProjectName: oj-spring-boot
* @ClassName: EvaluationMapper
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/4/8 1:28
*/
@Mapper
public interface EvaluationMapper extends BaseMapper<Evaluation> {
}

View File

@ -4,7 +4,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import top.weiyuexin.pojo.Problem;
/**
* @PackageName: top.weiyuexin.mapper
* @ProjectName: Online-code-evaluation-system
* @ClassName: ProblemMapper
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/2/7 21:22
*/
@Mapper
public interface ProblemMapper extends BaseMapper<Problem> {
}

View File

@ -4,7 +4,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import top.weiyuexin.pojo.Solution;
/**
* @PackageName: top.weiyuexin.mapper
* @ProjectName: Online-code-evaluation-system
* @ClassName: SolutionMapper
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/2/9 22:54
*/
@Mapper
public interface SolutionMapper extends BaseMapper<Solution> {
}

View File

@ -4,7 +4,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import top.weiyuexin.pojo.TestCase;
/**
* @PackageName: top.weiyuexin.mapper
* @ProjectName: oj-spring-boot
* @ClassName: TestCaseMapper
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/4/8 1:02
*/
@Mapper
public interface TestCaseMapper extends BaseMapper<TestCase> {
}

View File

@ -2,14 +2,17 @@ package top.weiyuexin.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import top.weiyuexin.pojo.User;
/**
* @PackageName: top.weiyuexin.mapper
* @ProjectName: Online-code-evaluation-system
* @ClassName: UserMapper
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/2/7 19:07
*/
@Mapper
public interface UserMapper extends BaseMapper<User> {
public User findByUsernameAndPassword(@Param("username") String username,
@Param("password") String password);
}

View File

@ -3,7 +3,14 @@ package top.weiyuexin.pojo;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
/**
* @PackageName: top.weiyuexin.pojo
* @ProjectName: Online-code-evaluation-system
* @ClassName: Article
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/2/7 19:04
*/
@Data
public class Article {
private Integer id;

View File

@ -3,7 +3,14 @@ package top.weiyuexin.pojo;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
/**
* @PackageName: top.weiyuexin.pojo
* @ProjectName: oj-spring-boot
* @ClassName: Code
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/4/7 17:16
*/
@Data
public class Code {
private Integer id;

View File

@ -2,7 +2,14 @@ package top.weiyuexin.pojo;
import lombok.Data;
/**
* @PackageName: top.weiyuexin.pojo
* @ProjectName: oj-spring-boot
* @ClassName: Contest
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/4/19 12:09
*/
@Data
public class Contest {
private Integer id;

View File

@ -1,6 +1,13 @@
package top.weiyuexin.pojo;
/**
* @PackageName: top.weiyuexin.pojo
* @ProjectName: oj-spring-boot
* @ClassName: FilePath
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/4/8 19:29
*/
public enum FilePath {
C("/data/code/c/"), CPP("/data/code/cpp/"),
JAVA("/data/code/java/"), PYTHON("/data/code/python/"),

View File

@ -3,7 +3,14 @@ package top.weiyuexin.pojo;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
/**
* @PackageName: top.weiyuexin.pojo
* @ProjectName: Online-code-evaluation-system
* @ClassName: problem
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/2/7 19:03
*/
@Data
public class Problem {
private Integer id;

View File

@ -3,7 +3,14 @@ package top.weiyuexin.pojo;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
/**
* @PackageName: top.weiyuexin.pojo
* @ProjectName: Online-code-evaluation-system
* @ClassName: solution
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/2/9 9:55
*/
@Data
public class Solution {
private Integer id;

View File

@ -2,7 +2,14 @@ package top.weiyuexin.pojo;
import lombok.Data;
/**
* @PackageName: top.weiyuexin.pojo
* @ProjectName: oj-spring-boot
* @ClassName: TestCase
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/4/7 17:12
*/
@Data
public class TestCase {
private Integer id;

View File

@ -1,15 +1,18 @@
package top.weiyuexin.pojo;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
/**
* @PackageName: top.weiyuexin.pojo
* @ProjectName: Online-code-evaluation-system
* @ClassName: User
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/2/7 19:03
*/
@Data
@TableName(value ="user")
public class User implements Serializable {
public class User {
private Integer id;
private String username;
private String password;

View File

@ -2,7 +2,14 @@ package top.weiyuexin.pojo.vo;
import lombok.Data;
/**
* @PackageName: top.weiyuexin.pojo.vo
* @ProjectName: oj-spring-boot
* @ClassName: F
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/4/29 1:02
*/
@Data
public class F {
Integer errno;

View File

@ -5,7 +5,14 @@ import top.weiyuexin.utils.Time;
import java.text.SimpleDateFormat;
/**
* @PackageName: top.weiyuexin.pojo.vo
* @ProjectName: Online-code-evaluation-system
* @ClassName: R
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/2/8 18:54
*/
@Data
public class R {
//定义两个常量成功的code是200失败的是400

View File

@ -4,7 +4,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import top.weiyuexin.pojo.Article;
/**
* @PackageName: top.weiyuexin.service
* @ProjectName: Online-code-evaluation-system
* @ClassName: ArticleService
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/2/7 21:26
*/
public interface ArticleService extends IService<Article> {
IPage<Article> getPage(Integer currentPage, Integer pageSize, Article article);
}

View File

@ -5,7 +5,14 @@ import top.weiyuexin.pojo.vo.R;
import javax.servlet.http.HttpSession;
/**
* @PackageName: top.weiyuexin.service
* @ProjectName: Online-code-evaluation-system
* @ClassName: COSService
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/2/11 18:57
*/
public interface COSService {
public R upload(MultipartFile file);
}

View File

@ -5,7 +5,14 @@ import top.weiyuexin.pojo.Code;
import top.weiyuexin.pojo.TestCase;
import top.weiyuexin.pojo.vo.R;
/**
* @PackageName: top.weiyuexin.service
* @ProjectName: Online-code-evaluation-system
* @ClassName: CodeService
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/2/16 21:01
*/
public interface CodeService extends IService<Code> {
public R compileJava(Code code);

View File

@ -6,7 +6,14 @@ import top.weiyuexin.pojo.Contest;
import java.util.List;
/**
* @PackageName: top.weiyuexin.service
* @ProjectName: oj-spring-boot
* @ClassName: ContestService
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/4/19 14:59
*/
public interface ContestService extends IService<Contest> {
IPage<Contest> getPage(Integer currentPage, Integer pageSize, Contest contest);

View File

@ -2,7 +2,14 @@ package top.weiyuexin.service;
import top.weiyuexin.pojo.vo.R;
/**
* @PackageName: top.weiyuexin.service
* @ProjectName: Online-code-evaluation-system
* @ClassName: EmailService
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/2/8 18:53
*/
public interface EmailService {
/**
* 发送邮件

View File

@ -4,7 +4,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import top.weiyuexin.pojo.Evaluation;
/**
* @PackageName: top.weiyuexin.service
* @ProjectName: oj-spring-boot
* @ClassName: EvaluationService
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/4/8 1:28
*/
public interface EvaluationService extends IService<Evaluation> {
IPage<Evaluation> getPage(Integer currentPage, Integer pageSize, Evaluation evaluation);
}

View File

@ -7,7 +7,14 @@ import top.weiyuexin.pojo.Problem;
import java.util.List;
/**
* @PackageName: top.weiyuexin.service
* @ProjectName: Online-code-evaluation-system
* @ClassName: ProblemService
* @Author: Weiyuexin
* @Email: 3022422894@qq.com
* @Date: 2023/2/7 21:27
*/
public interface ProblemService extends IService<Problem> {
IPage<Problem> getPage(Integer currentPage, Integer pageSize, Problem problem);

Some files were not shown because too many files have changed in this diff Show More