-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
lens_fixtures.go
59 lines (51 loc) Β· 1.34 KB
/
lens_fixtures.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
58
59
package entity
import (
"time"
)
type LensMap map[string]Lens
func (m LensMap) Get(name string) Lens {
if result, ok := m[name]; ok {
return result
}
return *NewLens("", name)
}
func (m LensMap) Pointer(name string) *Lens {
if result, ok := m[name]; ok {
return &result
}
return NewLens("", name)
}
var LensFixtures = LensMap{
"lens-f-380": {
ID: 1000000,
LensSlug: "lens-f-380",
LensName: "Apple F380",
LensMake: "Apple",
LensModel: "F380",
LensType: "",
LensDescription: "",
LensNotes: "Notes",
CreatedAt: time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
UpdatedAt: time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
DeletedAt: nil,
},
"4.15mm-f/2.2": {
ID: 1000001,
LensSlug: "4.15mm-f/2.2",
LensName: "Apple iPhone SE back camera 4.15mm f/2.2",
LensMake: "Apple",
LensModel: "iPhone SE back camera 4.15mm f/2.2",
LensType: "",
LensDescription: "",
LensNotes: "Notes",
CreatedAt: time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
UpdatedAt: time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
DeletedAt: nil,
},
}
// CreateLensFixtures inserts known entities into the database for testing.
func CreateLensFixtures() {
for _, entity := range LensFixtures {
Db().Create(&entity)
}
}