Table of Contents

IWeatherService 接口

命名空间
ClassIsland.Core.Abstractions.Services
程序集
ClassIsland.Core.dll

天气服务。

public interface IWeatherService

属性

IsWeatherRefreshed

天气是否已经刷新

bool IsWeatherRefreshed { get; set; }

属性值

bool

WeatherStatusList

天气状态列表

List<XiaomiWeatherStatusCodeItem> WeatherStatusList { get; set; }

属性值

List<XiaomiWeatherStatusCodeItem>

方法

GetCitiesByName(string)

按省份和城市名搜索城市

Task<List<City>> GetCitiesByName(string name)

参数

name string

搜索字符串

返回

Task<List<City>>

匹配搜索的城市列表

GetWeatherTextByCode(string)

根据天气代码获得天气名称

string GetWeatherTextByCode(string code)

参数

code string

天气代码

返回

string

对应的天气名称。如果不存在,则返回“未知”。

QueryWeatherAsync()

立刻查询天气

Task QueryWeatherAsync()

返回

Task