diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..b358abe --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "proto"] + path = proto + url = https://git.sch9.ru/new_gate/contracts diff --git a/Makefile b/Makefile index 22909bb..dc8a3ab 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,9 @@ +gen: + @buf generate proto/tester dev: - @buf generate proto + @make gen @go run main.go build: - @buf generate proto + @make gen # TODO: build dockerfile diff --git a/buf.gen.yaml b/buf.gen.yaml index d5b53a4..7a3b53b 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -2,7 +2,7 @@ version: v1 managed: enabled: true go_package_prefix: - default: ms-auth/pkg/go/gen + default: ./pkg/go/gen plugins: - name: go out: pkg/go/gen diff --git a/proto b/proto new file mode 160000 index 0000000..2a46d71 --- /dev/null +++ b/proto @@ -0,0 +1 @@ +Subproject commit 2a46d71423d3850a27b225f3780cd30497b591da diff --git a/proto/tester/v1/tester.proto b/proto/tester/v1/tester.proto deleted file mode 100644 index cd1ed33..0000000 --- a/proto/tester/v1/tester.proto +++ /dev/null @@ -1,62 +0,0 @@ -syntax = "proto3"; - -package proto.tester.v1; - -import "google/protobuf/timestamp.proto"; -import "google/protobuf/empty.proto"; - -service TesterService { - rpc CreateProblem (CreateProblemRequest) returns (CreateProblemResponse); - rpc ReadProblem (ReadProblemRequest) returns (ReadProblemResponse); - rpc UpdateProblem (UpdateProblemRequest) returns (google.protobuf.Empty); - rpc DeleteProblem (DeleteProblemRequest) returns (google.protobuf.Empty); -} - -message CreateProblemRequest { - message Problem { - string name = 1; - string description = 2; - int32 time_limit = 3; - int32 memory_limit = 4; - } - string token = 1; - Problem problem = 2; -} -message CreateProblemResponse { - int32 id = 1; -} - -message ReadProblemRequest { - string token = 1; - int32 id = 2; -} -message ReadProblemResponse { - message Problem { - int32 id = 1; - string name = 2; - string description = 3; - int32 time_limit = 4; - int32 memory_limit = 5; - google.protobuf.Timestamp created_at = 6; - google.protobuf.Timestamp updated_at = 7; - } - string token = 1; - Problem problem = 2; -} - -message UpdateProblemRequest { - message Problem { - int32 id = 1; - optional string name = 2; - optional string description = 3; - optional int32 time_limit = 4; - optional int32 memory_limit = 5; - } - string token = 1; - Problem problem = 2; -} - -message DeleteProblemRequest { - string token = 1; - int32 id = 2; -} \ No newline at end of file