ToolsWeather

package
v5.1.29 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run()

Types

type ArgsGetCity

type ArgsGetCity struct {
	//所属国家 国家代码
	// eg: china => 86
	Country int `db:"country" json:"country" check:"country"`
	//城市编码
	CityCode int `db:"city_code" json:"cityCode" check:"intThan0" empty:"true"`
}

ArgsGetCity 获取指定城市的数据包参数

type ArgsGetCityList

type ArgsGetCityList struct {
	//分页
	Pages CoreSQLPages.ArgsDataList `json:"pages"`
	//搜索
	Search string `json:"search" check:"search" empty:"true"`
}

ArgsGetCityList 获取城市列表参数

type ArgsGetWeather

type ArgsGetWeather struct {
	//所属国家 国家代码
	// eg: china => 86
	Country int `db:"country" json:"country" check:"country"`
	//城市编码
	CityCode int `db:"city_code" json:"cityCode" check:"intThan0" empty:"true"`
	//查询天数
	// 1 1天 / 3 3天 / 7 7天
	DayCount int `db:"day_count" json:"dayCount" check:"intThan0" empty:"true"`
}

ArgsGetWeather 获取指定城市的天气预报参数

type DataGetWeather

type DataGetWeather struct {
	//天气预报结构
	Weathers []FieldsWeatherData `json:"weathers"`
}

DataGetWeather 获取指定城市的天气预报数据

func GetWeather

func GetWeather(args *ArgsGetWeather) (data DataGetWeather, err error)

GetWeather 获取指定城市的天气预报

type FieldsCity

type FieldsCity struct {
	//ID
	ID int64 `db:"id" json:"id"`
	//所属国家 国家代码
	// eg: china => 86
	Country int `db:"country" json:"country"`
	//城市编码
	CityCode int `db:"city_code" json:"cityCode"`
	//扩展数据
	CityData FieldsCityData `db:"city_data" json:"cityData"`
}

FieldsCity 城市和关联数据集合

func GetCity

func GetCity(args *ArgsGetCity) (data FieldsCity, err error)

GetCity 获取指定城市的数据包参数

func GetCityList

func GetCityList(args *ArgsGetCityList) (dataList []FieldsCity, dataCount int64, err error)

GetCityList 获取城市列表

type FieldsCityData

type FieldsCityData struct {
	Name      string `json:"name"`
	Id        string `json:"id"`
	Lat       string `json:"lat"`
	Lon       string `json:"lon"`
	Adm2      string `json:"adm2"`
	Adm1      string `json:"adm1"`
	Country   string `json:"country"`
	Tz        string `json:"tz"`
	UtcOffset string `json:"utcOffset"`
	IsDst     string `json:"isDst"`
	Type      string `json:"type"`
	Rank      string `json:"rank"`
	FxLink    string `json:"fxLink"`
}

FieldsCityData 日风天气数据集合

func (*FieldsCityData) Scan

func (t *FieldsCityData) Scan(value interface{}) error

func (FieldsCityData) Value

func (t FieldsCityData) Value() (driver.Value, error)

Value sql底层处理器

type FieldsWeather

type FieldsWeather struct {
	//ID
	ID int64 `db:"id" json:"id"`
	//天气时间
	// 20200101 没有小时等
	DayTime time.Time `db:"day_time" json:"dayTime"`
	//城市ID
	CityID int64 `db:"city_id" json:"cityID"`
	//天气数据集合
	Weather FieldsWeatherData `db:"weather" json:"weather"`
}

FieldsWeather 天气数据

type FieldsWeatherData

type FieldsWeatherData struct {
	FxDate         string `json:"fxDate"`
	Sunrise        string `json:"sunrise"`
	Sunset         string `json:"sunset"`
	Moonrise       string `json:"moonrise"`
	Moonset        string `json:"moonset"`
	MoonPhase      string `json:"moonPhase"`
	TempMax        string `json:"tempMax"`
	TempMin        string `json:"tempMin"`
	IconDay        string `json:"iconDay"`
	TextDay        string `json:"textDay"`
	IconNight      string `json:"iconNight"`
	TextNight      string `json:"textNight"`
	Wind360Day     string `json:"wind360Day"`
	WindDirDay     string `json:"windDirDay"`
	WindScaleDay   string `json:"windScaleDay"`
	WindSpeedDay   string `json:"windSpeedDay"`
	Wind360Night   string `json:"wind360Night"`
	WindDirNight   string `json:"windDirNight"`
	WindScaleNight string `json:"windScaleNight"`
	WindSpeedNight string `json:"windSpeedNight"`
	Humidity       string `json:"humidity"`
	Precip         string `json:"precip"`
	Pressure       string `json:"pressure"`
	Vis            string `json:"vis"`
	Cloud          string `json:"cloud"`
	UvIndex        string `json:"uvIndex"`
}

FieldsWeatherData 日风天气气象数据集合

func (*FieldsWeatherData) Scan

func (t *FieldsWeatherData) Scan(value interface{}) error

func (FieldsWeatherData) Value

func (t FieldsWeatherData) Value() (driver.Value, error)

Value sql底层处理器

Jump to

Keyboard shortcuts

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