Convert Figma logo to code with AI

shuzheng logozheng

基于Spring+SpringMVC+Mybatis分布式敏捷开发系统架构,提供整套公共微服务服务模块:集中权限管理(单点登录)、内容管理、支付中心、用户管理(支持第三方登录)、微信平台、存储系统、配置中心、日志分析、任务和通知等,支持服务治理、监控和追踪,努力为中小型企业打造全方位J2EE企业级开发解决方案。

16,677
7,379
16,677
78

Top Related Projects

spring boot 实践学习案例,是 spring boot 初学者及核心技术巩固的最佳实践。

:seedling::rocket:一个基于Spring Boot & MyBatis的种子项目,用于快速构建中小型API、RESTful API项目~

🚀一个用来深入学习并实战 Spring Boot 的项目。

about learning Spring Boot via examples. Spring Boot 教程、技术栈示例代码,快速简单上手教程。

《Spring Boot基础教程》,2.x版本持续连载中!点击下方链接直达教程目录!

77,638

mall项目是一套电商系统,包括前台商城系统及后台管理系统,基于SpringBoot+MyBatis实现,采用Docker容器化部署。 前台商城系统包含首页门户、商品推荐、商品搜索、商品展示、购物车、订单流程、会员中心、客户服务、帮助中心等模块。 后台管理系统包含商品管理、订单管理、会员管理、促销管理、运营管理、内容管理、统计报表、财务管理、权限管理、设置等模块。

Quick Overview

Zheng is a comprehensive Java EE enterprise application development framework based on Spring+SpringMVC+Mybatis. It provides a modular architecture and includes various components for building large-scale, distributed systems. The project aims to simplify enterprise application development by offering a set of pre-configured modules and best practices.

Pros

  • Modular architecture allows for easy customization and scalability
  • Comprehensive set of components covering various aspects of enterprise development
  • Well-documented with detailed explanations and examples
  • Active community and regular updates

Cons

  • Steep learning curve for developers new to the Spring ecosystem
  • Large codebase may be overwhelming for smaller projects
  • Some modules may be overkill for simple applications
  • Documentation is primarily in Chinese, which may be a barrier for non-Chinese speakers

Code Examples

  1. Configuring a Mybatis mapper:
@Mapper
public interface UserMapper {
    @Select("SELECT * FROM users WHERE id = #{id}")
    User getUserById(@Param("id") Long id);
}
  1. Creating a RESTful controller:
@RestController
@RequestMapping("/api/users")
public class UserController {
    @Autowired
    private UserService userService;

    @GetMapping("/{id}")
    public ResponseEntity<User> getUser(@PathVariable Long id) {
        User user = userService.getUserById(id);
        return ResponseEntity.ok(user);
    }
}
  1. Configuring a Spring Boot application:
@SpringBootApplication
@EnableTransactionManagement
@MapperScan("com.zheng.mapper")
public class ZhengApplication {
    public static void main(String[] args) {
        SpringApplication.run(ZhengApplication.class, args);
    }
}

Getting Started

  1. Clone the repository:

    git clone https://github.com/shuzheng/zheng.git
    
  2. Navigate to the project directory:

    cd zheng
    
  3. Build the project using Maven:

    mvn clean install
    
  4. Run the application:

    java -jar zheng-webapp/target/zheng-webapp.jar
    
  5. Access the application at http://localhost:8080

Competitor Comparisons

spring boot 实践学习案例,是 spring boot 初学者及核心技术巩固的最佳实践。

Pros of springboot-learning-example

  • More focused on Spring Boot, providing specific examples and tutorials
  • Regularly updated with newer Spring Boot versions and features
  • Better organized structure with separate modules for different topics

Cons of springboot-learning-example

  • Less comprehensive in terms of overall system architecture
  • Lacks integration with other popular frameworks and tools
  • Smaller community and fewer contributors

Code Comparison

springboot-learning-example:

@SpringBootApplication
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

