zheng/README.md

526 lines
27 KiB
Markdown
Raw Permalink Normal View History

2017-01-13 23:36:43 +08:00
# zheng
2017-11-11 16:42:15 +08:00
[![Build Status](https://travis-ci.org/shuzheng/zheng.svg?branch=master)](https://travis-ci.org/shuzheng/zheng)
2017-03-26 02:01:57 +08:00
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
2017-01-02 20:35:35 +08:00
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/shuzheng/zheng/pulls)
2017-03-28 12:37:31 +08:00
[![GitHub stars](https://img.shields.io/github/stars/shuzheng/zheng.svg?style=social&label=Stars)](https://github.com/shuzheng/zheng)
2017-01-06 14:55:07 +08:00
[![GitHub forks](https://img.shields.io/github/forks/shuzheng/zheng.svg?style=social&label=Fork)](https://github.com/shuzheng/zheng)
2016-10-22 21:07:44 +08:00
2018-12-19 11:14:06 +08:00
交流QQ群133107819、284280411、305155242🈵、528049386、157869467🈵、570766789🈵、601147566🈵、309985359🈵、336380857🈵、522723488、556447629、654558397🈵、392564561🈵、494594000🈵、494070275🈵、168267539🈵、652798487🈵、650979251🈵、622461564🈵、219381522🈵、487874426🈵、398342630🈵、205986087🈵、574153262🈵、606890936🈵、565434047🈵、680947971🈵、341884034🈵、562977817🈵、478962414🈵、679219230🈵、676766033🈵、621874750🈵、522903600🈵、524932879🈵、376261902🈵、481096887🈵、232104667🈵、637879277🈵、697575367🈵、702995203🈵、708665910🈵、697141239🈵、574057714🈵、631332162🈵、591739143🈵、731016871🈵、598738752🈵、748759166🈵、159816595(群内含各种工具、文档、视频教程下载)
2017-01-12 23:15:52 +08:00
2017-01-13 23:36:43 +08:00
## 前言
2017-11-08 22:22:50 +08:00
  `zheng`项目不仅仅是一个开发架构,而是努力打造一套从 **前端模板** - **基础框架** - **分布式架构** - **开源项目** - **持续集成** - **自动化部署** - **系统监测** - **无缝升级** 的全方位J2EE企业级开发解决方案。
2017-01-13 23:36:43 +08:00
2017-01-13 23:38:37 +08:00
## 项目介绍
2017-01-13 23:36:43 +08:00
2017-03-28 12:45:22 +08:00
  基于Spring+SpringMVC+Mybatis分布式敏捷开发系统架构提供整套公共微服务服务模块内容管理、支付中心、用户管理包括第三方、微信平台、存储系统、配置中心、日志分析、任务和通知等支持服务治理、监控和追踪努力为中小型企业打造全方位J2EE企业级开发解决方案。
2017-01-13 23:36:43 +08:00
### 组织结构
2017-06-25 22:16:49 +08:00
``` lua
zheng
├── zheng-common -- SSM框架公共模块
├── zheng-admin -- 后台管理模板
├── zheng-ui -- 前台thymeleaf模板[端口:1000]
├── zheng-config -- 配置中心[端口:1001]
├── zheng-upms -- 用户权限管理系统
| ├── zheng-upms-common -- upms系统公共模块
| ├── zheng-upms-dao -- 代码生成模块,无需开发
| ├── zheng-upms-client -- 集成upms依赖包提供单点认证、授权、统一会话管理
| ├── zheng-upms-rpc-api -- rpc接口包
| ├── zheng-upms-rpc-service -- rpc服务提供者
| └── zheng-upms-server -- 用户权限系统及SSO服务端[端口:1111]
├── zheng-cms -- 内容管理系统
| ├── zheng-cms-common -- cms系统公共模块
| ├── zheng-cms-dao -- 代码生成模块,无需开发
| ├── zheng-cms-rpc-api -- rpc接口包
| ├── zheng-cms-rpc-service -- rpc服务提供者
| ├── zheng-cms-search -- 搜索服务[端口:2221]
| ├── zheng-cms-admin -- 后台管理[端口:2222]
| ├── zheng-cms-job -- 消息队列、任务调度等[端口:2223]
| └── zheng-cms-web -- 网站前台[端口:2224]
├── zheng-pay -- 支付系统
| ├── zheng-pay-common -- pay系统公共模块
| ├── zheng-pay-dao -- 代码生成模块,无需开发
| ├── zheng-pay-rpc-api -- rpc接口包
| ├── zheng-pay-rpc-service -- rpc服务提供者
| ├── zheng-pay-sdk -- 开发工具包
| ├── zheng-pay-admin -- 后台管理[端口:3331]
| └── zheng-pay-web -- 演示示例[端口:3332]
├── zheng-ucenter -- 用户系统(包括第三方登录)
| ├── zheng-ucenter-common -- ucenter系统公共模块
| ├── zheng-ucenter-dao -- 代码生成模块,无需开发
| ├── zheng-ucenter-rpc-api -- rpc接口包
| ├── zheng-ucenter-rpc-service -- rpc服务提供者
| └── zheng-ucenter-web -- 网站前台[端口:4441]
├── zheng-wechat -- 微信系统
| ├── zheng-wechat-mp -- 微信公众号管理系统
| | ├── zheng-wechat-mp-dao -- 代码生成模块,无需开发
| | ├── zheng-wechat-mp-service -- 业务逻辑
| | └── zheng-wechat-mp-admin -- 后台管理[端口:5551]
| └── zheng-ucenter-app -- 微信小程序后台
├── zheng-api -- API接口总线系统
| ├── zheng-api-common -- api系统公共模块
| ├── zheng-api-rpc-api -- rpc接口包
| ├── zheng-api-rpc-service -- rpc服务提供者
| └── zheng-api-server -- api系统服务端[端口:6666]
├── zheng-oss -- 对象存储系统
| ├── zheng-oss-sdk -- 开发工具包
| ├── zheng-oss-web -- 前台接口[端口:7771]
| └── zheng-oss-admin -- 后台管理[端口:7772]
2018-11-15 14:10:31 +08:00
├── zheng-message -- 实时通知系统
2018-07-04 16:23:40 +08:00
| ├── zheng-message-sdk -- 开发工具包
| ├── zheng-message-server -- 服务端[端口:8881,SocketIO端口:8882]
| └── zheng-message-client -- 客户端
2017-06-25 22:16:49 +08:00
├── zheng-shop -- 电子商务系统
└── zheng-demo -- 示例模块(包含一些示例代码等)
├── zheng-demo-rpc-api -- rpc接口包
├── zheng-demo-rpc-service -- rpc服务提供者
2018-07-03 20:15:19 +08:00
└── zheng-demo-web -- 演示示例[端口:9999]
2017-06-25 22:16:49 +08:00
```
2016-11-12 00:40:57 +08:00
2017-01-13 23:36:43 +08:00
### 技术选型
2017-01-02 20:27:11 +08:00
2017-01-13 23:36:43 +08:00
#### 后端技术:
2017-04-02 16:26:47 +08:00
技术 | 名称 | 官网
----|------|----
Spring Framework | 容器 | [http://projects.spring.io/spring-framework/](http://projects.spring.io/spring-framework/)
SpringMVC | MVC框架 | [http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/#mvc](http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/#mvc)
Apache Shiro | 安全框架 | [http://shiro.apache.org/](http://shiro.apache.org/)
Spring session | 分布式Session管理 | [http://projects.spring.io/spring-session/](http://projects.spring.io/spring-session/)
MyBatis | ORM框架 | [http://www.mybatis.org/mybatis-3/zh/index.html](http://www.mybatis.org/mybatis-3/zh/index.html)
MyBatis Generator | 代码生成 | [http://www.mybatis.org/generator/index.html](http://www.mybatis.org/generator/index.html)
2017-05-02 22:54:26 +08:00
PageHelper | MyBatis物理分页插件 | [http://git.oschina.net/free/Mybatis_PageHelper](http://git.oschina.net/free/Mybatis_PageHelper)
2017-04-02 16:26:47 +08:00
Druid | 数据库连接池 | [https://github.com/alibaba/druid](https://github.com/alibaba/druid)
FluentValidator | 校验框架 | [https://github.com/neoremind/fluent-validator](https://github.com/neoremind/fluent-validator)
Thymeleaf | 模板引擎 | [http://www.thymeleaf.org/](http://www.thymeleaf.org/)
Velocity | 模板引擎 | [http://velocity.apache.org/](http://velocity.apache.org/)
ZooKeeper | 分布式协调服务 | [http://zookeeper.apache.org/](http://zookeeper.apache.org/)
Dubbo | 分布式服务框架 | [http://dubbo.io/](http://dubbo.io/)
2017-04-02 16:35:18 +08:00
TBSchedule & elastic-job | 分布式调度框架 | [https://github.com/dangdangdotcom/elastic-job](https://github.com/dangdangdotcom/elastic-job)
2017-04-02 16:26:47 +08:00
Redis | 分布式缓存数据库 | [https://redis.io/](https://redis.io/)
2017-04-02 16:35:18 +08:00
Solr & Elasticsearch | 分布式全文搜索引擎 | [http://lucene.apache.org/solr/](http://lucene.apache.org/solr/) [https://www.elastic.co/](https://www.elastic.co/)
2017-04-02 16:26:47 +08:00
Quartz | 作业调度框架 | [http://www.quartz-scheduler.org/](http://www.quartz-scheduler.org/)
Ehcache | 进程内缓存框架 | [http://www.ehcache.org/](http://www.ehcache.org/)
ActiveMQ | 消息队列 | [http://activemq.apache.org/](http://activemq.apache.org/)
JStorm | 实时流式计算框架 | [http://jstorm.io/](http://jstorm.io/)
FastDFS | 分布式文件系统 | [https://github.com/happyfish100/fastdfs](https://github.com/happyfish100/fastdfs)
Log4J | 日志组件 | [http://logging.apache.org/log4j/1.2/](http://logging.apache.org/log4j/1.2/)
Swagger2 | 接口测试框架 | [http://swagger.io/](http://swagger.io/)
sequence | 分布式高效ID生产 | [http://git.oschina.net/yu120/sequence](http://git.oschina.net/yu120/sequence)
2017-04-02 16:35:18 +08:00
AliOSS & Qiniu & QcloudCOS | 云存储 | [https://www.aliyun.com/product/oss/](https://www.aliyun.com/product/oss/) [http://www.qiniu.com/](http://www.qiniu.com/) [https://www.qcloud.com/product/cos](https://www.qcloud.com/product/cos)
Protobuf & json | 数据序列化 | [https://github.com/google/protobuf](https://github.com/google/protobuf)
2017-04-02 16:26:47 +08:00
Jenkins | 持续集成工具 | [https://jenkins.io/index.html](https://jenkins.io/index.html)
Maven | 项目构建管理 | [http://maven.apache.org/](http://maven.apache.org/)
2018-07-03 20:15:19 +08:00
Netty-socketio | 实时推送 | [https://github.com/mrniko/netty-socketio](https://github.com/mrniko/netty-socketio)
2016-10-22 21:19:37 +08:00
2017-01-13 23:36:43 +08:00
#### 前端技术:
2017-04-02 16:35:18 +08:00
技术 | 名称 | 官网
----|------|----
jQuery | 函式库 | [http://jquery.com/](http://jquery.com/)
Bootstrap | 前端框架 | [http://getbootstrap.com/](http://getbootstrap.com/)
Bootstrap-table | Bootstrap数据表格 | [http://bootstrap-table.wenzhixin.net.cn/](http://bootstrap-table.wenzhixin.net.cn/)
Font-awesome | 字体图标 | [http://fontawesome.io/](http://fontawesome.io/)
2017-05-18 23:05:34 +08:00
material-design-iconic-font | 字体图标 | [https://github.com/zavoloklom/material-design-iconic-font](https://github.com/zavoloklom/material-design-iconic-font)
2017-04-02 16:35:18 +08:00
Waves | 点击效果插件 | [https://github.com/fians/Waves](https://github.com/fians/Waves)
zTree | 树插件 | [http://www.treejs.cn/v3/](http://www.treejs.cn/v3/)
Select2 | 选择框插件 | [https://github.com/select2/select2](https://github.com/select2/select2)
jquery-confirm | 弹出窗口插件 | [https://github.com/craftpip/jquery-confirm](https://github.com/craftpip/jquery-confirm)
jQuery EasyUI | 基于jQuery的UI插件集合体 | [http://www.jeasyui.com](http://www.jeasyui.com)
React | 界面构建框架 | [https://github.com/facebook/react](https://github.com/facebook/react)
Editor.md | Markdown编辑器 | [https://github.com/pandao/editor.md](https://github.com/pandao/editor.md)
zhengAdmin | 后台管理系统模板 | [https://github.com/shuzheng/zhengAdmin](https://github.com/shuzheng/zhengAdmin)
autoMail | 邮箱地址自动补全插件 | [https://github.com/shuzheng/autoMail](https://github.com/shuzheng/autoMail)
zheng.jprogress.js | 加载进度条插件 | [https://github.com/shuzheng/zheng.jprogress.js](https://github.com/shuzheng/zheng.jprogress.js)
zheng.jtotop.js | 返回顶部插件 | [https://github.com/shuzheng/zheng.jtotop.js](https://github.com/shuzheng/zheng.jtotop.js)
2018-07-03 20:15:19 +08:00
socket.io.js | SocketIO插件 | [https://socket.io/](https://socket.io/)
2016-10-22 21:19:37 +08:00
2017-03-24 14:23:07 +08:00
#### 架构图
![架构图](project-bootstrap/architect.png)
2017-03-24 14:25:01 +08:00
#### 模块依赖
![模块依赖](project-bootstrap/project.png)
2017-01-13 23:36:43 +08:00
#### 模块介绍
2017-01-13 23:41:47 +08:00
> zheng-common
2017-01-13 23:36:43 +08:00
2017-02-13 13:31:19 +08:00
Spring+SpringMVC+Mybatis框架集成公共模块包括公共配置、MybatisGenerator扩展插件、通用BaseService、工具类等。
2017-01-13 23:36:43 +08:00
> zheng-admin
2017-01-13 23:36:43 +08:00
基于bootstrap实现的响应式Material Design风格的通用后台管理系统`zheng`项目所有后台系统都是使用该模块界面作为前端展示。
2017-01-13 23:36:43 +08:00
2017-03-29 22:25:16 +08:00
> zheng-ui
各个子系统前台thymeleaf模板前端资源模块使用nginx代理实现动静分离。
2017-01-13 23:41:47 +08:00
> zheng-upms
2017-01-13 23:36:43 +08:00
2017-04-04 18:48:59 +08:00
本系统是基于RBAC授权和基于用户授权的细粒度权限控制通用平台并提供单点登录、会话管理和日志管理。接入的系统可自由定义组织、角色、权限、资源等。用户权限=所拥有角色权限合集+用户加权限-用户减权限,优先级:用户减权限>用户加权限>角色权限
2017-01-13 23:36:43 +08:00
2017-01-13 23:41:47 +08:00
> zheng-oss
2017-01-13 23:36:43 +08:00
2017-02-13 13:31:19 +08:00
文件存储系统,提供四种方案:
2017-01-13 23:36:43 +08:00
2017-02-13 13:31:19 +08:00
- **阿里云** OSS
- **腾讯云** COS
- **七牛云**
- 本地分布式存储
2017-02-09 23:29:39 +08:00
2017-05-15 21:07:25 +08:00
![阿里云OSS](project-bootstrap/aliyun-oss-post-callback.png)
2017-05-15 21:06:26 +08:00
2017-01-13 23:41:47 +08:00
> zheng-api
2017-01-13 23:36:43 +08:00
2017-08-29 20:03:47 +08:00
服务网关,对外暴露统一规范的接口和包装响应结果,包括各个子系统的交互接口、对外开放接口、开发加密接口、接口文档等服务,可在该模块支持验签、鉴权、路由、限流、监控、容错、日志等功能。示例图:
2017-02-14 11:25:08 +08:00
2017-08-29 20:03:47 +08:00
![API网关](project-bootstrap/gateway_config.png)
2017-02-14 11:25:08 +08:00
2017-01-13 23:36:43 +08:00
2017-01-13 23:41:47 +08:00
> zheng-cms
2017-01-13 23:36:43 +08:00
2017-02-13 13:31:19 +08:00
内容管理系统:支持多标签、多类目、强大评论的内容管理,有基本单页展示,菜单管理,系统设置等功能。
2017-01-13 23:36:43 +08:00
2017-01-13 23:41:47 +08:00
> zheng-pay
2017-01-13 23:36:43 +08:00
2017-02-13 13:31:19 +08:00
- 一站式支付解决方案,统一下单接口,支持支付宝、微信、网银等多种支付方式。不涉及业务的纯粹的支付平台。
2017-01-13 23:36:43 +08:00
2017-02-13 13:31:19 +08:00
- 统一下单(统一下单接口、统一扫码)、订单管理、数据分析、财务报表、商户管理、渠道管理、对账系统、系统监控。
2017-02-09 23:29:39 +08:00
2017-05-16 11:31:52 +08:00
![统一扫码支付](project-bootstrap/zheng-pay.png)
2017-01-13 23:41:47 +08:00
> zheng-ucenter
2017-01-13 23:36:43 +08:00
2017-02-13 13:31:19 +08:00
通用用户管理系统, 实现最常用的用户注册、登录、资料管理、个人中心、第三方登录等基本需求,支持扩展二次开发。
2017-01-13 23:36:43 +08:00
2017-01-13 23:41:47 +08:00
> zheng-wechat-mp
2017-01-13 23:36:43 +08:00
2017-02-13 13:31:19 +08:00
微信公众号管理平台,除实现官网后台自动回复、菜单管理、素材管理、用户管理、消息群发等基础功能外,还有二维码推广、营销活动、微网站、会员卡、优惠券等。
2017-01-13 23:36:43 +08:00
2017-07-15 20:27:34 +08:00
> zheng-wechat-app
2017-02-08 23:53:04 +08:00
2017-02-13 13:31:19 +08:00
微信小程序后台
2017-02-08 23:53:04 +08:00
2018-07-04 16:23:40 +08:00
> zheng-message
2018-07-03 20:15:19 +08:00
基于Netty实现SocketIO的实时推送系统。支持命名空间、二进制数据、SSL、ACK等功能。
2017-06-03 18:40:43 +08:00
## 环境搭建QQ群内有“zheng环境搭建和系统部署文档.doc”
2017-01-13 23:36:43 +08:00
#### 开发工具:
2017-02-04 11:05:00 +08:00
- MySql: 数据库
- jetty: 开发服务器
- Tomcat: 应用服务器
- SVN|Git: 版本管理
- Nginx: 反向代理服务器
- Varnish: HTTP加速器
- IntelliJ IDEA: 开发IDE
- PowerDesigner: 建模工具
- Navicat for MySQL: 数据库客户端
2016-11-14 13:15:54 +08:00
2017-01-13 23:36:43 +08:00
#### 开发环境:
2017-07-15 20:27:34 +08:00
- Jdk7+
- Mysql5.5+
2017-01-13 23:36:43 +08:00
- Redis
- Zookeeper
- ActiveMQ
- Dubbo-admin
2017-08-01 22:18:48 +08:00
- Dubbo-monitor
2017-01-10 12:37:00 +08:00
2017-01-13 23:36:43 +08:00
### 工具安装
2017-07-15 20:27:34 +08:00
环境搭建和系统部署文档(作者小兵QQ群共享提供下载)
2017-01-10 13:31:31 +08:00
2017-01-13 23:36:43 +08:00
### 资源下载
2017-01-10 12:37:00 +08:00
2017-02-13 17:38:02 +08:00
- JDK7 [http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html](http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html "JDK7")
2017-02-04 11:05:00 +08:00
- Maven [http://maven.apache.org/download.cgi](http://maven.apache.org/download.cgi "Maven")
- Redis [https://redis.io/download](https://redis.io/download "Redis")
- ActiveMQ [http://activemq.apache.org/download-archives.html](http://activemq.apache.org/download-archives.html "ActiveMQ")
- ZooKeeper [http://www.apache.org/dyn/closer.cgi/zookeeper/](http://www.apache.org/dyn/closer.cgi/zookeeper/ "ZooKeeper")
- Dubbo [http://dubbo.io/Download-zh.htm](http://dubbo.io/Download-zh.htm "Dubbo")
- Elastic Stack [https://www.elastic.co/downloads](https://www.elastic.co/downloads "Elastic Stack")
2017-03-25 15:49:01 +08:00
- Nginx [http://nginx.org/en/download.html](http://nginx.org/en/download.html "Nginx")
2017-02-04 11:05:00 +08:00
- Jenkins [http://updates.jenkins-ci.org/download/war/](http://updates.jenkins-ci.org/download/war/ "Jenkins")
- dubbo-admin-2.5.3 [http://download.csdn.net/detail/shuzheng5201314/9733652](http://download.csdn.net/detail/shuzheng5201314/9733652 "dubbo-admin-2.5.3")
- dubbo-admin-2.5.4-SNAPSHOT-jdk8 [http://download.csdn.net/detail/shuzheng5201314/9733657](http://download.csdn.net/detail/shuzheng5201314/9733657 "dubbo-admin-2.5.4-SNAPSHOT-jdk8")
2017-02-13 17:38:02 +08:00
- 更多资源请加QQ群
2016-11-14 13:15:54 +08:00
2017-01-13 23:36:43 +08:00
## 开发指南:
2017-03-29 22:06:00 +08:00
- 1、本机安装Jdk7、Mysql、Redis、Zookeeper、ActiveMQ并**启动相关服务**,使用默认配置默认端口即可
2017-02-04 19:50:49 +08:00
- 2、克隆源代码到本地并打开**推荐使用IntelliJ IDEA**本地编译并安装到本地maven仓库
2017-01-13 23:36:43 +08:00
2017-01-09 17:55:10 +08:00
### 修改本地Host
2017-02-04 11:05:00 +08:00
2017-03-23 17:50:44 +08:00
- 127.0.0.1 ui.zhangshuzheng.cn
2017-02-04 11:05:00 +08:00
- 127.0.0.1 upms.zhangshuzheng.cn
- 127.0.0.1 cms.zhangshuzheng.cn
- 127.0.0.1 pay.zhangshuzheng.cn
- 127.0.0.1 ucenter.zhangshuzheng.cn
- 127.0.0.1 wechat.zhangshuzheng.cn
- 127.0.0.1 api.zhangshuzheng.cn
- 127.0.0.1 oss.zhangshuzheng.cn
2017-07-23 23:16:36 +08:00
- 127.0.0.1 config.zhangshuzheng.cn
2017-01-09 17:55:10 +08:00
2017-07-15 20:27:34 +08:00
- 127.0.0.1 zkserver
- 127.0.0.1 rdserver
- 127.0.0.1 dbserver
- 127.0.0.1 mqserver
2017-01-13 23:36:43 +08:00
### 编译流程
2017-04-27 00:13:43 +08:00
maven编译安装zheng/pom.xml文件即可
2017-01-13 23:36:43 +08:00
2017-03-25 15:49:01 +08:00
### 启动顺序(后台)
2017-06-03 18:29:12 +08:00
> 准备工作
2017-04-05 23:22:33 +08:00
- 新建zheng数据库导入project-datamodel文件夹下的zheng.sql
2017-01-19 22:41:42 +08:00
2017-02-13 13:31:19 +08:00
- 修改各dao模块和rpc-service模块的redis.properties、jdbc.properties、generator.properties数据库连接等配置信息其中master.redis.password、master.jdbc.password、slave.jdbc.password、generator.jdbc.password密码值使用了AES加密请使用com.zheng.common.util.AESUtil工具类修改这些值
2017-06-25 22:16:49 +08:00
- 启动Zookeeper、Redis、ActiveMQ、Nginx配置文件参考project-tools/nginx下的*.conf文件
2017-06-03 18:29:12 +08:00
> **zheng-upms**
2017-03-17 13:47:48 +08:00
- 首先启动 zheng-upms-rpc-service(直接运行src目录下的ZhengUpmsRpcServiceApplication#main方法启动) => zheng-upms-server(jetty)然后按需启动对应子系统xxx的zheng-xxx-rpc-service(main方法) => zheng-xxx-webapp(jetty)
2017-06-03 18:29:12 +08:00
2017-04-02 18:42:32 +08:00
![启动演示](project-bootstrap/start.png)
2017-06-03 18:29:12 +08:00
2017-06-03 18:36:10 +08:00
- 访问 [http://upms.zhangshuzheng.cn:1111/](http://upms.zhangshuzheng.cn:1111/ "统一后台地址")子系统菜单已经配置到zheng-upms权限中不用直接访问子系统默认帐号密码admin/123456
2017-03-17 13:51:05 +08:00
2017-01-19 22:41:42 +08:00
- 登录成功后,可在右上角切换已注册系统访问
2017-01-18 13:11:20 +08:00
2017-06-03 18:29:12 +08:00
> **zheng-cms**
2017-03-25 15:49:01 +08:00
2017-06-03 18:29:12 +08:00
- zheng-cms-admin启动ActiveMQ-启动 => 启动zheng-rpc-service => 启动zheng-cms-admin
- zheng-cms-web启动nginx代理zheng-ui静态资源配置文件可参考 [nginx.conf](http://git.oschina.net/shuzheng/zheng/attach_files)
> **zheng-oss**
- 首先启动zheng-oss-web服务
- 开发阶段如果zheng-oss-web没有公网域名推荐使用`ngrok`内网穿透工具,为开发环境提供公网域名,实现上传回调
- 启动nginx代理zheng-ui静态资源
2017-03-25 15:49:01 +08:00
2017-06-03 18:40:43 +08:00
### 开发演示QQ群内有“zheng十分钟视频从检出到启动.wmv”
2017-01-13 23:36:43 +08:00
- 创建数据表建议使用PowerDesigner
- 直接运行对应项目dao模块中的generator.main()可自动生成单表的CRUD功能和对应的model、example、mapper、service代码
- 生成的model和example均已实现Serializable接口支持分布式
2017-03-25 15:58:19 +08:00
2017-01-13 23:36:43 +08:00
- 已包含抽象类BaseServiceImpl只需要继承抽象类并传入泛型参数即可默认实现mapper接口所有方法特殊需求直接扩展即可
2017-05-02 22:54:26 +08:00
2017-06-25 22:22:09 +08:00
- BaseServiceImpl默认已实现四种根据条件分页接口
- selectByExampleWithBLOBsForStartPage()
- selectByExampleForStartPage()
- selectByExampleWithBLOBsForOffsetPage()
- selectByExampleForOffsetPage()
2017-03-25 15:58:19 +08:00
2017-02-17 13:48:53 +08:00
- BaseServiceImpl方法根据读写操作自动切换主从数据源继承的扩展接口可手动通过`DynamicDataSource.setDataSource(DataSourceEnum.XXX.getName())`指定数据源
2017-01-13 23:36:43 +08:00
- 启动流程优先rcp-service服务提供者再启动其他webapp
- 扩展流程可扩展和拆分rpc-api和rpc-service模块可按微服务拆分或场景拆分
2017-06-03 18:40:43 +08:00
### 部署方式QQ群内有“zheng十分钟视频从打包到linux服务器部署.wmv”
2017-04-02 14:24:17 +08:00
- war包项目使用tomcat等web容器启动
- rpc-service服务提供者jar包将打包后的zheng-xxx-rpc-service-assembly.tar.gz文件解压使用bin目录的管理脚本运行即可支持优雅停机。
2017-02-06 16:26:03 +08:00
### 框架规范约定
2017-03-25 15:55:25 +08:00
约定优于配置(convention over configuration),此框架约定了很多编程规范,下面一一列举:
2017-02-06 16:26:03 +08:00
2017-03-25 15:52:07 +08:00
```
2017-02-06 16:26:03 +08:00
- service类需要在叫名`service`的包下,并以`Service`结尾,如`CmsArticleServiceImpl`
- controller类需要在以`controller`结尾的包下类名以Controller结尾如`CmsArticleController.java`,并继承`BaseController`
- spring task类需要在叫名`task`的包下,并以`Task`结尾,如`TestTask.java`
- mapper.xml需要在名叫`mapper`的包下,并以`Mapper.xml`结尾,如`CmsArticleMapper.xml`
- mapper接口需要在名叫`mapper`的包下,并以`Mapper`结尾,如`CmsArticleMapper.java`
- model实体类需要在名叫`model`的包下,命名规则为数据表转驼峰规则,如`CmsArticle.java`
- spring配置文件命名规则为`applicationContext-*.xml`
- 类名:首字母大写驼峰规则;方法名:首字母小写驼峰规则;常量:全大写;变量:首字母小写驼峰规则,尽量非缩写
- springmvc配置加到对应模块的`springMVC-servlet.xml`文件里
- 配置文件放到`src/main/resources`目录下
- 静态资源文件放到`src/main/webapp/resources`目录下
- jsp文件需要在`/WEB-INF/jsp`目录下
- `RequestMapping`和返回物理试图路径的url尽量写全路径`@RequestMapping("/manage")`、`return "/manage/index"`
- `RequestMapping`指定method
- 模块命名为`项目`-`子项目`-`业务`,如`zheng-cms-admin`
- 数据表命名为:`子系统`_`表`,如`cms_article`
2017-04-02 18:49:48 +08:00
- 更多规范,参考[[阿里巴巴Java开发手册] http://git.oschina.net/shuzheng/zheng/attach_files
2017-02-07 22:53:02 +08:00
2017-03-25 15:52:07 +08:00
```
2017-02-06 16:26:03 +08:00
2017-01-13 23:36:43 +08:00
## 演示地址
2017-05-02 13:54:38 +08:00
演示地址: [http://upms.zhangshuzheng.cn/](http://47.93.195.63/zheng-upms-server/sso/login?backurl=http%3A%2F%2F47.93.195.63%2Fzheng-upms-server%2Fmanage%2Findex "演示地址")
2017-01-13 23:36:43 +08:00
### 预览图
2017-03-24 14:39:37 +08:00
![idea](project-bootstrap/idea.png)
2017-03-19 00:37:35 +08:00
![login](project-bootstrap/zheng-login.png)
![upms](project-bootstrap/zheng-upms.png)
2017-03-19 00:47:41 +08:00
![cms](project-bootstrap/zheng-cms.png)
2017-01-19 20:41:38 +08:00
![swagger](project-bootstrap/api.png)
2017-01-02 21:12:49 +08:00
2017-01-13 23:36:43 +08:00
### 数据模型
2017-03-13 17:53:56 +08:00
![数据库模型](project-datamodel/zheng.png)
2017-01-13 23:36:43 +08:00
### 拓扑图
2017-03-13 17:53:56 +08:00
![拓扑图](project-bootstrap/distributedSystem.png)
2017-01-13 23:36:43 +08:00
2017-02-11 16:33:38 +08:00
### 开发进度
![开发进度](project-bootstrap/progress.png)
2017-03-18 22:58:28 +08:00
### 参与开发
首先谢谢大家支持,如果你希望参与开发,欢迎通过[Github](https://github.com/shuzheng/zheng "Github")上fork本项目并Pull Request您的commit。
2017-03-24 14:20:30 +08:00
### 常见问题
- Eclipse下dubbo找不到dubbo.xsd报错不影响使用如果要解决可参考 [http://blog.csdn.net/gjldwz/article/details/50555922](http://blog.csdn.net/gjldwz/article/details/50555922)
- 报zheng-xxx.jar包找不到,请按照文档编译顺序将源代码编译并安装到本地maven仓库
2017-03-29 22:06:00 +08:00
- zheng-cms-admin启动卡住因为没有启动activemq
- zheng-upms-server访问报session不存在因为没有启动redis服务
- 界面没有样式因为zheng-admin没有编译安装到本地仓库
2017-10-23 22:12:04 +08:00
- linux下执行rpc-service脚本报“bin/bash^M 坏的解释器”使用sed -i 's/\r$//' filename删除脚本中\r字符
2017-01-18 10:14:16 +08:00
## 附件
2017-10-20 14:26:08 +08:00
### zheng相关博客
- [zheng-1环境搭建及项目部署](http://www.jianshu.com/p/b2fb42e17b58 "zheng-1环境搭建及项目部署")
- [zheng项目新建一个module学习学习](http://blog.csdn.net/u014449653/article/details/78294862 "zheng项目新建一个module学习学习")
2017-10-24 21:43:27 +08:00
- [zheng项目系统简单的分析记录](http://blog.csdn.net/u014449653/article/details/78319135 "zheng项目系统简单的分析记录")
2017-11-08 22:11:37 +08:00
- [zheng项目-从rpc-service开始](http://blog.csdn.net/u014449653/article/details/78341171 "zheng项目-从rpc-service开始")
- [进击zheng项目zheng-umps-server](http://blog.csdn.net/u014449653/article/details/78355849 "进击zheng项目zheng-umps-server")
2018-01-17 17:06:22 +08:00
- [zheng环境搭建](http://blog.csdn.net/u011781521/article/details/79012311 "zheng环境搭建")
2018-01-17 17:10:35 +08:00
- [让zheng支持activiti工作流](http://blog.csdn.net/ctmold/article/details/79082406 "让zheng支持activiti工作流")
- [让zheng更完美地支持ajax提交的json数据](http://blog.csdn.net/ctmold/article/details/79081483 "让zheng更完美地支持ajax提交的json数据")
2017-01-18 10:14:16 +08:00
### 优秀文章和博客
2019-05-22 10:17:38 +08:00
- [Git原理及使用](https://zhuanlan.zhihu.com/p/66506485 "Git原理及使用")
2017-01-18 10:14:16 +08:00
- [创业互联网公司如何搭建自己的技术框架](http://shuzheng5201314.iteye.com/blog/2330151 "创业互联网公司如何搭建自己的技术框架")
2017-02-14 11:25:08 +08:00
- [微服务实战](https://segmentfault.com/a/1190000004634172 "微服务实战")
2017-01-18 10:14:16 +08:00
- [单点登录原理与简单实现](http://shuzheng5201314.iteye.com/blog/2343910 "单点登录原理与简单实现")
- [ITeye论坛关于权限控制的讨论](http://www.iteye.com/magazines/82 "ITeye论坛关于权限控制的讨论")
- [RBAC新解基于资源的权限管理(Resource-Based Access Control)](http://globeeip.iteye.com/blog/1236167 "RBAC新解基于资源的权限管理(Resource-Based Access Control)")
2017-02-04 20:01:33 +08:00
- [网站架构经验随笔](http://jinnianshilongnian.iteye.com/blog/2289904 "网站架构经验随笔")
2017-02-04 19:50:49 +08:00
- [支付系统架构](http://shuzheng5201314.iteye.com/blog/2355431 "支付系统架构")
2017-01-18 10:14:16 +08:00
- [Spring整合JMS](http://elim.iteye.com/blog/1893038 "Spring整合JMS")
2017-02-04 19:50:49 +08:00
- [跟我学Shiro目录贴](http://jinnianshilongnian.iteye.com/blog/2018398 "跟我学Shiro目录贴")
2017-02-04 20:01:33 +08:00
- [跟我学SpringMVC目录汇总贴](http://jinnianshilongnian.iteye.com/blog/1752171 "跟我学SpringMVC目录汇总贴")
- [跟我学spring3 目录贴](http://jinnianshilongnian.iteye.com/blog/1482071 "跟我学spring3 目录贴")
- [跟我学OpenResty(Nginx+Lua)开发目录贴](http://jinnianshilongnian.iteye.com/blog/2190344 "跟我学OpenResty(Nginx+Lua)开发目录贴")
2017-01-18 10:14:16 +08:00
- [Redis中文网](http://www.redis.net.cn/ "Redis中文网")
- [读懂Redis并配置主从集群及高可用部署](http://mp.weixin.qq.com/s?__biz=MzIxNTYzOTQ0Ng==&mid=2247483668&idx=1&sn=cd31574877d38cf7ff9c047b86c9bf23&chksm=979475eda0e3fcfb6b5006bcd19c5a838eca9e369252847dbdf97820bf418201dd75c1dadda3&mpshare=1&scene=23&srcid=0117KUiiITwi2ETRan16xRVg#rd "读懂Redis并配置主从集群及高可用部署")
2017-03-13 17:53:56 +08:00
- [Redis哨兵-实现Redis高可用](http://redis.majunwei.com/topics/sentinel.html "Redis哨兵-实现Redis高可用")
2017-01-18 13:01:22 +08:00
- [ELK(ElasticSearch, Logstash, Kibana)搭建实时日志分析平台](http://www.open-open.com/lib/view/open1451801542042.html "ELK(ElasticSearch, Logstash, Kibana)搭建实时日志分析平台")
2017-01-18 10:14:16 +08:00
- [Nginx基本功能极速入门](http://xxgblog.com/2015/05/17/nginx-start/ "Nginx基本功能极速入门")
- [mybatis-genarator 自定义插件](https://my.oschina.net/alexgaoyh/blog/702791 "mybatis-genarator 自定义插件")
- [Elasticsearch权威指南中文版](https://es.xiaoleilu.com/510_Deployment/20_hardware.html "Elasticsearch权威指南中文版")
- [springMVC对简单对象、Set、List、Map的数据绑定和常见问题.](http://blog.csdn.net/z_dendy/article/details/12648641 "springMVC对简单对象、Set、List、Map的数据绑定和常见问题.")
2017-03-01 17:56:31 +08:00
- [如何细粒度地控制你的MyBatis二级缓存](http://blog.csdn.net/luanlouis/article/details/41800511 "如何细粒度地控制你的MyBatis二级缓存")
2017-11-08 22:18:42 +08:00
- [Git 在团队中的最佳实践--如何正确使用Git Flow](hhttps://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow "Git 在团队中的最佳实践--如何正确使用Git Flow")
2017-01-18 10:14:16 +08:00
- [做个男人,做个成熟的男人,做个有城府的男人](http://shuzheng5201314.iteye.com/blog/1387820 "做个男人,做个成熟的男人,做个有城府的男人")
2017-02-13 17:38:02 +08:00
### 在线小工具
2017-01-18 10:14:16 +08:00
- [在线Cron表达式生成器](http://cron.qqe2.com/ "在线Cron表达式生成器")
- [在线工具 - 程序员的工具箱](http://tool.lu/ "在线工具 - 程序员的工具箱")
2017-01-18 13:08:32 +08:00
2017-02-13 17:38:02 +08:00
### 在线文档
- [JDK7英文文档](http://tool.oschina.net/apidocs/apidoc?api=jdk_7u4 "JDK7英文文档")
- [Spring4.x文档](http://spring.oschina.mopaas.com/ "Spring4.x文档")
- [Mybatis3官网](http://www.mybatis.org/mybatis-3/zh/index.html "Mybatis3官网")
- [Dubbo官网](http://dubbo.io/ "Dubbo官网")
- [Nginx中文文档](http://tool.oschina.net/apidocs/apidoc?api=nginx-zh "Nginx中文文档")
- [Freemarker在线手册](http://freemarker.foofun.cn/ "Freemarker在线中文手册")
- [Velocity在线手册](http://velocity.apache.org/engine/devel/developer-guide.html "Velocity在线手册")
- [Bootstrap在线手册](http://www.bootcss.com/ "Bootstrap在线手册")
2017-03-03 13:09:26 +08:00
- [Git官网中文文档](https://git-scm.com/book/zh/v2 "Git官网中文文档")
2017-03-21 14:50:58 +08:00
- [Thymeleaf](http://www.thymeleaf.org/doc/tutorials/3.0/thymeleafspring.html "Thymeleaf")
2017-01-18 13:08:32 +08:00
## 许可证
2017-06-03 18:55:44 +08:00
[MIT](LICENSE "MIT")