Add EditorState + Rename ConfigurationResponseModel, ApplicationStateModel

This commit is contained in:
Guillaume Tauzin 2022-10-12 12:12:54 +02:00
parent c256a76e01
commit b86f073cc1
6 changed files with 54 additions and 36 deletions

View file

@ -3,9 +3,9 @@ using System.Runtime.Serialization;
namespace SVGLDLibs.Models
{
public class ConfigurationResponseModel
public class Configuration
{
public ConfigurationResponseModel(AvailableContainerModel mainContainer)
public Configuration(AvailableContainerModel mainContainer)
{
MainContainer = mainContainer;
AvailableContainers = new List<AvailableContainerModel>();

View file

@ -0,0 +1,18 @@
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace SVGLDLibs.Models
{
public class EditorState
{
[DataMember(EmitDefaultValue = false)]
public List<HistoryState> history { get; set; }
[DataMember(EmitDefaultValue = false)]
public int historyCurrentStep { get; set; }
[DataMember(EmitDefaultValue = false)]
public Configuration configuration { get; set; }
}
}

View file

@ -5,6 +5,6 @@ namespace SVGLDLibs.Models
public class GetFeedbackRequest
{
[DataMember(EmitDefaultValue = false)]
public ApplicationStateModel ApplicationState { get; set; }
public HistoryState ApplicationState { get; set; }
}
}

View file

@ -1,29 +1,29 @@
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace SVGLDLibs.Models
{
public class ApplicationStateModel
{
[DataMember(EmitDefaultValue = false)]
public string lastAction;
[DataMember(EmitDefaultValue = false)]
public string mainContainer;
[DataMember(EmitDefaultValue = false)]
public Dictionary<string, ContainerModel> containers;
[DataMember(EmitDefaultValue = false)]
public string selectedContainerId;
[DataMember(EmitDefaultValue = false)]
public Dictionary<string, string> typeCounters;
[DataMember(EmitDefaultValue = false)]
public Dictionary<string, SymbolModel> symbols;
[DataMember(EmitDefaultValue = false)]
public string selectedSymbolId;
}
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace SVGLDLibs.Models
{
public class HistoryState
{
[DataMember(EmitDefaultValue = false)]
public string lastAction;
[DataMember(EmitDefaultValue = false)]
public string mainContainer;
[DataMember(EmitDefaultValue = false)]
public Dictionary<string, ContainerModel> containers;
[DataMember(EmitDefaultValue = false)]
public string selectedContainerId;
[DataMember(EmitDefaultValue = false)]
public Dictionary<string, string> typeCounters;
[DataMember(EmitDefaultValue = false)]
public Dictionary<string, SymbolModel> symbols;
[DataMember(EmitDefaultValue = false)]
public string selectedSymbolId;
}
}

View file

@ -17,6 +17,6 @@ namespace SVGLDLibs.Models
public ContainerModel NextContainer { get; set; }
[DataMember(EmitDefaultValue = false)]
public ApplicationStateModel ApplicationState { get; set; }
public HistoryState ApplicationState { get; set; }
}
}

View file

@ -20,8 +20,8 @@ public class SVGLDController : ControllerBase
return true;
}
[HttpPost(Name = nameof(SVGLDLibs.Models.ApplicationStateModel))]
public bool ApplicationStateModel(ApplicationStateModel model)
[HttpPost(Name = nameof(SVGLDLibs.Models.HistoryState))]
public bool ApplicationStateModel(HistoryState model)
{
return true;
}
@ -44,8 +44,8 @@ public class SVGLDController : ControllerBase
return true;
}
[HttpPost(Name = nameof(SVGLDLibs.Models.ConfigurationResponseModel))]
public bool ConfigurationResponseModel(ConfigurationResponseModel model)
[HttpPost(Name = nameof(SVGLDLibs.Models.Configuration))]
public bool ConfigurationResponseModel(Configuration model)
{
return true;
}