zheng:

@SpringBootApplication
@EnableDubboConfiguration
public class ZhengAdminWebApplication {
    public static void main(String[] args) {
        SpringApplication.run(ZhengAdminWebApplication.class, args);
    }
}

The main difference in the code snippets is that zheng includes additional configurations like @EnableDubboConfiguration, indicating a more complex setup with integration of other frameworks.

springboot-learning-example focuses on providing clear, simple examples for learning Spring Boot, while zheng offers a more comprehensive solution with additional integrations and architectural patterns. The choice between the two depends on whether you're looking for focused Spring Boot learning or a more complete system architecture example.

:seedling::rocket:一个基于Spring Boot & MyBatis的种子项目,用于快速构建中小型API、RESTful API项目~

Pros of spring-boot-api-project-seed

  • Lightweight and focused on API development, making it easier to get started quickly
  • Provides a clear and simple project structure for Spring Boot applications
  • Includes basic configurations and utilities commonly used in API projects

Cons of spring-boot-api-project-seed

  • Less comprehensive than zheng, offering fewer out-of-the-box features
  • May require more manual setup for complex enterprise applications
  • Limited documentation compared to zheng

Code Comparison

spring-boot-api-project-seed:

@Configuration
public class WebMvcConfigurer extends WebMvcConfigurerAdapter {
    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**");
    }
}

zheng:

@Configuration
public class CorsConfig {
    @Bean
    public CorsFilter corsFilter() {
        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
        source.registerCorsConfiguration("/**", buildConfig());
        return new CorsFilter(source);
    }
}

Both projects provide CORS configuration, but zheng offers a more detailed setup using CorsFilter, while spring-boot-api-project-seed uses a simpler approach with WebMvcConfigurer.

🚀一个用来深入学习并实战 Spring Boot 的项目。

Pros of spring-boot-demo

  • More focused on Spring Boot, providing a comprehensive set of examples
  • Regularly updated with new features and improvements
  • Cleaner project structure, making it easier for beginners to navigate

Cons of spring-boot-demo

  • Less comprehensive in terms of overall system architecture
  • Lacks some advanced features present in zheng
  • May not be suitable for large-scale enterprise applications

Code Comparison

spring-boot-demo:

@SpringBootApplication
public class SpringBootDemoApplication {
    public static void main(String[] args) {
        SpringApplication.run(SpringBootDemoApplication.class, args);
    }
}

zheng:

@SpringBootApplication
@EnableDubboConfiguration
public class ZhengAdminWebApplication {
    public static void main(String[] args) {
        SpringApplication.run(ZhengAdminWebApplication.class, args);
    }
}

The main difference in the code snippets is that zheng includes @EnableDubboConfiguration, indicating its use of the Dubbo framework for distributed systems, while spring-boot-demo focuses solely on Spring Boot functionality.

spring-boot-demo is more suitable for developers looking to learn Spring Boot and its various features, while zheng provides a more comprehensive solution for building large-scale distributed systems. The choice between the two depends on the specific requirements of the project and the developer's experience level.

about learning Spring Boot via examples. Spring Boot 教程、技术栈示例代码,快速简单上手教程。

Pros of spring-boot-examples

  • Focused specifically on Spring Boot, providing a wide range of examples
  • Well-organized structure with separate directories for different topics
  • Regularly updated with new examples and improvements

Cons of spring-boot-examples

  • Less comprehensive in terms of full-stack application architecture
  • Lacks integration with other popular frameworks and tools
  • May not provide as much guidance for large-scale project development

Code Comparison

spring-boot-examples:

@SpringBootApplication
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

zheng:

@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
public class ZhengAdminWebApplication {
    public static void main(String[] args) {
        SpringApplication.run(ZhengAdminWebApplication.class, args);
    }
}

The code comparison shows that zheng includes additional annotations for service discovery and Feign clients, indicating a more complex microservices architecture compared to the simpler Spring Boot setup in spring-boot-examples.

