天气预报
This commit is contained in:
parent
4d5444d8f6
commit
8809e5ccfe
|
|
@ -56,6 +56,7 @@ if (redisoptions != null)
|
||||||
//自动注入
|
//自动注入
|
||||||
builder.Services.ServicesAutoInjectionExtension();
|
builder.Services.ServicesAutoInjectionExtension();
|
||||||
builder.Services.AddSocketService();
|
builder.Services.AddSocketService();
|
||||||
|
builder.Services.AddHttpClient();
|
||||||
//cross domain
|
//cross domain
|
||||||
builder.Services.AddCors(options =>
|
builder.Services.AddCors(options =>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ using System.Linq.Expressions;
|
||||||
|
|
||||||
namespace langguanApi.Service
|
namespace langguanApi.Service
|
||||||
{
|
{
|
||||||
[ServiceInjection(InjectionType.Scoped)]
|
[ServiceInjection(InjectionType.Transient)]
|
||||||
public class DeviceService : BaseService<Device>
|
public class DeviceService : BaseService<Device>
|
||||||
{
|
{
|
||||||
public DeviceService(IConfiguration config) : base(config, nameof(Device))
|
public DeviceService(IConfiguration config) : base(config, nameof(Device))
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ namespace langguanApi.Service
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// HomeService
|
/// HomeService
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ServiceInjection(InjectionType.Scoped)]
|
[ServiceInjection(InjectionType.Singleton)]
|
||||||
public class HomeService
|
public class HomeService
|
||||||
{
|
{
|
||||||
private DeviceService _deviceService;
|
private DeviceService _deviceService;
|
||||||
|
|
@ -62,7 +62,8 @@ namespace langguanApi.Service
|
||||||
devices,
|
devices,
|
||||||
ariQuality,
|
ariQuality,
|
||||||
Realtime,
|
Realtime,
|
||||||
GetViewTop
|
GetViewTop,
|
||||||
|
weather
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
using Newtonsoft.Json;
|
using langguanApi.Extensions.AutoDI;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace langguanApi.Service
|
namespace langguanApi.Service
|
||||||
{
|
{
|
||||||
|
[ServiceInjection(InjectionType.Transient)]
|
||||||
public class WeatherService
|
public class WeatherService
|
||||||
{
|
{
|
||||||
private IHttpClientFactory _httpClientFactory;
|
private IHttpClientFactory _httpClientFactory;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue