diff --git a/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Extensions/WechatOpenAIClientExecuteBotExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Extensions/WechatOpenAIClientExecuteBotExtensions.cs index 5f321488..9be7d324 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Extensions/WechatOpenAIClientExecuteBotExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Extensions/WechatOpenAIClientExecuteBotExtensions.cs @@ -10,7 +10,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI { /// /// 异步调用 [POST] /batchimportskill/{TOKEN} 接口。 - /// REF: https://developers.weixin.qq.com/doc/aispeech/platform/skill/batchimportskill.html + /// REF: https://developers.weixin.qq.com/doc/aispeech/confapi/bot/batchimportskill.html /// /// /// @@ -29,7 +29,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI /// /// 异步调用 [POST] /publish/{TOKEN} 接口。 - /// REF: https://developers.weixin.qq.com/doc/aispeech/platform/skill/publish.html + /// REF: https://developers.weixin.qq.com/doc/aispeech/confapi/bot/publish.html /// /// /// @@ -48,7 +48,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI /// /// 异步调用 [POST] /publish_progress/{TOKEN} 接口。 - /// REF: https://developers.weixin.qq.com/doc/aispeech/platform/skill/publish_progress.html + /// REF: https://developers.weixin.qq.com/doc/aispeech/confapi/bot/publish_progress.html /// /// /// @@ -67,8 +67,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI /// /// 异步调用 [POST] /setautoreply/{TOKEN} 接口。 - /// REF: https://developers.weixin.qq.com/doc/aispeech/platform/living/setautoreply.html - /// REF: https://developers.weixin.qq.com/doc/aispeech/platform/skill/publish_progress.html + /// REF: https://developers.weixin.qq.com/doc/aispeech/confapi/bot/setautoreply.html /// /// /// @@ -87,7 +86,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI /// /// 异步调用 [POST] /label/batchset/{TOKEN} 接口。 - /// REF: https://developers.weixin.qq.com/doc/aispeech/platform/batchsetlabel.html + /// REF: https://developers.weixin.qq.com/doc/aispeech/confapi/bot/batchsetlabel.html /// /// /// diff --git a/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Extensions/WechatOpenAIClientExecuteDialogExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Extensions/WechatOpenAIClientExecuteDialogExtensions.cs index 32767b54..1c675373 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Extensions/WechatOpenAIClientExecuteDialogExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Extensions/WechatOpenAIClientExecuteDialogExtensions.cs @@ -46,6 +46,25 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); } + /// + /// 异步调用 [POST] /feedback/{TOKEN} 接口。 + /// REF: https://developers.weixin.qq.com/doc/aispeech/confapi/dialog/feedback.html + /// + /// + /// + /// + /// + public static async Task ExecuteFeedbackAsync(this WechatOpenAIClient client, Models.FeedbackRequest request, CancellationToken cancellationToken = default) + { + if (client is null) throw new ArgumentNullException(nameof(client)); + if (request is null) throw new ArgumentNullException(nameof(request)); + + IFlurlRequest flurlReq = client + .CreateRequest(request, HttpMethod.Post, "feedback", client.Credentials.Token!); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + /// /// 异步调用 [POST] /gethotquerylist/{TOKEN} 接口。 /// REF: https://developers.weixin.qq.com/doc/aispeech/confapi/dialog/gethotquerylist.html @@ -64,5 +83,24 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); } + + /// + /// 异步调用 [POST] /gethotquerydetail/{TOKEN} 接口。 + /// REF: https://developers.weixin.qq.com/doc/aispeech/confapi/dialog/gethotquerydetail.html + /// + /// + /// + /// + /// + public static async Task ExecuteGetHotQueryDetailAsync(this WechatOpenAIClient client, Models.GetHotQueryDetailRequest request, CancellationToken cancellationToken = default) + { + if (client is null) throw new ArgumentNullException(nameof(client)); + if (request is null) throw new ArgumentNullException(nameof(request)); + + IFlurlRequest flurlReq = client + .CreateRequest(request, HttpMethod.Post, "gethotquerydetail", client.Credentials.Token!); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } } } diff --git a/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Extensions/WechatOpenAIClientExecuteMpExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Extensions/WechatOpenAIClientExecuteMpExtensions.cs index 5d7c6ca6..6bc677c9 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Extensions/WechatOpenAIClientExecuteMpExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Extensions/WechatOpenAIClientExecuteMpExtensions.cs @@ -13,7 +13,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI { /// /// 异步调用 [POST] /getbindlink/{TOKEN} 接口。 - /// REF: https://developers.weixin.qq.com/doc/aispeech/platform/mp/getbindlink.html + /// REF: https://developers.weixin.qq.com/doc/aispeech/confapi/mp/getbindlink.html /// /// /// @@ -32,7 +32,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI /// /// 异步调用 [POST] /getbindlist/{TOKEN} 接口。 - /// REF: https://developers.weixin.qq.com/doc/aispeech/platform/mp/getbindlist.html + /// REF: https://developers.weixin.qq.com/doc/aispeech/confapi/mp/getbindlist.html /// /// /// @@ -51,7 +51,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI /// /// 异步调用 [POST] /unbindmp/{TOKEN} 接口。 - /// REF: https://developers.weixin.qq.com/doc/aispeech/platform/mp/unbindmp.html + /// REF: https://developers.weixin.qq.com/doc/aispeech/confapi/mp/unbindmp.html /// /// /// @@ -70,7 +70,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI /// /// 异步调用 [POST] /geth5link/{TOKEN} 接口。 - /// REF: https://developers.weixin.qq.com/doc/aispeech/platform/mp/getbindlist.html + /// REF: https://developers.weixin.qq.com/doc/aispeech/confapi/mp/getbindlist.html /// /// /// @@ -87,10 +87,9 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); } - /// /// 异步调用 [POST] /assetsupload/{TOKEN} 接口。 - /// REF: https://developers.weixin.qq.com/doc/aispeech/platform/mp/assetsupload.html + /// REF: https://developers.weixin.qq.com/doc/aispeech/confapi/mp/assetsupload.html /// /// /// diff --git a/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Extensions/WechatOpenAIClientExecuteThirdKefuExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Extensions/WechatOpenAIClientExecuteThirdKefuExtensions.cs index 8ac53561..213f4bfe 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Extensions/WechatOpenAIClientExecuteThirdKefuExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Extensions/WechatOpenAIClientExecuteThirdKefuExtensions.cs @@ -10,8 +10,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI { /// /// 异步调用 [POST] /sendmsg/{TOKEN} 接口。 - /// REF: https://developers.weixin.qq.com/doc/aispeech/platform/thirdkefu/sendmsg.html - /// REF: https://developers.weixin.qq.com/doc/aispeech/platform/sendmsg.html + /// REF: https://developers.weixin.qq.com/doc/aispeech/confapi/thirdkefu/sendmsg.html /// /// /// @@ -33,7 +32,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI /// /// 异步调用 [POST] /kefustate/get/{TOKEN} 接口。 - /// REF: https://developers.weixin.qq.com/doc/aispeech/platform/thirdkefu/getstate.html + /// REF: https://developers.weixin.qq.com/doc/aispeech/confapi/thirdkefu/getstate.html /// /// /// @@ -55,7 +54,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI /// /// 异步调用 [POST] /kefustate/change/{TOKEN} 接口。 - /// REF: https://developers.weixin.qq.com/doc/aispeech/platform/thirdkefu/getstate.html + /// REF: https://developers.weixin.qq.com/doc/aispeech/confapi/thirdkefu/changestate.html /// /// /// diff --git a/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Models/Dialog/FeedbackRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Models/Dialog/FeedbackRequest.cs new file mode 100644 index 00000000..0bf3b986 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Models/Dialog/FeedbackRequest.cs @@ -0,0 +1,29 @@ +using System.Xml.Serialization; + +namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models +{ + /// + /// 表示 [POST] /feedback/{TOKEN} 接口的请求。 + /// + [XmlRoot("xml")] + public class FeedbackRequest : WechatOpenAIRequest, WechatOpenAIRequest.Serialization.IEncryptedXmlable + { + /// + /// 获取或设置消息 ID。 + /// + [XmlElement("msgid")] + public string MessageId { get; set; } = string.Empty; + + /// + /// 获取或设置反馈结果。 + /// + [XmlElement("feedbackResult")] + public int FeedbackResult { get; set; } + + /// + /// 获取或设置用户反馈时间戳。 + /// + [XmlElement("updateAt")] + public long UpdateTimestamp { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Models/Dialog/FeedbackResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Models/Dialog/FeedbackResponse.cs new file mode 100644 index 00000000..98c5dfdc --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Models/Dialog/FeedbackResponse.cs @@ -0,0 +1,22 @@ +namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models +{ + /// + /// 表示 [POST] /feedback/{TOKEN} 接口的响应。 + /// + public class FeedbackResponse : WechatOpenAIResponse + { + /// + /// + /// + [Newtonsoft.Json.JsonProperty("code")] + [System.Text.Json.Serialization.JsonPropertyName("code")] + public override int? ReturnCode { get; set; } + + /// + /// 获取微信智能对话 API 返回的错误描述。 + /// + [Newtonsoft.Json.JsonProperty("msg")] + [System.Text.Json.Serialization.JsonPropertyName("msg")] + public string? ReturnMessage { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Models/Mp/AssetsUploadResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Models/Mp/AssetsUploadResponse.cs index ad1fb67e..5478da06 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Models/Mp/AssetsUploadResponse.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Models/Mp/AssetsUploadResponse.cs @@ -1,10 +1,24 @@ -namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models +namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models { /// /// 表示 [POST] /assetsupload/{TOKEN} 接口的响应。 /// public class AssetsUploadResponse : WechatOpenAIResponse { + /// + /// + /// + [Newtonsoft.Json.JsonProperty("code")] + [System.Text.Json.Serialization.JsonPropertyName("code")] + public override int? ReturnCode { get; set; } + + /// + /// 获取微信智能对话 API 返回的错误描述。 + /// + [Newtonsoft.Json.JsonProperty("msg")] + [System.Text.Json.Serialization.JsonPropertyName("msg")] + public string? ReturnMessage { get; set; } + /// /// 获取或设置文件标识。 /// diff --git a/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Models/Mp/GetBindLinkResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Models/Mp/GetBindLinkResponse.cs index c3b43d8d..13976a44 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Models/Mp/GetBindLinkResponse.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Models/Mp/GetBindLinkResponse.cs @@ -1,10 +1,24 @@ -namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models +namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models { /// /// 表示 [POST] /getbindlink/{TOKEN} 接口的响应。 /// public class GetBindLinkResponse : WechatOpenAIResponse { + /// + /// + /// + [Newtonsoft.Json.JsonProperty("code")] + [System.Text.Json.Serialization.JsonPropertyName("code")] + public override int? ReturnCode { get; set; } + + /// + /// 获取微信智能对话 API 返回的错误描述。 + /// + [Newtonsoft.Json.JsonProperty("msg")] + [System.Text.Json.Serialization.JsonPropertyName("msg")] + public string? ReturnMessage { get; set; } + /// /// 获取或设置绑定链接 URL。 /// diff --git a/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Models/Mp/GetBindListResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Models/Mp/GetBindListResponse.cs index c039bd77..72f1f4d2 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Models/Mp/GetBindListResponse.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Models/Mp/GetBindListResponse.cs @@ -1,10 +1,24 @@ -namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models +namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models { /// /// 表示 [POST] /getbindlist/{TOKEN} 接口的响应。 /// public class GetBindListResponse : WechatOpenAIResponse { + /// + /// + /// + [Newtonsoft.Json.JsonProperty("code")] + [System.Text.Json.Serialization.JsonPropertyName("code")] + public override int? ReturnCode { get; set; } + + /// + /// 获取微信智能对话 API 返回的错误描述。 + /// + [Newtonsoft.Json.JsonProperty("msg")] + [System.Text.Json.Serialization.JsonPropertyName("msg")] + public string? ReturnMessage { get; set; } + /// /// 获取或设置绑定列表。 /// diff --git a/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Models/Mp/GetH5LinkResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Models/Mp/GetH5LinkResponse.cs index 3850278e..137238e7 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Models/Mp/GetH5LinkResponse.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Models/Mp/GetH5LinkResponse.cs @@ -1,10 +1,24 @@ -namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models +namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models { /// /// 表示 [POST] /geth5link/{TOKEN} 接口的响应。 /// public class GetH5LinkResponse : WechatOpenAIResponse { + /// + /// + /// + [Newtonsoft.Json.JsonProperty("code")] + [System.Text.Json.Serialization.JsonPropertyName("code")] + public override int? ReturnCode { get; set; } + + /// + /// 获取微信智能对话 API 返回的错误描述。 + /// + [Newtonsoft.Json.JsonProperty("msg")] + [System.Text.Json.Serialization.JsonPropertyName("msg")] + public string? ReturnMessage { get; set; } + /// /// 获取或设置机器人链接 URL。 /// diff --git a/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Models/Mp/UnbindMpResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Models/Mp/UnbindMpResponse.cs index f433cdfd..ff27f0c4 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Models/Mp/UnbindMpResponse.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Models/Mp/UnbindMpResponse.cs @@ -1,9 +1,22 @@ -namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models +namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models { /// /// 表示 [POST] /unbindmp/{TOKEN} 接口的响应。 /// public class UnbindMpResponse : WechatOpenAIResponse { + /// + /// + /// + [Newtonsoft.Json.JsonProperty("code")] + [System.Text.Json.Serialization.JsonPropertyName("code")] + public override int? ReturnCode { get; set; } + + /// + /// 获取微信智能对话 API 返回的错误描述。 + /// + [Newtonsoft.Json.JsonProperty("msg")] + [System.Text.Json.Serialization.JsonPropertyName("msg")] + public string? ReturnMessage { get; set; } } }