《Spring Boot基础教程》,2.x版本持续连载中!点击下方链接直达教程目录!

Pros of SpringBoot-Learning

  • More focused on Spring Boot, providing in-depth tutorials and examples
  • Regularly updated with new Spring Boot features and best practices
  • Better organized structure for learning purposes

Cons of SpringBoot-Learning

  • Less comprehensive in terms of overall system architecture
  • Fewer integrations with other technologies and frameworks
  • Smaller community and fewer contributors

Code Comparison

SpringBoot-Learning:

@SpringBootApplication
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

zheng:

@SpringBootApplication
@EnableDubboConfiguration
public class ZhengAdminWebApplication {
    public static void main(String[] args) {
        SpringApplication.run(ZhengAdminWebApplication.class, args);
    }
}

The main difference in the code snippets is that zheng includes additional configuration for Dubbo, a high-performance RPC framework, while SpringBoot-Learning focuses on a basic Spring Boot application setup.

SpringBoot-Learning is ideal for developers looking to learn Spring Boot in-depth, with a structured approach to tutorials and examples. It's regularly updated but lacks the comprehensive system architecture and integrations found in zheng.

zheng, on the other hand, offers a more complete solution with various integrations and a larger community, but may be overwhelming for those solely focused on learning Spring Boot basics.

77,638

mall项目是一套电商系统,包括前台商城系统及后台管理系统,基于SpringBoot+MyBatis实现,采用Docker容器化部署。 前台商城系统包含首页门户、商品推荐、商品搜索、商品展示、购物车、订单流程、会员中心、客户服务、帮助中心等模块。 后台管理系统包含商品管理、订单管理、会员管理、促销管理、运营管理、内容管理、统计报表、财务管理、权限管理、设置等模块。

Pros of mall

  • More focused on e-commerce, providing a comprehensive solution for online retail
  • Better documentation and tutorials, making it easier for newcomers to get started
  • More active development and frequent updates

Cons of mall

  • Less modular architecture compared to zheng's microservices approach
  • More complex setup due to its comprehensive nature
  • Potentially steeper learning curve for developers new to e-commerce systems

Code Comparison

mall (Product Service):

@Service
public class PmsProductServiceImpl implements PmsProductService {
    @Autowired
    private PmsProductMapper productMapper;
    @Autowired
    private PmsProductLadderMapper productLadderMapper;
    // ... more dependencies
}

zheng (User Service):

@Service
@BaseService
public class UserServiceImpl extends BaseServiceImpl<UserMapper, User, UserExample> implements UserService {

    private static final Logger LOGGER = LoggerFactory.getLogger(UserServiceImpl.class);

    @Autowired
    UserMapper userMapper;
}

Both projects use Spring Boot and follow similar service implementation patterns. However, mall's services are more specialized for e-commerce, while zheng's services are more generic and adaptable to various use cases.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

zheng

Build Status License PRs Welcome GitHub stars GitHub forks

交流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(群内含各种工具、文档、视频教程下载)

前言

  zheng项目不仅仅是一个开发架构,而是努力打造一套从 前端模板 - 基础框架 - 分布式架构 - 开源项目 - 持续集成 - 自动化部署 - 系统监测 - 无缝升级 的全方位J2EE企业级开发解决方案。

项目介绍

  基于Spring+SpringMVC+Mybatis分布式敏捷开发系统架构,提供整套公共微服务服务模块:内容管理、支付中心、用户管理(包括第三方)、微信平台、存储系统、配置中心、日志分析、任务和通知等,支持服务治理、监控和追踪,努力为中小型企业打造全方位J2EE企业级开发解决方案。

