example.js 414 B

1234567891011121314151617181920212223242526272829
  1. 'use strict';
  2. const { Service } = require('ee-core');
  3. /**
  4. * 示例服务(service层为单例)
  5. * @class
  6. */
  7. class ExampleService extends Service {
  8. constructor(ctx) {
  9. super(ctx);
  10. }
  11. /**
  12. * test
  13. */
  14. async test(args) {
  15. let obj = {
  16. status:'ok',
  17. params: args
  18. }
  19. return obj;
  20. }
  21. }
  22. ExampleService.toString = () => '[class ExampleService]';
  23. module.exports = ExampleService;