| package com.pt.service; |
| |
| import com.pt.entity.Download; |
| import com.pt.repository.DownloadRepository; |
| import org.springframework.beans.factory.annotation.Autowired; |
| import org.springframework.stereotype.Service; |
| |
| import java.util.List; |
| |
| @Service |
| public class DownloadService { |
| |
| @Autowired |
| private DownloadRepository downloadRepository; |
| |
| public DownloadService(DownloadRepository downloadRepository) { |
| this.downloadRepository = downloadRepository; |
| } |
| |
| public List<Download> searchByResourceId(int resourceId) { |
| return downloadRepository.findByResourceId(resourceId); |
| } |
| /* |
| TODO: 添加下载需要的服务; |
| */ |
| } |