fix: add task model to function definition
This commit is contained in:
parent
d9e2f46de8
commit
edf55aa4b7
1 changed files with 9 additions and 9 deletions
|
@ -1,25 +1,25 @@
|
||||||
package services
|
package services
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"git.sch9.ru/new_gate/ms-tester/internal/models"
|
"git.sch9.ru/new_gate/ms-tester/internal/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TaskStorage interface {
|
type TaskStorage interface {
|
||||||
CreateTask(ctx context.Context, problemId int32,contestId int32) (int32, error)
|
CreateTask(ctx context.Context, models.Task) (int32, error)
|
||||||
DeleteTask(ctx context.Context, id int32) error
|
DeleteTask(ctx context.Context, id int32) error
|
||||||
}
|
}
|
||||||
|
|
||||||
type TaskService struct {
|
type TaskService struct {
|
||||||
taskStorage TaskStorage
|
taskStorage TaskStorage
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewTaskService(
|
func NewTaskService(
|
||||||
taskStorage TaskStorage,
|
taskStorage TaskStorage,
|
||||||
) *TaskService {
|
) *TaskService {
|
||||||
return &TaskService{
|
return &TaskService{
|
||||||
taskStorage: taskStorage,
|
taskStorage: taskStorage,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (service *TaskService) CreateTask(ctx context.Context, task models.Task) (int32, error) {
|
func (service *TaskService) CreateTask(ctx context.Context, task models.Task) (int32, error) {
|
||||||
|
|
Loading…
Reference in a new issue