setting.js 722 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. 'use strict';
  2. const BaseController = require('../base');
  3. class SettingController extends BaseController {
  4. async autoLaunchEnable() {
  5. const { service } = this;
  6. const data = {};
  7. await service.setting.autoLaunchEnable();
  8. this.sendSuccess(data);
  9. }
  10. async autoLaunchDisable() {
  11. const { service } = this;
  12. const data = {};
  13. await service.setting.autoLaunchDisable();
  14. this.sendSuccess(data);
  15. }
  16. async autoLaunchIsEnabled() {
  17. const { service } = this;
  18. const data = {
  19. isEnabled: null
  20. };
  21. const isEnabled = await service.setting.autoLaunchIsEnabled();
  22. data.isEnabled = isEnabled;
  23. this.sendSuccess(data);
  24. }
  25. }
  26. module.exports = SettingController;