22301102 | b108437 | 2025-06-01 16:44:23 +0800 | [diff] [blame] | 1 | package com.pt.service; |
| 2 | |
22301102 | fe5f841 | 2025-06-01 17:25:51 +0800 | [diff] [blame^] | 3 | import com.pt.entity.Download; |
22301102 | b108437 | 2025-06-01 16:44:23 +0800 | [diff] [blame] | 4 | import com.pt.repository.DownloadRepository; |
| 5 | import org.springframework.beans.factory.annotation.Autowired; |
| 6 | import org.springframework.stereotype.Service; |
| 7 | |
22301102 | fe5f841 | 2025-06-01 17:25:51 +0800 | [diff] [blame^] | 8 | import java.util.List; |
| 9 | |
22301102 | b108437 | 2025-06-01 16:44:23 +0800 | [diff] [blame] | 10 | @Service |
| 11 | public class DownloadService { |
| 12 | |
| 13 | @Autowired |
| 14 | private DownloadRepository downloadRepository; |
| 15 | |
| 16 | public DownloadService(DownloadRepository downloadRepository) { |
| 17 | this.downloadRepository = downloadRepository; |
| 18 | } |
| 19 | |
22301102 | fe5f841 | 2025-06-01 17:25:51 +0800 | [diff] [blame^] | 20 | public List<Download> searchByResourceId(int resourceId) { |
| 21 | return downloadRepository.findByResourceId(resourceId); |
| 22 | } |
22301102 | b108437 | 2025-06-01 16:44:23 +0800 | [diff] [blame] | 23 | /* |
| 24 | TODO: 添加下载需要的服务; |
| 25 | */ |
| 26 | } |