chore: updated grpc stubs
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package auth;
|
||||
|
||||
option go_package = "pkg/api/auth";
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package competition;
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
option go_package = "pkg/api/competition";
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package submission;
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
option go_package = "pkg/api/submission";
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package task;
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
option go_package = "pkg/api/task";
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package user;
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
+51
-551
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.10
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc v6.33.2
|
||||
// source: api/proto/auth.proto
|
||||
|
||||
@@ -221,26 +221,27 @@ func (x *SignInResponse) GetToken() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
type GetMeRequest struct {
|
||||
type ValidateTokenRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetMeRequest) Reset() {
|
||||
*x = GetMeRequest{}
|
||||
func (x *ValidateTokenRequest) Reset() {
|
||||
*x = ValidateTokenRequest{}
|
||||
mi := &file_api_proto_auth_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetMeRequest) String() string {
|
||||
func (x *ValidateTokenRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetMeRequest) ProtoMessage() {}
|
||||
func (*ValidateTokenRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetMeRequest) ProtoReflect() protoreflect.Message {
|
||||
func (x *ValidateTokenRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_auth_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@@ -252,77 +253,40 @@ func (x *GetMeRequest) ProtoReflect() protoreflect.Message {
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetMeRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetMeRequest) Descriptor() ([]byte, []int) {
|
||||
// Deprecated: Use ValidateTokenRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ValidateTokenRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_auth_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
type GetMeResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetMeResponse) Reset() {
|
||||
*x = GetMeResponse{}
|
||||
mi := &file_api_proto_auth_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetMeResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetMeResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetMeResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_auth_proto_msgTypes[5]
|
||||
func (x *ValidateTokenRequest) GetToken() string {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
return x.Token
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
return ""
|
||||
}
|
||||
|
||||
// Deprecated: Use GetMeResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetMeResponse) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_auth_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *GetMeResponse) GetUser() *User {
|
||||
if x != nil {
|
||||
return x.User
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type GetUserRequest struct {
|
||||
type ValidateTokenResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetUserRequest) Reset() {
|
||||
*x = GetUserRequest{}
|
||||
mi := &file_api_proto_auth_proto_msgTypes[6]
|
||||
func (x *ValidateTokenResponse) Reset() {
|
||||
*x = ValidateTokenResponse{}
|
||||
mi := &file_api_proto_auth_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetUserRequest) String() string {
|
||||
func (x *ValidateTokenResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetUserRequest) ProtoMessage() {}
|
||||
func (*ValidateTokenResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetUserRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_auth_proto_msgTypes[6]
|
||||
func (x *ValidateTokenResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_auth_proto_msgTypes[5]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -333,426 +297,18 @@ func (x *GetUserRequest) ProtoReflect() protoreflect.Message {
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetUserRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetUserRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_auth_proto_rawDescGZIP(), []int{6}
|
||||
// Deprecated: Use ValidateTokenResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ValidateTokenResponse) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_auth_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *GetUserRequest) GetUserId() string {
|
||||
func (x *ValidateTokenResponse) GetUserId() string {
|
||||
if x != nil {
|
||||
return x.UserId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type GetUserResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetUserResponse) Reset() {
|
||||
*x = GetUserResponse{}
|
||||
mi := &file_api_proto_auth_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetUserResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetUserResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetUserResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_auth_proto_msgTypes[7]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetUserResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetUserResponse) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_auth_proto_rawDescGZIP(), []int{7}
|
||||
}
|
||||
|
||||
func (x *GetUserResponse) GetUser() *User {
|
||||
if x != nil {
|
||||
return x.User
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type GetMyStatRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetMyStatRequest) Reset() {
|
||||
*x = GetMyStatRequest{}
|
||||
mi := &file_api_proto_auth_proto_msgTypes[8]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetMyStatRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetMyStatRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetMyStatRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_auth_proto_msgTypes[8]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetMyStatRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetMyStatRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_auth_proto_rawDescGZIP(), []int{8}
|
||||
}
|
||||
|
||||
type GetMyStatResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Stat *Stat `protobuf:"bytes,1,opt,name=stat,proto3" json:"stat,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetMyStatResponse) Reset() {
|
||||
*x = GetMyStatResponse{}
|
||||
mi := &file_api_proto_auth_proto_msgTypes[9]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetMyStatResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetMyStatResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetMyStatResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_auth_proto_msgTypes[9]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetMyStatResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetMyStatResponse) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_auth_proto_rawDescGZIP(), []int{9}
|
||||
}
|
||||
|
||||
func (x *GetMyStatResponse) GetStat() *Stat {
|
||||
if x != nil {
|
||||
return x.Stat
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type GetLeaderboardRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetLeaderboardRequest) Reset() {
|
||||
*x = GetLeaderboardRequest{}
|
||||
mi := &file_api_proto_auth_proto_msgTypes[10]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetLeaderboardRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetLeaderboardRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetLeaderboardRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_auth_proto_msgTypes[10]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetLeaderboardRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetLeaderboardRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_auth_proto_rawDescGZIP(), []int{10}
|
||||
}
|
||||
|
||||
type GetLeaderboardResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Users []*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetLeaderboardResponse) Reset() {
|
||||
*x = GetLeaderboardResponse{}
|
||||
mi := &file_api_proto_auth_proto_msgTypes[11]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetLeaderboardResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetLeaderboardResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetLeaderboardResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_auth_proto_msgTypes[11]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetLeaderboardResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetLeaderboardResponse) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_auth_proto_rawDescGZIP(), []int{11}
|
||||
}
|
||||
|
||||
func (x *GetLeaderboardResponse) GetUsers() []*User {
|
||||
if x != nil {
|
||||
return x.Users
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type User struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id *string `protobuf:"bytes,1,opt,name=id,proto3,oneof" json:"id,omitempty"`
|
||||
Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"`
|
||||
Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"`
|
||||
Avatar *string `protobuf:"bytes,4,opt,name=avatar,proto3,oneof" json:"avatar,omitempty"`
|
||||
CreatedAt string `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
|
||||
Achievements []*UserAchievement `protobuf:"bytes,6,rep,name=achievements,proto3" json:"achievements,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *User) Reset() {
|
||||
*x = User{}
|
||||
mi := &file_api_proto_auth_proto_msgTypes[12]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *User) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*User) ProtoMessage() {}
|
||||
|
||||
func (x *User) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_auth_proto_msgTypes[12]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use User.ProtoReflect.Descriptor instead.
|
||||
func (*User) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_auth_proto_rawDescGZIP(), []int{12}
|
||||
}
|
||||
|
||||
func (x *User) GetId() string {
|
||||
if x != nil && x.Id != nil {
|
||||
return *x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *User) GetEmail() string {
|
||||
if x != nil {
|
||||
return x.Email
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *User) GetUsername() string {
|
||||
if x != nil {
|
||||
return x.Username
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *User) GetAvatar() string {
|
||||
if x != nil && x.Avatar != nil {
|
||||
return *x.Avatar
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *User) GetCreatedAt() string {
|
||||
if x != nil {
|
||||
return x.CreatedAt
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *User) GetAchievements() []*UserAchievement {
|
||||
if x != nil {
|
||||
return x.Achievements
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type UserAchievement struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
|
||||
Icon string `protobuf:"bytes,3,opt,name=icon,proto3" json:"icon,omitempty"`
|
||||
ReceivedAt string `protobuf:"bytes,4,opt,name=received_at,json=receivedAt,proto3" json:"received_at,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *UserAchievement) Reset() {
|
||||
*x = UserAchievement{}
|
||||
mi := &file_api_proto_auth_proto_msgTypes[13]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *UserAchievement) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*UserAchievement) ProtoMessage() {}
|
||||
|
||||
func (x *UserAchievement) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_auth_proto_msgTypes[13]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use UserAchievement.ProtoReflect.Descriptor instead.
|
||||
func (*UserAchievement) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_auth_proto_rawDescGZIP(), []int{13}
|
||||
}
|
||||
|
||||
func (x *UserAchievement) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *UserAchievement) GetDescription() string {
|
||||
if x != nil {
|
||||
return x.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *UserAchievement) GetIcon() string {
|
||||
if x != nil {
|
||||
return x.Icon
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *UserAchievement) GetReceivedAt() string {
|
||||
if x != nil {
|
||||
return x.ReceivedAt
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type Stat struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
TotalAttempts int32 `protobuf:"varint,1,opt,name=total_attempts,json=totalAttempts,proto3" json:"total_attempts,omitempty"`
|
||||
SolvedTasks int32 `protobuf:"varint,2,opt,name=solved_tasks,json=solvedTasks,proto3" json:"solved_tasks,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Stat) Reset() {
|
||||
*x = Stat{}
|
||||
mi := &file_api_proto_auth_proto_msgTypes[14]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Stat) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Stat) ProtoMessage() {}
|
||||
|
||||
func (x *Stat) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_auth_proto_msgTypes[14]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Stat.ProtoReflect.Descriptor instead.
|
||||
func (*Stat) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_auth_proto_rawDescGZIP(), []int{14}
|
||||
}
|
||||
|
||||
func (x *Stat) GetTotalAttempts() int32 {
|
||||
if x != nil {
|
||||
return x.TotalAttempts
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Stat) GetSolvedTasks() int32 {
|
||||
if x != nil {
|
||||
return x.SolvedTasks
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_api_proto_auth_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_api_proto_auth_proto_rawDesc = "" +
|
||||
@@ -768,50 +324,15 @@ const file_api_proto_auth_proto_rawDesc = "" +
|
||||
"\x05email\x18\x01 \x01(\tR\x05email\x12\x1a\n" +
|
||||
"\bpassword\x18\x02 \x01(\tR\bpassword\"&\n" +
|
||||
"\x0eSignInResponse\x12\x14\n" +
|
||||
"\x05token\x18\x01 \x01(\tR\x05token\"\x0e\n" +
|
||||
"\fGetMeRequest\"/\n" +
|
||||
"\rGetMeResponse\x12\x1e\n" +
|
||||
"\x04user\x18\x01 \x01(\v2\n" +
|
||||
".auth.UserR\x04user\")\n" +
|
||||
"\x0eGetUserRequest\x12\x17\n" +
|
||||
"\auser_id\x18\x01 \x01(\tR\x06userId\"1\n" +
|
||||
"\x0fGetUserResponse\x12\x1e\n" +
|
||||
"\x04user\x18\x01 \x01(\v2\n" +
|
||||
".auth.UserR\x04user\"\x12\n" +
|
||||
"\x10GetMyStatRequest\"3\n" +
|
||||
"\x11GetMyStatResponse\x12\x1e\n" +
|
||||
"\x04stat\x18\x01 \x01(\v2\n" +
|
||||
".auth.StatR\x04stat\"\x17\n" +
|
||||
"\x15GetLeaderboardRequest\":\n" +
|
||||
"\x16GetLeaderboardResponse\x12 \n" +
|
||||
"\x05users\x18\x01 \x03(\v2\n" +
|
||||
".auth.UserR\x05users\"\xd6\x01\n" +
|
||||
"\x04User\x12\x13\n" +
|
||||
"\x02id\x18\x01 \x01(\tH\x00R\x02id\x88\x01\x01\x12\x14\n" +
|
||||
"\x05email\x18\x02 \x01(\tR\x05email\x12\x1a\n" +
|
||||
"\busername\x18\x03 \x01(\tR\busername\x12\x1b\n" +
|
||||
"\x06avatar\x18\x04 \x01(\tH\x01R\x06avatar\x88\x01\x01\x12\x1d\n" +
|
||||
"\n" +
|
||||
"created_at\x18\x05 \x01(\tR\tcreatedAt\x129\n" +
|
||||
"\fachievements\x18\x06 \x03(\v2\x15.auth.UserAchievementR\fachievementsB\x05\n" +
|
||||
"\x03_idB\t\n" +
|
||||
"\a_avatar\"|\n" +
|
||||
"\x0fUserAchievement\x12\x12\n" +
|
||||
"\x04name\x18\x01 \x01(\tR\x04name\x12 \n" +
|
||||
"\vdescription\x18\x02 \x01(\tR\vdescription\x12\x12\n" +
|
||||
"\x04icon\x18\x03 \x01(\tR\x04icon\x12\x1f\n" +
|
||||
"\vreceived_at\x18\x04 \x01(\tR\n" +
|
||||
"receivedAt\"P\n" +
|
||||
"\x04Stat\x12%\n" +
|
||||
"\x0etotal_attempts\x18\x01 \x01(\x05R\rtotalAttempts\x12!\n" +
|
||||
"\fsolved_tasks\x18\x02 \x01(\x05R\vsolvedTasks2\xec\x02\n" +
|
||||
"\x05token\x18\x01 \x01(\tR\x05token\",\n" +
|
||||
"\x14ValidateTokenRequest\x12\x14\n" +
|
||||
"\x05token\x18\x01 \x01(\tR\x05token\"0\n" +
|
||||
"\x15ValidateTokenResponse\x12\x17\n" +
|
||||
"\auser_id\x18\x01 \x01(\tR\x06userId2\xc1\x01\n" +
|
||||
"\vAuthService\x123\n" +
|
||||
"\x06SignUp\x12\x13.auth.SignUpRequest\x1a\x14.auth.SignUpResponse\x123\n" +
|
||||
"\x06SignIn\x12\x13.auth.SignInRequest\x1a\x14.auth.SignInResponse\x120\n" +
|
||||
"\x05GetMe\x12\x12.auth.GetMeRequest\x1a\x13.auth.GetMeResponse\x126\n" +
|
||||
"\aGetUser\x12\x14.auth.GetUserRequest\x1a\x15.auth.GetUserResponse\x12<\n" +
|
||||
"\tGetMyStat\x12\x16.auth.GetMyStatRequest\x1a\x17.auth.GetMyStatResponse\x12K\n" +
|
||||
"\x0eGetLeaderboard\x12\x1b.auth.GetLeaderboardRequest\x1a\x1c.auth.GetLeaderboardResponseB\x0eZ\fpkg/api/authb\x06proto3"
|
||||
"\x06SignIn\x12\x13.auth.SignInRequest\x1a\x14.auth.SignInResponse\x12H\n" +
|
||||
"\rValidateToken\x12\x1a.auth.ValidateTokenRequest\x1a\x1b.auth.ValidateTokenResponseB\x0eZ\fpkg/api/authb\x06proto3"
|
||||
|
||||
var (
|
||||
file_api_proto_auth_proto_rawDescOnce sync.Once
|
||||
@@ -825,47 +346,27 @@ func file_api_proto_auth_proto_rawDescGZIP() []byte {
|
||||
return file_api_proto_auth_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_api_proto_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 15)
|
||||
var file_api_proto_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_api_proto_auth_proto_goTypes = []any{
|
||||
(*SignUpRequest)(nil), // 0: auth.SignUpRequest
|
||||
(*SignUpResponse)(nil), // 1: auth.SignUpResponse
|
||||
(*SignInRequest)(nil), // 2: auth.SignInRequest
|
||||
(*SignInResponse)(nil), // 3: auth.SignInResponse
|
||||
(*GetMeRequest)(nil), // 4: auth.GetMeRequest
|
||||
(*GetMeResponse)(nil), // 5: auth.GetMeResponse
|
||||
(*GetUserRequest)(nil), // 6: auth.GetUserRequest
|
||||
(*GetUserResponse)(nil), // 7: auth.GetUserResponse
|
||||
(*GetMyStatRequest)(nil), // 8: auth.GetMyStatRequest
|
||||
(*GetMyStatResponse)(nil), // 9: auth.GetMyStatResponse
|
||||
(*GetLeaderboardRequest)(nil), // 10: auth.GetLeaderboardRequest
|
||||
(*GetLeaderboardResponse)(nil), // 11: auth.GetLeaderboardResponse
|
||||
(*User)(nil), // 12: auth.User
|
||||
(*UserAchievement)(nil), // 13: auth.UserAchievement
|
||||
(*Stat)(nil), // 14: auth.Stat
|
||||
(*SignUpRequest)(nil), // 0: auth.SignUpRequest
|
||||
(*SignUpResponse)(nil), // 1: auth.SignUpResponse
|
||||
(*SignInRequest)(nil), // 2: auth.SignInRequest
|
||||
(*SignInResponse)(nil), // 3: auth.SignInResponse
|
||||
(*ValidateTokenRequest)(nil), // 4: auth.ValidateTokenRequest
|
||||
(*ValidateTokenResponse)(nil), // 5: auth.ValidateTokenResponse
|
||||
}
|
||||
var file_api_proto_auth_proto_depIdxs = []int32{
|
||||
12, // 0: auth.GetMeResponse.user:type_name -> auth.User
|
||||
12, // 1: auth.GetUserResponse.user:type_name -> auth.User
|
||||
14, // 2: auth.GetMyStatResponse.stat:type_name -> auth.Stat
|
||||
12, // 3: auth.GetLeaderboardResponse.users:type_name -> auth.User
|
||||
13, // 4: auth.User.achievements:type_name -> auth.UserAchievement
|
||||
0, // 5: auth.AuthService.SignUp:input_type -> auth.SignUpRequest
|
||||
2, // 6: auth.AuthService.SignIn:input_type -> auth.SignInRequest
|
||||
4, // 7: auth.AuthService.GetMe:input_type -> auth.GetMeRequest
|
||||
6, // 8: auth.AuthService.GetUser:input_type -> auth.GetUserRequest
|
||||
8, // 9: auth.AuthService.GetMyStat:input_type -> auth.GetMyStatRequest
|
||||
10, // 10: auth.AuthService.GetLeaderboard:input_type -> auth.GetLeaderboardRequest
|
||||
1, // 11: auth.AuthService.SignUp:output_type -> auth.SignUpResponse
|
||||
3, // 12: auth.AuthService.SignIn:output_type -> auth.SignInResponse
|
||||
5, // 13: auth.AuthService.GetMe:output_type -> auth.GetMeResponse
|
||||
7, // 14: auth.AuthService.GetUser:output_type -> auth.GetUserResponse
|
||||
9, // 15: auth.AuthService.GetMyStat:output_type -> auth.GetMyStatResponse
|
||||
11, // 16: auth.AuthService.GetLeaderboard:output_type -> auth.GetLeaderboardResponse
|
||||
11, // [11:17] is the sub-list for method output_type
|
||||
5, // [5:11] is the sub-list for method input_type
|
||||
5, // [5:5] is the sub-list for extension type_name
|
||||
5, // [5:5] is the sub-list for extension extendee
|
||||
0, // [0:5] is the sub-list for field type_name
|
||||
0, // 0: auth.AuthService.SignUp:input_type -> auth.SignUpRequest
|
||||
2, // 1: auth.AuthService.SignIn:input_type -> auth.SignInRequest
|
||||
4, // 2: auth.AuthService.ValidateToken:input_type -> auth.ValidateTokenRequest
|
||||
1, // 3: auth.AuthService.SignUp:output_type -> auth.SignUpResponse
|
||||
3, // 4: auth.AuthService.SignIn:output_type -> auth.SignInResponse
|
||||
5, // 5: auth.AuthService.ValidateToken:output_type -> auth.ValidateTokenResponse
|
||||
3, // [3:6] is the sub-list for method output_type
|
||||
0, // [0:3] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_api_proto_auth_proto_init() }
|
||||
@@ -873,14 +374,13 @@ func file_api_proto_auth_proto_init() {
|
||||
if File_api_proto_auth_proto != nil {
|
||||
return
|
||||
}
|
||||
file_api_proto_auth_proto_msgTypes[12].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_proto_auth_proto_rawDesc), len(file_api_proto_auth_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 15,
|
||||
NumMessages: 6,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
|
||||
+21
-135
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc-gen-go-grpc v1.6.0
|
||||
// - protoc v6.33.2
|
||||
// source: api/proto/auth.proto
|
||||
|
||||
@@ -19,12 +19,9 @@ import (
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
AuthService_SignUp_FullMethodName = "/auth.AuthService/SignUp"
|
||||
AuthService_SignIn_FullMethodName = "/auth.AuthService/SignIn"
|
||||
AuthService_GetMe_FullMethodName = "/auth.AuthService/GetMe"
|
||||
AuthService_GetUser_FullMethodName = "/auth.AuthService/GetUser"
|
||||
AuthService_GetMyStat_FullMethodName = "/auth.AuthService/GetMyStat"
|
||||
AuthService_GetLeaderboard_FullMethodName = "/auth.AuthService/GetLeaderboard"
|
||||
AuthService_SignUp_FullMethodName = "/auth.AuthService/SignUp"
|
||||
AuthService_SignIn_FullMethodName = "/auth.AuthService/SignIn"
|
||||
AuthService_ValidateToken_FullMethodName = "/auth.AuthService/ValidateToken"
|
||||
)
|
||||
|
||||
// AuthServiceClient is the client API for AuthService service.
|
||||
@@ -33,10 +30,7 @@ const (
|
||||
type AuthServiceClient interface {
|
||||
SignUp(ctx context.Context, in *SignUpRequest, opts ...grpc.CallOption) (*SignUpResponse, error)
|
||||
SignIn(ctx context.Context, in *SignInRequest, opts ...grpc.CallOption) (*SignInResponse, error)
|
||||
GetMe(ctx context.Context, in *GetMeRequest, opts ...grpc.CallOption) (*GetMeResponse, error)
|
||||
GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error)
|
||||
GetMyStat(ctx context.Context, in *GetMyStatRequest, opts ...grpc.CallOption) (*GetMyStatResponse, error)
|
||||
GetLeaderboard(ctx context.Context, in *GetLeaderboardRequest, opts ...grpc.CallOption) (*GetLeaderboardResponse, error)
|
||||
ValidateToken(ctx context.Context, in *ValidateTokenRequest, opts ...grpc.CallOption) (*ValidateTokenResponse, error)
|
||||
}
|
||||
|
||||
type authServiceClient struct {
|
||||
@@ -67,40 +61,10 @@ func (c *authServiceClient) SignIn(ctx context.Context, in *SignInRequest, opts
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authServiceClient) GetMe(ctx context.Context, in *GetMeRequest, opts ...grpc.CallOption) (*GetMeResponse, error) {
|
||||
func (c *authServiceClient) ValidateToken(ctx context.Context, in *ValidateTokenRequest, opts ...grpc.CallOption) (*ValidateTokenResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetMeResponse)
|
||||
err := c.cc.Invoke(ctx, AuthService_GetMe_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authServiceClient) GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetUserResponse)
|
||||
err := c.cc.Invoke(ctx, AuthService_GetUser_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authServiceClient) GetMyStat(ctx context.Context, in *GetMyStatRequest, opts ...grpc.CallOption) (*GetMyStatResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetMyStatResponse)
|
||||
err := c.cc.Invoke(ctx, AuthService_GetMyStat_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authServiceClient) GetLeaderboard(ctx context.Context, in *GetLeaderboardRequest, opts ...grpc.CallOption) (*GetLeaderboardResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetLeaderboardResponse)
|
||||
err := c.cc.Invoke(ctx, AuthService_GetLeaderboard_FullMethodName, in, out, cOpts...)
|
||||
out := new(ValidateTokenResponse)
|
||||
err := c.cc.Invoke(ctx, AuthService_ValidateToken_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -113,10 +77,7 @@ func (c *authServiceClient) GetLeaderboard(ctx context.Context, in *GetLeaderboa
|
||||
type AuthServiceServer interface {
|
||||
SignUp(context.Context, *SignUpRequest) (*SignUpResponse, error)
|
||||
SignIn(context.Context, *SignInRequest) (*SignInResponse, error)
|
||||
GetMe(context.Context, *GetMeRequest) (*GetMeResponse, error)
|
||||
GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error)
|
||||
GetMyStat(context.Context, *GetMyStatRequest) (*GetMyStatResponse, error)
|
||||
GetLeaderboard(context.Context, *GetLeaderboardRequest) (*GetLeaderboardResponse, error)
|
||||
ValidateToken(context.Context, *ValidateTokenRequest) (*ValidateTokenResponse, error)
|
||||
mustEmbedUnimplementedAuthServiceServer()
|
||||
}
|
||||
|
||||
@@ -128,22 +89,13 @@ type AuthServiceServer interface {
|
||||
type UnimplementedAuthServiceServer struct{}
|
||||
|
||||
func (UnimplementedAuthServiceServer) SignUp(context.Context, *SignUpRequest) (*SignUpResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SignUp not implemented")
|
||||
return nil, status.Error(codes.Unimplemented, "method SignUp not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServiceServer) SignIn(context.Context, *SignInRequest) (*SignInResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SignIn not implemented")
|
||||
return nil, status.Error(codes.Unimplemented, "method SignIn not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServiceServer) GetMe(context.Context, *GetMeRequest) (*GetMeResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetMe not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServiceServer) GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServiceServer) GetMyStat(context.Context, *GetMyStatRequest) (*GetMyStatResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetMyStat not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServiceServer) GetLeaderboard(context.Context, *GetLeaderboardRequest) (*GetLeaderboardResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetLeaderboard not implemented")
|
||||
func (UnimplementedAuthServiceServer) ValidateToken(context.Context, *ValidateTokenRequest) (*ValidateTokenResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ValidateToken not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {}
|
||||
func (UnimplementedAuthServiceServer) testEmbeddedByValue() {}
|
||||
@@ -156,7 +108,7 @@ type UnsafeAuthServiceServer interface {
|
||||
}
|
||||
|
||||
func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer) {
|
||||
// If the following call pancis, it indicates UnimplementedAuthServiceServer was
|
||||
// If the following call panics, it indicates UnimplementedAuthServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
@@ -202,74 +154,20 @@ func _AuthService_SignIn_Handler(srv interface{}, ctx context.Context, dec func(
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AuthService_GetMe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetMeRequest)
|
||||
func _AuthService_ValidateToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ValidateTokenRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServiceServer).GetMe(ctx, in)
|
||||
return srv.(AuthServiceServer).ValidateToken(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AuthService_GetMe_FullMethodName,
|
||||
FullMethod: AuthService_ValidateToken_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServiceServer).GetMe(ctx, req.(*GetMeRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AuthService_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetUserRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServiceServer).GetUser(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AuthService_GetUser_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServiceServer).GetUser(ctx, req.(*GetUserRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AuthService_GetMyStat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetMyStatRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServiceServer).GetMyStat(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AuthService_GetMyStat_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServiceServer).GetMyStat(ctx, req.(*GetMyStatRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AuthService_GetLeaderboard_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetLeaderboardRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServiceServer).GetLeaderboard(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AuthService_GetLeaderboard_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServiceServer).GetLeaderboard(ctx, req.(*GetLeaderboardRequest))
|
||||
return srv.(AuthServiceServer).ValidateToken(ctx, req.(*ValidateTokenRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -290,20 +188,8 @@ var AuthService_ServiceDesc = grpc.ServiceDesc{
|
||||
Handler: _AuthService_SignIn_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetMe",
|
||||
Handler: _AuthService_GetMe_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetUser",
|
||||
Handler: _AuthService_GetUser_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetMyStat",
|
||||
Handler: _AuthService_GetMyStat_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetLeaderboard",
|
||||
Handler: _AuthService_GetLeaderboard_Handler,
|
||||
MethodName: "ValidateToken",
|
||||
Handler: _AuthService_ValidateToken_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.10
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc v6.33.2
|
||||
// source: api/proto/competition.proto
|
||||
|
||||
@@ -9,6 +9,7 @@ package competition
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
@@ -25,24 +26,30 @@ type CompetitionState int32
|
||||
|
||||
const (
|
||||
CompetitionState_COMPETITION_STATE_UNSPECIFIED CompetitionState = 0
|
||||
CompetitionState_COMPETITION_STATE_NOT_STARTED CompetitionState = 1
|
||||
CompetitionState_COMPETITION_STATE_STARTED CompetitionState = 2
|
||||
CompetitionState_COMPETITION_STATE_FINISHED CompetitionState = 3
|
||||
CompetitionState_COMPETITION_STATE_DRAFT CompetitionState = 1
|
||||
CompetitionState_COMPETITION_STATE_NOT_STARTED CompetitionState = 2
|
||||
CompetitionState_COMPETITION_STATE_STARTED CompetitionState = 3
|
||||
CompetitionState_COMPETITION_STATE_FINISHED CompetitionState = 4
|
||||
CompetitionState_COMPETITION_STATE_ARCHIVED CompetitionState = 5
|
||||
)
|
||||
|
||||
// Enum value maps for CompetitionState.
|
||||
var (
|
||||
CompetitionState_name = map[int32]string{
|
||||
0: "COMPETITION_STATE_UNSPECIFIED",
|
||||
1: "COMPETITION_STATE_NOT_STARTED",
|
||||
2: "COMPETITION_STATE_STARTED",
|
||||
3: "COMPETITION_STATE_FINISHED",
|
||||
1: "COMPETITION_STATE_DRAFT",
|
||||
2: "COMPETITION_STATE_NOT_STARTED",
|
||||
3: "COMPETITION_STATE_STARTED",
|
||||
4: "COMPETITION_STATE_FINISHED",
|
||||
5: "COMPETITION_STATE_ARCHIVED",
|
||||
}
|
||||
CompetitionState_value = map[string]int32{
|
||||
"COMPETITION_STATE_UNSPECIFIED": 0,
|
||||
"COMPETITION_STATE_NOT_STARTED": 1,
|
||||
"COMPETITION_STATE_STARTED": 2,
|
||||
"COMPETITION_STATE_FINISHED": 3,
|
||||
"COMPETITION_STATE_DRAFT": 1,
|
||||
"COMPETITION_STATE_NOT_STARTED": 2,
|
||||
"COMPETITION_STATE_STARTED": 3,
|
||||
"COMPETITION_STATE_FINISHED": 4,
|
||||
"COMPETITION_STATE_ARCHIVED": 5,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -73,6 +80,228 @@ func (CompetitionState) EnumDescriptor() ([]byte, []int) {
|
||||
return file_api_proto_competition_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type ParticipationType int32
|
||||
|
||||
const (
|
||||
ParticipationType_PARTICIPATION_TYPE_UNSPECIFIED ParticipationType = 0
|
||||
ParticipationType_PARTICIPATION_TYPE_INDIVIDUAL ParticipationType = 1
|
||||
ParticipationType_PARTICIPATION_TYPE_TEAM ParticipationType = 2
|
||||
)
|
||||
|
||||
// Enum value maps for ParticipationType.
|
||||
var (
|
||||
ParticipationType_name = map[int32]string{
|
||||
0: "PARTICIPATION_TYPE_UNSPECIFIED",
|
||||
1: "PARTICIPATION_TYPE_INDIVIDUAL",
|
||||
2: "PARTICIPATION_TYPE_TEAM",
|
||||
}
|
||||
ParticipationType_value = map[string]int32{
|
||||
"PARTICIPATION_TYPE_UNSPECIFIED": 0,
|
||||
"PARTICIPATION_TYPE_INDIVIDUAL": 1,
|
||||
"PARTICIPATION_TYPE_TEAM": 2,
|
||||
}
|
||||
)
|
||||
|
||||
func (x ParticipationType) Enum() *ParticipationType {
|
||||
p := new(ParticipationType)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x ParticipationType) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (ParticipationType) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_api_proto_competition_proto_enumTypes[1].Descriptor()
|
||||
}
|
||||
|
||||
func (ParticipationType) Type() protoreflect.EnumType {
|
||||
return &file_api_proto_competition_proto_enumTypes[1]
|
||||
}
|
||||
|
||||
func (x ParticipationType) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ParticipationType.Descriptor instead.
|
||||
func (ParticipationType) EnumDescriptor() ([]byte, []int) {
|
||||
return file_api_proto_competition_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
type CompetitionType int32
|
||||
|
||||
const (
|
||||
CompetitionType_COMPETITION_TYPE_UNSPECIFIED CompetitionType = 0
|
||||
CompetitionType_COMPETITION_TYPE_EDUCATIVE CompetitionType = 1
|
||||
CompetitionType_COMPETITION_TYPE_COMPETETIVE CompetitionType = 2
|
||||
)
|
||||
|
||||
// Enum value maps for CompetitionType.
|
||||
var (
|
||||
CompetitionType_name = map[int32]string{
|
||||
0: "COMPETITION_TYPE_UNSPECIFIED",
|
||||
1: "COMPETITION_TYPE_EDUCATIVE",
|
||||
2: "COMPETITION_TYPE_COMPETETIVE",
|
||||
}
|
||||
CompetitionType_value = map[string]int32{
|
||||
"COMPETITION_TYPE_UNSPECIFIED": 0,
|
||||
"COMPETITION_TYPE_EDUCATIVE": 1,
|
||||
"COMPETITION_TYPE_COMPETETIVE": 2,
|
||||
}
|
||||
)
|
||||
|
||||
func (x CompetitionType) Enum() *CompetitionType {
|
||||
p := new(CompetitionType)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x CompetitionType) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (CompetitionType) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_api_proto_competition_proto_enumTypes[2].Descriptor()
|
||||
}
|
||||
|
||||
func (CompetitionType) Type() protoreflect.EnumType {
|
||||
return &file_api_proto_competition_proto_enumTypes[2]
|
||||
}
|
||||
|
||||
func (x CompetitionType) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CompetitionType.Descriptor instead.
|
||||
func (CompetitionType) EnumDescriptor() ([]byte, []int) {
|
||||
return file_api_proto_competition_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
type Competition struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
State CompetitionState `protobuf:"varint,2,opt,name=state,proto3,enum=competition.CompetitionState" json:"state,omitempty"`
|
||||
Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"`
|
||||
Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
|
||||
ImageUrl *string `protobuf:"bytes,5,opt,name=image_url,json=imageUrl,proto3,oneof" json:"image_url,omitempty"`
|
||||
StartTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
|
||||
EndTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"`
|
||||
Type CompetitionType `protobuf:"varint,8,opt,name=type,proto3,enum=competition.CompetitionType" json:"type,omitempty"`
|
||||
ParticipationType ParticipationType `protobuf:"varint,9,opt,name=participation_type,json=participationType,proto3,enum=competition.ParticipationType" json:"participation_type,omitempty"`
|
||||
CreatedAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
|
||||
UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Competition) Reset() {
|
||||
*x = Competition{}
|
||||
mi := &file_api_proto_competition_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Competition) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Competition) ProtoMessage() {}
|
||||
|
||||
func (x *Competition) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_competition_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Competition.ProtoReflect.Descriptor instead.
|
||||
func (*Competition) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_competition_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Competition) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Competition) GetState() CompetitionState {
|
||||
if x != nil {
|
||||
return x.State
|
||||
}
|
||||
return CompetitionState_COMPETITION_STATE_UNSPECIFIED
|
||||
}
|
||||
|
||||
func (x *Competition) GetTitle() string {
|
||||
if x != nil {
|
||||
return x.Title
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Competition) GetDescription() string {
|
||||
if x != nil {
|
||||
return x.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Competition) GetImageUrl() string {
|
||||
if x != nil && x.ImageUrl != nil {
|
||||
return *x.ImageUrl
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Competition) GetStartTime() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.StartTime
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Competition) GetEndTime() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.EndTime
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Competition) GetType() CompetitionType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return CompetitionType_COMPETITION_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
func (x *Competition) GetParticipationType() ParticipationType {
|
||||
if x != nil {
|
||||
return x.ParticipationType
|
||||
}
|
||||
return ParticipationType_PARTICIPATION_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
func (x *Competition) GetCreatedAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.CreatedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Competition) GetUpdatedAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.UpdatedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type GetCompetitionRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
CompetitionId string `protobuf:"bytes,1,opt,name=competition_id,json=competitionId,proto3" json:"competition_id,omitempty"`
|
||||
@@ -82,7 +311,7 @@ type GetCompetitionRequest struct {
|
||||
|
||||
func (x *GetCompetitionRequest) Reset() {
|
||||
*x = GetCompetitionRequest{}
|
||||
mi := &file_api_proto_competition_proto_msgTypes[0]
|
||||
mi := &file_api_proto_competition_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -94,7 +323,7 @@ func (x *GetCompetitionRequest) String() string {
|
||||
func (*GetCompetitionRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetCompetitionRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_competition_proto_msgTypes[0]
|
||||
mi := &file_api_proto_competition_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -107,7 +336,7 @@ func (x *GetCompetitionRequest) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use GetCompetitionRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetCompetitionRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_competition_proto_rawDescGZIP(), []int{0}
|
||||
return file_api_proto_competition_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *GetCompetitionRequest) GetCompetitionId() string {
|
||||
@@ -117,53 +346,13 @@ func (x *GetCompetitionRequest) GetCompetitionId() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
type GetCompetitionResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Competition *Competition `protobuf:"bytes,1,opt,name=competition,proto3" json:"competition,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetCompetitionResponse) Reset() {
|
||||
*x = GetCompetitionResponse{}
|
||||
mi := &file_api_proto_competition_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetCompetitionResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetCompetitionResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetCompetitionResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_competition_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetCompetitionResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetCompetitionResponse) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_competition_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *GetCompetitionResponse) GetCompetition() *Competition {
|
||||
if x != nil {
|
||||
return x.Competition
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ListCompetitionsRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
IsParticipating bool `protobuf:"varint,1,opt,name=is_participating,json=isParticipating,proto3" json:"is_participating,omitempty"`
|
||||
PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
|
||||
PageToken int32 `protobuf:"varint,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
|
||||
State *CompetitionState `protobuf:"varint,3,opt,name=state,proto3,enum=competition.CompetitionState,oneof" json:"state,omitempty"`
|
||||
IsParticipating *bool `protobuf:"varint,4,opt,name=is_participating,json=isParticipating,proto3,oneof" json:"is_participating,omitempty"`
|
||||
SearchQuery *string `protobuf:"bytes,5,opt,name=search_query,json=searchQuery,proto3,oneof" json:"search_query,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@@ -198,15 +387,45 @@ func (*ListCompetitionsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_competition_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *ListCompetitionsRequest) GetIsParticipating() bool {
|
||||
func (x *ListCompetitionsRequest) GetPageSize() int32 {
|
||||
if x != nil {
|
||||
return x.IsParticipating
|
||||
return x.PageSize
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ListCompetitionsRequest) GetPageToken() int32 {
|
||||
if x != nil {
|
||||
return x.PageToken
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ListCompetitionsRequest) GetState() CompetitionState {
|
||||
if x != nil && x.State != nil {
|
||||
return *x.State
|
||||
}
|
||||
return CompetitionState_COMPETITION_STATE_UNSPECIFIED
|
||||
}
|
||||
|
||||
func (x *ListCompetitionsRequest) GetIsParticipating() bool {
|
||||
if x != nil && x.IsParticipating != nil {
|
||||
return *x.IsParticipating
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *ListCompetitionsRequest) GetSearchQuery() string {
|
||||
if x != nil && x.SearchQuery != nil {
|
||||
return *x.SearchQuery
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ListCompetitionsResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
TotalCount int32 `protobuf:"varint,2,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"`
|
||||
NextPageToken int32 `protobuf:"varint,3,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
|
||||
Competitions []*Competition `protobuf:"bytes,1,rep,name=competitions,proto3" json:"competitions,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
@@ -242,6 +461,20 @@ func (*ListCompetitionsResponse) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_competition_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *ListCompetitionsResponse) GetTotalCount() int32 {
|
||||
if x != nil {
|
||||
return x.TotalCount
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ListCompetitionsResponse) GetNextPageToken() int32 {
|
||||
if x != nil {
|
||||
return x.NextPageToken
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ListCompetitionsResponse) GetCompetitions() []*Competition {
|
||||
if x != nil {
|
||||
return x.Competitions
|
||||
@@ -301,200 +534,68 @@ func (x *ChangeCompetitionStateRequest) GetState() CompetitionState {
|
||||
return CompetitionState_COMPETITION_STATE_UNSPECIFIED
|
||||
}
|
||||
|
||||
type ChangeCompetitionStateResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
State CompetitionState `protobuf:"varint,1,opt,name=state,proto3,enum=competition.CompetitionState" json:"state,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ChangeCompetitionStateResponse) Reset() {
|
||||
*x = ChangeCompetitionStateResponse{}
|
||||
mi := &file_api_proto_competition_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ChangeCompetitionStateResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ChangeCompetitionStateResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ChangeCompetitionStateResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_competition_proto_msgTypes[5]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ChangeCompetitionStateResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ChangeCompetitionStateResponse) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_competition_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *ChangeCompetitionStateResponse) GetState() CompetitionState {
|
||||
if x != nil {
|
||||
return x.State
|
||||
}
|
||||
return CompetitionState_COMPETITION_STATE_UNSPECIFIED
|
||||
}
|
||||
|
||||
type Competition struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
State CompetitionState `protobuf:"varint,2,opt,name=state,proto3,enum=competition.CompetitionState" json:"state,omitempty"`
|
||||
Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"`
|
||||
Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
|
||||
ImageUrl *string `protobuf:"bytes,5,opt,name=image_url,json=imageUrl,proto3,oneof" json:"image_url,omitempty"`
|
||||
EndDate *string `protobuf:"bytes,6,opt,name=end_date,json=endDate,proto3,oneof" json:"end_date,omitempty"`
|
||||
StartDate *string `protobuf:"bytes,7,opt,name=start_date,json=startDate,proto3,oneof" json:"start_date,omitempty"`
|
||||
Type string `protobuf:"bytes,8,opt,name=type,proto3" json:"type,omitempty"`
|
||||
ParticipationType string `protobuf:"bytes,9,opt,name=participation_type,json=participationType,proto3" json:"participation_type,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Competition) Reset() {
|
||||
*x = Competition{}
|
||||
mi := &file_api_proto_competition_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Competition) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Competition) ProtoMessage() {}
|
||||
|
||||
func (x *Competition) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_competition_proto_msgTypes[6]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Competition.ProtoReflect.Descriptor instead.
|
||||
func (*Competition) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_competition_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *Competition) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Competition) GetState() CompetitionState {
|
||||
if x != nil {
|
||||
return x.State
|
||||
}
|
||||
return CompetitionState_COMPETITION_STATE_UNSPECIFIED
|
||||
}
|
||||
|
||||
func (x *Competition) GetTitle() string {
|
||||
if x != nil {
|
||||
return x.Title
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Competition) GetDescription() string {
|
||||
if x != nil {
|
||||
return x.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Competition) GetImageUrl() string {
|
||||
if x != nil && x.ImageUrl != nil {
|
||||
return *x.ImageUrl
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Competition) GetEndDate() string {
|
||||
if x != nil && x.EndDate != nil {
|
||||
return *x.EndDate
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Competition) GetStartDate() string {
|
||||
if x != nil && x.StartDate != nil {
|
||||
return *x.StartDate
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Competition) GetType() string {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Competition) GetParticipationType() string {
|
||||
if x != nil {
|
||||
return x.ParticipationType
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_api_proto_competition_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_api_proto_competition_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x1bapi/proto/competition.proto\x12\vcompetition\">\n" +
|
||||
"\x15GetCompetitionRequest\x12%\n" +
|
||||
"\x0ecompetition_id\x18\x01 \x01(\tR\rcompetitionId\"T\n" +
|
||||
"\x16GetCompetitionResponse\x12:\n" +
|
||||
"\vcompetition\x18\x01 \x01(\v2\x18.competition.CompetitionR\vcompetition\"D\n" +
|
||||
"\x17ListCompetitionsRequest\x12)\n" +
|
||||
"\x10is_participating\x18\x01 \x01(\bR\x0fisParticipating\"X\n" +
|
||||
"\x18ListCompetitionsResponse\x12<\n" +
|
||||
"\fcompetitions\x18\x01 \x03(\v2\x18.competition.CompetitionR\fcompetitions\"{\n" +
|
||||
"\x1dChangeCompetitionStateRequest\x12%\n" +
|
||||
"\x0ecompetition_id\x18\x01 \x01(\tR\rcompetitionId\x123\n" +
|
||||
"\x05state\x18\x02 \x01(\x0e2\x1d.competition.CompetitionStateR\x05state\"U\n" +
|
||||
"\x1eChangeCompetitionStateResponse\x123\n" +
|
||||
"\x05state\x18\x01 \x01(\x0e2\x1d.competition.CompetitionStateR\x05state\"\xdd\x02\n" +
|
||||
"\x1bapi/proto/competition.proto\x12\vcompetition\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa3\x04\n" +
|
||||
"\vCompetition\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\x123\n" +
|
||||
"\x05state\x18\x02 \x01(\x0e2\x1d.competition.CompetitionStateR\x05state\x12\x14\n" +
|
||||
"\x05title\x18\x03 \x01(\tR\x05title\x12 \n" +
|
||||
"\vdescription\x18\x04 \x01(\tR\vdescription\x12 \n" +
|
||||
"\timage_url\x18\x05 \x01(\tH\x00R\bimageUrl\x88\x01\x01\x12\x1e\n" +
|
||||
"\bend_date\x18\x06 \x01(\tH\x01R\aendDate\x88\x01\x01\x12\"\n" +
|
||||
"\timage_url\x18\x05 \x01(\tH\x00R\bimageUrl\x88\x01\x01\x129\n" +
|
||||
"\n" +
|
||||
"start_date\x18\a \x01(\tH\x02R\tstartDate\x88\x01\x01\x12\x12\n" +
|
||||
"\x04type\x18\b \x01(\tR\x04type\x12-\n" +
|
||||
"\x12participation_type\x18\t \x01(\tR\x11participationTypeB\f\n" +
|
||||
"start_time\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\tstartTime\x125\n" +
|
||||
"\bend_time\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\aendTime\x120\n" +
|
||||
"\x04type\x18\b \x01(\x0e2\x1c.competition.CompetitionTypeR\x04type\x12M\n" +
|
||||
"\x12participation_type\x18\t \x01(\x0e2\x1e.competition.ParticipationTypeR\x11participationType\x129\n" +
|
||||
"\n" +
|
||||
"_image_urlB\v\n" +
|
||||
"\t_end_dateB\r\n" +
|
||||
"\v_start_date*\x97\x01\n" +
|
||||
"created_at\x18\n" +
|
||||
" \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" +
|
||||
"\n" +
|
||||
"updated_at\x18\v \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAtB\f\n" +
|
||||
"\n" +
|
||||
"_image_url\">\n" +
|
||||
"\x15GetCompetitionRequest\x12%\n" +
|
||||
"\x0ecompetition_id\x18\x01 \x01(\tR\rcompetitionId\"\x97\x02\n" +
|
||||
"\x17ListCompetitionsRequest\x12\x1b\n" +
|
||||
"\tpage_size\x18\x01 \x01(\x05R\bpageSize\x12\x1d\n" +
|
||||
"\n" +
|
||||
"page_token\x18\x02 \x01(\x05R\tpageToken\x128\n" +
|
||||
"\x05state\x18\x03 \x01(\x0e2\x1d.competition.CompetitionStateH\x00R\x05state\x88\x01\x01\x12.\n" +
|
||||
"\x10is_participating\x18\x04 \x01(\bH\x01R\x0fisParticipating\x88\x01\x01\x12&\n" +
|
||||
"\fsearch_query\x18\x05 \x01(\tH\x02R\vsearchQuery\x88\x01\x01B\b\n" +
|
||||
"\x06_stateB\x13\n" +
|
||||
"\x11_is_participatingB\x0f\n" +
|
||||
"\r_search_query\"\xa1\x01\n" +
|
||||
"\x18ListCompetitionsResponse\x12\x1f\n" +
|
||||
"\vtotal_count\x18\x02 \x01(\x05R\n" +
|
||||
"totalCount\x12&\n" +
|
||||
"\x0fnext_page_token\x18\x03 \x01(\x05R\rnextPageToken\x12<\n" +
|
||||
"\fcompetitions\x18\x01 \x03(\v2\x18.competition.CompetitionR\fcompetitions\"{\n" +
|
||||
"\x1dChangeCompetitionStateRequest\x12%\n" +
|
||||
"\x0ecompetition_id\x18\x01 \x01(\tR\rcompetitionId\x123\n" +
|
||||
"\x05state\x18\x02 \x01(\x0e2\x1d.competition.CompetitionStateR\x05state*\xd4\x01\n" +
|
||||
"\x10CompetitionState\x12!\n" +
|
||||
"\x1dCOMPETITION_STATE_UNSPECIFIED\x10\x00\x12!\n" +
|
||||
"\x1dCOMPETITION_STATE_NOT_STARTED\x10\x01\x12\x1d\n" +
|
||||
"\x19COMPETITION_STATE_STARTED\x10\x02\x12\x1e\n" +
|
||||
"\x1aCOMPETITION_STATE_FINISHED\x10\x032\xc3\x02\n" +
|
||||
"\x12CompetitionService\x12Y\n" +
|
||||
"\x0eGetCompetition\x12\".competition.GetCompetitionRequest\x1a#.competition.GetCompetitionResponse\x12_\n" +
|
||||
"\x10ListCompetitions\x12$.competition.ListCompetitionsRequest\x1a%.competition.ListCompetitionsResponse\x12q\n" +
|
||||
"\x16ChangeCompetitionState\x12*.competition.ChangeCompetitionStateRequest\x1a+.competition.ChangeCompetitionStateResponseB\x15Z\x13pkg/api/competitionb\x06proto3"
|
||||
"\x1dCOMPETITION_STATE_UNSPECIFIED\x10\x00\x12\x1b\n" +
|
||||
"\x17COMPETITION_STATE_DRAFT\x10\x01\x12!\n" +
|
||||
"\x1dCOMPETITION_STATE_NOT_STARTED\x10\x02\x12\x1d\n" +
|
||||
"\x19COMPETITION_STATE_STARTED\x10\x03\x12\x1e\n" +
|
||||
"\x1aCOMPETITION_STATE_FINISHED\x10\x04\x12\x1e\n" +
|
||||
"\x1aCOMPETITION_STATE_ARCHIVED\x10\x05*w\n" +
|
||||
"\x11ParticipationType\x12\"\n" +
|
||||
"\x1ePARTICIPATION_TYPE_UNSPECIFIED\x10\x00\x12!\n" +
|
||||
"\x1dPARTICIPATION_TYPE_INDIVIDUAL\x10\x01\x12\x1b\n" +
|
||||
"\x17PARTICIPATION_TYPE_TEAM\x10\x02*u\n" +
|
||||
"\x0fCompetitionType\x12 \n" +
|
||||
"\x1cCOMPETITION_TYPE_UNSPECIFIED\x10\x00\x12\x1e\n" +
|
||||
"\x1aCOMPETITION_TYPE_EDUCATIVE\x10\x01\x12 \n" +
|
||||
"\x1cCOMPETITION_TYPE_COMPETETIVE\x10\x022\xa5\x02\n" +
|
||||
"\x12CompetitionService\x12N\n" +
|
||||
"\x0eGetCompetition\x12\".competition.GetCompetitionRequest\x1a\x18.competition.Competition\x12_\n" +
|
||||
"\x10ListCompetitions\x12$.competition.ListCompetitionsRequest\x1a%.competition.ListCompetitionsResponse\x12^\n" +
|
||||
"\x16ChangeCompetitionState\x12*.competition.ChangeCompetitionStateRequest\x1a\x18.competition.CompetitionB\x15Z\x13pkg/api/competitionb\x06proto3"
|
||||
|
||||
var (
|
||||
file_api_proto_competition_proto_rawDescOnce sync.Once
|
||||
@@ -508,35 +609,41 @@ func file_api_proto_competition_proto_rawDescGZIP() []byte {
|
||||
return file_api_proto_competition_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_api_proto_competition_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_api_proto_competition_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
||||
var file_api_proto_competition_proto_enumTypes = make([]protoimpl.EnumInfo, 3)
|
||||
var file_api_proto_competition_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||
var file_api_proto_competition_proto_goTypes = []any{
|
||||
(CompetitionState)(0), // 0: competition.CompetitionState
|
||||
(*GetCompetitionRequest)(nil), // 1: competition.GetCompetitionRequest
|
||||
(*GetCompetitionResponse)(nil), // 2: competition.GetCompetitionResponse
|
||||
(*ListCompetitionsRequest)(nil), // 3: competition.ListCompetitionsRequest
|
||||
(*ListCompetitionsResponse)(nil), // 4: competition.ListCompetitionsResponse
|
||||
(*ChangeCompetitionStateRequest)(nil), // 5: competition.ChangeCompetitionStateRequest
|
||||
(*ChangeCompetitionStateResponse)(nil), // 6: competition.ChangeCompetitionStateResponse
|
||||
(*Competition)(nil), // 7: competition.Competition
|
||||
(CompetitionState)(0), // 0: competition.CompetitionState
|
||||
(ParticipationType)(0), // 1: competition.ParticipationType
|
||||
(CompetitionType)(0), // 2: competition.CompetitionType
|
||||
(*Competition)(nil), // 3: competition.Competition
|
||||
(*GetCompetitionRequest)(nil), // 4: competition.GetCompetitionRequest
|
||||
(*ListCompetitionsRequest)(nil), // 5: competition.ListCompetitionsRequest
|
||||
(*ListCompetitionsResponse)(nil), // 6: competition.ListCompetitionsResponse
|
||||
(*ChangeCompetitionStateRequest)(nil), // 7: competition.ChangeCompetitionStateRequest
|
||||
(*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp
|
||||
}
|
||||
var file_api_proto_competition_proto_depIdxs = []int32{
|
||||
7, // 0: competition.GetCompetitionResponse.competition:type_name -> competition.Competition
|
||||
7, // 1: competition.ListCompetitionsResponse.competitions:type_name -> competition.Competition
|
||||
0, // 2: competition.ChangeCompetitionStateRequest.state:type_name -> competition.CompetitionState
|
||||
0, // 3: competition.ChangeCompetitionStateResponse.state:type_name -> competition.CompetitionState
|
||||
0, // 4: competition.Competition.state:type_name -> competition.CompetitionState
|
||||
1, // 5: competition.CompetitionService.GetCompetition:input_type -> competition.GetCompetitionRequest
|
||||
3, // 6: competition.CompetitionService.ListCompetitions:input_type -> competition.ListCompetitionsRequest
|
||||
5, // 7: competition.CompetitionService.ChangeCompetitionState:input_type -> competition.ChangeCompetitionStateRequest
|
||||
2, // 8: competition.CompetitionService.GetCompetition:output_type -> competition.GetCompetitionResponse
|
||||
4, // 9: competition.CompetitionService.ListCompetitions:output_type -> competition.ListCompetitionsResponse
|
||||
6, // 10: competition.CompetitionService.ChangeCompetitionState:output_type -> competition.ChangeCompetitionStateResponse
|
||||
8, // [8:11] is the sub-list for method output_type
|
||||
5, // [5:8] is the sub-list for method input_type
|
||||
5, // [5:5] is the sub-list for extension type_name
|
||||
5, // [5:5] is the sub-list for extension extendee
|
||||
0, // [0:5] is the sub-list for field type_name
|
||||
0, // 0: competition.Competition.state:type_name -> competition.CompetitionState
|
||||
8, // 1: competition.Competition.start_time:type_name -> google.protobuf.Timestamp
|
||||
8, // 2: competition.Competition.end_time:type_name -> google.protobuf.Timestamp
|
||||
2, // 3: competition.Competition.type:type_name -> competition.CompetitionType
|
||||
1, // 4: competition.Competition.participation_type:type_name -> competition.ParticipationType
|
||||
8, // 5: competition.Competition.created_at:type_name -> google.protobuf.Timestamp
|
||||
8, // 6: competition.Competition.updated_at:type_name -> google.protobuf.Timestamp
|
||||
0, // 7: competition.ListCompetitionsRequest.state:type_name -> competition.CompetitionState
|
||||
3, // 8: competition.ListCompetitionsResponse.competitions:type_name -> competition.Competition
|
||||
0, // 9: competition.ChangeCompetitionStateRequest.state:type_name -> competition.CompetitionState
|
||||
4, // 10: competition.CompetitionService.GetCompetition:input_type -> competition.GetCompetitionRequest
|
||||
5, // 11: competition.CompetitionService.ListCompetitions:input_type -> competition.ListCompetitionsRequest
|
||||
7, // 12: competition.CompetitionService.ChangeCompetitionState:input_type -> competition.ChangeCompetitionStateRequest
|
||||
3, // 13: competition.CompetitionService.GetCompetition:output_type -> competition.Competition
|
||||
6, // 14: competition.CompetitionService.ListCompetitions:output_type -> competition.ListCompetitionsResponse
|
||||
3, // 15: competition.CompetitionService.ChangeCompetitionState:output_type -> competition.Competition
|
||||
13, // [13:16] is the sub-list for method output_type
|
||||
10, // [10:13] is the sub-list for method input_type
|
||||
10, // [10:10] is the sub-list for extension type_name
|
||||
10, // [10:10] is the sub-list for extension extendee
|
||||
0, // [0:10] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_api_proto_competition_proto_init() }
|
||||
@@ -544,14 +651,15 @@ func file_api_proto_competition_proto_init() {
|
||||
if File_api_proto_competition_proto != nil {
|
||||
return
|
||||
}
|
||||
file_api_proto_competition_proto_msgTypes[6].OneofWrappers = []any{}
|
||||
file_api_proto_competition_proto_msgTypes[0].OneofWrappers = []any{}
|
||||
file_api_proto_competition_proto_msgTypes[2].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_proto_competition_proto_rawDesc), len(file_api_proto_competition_proto_rawDesc)),
|
||||
NumEnums: 1,
|
||||
NumMessages: 7,
|
||||
NumEnums: 3,
|
||||
NumMessages: 5,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc-gen-go-grpc v1.6.0
|
||||
// - protoc v6.33.2
|
||||
// source: api/proto/competition.proto
|
||||
|
||||
@@ -28,9 +28,9 @@ const (
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type CompetitionServiceClient interface {
|
||||
GetCompetition(ctx context.Context, in *GetCompetitionRequest, opts ...grpc.CallOption) (*GetCompetitionResponse, error)
|
||||
GetCompetition(ctx context.Context, in *GetCompetitionRequest, opts ...grpc.CallOption) (*Competition, error)
|
||||
ListCompetitions(ctx context.Context, in *ListCompetitionsRequest, opts ...grpc.CallOption) (*ListCompetitionsResponse, error)
|
||||
ChangeCompetitionState(ctx context.Context, in *ChangeCompetitionStateRequest, opts ...grpc.CallOption) (*ChangeCompetitionStateResponse, error)
|
||||
ChangeCompetitionState(ctx context.Context, in *ChangeCompetitionStateRequest, opts ...grpc.CallOption) (*Competition, error)
|
||||
}
|
||||
|
||||
type competitionServiceClient struct {
|
||||
@@ -41,9 +41,9 @@ func NewCompetitionServiceClient(cc grpc.ClientConnInterface) CompetitionService
|
||||
return &competitionServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *competitionServiceClient) GetCompetition(ctx context.Context, in *GetCompetitionRequest, opts ...grpc.CallOption) (*GetCompetitionResponse, error) {
|
||||
func (c *competitionServiceClient) GetCompetition(ctx context.Context, in *GetCompetitionRequest, opts ...grpc.CallOption) (*Competition, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetCompetitionResponse)
|
||||
out := new(Competition)
|
||||
err := c.cc.Invoke(ctx, CompetitionService_GetCompetition_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -61,9 +61,9 @@ func (c *competitionServiceClient) ListCompetitions(ctx context.Context, in *Lis
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *competitionServiceClient) ChangeCompetitionState(ctx context.Context, in *ChangeCompetitionStateRequest, opts ...grpc.CallOption) (*ChangeCompetitionStateResponse, error) {
|
||||
func (c *competitionServiceClient) ChangeCompetitionState(ctx context.Context, in *ChangeCompetitionStateRequest, opts ...grpc.CallOption) (*Competition, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ChangeCompetitionStateResponse)
|
||||
out := new(Competition)
|
||||
err := c.cc.Invoke(ctx, CompetitionService_ChangeCompetitionState_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -75,9 +75,9 @@ func (c *competitionServiceClient) ChangeCompetitionState(ctx context.Context, i
|
||||
// All implementations must embed UnimplementedCompetitionServiceServer
|
||||
// for forward compatibility.
|
||||
type CompetitionServiceServer interface {
|
||||
GetCompetition(context.Context, *GetCompetitionRequest) (*GetCompetitionResponse, error)
|
||||
GetCompetition(context.Context, *GetCompetitionRequest) (*Competition, error)
|
||||
ListCompetitions(context.Context, *ListCompetitionsRequest) (*ListCompetitionsResponse, error)
|
||||
ChangeCompetitionState(context.Context, *ChangeCompetitionStateRequest) (*ChangeCompetitionStateResponse, error)
|
||||
ChangeCompetitionState(context.Context, *ChangeCompetitionStateRequest) (*Competition, error)
|
||||
mustEmbedUnimplementedCompetitionServiceServer()
|
||||
}
|
||||
|
||||
@@ -88,14 +88,14 @@ type CompetitionServiceServer interface {
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedCompetitionServiceServer struct{}
|
||||
|
||||
func (UnimplementedCompetitionServiceServer) GetCompetition(context.Context, *GetCompetitionRequest) (*GetCompetitionResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetCompetition not implemented")
|
||||
func (UnimplementedCompetitionServiceServer) GetCompetition(context.Context, *GetCompetitionRequest) (*Competition, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetCompetition not implemented")
|
||||
}
|
||||
func (UnimplementedCompetitionServiceServer) ListCompetitions(context.Context, *ListCompetitionsRequest) (*ListCompetitionsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListCompetitions not implemented")
|
||||
return nil, status.Error(codes.Unimplemented, "method ListCompetitions not implemented")
|
||||
}
|
||||
func (UnimplementedCompetitionServiceServer) ChangeCompetitionState(context.Context, *ChangeCompetitionStateRequest) (*ChangeCompetitionStateResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ChangeCompetitionState not implemented")
|
||||
func (UnimplementedCompetitionServiceServer) ChangeCompetitionState(context.Context, *ChangeCompetitionStateRequest) (*Competition, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ChangeCompetitionState not implemented")
|
||||
}
|
||||
func (UnimplementedCompetitionServiceServer) mustEmbedUnimplementedCompetitionServiceServer() {}
|
||||
func (UnimplementedCompetitionServiceServer) testEmbeddedByValue() {}
|
||||
@@ -108,7 +108,7 @@ type UnsafeCompetitionServiceServer interface {
|
||||
}
|
||||
|
||||
func RegisterCompetitionServiceServer(s grpc.ServiceRegistrar, srv CompetitionServiceServer) {
|
||||
// If the following call pancis, it indicates UnimplementedCompetitionServiceServer was
|
||||
// If the following call panics, it indicates UnimplementedCompetitionServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
|
||||
@@ -0,0 +1,545 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc v6.33.2
|
||||
// source: api/proto/results.proto
|
||||
|
||||
package results
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type TaskStatus struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
|
||||
TaskTitle string `protobuf:"bytes,2,opt,name=task_title,json=taskTitle,proto3" json:"task_title,omitempty"`
|
||||
EarnedPoints int32 `protobuf:"varint,3,opt,name=earned_points,json=earnedPoints,proto3" json:"earned_points,omitempty"`
|
||||
MaxPoints int32 `protobuf:"varint,4,opt,name=max_points,json=maxPoints,proto3" json:"max_points,omitempty"`
|
||||
Position *int32 `protobuf:"varint,5,opt,name=position,proto3,oneof" json:"position,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *TaskStatus) Reset() {
|
||||
*x = TaskStatus{}
|
||||
mi := &file_api_proto_results_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *TaskStatus) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*TaskStatus) ProtoMessage() {}
|
||||
|
||||
func (x *TaskStatus) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_results_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use TaskStatus.ProtoReflect.Descriptor instead.
|
||||
func (*TaskStatus) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_results_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *TaskStatus) GetTaskId() string {
|
||||
if x != nil {
|
||||
return x.TaskId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *TaskStatus) GetTaskTitle() string {
|
||||
if x != nil {
|
||||
return x.TaskTitle
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *TaskStatus) GetEarnedPoints() int32 {
|
||||
if x != nil {
|
||||
return x.EarnedPoints
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *TaskStatus) GetMaxPoints() int32 {
|
||||
if x != nil {
|
||||
return x.MaxPoints
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *TaskStatus) GetPosition() int32 {
|
||||
if x != nil && x.Position != nil {
|
||||
return *x.Position
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type UserResult struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
||||
Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
|
||||
TotalScore int32 `protobuf:"varint,3,opt,name=total_score,json=totalScore,proto3" json:"total_score,omitempty"`
|
||||
OverallPosition int32 `protobuf:"varint,4,opt,name=overall_position,json=overallPosition,proto3" json:"overall_position,omitempty"`
|
||||
TaskStatuses []*TaskStatus `protobuf:"bytes,5,rep,name=task_statuses,json=taskStatuses,proto3" json:"task_statuses,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *UserResult) Reset() {
|
||||
*x = UserResult{}
|
||||
mi := &file_api_proto_results_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *UserResult) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*UserResult) ProtoMessage() {}
|
||||
|
||||
func (x *UserResult) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_results_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use UserResult.ProtoReflect.Descriptor instead.
|
||||
func (*UserResult) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_results_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *UserResult) GetUserId() string {
|
||||
if x != nil {
|
||||
return x.UserId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *UserResult) GetUsername() string {
|
||||
if x != nil {
|
||||
return x.Username
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *UserResult) GetTotalScore() int32 {
|
||||
if x != nil {
|
||||
return x.TotalScore
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *UserResult) GetOverallPosition() int32 {
|
||||
if x != nil {
|
||||
return x.OverallPosition
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *UserResult) GetTaskStatuses() []*TaskStatus {
|
||||
if x != nil {
|
||||
return x.TaskStatuses
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type GetCompetitionResultsRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
|
||||
PageToken int32 `protobuf:"varint,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
|
||||
CompetitionId string `protobuf:"bytes,3,opt,name=competition_id,json=competitionId,proto3" json:"competition_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetCompetitionResultsRequest) Reset() {
|
||||
*x = GetCompetitionResultsRequest{}
|
||||
mi := &file_api_proto_results_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetCompetitionResultsRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetCompetitionResultsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetCompetitionResultsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_results_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetCompetitionResultsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetCompetitionResultsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_results_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *GetCompetitionResultsRequest) GetPageSize() int32 {
|
||||
if x != nil {
|
||||
return x.PageSize
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *GetCompetitionResultsRequest) GetPageToken() int32 {
|
||||
if x != nil {
|
||||
return x.PageToken
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *GetCompetitionResultsRequest) GetCompetitionId() string {
|
||||
if x != nil {
|
||||
return x.CompetitionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type GetCompetitionResultsResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Results []*UserResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"`
|
||||
TotalCount int32 `protobuf:"varint,2,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"`
|
||||
NextPageToken int32 `protobuf:"varint,3,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetCompetitionResultsResponse) Reset() {
|
||||
*x = GetCompetitionResultsResponse{}
|
||||
mi := &file_api_proto_results_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetCompetitionResultsResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetCompetitionResultsResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetCompetitionResultsResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_results_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetCompetitionResultsResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetCompetitionResultsResponse) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_results_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *GetCompetitionResultsResponse) GetResults() []*UserResult {
|
||||
if x != nil {
|
||||
return x.Results
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *GetCompetitionResultsResponse) GetTotalCount() int32 {
|
||||
if x != nil {
|
||||
return x.TotalCount
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *GetCompetitionResultsResponse) GetNextPageToken() int32 {
|
||||
if x != nil {
|
||||
return x.NextPageToken
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type GetUserCompetitionResultsRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
CompetitionId string `protobuf:"bytes,1,opt,name=competition_id,json=competitionId,proto3" json:"competition_id,omitempty"`
|
||||
UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetUserCompetitionResultsRequest) Reset() {
|
||||
*x = GetUserCompetitionResultsRequest{}
|
||||
mi := &file_api_proto_results_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetUserCompetitionResultsRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetUserCompetitionResultsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetUserCompetitionResultsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_results_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetUserCompetitionResultsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetUserCompetitionResultsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_results_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *GetUserCompetitionResultsRequest) GetCompetitionId() string {
|
||||
if x != nil {
|
||||
return x.CompetitionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *GetUserCompetitionResultsRequest) GetUserId() string {
|
||||
if x != nil {
|
||||
return x.UserId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type GetUserCompetitionResultsResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Result *UserResult `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetUserCompetitionResultsResponse) Reset() {
|
||||
*x = GetUserCompetitionResultsResponse{}
|
||||
mi := &file_api_proto_results_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetUserCompetitionResultsResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetUserCompetitionResultsResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetUserCompetitionResultsResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_results_proto_msgTypes[5]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetUserCompetitionResultsResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetUserCompetitionResultsResponse) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_results_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *GetUserCompetitionResultsResponse) GetResult() *UserResult {
|
||||
if x != nil {
|
||||
return x.Result
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type RecalculateResultsRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
CompetitionId string `protobuf:"bytes,1,opt,name=competition_id,json=competitionId,proto3" json:"competition_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *RecalculateResultsRequest) Reset() {
|
||||
*x = RecalculateResultsRequest{}
|
||||
mi := &file_api_proto_results_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *RecalculateResultsRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*RecalculateResultsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *RecalculateResultsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_results_proto_msgTypes[6]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use RecalculateResultsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*RecalculateResultsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_results_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *RecalculateResultsRequest) GetCompetitionId() string {
|
||||
if x != nil {
|
||||
return x.CompetitionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_api_proto_results_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_api_proto_results_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x17api/proto/results.proto\x12\aresults\x1a\x1bgoogle/protobuf/empty.proto\"\xb6\x01\n" +
|
||||
"\n" +
|
||||
"TaskStatus\x12\x17\n" +
|
||||
"\atask_id\x18\x01 \x01(\tR\x06taskId\x12\x1d\n" +
|
||||
"\n" +
|
||||
"task_title\x18\x02 \x01(\tR\ttaskTitle\x12#\n" +
|
||||
"\rearned_points\x18\x03 \x01(\x05R\fearnedPoints\x12\x1d\n" +
|
||||
"\n" +
|
||||
"max_points\x18\x04 \x01(\x05R\tmaxPoints\x12\x1f\n" +
|
||||
"\bposition\x18\x05 \x01(\x05H\x00R\bposition\x88\x01\x01B\v\n" +
|
||||
"\t_position\"\xc7\x01\n" +
|
||||
"\n" +
|
||||
"UserResult\x12\x17\n" +
|
||||
"\auser_id\x18\x01 \x01(\tR\x06userId\x12\x1a\n" +
|
||||
"\busername\x18\x02 \x01(\tR\busername\x12\x1f\n" +
|
||||
"\vtotal_score\x18\x03 \x01(\x05R\n" +
|
||||
"totalScore\x12)\n" +
|
||||
"\x10overall_position\x18\x04 \x01(\x05R\x0foverallPosition\x128\n" +
|
||||
"\rtask_statuses\x18\x05 \x03(\v2\x13.results.TaskStatusR\ftaskStatuses\"\x81\x01\n" +
|
||||
"\x1cGetCompetitionResultsRequest\x12\x1b\n" +
|
||||
"\tpage_size\x18\x01 \x01(\x05R\bpageSize\x12\x1d\n" +
|
||||
"\n" +
|
||||
"page_token\x18\x02 \x01(\x05R\tpageToken\x12%\n" +
|
||||
"\x0ecompetition_id\x18\x03 \x01(\tR\rcompetitionId\"\x97\x01\n" +
|
||||
"\x1dGetCompetitionResultsResponse\x12-\n" +
|
||||
"\aresults\x18\x01 \x03(\v2\x13.results.UserResultR\aresults\x12\x1f\n" +
|
||||
"\vtotal_count\x18\x02 \x01(\x05R\n" +
|
||||
"totalCount\x12&\n" +
|
||||
"\x0fnext_page_token\x18\x03 \x01(\x05R\rnextPageToken\"b\n" +
|
||||
" GetUserCompetitionResultsRequest\x12%\n" +
|
||||
"\x0ecompetition_id\x18\x01 \x01(\tR\rcompetitionId\x12\x17\n" +
|
||||
"\auser_id\x18\x02 \x01(\tR\x06userId\"P\n" +
|
||||
"!GetUserCompetitionResultsResponse\x12+\n" +
|
||||
"\x06result\x18\x01 \x01(\v2\x13.results.UserResultR\x06result\"B\n" +
|
||||
"\x19RecalculateResultsRequest\x12%\n" +
|
||||
"\x0ecompetition_id\x18\x01 \x01(\tR\rcompetitionId2\xbe\x02\n" +
|
||||
"\x0eResultsService\x12f\n" +
|
||||
"\x15GetCompetitionResults\x12%.results.GetCompetitionResultsRequest\x1a&.results.GetCompetitionResultsResponse\x12r\n" +
|
||||
"\x19GetUserCompetitionResults\x12).results.GetUserCompetitionResultsRequest\x1a*.results.GetUserCompetitionResultsResponse\x12P\n" +
|
||||
"\x12RecalculateResults\x12\".results.RecalculateResultsRequest\x1a\x16.google.protobuf.EmptyB\x11Z\x0fpkg/api/resultsb\x06proto3"
|
||||
|
||||
var (
|
||||
file_api_proto_results_proto_rawDescOnce sync.Once
|
||||
file_api_proto_results_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_api_proto_results_proto_rawDescGZIP() []byte {
|
||||
file_api_proto_results_proto_rawDescOnce.Do(func() {
|
||||
file_api_proto_results_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_api_proto_results_proto_rawDesc), len(file_api_proto_results_proto_rawDesc)))
|
||||
})
|
||||
return file_api_proto_results_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_api_proto_results_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
||||
var file_api_proto_results_proto_goTypes = []any{
|
||||
(*TaskStatus)(nil), // 0: results.TaskStatus
|
||||
(*UserResult)(nil), // 1: results.UserResult
|
||||
(*GetCompetitionResultsRequest)(nil), // 2: results.GetCompetitionResultsRequest
|
||||
(*GetCompetitionResultsResponse)(nil), // 3: results.GetCompetitionResultsResponse
|
||||
(*GetUserCompetitionResultsRequest)(nil), // 4: results.GetUserCompetitionResultsRequest
|
||||
(*GetUserCompetitionResultsResponse)(nil), // 5: results.GetUserCompetitionResultsResponse
|
||||
(*RecalculateResultsRequest)(nil), // 6: results.RecalculateResultsRequest
|
||||
(*emptypb.Empty)(nil), // 7: google.protobuf.Empty
|
||||
}
|
||||
var file_api_proto_results_proto_depIdxs = []int32{
|
||||
0, // 0: results.UserResult.task_statuses:type_name -> results.TaskStatus
|
||||
1, // 1: results.GetCompetitionResultsResponse.results:type_name -> results.UserResult
|
||||
1, // 2: results.GetUserCompetitionResultsResponse.result:type_name -> results.UserResult
|
||||
2, // 3: results.ResultsService.GetCompetitionResults:input_type -> results.GetCompetitionResultsRequest
|
||||
4, // 4: results.ResultsService.GetUserCompetitionResults:input_type -> results.GetUserCompetitionResultsRequest
|
||||
6, // 5: results.ResultsService.RecalculateResults:input_type -> results.RecalculateResultsRequest
|
||||
3, // 6: results.ResultsService.GetCompetitionResults:output_type -> results.GetCompetitionResultsResponse
|
||||
5, // 7: results.ResultsService.GetUserCompetitionResults:output_type -> results.GetUserCompetitionResultsResponse
|
||||
7, // 8: results.ResultsService.RecalculateResults:output_type -> google.protobuf.Empty
|
||||
6, // [6:9] is the sub-list for method output_type
|
||||
3, // [3:6] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
3, // [3:3] is the sub-list for extension extendee
|
||||
0, // [0:3] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_api_proto_results_proto_init() }
|
||||
func file_api_proto_results_proto_init() {
|
||||
if File_api_proto_results_proto != nil {
|
||||
return
|
||||
}
|
||||
file_api_proto_results_proto_msgTypes[0].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_proto_results_proto_rawDesc), len(file_api_proto_results_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 7,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_api_proto_results_proto_goTypes,
|
||||
DependencyIndexes: file_api_proto_results_proto_depIdxs,
|
||||
MessageInfos: file_api_proto_results_proto_msgTypes,
|
||||
}.Build()
|
||||
File_api_proto_results_proto = out.File
|
||||
file_api_proto_results_proto_goTypes = nil
|
||||
file_api_proto_results_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,198 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.0
|
||||
// - protoc v6.33.2
|
||||
// source: api/proto/results.proto
|
||||
|
||||
package results
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
ResultsService_GetCompetitionResults_FullMethodName = "/results.ResultsService/GetCompetitionResults"
|
||||
ResultsService_GetUserCompetitionResults_FullMethodName = "/results.ResultsService/GetUserCompetitionResults"
|
||||
ResultsService_RecalculateResults_FullMethodName = "/results.ResultsService/RecalculateResults"
|
||||
)
|
||||
|
||||
// ResultsServiceClient is the client API for ResultsService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type ResultsServiceClient interface {
|
||||
GetCompetitionResults(ctx context.Context, in *GetCompetitionResultsRequest, opts ...grpc.CallOption) (*GetCompetitionResultsResponse, error)
|
||||
GetUserCompetitionResults(ctx context.Context, in *GetUserCompetitionResultsRequest, opts ...grpc.CallOption) (*GetUserCompetitionResultsResponse, error)
|
||||
RecalculateResults(ctx context.Context, in *RecalculateResultsRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
}
|
||||
|
||||
type resultsServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewResultsServiceClient(cc grpc.ClientConnInterface) ResultsServiceClient {
|
||||
return &resultsServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *resultsServiceClient) GetCompetitionResults(ctx context.Context, in *GetCompetitionResultsRequest, opts ...grpc.CallOption) (*GetCompetitionResultsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetCompetitionResultsResponse)
|
||||
err := c.cc.Invoke(ctx, ResultsService_GetCompetitionResults_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *resultsServiceClient) GetUserCompetitionResults(ctx context.Context, in *GetUserCompetitionResultsRequest, opts ...grpc.CallOption) (*GetUserCompetitionResultsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetUserCompetitionResultsResponse)
|
||||
err := c.cc.Invoke(ctx, ResultsService_GetUserCompetitionResults_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *resultsServiceClient) RecalculateResults(ctx context.Context, in *RecalculateResultsRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, ResultsService_RecalculateResults_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ResultsServiceServer is the server API for ResultsService service.
|
||||
// All implementations must embed UnimplementedResultsServiceServer
|
||||
// for forward compatibility.
|
||||
type ResultsServiceServer interface {
|
||||
GetCompetitionResults(context.Context, *GetCompetitionResultsRequest) (*GetCompetitionResultsResponse, error)
|
||||
GetUserCompetitionResults(context.Context, *GetUserCompetitionResultsRequest) (*GetUserCompetitionResultsResponse, error)
|
||||
RecalculateResults(context.Context, *RecalculateResultsRequest) (*emptypb.Empty, error)
|
||||
mustEmbedUnimplementedResultsServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedResultsServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedResultsServiceServer struct{}
|
||||
|
||||
func (UnimplementedResultsServiceServer) GetCompetitionResults(context.Context, *GetCompetitionResultsRequest) (*GetCompetitionResultsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetCompetitionResults not implemented")
|
||||
}
|
||||
func (UnimplementedResultsServiceServer) GetUserCompetitionResults(context.Context, *GetUserCompetitionResultsRequest) (*GetUserCompetitionResultsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetUserCompetitionResults not implemented")
|
||||
}
|
||||
func (UnimplementedResultsServiceServer) RecalculateResults(context.Context, *RecalculateResultsRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RecalculateResults not implemented")
|
||||
}
|
||||
func (UnimplementedResultsServiceServer) mustEmbedUnimplementedResultsServiceServer() {}
|
||||
func (UnimplementedResultsServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeResultsServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ResultsServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeResultsServiceServer interface {
|
||||
mustEmbedUnimplementedResultsServiceServer()
|
||||
}
|
||||
|
||||
func RegisterResultsServiceServer(s grpc.ServiceRegistrar, srv ResultsServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedResultsServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&ResultsService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _ResultsService_GetCompetitionResults_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetCompetitionResultsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ResultsServiceServer).GetCompetitionResults(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ResultsService_GetCompetitionResults_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ResultsServiceServer).GetCompetitionResults(ctx, req.(*GetCompetitionResultsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ResultsService_GetUserCompetitionResults_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetUserCompetitionResultsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ResultsServiceServer).GetUserCompetitionResults(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ResultsService_GetUserCompetitionResults_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ResultsServiceServer).GetUserCompetitionResults(ctx, req.(*GetUserCompetitionResultsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ResultsService_RecalculateResults_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RecalculateResultsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ResultsServiceServer).RecalculateResults(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ResultsService_RecalculateResults_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ResultsServiceServer).RecalculateResults(ctx, req.(*RecalculateResultsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// ResultsService_ServiceDesc is the grpc.ServiceDesc for ResultsService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var ResultsService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "results.ResultsService",
|
||||
HandlerType: (*ResultsServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetCompetitionResults",
|
||||
Handler: _ResultsService_GetCompetitionResults_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetUserCompetitionResults",
|
||||
Handler: _ResultsService_GetUserCompetitionResults_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RecalculateResults",
|
||||
Handler: _ResultsService_RecalculateResults_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "api/proto/results.proto",
|
||||
}
|
||||
@@ -0,0 +1,805 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc v6.33.2
|
||||
// source: api/proto/review.proto
|
||||
|
||||
package review
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type ReviewStatus int32
|
||||
|
||||
const (
|
||||
ReviewStatus_REVIEW_STATUS_UNSPECIFIED ReviewStatus = 0
|
||||
ReviewStatus_REVIEW_STATUS_PENDING ReviewStatus = 1
|
||||
ReviewStatus_REVIEW_STATUS_IN_REVIEW ReviewStatus = 2
|
||||
ReviewStatus_REVIEW_STATUS_COMPLETED ReviewStatus = 3
|
||||
ReviewStatus_REVIEW_STATUS_REJECTED ReviewStatus = 4
|
||||
)
|
||||
|
||||
// Enum value maps for ReviewStatus.
|
||||
var (
|
||||
ReviewStatus_name = map[int32]string{
|
||||
0: "REVIEW_STATUS_UNSPECIFIED",
|
||||
1: "REVIEW_STATUS_PENDING",
|
||||
2: "REVIEW_STATUS_IN_REVIEW",
|
||||
3: "REVIEW_STATUS_COMPLETED",
|
||||
4: "REVIEW_STATUS_REJECTED",
|
||||
}
|
||||
ReviewStatus_value = map[string]int32{
|
||||
"REVIEW_STATUS_UNSPECIFIED": 0,
|
||||
"REVIEW_STATUS_PENDING": 1,
|
||||
"REVIEW_STATUS_IN_REVIEW": 2,
|
||||
"REVIEW_STATUS_COMPLETED": 3,
|
||||
"REVIEW_STATUS_REJECTED": 4,
|
||||
}
|
||||
)
|
||||
|
||||
func (x ReviewStatus) Enum() *ReviewStatus {
|
||||
p := new(ReviewStatus)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x ReviewStatus) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (ReviewStatus) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_api_proto_review_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (ReviewStatus) Type() protoreflect.EnumType {
|
||||
return &file_api_proto_review_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x ReviewStatus) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ReviewStatus.Descriptor instead.
|
||||
func (ReviewStatus) EnumDescriptor() ([]byte, []int) {
|
||||
return file_api_proto_review_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type CriteriaMark struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Slug string `protobuf:"bytes,1,opt,name=slug,proto3" json:"slug,omitempty"`
|
||||
Mark float64 `protobuf:"fixed64,2,opt,name=mark,proto3" json:"mark,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *CriteriaMark) Reset() {
|
||||
*x = CriteriaMark{}
|
||||
mi := &file_api_proto_review_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *CriteriaMark) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CriteriaMark) ProtoMessage() {}
|
||||
|
||||
func (x *CriteriaMark) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_review_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CriteriaMark.ProtoReflect.Descriptor instead.
|
||||
func (*CriteriaMark) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_review_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *CriteriaMark) GetSlug() string {
|
||||
if x != nil {
|
||||
return x.Slug
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CriteriaMark) GetMark() float64 {
|
||||
if x != nil {
|
||||
return x.Mark
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type SubmissionSummary struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
CompetitionId string `protobuf:"bytes,2,opt,name=competition_id,json=competitionId,proto3" json:"competition_id,omitempty"`
|
||||
TaskId string `protobuf:"bytes,3,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
|
||||
CompetitionTitle string `protobuf:"bytes,4,opt,name=competition_title,json=competitionTitle,proto3" json:"competition_title,omitempty"`
|
||||
TaskTitle string `protobuf:"bytes,5,opt,name=task_title,json=taskTitle,proto3" json:"task_title,omitempty"`
|
||||
SubmittedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=submitted_at,json=submittedAt,proto3" json:"submitted_at,omitempty"`
|
||||
ReviewStatus ReviewStatus `protobuf:"varint,7,opt,name=review_status,json=reviewStatus,proto3,enum=review.ReviewStatus" json:"review_status,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SubmissionSummary) Reset() {
|
||||
*x = SubmissionSummary{}
|
||||
mi := &file_api_proto_review_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SubmissionSummary) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SubmissionSummary) ProtoMessage() {}
|
||||
|
||||
func (x *SubmissionSummary) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_review_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SubmissionSummary.ProtoReflect.Descriptor instead.
|
||||
func (*SubmissionSummary) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_review_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *SubmissionSummary) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SubmissionSummary) GetCompetitionId() string {
|
||||
if x != nil {
|
||||
return x.CompetitionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SubmissionSummary) GetTaskId() string {
|
||||
if x != nil {
|
||||
return x.TaskId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SubmissionSummary) GetCompetitionTitle() string {
|
||||
if x != nil {
|
||||
return x.CompetitionTitle
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SubmissionSummary) GetTaskTitle() string {
|
||||
if x != nil {
|
||||
return x.TaskTitle
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SubmissionSummary) GetSubmittedAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.SubmittedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *SubmissionSummary) GetReviewStatus() ReviewStatus {
|
||||
if x != nil {
|
||||
return x.ReviewStatus
|
||||
}
|
||||
return ReviewStatus_REVIEW_STATUS_UNSPECIFIED
|
||||
}
|
||||
|
||||
type SubmissionForReview struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
CompetitionId string `protobuf:"bytes,2,opt,name=competition_id,json=competitionId,proto3" json:"competition_id,omitempty"`
|
||||
TaskId string `protobuf:"bytes,3,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
|
||||
Content string `protobuf:"bytes,4,opt,name=content,proto3" json:"content,omitempty"`
|
||||
Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
|
||||
ReviewStatus ReviewStatus `protobuf:"varint,6,opt,name=review_status,json=reviewStatus,proto3,enum=review.ReviewStatus" json:"review_status,omitempty"`
|
||||
SubmittedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=submitted_at,json=submittedAt,proto3" json:"submitted_at,omitempty"`
|
||||
CheckedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=checked_at,json=checkedAt,proto3,oneof" json:"checked_at,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SubmissionForReview) Reset() {
|
||||
*x = SubmissionForReview{}
|
||||
mi := &file_api_proto_review_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SubmissionForReview) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SubmissionForReview) ProtoMessage() {}
|
||||
|
||||
func (x *SubmissionForReview) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_review_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SubmissionForReview.ProtoReflect.Descriptor instead.
|
||||
func (*SubmissionForReview) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_review_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *SubmissionForReview) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SubmissionForReview) GetCompetitionId() string {
|
||||
if x != nil {
|
||||
return x.CompetitionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SubmissionForReview) GetTaskId() string {
|
||||
if x != nil {
|
||||
return x.TaskId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SubmissionForReview) GetContent() string {
|
||||
if x != nil {
|
||||
return x.Content
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SubmissionForReview) GetDescription() string {
|
||||
if x != nil {
|
||||
return x.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SubmissionForReview) GetReviewStatus() ReviewStatus {
|
||||
if x != nil {
|
||||
return x.ReviewStatus
|
||||
}
|
||||
return ReviewStatus_REVIEW_STATUS_UNSPECIFIED
|
||||
}
|
||||
|
||||
func (x *SubmissionForReview) GetSubmittedAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.SubmittedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *SubmissionForReview) GetCheckedAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.CheckedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ListSubmissionsForReviewRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
|
||||
PageToken int32 `protobuf:"varint,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
|
||||
Status *ReviewStatus `protobuf:"varint,3,opt,name=status,proto3,enum=review.ReviewStatus,oneof" json:"status,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ListSubmissionsForReviewRequest) Reset() {
|
||||
*x = ListSubmissionsForReviewRequest{}
|
||||
mi := &file_api_proto_review_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ListSubmissionsForReviewRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListSubmissionsForReviewRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ListSubmissionsForReviewRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_review_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListSubmissionsForReviewRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ListSubmissionsForReviewRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_review_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *ListSubmissionsForReviewRequest) GetPageSize() int32 {
|
||||
if x != nil {
|
||||
return x.PageSize
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ListSubmissionsForReviewRequest) GetPageToken() int32 {
|
||||
if x != nil {
|
||||
return x.PageToken
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ListSubmissionsForReviewRequest) GetStatus() ReviewStatus {
|
||||
if x != nil && x.Status != nil {
|
||||
return *x.Status
|
||||
}
|
||||
return ReviewStatus_REVIEW_STATUS_UNSPECIFIED
|
||||
}
|
||||
|
||||
type ListSubmissionsForReviewResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Submissions []*SubmissionSummary `protobuf:"bytes,1,rep,name=submissions,proto3" json:"submissions,omitempty"`
|
||||
TotalCount int32 `protobuf:"varint,2,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"`
|
||||
NextPageToken int32 `protobuf:"varint,3,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ListSubmissionsForReviewResponse) Reset() {
|
||||
*x = ListSubmissionsForReviewResponse{}
|
||||
mi := &file_api_proto_review_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ListSubmissionsForReviewResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListSubmissionsForReviewResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ListSubmissionsForReviewResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_review_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListSubmissionsForReviewResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ListSubmissionsForReviewResponse) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_review_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *ListSubmissionsForReviewResponse) GetSubmissions() []*SubmissionSummary {
|
||||
if x != nil {
|
||||
return x.Submissions
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ListSubmissionsForReviewResponse) GetTotalCount() int32 {
|
||||
if x != nil {
|
||||
return x.TotalCount
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ListSubmissionsForReviewResponse) GetNextPageToken() int32 {
|
||||
if x != nil {
|
||||
return x.NextPageToken
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type GetSubmissionForReviewRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
SubmissionId string `protobuf:"bytes,1,opt,name=submission_id,json=submissionId,proto3" json:"submission_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetSubmissionForReviewRequest) Reset() {
|
||||
*x = GetSubmissionForReviewRequest{}
|
||||
mi := &file_api_proto_review_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetSubmissionForReviewRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetSubmissionForReviewRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetSubmissionForReviewRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_review_proto_msgTypes[5]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetSubmissionForReviewRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetSubmissionForReviewRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_review_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *GetSubmissionForReviewRequest) GetSubmissionId() string {
|
||||
if x != nil {
|
||||
return x.SubmissionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type EvaluateSubmissionRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
SubmissionId string `protobuf:"bytes,1,opt,name=submission_id,json=submissionId,proto3" json:"submission_id,omitempty"`
|
||||
EarnedPoints int32 `protobuf:"varint,2,opt,name=earned_points,json=earnedPoints,proto3" json:"earned_points,omitempty"`
|
||||
ReviewerComment string `protobuf:"bytes,3,opt,name=reviewer_comment,json=reviewerComment,proto3" json:"reviewer_comment,omitempty"`
|
||||
Marks []*CriteriaMark `protobuf:"bytes,4,rep,name=marks,proto3" json:"marks,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *EvaluateSubmissionRequest) Reset() {
|
||||
*x = EvaluateSubmissionRequest{}
|
||||
mi := &file_api_proto_review_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *EvaluateSubmissionRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*EvaluateSubmissionRequest) ProtoMessage() {}
|
||||
|
||||
func (x *EvaluateSubmissionRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_review_proto_msgTypes[6]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use EvaluateSubmissionRequest.ProtoReflect.Descriptor instead.
|
||||
func (*EvaluateSubmissionRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_review_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *EvaluateSubmissionRequest) GetSubmissionId() string {
|
||||
if x != nil {
|
||||
return x.SubmissionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *EvaluateSubmissionRequest) GetEarnedPoints() int32 {
|
||||
if x != nil {
|
||||
return x.EarnedPoints
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *EvaluateSubmissionRequest) GetReviewerComment() string {
|
||||
if x != nil {
|
||||
return x.ReviewerComment
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *EvaluateSubmissionRequest) GetMarks() []*CriteriaMark {
|
||||
if x != nil {
|
||||
return x.Marks
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type EvaluateSubmissionResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
SubmissionId string `protobuf:"bytes,1,opt,name=submission_id,json=submissionId,proto3" json:"submission_id,omitempty"`
|
||||
FinalScore int32 `protobuf:"varint,2,opt,name=final_score,json=finalScore,proto3" json:"final_score,omitempty"`
|
||||
NewStatus ReviewStatus `protobuf:"varint,3,opt,name=new_status,json=newStatus,proto3,enum=review.ReviewStatus" json:"new_status,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *EvaluateSubmissionResponse) Reset() {
|
||||
*x = EvaluateSubmissionResponse{}
|
||||
mi := &file_api_proto_review_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *EvaluateSubmissionResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*EvaluateSubmissionResponse) ProtoMessage() {}
|
||||
|
||||
func (x *EvaluateSubmissionResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_review_proto_msgTypes[7]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use EvaluateSubmissionResponse.ProtoReflect.Descriptor instead.
|
||||
func (*EvaluateSubmissionResponse) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_review_proto_rawDescGZIP(), []int{7}
|
||||
}
|
||||
|
||||
func (x *EvaluateSubmissionResponse) GetSubmissionId() string {
|
||||
if x != nil {
|
||||
return x.SubmissionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *EvaluateSubmissionResponse) GetFinalScore() int32 {
|
||||
if x != nil {
|
||||
return x.FinalScore
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *EvaluateSubmissionResponse) GetNewStatus() ReviewStatus {
|
||||
if x != nil {
|
||||
return x.NewStatus
|
||||
}
|
||||
return ReviewStatus_REVIEW_STATUS_UNSPECIFIED
|
||||
}
|
||||
|
||||
type ReleaseSubmissionRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
SubmissionId string `protobuf:"bytes,1,opt,name=submission_id,json=submissionId,proto3" json:"submission_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ReleaseSubmissionRequest) Reset() {
|
||||
*x = ReleaseSubmissionRequest{}
|
||||
mi := &file_api_proto_review_proto_msgTypes[8]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ReleaseSubmissionRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ReleaseSubmissionRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ReleaseSubmissionRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_review_proto_msgTypes[8]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ReleaseSubmissionRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ReleaseSubmissionRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_review_proto_rawDescGZIP(), []int{8}
|
||||
}
|
||||
|
||||
func (x *ReleaseSubmissionRequest) GetSubmissionId() string {
|
||||
if x != nil {
|
||||
return x.SubmissionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_api_proto_review_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_api_proto_review_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x16api/proto/review.proto\x12\x06review\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1bgoogle/protobuf/empty.proto\"6\n" +
|
||||
"\fCriteriaMark\x12\x12\n" +
|
||||
"\x04slug\x18\x01 \x01(\tR\x04slug\x12\x12\n" +
|
||||
"\x04mark\x18\x02 \x01(\x01R\x04mark\"\xa9\x02\n" +
|
||||
"\x11SubmissionSummary\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\x12%\n" +
|
||||
"\x0ecompetition_id\x18\x02 \x01(\tR\rcompetitionId\x12\x17\n" +
|
||||
"\atask_id\x18\x03 \x01(\tR\x06taskId\x12+\n" +
|
||||
"\x11competition_title\x18\x04 \x01(\tR\x10competitionTitle\x12\x1d\n" +
|
||||
"\n" +
|
||||
"task_title\x18\x05 \x01(\tR\ttaskTitle\x12=\n" +
|
||||
"\fsubmitted_at\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\vsubmittedAt\x129\n" +
|
||||
"\rreview_status\x18\a \x01(\x0e2\x14.review.ReviewStatusR\freviewStatus\"\xea\x02\n" +
|
||||
"\x13SubmissionForReview\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\x12%\n" +
|
||||
"\x0ecompetition_id\x18\x02 \x01(\tR\rcompetitionId\x12\x17\n" +
|
||||
"\atask_id\x18\x03 \x01(\tR\x06taskId\x12\x18\n" +
|
||||
"\acontent\x18\x04 \x01(\tR\acontent\x12 \n" +
|
||||
"\vdescription\x18\x05 \x01(\tR\vdescription\x129\n" +
|
||||
"\rreview_status\x18\x06 \x01(\x0e2\x14.review.ReviewStatusR\freviewStatus\x12=\n" +
|
||||
"\fsubmitted_at\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\vsubmittedAt\x12>\n" +
|
||||
"\n" +
|
||||
"checked_at\x18\b \x01(\v2\x1a.google.protobuf.TimestampH\x00R\tcheckedAt\x88\x01\x01B\r\n" +
|
||||
"\v_checked_at\"\x9b\x01\n" +
|
||||
"\x1fListSubmissionsForReviewRequest\x12\x1b\n" +
|
||||
"\tpage_size\x18\x01 \x01(\x05R\bpageSize\x12\x1d\n" +
|
||||
"\n" +
|
||||
"page_token\x18\x02 \x01(\x05R\tpageToken\x121\n" +
|
||||
"\x06status\x18\x03 \x01(\x0e2\x14.review.ReviewStatusH\x00R\x06status\x88\x01\x01B\t\n" +
|
||||
"\a_status\"\xa8\x01\n" +
|
||||
" ListSubmissionsForReviewResponse\x12;\n" +
|
||||
"\vsubmissions\x18\x01 \x03(\v2\x19.review.SubmissionSummaryR\vsubmissions\x12\x1f\n" +
|
||||
"\vtotal_count\x18\x02 \x01(\x05R\n" +
|
||||
"totalCount\x12&\n" +
|
||||
"\x0fnext_page_token\x18\x03 \x01(\x05R\rnextPageToken\"D\n" +
|
||||
"\x1dGetSubmissionForReviewRequest\x12#\n" +
|
||||
"\rsubmission_id\x18\x01 \x01(\tR\fsubmissionId\"\xbc\x01\n" +
|
||||
"\x19EvaluateSubmissionRequest\x12#\n" +
|
||||
"\rsubmission_id\x18\x01 \x01(\tR\fsubmissionId\x12#\n" +
|
||||
"\rearned_points\x18\x02 \x01(\x05R\fearnedPoints\x12)\n" +
|
||||
"\x10reviewer_comment\x18\x03 \x01(\tR\x0freviewerComment\x12*\n" +
|
||||
"\x05marks\x18\x04 \x03(\v2\x14.review.CriteriaMarkR\x05marks\"\x97\x01\n" +
|
||||
"\x1aEvaluateSubmissionResponse\x12#\n" +
|
||||
"\rsubmission_id\x18\x01 \x01(\tR\fsubmissionId\x12\x1f\n" +
|
||||
"\vfinal_score\x18\x02 \x01(\x05R\n" +
|
||||
"finalScore\x123\n" +
|
||||
"\n" +
|
||||
"new_status\x18\x03 \x01(\x0e2\x14.review.ReviewStatusR\tnewStatus\"?\n" +
|
||||
"\x18ReleaseSubmissionRequest\x12#\n" +
|
||||
"\rsubmission_id\x18\x01 \x01(\tR\fsubmissionId*\x9e\x01\n" +
|
||||
"\fReviewStatus\x12\x1d\n" +
|
||||
"\x19REVIEW_STATUS_UNSPECIFIED\x10\x00\x12\x19\n" +
|
||||
"\x15REVIEW_STATUS_PENDING\x10\x01\x12\x1b\n" +
|
||||
"\x17REVIEW_STATUS_IN_REVIEW\x10\x02\x12\x1b\n" +
|
||||
"\x17REVIEW_STATUS_COMPLETED\x10\x03\x12\x1a\n" +
|
||||
"\x16REVIEW_STATUS_REJECTED\x10\x042\x88\x03\n" +
|
||||
"\rReviewService\x12m\n" +
|
||||
"\x18ListSubmissionsForReview\x12'.review.ListSubmissionsForReviewRequest\x1a(.review.ListSubmissionsForReviewResponse\x12\\\n" +
|
||||
"\x16GetSubmissionForReview\x12%.review.GetSubmissionForReviewRequest\x1a\x1b.review.SubmissionForReview\x12[\n" +
|
||||
"\x12EvaluateSubmission\x12!.review.EvaluateSubmissionRequest\x1a\".review.EvaluateSubmissionResponse\x12M\n" +
|
||||
"\x11ReleaseSubmission\x12 .review.ReleaseSubmissionRequest\x1a\x16.google.protobuf.EmptyB\x10Z\x0epkg/api/reviewb\x06proto3"
|
||||
|
||||
var (
|
||||
file_api_proto_review_proto_rawDescOnce sync.Once
|
||||
file_api_proto_review_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_api_proto_review_proto_rawDescGZIP() []byte {
|
||||
file_api_proto_review_proto_rawDescOnce.Do(func() {
|
||||
file_api_proto_review_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_api_proto_review_proto_rawDesc), len(file_api_proto_review_proto_rawDesc)))
|
||||
})
|
||||
return file_api_proto_review_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_api_proto_review_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_api_proto_review_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
|
||||
var file_api_proto_review_proto_goTypes = []any{
|
||||
(ReviewStatus)(0), // 0: review.ReviewStatus
|
||||
(*CriteriaMark)(nil), // 1: review.CriteriaMark
|
||||
(*SubmissionSummary)(nil), // 2: review.SubmissionSummary
|
||||
(*SubmissionForReview)(nil), // 3: review.SubmissionForReview
|
||||
(*ListSubmissionsForReviewRequest)(nil), // 4: review.ListSubmissionsForReviewRequest
|
||||
(*ListSubmissionsForReviewResponse)(nil), // 5: review.ListSubmissionsForReviewResponse
|
||||
(*GetSubmissionForReviewRequest)(nil), // 6: review.GetSubmissionForReviewRequest
|
||||
(*EvaluateSubmissionRequest)(nil), // 7: review.EvaluateSubmissionRequest
|
||||
(*EvaluateSubmissionResponse)(nil), // 8: review.EvaluateSubmissionResponse
|
||||
(*ReleaseSubmissionRequest)(nil), // 9: review.ReleaseSubmissionRequest
|
||||
(*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp
|
||||
(*emptypb.Empty)(nil), // 11: google.protobuf.Empty
|
||||
}
|
||||
var file_api_proto_review_proto_depIdxs = []int32{
|
||||
10, // 0: review.SubmissionSummary.submitted_at:type_name -> google.protobuf.Timestamp
|
||||
0, // 1: review.SubmissionSummary.review_status:type_name -> review.ReviewStatus
|
||||
0, // 2: review.SubmissionForReview.review_status:type_name -> review.ReviewStatus
|
||||
10, // 3: review.SubmissionForReview.submitted_at:type_name -> google.protobuf.Timestamp
|
||||
10, // 4: review.SubmissionForReview.checked_at:type_name -> google.protobuf.Timestamp
|
||||
0, // 5: review.ListSubmissionsForReviewRequest.status:type_name -> review.ReviewStatus
|
||||
2, // 6: review.ListSubmissionsForReviewResponse.submissions:type_name -> review.SubmissionSummary
|
||||
1, // 7: review.EvaluateSubmissionRequest.marks:type_name -> review.CriteriaMark
|
||||
0, // 8: review.EvaluateSubmissionResponse.new_status:type_name -> review.ReviewStatus
|
||||
4, // 9: review.ReviewService.ListSubmissionsForReview:input_type -> review.ListSubmissionsForReviewRequest
|
||||
6, // 10: review.ReviewService.GetSubmissionForReview:input_type -> review.GetSubmissionForReviewRequest
|
||||
7, // 11: review.ReviewService.EvaluateSubmission:input_type -> review.EvaluateSubmissionRequest
|
||||
9, // 12: review.ReviewService.ReleaseSubmission:input_type -> review.ReleaseSubmissionRequest
|
||||
5, // 13: review.ReviewService.ListSubmissionsForReview:output_type -> review.ListSubmissionsForReviewResponse
|
||||
3, // 14: review.ReviewService.GetSubmissionForReview:output_type -> review.SubmissionForReview
|
||||
8, // 15: review.ReviewService.EvaluateSubmission:output_type -> review.EvaluateSubmissionResponse
|
||||
11, // 16: review.ReviewService.ReleaseSubmission:output_type -> google.protobuf.Empty
|
||||
13, // [13:17] is the sub-list for method output_type
|
||||
9, // [9:13] is the sub-list for method input_type
|
||||
9, // [9:9] is the sub-list for extension type_name
|
||||
9, // [9:9] is the sub-list for extension extendee
|
||||
0, // [0:9] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_api_proto_review_proto_init() }
|
||||
func file_api_proto_review_proto_init() {
|
||||
if File_api_proto_review_proto != nil {
|
||||
return
|
||||
}
|
||||
file_api_proto_review_proto_msgTypes[2].OneofWrappers = []any{}
|
||||
file_api_proto_review_proto_msgTypes[3].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_proto_review_proto_rawDesc), len(file_api_proto_review_proto_rawDesc)),
|
||||
NumEnums: 1,
|
||||
NumMessages: 9,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_api_proto_review_proto_goTypes,
|
||||
DependencyIndexes: file_api_proto_review_proto_depIdxs,
|
||||
EnumInfos: file_api_proto_review_proto_enumTypes,
|
||||
MessageInfos: file_api_proto_review_proto_msgTypes,
|
||||
}.Build()
|
||||
File_api_proto_review_proto = out.File
|
||||
file_api_proto_review_proto_goTypes = nil
|
||||
file_api_proto_review_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,236 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.0
|
||||
// - protoc v6.33.2
|
||||
// source: api/proto/review.proto
|
||||
|
||||
package review
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
ReviewService_ListSubmissionsForReview_FullMethodName = "/review.ReviewService/ListSubmissionsForReview"
|
||||
ReviewService_GetSubmissionForReview_FullMethodName = "/review.ReviewService/GetSubmissionForReview"
|
||||
ReviewService_EvaluateSubmission_FullMethodName = "/review.ReviewService/EvaluateSubmission"
|
||||
ReviewService_ReleaseSubmission_FullMethodName = "/review.ReviewService/ReleaseSubmission"
|
||||
)
|
||||
|
||||
// ReviewServiceClient is the client API for ReviewService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type ReviewServiceClient interface {
|
||||
ListSubmissionsForReview(ctx context.Context, in *ListSubmissionsForReviewRequest, opts ...grpc.CallOption) (*ListSubmissionsForReviewResponse, error)
|
||||
GetSubmissionForReview(ctx context.Context, in *GetSubmissionForReviewRequest, opts ...grpc.CallOption) (*SubmissionForReview, error)
|
||||
EvaluateSubmission(ctx context.Context, in *EvaluateSubmissionRequest, opts ...grpc.CallOption) (*EvaluateSubmissionResponse, error)
|
||||
ReleaseSubmission(ctx context.Context, in *ReleaseSubmissionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
}
|
||||
|
||||
type reviewServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewReviewServiceClient(cc grpc.ClientConnInterface) ReviewServiceClient {
|
||||
return &reviewServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *reviewServiceClient) ListSubmissionsForReview(ctx context.Context, in *ListSubmissionsForReviewRequest, opts ...grpc.CallOption) (*ListSubmissionsForReviewResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListSubmissionsForReviewResponse)
|
||||
err := c.cc.Invoke(ctx, ReviewService_ListSubmissionsForReview_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *reviewServiceClient) GetSubmissionForReview(ctx context.Context, in *GetSubmissionForReviewRequest, opts ...grpc.CallOption) (*SubmissionForReview, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SubmissionForReview)
|
||||
err := c.cc.Invoke(ctx, ReviewService_GetSubmissionForReview_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *reviewServiceClient) EvaluateSubmission(ctx context.Context, in *EvaluateSubmissionRequest, opts ...grpc.CallOption) (*EvaluateSubmissionResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(EvaluateSubmissionResponse)
|
||||
err := c.cc.Invoke(ctx, ReviewService_EvaluateSubmission_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *reviewServiceClient) ReleaseSubmission(ctx context.Context, in *ReleaseSubmissionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, ReviewService_ReleaseSubmission_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ReviewServiceServer is the server API for ReviewService service.
|
||||
// All implementations must embed UnimplementedReviewServiceServer
|
||||
// for forward compatibility.
|
||||
type ReviewServiceServer interface {
|
||||
ListSubmissionsForReview(context.Context, *ListSubmissionsForReviewRequest) (*ListSubmissionsForReviewResponse, error)
|
||||
GetSubmissionForReview(context.Context, *GetSubmissionForReviewRequest) (*SubmissionForReview, error)
|
||||
EvaluateSubmission(context.Context, *EvaluateSubmissionRequest) (*EvaluateSubmissionResponse, error)
|
||||
ReleaseSubmission(context.Context, *ReleaseSubmissionRequest) (*emptypb.Empty, error)
|
||||
mustEmbedUnimplementedReviewServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedReviewServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedReviewServiceServer struct{}
|
||||
|
||||
func (UnimplementedReviewServiceServer) ListSubmissionsForReview(context.Context, *ListSubmissionsForReviewRequest) (*ListSubmissionsForReviewResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListSubmissionsForReview not implemented")
|
||||
}
|
||||
func (UnimplementedReviewServiceServer) GetSubmissionForReview(context.Context, *GetSubmissionForReviewRequest) (*SubmissionForReview, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetSubmissionForReview not implemented")
|
||||
}
|
||||
func (UnimplementedReviewServiceServer) EvaluateSubmission(context.Context, *EvaluateSubmissionRequest) (*EvaluateSubmissionResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method EvaluateSubmission not implemented")
|
||||
}
|
||||
func (UnimplementedReviewServiceServer) ReleaseSubmission(context.Context, *ReleaseSubmissionRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ReleaseSubmission not implemented")
|
||||
}
|
||||
func (UnimplementedReviewServiceServer) mustEmbedUnimplementedReviewServiceServer() {}
|
||||
func (UnimplementedReviewServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeReviewServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ReviewServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeReviewServiceServer interface {
|
||||
mustEmbedUnimplementedReviewServiceServer()
|
||||
}
|
||||
|
||||
func RegisterReviewServiceServer(s grpc.ServiceRegistrar, srv ReviewServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedReviewServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&ReviewService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _ReviewService_ListSubmissionsForReview_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListSubmissionsForReviewRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ReviewServiceServer).ListSubmissionsForReview(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ReviewService_ListSubmissionsForReview_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ReviewServiceServer).ListSubmissionsForReview(ctx, req.(*ListSubmissionsForReviewRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ReviewService_GetSubmissionForReview_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetSubmissionForReviewRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ReviewServiceServer).GetSubmissionForReview(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ReviewService_GetSubmissionForReview_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ReviewServiceServer).GetSubmissionForReview(ctx, req.(*GetSubmissionForReviewRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ReviewService_EvaluateSubmission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(EvaluateSubmissionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ReviewServiceServer).EvaluateSubmission(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ReviewService_EvaluateSubmission_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ReviewServiceServer).EvaluateSubmission(ctx, req.(*EvaluateSubmissionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ReviewService_ReleaseSubmission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ReleaseSubmissionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ReviewServiceServer).ReleaseSubmission(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ReviewService_ReleaseSubmission_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ReviewServiceServer).ReleaseSubmission(ctx, req.(*ReleaseSubmissionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// ReviewService_ServiceDesc is the grpc.ServiceDesc for ReviewService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var ReviewService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "review.ReviewService",
|
||||
HandlerType: (*ReviewServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "ListSubmissionsForReview",
|
||||
Handler: _ReviewService_ListSubmissionsForReview_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetSubmissionForReview",
|
||||
Handler: _ReviewService_GetSubmissionForReview_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "EvaluateSubmission",
|
||||
Handler: _ReviewService_EvaluateSubmission_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ReleaseSubmission",
|
||||
Handler: _ReviewService_ReleaseSubmission_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "api/proto/review.proto",
|
||||
}
|
||||
@@ -0,0 +1,671 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc v6.33.2
|
||||
// source: api/proto/submission.proto
|
||||
|
||||
package submission
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type SubmissionStatus int32
|
||||
|
||||
const (
|
||||
SubmissionStatus_SUBMISSION_STATUS_UNSPECIFIED SubmissionStatus = 0
|
||||
SubmissionStatus_SUBMISSION_STATUS_PENDING SubmissionStatus = 1
|
||||
SubmissionStatus_SUBMISSION_STATUS_SENT_FOR_CHECK SubmissionStatus = 2
|
||||
SubmissionStatus_SUBMISSION_STATUS_CHECKING SubmissionStatus = 3
|
||||
SubmissionStatus_SUBMISSION_STATUS_CHECKED SubmissionStatus = 4
|
||||
SubmissionStatus_SUBMISSION_STATUS_FAILED SubmissionStatus = 5
|
||||
)
|
||||
|
||||
// Enum value maps for SubmissionStatus.
|
||||
var (
|
||||
SubmissionStatus_name = map[int32]string{
|
||||
0: "SUBMISSION_STATUS_UNSPECIFIED",
|
||||
1: "SUBMISSION_STATUS_PENDING",
|
||||
2: "SUBMISSION_STATUS_SENT_FOR_CHECK",
|
||||
3: "SUBMISSION_STATUS_CHECKING",
|
||||
4: "SUBMISSION_STATUS_CHECKED",
|
||||
5: "SUBMISSION_STATUS_FAILED",
|
||||
}
|
||||
SubmissionStatus_value = map[string]int32{
|
||||
"SUBMISSION_STATUS_UNSPECIFIED": 0,
|
||||
"SUBMISSION_STATUS_PENDING": 1,
|
||||
"SUBMISSION_STATUS_SENT_FOR_CHECK": 2,
|
||||
"SUBMISSION_STATUS_CHECKING": 3,
|
||||
"SUBMISSION_STATUS_CHECKED": 4,
|
||||
"SUBMISSION_STATUS_FAILED": 5,
|
||||
}
|
||||
)
|
||||
|
||||
func (x SubmissionStatus) Enum() *SubmissionStatus {
|
||||
p := new(SubmissionStatus)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x SubmissionStatus) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (SubmissionStatus) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_api_proto_submission_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (SubmissionStatus) Type() protoreflect.EnumType {
|
||||
return &file_api_proto_submission_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x SubmissionStatus) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SubmissionStatus.Descriptor instead.
|
||||
func (SubmissionStatus) EnumDescriptor() ([]byte, []int) {
|
||||
return file_api_proto_submission_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type Submission struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
||||
CompetitionId string `protobuf:"bytes,3,opt,name=competition_id,json=competitionId,proto3" json:"competition_id,omitempty"`
|
||||
TaskId string `protobuf:"bytes,4,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
|
||||
Status SubmissionStatus `protobuf:"varint,5,opt,name=status,proto3,enum=submission.SubmissionStatus" json:"status,omitempty"`
|
||||
EarnedPoints *int32 `protobuf:"varint,6,opt,name=earned_points,json=earnedPoints,proto3,oneof" json:"earned_points,omitempty"`
|
||||
SubmittedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=submitted_at,json=submittedAt,proto3" json:"submitted_at,omitempty"`
|
||||
CheckedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=checked_at,json=checkedAt,proto3,oneof" json:"checked_at,omitempty"`
|
||||
Content string `protobuf:"bytes,9,opt,name=content,proto3" json:"content,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Submission) Reset() {
|
||||
*x = Submission{}
|
||||
mi := &file_api_proto_submission_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Submission) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Submission) ProtoMessage() {}
|
||||
|
||||
func (x *Submission) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_submission_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Submission.ProtoReflect.Descriptor instead.
|
||||
func (*Submission) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_submission_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Submission) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Submission) GetUserId() string {
|
||||
if x != nil {
|
||||
return x.UserId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Submission) GetCompetitionId() string {
|
||||
if x != nil {
|
||||
return x.CompetitionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Submission) GetTaskId() string {
|
||||
if x != nil {
|
||||
return x.TaskId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Submission) GetStatus() SubmissionStatus {
|
||||
if x != nil {
|
||||
return x.Status
|
||||
}
|
||||
return SubmissionStatus_SUBMISSION_STATUS_UNSPECIFIED
|
||||
}
|
||||
|
||||
func (x *Submission) GetEarnedPoints() int32 {
|
||||
if x != nil && x.EarnedPoints != nil {
|
||||
return *x.EarnedPoints
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Submission) GetSubmittedAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.SubmittedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Submission) GetCheckedAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.CheckedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Submission) GetContent() string {
|
||||
if x != nil {
|
||||
return x.Content
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type SubmitTaskRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
CompetitionId string `protobuf:"bytes,1,opt,name=competition_id,json=competitionId,proto3" json:"competition_id,omitempty"`
|
||||
TaskId string `protobuf:"bytes,2,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
|
||||
Content []byte `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SubmitTaskRequest) Reset() {
|
||||
*x = SubmitTaskRequest{}
|
||||
mi := &file_api_proto_submission_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SubmitTaskRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SubmitTaskRequest) ProtoMessage() {}
|
||||
|
||||
func (x *SubmitTaskRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_submission_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SubmitTaskRequest.ProtoReflect.Descriptor instead.
|
||||
func (*SubmitTaskRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_submission_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *SubmitTaskRequest) GetCompetitionId() string {
|
||||
if x != nil {
|
||||
return x.CompetitionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SubmitTaskRequest) GetTaskId() string {
|
||||
if x != nil {
|
||||
return x.TaskId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SubmitTaskRequest) GetContent() []byte {
|
||||
if x != nil {
|
||||
return x.Content
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type GetSubmissionsHistoryRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
CompetitionId string `protobuf:"bytes,1,opt,name=competition_id,json=competitionId,proto3" json:"competition_id,omitempty"`
|
||||
TaskId string `protobuf:"bytes,2,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetSubmissionsHistoryRequest) Reset() {
|
||||
*x = GetSubmissionsHistoryRequest{}
|
||||
mi := &file_api_proto_submission_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetSubmissionsHistoryRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetSubmissionsHistoryRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetSubmissionsHistoryRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_submission_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetSubmissionsHistoryRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetSubmissionsHistoryRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_submission_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *GetSubmissionsHistoryRequest) GetCompetitionId() string {
|
||||
if x != nil {
|
||||
return x.CompetitionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *GetSubmissionsHistoryRequest) GetTaskId() string {
|
||||
if x != nil {
|
||||
return x.TaskId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type GetSubmissionsHistoryResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Submissions []*Submission `protobuf:"bytes,1,rep,name=submissions,proto3" json:"submissions,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetSubmissionsHistoryResponse) Reset() {
|
||||
*x = GetSubmissionsHistoryResponse{}
|
||||
mi := &file_api_proto_submission_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetSubmissionsHistoryResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetSubmissionsHistoryResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetSubmissionsHistoryResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_submission_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetSubmissionsHistoryResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetSubmissionsHistoryResponse) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_submission_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *GetSubmissionsHistoryResponse) GetSubmissions() []*Submission {
|
||||
if x != nil {
|
||||
return x.Submissions
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type GetSubmissionRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
SubmissionId string `protobuf:"bytes,1,opt,name=submission_id,json=submissionId,proto3" json:"submission_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetSubmissionRequest) Reset() {
|
||||
*x = GetSubmissionRequest{}
|
||||
mi := &file_api_proto_submission_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetSubmissionRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetSubmissionRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetSubmissionRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_submission_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetSubmissionRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetSubmissionRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_submission_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *GetSubmissionRequest) GetSubmissionId() string {
|
||||
if x != nil {
|
||||
return x.SubmissionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ListSubmissionsRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
|
||||
PageToken int32 `protobuf:"varint,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
|
||||
CompetitionId *string `protobuf:"bytes,3,opt,name=competition_id,json=competitionId,proto3,oneof" json:"competition_id,omitempty"`
|
||||
TaskId *string `protobuf:"bytes,4,opt,name=task_id,json=taskId,proto3,oneof" json:"task_id,omitempty"`
|
||||
UserId *string `protobuf:"bytes,5,opt,name=user_id,json=userId,proto3,oneof" json:"user_id,omitempty"`
|
||||
Status *SubmissionStatus `protobuf:"varint,6,opt,name=status,proto3,enum=submission.SubmissionStatus,oneof" json:"status,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ListSubmissionsRequest) Reset() {
|
||||
*x = ListSubmissionsRequest{}
|
||||
mi := &file_api_proto_submission_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ListSubmissionsRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListSubmissionsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ListSubmissionsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_submission_proto_msgTypes[5]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListSubmissionsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ListSubmissionsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_submission_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *ListSubmissionsRequest) GetPageSize() int32 {
|
||||
if x != nil {
|
||||
return x.PageSize
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ListSubmissionsRequest) GetPageToken() int32 {
|
||||
if x != nil {
|
||||
return x.PageToken
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ListSubmissionsRequest) GetCompetitionId() string {
|
||||
if x != nil && x.CompetitionId != nil {
|
||||
return *x.CompetitionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ListSubmissionsRequest) GetTaskId() string {
|
||||
if x != nil && x.TaskId != nil {
|
||||
return *x.TaskId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ListSubmissionsRequest) GetUserId() string {
|
||||
if x != nil && x.UserId != nil {
|
||||
return *x.UserId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ListSubmissionsRequest) GetStatus() SubmissionStatus {
|
||||
if x != nil && x.Status != nil {
|
||||
return *x.Status
|
||||
}
|
||||
return SubmissionStatus_SUBMISSION_STATUS_UNSPECIFIED
|
||||
}
|
||||
|
||||
type ListSubmissionsResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Submissions []*Submission `protobuf:"bytes,1,rep,name=submissions,proto3" json:"submissions,omitempty"`
|
||||
TotalCount int32 `protobuf:"varint,2,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"`
|
||||
NextPageToken int32 `protobuf:"varint,3,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ListSubmissionsResponse) Reset() {
|
||||
*x = ListSubmissionsResponse{}
|
||||
mi := &file_api_proto_submission_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ListSubmissionsResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListSubmissionsResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ListSubmissionsResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_submission_proto_msgTypes[6]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListSubmissionsResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ListSubmissionsResponse) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_submission_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *ListSubmissionsResponse) GetSubmissions() []*Submission {
|
||||
if x != nil {
|
||||
return x.Submissions
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ListSubmissionsResponse) GetTotalCount() int32 {
|
||||
if x != nil {
|
||||
return x.TotalCount
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ListSubmissionsResponse) GetNextPageToken() int32 {
|
||||
if x != nil {
|
||||
return x.NextPageToken
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_api_proto_submission_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_api_proto_submission_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x1aapi/proto/submission.proto\x12\n" +
|
||||
"submission\x1a\x1fgoogle/protobuf/timestamp.proto\"\x8f\x03\n" +
|
||||
"\n" +
|
||||
"Submission\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\x12\x17\n" +
|
||||
"\auser_id\x18\x02 \x01(\tR\x06userId\x12%\n" +
|
||||
"\x0ecompetition_id\x18\x03 \x01(\tR\rcompetitionId\x12\x17\n" +
|
||||
"\atask_id\x18\x04 \x01(\tR\x06taskId\x124\n" +
|
||||
"\x06status\x18\x05 \x01(\x0e2\x1c.submission.SubmissionStatusR\x06status\x12(\n" +
|
||||
"\rearned_points\x18\x06 \x01(\x05H\x00R\fearnedPoints\x88\x01\x01\x12=\n" +
|
||||
"\fsubmitted_at\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\vsubmittedAt\x12>\n" +
|
||||
"\n" +
|
||||
"checked_at\x18\b \x01(\v2\x1a.google.protobuf.TimestampH\x01R\tcheckedAt\x88\x01\x01\x12\x18\n" +
|
||||
"\acontent\x18\t \x01(\tR\acontentB\x10\n" +
|
||||
"\x0e_earned_pointsB\r\n" +
|
||||
"\v_checked_at\"m\n" +
|
||||
"\x11SubmitTaskRequest\x12%\n" +
|
||||
"\x0ecompetition_id\x18\x01 \x01(\tR\rcompetitionId\x12\x17\n" +
|
||||
"\atask_id\x18\x02 \x01(\tR\x06taskId\x12\x18\n" +
|
||||
"\acontent\x18\x03 \x01(\fR\acontent\"^\n" +
|
||||
"\x1cGetSubmissionsHistoryRequest\x12%\n" +
|
||||
"\x0ecompetition_id\x18\x01 \x01(\tR\rcompetitionId\x12\x17\n" +
|
||||
"\atask_id\x18\x02 \x01(\tR\x06taskId\"Y\n" +
|
||||
"\x1dGetSubmissionsHistoryResponse\x128\n" +
|
||||
"\vsubmissions\x18\x01 \x03(\v2\x16.submission.SubmissionR\vsubmissions\";\n" +
|
||||
"\x14GetSubmissionRequest\x12#\n" +
|
||||
"\rsubmission_id\x18\x01 \x01(\tR\fsubmissionId\"\xad\x02\n" +
|
||||
"\x16ListSubmissionsRequest\x12\x1b\n" +
|
||||
"\tpage_size\x18\x01 \x01(\x05R\bpageSize\x12\x1d\n" +
|
||||
"\n" +
|
||||
"page_token\x18\x02 \x01(\x05R\tpageToken\x12*\n" +
|
||||
"\x0ecompetition_id\x18\x03 \x01(\tH\x00R\rcompetitionId\x88\x01\x01\x12\x1c\n" +
|
||||
"\atask_id\x18\x04 \x01(\tH\x01R\x06taskId\x88\x01\x01\x12\x1c\n" +
|
||||
"\auser_id\x18\x05 \x01(\tH\x02R\x06userId\x88\x01\x01\x129\n" +
|
||||
"\x06status\x18\x06 \x01(\x0e2\x1c.submission.SubmissionStatusH\x03R\x06status\x88\x01\x01B\x11\n" +
|
||||
"\x0f_competition_idB\n" +
|
||||
"\n" +
|
||||
"\b_task_idB\n" +
|
||||
"\n" +
|
||||
"\b_user_idB\t\n" +
|
||||
"\a_status\"\x9c\x01\n" +
|
||||
"\x17ListSubmissionsResponse\x128\n" +
|
||||
"\vsubmissions\x18\x01 \x03(\v2\x16.submission.SubmissionR\vsubmissions\x12\x1f\n" +
|
||||
"\vtotal_count\x18\x02 \x01(\x05R\n" +
|
||||
"totalCount\x12&\n" +
|
||||
"\x0fnext_page_token\x18\x03 \x01(\x05R\rnextPageToken*\xd7\x01\n" +
|
||||
"\x10SubmissionStatus\x12!\n" +
|
||||
"\x1dSUBMISSION_STATUS_UNSPECIFIED\x10\x00\x12\x1d\n" +
|
||||
"\x19SUBMISSION_STATUS_PENDING\x10\x01\x12$\n" +
|
||||
" SUBMISSION_STATUS_SENT_FOR_CHECK\x10\x02\x12\x1e\n" +
|
||||
"\x1aSUBMISSION_STATUS_CHECKING\x10\x03\x12\x1d\n" +
|
||||
"\x19SUBMISSION_STATUS_CHECKED\x10\x04\x12\x1c\n" +
|
||||
"\x18SUBMISSION_STATUS_FAILED\x10\x052\xed\x02\n" +
|
||||
"\x11SubmissionService\x12C\n" +
|
||||
"\n" +
|
||||
"SubmitTask\x12\x1d.submission.SubmitTaskRequest\x1a\x16.submission.Submission\x12l\n" +
|
||||
"\x15GetSubmissionsHistory\x12(.submission.GetSubmissionsHistoryRequest\x1a).submission.GetSubmissionsHistoryResponse\x12I\n" +
|
||||
"\rGetSubmission\x12 .submission.GetSubmissionRequest\x1a\x16.submission.Submission\x12Z\n" +
|
||||
"\x0fListSubmissions\x12\".submission.ListSubmissionsRequest\x1a#.submission.ListSubmissionsResponseB\x14Z\x12pkg/api/submissionb\x06proto3"
|
||||
|
||||
var (
|
||||
file_api_proto_submission_proto_rawDescOnce sync.Once
|
||||
file_api_proto_submission_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_api_proto_submission_proto_rawDescGZIP() []byte {
|
||||
file_api_proto_submission_proto_rawDescOnce.Do(func() {
|
||||
file_api_proto_submission_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_api_proto_submission_proto_rawDesc), len(file_api_proto_submission_proto_rawDesc)))
|
||||
})
|
||||
return file_api_proto_submission_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_api_proto_submission_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_api_proto_submission_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
||||
var file_api_proto_submission_proto_goTypes = []any{
|
||||
(SubmissionStatus)(0), // 0: submission.SubmissionStatus
|
||||
(*Submission)(nil), // 1: submission.Submission
|
||||
(*SubmitTaskRequest)(nil), // 2: submission.SubmitTaskRequest
|
||||
(*GetSubmissionsHistoryRequest)(nil), // 3: submission.GetSubmissionsHistoryRequest
|
||||
(*GetSubmissionsHistoryResponse)(nil), // 4: submission.GetSubmissionsHistoryResponse
|
||||
(*GetSubmissionRequest)(nil), // 5: submission.GetSubmissionRequest
|
||||
(*ListSubmissionsRequest)(nil), // 6: submission.ListSubmissionsRequest
|
||||
(*ListSubmissionsResponse)(nil), // 7: submission.ListSubmissionsResponse
|
||||
(*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp
|
||||
}
|
||||
var file_api_proto_submission_proto_depIdxs = []int32{
|
||||
0, // 0: submission.Submission.status:type_name -> submission.SubmissionStatus
|
||||
8, // 1: submission.Submission.submitted_at:type_name -> google.protobuf.Timestamp
|
||||
8, // 2: submission.Submission.checked_at:type_name -> google.protobuf.Timestamp
|
||||
1, // 3: submission.GetSubmissionsHistoryResponse.submissions:type_name -> submission.Submission
|
||||
0, // 4: submission.ListSubmissionsRequest.status:type_name -> submission.SubmissionStatus
|
||||
1, // 5: submission.ListSubmissionsResponse.submissions:type_name -> submission.Submission
|
||||
2, // 6: submission.SubmissionService.SubmitTask:input_type -> submission.SubmitTaskRequest
|
||||
3, // 7: submission.SubmissionService.GetSubmissionsHistory:input_type -> submission.GetSubmissionsHistoryRequest
|
||||
5, // 8: submission.SubmissionService.GetSubmission:input_type -> submission.GetSubmissionRequest
|
||||
6, // 9: submission.SubmissionService.ListSubmissions:input_type -> submission.ListSubmissionsRequest
|
||||
1, // 10: submission.SubmissionService.SubmitTask:output_type -> submission.Submission
|
||||
4, // 11: submission.SubmissionService.GetSubmissionsHistory:output_type -> submission.GetSubmissionsHistoryResponse
|
||||
1, // 12: submission.SubmissionService.GetSubmission:output_type -> submission.Submission
|
||||
7, // 13: submission.SubmissionService.ListSubmissions:output_type -> submission.ListSubmissionsResponse
|
||||
10, // [10:14] is the sub-list for method output_type
|
||||
6, // [6:10] is the sub-list for method input_type
|
||||
6, // [6:6] is the sub-list for extension type_name
|
||||
6, // [6:6] is the sub-list for extension extendee
|
||||
0, // [0:6] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_api_proto_submission_proto_init() }
|
||||
func file_api_proto_submission_proto_init() {
|
||||
if File_api_proto_submission_proto != nil {
|
||||
return
|
||||
}
|
||||
file_api_proto_submission_proto_msgTypes[0].OneofWrappers = []any{}
|
||||
file_api_proto_submission_proto_msgTypes[5].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_proto_submission_proto_rawDesc), len(file_api_proto_submission_proto_rawDesc)),
|
||||
NumEnums: 1,
|
||||
NumMessages: 7,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_api_proto_submission_proto_goTypes,
|
||||
DependencyIndexes: file_api_proto_submission_proto_depIdxs,
|
||||
EnumInfos: file_api_proto_submission_proto_enumTypes,
|
||||
MessageInfos: file_api_proto_submission_proto_msgTypes,
|
||||
}.Build()
|
||||
File_api_proto_submission_proto = out.File
|
||||
file_api_proto_submission_proto_goTypes = nil
|
||||
file_api_proto_submission_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,235 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.0
|
||||
// - protoc v6.33.2
|
||||
// source: api/proto/submission.proto
|
||||
|
||||
package submission
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
SubmissionService_SubmitTask_FullMethodName = "/submission.SubmissionService/SubmitTask"
|
||||
SubmissionService_GetSubmissionsHistory_FullMethodName = "/submission.SubmissionService/GetSubmissionsHistory"
|
||||
SubmissionService_GetSubmission_FullMethodName = "/submission.SubmissionService/GetSubmission"
|
||||
SubmissionService_ListSubmissions_FullMethodName = "/submission.SubmissionService/ListSubmissions"
|
||||
)
|
||||
|
||||
// SubmissionServiceClient is the client API for SubmissionService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type SubmissionServiceClient interface {
|
||||
SubmitTask(ctx context.Context, in *SubmitTaskRequest, opts ...grpc.CallOption) (*Submission, error)
|
||||
GetSubmissionsHistory(ctx context.Context, in *GetSubmissionsHistoryRequest, opts ...grpc.CallOption) (*GetSubmissionsHistoryResponse, error)
|
||||
GetSubmission(ctx context.Context, in *GetSubmissionRequest, opts ...grpc.CallOption) (*Submission, error)
|
||||
ListSubmissions(ctx context.Context, in *ListSubmissionsRequest, opts ...grpc.CallOption) (*ListSubmissionsResponse, error)
|
||||
}
|
||||
|
||||
type submissionServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewSubmissionServiceClient(cc grpc.ClientConnInterface) SubmissionServiceClient {
|
||||
return &submissionServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *submissionServiceClient) SubmitTask(ctx context.Context, in *SubmitTaskRequest, opts ...grpc.CallOption) (*Submission, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Submission)
|
||||
err := c.cc.Invoke(ctx, SubmissionService_SubmitTask_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *submissionServiceClient) GetSubmissionsHistory(ctx context.Context, in *GetSubmissionsHistoryRequest, opts ...grpc.CallOption) (*GetSubmissionsHistoryResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetSubmissionsHistoryResponse)
|
||||
err := c.cc.Invoke(ctx, SubmissionService_GetSubmissionsHistory_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *submissionServiceClient) GetSubmission(ctx context.Context, in *GetSubmissionRequest, opts ...grpc.CallOption) (*Submission, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Submission)
|
||||
err := c.cc.Invoke(ctx, SubmissionService_GetSubmission_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *submissionServiceClient) ListSubmissions(ctx context.Context, in *ListSubmissionsRequest, opts ...grpc.CallOption) (*ListSubmissionsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListSubmissionsResponse)
|
||||
err := c.cc.Invoke(ctx, SubmissionService_ListSubmissions_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// SubmissionServiceServer is the server API for SubmissionService service.
|
||||
// All implementations must embed UnimplementedSubmissionServiceServer
|
||||
// for forward compatibility.
|
||||
type SubmissionServiceServer interface {
|
||||
SubmitTask(context.Context, *SubmitTaskRequest) (*Submission, error)
|
||||
GetSubmissionsHistory(context.Context, *GetSubmissionsHistoryRequest) (*GetSubmissionsHistoryResponse, error)
|
||||
GetSubmission(context.Context, *GetSubmissionRequest) (*Submission, error)
|
||||
ListSubmissions(context.Context, *ListSubmissionsRequest) (*ListSubmissionsResponse, error)
|
||||
mustEmbedUnimplementedSubmissionServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedSubmissionServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedSubmissionServiceServer struct{}
|
||||
|
||||
func (UnimplementedSubmissionServiceServer) SubmitTask(context.Context, *SubmitTaskRequest) (*Submission, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SubmitTask not implemented")
|
||||
}
|
||||
func (UnimplementedSubmissionServiceServer) GetSubmissionsHistory(context.Context, *GetSubmissionsHistoryRequest) (*GetSubmissionsHistoryResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetSubmissionsHistory not implemented")
|
||||
}
|
||||
func (UnimplementedSubmissionServiceServer) GetSubmission(context.Context, *GetSubmissionRequest) (*Submission, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetSubmission not implemented")
|
||||
}
|
||||
func (UnimplementedSubmissionServiceServer) ListSubmissions(context.Context, *ListSubmissionsRequest) (*ListSubmissionsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListSubmissions not implemented")
|
||||
}
|
||||
func (UnimplementedSubmissionServiceServer) mustEmbedUnimplementedSubmissionServiceServer() {}
|
||||
func (UnimplementedSubmissionServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeSubmissionServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to SubmissionServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeSubmissionServiceServer interface {
|
||||
mustEmbedUnimplementedSubmissionServiceServer()
|
||||
}
|
||||
|
||||
func RegisterSubmissionServiceServer(s grpc.ServiceRegistrar, srv SubmissionServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedSubmissionServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&SubmissionService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _SubmissionService_SubmitTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SubmitTaskRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SubmissionServiceServer).SubmitTask(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: SubmissionService_SubmitTask_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SubmissionServiceServer).SubmitTask(ctx, req.(*SubmitTaskRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SubmissionService_GetSubmissionsHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetSubmissionsHistoryRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SubmissionServiceServer).GetSubmissionsHistory(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: SubmissionService_GetSubmissionsHistory_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SubmissionServiceServer).GetSubmissionsHistory(ctx, req.(*GetSubmissionsHistoryRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SubmissionService_GetSubmission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetSubmissionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SubmissionServiceServer).GetSubmission(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: SubmissionService_GetSubmission_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SubmissionServiceServer).GetSubmission(ctx, req.(*GetSubmissionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SubmissionService_ListSubmissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListSubmissionsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SubmissionServiceServer).ListSubmissions(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: SubmissionService_ListSubmissions_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SubmissionServiceServer).ListSubmissions(ctx, req.(*ListSubmissionsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// SubmissionService_ServiceDesc is the grpc.ServiceDesc for SubmissionService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var SubmissionService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "submission.SubmissionService",
|
||||
HandlerType: (*SubmissionServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "SubmitTask",
|
||||
Handler: _SubmissionService_SubmitTask_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetSubmissionsHistory",
|
||||
Handler: _SubmissionService_GetSubmissionsHistory_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetSubmission",
|
||||
Handler: _SubmissionService_GetSubmission_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListSubmissions",
|
||||
Handler: _SubmissionService_ListSubmissions_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "api/proto/submission.proto",
|
||||
}
|
||||
+282
-978
File diff suppressed because it is too large
Load Diff
+26
-178
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc-gen-go-grpc v1.6.0
|
||||
// - protoc v6.33.2
|
||||
// source: api/proto/task.proto
|
||||
|
||||
@@ -19,26 +19,18 @@ import (
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
TaskService_StartCompetition_FullMethodName = "/task.TaskService/StartCompetition"
|
||||
TaskService_GetCompetitionTasks_FullMethodName = "/task.TaskService/GetCompetitionTasks"
|
||||
TaskService_GetTask_FullMethodName = "/task.TaskService/GetTask"
|
||||
TaskService_SubmitTask_FullMethodName = "/task.TaskService/SubmitTask"
|
||||
TaskService_GetSubmissionsHistory_FullMethodName = "/task.TaskService/GetSubmissionsHistory"
|
||||
TaskService_GetTaskAttachments_FullMethodName = "/task.TaskService/GetTaskAttachments"
|
||||
TaskService_GetCompetitionResults_FullMethodName = "/task.TaskService/GetCompetitionResults"
|
||||
TaskService_GetTask_FullMethodName = "/task.TaskService/GetTask"
|
||||
TaskService_ListCompetitionTasks_FullMethodName = "/task.TaskService/ListCompetitionTasks"
|
||||
TaskService_GetTaskAttachments_FullMethodName = "/task.TaskService/GetTaskAttachments"
|
||||
)
|
||||
|
||||
// TaskServiceClient is the client API for TaskService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type TaskServiceClient interface {
|
||||
StartCompetition(ctx context.Context, in *StartCompetitionRequest, opts ...grpc.CallOption) (*StartCompetitionResponse, error)
|
||||
GetCompetitionTasks(ctx context.Context, in *GetCompetitionTasksRequest, opts ...grpc.CallOption) (*GetCompetitionTasksResponse, error)
|
||||
GetTask(ctx context.Context, in *GetTaskRequest, opts ...grpc.CallOption) (*GetTaskResponse, error)
|
||||
SubmitTask(ctx context.Context, in *SubmitTaskRequest, opts ...grpc.CallOption) (*SubmitTaskResponse, error)
|
||||
GetSubmissionsHistory(ctx context.Context, in *GetSubmissionsHistoryRequest, opts ...grpc.CallOption) (*GetSubmissionsHistoryResponse, error)
|
||||
GetTask(ctx context.Context, in *GetTaskRequest, opts ...grpc.CallOption) (*Task, error)
|
||||
ListCompetitionTasks(ctx context.Context, in *ListCompetitionTasksRequest, opts ...grpc.CallOption) (*ListCompetitionTasksResponse, error)
|
||||
GetTaskAttachments(ctx context.Context, in *GetTaskAttachmentsRequest, opts ...grpc.CallOption) (*GetTaskAttachmentsResponse, error)
|
||||
GetCompetitionResults(ctx context.Context, in *GetCompetitionResultsRequest, opts ...grpc.CallOption) (*GetCompetitionResultsResponse, error)
|
||||
}
|
||||
|
||||
type taskServiceClient struct {
|
||||
@@ -49,29 +41,9 @@ func NewTaskServiceClient(cc grpc.ClientConnInterface) TaskServiceClient {
|
||||
return &taskServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *taskServiceClient) StartCompetition(ctx context.Context, in *StartCompetitionRequest, opts ...grpc.CallOption) (*StartCompetitionResponse, error) {
|
||||
func (c *taskServiceClient) GetTask(ctx context.Context, in *GetTaskRequest, opts ...grpc.CallOption) (*Task, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StartCompetitionResponse)
|
||||
err := c.cc.Invoke(ctx, TaskService_StartCompetition_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *taskServiceClient) GetCompetitionTasks(ctx context.Context, in *GetCompetitionTasksRequest, opts ...grpc.CallOption) (*GetCompetitionTasksResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetCompetitionTasksResponse)
|
||||
err := c.cc.Invoke(ctx, TaskService_GetCompetitionTasks_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *taskServiceClient) GetTask(ctx context.Context, in *GetTaskRequest, opts ...grpc.CallOption) (*GetTaskResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetTaskResponse)
|
||||
out := new(Task)
|
||||
err := c.cc.Invoke(ctx, TaskService_GetTask_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -79,20 +51,10 @@ func (c *taskServiceClient) GetTask(ctx context.Context, in *GetTaskRequest, opt
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *taskServiceClient) SubmitTask(ctx context.Context, in *SubmitTaskRequest, opts ...grpc.CallOption) (*SubmitTaskResponse, error) {
|
||||
func (c *taskServiceClient) ListCompetitionTasks(ctx context.Context, in *ListCompetitionTasksRequest, opts ...grpc.CallOption) (*ListCompetitionTasksResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SubmitTaskResponse)
|
||||
err := c.cc.Invoke(ctx, TaskService_SubmitTask_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *taskServiceClient) GetSubmissionsHistory(ctx context.Context, in *GetSubmissionsHistoryRequest, opts ...grpc.CallOption) (*GetSubmissionsHistoryResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetSubmissionsHistoryResponse)
|
||||
err := c.cc.Invoke(ctx, TaskService_GetSubmissionsHistory_FullMethodName, in, out, cOpts...)
|
||||
out := new(ListCompetitionTasksResponse)
|
||||
err := c.cc.Invoke(ctx, TaskService_ListCompetitionTasks_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -109,27 +71,13 @@ func (c *taskServiceClient) GetTaskAttachments(ctx context.Context, in *GetTaskA
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *taskServiceClient) GetCompetitionResults(ctx context.Context, in *GetCompetitionResultsRequest, opts ...grpc.CallOption) (*GetCompetitionResultsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetCompetitionResultsResponse)
|
||||
err := c.cc.Invoke(ctx, TaskService_GetCompetitionResults_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// TaskServiceServer is the server API for TaskService service.
|
||||
// All implementations must embed UnimplementedTaskServiceServer
|
||||
// for forward compatibility.
|
||||
type TaskServiceServer interface {
|
||||
StartCompetition(context.Context, *StartCompetitionRequest) (*StartCompetitionResponse, error)
|
||||
GetCompetitionTasks(context.Context, *GetCompetitionTasksRequest) (*GetCompetitionTasksResponse, error)
|
||||
GetTask(context.Context, *GetTaskRequest) (*GetTaskResponse, error)
|
||||
SubmitTask(context.Context, *SubmitTaskRequest) (*SubmitTaskResponse, error)
|
||||
GetSubmissionsHistory(context.Context, *GetSubmissionsHistoryRequest) (*GetSubmissionsHistoryResponse, error)
|
||||
GetTask(context.Context, *GetTaskRequest) (*Task, error)
|
||||
ListCompetitionTasks(context.Context, *ListCompetitionTasksRequest) (*ListCompetitionTasksResponse, error)
|
||||
GetTaskAttachments(context.Context, *GetTaskAttachmentsRequest) (*GetTaskAttachmentsResponse, error)
|
||||
GetCompetitionResults(context.Context, *GetCompetitionResultsRequest) (*GetCompetitionResultsResponse, error)
|
||||
mustEmbedUnimplementedTaskServiceServer()
|
||||
}
|
||||
|
||||
@@ -140,26 +88,14 @@ type TaskServiceServer interface {
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedTaskServiceServer struct{}
|
||||
|
||||
func (UnimplementedTaskServiceServer) StartCompetition(context.Context, *StartCompetitionRequest) (*StartCompetitionResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method StartCompetition not implemented")
|
||||
func (UnimplementedTaskServiceServer) GetTask(context.Context, *GetTaskRequest) (*Task, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetTask not implemented")
|
||||
}
|
||||
func (UnimplementedTaskServiceServer) GetCompetitionTasks(context.Context, *GetCompetitionTasksRequest) (*GetCompetitionTasksResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetCompetitionTasks not implemented")
|
||||
}
|
||||
func (UnimplementedTaskServiceServer) GetTask(context.Context, *GetTaskRequest) (*GetTaskResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetTask not implemented")
|
||||
}
|
||||
func (UnimplementedTaskServiceServer) SubmitTask(context.Context, *SubmitTaskRequest) (*SubmitTaskResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SubmitTask not implemented")
|
||||
}
|
||||
func (UnimplementedTaskServiceServer) GetSubmissionsHistory(context.Context, *GetSubmissionsHistoryRequest) (*GetSubmissionsHistoryResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetSubmissionsHistory not implemented")
|
||||
func (UnimplementedTaskServiceServer) ListCompetitionTasks(context.Context, *ListCompetitionTasksRequest) (*ListCompetitionTasksResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListCompetitionTasks not implemented")
|
||||
}
|
||||
func (UnimplementedTaskServiceServer) GetTaskAttachments(context.Context, *GetTaskAttachmentsRequest) (*GetTaskAttachmentsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetTaskAttachments not implemented")
|
||||
}
|
||||
func (UnimplementedTaskServiceServer) GetCompetitionResults(context.Context, *GetCompetitionResultsRequest) (*GetCompetitionResultsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetCompetitionResults not implemented")
|
||||
return nil, status.Error(codes.Unimplemented, "method GetTaskAttachments not implemented")
|
||||
}
|
||||
func (UnimplementedTaskServiceServer) mustEmbedUnimplementedTaskServiceServer() {}
|
||||
func (UnimplementedTaskServiceServer) testEmbeddedByValue() {}
|
||||
@@ -172,7 +108,7 @@ type UnsafeTaskServiceServer interface {
|
||||
}
|
||||
|
||||
func RegisterTaskServiceServer(s grpc.ServiceRegistrar, srv TaskServiceServer) {
|
||||
// If the following call pancis, it indicates UnimplementedTaskServiceServer was
|
||||
// If the following call panics, it indicates UnimplementedTaskServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
@@ -182,42 +118,6 @@ func RegisterTaskServiceServer(s grpc.ServiceRegistrar, srv TaskServiceServer) {
|
||||
s.RegisterService(&TaskService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _TaskService_StartCompetition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(StartCompetitionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TaskServiceServer).StartCompetition(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: TaskService_StartCompetition_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TaskServiceServer).StartCompetition(ctx, req.(*StartCompetitionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _TaskService_GetCompetitionTasks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetCompetitionTasksRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TaskServiceServer).GetCompetitionTasks(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: TaskService_GetCompetitionTasks_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TaskServiceServer).GetCompetitionTasks(ctx, req.(*GetCompetitionTasksRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _TaskService_GetTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetTaskRequest)
|
||||
if err := dec(in); err != nil {
|
||||
@@ -236,38 +136,20 @@ func _TaskService_GetTask_Handler(srv interface{}, ctx context.Context, dec func
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _TaskService_SubmitTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SubmitTaskRequest)
|
||||
func _TaskService_ListCompetitionTasks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListCompetitionTasksRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TaskServiceServer).SubmitTask(ctx, in)
|
||||
return srv.(TaskServiceServer).ListCompetitionTasks(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: TaskService_SubmitTask_FullMethodName,
|
||||
FullMethod: TaskService_ListCompetitionTasks_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TaskServiceServer).SubmitTask(ctx, req.(*SubmitTaskRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _TaskService_GetSubmissionsHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetSubmissionsHistoryRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TaskServiceServer).GetSubmissionsHistory(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: TaskService_GetSubmissionsHistory_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TaskServiceServer).GetSubmissionsHistory(ctx, req.(*GetSubmissionsHistoryRequest))
|
||||
return srv.(TaskServiceServer).ListCompetitionTasks(ctx, req.(*ListCompetitionTasksRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -290,24 +172,6 @@ func _TaskService_GetTaskAttachments_Handler(srv interface{}, ctx context.Contex
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _TaskService_GetCompetitionResults_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetCompetitionResultsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TaskServiceServer).GetCompetitionResults(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: TaskService_GetCompetitionResults_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TaskServiceServer).GetCompetitionResults(ctx, req.(*GetCompetitionResultsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// TaskService_ServiceDesc is the grpc.ServiceDesc for TaskService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
@@ -315,34 +179,18 @@ var TaskService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "task.TaskService",
|
||||
HandlerType: (*TaskServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "StartCompetition",
|
||||
Handler: _TaskService_StartCompetition_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetCompetitionTasks",
|
||||
Handler: _TaskService_GetCompetitionTasks_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetTask",
|
||||
Handler: _TaskService_GetTask_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SubmitTask",
|
||||
Handler: _TaskService_SubmitTask_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetSubmissionsHistory",
|
||||
Handler: _TaskService_GetSubmissionsHistory_Handler,
|
||||
MethodName: "ListCompetitionTasks",
|
||||
Handler: _TaskService_ListCompetitionTasks_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetTaskAttachments",
|
||||
Handler: _TaskService_GetTaskAttachments_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetCompetitionResults",
|
||||
Handler: _TaskService_GetCompetitionResults_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "api/proto/task.proto",
|
||||
|
||||
@@ -0,0 +1,415 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc v6.33.2
|
||||
// source: api/proto/user.proto
|
||||
|
||||
package user
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type User struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
|
||||
Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`
|
||||
FullName *string `protobuf:"bytes,4,opt,name=full_name,json=fullName,proto3,oneof" json:"full_name,omitempty"`
|
||||
AvatarUrl *string `protobuf:"bytes,5,opt,name=avatar_url,json=avatarUrl,proto3,oneof" json:"avatar_url,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *User) Reset() {
|
||||
*x = User{}
|
||||
mi := &file_api_proto_user_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *User) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*User) ProtoMessage() {}
|
||||
|
||||
func (x *User) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_user_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use User.ProtoReflect.Descriptor instead.
|
||||
func (*User) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_user_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *User) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *User) GetUsername() string {
|
||||
if x != nil {
|
||||
return x.Username
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *User) GetEmail() string {
|
||||
if x != nil {
|
||||
return x.Email
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *User) GetFullName() string {
|
||||
if x != nil && x.FullName != nil {
|
||||
return *x.FullName
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *User) GetAvatarUrl() string {
|
||||
if x != nil && x.AvatarUrl != nil {
|
||||
return *x.AvatarUrl
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type GetProfileRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetProfileRequest) Reset() {
|
||||
*x = GetProfileRequest{}
|
||||
mi := &file_api_proto_user_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetProfileRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetProfileRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetProfileRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_user_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetProfileRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetProfileRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_user_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *GetProfileRequest) GetUserId() string {
|
||||
if x != nil {
|
||||
return x.UserId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type RegisterForCompetitionRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
CompetitionId string `protobuf:"bytes,1,opt,name=competition_id,json=competitionId,proto3" json:"competition_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *RegisterForCompetitionRequest) Reset() {
|
||||
*x = RegisterForCompetitionRequest{}
|
||||
mi := &file_api_proto_user_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *RegisterForCompetitionRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*RegisterForCompetitionRequest) ProtoMessage() {}
|
||||
|
||||
func (x *RegisterForCompetitionRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_user_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use RegisterForCompetitionRequest.ProtoReflect.Descriptor instead.
|
||||
func (*RegisterForCompetitionRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_user_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *RegisterForCompetitionRequest) GetCompetitionId() string {
|
||||
if x != nil {
|
||||
return x.CompetitionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type UnregisterFromCompetitionRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
CompetitionId string `protobuf:"bytes,1,opt,name=competition_id,json=competitionId,proto3" json:"competition_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *UnregisterFromCompetitionRequest) Reset() {
|
||||
*x = UnregisterFromCompetitionRequest{}
|
||||
mi := &file_api_proto_user_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *UnregisterFromCompetitionRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*UnregisterFromCompetitionRequest) ProtoMessage() {}
|
||||
|
||||
func (x *UnregisterFromCompetitionRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_user_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use UnregisterFromCompetitionRequest.ProtoReflect.Descriptor instead.
|
||||
func (*UnregisterFromCompetitionRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_user_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *UnregisterFromCompetitionRequest) GetCompetitionId() string {
|
||||
if x != nil {
|
||||
return x.CompetitionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ListUserCompetitionsRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ListUserCompetitionsRequest) Reset() {
|
||||
*x = ListUserCompetitionsRequest{}
|
||||
mi := &file_api_proto_user_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ListUserCompetitionsRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListUserCompetitionsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ListUserCompetitionsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_user_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListUserCompetitionsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ListUserCompetitionsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_user_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *ListUserCompetitionsRequest) GetUserId() string {
|
||||
if x != nil {
|
||||
return x.UserId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ListUserCompetitionsResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
CompetitionIds []string `protobuf:"bytes,1,rep,name=competition_ids,json=competitionIds,proto3" json:"competition_ids,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ListUserCompetitionsResponse) Reset() {
|
||||
*x = ListUserCompetitionsResponse{}
|
||||
mi := &file_api_proto_user_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ListUserCompetitionsResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListUserCompetitionsResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ListUserCompetitionsResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_user_proto_msgTypes[5]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListUserCompetitionsResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ListUserCompetitionsResponse) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_user_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *ListUserCompetitionsResponse) GetCompetitionIds() []string {
|
||||
if x != nil {
|
||||
return x.CompetitionIds
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_api_proto_user_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_api_proto_user_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x14api/proto/user.proto\x12\x04user\x1a\x1bgoogle/protobuf/empty.proto\"\xab\x01\n" +
|
||||
"\x04User\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\x12\x1a\n" +
|
||||
"\busername\x18\x02 \x01(\tR\busername\x12\x14\n" +
|
||||
"\x05email\x18\x03 \x01(\tR\x05email\x12 \n" +
|
||||
"\tfull_name\x18\x04 \x01(\tH\x00R\bfullName\x88\x01\x01\x12\"\n" +
|
||||
"\n" +
|
||||
"avatar_url\x18\x05 \x01(\tH\x01R\tavatarUrl\x88\x01\x01B\f\n" +
|
||||
"\n" +
|
||||
"_full_nameB\r\n" +
|
||||
"\v_avatar_url\",\n" +
|
||||
"\x11GetProfileRequest\x12\x17\n" +
|
||||
"\auser_id\x18\x01 \x01(\tR\x06userId\"F\n" +
|
||||
"\x1dRegisterForCompetitionRequest\x12%\n" +
|
||||
"\x0ecompetition_id\x18\x01 \x01(\tR\rcompetitionId\"I\n" +
|
||||
" UnregisterFromCompetitionRequest\x12%\n" +
|
||||
"\x0ecompetition_id\x18\x01 \x01(\tR\rcompetitionId\"6\n" +
|
||||
"\x1bListUserCompetitionsRequest\x12\x17\n" +
|
||||
"\auser_id\x18\x01 \x01(\tR\x06userId\"G\n" +
|
||||
"\x1cListUserCompetitionsResponse\x12'\n" +
|
||||
"\x0fcompetition_ids\x18\x01 \x03(\tR\x0ecompetitionIds2\xd3\x02\n" +
|
||||
"\vUserService\x121\n" +
|
||||
"\n" +
|
||||
"GetProfile\x12\x17.user.GetProfileRequest\x1a\n" +
|
||||
".user.User\x12U\n" +
|
||||
"\x16RegisterForCompetition\x12#.user.RegisterForCompetitionRequest\x1a\x16.google.protobuf.Empty\x12[\n" +
|
||||
"\x19UnregisterFromCompetition\x12&.user.UnregisterFromCompetitionRequest\x1a\x16.google.protobuf.Empty\x12]\n" +
|
||||
"\x14ListUserCompetitions\x12!.user.ListUserCompetitionsRequest\x1a\".user.ListUserCompetitionsResponseB\x0eZ\fpkg/api/userb\x06proto3"
|
||||
|
||||
var (
|
||||
file_api_proto_user_proto_rawDescOnce sync.Once
|
||||
file_api_proto_user_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_api_proto_user_proto_rawDescGZIP() []byte {
|
||||
file_api_proto_user_proto_rawDescOnce.Do(func() {
|
||||
file_api_proto_user_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_api_proto_user_proto_rawDesc), len(file_api_proto_user_proto_rawDesc)))
|
||||
})
|
||||
return file_api_proto_user_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_api_proto_user_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_api_proto_user_proto_goTypes = []any{
|
||||
(*User)(nil), // 0: user.User
|
||||
(*GetProfileRequest)(nil), // 1: user.GetProfileRequest
|
||||
(*RegisterForCompetitionRequest)(nil), // 2: user.RegisterForCompetitionRequest
|
||||
(*UnregisterFromCompetitionRequest)(nil), // 3: user.UnregisterFromCompetitionRequest
|
||||
(*ListUserCompetitionsRequest)(nil), // 4: user.ListUserCompetitionsRequest
|
||||
(*ListUserCompetitionsResponse)(nil), // 5: user.ListUserCompetitionsResponse
|
||||
(*emptypb.Empty)(nil), // 6: google.protobuf.Empty
|
||||
}
|
||||
var file_api_proto_user_proto_depIdxs = []int32{
|
||||
1, // 0: user.UserService.GetProfile:input_type -> user.GetProfileRequest
|
||||
2, // 1: user.UserService.RegisterForCompetition:input_type -> user.RegisterForCompetitionRequest
|
||||
3, // 2: user.UserService.UnregisterFromCompetition:input_type -> user.UnregisterFromCompetitionRequest
|
||||
4, // 3: user.UserService.ListUserCompetitions:input_type -> user.ListUserCompetitionsRequest
|
||||
0, // 4: user.UserService.GetProfile:output_type -> user.User
|
||||
6, // 5: user.UserService.RegisterForCompetition:output_type -> google.protobuf.Empty
|
||||
6, // 6: user.UserService.UnregisterFromCompetition:output_type -> google.protobuf.Empty
|
||||
5, // 7: user.UserService.ListUserCompetitions:output_type -> user.ListUserCompetitionsResponse
|
||||
4, // [4:8] is the sub-list for method output_type
|
||||
0, // [0:4] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_api_proto_user_proto_init() }
|
||||
func file_api_proto_user_proto_init() {
|
||||
if File_api_proto_user_proto != nil {
|
||||
return
|
||||
}
|
||||
file_api_proto_user_proto_msgTypes[0].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_proto_user_proto_rawDesc), len(file_api_proto_user_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 6,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_api_proto_user_proto_goTypes,
|
||||
DependencyIndexes: file_api_proto_user_proto_depIdxs,
|
||||
MessageInfos: file_api_proto_user_proto_msgTypes,
|
||||
}.Build()
|
||||
File_api_proto_user_proto = out.File
|
||||
file_api_proto_user_proto_goTypes = nil
|
||||
file_api_proto_user_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,236 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.0
|
||||
// - protoc v6.33.2
|
||||
// source: api/proto/user.proto
|
||||
|
||||
package user
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
UserService_GetProfile_FullMethodName = "/user.UserService/GetProfile"
|
||||
UserService_RegisterForCompetition_FullMethodName = "/user.UserService/RegisterForCompetition"
|
||||
UserService_UnregisterFromCompetition_FullMethodName = "/user.UserService/UnregisterFromCompetition"
|
||||
UserService_ListUserCompetitions_FullMethodName = "/user.UserService/ListUserCompetitions"
|
||||
)
|
||||
|
||||
// UserServiceClient is the client API for UserService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type UserServiceClient interface {
|
||||
GetProfile(ctx context.Context, in *GetProfileRequest, opts ...grpc.CallOption) (*User, error)
|
||||
RegisterForCompetition(ctx context.Context, in *RegisterForCompetitionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
UnregisterFromCompetition(ctx context.Context, in *UnregisterFromCompetitionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
ListUserCompetitions(ctx context.Context, in *ListUserCompetitionsRequest, opts ...grpc.CallOption) (*ListUserCompetitionsResponse, error)
|
||||
}
|
||||
|
||||
type userServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient {
|
||||
return &userServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *userServiceClient) GetProfile(ctx context.Context, in *GetProfileRequest, opts ...grpc.CallOption) (*User, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(User)
|
||||
err := c.cc.Invoke(ctx, UserService_GetProfile_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *userServiceClient) RegisterForCompetition(ctx context.Context, in *RegisterForCompetitionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, UserService_RegisterForCompetition_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *userServiceClient) UnregisterFromCompetition(ctx context.Context, in *UnregisterFromCompetitionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, UserService_UnregisterFromCompetition_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *userServiceClient) ListUserCompetitions(ctx context.Context, in *ListUserCompetitionsRequest, opts ...grpc.CallOption) (*ListUserCompetitionsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListUserCompetitionsResponse)
|
||||
err := c.cc.Invoke(ctx, UserService_ListUserCompetitions_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// UserServiceServer is the server API for UserService service.
|
||||
// All implementations must embed UnimplementedUserServiceServer
|
||||
// for forward compatibility.
|
||||
type UserServiceServer interface {
|
||||
GetProfile(context.Context, *GetProfileRequest) (*User, error)
|
||||
RegisterForCompetition(context.Context, *RegisterForCompetitionRequest) (*emptypb.Empty, error)
|
||||
UnregisterFromCompetition(context.Context, *UnregisterFromCompetitionRequest) (*emptypb.Empty, error)
|
||||
ListUserCompetitions(context.Context, *ListUserCompetitionsRequest) (*ListUserCompetitionsResponse, error)
|
||||
mustEmbedUnimplementedUserServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedUserServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedUserServiceServer struct{}
|
||||
|
||||
func (UnimplementedUserServiceServer) GetProfile(context.Context, *GetProfileRequest) (*User, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetProfile not implemented")
|
||||
}
|
||||
func (UnimplementedUserServiceServer) RegisterForCompetition(context.Context, *RegisterForCompetitionRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RegisterForCompetition not implemented")
|
||||
}
|
||||
func (UnimplementedUserServiceServer) UnregisterFromCompetition(context.Context, *UnregisterFromCompetitionRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UnregisterFromCompetition not implemented")
|
||||
}
|
||||
func (UnimplementedUserServiceServer) ListUserCompetitions(context.Context, *ListUserCompetitionsRequest) (*ListUserCompetitionsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListUserCompetitions not implemented")
|
||||
}
|
||||
func (UnimplementedUserServiceServer) mustEmbedUnimplementedUserServiceServer() {}
|
||||
func (UnimplementedUserServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to UserServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeUserServiceServer interface {
|
||||
mustEmbedUnimplementedUserServiceServer()
|
||||
}
|
||||
|
||||
func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedUserServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&UserService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _UserService_GetProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetProfileRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(UserServiceServer).GetProfile(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: UserService_GetProfile_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(UserServiceServer).GetProfile(ctx, req.(*GetProfileRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _UserService_RegisterForCompetition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RegisterForCompetitionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(UserServiceServer).RegisterForCompetition(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: UserService_RegisterForCompetition_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(UserServiceServer).RegisterForCompetition(ctx, req.(*RegisterForCompetitionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _UserService_UnregisterFromCompetition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UnregisterFromCompetitionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(UserServiceServer).UnregisterFromCompetition(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: UserService_UnregisterFromCompetition_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(UserServiceServer).UnregisterFromCompetition(ctx, req.(*UnregisterFromCompetitionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _UserService_ListUserCompetitions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListUserCompetitionsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(UserServiceServer).ListUserCompetitions(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: UserService_ListUserCompetitions_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(UserServiceServer).ListUserCompetitions(ctx, req.(*ListUserCompetitionsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// UserService_ServiceDesc is the grpc.ServiceDesc for UserService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var UserService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "user.UserService",
|
||||
HandlerType: (*UserServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetProfile",
|
||||
Handler: _UserService_GetProfile_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RegisterForCompetition",
|
||||
Handler: _UserService_RegisterForCompetition_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UnregisterFromCompetition",
|
||||
Handler: _UserService_UnregisterFromCompetition_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListUserCompetitions",
|
||||
Handler: _UserService_ListUserCompetitions_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "api/proto/user.proto",
|
||||
}
|
||||
Reference in New Issue
Block a user