chore(api)!: added achievement service

This commit is contained in:
ITQ
2025-12-16 21:25:46 +03:00
parent 7499a14024
commit 843c50a103
7 changed files with 129 additions and 173 deletions
+34 -79
View File
@@ -9,6 +9,7 @@ package task
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"
@@ -338,50 +339,6 @@ func (x *DeleteTaskRequest) GetTaskId() string {
return ""
}
type DeleteTaskResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *DeleteTaskResponse) Reset() {
*x = DeleteTaskResponse{}
mi := &file_api_proto_task_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *DeleteTaskResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeleteTaskResponse) ProtoMessage() {}
func (x *DeleteTaskResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_proto_task_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 DeleteTaskResponse.ProtoReflect.Descriptor instead.
func (*DeleteTaskResponse) Descriptor() ([]byte, []int) {
return file_api_proto_task_proto_rawDescGZIP(), []int{4}
}
func (x *DeleteTaskResponse) GetSuccess() bool {
if x != nil {
return x.Success
}
return false
}
type ListCompetitionTasksRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
CompetitionId string `protobuf:"bytes,1,opt,name=competition_id,json=competitionId,proto3" json:"competition_id,omitempty"`
@@ -391,7 +348,7 @@ type ListCompetitionTasksRequest struct {
func (x *ListCompetitionTasksRequest) Reset() {
*x = ListCompetitionTasksRequest{}
mi := &file_api_proto_task_proto_msgTypes[5]
mi := &file_api_proto_task_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -403,7 +360,7 @@ func (x *ListCompetitionTasksRequest) String() string {
func (*ListCompetitionTasksRequest) ProtoMessage() {}
func (x *ListCompetitionTasksRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_proto_task_proto_msgTypes[5]
mi := &file_api_proto_task_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -416,7 +373,7 @@ func (x *ListCompetitionTasksRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListCompetitionTasksRequest.ProtoReflect.Descriptor instead.
func (*ListCompetitionTasksRequest) Descriptor() ([]byte, []int) {
return file_api_proto_task_proto_rawDescGZIP(), []int{5}
return file_api_proto_task_proto_rawDescGZIP(), []int{4}
}
func (x *ListCompetitionTasksRequest) GetCompetitionId() string {
@@ -435,7 +392,7 @@ type ListCompetitionTasksResponse struct {
func (x *ListCompetitionTasksResponse) Reset() {
*x = ListCompetitionTasksResponse{}
mi := &file_api_proto_task_proto_msgTypes[6]
mi := &file_api_proto_task_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -447,7 +404,7 @@ func (x *ListCompetitionTasksResponse) String() string {
func (*ListCompetitionTasksResponse) ProtoMessage() {}
func (x *ListCompetitionTasksResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_proto_task_proto_msgTypes[6]
mi := &file_api_proto_task_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -460,7 +417,7 @@ func (x *ListCompetitionTasksResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListCompetitionTasksResponse.ProtoReflect.Descriptor instead.
func (*ListCompetitionTasksResponse) Descriptor() ([]byte, []int) {
return file_api_proto_task_proto_rawDescGZIP(), []int{6}
return file_api_proto_task_proto_rawDescGZIP(), []int{5}
}
func (x *ListCompetitionTasksResponse) GetTasks() []*Task {
@@ -480,7 +437,7 @@ type GetTaskAttachmentsRequest struct {
func (x *GetTaskAttachmentsRequest) Reset() {
*x = GetTaskAttachmentsRequest{}
mi := &file_api_proto_task_proto_msgTypes[7]
mi := &file_api_proto_task_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -492,7 +449,7 @@ func (x *GetTaskAttachmentsRequest) String() string {
func (*GetTaskAttachmentsRequest) ProtoMessage() {}
func (x *GetTaskAttachmentsRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_proto_task_proto_msgTypes[7]
mi := &file_api_proto_task_proto_msgTypes[6]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -505,7 +462,7 @@ func (x *GetTaskAttachmentsRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetTaskAttachmentsRequest.ProtoReflect.Descriptor instead.
func (*GetTaskAttachmentsRequest) Descriptor() ([]byte, []int) {
return file_api_proto_task_proto_rawDescGZIP(), []int{7}
return file_api_proto_task_proto_rawDescGZIP(), []int{6}
}
func (x *GetTaskAttachmentsRequest) GetTaskId() string {
@@ -531,7 +488,7 @@ type GetTaskAttachmentsResponse struct {
func (x *GetTaskAttachmentsResponse) Reset() {
*x = GetTaskAttachmentsResponse{}
mi := &file_api_proto_task_proto_msgTypes[8]
mi := &file_api_proto_task_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -543,7 +500,7 @@ func (x *GetTaskAttachmentsResponse) String() string {
func (*GetTaskAttachmentsResponse) ProtoMessage() {}
func (x *GetTaskAttachmentsResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_proto_task_proto_msgTypes[8]
mi := &file_api_proto_task_proto_msgTypes[7]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -556,7 +513,7 @@ func (x *GetTaskAttachmentsResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetTaskAttachmentsResponse.ProtoReflect.Descriptor instead.
func (*GetTaskAttachmentsResponse) Descriptor() ([]byte, []int) {
return file_api_proto_task_proto_rawDescGZIP(), []int{8}
return file_api_proto_task_proto_rawDescGZIP(), []int{7}
}
func (x *GetTaskAttachmentsResponse) GetAttachments() []*TaskAttachment {
@@ -570,7 +527,7 @@ var File_api_proto_task_proto protoreflect.FileDescriptor
const file_api_proto_task_proto_rawDesc = "" +
"\n" +
"\x14api/proto/task.proto\x12\x04task\x1a\x1fgoogle/protobuf/timestamp.proto\"\x89\x03\n" +
"\x14api/proto/task.proto\x12\x04task\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1bgoogle/protobuf/empty.proto\"\x89\x03\n" +
"\x04Task\x12\x0e\n" +
"\x02id\x18\x01 \x01(\tR\x02id\x12%\n" +
"\x0ecompetition_id\x18\x02 \x01(\tR\rcompetitionId\x12\x14\n" +
@@ -593,9 +550,7 @@ const file_api_proto_task_proto_rawDesc = "" +
"\x0eGetTaskRequest\x12\x17\n" +
"\atask_id\x18\x01 \x01(\tR\x06taskId\",\n" +
"\x11DeleteTaskRequest\x12\x17\n" +
"\atask_id\x18\x01 \x01(\tR\x06taskId\".\n" +
"\x12DeleteTaskResponse\x12\x18\n" +
"\asuccess\x18\x01 \x01(\bR\asuccess\"D\n" +
"\atask_id\x18\x01 \x01(\tR\x06taskId\"D\n" +
"\x1bListCompetitionTasksRequest\x12%\n" +
"\x0ecompetition_id\x18\x01 \x01(\tR\rcompetitionId\"@\n" +
"\x1cListCompetitionTasksResponse\x12 \n" +
@@ -611,7 +566,7 @@ const file_api_proto_task_proto_rawDesc = "" +
"\x15TASK_TYPE_UNSPECIFIED\x10\x00\x12\x13\n" +
"\x0fTASK_TYPE_INPUT\x10\x01\x12\x15\n" +
"\x11TASK_TYPE_CHECKER\x10\x02\x12\x14\n" +
"\x10TASK_TYPE_REVIEW\x10\x032\xfd\x02\n" +
"\x10TASK_TYPE_REVIEW\x10\x032\xfb\x02\n" +
"\vTaskService\x12$\n" +
"\n" +
"CreateTask\x12\n" +
@@ -621,9 +576,9 @@ const file_api_proto_task_proto_rawDesc = "" +
".task.Task\x12\"\n" +
"\bEditTask\x12\n" +
".task.Task\x1a\n" +
".task.Task\x12?\n" +
".task.Task\x12=\n" +
"\n" +
"DeleteTask\x12\x17.task.DeleteTaskRequest\x1a\x18.task.DeleteTaskResponse\x12]\n" +
"DeleteTask\x12\x17.task.DeleteTaskRequest\x1a\x16.google.protobuf.Empty\x12]\n" +
"\x14ListCompetitionTasks\x12!.task.ListCompetitionTasksRequest\x1a\".task.ListCompetitionTasksResponse\x12W\n" +
"\x12GetTaskAttachments\x12\x1f.task.GetTaskAttachmentsRequest\x1a .task.GetTaskAttachmentsResponseB\x0eZ\fpkg/api/taskb\x06proto3"
@@ -640,38 +595,38 @@ func file_api_proto_task_proto_rawDescGZIP() []byte {
}
var file_api_proto_task_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_api_proto_task_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
var file_api_proto_task_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_api_proto_task_proto_goTypes = []any{
(TaskType)(0), // 0: task.TaskType
(*Task)(nil), // 1: task.Task
(*TaskAttachment)(nil), // 2: task.TaskAttachment
(*GetTaskRequest)(nil), // 3: task.GetTaskRequest
(*DeleteTaskRequest)(nil), // 4: task.DeleteTaskRequest
(*DeleteTaskResponse)(nil), // 5: task.DeleteTaskResponse
(*ListCompetitionTasksRequest)(nil), // 6: task.ListCompetitionTasksRequest
(*ListCompetitionTasksResponse)(nil), // 7: task.ListCompetitionTasksResponse
(*GetTaskAttachmentsRequest)(nil), // 8: task.GetTaskAttachmentsRequest
(*GetTaskAttachmentsResponse)(nil), // 9: task.GetTaskAttachmentsResponse
(*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp
(*ListCompetitionTasksRequest)(nil), // 5: task.ListCompetitionTasksRequest
(*ListCompetitionTasksResponse)(nil), // 6: task.ListCompetitionTasksResponse
(*GetTaskAttachmentsRequest)(nil), // 7: task.GetTaskAttachmentsRequest
(*GetTaskAttachmentsResponse)(nil), // 8: task.GetTaskAttachmentsResponse
(*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp
(*emptypb.Empty)(nil), // 10: google.protobuf.Empty
}
var file_api_proto_task_proto_depIdxs = []int32{
0, // 0: task.Task.type:type_name -> task.TaskType
10, // 1: task.Task.created_at:type_name -> google.protobuf.Timestamp
10, // 2: task.Task.updated_at:type_name -> google.protobuf.Timestamp
9, // 1: task.Task.created_at:type_name -> google.protobuf.Timestamp
9, // 2: task.Task.updated_at:type_name -> google.protobuf.Timestamp
1, // 3: task.ListCompetitionTasksResponse.tasks:type_name -> task.Task
2, // 4: task.GetTaskAttachmentsResponse.attachments:type_name -> task.TaskAttachment
1, // 5: task.TaskService.CreateTask:input_type -> task.Task
3, // 6: task.TaskService.GetTask:input_type -> task.GetTaskRequest
1, // 7: task.TaskService.EditTask:input_type -> task.Task
4, // 8: task.TaskService.DeleteTask:input_type -> task.DeleteTaskRequest
6, // 9: task.TaskService.ListCompetitionTasks:input_type -> task.ListCompetitionTasksRequest
8, // 10: task.TaskService.GetTaskAttachments:input_type -> task.GetTaskAttachmentsRequest
5, // 9: task.TaskService.ListCompetitionTasks:input_type -> task.ListCompetitionTasksRequest
7, // 10: task.TaskService.GetTaskAttachments:input_type -> task.GetTaskAttachmentsRequest
1, // 11: task.TaskService.CreateTask:output_type -> task.Task
1, // 12: task.TaskService.GetTask:output_type -> task.Task
1, // 13: task.TaskService.EditTask:output_type -> task.Task
5, // 14: task.TaskService.DeleteTask:output_type -> task.DeleteTaskResponse
7, // 15: task.TaskService.ListCompetitionTasks:output_type -> task.ListCompetitionTasksResponse
9, // 16: task.TaskService.GetTaskAttachments:output_type -> task.GetTaskAttachmentsResponse
10, // 14: task.TaskService.DeleteTask:output_type -> google.protobuf.Empty
6, // 15: task.TaskService.ListCompetitionTasks:output_type -> task.ListCompetitionTasksResponse
8, // 16: task.TaskService.GetTaskAttachments:output_type -> task.GetTaskAttachmentsResponse
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
@@ -684,14 +639,14 @@ func file_api_proto_task_proto_init() {
if File_api_proto_task_proto != nil {
return
}
file_api_proto_task_proto_msgTypes[7].OneofWrappers = []any{}
file_api_proto_task_proto_msgTypes[6].OneofWrappers = []any{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_proto_task_proto_rawDesc), len(file_api_proto_task_proto_rawDesc)),
NumEnums: 1,
NumMessages: 9,
NumMessages: 8,
NumExtensions: 0,
NumServices: 1,
},