useraddressrepo

package
v0.0.0-...-ffb043f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QUERY_SELECT_ENABLED = "select ua.id, ua.user_id, ua.receiver_name, ua.phone_number, ua.post_code, " +
		`ua.type, ua.address, ua."default", ua.lat, ua.long, p.id, p.parent_id, p.name, ` +
		"p.ref_id, p.lat, p.long, c.id, c.parent_id, c.ref_id, c.name, c.lat, c.long, " +
		"d.id, d.parent_id, d.ref_id, d.name, d.lat, d.long, a.id, " +
		"a.parent_id, a.ref_id, a.name, a.lat, a.long " +
		"from public.user_address ua " +
		"inner join public.region p on ua.province_id = p.id " +
		"inner join public.region c on ua.city_id  = c.id " +
		"inner join public.region d on ua.district_id = d.id " +
		"inner join public.region a on ua.area_id = a.id " +
		"where ua.deleted = false "
	QUERY_BY_ID               = QUERY_SELECT_ENABLED + "and ua.id=$1"
	QUERY_BY_USER             = QUERY_SELECT_ENABLED + "and ua.user_id = $1"
	QUERY_BY_DELIVERY_DEFAULT = QUERY_BY_USER + ` and ua."default" = true and type = 'delivery'`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type UserAddressRepository

type UserAddressRepository struct {
	DB dbc.SqlDbc
}

func (*UserAddressRepository) FindAllByUser

func (uar *UserAddressRepository) FindAllByUser(user *model.User) ([]*model.UserAddress, error)

func (*UserAddressRepository) FindDefaultDeliveryByUser

func (uar *UserAddressRepository) FindDefaultDeliveryByUser(user *model.User) (*model.UserAddress, error)

func (*UserAddressRepository) FindUserAddressById

func (uar *UserAddressRepository) FindUserAddressById(id int) (*model.UserAddress, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL