├── .gitignore
├── .idea
├── .gitignore
├── Netdisk.iml
├── compiler.xml
├── dataSources.xml
├── encodings.xml
├── inspectionProfiles
│ └── Project_Default.xml
├── jarRepositories.xml
├── misc.xml
├── modules.xml
├── uiDesigner.xml
└── vcs.xml
├── Netdisk-pan
├── Netdisk-pan.iml
├── pom.xml
├── src
│ └── main
│ │ ├── java
│ │ └── xyz
│ │ │ └── kbws
│ │ │ ├── NetDiskPanApplication.java
│ │ │ ├── annotation
│ │ │ ├── GlobalInterceptor.java
│ │ │ └── VerifyParam.java
│ │ │ ├── aspect
│ │ │ └── GlobalOperatcionAspect.java
│ │ │ ├── component
│ │ │ ├── RedisComponent.java
│ │ │ └── RedisUtils.java
│ │ │ ├── controller
│ │ │ ├── ABaseController.java
│ │ │ ├── AGlobalExceptionHandlerController.java
│ │ │ ├── AdminController.java
│ │ │ ├── CommonFileController.java
│ │ │ ├── EmailCodeController.java
│ │ │ ├── FileInfoController.java
│ │ │ ├── RecycleController.java
│ │ │ ├── ShareController.java
│ │ │ ├── UserInfoController.java
│ │ │ └── WebShareController.java
│ │ │ ├── entity
│ │ │ ├── config
│ │ │ │ ├── AppConfig.java
│ │ │ │ └── RedisConfig.java
│ │ │ ├── constants
│ │ │ │ └── Constants.java
│ │ │ ├── dto
│ │ │ │ ├── CreateImageCode.java
│ │ │ │ ├── DownloadFileDto.java
│ │ │ │ ├── QQInfoDto.java
│ │ │ │ ├── SessionShareDto.java
│ │ │ │ ├── SessionWebUserDto.java
│ │ │ │ ├── SysSettingsDto.java
│ │ │ │ ├── UploadResultDto.java
│ │ │ │ └── UserSpaceDto.java
│ │ │ ├── enums
│ │ │ │ ├── DateTimePatternEnum.java
│ │ │ │ ├── FileCategoryEnum.java
│ │ │ │ ├── FileDelFlagEnum.java
│ │ │ │ ├── FileFolderTypeEnum.java
│ │ │ │ ├── FileStatusEnum.java
│ │ │ │ ├── FileTypeEnum.java
│ │ │ │ ├── PageSize.java
│ │ │ │ ├── ResponseCodeEnum.java
│ │ │ │ ├── ShareValidTypeEnum.java
│ │ │ │ ├── UploadStatusEnum.java
│ │ │ │ ├── UserStatusEnum.java
│ │ │ │ └── VerifyRegexEnum.java
│ │ │ ├── po
│ │ │ │ ├── EmailCode.java
│ │ │ │ ├── FileInfo.java
│ │ │ │ ├── FileShare.java
│ │ │ │ └── UserInfo.java
│ │ │ ├── query
│ │ │ │ ├── BaseParam.java
│ │ │ │ ├── EmailCodeQuery.java
│ │ │ │ ├── FileInfoQuery.java
│ │ │ │ ├── FileShareQuery.java
│ │ │ │ ├── SimplePage.java
│ │ │ │ └── UserInfoQuery.java
│ │ │ └── vo
│ │ │ │ ├── FileInfoVO.java
│ │ │ │ ├── PaginationResultVO.java
│ │ │ │ ├── ResponseVO.java
│ │ │ │ ├── ShareInfoVO.java
│ │ │ │ └── UserInfoVO.java
│ │ │ ├── exception
│ │ │ └── BusinessException.java
│ │ │ ├── mappers
│ │ │ ├── BaseMapper.java
│ │ │ ├── EmailCodeMapper.java
│ │ │ ├── FileInfoMapper.java
│ │ │ ├── FileShareMapper.java
│ │ │ └── UserInfoMapper.java
│ │ │ ├── service
│ │ │ ├── EmailCodeService.java
│ │ │ ├── FileInfoService.java
│ │ │ ├── FileShareService.java
│ │ │ ├── UserInfoService.java
│ │ │ └── impl
│ │ │ │ ├── EmailCodeServiceImpl.java
│ │ │ │ ├── FileInfoServiceImpl.java
│ │ │ │ ├── FileShareServiceImpl.java
│ │ │ │ └── UserInfoServiceImpl.java
│ │ │ ├── task
│ │ │ └── FileCleanTask.java
│ │ │ └── utils
│ │ │ ├── CopyTools.java
│ │ │ ├── DateUtil.java
│ │ │ ├── JsonUtils.java
│ │ │ ├── OKHttpUtils.java
│ │ │ ├── ProcessUtils.java
│ │ │ ├── ScaleFiler.java
│ │ │ ├── StringTools.java
│ │ │ └── VerifyUtils.java
│ │ └── resources
│ │ ├── application-cloud.yml
│ │ ├── application-local.yml
│ │ ├── application.yml
│ │ ├── logback-spring.xml
│ │ ├── rebel.xml
│ │ └── xyz
│ │ └── kbws
│ │ └── mappers
│ │ ├── EmailCodeMapper.xml
│ │ ├── FileInfoMapper.xml
│ │ ├── FileShareMapper.xml
│ │ └── UserInfoMapper.xml
└── target
│ ├── classes
│ ├── application-cloud.yml
│ ├── application-local.yml
│ ├── application.yml
│ ├── logback-spring.xml
│ ├── rebel.xml
│ └── xyz
│ │ └── kbws
│ │ ├── NetDiskPanApplication.class
│ │ ├── annotation
│ │ ├── GlobalInterceptor.class
│ │ └── VerifyParam.class
│ │ ├── component
│ │ └── RedisUtils.class
│ │ ├── entity
│ │ ├── config
│ │ │ └── AppConfig.class
│ │ ├── dto
│ │ │ ├── CreateImageCode.class
│ │ │ ├── SessionWebUserDto.class
│ │ │ ├── SysSettingsDto.class
│ │ │ └── UserSpaceDto.class
│ │ ├── enums
│ │ │ ├── DateTimePatternEnum.class
│ │ │ ├── PageSize.class
│ │ │ ├── ResponseCodeEnum.class
│ │ │ ├── UserStatusEnum.class
│ │ │ └── VerifyRegexEnum.class
│ │ ├── po
│ │ │ ├── EmailCode.class
│ │ │ └── UserInfo.class
│ │ ├── query
│ │ │ ├── BaseParam.class
│ │ │ ├── EmailCodeQuery.class
│ │ │ ├── SimplePage.class
│ │ │ └── UserInfoQuery.class
│ │ └── vo
│ │ │ ├── PaginationResultVO.class
│ │ │ └── ResponseVO.class
│ │ ├── exception
│ │ └── BusinessException.class
│ │ ├── mappers
│ │ ├── BaseMapper.class
│ │ ├── EmailCodeMapper.class
│ │ ├── EmailCodeMapper.xml
│ │ ├── UserInfoMapper.class
│ │ └── UserInfoMapper.xml
│ │ ├── service
│ │ ├── EmailCodeService.class
│ │ └── UserInfoService.class
│ │ └── utils
│ │ ├── DateUtil$1.class
│ │ ├── DateUtil.class
│ │ └── VerifyUtils.class
│ └── maven-status
│ └── maven-compiler-plugin
│ └── compile
│ └── default-compile
│ ├── createdFiles.lst
│ └── inputFiles.lst
├── README.md
├── dist
├── assets
│ ├── @ctrl-f8748455.js
│ ├── @element-plus-4ca69592.js
│ ├── @floating-ui-8a8891e3.js
│ ├── @highlightjs-e10ea536.js
│ ├── @popperjs-c75af06c.js
│ ├── @vue-3886a262.js
│ ├── @vueuse-08bf1a74.js
│ ├── APlayer-2531d34a.css
│ ├── FileList-b91dafa9.js
│ ├── FileList-c4c5126f.css
│ ├── Framework-940079c4.css
│ ├── Framework-c5ca01e1.js
│ ├── Login-32a954d1.css
│ ├── Login-4bbba6f7.js
│ ├── Main-5153f850.js
│ ├── Main-ec927bfd.css
│ ├── QqLoginCallback-cfb92722.js
│ ├── Recycle-07db5704.js
│ ├── Recycle-ce24e1a7.css
│ ├── Share-14d41aec.css
│ ├── Share-204245cb.js
│ ├── Share-9d43d77f.js
│ ├── Share-d0d8740e.css
│ ├── ShareCheck-85e68768.css
│ ├── ShareCheck-f2626f6d.js
│ ├── SysSettings-04d2d718.css
│ ├── SysSettings-f51762ee.js
│ ├── UserList-72471675.js
│ ├── UserList-e2804a12.css
│ ├── aplayer-585df14e.js
│ ├── async-validator-10c6301d.js
│ ├── axios-4a70c6fc.js
│ ├── clipboard-65322c36.js
│ ├── dayjs-5d216acc.js
│ ├── docx-preview-8cc7001d.js
│ ├── dommatrix-4ed993c7.js
│ ├── dplayer-d4a41b2a.js
│ ├── element-plus-37cd7934.css
│ ├── element-plus-485a4a99.js
│ ├── escape-html-9626137c.js
│ ├── file-2f39022e.png
│ ├── highlight-ca5035c8.css
│ ├── highlight.js-6845818c.js
│ ├── iconfont-03347298.woff2
│ ├── iconfont-acdf2a30.ttf
│ ├── iconfont-c1f2ff3c.woff
│ ├── index-bba13761.css
│ ├── index-db517136.js
│ ├── js-md5-4754c8f0.js
│ ├── jszip-1f4bc9a3.js
│ ├── lodash-es-36eb724a.js
│ ├── lodash-unified-4ed993c7.js
│ ├── login_bg-6b1edf8c.jpg
│ ├── login_img-db08ed45.png
│ ├── memoize-one-297ddbcb.js
│ ├── music_cover-6176aee0.png
│ ├── no_data-8d6fee09.png
│ ├── normalize-wheel-es-ed76fb12.js
│ ├── pdfjs-dist-1ab6505b.js
│ ├── pdfjs-dist-2413a12f.css
│ ├── qq-8fddb348.png
│ ├── share_bg-0a430d8f.png
│ ├── spark-md5-66a43a5d.js
│ ├── vue-0ba3f033.js
│ ├── vue-clipboard3-6d269bab.js
│ ├── vue-cookies-fc2d14d9.js
│ ├── vue-pdf-embed-608804e8.js
│ ├── vue-router-6d9ab4b6.js
│ ├── vue3-pdfjs-6fbc090f.js
│ ├── web-streams-polyfill-4ed993c7.js
│ └── xlsx-74460a39.js
├── favicon.ico
├── hls.min.js
└── index.html
├── file
└── avatar
│ └── default_avatar.jpg
├── logs
├── easypan.log
└── easypan.log.20230828.0
└── sql
└── netdisk.sql
/.gitignore:
--------------------------------------------------------------------------------
1 | /Netdisk-pan/target/
2 | /logs/
3 | /file/
4 | /temp/
5 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # 默认忽略的文件
2 | /shelf/
3 | /workspace.xml
4 | # 基于编辑器的 HTTP 客户端请求
5 | /httpRequests/
6 | # Datasource local storage ignored files
7 | /dataSources/
8 | /dataSources.local.xml
9 |
--------------------------------------------------------------------------------
/.idea/Netdisk.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/.idea/dataSources.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | mysql.8
6 | true
7 | com.mysql.cj.jdbc.Driver
8 | jdbc:mysql://localhost:3306/netdisk
9 | $ProjectFileDir$
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
13 |
14 |
15 |
16 |
44 |
45 |
46 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/.idea/jarRepositories.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Netdisk-pan/Netdisk-pan.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/NetDiskPanApplication.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws;
2 |
3 | import org.mybatis.spring.annotation.MapperScan;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.scheduling.annotation.EnableAsync;
7 | import org.springframework.scheduling.annotation.EnableScheduling;
8 | import org.springframework.transaction.annotation.EnableTransactionManagement;
9 |
10 | /**
11 | * @author hsy
12 | * @date 2023/8/12
13 | */
14 | @EnableAsync //异步调用(大文件上传后异步调用组装起来)
15 | @SpringBootApplication(scanBasePackages = "xyz.kbws")
16 | @MapperScan(basePackages = {"xyz.kbws.mappers"})
17 | @EnableTransactionManagement //事务生效
18 | @EnableScheduling //定时任务
19 | public class NetDiskPanApplication {
20 | public static void main(String[] args) {
21 | SpringApplication.run(NetDiskPanApplication.class, args);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/annotation/GlobalInterceptor.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.annotation;
2 |
3 | import org.springframework.web.bind.annotation.Mapping;
4 | import java.lang.annotation.*;
5 |
6 | @Target({ElementType.METHOD})
7 | @Retention(RetentionPolicy.RUNTIME)
8 | @Documented
9 | @Mapping
10 | public @interface GlobalInterceptor {
11 |
12 | /**
13 | * 校验参数
14 | * @return
15 | */
16 | boolean checkParams() default false;
17 |
18 | /**
19 | * 校验登录
20 | * @return
21 | */
22 | boolean checkLogin() default true;
23 |
24 | /**
25 | * 校验管理员
26 | * @return
27 | */
28 | boolean checkAdmin() default false;
29 | }
30 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/annotation/VerifyParam.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.annotation;
2 |
3 | import xyz.kbws.entity.enums.VerifyRegexEnum;
4 |
5 | import java.lang.annotation.ElementType;
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.RetentionPolicy;
8 | import java.lang.annotation.Target;
9 |
10 | @Retention(RetentionPolicy.RUNTIME)
11 | @Target({ElementType.PARAMETER,ElementType.FIELD})
12 | public @interface VerifyParam {
13 |
14 | int min() default -1;
15 |
16 | int max() default -1;
17 |
18 | boolean required() default false;
19 |
20 | VerifyRegexEnum regex() default VerifyRegexEnum.NO;
21 | }
22 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/component/RedisComponent.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.component;
2 |
3 | import org.springframework.stereotype.Component;
4 | import xyz.kbws.component.RedisUtils;
5 | import xyz.kbws.entity.constants.Constants;
6 | import xyz.kbws.entity.dto.DownloadFileDto;
7 | import xyz.kbws.entity.dto.SysSettingsDto;
8 | import xyz.kbws.entity.dto.UserSpaceDto;
9 | import xyz.kbws.entity.po.FileInfo;
10 | import xyz.kbws.entity.po.UserInfo;
11 | import xyz.kbws.entity.query.FileInfoQuery;
12 | import xyz.kbws.entity.query.UserInfoQuery;
13 | import xyz.kbws.mappers.FileInfoMapper;
14 | import xyz.kbws.mappers.UserInfoMapper;
15 |
16 | import javax.annotation.Resource;
17 |
18 | @Component("redisComponent")
19 | public class RedisComponent {
20 |
21 | @Resource
22 | private RedisUtils redisUtils;
23 |
24 | @Resource
25 | private UserInfoMapper userInfoMapper;
26 |
27 | @Resource
28 | private FileInfoMapper fileInfoMapper;
29 |
30 | /**
31 | * 获取系统设置
32 | *
33 | * @return
34 | */
35 | public SysSettingsDto getSysSettingsDto() {
36 | SysSettingsDto sysSettingsDto = (SysSettingsDto) redisUtils.get(Constants.REDIS_KEY_SYS_SETTING);
37 | if (sysSettingsDto == null) {
38 | sysSettingsDto = new SysSettingsDto();
39 | redisUtils.set(Constants.REDIS_KEY_SYS_SETTING, sysSettingsDto);
40 | }
41 | return sysSettingsDto;
42 | }
43 |
44 | /**
45 | * 保存设置
46 | *
47 | * @param sysSettingsDto
48 | */
49 | public void saveSysSettingsDto(SysSettingsDto sysSettingsDto) {
50 | redisUtils.set(Constants.REDIS_KEY_SYS_SETTING, sysSettingsDto);
51 | }
52 |
53 | public void saveDownloadCode(String code, DownloadFileDto downloadFileDto) {
54 | redisUtils.setex(Constants.REDIS_KEY_DOWNLOAD + code, downloadFileDto, Constants.REDIS_KEY_EXPIRES_FIVE_MIN);
55 | }
56 |
57 | public DownloadFileDto getDownloadCode(String code) {
58 | return (DownloadFileDto) redisUtils.get(Constants.REDIS_KEY_DOWNLOAD + code);
59 | }
60 |
61 |
62 | /**
63 | * 获取用户使用的空间
64 | *
65 | * @param userId
66 | * @return
67 | */
68 | public UserSpaceDto getUserSpaceUse(String userId) {
69 | UserSpaceDto spaceDto = (UserSpaceDto) redisUtils.get(Constants.REDIS_KEY_USER_SPACE_USE + userId);
70 | if (null == spaceDto) {
71 | spaceDto = new UserSpaceDto();
72 | Long useSpace = this.fileInfoMapper.selectUseSpace(userId);
73 | spaceDto.setUseSpace(useSpace);
74 | spaceDto.setTotalSpace(getSysSettingsDto().getUserInitUseSpace() * Constants.MB);
75 | redisUtils.setex(Constants.REDIS_KEY_USER_SPACE_USE + userId, spaceDto, Constants.REDIS_KEY_EXPIRES_DAY);
76 | }
77 | return spaceDto;
78 | }
79 |
80 | /**
81 | * 保存已使用的空间
82 | *
83 | * @param userId
84 | */
85 | public void saveUserSpaceUse(String userId, UserSpaceDto userSpaceDto) {
86 | redisUtils.setex(Constants.REDIS_KEY_USER_SPACE_USE + userId, userSpaceDto, Constants.REDIS_KEY_EXPIRES_DAY);
87 | }
88 |
89 | public UserSpaceDto resetUserSpaceUse(String userId) {
90 | UserSpaceDto spaceDto = new UserSpaceDto();
91 | Long useSpace = this.fileInfoMapper.selectUseSpace(userId);
92 | spaceDto.setUseSpace(useSpace);
93 |
94 | UserInfo userInfo = this.userInfoMapper.selectByUserId(userId);
95 | spaceDto.setTotalSpace(userInfo.getTotalSpace());
96 | redisUtils.setex(Constants.REDIS_KEY_USER_SPACE_USE + userId, spaceDto, Constants.REDIS_KEY_EXPIRES_DAY);
97 | return spaceDto;
98 | }
99 |
100 | //保存文件临时大小
101 | public void saveFileTempSize(String userId, String fileId, Long fileSize) {
102 | Long currentSize = getFileTempSize(userId, fileId);
103 | redisUtils.setex(Constants.REDIS_KEY_USER_FILE_TEMP_SIZE + userId + fileId, currentSize + fileSize,
104 | Constants.REDIS_KEY_EXPIRES_ONE_HOUR);
105 | }
106 |
107 | public Long getFileTempSize(String userId, String fileId) {
108 | Long currentSize = getFileSizeFromRedis(Constants.REDIS_KEY_USER_FILE_TEMP_SIZE + userId + fileId);
109 | return currentSize;
110 | }
111 |
112 | private Long getFileSizeFromRedis(String key) {
113 | Object sizeObj = redisUtils.get(key);
114 | if (sizeObj == null) {
115 | return 0L;
116 | }
117 | if (sizeObj instanceof Integer) {
118 | return ((Integer) sizeObj).longValue();
119 | } else if (sizeObj instanceof Long) {
120 | return (Long) sizeObj;
121 | }
122 |
123 | return 0L;
124 | }
125 | }
126 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/component/RedisUtils.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.component;
2 |
3 | import org.slf4j.Logger;
4 | import org.slf4j.LoggerFactory;
5 | import org.springframework.data.redis.core.RedisTemplate;
6 | import org.springframework.stereotype.Component;
7 | import org.springframework.util.CollectionUtils;
8 |
9 | import javax.annotation.Resource;
10 | import java.util.Collection;
11 | import java.util.concurrent.TimeUnit;
12 |
13 | @Component("redisUtils")
14 | public class RedisUtils {
15 | @Resource
16 | private RedisTemplate redisTemplate;
17 |
18 | private static final Logger logger = LoggerFactory.getLogger(RedisUtils.class);
19 |
20 | /**
21 | * 获取值
22 | * @param key
23 | * @return
24 | */
25 | public V get(String key){
26 | return key == null ? null : redisTemplate.opsForValue().get(key);
27 | }
28 |
29 | /**
30 | * 普通缓存放入
31 | * @param key
32 | * @param value
33 | * @return
34 | */
35 | public boolean set(String key, V value){
36 | try {
37 | redisTemplate.opsForValue().set(key, value);
38 | return true;
39 | }catch (Exception e){
40 | logger.error("设置redisKey:{},value:{}失败",key, value);
41 | return false;
42 | }
43 | }
44 |
45 | /**
46 | * 普通缓存放入并设置时间
47 | * @param key 键
48 | * @param value 值
49 | * @param time 时间(秒)time要大于0 如果time小于等于0则设置无限期
50 | * @return true成功 false失败
51 | */
52 | public boolean setex(String key, V value, long time){
53 | try {
54 | if (time>0){
55 | redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS);
56 | }else {
57 | set(key, value);
58 | }
59 | return true;
60 | }catch (Exception e){
61 | logger.error("设置redisKey:{},value:{}失败",key, value);
62 | return false;
63 | }
64 | }
65 |
66 | /**
67 | * 删除缓存
68 | * @param key 可以传一个也可以传多个
69 | */
70 | public void delete(String... key){
71 | if (key != null && key.length > 0){
72 | if (key.length==1){
73 | redisTemplate.delete(key[0]);
74 | }else {
75 | redisTemplate.delete((Collection) CollectionUtils.arrayToList(key));
76 | }
77 | }
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/controller/ABaseController.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.controller;
2 | import org.slf4j.Logger;
3 | import org.slf4j.LoggerFactory;
4 | import xyz.kbws.entity.constants.Constants;
5 | import xyz.kbws.entity.dto.SessionShareDto;
6 | import xyz.kbws.entity.dto.SessionWebUserDto;
7 | import xyz.kbws.entity.enums.ResponseCodeEnum;
8 | import xyz.kbws.entity.vo.PaginationResultVO;
9 | import xyz.kbws.entity.vo.ResponseVO;
10 | import xyz.kbws.exception.BusinessException;
11 | import xyz.kbws.utils.CopyTools;
12 | import xyz.kbws.utils.StringTools;
13 |
14 | import javax.servlet.http.HttpServletResponse;
15 | import javax.servlet.http.HttpSession;
16 | import java.io.File;
17 | import java.io.FileInputStream;
18 | import java.io.IOException;
19 | import java.io.OutputStream;
20 |
21 |
22 | public class ABaseController {
23 |
24 | protected static final Logger logger = LoggerFactory.getLogger(ABaseController.class);
25 |
26 | protected static final String STATUC_SUCCESS = "success";
27 |
28 | protected static final String STATUC_ERROR = "error";
29 |
30 | protected ResponseVO getSuccessResponseVO(T t) {
31 | ResponseVO responseVO = new ResponseVO<>();
32 | responseVO.setStatus(STATUC_SUCCESS);
33 | responseVO.setCode(ResponseCodeEnum.CODE_200.getCode());
34 | responseVO.setInfo(ResponseCodeEnum.CODE_200.getMsg());
35 | responseVO.setData(t);
36 | return responseVO;
37 | }
38 |
39 | protected ResponseVO getBusinessErrorResponseVO(BusinessException e, T t) {
40 | ResponseVO vo = new ResponseVO();
41 | vo.setStatus(STATUC_ERROR);
42 | if (e.getCode() == null) {
43 | vo.setCode(ResponseCodeEnum.CODE_600.getCode());
44 | } else {
45 | vo.setCode(e.getCode());
46 | }
47 | vo.setInfo(e.getMessage());
48 | vo.setData(t);
49 | return vo;
50 | }
51 |
52 | protected ResponseVO getServerErrorResponseVO(T t) {
53 | ResponseVO vo = new ResponseVO();
54 | vo.setStatus(STATUC_ERROR);
55 | vo.setCode(ResponseCodeEnum.CODE_500.getCode());
56 | vo.setInfo(ResponseCodeEnum.CODE_500.getMsg());
57 | vo.setData(t);
58 | return vo;
59 | }
60 |
61 | protected PaginationResultVO convert2PaginationVO(PaginationResultVO result, Class tClass){
62 | PaginationResultVO resultVO = new PaginationResultVO<>();
63 | resultVO.setList(CopyTools.copyList(result.getList(), tClass));
64 | resultVO.setPageNo(result.getPageNo());
65 | resultVO.setPageSize(result.getPageSize());
66 | resultVO.setPageTotal(result.getPageTotal());
67 | resultVO.setTotalCount(result.getTotalCount());
68 | return resultVO;
69 | }
70 |
71 | protected void readFile(HttpServletResponse response, String filePath){
72 | if (!StringTools.pathIsOk(filePath)){
73 | return;
74 | }
75 | OutputStream out = null;
76 | FileInputStream in = null;
77 | try {
78 | File file = new File(filePath);
79 | if (!file.exists()){
80 | return;
81 | }
82 | in = new FileInputStream(file);
83 | byte[] byteData = new byte[1024];
84 | out = response.getOutputStream();
85 | int len = 0;
86 | while ((len = in.read(byteData)) != -1){
87 | out.write(byteData, 0 ,len);
88 | }
89 | out.flush();
90 | }catch (Exception e){
91 | logger.error("读取文件异常",e);
92 | }finally {
93 | if (out != null){
94 | try {
95 | out.close();
96 | }catch (IOException e){
97 | logger.error("IO异常",e);
98 | }
99 | }
100 | if (in != null){
101 | try {
102 | in.close();
103 | }catch (IOException e){
104 | logger.error("IO异常",e);
105 | }
106 | }
107 | }
108 | }
109 |
110 | protected SessionWebUserDto getUserInfoFromSession(HttpSession session){
111 | SessionWebUserDto sessionWebUserDto = (SessionWebUserDto) session.getAttribute(Constants.SESSION_KEY);
112 | return sessionWebUserDto;
113 | }
114 |
115 | protected SessionShareDto getSessionShareFromSession(HttpSession session, String shareId) {
116 | SessionShareDto sessionShareDto = (SessionShareDto) session.getAttribute(Constants.SESSION_SHARE_KEY + shareId);
117 | return sessionShareDto;
118 | }
119 | }
120 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/controller/AGlobalExceptionHandlerController.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.controller;
2 | import xyz.kbws.entity.enums.ResponseCodeEnum;
3 | import xyz.kbws.entity.vo.ResponseVO;
4 | import xyz.kbws.exception.BusinessException;
5 |
6 |
7 | import org.slf4j.Logger;
8 | import org.slf4j.LoggerFactory;
9 | import org.springframework.dao.DuplicateKeyException;
10 | import org.springframework.validation.BindException;
11 | import org.springframework.web.bind.annotation.ExceptionHandler;
12 | import org.springframework.web.bind.annotation.RestControllerAdvice;
13 | import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException;
14 | import org.springframework.web.servlet.NoHandlerFoundException;
15 |
16 | import javax.servlet.http.HttpServletRequest;
17 |
18 | @RestControllerAdvice
19 | public class AGlobalExceptionHandlerController extends ABaseController {
20 |
21 | private static final Logger logger = LoggerFactory.getLogger(AGlobalExceptionHandlerController.class);
22 |
23 | @ExceptionHandler(value = Exception.class)
24 | Object handleException(Exception e, HttpServletRequest request) {
25 | logger.error("请求错误,请求地址{},错误信息:", request.getRequestURL(), e);
26 | ResponseVO ajaxResponse = new ResponseVO();
27 | //404
28 | if (e instanceof NoHandlerFoundException) {
29 | ajaxResponse.setCode(ResponseCodeEnum.CODE_404.getCode());
30 | ajaxResponse.setInfo(ResponseCodeEnum.CODE_404.getMsg());
31 | ajaxResponse.setStatus(STATUC_ERROR);
32 | } else if (e instanceof BusinessException) {
33 | //业务错误
34 | BusinessException biz = (BusinessException) e;
35 | ajaxResponse.setCode(biz.getCode() == null ? ResponseCodeEnum.CODE_600.getCode() : biz.getCode());
36 | ajaxResponse.setInfo(biz.getMessage());
37 | ajaxResponse.setStatus(STATUC_ERROR);
38 | } else if (e instanceof BindException|| e instanceof MethodArgumentTypeMismatchException) {
39 | //参数类型错误
40 | ajaxResponse.setCode(ResponseCodeEnum.CODE_600.getCode());
41 | ajaxResponse.setInfo(ResponseCodeEnum.CODE_600.getMsg());
42 | ajaxResponse.setStatus(STATUC_ERROR);
43 | } else if (e instanceof DuplicateKeyException) {
44 | //主键冲突
45 | ajaxResponse.setCode(ResponseCodeEnum.CODE_601.getCode());
46 | ajaxResponse.setInfo(ResponseCodeEnum.CODE_601.getMsg());
47 | ajaxResponse.setStatus(STATUC_ERROR);
48 | } else {
49 | ajaxResponse.setCode(ResponseCodeEnum.CODE_500.getCode());
50 | ajaxResponse.setInfo(ResponseCodeEnum.CODE_500.getMsg());
51 | ajaxResponse.setStatus(STATUC_ERROR);
52 | }
53 | return ajaxResponse;
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/controller/EmailCodeController.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.controller;
2 |
3 | import java.util.List;
4 |
5 | import xyz.kbws.entity.query.EmailCodeQuery;
6 | import xyz.kbws.entity.po.EmailCode;
7 | import xyz.kbws.entity.vo.ResponseVO;
8 | import xyz.kbws.service.EmailCodeService;
9 | import org.springframework.web.bind.annotation.RequestBody;
10 | import org.springframework.web.bind.annotation.RequestMapping;
11 | import org.springframework.web.bind.annotation.RestController;
12 |
13 | import javax.annotation.Resource;
14 |
15 | /**
16 | * 邮箱验证码 Controller
17 | */
18 | @RestController("emailCodeController")
19 | @RequestMapping("/emailCode")
20 | public class EmailCodeController extends ABaseController{
21 |
22 | @Resource
23 | private EmailCodeService emailCodeService;
24 | /**
25 | * 根据条件分页查询
26 | */
27 | @RequestMapping("/loadDataList")
28 | public ResponseVO loadDataList(EmailCodeQuery query){
29 | return getSuccessResponseVO(emailCodeService.findListByPage(query));
30 | }
31 |
32 | /**
33 | * 新增
34 | */
35 | @RequestMapping("/add")
36 | public ResponseVO add(EmailCode bean) {
37 | emailCodeService.add(bean);
38 | return getSuccessResponseVO(null);
39 | }
40 |
41 | /**
42 | * 批量新增
43 | */
44 | @RequestMapping("/addBatch")
45 | public ResponseVO addBatch(@RequestBody List listBean) {
46 | emailCodeService.addBatch(listBean);
47 | return getSuccessResponseVO(null);
48 | }
49 |
50 | /**
51 | * 批量新增/修改
52 | */
53 | @RequestMapping("/addOrUpdateBatch")
54 | public ResponseVO addOrUpdateBatch(@RequestBody List listBean) {
55 | emailCodeService.addBatch(listBean);
56 | return getSuccessResponseVO(null);
57 | }
58 |
59 | /**
60 | * 根据EmailAndCode查询对象
61 | */
62 | @RequestMapping("/getEmailCodeByEmailAndCode")
63 | public ResponseVO getEmailCodeByEmailAndCode(String email,String code) {
64 | return getSuccessResponseVO(emailCodeService.getEmailCodeByEmailAndCode(email,code));
65 | }
66 |
67 | /**
68 | * 根据EmailAndCode修改对象
69 | */
70 | @RequestMapping("/updateEmailCodeByEmailAndCode")
71 | public ResponseVO updateEmailCodeByEmailAndCode(EmailCode bean,String email,String code) {
72 | emailCodeService.updateEmailCodeByEmailAndCode(bean,email,code);
73 | return getSuccessResponseVO(null);
74 | }
75 |
76 | /**
77 | * 根据EmailAndCode删除
78 | */
79 | @RequestMapping("/deleteEmailCodeByEmailAndCode")
80 | public ResponseVO deleteEmailCodeByEmailAndCode(String email,String code) {
81 | emailCodeService.deleteEmailCodeByEmailAndCode(email,code);
82 | return getSuccessResponseVO(null);
83 | }
84 | }
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/controller/RecycleController.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.controller;
2 |
3 | import org.springframework.web.bind.annotation.RequestMapping;
4 | import org.springframework.web.bind.annotation.RestController;
5 | import xyz.kbws.annotation.GlobalInterceptor;
6 | import xyz.kbws.annotation.VerifyParam;
7 | import xyz.kbws.entity.dto.SessionWebUserDto;
8 | import xyz.kbws.entity.enums.FileDelFlagEnum;
9 | import xyz.kbws.entity.query.FileInfoQuery;
10 | import xyz.kbws.entity.vo.FileInfoVO;
11 | import xyz.kbws.entity.vo.PaginationResultVO;
12 | import xyz.kbws.entity.vo.ResponseVO;
13 | import xyz.kbws.service.FileInfoService;
14 |
15 | import javax.annotation.Resource;
16 | import javax.servlet.http.HttpSession;
17 |
18 | @RestController("recycleController")
19 | @RequestMapping("/recycle")
20 | public class RecycleController extends ABaseController{
21 | @Resource
22 | private FileInfoService fileInfoService;
23 |
24 |
25 | @RequestMapping("/loadRecycleList")
26 | @GlobalInterceptor
27 | public ResponseVO loadRecycleList(HttpSession session, Integer pageNo, Integer pageSize){
28 | FileInfoQuery query = new FileInfoQuery();
29 | query.setPageSize(pageSize);
30 | query.setPageNo(pageNo);
31 | query.setUserId(getUserInfoFromSession(session).getUserId());
32 | query.setOrderBy("recovery_time desc");
33 | query.setDelFlag(FileDelFlagEnum.RECYCLE.getFlag());
34 | PaginationResultVO result = fileInfoService.findListByPage(query);
35 | return getSuccessResponseVO(convert2PaginationVO(result, FileInfoVO.class));
36 | }
37 |
38 | @RequestMapping("/recoverFile")
39 | @GlobalInterceptor
40 | public ResponseVO recoverFile(HttpSession session, @VerifyParam(required = true) String fileIds){
41 | SessionWebUserDto webUserDto = getUserInfoFromSession(session);
42 | fileInfoService.recoverFileBatch(webUserDto.getUserId(), fileIds);
43 | return getSuccessResponseVO(null);
44 | }
45 |
46 | @RequestMapping("/delFile")
47 | @GlobalInterceptor(checkParams = true)
48 | public ResponseVO delFile(HttpSession session, @VerifyParam(required = true) String fileIds) {
49 | SessionWebUserDto webUserDto = getUserInfoFromSession(session);
50 | fileInfoService.delFileBatch(webUserDto.getUserId(), fileIds,false);
51 | return getSuccessResponseVO(null);
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/controller/ShareController.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.controller;
2 |
3 | import org.springframework.web.bind.annotation.RequestMapping;
4 | import org.springframework.web.bind.annotation.RestController;
5 | import xyz.kbws.annotation.GlobalInterceptor;
6 | import xyz.kbws.annotation.VerifyParam;
7 | import xyz.kbws.entity.dto.SessionWebUserDto;
8 | import xyz.kbws.entity.po.FileShare;
9 | import xyz.kbws.entity.query.FileShareQuery;
10 | import xyz.kbws.entity.vo.PaginationResultVO;
11 | import xyz.kbws.entity.vo.ResponseVO;
12 | import xyz.kbws.service.FileShareService;
13 |
14 | import javax.annotation.Resource;
15 | import javax.servlet.http.HttpSession;
16 |
17 | @RestController("shareController")
18 | @RequestMapping("/share")
19 | public class ShareController extends ABaseController{
20 | @Resource
21 | private FileShareService fileShareService;
22 |
23 | @RequestMapping("/loadShareList")
24 | @GlobalInterceptor
25 | public ResponseVO loadShareList(HttpSession session, FileShareQuery query){
26 | query.setOrderBy("share_time desc");
27 | SessionWebUserDto userDto = getUserInfoFromSession(session);
28 | query.setUserId(userDto.getUserId());
29 | query.setQueryFileName(true);
30 | PaginationResultVO resultVO = this.fileShareService.findListByPage(query);
31 | return getSuccessResponseVO(resultVO);
32 | }
33 |
34 | @RequestMapping("/shareFile")
35 | @GlobalInterceptor(checkParams = true)
36 | public ResponseVO shareFile(HttpSession session,
37 | @VerifyParam(required = true) String fileId,
38 | @VerifyParam(required = true) Integer validType,
39 | String code) {
40 | SessionWebUserDto userDto = getUserInfoFromSession(session);
41 | FileShare share = new FileShare();
42 | share.setFileId(fileId);
43 | share.setValidType(validType);
44 | share.setCode(code);
45 | share.setUserId(userDto.getUserId());
46 | fileShareService.saveShare(share);
47 | return getSuccessResponseVO(share);
48 | }
49 |
50 | @RequestMapping("/cancelShare")
51 | @GlobalInterceptor(checkParams = true)
52 | public ResponseVO cancelShare(HttpSession session, @VerifyParam(required = true) String shareIds) {
53 | SessionWebUserDto userDto = getUserInfoFromSession(session);
54 | fileShareService.deleteFileShareBatch(shareIds.split(","), userDto.getUserId());
55 | return getSuccessResponseVO(null);
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/config/AppConfig.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.config;
2 |
3 | import lombok.Data;
4 | import org.springframework.beans.factory.annotation.Value;
5 | import org.springframework.stereotype.Component;
6 |
7 | @Data
8 | @Component("appConfig")
9 | public class AppConfig {
10 | @Value("${spring.mail.username}")
11 | private String sendUserName;
12 |
13 | @Value("${admin.emails:}")
14 | private String adminEmails;
15 |
16 | @Value("${project.folder:}")
17 | private String projectFolder;
18 |
19 | //QQ登录相关
20 | @Value("${qq.app.id}")
21 | private String qqAppId;
22 |
23 | @Value("${qq.app.key}")
24 | private String qqAppKey;
25 |
26 | @Value("${qq.url.authorization}")
27 | private String qqUrlAuthorization;
28 |
29 | @Value("${qq.url.access.token}")
30 | private String qqUrlAccessToken;
31 |
32 | @Value("${qq.url.openid}")
33 | private String qqUrlOpenId;
34 |
35 | @Value("${qq.url.user.info}")
36 | private String qqUrlUserInfo;
37 |
38 | @Value("${qq.url.redirect}")
39 | private String qqUrlRedirect;
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/config/RedisConfig.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.config;
2 |
3 | import org.springframework.context.annotation.Bean;
4 | import org.springframework.context.annotation.Configuration;
5 | import org.springframework.data.redis.connection.RedisConnectionFactory;
6 | import org.springframework.data.redis.core.RedisTemplate;
7 | import org.springframework.data.redis.serializer.RedisSerializer;
8 |
9 | @Configuration
10 | public class RedisConfig {
11 |
12 | @Bean
13 | public RedisTemplate redisTemplate(RedisConnectionFactory factory){
14 | RedisTemplate template = new RedisTemplate<>();
15 | template.setConnectionFactory(factory);
16 | // 设置key的序列化方式
17 | template.setKeySerializer(RedisSerializer.string());
18 | // 设置value的序列化方式
19 | template.setValueSerializer(RedisSerializer.json());
20 | // 设置hash的key的序列化方式
21 | template.setHashKeySerializer(RedisSerializer.string());
22 | // 设置hash的value的序列化方式
23 | template.setHashValueSerializer(RedisSerializer.json());
24 | template.afterPropertiesSet();
25 | return template;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/constants/Constants.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.constants;
2 |
3 | public class Constants {
4 | public static final Integer ZERO = 0;
5 | public static final String ZERO_STR = "0";
6 | public static final Integer LENGTH_5 = 5;
7 | public static final Integer LENGTH_10 = 10;
8 | public static final Integer LENGTH_15 = 15;
9 | public static final Integer LENGTH_20 = 20;
10 | public static final Integer LENGTH_30 = 30;
11 | public static final Integer LENGTH_50 = 50;
12 | public static final Integer LENGTH_150 = 150;
13 | public static final String CHECK_CODE_KEY = "check_code_key";
14 | public static final String CHECK_CODE_KEY_EMAIL = "check_code_key_email";
15 | public static final String FILE_FOLDER_FILE = "/file/";
16 | public static final String FILE_FOLDER_AVATAR_NAME = "avatar/";
17 | public static final String AVATAR_SUFFIX = ".jpg";
18 | public static final String IMAGE_PNG_SUFFIX = ".png";
19 | public static final String FILE_FOLDER_TEMP = "/temp/";
20 | public static final String AVATAR_DEFAULT = "default_avatar.jpg";
21 | public static final Long MB = 1024*1024L;
22 | public static final String REDIS_KEY_SYS_SETTING = "netdisk:syssetting:";
23 | public static final String REDIS_KEY_USER_SPACE_USE = "netdisk:user:spaceuse:";
24 | public static final String REDIS_KEY_DOWNLOAD = "netdisk:download:";
25 | public static final String SESSION_KEY = "session_key";
26 | public static final Integer REDIS_KEY_EXPIRES_ONE_MIN = 60;
27 | public static final Integer REDIS_KEY_EXPIRES_DAY = REDIS_KEY_EXPIRES_ONE_MIN * 60 * 24;
28 | public static final Integer REDIS_KEY_EXPIRES_ONE_HOUR = REDIS_KEY_EXPIRES_ONE_MIN * 60;
29 | public static final Integer REDIS_KEY_EXPIRES_FIVE_MIN = REDIS_KEY_EXPIRES_ONE_MIN * 5;
30 | public static final String REDIS_KEY_USER_FILE_TEMP_SIZE = "netdisk:user:file:temp:";
31 | public static final String VIEW_OBJ_RESULT_KEY = "result";
32 | public static final String TS_NAME = "index.ts";
33 | public static final String M3U8_NAME = "index.m3u8";
34 | public static final String SESSION_SHARE_KEY = "session_share_key_";
35 | }
36 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/dto/DownloadFileDto.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.dto;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | @Data
8 | @AllArgsConstructor
9 | @NoArgsConstructor
10 | public class DownloadFileDto {
11 | private String downloadCode;
12 | private String fileId;
13 | private String fileName;
14 | private String filePath;
15 | }
16 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/dto/QQInfoDto.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.dto;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | @Data
8 | @NoArgsConstructor
9 | @AllArgsConstructor
10 | public class QQInfoDto {
11 | private Integer ret;
12 | private String msg;
13 | private String nickName;
14 | private String figureurl_qq_1;
15 | private String figureurl_qq_2;
16 | private String gender;
17 | }
18 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/dto/SessionShareDto.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.dto;
2 |
3 | import java.util.Date;
4 |
5 | public class SessionShareDto {
6 | private String shareId;
7 | private String shareUserId;
8 | private Date expireTime;
9 | private String fileId;
10 |
11 | public String getShareId() {
12 | return shareId;
13 | }
14 |
15 | public void setShareId(String shareId) {
16 | this.shareId = shareId;
17 | }
18 |
19 | public String getShareUserId() {
20 | return shareUserId;
21 | }
22 |
23 | public void setShareUserId(String shareUserId) {
24 | this.shareUserId = shareUserId;
25 | }
26 |
27 | public Date getExpireTime() {
28 | return expireTime;
29 | }
30 |
31 | public void setExpireTime(Date expireTime) {
32 | this.expireTime = expireTime;
33 | }
34 |
35 | public String getFileId() {
36 | return fileId;
37 | }
38 |
39 | public void setFileId(String fileId) {
40 | this.fileId = fileId;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/dto/SessionWebUserDto.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.dto;
2 |
3 |
4 | public class SessionWebUserDto {
5 | private String nickName;
6 | private String userId;
7 | private Boolean isAdmin;
8 | private String avatar;
9 |
10 | public String getNickName() {
11 | return nickName;
12 | }
13 |
14 | public void setNickName(String nickName) {
15 | this.nickName = nickName;
16 | }
17 |
18 | public String getUserId() {
19 | return userId;
20 | }
21 |
22 | public void setUserId(String userId) {
23 | this.userId = userId;
24 | }
25 |
26 | public Boolean getAdmin() {
27 | return isAdmin;
28 | }
29 |
30 | public void setAdmin(Boolean admin) {
31 | isAdmin = admin;
32 | }
33 |
34 | public String getAvatar() {
35 | return avatar;
36 | }
37 |
38 | public void setAvatar(String avatar) {
39 | this.avatar = avatar;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/dto/SysSettingsDto.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.dto;
2 |
3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4 |
5 | import java.io.Serializable;
6 |
7 | @JsonIgnoreProperties(ignoreUnknown = true)
8 | public class SysSettingsDto implements Serializable {
9 | private String registerMailTitle = "邮箱验证码";
10 | private String registerEmailContent = "您好,您的邮箱验证码是:%s,15分钟内有效";
11 | private Integer userInitUseSpace = 5;
12 |
13 | public String getRegisterMailTitle() {
14 | return registerMailTitle;
15 | }
16 |
17 | public void setRegisterMailTitle(String registerMailTitle) {
18 | this.registerMailTitle = registerMailTitle;
19 | }
20 |
21 | public String getRegisterEmailContent() {
22 | return registerEmailContent;
23 | }
24 |
25 | public void setRegisterEmailContent(String registerEmailContent) {
26 | this.registerEmailContent = registerEmailContent;
27 | }
28 |
29 | public Integer getUserInitUseSpace() {
30 | return userInitUseSpace;
31 | }
32 |
33 | public void setUserInitUseSpace(Integer userInitUseSpace) {
34 | this.userInitUseSpace = userInitUseSpace;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/dto/UploadResultDto.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.dto;
2 |
3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4 | import lombok.Data;
5 |
6 | import java.io.Serializable;
7 |
8 | @JsonIgnoreProperties(ignoreUnknown = true)
9 | @Data
10 | public class UploadResultDto implements Serializable {
11 | private String fileId;
12 | private String status;
13 | }
14 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/dto/UserSpaceDto.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.dto;
2 |
3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4 |
5 | import java.io.Serializable;
6 |
7 | @JsonIgnoreProperties(ignoreUnknown = true)
8 | public class UserSpaceDto implements Serializable {
9 | private Long useSpace;
10 | private Long totalSpace;
11 |
12 | public Long getUseSpace() {
13 | return useSpace;
14 | }
15 |
16 | public void setUseSpace(Long useSpace) {
17 | this.useSpace = useSpace;
18 | }
19 |
20 | public Long getTotalSpace() {
21 | return totalSpace;
22 | }
23 |
24 | public void setTotalSpace(Long totalSpace) {
25 | this.totalSpace = totalSpace;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/enums/DateTimePatternEnum.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.enums;
2 |
3 |
4 | public enum DateTimePatternEnum {
5 | YYYY_MM_DD_HH_MM_SS("yyyy-MM-dd HH:mm:ss"),
6 | YYYY_MM_DD("yyyy-MM-dd"),
7 | YYYYMM("yyyyMM");
8 |
9 | private String pattern;
10 |
11 | DateTimePatternEnum(String pattern) {
12 | this.pattern = pattern;
13 | }
14 |
15 | public String getPattern() {
16 | return pattern;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/enums/FileCategoryEnum.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.enums;
2 |
3 | public enum FileCategoryEnum {
4 | VIDEO(1,"video","视频"),
5 | MUSIC(2,"music","音频"),
6 | IMAGE(3,"image","图片"),
7 | DOC(4,"doc","文档"),
8 | OTHERS(5,"others","其他");
9 |
10 | private Integer category;
11 | private String code;
12 | private String desc;
13 |
14 | FileCategoryEnum(Integer category, String code, String desc){
15 | this.category = category;
16 | this.code = code;
17 | this.desc = desc;
18 | }
19 |
20 | public static FileCategoryEnum getByCode(String code){
21 | for (FileCategoryEnum item : FileCategoryEnum.values()){
22 | if (item.getCode().equals(code)){
23 | return item;
24 | }
25 | }
26 | return null;
27 | }
28 |
29 | public Integer getCategory() {
30 | return category;
31 | }
32 |
33 | public String getCode() {
34 | return code;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/enums/FileDelFlagEnum.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.enums;
2 |
3 | public enum FileDelFlagEnum {
4 | DEL(0,"删除"),
5 | RECYCLE(1,"回收站"),
6 | USING(2,"使用中");
7 |
8 | private Integer flag;
9 | private String desc;
10 |
11 | FileDelFlagEnum(Integer flag, String desc){
12 | this.flag = flag;
13 | this.desc = desc;
14 | }
15 |
16 | public Integer getFlag() {
17 | return flag;
18 | }
19 |
20 | public String getDesc() {
21 | return desc;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/enums/FileFolderTypeEnum.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.enums;
2 |
3 | public enum FileFolderTypeEnum {
4 | FILE(0,"文档"),
5 | FOLDER(1,"目录");
6 |
7 | private Integer type;
8 | private String desc;
9 |
10 | FileFolderTypeEnum(Integer type, String desc){
11 | this.type = type;
12 | this.desc = desc;
13 | }
14 |
15 | public Integer getType() {
16 | return type;
17 | }
18 |
19 | public String getDesc() {
20 | return desc;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/enums/FileStatusEnum.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.enums;
2 |
3 | public enum FileStatusEnum {
4 | TRANSFER(0,"转码中"),
5 | TRANSFER_FAIL(1,"转码失败"),
6 | USING(2,"使用中");
7 |
8 | private Integer status;
9 | private String desc;
10 |
11 | FileStatusEnum(Integer status, String desc){
12 | this.status = status;
13 | this.desc = desc;
14 | }
15 |
16 | public Integer getStatus() {
17 | return status;
18 | }
19 |
20 | public String getDesc() {
21 | return desc;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/enums/FileTypeEnum.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.enums;
2 |
3 | import org.apache.commons.lang3.ArrayUtils;
4 |
5 | public enum FileTypeEnum {
6 | //1.视频 2.音频 3.图片 4.PDF 5.Word 6.Excel 7.TXT 8.Code 9.ZIP 10.其它文件
7 | VIDEO(FileCategoryEnum.VIDEO, 1, new String[]{".mp4",".avi",".rmvb",".mkv",".mov"},"视频"),
8 | MUSIC(FileCategoryEnum.MUSIC, 2, new String[]{".mp3",".wav",".wma",".mp2",".flac",".midi",".ra",
9 | ".ape",".aac",".cda"},"音频"),
10 | IMAGE(FileCategoryEnum.IMAGE, 3, new String[]{".jpeg",".jpg",".png",".gif",".bmp",".dds",".psd",
11 | ".pdt",".webp",".xmp",".svg",".tiff"},"图片"),
12 | PDF(FileCategoryEnum.DOC, 4, new String[]{".pdf"},"PDF"),
13 | WORD(FileCategoryEnum.DOC, 5, new String[]{".doc",".docx"},"Word"),
14 | EXCEL(FileCategoryEnum.DOC, 6, new String[]{".xlsx",".xls"},"Excel"),
15 | TXT(FileCategoryEnum.DOC, 7, new String[]{".txt"},"txt文本"),
16 | PROGRAME(FileCategoryEnum.OTHERS, 8, new String[]{".h",".c",".hpp",".hpp",".hxx",".cpp",".cc",
17 | ".c++",".cxx", ".m",".o",".s",".dll",".cs",".java",".class",".js",".ts",".scss",".css",".vue",
18 | ".jsx",".sql",".md",".json",".html",".xml",".py",".go",".rs"},"CODE"),
19 | ZIP(FileCategoryEnum.OTHERS, 9, new String[]{".rar",".zip",".7z",".cab",".arj",".lzh",".tar",".gz",
20 | ".ace",".uue",".bz",".jar",".iso","mpq"},"压缩包"),
21 | OTHERS(FileCategoryEnum.OTHERS, 10, new String[]{".mp4",".avi",".rmvb",".mkv",".mov"},"其它");
22 |
23 | private FileCategoryEnum category;
24 | private Integer type;
25 | private String[] suffixs;
26 | private String desc;
27 |
28 | FileTypeEnum(FileCategoryEnum category, Integer type, String[] suffixs, String desc){
29 | this.category = category;
30 | this.type = type;
31 | this.suffixs = suffixs;
32 | this.desc = desc;
33 | }
34 |
35 | public static FileTypeEnum getFileTypeBySuffix(String suffix){
36 | for (FileTypeEnum item : FileTypeEnum.values()){
37 | if (ArrayUtils.contains(item.getSuffixs(), suffix)){
38 | return item;
39 | }
40 | }
41 | return FileTypeEnum.OTHERS;
42 | }
43 |
44 | public static FileTypeEnum getByType(Integer type){
45 | for (FileTypeEnum item : FileTypeEnum.values()){
46 | if (item.getType().equals(type)){
47 | return item;
48 | }
49 | }
50 | return null;
51 | }
52 |
53 | public FileCategoryEnum getCategory() {
54 | return category;
55 | }
56 |
57 | public Integer getType() {
58 | return type;
59 | }
60 |
61 | public String[] getSuffixs() {
62 | return suffixs;
63 | }
64 |
65 | public String getDesc() {
66 | return desc;
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/enums/PageSize.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.enums;
2 |
3 |
4 | public enum PageSize {
5 | SIZE15(15), SIZE20(20), SIZE30(30), SIZE40(40), SIZE50(50);
6 | int size;
7 |
8 | private PageSize(int size) {
9 | this.size = size;
10 | }
11 |
12 | public int getSize() {
13 | return this.size;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/enums/ResponseCodeEnum.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.enums;
2 |
3 |
4 | public enum ResponseCodeEnum {
5 | CODE_200(200, "请求成功"),
6 | CODE_404(404, "请求地址不存在"),
7 | CODE_600(600, "请求参数错误"),
8 | CODE_601(601, "信息已经存在"),
9 | CODE_500(500, "服务器返回错误,请联系管理员"),
10 | CODE_901(901,"登录超时,请重新登录"),
11 | CODE_902(902, "分享连接不存在,或者已失效"),
12 | CODE_903(903, "分享验证失效,请重新验证"),
13 | CODE_904(904, "网盘空间不足,请扩容");
14 |
15 | private Integer code;
16 |
17 | private String msg;
18 |
19 | ResponseCodeEnum(Integer code, String msg) {
20 | this.code = code;
21 | this.msg = msg;
22 | }
23 |
24 | public Integer getCode() {
25 | return code;
26 | }
27 |
28 | public String getMsg() {
29 | return msg;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/enums/ShareValidTypeEnum.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.enums;
2 |
3 |
4 | public enum ShareValidTypeEnum {
5 | DAY_1(0, 1, "1天"),
6 | DAY_7(1, 7, "7天"),
7 | DAY_30(2, 30, "30天"),
8 | FOREVER(3, -1, "永久有效");
9 |
10 | private Integer type;
11 | private Integer days;
12 | private String desc;
13 |
14 | ShareValidTypeEnum(Integer type, Integer days, String desc) {
15 | this.type = type;
16 | this.days = days;
17 | this.desc = desc;
18 | }
19 |
20 |
21 | public static ShareValidTypeEnum getByType(Integer type) {
22 | for (ShareValidTypeEnum typeEnums : ShareValidTypeEnum.values()) {
23 | if (typeEnums.getType().equals(type)) {
24 | return typeEnums;
25 | }
26 | }
27 | return null;
28 | }
29 |
30 | public Integer getType() {
31 | return type;
32 | }
33 |
34 | public Integer getDays() {
35 | return days;
36 | }
37 |
38 | public String getDesc() {
39 | return desc;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/enums/UploadStatusEnum.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.enums;
2 |
3 | public enum UploadStatusEnum {
4 | UPLOAD_SECONDS("upload_seconds","秒传"),
5 | UPLOADING("uploading","上传中"),
6 | UPLOAD_FINISH("upload_finish","上传完成");
7 |
8 | private String code;
9 | private String desc;
10 |
11 | UploadStatusEnum(String code, String desc){
12 | this.code = code;
13 | this.desc = desc;
14 | }
15 |
16 | public String getCode() {
17 | return code;
18 | }
19 |
20 | public String getDesc() {
21 | return desc;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/enums/UserStatusEnum.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.enums;
2 |
3 | public enum UserStatusEnum {
4 | DISABLE(0,"禁用"),
5 | ENABLE(1,"启用");
6 |
7 | private Integer status;
8 | private String desc;
9 |
10 | UserStatusEnum(Integer status, String desc){
11 | this.status = status;
12 | this.desc = desc;
13 | }
14 |
15 | public static UserStatusEnum getByStatus(Integer status){
16 | for (UserStatusEnum item : UserStatusEnum.values()) {
17 | if (item.getStatus().equals(status)){
18 | return item;
19 | }
20 | }
21 | return null;
22 | }
23 |
24 | public Integer getStatus() {
25 | return status;
26 | }
27 |
28 | public String getDesc() {
29 | return desc;
30 | }
31 |
32 | public void setDesc(String desc) {
33 | this.desc = desc;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/enums/VerifyRegexEnum.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.enums;
2 |
3 | public enum VerifyRegexEnum {
4 | NO("","不校验"),
5 | IP("([1-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3}","IP地址"),
6 | POSITIVE_INTEGER("^[0-9]*[0-9][0-9]*$","正整数"),
7 | NUMBER_LETTER_UNDER_LINE("^\\w+$","由数字、26个英文字母或者下划线组成的字符串"),
8 | EMAIL("^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$","邮箱"),
9 | PHONE("(1[0-9])\\d{9}$","手机号码"),
10 | COMMON("^[a-zA-Z0-9_\\u4e00-\\u9fa5]+$","数字,字母,中文,下划线"),
11 | PASSWORD("^(?=.*\\d)(?=.*[a-zA-Z])[\\da-zA-Z~!@#$%^&*_]{8,}","只能是数字、字母、特殊字符 8-18位"),
12 | ACCOUNT("^[0-9a-zA-Z_]{1,}$","字母开头,由数字、英文字母或者下划线组成"),
13 | MONEY("^[0-9]+(.[0-9]{1,2})?$","金额");
14 |
15 |
16 | private String regex;
17 | private String desc;
18 |
19 | VerifyRegexEnum(String regex, String desc){
20 | this.regex = regex;
21 | this.desc = desc;
22 | }
23 |
24 | public String getRegex() {
25 | return regex;
26 | }
27 |
28 | public String getDesc() {
29 | return desc;
30 | }
31 |
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/po/EmailCode.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.po;
2 |
3 | import com.fasterxml.jackson.annotation.JsonIgnore;
4 | import java.util.Date;
5 | import xyz.kbws.entity.enums.DateTimePatternEnum;
6 | import xyz.kbws.utils.DateUtil;
7 | import com.fasterxml.jackson.annotation.JsonFormat;
8 | import org.springframework.format.annotation.DateTimeFormat;
9 |
10 | import java.io.Serializable;
11 |
12 |
13 | /**
14 | * 邮箱验证码
15 | */
16 | public class EmailCode implements Serializable {
17 |
18 |
19 | /**
20 | * 邮箱
21 | */
22 | private String email;
23 |
24 | /**
25 | * 编号
26 | */
27 | private String code;
28 |
29 | /**
30 | * 创建时间
31 | */
32 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
33 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
34 | private Date createTime;
35 |
36 | /**
37 | * 0:未使用 1:已使用
38 | */
39 | private Integer status;
40 |
41 |
42 | public void setEmail(String email){
43 | this.email = email;
44 | }
45 |
46 | public String getEmail(){
47 | return this.email;
48 | }
49 |
50 | public void setCode(String code){
51 | this.code = code;
52 | }
53 |
54 | public String getCode(){
55 | return this.code;
56 | }
57 |
58 | public void setCreateTime(Date createTime){
59 | this.createTime = createTime;
60 | }
61 |
62 | public Date getCreateTime(){
63 | return this.createTime;
64 | }
65 |
66 | public void setStatus(Integer status){
67 | this.status = status;
68 | }
69 |
70 | public Integer getStatus(){
71 | return this.status;
72 | }
73 |
74 | @Override
75 | public String toString (){
76 | return "邮箱:"+(email == null ? "空" : email)+",编号:"+(code == null ? "空" : code)+",创建时间:"+(createTime == null ? "空" : DateUtil.format(createTime, DateTimePatternEnum.YYYY_MM_DD_HH_MM_SS.getPattern()))+",0:未使用 1:已使用:"+(status == null ? "空" : status);
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/po/FileShare.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.po;
2 |
3 |
4 | import com.fasterxml.jackson.annotation.JsonFormat;
5 | import org.springframework.format.annotation.DateTimeFormat;
6 | import xyz.kbws.entity.enums.DateTimePatternEnum;
7 | import xyz.kbws.utils.DateUtil;
8 |
9 | import java.io.Serializable;
10 | import java.util.Date;
11 |
12 |
13 | /**
14 | * 分享信息
15 | */
16 | public class FileShare implements Serializable {
17 |
18 |
19 | /**
20 | * 分享ID
21 | */
22 | private String shareId;
23 |
24 | /**
25 | * 文件ID
26 | */
27 | private String fileId;
28 |
29 | /**
30 | * 用户ID
31 | */
32 | private String userId;
33 |
34 | /**
35 | * 有效期类型 0:1天 1:7天 2:30天 3:永久有效
36 | */
37 | private Integer validType;
38 |
39 | /**
40 | * 失效时间
41 | */
42 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
43 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
44 | private Date expireTime;
45 |
46 | /**
47 | * 分享时间
48 | */
49 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
50 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
51 | private Date shareTime;
52 |
53 | /**
54 | * 提取码
55 | */
56 | private String code;
57 |
58 | /**
59 | * 浏览次数
60 | */
61 | private Integer showCount;
62 |
63 |
64 | private String fileName;
65 |
66 | /**
67 | * 0:文件 1:目录
68 | */
69 | private Integer folderType;
70 |
71 | /**
72 | * 1:视频 2:音频 3:图片 4:文档 5:其他
73 | */
74 | private Integer fileCategory;
75 |
76 | /**
77 | * 1:视频 2:音频 3:图片 4:pdf 5:doc 6:excel 7:txt 8:code 9:zip 10:其他
78 | */
79 | private Integer fileType;
80 |
81 | /**
82 | * 封面
83 | */
84 | private String fileCover;
85 |
86 | public String getFileName() {
87 | return fileName;
88 | }
89 |
90 | public void setFileName(String fileName) {
91 | this.fileName = fileName;
92 | }
93 |
94 | public void setShareId(String shareId) {
95 | this.shareId = shareId;
96 | }
97 |
98 | public String getShareId() {
99 | return this.shareId;
100 | }
101 |
102 | public void setFileId(String fileId) {
103 | this.fileId = fileId;
104 | }
105 |
106 | public String getFileId() {
107 | return this.fileId;
108 | }
109 |
110 | public void setUserId(String userId) {
111 | this.userId = userId;
112 | }
113 |
114 | public String getUserId() {
115 | return this.userId;
116 | }
117 |
118 | public void setValidType(Integer validType) {
119 | this.validType = validType;
120 | }
121 |
122 | public Integer getValidType() {
123 | return this.validType;
124 | }
125 |
126 | public void setExpireTime(Date expireTime) {
127 | this.expireTime = expireTime;
128 | }
129 |
130 | public Date getExpireTime() {
131 | return this.expireTime;
132 | }
133 |
134 | public void setShareTime(Date shareTime) {
135 | this.shareTime = shareTime;
136 | }
137 |
138 | public Date getShareTime() {
139 | return this.shareTime;
140 | }
141 |
142 | public void setCode(String code) {
143 | this.code = code;
144 | }
145 |
146 | public String getCode() {
147 | return this.code;
148 | }
149 |
150 | public void setShowCount(Integer showCount) {
151 | this.showCount = showCount;
152 | }
153 |
154 | public Integer getShowCount() {
155 | return this.showCount;
156 | }
157 |
158 | public Integer getFolderType() {
159 | return folderType;
160 | }
161 |
162 | public void setFolderType(Integer folderType) {
163 | this.folderType = folderType;
164 | }
165 |
166 | public Integer getFileCategory() {
167 | return fileCategory;
168 | }
169 |
170 | public void setFileCategory(Integer fileCategory) {
171 | this.fileCategory = fileCategory;
172 | }
173 |
174 | public Integer getFileType() {
175 | return fileType;
176 | }
177 |
178 | public void setFileType(Integer fileType) {
179 | this.fileType = fileType;
180 | }
181 |
182 | public String getFileCover() {
183 | return fileCover;
184 | }
185 |
186 | public void setFileCover(String fileCover) {
187 | this.fileCover = fileCover;
188 | }
189 |
190 | @Override
191 | public String toString() {
192 | return "分享ID:" + (shareId == null ? "空" : shareId) + ",文件ID:" + (fileId == null ? "空" : fileId) + ",用户ID:" + (userId == null ? "空" : userId) + ",有效期类型 0:1天 " +
193 | "1:7天 2:30天 3:永久有效:" + (validType == null ? "空" : validType) + ",失效时间:" + (expireTime == null ? "空" : DateUtil.format(expireTime,
194 | DateTimePatternEnum.YYYY_MM_DD_HH_MM_SS.getPattern())) + ",分享时间:" + (shareTime == null ? "空" : DateUtil.format(shareTime,
195 | DateTimePatternEnum.YYYY_MM_DD_HH_MM_SS.getPattern())) + ",提取码:" + (code == null ? "空" : code) + ",浏览次数:" + (showCount == null ? "空" : showCount);
196 | }
197 | }
198 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/po/UserInfo.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.po;
2 |
3 | import com.fasterxml.jackson.annotation.JsonIgnore;
4 | import java.util.Date;
5 | import xyz.kbws.entity.enums.DateTimePatternEnum;
6 | import xyz.kbws.utils.DateUtil;
7 | import com.fasterxml.jackson.annotation.JsonFormat;
8 | import org.springframework.format.annotation.DateTimeFormat;
9 |
10 | import java.io.Serializable;
11 |
12 |
13 | /**
14 | * 用户信息
15 | */
16 | public class UserInfo implements Serializable {
17 |
18 |
19 | /**
20 | * 用户ID
21 | */
22 | private String userId;
23 |
24 | /**
25 | * 昵称
26 | */
27 | private String nickName;
28 |
29 | /**
30 | * 邮箱
31 | */
32 | private String email;
33 |
34 | /**
35 | * qqOpenId
36 | */
37 | private String qqOpenId;
38 |
39 | /**
40 | * QQ头像
41 | */
42 | private String qqAvatar;
43 |
44 | /**
45 | * 密码
46 | */
47 | private String password;
48 |
49 | /**
50 | * 注册时间
51 | */
52 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
53 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
54 | private Date joinTime;
55 |
56 | /**
57 | * 最后登录时间
58 | */
59 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
60 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
61 | private Date lastLoginTime;
62 |
63 | /**
64 | * 0:禁用 1:启用
65 | */
66 | private Integer status;
67 |
68 | /**
69 | * 使用空间 单位byte
70 | */
71 | private Long useSpace;
72 |
73 | /**
74 | * 总空间
75 | */
76 | private Long totalSpace;
77 |
78 |
79 | public void setUserId(String userId){
80 | this.userId = userId;
81 | }
82 |
83 | public String getUserId(){
84 | return this.userId;
85 | }
86 |
87 | public void setNickName(String nickName){
88 | this.nickName = nickName;
89 | }
90 |
91 | public String getNickName(){
92 | return this.nickName;
93 | }
94 |
95 | public void setEmail(String email){
96 | this.email = email;
97 | }
98 |
99 | public String getEmail(){
100 | return this.email;
101 | }
102 |
103 | public void setQqOpenId(String qqOpenId){
104 | this.qqOpenId = qqOpenId;
105 | }
106 |
107 | public String getQqOpenId(){
108 | return this.qqOpenId;
109 | }
110 |
111 | public void setQqAvatar(String qqAvatar){
112 | this.qqAvatar = qqAvatar;
113 | }
114 |
115 | public String getQqAvatar(){
116 | return this.qqAvatar;
117 | }
118 |
119 | public void setPassword(String password){
120 | this.password = password;
121 | }
122 |
123 | public String getPassword(){
124 | return this.password;
125 | }
126 |
127 | public void setJoinTime(Date joinTime){
128 | this.joinTime = joinTime;
129 | }
130 |
131 | public Date getJoinTime(){
132 | return this.joinTime;
133 | }
134 |
135 | public void setLastLoginTime(Date lastLoginTime){
136 | this.lastLoginTime = lastLoginTime;
137 | }
138 |
139 | public Date getLastLoginTime(){
140 | return this.lastLoginTime;
141 | }
142 |
143 | public void setStatus(Integer status){
144 | this.status = status;
145 | }
146 |
147 | public Integer getStatus(){
148 | return this.status;
149 | }
150 |
151 | public void setUseSpace(Long useSpace){
152 | this.useSpace = useSpace;
153 | }
154 |
155 | public Long getUseSpace(){
156 | return this.useSpace;
157 | }
158 |
159 | public void setTotalSpace(Long totalSpace){
160 | this.totalSpace = totalSpace;
161 | }
162 |
163 | public Long getTotalSpace(){
164 | return this.totalSpace;
165 | }
166 |
167 | @Override
168 | public String toString (){
169 | return "用户ID:"+(userId == null ? "空" : userId)+",昵称:"+(nickName == null ? "空" : nickName)+",邮箱:"+(email == null ? "空" : email)+",qqOpenId:"+(qqOpenId == null ? "空" : qqOpenId)+",QQ头像:"+(qqAvatar == null ? "空" : qqAvatar)+",密码:"+(password == null ? "空" : password)+",注册时间:"+(joinTime == null ? "空" : DateUtil.format(joinTime, DateTimePatternEnum.YYYY_MM_DD_HH_MM_SS.getPattern()))+",最后登录时间:"+(lastLoginTime == null ? "空" : DateUtil.format(lastLoginTime, DateTimePatternEnum.YYYY_MM_DD_HH_MM_SS.getPattern()))+",0:禁用 1:启用:"+(status == null ? "空" : status)+",使用空间 单位byte:"+(useSpace == null ? "空" : useSpace)+",总空间:"+(totalSpace == null ? "空" : totalSpace);
170 | }
171 | }
172 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/query/BaseParam.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.query;
2 |
3 |
4 | public class BaseParam {
5 | private SimplePage simplePage;
6 | private Integer pageNo;
7 | private Integer pageSize;
8 | private String orderBy;
9 | public SimplePage getSimplePage() {
10 | return simplePage;
11 | }
12 |
13 | public void setSimplePage(SimplePage simplePage) {
14 | this.simplePage = simplePage;
15 | }
16 |
17 | public Integer getPageNo() {
18 | return pageNo;
19 | }
20 |
21 | public void setPageNo(Integer pageNo) {
22 | this.pageNo = pageNo;
23 | }
24 |
25 | public Integer getPageSize() {
26 | return pageSize;
27 | }
28 |
29 | public void setPageSize(Integer pageSize) {
30 | this.pageSize = pageSize;
31 | }
32 |
33 | public void setOrderBy(String orderBy){
34 | this.orderBy = orderBy;
35 | }
36 |
37 | public String getOrderBy(){
38 | return this.orderBy;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/query/EmailCodeQuery.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.query;
2 |
3 | import java.util.Date;
4 |
5 |
6 | /**
7 | * 邮箱验证码参数
8 | */
9 | public class EmailCodeQuery extends BaseParam {
10 |
11 |
12 | /**
13 | * 邮箱
14 | */
15 | private String email;
16 |
17 | private String emailFuzzy;
18 |
19 | /**
20 | * 编号
21 | */
22 | private String code;
23 |
24 | private String codeFuzzy;
25 |
26 | /**
27 | * 创建时间
28 | */
29 | private String createTime;
30 |
31 | private String createTimeStart;
32 |
33 | private String createTimeEnd;
34 |
35 | /**
36 | * 0:未使用 1:已使用
37 | */
38 | private Integer status;
39 |
40 |
41 | public void setEmail(String email){
42 | this.email = email;
43 | }
44 |
45 | public String getEmail(){
46 | return this.email;
47 | }
48 |
49 | public void setEmailFuzzy(String emailFuzzy){
50 | this.emailFuzzy = emailFuzzy;
51 | }
52 |
53 | public String getEmailFuzzy(){
54 | return this.emailFuzzy;
55 | }
56 |
57 | public void setCode(String code){
58 | this.code = code;
59 | }
60 |
61 | public String getCode(){
62 | return this.code;
63 | }
64 |
65 | public void setCodeFuzzy(String codeFuzzy){
66 | this.codeFuzzy = codeFuzzy;
67 | }
68 |
69 | public String getCodeFuzzy(){
70 | return this.codeFuzzy;
71 | }
72 |
73 | public void setCreateTime(String createTime){
74 | this.createTime = createTime;
75 | }
76 |
77 | public String getCreateTime(){
78 | return this.createTime;
79 | }
80 |
81 | public void setCreateTimeStart(String createTimeStart){
82 | this.createTimeStart = createTimeStart;
83 | }
84 |
85 | public String getCreateTimeStart(){
86 | return this.createTimeStart;
87 | }
88 | public void setCreateTimeEnd(String createTimeEnd){
89 | this.createTimeEnd = createTimeEnd;
90 | }
91 |
92 | public String getCreateTimeEnd(){
93 | return this.createTimeEnd;
94 | }
95 |
96 | public void setStatus(Integer status){
97 | this.status = status;
98 | }
99 |
100 | public Integer getStatus(){
101 | return this.status;
102 | }
103 |
104 | }
105 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/query/FileShareQuery.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.query;
2 |
3 | /**
4 | * 分享信息参数
5 | */
6 | public class FileShareQuery extends BaseParam {
7 |
8 |
9 | /**
10 | * 分享ID
11 | */
12 | private String shareId;
13 |
14 | private String shareIdFuzzy;
15 |
16 | /**
17 | * 文件ID
18 | */
19 | private String fileId;
20 |
21 | private String fileIdFuzzy;
22 |
23 | /**
24 | * 用户ID
25 | */
26 | private String userId;
27 |
28 | private String userIdFuzzy;
29 |
30 | /**
31 | * 有效期类型 0:1天 1:7天 2:30天 3:永久有效
32 | */
33 | private Integer validType;
34 |
35 | /**
36 | * 失效时间
37 | */
38 | private String expireTime;
39 |
40 | private String expireTimeStart;
41 |
42 | private String expireTimeEnd;
43 |
44 | /**
45 | * 分享时间
46 | */
47 | private String shareTime;
48 |
49 | private String shareTimeStart;
50 |
51 | private String shareTimeEnd;
52 |
53 | /**
54 | * 提取码
55 | */
56 | private String code;
57 |
58 | private String codeFuzzy;
59 |
60 | /**
61 | * 浏览次数
62 | */
63 | private Integer showCount;
64 |
65 | private Boolean queryFileName;
66 |
67 | public Boolean getQueryFileName() {
68 | return queryFileName;
69 | }
70 |
71 | public void setQueryFileName(Boolean queryFileName) {
72 | this.queryFileName = queryFileName;
73 | }
74 |
75 | public void setShareId(String shareId) {
76 | this.shareId = shareId;
77 | }
78 |
79 | public String getShareId() {
80 | return this.shareId;
81 | }
82 |
83 | public void setShareIdFuzzy(String shareIdFuzzy) {
84 | this.shareIdFuzzy = shareIdFuzzy;
85 | }
86 |
87 | public String getShareIdFuzzy() {
88 | return this.shareIdFuzzy;
89 | }
90 |
91 | public void setFileId(String fileId) {
92 | this.fileId = fileId;
93 | }
94 |
95 | public String getFileId() {
96 | return this.fileId;
97 | }
98 |
99 | public void setFileIdFuzzy(String fileIdFuzzy) {
100 | this.fileIdFuzzy = fileIdFuzzy;
101 | }
102 |
103 | public String getFileIdFuzzy() {
104 | return this.fileIdFuzzy;
105 | }
106 |
107 | public void setUserId(String userId) {
108 | this.userId = userId;
109 | }
110 |
111 | public String getUserId() {
112 | return this.userId;
113 | }
114 |
115 | public void setUserIdFuzzy(String userIdFuzzy) {
116 | this.userIdFuzzy = userIdFuzzy;
117 | }
118 |
119 | public String getUserIdFuzzy() {
120 | return this.userIdFuzzy;
121 | }
122 |
123 | public void setValidType(Integer validType) {
124 | this.validType = validType;
125 | }
126 |
127 | public Integer getValidType() {
128 | return this.validType;
129 | }
130 |
131 | public void setExpireTime(String expireTime) {
132 | this.expireTime = expireTime;
133 | }
134 |
135 | public String getExpireTime() {
136 | return this.expireTime;
137 | }
138 |
139 | public void setExpireTimeStart(String expireTimeStart) {
140 | this.expireTimeStart = expireTimeStart;
141 | }
142 |
143 | public String getExpireTimeStart() {
144 | return this.expireTimeStart;
145 | }
146 |
147 | public void setExpireTimeEnd(String expireTimeEnd) {
148 | this.expireTimeEnd = expireTimeEnd;
149 | }
150 |
151 | public String getExpireTimeEnd() {
152 | return this.expireTimeEnd;
153 | }
154 |
155 | public void setShareTime(String shareTime) {
156 | this.shareTime = shareTime;
157 | }
158 |
159 | public String getShareTime() {
160 | return this.shareTime;
161 | }
162 |
163 | public void setShareTimeStart(String shareTimeStart) {
164 | this.shareTimeStart = shareTimeStart;
165 | }
166 |
167 | public String getShareTimeStart() {
168 | return this.shareTimeStart;
169 | }
170 |
171 | public void setShareTimeEnd(String shareTimeEnd) {
172 | this.shareTimeEnd = shareTimeEnd;
173 | }
174 |
175 | public String getShareTimeEnd() {
176 | return this.shareTimeEnd;
177 | }
178 |
179 | public void setCode(String code) {
180 | this.code = code;
181 | }
182 |
183 | public String getCode() {
184 | return this.code;
185 | }
186 |
187 | public void setCodeFuzzy(String codeFuzzy) {
188 | this.codeFuzzy = codeFuzzy;
189 | }
190 |
191 | public String getCodeFuzzy() {
192 | return this.codeFuzzy;
193 | }
194 |
195 | public void setShowCount(Integer showCount) {
196 | this.showCount = showCount;
197 | }
198 |
199 | public Integer getShowCount() {
200 | return this.showCount;
201 | }
202 |
203 | }
204 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/query/SimplePage.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.query;
2 | import xyz.kbws.entity.enums.PageSize;
3 |
4 |
5 | public class SimplePage {
6 | private int pageNo;
7 | private int countTotal;
8 | private int pageSize;
9 | private int pageTotal;
10 | private int start;
11 | private int end;
12 |
13 | public SimplePage() {
14 | }
15 |
16 | public SimplePage(Integer pageNo, int countTotal, int pageSize) {
17 | if (null == pageNo) {
18 | pageNo = 0;
19 | }
20 | this.pageNo = pageNo;
21 | this.countTotal = countTotal;
22 | this.pageSize = pageSize;
23 | action();
24 | }
25 |
26 | public SimplePage(int start, int end) {
27 | this.start = start;
28 | this.end = end;
29 | }
30 |
31 | public void action() {
32 | if (this.pageSize <= 0) {
33 | this.pageSize = PageSize.SIZE20.getSize();
34 | }
35 | if (this.countTotal > 0) {
36 | this.pageTotal = this.countTotal % this.pageSize == 0 ? this.countTotal / this.pageSize
37 | : this.countTotal / this.pageSize + 1;
38 | } else {
39 | pageTotal = 1;
40 | }
41 |
42 | if (pageNo <= 1) {
43 | pageNo = 1;
44 | }
45 | if (pageNo > pageTotal) {
46 | pageNo = pageTotal;
47 | }
48 | this.start = (pageNo - 1) * pageSize;
49 | this.end = this.pageSize;
50 | }
51 |
52 | public int getStart() {
53 | return start;
54 | }
55 |
56 | public int getEnd() {
57 | return end;
58 | }
59 |
60 | public int getPageTotal() {
61 | return pageTotal;
62 | }
63 |
64 | public int getPageNo() {
65 | return pageNo;
66 | }
67 |
68 | public void setPageNo(int pageNo) {
69 | this.pageNo = pageNo;
70 | }
71 |
72 | public void setPageTotal(int pageTotal) {
73 | this.pageTotal = pageTotal;
74 | }
75 |
76 | public int getCountTotal() {
77 | return countTotal;
78 | }
79 |
80 | public int getPageSize() {
81 | return pageSize;
82 | }
83 |
84 | public void setStart(int start) {
85 | this.start = start;
86 | }
87 |
88 | public void setEnd(int end) {
89 | this.end = end;
90 | }
91 |
92 | public void setCountTotal(int countTotal) {
93 | this.countTotal = countTotal;
94 | this.action();
95 | }
96 |
97 | public void setPageSize(int pageSize) {
98 | this.pageSize = pageSize;
99 | }
100 |
101 | }
102 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/vo/FileInfoVO.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonFormat;
4 | import org.springframework.format.annotation.DateTimeFormat;
5 |
6 | import java.util.Date;
7 |
8 | public class FileInfoVO {
9 |
10 | /**
11 | * 文件ID
12 | */
13 | private String fileId;
14 |
15 | /**
16 | * 父级ID
17 | */
18 | private String filePid;
19 |
20 | /**
21 | * 文件大小
22 | */
23 | private Long fileSize;
24 |
25 | /**
26 | * 文件名称
27 | */
28 | private String fileName;
29 |
30 | /**
31 | * 封面
32 | */
33 | private String fileCover;
34 |
35 | /**
36 | * 最后更新时间
37 | */
38 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
39 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
40 | private Date recoveryTime;
41 |
42 |
43 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
44 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
45 | private Date lastUpdateTime;
46 |
47 |
48 | /**
49 | * 0:文件 1:目录
50 | */
51 | private Integer folderType;
52 |
53 | /**
54 | * 1:视频 2:音频 3:图片 4:文档 5:其他
55 | */
56 | private Integer fileCategory;
57 |
58 | /**
59 | * 1:视频 2:音频 3:图片 4:pdf 5:doc 6:excel 7:txt 8:code 9:zip 10:其他
60 | */
61 | private Integer fileType;
62 |
63 | /**
64 | * 0:转码中 1转码失败 2:转码成功
65 | */
66 | private Integer status;
67 |
68 | public String getFileId() {
69 | return fileId;
70 | }
71 |
72 | public void setFileId(String fileId) {
73 | this.fileId = fileId;
74 | }
75 |
76 | public String getFilePid() {
77 | return filePid;
78 | }
79 |
80 | public void setFilePid(String filePid) {
81 | this.filePid = filePid;
82 | }
83 |
84 | public Long getFileSize() {
85 | return fileSize;
86 | }
87 |
88 | public void setFileSize(Long fileSize) {
89 | this.fileSize = fileSize;
90 | }
91 |
92 | public String getFileName() {
93 | return fileName;
94 | }
95 |
96 | public void setFileName(String fileName) {
97 | this.fileName = fileName;
98 | }
99 |
100 | public String getFileCover() {
101 | return fileCover;
102 | }
103 |
104 | public void setFileCover(String fileCover) {
105 | this.fileCover = fileCover;
106 | }
107 |
108 | public Date getRecoveryTime() {
109 | return recoveryTime;
110 | }
111 |
112 | public void setRecoveryTime(Date recoveryTime) {
113 | this.recoveryTime = recoveryTime;
114 | }
115 |
116 | public Integer getFolderType() {
117 | return folderType;
118 | }
119 |
120 | public void setFolderType(Integer folderType) {
121 | this.folderType = folderType;
122 | }
123 |
124 | public Integer getFileCategory() {
125 | return fileCategory;
126 | }
127 |
128 | public void setFileCategory(Integer fileCategory) {
129 | this.fileCategory = fileCategory;
130 | }
131 |
132 | public Integer getFileType() {
133 | return fileType;
134 | }
135 |
136 | public void setFileType(Integer fileType) {
137 | this.fileType = fileType;
138 | }
139 |
140 | public Integer getStatus() {
141 | return status;
142 | }
143 |
144 | public void setStatus(Integer status) {
145 | this.status = status;
146 | }
147 |
148 | public Date getLastUpdateTime() {
149 | return lastUpdateTime;
150 | }
151 |
152 | public void setLastUpdateTime(Date lastUpdateTime) {
153 | this.lastUpdateTime = lastUpdateTime;
154 | }
155 | }
156 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/vo/PaginationResultVO.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.vo;
2 | import java.util.ArrayList;
3 | import java.util.List;
4 |
5 |
6 | public class PaginationResultVO {
7 | private Integer totalCount;
8 | private Integer pageSize;
9 | private Integer pageNo;
10 | private Integer pageTotal;
11 | private List list = new ArrayList();
12 |
13 | public PaginationResultVO(Integer totalCount, Integer pageSize, Integer pageNo, List list) {
14 | this.totalCount = totalCount;
15 | this.pageSize = pageSize;
16 | this.pageNo = pageNo;
17 | this.list = list;
18 | }
19 |
20 | public PaginationResultVO(Integer totalCount, Integer pageSize, Integer pageNo, Integer pageTotal, List list) {
21 | if (pageNo == 0) {
22 | pageNo = 1;
23 | }
24 | this.totalCount = totalCount;
25 | this.pageSize = pageSize;
26 | this.pageNo = pageNo;
27 | this.pageTotal = pageTotal;
28 | this.list = list;
29 | }
30 |
31 | public PaginationResultVO(List list) {
32 | this.list = list;
33 | }
34 |
35 | public PaginationResultVO() {
36 |
37 | }
38 |
39 | public Integer getTotalCount() {
40 | return totalCount;
41 | }
42 |
43 | public void setTotalCount(Integer totalCount) {
44 | this.totalCount = totalCount;
45 | }
46 |
47 | public Integer getPageSize() {
48 | return pageSize;
49 | }
50 |
51 | public void setPageSize(Integer pageSize) {
52 | this.pageSize = pageSize;
53 | }
54 |
55 | public Integer getPageNo() {
56 | return pageNo;
57 | }
58 |
59 | public void setPageNo(Integer pageNo) {
60 | this.pageNo = pageNo;
61 | }
62 |
63 | public List getList() {
64 | return list;
65 | }
66 |
67 | public void setList(List list) {
68 | this.list = list;
69 | }
70 |
71 | public Integer getPageTotal() {
72 | return pageTotal;
73 | }
74 |
75 | public void setPageTotal(Integer pageTotal) {
76 | this.pageTotal = pageTotal;
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/vo/ResponseVO.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.vo;
2 |
3 |
4 | public class ResponseVO {
5 | private String status;
6 | private Integer code;
7 | private String info;
8 | private T data;
9 |
10 | public String getStatus() {
11 | return status;
12 | }
13 |
14 | public void setStatus(String status) {
15 | this.status = status;
16 | }
17 |
18 | public Integer getCode() {
19 | return code;
20 | }
21 |
22 | public void setCode(Integer code) {
23 | this.code = code;
24 | }
25 |
26 | public T getData() {
27 | return data;
28 | }
29 |
30 | public void setData(T data) {
31 | this.data = data;
32 | }
33 |
34 | public String getInfo() {
35 | return info;
36 | }
37 |
38 | public void setInfo(String info) {
39 | this.info = info;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/vo/ShareInfoVO.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonFormat;
4 |
5 | import java.util.Date;
6 |
7 | public class ShareInfoVO {
8 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
9 | private Date shareTime;
10 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
11 | private Date expireTime;
12 | private String nickName;
13 | private String fileName;
14 | private Boolean currentUser;
15 | private String fileId;
16 | private String avatar;
17 | private String userId;
18 |
19 | public String getUserId() {
20 | return userId;
21 | }
22 |
23 | public void setUserId(String userId) {
24 | this.userId = userId;
25 | }
26 |
27 | public String getAvatar() {
28 | return avatar;
29 | }
30 |
31 | public void setAvatar(String avatar) {
32 | this.avatar = avatar;
33 | }
34 |
35 | public String getFileId() {
36 | return fileId;
37 | }
38 |
39 | public void setFileId(String fileId) {
40 | this.fileId = fileId;
41 | }
42 |
43 | public Date getShareTime() {
44 | return shareTime;
45 | }
46 |
47 | public void setShareTime(Date shareTime) {
48 | this.shareTime = shareTime;
49 | }
50 |
51 | public Date getExpireTime() {
52 | return expireTime;
53 | }
54 |
55 | public void setExpireTime(Date expireTime) {
56 | this.expireTime = expireTime;
57 | }
58 |
59 | public String getNickName() {
60 | return nickName;
61 | }
62 |
63 | public void setNickName(String nickName) {
64 | this.nickName = nickName;
65 | }
66 |
67 | public String getFileName() {
68 | return fileName;
69 | }
70 |
71 | public void setFileName(String fileName) {
72 | this.fileName = fileName;
73 | }
74 |
75 | public Boolean getCurrentUser() {
76 | return currentUser;
77 | }
78 |
79 | public void setCurrentUser(Boolean currentUser) {
80 | this.currentUser = currentUser;
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/entity/vo/UserInfoVO.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.entity.vo;
2 |
3 | import java.util.Date;
4 |
5 | import com.fasterxml.jackson.annotation.JsonFormat;
6 | import org.springframework.format.annotation.DateTimeFormat;
7 |
8 | import java.io.Serializable;
9 |
10 |
11 | /**
12 | * 用户信息
13 | */
14 | public class UserInfoVO implements Serializable {
15 |
16 |
17 | /**
18 | * 用户ID
19 | */
20 | private String userId;
21 |
22 | /**
23 | * 昵称
24 | */
25 | private String nickName;
26 |
27 | /**
28 | * 邮箱
29 | */
30 | private String email;
31 |
32 | /**
33 | * qq 头像
34 | */
35 | private String qqAvatar;
36 |
37 | /**
38 | * 加入时间
39 | */
40 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
41 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
42 | private Date joinTime;
43 |
44 | /**
45 | * 最后登录时间
46 | */
47 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
48 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
49 | private Date lastLoginTime;
50 |
51 | /**
52 | * 0:禁用 1:正常
53 | */
54 | private Integer status;
55 |
56 | /**
57 | * 使用空间单位byte
58 | */
59 | private Long useSpace;
60 |
61 | /**
62 | * 总空间单位byte
63 | */
64 | private Long totalSpace;
65 |
66 | public String getUserId() {
67 | return userId;
68 | }
69 |
70 | public void setUserId(String userId) {
71 | this.userId = userId;
72 | }
73 |
74 | public String getNickName() {
75 | return nickName;
76 | }
77 |
78 | public void setNickName(String nickName) {
79 | this.nickName = nickName;
80 | }
81 |
82 | public String getEmail() {
83 | return email;
84 | }
85 |
86 | public void setEmail(String email) {
87 | this.email = email;
88 | }
89 |
90 | public String getQqAvatar() {
91 | return qqAvatar;
92 | }
93 |
94 | public void setQqAvatar(String qqAvatar) {
95 | this.qqAvatar = qqAvatar;
96 | }
97 |
98 | public Date getJoinTime() {
99 | return joinTime;
100 | }
101 |
102 | public void setJoinTime(Date joinTime) {
103 | this.joinTime = joinTime;
104 | }
105 |
106 | public Date getLastLoginTime() {
107 | return lastLoginTime;
108 | }
109 |
110 | public void setLastLoginTime(Date lastLoginTime) {
111 | this.lastLoginTime = lastLoginTime;
112 | }
113 |
114 | public Integer getStatus() {
115 | return status;
116 | }
117 |
118 | public void setStatus(Integer status) {
119 | this.status = status;
120 | }
121 |
122 | public Long getUseSpace() {
123 | return useSpace;
124 | }
125 |
126 | public void setUseSpace(Long useSpace) {
127 | this.useSpace = useSpace;
128 | }
129 |
130 | public Long getTotalSpace() {
131 | return totalSpace;
132 | }
133 |
134 | public void setTotalSpace(Long totalSpace) {
135 | this.totalSpace = totalSpace;
136 | }
137 | }
138 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/exception/BusinessException.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.exception;
2 | import xyz.kbws.entity.enums.ResponseCodeEnum;
3 |
4 |
5 | public class BusinessException extends RuntimeException {
6 |
7 | private ResponseCodeEnum codeEnum;
8 |
9 | private Integer code;
10 |
11 | private String message;
12 |
13 | public BusinessException(String message, Throwable e) {
14 | super(message, e);
15 | this.message = message;
16 | }
17 |
18 | public BusinessException(String message) {
19 | super(message);
20 | this.message = message;
21 | }
22 |
23 | public BusinessException(Throwable e) {
24 | super(e);
25 | }
26 |
27 | public BusinessException(ResponseCodeEnum codeEnum) {
28 | super(codeEnum.getMsg());
29 | this.codeEnum = codeEnum;
30 | this.code = codeEnum.getCode();
31 | this.message = codeEnum.getMsg();
32 | }
33 |
34 | public BusinessException(Integer code, String message) {
35 | super(message);
36 | this.code = code;
37 | this.message = message;
38 | }
39 |
40 | public ResponseCodeEnum getCodeEnum() {
41 | return codeEnum;
42 | }
43 |
44 | public Integer getCode() {
45 | return code;
46 | }
47 |
48 | @Override
49 | public String getMessage() {
50 | return message;
51 | }
52 |
53 | /**
54 | * 重写fillInStackTrace 业务异常不需要堆栈信息,提高效率.
55 | */
56 | @Override
57 | public Throwable fillInStackTrace() {
58 | return this;
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/mappers/BaseMapper.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.mappers;
2 |
3 |
4 | import org.apache.ibatis.annotations.Param;
5 |
6 | import java.util.List;
7 |
8 | interface BaseMapper {
9 |
10 | /**
11 | * selectList:(根据参数查询集合)
12 | */
13 | List selectList(@Param("query") P p);
14 |
15 | /**
16 | * selectCount:(根据集合查询数量)
17 | */
18 | Integer selectCount(@Param("query") P p);
19 |
20 | /**
21 | * insert:(插入)
22 | */
23 | Integer insert(@Param("bean") T t);
24 |
25 |
26 | /**
27 | * insertOrUpdate:(插入或者更新)
28 | */
29 | Integer insertOrUpdate(@Param("bean") T t);
30 |
31 |
32 | /**
33 | * insertBatch:(批量插入)
34 | */
35 | Integer insertBatch(@Param("list") List list);
36 |
37 |
38 | /**
39 | * insertOrUpdateBatch:(批量插入或更新)
40 | */
41 | Integer insertOrUpdateBatch(@Param("list") List list);
42 |
43 |
44 | /**
45 | * updateByParams:(多条件更新)
46 | */
47 | Integer updateByParam(@Param("bean") T t,@Param("query") P p);
48 |
49 | /**
50 | * deleteByParam:(多条件删除)
51 | */
52 | Integer deleteByParam(@Param("query") P p);
53 | }
54 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/mappers/EmailCodeMapper.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.mappers;
2 |
3 | import org.apache.ibatis.annotations.Param;
4 |
5 | /**
6 | * 邮箱验证码 数据库操作接口
7 | */
8 | public interface EmailCodeMapper extends BaseMapper {
9 |
10 | /**
11 | * 根据EmailAndCode更新
12 | */
13 | Integer updateByEmailAndCode(@Param("bean") T t,@Param("email") String email,@Param("code") String code);
14 |
15 |
16 | /**
17 | * 根据EmailAndCode删除
18 | */
19 | Integer deleteByEmailAndCode(@Param("email") String email,@Param("code") String code);
20 |
21 |
22 | /**
23 | * 根据EmailAndCode获取对象
24 | */
25 | T selectByEmailAndCode(@Param("email") String email,@Param("code") String code);
26 |
27 | void disableEmailCode(@Param("email") String email);
28 | }
29 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/mappers/FileInfoMapper.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.mappers;
2 |
3 | import org.apache.ibatis.annotations.Param;
4 | import xyz.kbws.entity.po.FileInfo;
5 |
6 | import java.util.List;
7 |
8 | /**
9 | * 文件信息 数据库操作接口
10 | */
11 | public interface FileInfoMapper extends BaseMapper {
12 |
13 | /**
14 | * 根据FileIdAndUserId更新
15 | */
16 | Integer updateByFileIdAndUserId(@Param("bean") T t,@Param("fileId") String fileId,@Param("userId") String userId);
17 |
18 |
19 | /**
20 | * 根据FileIdAndUserId删除
21 | */
22 | Integer deleteByFileIdAndUserId(@Param("fileId") String fileId,@Param("userId") String userId);
23 |
24 |
25 | /**
26 | * 根据FileIdAndUserId获取对象
27 | */
28 | T selectByFileIdAndUserId(@Param("fileId") String fileId,@Param("userId") String userId);
29 |
30 | /**
31 | * 根据id查询用户使用空间
32 | */
33 | Long selectUseSpace(@Param("userId") String userId);
34 |
35 | /**
36 | * 乐观锁
37 | * @param fileId
38 | * @param userId
39 | * @param t
40 | * @param oldStatus
41 | */
42 | void updateFileStatusWithOldStatus(@Param("fileId") String fileId, @Param("userId") String userId,
43 | @Param("bean") T t, @Param("oldStatus") Integer oldStatus);
44 |
45 | /**
46 | * 批量回收站
47 | */
48 | void updateFileDelFlagBatch(@Param("bean")FileInfo fileInfo, @Param("userId") String userId,
49 | @Param("filePidList")List filePidList,
50 | @Param("fileIdList") List fileIdList,
51 | @Param("oldDelFlag") Integer oldDelFlag);
52 |
53 | /**
54 | * 批量删除
55 | */
56 | void delFileBatch(@Param("userId") String userId,
57 | @Param("filePidList") List filePidList,
58 | @Param("fileIdList") List fileIdList,
59 | @Param("oldDelFlag") Integer oldDelFlag);
60 |
61 | void deleteFileByUserId(@Param("userId") String userId);
62 | }
63 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/mappers/FileShareMapper.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.mappers;
2 |
3 | import org.apache.ibatis.annotations.Param;
4 |
5 | /**
6 | * 分享信息 数据库操作接口
7 | */
8 | public interface FileShareMapper extends BaseMapper {
9 |
10 | /**
11 | * 根据ShareId更新
12 | */
13 | Integer updateByShareId(@Param("bean") T t, @Param("shareId") String shareId);
14 |
15 |
16 | /**
17 | * 根据ShareId删除
18 | */
19 | Integer deleteByShareId(@Param("shareId") String shareId);
20 |
21 |
22 | /**
23 | * 根据ShareId获取对象
24 | */
25 | T selectByShareId(@Param("shareId") String shareId);
26 |
27 | Integer deleteFileShareBatch(@Param("shareIdArray") String[] shareIdArray, @Param("userId") String userId);
28 |
29 | void updateShareShowCount(@Param("shareId") String shareId);
30 | }
31 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/mappers/UserInfoMapper.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.mappers;
2 |
3 | import org.apache.ibatis.annotations.Param;
4 |
5 | /**
6 | * 用户信息 数据库操作接口
7 | */
8 | public interface UserInfoMapper extends BaseMapper {
9 |
10 | /**
11 | * 根据UserId更新
12 | */
13 | Integer updateByUserId(@Param("bean") T t,@Param("userId") String userId);
14 |
15 |
16 | /**
17 | * 根据UserId删除
18 | */
19 | Integer deleteByUserId(@Param("userId") String userId);
20 |
21 |
22 | /**
23 | * 根据UserId获取对象
24 | */
25 | T selectByUserId(@Param("userId") String userId);
26 |
27 |
28 | /**
29 | * 根据Email更新
30 | */
31 | Integer updateByEmail(@Param("bean") T t,@Param("email") String email);
32 |
33 |
34 | /**
35 | * 根据Email删除
36 | */
37 | Integer deleteByEmail(@Param("email") String email);
38 |
39 |
40 | /**
41 | * 根据Email获取对象
42 | */
43 | T selectByEmail(@Param("email") String email);
44 |
45 |
46 | /**
47 | * 根据NickName更新
48 | */
49 | Integer updateByNickName(@Param("bean") T t,@Param("nickName") String nickName);
50 |
51 |
52 | /**
53 | * 根据NickName删除
54 | */
55 | Integer deleteByNickName(@Param("nickName") String nickName);
56 |
57 |
58 | /**
59 | * 根据NickName获取对象
60 | */
61 | T selectByNickName(@Param("nickName") String nickName);
62 |
63 |
64 | /**
65 | * 根据QqOpenId更新
66 | */
67 | Integer updateByQqOpenId(@Param("bean") T t,@Param("qqOpenId") String qqOpenId);
68 |
69 |
70 | /**
71 | * 根据QqOpenId删除
72 | */
73 | Integer deleteByQqOpenId(@Param("qqOpenId") String qqOpenId);
74 |
75 |
76 | /**
77 | * 根据QqOpenId获取对象
78 | */
79 | T selectByQqOpenId(@Param("qqOpenId") String qqOpenId);
80 |
81 |
82 | /**
83 | * 更新用户使用空间
84 | */
85 | Integer updateUserSpace(@Param("userId") String userId, @Param("useSpace") Long useSpace,
86 | @Param("totalSpace") Long totalSpace);
87 | }
88 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/service/EmailCodeService.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.service;
2 |
3 | import java.util.List;
4 |
5 | import xyz.kbws.entity.query.EmailCodeQuery;
6 | import xyz.kbws.entity.po.EmailCode;
7 | import xyz.kbws.entity.vo.PaginationResultVO;
8 |
9 |
10 | /**
11 | * 邮箱验证码 业务接口
12 | */
13 | public interface EmailCodeService {
14 |
15 | /**
16 | * 根据条件查询列表
17 | */
18 | List findListByParam(EmailCodeQuery param);
19 |
20 | /**
21 | * 根据条件查询列表
22 | */
23 | Integer findCountByParam(EmailCodeQuery param);
24 |
25 | /**
26 | * 分页查询
27 | */
28 | PaginationResultVO findListByPage(EmailCodeQuery param);
29 |
30 | /**
31 | * 新增
32 | */
33 | Integer add(EmailCode bean);
34 |
35 | /**
36 | * 批量新增
37 | */
38 | Integer addBatch(List listBean);
39 |
40 | /**
41 | * 批量新增/修改
42 | */
43 | Integer addOrUpdateBatch(List listBean);
44 |
45 | /**
46 | * 多条件更新
47 | */
48 | Integer updateByParam(EmailCode bean,EmailCodeQuery param);
49 |
50 | /**
51 | * 多条件删除
52 | */
53 | Integer deleteByParam(EmailCodeQuery param);
54 |
55 | /**
56 | * 根据EmailAndCode查询对象
57 | */
58 | EmailCode getEmailCodeByEmailAndCode(String email,String code);
59 |
60 |
61 | /**
62 | * 根据EmailAndCode修改
63 | */
64 | Integer updateEmailCodeByEmailAndCode(EmailCode bean,String email,String code);
65 |
66 |
67 | /**
68 | * 根据EmailAndCode删除
69 | */
70 | Integer deleteEmailCodeByEmailAndCode(String email,String code);
71 |
72 | /**
73 | * 发生邮箱验证码
74 | */
75 | void sendEmailCode(String email, Integer type);
76 |
77 | /**
78 | * 检验邮箱验证码
79 | */
80 | void checkCode(String email, String code);
81 | }
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/service/FileInfoService.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.service;
2 |
3 | import java.util.List;
4 |
5 | import org.apache.ibatis.annotations.Param;
6 | import org.springframework.web.multipart.MultipartFile;
7 | import xyz.kbws.entity.dto.SessionWebUserDto;
8 | import xyz.kbws.entity.dto.UploadResultDto;
9 | import xyz.kbws.entity.query.FileInfoQuery;
10 | import xyz.kbws.entity.po.FileInfo;
11 | import xyz.kbws.entity.vo.PaginationResultVO;
12 |
13 |
14 | /**
15 | * 文件信息 业务接口
16 | */
17 | public interface FileInfoService {
18 |
19 | /**
20 | * 根据条件查询列表
21 | */
22 | List findListByParam(FileInfoQuery param);
23 |
24 | /**
25 | * 根据条件查询列表
26 | */
27 | Integer findCountByParam(FileInfoQuery param);
28 |
29 | /**
30 | * 分页查询
31 | */
32 | PaginationResultVO findListByPage(FileInfoQuery param);
33 |
34 | /**
35 | * 新增
36 | */
37 | Integer add(FileInfo bean);
38 |
39 | /**
40 | * 批量新增
41 | */
42 | Integer addBatch(List listBean);
43 |
44 | /**
45 | * 批量新增/修改
46 | */
47 | Integer addOrUpdateBatch(List listBean);
48 |
49 | /**
50 | * 多条件更新
51 | */
52 | Integer updateByParam(FileInfo bean,FileInfoQuery param);
53 |
54 | /**
55 | * 多条件删除
56 | */
57 | Integer deleteByParam(FileInfoQuery param);
58 |
59 | /**
60 | * 根据FileIdAndUserId查询对象
61 | */
62 | FileInfo getFileInfoByFileIdAndUserId(String fileId,String userId);
63 |
64 |
65 | /**
66 | * 根据FileIdAndUserId修改
67 | */
68 | Integer updateFileInfoByFileIdAndUserId(FileInfo bean,String fileId,String userId);
69 |
70 |
71 | /**
72 | * 根据FileIdAndUserId删除
73 | */
74 | Integer deleteFileInfoByFileIdAndUserId(String fileId,String userId);
75 |
76 | /**
77 | * 文件上传
78 | */
79 | UploadResultDto uploadFile(SessionWebUserDto webUserDto, String fileId, MultipartFile file,
80 | String fileName, String filePid, String fileMd5, Integer chunkIndex, Integer chunks);
81 |
82 | /**
83 | * 新建目录
84 | * @param filePid 父级id
85 | * @param userId 用户id
86 | * @param folderName 文件夹名
87 | * @return
88 | */
89 | FileInfo newFolder(String filePid, String userId, String folderName);
90 |
91 | /**
92 | * 重命名文件夹
93 | * @param fileId 文件id
94 | * @param userId 用户id
95 | * @param fileName 文件夹名
96 | * @return
97 | */
98 | FileInfo rename(String fileId, String userId, String fileName);
99 |
100 | /**
101 | * 修改文件目录、移动文件
102 | * @param fileIds 需要移动的文件id列表
103 | * @param filePid 父级目录id
104 | * @param userId 用户id
105 | */
106 | void changeFileFolder(String fileIds, String filePid, String userId);
107 |
108 | /**
109 | * 移动文件到回收站
110 | * @param userId 用户id
111 | * @param fileIds 文件id
112 | */
113 | void removeFile2RecycleBatch(String userId, String fileIds);
114 |
115 | /**
116 | * 还原文件
117 | * @param userId
118 | * @param fileIds
119 | */
120 | void recoverFileBatch(String userId, String fileIds);
121 |
122 | /**
123 | * 彻底删除文件
124 | * @param userId 用户id
125 | * @param fileIds 文件id
126 | * @param adminOp 是否是管理员
127 | */
128 | void delFileBatch(String userId, String fileIds, Boolean adminOp);
129 |
130 | void checkRootFilePid(String rootFilePid, String userId, String fileId);
131 |
132 | void saveShare(String shareRootFilePid, String shareFileIds, String myFolderId, String shareUserId, String cureentUserId);
133 |
134 | Long getUserUseSpace(@Param("userId") String userId);
135 |
136 | void deleteFileByUserId(@Param("userId") String userId);
137 | }
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/service/FileShareService.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.service;
2 |
3 | import xyz.kbws.entity.dto.SessionShareDto;
4 | import xyz.kbws.entity.po.FileShare;
5 | import xyz.kbws.entity.query.FileShareQuery;
6 | import xyz.kbws.entity.vo.PaginationResultVO;
7 |
8 | import java.util.List;
9 |
10 |
11 | /**
12 | * 分享信息 业务接口
13 | */
14 | public interface FileShareService {
15 |
16 | /**
17 | * 根据条件查询列表
18 | */
19 | List findListByParam(FileShareQuery param);
20 |
21 | /**
22 | * 根据条件查询列表
23 | */
24 | Integer findCountByParam(FileShareQuery param);
25 |
26 | /**
27 | * 分页查询
28 | */
29 | PaginationResultVO findListByPage(FileShareQuery param);
30 |
31 | /**
32 | * 新增
33 | */
34 | Integer add(FileShare bean);
35 |
36 | /**
37 | * 批量新增
38 | */
39 | Integer addBatch(List listBean);
40 |
41 | /**
42 | * 批量新增/修改
43 | */
44 | Integer addOrUpdateBatch(List listBean);
45 |
46 | /**
47 | * 根据ShareId查询对象
48 | */
49 | FileShare getFileShareByShareId(String shareId);
50 |
51 |
52 | /**
53 | * 根据ShareId修改
54 | */
55 | Integer updateFileShareByShareId(FileShare bean, String shareId);
56 |
57 |
58 | /**
59 | * 根据ShareId删除
60 | */
61 | Integer deleteFileShareByShareId(String shareId);
62 |
63 | void saveShare(FileShare share);
64 |
65 | void deleteFileShareBatch(String[] shareIdArray, String userId);
66 |
67 | SessionShareDto checkShareCode(String shareId, String code);
68 | }
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/service/UserInfoService.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.service;
2 |
3 | import java.util.List;
4 |
5 | import xyz.kbws.entity.dto.SessionWebUserDto;
6 | import xyz.kbws.entity.query.UserInfoQuery;
7 | import xyz.kbws.entity.po.UserInfo;
8 | import xyz.kbws.entity.vo.PaginationResultVO;
9 |
10 |
11 | /**
12 | * 用户信息 业务接口
13 | */
14 | public interface UserInfoService {
15 |
16 | /**
17 | * 根据条件查询列表
18 | */
19 | List findListByParam(UserInfoQuery param);
20 |
21 | /**
22 | * 根据条件查询列表
23 | */
24 | Integer findCountByParam(UserInfoQuery param);
25 |
26 | /**
27 | * 分页查询
28 | */
29 | PaginationResultVO findListByPage(UserInfoQuery param);
30 |
31 | /**
32 | * 新增
33 | */
34 | Integer add(UserInfo bean);
35 |
36 | /**
37 | * 批量新增
38 | */
39 | Integer addBatch(List listBean);
40 |
41 | /**
42 | * 批量新增/修改
43 | */
44 | Integer addOrUpdateBatch(List listBean);
45 |
46 | /**
47 | * 多条件更新
48 | */
49 | Integer updateByParam(UserInfo bean,UserInfoQuery param);
50 |
51 | /**
52 | * 多条件删除
53 | */
54 | Integer deleteByParam(UserInfoQuery param);
55 |
56 | /**
57 | * 根据UserId查询对象
58 | */
59 | UserInfo getUserInfoByUserId(String userId);
60 |
61 |
62 | /**
63 | * 根据UserId修改
64 | */
65 | Integer updateUserInfoByUserId(UserInfo bean,String userId);
66 |
67 |
68 | /**
69 | * 根据UserId删除
70 | */
71 | Integer deleteUserInfoByUserId(String userId);
72 |
73 |
74 | /**
75 | * 根据Email查询对象
76 | */
77 | UserInfo getUserInfoByEmail(String email);
78 |
79 |
80 | /**
81 | * 根据Email修改
82 | */
83 | Integer updateUserInfoByEmail(UserInfo bean,String email);
84 |
85 |
86 | /**
87 | * 根据Email删除
88 | */
89 | Integer deleteUserInfoByEmail(String email);
90 |
91 |
92 | /**
93 | * 根据NickName查询对象
94 | */
95 | UserInfo getUserInfoByNickName(String nickName);
96 |
97 |
98 | /**
99 | * 根据NickName修改
100 | */
101 | Integer updateUserInfoByNickName(UserInfo bean,String nickName);
102 |
103 |
104 | /**
105 | * 根据NickName删除
106 | */
107 | Integer deleteUserInfoByNickName(String nickName);
108 |
109 |
110 | /**
111 | * 根据QqOpenId查询对象
112 | */
113 | UserInfo getUserInfoByQqOpenId(String qqOpenId);
114 |
115 |
116 | /**
117 | * 根据QqOpenId修改
118 | */
119 | Integer updateUserInfoByQqOpenId(UserInfo bean,String qqOpenId);
120 |
121 |
122 | /**
123 | * 根据QqOpenId删除
124 | */
125 | Integer deleteUserInfoByQqOpenId(String qqOpenId);
126 |
127 | /**
128 | * 用户注册
129 | */
130 | void register(String email, String nickName, String password, String mailCode);
131 |
132 | /**
133 | * 登录
134 | */
135 | SessionWebUserDto login(String email, String password);
136 |
137 | /**
138 | * 重置密码
139 | */
140 | void resetPwd(String email, String password, String emailCode);
141 | /**
142 | * QQ登录
143 | */
144 | SessionWebUserDto qqLogin(String code);
145 |
146 | /**
147 | * 更改用户状态
148 | */
149 | void updateUserStatus(String userId, Integer status);
150 |
151 | /**
152 | * 更改用户使用空间
153 | */
154 | void changeUserSpace(String userId, Integer changeSpace);
155 | }
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/task/FileCleanTask.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.task;
2 |
3 | import org.springframework.scheduling.annotation.Scheduled;
4 | import org.springframework.stereotype.Component;
5 | import xyz.kbws.entity.enums.FileDelFlagEnum;
6 | import xyz.kbws.entity.po.FileInfo;
7 | import xyz.kbws.entity.query.FileInfoQuery;
8 | import xyz.kbws.service.FileInfoService;
9 |
10 | import javax.annotation.Resource;
11 | import java.util.List;
12 | import java.util.Map;
13 | import java.util.stream.Collectors;
14 |
15 | @Component
16 | public class FileCleanTask {
17 | @Resource
18 | private FileInfoService fileInfoService;
19 |
20 | @Scheduled(fixedDelay = 1000 * 60 * 3)
21 | public void execute(){
22 | FileInfoQuery query = new FileInfoQuery();
23 | query.setDelFlag(FileDelFlagEnum.RECYCLE.getFlag());
24 | query.setQueryExpire(true);
25 | List fileInfoList = fileInfoService.findListByParam(query);
26 | Map> filenfoMap = fileInfoList.stream().collect(Collectors.groupingBy(FileInfo::getUserId));
27 | for (Map.Entry> entry : filenfoMap.entrySet()){
28 | List fileIds = entry.getValue().stream().map(p -> p.getFileId()).collect(Collectors.toList());
29 | fileInfoService.delFileBatch(entry.getKey(), String.join(",", fileIds), false);
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/utils/CopyTools.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.utils;
2 |
3 | import org.springframework.beans.BeanUtils;
4 |
5 | import java.util.ArrayList;
6 | import java.util.List;
7 |
8 | public class CopyTools {
9 | public static List copyList(List sList, Class classz) {
10 | List list = new ArrayList();
11 | for (S s : sList) {
12 | T t = null;
13 | try {
14 | t = classz.newInstance();
15 | } catch (Exception e) {
16 | e.printStackTrace();
17 | }
18 | BeanUtils.copyProperties(s, t);
19 | list.add(t);
20 | }
21 | return list;
22 | }
23 |
24 | public static T copy(S s, Class classz) {
25 | T t = null;
26 | try {
27 | t = classz.newInstance();
28 | } catch (Exception e) {
29 | e.printStackTrace();
30 | }
31 | BeanUtils.copyProperties(s, t);
32 | return t;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/utils/DateUtil.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.utils;
2 |
3 |
4 | import xyz.kbws.entity.enums.DateTimePatternEnum;
5 |
6 | import java.text.ParseException;
7 | import java.text.SimpleDateFormat;
8 | import java.util.Calendar;
9 | import java.util.Date;
10 | import java.util.HashMap;
11 | import java.util.Map;
12 |
13 | public class DateUtil {
14 |
15 | private static final Object lockObj = new Object();
16 | private static Map> sdfMap = new HashMap>();
17 |
18 | private static SimpleDateFormat getSdf(final String pattern) {
19 | ThreadLocal tl = sdfMap.get(pattern);
20 | if (tl == null) {
21 | synchronized (lockObj) {
22 | tl = sdfMap.get(pattern);
23 | if (tl == null) {
24 | tl = new ThreadLocal() {
25 | @Override
26 | protected SimpleDateFormat initialValue() {
27 | return new SimpleDateFormat(pattern);
28 | }
29 | };
30 | sdfMap.put(pattern, tl);
31 | }
32 | }
33 | }
34 |
35 | return tl.get();
36 | }
37 |
38 | public static String format(Date date, String pattern) {
39 | return getSdf(pattern).format(date);
40 | }
41 |
42 | public static Date parse(String dateStr, String pattern) {
43 | try {
44 | return getSdf(pattern).parse(dateStr);
45 | } catch (ParseException e) {
46 | e.printStackTrace();
47 | }
48 | return new Date();
49 | }
50 |
51 | public static Date getAfterDate(Integer day) {
52 | Calendar calendar = Calendar.getInstance();
53 | calendar.add(Calendar.DAY_OF_YEAR, day);
54 | return calendar.getTime();
55 | }
56 |
57 | public static void main(String[] args) {
58 | System.out.println(format(getAfterDate(1), DateTimePatternEnum.YYYY_MM_DD_HH_MM_SS.getPattern()));
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/utils/JsonUtils.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.utils;
2 |
3 | import com.alibaba.fastjson.JSON;
4 | import com.alibaba.fastjson.JSONArray;
5 | import com.alibaba.fastjson.JSONObject;
6 | import org.slf4j.Logger;
7 | import org.slf4j.LoggerFactory;
8 |
9 | import java.util.List;
10 |
11 | public class JsonUtils {
12 | private static final Logger logger = LoggerFactory.getLogger(JsonUtils.class);
13 | public static String converObj2Json(Object obj){
14 | return JSON.toJSONString(obj);
15 | }
16 | public static T converJson2Obj(String json, Class classz){
17 | return JSONObject.parseObject(json, classz);
18 | }
19 | public static List converJsonArray2List(String json, Class classz){
20 | return JSONArray.parseArray(json, classz);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/utils/OKHttpUtils.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.utils;
2 |
3 | import okhttp3.OkHttpClient;
4 | import okhttp3.Request;
5 | import okhttp3.Response;
6 | import okhttp3.ResponseBody;
7 | import org.slf4j.Logger;
8 | import org.slf4j.LoggerFactory;
9 | import xyz.kbws.entity.enums.ResponseCodeEnum;
10 | import xyz.kbws.exception.BusinessException;
11 |
12 | import java.net.ConnectException;
13 | import java.net.SocketException;
14 | import java.net.SocketTimeoutException;
15 | import java.util.Map;
16 | import java.util.concurrent.TimeUnit;
17 |
18 | public class OKHttpUtils {
19 | public static final int TIME_OUT_SECOND = 0;
20 |
21 | public static final Logger logger = LoggerFactory.getLogger(OKHttpUtils.class);
22 | private static OkHttpClient.Builder getCulientBuilder(){
23 | OkHttpClient.Builder builder = new OkHttpClient.Builder().followRedirects(false).retryOnConnectionFailure(false);
24 | builder.connectTimeout(TIME_OUT_SECOND, TimeUnit.SECONDS).readTimeout(TIME_OUT_SECOND, TimeUnit.SECONDS);
25 | return builder;
26 | }
27 |
28 | private static Request.Builder getRequestBuilder(Map header){
29 | Request.Builder requestBuilder = new Request.Builder();
30 | if (header != null){
31 | for (Map.Entry map : header.entrySet()){
32 | String key = map.getKey();
33 | String value;
34 | if (map.getValue() == null){
35 | value = "";
36 | }else{
37 | value = map.getValue();
38 | }
39 | requestBuilder.addHeader(key, value);
40 | }
41 | }
42 | return requestBuilder;
43 | }
44 |
45 | public static String getRequest(String url){
46 | ResponseBody responseBody = null;
47 | try {
48 | OkHttpClient.Builder clientBuilder = getCulientBuilder();
49 | Request.Builder requestBuilder = getRequestBuilder(null);
50 | OkHttpClient client = clientBuilder.build();
51 | Request request = requestBuilder.url(url).build();
52 | Response response = client.newCall(request).execute();
53 | responseBody = response.body();
54 | String responseStr = responseBody.string();
55 | logger.info("postRequest请求地址:{},返回信息:{}", url, responseStr);
56 | return responseStr;
57 | }catch (SocketTimeoutException | ConnectException e){
58 | logger.error("OKHttp POST 请求超时,url:{}",url, e);
59 | throw new BusinessException(ResponseCodeEnum.CODE_500);
60 | }catch (Exception e){
61 | logger.error("OKHtp GET 请求异常",e);
62 | return null;
63 | }finally {
64 | if (responseBody != null){
65 | responseBody.close();
66 | }
67 | }
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/utils/ProcessUtils.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.utils;
2 |
3 | import org.slf4j.Logger;
4 | import org.slf4j.LoggerFactory;
5 | import xyz.kbws.exception.BusinessException;
6 |
7 | import java.io.*;
8 |
9 | public class ProcessUtils {
10 | private static final Logger logger = LoggerFactory.getLogger(ProcessUtils.class);
11 |
12 | public static String executeCommand(String cmd, Boolean outprintLog) throws BusinessException{
13 | if (StringTools.isEmpty(cmd)){
14 | logger.error("指令执行失败,要执行的指令为空");
15 | return null;
16 | }
17 |
18 | Runtime runtime = Runtime.getRuntime();
19 | Process process = null;
20 | try {
21 | process = Runtime.getRuntime().exec(cmd);
22 | /**
23 | * 执行ffmpeg指令
24 | * 取出输出流和错误流的信息
25 | * 注意:必须取出ffmpeg在执行命令过程中产生的输出信息,如果不取出的话输出流信息填满JVM存储输出信息的缓冲区时线程就会阻塞
26 | */
27 | PrintStream errorStream = new PrintStream(process.getErrorStream());
28 | PrintStream inputStream = new PrintStream(process.getInputStream());
29 | errorStream.start();
30 | inputStream.start();
31 | //等待ffmpeg命令执行完毕
32 | process.waitFor();
33 | //获取执行结果字符串
34 | String result = errorStream.stringBuffer.append(inputStream.stringBuffer + "\n").toString();
35 | //输出执行的命令信息
36 |
37 | if (outprintLog){
38 | logger.info("执行命令:{},已执行完毕,执行结果:{}", cmd, result);
39 | }else {
40 | logger.info("执行命令:{},已执行完毕", cmd);
41 | }
42 | return result;
43 | }catch (Exception e){
44 | e.printStackTrace();
45 | throw new BusinessException("视频转换失败");
46 | }finally {
47 | if (process != null){
48 | ProcessKiller processKiller = new ProcessKiller(process);
49 | runtime.addShutdownHook(processKiller);
50 | }
51 | }
52 | }
53 |
54 | /**
55 | * 在程序退出前结束已有的ffmpeg进程
56 | */
57 | public static class ProcessKiller extends Thread{
58 | private Process process;
59 |
60 | public ProcessKiller(Process process){
61 | this.process = process;
62 | }
63 |
64 | @Override
65 | public void run() {
66 | this.process.destroy();
67 | }
68 | }
69 |
70 | /**
71 | * 用于取出ffmpeg线程执行过程中产生的各种输出和错误流信息
72 | */
73 | static class PrintStream extends Thread{
74 | InputStream inputStream = null;
75 | BufferedReader bufferedReader = null;
76 | StringBuffer stringBuffer = new StringBuffer();
77 |
78 | public PrintStream(InputStream inputStream){
79 | this.inputStream = inputStream;
80 | }
81 |
82 | @Override
83 | public void run() {
84 | try {
85 | if (inputStream == null){
86 | return;
87 | }
88 | bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
89 | String line = null;
90 | while ((line = bufferedReader.readLine()) != null){
91 | stringBuffer.append(line);
92 | }
93 | }catch (Exception e){
94 | logger.error("读取输入流出错了!错误信息:" + e.getMessage());
95 | }finally {
96 | try {
97 | if (bufferedReader != null){
98 | bufferedReader.close();
99 | }
100 | if (inputStream != null){
101 | inputStream.close();
102 | }
103 | }catch (IOException e){
104 | logger.error("调用PrintStream读取输出流后,关闭流时出错!");
105 | }
106 | }
107 | }
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/utils/ScaleFiler.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.utils;
2 |
3 | import org.apache.commons.io.FileUtils;
4 | import org.slf4j.Logger;
5 | import org.slf4j.LoggerFactory;
6 |
7 | import javax.imageio.ImageIO;
8 | import java.awt.image.BufferedImage;
9 | import java.io.BufferedReader;
10 | import java.io.File;
11 |
12 | public class ScaleFiler {
13 | private static final Logger logger = LoggerFactory.getLogger(ScaleFiler.class);
14 |
15 | public static void createCover4Video(File sourceFile, Integer width, File targetFile){
16 | try {
17 | String cmd = "ffmpeg -i %s -y -vframes 1 -vf scale=%d:%d/a %s";
18 | ProcessUtils.executeCommand(String.format(cmd, sourceFile.getAbsoluteFile(),width, width, targetFile.getAbsoluteFile()), false);
19 |
20 | }catch (Exception e){
21 | logger.error("生成视频封面失败",e);
22 | }
23 | }
24 |
25 | public static Boolean createThumbnailWidthFFmpeg(File file, int thumbnailWidth, File targetFile, Boolean delSource){
26 | try {
27 | BufferedImage src = ImageIO.read(file);
28 | //thumbnailWidth 缩略图宽度 thumbnailHeight 缩略图高度
29 | int sorceW = src.getWidth();
30 | int sorceH = src.getHeight();
31 | //小于指定高宽不压缩
32 | if (sorceW <= thumbnailWidth){
33 | return false;
34 | }
35 | compressImage(file, thumbnailWidth, targetFile, delSource);
36 | return true;
37 | }catch (Exception e){
38 | e.printStackTrace();
39 | }
40 | return false;
41 | }
42 |
43 | public static void compressImage(File sourceFile, Integer width, File targetFile, Boolean delSource){
44 | try {
45 | String cmd = "ffmpeg -i %s -vf scale=%d:-1 %s -y";
46 | ProcessUtils.executeCommand(String.format(cmd, sourceFile.getAbsoluteFile(), width, targetFile.getAbsoluteFile()), false);
47 | if (delSource){
48 | FileUtils.forceDelete(sourceFile);
49 | }
50 | }catch (Exception e){
51 | logger.error("压缩图片失败");
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/utils/StringTools.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.utils;
2 | import org.apache.commons.codec.digest.DigestUtils;
3 | import org.apache.commons.lang3.RandomStringUtils;
4 | import org.apache.commons.lang3.RandomUtils;
5 | import xyz.kbws.entity.constants.Constants;
6 | import xyz.kbws.exception.BusinessException;
7 | import java.lang.reflect.Field;
8 | import java.lang.reflect.Method;
9 |
10 |
11 | public class StringTools {
12 |
13 | public static void checkParam(Object param) {
14 | try {
15 | Field[] fields = param.getClass().getDeclaredFields();
16 | boolean notEmpty = false;
17 | for (Field field : fields) {
18 | String methodName = "get" + StringTools.upperCaseFirstLetter(field.getName());
19 | Method method = param.getClass().getMethod(methodName);
20 | Object object = method.invoke(param);
21 | if (object != null && object instanceof java.lang.String && !StringTools.isEmpty(object.toString())
22 | || object != null && !(object instanceof java.lang.String)) {
23 | notEmpty = true;
24 | break;
25 | }
26 | }
27 | if (!notEmpty) {
28 | throw new BusinessException("多参数更新,删除,必须有非空条件");
29 | }
30 | } catch (BusinessException e) {
31 | throw e;
32 | } catch (Exception e) {
33 | e.printStackTrace();
34 | throw new BusinessException("校验参数是否为空失败");
35 | }
36 | }
37 |
38 | public static String upperCaseFirstLetter(String field) {
39 | if (isEmpty(field)) {
40 | return field;
41 | }
42 | //如果第二个字母是大写,第一个字母不大写
43 | if (field.length() > 1 && Character.isUpperCase(field.charAt(1))) {
44 | return field;
45 | }
46 | return field.substring(0, 1).toUpperCase() + field.substring(1);
47 | }
48 |
49 | public static boolean isEmpty(String str) {
50 | if (null == str || "".equals(str) || "null".equals(str) || "\u0000".equals(str)) {
51 | return true;
52 | } else if ("".equals(str.trim())) {
53 | return true;
54 | }
55 | return false;
56 | }
57 |
58 | public static final String getRandomNumber(Integer count){
59 | return RandomStringUtils.random(count,false,true);
60 | }
61 | public static final String getRandomString(Integer count){
62 | return RandomStringUtils.random(count,true,true);
63 | }
64 |
65 | public static String encodingByMd5(String originString){
66 | return isEmpty(originString)?null: DigestUtils.md5Hex(originString);
67 | }
68 |
69 | public static boolean pathIsOk(String path){
70 | if (StringTools.isEmpty(path)){
71 | return true;
72 | }
73 | if (path.contains("../") || path.contains("..\\")){
74 | return false;
75 | }
76 | return true;
77 | }
78 |
79 | public static String rename(String fileName){
80 | String fileNameReal = getFileNameNoSuffix(fileName);
81 | String suffix= getFileSuffix(fileName);
82 | return fileNameReal+"_"+getRandomString(Constants.LENGTH_5)+suffix;
83 | }
84 |
85 | public static String getFileNameNoSuffix(String fileName){
86 | Integer index = fileName.lastIndexOf(".");
87 | if (index == -1){
88 | return fileName;
89 | }
90 | fileName = fileName.substring(0,index);
91 | return fileName;
92 | }
93 |
94 | public static String getFileSuffix(String fileName){
95 | Integer index = fileName.lastIndexOf(".");
96 | if (index == -1){
97 | return "";
98 | }
99 | String suffix = fileName.substring(index);
100 | return suffix;
101 | }
102 | }
103 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/java/xyz/kbws/utils/VerifyUtils.java:
--------------------------------------------------------------------------------
1 | package xyz.kbws.utils;
2 |
3 | import xyz.kbws.entity.enums.VerifyRegexEnum;
4 |
5 | import java.util.regex.Matcher;
6 | import java.util.regex.Pattern;
7 |
8 | public class VerifyUtils {
9 | public static boolean verify(String regex, String value){
10 | if (StringTools.isEmpty(value)){
11 | return false;
12 | }
13 | Pattern pattern = Pattern.compile(regex);
14 | Matcher matcher = pattern.matcher(value);
15 | return matcher.matches();
16 | }
17 |
18 | public static boolean verify(VerifyRegexEnum regex, String value){
19 | return verify(regex.getRegex(), value);
20 | }
21 |
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/resources/application-cloud.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 7090
3 |
4 | spring:
5 | # 数据库配置
6 | datasource:
7 | url: jdbc:mysql://127.0.0.1:3306/netdisk?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true
8 | username: root
9 | password: hsy031122
10 | driver-class-name: com.mysql.cj.jdbc.Driver
11 | hikari:
12 | pool-name: HikariCPDatasource
13 | minimum-idle: 5
14 | idle-timeout: 180000
15 | maximum-pool-size: 10
16 | auto-commit: true
17 | max-lifetime: 1800000
18 | connection-timeout: 30000
19 | connection-test-query: SELECT 1
20 |
21 | #项目目录
22 | project:
23 | folder: E:/Project/Netdisk
24 |
25 | #日志级别配置
26 | log:
27 | root:
28 | level: info
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/resources/application-local.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 7090
3 |
4 | spring:
5 | # 数据库配置
6 | datasource:
7 | url: jdbc:mysql://127.0.0.1:3306/netdisk?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true
8 | username: root
9 | password: hsy031122
10 | driver-class-name: com.mysql.cj.jdbc.Driver
11 | hikari:
12 | pool-name: HikariCPDatasource
13 | minimum-idle: 5
14 | idle-timeout: 180000
15 | maximum-pool-size: 10
16 | auto-commit: true
17 | max-lifetime: 1800000
18 | connection-timeout: 30000
19 | connection-test-query: SELECT 1
20 |
21 | #项目目录
22 | project:
23 | folder: D:/Data/Project/Netdisk/
24 |
25 | #日志级别配置
26 | log:
27 | root:
28 | level: debug
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 7090
3 | servlet:
4 | context-path: /api
5 | # session过期时间 60M 一个小时
6 | session:
7 | timeout: PT60M
8 | spring:
9 | # 配置文件
10 | profiles:
11 | active: local
12 | servlet:
13 | multipart:
14 | max-file-size: 15MB
15 | max-request-size: 15MB
16 | mvc:
17 | # 异常处理
18 | throw-exception-if-no-handler-found: true
19 | web:
20 | resources:
21 | add-mappings: false
22 | # 数据库配置
23 | datasource:
24 | url: jdbc:mysql://127.0.0.1:3306/netdisk?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true
25 | username: root
26 | password: hsy031122
27 | driver-class-name: com.mysql.cj.jdbc.Driver
28 | hikari:
29 | pool-name: HikariCPDatasource
30 | minimum-idle: 5
31 | idle-timeout: 180000
32 | maximum-pool-size: 10
33 | auto-commit: true
34 | max-lifetime: 1800000
35 | connection-timeout: 30000
36 | connection-test-query: SELECT 1
37 | # 发送邮件相关配置
38 | mail:
39 | # 配置邮件服务器的地址
40 | host: smtp.163.com
41 | # 配置邮件服务器的端口
42 | port: 465
43 | # 配置用户的账号
44 | username: hsy040506@163.com
45 | # 配置授权码
46 | password: PIFASGVRTVXTJRNL
47 | # 配置默认编码
48 | default-encoding: UTF-8
49 | properties:
50 | # SSL 连接配置
51 | mail:
52 | smtp:
53 | socketFactory: javax.net.ssl.SSLSocketFactory
54 | # 开启 debug,这样方便开发者查看邮件发送日志
55 | debug: true
56 | protocol: smtps
57 | # Redis配置
58 | redis:
59 | # Redis数据库索引(默认为0)
60 | database: 0
61 | host: 127.0.0.1
62 | port: 6379
63 | jedis:
64 | pool:
65 | # 连接池最大连接数(使用负值表示没有限制)
66 | max-active: 20
67 | # 连接池最大阻塞等待时间(使用负值表示没有限制)
68 | max-wait: -1
69 | # 连接池中的最大空闲连接
70 | max-idle: 10
71 | # 连接池中的最小空闲连接
72 | min-idle: 0
73 | # 连接超时时间(毫秒)
74 | timeout: 2000
75 |
76 | #超级管理员id
77 | admin:
78 | emails: hsy040506@163.com
79 |
80 | #是否是开发环境
81 | dev: true
82 |
83 | # qq登陆相关
84 | qq:
85 | app:
86 | id: 12333
87 | key: 2222222
88 | url:
89 | authorization: https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=%s&redirect_uri=%s&state=%s
90 | access:
91 | token: https://graph.qq.com/oauth2.0/token?grant_type=authorization_code&client_id=%s&client_secret=%s&code=%s&redirect_uri=%s
92 | openid: https://graph.qq.com/oauth2.0/me?access_token=%S
93 | user:
94 | info: https://graph.qq.com/user/get_user_info?access_token=%s&oauth_consumer_key=%s&openid=%s
95 | redirect: http://easypan.wuhancoder.com/qqlogincalback
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/resources/logback-spring.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | %d{yyyy-MM-dd HH:mm:ss,GMT+8} [%p][%c][%M][%L]-> %m%n
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | ${log.path}/${LOG_FOLDER}/${LOG_FILE_NAME}
17 |
18 | ${log.path}/${LOG_FOLDER}/${LOG_FILE_NAME}.%d{yyyyMMdd}.%i
19 | true
20 |
21 | 20MB
22 |
23 | 30
24 |
25 |
26 | utf-8
27 | %d{yyyy-MM-dd HH:mm:ss,GMT+8} [%p][%c][%M][%L]-> %m%n
28 |
29 | false
30 | false
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/Netdisk-pan/src/main/resources/rebel.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 | Netdisk-pan
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/application-cloud.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 7090
3 |
4 | spring:
5 | # 数据库配置
6 | datasource:
7 | url: jdbc:mysql://127.0.0.1:3306/netdisk?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true
8 | username: root
9 | password: hsy031122
10 | driver-class-name: com.mysql.cj.jdbc.Driver
11 | hikari:
12 | pool-name: HikariCPDatasource
13 | minimum-idle: 5
14 | idle-timeout: 180000
15 | maximum-pool-size: 10
16 | auto-commit: true
17 | max-lifetime: 1800000
18 | connection-timeout: 30000
19 | connection-test-query: SELECT 1
20 |
21 | #项目目录
22 | project:
23 | folder: E:/Project/Netdisk
24 |
25 | #日志级别配置
26 | log:
27 | root:
28 | level: info
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/application-local.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 7090
3 |
4 | spring:
5 | # 数据库配置
6 | datasource:
7 | url: jdbc:mysql://127.0.0.1:3306/netdisk?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true
8 | username: root
9 | password: hsy031122
10 | driver-class-name: com.mysql.cj.jdbc.Driver
11 | hikari:
12 | pool-name: HikariCPDatasource
13 | minimum-idle: 5
14 | idle-timeout: 180000
15 | maximum-pool-size: 10
16 | auto-commit: true
17 | max-lifetime: 1800000
18 | connection-timeout: 30000
19 | connection-test-query: SELECT 1
20 |
21 | #项目目录
22 | project:
23 | folder: D:/Data/Project/Netdisk/
24 |
25 | #日志级别配置
26 | log:
27 | root:
28 | level: debug
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 7090
3 | servlet:
4 | context-path: /api
5 | # session过期时间 60M 一个小时
6 | session:
7 | timeout: PT60M
8 | spring:
9 | # 配置文件
10 | profiles:
11 | active: local
12 | servlet:
13 | multipart:
14 | max-file-size: 15MB
15 | max-request-size: 15MB
16 | mvc:
17 | # 异常处理
18 | throw-exception-if-no-handler-found: true
19 | web:
20 | resources:
21 | add-mappings: false
22 | # 数据库配置
23 | datasource:
24 | url: jdbc:mysql://127.0.0.1:3306/netdisk?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true
25 | username: root
26 | password: hsy031122
27 | driver-class-name: com.mysql.cj.jdbc.Driver
28 | hikari:
29 | pool-name: HikariCPDatasource
30 | minimum-idle: 5
31 | idle-timeout: 180000
32 | maximum-pool-size: 10
33 | auto-commit: true
34 | max-lifetime: 1800000
35 | connection-timeout: 30000
36 | connection-test-query: SELECT 1
37 | # 发送邮件相关配置
38 | mail:
39 | # 配置邮件服务器的地址
40 | host: smtp.163.com
41 | # 配置邮件服务器的端口
42 | port: 465
43 | # 配置用户的账号
44 | username: hsy040506@163.com
45 | # 配置授权码
46 | password: PIFASGVRTVXTJRNL
47 | # 配置默认编码
48 | default-encoding: UTF-8
49 | properties:
50 | # SSL 连接配置
51 | mail:
52 | smtp:
53 | socketFactory: javax.net.ssl.SSLSocketFactory
54 | # 开启 debug,这样方便开发者查看邮件发送日志
55 | debug: true
56 | protocol: smtps
57 | # Redis配置
58 | redis:
59 | # Redis数据库索引(默认为0)
60 | database: 0
61 | host: 127.0.0.1
62 | port: 6379
63 | jedis:
64 | pool:
65 | # 连接池最大连接数(使用负值表示没有限制)
66 | max-active: 20
67 | # 连接池最大阻塞等待时间(使用负值表示没有限制)
68 | max-wait: -1
69 | # 连接池中的最大空闲连接
70 | max-idle: 10
71 | # 连接池中的最小空闲连接
72 | min-idle: 0
73 | # 连接超时时间(毫秒)
74 | timeout: 2000
75 |
76 | #超级管理员id
77 | admin:
78 | emails: hsy040506@163.com
79 |
80 | #是否是开发环境
81 | dev: true
82 |
83 | # qq登陆相关
84 | qq:
85 | app:
86 | id: 12333
87 | key: 2222222
88 | url:
89 | authorization: https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=%s&redirect_uri=%s&state=%s
90 | access:
91 | token: https://graph.qq.com/oauth2.0/token?grant_type=authorization_code&client_id=%s&client_secret=%s&code=%s&redirect_uri=%s
92 | openid: https://graph.qq.com/oauth2.0/me?access_token=%S
93 | user:
94 | info: https://graph.qq.com/user/get_user_info?access_token=%s&oauth_consumer_key=%s&openid=%s
95 | redirect: http://easypan.wuhancoder.com/qqlogincalback
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/logback-spring.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | %d{yyyy-MM-dd HH:mm:ss,GMT+8} [%p][%c][%M][%L]-> %m%n
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | ${log.path}/${LOG_FOLDER}/${LOG_FILE_NAME}
17 |
18 | ${log.path}/${LOG_FOLDER}/${LOG_FILE_NAME}.%d{yyyyMMdd}.%i
19 | true
20 |
21 | 20MB
22 |
23 | 30
24 |
25 |
26 | utf-8
27 | %d{yyyy-MM-dd HH:mm:ss,GMT+8} [%p][%c][%M][%L]-> %m%n
28 |
29 | false
30 | false
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/rebel.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 | Netdisk-pan
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/NetDiskPanApplication.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/NetDiskPanApplication.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/annotation/GlobalInterceptor.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/annotation/GlobalInterceptor.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/annotation/VerifyParam.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/annotation/VerifyParam.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/component/RedisUtils.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/component/RedisUtils.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/entity/config/AppConfig.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/entity/config/AppConfig.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/entity/dto/CreateImageCode.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/entity/dto/CreateImageCode.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/entity/dto/SessionWebUserDto.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/entity/dto/SessionWebUserDto.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/entity/dto/SysSettingsDto.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/entity/dto/SysSettingsDto.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/entity/dto/UserSpaceDto.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/entity/dto/UserSpaceDto.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/entity/enums/DateTimePatternEnum.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/entity/enums/DateTimePatternEnum.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/entity/enums/PageSize.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/entity/enums/PageSize.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/entity/enums/ResponseCodeEnum.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/entity/enums/ResponseCodeEnum.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/entity/enums/UserStatusEnum.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/entity/enums/UserStatusEnum.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/entity/enums/VerifyRegexEnum.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/entity/enums/VerifyRegexEnum.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/entity/po/EmailCode.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/entity/po/EmailCode.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/entity/po/UserInfo.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/entity/po/UserInfo.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/entity/query/BaseParam.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/entity/query/BaseParam.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/entity/query/EmailCodeQuery.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/entity/query/EmailCodeQuery.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/entity/query/SimplePage.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/entity/query/SimplePage.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/entity/query/UserInfoQuery.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/entity/query/UserInfoQuery.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/entity/vo/PaginationResultVO.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/entity/vo/PaginationResultVO.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/entity/vo/ResponseVO.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/entity/vo/ResponseVO.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/exception/BusinessException.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/exception/BusinessException.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/mappers/BaseMapper.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/mappers/BaseMapper.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/mappers/EmailCodeMapper.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/mappers/EmailCodeMapper.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/mappers/UserInfoMapper.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/mappers/UserInfoMapper.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/service/EmailCodeService.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/service/EmailCodeService.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/service/UserInfoService.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/service/UserInfoService.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/utils/DateUtil$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/utils/DateUtil$1.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/utils/DateUtil.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/utils/DateUtil.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/classes/xyz/kbws/utils/VerifyUtils.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/Netdisk-pan/target/classes/xyz/kbws/utils/VerifyUtils.class
--------------------------------------------------------------------------------
/Netdisk-pan/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst:
--------------------------------------------------------------------------------
1 | xyz\kbws\entity\po\UserInfo.class
2 | xyz\kbws\entity\query\SimplePage.class
3 | xyz\kbws\service\UserInfoService.class
4 | xyz\kbws\service\impl\UserInfoServiceImpl.class
5 | xyz\kbws\entity\vo\PaginationResultVO.class
6 | xyz\kbws\mapper\UserInfoMapper.class
7 | xyz\kbws\entity\query\UserInfoQuery.class
8 | xyz\kbws\mapper\BaseMapper.class
9 | xyz\kbws\entity\query\BaseQuery.class
10 |
--------------------------------------------------------------------------------
/Netdisk-pan/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst:
--------------------------------------------------------------------------------
1 | E:\Project\Netdisk\Netdisk-pan\src\main\java\xyz\kbws\service\impl\EmailCodeServiceImpl.java
2 | E:\Project\Netdisk\Netdisk-pan\src\main\java\xyz\kbws\controller\AGlobalExceptionHandlerController.java
3 | E:\Project\Netdisk\Netdisk-pan\src\main\java\xyz\kbws\entity\query\EmailCodeQuery.java
4 | E:\Project\Netdisk\Netdisk-pan\src\main\java\xyz\kbws\entity\vo\PaginationResultVO.java
5 | E:\Project\Netdisk\Netdisk-pan\src\main\java\xyz\kbws\service\UserInfoService.java
6 | E:\Project\Netdisk\Netdisk-pan\src\main\java\xyz\kbws\mapper\UserInfoMapper.java
7 | E:\Project\Netdisk\Netdisk-pan\src\main\java\xyz\kbws\service\impl\UserInfoServiceImpl.java
8 | E:\Project\Netdisk\Netdisk-pan\src\main\java\xyz\kbws\entity\vo\ResponseVO.java
9 | E:\Project\Netdisk\Netdisk-pan\src\main\java\xyz\kbws\entity\dto\CreateImageCode.java
10 | E:\Project\Netdisk\Netdisk-pan\src\main\java\xyz\kbws\exception\BusinessException.java
11 | E:\Project\Netdisk\Netdisk-pan\src\main\java\xyz\kbws\utils\StringTools.java
12 | E:\Project\Netdisk\Netdisk-pan\src\main\java\xyz\kbws\entity\enums\DateTimePatternEnum.java
13 | E:\Project\Netdisk\Netdisk-pan\src\main\java\xyz\kbws\controller\ABaseController.java
14 | E:\Project\Netdisk\Netdisk-pan\src\main\java\xyz\kbws\entity\enums\ResponseCodeEnum.java
15 | E:\Project\Netdisk\Netdisk-pan\src\main\java\xyz\kbws\entity\enums\PageSize.java
16 | E:\Project\Netdisk\Netdisk-pan\src\main\java\xyz\kbws\entity\constants\Constants.java
17 | E:\Project\Netdisk\Netdisk-pan\src\main\java\xyz\kbws\NetDiskPanApplication.java
18 | E:\Project\Netdisk\Netdisk-pan\src\main\java\xyz\kbws\utils\DateUtils.java
19 | E:\Project\Netdisk\Netdisk-pan\src\main\java\xyz\kbws\entity\query\SimplePage.java
20 | E:\Project\Netdisk\Netdisk-pan\src\main\java\xyz\kbws\entity\query\UserInfoQuery.java
21 | E:\Project\Netdisk\Netdisk-pan\src\main\java\xyz\kbws\mapper\EmailCodeMapper.java
22 | E:\Project\Netdisk\Netdisk-pan\src\main\java\xyz\kbws\entity\po\UserInfo.java
23 | E:\Project\Netdisk\Netdisk-pan\src\main\java\xyz\kbws\entity\query\BaseQuery.java
24 | E:\Project\Netdisk\Netdisk-pan\src\main\java\xyz\kbws\controller\UserInfoController.java
25 | E:\Project\Netdisk\Netdisk-pan\src\main\java\xyz\kbws\mapper\BaseMapper.java
26 | E:\Project\Netdisk\Netdisk-pan\src\main\java\xyz\kbws\service\EmailCodeService.java
27 | E:\Project\Netdisk\Netdisk-pan\src\main\java\xyz\kbws\entity\po\EmailCode.java
28 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 个人云盘项目
2 | ## 项目描述
3 | 一个仿百度云盘面向C端用户的网盘项目,包括用户注册,QQ快捷登录,文件上传,分片上传,断点断传,秒传,文件在线预览,包括文本、图片、视频、音频、Excel、Word、PDF等文件的在线预览,文件分享等功能
4 |
5 | ## 技术选型
6 |
7 | SpringBoot+Mybatis+MySQL+Redis+ffmpeg
8 |
9 | ## 负责内容
10 |
11 | 1. 用户注册,登录,QQ快捷登录,发送邮箱验证码,找回密码
12 | 2. 文件分片上传,秒传,新建目录,预览,文件重命名,文件移动,文件分享,删除,下载等功能
13 | 3. 文件分享列表,取消分享
14 | 4. 回收站功能,还原文件,彻底删除
15 | 5. 设置模块
16 | 1. 超级管理员角色查询所有用户上传的文件,可以对文件下载,删除
17 | 2. 超级管理员可以对用户进行管理,给用户分配空间,禁用、启用用户
18 | 3. 超级管理员可以对系统进行设置,设置邮箱模板,设置用户注册初始化空间大小
19 | 6. 用户通过分享链接和分享码预览下载其他人分享的文件,同时也可以将文件保存到自己的网盘
20 |
21 | ## 项目难点
22 |
23 | 1. 文件分片上传,通过文件`MD5`实现文件秒传。文件分片上传后,异步对文件进行合并处理,视频文件,调用`ffmpeg`生成视频缩略图,将文件分片成`ts`文件
24 | 2. 通过`Redis`缓存实时计算用户上传过程中空间占用情况
25 | 3. 多级目录线性展示,通过递归查询,查询目录的所有父级目录
26 | 4. 用户上传文件,同一级目录重名文件自动重命名,文件移动,同名文件自动重命名
27 |
28 | ## 项目收获
29 |
30 | 熟悉第三方登录接入流程,比如QQ登录。
31 |
32 | 熟练使用`SpringBoot`,采用`Spring`的`AOP`的注解方式实现了不听的接口权限不一样,比如普通用户和超级管理员权限的区别,同时使用`AOP`和`Java`的反射实现了后端的参数校验
33 |
34 | 使用`Redis`缓存了一些系统设置,用户上传过程中空间使用实时计算,避免反复查询数据库
35 |
36 | 项目中解决了如何实现异步调用事务的问题,解决循环依赖的问题,如何调用第三方插件比如`ffmpeg`来实现对文件的分片处理,合并处理
37 |
38 | 学习到如何从功能点去设计数据库,在数据库设计的时候考虑到后续的扩展,比如文件数据的分表处理,可以根据用户`id hash`取模的方式对文件数据进行分表处理
39 |
40 | 通过`Spring`的核心`AOP`来实现与事务的解耦
41 |
42 |
43 | # Personal cloud disk project
44 | ## Project Description
45 | A network disk project that imitates Baidu Cloud Disk for C-end users, including user registration, QQ quick login, file upload, shard upload, breakpoint interrupt, second transfer, online file preview, including online preview of text, images, videos, audio, Excel, Word, PDF, and other files, and file sharing functions
46 | ## Technical Selection
47 | SpringBoot+Mybatis+MySQL+Redis+ffmpeg
48 | ## Responsible for content
49 | 1. User registration, login, QQ quick login, send email verification code, and retrieve password
50 | 2. File sharding upload, second transfer, new directory creation, preview, file renaming, file movement, file sharing, deletion, download, and other functions
51 | 3. File sharing list, cancel sharing
52 | 4. Recycle Bin function, restore files, completely delete
53 | 5. Setting module
54 | 1. The super administrator role queries all files uploaded by users, allowing them to be downloaded and deleted
55 | 2. Super administrators can manage users, allocate space to users, disable or enable users
56 | 3. Super administrators can set up the system, set email templates, and set the size of user registration initialization space
57 | 6. Users can preview and download files shared by others through sharing links and sharing codes, and also save the files to their own online drive
58 | ## Project difficulties
59 | 1. File sharding upload, achieving file transfer in seconds through file 'MD5'. After the file is sharded and uploaded, asynchronous merging processing is performed on the file. The video file is called 'ffmpeg' to generate a video thumbnail, and the file is sharded into a 'ts' file
60 | 2. Real time calculation of space usage during user upload process through Redis cache
61 | 3. Multilevel directory linear display, using recursive queries to query all parent directories of the directory
62 | 4. When users upload files, files with duplicate names in the same level directory will be automatically renamed. When files are moved, files with the same name will be automatically renamed
63 | ## Project Harvest
64 | Familiar with third-party login and access processes, such as QQ login.
65 | Proficient in using 'SpringBoot', using the annotation method of 'AOP' in 'Spring' to achieve different interface permissions that do not listen to, such as the difference in permissions between regular users and super administrators. At the same time, using reflection from 'AOP' and 'Java' to achieve backend parameter verification
66 |
--------------------------------------------------------------------------------
/dist/assets/@highlightjs-e10ea536.js:
--------------------------------------------------------------------------------
1 | import{H as u}from"./highlight.js-6845818c.js";import{d as c,r as d,w as h,b as t,h as g}from"./@vue-3886a262.js";var i=c({props:{code:{type:String,required:!0},language:{type:String,default:""},autodetect:{type:Boolean,default:!0},ignoreIllegals:{type:Boolean,default:!0}},setup:function(e){var a=d(e.language);h(function(){return e.language},function(n){a.value=n});var r=t(function(){return e.autodetect||!a.value}),o=t(function(){return!r.value&&!u.getLanguage(a.value)});return{className:t(function(){return o.value?"":"hljs "+a.value}),highlightedCode:t(function(){var n;if(o.value)return console.warn('The language "'+a.value+'" you specified could not be found.'),e.code.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'");if(r.value){var l=u.highlightAuto(e.code);return a.value=(n=l.language)!==null&&n!==void 0?n:"",l.value}return(l=u.highlight(e.code,{language:a.value,ignoreIllegals:e.ignoreIllegals})).value})}},render:function(){return g("pre",{},[g("code",{class:this.className,innerHTML:this.highlightedCode})])}}),f={install:function(e){e.component("highlightjs",i)},component:i};export{f as o};
2 |
--------------------------------------------------------------------------------
/dist/assets/FileList-c4c5126f.css:
--------------------------------------------------------------------------------
1 | .top[data-v-86a7c3ad]{margin-top:20px}.top .top-op[data-v-86a7c3ad]{display:flex;align-items:center}.top .top-op .btn[data-v-86a7c3ad]{margin-right:10px}.top .top-op .search-panel[data-v-86a7c3ad]{margin-left:10px;width:300px}.top .top-op .icon-refresh[data-v-86a7c3ad]{cursor:pointer;margin-left:10px}.top .top-op .not-allow[data-v-86a7c3ad]{background:#d2d2d2!important;cursor:not-allowed}.file-list .file-item[data-v-86a7c3ad]{display:flex;align-items:center;padding:6px 0}.file-list .file-item .file-name[data-v-86a7c3ad]{margin-left:8px;flex:1;width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-list .file-item .file-name span[data-v-86a7c3ad]{cursor:pointer}.file-list .file-item .file-name span[data-v-86a7c3ad]:hover{color:#06a7ff}.file-list .file-item .file-name .transfer-status[data-v-86a7c3ad]{font-size:13px;margin-left:10px;color:#e6a23c}.file-list .file-item .file-name .transfer-fail[data-v-86a7c3ad]{color:#f75000}.file-list .file-item .edit-panel[data-v-86a7c3ad]{flex:1;width:0;display:flex;align-items:center;margin:0 5px}.file-list .file-item .edit-panel .iconfont[data-v-86a7c3ad]{margin-left:10px;background:#0c95f7;color:#fff;padding:3px 5px;border-radius:5px;cursor:pointer}.file-list .file-item .edit-panel .not-allow[data-v-86a7c3ad]{cursor:not-allowed;background:#7cb1d7;color:#ddd;text-decoration:none}.file-list .file-item .op[data-v-86a7c3ad]{width:280px;margin-left:15px}.file-list .file-item .op .iconfont[data-v-86a7c3ad]{font-size:13px;margin-left:10px;color:#06a7ff;cursor:pointer}.file-list .file-item .op .iconfont[data-v-86a7c3ad]:before{margin-right:3px}.no-data[data-v-86a7c3ad]{height:calc(100vh - 150px);display:flex;align-items:center;justify-content:center}.no-data .no-data-inner[data-v-86a7c3ad]{text-align:center}.no-data .no-data-inner .tips[data-v-86a7c3ad]{margin-top:10px}.no-data .no-data-inner .op-list[data-v-86a7c3ad]{margin-top:20px;display:flex;justify-content:center;align-items:center}.no-data .no-data-inner .op-list .op-item[data-v-86a7c3ad]{cursor:pointer;width:100px;height:100px;margin:0 10px;padding:5px 0;background:rgb(241,241,241)}.search-panel[data-v-86a7c3ad]{margin-left:0!important}.file-list[data-v-86a7c3ad]{margin-top:10px}.file-list .file-item .op[data-v-86a7c3ad]{width:120px}
2 |
--------------------------------------------------------------------------------
/dist/assets/Framework-940079c4.css:
--------------------------------------------------------------------------------
1 | .avatar-upload{display:flex;justify-content:center;align-items:end}.avatar-upload .avatar-show{background:rgb(245,245,245);width:150px;height:150px;display:flex;align-items:center;justify-content:center;overflow:hidden;position:relative}.avatar-upload .avatar-show .iconfont{font-size:50px;color:#ddd}.avatar-upload .avatar-show img{width:100%;height:100%}.avatar-upload .avatar-show .op{position:absolute;color:#0e8aef;top:80px}.avatar-upload .select-btn{margin-left:10px;vertical-align:bottom}.uploader-panel .uploader-title[data-v-c4b41b7f]{border-bottom:1px solid #ddd;line-height:40px;padding:0 10px;font-size:15px}.uploader-panel .uploader-title .tips[data-v-c4b41b7f]{font-size:13px;color:#a9a9a9}.uploader-panel .file-list[data-v-c4b41b7f]{overflow:auto;padding:10px 0;min-height:50vh;max-height:calc(100vh - 120px)}.uploader-panel .file-list .file-item[data-v-c4b41b7f]{position:relative;display:flex;justify-content:center;align-items:center;padding:3px 10px;background-color:#fff;border-bottom:1px solid #ddd}.uploader-panel .file-list .file-item[data-v-c4b41b7f]:nth-child(even){background-color:#fcf8f4}.uploader-panel .file-list .upload-panel[data-v-c4b41b7f]{flex:1}.uploader-panel .file-list .upload-panel .file-name[data-v-c4b41b7f]{color:#403e3e}.uploader-panel .file-list .upload-panel .upload-status[data-v-c4b41b7f]{display:flex;align-items:center;margin-top:5px}.uploader-panel .file-list .upload-panel .upload-status .iconfont[data-v-c4b41b7f]{margin-right:3px}.uploader-panel .file-list .upload-panel .upload-status .status[data-v-c4b41b7f]{color:red;font-size:13px}.uploader-panel .file-list .upload-panel .upload-status .upload-info[data-v-c4b41b7f]{margin-left:5px;font-size:12px;color:#706f6f}.uploader-panel .file-list .upload-panel .progress[data-v-c4b41b7f]{height:10px}.uploader-panel .file-list .op[data-v-c4b41b7f]{width:100px;display:flex;align-items:center;justify-content:flex-end}.uploader-panel .file-list .op .op-btn .btn-item[data-v-c4b41b7f]{cursor:pointer}.uploader-panel .file-list .op .op-btn .del[data-v-c4b41b7f],.uploader-panel .file-list .op .op-btn .clean[data-v-c4b41b7f]{margin-left:5px}.header[data-v-832ae474]{box-shadow:0 3px 10px #0000000f;height:56px;padding-left:24px;padding-right:24px;position:relative;z-index:200;display:flex;align-items:center;justify-content:space-between}.header .logo[data-v-832ae474]{display:flex;align-items:center}.header .logo .icon-pan[data-v-832ae474]{font-size:40px;color:#1296db}.header .logo .name[data-v-832ae474]{font-weight:700;margin-left:5px;font-size:25px;color:#05a1f5}.header .right-panel[data-v-832ae474]{display:flex;align-items:center}.header .right-panel .icon-transfer[data-v-832ae474]{cursor:pointer}.header .right-panel .user-info[data-v-832ae474]{margin-right:10px;display:flex;align-items:center;cursor:pointer}.header .right-panel .user-info .avatar[data-v-832ae474]{margin:0 5px 0 15px}.header .right-panel .user-info .nick-name[data-v-832ae474]{color:#05a1f5}.body[data-v-832ae474]{display:flex}.body .left-sider[data-v-832ae474]{border-right:1px solid #f1f2f4;display:flex}.body .left-sider .menu-list[data-v-832ae474]{height:calc(100vh - 56px);width:80px;box-shadow:0 3px 10px #0000000f;border-right:1px solid #f1f2f4}.body .left-sider .menu-list .menu-item[data-v-832ae474]{text-align:center;font-size:14px;font-weight:700;padding:20px 0;cursor:pointer}.body .left-sider .menu-list .menu-item[data-v-832ae474]:hover{background:#f3f3f3}.body .left-sider .menu-list .menu-item .iconfont[data-v-832ae474]{font-weight:400;font-size:28px}.body .left-sider .menu-list .active .iconfont[data-v-832ae474],.body .left-sider .menu-list .active .text[data-v-832ae474]{color:#06a7ff}.body .left-sider .menu-sub-list[data-v-832ae474]{width:200px;padding:20px 10px 0;position:relative}.body .left-sider .menu-sub-list .menu-item-sub[data-v-832ae474]{text-align:center;line-height:40px;border-radius:5px;cursor:pointer}.body .left-sider .menu-sub-list .menu-item-sub[data-v-832ae474]:hover{background:#f3f3f3}.body .left-sider .menu-sub-list .menu-item-sub .iconfont[data-v-832ae474]{font-size:14px;margin-right:20px}.body .left-sider .menu-sub-list .menu-item-sub .text[data-v-832ae474]{font-size:13px}.body .left-sider .menu-sub-list .active[data-v-832ae474]{background:#eef9fe}.body .left-sider .menu-sub-list .active .iconfont[data-v-832ae474],.body .left-sider .menu-sub-list .active .text[data-v-832ae474]{color:#05a1f5}.body .left-sider .menu-sub-list .tips[data-v-832ae474]{margin-top:10px;color:#888;font-size:13px}.body .left-sider .menu-sub-list .space-info[data-v-832ae474]{position:absolute;bottom:10px;width:100%;padding:0 5px}.body .left-sider .menu-sub-list .space-info .percent[data-v-832ae474]{padding-right:10px}.body .left-sider .menu-sub-list .space-info .space-use[data-v-832ae474]{margin-top:5px;color:#7e7e7e;display:flex;justify-content:space-around}.body .left-sider .menu-sub-list .space-info .space-use .use[data-v-832ae474]{flex:1}.body .left-sider .menu-sub-list .space-info .space-use .iconfont[data-v-832ae474]{cursor:pointer;margin-right:20px;color:#05a1f5}.body .body-content[data-v-832ae474]{flex:1;width:0;padding-left:20px}
2 |
--------------------------------------------------------------------------------
/dist/assets/Login-32a954d1.css:
--------------------------------------------------------------------------------
1 | .login-body[data-v-d74b197d]{height:100vh;background-size:cover;background:url(/assets/login_bg-6b1edf8c.jpg);display:flex}.login-body .bg[data-v-d74b197d]{flex:1;background-size:cover;background-position:center;background-size:800px;background-repeat:no-repeat;background-image:url(/assets/login_img-db08ed45.png)}.login-body .login-panel[data-v-d74b197d]{width:430px;margin-right:15%;margin-top:calc((100vh - 500px)/2)}.login-body .login-panel .login-register[data-v-d74b197d]{padding:25px;background:#fff;border-radius:5px}.login-body .login-panel .login-register .login-title[data-v-d74b197d]{text-align:center;font-size:18px;font-weight:700;margin-bottom:20px}.login-body .login-panel .login-register .send-emali-panel[data-v-d74b197d]{display:flex;width:100%;justify-content:space-between}.login-body .login-panel .login-register .send-emali-panel .send-mail-btn[data-v-d74b197d]{margin-left:5px}.login-body .login-panel .login-register .rememberme-panel[data-v-d74b197d]{width:100%}.login-body .login-panel .login-register .no-account[data-v-d74b197d]{width:100%;display:flex;justify-content:space-between}.login-body .login-panel .login-register .op-btn[data-v-d74b197d]{width:100%}.login-body .check-code-panel[data-v-d74b197d]{width:100%;display:flex}.login-body .check-code-panel .check-code[data-v-d74b197d]{margin-left:5px;cursor:pointer}.login-body .login-btn-qq[data-v-d74b197d]{margin-top:20px;text-align:center;display:flex;align-items:center;justify-content:center}.login-body .login-btn-qq img[data-v-d74b197d]{cursor:pointer;margin-left:10px;width:20px}
2 |
--------------------------------------------------------------------------------
/dist/assets/Main-ec927bfd.css:
--------------------------------------------------------------------------------
1 | .top[data-v-1a1d1f66]{margin-top:20px}.top .top-op[data-v-1a1d1f66]{display:flex;align-items:center}.top .top-op .btn[data-v-1a1d1f66]{margin-right:10px}.top .top-op .search-panel[data-v-1a1d1f66]{margin-left:10px;width:300px}.top .top-op .icon-refresh[data-v-1a1d1f66]{cursor:pointer;margin-left:10px}.top .top-op .not-allow[data-v-1a1d1f66]{background:#d2d2d2!important;cursor:not-allowed}.file-list .file-item[data-v-1a1d1f66]{display:flex;align-items:center;padding:6px 0}.file-list .file-item .file-name[data-v-1a1d1f66]{margin-left:8px;flex:1;width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-list .file-item .file-name span[data-v-1a1d1f66]{cursor:pointer}.file-list .file-item .file-name span[data-v-1a1d1f66]:hover{color:#06a7ff}.file-list .file-item .file-name .transfer-status[data-v-1a1d1f66]{font-size:13px;margin-left:10px;color:#e6a23c}.file-list .file-item .file-name .transfer-fail[data-v-1a1d1f66]{color:#f75000}.file-list .file-item .edit-panel[data-v-1a1d1f66]{flex:1;width:0;display:flex;align-items:center;margin:0 5px}.file-list .file-item .edit-panel .iconfont[data-v-1a1d1f66]{margin-left:10px;background:#0c95f7;color:#fff;padding:3px 5px;border-radius:5px;cursor:pointer}.file-list .file-item .edit-panel .not-allow[data-v-1a1d1f66]{cursor:not-allowed;background:#7cb1d7;color:#ddd;text-decoration:none}.file-list .file-item .op[data-v-1a1d1f66]{width:280px;margin-left:15px}.file-list .file-item .op .iconfont[data-v-1a1d1f66]{font-size:13px;margin-left:10px;color:#06a7ff;cursor:pointer}.file-list .file-item .op .iconfont[data-v-1a1d1f66]:before{margin-right:3px}.no-data[data-v-1a1d1f66]{height:calc(100vh - 150px);display:flex;align-items:center;justify-content:center}.no-data .no-data-inner[data-v-1a1d1f66]{text-align:center}.no-data .no-data-inner .tips[data-v-1a1d1f66]{margin-top:10px}.no-data .no-data-inner .op-list[data-v-1a1d1f66]{margin-top:20px;display:flex;justify-content:center;align-items:center}.no-data .no-data-inner .op-list .op-item[data-v-1a1d1f66]{cursor:pointer;width:100px;height:100px;margin:0 10px;padding:5px 0;background:rgb(241,241,241)}
2 |
--------------------------------------------------------------------------------
/dist/assets/QqLoginCallback-cfb92722.js:
--------------------------------------------------------------------------------
1 | import{u as t,b as c}from"./vue-router-6d9ab4b6.js";import{j as n,o as s,c as u}from"./@vue-3886a262.js";const f={__name:"QqLoginCallback",setup(i){const{proxy:r}=n(),o=t();c();const l={logincallback:"/qqlogin/callback"};return(async()=>{let a=await r.Request({url:l.logincallback,params:o.currentRoute.value.query,errorCallback:()=>{o.push("/")}});if(!a)return;let e=a.data.callbackUrl||"/";e=="/login"&&(e="/"),r.VueCookies.set("userInfo",a.data.userInfo,0),console.log("路径",e),o.push(e)})(),(a,e)=>(s(),u("div",null,"登录中,请勿刷新页面"))}};export{f as default};
2 |
--------------------------------------------------------------------------------
/dist/assets/Recycle-07db5704.js:
--------------------------------------------------------------------------------
1 | import{u as V,b as M}from"./vue-router-6d9ab4b6.js";import{_ as j}from"./index-db517136.js";import{j as E,r as g,ag as v,o as a,c as d,a as s,V as h,P as u,T as k,O as y,F as C,S as f,U as I,u as P,bb as w,b9 as U}from"./@vue-3886a262.js";import"./element-plus-485a4a99.js";import"./lodash-es-36eb724a.js";import"./@vueuse-08bf1a74.js";import"./@element-plus-4ca69592.js";import"./@popperjs-c75af06c.js";import"./@ctrl-f8748455.js";import"./dayjs-5d216acc.js";import"./aplayer-585df14e.js";import"./async-validator-10c6301d.js";import"./memoize-one-297ddbcb.js";import"./escape-html-9626137c.js";import"./normalize-wheel-es-ed76fb12.js";import"./@floating-ui-8a8891e3.js";import"./vue-cookies-fc2d14d9.js";import"./@highlightjs-e10ea536.js";import"./highlight.js-6845818c.js";import"./axios-4a70c6fc.js";import"./docx-preview-8cc7001d.js";import"./jszip-1f4bc9a3.js";import"./xlsx-74460a39.js";import"./vue-pdf-embed-608804e8.js";import"./vue-0ba3f033.js";import"./dplayer-d4a41b2a.js";import"./vue-clipboard3-6d269bab.js";import"./clipboard-65322c36.js";const T=p=>(w("data-v-25de2ecd"),p=p(),U(),p),H={class:"top"},A=T(()=>s("span",{class:"iconfont icon-revert"},null,-1)),G=T(()=>s("span",{class:"iconfont icon-del"},null,-1)),J={class:"file-list"},K=["onMouseenter","onMouseleave"],Q=["title"],W={class:"op"},X=["onClick"],Y=["onClick"],Z={key:0},ee={__name:"Recycle",emits:["reload"],setup(p,{emit:S}){const{proxy:l}=E();V(),M();const n={loadDataList:"/recycle/loadRecycleList",delFile:"/recycle/delFile",recoverFile:"/recycle/recoverFile"},N=[{label:"文件名",prop:"fileName",scopedSlots:"fileName"},{label:"删除时间",prop:"recoveryTime",width:200},{label:"大小",prop:"fileSize",scopedSlots:"fileSize",width:200}],c=g({}),F={extHeight:20,selectType:"checkbox"},r=async()=>{let e={pageNo:c.value.pageNo,pageSize:c.value.pageSize};e.category!=="all"&&delete e.filePid;let o=await l.Request({url:n.loadDataList,params:e});o&&(c.value=o.data)},R=e=>{c.value.list.forEach(o=>{o.showOp=!1}),e.showOp=!0},x=e=>{e.showOp=!1},i=g([]),z=e=>{i.value=[],e.forEach(o=>{i.value.push(o.fileId)})},O=e=>{l.Confirm(`你确定要还原【${e.fileName}】吗?`,async()=>{await l.Request({url:n.recoverFile,params:{fileIds:e.fileId}})&&r()})},B=()=>{i.value.length!=0&&l.Confirm("你确定要还原这些文件吗?",async()=>{await l.Request({url:n.recoverFile,params:{fileIds:i.value.join(",")}})&&r()})},$=e=>{l.Confirm(`你确定要删除【${e.fileName}】?`,async()=>{await l.Request({url:n.delFile,params:{fileIds:e.fileId}})&&(r(),S("reload"))})},q=e=>{i.value.length!=0&&l.Confirm("你确定要删除选中的文件?删除将无法恢复",async()=>{await l.Request({url:n.delFile,params:{fileIds:i.value.join(",")}})&&(r(),S("reload"))})};return(e,o)=>{const b=v("el-button"),m=v("icon"),D=v("Table");return a(),d("div",null,[s("div",H,[h(b,{type:"success",disabled:i.value.length==0,onClick:B},{default:u(()=>[A,k("还原 ")]),_:1},8,["disabled"]),h(b,{type:"danger",disabled:i.value.length==0,onClick:q},{default:u(()=>[G,k("批量删除 ")]),_:1},8,["disabled"])]),s("div",J,[h(D,{columns:N,showPagination:!0,dataSource:c.value,fetch:r,options:F,onRowSelected:z},{fileName:u(({index:L,row:t})=>[s("div",{class:"file-item",onMouseenter:_=>R(t),onMouseleave:_=>x(t)},[(t.fileType==3||t.fileType==1)&&t.status!==0?(a(),y(m,{key:0,cover:t.fileCover},null,8,["cover"])):(a(),d(C,{key:1},[t.folderType==0?(a(),y(m,{key:0,fileType:t.fileType},null,8,["fileType"])):f("",!0),t.folderType==1?(a(),y(m,{key:1,fileType:0})):f("",!0)],64)),s("span",{class:"file-name",title:t.fileName},[s("span",null,I(t.fileName),1)],8,Q),s("span",W,[t.showOp&&t.fileId?(a(),d(C,{key:0},[s("span",{class:"iconfont icon-revert",onClick:_=>O(t)},"还原",8,X),s("span",{class:"iconfont icon-del",onClick:_=>$(t)},"删除",8,Y)],64)):f("",!0)])],40,K)]),fileSize:u(({index:L,row:t})=>[t.fileSize?(a(),d("span",Z,I(P(l).Utils.size2Str(t.fileSize)),1)):f("",!0)]),_:1},8,["dataSource"])])])}}},xe=j(ee,[["__scopeId","data-v-25de2ecd"]]);export{xe as default};
2 |
--------------------------------------------------------------------------------
/dist/assets/Recycle-ce24e1a7.css:
--------------------------------------------------------------------------------
1 | .top[data-v-25de2ecd]{margin-top:20px}.top .top-op[data-v-25de2ecd]{display:flex;align-items:center}.top .top-op .btn[data-v-25de2ecd]{margin-right:10px}.top .top-op .search-panel[data-v-25de2ecd]{margin-left:10px;width:300px}.top .top-op .icon-refresh[data-v-25de2ecd]{cursor:pointer;margin-left:10px}.top .top-op .not-allow[data-v-25de2ecd]{background:#d2d2d2!important;cursor:not-allowed}.file-list .file-item[data-v-25de2ecd]{display:flex;align-items:center;padding:6px 0}.file-list .file-item .file-name[data-v-25de2ecd]{margin-left:8px;flex:1;width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-list .file-item .file-name span[data-v-25de2ecd]{cursor:pointer}.file-list .file-item .file-name span[data-v-25de2ecd]:hover{color:#06a7ff}.file-list .file-item .file-name .transfer-status[data-v-25de2ecd]{font-size:13px;margin-left:10px;color:#e6a23c}.file-list .file-item .file-name .transfer-fail[data-v-25de2ecd]{color:#f75000}.file-list .file-item .edit-panel[data-v-25de2ecd]{flex:1;width:0;display:flex;align-items:center;margin:0 5px}.file-list .file-item .edit-panel .iconfont[data-v-25de2ecd]{margin-left:10px;background:#0c95f7;color:#fff;padding:3px 5px;border-radius:5px;cursor:pointer}.file-list .file-item .edit-panel .not-allow[data-v-25de2ecd]{cursor:not-allowed;background:#7cb1d7;color:#ddd;text-decoration:none}.file-list .file-item .op[data-v-25de2ecd]{width:280px;margin-left:15px}.file-list .file-item .op .iconfont[data-v-25de2ecd]{font-size:13px;margin-left:10px;color:#06a7ff;cursor:pointer}.file-list .file-item .op .iconfont[data-v-25de2ecd]:before{margin-right:3px}.no-data[data-v-25de2ecd]{height:calc(100vh - 150px);display:flex;align-items:center;justify-content:center}.no-data .no-data-inner[data-v-25de2ecd]{text-align:center}.no-data .no-data-inner .tips[data-v-25de2ecd]{margin-top:10px}.no-data .no-data-inner .op-list[data-v-25de2ecd]{margin-top:20px;display:flex;justify-content:center;align-items:center}.no-data .no-data-inner .op-list .op-item[data-v-25de2ecd]{cursor:pointer;width:100px;height:100px;margin:0 10px;padding:5px 0;background:rgb(241,241,241)}.file-list[data-v-25de2ecd]{margin-top:10px}.file-list .file-item .op[data-v-25de2ecd]{width:120px}
2 |
--------------------------------------------------------------------------------
/dist/assets/Share-14d41aec.css:
--------------------------------------------------------------------------------
1 | .top[data-v-80700666]{margin-top:20px}.top .top-op[data-v-80700666]{display:flex;align-items:center}.top .top-op .btn[data-v-80700666]{margin-right:10px}.top .top-op .search-panel[data-v-80700666]{margin-left:10px;width:300px}.top .top-op .icon-refresh[data-v-80700666]{cursor:pointer;margin-left:10px}.top .top-op .not-allow[data-v-80700666]{background:#d2d2d2!important;cursor:not-allowed}.file-list .file-item[data-v-80700666]{display:flex;align-items:center;padding:6px 0}.file-list .file-item .file-name[data-v-80700666]{margin-left:8px;flex:1;width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-list .file-item .file-name span[data-v-80700666]{cursor:pointer}.file-list .file-item .file-name span[data-v-80700666]:hover{color:#06a7ff}.file-list .file-item .file-name .transfer-status[data-v-80700666]{font-size:13px;margin-left:10px;color:#e6a23c}.file-list .file-item .file-name .transfer-fail[data-v-80700666]{color:#f75000}.file-list .file-item .edit-panel[data-v-80700666]{flex:1;width:0;display:flex;align-items:center;margin:0 5px}.file-list .file-item .edit-panel .iconfont[data-v-80700666]{margin-left:10px;background:#0c95f7;color:#fff;padding:3px 5px;border-radius:5px;cursor:pointer}.file-list .file-item .edit-panel .not-allow[data-v-80700666]{cursor:not-allowed;background:#7cb1d7;color:#ddd;text-decoration:none}.file-list .file-item .op[data-v-80700666]{width:280px;margin-left:15px}.file-list .file-item .op .iconfont[data-v-80700666]{font-size:13px;margin-left:10px;color:#06a7ff;cursor:pointer}.file-list .file-item .op .iconfont[data-v-80700666]:before{margin-right:3px}.no-data[data-v-80700666]{height:calc(100vh - 150px);display:flex;align-items:center;justify-content:center}.no-data .no-data-inner[data-v-80700666]{text-align:center}.no-data .no-data-inner .tips[data-v-80700666]{margin-top:10px}.no-data .no-data-inner .op-list[data-v-80700666]{margin-top:20px;display:flex;justify-content:center;align-items:center}.no-data .no-data-inner .op-list .op-item[data-v-80700666]{cursor:pointer;width:100px;height:100px;margin:0 10px;padding:5px 0;background:rgb(241,241,241)}.header[data-v-80700666]{width:100%;position:fixed;background:#0c95f7;height:50px}.header .header-content[data-v-80700666]{width:70%;margin:0 auto;color:#fff;line-height:50px}.header .header-content .logo[data-v-80700666]{display:flex;align-items:center;cursor:pointer}.header .header-content .logo .icon-pan[data-v-80700666]{font-size:40px}.header .header-content .logo .name[data-v-80700666]{font-weight:700;margin-left:5px;font-size:25px}.share-body[data-v-80700666]{width:70%;margin:0 auto;padding-top:50px}.share-body .loading[data-v-80700666]{height:50vh;width:100%}.share-body .share-panel[data-v-80700666]{margin-top:20px;display:flex;justify-content:space-around;border-bottom:1px solid #ddd;padding-bottom:10px}.share-body .share-panel .share-user-info[data-v-80700666]{flex:1;display:flex;align-items:center}.share-body .share-panel .share-user-info .avatar[data-v-80700666]{margin-right:5px}.share-body .share-panel .share-user-info .share-info .user-info[data-v-80700666]{display:flex;align-items:center}.share-body .share-panel .share-user-info .share-info .user-info .nick-name[data-v-80700666]{font-size:15px}.share-body .share-panel .share-user-info .share-info .user-info .share-time[data-v-80700666]{margin-left:20px;font-size:12px}.share-body .share-panel .share-user-info .share-info .file-name[data-v-80700666]{margin-top:10px;font-size:12px}.file-list[data-v-80700666]{margin-top:10px}.file-list .file-item .op[data-v-80700666]{width:170px}
2 |
--------------------------------------------------------------------------------
/dist/assets/Share-9d43d77f.js:
--------------------------------------------------------------------------------
1 | import{u as P}from"./vue-clipboard3-6d269bab.js";import{u as j,b as q}from"./vue-router-6d9ab4b6.js";import{_ as z}from"./index-db517136.js";import{j as F,r,ag as _,o as s,c as p,a as o,V as T,P as f,T as g,O as v,F as k,S as u,U as x,bb as U,b9 as H}from"./@vue-3886a262.js";import"./clipboard-65322c36.js";import"./aplayer-585df14e.js";import"./element-plus-485a4a99.js";import"./lodash-es-36eb724a.js";import"./@vueuse-08bf1a74.js";import"./@element-plus-4ca69592.js";import"./@popperjs-c75af06c.js";import"./@ctrl-f8748455.js";import"./dayjs-5d216acc.js";import"./async-validator-10c6301d.js";import"./memoize-one-297ddbcb.js";import"./escape-html-9626137c.js";import"./normalize-wheel-es-ed76fb12.js";import"./@floating-ui-8a8891e3.js";import"./vue-cookies-fc2d14d9.js";import"./@highlightjs-e10ea536.js";import"./highlight.js-6845818c.js";import"./axios-4a70c6fc.js";import"./docx-preview-8cc7001d.js";import"./jszip-1f4bc9a3.js";import"./xlsx-74460a39.js";import"./vue-pdf-embed-608804e8.js";import"./vue-0ba3f033.js";import"./dplayer-d4a41b2a.js";const A=n=>(U("data-v-8dfc0301"),n=n(),H(),n),G={class:"top"},J=A(()=>o("span",{class:"iconfont icon-cancel"},null,-1)),K={class:"file-list"},Q=["onMouseenter","onMouseleave"],W=["title"],X={class:"op"},Y=["onClick"],Z=["onClick"],ee={__name:"Share",setup(n){const{toClipboard:C}=P(),{proxy:c}=F();j(),q();const y={loadDataList:"/share/loadShareList",cancelShare:"/share/cancelShare"},I=r(document.location.origin+"/share/"),N=[{label:"文件名",prop:"fileName",scopedSlots:"fileName"},{label:"分享时间",prop:"shareTime",width:200},{label:"失效时间",prop:"expireTime",scopedSlots:"expireTime",width:200},{label:"浏览次数",prop:"showCount",width:200}],l=r({}),O={extHeight:20,selectType:"checkbox"},S=async()=>{let t={pageNo:l.value.pageNo,pageSize:l.value.pageSize};t.category!=="all"&&delete t.filePid;let a=await c.Request({url:y.loadDataList,params:t});a&&(l.value=a.data)},$=t=>{l.value.list.forEach(a=>{a.showOp=!1}),t.showOp=!0},D=t=>{t.showOp=!1},L=async t=>{await C(`链接:${I.value}${t.shareId} 提取码: ${t.code}`),c.Message.success("复制成功")},i=r([]),M=t=>{i.value=[],t.forEach(a=>{i.value.push(a.shareId)})},d=r([]),R=()=>{i.value.length!=0&&(d.value=i.value,b())},B=t=>{d.value=[t.shareId],b()},b=async()=>{c.Confirm("你确定要取消分享吗?",async()=>{await c.Request({url:y.cancelShare,params:{shareIds:d.value.join(",")}})&&(c.Message.success("取消分享成功"),S())})};return(t,a)=>{const V=_("el-button"),m=_("icon"),w=_("Table");return s(),p("div",null,[o("div",G,[T(V,{type:"primary",disabled:i.value.length==0,onClick:R},{default:f(()=>[J,g("取消分享 ")]),_:1},8,["disabled"])]),o("div",K,[T(w,{columns:N,showPagination:!0,dataSource:l.value,fetch:S,options:O,onRowSelected:M},{fileName:f(({index:E,row:e})=>[o("div",{class:"file-item",onMouseenter:h=>$(e),onMouseleave:h=>D(e)},[(e.fileType==3||e.fileType==1)&&e.status!==0?(s(),v(m,{key:0,cover:e.fileCover},null,8,["cover"])):(s(),p(k,{key:1},[e.folderType==0?(s(),v(m,{key:0,fileType:e.fileType},null,8,["fileType"])):u("",!0),e.folderType==1?(s(),v(m,{key:1,fileType:0})):u("",!0)],64)),e.showRename?u("",!0):(s(),p("span",{key:2,class:"file-name",title:e.fileName},[o("span",null,x(e.fileName),1)],8,W)),o("span",X,[e.showOp&&e.fileId?(s(),p(k,{key:0},[o("span",{class:"iconfont icon-link",onClick:h=>L(e)},"复制链接",8,Y),o("span",{class:"iconfont icon-cancel",onClick:h=>B(e)},"取消分享",8,Z)],64)):u("",!0)])],40,Q)]),expireTime:f(({index:E,row:e})=>[g(x(e.validType==3?"永久":e.expireTime),1)]),_:1},8,["dataSource"])])])}}},$e=z(ee,[["__scopeId","data-v-8dfc0301"]]);export{$e as default};
2 |
--------------------------------------------------------------------------------
/dist/assets/Share-d0d8740e.css:
--------------------------------------------------------------------------------
1 | .top[data-v-8dfc0301]{margin-top:20px}.top .top-op[data-v-8dfc0301]{display:flex;align-items:center}.top .top-op .btn[data-v-8dfc0301]{margin-right:10px}.top .top-op .search-panel[data-v-8dfc0301]{margin-left:10px;width:300px}.top .top-op .icon-refresh[data-v-8dfc0301]{cursor:pointer;margin-left:10px}.top .top-op .not-allow[data-v-8dfc0301]{background:#d2d2d2!important;cursor:not-allowed}.file-list .file-item[data-v-8dfc0301]{display:flex;align-items:center;padding:6px 0}.file-list .file-item .file-name[data-v-8dfc0301]{margin-left:8px;flex:1;width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-list .file-item .file-name span[data-v-8dfc0301]{cursor:pointer}.file-list .file-item .file-name span[data-v-8dfc0301]:hover{color:#06a7ff}.file-list .file-item .file-name .transfer-status[data-v-8dfc0301]{font-size:13px;margin-left:10px;color:#e6a23c}.file-list .file-item .file-name .transfer-fail[data-v-8dfc0301]{color:#f75000}.file-list .file-item .edit-panel[data-v-8dfc0301]{flex:1;width:0;display:flex;align-items:center;margin:0 5px}.file-list .file-item .edit-panel .iconfont[data-v-8dfc0301]{margin-left:10px;background:#0c95f7;color:#fff;padding:3px 5px;border-radius:5px;cursor:pointer}.file-list .file-item .edit-panel .not-allow[data-v-8dfc0301]{cursor:not-allowed;background:#7cb1d7;color:#ddd;text-decoration:none}.file-list .file-item .op[data-v-8dfc0301]{width:280px;margin-left:15px}.file-list .file-item .op .iconfont[data-v-8dfc0301]{font-size:13px;margin-left:10px;color:#06a7ff;cursor:pointer}.file-list .file-item .op .iconfont[data-v-8dfc0301]:before{margin-right:3px}.no-data[data-v-8dfc0301]{height:calc(100vh - 150px);display:flex;align-items:center;justify-content:center}.no-data .no-data-inner[data-v-8dfc0301]{text-align:center}.no-data .no-data-inner .tips[data-v-8dfc0301]{margin-top:10px}.no-data .no-data-inner .op-list[data-v-8dfc0301]{margin-top:20px;display:flex;justify-content:center;align-items:center}.no-data .no-data-inner .op-list .op-item[data-v-8dfc0301]{cursor:pointer;width:100px;height:100px;margin:0 10px;padding:5px 0;background:rgb(241,241,241)}.file-list[data-v-8dfc0301]{margin-top:10px}.file-list .file-item .file-name span[data-v-8dfc0301]:hover{color:#494944}.file-list .file-item .op[data-v-8dfc0301]{width:170px}
2 |
--------------------------------------------------------------------------------
/dist/assets/ShareCheck-85e68768.css:
--------------------------------------------------------------------------------
1 | .share[data-v-94cbaaea]{height:100vh;background:url(/assets/share_bg-0a430d8f.png);background-repeat:repeat-x;background-position:0 bottom;background-color:#eef2f6;display:flex;justify-content:center}.share .body-content[data-v-94cbaaea]{margin-top:20vh;width:500px}.share .body-content .logo[data-v-94cbaaea]{display:flex;align-items:center;justify-content:center}.share .body-content .logo .icon-pan[data-v-94cbaaea]{font-size:60px;color:#409eff}.share .body-content .logo .name[data-v-94cbaaea]{font-weight:700;margin-left:5px;font-size:25px;color:#409eff}.share .body-content .code-panel[data-v-94cbaaea]{margin-top:20px;background:#fff;border-radius:5px;overflow:hidden;box-shadow:0 0 7px 1px #5757574f}.share .body-content .code-panel .file-info[data-v-94cbaaea]{padding:10px 20px;background:#409eff;color:#fff;display:flex;align-items:center}.share .body-content .code-panel .file-info .avatar[data-v-94cbaaea]{margin-right:5px}.share .body-content .code-panel .file-info .share-info .user-info[data-v-94cbaaea]{display:flex;align-items:center}.share .body-content .code-panel .file-info .share-info .user-info .nick-name[data-v-94cbaaea]{font-size:15px}.share .body-content .code-panel .file-info .share-info .user-info .share-time[data-v-94cbaaea]{margin-left:20px;font-size:12px}.share .body-content .code-panel .file-info .share-info .file-name[data-v-94cbaaea]{margin-top:10px;font-size:12px}.share .body-content .code-panel .code-body[data-v-94cbaaea]{padding:30px 20px 60px}.share .body-content .code-panel .code-body .tips[data-v-94cbaaea]{font-weight:700}.share .body-content .code-panel .code-body .input-area[data-v-94cbaaea]{margin-top:10px}.share .body-content .code-panel .code-body .input-area .input[data-v-94cbaaea]{flex:1;margin-right:10px}
2 |
--------------------------------------------------------------------------------
/dist/assets/ShareCheck-f2626f6d.js:
--------------------------------------------------------------------------------
1 | import{j as x,r as l,ag as s,o as V,c as R,a as e,V as r,U as p,P as m,a3 as N,a9 as D,T as q,bb as B,b9 as K}from"./@vue-3886a262.js";import{u as T,b as A}from"./vue-router-6d9ab4b6.js";import{_ as E}from"./index-db517136.js";import"./element-plus-485a4a99.js";import"./lodash-es-36eb724a.js";import"./@vueuse-08bf1a74.js";import"./@element-plus-4ca69592.js";import"./@popperjs-c75af06c.js";import"./@ctrl-f8748455.js";import"./dayjs-5d216acc.js";import"./aplayer-585df14e.js";import"./async-validator-10c6301d.js";import"./memoize-one-297ddbcb.js";import"./escape-html-9626137c.js";import"./normalize-wheel-es-ed76fb12.js";import"./@floating-ui-8a8891e3.js";import"./vue-cookies-fc2d14d9.js";import"./@highlightjs-e10ea536.js";import"./highlight.js-6845818c.js";import"./axios-4a70c6fc.js";import"./docx-preview-8cc7001d.js";import"./jszip-1f4bc9a3.js";import"./xlsx-74460a39.js";import"./vue-pdf-embed-608804e8.js";import"./vue-0ba3f033.js";import"./dplayer-d4a41b2a.js";import"./vue-clipboard3-6d269bab.js";import"./clipboard-65322c36.js";const f=n=>(B("data-v-94cbaaea"),n=n(),K(),n),U={class:"share"},j={class:"body-content"},L=f(()=>e("div",{class:"logo"},[e("span",{class:"iconfont icon-pan"}),e("span",{class:"name"},"Easy云盘")],-1)),M={class:"code-panel"},P={class:"file-info"},$={class:"avatar"},z={class:"share-info"},F={class:"user-info"},G={class:"nick-name"},H={class:"share-time"},J={class:"file-name"},O={class:"code-body"},Q=f(()=>e("div",{class:"tips"},"请输入提取码:",-1)),W={class:"input-area"},X={__name:"ShareCheck",setup(n){const{proxy:d}=x(),v=T(),S=A(),_={getShareInfo:"/showShare/getShareInfo",checkShareCode:"/showShare/checkShareCode"},i=S.params.shareId,t=l({});(async()=>{let o=await d.Request({url:_.getShareInfo,params:{shareId:i}});o&&(t.value=o.data)})();const c=l({}),u=l(),I={code:[{required:!0,message:"请输入提取码"},{min:5,message:"提取码为5位"},{max:5,message:"提取码为5位"}]},h=async()=>{u.value.validate(async o=>{!o||!await d.Request({url:_.checkShareCode,params:{shareId:i,code:c.value.code}})||v.push(`/share/${i}`)})};return(o,a)=>{const y=s("Avatar"),g=s("el-input"),k=s("el-button"),b=s("el-form-item"),C=s("el-form");return V(),R("div",U,[e("div",j,[L,e("div",M,[e("div",P,[e("div",$,[r(y,{userId:t.value.userId,avatar:t.value.avatar,width:50},null,8,["userId","avatar"])]),e("div",z,[e("div",F,[e("span",G,p(t.value.nickName),1),e("span",H,"分享于 "+p(t.value.shareTime),1)]),e("div",J,"分享文件:"+p(t.value.fileName),1)])]),e("div",O,[Q,e("div",W,[r(C,{model:c.value,rules:I,ref_key:"formDataRef",ref:u,maxLength:5,onSubmit:a[1]||(a[1]=N(()=>{},["prevent"]))},{default:m(()=>[r(b,{prop:"code"},{default:m(()=>[r(g,{class:"input",modelValue:c.value.code,"onUpdate:modelValue":a[0]||(a[0]=w=>c.value.code=w),onKeyup:D(h,["enter"])},null,8,["modelValue","onKeyup"]),r(k,{type:"primary",onClick:h},{default:m(()=>[q("提取文件")]),_:1})]),_:1})]),_:1},8,["model"])])])])])])}}},Ve=E(X,[["__scopeId","data-v-94cbaaea"]]);export{Ve as default};
2 |
--------------------------------------------------------------------------------
/dist/assets/SysSettings-04d2d718.css:
--------------------------------------------------------------------------------
1 | .sys-setting-panel[data-v-47267eef]{margin-top:20px;width:600px}
2 |
--------------------------------------------------------------------------------
/dist/assets/SysSettings-f51762ee.js:
--------------------------------------------------------------------------------
1 | import{j as v,r as d,ag as m,o as y,c as b,V as r,P as s,a3 as V,T as _}from"./@vue-3886a262.js";import{u as x,b as E}from"./vue-router-6d9ab4b6.js";import{_ as C}from"./index-db517136.js";import"./element-plus-485a4a99.js";import"./lodash-es-36eb724a.js";import"./@vueuse-08bf1a74.js";import"./@element-plus-4ca69592.js";import"./@popperjs-c75af06c.js";import"./@ctrl-f8748455.js";import"./dayjs-5d216acc.js";import"./aplayer-585df14e.js";import"./async-validator-10c6301d.js";import"./memoize-one-297ddbcb.js";import"./escape-html-9626137c.js";import"./normalize-wheel-es-ed76fb12.js";import"./@floating-ui-8a8891e3.js";import"./vue-cookies-fc2d14d9.js";import"./@highlightjs-e10ea536.js";import"./highlight.js-6845818c.js";import"./axios-4a70c6fc.js";import"./docx-preview-8cc7001d.js";import"./jszip-1f4bc9a3.js";import"./xlsx-74460a39.js";import"./vue-pdf-embed-608804e8.js";import"./vue-0ba3f033.js";import"./dplayer-d4a41b2a.js";import"./vue-clipboard3-6d269bab.js";import"./clipboard-65322c36.js";const U={class:"sys-setting-panel"},I={__name:"SysSettings",setup(R){const{proxy:l}=v();x(),E();const p={getSysSettings:"/admin/getSysSettings",saveSettings:"/admin/saveSysSettings"},t=d({}),u=d(),c={registerEmailTitle:[{required:!0,message:"请输入注册邮件验证码邮件标题"}],registerEmailContent:[{required:!0,message:"请输入注册邮件验证码邮件内容"}],userInitUseSpace:[{required:!0,message:"请输入初始化空间大小"},{validator:l.Verify.number,message:"空间大小只能是数字"}]};(async()=>{let a=await l.Request({url:p.getSysSettings});a&&(t.value=a.data)})();const g=async()=>{u.value.validate(async a=>{if(!a)return;let e=Object.assign({},t.value);await l.Request({url:p.saveSettings,params:e})&&l.Message.success("保存成功")})};return(a,e)=>{const i=m("el-input"),n=m("el-form-item"),f=m("el-button"),S=m("el-form");return y(),b("div",U,[r(S,{model:t.value,rules:c,ref_key:"formDataRef",ref:u,"label-width":"150px",onSubmit:e[3]||(e[3]=V(()=>{},["prevent"]))},{default:s(()=>[r(n,{label:"注册邮件标题",prop:"registerEmailTitle"},{default:s(()=>[r(i,{clearable:"",placeholder:"请输入注册邮件验证码邮件标题",modelValue:t.value.registerEmailTitle,"onUpdate:modelValue":e[0]||(e[0]=o=>t.value.registerEmailTitle=o)},null,8,["modelValue"])]),_:1}),r(n,{label:"注册邮件标题",prop:"registerEmailContent"},{default:s(()=>[r(i,{clearable:"",placeholder:"请输入注册邮件验证码邮件内容%s占位符为验证码内容",modelValue:t.value.registerEmailContent,"onUpdate:modelValue":e[1]||(e[1]=o=>t.value.registerEmailContent=o)},null,8,["modelValue"])]),_:1}),r(n,{label:"初始空间大小",prop:"userInitUseSpace"},{default:s(()=>[r(i,{clearable:"",placeholder:"初始空间大小",modelValue:t.value.userInitUseSpace,"onUpdate:modelValue":e[2]||(e[2]=o=>t.value.userInitUseSpace=o)},{suffix:s(()=>[_("MB")]),_:1},8,["modelValue"])]),_:1}),r(n,{label:"",prop:""},{default:s(()=>[r(f,{type:"primary",onClick:g},{default:s(()=>[_("保存")]),_:1})]),_:1})]),_:1},8,["model"])])}}},se=C(I,[["__scopeId","data-v-47267eef"]]);export{se as default};
2 |
--------------------------------------------------------------------------------
/dist/assets/UserList-72471675.js:
--------------------------------------------------------------------------------
1 | import{j as K,r as d,ag as l,o as x,c as k,a as m,V as e,P as a,a3 as V,a9 as P,T as f,U as b,u as C,S as D,n as E}from"./@vue-3886a262.js";import{u as H,b as G}from"./vue-router-6d9ab4b6.js";import{_ as J}from"./index-db517136.js";import"./element-plus-485a4a99.js";import"./lodash-es-36eb724a.js";import"./@vueuse-08bf1a74.js";import"./@element-plus-4ca69592.js";import"./@popperjs-c75af06c.js";import"./@ctrl-f8748455.js";import"./dayjs-5d216acc.js";import"./aplayer-585df14e.js";import"./async-validator-10c6301d.js";import"./memoize-one-297ddbcb.js";import"./escape-html-9626137c.js";import"./normalize-wheel-es-ed76fb12.js";import"./@floating-ui-8a8891e3.js";import"./vue-cookies-fc2d14d9.js";import"./@highlightjs-e10ea536.js";import"./highlight.js-6845818c.js";import"./axios-4a70c6fc.js";import"./docx-preview-8cc7001d.js";import"./jszip-1f4bc9a3.js";import"./xlsx-74460a39.js";import"./vue-pdf-embed-608804e8.js";import"./vue-0ba3f033.js";import"./dplayer-d4a41b2a.js";import"./vue-clipboard3-6d269bab.js";import"./clipboard-65322c36.js";const Q={class:"top-panel"},W={class:"file-list"},X={class:"avatar"},Y={key:0,style:{color:"#529b2e"}},Z={key:1,style:{color:"#f56c6c"}},ee=["onClick"],te=["onClick"],ae={__name:"UserList",setup(oe){const{proxy:r}=K();H(),G();const S={loadDataList:"/admin/loadUserList",updateUserStatus:"/admin/updateUserStatus",updateUserSpace:"/admin/updateUserSpace"},N=[{label:"头像",prop:"avatar",width:80,scopedSlots:"avatar"},{label:"昵称",prop:"nickName"},{label:"邮箱",prop:"email"},{label:"空间使用",prop:"space",scopedSlots:"space"},{label:"加入时间",prop:"joinTime"},{label:"最后登录时间",prop:"lastLoginTime"},{label:"状态",prop:"status",scopedSlots:"status",width:80},{label:"操作",prop:"op",width:150,scopedSlots:"op"}],i=d({}),_=d({}),z={extHeight:20},c=async()=>{let o={pageNo:_.value.pageNo,pageSize:_.value.pageSize};Object.assign(o,i.value);let t=await r.Request({url:S.loadDataList,params:o});t&&(_.value=t.data)},L=o=>{r.Confirm(`你确定要【${o.status==0?"启动":"禁用"}】吗?`,async()=>{await r.Request({url:S.updateUserStatus,params:{userId:o.userId,status:o.status==0?1:0}})&&c()})},p=d({show:!1,title:"修改空间大小",buttons:[{type:"primary",text:"确定",click:o=>{T()}}]}),u=d({}),g=d(),I={changeSpace:[{required:!0,message:"请输入空间大小"}]},R=o=>{p.value.show=!0,E(()=>{g.value.resetFields(),u.value=Object.assign({},o)})},T=()=>{g.value.validate(async o=>{if(!o)return;let t={};Object.assign(t,u.value),await r.Request({url:S.updateUserSpace,params:t})&&(p.value.show=!1,r.Message.success("操作成功"),c())})};return(o,t)=>{const h=l("el-input"),v=l("el-form-item"),y=l("el-col"),U=l("el-option"),q=l("el-select"),j=l("el-button"),F=l("el-row"),w=l("el-form"),B=l("Avatar"),M=l("el-divider"),O=l("Table"),$=l("Dialog");return x(),k("div",null,[m("div",Q,[e(w,{model:i.value,"label-width":"80px",onSubmit:t[2]||(t[2]=V(()=>{},["prevent"]))},{default:a(()=>[e(F,null,{default:a(()=>[e(y,{span:4},{default:a(()=>[e(v,{label:"用户昵称"},{default:a(()=>[e(h,{clearable:"",placeholder:"支持模糊搜索",modelValue:i.value.nickNameFuzzy,"onUpdate:modelValue":t[0]||(t[0]=n=>i.value.nickNameFuzzy=n),modelModifiers:{trim:!0},onKeyup:P(c,["native"])},null,8,["modelValue","onKeyup"])]),_:1})]),_:1}),e(y,{span:4},{default:a(()=>[e(v,{label:"状态"},{default:a(()=>[e(q,{clearable:"",placeholder:"请选择状态",modelValue:i.value.status,"onUpdate:modelValue":t[1]||(t[1]=n=>i.value.status=n)},{default:a(()=>[e(U,{value:1,label:"启用"}),e(U,{value:0,label:"禁用"})]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(y,{span:4,style:{"padding-left":"10px"}},{default:a(()=>[e(j,{type:"primary",onClick:c},{default:a(()=>[f(" 查询 ")]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),m("div",W,[e(O,{columns:N,showPagination:!0,dataSource:_.value,fetch:c,options:z},{avatar:a(({index:n,row:s})=>[m("div",X,[e(B,{userId:s.userId,avatar:s.qqAvatar},null,8,["userId","avatar"])])]),space:a(({index:n,row:s})=>[f(b(C(r).Utils.size2Str(s.useSpace))+"/"+b(C(r).Utils.size2Str(s.totalSpace)),1)]),status:a(({index:n,row:s})=>[s.status==1?(x(),k("span",Y,"启用")):D("",!0),s.status==0?(x(),k("span",Z,"禁用")):D("",!0)]),op:a(({index:n,row:s})=>[m("span",{class:"a-link",onClick:A=>R(s)},"分配空间",8,ee),e(M,{direction:"vertical"}),m("span",{class:"a-link",onClick:A=>L(s)},b(s.status==0?"启用":"禁用"),9,te)]),_:1},8,["dataSource"])]),e($,{show:p.value.show,title:p.value.title,buttons:p.value.buttons,width:"400px",showCancel:!1,onClose:t[5]||(t[5]=n=>p.value.show=!1)},{default:a(()=>[e(w,{model:u.value,rules:I,ref_key:"formDataRef",ref:g,"label-width":"80px",onSubmit:t[4]||(t[4]=V(()=>{},["prevent"]))},{default:a(()=>[e(v,{label:"昵称"},{default:a(()=>[f(b(u.value.nickName),1)]),_:1}),e(v,{label:"空间大小",prop:"changeSpace"},{default:a(()=>[e(h,{clearable:"",placeholder:"请输入空间大小",modelValue:u.value.changeSpace,"onUpdate:modelValue":t[3]||(t[3]=n=>u.value.changeSpace=n)},{suffix:a(()=>[f("MB")]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["show","title","buttons"])])}}},Ie=J(ae,[["__scopeId","data-v-ad38efaa"]]);export{Ie as default};
2 |
--------------------------------------------------------------------------------
/dist/assets/UserList-e2804a12.css:
--------------------------------------------------------------------------------
1 | .top-panel[data-v-ad38efaa]{margin-top:10px}.avatar[data-v-ad38efaa]{width:50px;height:50px;border-radius:25px;overflow:hidden}.avatar img[data-v-ad38efaa]{width:100%;height:100}
2 |
--------------------------------------------------------------------------------
/dist/assets/dommatrix-4ed993c7.js:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/dist/assets/escape-html-9626137c.js:
--------------------------------------------------------------------------------
1 | import{g as m}from"./aplayer-585df14e.js";/*!
2 | * escape-html
3 | * Copyright(c) 2012-2013 TJ Holowaychuk
4 | * Copyright(c) 2015 Andreas Lubbe
5 | * Copyright(c) 2015 Tiancheng "Timothy" Gu
6 | * MIT Licensed
7 | */var o=/["'&<>]/,i=l;function l(n){var a=""+n,c=o.exec(a);if(!c)return a;var t,s="",e=0,r=0;for(e=c.index;eo},ie64:function(){return h.ie()&&E},firefox:function(){return a()||s},opera:function(){return a()||f},webkit:function(){return a()||u},safari:function(){return h.webkit()},chrome:function(){return a()||c},windows:function(){return a()||p},osx:function(){return a()||l},linux:function(){return a()||w},iphone:function(){return a()||v},mobile:function(){return a()||v||x||m||X},nativeApp:function(){return a()||O},android:function(){return a()||m},ipad:function(){return a()||x}},I=h,d=!!(typeof window<"u"&&window.document&&window.document.createElement),S={canUseDOM:d,canUseWorkers:typeof Worker<"u",canUseEventListeners:d&&!!(window.addEventListener||window.attachEvent),canUseViewport:d&&!!window.screen,isInWorker:!d},A=S,U;A.canUseDOM&&(U=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);function W(e,n){if(!A.canUseDOM||n&&!("addEventListener"in document))return!1;var t="on"+e,r=t in document;if(!r){var i=document.createElement("div");i.setAttribute(t,"return;"),r=typeof i[t]=="function"}return!r&&U&&e==="wheel"&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}var k=W,M=10,F=40,D=800;function Y(e){var n=0,t=0,r=0,i=0;return"detail"in e&&(t=e.detail),"wheelDelta"in e&&(t=-e.wheelDelta/120),"wheelDeltaY"in e&&(t=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(n=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(n=t,t=0),r=n*M,i=t*M,"deltaY"in e&&(i=e.deltaY),"deltaX"in e&&(r=e.deltaX),(r||i)&&e.deltaMode&&(e.deltaMode==1?(r*=F,i*=F):(r*=D,i*=D)),r&&!n&&(n=r<1?-1:1),i&&!t&&(t=i<1?-1:1),{spinX:n,spinY:t,pixelX:r,pixelY:i}}Y.getEventType=function(){return I.firefox()?"DOMMouseScroll":k("wheel")?"wheel":"mousewheel"};var y=Y;/**
2 | * Checks if an event is supported in the current execution environment.
3 | *
4 | * NOTE: This will not work correctly for non-generic events such as `change`,
5 | * `reset`, `load`, `error`, and `select`.
6 | *
7 | * Borrows from Modernizr.
8 | *
9 | * @param {string} eventNameSuffix Event name, e.g. "click".
10 | * @param {?boolean} capture Check if the capture phase is supported.
11 | * @return {boolean} True if the event is supported.
12 | * @internal
13 | * @license Modernizr 3.0.0pre (Custom Build) | MIT
14 | */export{y as Y};
15 |
--------------------------------------------------------------------------------
/dist/assets/pdfjs-dist-1ab6505b.js:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/dist/assets/qq-8fddb348.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/dist/assets/qq-8fddb348.png
--------------------------------------------------------------------------------
/dist/assets/share_bg-0a430d8f.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/dist/assets/share_bg-0a430d8f.png
--------------------------------------------------------------------------------
/dist/assets/vue-0ba3f033.js:
--------------------------------------------------------------------------------
1 | import{a}from"./aplayer-585df14e.js";import{av as e,C as s,aw as t,F as o,ax as r,ay as n,az as i,aA as c,a6 as l,a5 as d,X as m,a1 as p,aB as b,aC as f,aD as u,aE as S,t as v,q as R,a4 as h,aF as g,b as C,ar as w,O as y,S as T,c as x,a as E,aG as k,aH as M,aI as A,aJ as B,aa as D,aK as P,T as V,V as N,aL as H,aM as z,d as U,aN as _,aO as F,aP as j,aQ as I,aR as K,aS as q,aT as O,an as W,j as $,g as G,aU as L,al as J,h as Q,aV as X,aW as Y,aX as Z,aY as aa,B as ea,aZ as sa,a_ as ta,a$ as oa,b0 as ra,D as na,b1 as ia,b2 as ca,z as la,am as da,b3 as ma,L as pa,n as ba,J as fa,ac as ua,K as Sa,b4 as va,G as Ra,A as ha,ah as ga,a7 as Ca,b5 as wa,k as ya,b6 as Ta,b7 as xa,i as Ea,b8 as ka,Z as Ma,a0 as Aa,o as Ba,b9 as Da,H as Pa,ba as Va,bb as Na,bc as Ha,_ as za,f as Ua,r as _a,bd as Fa,au as ja,a8 as Ia,I as Ka,ag as qa,aq as Oa,R as Wa,be as $a,bf as Ga,bg as La,bh as Ja,bi as Qa,at as Xa,bj as Ya,s as Za,bk as ae,bl as ee,bm as se,U as te,bn as oe,ak as re,ad as ne,Y as ie,$ as ce,bo as le,ao as de,u as me,a2 as pe,bp as be,bq as fe,br as ue,M as Se,bs as ve,ae as Re,bt as he,af as ge,bu as Ce,aj as we,W as ye,bv as Te,x as xe,w as Ee,e as ke,bw as Me,bx as Ae,by as Be,P as De,bz as Pe,Q as Ve,a9 as Ne,bA as He,a3 as ze,bB as Ue}from"./@vue-3886a262.js";const _e=()=>{},Fe=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition:e,Comment:s,EffectScope:t,Fragment:o,KeepAlive:r,ReactiveEffect:n,Static:i,Suspense:c,Teleport:l,Text:d,Transition:m,TransitionGroup:p,VueElement:b,assertNumber:f,callWithAsyncErrorHandling:u,callWithErrorHandling:S,camelize:v,capitalize:R,cloneVNode:h,compatUtils:g,compile:_e,computed:C,createApp:w,createBlock:y,createCommentVNode:T,createElementBlock:x,createElementVNode:E,createHydrationRenderer:k,createPropsRestProxy:M,createRenderer:A,createSSRApp:B,createSlots:D,createStaticVNode:P,createTextVNode:V,createVNode:N,customRef:H,defineAsyncComponent:z,defineComponent:U,defineCustomElement:_,defineEmits:F,defineExpose:j,defineProps:I,defineSSRCustomElement:K,get devtools(){return q},effect:O,effectScope:W,getCurrentInstance:$,getCurrentScope:G,getTransitionRawChildren:L,guardReactiveProps:J,h:Q,handleError:X,hydrate:Y,initCustomFormatter:Z,initDirectivesForSSR:aa,inject:ea,isMemoSame:sa,isProxy:ta,isReactive:oa,isReadonly:ra,isRef:na,isRuntimeOnly:ia,isShallow:ca,isVNode:la,markRaw:da,mergeDefaults:ma,mergeProps:pa,nextTick:ba,normalizeClass:fa,normalizeProps:ua,normalizeStyle:Sa,onActivated:va,onBeforeMount:Ra,onBeforeUnmount:ha,onBeforeUpdate:ga,onDeactivated:Ca,onErrorCaptured:wa,onMounted:ya,onRenderTracked:Ta,onRenderTriggered:xa,onScopeDispose:Ea,onServerPrefetch:ka,onUnmounted:Ma,onUpdated:Aa,openBlock:Ba,popScopeId:Da,provide:Pa,proxyRefs:Va,pushScopeId:Na,queuePostFlushCb:Ha,reactive:za,readonly:Ua,ref:_a,registerRuntimeCompiler:Fa,render:ja,renderList:Ia,renderSlot:Ka,resolveComponent:qa,resolveDirective:Oa,resolveDynamicComponent:Wa,resolveFilter:$a,resolveTransitionHooks:Ga,setBlockTracking:La,setDevtoolsHook:Ja,setTransitionHooks:Qa,shallowReactive:Xa,shallowReadonly:Ya,shallowRef:Za,ssrContextKey:ae,ssrUtils:ee,stop:se,toDisplayString:te,toHandlerKey:oe,toHandlers:re,toRaw:ne,toRef:ie,toRefs:ce,transformVNodeArgs:le,triggerRef:de,unref:me,useAttrs:pe,useCssModule:be,useCssVars:fe,useSSRContext:ue,useSlots:Se,useTransitionState:ve,vModelCheckbox:Re,vModelDynamic:he,vModelRadio:ge,vModelSelect:Ce,vModelText:we,vShow:ye,version:Te,warn:xe,watch:Ee,watchEffect:ke,watchPostEffect:Me,watchSyncEffect:Ae,withAsyncContext:Be,withCtx:De,withDefaults:Pe,withDirectives:Ve,withKeys:Ne,withMemo:He,withModifiers:ze,withScopeId:Ue},Symbol.toStringTag,{value:"Module"})),Ke=a(Fe);export{Ke as r};
2 |
--------------------------------------------------------------------------------
/dist/assets/vue-clipboard3-6d269bab.js:
--------------------------------------------------------------------------------
1 | import{C as a}from"./clipboard-65322c36.js";const l=o=>{const r=(o==null?void 0:o.appendToBody)===void 0?!0:o.appendToBody;return{toClipboard(c,t){return new Promise((i,u)=>{const e=document.createElement("button"),d=new a(e,{text:()=>c,action:()=>"copy",container:t!==void 0?t:document.body});d.on("success",n=>{d.destroy(),i(n)}),d.on("error",n=>{d.destroy(),u(n)}),r&&document.body.appendChild(e),e.click(),r&&document.body.removeChild(e)})}}};export{l as u};
2 |
--------------------------------------------------------------------------------
/dist/assets/vue-cookies-fc2d14d9.js:
--------------------------------------------------------------------------------
1 | import{g}from"./aplayer-585df14e.js";var u={exports:{}};(function(d,p){(function(){var n={expires:"1d",path:"; path=/",domain:"",secure:"",sameSite:"; SameSite=Lax"},m={install:function(t,e){e&&this.config(e.expires,e.path,e.domain,e.secure,e.sameSite),t.prototype&&(t.prototype.$cookies=this),t.config&&t.config.globalProperties&&(t.config.globalProperties.$cookies=this,t.provide("$cookies",this)),t.$cookies=this},config:function(t,e,o,s,r){n.expires=t||"1d",n.path=e?"; path="+e:"; path=/",n.domain=o?"; domain="+o:"",n.secure=s?"; Secure":"",n.sameSite=r?"; SameSite="+r:"; SameSite=Lax"},get:function(t){var e=decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null;if(e&&(e.substring(0,1)==="{"&&e.substring(e.length-1,e.length)==="}"||e.substring(0,1)==="["&&e.substring(e.length-1,e.length)==="]"))try{e=JSON.parse(e)}catch{return e}return e},set:function(t,e,o,s,r,f,c){if(t){if(/^(?:expires|max\-age|path|domain|secure|SameSite)$/i.test(t))throw new Error('Cookie name illegality. Cannot be set to ["expires","max-age","path","domain","secure","SameSite"] current key name: '+t)}else throw new Error("Cookie name is not found in the first argument.");e&&typeof e=="object"&&(e=JSON.stringify(e));var a="";if(o=o??n.expires,o&&o!=0)switch(o.constructor){case Number:o===1/0||o===-1?a="; expires=Fri, 31 Dec 9999 23:59:59 GMT":a="; max-age="+o;break;case String:if(/^(?:\d+(y|m|d|h|min|s))$/i.test(o)){var i=o.replace(/^(\d+)(?:y|m|d|h|min|s)$/i,"$1");switch(o.replace(/^(?:\d+)(y|m|d|h|min|s)$/i,"$1").toLowerCase()){case"m":a="; max-age="+ +i*2592e3;break;case"d":a="; max-age="+ +i*86400;break;case"h":a="; max-age="+ +i*3600;break;case"min":a="; max-age="+ +i*60;break;case"s":a="; max-age="+i;break;case"y":a="; max-age="+ +i*31104e3;break}}else a="; expires="+o;break;case Date:a="; expires="+o.toUTCString();break}return document.cookie=encodeURIComponent(t)+"="+encodeURIComponent(e)+a+(r?"; domain="+r:n.domain)+(s?"; path="+s:n.path)+(f==null?n.secure:f?"; Secure":"")+(c==null?n.sameSite:c?"; SameSite="+c:""),this},remove:function(t,e,o){return!t||!this.isKey(t)?!1:(document.cookie=encodeURIComponent(t)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"+(o?"; domain="+o:n.domain)+(e?"; path="+e:n.path)+"; SameSite=Lax",!0)},isKey:function(t){return new RegExp("(?:^|;\\s*)"+encodeURIComponent(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(document.cookie)},keys:function(){if(!document.cookie)return[];for(var t=document.cookie.replace(/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g,"").split(/\s*(?:\=[^;]*)?;\s*/),e=0;e
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | EasyPan
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/file/avatar/default_avatar.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbws13/Netdisk/8fc336efaabfa1ecde28f2e797d562419433d4bb/file/avatar/default_avatar.jpg
--------------------------------------------------------------------------------
/sql/netdisk.sql:
--------------------------------------------------------------------------------
1 | create database netdisk;
2 |
3 | use netdisk;
4 |
5 | CREATE TABLE `email_code`
6 | (
7 | `email` varchar(150) NOT NULL COMMENT '邮箱',
8 | `code` varchar(5) NOT NULL COMMENT '编号',
9 | `create_time` datetime DEFAULT NULL COMMENT '创建时间',
10 | `status` tinyint(1) DEFAULT NULL COMMENT '0:未使用 1:已使用',
11 | PRIMARY KEY (`email`, `code`)
12 | ) ENGINE = InnoDB
13 | DEFAULT CHARSET = utf8mb4
14 | COLLATE = utf8mb4_0900_ai_ci COMMENT ='邮箱验证码';
15 |
16 | CREATE TABLE `file_info`
17 | (
18 | `file_id` varchar(10) NOT NULL COMMENT '文件ID',
19 | `user_id` varchar(10) NOT NULL COMMENT '用户ID',
20 | `file_md5` varchar(32) DEFAULT NULL COMMENT 'md5值,第一次上传记录',
21 | `file_pid` varchar(10) DEFAULT NULL COMMENT '父级ID',
22 | `file_size` bigint DEFAULT NULL COMMENT '文件大小',
23 | `file_name` varchar(200) DEFAULT NULL COMMENT '文件名称',
24 | `file_cover` varchar(100) DEFAULT NULL COMMENT '封面',
25 | `file_path` varchar(100) DEFAULT NULL COMMENT '文件路径',
26 | `create_time` datetime DEFAULT NULL COMMENT '创建时间',
27 | `last_update_time` datetime DEFAULT NULL COMMENT '最后更新时间',
28 | `folder_type` tinyint(1) DEFAULT NULL COMMENT '0:文件 1:目录',
29 | `file_category` tinyint(1) DEFAULT NULL COMMENT '1:视频 2:音频 3:图片 4:文档 5:其他',
30 | `file_type` tinyint(1) DEFAULT NULL COMMENT ' 1:视频 2:音频 3:图片 4:pdf 5:doc 6:excel 7:txt 8:code 9:zip 10:其他',
31 | `status` tinyint(1) DEFAULT NULL COMMENT '0:转码中 1转码失败 2:转码成功',
32 | `recovery_time` datetime DEFAULT NULL COMMENT '回收站时间',
33 | `del_flag` tinyint(1) DEFAULT '2' COMMENT '删除标记 0:删除 1:回收站 2:正常',
34 | PRIMARY KEY (`file_id`, `user_id`),
35 | KEY `idx_create_time` (`create_time`),
36 | KEY `idx_user_id` (`user_id`),
37 | KEY `idx_md5` (`file_md5`) USING BTREE,
38 | KEY `idx_file_pid` (`file_pid`),
39 | KEY `idx_del_flag` (`del_flag`),
40 | KEY `idx_recovery_time` (`recovery_time`)
41 | ) ENGINE = InnoDB
42 | DEFAULT CHARSET = utf8mb4
43 | COLLATE = utf8mb4_0900_ai_ci COMMENT ='文件信息';
44 |
45 | CREATE TABLE `file_share`
46 | (
47 | `share_id` varchar(20) NOT NULL COMMENT '分享ID',
48 | `file_id` varchar(10) NOT NULL COMMENT '文件ID',
49 | `user_id` varchar(10) NOT NULL COMMENT '用户ID',
50 | `valid_type` tinyint(1) DEFAULT NULL COMMENT '有效期类型 0:1天 1:7天 2:30天 3:永久有效',
51 | `expire_time` datetime DEFAULT NULL COMMENT '失效时间',
52 | `share_time` datetime DEFAULT NULL COMMENT '分享时间',
53 | `code` varchar(5) DEFAULT NULL COMMENT '提取码',
54 | `show_count` int DEFAULT '0' COMMENT '浏览次数',
55 | PRIMARY KEY (`share_id`),
56 | KEY `idx_file_id` (`file_id`),
57 | KEY `idx_user_id` (`user_id`),
58 | KEY `idx_share_time` (`share_time`)
59 | ) ENGINE = InnoDB
60 | DEFAULT CHARSET = utf8mb4
61 | COLLATE = utf8mb4_0900_ai_ci COMMENT ='分享信息';
62 |
63 |
64 | CREATE TABLE `user_info`
65 | (
66 | `user_id` varchar(10) NOT NULL COMMENT '用户ID',
67 | `nick_name` varchar(20) DEFAULT NULL COMMENT '昵称',
68 | `email` varchar(150) DEFAULT NULL COMMENT '邮箱',
69 | `qq_open_id` varchar(35) DEFAULT NULL COMMENT 'qqOpenID',
70 | `qq_avatar` varchar(150) DEFAULT NULL COMMENT 'qq头像',
71 | `password` varchar(50) DEFAULT NULL COMMENT '密码',
72 | `join_time` datetime DEFAULT NULL COMMENT '加入时间',
73 | `last_login_time` datetime DEFAULT NULL COMMENT '最后登录时间',
74 | `status` tinyint DEFAULT NULL COMMENT '0:禁用 1:正常',
75 | `use_space` bigint DEFAULT '0' COMMENT '使用空间单位byte',
76 | `total_space` bigint DEFAULT NULL COMMENT '总空间',
77 | PRIMARY KEY (`user_id`),
78 | UNIQUE KEY `key_email` (`email`),
79 | UNIQUE KEY `key_nick_name` (`nick_name`),
80 | UNIQUE KEY `key_qq_open_id` (`qq_open_id`) USING BTREE
81 | ) ENGINE = InnoDB
82 | DEFAULT CHARSET = utf8mb4
83 | COLLATE = utf8mb4_0900_ai_ci COMMENT ='用户信息';
84 |
85 |
--------------------------------------------------------------------------------