ITopRequest.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System;
  2. using System.Collections.Generic;
  3. namespace Top.Api
  4. {
  5. /// <summary>
  6. /// TOP请求接口。
  7. /// </summary>
  8. public interface ITopRequest<out T> where T : TopResponse
  9. {
  10. /// <summary>
  11. /// 获取TOP的API名称。
  12. /// </summary>
  13. string GetApiName();
  14. /// <summary>
  15. /// 获取被调用的目标AppKey
  16. /// </summary>
  17. string GetTargetAppKey();
  18. /// <summary>
  19. /// 获取所有的Key-Value形式的文本请求参数字典。
  20. /// </summary>
  21. IDictionary<string, string> GetParameters();
  22. /// <summary>
  23. /// 获取自定义HTTP请求头参数。
  24. /// </summary>
  25. IDictionary<string, string> GetHeaderParameters();
  26. /// <summary>
  27. /// 获取API请求的用户授权码,仅用于批量API调用请求。
  28. /// </summary>
  29. string GetBatchApiSession();
  30. /// <summary>
  31. /// 设置API请求的用户授权码,仅用于批量API调用请求。
  32. /// </summary>
  33. void SetBatchApiSession(string session);
  34. /// <summary>
  35. /// 获取API在批量调用中的顺序,仅用于批量API调用请求。
  36. /// </summary>
  37. int GetBatchApiOrder();
  38. /// <summary>
  39. /// 设置API在批量调用中的顺序,仅用于批量API调用请求。
  40. /// </summary>
  41. void SetBatchApiOrder(int order);
  42. /// <summary>
  43. /// 客户端参数检查,减少服务端无效调用。
  44. /// </summary>
  45. void Validate();
  46. }
  47. }