46 lines
1.5 KiB
Java
46 lines
1.5 KiB
Java
package com.onekeycall.videotablet.service;
|
|
|
|
import com.onekeycall.videotablet.entity.ApkIconFileInfo;
|
|
import com.onekeycall.videotablet.repository.ApkIconRepository;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import java.util.List;
|
|
import java.util.Optional;
|
|
|
|
@Service
|
|
public class ApkIconService {
|
|
@Autowired
|
|
private ApkIconRepository apkIconRepository;
|
|
|
|
public void save(ApkIconFileInfo apkIconFileInfo) {
|
|
apkIconRepository.save(apkIconFileInfo);
|
|
}
|
|
|
|
public boolean existsByPackageNameAndMd5(String packageName, String md5) {
|
|
return apkIconRepository.existsByPackageNameAndMd5(packageName, md5);
|
|
}
|
|
|
|
public List<ApkIconFileInfo> findByPackageNameAndMd5(String packageName, String md5) {
|
|
return apkIconRepository.findByPackageNameAndMd5(packageName, md5);
|
|
}
|
|
|
|
public List<ApkIconFileInfo> findByPackageName(String packageName) {
|
|
return apkIconRepository.findByPackageName(packageName);
|
|
}
|
|
|
|
public Optional<ApkIconFileInfo> findMaxVersionCodeByPackageName(String packageName) {
|
|
return apkIconRepository.findMaxVersionCodeByPackageName(packageName);
|
|
}
|
|
|
|
public List<ApkIconFileInfo> findAll() {
|
|
return apkIconRepository.findAll();
|
|
}
|
|
|
|
@Transactional
|
|
public Integer deleteApkIconFileInfosById(Long id) {
|
|
return apkIconRepository.deleteApkIconFileInfosById(id);
|
|
}
|
|
}
|