summaryrefslogtreecommitdiff
path: root/src/main/java/com/mesasoft/cn/service/impl/DownloadedServiceImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/mesasoft/cn/service/impl/DownloadedServiceImpl.java')
-rw-r--r--src/main/java/com/mesasoft/cn/service/impl/DownloadedServiceImpl.java42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/main/java/com/mesasoft/cn/service/impl/DownloadedServiceImpl.java b/src/main/java/com/mesasoft/cn/service/impl/DownloadedServiceImpl.java
new file mode 100644
index 0000000..3c2b546
--- /dev/null
+++ b/src/main/java/com/mesasoft/cn/service/impl/DownloadedServiceImpl.java
@@ -0,0 +1,42 @@
+package com.mesasoft.cn.service.impl;
+
+import com.mesasoft.cn.dao.DownloadedDAO;
+import com.mesasoft.cn.model.DownloadRecord;
+import com.mesasoft.cn.service.IDownloadedService;
+import com.mesasoft.cn.util.ServiceUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @author pantao
+ * @since 2018/2/1
+ */
+@Service
+public class DownloadedServiceImpl implements IDownloadedService {
+
+ private final DownloadedDAO downloadDAO;
+
+ @Autowired
+ public DownloadedServiceImpl(DownloadedDAO downloadDAO) {
+ this.downloadDAO = downloadDAO;
+ }
+
+ @Override
+ public void insertDownload(int userId, long fileId) {
+ downloadDAO.insertDownload(userId, fileId);
+ }
+
+ @Override
+ public void removeByFileId(long fileId) {
+ downloadDAO.removeByFileId(fileId);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public List<DownloadRecord> list(String user, String file, String category, int offset) {
+ return (List<DownloadRecord>) ServiceUtils.invokeFileFilter(downloadDAO, "listDownloadedBy", user, file,
+ category, offset);
+ }
+}