组织结构

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]
├── zheng-message -- 实时通知系统
|    ├── zheng-message-sdk -- 开发工具包
|    ├── zheng-message-server -- 服务端[端口:8881,SocketIO端口:8882]
|    └── zheng-message-client -- 客户端
├── zheng-shop -- 电子商务系统
└── zheng-demo -- 示例模块(包含一些示例代码等)
     ├── zheng-demo-rpc-api -- rpc接口包
     ├── zheng-demo-rpc-service -- rpc服务提供者
     └── zheng-demo-web -- 演示示例[端口:9999]

技术选型

后端技术:

技术名称官网
Spring Framework容器http://projects.spring.io/spring-framework/
SpringMVCMVC框架http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/#mvc
Apache Shiro安全框架http://shiro.apache.org/
Spring session分布式Session管理http://projects.spring.io/spring-session/
MyBatisORM框架http://www.mybatis.org/mybatis-3/zh/index.html
MyBatis Generator代码生成http://www.mybatis.org/generator/index.html
PageHelperMyBatis物理分页插件http://git.oschina.net/free/Mybatis_PageHelper
Druid数据库连接池https://github.com/alibaba/druid
FluentValidator校验框架https://github.com/neoremind/fluent-validator
Thymeleaf模板引擎http://www.thymeleaf.org/
Velocity模板引擎http://velocity.apache.org/
ZooKeeper分布式协调服务http://zookeeper.apache.org/
Dubbo分布式服务框架http://dubbo.io/
TBSchedule & elastic-job分布式调度框架https://github.com/dangdangdotcom/elastic-job
Redis分布式缓存数据库https://redis.io/
Solr & Elasticsearch分布式全文搜索引擎http://lucene.apache.org/solr/ https://www.elastic.co/
Quartz作业调度框架http://www.quartz-scheduler.org/
Ehcache进程内缓存框架http://www.ehcache.org/
ActiveMQ消息队列http://activemq.apache.org/
JStorm实时流式计算框架http://jstorm.io/
FastDFS分布式文件系统https://github.com/happyfish100/fastdfs
Log4J日志组件http://logging.apache.org/log4j/1.2/
Swagger2接口测试框架http://swagger.io/
sequence分布式高效ID生产http://git.oschina.net/yu120/sequence
AliOSS & Qiniu & QcloudCOS云存储https://www.aliyun.com/product/oss/ http://www.qiniu.com/ https://www.qcloud.com/product/cos
Protobuf & json数据序列化https://github.com/google/protobuf
Jenkins持续集成工具https://jenkins.io/index.html
Maven项目构建管理http://maven.apache.org/
Netty-socketio实时推送https://github.com/mrniko/netty-socketio

前端技术:

技术名称官网
jQuery函式库http://jquery.com/
Bootstrap前端框架http://getbootstrap.com/
Bootstrap-tableBootstrap数据表格http://bootstrap-table.wenzhixin.net.cn/
Font-awesome字体图标http://fontawesome.io/
material-design-iconic-font字体图标https://github.com/zavoloklom/material-design-iconic-font
Waves点击效果插件https://github.com/fians/Waves
zTree树插件http://www.treejs.cn/v3/
Select2选择框插件https://github.com/select2/select2
jquery-confirm弹出窗口插件https://github.com/craftpip/jquery-confirm
jQuery EasyUI基于jQuery的UI插件集合体http://www.jeasyui.com
React界面构建框架https://github.com/facebook/react
Editor.mdMarkdown编辑器https://github.com/pandao/editor.md
zhengAdmin后台管理系统模板https://github.com/shuzheng/zhengAdmin
autoMail邮箱地址自动补全插件https://github.com/shuzheng/autoMail
zheng.jprogress.js加载进度条插件https://github.com/shuzheng/zheng.jprogress.js
zheng.jtotop.js返回顶部插件https://github.com/shuzheng/zheng.jtotop.js
socket.io.jsSocketIO插件https://socket.io/

架构图

架构图

模块依赖

模块依赖

模块介绍

zheng-common

Spring+SpringMVC+Mybatis框架集成公共模块,包括公共配置、MybatisGenerator扩展插件、通用BaseService、工具类等。

zheng-admin

基于bootstrap实现的响应式Material Design风格的通用后台管理系统,zheng项目所有后台系统都是使用该模块界面作为前端展示。

zheng-ui

各个子系统前台thymeleaf模板,前端资源模块,使用nginx代理,实现动静分离。

zheng-upms

本系统是基于RBAC授权和基于用户授权的细粒度权限控制通用平台,并提供单点登录、会话管理和日志管理。接入的系统可自由定义组织、角色、权限、资源等。用户权限=所拥有角色权限合集+用户加权限-用户减权限,优先级:用户减权限>用户加权限>角色权限

zheng-oss

文件存储系统,提供四种方案:

  • 阿里云 OSS
  • 腾讯云 COS
  • 七牛云
  • 本地分布式存储

阿里云OSS

zheng-api

服务网关,对外暴露统一规范的接口和包装响应结果,包括各个子系统的交互接口、对外开放接口、开发加密接口、接口文档等服务,可在该模块支持验签、鉴权、路由、限流、监控、容错、日志等功能。示例图:

API网关

zheng-cms

内容管理系统:支持多标签、多类目、强大评论的内容管理,有基本单页展示,菜单管理,系统设置等功能。

zheng-pay

  • 一站式支付解决方案,统一下单接口,支持支付宝、微信、网银等多种支付方式。不涉及业务的纯粹的支付平台。

  • 统一下单(统一下单接口、统一扫码)、订单管理、数据分析、财务报表、商户管理、渠道管理、对账系统、系统监控。

统一扫码支付

zheng-ucenter

通用用户管理系统, 实现最常用的用户注册、登录、资料管理、个人中心、第三方登录等基本需求,支持扩展二次开发。

zheng-wechat-mp

微信公众号管理平台,除实现官网后台自动回复、菜单管理、素材管理、用户管理、消息群发等基础功能外,还有二维码推广、营销活动、微网站、会员卡、优惠券等。

zheng-wechat-app

微信小程序后台

zheng-message

基于Netty实现SocketIO的实时推送系统。支持命名空间、二进制数据、SSL、ACK等功能。

环境搭建(QQ群内有“zheng环境搭建和系统部署文档.doc”)

开发工具:

  • MySql: 数据库
  • jetty: 开发服务器
  • Tomcat: 应用服务器
  • SVN|Git: 版本管理
  • Nginx: 反向代理服务器
  • Varnish: HTTP加速器
  • IntelliJ IDEA: 开发IDE
  • PowerDesigner: 建模工具
  • Navicat for MySQL: 数据库客户端

开发环境:

  • Jdk7+
  • Mysql5.5+
  • Redis
  • Zookeeper
  • ActiveMQ
  • Dubbo-admin
  • Dubbo-monitor

工具安装

环境搭建和系统部署文档(作者:小兵,QQ群共享提供下载)

资源下载

开发指南:

  • 1、本机安装Jdk7、Mysql、Redis、Zookeeper、ActiveMQ并**启动相关服务**,使用默认配置默认端口即可
  • 2、克隆源代码到本地并打开,推荐使用IntelliJ IDEA,本地编译并安装到本地maven仓库

修改本地Host

  • 127.0.0.1 ui.zhangshuzheng.cn

  • 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

  • 127.0.0.1 config.zhangshuzheng.cn

  • 127.0.0.1 zkserver

  • 127.0.0.1 rdserver

  • 127.0.0.1 dbserver

  • 127.0.0.1 mqserver

编译流程

maven编译安装zheng/pom.xml文件即可

启动顺序(后台)

准备工作

  • 新建zheng数据库,导入project-datamodel文件夹下的zheng.sql

  • 修改各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工具类修改这些值

  • 启动Zookeeper、Redis、ActiveMQ、Nginx(配置文件参考project-tools/nginx下的*.conf文件)

