增加上传和获取定位接口
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package com.onekeycall.videotablet.service;
|
||||
|
||||
import com.onekeycall.videotablet.entity.DeviceLocation;
|
||||
import com.onekeycall.videotablet.repository.DeviceLocationRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class DeviceLocationService {
|
||||
private final DeviceLocationRepository deviceSnRepository;
|
||||
|
||||
@Autowired
|
||||
public DeviceLocationService(DeviceLocationRepository deviceSnRepository) {
|
||||
this.deviceSnRepository = deviceSnRepository;
|
||||
}
|
||||
|
||||
public DeviceLocation getDeviceLocation(String sn) {
|
||||
return deviceSnRepository.findBySn(sn);
|
||||
}
|
||||
|
||||
public boolean isExist(String sn) {
|
||||
return deviceSnRepository.existsBySn(sn);
|
||||
}
|
||||
|
||||
public void save(DeviceLocation deviceLocation) {
|
||||
deviceSnRepository.save(deviceLocation);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user