context.js 297 B

12345678910111213141516171819202122
  1. /**
  2. *
  3. * @type {{foo(*)}}
  4. */
  5. 'use strict';
  6. module.exports = {
  7. success(msg, data, total) {
  8. this.body = {
  9. success: true,
  10. msg,
  11. result: data,
  12. total,
  13. };
  14. },
  15. failure(msg, data) {
  16. this.body = {
  17. success: false,
  18. msg,
  19. result: data,
  20. };
  21. }
  22. };