diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..feeaef20 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Himit_ZH + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index d4973fac..d7b150b8 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,15 @@ 基于前后端分离,分布式架构的在线测评平台(hoj) -在线Demo:[http://oj.hcode.top](http://oj.hcode.top) +在线Demo:[http://www.hcode.top](http://www.hcode.top) > 上线日记 -| 时间 | 内容 | 更新者 | -| ---------- | ------------ | -------- | -| 2020-10-26 | 正式开发 | Himit_ZH | -| 2021-04-10 | 首次上线测试 | Himit_ZH | +| 时间 | 内容 | 更新者 | +| ---------- | ----------------------- | -------- | +| 2020-10-26 | 正式开发 | Himit_ZH | +| 2021-04-10 | 首次上线测试 | Himit_ZH | +| 2021-04-15 | 判题调度2.0解决并发问题 | Himit_ZH | > 简略介绍 diff --git a/hoj-springboot/DataBackup/pom.xml b/hoj-springboot/DataBackup/pom.xml index e25cb8d8..f79a77db 100644 --- a/hoj-springboot/DataBackup/pom.xml +++ b/hoj-springboot/DataBackup/pom.xml @@ -69,10 +69,6 @@ com.alibaba.cloud spring-cloud-alibaba-nacos-discovery - - org.springframework.cloud - spring-cloud-starter-openfeign - org.projectlombok lombok diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/common/exception/CloudHandler.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/common/exception/CloudHandler.java deleted file mode 100644 index b3f07783..00000000 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/common/exception/CloudHandler.java +++ /dev/null @@ -1,100 +0,0 @@ -package top.hcode.hoj.common.exception; - -import cn.hutool.json.JSONObject; -import cn.hutool.json.JSONUtil; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; -import top.hcode.hoj.common.result.CommonResult; -import top.hcode.hoj.judge.remote.RemoteJudgeDispatcher; -import top.hcode.hoj.judge.self.JudgeDispatcher; -import top.hcode.hoj.pojo.entity.CompileSpj; -import top.hcode.hoj.pojo.entity.Judge; -import top.hcode.hoj.pojo.entity.ToJudge; -import top.hcode.hoj.service.ToJudgeService; -import top.hcode.hoj.service.impl.JudgeServiceImpl; -import top.hcode.hoj.utils.Constants; -import top.hcode.hoj.utils.RedisUtils; - - -import java.util.concurrent.TimeUnit; - - -/** - * @Author: Himit_ZH - * @Date: 2020/10/30 10:21 - * @Description: 调用判题服务器的方法的容错机制,调用失败会走到以下方法进行执行 - */ -@Component -public class CloudHandler implements ToJudgeService { - - @Autowired - private JudgeDispatcher judgeDispatcher; - - @Autowired - private RemoteJudgeDispatcher remoteJudgeDispatcher; - - @Autowired - private RedisUtils redisUtils; - - @Autowired - private JudgeServiceImpl judgeService; - - - // 调度判题服务器失败,可能是判题服务器有故障,或者全部达到判题最大数,那么将该提交重新进入等待队列 - @Override - public CommonResult submitProblemJudge(ToJudge toJudge) { - if (toJudge.getTryAgainNum() == 30) { - Judge judge = toJudge.getJudge(); - judge.setStatus(Constants.Judge.STATUS_SUBMITTED_FAILED.getStatus()); - judge.setErrorMessage("Failed to connect the judgeServer. Please resubmit this submission again!"); - judgeService.updateById(judge); - } else { - // 线程沉睡1秒,再将任务重新发布,避免过快问题,同时判题服务过多,导致的失败 - try { - TimeUnit.SECONDS.sleep(1); - } catch (InterruptedException e) { - e.printStackTrace(); - } - Judge judge = toJudge.getJudge(); - judgeDispatcher.sendTask(judge.getSubmitId(), judge.getPid(), toJudge.getToken(), - judge.getCid() != 0, toJudge.getTryAgainNum() + 1); - } - return CommonResult.errorResponse("判题服务器繁忙或出错,提交进入重判队列,请等待管理员处理!", CommonResult.STATUS_ERROR); - } - - @Override - public CommonResult compileSpj(CompileSpj compileSpj) { - return CommonResult.errorResponse("没有可用的判题服务,请重新尝试!"); - } - - @Override - public CommonResult remoteJudge(ToJudge toJudge) { - // 将使用的账号放回对应列表 - JSONObject account = new JSONObject(); - account.set("username", toJudge.getUsername()); - account.set("password", toJudge.getPassword()); - redisUtils.llPush(Constants.Judge.getListNameByOJName(toJudge.getRemoteJudge().split("-")[0]), JSONUtil.toJsonStr(account)); - - if (toJudge.getTryAgainNum() == 30) { - Judge judge = toJudge.getJudge(); - judge.setStatus(Constants.Judge.STATUS_SUBMITTED_FAILED.getStatus()); - judge.setErrorMessage("Failed to connect the judgeServer. Please resubmit this submission again!"); - judgeService.updateById(judge); - } else { - - // 线程沉睡一秒,再将任务重新发布,避免过快问题,同时判题服务过多,导致的失败 - try { - TimeUnit.SECONDS.sleep(1); - } catch (InterruptedException e) { - e.printStackTrace(); - } - - Judge judge = toJudge.getJudge(); - remoteJudgeDispatcher.sendTask(judge.getSubmitId(), judge.getPid(), toJudge.getToken(), - toJudge.getRemoteJudge(), judge.getCid() != 0, toJudge.getTryAgainNum() + 1); - } - - return CommonResult.errorResponse("判题服务器繁忙或出错,提交进入重判队列,请等待管理员处理!", CommonResult.STATUS_ERROR); - } - -} \ No newline at end of file diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/config/RestTemplateConfig.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/config/RestTemplateConfig.java index 3b4738a9..dddd152f 100644 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/config/RestTemplateConfig.java +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/config/RestTemplateConfig.java @@ -23,7 +23,7 @@ public class RestTemplateConfig { @Bean public ClientHttpRequestFactory simpleClientHttpRequestFactory() { SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory(); - factory.setReadTimeout(10000);//单位为ms + factory.setReadTimeout(30000);//单位为ms factory.setConnectTimeout(10000);//单位为ms return factory; } diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/config/RibbonConfig.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/config/RibbonConfig.java deleted file mode 100644 index 8594ba3e..00000000 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/config/RibbonConfig.java +++ /dev/null @@ -1,22 +0,0 @@ -package top.hcode.hoj.config; - -import com.netflix.loadbalancer.IRule; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import top.hcode.hoj.judge.self.JudgeChooseRule; - -/** - * @Author: Himit_ZH - * @Date: 2021/2/4 23:10 - * @Description: - */ -@Configuration -public class RibbonConfig { - - @Bean - public IRule ribbonRule() { - // 随机的负载均衡策略对象 - return new JudgeChooseRule(); - } - -} \ No newline at end of file diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/config/StartupRunner.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/config/StartupRunner.java index 07717ad1..989b225c 100644 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/config/StartupRunner.java +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/config/StartupRunner.java @@ -11,6 +11,7 @@ import top.hcode.hoj.pojo.vo.ConfigVo; import top.hcode.hoj.utils.Constants; import top.hcode.hoj.utils.RedisUtils; +import javax.annotation.PreDestroy; import java.util.HashMap; import java.util.LinkedList; import java.util.List; @@ -58,4 +59,5 @@ public class StartupRunner implements CommandLineRunner { log.error("CF判题账号注入Redis的List异常------------>{}", "请检查配置文件,然后重新启动!"); } } + } \ No newline at end of file diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/controller/admin/AdminJudgeController.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/controller/admin/AdminJudgeController.java index c8de65c4..4ce9066c 100644 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/controller/admin/AdminJudgeController.java +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/controller/admin/AdminJudgeController.java @@ -95,6 +95,7 @@ public class AdminJudgeController { // 设置默认值 judge.setStatus(Constants.Judge.STATUS_PENDING.getStatus()); // 开始进入判题队列 + judge.setVersion(judge.getVersion() + 1); judge.setJudger(null).setTime(null).setMemory(null).setErrorMessage(null); boolean result = judgeService.updateById(judge); if (result) { @@ -130,6 +131,7 @@ public class AdminJudgeController { // 全部设置默认值 for (Judge judge : rejudgeList) { judge.setStatus(Constants.Judge.STATUS_PENDING.getStatus()); // 开始进入判题队列 + judge.setVersion(judge.getVersion() + 1); judge.setJudger(null).setTime(null).setMemory(null).setErrorMessage(null); submitIdList.add(judge.getSubmitId()); } diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/controller/admin/AdminProblemController.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/controller/admin/AdminProblemController.java index 9b01f4be..1b6ca823 100644 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/controller/admin/AdminProblemController.java +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/controller/admin/AdminProblemController.java @@ -14,10 +14,10 @@ import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; import top.hcode.hoj.common.result.CommonResult; import top.hcode.hoj.crawler.problem.ProblemStrategy; +import top.hcode.hoj.judge.JudgeServerUtils; import top.hcode.hoj.pojo.dto.ProblemDto; import top.hcode.hoj.pojo.entity.*; import top.hcode.hoj.pojo.vo.UserRolesVo; -import top.hcode.hoj.service.ToJudgeService; import top.hcode.hoj.service.impl.*; @@ -43,7 +43,7 @@ public class AdminProblemController { private ProblemCaseServiceImpl problemCaseService; @Autowired - private ToJudgeService toJudgeService; + private JudgeServerUtils judgeServerUtils; @Value("${hoj.judge.token}") private String judgeToken; @@ -179,7 +179,7 @@ public class AdminProblemController { } compileSpj.setToken(judgeToken); - return toJudgeService.compileSpj(compileSpj); + return judgeServerUtils.dispatcher("compile", "/compile-spj", compileSpj); } @GetMapping("/import-remote-oj-problem") diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/controller/oj/JudgeController.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/controller/oj/JudgeController.java index d93b78cd..7a970c1e 100644 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/controller/oj/JudgeController.java +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/controller/oj/JudgeController.java @@ -276,6 +276,7 @@ public class JudgeController { Problem problem = problemService.getById(judge.getPid()); // 重新进入等待队列 judge.setStatus(Constants.Judge.STATUS_PENDING.getStatus()); + judge.setVersion(judge.getVersion() + 1); judge.setErrorMessage(null); judgeService.updateById(judge); // 将提交加入任务队列 @@ -332,7 +333,7 @@ public class JudgeController { if (judge.getStatus().intValue() != Constants.Judge.STATUS_COMPILE_ERROR.getStatus() && judge.getStatus().intValue() != Constants.Judge.STATUS_SYSTEM_ERROR.getStatus() && judge.getStatus().intValue() != Constants.Judge.STATUS_SUBMITTED_FAILED.getStatus()) { - judge.setErrorMessage(""); + judge.setErrorMessage("The error message does not support viewing."); } result.put("submission", judge); result.put("codeShare", problem.getCodeShare()); @@ -451,6 +452,10 @@ public class JudgeController { Judge judge = judgeService.getById(submitId); + if (judge == null) { + return CommonResult.errorResponse("此提交数据不存在!"); + } + Problem problem = problemService.getById(judge.getPid()); // 如果该题不支持开放测试点结果查看 diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/JudgeServerMapper.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/JudgeServerMapper.java new file mode 100644 index 00000000..f82106fa --- /dev/null +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/JudgeServerMapper.java @@ -0,0 +1,11 @@ +package top.hcode.hoj.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Repository; +import top.hcode.hoj.pojo.entity.JudgeServer; + +@Mapper +@Repository +public interface JudgeServerMapper extends BaseMapper { +} diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/JudgeServerUtils.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/JudgeServerUtils.java new file mode 100644 index 00000000..e3ab1f24 --- /dev/null +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/JudgeServerUtils.java @@ -0,0 +1,233 @@ +package top.hcode.hoj.judge; + +import com.alibaba.cloud.nacos.NacosDiscoveryProperties; +import com.alibaba.cloud.nacos.ribbon.NacosServer; +import com.alibaba.nacos.api.exception.NacosException; +import com.alibaba.nacos.api.naming.NamingService; +import com.alibaba.nacos.api.naming.pojo.Instance; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Isolation; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.client.RestTemplate; +import top.hcode.hoj.common.result.CommonResult; +import top.hcode.hoj.pojo.entity.CompileSpj; +import top.hcode.hoj.pojo.entity.Judge; +import top.hcode.hoj.pojo.entity.JudgeServer; +import top.hcode.hoj.pojo.entity.ToJudge; +import top.hcode.hoj.service.impl.JudgeServerServiceImpl; +import top.hcode.hoj.service.impl.JudgeServiceImpl; +import top.hcode.hoj.utils.Constants; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * @Author: Himit_ZH + * @Date: 2021/4/15 17:29 + * @Description: + */ +@Component +@Slf4j +public class JudgeServerUtils { + + @Autowired + private NacosDiscoveryProperties discoveryProperties; + + @Value("${service-url.name}") + private String JudgeServiceName; + + @Autowired + private RestTemplate restTemplate; + + @Autowired + private JudgeServerServiceImpl judgeServerService; + + @Autowired + private JudgeServiceImpl judgeService; + + + public CommonResult dispatcher(String type, String path, Object data) { + switch (type) { + case "judge": + ToJudge judgeData = (ToJudge) data; + toJudge(path, (ToJudge) data, judgeData.getJudge().getSubmitId(), judgeData.getRemoteJudge() != null); + break; + case "compile": + CompileSpj compileSpj = (CompileSpj) data; + return toCompile(path, compileSpj); + default: + throw new NullPointerException("判题机不支持此调用类型"); + } + return null; + } + + @Transactional(isolation = Isolation.READ_COMMITTED) + public void toJudge(String path, ToJudge data, Long submitId, Boolean isRemote) { + // 尝试30s + ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); + AtomicInteger count = new AtomicInteger(0); + Runnable getResultTask = new Runnable() { + @Override + public void run() { + count.getAndIncrement(); + JudgeServer judgeServer = chooseServer(isRemote); + if (count.get() == 30) { // 30次失败则判为提交失败 + checkResult(null, submitId); + scheduler.shutdown(); + } + if (judgeServer != null) { // 获取到判题机资源 + CommonResult result = null; + try { + result = restTemplate.postForObject("http://" + judgeServer.getUrl() + path, data, CommonResult.class); + } catch (Exception e) { + log.error("调用判题服务器[" + judgeServer.getUrl() + "]发送异常-------------->{}", e.getMessage()); + } finally { + checkResult(result, submitId); + // 无论成功与否,都要将对应的当前判题机当前判题数减1 + reduceCurrentTaskNum(judgeServer.getId()); + scheduler.shutdown(); + } + } + } + }; + scheduler.scheduleAtFixedRate(getResultTask, 0, 1, TimeUnit.SECONDS); + } + + @Transactional(isolation = Isolation.READ_COMMITTED) + public CommonResult toCompile(String path, CompileSpj data) { + CommonResult result = CommonResult.errorResponse("没有可用的判题服务器,请重新尝试!"); + JudgeServer judgeServer = chooseServer(false); + if (judgeServer != null) { + try { + result = restTemplate.postForObject("http://" + judgeServer.getUrl() + path, data, CommonResult.class); + } catch (Exception e) { + log.error("调用判题服务器[" + judgeServer.getUrl() + "]发送异常-------------->{}", e.getMessage()); + } finally { + // 无论成功与否,都要将对应的当前判题机当前判题数减1 + reduceCurrentTaskNum(judgeServer.getId()); + } + } + return result; + } + + /** + * @param + * @MethodName chooseServer + * @Description 选择可以用调用判题的判题服务器 + * @Return + * @Since 2021/4/15 + */ + public JudgeServer chooseServer(Boolean isRemote) { + // 获取该微服务的所有健康实例 + List instances = getInstances(JudgeServiceName); + if (instances.size() <= 0) { + return null; + } + List keyList = new ArrayList<>(); + // 获取当前健康实例取出ip和port拼接 + for (Instance instance : instances) { + keyList.add(instance.getIp() + ":" + instance.getPort()); + } + // 过滤出小于或等于规定最大并发判题任务数的服务实例且健康的判题机 + QueryWrapper judgeServerQueryWrapper = new QueryWrapper<>(); + judgeServerQueryWrapper + .in("url", keyList) + .eq("is_remote", isRemote) + .orderByAsc("task_number"); + List judgeServerList = judgeServerService.list(judgeServerQueryWrapper); + // 使用乐观锁获取可用判题机 + for (JudgeServer judgeServer : judgeServerList) { + if (judgeServer.getTaskNumber() < judgeServer.getMaxTaskNumber()) { + judgeServer.setTaskNumber(judgeServer.getTaskNumber() + 1); + boolean isOk = judgeServerService.updateById(judgeServer); + if (isOk) { + return judgeServer; + } + } + } + return null; + } + + + /** + * @param serviceId + * @MethodName getInstances + * @Description 根据服务id获取对应的健康实例列表 + * @Return + * @Since 2021/4/15 + */ + private List getInstances(String serviceId) { + // 获取服务发现的相关API + NamingService namingService = discoveryProperties.namingServiceInstance(); + try { + // 获取该微服务的所有健康实例 + return namingService.selectInstances(serviceId, true); + } catch (NacosException e) { + log.error("获取微服务健康实例发生异常--------->{}", e); + return Collections.emptyList(); + } + } + + private void checkResult(CommonResult result, Long submitId) { + + Judge judge = new Judge(); + if (result == null) { // 调用失败 + judge.setSubmitId(submitId); + judge.setStatus(Constants.Judge.STATUS_SUBMITTED_FAILED.getStatus()); + judge.setErrorMessage("Failed to connect the judgeServer. Please resubmit this submission again!"); + judgeService.updateById(judge); + } else { + if (result.getStatus().intValue() != CommonResult.STATUS_SUCCESS) { // 如果是结果码不是200 说明调用有错误 + // 判为系统错误 + judge.setStatus(Constants.Judge.STATUS_SYSTEM_ERROR.getStatus()) + .setErrorMessage(result.getMsg()); + judgeService.updateById(judge); + } + } + } + + @Transactional(isolation = Isolation.READ_COMMITTED) + public void reduceCurrentTaskNum(Integer id) { + UpdateWrapper judgeServerUpdateWrapper = new UpdateWrapper<>(); + judgeServerUpdateWrapper.setSql("task_number = task_number-1").eq("id", id); + boolean isOk = judgeServerService.update(judgeServerUpdateWrapper); + if (!isOk) { // 重试八次 + tryAgainUpdate(judgeServerUpdateWrapper); + } + } + + @Transactional(isolation = Isolation.READ_COMMITTED) + public void tryAgainUpdate(UpdateWrapper updateWrapper) { + boolean retryable; + int attemptNumber = 0; + do { + boolean success = judgeServerService.update(updateWrapper); + if (success) { + return; + } else { + attemptNumber++; + retryable = attemptNumber < 8; + if (attemptNumber == 8) { + break; + } + try { + Thread.sleep(300); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } while (retryable); + } +} \ No newline at end of file diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/remote/RemoteJudgeReceiver.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/remote/RemoteJudgeReceiver.java index 91a0c3c0..9e606ccf 100644 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/remote/RemoteJudgeReceiver.java +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/remote/RemoteJudgeReceiver.java @@ -6,9 +6,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; import org.springframework.util.StringUtils; +import top.hcode.hoj.judge.JudgeServerUtils; import top.hcode.hoj.pojo.entity.Judge; import top.hcode.hoj.pojo.entity.ToJudge; -import top.hcode.hoj.service.ToJudgeService; import top.hcode.hoj.service.impl.JudgeServiceImpl; import top.hcode.hoj.utils.Constants; import top.hcode.hoj.utils.RedisUtils; @@ -19,8 +19,6 @@ import java.util.concurrent.TimeUnit; @Async public class RemoteJudgeReceiver { - @Autowired - private ToJudgeService toJudgeService; @Autowired private RemoteJudgeDispatcher remoteJudgeDispatcher; @@ -28,6 +26,9 @@ public class RemoteJudgeReceiver { @Autowired private JudgeServiceImpl judgeService; + @Autowired + private JudgeServerUtils judgeServerUtils; + @Autowired private RedisUtils redisUtils; @@ -54,7 +55,6 @@ public class RemoteJudgeReceiver { String remoteJudge = task.getStr("remoteJudge"); Boolean isContest = task.getBool("isContest"); Integer tryAgainNum = task.getInt("tryAgainNum"); - // 如果对应远程判题oj的账号列表还有账号 String remoteJudgeAccountListName = Constants.Judge.getListNameByOJName(remoteJudge.split("-")[0]); @@ -75,7 +75,7 @@ public class RemoteJudgeReceiver { password = accountJson.getStr("password"); Judge judge = judgeService.getById(submitId); // 调用判题服务 - toJudgeService.remoteJudge(new ToJudge() + judgeServerUtils.dispatcher("judge", "/remote-judge", new ToJudge() .setJudge(judge) .setToken(token) .setRemoteJudge(remoteJudge) @@ -85,10 +85,10 @@ public class RemoteJudgeReceiver { // 如果队列中还有任务,则继续处理 processWaitingTask(); + } } else { - - if (tryAgainNum >= 40) { + if (tryAgainNum >= 30) { // 获取调用多次失败可能为系统忙碌,判为提交失败 Judge judge = new Judge(); judge.setSubmitId(submitId); diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/self/JudgeChooseRule.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/self/JudgeChooseRule.java index 95f18556..d4b5cbf3 100644 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/self/JudgeChooseRule.java +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/self/JudgeChooseRule.java @@ -6,6 +6,7 @@ import com.alibaba.cloud.nacos.ribbon.NacosServer; import com.alibaba.nacos.api.exception.NacosException; import com.alibaba.nacos.api.naming.NamingService; import com.alibaba.nacos.api.naming.pojo.Instance; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.netflix.client.config.IClientConfig; import com.netflix.loadbalancer.AbstractLoadBalancerRule; import com.netflix.loadbalancer.DynamicServerListLoadBalancer; @@ -13,9 +14,15 @@ import com.netflix.loadbalancer.Server; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; +import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; +import top.hcode.hoj.pojo.entity.JudgeServer; +import top.hcode.hoj.service.impl.JudgeServerServiceImpl; +import top.hcode.hoj.utils.RedisUtils; +import java.util.ArrayList; import java.util.Collections; +import java.util.LinkedList; import java.util.List; import java.util.stream.Collectors; @@ -25,12 +32,22 @@ import java.util.stream.Collectors; * @Description: 任务调度的自定义负载均衡策略 */ @Slf4j + public class JudgeChooseRule extends AbstractLoadBalancerRule { @Autowired private NacosDiscoveryProperties discoveryProperties; + private JudgeServerServiceImpl judgeServerService ; + + + @Autowired + public void setJudgeServerService (JudgeServerServiceImpl judgeServerService){ + this.judgeServerService = judgeServerService; + } + + @Override public void initWithNiwsConfig(IClientConfig iClientConfig) { @@ -45,24 +62,39 @@ public class JudgeChooseRule extends AbstractLoadBalancerRule { String serviceId = loadBalancer.getName(); // 获取该微服务的所有健康实例 List instances = getInstances(serviceId); - // 进行匹配筛选的实例列表 - List metadataMatchInstances; - // 过滤出小于或等于规定最大并发判题任务数的服务实例 - metadataMatchInstances = instances.stream() - .filter(instance -> - Integer.parseInt(instance.getMetadata().getOrDefault("currentTaskNum", "0"))<= - Integer.parseInt(instance.getMetadata().getOrDefault("maxTaskNum","4")) - ).collect(Collectors.toList()); - // 如果为空闲判题服务器的数量为空,则该判题请求重新进入等待队列 - if (CollectionUtils.isEmpty(metadataMatchInstances)) { + if (instances.size() <= 0) { return null; } - // 基于随机权重的负载均衡算法,选取其中一个实例 - Instance instance = ExtendBalancer.getHostByRandomWeight2(metadataMatchInstances); - return new NacosServer(instance); - } + List keyList = new ArrayList<>(); + // 获取当前健康实例取出ip和port拼接 + for (Instance instance : instances) { + keyList.add(instance.getIp() + ":" + instance.getPort()); + } + // 过滤出小于或等于规定最大并发判题任务数的服务实例且健康的判题机 + QueryWrapper judgeServerQueryWrapper = new QueryWrapper<>(); + judgeServerQueryWrapper + .in("url", keyList) + .orderByAsc("task_num"); + List judgeServerList = judgeServerService.list(judgeServerQueryWrapper); + System.out.println(judgeServerList); + // 使用乐观锁获取可用判题机 + for (JudgeServer judgeServer : judgeServerList) { + if (judgeServer.getTaskNumber() <= judgeServer.getMaxTaskNumber()) { + judgeServer.setTaskNumber(judgeServer.getTaskNumber() + 1); + boolean isOk = judgeServerService.updateById(judgeServer); + if (isOk) { + int instanceIndex = keyList.indexOf(judgeServer.getIp() + ":" + judgeServer.getPort()); + if (instanceIndex != -1) { + return new NacosServer(instances.get(instanceIndex)); + } + } + } + } + + return null; + } private List getInstances(String serviceId) { diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/self/JudgeReceiver.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/self/JudgeReceiver.java index db15e64d..2aac9546 100644 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/self/JudgeReceiver.java +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/self/JudgeReceiver.java @@ -2,13 +2,13 @@ package top.hcode.hoj.judge.self; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; -import top.hcode.hoj.common.result.CommonResult; +import top.hcode.hoj.judge.JudgeServerUtils; import top.hcode.hoj.pojo.entity.Judge; import top.hcode.hoj.pojo.entity.ToJudge; -import top.hcode.hoj.service.ToJudgeService; import top.hcode.hoj.service.impl.JudgeServiceImpl; import top.hcode.hoj.utils.Constants; import top.hcode.hoj.utils.RedisUtils; @@ -22,10 +22,11 @@ import top.hcode.hoj.utils.RedisUtils; */ @Component @Async +@Slf4j public class JudgeReceiver { @Autowired - private ToJudgeService toJudgeService; + private JudgeServerUtils judgeServerUtils; @Autowired private RedisUtils redisUtils; @@ -33,8 +34,6 @@ public class JudgeReceiver { @Autowired private JudgeServiceImpl judgeService; - @Autowired - private JudgeDispatcher judgeDispatcher; public void processWaitingTask() { // 如果队列中还有任务,则继续处理 @@ -54,16 +53,15 @@ public class JudgeReceiver { String token = task.getStr("token"); Integer tryAgainNum = task.getInt("tryAgainNum"); Judge judge = judgeService.getById(submitId); + // 调用判题服务 - toJudgeService.submitProblemJudge(new ToJudge() + judgeServerUtils.dispatcher("judge", "/judge", new ToJudge() .setJudge(judge) .setToken(token) .setRemoteJudge(null) .setTryAgainNum(tryAgainNum)); - // 接着处理任务 processWaitingTask(); - } } \ No newline at end of file diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/service/JudgeServerService.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/service/JudgeServerService.java new file mode 100644 index 00000000..221d523b --- /dev/null +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/service/JudgeServerService.java @@ -0,0 +1,9 @@ +package top.hcode.hoj.service; + +import com.baomidou.mybatisplus.extension.service.IService; + +import top.hcode.hoj.pojo.entity.JudgeServer; + +public interface JudgeServerService extends IService { + +} diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/service/ToJudgeService.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/service/ToJudgeService.java deleted file mode 100644 index b66bf77c..00000000 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/service/ToJudgeService.java +++ /dev/null @@ -1,28 +0,0 @@ -package top.hcode.hoj.service; - - -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.stereotype.Component; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import top.hcode.hoj.common.exception.CloudHandler; -import top.hcode.hoj.common.result.CommonResult; -import top.hcode.hoj.config.RibbonConfig; -import top.hcode.hoj.pojo.entity.CompileSpj; -import top.hcode.hoj.pojo.entity.ToJudge; - - -//需要的判题微服务名 -@FeignClient(value = "hoj-judge-server", fallback = CloudHandler.class, configuration = RibbonConfig.class) -@Component -public interface ToJudgeService { - - @PostMapping(value = "/judge") - public CommonResult submitProblemJudge(ToJudge toJudge); - - @PostMapping(value = "/compile-spj") - public CommonResult compileSpj(CompileSpj compileSpj); - - @PostMapping(value = "/remote-judge") - public CommonResult remoteJudge(ToJudge toJudge); -} diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/service/impl/JudgeServerServiceImpl.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/service/impl/JudgeServerServiceImpl.java new file mode 100644 index 00000000..33c9c4ec --- /dev/null +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/service/impl/JudgeServerServiceImpl.java @@ -0,0 +1,20 @@ +package top.hcode.hoj.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +import top.hcode.hoj.dao.JudgeServerMapper; + +import top.hcode.hoj.pojo.entity.JudgeServer; +import top.hcode.hoj.service.JudgeServerService; + +/** + * @Author: Himit_ZH + * @Date: 2021/4/15 11:27 + * @Description: + */ +@Service +public class JudgeServerServiceImpl extends ServiceImpl implements JudgeServerService { + + +} \ No newline at end of file diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/service/impl/ProblemServiceImpl.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/service/impl/ProblemServiceImpl.java index 5a7f60c6..2501f463 100644 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/service/impl/ProblemServiceImpl.java +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/service/impl/ProblemServiceImpl.java @@ -7,13 +7,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.StringUtils; -import top.hcode.hoj.common.result.CommonResult; import top.hcode.hoj.crawler.problem.CFProblemStrategy; import top.hcode.hoj.crawler.problem.HDUProblemStrategy; import top.hcode.hoj.crawler.problem.ProblemContext; import top.hcode.hoj.crawler.problem.ProblemStrategy; -import top.hcode.hoj.dao.ProblemCaseMapper; import top.hcode.hoj.pojo.dto.ProblemDto; import top.hcode.hoj.pojo.entity.*; import top.hcode.hoj.pojo.vo.ProblemVo; @@ -21,7 +18,6 @@ import top.hcode.hoj.dao.ProblemMapper; import top.hcode.hoj.service.ProblemService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; -import top.hcode.hoj.service.ToJudgeService; import top.hcode.hoj.utils.Constants; import java.io.File; diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/utils/Constants.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/utils/Constants.java index 0b632240..fefd0976 100644 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/utils/Constants.java +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/utils/Constants.java @@ -22,7 +22,6 @@ public class Constants { public static String ojEmailFrom; - @Value("${hoj-backstage.addr}") public void setOjAddr(String ojAddr) { Constants.ojAddr = ojAddr; @@ -72,8 +71,8 @@ public class Constants { STATUS_JUDGE_WAITING(-100, "Waiting Queue", null), STATUS_REMOTE_JUDGE_WAITING_HANDLE(-200, "Remote Waiting Handle Queue", null), STATUS_HDU_REMOTE_JUDGE_ACCOUNT(-1000, "Hdu Remote Judge Account", null), - STATUS_CF_REMOTE_JUDGE_ACCOUNT(-1001, "Codeforces Remote Judge Account", null); - + STATUS_CF_REMOTE_JUDGE_ACCOUNT(-1001, "Codeforces Remote Judge Account", null), + JUDGE_SERVER_SUBMIT_PREFIX(-1002,"Judge SubmitId-ServerId:",null); private Judge(Integer status, String name, String columnName) { this.status = status; this.name = name; diff --git a/hoj-springboot/DataBackup/src/main/resources/bootstrap.yml b/hoj-springboot/DataBackup/src/main/resources/bootstrap.yml index 22c157d2..adae831e 100644 --- a/hoj-springboot/DataBackup/src/main/resources/bootstrap.yml +++ b/hoj-springboot/DataBackup/src/main/resources/bootstrap.yml @@ -1,6 +1,6 @@ hoj-backstage: port: 6688 - nacos-url: 172.18.0.2:8848 + nacos-url: http://172.18.0.2:8848 addr: http://oj.hcode.top name: Hcode Online Judge short-name: HOJ diff --git a/hoj-springboot/DataBackup/target/classes/bootstrap.yml b/hoj-springboot/DataBackup/target/classes/bootstrap.yml index 22c157d2..adae831e 100644 --- a/hoj-springboot/DataBackup/target/classes/bootstrap.yml +++ b/hoj-springboot/DataBackup/target/classes/bootstrap.yml @@ -1,6 +1,6 @@ hoj-backstage: port: 6688 - nacos-url: 172.18.0.2:8848 + nacos-url: http://172.18.0.2:8848 addr: http://oj.hcode.top name: Hcode Online Judge short-name: HOJ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/DataBackupApplication.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/DataBackupApplication.class deleted file mode 100644 index 46b94c14..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/DataBackupApplication.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/common/exception/CloudHandler.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/common/exception/CloudHandler.class deleted file mode 100644 index 8040f79b..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/common/exception/CloudHandler.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/common/exception/GlobalExceptionHandler.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/common/exception/GlobalExceptionHandler.class deleted file mode 100644 index 6f00aece..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/common/exception/GlobalExceptionHandler.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/common/result/CommonResult.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/common/result/CommonResult.class deleted file mode 100644 index b805b015..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/common/result/CommonResult.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/AsyncTaskConfig.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/AsyncTaskConfig.class deleted file mode 100644 index 1579cf4b..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/AsyncTaskConfig.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/CorsConfig.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/CorsConfig.class deleted file mode 100644 index d95f984e..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/CorsConfig.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/MyMetaObjectConfig.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/MyMetaObjectConfig.class deleted file mode 100644 index 3292bf81..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/MyMetaObjectConfig.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/MybatisPlusConfig.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/MybatisPlusConfig.class deleted file mode 100644 index cf5b97b3..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/MybatisPlusConfig.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/RedisConfig.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/RedisConfig.class deleted file mode 100644 index d5b818b1..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/RedisConfig.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/RestTemplateConfig.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/RestTemplateConfig.class deleted file mode 100644 index 65e7b1b0..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/RestTemplateConfig.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/RibbonConfig.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/RibbonConfig.class deleted file mode 100644 index 908908b9..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/RibbonConfig.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/ShiroConfig.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/ShiroConfig.class deleted file mode 100644 index c8e3d84e..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/ShiroConfig.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/StartupRunner.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/StartupRunner.class deleted file mode 100644 index 2c0cfb2b..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/StartupRunner.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/SwaggerConfig.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/SwaggerConfig.class deleted file mode 100644 index 87de4679..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/config/SwaggerConfig.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/AdminAccountController.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/AdminAccountController.class deleted file mode 100644 index 0afef979..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/AdminAccountController.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/AdminContestController.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/AdminContestController.class deleted file mode 100644 index edd751da..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/AdminContestController.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/AdminJudgeController.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/AdminJudgeController.class deleted file mode 100644 index b05156e3..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/AdminJudgeController.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/AdminProblemController.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/AdminProblemController.class deleted file mode 100644 index d44c571f..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/AdminProblemController.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/AdminUserController.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/AdminUserController.class deleted file mode 100644 index 921c5497..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/AdminUserController.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/AnnouncementController.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/AnnouncementController.class deleted file mode 100644 index 446925e4..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/AnnouncementController.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/ConfigController.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/ConfigController.class deleted file mode 100644 index 6b6b8940..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/ConfigController.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/DashboardController.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/DashboardController.class deleted file mode 100644 index e1886358..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/DashboardController.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/FileController$1.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/FileController$1.class deleted file mode 100644 index cacc65a5..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/FileController$1.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/FileController.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/FileController.class deleted file mode 100644 index 3ec6ac81..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/admin/FileController.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/oj/AccountController.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/oj/AccountController.class deleted file mode 100644 index 8ad4c701..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/oj/AccountController.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/oj/CommentController.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/oj/CommentController.class deleted file mode 100644 index 62fc5b09..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/oj/CommentController.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/oj/CommonController.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/oj/CommonController.class deleted file mode 100644 index 20983d23..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/oj/CommonController.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/oj/ContestController.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/oj/ContestController.class deleted file mode 100644 index cf1605f4..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/oj/ContestController.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/oj/HomeController.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/oj/HomeController.class deleted file mode 100644 index 331b5b49..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/oj/HomeController.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/oj/JudgeController.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/oj/JudgeController.class deleted file mode 100644 index 5e0b8d10..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/oj/JudgeController.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/oj/ProblemController.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/oj/ProblemController.class deleted file mode 100644 index dbb176cc..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/oj/ProblemController.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/oj/RankController.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/oj/RankController.class deleted file mode 100644 index d71f5834..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/controller/oj/RankController.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/crawler/problem/CFProblemStrategy.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/crawler/problem/CFProblemStrategy.class deleted file mode 100644 index 0fb3627b..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/crawler/problem/CFProblemStrategy.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/crawler/problem/HDUProblemStrategy.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/crawler/problem/HDUProblemStrategy.class deleted file mode 100644 index fb60593a..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/crawler/problem/HDUProblemStrategy.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/crawler/problem/ProblemContext.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/crawler/problem/ProblemContext.class deleted file mode 100644 index 3447d74e..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/crawler/problem/ProblemContext.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/crawler/problem/ProblemStrategy$RemoteProblemInfo.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/crawler/problem/ProblemStrategy$RemoteProblemInfo.class deleted file mode 100644 index aa1b751e..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/crawler/problem/ProblemStrategy$RemoteProblemInfo.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/crawler/problem/ProblemStrategy.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/crawler/problem/ProblemStrategy.class deleted file mode 100644 index 6614668e..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/crawler/problem/ProblemStrategy.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/AnnouncementMapper.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/AnnouncementMapper.class deleted file mode 100644 index 13db486a..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/AnnouncementMapper.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/AuthMapper.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/AuthMapper.class deleted file mode 100644 index 9885616c..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/AuthMapper.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/CommentMapper.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/CommentMapper.class deleted file mode 100644 index cd0cf3f9..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/CommentMapper.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ContestAnnouncementMapper.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ContestAnnouncementMapper.class deleted file mode 100644 index f1acdc33..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ContestAnnouncementMapper.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ContestExplanationMapper.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ContestExplanationMapper.class deleted file mode 100644 index 604f2a38..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ContestExplanationMapper.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ContestMapper.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ContestMapper.class deleted file mode 100644 index a9cd8b8d..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ContestMapper.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ContestProblemMapper.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ContestProblemMapper.class deleted file mode 100644 index d7332320..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ContestProblemMapper.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ContestRecordMapper.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ContestRecordMapper.class deleted file mode 100644 index 65619bfa..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ContestRecordMapper.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ContestRegisterMapper.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ContestRegisterMapper.class deleted file mode 100644 index 4da6da92..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ContestRegisterMapper.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ContestScoreMapper.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ContestScoreMapper.class deleted file mode 100644 index 6a099b5e..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ContestScoreMapper.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/FileMapper.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/FileMapper.class deleted file mode 100644 index 2e44a251..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/FileMapper.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/JudgeCaseMapper.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/JudgeCaseMapper.class deleted file mode 100644 index fd0b4f62..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/JudgeCaseMapper.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/JudgeMapper.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/JudgeMapper.class deleted file mode 100644 index 51109300..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/JudgeMapper.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/LanguageMapper.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/LanguageMapper.class deleted file mode 100644 index 16ae2235..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/LanguageMapper.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ProblemCaseMapper.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ProblemCaseMapper.class deleted file mode 100644 index 596b1bff..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ProblemCaseMapper.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ProblemCountMapper.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ProblemCountMapper.class deleted file mode 100644 index 41f365b2..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ProblemCountMapper.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ProblemLanguageMapper.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ProblemLanguageMapper.class deleted file mode 100644 index a88dbdb4..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ProblemLanguageMapper.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ProblemMapper.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ProblemMapper.class deleted file mode 100644 index ec464b2c..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ProblemMapper.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ProblemTagMapper.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ProblemTagMapper.class deleted file mode 100644 index 295d11e2..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/ProblemTagMapper.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/RoleAuthMapper.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/RoleAuthMapper.class deleted file mode 100644 index a0ca0391..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/RoleAuthMapper.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/RoleMapper.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/RoleMapper.class deleted file mode 100644 index c3d48ece..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/RoleMapper.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/SessionMapper.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/SessionMapper.class deleted file mode 100644 index fb54481e..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/SessionMapper.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/TagMapper.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/TagMapper.class deleted file mode 100644 index f6d58e65..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/TagMapper.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/UserAcproblemMapper.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/UserAcproblemMapper.class deleted file mode 100644 index da756db8..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/UserAcproblemMapper.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/UserInfoMapper.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/UserInfoMapper.class deleted file mode 100644 index bc213af6..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/UserInfoMapper.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/UserRecordMapper.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/UserRecordMapper.class deleted file mode 100644 index b8e9aff7..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/UserRecordMapper.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/UserRoleMapper.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/UserRoleMapper.class deleted file mode 100644 index c13b9fe5..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/dao/UserRoleMapper.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/judge/remote/RemoteJudgeDispatcher.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/judge/remote/RemoteJudgeDispatcher.class deleted file mode 100644 index 7cbe76b2..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/judge/remote/RemoteJudgeDispatcher.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/judge/remote/RemoteJudgeReceiver.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/judge/remote/RemoteJudgeReceiver.class deleted file mode 100644 index 8dad3bd6..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/judge/remote/RemoteJudgeReceiver.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/judge/self/JudgeChooseRule.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/judge/self/JudgeChooseRule.class deleted file mode 100644 index dac3fa0d..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/judge/self/JudgeChooseRule.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/judge/self/JudgeDispatcher.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/judge/self/JudgeDispatcher.class deleted file mode 100644 index e1c8b19a..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/judge/self/JudgeDispatcher.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/judge/self/JudgeReceiver.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/judge/self/JudgeReceiver.class deleted file mode 100644 index 28a47331..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/judge/self/JudgeReceiver.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/dto/AnnouncementDto.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/dto/AnnouncementDto.class deleted file mode 100644 index 5dc7ec07..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/dto/AnnouncementDto.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/dto/CheckACDto.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/dto/CheckACDto.class deleted file mode 100644 index 188ca77f..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/dto/CheckACDto.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/dto/LoginDto.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/dto/LoginDto.class deleted file mode 100644 index a9f6fb53..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/dto/LoginDto.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/dto/PidListDto.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/dto/PidListDto.class deleted file mode 100644 index 1237a68e..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/dto/PidListDto.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/dto/ProblemDto.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/dto/ProblemDto.class deleted file mode 100644 index 525049eb..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/dto/ProblemDto.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/dto/RegisterDto.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/dto/RegisterDto.class deleted file mode 100644 index bf3ea6a6..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/dto/RegisterDto.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/dto/SubmitIdListDto.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/dto/SubmitIdListDto.class deleted file mode 100644 index b74d43f2..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/dto/SubmitIdListDto.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/dto/ToJudgeDto.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/dto/ToJudgeDto.class deleted file mode 100644 index 4d931915..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/dto/ToJudgeDto.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/ACMContestRankVo.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/ACMContestRankVo.class deleted file mode 100644 index fcfac1d8..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/ACMContestRankVo.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/ACMRankVo.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/ACMRankVo.class deleted file mode 100644 index fb8c498d..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/ACMRankVo.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/AnnouncementVo.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/AnnouncementVo.class deleted file mode 100644 index b655fd84..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/AnnouncementVo.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/ConfigVo.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/ConfigVo.class deleted file mode 100644 index 8bda36c7..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/ConfigVo.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/ContestProblemVo.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/ContestProblemVo.class deleted file mode 100644 index 8266c2c7..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/ContestProblemVo.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/ContestRecordVo.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/ContestRecordVo.class deleted file mode 100644 index 7b0b940a..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/ContestRecordVo.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/ContestVo.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/ContestVo.class deleted file mode 100644 index 1b8d439d..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/ContestVo.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/ExcelUserVo.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/ExcelUserVo.class deleted file mode 100644 index 5b33c1db..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/ExcelUserVo.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/JudgeVo.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/JudgeVo.class deleted file mode 100644 index 554a3d01..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/JudgeVo.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/OIContestRankVo.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/OIContestRankVo.class deleted file mode 100644 index d57e92f0..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/OIContestRankVo.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/OIRankVo.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/OIRankVo.class deleted file mode 100644 index b2344062..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/OIRankVo.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/ProblemInfoVo.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/ProblemInfoVo.class deleted file mode 100644 index b53abb95..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/ProblemInfoVo.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/ProblemVo.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/ProblemVo.class deleted file mode 100644 index 32e5d5b3..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/ProblemVo.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/RoleAuthsVo.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/RoleAuthsVo.class deleted file mode 100644 index fabf8e0c..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/RoleAuthsVo.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/UserHomeVo.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/UserHomeVo.class deleted file mode 100644 index ae32dc10..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/UserHomeVo.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/UserRolesVo.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/UserRolesVo.class deleted file mode 100644 index af3985b2..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/pojo/vo/UserRolesVo.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/AnnouncementService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/AnnouncementService.class deleted file mode 100644 index 7a7a4657..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/AnnouncementService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/AuthService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/AuthService.class deleted file mode 100644 index 83b450b3..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/AuthService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/CommentService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/CommentService.class deleted file mode 100644 index 6cbc048e..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/CommentService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ConfigService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ConfigService.class deleted file mode 100644 index 37904d70..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ConfigService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ContestAnnouncementService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ContestAnnouncementService.class deleted file mode 100644 index c0bcf8a7..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ContestAnnouncementService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ContestExplanationService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ContestExplanationService.class deleted file mode 100644 index ea07dc92..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ContestExplanationService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ContestProblemService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ContestProblemService.class deleted file mode 100644 index 40bcbf49..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ContestProblemService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ContestRecordService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ContestRecordService.class deleted file mode 100644 index 74816d88..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ContestRecordService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ContestRegisterService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ContestRegisterService.class deleted file mode 100644 index 7030935d..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ContestRegisterService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ContestScoreService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ContestScoreService.class deleted file mode 100644 index 6fe3d048..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ContestScoreService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ContestService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ContestService.class deleted file mode 100644 index db8c4064..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ContestService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/EmailService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/EmailService.class deleted file mode 100644 index dac7a64e..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/EmailService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/FileService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/FileService.class deleted file mode 100644 index 18f90f09..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/FileService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/JudgeCaseService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/JudgeCaseService.class deleted file mode 100644 index 0d840752..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/JudgeCaseService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/JudgeService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/JudgeService.class deleted file mode 100644 index 4b04f22a..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/JudgeService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/LanguageService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/LanguageService.class deleted file mode 100644 index 027edaf8..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/LanguageService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ProblemCaseService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ProblemCaseService.class deleted file mode 100644 index a93cbbe9..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ProblemCaseService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ProblemCountService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ProblemCountService.class deleted file mode 100644 index e6e78990..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ProblemCountService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ProblemLanguageService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ProblemLanguageService.class deleted file mode 100644 index b7645efd..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ProblemLanguageService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ProblemService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ProblemService.class deleted file mode 100644 index 9deb0874..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ProblemService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ProblemTagService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ProblemTagService.class deleted file mode 100644 index 91259a03..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ProblemTagService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/RoleAuthService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/RoleAuthService.class deleted file mode 100644 index 2a23b80e..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/RoleAuthService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/RoleService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/RoleService.class deleted file mode 100644 index b08bbeb2..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/RoleService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ScheduleService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ScheduleService.class deleted file mode 100644 index b322dd74..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ScheduleService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/SessionService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/SessionService.class deleted file mode 100644 index d11d7d55..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/SessionService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/TagService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/TagService.class deleted file mode 100644 index 727044c9..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/TagService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ToJudgeService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ToJudgeService.class deleted file mode 100644 index 2b5be10d..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/ToJudgeService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/UserAcproblemService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/UserAcproblemService.class deleted file mode 100644 index d31b7897..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/UserAcproblemService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/UserInfoService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/UserInfoService.class deleted file mode 100644 index eeec6a93..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/UserInfoService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/UserRecordService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/UserRecordService.class deleted file mode 100644 index 2b71a1aa..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/UserRecordService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/UserRoleService.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/UserRoleService.class deleted file mode 100644 index a8c8de52..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/UserRoleService.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/AnnouncementServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/AnnouncementServiceImpl.class deleted file mode 100644 index 1c9fae2c..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/AnnouncementServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/AuthServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/AuthServiceImpl.class deleted file mode 100644 index dcd7c57a..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/AuthServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/CommentServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/CommentServiceImpl.class deleted file mode 100644 index 3bc314d5..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/CommentServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ConfigServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ConfigServiceImpl.class deleted file mode 100644 index 1cf9cdc2..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ConfigServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ContestAnnouncementServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ContestAnnouncementServiceImpl.class deleted file mode 100644 index 6b7f1cb7..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ContestAnnouncementServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ContestExplanationServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ContestExplanationServiceImpl.class deleted file mode 100644 index d400f8d3..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ContestExplanationServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ContestProblemServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ContestProblemServiceImpl.class deleted file mode 100644 index 15a17c9a..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ContestProblemServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ContestRecordServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ContestRecordServiceImpl.class deleted file mode 100644 index b904d907..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ContestRecordServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ContestRegisterServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ContestRegisterServiceImpl.class deleted file mode 100644 index 26a7567b..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ContestRegisterServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ContestScoreServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ContestScoreServiceImpl.class deleted file mode 100644 index 00e6a0f2..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ContestScoreServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ContestServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ContestServiceImpl.class deleted file mode 100644 index 018b5192..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ContestServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/EmailServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/EmailServiceImpl.class deleted file mode 100644 index 2915575b..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/EmailServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/FileServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/FileServiceImpl.class deleted file mode 100644 index 2312ae87..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/FileServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/JudgeCaseServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/JudgeCaseServiceImpl.class deleted file mode 100644 index 6ddba596..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/JudgeCaseServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/JudgeServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/JudgeServiceImpl.class deleted file mode 100644 index f5b9210e..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/JudgeServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/LanguageServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/LanguageServiceImpl.class deleted file mode 100644 index eac122c6..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/LanguageServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ProblemCaseServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ProblemCaseServiceImpl.class deleted file mode 100644 index e70aaf4f..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ProblemCaseServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ProblemCountServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ProblemCountServiceImpl.class deleted file mode 100644 index f2362098..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ProblemCountServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ProblemLanguageServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ProblemLanguageServiceImpl.class deleted file mode 100644 index b669b081..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ProblemLanguageServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ProblemServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ProblemServiceImpl.class deleted file mode 100644 index 6aeab712..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ProblemServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ProblemTagServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ProblemTagServiceImpl.class deleted file mode 100644 index c53c576a..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ProblemTagServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/RoleAuthServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/RoleAuthServiceImpl.class deleted file mode 100644 index 6b291022..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/RoleAuthServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/RoleServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/RoleServiceImpl.class deleted file mode 100644 index 46a0f0e1..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/RoleServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ScheduleServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ScheduleServiceImpl.class deleted file mode 100644 index 9e0f7e31..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/ScheduleServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/SessionServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/SessionServiceImpl.class deleted file mode 100644 index 90d78f01..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/SessionServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/TagServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/TagServiceImpl.class deleted file mode 100644 index cff232ca..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/TagServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/UserAcproblemServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/UserAcproblemServiceImpl.class deleted file mode 100644 index 628427e3..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/UserAcproblemServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/UserInfoServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/UserInfoServiceImpl.class deleted file mode 100644 index 6c0968bb..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/UserInfoServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/UserRecordServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/UserRecordServiceImpl.class deleted file mode 100644 index 41e400cc..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/UserRecordServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/UserRoleServiceImpl.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/UserRoleServiceImpl.class deleted file mode 100644 index daf06fe5..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/service/impl/UserRoleServiceImpl.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/shiro/AccountProfile.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/shiro/AccountProfile.class deleted file mode 100644 index f7cb9165..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/shiro/AccountProfile.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/shiro/AccountRealm.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/shiro/AccountRealm.class deleted file mode 100644 index b61a3f99..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/shiro/AccountRealm.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/shiro/JwtFilter.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/shiro/JwtFilter.class deleted file mode 100644 index 7af31174..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/shiro/JwtFilter.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/shiro/JwtToken.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/shiro/JwtToken.class deleted file mode 100644 index 648febca..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/shiro/JwtToken.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/ConfigUtils.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/ConfigUtils.class deleted file mode 100644 index 404a268a..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/ConfigUtils.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/Constants$Account.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/Constants$Account.class deleted file mode 100644 index 91cac675..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/Constants$Account.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/Constants$Contest.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/Constants$Contest.class deleted file mode 100644 index 6e7e6456..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/Constants$Contest.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/Constants$Email.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/Constants$Email.class deleted file mode 100644 index ff2dfcaf..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/Constants$Email.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/Constants$File.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/Constants$File.class deleted file mode 100644 index cd460c5e..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/Constants$File.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/Constants$Judge.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/Constants$Judge.class deleted file mode 100644 index a6f3368d..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/Constants$Judge.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/Constants$Schedule.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/Constants$Schedule.class deleted file mode 100644 index 296cfa8a..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/Constants$Schedule.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/Constants.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/Constants.class deleted file mode 100644 index 70eecdd5..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/Constants.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/IpUtils.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/IpUtils.class deleted file mode 100644 index c10b0dc8..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/IpUtils.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/JsoupUtils.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/JsoupUtils.class deleted file mode 100644 index ccc23ee6..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/JsoupUtils.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/JwtUtils.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/JwtUtils.class deleted file mode 100644 index 0fd4100f..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/JwtUtils.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/RedisUtils.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/RedisUtils.class deleted file mode 100644 index 71d721cb..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/RedisUtils.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/ShiroUtils.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/ShiroUtils.class deleted file mode 100644 index 7db87468..00000000 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/utils/ShiroUtils.class and /dev/null differ diff --git a/hoj-springboot/DataBackup/target/test-classes/top/hcode/hoj/DataBackupApplicationTests.class b/hoj-springboot/DataBackup/target/test-classes/top/hcode/hoj/DataBackupApplicationTests.class deleted file mode 100644 index 596d78f2..00000000 Binary files a/hoj-springboot/DataBackup/target/test-classes/top/hcode/hoj/DataBackupApplicationTests.class and /dev/null differ diff --git a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/config/NacosConfig.java b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/config/NacosConfig.java index 1c001387..3f86d5e2 100644 --- a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/config/NacosConfig.java +++ b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/config/NacosConfig.java @@ -20,18 +20,25 @@ public class NacosConfig { private static final int cpuNum = Runtime.getRuntime().availableProcessors(); - @Value("${hoj-judger.max-task-num}") + @Value("${hoj-judge-server.max-task-num}") private Integer maxTaskNum; - @Value("${hoj-judger.ip}") + @Value("${hoj-judge-server.remote-judge.max-task-num}") + private Integer maxRemoteTaskNum; + + @Value("${hoj-judge-server.remote-judge.open}") + private Boolean openRemoteJudge; + + @Value("${hoj-judge-server.ip}") private String ip; - @Value("${hoj-judger.port}") + @Value("${hoj-judge-server.port}") private Integer port; - @Value("${hoj-judger.name}") + @Value("${hoj-judge-server.name}") private String name; + /** * 用于改变程序自动获取的本机ip */ @@ -42,12 +49,18 @@ public class NacosConfig { //此处我只改了ip,其他参数可以根据自己的需求改变 nacosDiscoveryProperties.setIp(IpUtils.getServiceIp()); HashMap meta = new HashMap<>(); - int max = cpuNum; + int max = cpuNum * 2 + 1; if (maxTaskNum != -1) { max = maxTaskNum; } meta.put("maxTaskNum", String.valueOf(max)); - meta.put("currentTaskNum", "0"); + if (openRemoteJudge) { + max = (cpuNum * 2 + 1) * 2; + if (maxRemoteTaskNum != -1) { + max = maxRemoteTaskNum; + } + meta.put("maxRemoteTaskNum", String.valueOf(max)); + } meta.put("judgeName", name); nacosDiscoveryProperties.setMetadata(meta); if (ip.equals("-1")) { diff --git a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/config/StartupRunner.java b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/config/StartupRunner.java new file mode 100644 index 00000000..46e07f4a --- /dev/null +++ b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/config/StartupRunner.java @@ -0,0 +1,98 @@ +package top.hcode.hoj.config; + +import cn.hutool.json.JSONObject; +import cn.hutool.json.JSONUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.CommandLineRunner; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; +import top.hcode.hoj.pojo.entity.JudgeServer; +import top.hcode.hoj.service.impl.JudgeServerServiceImpl; +import top.hcode.hoj.util.Constants; +import top.hcode.hoj.util.IpUtils; +import top.hcode.hoj.util.RedisUtils; + +import java.util.HashMap; + + +/** + * @Author: Himit_ZH + * @Date: 2021/2/19 22:11 + * @Description:项目启动加载类,启动完毕将该判题机加入到redis里面 + */ +@Component +@Slf4j +public class StartupRunner implements CommandLineRunner { + + @Value("${hoj-judge-server.max-task-num}") + private Integer maxTaskNum; + + @Value("${hoj-judge-server.remote-judge.max-task-num}") + private Integer maxRemoteTaskNum; + + @Value("${hoj-judge-server.remote-judge.open}") + private Boolean openRemoteJudge; + + @Value("${hoj-judge-server.name}") + private String name; + + @Value("${hoj-judge-server.ip}") + private String ip; + + @Value("${hoj-judge-server.port}") + private Integer port; + + private static final int cpuNum = Runtime.getRuntime().availableProcessors(); + + @Autowired + private JudgeServerServiceImpl judgeServerService; + + @Override + @Transactional + public void run(String... args) { + + if (maxTaskNum == -1) { + maxTaskNum = cpuNum * 2; + } + if (ip.equals("-1")) { + ip = IpUtils.getLocalIpv4Address(); + } + UpdateWrapper judgeServerQueryWrapper = new UpdateWrapper<>(); + judgeServerQueryWrapper.eq("ip", ip).eq("port", port); + judgeServerService.remove(judgeServerQueryWrapper); + boolean isOk1 = judgeServerService.save(new JudgeServer() + .setCpuCore(cpuNum) + .setIp(ip) + .setPort(port) + .setVersion(0L) + .setUrl(ip + ":" + port) + .setMaxTaskNumber(maxTaskNum) + .setIsRemote(false) + .setName(name)); + boolean isOk2 = true; + if (openRemoteJudge) { + if (maxRemoteTaskNum == -1) { + maxRemoteTaskNum = (cpuNum * 2 ) * 2; + } + isOk2 = judgeServerService.save(new JudgeServer() + .setCpuCore(cpuNum) + .setIp(ip) + .setPort(port) + .setVersion(0L) + .setUrl(ip + ":" + port) + .setMaxTaskNumber(maxRemoteTaskNum) + .setIsRemote(true) + .setName(name)); + } + + if (!isOk1 || !isOk2) { + log.error("初始化判题机信息到数据库失败,请重新启动试试!"); + } + + } + +} \ No newline at end of file diff --git a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/controller/JudgeController.java b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/controller/JudgeController.java index 38a857d7..db2b781f 100644 --- a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/controller/JudgeController.java +++ b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/controller/JudgeController.java @@ -2,6 +2,7 @@ package top.hcode.hoj.controller; import cn.hutool.core.map.MapUtil; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -40,21 +41,21 @@ public class JudgeController { @Autowired private RemoteJudgeToSubmit remoteJudgeToSubmit; + @Value("${hoj.judge.token}") private String judgeToken; - @Value("${hoj-judger.max-task-num}") + @Value("${hoj-judge-server.max-task-num}") private Integer maxTaskNum; - @Value("${hoj-judger.name}") + @Value("${hoj-judge-server.name}") private String name; - @RequestMapping("/version") public CommonResult getVersion() { return CommonResult.successResponse(MapUtil.builder() - .put("version", "1.0.0") + .put("version", "1.1.0") .put("currentTime", new Date()) .put("judgeServerName", name) .put("cpu", Runtime.getRuntime().availableProcessors()) @@ -72,12 +73,10 @@ public class JudgeController { } Judge judge = toJudge.getJudge(); - if (judge == null || judge.getSubmitId() == null || judge.getUid() == null || judge.getPid() == null) { - return CommonResult.errorResponse("参数错误!"); - } - // 当前判题任务数+1 - systemConfigService.updateJudgeTaskNum(true); + if (judge == null || judge.getSubmitId() == null || judge.getUid() == null || judge.getPid() == null) { + return CommonResult.errorResponse("调用参数错误!请检查您的调用参数!", CommonResult.STATUS_FAIL); + } judge.setStatus(Constants.Judge.STATUS_COMPILING.getStatus()); // 标志该判题过程进入编译阶段 // 写入当前判题服务的名字 @@ -102,8 +101,7 @@ public class JudgeController { finalJudge.getPid(), finalJudge.getScore()); - // 当前判题任务数-1 - systemConfigService.updateJudgeTaskNum(false); + return CommonResult.successResponse(finalJudge, "判题机评测完成!"); } diff --git a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/dao/JudgeServerMapper.java b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/dao/JudgeServerMapper.java new file mode 100644 index 00000000..f82106fa --- /dev/null +++ b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/dao/JudgeServerMapper.java @@ -0,0 +1,11 @@ +package top.hcode.hoj.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Repository; +import top.hcode.hoj.pojo.entity.JudgeServer; + +@Mapper +@Repository +public interface JudgeServerMapper extends BaseMapper { +} diff --git a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/judge/JudgeStrategy.java b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/judge/JudgeStrategy.java index 0b0432d1..80572f90 100644 --- a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/judge/JudgeStrategy.java +++ b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/judge/JudgeStrategy.java @@ -72,7 +72,6 @@ public class JudgeStrategy { @Autowired private JudgeCaseServiceImpl judgeCaseService; - public void init(Problem problem, Judge judge) { this.testCasesDir = Constants.JudgeDir.TEST_CASE_DIR.getContent() + "/problem_" + problem.getId(); this.runConfig = Constants.RunConfig.getRunnerByLanguage(judge.getLanguage()); diff --git a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/remoteJudge/RemoteJudgeToSubmit.java b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/remoteJudge/RemoteJudgeToSubmit.java index f1f4dbce..6c76d1d6 100644 --- a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/remoteJudge/RemoteJudgeToSubmit.java +++ b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/remoteJudge/RemoteJudgeToSubmit.java @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; import top.hcode.hoj.pojo.entity.Judge; import top.hcode.hoj.remoteJudge.task.RemoteJudgeFactory; @@ -30,7 +31,8 @@ public class RemoteJudgeToSubmit { @Autowired private JudgeServiceImpl judgeService; - @Value("${hoj-judger.name}") + + @Value("${hoj-judge-server.name}") private String name; diff --git a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/service/JudgeServerService.java b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/service/JudgeServerService.java new file mode 100644 index 00000000..7cadacf0 --- /dev/null +++ b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/service/JudgeServerService.java @@ -0,0 +1,8 @@ +package top.hcode.hoj.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import top.hcode.hoj.pojo.entity.JudgeServer; + +public interface JudgeServerService extends IService { + +} diff --git a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/service/SystemConfigService.java b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/service/SystemConfigService.java index 39e85d0e..6e3305dc 100644 --- a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/service/SystemConfigService.java +++ b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/service/SystemConfigService.java @@ -3,7 +3,5 @@ package top.hcode.hoj.service; import java.util.HashMap; public interface SystemConfigService { - public HashMap getSystemConfig(); - - public void updateJudgeTaskNum(Boolean add); + public HashMap getSystemConfig(); } diff --git a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/service/impl/ContestRecordServiceImpl.java b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/service/impl/ContestRecordServiceImpl.java index 0f02f896..a72ed2cb 100644 --- a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/service/impl/ContestRecordServiceImpl.java +++ b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/service/impl/ContestRecordServiceImpl.java @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Isolation; import org.springframework.transaction.annotation.Transactional; import top.hcode.hoj.dao.ContestRecordMapper; import top.hcode.hoj.pojo.entity.ContestRecord; @@ -30,7 +31,8 @@ public class ContestRecordServiceImpl extends ServiceImpl penaltyStatus = Arrays.asList(Constants.Judge.STATUS_PRESENTATION_ERROR.getStatus(), + private static List penaltyStatus = Arrays.asList( + Constants.Judge.STATUS_PRESENTATION_ERROR.getStatus(), Constants.Judge.STATUS_WRONG_ANSWER.getStatus(), Constants.Judge.STATUS_TIME_LIMIT_EXCEEDED.getStatus(), Constants.Judge.STATUS_MEMORY_LIMIT_EXCEEDED.getStatus(), @@ -39,7 +41,7 @@ public class ContestRecordServiceImpl extends ServiceImpl updateWrapper = new UpdateWrapper<>(); // 如果是AC @@ -53,6 +55,9 @@ public class ContestRecordServiceImpl extends ServiceImpl updateWrapper) { boolean retryable; int attemptNumber = 0; diff --git a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/service/impl/JudgeServerServiceImpl.java b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/service/impl/JudgeServerServiceImpl.java new file mode 100644 index 00000000..3e66781b --- /dev/null +++ b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/service/impl/JudgeServerServiceImpl.java @@ -0,0 +1,18 @@ +package top.hcode.hoj.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import top.hcode.hoj.dao.JudgeServerMapper; +import top.hcode.hoj.pojo.entity.JudgeServer; +import top.hcode.hoj.service.JudgeServerService; + +/** + * @Author: Himit_ZH + * @Date: 2021/4/15 11:27 + * @Description: + */ +@Service +public class JudgeServerServiceImpl extends ServiceImpl implements JudgeServerService { + + +} \ No newline at end of file diff --git a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/service/impl/SystemConfigServiceImpl.java b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/service/impl/SystemConfigServiceImpl.java index c3e5cff5..cbcc20b6 100644 --- a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/service/impl/SystemConfigServiceImpl.java +++ b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/service/impl/SystemConfigServiceImpl.java @@ -1,20 +1,14 @@ package top.hcode.hoj.service.impl; -import cn.hutool.json.JSONObject; -import cn.hutool.json.JSONUtil; + import com.sun.management.OperatingSystemMXBean; import lombok.Data; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.*; import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; import top.hcode.hoj.service.SystemConfigService; -import top.hcode.hoj.util.IpUtils; -import java.io.UnsupportedEncodingException; import java.lang.management.ManagementFactory; -import java.net.URLEncoder; import java.util.HashMap; /** @@ -28,29 +22,20 @@ public class SystemConfigServiceImpl implements SystemConfigService { private static final int cpuNum = Runtime.getRuntime().availableProcessors(); - @Value("${hoj-judger.task-num}") - private Integer taskNum; - - @Value("${hoj-judger.max-task-num}") - private Integer maxTaskNum; - - @Value("${spring.cloud.nacos.url}") - private String nacosUrl; - - @Value("${hoj-judger.ip}") + @Value("${hoj-judge-server.ip}") private String ip; - @Value("${hoj-judger.port}") + @Value("${hoj-judge-server.port}") private Integer port; - @Value("${hoj-judger.name}") + @Value("${hoj-judge-server.name}") private String name; @Value("${spring.application.name}") private String judgeServiceName; @Autowired - private RestTemplate restTemplate; + private JudgeServerServiceImpl judgeServerService; private static OperatingSystemMXBean osmxb = (OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean(); @@ -72,87 +57,4 @@ public class SystemConfigServiceImpl implements SystemConfigService { return result; } - public synchronized void reduceCurrentTaskNum() { - int currentTaskNum = getTaskNum(); - if (currentTaskNum >= 1) { - setTaskNum(currentTaskNum - 1); - } - } - - public synchronized void addCurrentTaskNum() { - int currentTaskNum = getTaskNum(); - setTaskNum(currentTaskNum + 1); - } - - @Override - public void updateJudgeTaskNum(Boolean add) { - int max = cpuNum; - if (maxTaskNum != -1) { - max = getMaxTaskNum(); - } - String useIP = ip.equals("-1") ? IpUtils.getLocalIpv4Address() : ip; - if (add) { - addCurrentTaskNum(); - } else { - reduceCurrentTaskNum(); - } - - JSONObject metaData = new JSONObject(); - metaData.set("currentTaskNum", getTaskNum()); - metaData.set("maxTaskNum", max); - metaData.set("judgeName", name); - String url = nacosUrl + "/nacos/v1/ns/instance?ip=" + useIP + "&port=" + getPort() + - "&serviceName=" + getJudgeServiceName() + "&metadata="; - try { - String encodeMeta = URLEncoder.encode(JSONUtil.toJsonStr(metaData), "utf-8"); - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); - HttpEntity entity = new HttpEntity<>(headers); - ResponseEntity result = restTemplate.exchange(url + encodeMeta, HttpMethod.PUT, entity, String.class); - if (result.getBody() == null || !result.getBody().equals("ok")) { - tryAgainUpdate(max,useIP); - } - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - - } - - public void tryAgainUpdate(int max,String useIP) { - boolean retryable; - int attemptNumber = 0; - do { - JSONObject metaData = new JSONObject(); - metaData.set("currentTaskNum", getTaskNum()); - metaData.set("maxTaskNum", max); - metaData.set("judgeName", name); - String url = nacosUrl + "/nacos/v1/ns/instance?ip=" + useIP + "&port=" + getPort() + - "&serviceName=" + getJudgeServiceName() + "&metadata=" + JSONUtil.toJsonStr(metaData); - String encodeUrl; - boolean success = false; - try { - encodeUrl = URLEncoder.encode(url, "utf-8"); - String result = restTemplate.getForObject(encodeUrl, String.class); - if (result == null || result.equals("ok")) { - success = true; - } - } catch (Exception e) { - e.printStackTrace(); - } - if (success) { - return; - } else { - attemptNumber++; - retryable = attemptNumber < 3; - if (attemptNumber == 3) { - break; - } - try { - Thread.sleep(300); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - } while (retryable); - } } \ No newline at end of file diff --git a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/service/impl/UserRecordServiceImpl.java b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/service/impl/UserRecordServiceImpl.java index 6795c8e6..00dd8a5d 100644 --- a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/service/impl/UserRecordServiceImpl.java +++ b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/service/impl/UserRecordServiceImpl.java @@ -60,6 +60,7 @@ public class UserRecordServiceImpl extends ServiceImpl { + if (/\w|\./g.test(changeObj.text[0]) && changeObj.origin !== 'complete') { + instance.showHint({ + hint: CodeMirror.hint.anyword, + completeSingle: false, + range: 1000, // 附近多少行代码匹配 + }); + } + }); }, watch: { value(val) { diff --git a/hoj-vue/src/components/oj/common/CodeMirror.vue b/hoj-vue/src/components/oj/common/CodeMirror.vue index febc508e..b210d3d1 100644 --- a/hoj-vue/src/components/oj/common/CodeMirror.vue +++ b/hoj-vue/src/components/oj/common/CodeMirror.vue @@ -74,7 +74,7 @@ diff --git a/hoj-vue/src/router/ojRoutes.js b/hoj-vue/src/router/ojRoutes.js index c30d7908..091f83a4 100644 --- a/hoj-vue/src/router/ojRoutes.js +++ b/hoj-vue/src/router/ojRoutes.js @@ -110,6 +110,12 @@ const ojRoutes = [ component: SubmissionList, meta: { title: 'Contest Submission' } }, + { + name: 'ContestSubmissionDeatil', + path: 'problem/:problemID/submission-deatil/:submitID', + component: SubmissionDetails, + meta: { title: 'Contest Submission Deatil' } + }, { name: 'ContestProblemList', path: 'problems', diff --git a/hoj-vue/src/views/admin/problem/Problem.vue b/hoj-vue/src/views/admin/problem/Problem.vue index bb1c3b45..73d49569 100644 --- a/hoj-vue/src/views/admin/problem/Problem.vue +++ b/hoj-vue/src/views/admin/problem/Problem.vue @@ -18,9 +18,9 @@ placeholder="Enter the display id of problem" v-model="problem.problemId" > - + @@ -544,7 +544,7 @@ export default { loadingCompile: false, mode: '', // 该题目是编辑或者创建 contest: {}, - OJ_NAME: 'HOJ', + problemIdPrex: 'HOJ-', pid: null, // 题目id,如果为创建模式则为null contestID: null, // 比赛id contestProblem: { @@ -605,7 +605,12 @@ export default { }, mounted() { this.routeName = this.$route.name; - this.OJ_NAME = OJ_NAME; + let contestID = this.$route.params.contestId; + this.problemIdPrex = OJ_NAME + '-'; + // 比赛题目HOJ-C1000 + if (contestID) { + this.problemIdPrex += 'C'; + } this.uploadFileUrl = this.$http.defaults.baseURL + '/file/upload-testcase-zip'; if ( @@ -649,7 +654,7 @@ export default { source: '', cid: null, }; - let contestID = this.$route.params.contestId; + this.contestID = contestID; if (contestID) { this.problem.cid = this.reProblem.cid = contestID; @@ -1054,7 +1059,7 @@ export default { problemDto['problem'] = Object.assign({}, this.problem); // 深克隆 if (this.mode == 'add') { problemDto.problem.problemId = - this.OJ_NAME + '-' + this.problem.problemId; + this.problemIdPrex + this.problem.problemId; } problemDto.problem.examples = utils.examplesToString( this.problem.examples diff --git a/hoj-vue/src/views/oj/about/Introduction.vue b/hoj-vue/src/views/oj/about/Introduction.vue index 815652fb..9e6cc325 100644 --- a/hoj-vue/src/views/oj/about/Introduction.vue +++ b/hoj-vue/src/views/oj/about/Introduction.vue @@ -78,6 +78,26 @@ + +
+ Compile Explanation +
+
    +
  • + 1. __int64不是ANSI标准定义,只能在VC使用,在 GNU C++ 中应写成 long + long 类型, scanf和printf 请使用%lld作为格式 +
  • +
  • + 2. main() 返回值必须定义为 int ,而不是 void +
  • +
  • + 3. i 在循环外失去定义 "for(int i=0...){...}" +
  • +
  • + 4. itoa 不是ansi标准函数(标准 C/C++ 中无此函数) +
  • +
+
@@ -136,7 +156,8 @@ li { line-height: 2; } li .title { - font-weight: 500; + font-weight: 600; + font-size: 1rem; } .result li { list-style-type: none; diff --git a/hoj-vue/src/views/oj/contest/ContestDetails.vue b/hoj-vue/src/views/oj/contest/ContestDetails.vue index 357c2ece..71a98d2c 100644 --- a/hoj-vue/src/views/oj/contest/ContestDetails.vue +++ b/hoj-vue/src/views/oj/contest/ContestDetails.vue @@ -235,6 +235,9 @@ export default { if (this.route_name == 'ContestProblemDetails') { this.route_name = 'ContestProblemList'; } + if (this.route_name == 'ContestSubmissionDeatil') { + this.route_name = 'ContestSubmissionList'; + } this.CONTEST_TYPE_REVERSE = Object.assign({}, CONTEST_TYPE_REVERSE); this.CONTEST_STATUS = Object.assign({}, CONTEST_STATUS); this.CONTEST_STATUS_REVERSE = Object.assign({}, CONTEST_STATUS_REVERSE); @@ -334,6 +337,9 @@ export default { if (newVal.name == 'ContestProblemDetails') { this.route_name = 'ContestProblemList'; } + if (this.route_name == 'ContestSubmissionDeatil') { + this.route_name = 'ContestSubmissionList'; + } this.contestID = newVal.params.contestID; this.changeDomTitle({ title: this.contest.title }); }, diff --git a/hoj-vue/src/views/oj/status/SubmissionDetails.vue b/hoj-vue/src/views/oj/status/SubmissionDetails.vue index 0071518d..a1ff86c5 100644 --- a/hoj-vue/src/views/oj/status/SubmissionDetails.vue +++ b/hoj-vue/src/views/oj/status/SubmissionDetails.vue @@ -1,6 +1,6 @@