|
@@ -4,8 +4,10 @@ import cn.kdan.pdf.backend.core.mapper.DevicesMapper;
|
|
|
import cn.kdan.pdf.backend.core.model.Devices;
|
|
|
import cn.kdan.pdf.backend.core.model.DevicesExample;
|
|
|
import cn.kdan.pdf.backend.core.service.DeviceService;
|
|
|
+import exception.BackendRuntimeException;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@@ -24,6 +26,7 @@ public class DeviceServiceImpl implements DeviceService {
|
|
|
private DevicesMapper devicesMapper;
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = BackendRuntimeException.class)
|
|
|
public int insert(Devices devices) {
|
|
|
Date now = new Date();
|
|
|
devices.setCreatedAt(now);
|
|
@@ -54,6 +57,7 @@ public class DeviceServiceImpl implements DeviceService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = BackendRuntimeException.class)
|
|
|
public void update(Devices device, String uuid) {
|
|
|
Date date = new Date();
|
|
|
device.setUpdatedAt(date);
|