增加工单模块
This commit is contained in:
1 parent
dc136e449e
commit
f9dcae4610
17 files changed
+4908
No files matched your search
@@ -0,0 +1,87 @@
|
||||
using OrderSupportTicket.Models;
|
||||
using OrderSupportTicket.Models.Api;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrderSupportTicket.Services;
|
||||
|
||||
/// <summary>
|
||||
/// 客户工单 v2 接口。
|
||||
/// </summary>
|
||||
public interface ITicketApiService
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询工单摘要列表。
|
||||
/// </summary>
|
||||
Task<WorkOrderListResponse> GetWorkOrdersAsync(
|
||||
TicketClientOptions options,
|
||||
string wechatOrderId = null,
|
||||
string status = null,
|
||||
int limit = 20,
|
||||
string cursor = null);
|
||||
|
||||
/// <summary>
|
||||
/// 查询指定订单的公开留言板。
|
||||
/// </summary>
|
||||
Task<WorkOrderMessagesResponse> GetMessagesAsync(
|
||||
TicketClientOptions options,
|
||||
string appId,
|
||||
string wechatOrderId,
|
||||
string before = null,
|
||||
int limit = 50);
|
||||
|
||||
/// <summary>
|
||||
/// 提交问题或创建工单。
|
||||
/// </summary>
|
||||
Task<CreateWorkOrderResponse> CreateWorkOrderAsync(
|
||||
TicketClientOptions options,
|
||||
TicketOrderOption order,
|
||||
string description,
|
||||
string clientRequestId = null);
|
||||
|
||||
/// <summary>
|
||||
/// 提交客户留言。
|
||||
/// </summary>
|
||||
Task<SendMessageResponse> SendMessageAsync(
|
||||
TicketClientOptions options,
|
||||
WorkOrderSummaryDto workOrder,
|
||||
string text,
|
||||
string clientMessageId);
|
||||
|
||||
/// <summary>
|
||||
/// 标记当前订单留言已读。
|
||||
/// </summary>
|
||||
Task MarkReadAsync(
|
||||
TicketClientOptions options,
|
||||
string appId,
|
||||
string wechatOrderId,
|
||||
int throughSequenceNo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 工单接口调用失败时返回的异常。
|
||||
/// </summary>
|
||||
public sealed class TicketApiException : System.Exception
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建工单接口异常。
|
||||
/// </summary>
|
||||
public TicketApiException(
|
||||
int statusCode,
|
||||
string message,
|
||||
string responseBody = null)
|
||||
: base(message)
|
||||
{
|
||||
StatusCode = statusCode;
|
||||
ResponseBody = responseBody;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 服务端返回的状态码;无法从 GetHtml 响应中识别时为 0。
|
||||
/// </summary>
|
||||
public int StatusCode { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务端返回的原始响应正文。
|
||||
/// </summary>
|
||||
public string ResponseBody { get; }
|
||||
}
|
||||
Reference in new issue
Block a user