dao

package
v0.0.0-...-8c6f8b2 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateUser

func CreateUser(trx *sqlx.Tx, id int64, username, password string) (err error)

func GetCityByIp

func GetCityByIp(ipStr string) (*geoip2.City, error)

func GetProvince

func GetProvince(trx *sqlx.Tx, id int) (*models.Province, error)

func GetUserById

func GetUserById(trx *sqlx.Tx, id int64) (*models.User, error)

func HasUser

func HasUser(trx *sqlx.Tx, user *models.User) (bool, error)

func ListProvinces

func ListProvinces(trx *sqlx.Tx) ([]*models.Province, error)

func ListUsers

func ListUsers(trx *sqlx.Tx) (*[]models.User, error)

Types

type CityDao

type CityDao struct {
	Trx *sqlx.Tx
}

func (*CityDao) GetCity

func (cityDao *CityDao) GetCity(id int) (*models.City, error)

func (*CityDao) ListCities

func (cityDao *CityDao) ListCities() (*[]models.City, error)

type ProvinceDao

type ProvinceDao struct {
	Trx *sqlx.Tx
}

func (*ProvinceDao) GetProvince

func (provinceDao *ProvinceDao) GetProvince(id int) (*models.Province, error)

func (*ProvinceDao) ListProvinces

func (provinceDao *ProvinceDao) ListProvinces() (*[]models.Province, error)

Jump to

Keyboard shortcuts

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