serializers

package
v0.0.0-...-532b7ea Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2021 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetValidate

func GetValidate() *validator.Validate

func VerifyCertificateFormat

func VerifyCertificateFormat(password validator.FieldLevel) bool

func VerifyDateFormat

func VerifyDateFormat(date validator.FieldLevel) bool

func VerifyInitialNameFormat

func VerifyInitialNameFormat(initialName validator.FieldLevel) bool

func VerifyMobilePhoneFormat

func VerifyMobilePhoneFormat(mobilePhone validator.FieldLevel) bool

func VerifyNameFormat

func VerifyNameFormat(password validator.FieldLevel) bool

func VerifyPasswordFormat

func VerifyPasswordFormat(password validator.FieldLevel) bool

func VerifyStationNameFormat

func VerifyStationNameFormat(stationName validator.FieldLevel) bool

func VerifyTimeFormat

func VerifyTimeFormat(date validator.FieldLevel) bool

func VerifyTrainNoFormat

func VerifyTrainNoFormat(trainNo validator.FieldLevel) bool

func VerifyUsernameFormat

func VerifyUsernameFormat(username validator.FieldLevel) bool

Types

type AddRegularPassenger

type AddRegularPassenger struct {
	MobilePhone string `validate:"required,numeric,len=11,VerifyMobilePhoneFormat" json:"mobile_phone"`
	Name        string `validate:"required,VerifyNameFormat" json:"name"`
	Certificate string `validate:"required,len=18,VerifyCertificateFormat" json:"certificate"`
}

type CancelOrder

type CancelOrder struct {
	OrderID uint64 `json:"order_id"`
}

type CreateOrder

type CreateOrder struct {
	ScheduleID uint64   `json:"schedule_id"`
	SeatType   uint64   `json:"seat_type"`
	Passengers []uint64 `json:"passengers"`
}

type DeleteRegularPassenger

type DeleteRegularPassenger struct {
	PassengerID uint `validate:"required" json:"passenger_id"`
}

type GetScheduleDetail

type GetScheduleDetail struct {
	TrainNo   string `json:"train_no" validate:"required,VerifyTrainNoFormat"`
	StartTime string `json:"start_time" validate:"required,VerifyTimeFormat"`
}

type GetScheduleList

type GetScheduleList struct {
	StartDate      string `json:"start_date" validate:"required,VerifyTimeFormat"`
	StartStationID uint   `json:"start_station_id" validate:"required"`
	EndStationID   uint   `json:"end_station_id" validate:"required"`
}

type GetStation

type GetStation struct {
	InitialName string `json:"initial_name" validate:"required,len=1,VerifyInitialNameFormat"`
}

type GetStop

type GetStop struct {
	ScheduleID uint `json:"schedule_id" validate:"required"`
}

type Login

type Login struct {
	Username string `validate:"required" json:"username"`
	Password string `validate:"required,VerifyPasswordFormat" json:"password"`
}

type PayMoney

type PayMoney struct {
	OrderID uint64 `json:"order_id"`
}

type QueryRegularPassenger

type QueryRegularPassenger struct {
	CertificateType string `json:"certificate_type"`
	Name            string `json:"name"`
	Certificate     string `json:"certificate"`
	PassengerType   string `json:"passenger_type"`
	CheckStatus     string `json:"check_status"`
	CreateDate      string `json:"create_date"`
	MobilePhone     string `json:"mobile_phone"`
}

type QueryUserInformation

type QueryUserInformation struct {
	Username        string `json:"username"`
	Name            string `json:"name"`
	Country         string `json:"country"`
	CertificateType string `json:"certificate_type"`
	Certificate     string `json:"certificate"`
	CheckStatus     string `json:"check_status"`
	MobilePhone     string `json:"mobile_phone"`
	Email           string `json:"email"`
	PassengerType   string `json:"passenger_type"`
}

type RefundMoney

type RefundMoney struct {
	OrderID uint64 `json:"order_id"`
}

type Register

type Register struct {
	Username    string `validate:"required,VerifyUsernameFormat" json:"username"`
	Password    string `validate:"required,VerifyPasswordFormat" json:"password"`
	Email       string `validate:"required,email" json:"email"`
	MobilePhone string `validate:"required,numeric,len=11,VerifyMobilePhoneFormat" json:"mobile_phone"`
	Name        string `validate:"required" json:"name"`
	Certificate string `validate:"required" json:"certificate"`
}

type ScheduleList

type ScheduleList struct {
	TrainNo      string    `json:"train_no"`
	TrainType    string    `json:"train_type"`
	TicketStatus string    `json:"ticket_status"`
	StartTime    time.Time `json:"start_time"`
	EndTime      time.Time `json:"end_time"`
	Duration     uint      `json:"duration"`

	StartStation StationList `json:"start_station"`
	EndStation   StationList `json:"end_station"`
}

type SearchStation

type SearchStation struct {
	Key string `json:"key" validate:"required"`
}

type StationList

type StationList struct {
	StationID   uint   `json:"station_id"`
	StationName string `json:"station_name"`
	InitialName string `json:"initial_name"`
	Pinyin      string `json:"pinyin"`
	CityNo      string `json:"city_no"`
	CityName    string `json:"city_name"`
	ShowName    string `json:"show_name"`
	NameType    string `json:"name_type"`
}

type StopList

type StopList struct {
	No          uint      `json:"no"`
	StationName string    `json:"station_name"`
	StartTime   time.Time `json:"start_time"`
	Duration    uint      `json:"duration"`
}

type UpdatePassword

type UpdatePassword struct {
	Password string `validate:"required,VerifyPasswordFormat" json:"password""`
}

type UpdateRegularPassenger

type UpdateRegularPassenger struct {
	PassengerID   uint   `validate:"required" json:"passenger_id"`
	MobilePhone   string `validate:"required,numeric,len=11,VerifyMobilePhoneFormat" json:"mobile_phone"`
	PassengerType uint8  `validate:"required" json:"passenger_type"`
}

Jump to

Keyboard shortcuts

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