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