-
Notifications
You must be signed in to change notification settings - Fork 1
/
watering.go
45 lines (35 loc) · 1.35 KB
/
watering.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
package database
import (
"github.com/jphacks/F_2002_1/go/domain/entity"
"github.com/jphacks/F_2002_1/go/domain/repository"
"github.com/jinzhu/gorm"
)
var _ repository.Watering = &WateringRepository{}
// WateringRepository は repository.WateringRepository を満たす構造体です。
type WateringRepository struct {
db *gorm.DB
}
// NewWateringRepository はWateringRepositoryのポインタを生成する関数です。
func NewWateringRepository(db *gorm.DB) *WateringRepository {
return &WateringRepository{db: db}
}
// FindByID は指定されたIDを持つ水やりの記録を取得します。
func (r *WateringRepository) FindByID(id int) (*entity.Watering, error) {
return nil, nil
}
// FindAll は指定されたIDを持つ水やりの記録を取得します。
func (r *WateringRepository) FindAll() (*entity.Waterings, error) {
return nil, nil
}
// Store は水やりの記録を新規保存します。
func (r *WateringRepository) Store(watering *entity.Watering) (*entity.Watering, error) {
return nil, nil
}
// UpdateByID は水やりの記録の情報を更新します。
func (r *WateringRepository) UpdateByID(watering *entity.Watering) (*entity.Watering, error) {
return nil, nil
}
// DeleteByID は指定されたIDを持つ水やりの記録を削除します。
func (r *WateringRepository) DeleteByID(id int) error {
return nil
}