增加添加和获取联系人接口,AesAttributeConverter中autoApply = false取消全局加密

This commit is contained in:
2025-08-26 19:07:26 +08:00
parent 49572f46d7
commit bab1db37e3
6 changed files with 129 additions and 7 deletions

View File

@@ -0,0 +1,48 @@
package com.onekeycall.videotablet.service;
import com.onekeycall.videotablet.entity.Contact;
import com.onekeycall.videotablet.entity.DeviceLocation;
import com.onekeycall.videotablet.repository.ContactRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class ContactService {
private final ContactRepository contactRepository;
@Autowired
public ContactService(ContactRepository deviceSnRepository) {
this.contactRepository = deviceSnRepository;
}
public boolean isExistByPhoneNumber(String phoneNumber) {
return contactRepository.existsByPhoneNumber(phoneNumber);
}
public boolean isExistByPhoneNumberAndSn(String phoneNumber, String sn) {
return contactRepository.existsByPhoneNumberAndSn(phoneNumber, sn);
}
public Contact findByPhoneNumber(String phoneNumber) {
return contactRepository.findByPhoneNumber(phoneNumber);
}
public Contact findByPhoneNumberAndUserId(String phoneNumber, String userId) {
return contactRepository.findByPhoneNumberAndUserId(phoneNumber, userId);
}
public Contact findByUserId(String userId) {
return contactRepository.findByUserId(userId);
}
public List<Contact> findAllBySn(String sn) {
return contactRepository.findAllBySn(sn);
}
public void save(Contact contact) {
contactRepository.save(contact);
}
}