cti

package
v1.0.29 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func Init

func Init(host, user, pwd string) error

func InitMock

func InitMock(db *sql.DB) error

Types

type Phone

type Phone struct {
	// 7位前缀
	Num string `gorm:"column:phone"`
	// 省份
	Province string `gorm:"column:province"`
	// 城市
	City string `gorm:"column:city"`
	// 运营商
	Isp string `gorm:"column:isp"`
}

func (*Phone) MarshalLogObject

func (p *Phone) MarshalLogObject(enc zapcore.ObjectEncoder) error

zap 日志格式化

func (Phone) TableName

func (p Phone) TableName() string

type PhoneRepository

type PhoneRepository struct {
	DB *gorm.DB
}

func NewPhoneRepository

func NewPhoneRepository() *PhoneRepository

func (*PhoneRepository) Phones

func (p *PhoneRepository) Phones() ([]Phone, error)

func (*PhoneRepository) PhonesMap

func (p *PhoneRepository) PhonesMap() (map[string]Phone, error)

Jump to

Keyboard shortcuts

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