From bb11bb18dae1884557e9bf78cb44b800ab8985ee Mon Sep 17 00:00:00 2001 From: pqyt64hnf <2543568107@qq.com> Date: Sun, 30 Apr 2023 01:18:48 +0800 Subject: [PATCH] ADD file via upload --- .../com/service/NxSystemFileInfoService.java | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 src/main/java/com/service/NxSystemFileInfoService.java diff --git a/src/main/java/com/service/NxSystemFileInfoService.java b/src/main/java/com/service/NxSystemFileInfoService.java new file mode 100644 index 0000000..8e26621 --- /dev/null +++ b/src/main/java/com/service/NxSystemFileInfoService.java @@ -0,0 +1,52 @@ +package com.example.service; + +import com.example.dao.NxSystemFileInfoDao; +import com.example.entity.NxSystemFileInfo; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +@Service +public class NxSystemFileInfoService { + + @Value("${authority.info}") + private String authorityInfo; + + @Resource + private NxSystemFileInfoDao nxSystemFileInfoDao; + + public NxSystemFileInfo add(NxSystemFileInfo nxSystemFileInfo) { + nxSystemFileInfoDao.insertSelective(nxSystemFileInfo); + return nxSystemFileInfo; + } + + public void delete(Long id) { + nxSystemFileInfoDao.deleteByPrimaryKey(id); + } + + public void update(NxSystemFileInfo nxSystemFileInfo) { + nxSystemFileInfoDao.updateByPrimaryKeySelective(nxSystemFileInfo); + } + + public NxSystemFileInfo findById(Long id) { + return nxSystemFileInfoDao.selectByPrimaryKey(id); + } + + public NxSystemFileInfo findByFileName(String name) { + return nxSystemFileInfoDao.findByFileName(name); + } + + public List findAll() { + return nxSystemFileInfoDao.findByName("all"); + } + + public PageInfo findPage(String name, Integer pageNum, Integer pageSize) { + PageHelper.startPage(pageNum, pageSize); + List all = nxSystemFileInfoDao.findByName(name); + return PageInfo.of(all); + } +}