chore(api)!: added new fields to contract

This commit is contained in:
ITQ
2025-12-20 18:06:28 +03:00
parent 31738d3a0a
commit acfe7275eb
6 changed files with 60 additions and 19 deletions
+11
View File
@@ -49,12 +49,22 @@ func TaskProtoToHTTP(t *taskpb.Task) *domain.TaskResponse {
InCompetitionPosition: t.InCompetitionPosition,
MaxPoints: t.MaxPoints,
MaxAttempts: t.MaxAttempts,
AnswerURL: t.AnswerUrl,
Type: TaskTypeToString(t.Type),
CreatedAt: t.CreatedAt.AsTime(),
UpdatedAt: t.UpdatedAt.AsTime(),
}
}
func TaskAttachmentProtoToHTTP(a *taskpb.TaskAttachment) *domain.TaskAttachmentResponse {
return &domain.TaskAttachmentResponse{
ID: a.Id,
FileURL: a.FileUrl,
Mountpoint: a.Mountpoint,
IsPublic: a.IsPublic,
}
}
func SubmissionProtoToHTTP(s *subpb.Submission) *domain.SubmissionResponse {
return &domain.SubmissionResponse{
ID: s.Id,
@@ -150,6 +160,7 @@ func TaskHTTPToProto(req *domain.TaskRequest) *taskpb.Task {
InCompetitionPosition: req.InCompetitionPosition,
MaxPoints: req.MaxPoints,
MaxAttempts: req.MaxAttempts,
AnswerUrl: req.AnswerURL,
Type: StringToTaskType(req.Type),
}
}