1 Star 0 Fork 594

养浩_山东 / 仿百度网盘的一款轻量级微服务架构网盘系统,云盘系统,文件管理系统

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
AFL-3.0

一、平台介绍

在gitee和github里面基本上找不到一款好用、功能完善、且开放源码的网盘系统,有一些可以免费试用但是只提供安装包,于是在利用业务时间开发了一套轻量级且易于上手的网盘系统,主要基于目前主流的前后端分离和微服务架构模式开发,里面涉及很多的解决方案,适合没有项目经验的同学学习。网盘系统的核心目的有两个,第一:提供客户端给业务系统集成,统一管理业务系统的文件;第二:提供在线协调办公、管理个人文件的功能。系统会陆续更新和完善一些功能。

二、部署架构说明

输入图片说明

三、技术栈说明

前端技术

  • ①vue.js+ElementUI 作为基础技术框架
  • ②WebUploader.js做切块上传框架

后端技术

  • ①Maven+SpringBoot+SpringDataJPA作为基础架构
  • ②Dubbo+Zookeeper作为服务治理架构
  • ③Nacos作为配置中心
  • ④Redis做分布式缓存、过期监听
  • ⑤Zookeeper做分布式锁
  • ⑥WebSocket+Netty做消息推送
  • ⑦Solr做全文检索引擎
  • ⑧FastDFS做分布式文件系统
  • ⑨基于Redis+token+自定义注解实现接口幂等性

四、功能说明

一、网盘系统

  • ①上传功能:主要是针对大文件的切块上传、秒传、文件夹上传
  • ②下载功能:主要是大文件的切块下载;多文件(夹)合并、压缩下载
  • ③文件分享:文件分享包括好友分享、私密链接分享、分享文件的转存
  • ④相册管理:可以建立不同的相册来管理图片,并且可以图片在线预览功能
  • ⑤回收站:删除的文件进入回收站,可以进行还原或者彻底删除
  • ⑥推送功能:主要是好友分享消息推送、过期消息推送、容量更新推送
  • ⑦分布式锁:主要是基于Zookeeper实现分布式锁,保证高并发情况下系统的数据安全
  • ⑧过期监听:主要是基于Redis过期事件实现监听功能,包括:分享失效监听、删除过期监听等
  • ⑨日志采集:通过AOP埋点的方式进行采集用户请求日志,并远程传输到日志服务端;自定义Dubbo的Filter实现链路ID的生成
  • ⑩文件搜索:集成Solr框架实现全文搜索功能
  • ⑪文件存储:集成FastDFS框架实现文件分布式存储
  • ⑫其他琐碎功能:比如,复杂、移动、预览、删除、重命名、在线创建、在线编辑、编辑历史版本留痕等等
  • ⑬Office在线编辑: 后期更新
  • ⑭h5版本客户端: 预计4月25号更新
  • ⑮c/s版本客户端: 后期更新
  • ⑯业务系统API客户端:【 已经完成
  • ⑰图片新增水印: 后期更新
  • ⑱图片在线裁剪: 后期更新

二、后台系统

  • ①组件管理:主要管理文件的预览和编辑组件
  • ②类型管理:主要是管理文件的格式、对应的图标、对应的预览和编辑组件
  • ③日志管理:存储和展示业务系统的操作日志记录,并且可以根据追踪ID来关联所有的日志信息

五、系统安装步骤

参考:https://gitee.com/college996/zwz-netdisk/wikis

后期会编写一个自动化脚本,做到快速本地部署

六、版本更新说明

2020-04-14第一个版本更新

1、更新的功能点说明

  • ①开发了针对业务系统集成的客户端,netdisk-client、netdisk-client-provider
  • ②完善的接口幂等性,redisTemplate执行LUA脚本保证原子性,【判断key是否存在+保存值】这两步是有原子性问题,netdisk-web-perpc/src/main/java/com.micro.idempotence.NoRepeatAop类
  • ③日志采集,增加了开关(Nacos配置:busilog.state=off),netdisk-log-api/src/main/java/com.micro.logs.aop.CollectionLogAop
  • ④完善了Redis功能,新增redis密码,避免遭遇攻击(Nacos配置:redispwd=xxxx)
  • ⑤完善了切块临时记录存储问题,合并切块接口调用完成之后里面删除Redis里面的切块记录,避免大量切块记录过期造成的压力

2、如果想获取该版本,则更新以下操作

  • ①拉取后端代码
  • ②更新前端工程:zwz-disk-manage(新增了应用系统文件管理),更新地址:https://gitee.com/college996/zwz-disk-manage.git
  • ③Nacos配置文件,需要获取nacos_config_20200414.zip,可以从网盘分享里面获取,或者从上面的附件获取
  • ④安装Redis时,需要设置密码,参考:wiki里面的redis安装

七、对接业务系统的sdk说明【4月14号发布的】

1、功能说明

参考我写的一篇文章: https://mp.weixin.qq.com/s?__biz=MzUzMzE3MDcwMQ==&mid=2247483693&idx=1&sn=f81a094019bb3d88cf6bb035e7c932d9&chksm=faa95e4fcdded7593ab31dc8c9920f79290b07bc006ac7f5d4396e66cfec8c3aa6aae5a82769&token=545547741&lang=zh_CN#rd

2、如何集成

第一步:运行netdisk-service-provider.jar

第二步:运行netdisk-client-provider.jar

第三步:业务注册,首先需要让管理员到后台系统新增一条记录,然后拿到APPID(后台系统->应用管理模块

第四步:业务系统,采用原生的方式集成,导入disk-client-javasdk.jar包或者对应其坐标

<dependency>
    <groupId>com.micro</groupId>
    <artifactId>netdisk-client-javasdk</artifactId>
    <version>0.0.1-SNAPSHOT</version>
</dependency>
	

示例代码:

    public static void main(String[] args){
        List<HostBean> hosts=new ArrayList<>();
        hosts.add(new HostBean("127.0.0.1", 8015, 1));
        FileService fs=FileFactory.createFileService(hosts,"ddd");

        //检查md5是否存在
        String appId="11111";
        String filemd5="xxxx";        
        int count=fs.checkFileByMd5(appId, filemd5);
    }

第五步:业务系统,采用SpringBoot starter的方式集成,导入netdisk-spring-boot-starter.jar的坐标

<dependency>
    <groupId>com.micro</groupId>
    <artifactId>netdisk-spring-boot-starter</artifactId>
    <version>0.0.1-SNAPSHOT</version>
</dependency>

application.properties

    netdisk.server.host=127.0.0.1:8015

示例代码:

@Autowired
private FileService fs;

@RequestMapping("/upload")
public String upload() throws InterruptedException{
    String appId="11111";
    String filemd5="xxxx";
    //检查md5是否存在
    int count=fs.checkFileByMd5(appId, filemd5);
}

3、API接口说明

由于接口太多,这里列出来不太方便,大家请看接口文件,里面的接口参数写的很清楚:

netdisk-client-javasdk/src/main/java/com.micro.netdisk.javasdk.service.FileService

八、其他相关地址说明

微信公众号开通了,坚持手写有技术含量的原创文章

【作者写专栏和做项目也不容易,如果觉得对您有帮助可以帮忙订阅一下专栏,当做请作者喝杯咖啡,非常感谢 】

感谢各位老铁订阅了慕课网上面的专栏,由于慕课网的专栏留言是需要官方审核通过之后我才能看到,因此可能会延时,但是我收到留言基本上都会第一时间给大家回复。通过留言,我发现好多小伙伴还是有疑问的,为了方便帮助各位老铁解答相关疑问,zwyjavaee这是我的微信号,专栏内容、网盘系统、技术上有疑问的,都可以互相沟通,本人也是本着交朋友的态度去跟大家交流,所以希望文明交流!【加的时候,备注慕课网或者码云吧】

输入图片说明

Academic Free License (“AFL”) v. 3.0 This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work: Licensed under the Academic Free License version 3.0 1) Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following: a) to reproduce the Original Work in copies, either alone or as part of a collective work; b) to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work; c) to distribute or communicate copies of the Original Work and Derivative Works to the public, under any license of your choice that does not contradict the terms and conditions, including Licensor’s reserved rights and remedies, in this Academic Free License; d) to perform the Original Work publicly; and e) to display the Original Work publicly. 2) Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works. 3) Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work. 4) Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor’s trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license. 5) External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c). 6) Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work. 7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer. 8) Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation. 9) Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including “fair use” or “fair dealing”). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c). 10) Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware. 11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License. 12) Attorneys’ Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License. 13) Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. 14) Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. 15) Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You. 16) Modification of This License. This License is Copyright © 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Academic Free License" or "AFL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.

简介

前后端分离,前端是vue.js+elementui;后端是采用SpringBoot+Dubbo+Zookeeper+Nacos为技术栈的微服务架构模式。页面简洁美观、易于上手学习。 展开 收起
Java
AFL-3.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/zhhb778899/zwz-netdisk.git
git@gitee.com:zhhb778899/zwz-netdisk.git
zhhb778899
zwz-netdisk
仿百度网盘的一款轻量级微服务架构网盘系统,云盘系统,文件管理系统
master

搜索帮助

14c37bed 8189591 565d56ea 8189591