Compare commits
20 Commits
d8a5099adc
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 633aa3b15a | |||
| 202c7eca64 | |||
| 6987759817 | |||
| a1bc22a40a | |||
| b393425166 | |||
| 37896ea102 | |||
| ca2e39277e | |||
| 0aa2216cb6 | |||
| 74c38b5e8c | |||
| 4312eaa0f0 | |||
| 8911e1e48a | |||
| 9e9dcd5264 | |||
| cfe5087bed | |||
| e6a6792580 | |||
| 46705123bf | |||
| b48907796f | |||
| fd3dd8dfbe | |||
| ef1bf9f4b6 | |||
| e4519a0615 | |||
| afcb48b1cc |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -56,3 +56,6 @@
|
||||
/ConsoleAppredissub/bin
|
||||
BLW_Log/wwwroot/PanelSelectionPic
|
||||
.trae
|
||||
WebApplication2
|
||||
WebServices
|
||||
不断升级
|
||||
|
||||
@@ -23,16 +23,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mykafka", "mykafka\mykafka.
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleAppConsume", "ConsoleAppConsume\ConsoleAppConsume.csproj", "{BD6CFB20-0AC0-4E00-8254-CCDA0401ADE7}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApplication2", "WebApplication2\WebApplication2.csproj", "{DD710D18-8A73-46B8-8CA5-72F208C68B02}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleAppredissub", "ConsoleAppredissub\ConsoleAppredissub.csproj", "{00FF77EE-827B-4288-B3B5-F8833FF532AC}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleAppDB", "ConsoleAppDB\ConsoleAppDB.csproj", "{1339A235-5CBF-4D0B-B68A-4B6DAD73C536}"
|
||||
EndProject
|
||||
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "WebApplication3", "WebApplication3\WebApplication3.fsproj", "{D1B1D313-0E9B-4018-9048-735AB69A5830}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebServices", "WebServices\WebServices.csproj", "{D93B795D-4836-40AA-B14A-D742B4F04F14}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -79,10 +75,6 @@ Global
|
||||
{BD6CFB20-0AC0-4E00-8254-CCDA0401ADE7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{BD6CFB20-0AC0-4E00-8254-CCDA0401ADE7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{BD6CFB20-0AC0-4E00-8254-CCDA0401ADE7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{DD710D18-8A73-46B8-8CA5-72F208C68B02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DD710D18-8A73-46B8-8CA5-72F208C68B02}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DD710D18-8A73-46B8-8CA5-72F208C68B02}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DD710D18-8A73-46B8-8CA5-72F208C68B02}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{00FF77EE-827B-4288-B3B5-F8833FF532AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{00FF77EE-827B-4288-B3B5-F8833FF532AC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{00FF77EE-827B-4288-B3B5-F8833FF532AC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
@@ -95,10 +87,6 @@ Global
|
||||
{D1B1D313-0E9B-4018-9048-735AB69A5830}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D1B1D313-0E9B-4018-9048-735AB69A5830}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D1B1D313-0E9B-4018-9048-735AB69A5830}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D93B795D-4836-40AA-B14A-D742B4F04F14}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D93B795D-4836-40AA-B14A-D742B4F04F14}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D93B795D-4836-40AA-B14A-D742B4F04F14}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D93B795D-4836-40AA-B14A-D742B4F04F14}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -6,6 +6,7 @@ using Microsoft.Extensions.Caching.Memory;
|
||||
using MySql.Data.MySqlClient;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NPOI.HSSF.Record;
|
||||
using Org.BouncyCastle.Asn1.Ocsp;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
@@ -805,6 +806,174 @@ namespace BLW_Log.Controllers
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 复制面板组:根据原始面板组 GUID 查询记录,创建一条新面板组记录,并将新面板组挂载到目标房型
|
||||
/// 关联方式:tbl_web_room_type.panel_group_count(JSON数组字符串)
|
||||
/// </summary>
|
||||
[HttpPost]
|
||||
public ReturnInfo CopyPanelListWithNewFields([FromBody] CopyPanelListRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (request == null)
|
||||
{
|
||||
return new ReturnInfo { isok = false, message = "请求参数不能为空", status = 400, response = null };
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(request.OriginalGuid))
|
||||
{
|
||||
return new ReturnInfo { isok = false, message = "原始GUID不能为空", status = 400, response = null };
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(request.TargetRoomGuid))
|
||||
{
|
||||
return new ReturnInfo { isok = false, message = "目标房型GUID不能为空", status = 400, response = null };
|
||||
}
|
||||
|
||||
// 使用事务保证:插入面板组 + 更新目标房型的 panel_group_count 原子性
|
||||
using var conn = new MySqlConnection(ReadConfig.Instance.MySQLConnectionString);
|
||||
conn.Open();
|
||||
using var tx = conn.BeginTransaction();
|
||||
|
||||
// 1) 查询原始面板组记录
|
||||
DataTable panelTable = new();
|
||||
using (var queryPanelCmd = new MySqlCommand(
|
||||
"SELECT * FROM `cdr_library`.`tbl_web_panel_list` WHERE guid = @guid AND is_valid = 1",
|
||||
conn,
|
||||
tx))
|
||||
{
|
||||
queryPanelCmd.Parameters.AddWithValue("@guid", request.OriginalGuid);
|
||||
using var adapter = new MySqlDataAdapter(queryPanelCmd);
|
||||
adapter.Fill(panelTable);
|
||||
}
|
||||
|
||||
if (panelTable.Rows.Count == 0)
|
||||
{
|
||||
tx.Rollback();
|
||||
return new ReturnInfo { isok = false, message = "未找到有效的原始面板组", status = 404, response = null };
|
||||
}
|
||||
|
||||
// 2) 锁定读取目标房型的 panel_group_count
|
||||
string roomPanelGroupCountRaw = null;
|
||||
using (var queryRoomCmd = new MySqlCommand(
|
||||
"SELECT panel_group_count FROM `cdr_library`.`tbl_web_room_type` WHERE guid = @guid AND is_valid = 1 FOR UPDATE",
|
||||
conn,
|
||||
tx))
|
||||
{
|
||||
queryRoomCmd.Parameters.AddWithValue("@guid", request.TargetRoomGuid);
|
||||
var scalar = queryRoomCmd.ExecuteScalar();
|
||||
if (scalar == null || scalar == DBNull.Value)
|
||||
{
|
||||
roomPanelGroupCountRaw = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
roomPanelGroupCountRaw = scalar.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
// 如果目标房型不存在
|
||||
// 注意:ExecuteScalar 在无行时返回 null
|
||||
using (var existsCmd = new MySqlCommand(
|
||||
"SELECT COUNT(1) FROM `cdr_library`.`tbl_web_room_type` WHERE guid = @guid AND is_valid = 1",
|
||||
conn,
|
||||
tx))
|
||||
{
|
||||
existsCmd.Parameters.AddWithValue("@guid", request.TargetRoomGuid);
|
||||
var cnt = Convert.ToInt32(existsCmd.ExecuteScalar() ?? 0);
|
||||
if (cnt <= 0)
|
||||
{
|
||||
tx.Rollback();
|
||||
return new ReturnInfo { isok = false, message = "未找到有效的目标房型", status = 404, response = null };
|
||||
}
|
||||
}
|
||||
|
||||
var originalRow = panelTable.Rows[0];
|
||||
var newGuid = Guid.NewGuid().ToString("N");
|
||||
var currentTime = DateTime.Now;
|
||||
|
||||
// 3) 插入新面板组记录
|
||||
using (var insertCmd = new MySqlCommand(@"
|
||||
INSERT INTO `cdr_library`.`tbl_web_panel_list`
|
||||
(panel_list_name, gang_series, model_type, gang_material_id, panel_count,
|
||||
carving_quantity, position, carving_filename, design_status, panel_info_json, logo_json, cdr_filename, thumbnail_large,
|
||||
thumbnail_small, erp_part_number, remarks, created_at, is_valid, guid)
|
||||
VALUES (@panel_list_name, @gang_series, @model_type, @gang_material_id, @panel_count,
|
||||
@carving_quantity, @position, @carving_filename, @design_status, @panel_info_json, @logo_json, @cdr_filename, @thumbnail_large,
|
||||
@thumbnail_small, @erp_part_number, @remarks, @created_at, 1, @guid)", conn, tx))
|
||||
{
|
||||
insertCmd.Parameters.AddWithValue("@panel_list_name", originalRow["panel_list_name"] ?? (object)DBNull.Value);
|
||||
insertCmd.Parameters.AddWithValue("@gang_series", originalRow["gang_series"] ?? (object)DBNull.Value);
|
||||
insertCmd.Parameters.AddWithValue("@model_type", originalRow["model_type"] ?? (object)DBNull.Value);
|
||||
insertCmd.Parameters.AddWithValue("@gang_material_id", originalRow["gang_material_id"] ?? (object)DBNull.Value);
|
||||
insertCmd.Parameters.AddWithValue("@panel_count", originalRow["panel_count"] ?? (object)DBNull.Value);
|
||||
insertCmd.Parameters.AddWithValue("@carving_quantity", originalRow["carving_quantity"] ?? (object)DBNull.Value);
|
||||
insertCmd.Parameters.AddWithValue("@position", originalRow["position"] ?? (object)DBNull.Value);
|
||||
insertCmd.Parameters.AddWithValue("@carving_filename", originalRow["carving_filename"] ?? (object)DBNull.Value);
|
||||
insertCmd.Parameters.AddWithValue("@design_status", originalRow["design_status"] ?? (object)DBNull.Value);
|
||||
insertCmd.Parameters.AddWithValue("@panel_info_json", originalRow["panel_info_json"] ?? (object)DBNull.Value);
|
||||
insertCmd.Parameters.AddWithValue("@logo_json", originalRow["logo_json"] ?? (object)DBNull.Value);
|
||||
insertCmd.Parameters.AddWithValue("@cdr_filename", originalRow["cdr_filename"] ?? (object)DBNull.Value);
|
||||
insertCmd.Parameters.AddWithValue("@thumbnail_large", originalRow["thumbnail_large"] ?? (object)DBNull.Value);
|
||||
insertCmd.Parameters.AddWithValue("@thumbnail_small", originalRow["thumbnail_small"] ?? (object)DBNull.Value);
|
||||
insertCmd.Parameters.AddWithValue("@erp_part_number", originalRow["erp_part_number"] ?? (object)DBNull.Value);
|
||||
insertCmd.Parameters.AddWithValue("@remarks", originalRow["remarks"] ?? (object)DBNull.Value);
|
||||
insertCmd.Parameters.AddWithValue("@created_at", currentTime);
|
||||
insertCmd.Parameters.AddWithValue("@guid", newGuid);
|
||||
|
||||
var affected = insertCmd.ExecuteNonQuery();
|
||||
if (affected <= 0)
|
||||
{
|
||||
tx.Rollback();
|
||||
return new ReturnInfo { isok = false, message = "新增面板组记录失败(未影响任何数据)", status = 500, response = null };
|
||||
}
|
||||
}
|
||||
|
||||
// 4) 更新目标房型的 panel_group_count
|
||||
List<string> panelGroups;
|
||||
try
|
||||
{
|
||||
panelGroups = JsonConvert.DeserializeObject<List<string>>(string.IsNullOrWhiteSpace(roomPanelGroupCountRaw) ? "[]" : roomPanelGroupCountRaw)
|
||||
?? new List<string>();
|
||||
}
|
||||
catch
|
||||
{
|
||||
panelGroups = new List<string>();
|
||||
}
|
||||
|
||||
if (!panelGroups.Contains(newGuid)) panelGroups.Add(newGuid);
|
||||
var newPanelGroupCountJson = JsonConvert.SerializeObject(panelGroups);
|
||||
|
||||
using (var updateRoomCmd = new MySqlCommand(
|
||||
"UPDATE `cdr_library`.`tbl_web_room_type` SET panel_group_count=@panel_group_count WHERE guid=@guid",
|
||||
conn,
|
||||
tx))
|
||||
{
|
||||
updateRoomCmd.Parameters.AddWithValue("@panel_group_count", newPanelGroupCountJson);
|
||||
updateRoomCmd.Parameters.AddWithValue("@guid", request.TargetRoomGuid);
|
||||
var affected = updateRoomCmd.ExecuteNonQuery();
|
||||
if (affected <= 0)
|
||||
{
|
||||
tx.Rollback();
|
||||
return new ReturnInfo { isok = false, message = "更新目标房型面板组列表失败(未影响任何数据)", status = 500, response = null };
|
||||
}
|
||||
}
|
||||
|
||||
tx.Commit();
|
||||
return new ReturnInfo { isok = true, message = "复制成功", status = 200, response = newGuid };
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ReturnInfo
|
||||
{
|
||||
isok = false,
|
||||
message = $"复制面板组失败: {ex.Message}",
|
||||
status = 500,
|
||||
response = null
|
||||
};
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region tbl_web_project 增删改查
|
||||
@@ -1033,6 +1202,7 @@ namespace BLW_Log.Controllers
|
||||
{
|
||||
project = projectToken,
|
||||
panels = panelsToken,
|
||||
RecordDate = DateTime.Now.ToString("yyyy-MM-dd"),
|
||||
picNum
|
||||
};
|
||||
|
||||
@@ -1306,11 +1476,14 @@ namespace BLW_Log.Controllers
|
||||
(room_name, room_description, panel_group_count, remarks, creator, created_at, is_valid, guid)
|
||||
VALUES (@room_name, @room_description, @panel_group_count, @remarks, @creator, @created_at, 1, @guid)";
|
||||
|
||||
// 兜底:panel_group_count 为空时用 [],避免前端 JSON.parse 报错
|
||||
var panelGroupCount = string.IsNullOrWhiteSpace(room.panel_group_count) ? "[]" : room.panel_group_count;
|
||||
|
||||
var parameters = new[]
|
||||
{
|
||||
new MySqlParameter("@room_name", room.room_name),
|
||||
new MySqlParameter("@room_description", room.room_description ?? (object)DBNull.Value),
|
||||
new MySqlParameter("@panel_group_count", room.panel_group_count ?? (object)DBNull.Value),
|
||||
new MySqlParameter("@panel_group_count", panelGroupCount),
|
||||
new MySqlParameter("@remarks", room.remarks ?? (object)DBNull.Value),
|
||||
new MySqlParameter("@creator", room.creator),
|
||||
new MySqlParameter("@created_at", room.created_at ?? DateTime.Now),
|
||||
@@ -1326,7 +1499,7 @@ namespace BLW_Log.Controllers
|
||||
string sql = @"
|
||||
UPDATE `cdr_library`.`tbl_web_room_type` SET
|
||||
room_name=@room_name, room_description=@room_description, panel_group_count=@panel_group_count,
|
||||
remarks=@remarks, creator=@creator
|
||||
remarks=@remarks, creator=IFNULL(@creator, creator)
|
||||
WHERE guid=@guid";
|
||||
|
||||
var parameters = new[]
|
||||
@@ -1335,7 +1508,7 @@ namespace BLW_Log.Controllers
|
||||
new MySqlParameter("@room_description", room.room_description ?? (object)DBNull.Value),
|
||||
new MySqlParameter("@panel_group_count", room.panel_group_count ?? (object)DBNull.Value),
|
||||
new MySqlParameter("@remarks", room.remarks ?? (object)DBNull.Value),
|
||||
new MySqlParameter("@creator", room.creator),
|
||||
new MySqlParameter("@creator", room.creator ?? (object)DBNull.Value),
|
||||
new MySqlParameter("@guid", room.guid ?? (object)DBNull.Value)
|
||||
};
|
||||
|
||||
@@ -1873,4 +2046,20 @@ public class CopyPanelUnitRequest
|
||||
/// </summary>
|
||||
public string NewProjectGuid { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 复制面板组请求参数
|
||||
/// </summary>
|
||||
public class CopyPanelListRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 原始面板组的GUID
|
||||
/// </summary>
|
||||
public string OriginalGuid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 目标房型的GUID(同酒店/同项目下的另一房型)
|
||||
/// </summary>
|
||||
public string TargetRoomGuid { get; set; }
|
||||
}
|
||||
#endregion
|
||||
@@ -10,6 +10,18 @@ namespace BLW_Log.Controllers
|
||||
[ApiController]
|
||||
public class ValuesController : ControllerBase
|
||||
{
|
||||
public readonly IConfiguration configuration;
|
||||
public ValuesController(IConfiguration _configuration)
|
||||
{
|
||||
configuration = _configuration;
|
||||
}
|
||||
|
||||
public string Get()
|
||||
{
|
||||
var timer_es = configuration["ShengJi:JianGe"];
|
||||
var RoomTypeID_FirstVersion = configuration["ShengJi:RoomTypeID_FirstVersion"];
|
||||
return timer_es;
|
||||
}
|
||||
public string get_json(string data)
|
||||
{
|
||||
return data;
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
using System.Buffers;
|
||||
using System.Data;
|
||||
using System.IO.Pipelines;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using BLW_Log.Controllers;
|
||||
using BLW_Log.Models;
|
||||
using BLW_Log.Push;
|
||||
@@ -21,6 +16,12 @@ using NLog;
|
||||
using NLog.Extensions.Logging;
|
||||
using NLog.Web;
|
||||
using Quartz;
|
||||
using RestSharp;
|
||||
using System.Buffers;
|
||||
using System.Data;
|
||||
using System.IO.Pipelines;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using static IronPython.Modules.PythonCsvModule;
|
||||
namespace BLW_Log
|
||||
{
|
||||
@@ -32,7 +33,7 @@ namespace BLW_Log
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
//var N = DateTime.Now.ToString("yyyy-MM-dd#HH:mm:ss:fff");
|
||||
//var N = DateTime.Now.ToString("yyyy-MM-dd#HH:mm:ss:fff");
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
//builder.Services.AddSingleton<MyMemoryCache>();
|
||||
@@ -102,7 +103,13 @@ namespace BLW_Log
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
builder.Services.AddSingleton<Dictionary<string, IRestClient>>(provider =>
|
||||
{
|
||||
return new Dictionary<string, IRestClient>
|
||||
{
|
||||
["NoStopShengJi"] = new RestClient("https://www.boonlive-rcu.com/"),
|
||||
};
|
||||
});
|
||||
|
||||
string ttt1 = builder.Configuration["ExcelGenerater"].ToString();
|
||||
string[] ssk1 = ttt1.Split(',');
|
||||
@@ -167,6 +174,20 @@ namespace BLW_Log
|
||||
}) // ÿ<><C3BF>17:00
|
||||
);
|
||||
|
||||
|
||||
var isenable = builder.Configuration["ShengJi:IsEnable"];
|
||||
if (isenable.Equals("1"))
|
||||
{
|
||||
//<2F><>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD>
|
||||
var jobKey5 = new JobKey("BuTingShengJi");
|
||||
q.AddJob<ShengJiCaoZuoA>(opts => opts.WithIdentity(jobKey5));
|
||||
q.AddTrigger(opts => opts
|
||||
.ForJob(jobKey5)
|
||||
.WithIdentity("BuTingShengJi-trigger")
|
||||
.StartAt(DateTimeOffset.Now.AddMinutes(1))
|
||||
);
|
||||
}
|
||||
|
||||
});
|
||||
builder.Services.AddQuartzHostedService(q => q.WaitForJobsToComplete = true);
|
||||
builder.Services.AddSignalR();
|
||||
|
||||
@@ -1,18 +1,27 @@
|
||||
{
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Server=10.8.8.208;Database=postgres;user id=postgres;password=123456;port=16035;"
|
||||
},
|
||||
"ExcelGenerater": "15,45,0",
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"JwT": {
|
||||
"SecretKey": "393bJJaBS%siAQ7U=dxk3&lb$0p3])r96=FU9-B.yp'8%'a.1wF64rkCv3$&2?^T3Vs]6z4u8j]*4NRTd418x8b6m4T04=hyn4>l0i-MB8Sy%h745GKN0~p3fMIaJav)",
|
||||
"Issuer": "宝来威供应商系统",
|
||||
"Audience": "W*u93xxp*08DnW@%6}5Tjh6bE?;hW"
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Server=10.8.8.208;Database=postgres;user id=postgres;password=123456;port=16035;"
|
||||
},
|
||||
"ExcelGenerater": "15,45,0",
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"JwT": {
|
||||
"SecretKey": "393bJJaBS%siAQ7U=dxk3&lb$0p3])r96=FU9-B.yp'8%'a.1wF64rkCv3$&2?^T3Vs]6z4u8j]*4NRTd418x8b6m4T04=hyn4>l0i-MB8Sy%h745GKN0~p3fMIaJav)",
|
||||
"Issuer": "宝来威供应商系统",
|
||||
"Audience": "W*u93xxp*08DnW@%6}5Tjh6bE?;hW"
|
||||
},
|
||||
"ShengJi": {
|
||||
"IsEnable": "1",
|
||||
"JianGe": "10",
|
||||
"RoomTypeID_FirstVersion": "1412",
|
||||
"First_GuJian_Name": "C1F_A_L4_31_240723_NM.bin",
|
||||
"RoomTypeID_SecondVerrsion": "2438",
|
||||
"Second_GuJian_Name": "C1F_A_L4_41_250605_NM.bin",
|
||||
"HostIdList": "[24540]"
|
||||
}
|
||||
}
|
||||
|
||||
158
BLW_Log/services/ShengJiCaoZuo.cs
Normal file
158
BLW_Log/services/ShengJiCaoZuo.cs
Normal file
@@ -0,0 +1,158 @@
|
||||
using Common;
|
||||
using Commonlib;
|
||||
using Newtonsoft.Json;
|
||||
using NLog;
|
||||
using Quartz;
|
||||
using RestSharp;
|
||||
|
||||
namespace BLW_Log.services
|
||||
{
|
||||
public class ShengJiCaoZuoB : IJob
|
||||
{
|
||||
public static int ShengJiCaoZuoBCount = 0;
|
||||
private readonly Logger _logger = LogManager.GetCurrentClassLogger();
|
||||
private readonly Dictionary<string, IRestClient> _clients;
|
||||
private readonly IConfiguration configuration;
|
||||
|
||||
public ShengJiCaoZuoB(Dictionary<string, IRestClient> clients, IConfiguration configuration)
|
||||
{
|
||||
_clients = clients;
|
||||
this.configuration = configuration;
|
||||
}
|
||||
|
||||
async public Task Execute(IJobExecutionContext context)
|
||||
{
|
||||
try
|
||||
{
|
||||
var timer_es = configuration["ShengJi:JianGe"];
|
||||
var RoomTypeID_FirstVersion = configuration["ShengJi:RoomTypeID_FirstVersion"];
|
||||
var First_GuJian_Name = configuration["ShengJi:First_GuJian_Name"];
|
||||
var RoomTypeID_SecondVerrsion = configuration["ShengJi:RoomTypeID_SecondVerrsion"];
|
||||
var Second_GuJian_Name = configuration["ShengJi:Second_GuJian_Name"];
|
||||
var HostIdList = configuration["ShengJi:HostIdList"];
|
||||
int jiange = int.Parse(timer_es);
|
||||
|
||||
var client = _clients["NoStopShengJi"];
|
||||
string Url = "api/WebChatUpgrade";
|
||||
var request = new RestRequest(Url);
|
||||
//2438
|
||||
//研发测试房型_1
|
||||
//固件:BLV-C5 || Launcher_C1F_V04 || C1F_A_L4_41_250605_NM.bin
|
||||
//request.AddParameter("roomTypeID", "2438");
|
||||
//request.AddParameter("hostid_lists", "[24540]");
|
||||
//request.AddParameter("upgradefileName", "C1F_A_L4_41_250605_NM.bin");
|
||||
|
||||
request.AddParameter("roomTypeID", RoomTypeID_SecondVerrsion);
|
||||
request.AddParameter("hostid_lists", HostIdList);
|
||||
request.AddParameter("upgradefileName", Second_GuJian_Name);
|
||||
|
||||
_logger.Error("ShengJiCaoZuo 研发测试房型_1 开始:");
|
||||
var response = await client.ExecutePostAsync(request);
|
||||
_logger.Error("ShengJiCaoZuo 研发测试房型_1 执行结果:" + response.Content);
|
||||
|
||||
ShengJiCaoZuoBCount = ShengJiCaoZuoBCount + 1;
|
||||
if (ShengJiCaoZuoBCount >= 2)
|
||||
{
|
||||
|
||||
// 直接启动JobA
|
||||
var jobA = JobBuilder.Create<ShengJiCaoZuoA>().Build();
|
||||
var triggerA = TriggerBuilder.Create()
|
||||
.StartAt(DateTimeOffset.Now.AddMinutes(jiange))
|
||||
.Build();
|
||||
|
||||
await context.Scheduler.ScheduleJob(jobA, triggerA);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 直接启动JobB
|
||||
var jobB = JobBuilder.Create<ShengJiCaoZuoB>().Build();
|
||||
var triggerB = TriggerBuilder.Create()
|
||||
.StartAt(DateTimeOffset.Now.AddMinutes(jiange))
|
||||
.Build();
|
||||
|
||||
await context.Scheduler.ScheduleJob(jobB, triggerB);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error("ShengJiCaoZuoB 执行失败:" + ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
public class ShengJiCaoZuoA : IJob
|
||||
{
|
||||
public static int ShengJiCaoZuoACount = 0;
|
||||
private readonly Logger _logger = LogManager.GetCurrentClassLogger();
|
||||
public readonly IConfiguration configuration;
|
||||
private readonly Dictionary<string, IRestClient> _clients;
|
||||
|
||||
public ShengJiCaoZuoA(Dictionary<string, IRestClient> clients, IConfiguration _configuration)
|
||||
{
|
||||
_clients = clients;
|
||||
this.configuration = _configuration;
|
||||
}
|
||||
public async Task Execute(IJobExecutionContext context)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var timer_es = configuration["ShengJi:JianGe"];
|
||||
var RoomTypeID_FirstVersion = configuration["ShengJi:RoomTypeID_FirstVersion"];
|
||||
var First_GuJian_Name = configuration["ShengJi:First_GuJian_Name"];
|
||||
var RoomTypeID_SecondVerrsion = configuration["ShengJi:RoomTypeID_SecondVerrsion"];
|
||||
var Second_GuJian_Name = configuration["ShengJi:Second_GuJian_Name"];
|
||||
var HostIdList = configuration["ShengJi:HostIdList"];
|
||||
int jiange = int.Parse(timer_es);
|
||||
|
||||
var client = _clients["NoStopShengJi"];
|
||||
string Url = "api/WebChatUpgrade";
|
||||
var request = new RestRequest(Url);
|
||||
|
||||
|
||||
//1412
|
||||
//固件:BLV-V9 || Launcher_C1F_V04 || C1F_A_L4_31_240723_NM.bin
|
||||
//100331-YHF_T
|
||||
//YHF_T
|
||||
|
||||
//2438
|
||||
//研发测试房型_1
|
||||
//固件:BLV-C5 || Launcher_C1F_V04 || C1F_A_L4_41_250605_NM.bin
|
||||
//request.AddParameter("roomTypeID", "1412");
|
||||
//request.AddParameter("hostid_lists", "[24540]");
|
||||
//request.AddParameter("upgradefileName", "C1F_A_L4_31_240723_NM.bin");
|
||||
|
||||
request.AddParameter("roomTypeID", RoomTypeID_FirstVersion);
|
||||
request.AddParameter("hostid_lists", HostIdList);
|
||||
request.AddParameter("upgradefileName", First_GuJian_Name);
|
||||
_logger.Error("ShengJiCaoZuo YHF_T 开始:");
|
||||
var response = await client.ExecutePostAsync(request);
|
||||
_logger.Error("ShengJiCaoZuo YHF_T 执行成功:" + response.Content);
|
||||
|
||||
|
||||
ShengJiCaoZuoACount = ShengJiCaoZuoACount + 1;
|
||||
|
||||
if (ShengJiCaoZuoACount >= 2)
|
||||
{
|
||||
var jobB = JobBuilder.Create<ShengJiCaoZuoB>().Build();
|
||||
var triggerB = TriggerBuilder.Create()
|
||||
.StartAt(DateTimeOffset.Now.AddMinutes(jiange))
|
||||
.Build();
|
||||
|
||||
await context.Scheduler.ScheduleJob(jobB, triggerB);
|
||||
}
|
||||
else
|
||||
{
|
||||
var jobA = JobBuilder.Create<ShengJiCaoZuoA>().Build();
|
||||
var triggerA = TriggerBuilder.Create()
|
||||
.StartAt(DateTimeOffset.Now.AddMinutes(jiange))
|
||||
.Build();
|
||||
await context.Scheduler.ScheduleJob(jobA, triggerA);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error("ShengJiCaoZuoA 执行失败:" + ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -145,6 +145,7 @@ namespace Commonlib
|
||||
/// 读取主机信息
|
||||
/// </summary>
|
||||
读取主机信息 = 0xB1,
|
||||
升级 = 0xB6,
|
||||
/// <summary>
|
||||
/// 主机获取指定域名解释的IP
|
||||
/// </summary>
|
||||
@@ -166,7 +167,9 @@ namespace Commonlib
|
||||
重启=0x33,
|
||||
定时上报=0x34,
|
||||
插拔卡动作=0x35,
|
||||
设备动作=0x36
|
||||
设备动作=0x36,
|
||||
设备透传下行=0x70,
|
||||
设备透传上行=0x71
|
||||
}
|
||||
|
||||
public class TypeList
|
||||
|
||||
@@ -286,7 +286,23 @@ namespace LogCap.Common
|
||||
{
|
||||
return;
|
||||
}
|
||||
long HHH = context.SystemHeader.Value.HostNumber.ToHotelCode();
|
||||
long HHH = 0;
|
||||
|
||||
var abd = context.SystemHeader.HasValue;
|
||||
if (abd == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
HHH = context.SystemHeader.Value.HostNumber.ToHotelCode();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
var data_error= Tools.ByteToString(data.ToArray());
|
||||
Console.WriteLine("ErrorData"+data_error);
|
||||
return;
|
||||
}
|
||||
|
||||
var list = Program.Cache.Get<List<Monitor_Host>>(CacheKey.Key);
|
||||
|
||||
@@ -373,7 +389,7 @@ namespace LogCap.Common
|
||||
|
||||
string Key = string.Format("{0}_{1}", CacheKey.RoomIP_Port_Prefix, HostNNN);
|
||||
var takeMM = Program.Cache.Get<MonitorRedis>(Key);
|
||||
|
||||
|
||||
if (HHH == 1197)
|
||||
{
|
||||
//Console.WriteLine("1197::::"+JsonConvert.SerializeObject(takeMM));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<_LastSelectedProfileId>E:\tian\BLWLogMonitor\LogCap\Properties\PublishProfiles\FolderProfile.pubxml</_LastSelectedProfileId>
|
||||
<_LastSelectedProfileId>E:\tian\chongxin\NewGit\Web_BLVLOG_Server_Mvc_Prod\LogCap\Properties\PublishProfiles\FolderProfile.pubxml</_LastSelectedProfileId>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<History>True|2025-11-18T02:38:51.0970145Z||;True|2025-11-18T10:38:36.6590100+08:00||;True|2025-11-18T09:55:20.7541888+08:00||;True|2025-11-18T09:54:09.8014429+08:00||;True|2025-11-18T09:03:03.6239935+08:00||;True|2025-11-12T13:37:44.5193799+08:00||;True|2025-11-04T19:04:11.1977717+08:00||;True|2025-10-15T14:12:11.7503437+08:00||;True|2025-09-29T09:53:03.7995047+08:00||;True|2025-09-29T09:52:00.2305647+08:00||;True|2025-09-29T09:49:50.6101495+08:00||;True|2025-09-29T09:35:55.7152890+08:00||;True|2025-09-29T09:34:28.6196941+08:00||;True|2025-09-29T09:31:27.1029278+08:00||;True|2025-09-29T09:31:20.5804056+08:00||;True|2025-09-29T09:29:27.0993157+08:00||;True|2025-09-29T09:26:09.9458028+08:00||;True|2025-09-11T14:19:22.7215134+08:00||;True|2025-07-21T09:19:25.8321680+08:00||;True|2025-07-18T16:09:34.8867018+08:00||;True|2025-07-18T16:06:18.6358237+08:00||;True|2025-07-18T15:49:28.4034135+08:00||;True|2025-07-18T15:38:30.1452114+08:00||;True|2025-07-18T15:37:55.7831800+08:00||;True|2025-07-18T15:26:49.0230860+08:00||;True|2025-07-18T15:14:11.3917759+08:00||;True|2025-07-18T14:53:35.1351174+08:00||;True|2025-07-18T14:51:40.7222368+08:00||;True|2025-07-18T14:50:19.5264194+08:00||;True|2025-07-18T14:48:37.5000171+08:00||;True|2025-07-18T14:46:06.6645443+08:00||;True|2025-07-18T14:43:35.5161662+08:00||;True|2025-07-18T14:41:32.1953723+08:00||;True|2025-07-18T14:39:41.8990197+08:00||;True|2025-07-18T14:37:59.5226728+08:00||;False|2025-07-18T14:36:34.9869313+08:00||;False|2025-07-18T14:36:28.5844407+08:00||;True|2025-07-18T14:33:19.7559086+08:00||;True|2025-07-18T14:31:58.6399805+08:00||;True|2025-07-18T14:29:41.3500470+08:00||;True|2025-07-18T14:25:09.8903114+08:00||;True|2025-07-18T14:04:10.8844905+08:00||;True|2025-07-18T13:30:11.7855851+08:00||;True|2025-07-18T13:17:27.5926995+08:00||;True|2025-07-16T09:38:37.9415699+08:00||;True|2025-07-16T09:29:01.5138136+08:00||;True|2025-07-16T09:21:08.0981473+08:00||;True|2025-07-15T17:38:31.1667932+08:00||;True|2025-07-15T16:43:05.4527411+08:00||;True|2025-07-07T10:16:09.3877487+08:00||;True|2025-07-07T10:10:49.7560402+08:00||;True|2025-06-17T14:46:41.6347900+08:00||;True|2025-06-17T14:39:33.5356221+08:00||;True|2025-06-17T14:35:00.6059962+08:00||;True|2025-06-16T14:29:42.1186724+08:00||;True|2025-04-10T16:27:27.4571680+08:00||;True|2025-04-10T16:26:52.4704500+08:00||;True|2025-04-10T16:23:44.7512424+08:00||;True|2025-04-10T16:20:38.5807986+08:00||;True|2025-04-10T16:18:39.7753691+08:00||;True|2025-04-10T16:14:06.5114394+08:00||;True|2025-04-09T15:37:02.3941152+08:00||;True|2025-04-09T14:51:04.4433953+08:00||;True|2025-04-09T09:50:05.6074325+08:00||;True|2025-04-08T19:25:32.8536115+08:00||;False|2025-04-08T19:23:51.5364323+08:00||;True|2025-04-08T09:23:44.2543020+08:00||;True|2025-04-08T09:22:54.9082916+08:00||;True|2025-03-31T16:13:42.0797431+08:00||;True|2025-03-31T16:13:15.4339600+08:00||;True|2025-03-31T16:12:35.5470378+08:00||;True|2025-03-31T16:12:06.9833114+08:00||;True|2025-03-31T16:04:47.2437329+08:00||;True|2025-03-31T15:27:09.4504997+08:00||;True|2025-03-14T19:40:25.2983776+08:00||;True|2025-03-10T09:17:51.3361540+08:00||;True|2025-03-10T09:09:10.4750125+08:00||;True|2025-03-08T16:44:19.0185608+08:00||;True|2025-03-08T16:38:26.8544178+08:00||;True|2025-03-07T08:58:41.8621312+08:00||;True|2025-03-07T08:58:23.6999802+08:00||;True|2025-03-05T16:32:51.3089913+08:00||;True|2025-03-05T15:52:19.9963516+08:00||;True|2025-03-05T15:52:02.6859260+08:00||;True|2025-03-04T14:09:36.4338421+08:00||;True|2025-03-04T10:05:44.6777562+08:00||;True|2025-03-04T09:12:49.9348187+08:00||;True|2025-03-03T08:47:09.8416556+08:00||;True|2025-03-03T08:44:56.7823894+08:00||;True|2025-02-21T14:47:27.2104567+08:00||;True|2025-02-21T14:42:30.8494218+08:00||;True|2025-02-21T14:36:24.1989089+08:00||;True|2025-02-21T14:34:10.8466400+08:00||;True|2025-02-21T14:28:18.6904848+08:00||;True|2025-02-21T14:18:04.2323793+08:00||;True|2025-02-21T14:13:25.3047586+08:00||;True|2025-02-21T14:07:51.0808912+08:00||;True|2025-02-21T11:52:04.2644013+08:00||;True|2025-02-18T08:38:44.8636891+08:00||;True|2025-02-17T15:03:01.3963923+08:00||;</History>
|
||||
<History>True|2026-01-21T08:04:29.2346921Z||;True|2026-01-08T17:31:34.8778232+08:00||;True|2026-01-08T17:29:38.5339303+08:00||;True|2026-01-08T17:17:34.1517942+08:00||;True|2026-01-08T17:13:33.6164621+08:00||;True|2026-01-08T16:50:29.4216579+08:00||;True|2026-01-08T16:42:32.5476567+08:00||;True|2025-11-18T10:38:51.0970145+08:00||;True|2025-11-18T10:38:36.6590100+08:00||;True|2025-11-18T09:55:20.7541888+08:00||;True|2025-11-18T09:54:09.8014429+08:00||;True|2025-11-18T09:03:03.6239935+08:00||;True|2025-11-12T13:37:44.5193799+08:00||;True|2025-11-04T19:04:11.1977717+08:00||;True|2025-10-15T14:12:11.7503437+08:00||;True|2025-09-29T09:53:03.7995047+08:00||;True|2025-09-29T09:52:00.2305647+08:00||;True|2025-09-29T09:49:50.6101495+08:00||;True|2025-09-29T09:35:55.7152890+08:00||;True|2025-09-29T09:34:28.6196941+08:00||;True|2025-09-29T09:31:27.1029278+08:00||;True|2025-09-29T09:31:20.5804056+08:00||;True|2025-09-29T09:29:27.0993157+08:00||;True|2025-09-29T09:26:09.9458028+08:00||;True|2025-09-11T14:19:22.7215134+08:00||;True|2025-07-21T09:19:25.8321680+08:00||;True|2025-07-18T16:09:34.8867018+08:00||;True|2025-07-18T16:06:18.6358237+08:00||;True|2025-07-18T15:49:28.4034135+08:00||;True|2025-07-18T15:38:30.1452114+08:00||;True|2025-07-18T15:37:55.7831800+08:00||;True|2025-07-18T15:26:49.0230860+08:00||;True|2025-07-18T15:14:11.3917759+08:00||;True|2025-07-18T14:53:35.1351174+08:00||;True|2025-07-18T14:51:40.7222368+08:00||;True|2025-07-18T14:50:19.5264194+08:00||;True|2025-07-18T14:48:37.5000171+08:00||;True|2025-07-18T14:46:06.6645443+08:00||;True|2025-07-18T14:43:35.5161662+08:00||;True|2025-07-18T14:41:32.1953723+08:00||;True|2025-07-18T14:39:41.8990197+08:00||;True|2025-07-18T14:37:59.5226728+08:00||;False|2025-07-18T14:36:34.9869313+08:00||;False|2025-07-18T14:36:28.5844407+08:00||;True|2025-07-18T14:33:19.7559086+08:00||;True|2025-07-18T14:31:58.6399805+08:00||;True|2025-07-18T14:29:41.3500470+08:00||;True|2025-07-18T14:25:09.8903114+08:00||;True|2025-07-18T14:04:10.8844905+08:00||;True|2025-07-18T13:30:11.7855851+08:00||;True|2025-07-18T13:17:27.5926995+08:00||;True|2025-07-16T09:38:37.9415699+08:00||;True|2025-07-16T09:29:01.5138136+08:00||;True|2025-07-16T09:21:08.0981473+08:00||;True|2025-07-15T17:38:31.1667932+08:00||;True|2025-07-15T16:43:05.4527411+08:00||;True|2025-07-07T10:16:09.3877487+08:00||;True|2025-07-07T10:10:49.7560402+08:00||;True|2025-06-17T14:46:41.6347900+08:00||;True|2025-06-17T14:39:33.5356221+08:00||;True|2025-06-17T14:35:00.6059962+08:00||;True|2025-06-16T14:29:42.1186724+08:00||;True|2025-04-10T16:27:27.4571680+08:00||;True|2025-04-10T16:26:52.4704500+08:00||;True|2025-04-10T16:23:44.7512424+08:00||;True|2025-04-10T16:20:38.5807986+08:00||;True|2025-04-10T16:18:39.7753691+08:00||;True|2025-04-10T16:14:06.5114394+08:00||;True|2025-04-09T15:37:02.3941152+08:00||;True|2025-04-09T14:51:04.4433953+08:00||;True|2025-04-09T09:50:05.6074325+08:00||;True|2025-04-08T19:25:32.8536115+08:00||;False|2025-04-08T19:23:51.5364323+08:00||;True|2025-04-08T09:23:44.2543020+08:00||;True|2025-04-08T09:22:54.9082916+08:00||;True|2025-03-31T16:13:42.0797431+08:00||;True|2025-03-31T16:13:15.4339600+08:00||;True|2025-03-31T16:12:35.5470378+08:00||;True|2025-03-31T16:12:06.9833114+08:00||;True|2025-03-31T16:04:47.2437329+08:00||;True|2025-03-31T15:27:09.4504997+08:00||;True|2025-03-14T19:40:25.2983776+08:00||;True|2025-03-10T09:17:51.3361540+08:00||;True|2025-03-10T09:09:10.4750125+08:00||;True|2025-03-08T16:44:19.0185608+08:00||;True|2025-03-08T16:38:26.8544178+08:00||;True|2025-03-07T08:58:41.8621312+08:00||;True|2025-03-07T08:58:23.6999802+08:00||;True|2025-03-05T16:32:51.3089913+08:00||;True|2025-03-05T15:52:19.9963516+08:00||;True|2025-03-05T15:52:02.6859260+08:00||;True|2025-03-04T14:09:36.4338421+08:00||;True|2025-03-04T10:05:44.6777562+08:00||;True|2025-03-04T09:12:49.9348187+08:00||;True|2025-03-03T08:47:09.8416556+08:00||;True|2025-03-03T08:44:56.7823894+08:00||;True|2025-02-21T14:47:27.2104567+08:00||;True|2025-02-21T14:42:30.8494218+08:00||;True|2025-02-21T14:36:24.1989089+08:00||;True|2025-02-21T14:34:10.8466400+08:00||;</History>
|
||||
<LastFailureDetails />
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,33 +0,0 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace WebApplication2.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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
namespace WebApplication2
|
||||
{
|
||||
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.UseAuthorization();
|
||||
|
||||
|
||||
app.MapControllers();
|
||||
|
||||
app.Run();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:58914",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"http": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "weatherforecast",
|
||||
"applicationUrl": "http://localhost:5082",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "weatherforecast",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
namespace WebApplication2
|
||||
{
|
||||
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; }
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Confluent.Kafka" Version="2.11.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -1,6 +0,0 @@
|
||||
@WebApplication2_HostAddress = http://localhost:5082
|
||||
|
||||
GET {{WebApplication2_HostAddress}}/weatherforecast/
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
|
||||
using Confluent.Kafka;
|
||||
|
||||
namespace WebApplication2.services
|
||||
{
|
||||
public class MQServices : BackgroundService
|
||||
{
|
||||
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
||||
{
|
||||
var conf = new ConsumerConfig
|
||||
{
|
||||
GroupId = "test-consumer-group",
|
||||
BootstrapServers = "localhost:9092",
|
||||
// Note: The AutoOffsetReset property determines the start offset in the event
|
||||
// there are not yet any committed offsets for the consumer group for the
|
||||
// topic/partitions of interest. By default, offsets are committed
|
||||
// automatically, so in this example, consumption will only start from the
|
||||
// earliest message in the topic 'my-topic' the first time you run the program.
|
||||
AutoOffsetReset = AutoOffsetReset.Earliest
|
||||
};
|
||||
|
||||
using (var c = new ConsumerBuilder<string, string>(conf).Build())
|
||||
{
|
||||
c.Subscribe("test-topic");
|
||||
try
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
try
|
||||
{
|
||||
var cr = c.Consume(stoppingToken);
|
||||
var v= cr.Message.Value;
|
||||
var k=cr.Message.Key;
|
||||
Console.WriteLine($"Consumed message '{k} {v}' at: '{cr.TopicPartitionOffset}'.");
|
||||
}
|
||||
catch (ConsumeException e)
|
||||
{
|
||||
Console.WriteLine($"Error occured: {e.Error.Reason}");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
// Ensure the consumer leaves the group cleanly and final offsets are committed.
|
||||
c.Close();
|
||||
}
|
||||
}
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"version": 1,
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"dotnet-ef": {
|
||||
"version": "9.0.9",
|
||||
"commands": [
|
||||
"dotnet-ef"
|
||||
],
|
||||
"rollForward": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace WebServices.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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
namespace WebServices
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add services to the container.
|
||||
|
||||
builder.Services.AddWindowsService();
|
||||
builder.Services.AddControllers();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
|
||||
app.UseAuthorization();
|
||||
|
||||
|
||||
app.MapControllers();
|
||||
|
||||
app.Run();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<DeleteExistingFiles>false</DeleteExistingFiles>
|
||||
<ExcludeApp_Data>false</ExcludeApp_Data>
|
||||
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
|
||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||
<PublishProvider>FileSystem</PublishProvider>
|
||||
<PublishUrl>bin\Release\net8.0\publish\</PublishUrl>
|
||||
<WebPublishMethod>FileSystem</WebPublishMethod>
|
||||
<_TargetId>Folder</_TargetId>
|
||||
<SiteUrlToLaunchAfterPublish />
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<ProjectGuid>d93b795d-4836-40aa-b14a-d742b4f04f14</ProjectGuid>
|
||||
<SelfContained>false</SelfContained>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<_PublishTargetUrl>E:\tian\BLWLogMonitor\WebServices\bin\Release\net8.0\publish\</_PublishTargetUrl>
|
||||
<History>True|2025-10-10T07:48:04.6905094Z||;</History>
|
||||
<LastFailureDetails />
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:37392",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"http": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "weatherforecast",
|
||||
"applicationUrl": "http://localhost:5029",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "weatherforecast",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
namespace WebServices
|
||||
{
|
||||
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; }
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<NameOfLastUsedPublishProfile>E:\tian\BLWLogMonitor\WebServices\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,6 +0,0 @@
|
||||
@WebServices_HostAddress = http://localhost:5029
|
||||
|
||||
GET {{WebServices_HostAddress}}/weatherforecast/
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
Reference in New Issue
Block a user