From a92b1db7619b2b850125d56cc3f6153c5b9fb1ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Tue, 31 Dec 2024 17:26:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC=E5=91=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test/TestAppService.cs | 6 +- .../Jobs/IssueJobs/AgvJobs/DTOS/AgvDto.cs | 327 +++++++++--------- .../Jobs/IssueJobs/proxy/AgvJobClient.cs | 150 ++++---- 3 files changed, 253 insertions(+), 230 deletions(-) diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/test/TestAppService.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/test/TestAppService.cs index 1e3fe9760..30840e1ed 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/test/TestAppService.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/test/TestAppService.cs @@ -29,7 +29,7 @@ ///// //[AllowAnonymous] //[Route($"{BasedataConsts.RootPath}test")] -//public class TestService:ApplicationService +//public class TestService : ApplicationService //{ // private readonly IServiceProvider _serviceProvider; // private readonly IOptions _options; @@ -152,7 +152,7 @@ // [HttpPost("pushOutTaskCoating")] // public async Task PushOutTaskCoating(AgvRequest request) // { -// var json=System.Text.Json.JsonSerializer.Serialize(request); +// var json = System.Text.Json.JsonSerializer.Serialize(request); // _logger.LogInformation(json); // AgvResultObject reusltObject = new AgvResultObject(); // reusltObject.Code = "0"; @@ -230,7 +230,7 @@ ///// //public class IssueJobToRestoDTO //{ -// public Guid UUID { set; get; } +// public Guid UUID { set; get; } // public string OperatorName { set; get; } // public List Details { set; get; } //} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/AgvJobs/DTOS/AgvDto.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/AgvJobs/DTOS/AgvDto.cs index 646dd534f..c83b24586 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/AgvJobs/DTOS/AgvDto.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/AgvJobs/DTOS/AgvDto.cs @@ -6,189 +6,73 @@ using System.Text; using System.Threading.Tasks; namespace Win_in.Sfs.Wms.Store.Application.Contracts; -/// -/// 海康调闻荫入参数 -/// -public class AgvRequestDto -{ - //[Display(Name = "请求编号")] - //public string ReqCode { set; get; } - [Display(Name = "明细")] - public List Data { set; get; } - -} -/// -/// 海康调闻荫入参数 -/// -//public class AgvRequestOnlyJobHK -//{ -// //[Display(Name = "请求编号")] -// //public string ReqCode { set; get; } -// [Display(Name = "明细")] -// public List Data { set; get; } - -//} - - - -/// -/// 海康调闻荫入参明细 -/// -public class AgvRequestDetailDto -{ - [Display(Name = "任务类型")] - public string OrderType { set; get; } - [Display(Name = "任务编号")] - public string OrderNum { set; get; } - [Display(Name = "物料编号")] - public string MatCode { set; get; } - [Display(Name = "物料数量")] - public decimal MatQty { set; get; } - [Display(Name = "起始点")] - public string BeginPosition { set; get; } - [Display(Name = "终点")] - public string EndPosition { set; get; } - - [Display(Name = "箱码")] - public string PakingCode { set; get; } - - - [Display(Name = "库存状态")] - public string State { set; get; } - - - [Display(Name = "批次属性07")] - public string BatchAttr07 { set; get; } - [Display(Name = "批次属性08")] - public string BatchAttr08 { set; get; } - [Display(Name = "批次属性09")] - public string BatchAttr09 { set; get; } - [Display(Name = "批次属性10")] - public string BatchAttr10 { set; get; } - [Display(Name = "批次属性11")] - public string BatchAttr11 { set; get; } - [Display(Name = "批次属性12")] - public string BatchAttr12 { set; get; } - [Display(Name = "批次属性13")] - public string BatchAttr13 { set; get; } - [Display(Name = "批次属性14")] - public string BatchAttr14 { set; get; } - [Display(Name = "批次属性15")] - public string BatchAttr15 { set; get; } - -} - -public class AgvRequestUnplannedDto -{ - - [Display(Name = "明细")] - public List Data { set; get; } - -} -public class AgvRequestUnplannedDetailDto -{ - [Display(Name = "任务类型")] - public string OrderType { set; get; } - [Display(Name = "任务编号")] - public string OrderNum { set; get; } - [Display(Name = "物料编号")] - public string MatCode { set; get; } - [Display(Name = "物料数量")] - public decimal MatQty { set; get; } - [Display(Name = "起始点")] - public string BeginPosition { set; get; } - [Display(Name = "终点")] - public string EndPosition { set; get; } - - [Display(Name = "箱码")] - public string PakingCode { set; get; } - - [Display(Name = "库存状态")] - public string State { set; get; } - - - [Display(Name = "批次属性07")] - public string BatchAttr07 { set; get; } - [Display(Name = "批次属性08")] - public string BatchAttr08 { set; get; } - [Display(Name = "批次属性09")] - public string BatchAttr09 { set; get; } - [Display(Name = "批次属性10")] - public string BatchAttr10 { set; get; } - [Display(Name = "批次属性11")] - public string BatchAttr11 { set; get; } - [Display(Name = "批次属性12")] - public string BatchAttr12 { set; get; } - [Display(Name = "批次属性13")] - public string BatchAttr13 { set; get; } - [Display(Name = "批次属性14")] - public string BatchAttr14 { set; get; } - [Display(Name = "批次属性15")] - public string BatchAttr15 { set; get; } - -} - - /// /// 闻荫调海康入参 /// - +[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class AgvRequest { - /// /// 任务类型 /// - [Newtonsoft.Json.JsonProperty("orderType", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + + [System.Text.Json.Serialization.JsonPropertyName("orderType")] public string OrderType { get; set; } /// /// 任务编号 /// - [Newtonsoft.Json.JsonProperty("orderNum", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + + [System.Text.Json.Serialization.JsonPropertyName("orderNum")] public string OrderNum { get; set; } /// /// 物料编号 /// - [Newtonsoft.Json.JsonProperty("matCode", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + + [System.Text.Json.Serialization.JsonPropertyName("matCode")] public string MatCode { get; set; } /// /// 箱码 /// - [Newtonsoft.Json.JsonProperty("pakingCode", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + + [System.Text.Json.Serialization.JsonPropertyName("pakingCode")] public string PakingCode { get; set; } /// /// 库存状态 /// - [Newtonsoft.Json.JsonProperty("state", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + + [System.Text.Json.Serialization.JsonPropertyName("state")] public string State { get; set; } /// /// 批次 /// - [Newtonsoft.Json.JsonProperty("batch", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Batch { get; set; } + [System.Text.Json.Serialization.JsonPropertyName("batch")] + public string Batch { get; set; } /// /// 物料数量 /// - [Newtonsoft.Json.JsonProperty("matQty", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + + [System.Text.Json.Serialization.JsonPropertyName("matQty")] public decimal MatQty { get; set; } /// /// 来源工位 /// - [Newtonsoft.Json.JsonProperty("beginPosition", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + + [System.Text.Json.Serialization.JsonPropertyName("beginPosition")] public string BeginPosition { get; set; } /// /// 目标工位 /// - [Newtonsoft.Json.JsonProperty("endPosition", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + + [System.Text.Json.Serialization.JsonPropertyName("endPosition")] public string EndPosition { get; set; } } @@ -199,19 +83,22 @@ public partial class AgvRequestBack /// /// 物料编号 /// - [Newtonsoft.Json.JsonProperty("matCode", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + + [System.Text.Json.Serialization.JsonPropertyName("matCode")] public string MatCode { get; set; } /// /// 物料数量 /// - [Newtonsoft.Json.JsonProperty("returnQty", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public decimal ReturnQty { get; set; } + + [System.Text.Json.Serialization.JsonPropertyName("returnQty")] + public double ReturnQty { get; set; } /// /// 目标工位 /// - [Newtonsoft.Json.JsonProperty("endPosition", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + + [System.Text.Json.Serialization.JsonPropertyName("endPosition")] public string EndPosition { get; set; } } @@ -222,84 +109,210 @@ public partial class AgvRequestUnplanned /// /// 批次 /// - [Newtonsoft.Json.JsonProperty("batch", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + + [System.Text.Json.Serialization.JsonPropertyName("batch")] public string Batch { get; set; } /// /// 箱码 /// - [Newtonsoft.Json.JsonProperty("pakingCode", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string PakingCode { get; set; } + [System.Text.Json.Serialization.JsonPropertyName("pakingCode")] + public string PakingCode { get; set; } /// /// 库存状态 /// - [Newtonsoft.Json.JsonProperty("state", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string State { get; set; } + [System.Text.Json.Serialization.JsonPropertyName("state")] + public string State { get; set; } /// /// ERP储位 /// - [Newtonsoft.Json.JsonProperty("erpLocationCode", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + + [System.Text.Json.Serialization.JsonPropertyName("erpLocationCode")] public string ErpLocationCode { get; set; } /// /// 任务类型 /// - [Newtonsoft.Json.JsonProperty("orderType", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + + [System.Text.Json.Serialization.JsonPropertyName("orderType")] public string OrderType { get; set; } /// /// 任务编号 /// - [Newtonsoft.Json.JsonProperty("orderNum", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + + [System.Text.Json.Serialization.JsonPropertyName("orderNum")] public string OrderNum { get; set; } /// /// 物料编号 /// - [Newtonsoft.Json.JsonProperty("matCode", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + + [System.Text.Json.Serialization.JsonPropertyName("matCode")] public string MatCode { get; set; } /// /// 物料数量 /// - [Newtonsoft.Json.JsonProperty("matQty", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + + [System.Text.Json.Serialization.JsonPropertyName("matQty")] public decimal MatQty { get; set; } /// /// 来源工位 /// - [Newtonsoft.Json.JsonProperty("beginPosition", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + + [System.Text.Json.Serialization.JsonPropertyName("beginPosition")] public string BeginPosition { get; set; } /// /// 目标工位 /// - [Newtonsoft.Json.JsonProperty("endPosition", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string EndPosition { get; set; } - - + [System.Text.Json.Serialization.JsonPropertyName("endPosition")] + public string EndPosition { get; set; } } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class AgvResultObject { - [Newtonsoft.Json.JsonProperty("code", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + + [System.Text.Json.Serialization.JsonPropertyName("code")] public string Code { get; set; } - [Newtonsoft.Json.JsonProperty("message", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.Text.Json.Serialization.JsonPropertyName("message")] public string Message { get; set; } - [Newtonsoft.Json.JsonProperty("reqCode", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.Text.Json.Serialization.JsonPropertyName("reqCode")] public string ReqCode { get; set; } } +/// +/// 海康调闻荫入参数 +/// +public class AgvRequestDto +{ + //[Display(Name = "请求编号")] + //public string ReqCode { set; get; } + [Display(Name = "明细")] + public List Data { set; get; } +} +/// +/// 海康调闻荫入参数 +/// +//public class AgvRequestOnlyJobHK +//{ +// //[Display(Name = "请求编号")] +// //public string ReqCode { set; get; } +// [Display(Name = "明细")] +// public List Data { set; get; } + +//} + + + +/// +/// 海康调闻荫入参明细 +/// +public class AgvRequestDetailDto +{ + [Display(Name = "任务类型")] + public string OrderType { set; get; } + [Display(Name = "任务编号")] + public string OrderNum { set; get; } + [Display(Name = "物料编号")] + public string MatCode { set; get; } + [Display(Name = "物料数量")] + public decimal MatQty { set; get; } + [Display(Name = "起始点")] + public string BeginPosition { set; get; } + [Display(Name = "终点")] + public string EndPosition { set; get; } + + [Display(Name = "箱码")] + public string PakingCode { set; get; } + + + [Display(Name = "库存状态")] + public string State { set; get; } + + + [Display(Name = "批次属性07")] + public string BatchAttr07 { set; get; } + [Display(Name = "批次属性08")] + public string BatchAttr08 { set; get; } + [Display(Name = "批次属性09")] + public string BatchAttr09 { set; get; } + [Display(Name = "批次属性10")] + public string BatchAttr10 { set; get; } + [Display(Name = "批次属性11")] + public string BatchAttr11 { set; get; } + [Display(Name = "批次属性12")] + public string BatchAttr12 { set; get; } + [Display(Name = "批次属性13")] + public string BatchAttr13 { set; get; } + [Display(Name = "批次属性14")] + public string BatchAttr14 { set; get; } + [Display(Name = "批次属性15")] + public string BatchAttr15 { set; get; } + +} + +public class AgvRequestUnplannedDto +{ + + [Display(Name = "明细")] + public List Data { set; get; } + +} +public class AgvRequestUnplannedDetailDto +{ + [Display(Name = "任务类型")] + public string OrderType { set; get; } + [Display(Name = "任务编号")] + public string OrderNum { set; get; } + [Display(Name = "物料编号")] + public string MatCode { set; get; } + [Display(Name = "物料数量")] + public decimal MatQty { set; get; } + [Display(Name = "起始点")] + public string BeginPosition { set; get; } + [Display(Name = "终点")] + public string EndPosition { set; get; } + + [Display(Name = "箱码")] + public string PakingCode { set; get; } + + [Display(Name = "库存状态")] + public string State { set; get; } + + + [Display(Name = "批次属性07")] + public string BatchAttr07 { set; get; } + [Display(Name = "批次属性08")] + public string BatchAttr08 { set; get; } + [Display(Name = "批次属性09")] + public string BatchAttr09 { set; get; } + [Display(Name = "批次属性10")] + public string BatchAttr10 { set; get; } + [Display(Name = "批次属性11")] + public string BatchAttr11 { set; get; } + [Display(Name = "批次属性12")] + public string BatchAttr12 { set; get; } + [Display(Name = "批次属性13")] + public string BatchAttr13 { set; get; } + [Display(Name = "批次属性14")] + public string BatchAttr14 { set; get; } + [Display(Name = "批次属性15")] + public string BatchAttr15 { set; get; } + +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/proxy/AgvJobClient.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/proxy/AgvJobClient.cs index 503505562..63ee3f044 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/proxy/AgvJobClient.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/proxy/AgvJobClient.cs @@ -1,6 +1,6 @@ //---------------------- // -// Generated using the NSwag toolchain v14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org) +// Generated using the NSwag toolchain v14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org) // //---------------------- @@ -8,6 +8,7 @@ #pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword." #pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' #pragma warning disable 612 // Disable "CS0612 '...' is obsolete" +#pragma warning disable 649 // Disable "CS0649 Field is never assigned to, and will always have its default value null" #pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... #pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." #pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'" @@ -15,14 +16,14 @@ #pragma warning disable 8603 // Disable "CS8603 Possible null reference return" #pragma warning disable 8604 // Disable "CS8604 Possible null reference argument for parameter" #pragma warning disable 8625 // Disable "CS8625 Cannot convert null literal to non-nullable reference type" -#pragma warning disable CS8765 // Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes). +#pragma warning disable 8765 // Disable "CS8765 Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes)." -namespace Win_in.Sfs.Wms.Store.Jobs.IssueJobs.proxy; +namespace Win_in.Sfs.Wms.Store.Jobs.IssueJobs.proxy +{ + using Win_in.Sfs.Wms.Store.Application.Contracts; + using System = global::System; -using Win_in.Sfs.Wms.Store.Application.Contracts; -using System = global::System; - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class AgvJobClient { #pragma warning disable 8618 @@ -30,24 +31,37 @@ using System = global::System; #pragma warning restore 8618 private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); + private System.Text.Json.JsonSerializerOptions _instanceSettings; #pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. - public AgvJobClient(string baseUrl, System.Net.Http.HttpClient httpClient, string path) + public AgvJobClient(string baseUrl, System.Net.Http.HttpClient httpClient,string path) #pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. { - _path = path; - BaseUrl = baseUrl; + BaseUrl = baseUrl; _httpClient = httpClient; + _path= path; + Initialize(); } - private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + + private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() { - var settings = new Newtonsoft.Json.JsonSerializerSettings(); + var settings = new System.Text.Json.JsonSerializerOptions(); UpdateJsonSerializerSettings(settings); return settings; } + private string _path; + public string Path + { + get { return _path; } + set + { + _path = value; + + } + } public string BaseUrl { get { return _baseUrl; } @@ -58,19 +72,12 @@ using System = global::System; _baseUrl += '/'; } } - private string _path; - public string Path - { - get { return _path; } - set - { - _path = value; - } - } - protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } + protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _instanceSettings ?? _settings.Value; } } + + static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + partial void Initialize(); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); @@ -94,12 +101,12 @@ using System = global::System; { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); - var content_ = new System.Net.Http.StringContent(json_); + var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, JsonSerializerSettings); + var content_ = new System.Net.Http.ByteArrayContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("*/*")); var urlBuilder_ = new System.Text.StringBuilder(); if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); @@ -236,12 +243,12 @@ using System = global::System; { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); - var content_ = new System.Net.Http.StringContent(json_); + var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, JsonSerializerSettings); + var content_ = new System.Net.Http.ByteArrayContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("*/*")); var urlBuilder_ = new System.Text.StringBuilder(); if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); @@ -378,12 +385,12 @@ using System = global::System; { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); - var content_ = new System.Net.Http.StringContent(json_); + var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, JsonSerializerSettings); + var content_ = new System.Net.Http.ByteArrayContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("*/*")); var urlBuilder_ = new System.Text.StringBuilder(); if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); @@ -520,12 +527,15 @@ using System = global::System; { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); - var content_ = new System.Net.Http.StringContent(json_); + var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, JsonSerializerSettings); + var content_ = new System.Net.Http.ByteArrayContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("*/*")); + + + var urlBuilder_ = new System.Text.StringBuilder(); if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); @@ -662,12 +672,12 @@ using System = global::System; { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); - var content_ = new System.Net.Http.StringContent(json_); + var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, JsonSerializerSettings); + var content_ = new System.Net.Http.ByteArrayContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("*/*")); var urlBuilder_ = new System.Text.StringBuilder(); if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); @@ -804,12 +814,12 @@ using System = global::System; { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); - var content_ = new System.Net.Http.StringContent(json_); + var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, JsonSerializerSettings); + var content_ = new System.Net.Http.ByteArrayContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("*/*")); var urlBuilder_ = new System.Text.StringBuilder(); if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); @@ -946,12 +956,12 @@ using System = global::System; { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); - var content_ = new System.Net.Http.StringContent(json_); + var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, JsonSerializerSettings); + var content_ = new System.Net.Http.ByteArrayContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("*/*")); var urlBuilder_ = new System.Text.StringBuilder(); if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); @@ -1088,12 +1098,12 @@ using System = global::System; { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); - var content_ = new System.Net.Http.StringContent(json_); + var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, JsonSerializerSettings); + var content_ = new System.Net.Http.ByteArrayContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("*/*")); var urlBuilder_ = new System.Text.StringBuilder(); if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); @@ -1239,10 +1249,10 @@ using System = global::System; var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); try { - var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject(responseText, JsonSerializerSettings); + var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); return new ObjectResponseResult(typedBody, responseText); } - catch (Newtonsoft.Json.JsonException exception) + catch (System.Text.Json.JsonException exception) { var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; throw new ApiException(message, (int)response.StatusCode, responseText, headers, exception); @@ -1253,15 +1263,12 @@ using System = global::System; try { using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - using (var streamReader = new System.IO.StreamReader(responseStream)) - using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader)) { - var serializer = Newtonsoft.Json.JsonSerializer.Create(JsonSerializerSettings); - var typedBody = serializer.Deserialize(jsonTextReader); + var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); return new ObjectResponseResult(typedBody, string.Empty); } } - catch (Newtonsoft.Json.JsonException exception) + catch (System.Text.Json.JsonException exception) { var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; throw new ApiException(message, (int)response.StatusCode, string.Empty, headers, exception); @@ -1324,50 +1331,53 @@ using System = global::System; } } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class RemoteServiceErrorInfo { - [Newtonsoft.Json.JsonProperty("code", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + + [System.Text.Json.Serialization.JsonPropertyName("code")] public string Code { get; set; } - [Newtonsoft.Json.JsonProperty("message", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.Text.Json.Serialization.JsonPropertyName("message")] public string Message { get; set; } - [Newtonsoft.Json.JsonProperty("details", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.Text.Json.Serialization.JsonPropertyName("details")] public string Details { get; set; } - [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.Text.Json.Serialization.JsonPropertyName("data")] public System.Collections.Generic.IDictionary Data { get; set; } - [Newtonsoft.Json.JsonProperty("validationErrors", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.Text.Json.Serialization.JsonPropertyName("validationErrors")] public System.Collections.Generic.ICollection ValidationErrors { get; set; } } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class RemoteServiceErrorResponse { - [Newtonsoft.Json.JsonProperty("error", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + + [System.Text.Json.Serialization.JsonPropertyName("error")] public RemoteServiceErrorInfo Error { get; set; } } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class RemoteServiceValidationErrorInfo { - [Newtonsoft.Json.JsonProperty("message", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + + [System.Text.Json.Serialization.JsonPropertyName("message")] public string Message { get; set; } - [Newtonsoft.Json.JsonProperty("members", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.Text.Json.Serialization.JsonPropertyName("members")] public System.Collections.Generic.ICollection Members { get; set; } } - + - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ApiException : System.Exception { public int StatusCode { get; private set; } @@ -1390,7 +1400,7 @@ using System = global::System; } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ApiException : ApiException { public TResult Result { get; private set; } @@ -1402,7 +1412,7 @@ using System = global::System; } } - +} #pragma warning restore 108 #pragma warning restore 114