/
task.go
57 lines (42 loc) · 1.25 KB
/
task.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package postgreSQL
import (
"context"
"github.com/equilibristofgo/sandbox/04_internal/app3/internal/core/domain"
"github.com/equilibristofgo/sandbox/04_internal/app3/internal/core/ports"
"gorm.io/gorm"
"log"
)
type taskPostgres struct {
db *gorm.DB
}
func NewTaskPostgres(db *gorm.DB) ports.TasksRepository {
return &taskPostgres{db}
}
func (p *taskPostgres) Create(ctx context.Context, task domain.Task) (domain.Task, error) {
headerLog := "TaskPostgres - Create - "
log.Println(headerLog + "Init")
//TODO: implement
log.Println(headerLog + "End")
return domain.Task{}, nil
}
func (p *taskPostgres) Find(ctx context.Context, id int) (domain.Task, error) {
headerLog := "TaskPostgres - Find - "
log.Println(ctx, headerLog+"Init")
//TODO: implement
log.Println(ctx, headerLog+"End")
return domain.Task{}, nil
}
func (p *taskPostgres) Update(ctx context.Context, task domain.Task) error {
headerLog := "TaskPostgres - Update - "
log.Println(ctx, headerLog+"Init")
//TODO: implement
log.Println(ctx, headerLog+"End")
return nil
}
func (p *taskPostgres) Delete(ctx context.Context, id int) error {
headerLog := "TaskPostgres - Delete - "
log.Println(ctx, headerLog+"Init")
//TODO: implement
log.Println(ctx, headerLog+"End")
return nil
}