ehcache入门基础示例

分享一个朋友的人工智能教程(请以“右键”->"在新标签页中打开连接”的方式访问)。比较通俗易懂,风趣幽默,感兴趣的朋友可以去看看。

一:目录

  • EhCache 简介
  • Hello World 示例
  • Spring 整合

二: 简介

1. 基本介绍

EhCache 是一个纯Java的进程内缓存框架,具有快速、精干等特点,是Hibernate中默认CacheProvider。Ehcache是一种广泛使用的开源Java分布式缓存。主要面向通用缓存,Java EE和轻量级容器。它具有内存和磁盘存储,缓存加载器,缓存扩展,缓存异常处理程序,一个gzip缓存servlet过滤器,支持REST和SOAP api等特点。

Spring 提供了对缓存功能的抽象:即允许绑定不同的缓存解决方案(如Ehcache),但本身不直接提供缓存功能的实现。它支持注解方式使用缓存,非常方便。

2. 主要的特性有:

  1. 快速
  2. 简单
  3. 多种缓存策略
  4. 缓存数据有两级:内存和磁盘,因此无需担心容量问题
  5. 缓存数据会在虚拟机重启的过程中写入磁盘
  6. 可以通过RMI、可插入API等方式进行分布式缓存
  7. 具有缓存和缓存管理器的侦听接口
  8. 支持多缓存管理器实例,以及一个实例的多个缓存区域
  9. 提供Hibernate的缓存实现

3. 集成

可以单独使用,一般在第三方库中被用到的比较多(如mybatis、shiro等)ehcache 对分布式支持不够好,多个节点不能同步,通常和redis一块使用

4. ehcache 和 redis 比较

  • ehcache直接在jvm虚拟机中缓存,速度快,效率高;但是缓存共享麻烦,集群分布式应用不方便。

  • redis是通过socket访问到缓存服务,效率比ecache低,比数据库要快很多,
    处理集群和分布式缓存方便,有成熟的方案。如果是单个应用或者对缓存访问要求很高的应用,用ehcache。如果是大型系统,存在缓存共享、分布式部署、缓存内容很大的,建议用redis。

ehcache也有缓存共享方案,不过是通过RMI或者Jgroup多播方式进行广播缓存通知更新,缓存共享复杂,维护不方便;简单的共享可以,但是涉及到缓存恢复,大数据缓存,则不合适。


三: Hello World

1、在pom.xml中引入依赖

<dependency>
    <groupId>net.sf.ehcache</groupId>
    <artifactId>ehcache</artifactId>
    <version>2.10.2</version>
</dependency>

2、在src/main/resources/创建一个配置文件 ehcache.xml

默认情况下Ehcache会自动加载classpath根目录下名为ehcache.xml文件,也可以将该文件放到其他地方在使用时指定文件的位置

<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd">

  <!-- 磁盘缓存位置 -->
  <diskStore path="java.io.tmpdir/ehcache"/>

  <!-- 默认缓存 -->
  <defaultCache
          maxEntriesLocalHeap="10000"
          eternal="false"
          timeToIdleSeconds="120"
          timeToLiveSeconds="120"
          maxEntriesLocalDisk="10000000"
          diskExpiryThreadIntervalSeconds="120"
          memoryStoreEvictionPolicy="LRU">
    <persistence strategy="localTempSwap"/>
  </defaultCache>

  <!-- helloworld缓存 -->
  <cache name="HelloWorldCache"
         maxElementsInMemory="1000"
         eternal="false"
         timeToIdleSeconds="5"
         timeToLiveSeconds="5"
         overflowToDisk="false"
         memoryStoreEvictionPolicy="LRU"/>
</ehcache>

3、测试类

package com.mengdee.manage.cache;

import com.mengdee.manage.entity.Dog;

import net.sf.ehcache.Cache;
import net.sf.ehcache.CacheManager;
import net.sf.ehcache.Element;

public class CacheTest {

	public static void main(String[] args) {
		
		// 1. 创建缓存管理器
		CacheManager cacheManager = CacheManager.create("./src/main/resources/ehcache.xml");
		
		// 2. 获取缓存对象
		Cache cache = cacheManager.getCache("HelloWorldCache");
		
		// 3. 创建元素
		Element element = new Element("key1", "value1");
		
		// 4. 将元素添加到缓存
		cache.put(element);
		
		// 5. 获取缓存
		Element value = cache.get("key1");
		System.out.println(value);
		System.out.println(value.getObjectValue());
		
		// 6. 删除元素
		cache.remove("key1");
		
		Dog dog = new Dog(1L, "taidi", (short)2);
		Element element2 = new Element("taidi", dog);
		cache.put(element2);
		Element value2 = cache.get("taidi");
		Dog dog2 = (Dog) value2.getObjectValue();
		System.out.println(dog2);
		
		System.out.println(cache.getSize());
		
		// 7. 刷新缓存
		cache.flush();
		
		// 8. 关闭缓存管理器
		cacheManager.shutdown();
	}
}

4、缓存配置

一:xml配置方式:

  • diskStore : ehcache支持内存和磁盘两种存储

    • path :指定磁盘存储的位置
  • defaultCache : 默认的缓存

    • maxEntriesLocalHeap=“10000”
    • eternal=“false”
    • timeToIdleSeconds=“120”
    • timeToLiveSeconds=“120”
    • maxEntriesLocalDisk=“10000000”
    • diskExpiryThreadIntervalSeconds=“120”
    • memoryStoreEvictionPolicy=“LRU”
  • cache :自定的缓存,当自定的配置不满足实际情况时可以通过自定义(可以包含多个cache节点)

    • name : 缓存的名称,可以通过指定名称获取指定的某个Cache对象

    • maxElementsInMemory :内存中允许存储的最大的元素个数,0代表无限个

    • clearOnFlush:内存数量最大时是否清除。

    • eternal :设置缓存中对象是否为永久的,如果是,超时设置将被忽略,对象从不过期。根据存储数据的不同,例如一些静态不变的数据如省市区等可以设置为永不过时

    • timeToIdleSeconds : 设置对象在失效前的允许闲置时间(单位:秒)。仅当eternal=false对象不是永久有效时使用,可选属性,默认值是0,也就是可闲置时间无穷大。

    • timeToLiveSeconds :缓存数据的生存时间(TTL),也就是一个元素从构建到消亡的最大时间间隔值,这只能在元素不是永久驻留时有效,如果该值是0就意味着元素可以停顿无穷长的时间。

    • overflowToDisk :内存不足时,是否启用磁盘缓存。

    • maxEntriesLocalDisk:当内存中对象数量达到maxElementsInMemory时,Ehcache将会对象写到磁盘中。

    • maxElementsOnDisk:硬盘最大缓存个数。

    • diskSpoolBufferSizeMB:这个参数设置DiskStore(磁盘缓存)的缓存区大小。默认是30MB。每个Cache都应该有自己的一个缓冲区。

    • diskPersistent:是否在VM重启时存储硬盘的缓存数据。默认值是false。

    • diskExpiryThreadIntervalSeconds:磁盘失效线程运行时间间隔,默认是120秒。

二:编程方式配置

Cache cache = manager.getCache("mycache"); 
CacheConfiguration config = cache.getCacheConfiguration(); 
config.setTimeToIdleSeconds(60); 
config.setTimeToLiveSeconds(120); 
config.setmaxEntriesLocalHeap(10000); 
config.setmaxEntriesLocalDisk(1000000);

5、Ehcache API

  • CacheManager:Cache的容器对象,并管理着(添加或删除)Cache的生命周期。
// 可以自己创建一个Cache对象添加到CacheManager中
public void addCache(Cache cache);
public synchronized void removeCache(String cacheName);
  • Cache: 一个Cache可以包含多个Element,并被CacheManager管理。它实现了对缓存的逻辑行为

  • Element:需要缓存的元素,它维护着一个键值对, 元素也可以设置有效期,0代表无限制

  • 获取CacheManager的方式:

    可以通过create()或者newInstance()方法或重载方法来创建获取CacheManager的方式:

public static CacheManager create();
public static CacheManager create(String configurationFileName);
public static CacheManager create(InputStream inputStream);
public static CacheManager create(URL configurationFileURL);

public static CacheManager newInstance();

Ehcache的CacheManager构造函数或工厂方法被调用时,会默认加载classpath下名为ehcache.xml的配置文件。
如果加载失败,会加载Ehcache jar包中的ehcache-failsafe.xml文件,这个文件中含有简单的默认配置。

// CacheManager.create() == CacheManager.create("./src/main/resources/ehcache.xml")
// 使用Ehcache默认配置新建一个CacheManager实例
CacheManager cacheManager = CacheManager.create();
cacheManager = CacheManager.newInstance();

cacheManager = CacheManager.newInstance("./src/main/resources/ehcache.xml");

InputStream inputStream = new FileInputStream(new File("./src/main/resources/ehcache.xml"));
cacheManager = CacheManager.newInstance(inputStream);

String[] cacheNames = cacheManager.getCacheNames();  // [HelloWorldCache]

四:Spring整合

示例结构:

这里写图片描述

1. pom.xml 引入spring和ehcache

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.mengdee</groupId>
  <artifactId>ehcache</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  
  <properties>
  	<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  	<junit.version>4.10</junit.version>
	<spring.version>4.2.3.RELEASE</spring.version>
  </properties>
  
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    
    <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-test</artifactId>
         <version>${spring.version}</version>
         <scope>test</scope>
     </dependency>
    
    
    <!-- springframework -->
    <dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-webmvc</artifactId>
		<version>${spring.version}</version>
	</dependency>
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-core</artifactId>
		<version>${spring.version}</version>
	</dependency>
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-context</artifactId>
		<version>${spring.version}</version>
	</dependency>
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-context-support</artifactId>
		<version>${spring.version}</version>
	</dependency>
    
	<dependency>
	    <groupId>net.sf.ehcache</groupId>
	    <artifactId>ehcache</artifactId>
	    <version>2.10.3</version>
	</dependency>

    
  </dependencies>
  
  <repositories>
    <repository>
        <id>aliyun</id>
        <name>aliyun</name>
        <url>http://maven.aliyun.com/nexus/content/groups/public</url>
    </repository>
  </repositories>
</project>

2. 在src/main/resources添加ehcache.xml

<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd">

  <!-- 磁盘缓存位置 -->
  <diskStore path="java.io.tmpdir/ehcache" />

  <!-- 默认缓存 -->
  <defaultCache
          maxEntriesLocalHeap="10000"
          eternal="false"
          timeToIdleSeconds="120"
          timeToLiveSeconds="120"
          maxEntriesLocalDisk="10000000"
          diskExpiryThreadIntervalSeconds="120"
          memoryStoreEvictionPolicy="LRU">
    <persistence strategy="localTempSwap"/>
  </defaultCache>

  <!-- helloworld缓存 -->
  <cache name="HelloWorldCache"
         maxElementsInMemory="1000"
         eternal="false"
         timeToIdleSeconds="5"
         timeToLiveSeconds="5"
         overflowToDisk="false"
         memoryStoreEvictionPolicy="LRU"/>
  
  <cache name="UserCache"
         maxElementsInMemory="1000"
         eternal="false"
         timeToIdleSeconds="1800"
         timeToLiveSeconds="1800"
         overflowToDisk="false"
         memoryStoreEvictionPolicy="LRU"/>
</ehcache>

3. 在src/main/resources/conf/spring中配置spring-base.xml和spring-ehcache.xml

spring-base.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context" xmlns:util="http://www.springframework.org/schema/util"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">

    <context:component-scan base-package="com.mengdee.**.dao,com.mengdee.**.service"/>
</beans>

spring-ehcache.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:cache="http://www.springframework.org/schema/cache"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/cache
        http://www.springframework.org/schema/cache/spring-cache-3.2.xsd">

  <description>ehcache缓存配置管理文件</description>

  <!-- 启用缓存注解开关 -->
  <cache:annotation-driven cache-manager="cacheManager"/>

  <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager">
    <property name="cacheManager" ref="ehcache"/>
  </bean>
  
  <bean id="ehcache" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
    <property name="configLocation" value="classpath:ehcache.xml"/>
  </bean>

</beans>

4、在src/main/java/com.mengdee.manager.service/下 创建EhcacheService和EhcacheServiceImpl

EhcacheService

package com.mengdee.manager.service;

import com.mengdee.manager.entity.User;

public interface EhcacheService {

	// 测试失效情况,有效期为5秒
	public String getTimestamp(String param);
	
	public String getDataFromDB(String key);
	
	public void removeDataAtDB(String key);
	
	public String refreshData(String key);
	
	
	public User findById(String userId);
	
	public boolean isReserved(String userId);
	
	public void removeUser(String userId);
	
	public void removeAllUser();
}

EhcacheServiceImpl:

package com.mengdee.manager.service;

import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import com.mengdee.manager.entity.User;

@Service
public class EhcacheServiceImpl implements EhcacheService{

	// value的值和ehcache.xml中的配置保持一致
	@Cacheable(value="HelloWorldCache", key="#param")
	@Override
	public String getTimestamp(String param) {
		Long timestamp = System.currentTimeMillis();
		return timestamp.toString();
	}

	@Cacheable(value="HelloWorldCache", key="#key")
	@Override
	public String getDataFromDB(String key) {
		System.out.println("从数据库中获取数据...");
		return key + ":" + String.valueOf(Math.round(Math.random()*1000000));
	}

	@CacheEvict(value="HelloWorldCache", key="#key")
	@Override
	public void removeDataAtDB(String key) {
		System.out.println("从数据库中删除数据");
	}

	@CachePut(value="HelloWorldCache", key="#key")
	@Override
	public String refreshData(String key) {
		System.out.println("模拟从数据库中加载数据");
		return key + "::" + String.valueOf(Math.round(Math.random()*1000000));
	}
	
	// ------------------------------------------------------------------------
	@Cacheable(value="UserCache", key="'user:' + #userId")    
	public User findById(String userId) {  
		System.out.println("模拟从数据库中查询数据");
	    return (User) new User("1", "mengdee");           
	}  
	
	@Cacheable(value="UserCache", condition="#userId.length()<12")    
	public boolean isReserved(String userId) {    
	    System.out.println("UserCache:"+userId);    
	    return false;    
	}
	
	//清除掉UserCache中某个指定key的缓存    
	@CacheEvict(value="UserCache",key="'user:' + #userId")    
	public void removeUser(String userId) {    
	    System.out.println("UserCache remove:"+ userId);    
	}    

	//清除掉UserCache中全部的缓存    
	@CacheEvict(value="UserCache", allEntries=true)    
	public void removeAllUser() {    
	   System.out.println("UserCache delete all");    
	}
}

#注解基本使用方法

Spring对缓存的支持类似于对事务的支持。
首先使用注解标记方法,相当于定义了切点,然后使用Aop技术在这个方法的调用前、调用后获取方法的入参和返回值,进而实现了缓存的逻辑。

  • @Cacheable

    表明所修饰的方法是可以缓存的:当第一次调用这个方法时,它的结果会被缓存下来,在缓存的有效时间内,以后访问这个方法都直接返回缓存结果,不再执行方法中的代码段。
    这个注解可以用condition属性来设置条件,如果不满足条件,就不使用缓存能力,直接执行方法。
    可以使用key属性来指定key的生成规则。

@Cacheable 支持如下几个参数:

  • value:缓存位置名称,不能为空,如果使用EHCache,就是ehcache.xml中声明的cache的name, 指明将值缓存到哪个Cache中

  • key:缓存的key,默认为空,既表示使用方法的参数类型及参数值作为key,支持SpEL,如果要引用参数值使用井号加参数名,如:#userId,

    一般来说,我们的更新操作只需要刷新缓存中某一个值,所以定义缓存的key值的方式就很重要,最好是能够唯一,因为这样可以准确的清除掉特定的缓存,而不会影响到其它缓存值 ,
    本例子中使用实体加冒号再加ID组合成键的名称,如"user:1"、"order:223123"等

  • condition:触发条件,只有满足条件的情况才会加入缓存,默认为空,既表示全部都加入缓存,支持SpEL

// 将缓存保存到名称为UserCache中,键为"user:"字符串加上userId值,如 'user:1'
@Cacheable(value="UserCache", key="'user:' + #userId")    
public User findById(String userId) {    
    return (User) new User("1", "mengdee");           
}    

// 将缓存保存进UserCache中,并当参数userId的长度小于12时才保存进缓存,默认使用参数值及类型作为缓存的key
// 保存缓存需要指定key,value, value的数据类型,不指定key默认和参数名一样如:"1"
@Cacheable(value="UserCache", condition="#userId.length() < 12")    
public boolean isReserved(String userId) {    
    System.out.println("UserCache:"+userId);    
    return false;    
}
  • @CachePut

    与@Cacheable不同,@CachePut不仅会缓存方法的结果,还会执行方法的代码段。它支持的属性和用法都与@Cacheable一致。

  • @CacheEvict

    与@Cacheable功能相反,@CacheEvict表明所修饰的方法是用来删除失效或无用的缓存数据。

    @CacheEvict 支持如下几个参数:

    • value:缓存位置名称,不能为空,同上
    • key:缓存的key,默认为空,同上
    • condition:触发条件,只有满足条件的情况才会清除缓存,默认为空,支持SpEL
    • allEntries:true表示清除value中的全部缓存,默认为false
//清除掉UserCache中某个指定key的缓存    
@CacheEvict(value="UserCache",key="'user:' + #userId")    
public void removeUser(User user) {    
    System.out.println("UserCache"+user.getUserId());    
}    

//清除掉UserCache中全部的缓存    
@CacheEvict(value="UserCache", allEntries=true)    
public final void setReservedUsers(String[] reservedUsers) {    
   System.out.println("UserCache deleteall");    
}

5、测试

SpringTestCase

package com.mengdee.manager;

import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@ContextConfiguration(locations = {"classpath:conf/spring/spring-*.xml"})
@RunWith(SpringJUnit4ClassRunner.class)
public class SpringTestCase extends AbstractJUnit4SpringContextTests{

}
package com.mengdee.manager;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import com.mengdee.manager.service.EhcacheService;



public class EhcacheServiceTest extends SpringTestCase{

	@Autowired
	private EhcacheService ehcacheService;
	
	// 有效时间是5秒,第一次和第二次获取的值是一样的,因第三次是5秒之后所以会获取新的值
	@Test
	public void testTimestamp() throws InterruptedException{
		System.out.println("第一次调用:" + ehcacheService.getTimestamp("param"));
        Thread.sleep(2000);
        System.out.println("2秒之后调用:" + ehcacheService.getTimestamp("param"));
        Thread.sleep(4000);
        System.out.println("再过4秒之后调用:" + ehcacheService.getTimestamp("param"));
	}
	
	@Test
	public void testCache(){
		String key = "zhangsan";
		String value = ehcacheService.getDataFromDB(key); // 从数据库中获取数据...
		ehcacheService.getDataFromDB(key);  // 从缓存中获取数据,所以不执行该方法体
		ehcacheService.removeDataAtDB(key); // 从数据库中删除数据
		ehcacheService.getDataFromDB(key);  // 从数据库中获取数据...(缓存数据删除了,所以要重新获取,执行方法体)
	}
	
	@Test
	public void testPut(){
		String key = "mengdee";
		ehcacheService.refreshData(key);  // 模拟从数据库中加载数据
		String data = ehcacheService.getDataFromDB(key);
		System.out.println("data:" + data);	// data:mengdee::103385

		ehcacheService.refreshData(key);  // 模拟从数据库中加载数据
		String data2 = ehcacheService.getDataFromDB(key);
		System.out.println("data2:" + data2);	// data2:mengdee::180538	
	}
	
	
	@Test
	public void testFindById(){
		ehcacheService.findById("1"); // 模拟从数据库中查询数据
		ehcacheService.findById("1");
	}
	
	@Test
	public void testIsReserved(){
		ehcacheService.isReserved("123");
		ehcacheService.isReserved("123");
	}
	
	@Test
	public void testRemoveUser(){
		// 线添加到缓存
		ehcacheService.findById("1");
		
		// 再删除
		ehcacheService.removeUser("1");
		
		// 如果不存在会执行方法体
		ehcacheService.findById("1");
	}
	
	@Test
	public void testRemoveAllUser(){
		ehcacheService.findById("1");
		ehcacheService.findById("2");
		
		ehcacheService.removeAllUser();
		
		ehcacheService.findById("1");
		ehcacheService.findById("2");
		
//		模拟从数据库中查询数据
//		模拟从数据库中查询数据
//		UserCache delete all
//		模拟从数据库中查询数据
//		模拟从数据库中查询数据
	}
		
}


示例Demo代码下载:http://download.csdn.net/detail/vbirdbest/9852783

参考文章: http://www.cnblogs.com/jingmoxukong/p/5975994.html

分享一个朋友的人工智能教程(请以“右键”->"在新标签页中打开连接”的方式访问)。比较通俗易懂,风趣幽默,感兴趣的朋友可以去看看。

我的微信公众号

这里写图片描述

  • 68
    点赞
  • 298
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 18
    评论
单点登录, 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-shop -- 电子商务系统 ├── zheng-im -- 即时通讯系统 ├── zheng-oa -- 办公自动化系统 ├── zheng-eoms -- 运维系统 └── zheng-demo -- 示例模块(包含一些示例代码等) ├── zheng-demo-rpc-api -- rpc接口包 ├── zheng-demo-rpc-service -- rpc服务提供者 └── zheng-demo-web -- 演示示例[端口:8888] ``` ### 技术选型 #### 后端技术: 技术 | 名称 | 官网 ----|------|---- 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) PageHelper | MyBatis物理分页插件 | [http://git.oschina.net/free/Mybatis_PageHelper](http://git.oschina.net/free/Mybatis_PageHelper) 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/) TBSchedule & elastic-job | 分布式调度框架 | [https://github.com/dangdangdotcom/elastic-job](https://github.com/dangdangdotcom/elastic-job) Redis | 分布式缓存数据库 | [https://redis.io/](https://redis.io/) Solr & Elasticsearch | 分布式全文搜索引擎 | [http://lucene.apache.org/solr/](http://lucene.apache.org/solr/) [https://www.elastic.co/](https://www.elastic.co/) 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) 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) Jenkins | 持续集成工具 | [https://jenkins.io/index.html](https://jenkins.io/index.html) Maven | 项目构建管理 | [http://maven.apache.org/](http://maven.apache.org/) #### 前端技术: 技术 | 名称 | 官网 ----|------|---- 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/) material-design-iconic-font | 字体图标 | [https://github.com/zavoloklom/material-design-iconic-font](https://github.com/zavoloklom/material-design-iconic-font) 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) #### 架构图 ![架构图](project-bootstrap/architect.png) #### 模块依赖 ![模块依赖](project-bootstrap/project.png) #### 模块介绍 > 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](project-bootstrap/aliyun-oss-post-callback.png) > zheng-api 服务网关,对外暴露统一规范的接口和包装响应结果,包括各个子系统的交互接口、对外开放接口、开发加密接口、接口文档等服务,可在该模块支持验签、鉴权、路由、限流、监控、容错、日志等功能。示例图: ![API网关](project-bootstrap/gateway_config.png) > zheng-cms 内容管理系统:支持多标签、多类目、强大评论的内容管理,有基本单页展示,菜单管理,系统设置等功能。 > zheng-pay - 一站式支付解决方案,统一下单接口,支持支付宝、微信、网银等多种支付方式。不涉及业务的纯粹的支付平台。 - 统一下单(统一下单接口、统一扫码)、订单管理、数据分析、财务报表、商户管理、渠道管理、对账系统、系统监控。 ![统一扫码支付](project-bootstrap/zheng-pay.png) > zheng-ucenter 通用用户管理系统, 实现最常用的用户注册、登录、资料管理、个人中心、第三方登录等基本需求,支持扩展二次开发。 > zheng-wechat-mp 微信公众号管理平台,除实现官网后台自动回复、菜单管理、素材管理、用户管理、消息群发等基础功能外,还有二维码推广、营销活动、微网站、会员卡、优惠券等。 > zheng-wechat-app 微信小程序后台 ## 环境搭建(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群共享提供下载) ### 资源下载 - 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") - 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") - Nginx [http://nginx.org/en/download.html](http://nginx.org/en/download.html "Nginx") - 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") - 更多资源请加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) ![启动演示](project-bootstrap/start.png) - 访问 [http://upms.zhangshuzheng.cn:1111/](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](http://git.oschina.net/shuzheng/zheng/attach_files) > **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/](http://47.93.195.63/zheng-upms-server/sso/login?backurl=http://47.93.195.63/zheng-upms-server/manage/index "演示地址") ### 预览图 ![idea](project-bootstrap/idea.png) ![login](project-bootstrap/zheng-login.png) ![upms](project-bootstrap/zheng-upms.png) ![cms](project-bootstrap/zheng-cms.png) ![swagger](project-bootstrap/api.png) ### 数据模型 ![数据库模型](project-datamodel/zheng.png) ### 拓扑图 ![拓扑图](project-bootstrap/distributedSystem.png) ### 开发进度 ![开发进度](project-bootstrap/progress.png) ### 参与开发 首先谢谢大家支持,如果你希望参与开发,欢迎通过[Github](https://github.com/shuzheng/zheng "Github")上fork本项目,并Pull Request您的commit。 ### 常见问题 - Eclipse下,dubbo找不到dubbo.xsd报错,不影响使用,如果要解决,可参考 [http://blog.csdn.net/gjldwz/article/details/50555922](http://blog.csdn.net/gjldwz/article/details/50555922) - 报zheng-xxx.jar包找不到,请按照文档编译顺序,将源代码编译并安装到本地maven仓库 - zheng-cms-admin启动卡住:因为没有启动activemq - zheng-upms-server访问报session不存在:因为没有启动redis服务 - 界面没有样式:因为zheng-admin没有编译安装到本地仓库 ## 附件 ### 优秀文章和博客 - [创业互联网公司如何搭建自己的技术框架](http://shuzheng5201314.iteye.com/blog/2330151 "创业互联网公司如何搭建自己的技术框架") - [微服务实战](https://segmentfault.com/a/1190000004634172 "微服务实战") - [单点登录原理与简单实现](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)") - [网站架构经验随笔](http://jinnianshilongnian.iteye.com/blog/2289904 "网站架构经验随笔") - [支付系统架构](http://shuzheng5201314.iteye.com/blog/2355431 "支付系统架构") - [Spring整合JMS](http://elim.iteye.com/blog/1893038 "Spring整合JMS") - [跟我学Shiro目录贴](http://jinnianshilongnian.iteye.com/blog/2018398 "跟我学Shiro目录贴") - [跟我学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)开发目录贴") - [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并配置主从集群及高可用部署") - [Redis哨兵-实现Redis高可用](http://redis.majunwei.com/topics/sentinel.html "Redis哨兵-实现Redis高可用") - [ELK(ElasticSearch, Logstash, Kibana)搭建实时日志分析平台](http://www.open-open.com/lib/view/open1451801542042.html "ELK(ElasticSearch, Logstash, Kibana)搭建实时日志分析平台") - [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的数据绑定和常见问题.") - [如何细粒度地控制你的MyBatis二级缓存](http://blog.csdn.net/luanlouis/article/details/41800511 "如何细粒度地控制你的MyBatis二级缓存") - [做个男人,做个成熟的男人,做个有城府的男人](http://shuzheng5201314.iteye.com/blog/1387820 "做个男人,做个成熟的男人,做个有城府的男人") ### 在线小工具 - [在线Cron表达式生成器](http://cron.qqe2.com/ "在线Cron表达式生成器") - [在线工具 - 程序员的工具箱](http://tool.lu/ "在线工具 - 程序员的工具箱") ### 在线文档 - [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在线手册") - [Git官网中文文档](https://git-scm.com/book/zh/v2 "Git官网中文文档") - [Thymeleaf](http://www.thymeleaf.org/doc/tutorials/3.0/thymeleafspring.html "Thymeleaf") ## 许可证 [MIT](LICENSE "MIT")

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 18
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

风流 少年

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值