|
|
|
@@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
@RestController |
|
|
|
@RequestMapping("wxDeviceScreenAd") |
|
|
|
@@ -85,14 +86,14 @@ public class WxDeviceScreenAdController extends BaseController { |
|
|
|
|
|
|
|
@ApiOperation("心跳") |
|
|
|
@PostMapping("heartbeat") |
|
|
|
public Result heartbeat(@RequestParam String deviceId,@RequestBody String version) { |
|
|
|
public Result heartbeat(@RequestParam String deviceId,@RequestBody Map<String,String> paramMap) { |
|
|
|
WxDevice wxDevice = findDevice(deviceId); |
|
|
|
if (wxDevice == null) |
|
|
|
return new ResultData(ErrorCode.DEVICE_NOT_FOUND); |
|
|
|
if (wxDevice.getFirstHbTime() == null) |
|
|
|
wxDevice.setFirstHbTime(new Date()); |
|
|
|
wxDevice.setLastHbTime(new Date()); |
|
|
|
wxDevice.setVersion(version); |
|
|
|
wxDevice.setVersion(paramMap.get("version")); |
|
|
|
wxDeviceService.saveOrUpdate(wxDevice); |
|
|
|
return new ResultData(wxDevice); |
|
|
|
} |
|
|
|
|