pooliot-client
Version:
34 lines (27 loc) • 906 B
JavaScript
import deviceService from '../../deviceService';
export default {
async index(ctx) {
if (ctx.method !== 'GET') return (ctx.status = 404);
ctx.body = await deviceService.getDisplayInfo();
},
async start(ctx) {
if (ctx.method !== 'POST') return (ctx.status = 404);
ctx.body = await deviceService.startDisplay();
},
async restart(ctx) {
if (ctx.method !== 'POST') return (ctx.status = 404);
ctx.body = await deviceService.restartDisplay();
},
async stop(ctx) {
if (ctx.method !== 'POST') return (ctx.status = 404);
ctx.body = await deviceService.stopDisplay();
},
async refresh(ctx) {
if (ctx.method !== 'POST') return (ctx.status = 404);
ctx.body = await deviceService.refreshDisplay();
},
async openboxStarted(ctx) {
if (ctx.method !== 'POST') return (ctx.status = 404);
ctx.body = await deviceService.setOpenboxStarted();
},
};