ResultObject.cs 870 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using JiaZhiQuan.Common.Utils;
  2. using Senparc.Weixin.Entities;
  3. using Wicture.DbRESTFul;
  4. namespace JiaZhiQuan.Common.Response
  5. {
  6. public class ResultObject
  7. {
  8. public int statusCode { get; set; }
  9. public string errorMessage { get; set; }
  10. public object data { get; set; }
  11. public ResultObject()
  12. {
  13. statusCode = ErrorCodes.Success;
  14. errorMessage = string.Empty;
  15. }
  16. public static QueryResult BuildOkQuery(object data, Pagination pagination = null)
  17. {
  18. return new QueryResult
  19. {
  20. items = data,
  21. pagination = pagination
  22. };
  23. }
  24. public static OperateResult BuildOkCommand(int count)
  25. {
  26. return new OperateResult
  27. {
  28. count = count
  29. };
  30. }
  31. }
  32. }