first commit -push

This commit is contained in:
dungtt
2025-10-15 15:15:53 +07:00
parent 674ae395be
commit a9577c5756
885 changed files with 74595 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
using Microsoft.AspNetCore.Mvc;
using RobotNet.ScriptManager.Services;
using RobotNet.Shares;
namespace RobotNet.ScriptManager.Controllers;
[Route("api/[controller]")]
[ApiController]
public class DashboardConfigController(DashboardConfig Config, ILogger<DashboardConfigController> Logger) : ControllerBase
{
[HttpGet]
public Task<MessageResult<string[]>> GetOpenACSSettings()
{
try
{
return Task.FromResult<MessageResult<string[]>>(new(true, "") { Data = Config.MissionNames });
}
catch (Exception ex)
{
Logger.LogWarning($"Lấy cấu hình OpenACS xảy ra lỗi: {ex.Message}");
return Task.FromResult<MessageResult<string[]>>(new(false, "Hệ thống có lỗi xảy ra"));
}
}
[HttpPost]
public async Task<MessageResult> UpdatePublishSetting([FromBody] string[] missionNames)
{
try
{
await Config.UpdateMissionNames(missionNames);
return new(true, "");
}
catch (Exception ex)
{
Logger.LogWarning($"Cập nhật cấu hình publish OpenACS xảy ra lỗi: {ex.Message}");
return new(false, "Hệ thống có lỗi xảy ra");
}
}
}