zheng-upms

  • 首先启动 zheng-upms-rpc-service(直接运行src目录下的ZhengUpmsRpcServiceApplication#main方法启动) => zheng-upms-server(jetty),然后按需启动对应子系统xxx的zheng-xxx-rpc-service(main方法) => zheng-xxx-webapp(jetty)

启动演示

  • 访问 http://upms.zhangshuzheng.cn:1111/,子系统菜单已经配置到zheng-upms权限中,不用直接访问子系统,默认帐号密码:admin/123456

  • 登录成功后,可在右上角切换已注册系统访问

zheng-cms

  • zheng-cms-admin:启动ActiveMQ-启动 => 启动zheng-rpc-service => 启动zheng-cms-admin

  • zheng-cms-web:启动nginx代理zheng-ui静态资源,配置文件可参考 nginx.conf

zheng-oss

  • 首先启动zheng-oss-web服务

  • 开发阶段,如果zheng-oss-web没有公网域名,推荐使用ngrok内网穿透工具,为开发环境提供公网域名,实现上传回调

  • 启动nginx代理zheng-ui静态资源

开发演示(QQ群内有“zheng十分钟视频:从检出到启动.wmv”)

  • 创建数据表(建议使用PowerDesigner)

  • 直接运行对应项目dao模块中的generator.main(),可自动生成单表的CRUD功能和对应的model、example、mapper、service代码

    • 生成的model和example均已实现Serializable接口,支持分布式

    • 已包含抽象类BaseServiceImpl,只需要继承抽象类并传入泛型参数,即可默认实现mapper接口所有方法,特殊需求直接扩展即可

    • BaseServiceImpl默认已实现四种根据条件分页接口

      • selectByExampleWithBLOBsForStartPage()

      • selectByExampleForStartPage()

      • selectByExampleWithBLOBsForOffsetPage()

      • selectByExampleForOffsetPage()

    • BaseServiceImpl方法根据读写操作自动切换主从数据源,继承的扩展接口,可手动通过DynamicDataSource.setDataSource(DataSourceEnum.XXX.getName())指定数据源

  • 启动流程:优先rcp-service服务提供者,再启动其他webapp

  • 扩展流程:可扩展和拆分rpc-api和rpc-service模块,可按微服务拆分或场景拆分

部署方式(QQ群内有“zheng十分钟视频:从打包到linux服务器部署.wmv”)

  • war包项目:使用tomcat等web容器启动

  • rpc-service服务提供者jar包:将打包后的zheng-xxx-rpc-service-assembly.tar.gz文件解压,使用bin目录的管理脚本运行即可,支持优雅停机。

框架规范约定

约定优于配置(convention over configuration),此框架约定了很多编程规范,下面一一列举:


- 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`

- 更多规范,参考[[阿里巴巴Java开发手册] http://git.oschina.net/shuzheng/zheng/attach_files

演示地址

演示地址: http://upms.zhangshuzheng.cn/

预览图

idea login upms cms swagger

数据模型

数据库模型

拓扑图

拓扑图

开发进度

开发进度

参与开发

首先谢谢大家支持,如果你希望参与开发,欢迎通过Github上fork本项目,并Pull Request您的commit。

常见问题

  • Eclipse下,dubbo找不到dubbo.xsd报错,不影响使用,如果要解决,可参考 http://blog.csdn.net/gjldwz/article/details/50555922

  • 报zheng-xxx.jar包找不到,请按照文档编译顺序,将源代码编译并安装到本地maven仓库

  • zheng-cms-admin启动卡住:因为没有启动activemq

  • zheng-upms-server访问报session不存在:因为没有启动redis服务

  • 界面没有样式:因为zheng-admin没有编译安装到本地仓库

  • linux下执行rpc-service脚本报“bin/bash^M 坏的解释器”,使用sed -i 's/\r$//' filename删除脚本中\r字符

附件

zheng相关博客

优秀文章和博客

在线小工具

在线文档

许可证

MIT