Add new strrrups DTOs

This commit is contained in:
RedikultsevEvg
2025-07-17 00:06:26 +05:00
parent 0addeda339
commit efb0fa6e1e
13 changed files with 237 additions and 17 deletions

View File

@@ -47,6 +47,14 @@ namespace DataAccess.DTOs
{
newItem = ProcessRebar(rebar);
}
else if (stirrup is IStirrupGroup group)
{
newItem = ProcessGroup(group);
}
else if (stirrup is IStirrupByInclinedRebar inclinatedRebar)
{
newItem = ProcessInclinatedRebar(inclinatedRebar);
}
else if (stirrup is IStirrupByDensity density)
{
newItem = ProcessDensity(density);
@@ -55,10 +63,19 @@ namespace DataAccess.DTOs
{
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(stirrup));
}
return newItem;
}
private IStirrup ProcessInclinatedRebar(IStirrupByInclinedRebar inclinatedRebar)
{
throw new NotImplementedException();
}
private IStirrup ProcessGroup(IStirrupGroup group)
{
throw new NotImplementedException();
}
private IStirrup ProcessDensity(IStirrupByDensity density)
{
traceLogger?.AddMessage("Stirrup is stirrup by density");

View File

@@ -0,0 +1,19 @@
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperLogics.Models.BeamShears;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataAccess.DTOs
{
internal class StirrupGroupToDTOConvertStrategy : ConvertStrategy<StirrupGroupDTO, IStirrupGroup>
{
public override StirrupGroupDTO GetNewItem(IStirrupGroup source)
{
throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,37 @@
using Newtonsoft.Json;
using StructureHelperLogics.Models.BeamShears;
using StructureHelperLogics.Models.Materials;
namespace DataAccess.DTOs
{
public class StirrupByInclinedRebarDTO : IStirrupByInclinedRebar
{
[JsonProperty("Id")]
public Guid Id { get; }
[JsonProperty("Name")]
public string? Name { get; set; }
[JsonProperty("CompressedGap")]
public double CompressedGap { get; set; }
[JsonProperty("StartCoordinate")]
public double StartCoordinate { get; set; }
[JsonProperty("TransferLength")]
public double TransferLength { get; set; }
[JsonProperty("AngleOfInclination")]
public double AngleOfInclination { get; set; }
[JsonProperty("LegCount")]
public double LegCount { get; set; }
[JsonProperty("RebarSection")]
public IRebarSection RebarSection { get; set; }
public StirrupByInclinedRebarDTO(Guid id)
{
Id = id;
}
public object Clone()
{
return this;
}
}
}

View File

@@ -0,0 +1,27 @@
using Newtonsoft.Json;
using StructureHelperLogics.Models.BeamShears;
namespace DataAccess.DTOs
{
public class StirrupGroupDTO : IStirrupGroup
{
[JsonProperty("Id")]
public Guid Id { get; }
[JsonProperty("Name")]
public string? Name { get; set; }
[JsonProperty("CompressedGap")]
public double CompressedGap { get; set; }
[JsonProperty("Stirrups")]
public List<IStirrup> Stirrups { get; } = new();
public StirrupGroupDTO(Guid id)
{
Id = id;
}
public object Clone()
{
throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,26 @@
using Newtonsoft.Json;
using StructureHelperLogics.Models.Materials;
namespace DataAccess.DTOs
{
public class RebarSectionDTO : IRebarSection
{
[JsonProperty("Id")]
public Guid Id { get; }
[JsonProperty("Material")]
public IReinforcementLibMaterial Material { get; set; }
[JsonProperty("Diameter")]
public double Diameter { get; set; }
public RebarSectionDTO(Guid id)
{
Id = id;
}
public object Clone()
{
throw new NotImplementedException();
}
}
}