DeviceControl.java 846 Bytes
package com.example.dahua.control;

import com.example.dahua.service.DeviceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController("/device/")
@Api(tags = "设备控制")
@RequestMapping("/device/*")
public class DeviceControl {

    @Autowired
    DeviceService deviceService;

    @RequestMapping(value = "restartDevice", method = RequestMethod.GET)
    public boolean restart(@RequestParam("deviceId") String deviceId) {
       return deviceService.restart(deviceId);
    }


}