|
@@ -1,5 +1,6 @@
|
|
|
package com.xy.service;
|
|
|
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.xy.dbmapper.SyncUpdate;
|
|
@@ -14,6 +15,7 @@ import com.xy.utils.R;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
@@ -34,6 +36,7 @@ import static com.xy.utils.Beans.copy;
|
|
|
*/
|
|
|
@Service
|
|
|
@AllArgsConstructor
|
|
|
+@Slf4j
|
|
|
@Api(tags = "设备-状态")
|
|
|
public class DeviceStatusServiceImpl extends ServiceImpl<DeviceStatusMapper, DeviceStatus> implements DeviceStatusService {
|
|
|
|
|
@@ -42,6 +45,7 @@ public class DeviceStatusServiceImpl extends ServiceImpl<DeviceStatusMapper, Dev
|
|
|
@Override
|
|
|
@ApiOperation("上报信息")
|
|
|
public R up(DeviceStatusDto.Up up) {
|
|
|
+ log.info("设备信息上报:{}", JSONUtil.toJsonStr(up));
|
|
|
DeviceStatus deviceStatusInfo = getById(up.getDeviceId());
|
|
|
if (deviceStatusInfo == null) {
|
|
|
return R.ok();
|