fix:
This commit is contained in:
parent
d62ae666d5
commit
4cdd751b16
11 changed files with 53 additions and 53 deletions
|
@ -3,7 +3,6 @@ package grpc
|
|||
import (
|
||||
"context"
|
||||
"git.sch9.ru/new_gate/models"
|
||||
"git.sch9.ru/new_gate/ms-tester/internal/lib"
|
||||
"git.sch9.ru/new_gate/ms-tester/internal/problems"
|
||||
problemv1 "git.sch9.ru/new_gate/ms-tester/pkg/go/gen/proto/problem/v1"
|
||||
"git.sch9.ru/new_gate/ms-tester/pkg/utils"
|
||||
|
@ -29,18 +28,18 @@ func (h *problemHandlers) CreateProblem(server problemv1.ProblemService_CreatePr
|
|||
|
||||
req, err := server.Recv() // receive problem
|
||||
if err != nil {
|
||||
return lib.TransportError(err, lib.ErrBadInput, "can't receive problem")
|
||||
return utils.TransportError(err, utils.ErrBadInput, "can't receive problem")
|
||||
}
|
||||
problem := req.GetProblem()
|
||||
if problem == nil {
|
||||
return lib.TransportError(nil, lib.ErrBadInput, "empty problem")
|
||||
return utils.TransportError(nil, utils.ErrBadInput, "empty problem")
|
||||
}
|
||||
|
||||
p := &models.Problem{
|
||||
Name: lib.AsStringP(problem.Name),
|
||||
Description: lib.AsStringP(problem.Description),
|
||||
TimeLimit: lib.AsInt32P(problem.TimeLimit),
|
||||
MemoryLimit: lib.AsInt32P(problem.MemoryLimit),
|
||||
Name: utils.AsStringP(problem.Name),
|
||||
Description: utils.AsStringP(problem.Description),
|
||||
TimeLimit: utils.AsInt32P(problem.TimeLimit),
|
||||
MemoryLimit: utils.AsInt32P(problem.MemoryLimit),
|
||||
}
|
||||
|
||||
ch := readChunks(ctx, server)
|
||||
|
@ -59,7 +58,7 @@ func (h *problemHandlers) CreateProblem(server problemv1.ProblemService_CreatePr
|
|||
Id: id,
|
||||
})
|
||||
if err != nil {
|
||||
return lib.TransportError(err, lib.ErrBadInput, "can't send response")
|
||||
return utils.TransportError(err, utils.ErrBadInput, "can't send response")
|
||||
}
|
||||
|
||||
return nil
|
||||
|
@ -147,7 +146,7 @@ func (h *problemHandlers) ReadProblem(ctx context.Context, req *problemv1.ReadPr
|
|||
// err := s.problemService.UpdateProblem(
|
||||
// ctx,
|
||||
// &models.Problem{
|
||||
// Id: lib.AsInt32P(problem.Id),
|
||||
// Id: utils.AsInt32P(problem.Id),
|
||||
// Name: problem.Name,
|
||||
// Description: problem.Description,
|
||||
// TimeLimit: problem.TimeLimit,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue