1.文件列表新增创建人

2.区分共享和分享
3.新增查看共享列表接口
4.调整文件管理默认存储空间
This commit is contained in:
aikai 2024-09-03 16:33:14 +08:00
parent f4fda113b9
commit 8454178f46
7 changed files with 36 additions and 16 deletions

View File

@ -1,7 +1,6 @@
package com.qiwenshare.file.controller;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.RandomUtil;
import com.alibaba.fastjson2.JSON;
@ -33,7 +32,10 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.text.ParseException;
import java.util.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
@Tag(name = "share", description = "该接口为文件分享接口")
@RestController
@ -168,6 +170,7 @@ public class ShareController {
@ResponseBody
public RestResult<ShareListVO> shareList(ShareListDTO shareListDTO) {
JwtUser sessionUserBean = SessionUtil.getSession();
shareListDTO.setSharedFlag(0);
List<ShareListVO> shareList = shareService.selectShareList(shareListDTO, sessionUserBean.getUserId());
int total = shareService.selectShareListTotalCount(shareListDTO, sessionUserBean.getUserId());
@ -176,6 +179,19 @@ public class ShareController {
}
@Operation(summary = "查看共享列表", description = "查看共享列表", tags = {"share"})
@GetMapping(value = "/getShareList")
@ResponseBody
public RestResult<ShareListVO> getShareList(ShareListDTO shareListDTO) {
JwtUser sessionUserBean = SessionUtil.getSession();
shareListDTO.setSharedFlag(1);
List<ShareListVO> shareList = shareService.selectShareList(shareListDTO, sessionUserBean.getUserId());
int total = shareService.selectShareListTotalCount(shareListDTO, sessionUserBean.getUserId());
return RestResult.success().dataList(shareList, total);
}
@Operation(summary = "分享文件列表", description = "分享列表", tags = {"share"})
@GetMapping(value = "/sharefileList")
@ResponseBody

View File

@ -6,6 +6,9 @@ import lombok.Data;
@Data
@Schema(name = "分享列表DTO",required = true)
public class ShareListDTO {
@Schema(description="是否共享列表 0否1是")
private Integer sharedFlag;
@Schema(description="分享文件路径")
private String shareFilePath;
@Schema(description="批次号")

View File

@ -6,8 +6,9 @@ import com.qiwenshare.file.vo.share.ShareListVO;
import java.util.List;
public interface ShareMapper extends BaseMapper<Share> {
public interface ShareMapper extends BaseMapper<Share> {
List<ShareListVO> selectShareList(String shareFilePath,String shareBatchNum, Long beginCount, Long pageCount, String userId);
int selectShareListTotalCount(String shareFilePath,String shareBatchNum, String userId);
List<ShareListVO> selectShareList(String shareFilePath, Integer sharedFlag, String shareBatchNum, Long beginCount, Long pageCount, String userId);
int selectShareListTotalCount(String shareFilePath, String shareBatchNum, String userId);
}

View File

@ -2,13 +2,9 @@ package com.qiwenshare.file.service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qiwenshare.file.api.IShareService;
import com.qiwenshare.file.domain.RecoveryFile;
import com.qiwenshare.file.domain.Share;
import com.qiwenshare.file.domain.ShareFile;
import com.qiwenshare.file.dto.sharefile.ShareListDTO;
import com.qiwenshare.file.mapper.RecoveryFileMapper;
import com.qiwenshare.file.mapper.ShareMapper;
import com.qiwenshare.file.vo.share.ShareFileListVO;
import com.qiwenshare.file.vo.share.ShareListVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@ -28,6 +24,7 @@ public class ShareService extends ServiceImpl<ShareMapper, Share> implements ISh
public List<ShareListVO> selectShareList(ShareListDTO shareListDTO, String userId) {
Long beginCount = (shareListDTO.getCurrentPage() - 1) * shareListDTO.getPageCount();
return shareMapper.selectShareList(shareListDTO.getShareFilePath(),
shareListDTO.getSharedFlag(),
shareListDTO.getShareBatchNum(),
beginCount, shareListDTO.getPageCount(), userId);
}

View File

@ -42,5 +42,6 @@ public class FileListVO {
private Integer imageWidth;
private Integer imageHeight;
private String creator;
}

View File

@ -32,4 +32,6 @@ public class ShareListVO {
private String fileUrl;
private Long fileSize;
private Integer storageType;
private String creator;
}

View File

@ -1,4 +1,4 @@
server.port=8080
server.port=8099
#环境切换 dev/prod
spring.profiles.active=dev
@ -21,9 +21,9 @@ spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.Ph
#jdbc连接-mysql数据库
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
spring.datasource.url = jdbc:mysql://localhost:3306/file?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
spring.datasource.url = jdbc:mysql://rm-bp1yloyj508qld78jno.mysql.rds.aliyuncs.com:3306/file?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.password=Znalyrds2024
#静态资源指定
spring.mvc.static-path-pattern=/**
@ -76,13 +76,13 @@ fdfs.tracker-list=127.0.0.1:22122
# Redis数据库索引默认为0
spring.redis.database=0
spring.redis.database=1
# Redis服务器地址
spring.redis.host=127.0.0.1
# Redis服务器连接端口
spring.redis.port=6379
# Redis服务器连接密码默认为空
spring.redis.password=ma123456
spring.redis.password=ZNredis2024!
# 连接池最大连接数(使用负值表示没有限制) 默认 8
spring.redis.lettuce.pool.max-active=8
# 连接池最大阻塞等待时间(使用负值表示没有限制) 默认 -1
@ -129,7 +129,7 @@ jwt.payload.registerd-claims.aud = qiwenshare
qiwen.file.version=1.1.2
# 当前部署外网IP用于office预览
deployment.host=192.168.1.6
deployment.host=47.97.8.94
@ -145,7 +145,7 @@ files.docservice.convert-docs=.docm|.dotx|.dotm|.dot|.doc|.odt|.fodt|.ott|.xlsm|
files.docservice.timeout=120000
files.docservice.history.postfix=-hist
files.docservice.url.site=http://192.168.1.6:80/
files.docservice.url.site=http://47.97.8.94:80/
files.docservice.url.converter=ConvertService.ashx
files.docservice.url.command=coauthoring/CommandService.ashx
files.docservice.url.api=web-apps/apps/api/documents/api.js