Skip to content

Commit 26e6c84

Browse files
committed
搭建框架
1 parent f786812 commit 26e6c84

File tree

286 files changed

+21587
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

286 files changed

+21587
-0
lines changed

.gitignore

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
target/
2+
!.mvn/wrapper/maven-wrapper.jar
3+
4+
### STS ###
5+
.apt_generated
6+
.classpath
7+
.factorypath
8+
.project
9+
.settings
10+
.springBeans
11+
12+
### IntelliJ IDEA ###
13+
.idea
14+
*.iws
15+
*.iml
16+
*.ipr
17+
18+
### NetBeans ###
19+
nbproject/private/
20+
build/
21+
nbbuild/
22+
dist/
23+
nbdist/
24+
.nb-gradle/
25+
26+
### Mallcloud
27+
logs
28+
LOG_FILE_IS_UNDEFINED

LICENSE

+191
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
Apache License
2+
Version 2.0, January 2004
3+
http://www.apache.org/licenses/
4+
5+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6+
7+
1. Definitions.
8+
9+
"License" shall mean the terms and conditions for use, reproduction, and
10+
distribution as defined by Sections 1 through 9 of this document.
11+
12+
"Licensor" shall mean the copyright owner or entity authorized by the copyright
13+
owner that is granting the License.
14+
15+
"Legal Entity" shall mean the union of the acting entity and all other entities
16+
that control, are controlled by, or are under common control with that entity.
17+
For the purposes of this definition, "control" means (i) the power, direct or
18+
indirect, to cause the direction or management of such entity, whether by
19+
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
20+
outstanding shares, or (iii) beneficial ownership of such entity.
21+
22+
"You" (or "Your") shall mean an individual or Legal Entity exercising
23+
permissions granted by this License.
24+
25+
"Source" form shall mean the preferred form for making modifications, including
26+
but not limited to software source code, documentation source, and configuration
27+
files.
28+
29+
"Object" form shall mean any form resulting from mechanical transformation or
30+
translation of a Source form, including but not limited to compiled object code,
31+
generated documentation, and conversions to other media types.
32+
33+
"Work" shall mean the work of authorship, whether in Source or Object form, made
34+
available under the License, as indicated by a copyright notice that is included
35+
in or attached to the work (an example is provided in the Appendix below).
36+
37+
"Derivative Works" shall mean any work, whether in Source or Object form, that
38+
is based on (or derived from) the Work and for which the editorial revisions,
39+
annotations, elaborations, or other modifications represent, as a whole, an
40+
original work of authorship. For the purposes of this License, Derivative Works
41+
shall not include works that remain separable from, or merely link (or bind by
42+
name) to the interfaces of, the Work and Derivative Works thereof.
43+
44+
"Contribution" shall mean any work of authorship, including the original version
45+
of the Work and any modifications or additions to that Work or Derivative Works
46+
thereof, that is intentionally submitted to Licensor for inclusion in the Work
47+
by the copyright owner or by an individual or Legal Entity authorized to submit
48+
on behalf of the copyright owner. For the purposes of this definition,
49+
"submitted" means any form of electronic, verbal, or written communication sent
50+
to the Licensor or its representatives, including but not limited to
51+
communication on electronic mailing lists, source code control systems, and
52+
issue tracking systems that are managed by, or on behalf of, the Licensor for
53+
the purpose of discussing and improving the Work, but excluding communication
54+
that is conspicuously marked or otherwise designated in writing by the copyright
55+
owner as "Not a Contribution."
56+
57+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
58+
of whom a Contribution has been received by Licensor and subsequently
59+
incorporated within the Work.
60+
61+
2. Grant of Copyright License.
62+
63+
Subject to the terms and conditions of this License, each Contributor hereby
64+
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
65+
irrevocable copyright license to reproduce, prepare Derivative Works of,
66+
publicly display, publicly perform, sublicense, and distribute the Work and such
67+
Derivative Works in Source or Object form.
68+
69+
3. Grant of Patent License.
70+
71+
Subject to the terms and conditions of this License, each Contributor hereby
72+
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
73+
irrevocable (except as stated in this section) patent license to make, have
74+
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
75+
such license applies only to those patent claims licensable by such Contributor
76+
that are necessarily infringed by their Contribution(s) alone or by combination
77+
of their Contribution(s) with the Work to which such Contribution(s) was
78+
submitted. If You institute patent litigation against any entity (including a
79+
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
80+
Contribution incorporated within the Work constitutes direct or contributory
81+
patent infringement, then any patent licenses granted to You under this License
82+
for that Work shall terminate as of the date such litigation is filed.
83+
84+
4. Redistribution.
85+
86+
You may reproduce and distribute copies of the Work or Derivative Works thereof
87+
in any medium, with or without modifications, and in Source or Object form,
88+
provided that You meet the following conditions:
89+
90+
You must give any other recipients of the Work or Derivative Works a copy of
91+
this License; and
92+
You must cause any modified files to carry prominent notices stating that You
93+
changed the files; and
94+
You must retain, in the Source form of any Derivative Works that You distribute,
95+
all copyright, patent, trademark, and attribution notices from the Source form
96+
of the Work, excluding those notices that do not pertain to any part of the
97+
Derivative Works; and
98+
If the Work includes a "NOTICE" text file as part of its distribution, then any
99+
Derivative Works that You distribute must include a readable copy of the
100+
attribution notices contained within such NOTICE file, excluding those notices
101+
that do not pertain to any part of the Derivative Works, in at least one of the
102+
following places: within a NOTICE text file distributed as part of the
103+
Derivative Works; within the Source form or documentation, if provided along
104+
with the Derivative Works; or, within a display generated by the Derivative
105+
Works, if and wherever such third-party notices normally appear. The contents of
106+
the NOTICE file are for informational purposes only and do not modify the
107+
License. You may add Your own attribution notices within Derivative Works that
108+
You distribute, alongside or as an addendum to the NOTICE text from the Work,
109+
provided that such additional attribution notices cannot be construed as
110+
modifying the License.
111+
You may add Your own copyright statement to Your modifications and may provide
112+
additional or different license terms and conditions for use, reproduction, or
113+
distribution of Your modifications, or for any such Derivative Works as a whole,
114+
provided Your use, reproduction, and distribution of the Work otherwise complies
115+
with the conditions stated in this License.
116+
117+
5. Submission of Contributions.
118+
119+
Unless You explicitly state otherwise, any Contribution intentionally submitted
120+
for inclusion in the Work by You to the Licensor shall be under the terms and
121+
conditions of this License, without any additional terms or conditions.
122+
Notwithstanding the above, nothing herein shall supersede or modify the terms of
123+
any separate license agreement you may have executed with Licensor regarding
124+
such Contributions.
125+
126+
6. Trademarks.
127+
128+
This License does not grant permission to use the trade names, trademarks,
129+
service marks, or product names of the Licensor, except as required for
130+
reasonable and customary use in describing the origin of the Work and
131+
reproducing the content of the NOTICE file.
132+
133+
7. Disclaimer of Warranty.
134+
135+
Unless required by applicable law or agreed to in writing, Licensor provides the
136+
Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
137+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
138+
including, without limitation, any warranties or conditions of TITLE,
139+
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
140+
solely responsible for determining the appropriateness of using or
141+
redistributing the Work and assume any risks associated with Your exercise of
142+
permissions under this License.
143+
144+
8. Limitation of Liability.
145+
146+
In no event and under no legal theory, whether in tort (including negligence),
147+
contract, or otherwise, unless required by applicable law (such as deliberate
148+
and grossly negligent acts) or agreed to in writing, shall any Contributor be
149+
liable to You for damages, including any direct, indirect, special, incidental,
150+
or consequential damages of any character arising as a result of this License or
151+
out of the use or inability to use the Work (including but not limited to
152+
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
153+
any and all other commercial damages or losses), even if such Contributor has
154+
been advised of the possibility of such damages.
155+
156+
9. Accepting Warranty or Additional Liability.
157+
158+
While redistributing the Work or Derivative Works thereof, You may choose to
159+
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
160+
other liability obligations and/or rights consistent with this License. However,
161+
in accepting such obligations, You may act only on Your own behalf and on Your
162+
sole responsibility, not on behalf of any other Contributor, and only if You
163+
agree to indemnify, defend, and hold each Contributor harmless for any liability
164+
incurred by, or claims asserted against, such Contributor by reason of your
165+
accepting any such warranty or additional liability.
166+
167+
END OF TERMS AND CONDITIONS
168+
169+
APPENDIX: How to apply the Apache License to your work
170+
171+
To apply the Apache License to your work, attach the following boilerplate
172+
notice, with the fields enclosed by brackets "{}" replaced with your own
173+
identifying information. (Don't include the brackets!) The text should be
174+
enclosed in the appropriate comment syntax for the file format. We also
175+
recommend that a file or class name and description of purpose be included on
176+
the same "printed page" as the copyright notice for easier identification within
177+
third-party archives.
178+
179+
Copyright 2017 zscat777
180+
181+
Licensed under the Apache License, Version 2.0 (the "License");
182+
you may not use this file except in compliance with the License.
183+
You may obtain a copy of the License at
184+
185+
http://www.apache.org/licenses/LICENSE-2.0
186+
187+
Unless required by applicable law or agreed to in writing, software
188+
distributed under the License is distributed on an "AS IS" BASIS,
189+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190+
See the License for the specific language governing permissions and
191+
limitations under the License.

README.md

+131
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# Mallcloud
2+
3+
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/shenzhuan/mallcloud)
4+
[![Total lines](https://tokei.rs/b1/github/zscat777/Mallcloud?category=lines)](https://github.com/shenzhuan/mallcloud)
5+
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?label=license)](https://github.com/shenzhuan/mallcloud/blob/master/LICENSE)
6+
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/1237f7a17da0481bad1ad1fe0f93b7ea)](https://app.codacy.com/app/zscat777/Mallcloud?utm_source=github.com&utm_medium=referral&utm_content=zscat777/Mallcloud&utm_campaign=Badge_Grade_Dashboard)
7+
8+
- [配套前端地址](https://github.com/shenzhuan/mallcloud-UI-NEW)
9+
- [在线文档](http://118.190.154.85:8080)
10+
- [演示地址](http://118.190.154.85)
11+
12+
## 前言
13+
14+
'Mallcloud' 是一整套的微服务企业级解决方案。是微服务敏捷开发的代表。
15+
16+
## 项目介绍
17+
18+
[Spring Cloud](https://projects.spring.io/spring-cloud/) 是一个微服务框架,相比 Dubbo 等 RPC 框架, Spring Cloud 提供更全面的分布式系统解决方案。Spring
19+
Cloud 对微服务基础框架 Netflix 的多个开源组件进行了封装,同时又实现了和云端平台以及和 Spring Boot 开发框架的集成。 Spring
20+
Cloud 为微服务架构开发涉及的统一认证,配置管理,服务治理,熔断机制,动态路由等提供了一种简单的开发方式。
21+
22+
Spring Cloud 本身已经封装得足够简单,也够丰富。也许正是因为这种简单而丰富,使得想要使用它的团队望而却步。学习成本太高,历史包袱太重,维护成本太高等等一系列原因。
23+
24+
*Mallcloud* 就是为了解决这一问题而诞生的。 *Mallcloud* 整合了 Spring Cloud 的**配置中心****注册中心****服务网关**,提供了一系列starter组件,
25+
同时提供**服务治理****服务监控****OAuth2 权限认证**,支持**服务降级/熔断****基于标签(x-label)
26+
的路由****服务权重**,前端采用**vue+elementUI**,可以很好的解决技术转向 Spring Cloud 的一系列问题,努力打造全方位的微服务敏捷开发解决方案。
27+
28+
*Mallcloud* 提供了基于 Docker Compose 的部署方式。配置文件统一放置在docs目录中,运行脚本案例在根目录中查找。
29+
30+
### 主要实现功能
31+
32+
* Spring Cloud Eureka 注册中心
33+
* Spring Cloud Config Server 配置中心,统一管理配置信息
34+
* Spring Cloud Zuul Gateway 统一微服务网关配置,支持动态路由配置
35+
* 基于 spring-boot-starter-actuator 的自实现的服务治理。包括日志、变量、映射等情况。
36+
* 基于 Hystrix 的聚合监控页面,包括单个服务和服务多个实例的监控。
37+
* 基于 Spring Security OAuth2 的权限认证系统。采用JWT RSA非对称加密的形式进行 token 加密解密。
38+
* 支持基于权重以及基于标签的服务路由,支持动态配置服务权重及标签信息。通过控制用户标签以及动态路由的配置,满足各种各样请求策略。
39+
* 基于角色的RBAC权限控制(用户、部门、角色、菜单、日志、字典、动态路由、oauth2 客户端),支持按钮级别的权限控制以及数据权限控制(DataScope)。
40+
* 基于Zipkin的调用链追踪(如果生产上使用,还需要把监控内容持久化比,如采用ElasticSearch,把监控内容从发送http请求切换到MQ等改造)。
41+
42+
### 分支版本
43+
44+
* Branch 1.5.12:基于 Spring Boot 1.5.12.RELEASE + Spring Cloud Edgware.SR4,是Mallcloud最初的版本。
45+
* Branch 2.x:基于 Spring Boot 2.0.5.RELEASE + Spring Cloud Finchley.SR1 是当前维护的版本。
46+
* Master 分支已经改为从2.x merge代码,今后更新的中心也会放在2.x分支上。
47+
48+
### 整体架构
49+
50+
![架构图](https://github.com/shenzhuan/mallcloud/blob/master/mallcloud-docs/files/mallcloud%E6%9E%B6%E6%9E%84%E5%9B%BE.jpg)
51+
52+
### 项目目录结构
53+
54+
```
55+
├── mallcloud-cloud --微服务相关组件
56+
│ ├── cloud-admin --服务治理相关
57+
│ ├── cloud-config --服务配置中心
58+
│ ├── cloud-monitor --服务监控
59+
│ ├── cloud-registry --服务注册中心
60+
├── mallcloud-common-starter --自定义spring boot starter
61+
│ ├── mallcloud-common-spring-boot-starter --公共依赖模块(全局异常、常量、通用类)
62+
│ ├── mallcloud-log-spring-boot-starter --通用logback-spring、自定义banner
63+
│ ├── mallcloud-redis-spring-boot-starter --通用redis配置
64+
│ ├── mallcloud-ribbon-spring-boot-starter --基于ribbon的服务治理扩展
65+
│ ├── mallcloud-swagger2-spring-boot-starter --自定义封装swagger2配置
66+
├── mallcloud-demo --demo案例
67+
├── mallcloud-docs --文档、截图、docker文件、初始化脚本
68+
├── mallcloud-gateway --微服务网关
69+
├── mallcloud-oauth2 --认证中心
70+
│ ├── authentication-server --统一认证服务
71+
│ ├── oauth2-config --oauth2抽象封装
72+
│ ├── sso-demo1 --sso案例
73+
│ ├── sso-demo1 --sso案例
74+
├── mallcloud-rbac --基于角色的权限控制服务
75+
76+
```
77+
78+
### 项目截图
79+
80+
![login](https://github.com/shenzhuan/mallcloud/blob/master/mallcloud-docs/files/login.png)
81+
![menu](https://github.com/shenzhuan/mallcloud/blob/master/mallcloud-docs/files/menu.png)
82+
![route](https://github.com/shenzhuan/mallcloud/blob/master/mallcloud-docs/files/route.png)
83+
![monitor](https://github.com/shenzhuan/mallcloud/blob/master/mallcloud-docs/files/monitor.png)
84+
![servers](https://github.com/shenzhuan/mallcloud/blob/master/mallcloud-docs/files/servers.png)
85+
![api](https://github.com/shenzhuan/mallcloud/blob/master/mallcloud-docs/files/api.png)
86+
![zipkin](https://github.com/shenzhuan/mallcloud/blob/master/mallcloud-docs/files/zipkin.png)
87+
88+
### 后端环境
89+
90+
* JDK1.8+
91+
* Spring Boot 1.5.12
92+
* Spring Cloud Edgware.SR4
93+
* Maven 3.0+
94+
* Redis 3.0+
95+
* MySQL 5.7
96+
* IDEA
97+
98+
### 前端
99+
100+
Mallcloud 前端基于开源项目 [D2Admin](https://github.com/d2-projects/d2-admin) 构建。
101+
102+
D2Admin 中文文档:[D2Admin Document](https://d2-projects.github.io/d2-admin-doc/zh/)
103+
104+
<a href="https://github.com/d2-projects/d2-admin" target="_blank"><img src="https://raw.githubusercontent.com/FairyEver/d2-admin/master/doc/image/d2-admin@2x.png" width="200"></a>
105+
106+
### 链接推荐
107+
108+
- [Spring Boot 1.5.12.RELEASE](https://docs.spring.io/spring-boot/docs/1.5.12.RELEASE/reference/htmlsingle) 官方文档
109+
- [Spring Cloud Edgware.SR4](http://cloud.spring.io/spring-cloud-static/Dalston.SR4/multi/multi_spring-cloud.html) 官方文档
110+
- [Spring Security OAuth2](http://projects.spring.io/spring-security-oauth/docs/oauth2.html) 开发者指南
111+
112+
### 资源下载
113+
114+
- JDK8 [http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html "JDK8")
115+
- Maven [http://maven.apache.org/download.cgi](http://maven.apache.org/download.cgi "Maven")
116+
- Redis [https://redis.io/download](https://redis.io/download "Redis")
117+
- ActiveMQ [http://activemq.apache.org/download-archives.html](http://activemq.apache.org/download-archives.html "ActiveMQ")
118+
- ZooKeeper [http://www.apache.org/dyn/closer.cgi/zookeeper/](http://www.apache.org/dyn/closer.cgi/zookeeper/ "ZooKeeper")
119+
- Elastic Stack [https://www.elastic.co/downloads](https://www.elastic.co/downloads "Elastic Stack")
120+
- Nginx [http://nginx.org/en/download.html](http://nginx.org/en/download.html "Nginx")
121+
- Jenkins [http://updates.jenkins-ci.org/download/war/](http://updates.jenkins-ci.org/download/war/ "Jenkins")
122+
123+
### 友情链接
124+
125+
- [管理系统前端模板 D2Admin](https://github.com/d2-projects/d2-admin)
126+
127+
## LICENSE
128+
129+
[MIT](LICENSE "MIT")
130+
131+

0 commit comments

Comments
 (0)