修改bug和新增项目

pull/23/head
刘鑫 2 months ago
parent c27b30a6f5
commit 8f9429ce9f
  1. 6
      WeiCloud.Fusion/AlarmService/Alarm.DomainService/DahAlarm/DahuaGeneralCtlService.cs
  2. 2
      WeiCloud.Fusion/AlarmService/AlarmService.API/Controllers/AlarmController.cs
  3. 15
      WeiCloud.Fusion/AlarmService/AlarmService.API/appsettings.json
  4. 33
      WeiCloud.Fusion/ThirdPartyServices/ThirdPartyServices.API/Controllers/WeatherForecastController.cs
  5. 27
      WeiCloud.Fusion/ThirdPartyServices/ThirdPartyServices.API/Program.cs
  6. 41
      WeiCloud.Fusion/ThirdPartyServices/ThirdPartyServices.API/Properties/launchSettings.json
  7. 9
      WeiCloud.Fusion/ThirdPartyServices/ThirdPartyServices.API/ThirdPartyServices.API.csproj
  8. 6
      WeiCloud.Fusion/ThirdPartyServices/ThirdPartyServices.API/ThirdPartyServices.API.http
  9. 13
      WeiCloud.Fusion/ThirdPartyServices/ThirdPartyServices.API/WeatherForecast.cs
  10. 9
      WeiCloud.Fusion/ThirdPartyServices/ThirdPartyServices.API/appsettings.json
  11. 9
      WeiCloud.Fusion/ThirdPartyServices/ThirdPartyServices.Application/ThirdPartyServices.Application.csproj
  12. 9
      WeiCloud.Fusion/ThirdPartyServices/ThirdPartyServices.DomainService/ThirdPartyServices.DomainService.csproj
  13. 9
      WeiCloud.Fusion/ThirdPartyServices/ThirdPartyServices.Entity/ThirdPartyServices.Entity.csproj
  14. 4
      WeiCloud.Fusion/VideoService/Video.API/Controllers/DaHua/VideoManageController.cs
  15. 30
      WeiCloud.Fusion/WeiCloud.Fusion.sln

@ -206,14 +206,14 @@ namespace Alarm.DomainService.DahAlarm
if (dto.Info is not null) if (dto.Info is not null)
{ {
//这是大华的残卫报警类型 //这是大华的残卫报警类型
if (dto.Info.AlarmType == 4321) if (dto.Info.AlarmType == 81)
{ {
//拼接物联平台标准的mqtt消息格式 //拼接物联平台标准的mqtt消息格式
var payload = "[{\"taglabel\":\"DH" + dto.Info.DeviceName + "\",\"value\":\"" + dto.Info.AlarmStat + "\",\"time\":\"" + DateTimeOffset.UtcNow.ToUnixTimeSeconds() + "\"}]"; var payload = "[{\"taglabel\":\"" + dto.Info.NodeCode + "\",\"value\":\"" + dto.Info.AlarmStat + "\",\"time\":\"" + DateTimeOffset.UtcNow.ToUnixTimeSeconds() + "\"}]";
// var payload = "[{\"taglabel\":\"残卫测试报警按钮.alarmStat\",\"value\":\"" + dto.Info.AlarmStat + "\",\"time\":\"" + DateTimeOffset.UtcNow.ToUnixTimeSeconds() + "\"}]"; // var payload = "[{\"taglabel\":\"残卫测试报警按钮.alarmStat\",\"value\":\"" + dto.Info.AlarmStat + "\",\"time\":\"" + DateTimeOffset.UtcNow.ToUnixTimeSeconds() + "\"}]";
await _mqttClient.EnsureConnectedAsync(mqttHostIp, mqttHostPort, mqttUsername, mqttPassword, topicName, mqttClientId); await _mqttClient.EnsureConnectedAsync(mqttHostIp, mqttHostPort, mqttUsername, mqttPassword, topicName, mqttClientId);
await _mqttClientService.PublishAsync(topicName, payload); await _mqttClientService.PublishAsync("/zrh/sun/alarm", payload);
} }
} }
} }

