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 namespace SVGLDLibs.Models
{ {
public class ConfigurationResponseModel public class Configuration
{ {
public ConfigurationResponseModel(AvailableContainerModel mainContainer) public Configuration(AvailableContainerModel mainContainer)
{ {
MainContainer = mainContainer; MainContainer = mainContainer;
AvailableContainers = new List<AvailableContainerModel>(); 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 public class GetFeedbackRequest
{ {
[DataMember(EmitDefaultValue = false)] [DataMember(EmitDefaultValue = false)]
public ApplicationStateModel ApplicationState { get; set; } public HistoryState ApplicationState { get; set; }
} }
} }

View file

@ -3,7 +3,7 @@ using System.Runtime.Serialization;
namespace SVGLDLibs.Models namespace SVGLDLibs.Models
{ {
public class ApplicationStateModel public class HistoryState
{ {
[DataMember(EmitDefaultValue = false)] [DataMember(EmitDefaultValue = false)]
public string lastAction; public string lastAction;

View file

@ -17,6 +17,6 @@ namespace SVGLDLibs.Models
public ContainerModel NextContainer { get; set; } public ContainerModel NextContainer { get; set; }
[DataMember(EmitDefaultValue = false)] [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; return true;
} }
[HttpPost(Name = nameof(SVGLDLibs.Models.ApplicationStateModel))] [HttpPost(Name = nameof(SVGLDLibs.Models.HistoryState))]
public bool ApplicationStateModel(ApplicationStateModel model) public bool ApplicationStateModel(HistoryState model)
{ {
return true; return true;
} }
@ -44,8 +44,8 @@ public class SVGLDController : ControllerBase
return true; return true;
} }
[HttpPost(Name = nameof(SVGLDLibs.Models.ConfigurationResponseModel))] [HttpPost(Name = nameof(SVGLDLibs.Models.Configuration))]
public bool ConfigurationResponseModel(ConfigurationResponseModel model) public bool ConfigurationResponseModel(Configuration model)
{ {
return true; return true;
} }