Skip to content

Commit

Permalink
build: docker-compose.yml交给judge-server维护
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzhanglong committed Sep 13, 2020
1 parent 101eb80 commit 04c3de0
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 32 deletions.
1 change: 0 additions & 1 deletion deploy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& chmod 777 -R /home/judgeEnvironment/scripts \
&& chmod 777 /entrypoint.sh


# 暴露8080端口
EXPOSE 8080
ENTRYPOINT ["./entrypoint.sh"]
1 change: 0 additions & 1 deletion deploy/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ mkdir build
cp -r src/main/java/com/yzl/judgehost/scripts build
cp target/YuJudge-JudgeHost-1.0.jar build/app.jar
cp deploy/Dockerfile build
cp deploy/docker-compose.yml build
cp deploy/entrypoint.sh build
23 changes: 0 additions & 23 deletions deploy/docker-compose.yml

This file was deleted.

28 changes: 28 additions & 0 deletions src/main/java/com/yzl/judgehost/controller/v1/BaseController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.yzl.judgehost.controller.v1;

import com.yzl.judgehost.core.common.UnifiedResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* 增加 baseController
*
* @author yuzhanglong
* @date 2020-9-13 17:51:40
*/

@RestController
public class BaseController {

/**
* 欢迎 -- 表示部署成功
*
* @author yuzhanglong
* @date 2020-9-13 17:56:20
*/

@GetMapping("/")
public UnifiedResponse getWelcomeText() {
return new UnifiedResponse("Your project is running successfully! O(∩_∩)O");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;

/**
* 一般功能性接口
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.yzl.judgehost.controller.v1;

import com.yzl.judgehost.core.authorization.AuthorizationRequired;
import com.yzl.judgehost.dto.JudgeDTO;
import com.yzl.judgehost.exception.http.ForbiddenException;
import com.yzl.judgehost.service.JudgeService;
Expand Down Expand Up @@ -38,7 +37,6 @@ public JudgeController(JudgeService judgeService) {
* @date 2020-7-1 21:00
*/
@PostMapping("/result")
@AuthorizationRequired
public JudgeConditionVO runJudge(@RequestBody @Validated JudgeDTO judgeDTO) throws ExecutionException, InterruptedException {
CompletableFuture<JudgeConditionVO> judgeResults;
try {
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/com/yzl/judgehost/service/CommonService.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
import com.yzl.judgehost.core.configuration.JudgeEnvironmentConfiguration;
import com.yzl.judgehost.core.configuration.JudgeExecutorConfiguration;
import com.yzl.judgehost.exception.http.ForbiddenException;
import com.yzl.judgehost.utils.FileUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import java.io.IOException;
import java.lang.management.ManagementFactory;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public JudgeCache(RedisOperations redisOperations) {
public void addSolutionRemoteUrlToLocalMap(String remotePath, Map<String, String> localPaths) {
// 写数据时我们不允许读,更不允许写,因此我们使用读写锁
readWriteLock.writeLock().lock();
redisOperations.setHashMap(SOLUTION_REMOTE_URL_TO_LOCAL_MAP_REDIS_SAVE_PREFIX, remotePath, localPaths);
boolean isSet = redisOperations.setHashMap(SOLUTION_REMOTE_URL_TO_LOCAL_MAP_REDIS_SAVE_PREFIX, remotePath, localPaths);
readWriteLock.writeLock().unlock();
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/yzl/judgehost/utils/TokenUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static String generateAuthToken(String userId, String secretKey, Integer
* now: 当前时间
* expiredIn: 过期时间
*
* @return map 返回一系列kv对,具体内容查看 @description
* @return map 返回一系列kv对,具体内容查看
* @author yuzhanglong
*/
public static Map<String, Date> calculateExpiredInfo(Integer expiredIn) {
Expand Down

0 comments on commit 04c3de0

Please sign in to comment.