-
Notifications
You must be signed in to change notification settings - Fork 0
/
address.go
36 lines (28 loc) · 1.1 KB
/
address.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
package data
import "gitlab.com/distributed_lab/kit/pgdb"
type AddressesQ interface {
New() AddressesQ
Get() (*Address, error)
Select() ([]Address, error)
Transaction(fn func(q AddressesQ) error) error
Insert(address Address) (Address, error)
Update(address Address) (Address, error)
Delete(id int64) error
Page(pageParams pgdb.OffsetPageParams) AddressesQ
FilterById(ids ...int64) AddressesQ
FilterByBuildingNumber(numbers ...int64) AddressesQ
FilterByStreet(streets ...string) AddressesQ
FilterByCities(cities ...string) AddressesQ
FilterByDistricts(districts ...string) AddressesQ
FilterByRegion(regions ...string) AddressesQ
FilterByPostalCodes(codes ...string) AddressesQ
}
type Address struct {
Id int64 `db:"id" structs:"-"`
BuildingNumber int64 `db:"building_number" structs:"building_number"`
Street string `db:"street" structs:"street"`
City string `db:"city" structs:"city"`
District string `db:"district" structs:"district"`
Region string `db:"region" structs:"region"`
PostalCode string `db:"postal_code" structs:"postal_code"`
}