AppResult.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #region Apache License Version 2.0
  2. /*----------------------------------------------------------------
  3. Copyright 2019 Jeffrey Su & Suzhou Senparc Network Technology Co.,Ltd.
  4. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
  5. except in compliance with the License. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software distributed under the
  8. License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
  9. either express or implied. See the License for the specific language governing permissions
  10. and limitations under the License.
  11. Detail: https://github.com/JeffreySu/WeiXinMPSDK/blob/master/license.md
  12. ----------------------------------------------------------------*/
  13. #endregion Apache License Version 2.0
  14. /*----------------------------------------------------------------
  15. Copyright (C) 2019 Senparc
  16. 文件名:AppResult.cs
  17. 文件功能描述:获取App返回结果
  18. 创建标识:Senparc - 20150319
  19. ----------------------------------------------------------------*/
  20. namespace Senparc.Weixin.MP.AppStore
  21. {
  22. public interface IAppResult<T> where T : IAppResultData
  23. {
  24. AppResultKind Result { get; set; }
  25. string ErrorMessage { get; set; }
  26. T Data { get; set; }
  27. long RunTime { get; set; }
  28. }
  29. public interface IAppResultData
  30. {
  31. }
  32. public class AppResultData : IAppResultData
  33. {
  34. }
  35. /// <summary>
  36. /// JSON返回结果(用于菜单接口等)
  37. /// </summary>
  38. public class AppResult<T> : IAppResult<T> where T : IAppResultData
  39. {
  40. public AppResultKind Result { get; set; }
  41. /// <summary>
  42. /// 如果结果未成功,则Data为期望的类型
  43. /// </summary>
  44. public T Data { get; set; }
  45. /// <summary>
  46. /// 错误信息,如果结果为成功,错误信息为Null
  47. /// </summary>
  48. public string ErrorMessage { get; set; }
  49. /// <summary>
  50. /// Api执行时间
  51. /// </summary>
  52. public long RunTime { get; set; }
  53. //public T SData
  54. //{
  55. // get { return Data as T; }
  56. //}
  57. }
  58. }