route

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHouseData

func GetHouseData(c *Context)

func GetHouseStatsByYear

func GetHouseStatsByYear(ctx context.Context, phone, year, smd, emd string) (map[string][]float64, error)

func ListCustomers

func ListCustomers(c *Context)

Types

type Context

type Context = gin.Context

type Customer

type Customer struct {
	Phone string `json:"phone"`
}

type GetHouseDataReq

type GetHouseDataReq struct {
	Phone     string `json:"phone" validate:"required,min=1"`
	StartDate string `json:"startDate" validate:"required,datetime=2006-01-02"`
	EndDate   string `json:"endDate" validate:"required,datetime=2006-01-02,gtecsfield=StartDate"`
}

type GetHouseDataResp

type GetHouseDataResp struct {
	// 年-月-日
	Dates []string `json:"dates"`
	// 0用电量 1电费
	// 2用水量 3水费
	// 4用气量 5气费
	Datasets [6][]float64 `json:"datasets"`
}

type ListCustomersResp

type ListCustomersResp struct {
	Customers []Customer `json:"customers"`
}

Jump to

Keyboard shortcuts

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