From 4dbefcb627e633257e21419de1321202562ab1ff Mon Sep 17 00:00:00 2001 From: cranemont Date: Thu, 29 Dec 2022 22:03:16 +0900 Subject: [PATCH 1/2] chore: scaffold file connector --- connector/file/connector.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 connector/file/connector.go diff --git a/connector/file/connector.go b/connector/file/connector.go new file mode 100644 index 0000000..6e2ad20 --- /dev/null +++ b/connector/file/connector.go @@ -0,0 +1,29 @@ +package file + +import ( + "github.com/cranemont/judge-manager/router" + "github.com/cranemont/judge-manager/service/file" + "github.com/cranemont/judge-manager/service/logger" +) + +type connector struct { + file file.FileManager + router router.Router + logger logger.Logger +} + +func NewConnector(f file.FileManager, r router.Router, l logger.Logger) *connector { + return &connector{f, r, l} +} + +func (c *connector) Connect() { + // validate file source +} + +func (c *connector) Disconnect() { + // relaese resources +} + +func (c *connector) Handle() { + +} From b4cfa84e594139da599726c44de37ecbbc39c59d Mon Sep 17 00:00:00 2001 From: cranemont Date: Thu, 29 Dec 2022 22:03:31 +0900 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20file=20connector=EC=9A=A9=20?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- connector/file/data/script.json | 5 +++++ connector/file/data/submission_1.json | 7 +++++++ connector/file/data/testcase_1.json | 27 +++++++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 connector/file/data/script.json create mode 100644 connector/file/data/submission_1.json create mode 100644 connector/file/data/testcase_1.json diff --git a/connector/file/data/script.json b/connector/file/data/script.json new file mode 100644 index 0000000..785d828 --- /dev/null +++ b/connector/file/data/script.json @@ -0,0 +1,5 @@ +{ + "mode": "judge", + "policy": "temporal", + "dir": "./data" +} \ No newline at end of file diff --git a/connector/file/data/submission_1.json b/connector/file/data/submission_1.json new file mode 100644 index 0000000..7eeedde --- /dev/null +++ b/connector/file/data/submission_1.json @@ -0,0 +1,7 @@ +{ + "problemId": 1, + "code": "#include\n\n int main () {\n int a;\n scanf(\"%d\\n\", &a);\n printf(\"%d\\n\", a);\n}\n", + "language": "C", + "timeLimit": 1000, + "memoryLimit": 268435456 +} \ No newline at end of file diff --git a/connector/file/data/testcase_1.json b/connector/file/data/testcase_1.json new file mode 100644 index 0000000..c0d041e --- /dev/null +++ b/connector/file/data/testcase_1.json @@ -0,0 +1,27 @@ +[ + { + "id": 1, + "input": 1, + "output": 1 + }, + { + "id": 1, + "input": 22, + "output": 22 + }, + { + "id": 1, + "input": 333, + "output": 333 + }, + { + "id": 1, + "input": 4444, + "output": 4444 + }, + { + "id": 1, + "input": 55555, + "output": 55555 + } +] \ No newline at end of file