Готов Wizard
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 12s

This commit is contained in:
2026-07-14 17:45:41 +03:00
parent 2883b537ab
commit fa9fd1e06a
11 changed files with 88 additions and 59 deletions
+2 -2
View File
@@ -23,7 +23,7 @@ public class DeviceController : ControllerBase
[HttpGet("GetDeviceById")]
[ProducesResponseType<DeviceItem>(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status204NoContent)]
public IActionResult GetById(int id) // Получить устройство по id
public IActionResult GetById(Guid id) // Получить устройство по id
{
using (var db = new SQLiteService())
{
@@ -69,7 +69,7 @@ public class DeviceController : ControllerBase
#region DELETE
[HttpDelete("DelDevice")]
public IActionResult DelDevice(int id) //Удалить устройство по id
public IActionResult DelDevice(Guid id) //Удалить устройство по id
{
using (var db = new SQLiteService())
{
+2 -2
View File
@@ -29,7 +29,7 @@ public class ObjectController : ControllerBase
[HttpGet("GetObjectById")]
[ProducesResponseType<ObjectItem>(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status204NoContent)]
public IActionResult GetById(int id)
public IActionResult GetById(Guid id)
{
using (var db = new SQLiteService())
{
@@ -69,7 +69,7 @@ public class ObjectController : ControllerBase
//========================= DELETE ====================================//
[HttpDelete("DelObject")]
public IActionResult DelObject(int id)
public IActionResult DelObject(Guid id)
{
using (var db = new SQLiteService())
{
+2 -2
View File
@@ -31,7 +31,7 @@ public class TypeController : ControllerBase
[HttpGet("GetTypeById")]
[ProducesResponseType<DeviceItem>(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status204NoContent)]
public IActionResult GetById(int id) // Получить устройство по id
public IActionResult GetById(Guid id) // Получить устройство по id
{
using (var db = new SQLiteService())
{
@@ -63,7 +63,7 @@ public class TypeController : ControllerBase
//========================= DELETE ====================================//
#region DELETE
[HttpDelete("DelType")]
public IActionResult DelType(int id) //Удалить тип устройства по id
public IActionResult DelType(Guid id) //Удалить тип устройства по id
{
using (var db = new SQLiteService())
{
+4 -4
View File
@@ -8,10 +8,10 @@
public string? Description { get; set; }
public string? Name { get; set; }
public string? Location { get; set; }
public List<DeviceItem>? ListDevices { get; set; }
public DeviceType? DeviceType { get; set; }
public ObjectItem? DeviceObject { get; set; }
public Guid ConnectedToSwitchId { get; set; }
public List<Guid>? ListDevices { get; set; }
public Guid? DeviceType { get; set; }
public Guid? DeviceObject { get; set; }
public Guid? ConnectedToSwitchId { get; set; }
public int ConnectedToPortOnSwitch { get; set; }
}
+2 -2
View File
@@ -14,8 +14,8 @@ namespace Strela.Services
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
//optionsBuilder.UseNpgsql("Host=172.24.12.201;Port=5432;Database=Notifications;Username=postgres;Password=4NUDZhJ7");
optionsBuilder.UseSqlite("Data Source=Services/DataBase.db");
optionsBuilder.UseNpgsql("Host=172.22.10.39;Port=5432;Database=strela;Username=postgres;Password=4NUDZhJ7");
//optionsBuilder.UseSqlite("Data Source=Services/DataBase.db");
}
//protected override void OnModelCreating(ModelBuilder modelBuilder)
+1
View File
@@ -23,6 +23,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.22.1" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
</ItemGroup>