diff --git a/README.md b/README.md index d8ffe6c6..866d63c1 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,7 @@ Password: 开启SMTP服务后生成的随机授权码 | 2021-05-12 | 添加评论及回复删除,讨论举报,调整显示时间。 | Himit_ZH | | 2021-05-16 | 完善权限控制,讨论管理员管理,讨论删除与编辑更新。 | Himit_ZH | | 2021-05-22 | 更新docker-compose一键部署,修正部分bug | Himit_ZH | +| 2021-05-24 | 判题调度乐观锁改为悲观锁 | Himit_ZH | diff --git a/hoj-springboot/.gitignore b/hoj-springboot/.gitignore index fd47c5f0..e8400896 100644 --- a/hoj-springboot/.gitignore +++ b/hoj-springboot/.gitignore @@ -23,3 +23,4 @@ pnpm-debug.log* *.njsproj *.sln *.sw? + diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/DataBackupApplication.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/DataBackupApplication.java index bd58b160..cd94f194 100644 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/DataBackupApplication.java +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/DataBackupApplication.java @@ -6,6 +6,7 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.transaction.annotation.EnableTransactionManagement; /** * @Author: Himit_ZH @@ -16,6 +17,7 @@ import org.springframework.scheduling.annotation.EnableScheduling; @EnableDiscoveryClient // 开启注册发现 @SpringBootApplication @EnableAsync(proxyTargetClass=true) //开启异步注解 +@EnableTransactionManagement public class DataBackupApplication { public static void main(String[] args) { SpringApplication.run(DataBackupApplication.class,args); diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/config/AsyncTaskConfig.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/config/AsyncTaskConfig.java index 42d9e467..f614acf7 100644 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/config/AsyncTaskConfig.java +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/config/AsyncTaskConfig.java @@ -1,29 +1,34 @@ package top.hcode.hoj.config; +import lombok.extern.slf4j.Slf4j; import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.annotation.AsyncConfigurer; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; +import java.lang.reflect.Method; import java.util.concurrent.Executor; import java.util.concurrent.ThreadPoolExecutor; /** * @Author: Himit_ZH * @Date: 2020/11/6 23:36 - * @Description: + * @Description: 通用异步线程池 */ @Configuration +@Slf4j(topic = "hoj") public class AsyncTaskConfig implements AsyncConfigurer { @Override public Executor getAsyncExecutor() { ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor(); // 线程池维护线程的最少数量 - taskExecutor.setCorePoolSize(20); + taskExecutor.setCorePoolSize(10); // 线程池维护线程的最大数量 taskExecutor.setMaxPoolSize(100); // 缓存队列 taskExecutor.setQueueCapacity(200); + //活跃时间 + taskExecutor.setKeepAliveSeconds(10); // 对拒绝task的处理策略 //(1) 默认的ThreadPoolExecutor.AbortPolicy 处理程序遭到拒绝将抛出运行时RejectedExecutionException; //(2) ThreadPoolExecutor.CallerRunsPolicy 线程调用运行该任务的 execute 本身。此策略提供简单的反馈控制机制,能够减缓新任务的提交速度 @@ -31,7 +36,7 @@ public class AsyncTaskConfig implements AsyncConfigurer { //(4) ThreadPoolExecutor.DiscardOldestPolicy 如果执行程序尚未关闭,则位于工作队列头部的任务将被删除,然后重试执行程序(如果再次失败,则重复此过程) taskExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); // 线程名前缀,方便排查问题 - taskExecutor.setThreadNamePrefix("order-send-thread-"); + taskExecutor.setThreadNamePrefix("CommonThread-"); // 注意一定要初始化 taskExecutor.initialize(); @@ -39,8 +44,19 @@ public class AsyncTaskConfig implements AsyncConfigurer { } + /** + * 异步任务中异常处理 + * @return + */ @Override public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() { - return null; + return new AsyncUncaughtExceptionHandler() { + + @Override + public void handleUncaughtException(Throwable arg0, Method arg1, Object... arg2) { + log.error("==========================" + arg0.getMessage() + "=======================", arg0); + log.error("exception method:" + arg1.getName()); + } + }; } } \ No newline at end of file diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/config/JudgeAsyncTaskConfig.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/config/JudgeAsyncTaskConfig.java new file mode 100644 index 00000000..e675544b --- /dev/null +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/config/JudgeAsyncTaskConfig.java @@ -0,0 +1,39 @@ +package top.hcode.hoj.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; + +import java.util.concurrent.Executor; +import java.util.concurrent.ThreadPoolExecutor; + +/** + * @Author: Himit_ZH + * @Date: 2021/5/24 16:54 + * @Description: 专用于判题的异步线程池 + */ +@Configuration +@EnableAsync +public class JudgeAsyncTaskConfig { + @Bean + public Executor judgeTaskAsyncPool() { + ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); + //核心线程池大小 + executor.setCorePoolSize(2); + //最大线程数 + executor.setMaxPoolSize(10); + //队列容量 + executor.setQueueCapacity(300); + //活跃时间 + executor.setKeepAliveSeconds(10); + //线程名字前缀 + executor.setThreadNamePrefix("JudgeExecutor-"); + + // setRejectedExecutionHandler:当pool已经达到max size的时候,如何处理新任务 + // CallerRunsPolicy:不在新线程中执行任务,而是由调用者所在的线程来执行 + executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); + executor.initialize(); + return executor; + } +} \ 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 93b1920c..73d3eb22 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 @@ -107,9 +107,6 @@ public class StartupRunner implements CommandLineRunner { @Override public void run(String... args) throws Exception { - if (openRemoteJudge.equals("true")) { - addRemoteJudgeAccountToRedis(); - } // 动态修改nacos上的配置文件 if (judgeToken.equals("default")) { configVo.setJudgeToken(IdUtil.fastSimpleUUID()); @@ -147,6 +144,10 @@ public class StartupRunner implements CommandLineRunner { configVo.setCfUsernameList(cfUsernameList); configVo.setCfPasswordList(cfPasswordList); configService.sendNewConfigToNacos(); + + if (openRemoteJudge.equals("true")) { + addRemoteJudgeAccountToRedis(); + } } /** 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 615795a2..7ec1fb04 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,7 +14,7 @@ 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.judge.Dispatcher; import top.hcode.hoj.pojo.dto.ProblemDto; import top.hcode.hoj.pojo.entity.*; import top.hcode.hoj.pojo.vo.UserRolesVo; @@ -43,7 +43,7 @@ public class AdminProblemController { private ProblemCaseServiceImpl problemCaseService; @Autowired - private JudgeServerUtils judgeServerUtils; + private Dispatcher dispatcher; @Value("${hoj.judge.token}") private String judgeToken; @@ -180,7 +180,7 @@ public class AdminProblemController { } compileSpj.setToken(judgeToken); - return judgeServerUtils.dispatcher("compile", "/compile-spj", compileSpj); + return dispatcher.dispatcher("compile", "/compile-spj", compileSpj); } @GetMapping("/import-remote-oj-problem") 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 index f82106fa..6230249b 100644 --- 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 @@ -5,7 +5,9 @@ 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/dao/xml/AuthMapper.xml b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/AuthMapper.xml deleted file mode 100644 index d61a52be..00000000 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/AuthMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/ContestExplanationMapper.xml b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/ContestExplanationMapper.xml deleted file mode 100644 index 686cc0ee..00000000 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/ContestExplanationMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/ContestRegisterMapper.xml b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/ContestRegisterMapper.xml deleted file mode 100644 index 5cfb91e1..00000000 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/ContestRegisterMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/ContestScoreMapper.xml b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/ContestScoreMapper.xml deleted file mode 100644 index bc02fc2e..00000000 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/ContestScoreMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/JudgeCaseMapper.xml b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/JudgeCaseMapper.xml deleted file mode 100644 index 28ef911c..00000000 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/JudgeCaseMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/LanguageMapper.xml b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/LanguageMapper.xml deleted file mode 100644 index c47f300c..00000000 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/LanguageMapper.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/RoleMapper.xml b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/RoleMapper.xml deleted file mode 100644 index 397d6d71..00000000 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/RoleMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/SessionMapper.xml b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/SessionMapper.xml deleted file mode 100644 index 9a333c5c..00000000 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/SessionMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/TagMapper.xml b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/TagMapper.xml deleted file mode 100644 index 78be8b24..00000000 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/TagMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/UserAcproblemMapper.xml b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/UserAcproblemMapper.xml deleted file mode 100644 index 34b29511..00000000 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/UserAcproblemMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/ChooseServer.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/ChooseServer.java new file mode 100644 index 00000000..bf55a152 --- /dev/null +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/ChooseServer.java @@ -0,0 +1,99 @@ +package top.hcode.hoj.judge; + +import com.alibaba.cloud.nacos.NacosDiscoveryProperties; +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 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.Transactional; +import top.hcode.hoj.pojo.entity.JudgeServer; +import top.hcode.hoj.service.impl.JudgeServerServiceImpl; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * @Author: Himit_ZH + * @Date: 2021/5/24 17:30 + * @Description: 筛选可用判题机 + */ +@Component +@Slf4j(topic = "hoj") +public class ChooseServer { + + @Autowired + private NacosDiscoveryProperties discoveryProperties; + + @Value("${service-url.name}") + private String JudgeServiceName; + + @Autowired + private JudgeServerServiceImpl judgeServerService; + + /** + * @param + * @MethodName chooseServer + * @Description 选择可以用调用判题的判题服务器 + * @Return + * @Since 2021/4/15 + */ + @Transactional + public JudgeServer choose(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") + .last("for update"); // 开启悲观锁 + 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(); + } + } + +} \ No newline at end of file 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/Dispatcher.java similarity index 66% rename from hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/JudgeServerUtils.java rename to hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/Dispatcher.java index c49eae44..fb4769d9 100644 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/JudgeServerUtils.java +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/Dispatcher.java @@ -1,15 +1,9 @@ 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; @@ -21,13 +15,9 @@ import top.hcode.hoj.service.impl.JudgeServiceImpl; import top.hcode.hoj.service.impl.RemoteJudgeAccountServiceImpl; 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; @@ -38,13 +28,7 @@ import java.util.concurrent.atomic.AtomicInteger; */ @Component @Slf4j(topic = "hoj") -public class JudgeServerUtils { - - @Autowired - private NacosDiscoveryProperties discoveryProperties; - - @Value("${service-url.name}") - private String JudgeServiceName; +public class Dispatcher { @Autowired private RestTemplate restTemplate; @@ -55,6 +39,9 @@ public class JudgeServerUtils { @Autowired private JudgeServiceImpl judgeService; + @Autowired + private ChooseServer chooseServer; + @Autowired private RemoteJudgeAccountServiceImpl remoteJudgeAccountService; @@ -73,7 +60,7 @@ public class JudgeServerUtils { return null; } - @Transactional(isolation = Isolation.READ_COMMITTED) + public void toJudge(String path, ToJudge data, Long submitId, Boolean isRemote) { // 尝试30s ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); @@ -82,19 +69,7 @@ public class JudgeServerUtils { @Override public void run() { count.getAndIncrement(); - JudgeServer judgeServer = chooseServer(isRemote); - if (count.get() == 30) { // 30次失败则判为提交失败 - if (isRemote) { // 远程判题需要将账号归为可用 - UpdateWrapper remoteJudgeAccountUpdateWrapper = new UpdateWrapper<>(); - remoteJudgeAccountUpdateWrapper - .eq("username", data.getUsername()) - .eq("password", data.getPassword()) - .set("status", true); - remoteJudgeAccountService.update(remoteJudgeAccountUpdateWrapper); - } - checkResult(null, submitId); - scheduler.shutdown(); - } + JudgeServer judgeServer = chooseServer.choose(isRemote); if (judgeServer != null) { // 获取到判题机资源 CommonResult result = null; try { @@ -108,15 +83,28 @@ public class JudgeServerUtils { scheduler.shutdown(); } } + + if (count.get() == 30) { // 30次失败则判为提交失败 + if (isRemote) { // 远程判题需要将账号归为可用 + UpdateWrapper remoteJudgeAccountUpdateWrapper = new UpdateWrapper<>(); + remoteJudgeAccountUpdateWrapper + .eq("username", data.getUsername()) + .eq("password", data.getPassword()) + .set("status", true); + remoteJudgeAccountService.update(remoteJudgeAccountUpdateWrapper); + } + checkResult(null, submitId); + 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); + JudgeServer judgeServer = chooseServer.choose(false); if (judgeServer != null) { try { result = restTemplate.postForObject("http://" + judgeServer.getUrl() + path, data, CommonResult.class); @@ -130,63 +118,6 @@ public class JudgeServerUtils { 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) { @@ -199,6 +130,7 @@ public class JudgeServerUtils { } else { if (result.getStatus().intValue() != CommonResult.STATUS_SUCCESS) { // 如果是结果码不是200 说明调用有错误 // 判为系统错误 + System.out.println("进来了"); judge.setStatus(Constants.Judge.STATUS_SYSTEM_ERROR.getStatus()) .setErrorMessage(result.getMsg()); judgeService.updateById(judge); @@ -207,7 +139,6 @@ public class JudgeServerUtils { } - @Transactional(isolation = Isolation.READ_COMMITTED) public void reduceCurrentTaskNum(Integer id) { UpdateWrapper judgeServerUpdateWrapper = new UpdateWrapper<>(); judgeServerUpdateWrapper.setSql("task_number = task_number-1").eq("id", id); @@ -217,7 +148,6 @@ public class JudgeServerUtils { } } - @Transactional(isolation = Isolation.READ_COMMITTED) public void tryAgainUpdate(UpdateWrapper updateWrapper) { boolean retryable; int attemptNumber = 0; 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 945b32f1..806d3aa2 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,12 +6,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Isolation; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.StringUtils; -import top.hcode.hoj.judge.JudgeServerUtils; +import top.hcode.hoj.judge.Dispatcher; import top.hcode.hoj.pojo.entity.Judge; -import top.hcode.hoj.pojo.entity.JudgeServer; import top.hcode.hoj.pojo.entity.RemoteJudgeAccount; import top.hcode.hoj.pojo.entity.ToJudge; import top.hcode.hoj.service.impl.JudgeServiceImpl; @@ -23,7 +19,6 @@ import java.util.List; import java.util.concurrent.TimeUnit; @Component -@Async public class RemoteJudgeReceiver { @@ -34,7 +29,7 @@ public class RemoteJudgeReceiver { private JudgeServiceImpl judgeService; @Autowired - private JudgeServerUtils judgeServerUtils; + private Dispatcher dispatcher; @Autowired private RedisUtils redisUtils; @@ -42,7 +37,7 @@ public class RemoteJudgeReceiver { @Autowired private RemoteJudgeAccountServiceImpl remoteJudgeAccountService; - @Transactional(isolation = Isolation.READ_COMMITTED) + @Async("judgeTaskAsyncPool") public void processWaitingTask() { // 如果队列中还有任务,则继续处理 if (redisUtils.lGetListSize(Constants.Judge.STATUS_REMOTE_JUDGE_WAITING_HANDLE.getName()) > 0) { @@ -54,7 +49,6 @@ public class RemoteJudgeReceiver { } } - @Transactional(isolation = Isolation.READ_COMMITTED) public void handleJudgeMsg(String taskJsonStr) { JSONObject task = JSONUtil.parseObj(taskJsonStr); @@ -88,7 +82,7 @@ public class RemoteJudgeReceiver { if (account != null) { // 如果获取到账号 // 调用判题服务 - judgeServerUtils.dispatcher("judge", "/remote-judge", new ToJudge() + dispatcher.dispatcher("judge", "/remote-judge", new ToJudge() .setJudge(judge) .setToken(token) .setRemoteJudge(remoteJudge) 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 399921ba..2b23cb3a 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 @@ -6,10 +6,9 @@ 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.judge.JudgeServerUtils; +import top.hcode.hoj.judge.Dispatcher; import top.hcode.hoj.pojo.entity.Judge; import top.hcode.hoj.pojo.entity.ToJudge; -import top.hcode.hoj.service.impl.JudgeServiceImpl; import top.hcode.hoj.utils.Constants; import top.hcode.hoj.utils.RedisUtils; @@ -25,12 +24,12 @@ import top.hcode.hoj.utils.RedisUtils; public class JudgeReceiver { @Autowired - private JudgeServerUtils judgeServerUtils; + private Dispatcher dispatcher; @Autowired private RedisUtils redisUtils; - @Async + @Async("judgeTaskAsyncPool") public void processWaitingTask() { // 如果队列中还有任务,则继续处理 if (redisUtils.lGetListSize(Constants.Judge.STATUS_JUDGE_WAITING.getName()) > 0) { @@ -48,9 +47,8 @@ public class JudgeReceiver { Judge judge = task.get("judge", Judge.class); String token = task.getStr("token"); Integer tryAgainNum = task.getInt("tryAgainNum"); - // 调用判题服务 - judgeServerUtils.dispatcher("judge", "/judge", new ToJudge() + dispatcher.dispatcher("judge", "/judge", new ToJudge() .setJudge(judge) .setToken(token) .setRemoteJudge(null) diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/pojo/vo/ConfigVo.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/pojo/vo/ConfigVo.java index 0ab84284..4f0e5300 100644 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/pojo/vo/ConfigVo.java +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/pojo/vo/ConfigVo.java @@ -21,7 +21,7 @@ public class ConfigVo { @Value("${hoj.db.username}") private String mysqlUsername; - @Value("${hoj.db.password:hoj123456}") + @Value("${hoj.db.password}") private String mysqlPassword; @Value("${hoj.db.name}") 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 index 33c9c4ec..40370990 100644 --- 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 @@ -8,6 +8,8 @@ import top.hcode.hoj.dao.JudgeServerMapper; import top.hcode.hoj.pojo.entity.JudgeServer; import top.hcode.hoj.service.JudgeServerService; +import java.util.List; + /** * @Author: Himit_ZH * @Date: 2021/4/15 11:27 @@ -16,5 +18,4 @@ import top.hcode.hoj.service.JudgeServerService; @Service public class JudgeServerServiceImpl extends ServiceImpl implements JudgeServerService { - } \ No newline at end of file diff --git a/hoj-springboot/DataBackup/src/main/resources/bootstrap.yml b/hoj-springboot/DataBackup/src/main/resources/bootstrap.yml index 494a347b..dd12b478 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: ${BACKEND_SERVER_PORT:6688} # 本服务器启动的端口号 - nacos-url: ${NACOS_URL:172.20.0.4:8848} # nacos的地址 + nacos-url: ${NACOS_URL:129.204.177.72:8848} # nacos的地址 server: port: ${hoj-backstage.port} spring: diff --git a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/JudgeServerApplication.java b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/JudgeServerApplication.java index b05d9ba0..115e2e3f 100644 --- a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/JudgeServerApplication.java +++ b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/JudgeServerApplication.java @@ -4,6 +4,7 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.transaction.annotation.EnableTransactionManagement; /** * @Author: Himit_ZH @@ -13,6 +14,7 @@ import org.springframework.scheduling.annotation.EnableAsync; @EnableDiscoveryClient @SpringBootApplication @EnableAsync(proxyTargetClass=true) //开启异步注解 +@EnableTransactionManagement public class JudgeServerApplication { public static void main(String[] args) { SpringApplication.run(JudgeServerApplication.class,args); diff --git a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/config/AsyncTaskConfig.java b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/config/AsyncTaskConfig.java index c64105d8..ec77a4bc 100644 --- a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/config/AsyncTaskConfig.java +++ b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/config/AsyncTaskConfig.java @@ -24,6 +24,8 @@ public class AsyncTaskConfig implements AsyncConfigurer { taskExecutor.setMaxPoolSize(50); // 缓存队列 taskExecutor.setQueueCapacity(200); + //活跃时间 + taskExecutor.setKeepAliveSeconds(10); // 对拒绝task的处理策略 //(1) 默认的ThreadPoolExecutor.AbortPolicy 处理程序遭到拒绝将抛出运行时RejectedExecutionException; //(2) ThreadPoolExecutor.CallerRunsPolicy 线程调用运行该任务的 execute 本身。此策略提供简单的反馈控制机制,能够减缓新任务的提交速度 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 index 0fa66312..d287f039 100644 --- 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 @@ -61,7 +61,6 @@ public class StartupRunner implements CommandLineRunner { .setCpuCore(cpuNum) .setIp(ip) .setPort(port) - .setVersion(0L) .setUrl(ip + ":" + port) .setMaxTaskNumber(maxTaskNum) .setIsRemote(false) @@ -75,7 +74,6 @@ public class StartupRunner implements CommandLineRunner { .setCpuCore(cpuNum) .setIp(ip) .setPort(port) - .setVersion(0L) .setUrl(ip + ":" + port) .setMaxTaskNumber(maxRemoteTaskNum) .setIsRemote(true) diff --git a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/util/Constants.java b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/util/Constants.java index b87b40a2..62a5474b 100644 --- a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/util/Constants.java +++ b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/util/Constants.java @@ -153,7 +153,7 @@ public class Constants { PYTHON2("Python2", "main.py", "main.pyc", 3000L, 10000L, 128 * 1024 * 1024L, "/usr/bin/python -m py_compile ./{1}", defaultEnv), - PYTHON3("Python3", "main.py", "__pycache__/main.cpython-37.pyc", 3000L, 10000L, 128 * 1024 * 1024L, "/usr/bin/python3 -m py_compile ./{1}", defaultEnv), + PYTHON3("Python3", "main.py", "__pycache__/main.cpython-36.pyc", 3000L, 10000L, 128 * 1024 * 1024L, "/usr/bin/python3 -m py_compile ./{1}", defaultEnv), GOLANG("Golang", "main.go", "main", 3000L, 5000L, 512 * 1024 * 1024L, "/usr/bin/go build -o {2} {1}", defaultEnv), diff --git a/hoj-springboot/JudgeServer/src/main/resources/application.yml b/hoj-springboot/JudgeServer/src/main/resources/application.yml index a9711786..ba3896f3 100644 --- a/hoj-springboot/JudgeServer/src/main/resources/application.yml +++ b/hoj-springboot/JudgeServer/src/main/resources/application.yml @@ -40,7 +40,7 @@ logging: nacos: error root: error config: classpath:logback-spring.xml - path: /hoj/log/backend/hoj_judgeserver.log + path: /hoj/log/judgeserver/hoj_judgeserver.log # 暴露监控 management: endpoints: diff --git a/hoj-springboot/api/src/main/java/top/hcode/hoj/pojo/entity/JudgeServer.java b/hoj-springboot/api/src/main/java/top/hcode/hoj/pojo/entity/JudgeServer.java index 0c5b3df6..4ebd6458 100644 --- a/hoj-springboot/api/src/main/java/top/hcode/hoj/pojo/entity/JudgeServer.java +++ b/hoj-springboot/api/src/main/java/top/hcode/hoj/pojo/entity/JudgeServer.java @@ -48,10 +48,6 @@ public class JudgeServer { @ApiModelProperty(value = "0可用,1不可用") private Integer status; - @Version - @TableField(fill = FieldFill.INSERT) - private Long version; - @ApiModelProperty(value = "是否为远程判题vj") private Boolean isRemote; diff --git a/hoj-springboot/api/target/api-1.0-SNAPSHOT.jar b/hoj-springboot/api/target/api-1.0-SNAPSHOT.jar new file mode 100644 index 00000000..af65c9c2 Binary files /dev/null and b/hoj-springboot/api/target/api-1.0-SNAPSHOT.jar differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Announcement.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Announcement.class new file mode 100644 index 00000000..36004d99 Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Announcement.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Auth.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Auth.class new file mode 100644 index 00000000..d5996f18 Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Auth.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Category.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Category.class new file mode 100644 index 00000000..4fc72fab Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Category.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/CodeTemplate.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/CodeTemplate.class new file mode 100644 index 00000000..3d5e10b1 Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/CodeTemplate.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Comment.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Comment.class new file mode 100644 index 00000000..1bb35cb2 Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Comment.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/CommentLike.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/CommentLike.class new file mode 100644 index 00000000..0df2527c Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/CommentLike.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/CompileSpj.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/CompileSpj.class new file mode 100644 index 00000000..52ec5010 Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/CompileSpj.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Contest.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Contest.class new file mode 100644 index 00000000..0e8fc3a6 Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Contest.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ContestAnnouncement.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ContestAnnouncement.class new file mode 100644 index 00000000..5581780e Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ContestAnnouncement.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ContestExplanation.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ContestExplanation.class new file mode 100644 index 00000000..bc414a88 Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ContestExplanation.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ContestProblem.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ContestProblem.class new file mode 100644 index 00000000..b459b9f3 Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ContestProblem.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ContestRecord.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ContestRecord.class new file mode 100644 index 00000000..4c48f987 Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ContestRecord.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ContestRegister.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ContestRegister.class new file mode 100644 index 00000000..cb20434c Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ContestRegister.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ContestScore.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ContestScore.class new file mode 100644 index 00000000..ce66680e Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ContestScore.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Discussion.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Discussion.class new file mode 100644 index 00000000..86489c1e Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Discussion.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/DiscussionLike.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/DiscussionLike.class new file mode 100644 index 00000000..e030d276 Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/DiscussionLike.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/DiscussionReport.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/DiscussionReport.class new file mode 100644 index 00000000..6ace4d85 Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/DiscussionReport.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/File.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/File.class new file mode 100644 index 00000000..23fd2920 Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/File.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Judge.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Judge.class new file mode 100644 index 00000000..167aad2f Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Judge.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/JudgeCase.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/JudgeCase.class new file mode 100644 index 00000000..b717a471 Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/JudgeCase.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/JudgeServer.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/JudgeServer.class new file mode 100644 index 00000000..00b5b288 Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/JudgeServer.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Language.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Language.class new file mode 100644 index 00000000..d33b355c Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Language.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Problem.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Problem.class new file mode 100644 index 00000000..846aee7a Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Problem.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ProblemCase.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ProblemCase.class new file mode 100644 index 00000000..c695539e Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ProblemCase.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ProblemCount.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ProblemCount.class new file mode 100644 index 00000000..a5cb727e Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ProblemCount.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ProblemLanguage.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ProblemLanguage.class new file mode 100644 index 00000000..990b5fa7 Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ProblemLanguage.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ProblemTag.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ProblemTag.class new file mode 100644 index 00000000..5e7f1ec5 Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ProblemTag.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/RemoteJudgeAccount.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/RemoteJudgeAccount.class new file mode 100644 index 00000000..eca9d2d9 Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/RemoteJudgeAccount.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Reply.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Reply.class new file mode 100644 index 00000000..55e97c0f Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Reply.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Role.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Role.class new file mode 100644 index 00000000..38f2a720 Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Role.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/RoleAuth.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/RoleAuth.class new file mode 100644 index 00000000..d8ea182e Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/RoleAuth.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Session.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Session.class new file mode 100644 index 00000000..82b83203 Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Session.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Tag.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Tag.class new file mode 100644 index 00000000..07aeb912 Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/Tag.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ToJudge.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ToJudge.class new file mode 100644 index 00000000..9ea36f68 Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/ToJudge.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/UserAcproblem.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/UserAcproblem.class new file mode 100644 index 00000000..7fd137c9 Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/UserAcproblem.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/UserInfo.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/UserInfo.class new file mode 100644 index 00000000..6f0d4d33 Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/UserInfo.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/UserRecord.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/UserRecord.class new file mode 100644 index 00000000..82744d38 Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/UserRecord.class differ diff --git a/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/UserRole.class b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/UserRole.class new file mode 100644 index 00000000..8de71364 Binary files /dev/null and b/hoj-springboot/api/target/classes/top/hcode/hoj/pojo/entity/UserRole.class differ diff --git a/hoj-springboot/api/target/maven-archiver/pom.properties b/hoj-springboot/api/target/maven-archiver/pom.properties new file mode 100644 index 00000000..d26bbfba --- /dev/null +++ b/hoj-springboot/api/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Mon May 24 19:05:59 CST 2021 +version=1.0-SNAPSHOT +groupId=top.hcode +artifactId=api diff --git a/hoj-springboot/api/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/hoj-springboot/api/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 00000000..5ef1190e --- /dev/null +++ b/hoj-springboot/api/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,29 @@ +top\hcode\hoj\pojo\entity\File.class +top\hcode\hoj\pojo\entity\UserInfo.class +top\hcode\hoj\pojo\entity\ContestRegister.class +top\hcode\hoj\pojo\entity\Session.class +top\hcode\hoj\pojo\entity\RoleAuth.class +top\hcode\hoj\pojo\entity\Discussion.class +top\hcode\hoj\pojo\entity\RemoteJudgeAccount.class +top\hcode\hoj\pojo\entity\Role.class +top\hcode\hoj\pojo\entity\ContestExplanation.class +top\hcode\hoj\pojo\entity\ToJudge.class +top\hcode\hoj\pojo\entity\ContestProblem.class +top\hcode\hoj\pojo\entity\DiscussionLike.class +top\hcode\hoj\pojo\entity\ProblemTag.class +top\hcode\hoj\pojo\entity\Problem.class +top\hcode\hoj\pojo\entity\Tag.class +top\hcode\hoj\pojo\entity\ProblemLanguage.class +top\hcode\hoj\pojo\entity\DiscussionReport.class +top\hcode\hoj\pojo\entity\UserRecord.class +top\hcode\hoj\pojo\entity\ContestScore.class +top\hcode\hoj\pojo\entity\ProblemCase.class +top\hcode\hoj\pojo\entity\ProblemCount.class +top\hcode\hoj\pojo\entity\Judge.class +top\hcode\hoj\pojo\entity\ContestRecord.class +top\hcode\hoj\pojo\entity\Language.class +top\hcode\hoj\pojo\entity\JudgeCase.class +top\hcode\hoj\pojo\entity\JudgeServer.class +top\hcode\hoj\pojo\entity\UserAcproblem.class +top\hcode\hoj\pojo\entity\UserRole.class +top\hcode\hoj\pojo\entity\Reply.class diff --git a/hoj-springboot/api/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/hoj-springboot/api/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 00000000..a4607ceb --- /dev/null +++ b/hoj-springboot/api/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,38 @@ +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\Announcement.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\Auth.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\Discussion.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\UserInfo.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\ProblemCase.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\ContestScore.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\DiscussionReport.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\CommentLike.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\DiscussionLike.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\RemoteJudgeAccount.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\Tag.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\UserAcproblem.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\ProblemLanguage.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\Comment.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\ProblemCount.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\ContestRegister.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\Session.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\CodeTemplate.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\Contest.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\JudgeCase.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\UserRecord.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\RoleAuth.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\ToJudge.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\CompileSpj.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\ProblemTag.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\Language.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\ContestRecord.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\Judge.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\Problem.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\UserRole.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\File.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\Category.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\ContestAnnouncement.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\Reply.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\Role.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\JudgeServer.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\ContestProblem.java +E:\code\Gitee\hoj\hoj-springboot\api\src\main\java\top\hcode\hoj\pojo\entity\ContestExplanation.java