UNPKG

pooliot-client

Version:
46 lines (35 loc) 1.31 kB
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _alpNode = require('alp-node'); var _deviceService = require('../../deviceService'); var _deviceService2 = _interopRequireDefault(_deviceService); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = (0, _alpNode.newController)({ async index(ctx) { if (ctx.method !== 'GET') return ctx.status = 404; ctx.body = await _deviceService2.default.getDisplayInfo(); }, async start(ctx) { if (ctx.method !== 'POST') return ctx.status = 404; ctx.body = await _deviceService2.default.startDisplay(); }, async restart(ctx) { if (ctx.method !== 'POST') return ctx.status = 404; ctx.body = await _deviceService2.default.restartDisplay(); }, async stop(ctx) { if (ctx.method !== 'POST') return ctx.status = 404; ctx.body = await _deviceService2.default.stopDisplay(); }, async refresh(ctx) { if (ctx.method !== 'POST') return ctx.status = 404; ctx.body = await _deviceService2.default.refreshDisplay(); }, async openboxStarted(ctx) { if (ctx.method !== 'POST') return ctx.status = 404; ctx.body = await _deviceService2.default.setOpenboxStarted(); } }); //# sourceMappingURL=displayController.js.map