31 lines
859 B
Java
31 lines
859 B
Java
package com.onekeycall.videotablet.service;
|
|
|
|
import com.onekeycall.videotablet.entity.DeviceInfo;
|
|
import com.onekeycall.videotablet.repository.DeviceSnRepository;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import java.util.List;
|
|
|
|
@Service
|
|
public class DeviceSnService {
|
|
private final DeviceSnRepository deviceSnRepository;
|
|
|
|
@Autowired
|
|
public DeviceSnService(DeviceSnRepository deviceSnRepository) {
|
|
this.deviceSnRepository = deviceSnRepository;
|
|
}
|
|
|
|
public List<DeviceInfo> findByUserId(String userId) {
|
|
return deviceSnRepository.findByUserId(userId);
|
|
}
|
|
|
|
public DeviceInfo findBySn(String sn) {
|
|
return deviceSnRepository.findBySn(sn);
|
|
}
|
|
|
|
public void save(DeviceInfo deviceInfo) {
|
|
deviceSnRepository.save(deviceInfo);
|
|
}
|
|
}
|