11
This commit is contained in:
1 parent
6c73388fdd
commit
30da249b6b
14 files changed
+540
-69
No files matched your search
@@ -1,15 +1,13 @@
|
||||
package com.luqj.ec.controller;
|
||||
|
||||
import com.luqj.ec.domain.EcDevice;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.luqj.ec.domain.dto.EcDeviceHeartbeatDto;
|
||||
import com.luqj.ec.domain.dto.EcDeviceReportDto;
|
||||
import com.luqj.ec.service.IEcDeviceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/ec/device-api")
|
||||
@@ -26,7 +24,17 @@ public class EcDeviceApiController extends BaseController {
|
||||
ecDeviceService.reportDevice(reportDto);
|
||||
return AjaxResult.success("设备上报成功");
|
||||
}
|
||||
|
||||
@GetMapping("/snapshop")
|
||||
public AjaxResult snapshop(@RequestParam(name = "deviceCode") String deviceCode) {
|
||||
EcDevice ecDevice = new EcDevice();
|
||||
try {
|
||||
ecDevice.setLastScreenPic(ecDeviceService.snapshop(deviceCode));
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(),e);
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
return AjaxResult.success(ecDevice);
|
||||
}
|
||||
@PostMapping("/heartbeat")
|
||||
public AjaxResult heartbeat(@RequestBody EcDeviceHeartbeatDto heartbeatDto) {
|
||||
if (heartbeatDto.getDeviceCode() == null || heartbeatDto.getDeviceCode().isEmpty()) {
|
||||
|
||||
Reference in new issue
Block a user