@ -46,7 +46,7 @@ namespace AlarmService.API.Controllers
EventEnvelopeDto dto = new EventEnvelopeDto(); EventEnvelopeDto dto = new EventEnvelopeDto();
try try
{ {
dto = JsonSerializer.Deserialize<EventEnvelopeDto>(data.ToJson())!; dto = JsonSerializer.Deserialize<EventEnvelopeDto>(data)!;
} }
catch (Exception ex) catch (Exception ex)
{ {

@ -7,7 +7,7 @@
}, },
"SubscribeMQTT": { "SubscribeMQTT": {
"TopicName": "/zrh/sun/alarm", "TopicName": "/zrh/sun/alarm2",
"ProjectId": 530522108656160, "ProjectId": 530522108656160,
"HostIP": "v4.weienergy.cn", "HostIP": "v4.weienergy.cn",
"HostPort": 18883, "HostPort": 18883,
@ -17,6 +17,19 @@
"ClientId": "datasource_points_AXYJPT_v4", "ClientId": "datasource_points_AXYJPT_v4",
"ApiUrl": "http://v4.weienergy.cn/datastream" "ApiUrl": "http://v4.weienergy.cn/datastream"
}, },
//"SubscribeMQTT": {
// "TopicName": "/zrh/sun/alarm2",
// "ProjectId": 530522108656160,
// "HostIP": "demo.weienergy.cn",
// "HostPort": 1883,
// "Timeout": 5000,
// "UserName": "test",
// "Password": "test123",
// "ClientId": "mqttx_40578401",
// "ApiUrl": "http://demo.weienergy.cn/datastream"
//},
"CorsWithOrigins": [ "https://demo.weienergy.cn:15214", "http://59.110.150.214", "https://demo.weienergy.cn/" ], "CorsWithOrigins": [ "https://demo.weienergy.cn:15214", "http://59.110.150.214", "https://demo.weienergy.cn/" ],
"AllowedHosts": "*", "AllowedHosts": "*",
// //

@ -0,0 +1,33 @@
using Microsoft.AspNetCore.Mvc;
namespace ThirdPartyServices.API.Controllers
{
[ApiController]
[Route("[controller]")]
public class WeatherForecastController : ControllerBase
{
private static readonly string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};
private readonly ILogger<WeatherForecastController> _logger;
public WeatherForecastController(ILogger<WeatherForecastController> logger)
{
_logger = logger;
}
[HttpGet]
public IEnumerable<WeatherForecast> Get()
{
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
TemperatureC = Random.Shared.Next(-20, 55),
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
})
.ToArray();
}
}
}

@ -0,0 +1,27 @@
namespace ThirdPartyServices.API
{
public class Program
{
public static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
var app = builder.Build();
// Configure the HTTP request pipeline.
app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();
app.Run();
}
}
}

@ -0,0 +1,41 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:45980",
"sslPort": 44353
}
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "weatherforecast",
"applicationUrl": "http://localhost:5053",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "weatherforecast",
"applicationUrl": "https://localhost:7195;http://localhost:5053",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "weatherforecast",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
</Project>

@ -0,0 +1,6 @@
@ThirdPartyServices.API_HostAddress = http://localhost:5053
GET {{ThirdPartyServices.API_HostAddress}}/weatherforecast/
Accept: application/json
###

