service

package
v0.0.0-...-4362469 Latest Latest
Warning

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

Go to latest
Published: May 8, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DateString string = "2006-01-02"
	TimeString string = "2006-01-02T15:04:05.000Z"
)

Variables

View Source
var ServiceError error = errors.New("service: serivce has error.")

Functions

func ChangeBus

func ChangeBus(busModel *BusModel) error

func ChangeChargeRecord

func ChangeChargeRecord(chargeRecordModel *ChargeRecordModel) error

func ChangeLineFareIncome

func ChangeLineFareIncome(lineFareIncomeModel *LineFareIncomeModel) error

func CreateBus

func CreateBus(busModel *BusModel) error

func CreateChargeRecord

func CreateChargeRecord(chargeRecordModel *ChargeRecordModel) error

func CreateLineFareIncome

func CreateLineFareIncome(chargeRecordModel *LineFareIncomeModel) error

func CreateStaff

func CreateStaff(staffModel *StaffModel) error

func Resign

func Resign(model *StaffResignModel) error

Types

type BusBrandModel

type BusBrandModel struct {
	ID    string `form:"id" json:"id"`
	Name  string `form:"name" json:"name"`
	Model string `form:"model" json:"model"`
	Alias string `form:"alias" json:"alias"`
}

func GetAllBusBrands

func GetAllBusBrands() []BusBrandModel

type BusModel

type BusModel struct {
	ID              string `form:"id" json:"id"`
	License         string `form:"license" json:"license" binding:"required"`
	CustomID        string `form:"customID" json:"customID"`
	BrandID         string `form:"brandID" json:"brandID"`
	BrandAlias      string `form:"brandAlias" json:"brandAlias"`
	RegisterDate    string `form:"registerDate" json:"registerDate" binding:"required"`
	VehicleIDNumber string `form:"vin" json:"vin"`
	EngineNo        string `form:"engineNo" json:"engineNo"`
	PersonsCapacity int    `form:"personsCapacity" json:"personsCapacity"`
}

func FetchBusByLicense

func FetchBusByLicense(license string) (BusModel, bool)

func GetAllBuses

func GetAllBuses() []BusModel

type ChargeRecordModel

type ChargeRecordModel struct {
	ID            string     `json:"id"`
	Bus           BusModel   `json:"bus"`
	RecordDate    string     `json:"recordDate"`
	RecordStaff   StaffModel `json:"recordStaff"`
	Mileage       float32    `json:"mileage"`
	ChargedTWH    float32    `json:"chargedTWH"`
	RemainPercent float32    `json:"remainPercent"`
	FinalPercent  float32    `json:"finalPercent"`
}

func GetAllChargeRecord

func GetAllChargeRecord() []ChargeRecordModel

func GetChargeRecord

func GetChargeRecord(query map[string]interface{}) []ChargeRecordModel

type DictionaryModel

type DictionaryModel struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Type     int    `json:"type"`
	IsActive bool   `json:"isActive"`
}

func FetchDictionariesByType

func FetchDictionariesByType(dicType string) ([]DictionaryModel, error)

type LineFareIncomeModel

type LineFareIncomeModel struct {
	ID             string     `json:"id"`
	LineNo         int        `json:"lineNo"`
	CarryingAmount float32    `json:"carryingAmount"`
	ActualAmount   float32    `json:"actualAmount"`
	WornCoinAmount float32    `json:"wornCoinAmount"`
	BusNumbers     int        `json:"busNumbers"`
	CountingDate   string     `json:"countingDate"`
	CountingStaff1 StaffModel `json:"countingStaff1"`
	CountingStaff2 StaffModel `json:"countingStaff2"`
	RecordStaff    StaffModel `json:"recordStaff"`
}

func GetAllLineFareIncome

func GetAllLineFareIncome() []LineFareIncomeModel

func GetLineFareIncome

func GetLineFareIncome(query map[string]interface{}) []LineFareIncomeModel

type StaffModel

type StaffModel struct {
	ID                       string          `json:"id"`
	Name                     string          `json:"name"`
	JobType                  DictionaryModel `json:"jobType"`
	OnboardTime              string          `json:"onboardTime"`
	PersonalID               string          `json:"personalID"`
	DriverType               DictionaryModel `json:"driverType"`
	IsInternship             bool            `json:"isInternship"`
	IsMultitimeHired         bool            `json:"isMultitimeHired"`
	IsResign                 bool            `json:"isResign"`
	FirstOnboardTime         string          `json:"firstOnboardTime"`
	Phone                    string          `json:"phone,omitempty"`
	Department               DictionaryModel `json:"department"`
	EmergencyContact         string          `json:"emergencyContact"`
	EmergencyContactPhone    string          `json:"emergencyContactPhone,omitempty"`
	EmergencyContactRelation string          `json:"emergencyContactRelation"`
}

func FetchStaffByID

func FetchStaffByID(id string) (StaffModel, bool)

func GetAllDrivers

func GetAllDrivers() []StaffModel

func GetAllInternshipDrivers

func GetAllInternshipDrivers() []StaffModel

func GetAllQualifiedDrivers

func GetAllQualifiedDrivers() []StaffModel

func GetAllStaffs

func GetAllStaffs() []StaffModel

func GetSupportStaffs

func GetSupportStaffs() []StaffModel

type StaffResignModel

type StaffResignModel struct {
	ID           string     `json:"id"`
	ResignDate   string     `json:"resignDate"`
	ResignReason string     `json:"resignReason"`
	Staff        StaffModel `json:"staff"`
}

Jump to

Keyboard shortcuts

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