@ -0,0 +1,13 @@
namespace ThirdPartyServices.API
{
public class WeatherForecast
{
public DateOnly Date { get; set; }
public int TemperatureC { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
public string? Summary { get; set; }
}
}

@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

@ -108,8 +108,8 @@ namespace Video.API.Controllers.DaHua
$"https://{_configuration["DahuaAuth:Host"]}/evo-apigw/evo-httpnode/vod/cam/download.mp4" + $"https://{_configuration["DahuaAuth:Host"]}/evo-apigw/evo-httpnode/vod/cam/download.mp4" +
$"?vcuid={dto.Vcuid.Replace("$", "%24")}" + $"?vcuid={dto.Vcuid.Replace("$", "%24")}" +
$"&subtype=1" + $"&subtype=1" +
$"&starttime={dto.Starttime:yyyy_MM_dd_HH_mm_ss}" + $"&starttime={dto.Starttime}" +
$"&endtime={dto.Endtime:yyyy_MM_dd_HH_mm_ss}" + $"&endtime={dto.Endtime}" +
$"&videoType={dto.VideoType}" + $"&videoType={dto.VideoType}" +
$"&token={token.Replace("bearer ", "")}" + $"&token={token.Replace("bearer ", "")}" +
$"&recordType={dto.RecordType}"; $"&recordType={dto.RecordType}";

@ -63,6 +63,16 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ParkingLotEntity", "Parking
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ParkLotInfoService", "ParkingLotService\ParkLotInfoService\ParkLotInfoService.csproj", "{AAF45271-3161-46EB-971E-317577091BCF}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ParkLotInfoService", "ParkingLotService\ParkLotInfoService\ParkLotInfoService.csproj", "{AAF45271-3161-46EB-971E-317577091BCF}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ThirdPartyServices", "ThirdPartyServices", "{EDE1A83A-1BCD-4A9A-9732-AAAC2AE46216}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ThirdPartyServices.API", "ThirdPartyServices\ThirdPartyServices.API\ThirdPartyServices.API.csproj", "{542D2F63-50B0-4279-9EBE-A0603C387546}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ThirdPartyServices.DomainService", "ThirdPartyServices\ThirdPartyServices.DomainService\ThirdPartyServices.DomainService.csproj", "{2A33E53C-E4C0-491D-8B14-BF137ECECA83}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ThirdPartyServices.Application", "ThirdPartyServices\ThirdPartyServices.Application\ThirdPartyServices.Application.csproj", "{7BC20C1A-33DA-4EFD-A61E-9BC7B3749023}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ThirdPartyServices.Entity", "ThirdPartyServices\ThirdPartyServices.Entity\ThirdPartyServices.Entity.csproj", "{53A7A11F-729C-4A56-BEA7-52D7080C86E2}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -157,6 +167,22 @@ Global
{AAF45271-3161-46EB-971E-317577091BCF}.Debug|Any CPU.Build.0 = Debug|Any CPU {AAF45271-3161-46EB-971E-317577091BCF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AAF45271-3161-46EB-971E-317577091BCF}.Release|Any CPU.ActiveCfg = Release|Any CPU {AAF45271-3161-46EB-971E-317577091BCF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AAF45271-3161-46EB-971E-317577091BCF}.Release|Any CPU.Build.0 = Release|Any CPU {AAF45271-3161-46EB-971E-317577091BCF}.Release|Any CPU.Build.0 = Release|Any CPU
{542D2F63-50B0-4279-9EBE-A0603C387546}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{542D2F63-50B0-4279-9EBE-A0603C387546}.Debug|Any CPU.Build.0 = Debug|Any CPU
{542D2F63-50B0-4279-9EBE-A0603C387546}.Release|Any CPU.ActiveCfg = Release|Any CPU
{542D2F63-50B0-4279-9EBE-A0603C387546}.Release|Any CPU.Build.0 = Release|Any CPU
{2A33E53C-E4C0-491D-8B14-BF137ECECA83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2A33E53C-E4C0-491D-8B14-BF137ECECA83}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2A33E53C-E4C0-491D-8B14-BF137ECECA83}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2A33E53C-E4C0-491D-8B14-BF137ECECA83}.Release|Any CPU.Build.0 = Release|Any CPU
{7BC20C1A-33DA-4EFD-A61E-9BC7B3749023}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7BC20C1A-33DA-4EFD-A61E-9BC7B3749023}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7BC20C1A-33DA-4EFD-A61E-9BC7B3749023}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7BC20C1A-33DA-4EFD-A61E-9BC7B3749023}.Release|Any CPU.Build.0 = Release|Any CPU
{53A7A11F-729C-4A56-BEA7-52D7080C86E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{53A7A11F-729C-4A56-BEA7-52D7080C86E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{53A7A11F-729C-4A56-BEA7-52D7080C86E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{53A7A11F-729C-4A56-BEA7-52D7080C86E2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -184,6 +210,10 @@ Global
{40B0D902-553C-C52F-71A2-56FB176FCCBD} = {44DAA396-C724-480A-A2BC-9A33D29E8FEA} {40B0D902-553C-C52F-71A2-56FB176FCCBD} = {44DAA396-C724-480A-A2BC-9A33D29E8FEA}
{17CDE797-A6C8-4454-BDF2-E63679C22570} = {0A3134C8-219C-4674-B152-1FA6561E4217} {17CDE797-A6C8-4454-BDF2-E63679C22570} = {0A3134C8-219C-4674-B152-1FA6561E4217}
{AAF45271-3161-46EB-971E-317577091BCF} = {0A3134C8-219C-4674-B152-1FA6561E4217} {AAF45271-3161-46EB-971E-317577091BCF} = {0A3134C8-219C-4674-B152-1FA6561E4217}
{542D2F63-50B0-4279-9EBE-A0603C387546} = {EDE1A83A-1BCD-4A9A-9732-AAAC2AE46216}
{2A33E53C-E4C0-491D-8B14-BF137ECECA83} = {EDE1A83A-1BCD-4A9A-9732-AAAC2AE46216}
{7BC20C1A-33DA-4EFD-A61E-9BC7B3749023} = {EDE1A83A-1BCD-4A9A-9732-AAAC2AE46216}
{53A7A11F-729C-4A56-BEA7-52D7080C86E2} = {EDE1A83A-1BCD-4A9A-9732-AAAC2AE46216}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {379A56DA-D3F0-4E7E-8FF7-DA8E20015BF3} SolutionGuid = {379A56DA-D3F0-4E7E-8FF7-DA8E20015BF3}

Loading…
Cancel
Save