| 类 | 说明 |
|---|---|
| BaseController |
Spring web base controller
|
| JdbcTemplateWrapper |
Wrapped spring jdbc template.
|
| MybatisDataSourceConfigurer.MybatisDataSourceRegistrar | |
| RedisKeyRenewal |
Renew redis key ttl based spring redis template.
|
| RedisTemplateFactory |
RedisTemplate factory based lettuce
|
| RedisTemplateUtils |
Redis template utils
redis.call:抛出异常给调用方
redis.pcall:捕获异常并以Lua表的形式返回给调用方
|
| ResourceScanner |
资源扫描文件,用法:
new ResourceScanner("/*.template").scan4text()
new ResourceScanner("/**∕tika*.xml").scan4text()
// findAllClassPathResources:“/*” 等同 “*”,“/”开头会被截取path.substring(1)
new ResourceScanner("*.xml").scan4bytes()
new ResourceScanner("/*.xml").scan4bytes()
new ResourceScanner("**∕*.xml").scan4bytes()
new ResourceScanner("/**∕*.xml").scan4bytes()
new ResourceScanner("log4j2.xml.template").scan4bytes()
new ResourceScanner("/log4j2.xml.template").scan4bytes()
new ResourceScanner("/cn/ponfee/commons/jce/*.class").scan4bytes()
new ResourceScanner("/cn/ponfee/commons/jce/**∕*.class").scan4bytes()
new ResourceScanner("/cn/ponfee/commons/base/**∕*.class").scan4class()
new ResourceScanner("/cn/ponfee/commons/**∕*.class").scan4class(null, new Class[] {Service.class})
new ResourceScanner("/cn/ponfee/commons/**∕*.class").scan4class(null, new Class[] {Component.class})
new ResourceScanner("/cn/ponfee/commons/**∕*.class").scan4class(new Class[]{Tuple.class}, null)
|
| RestTemplateUtils |
Spring rest template utility.
|
| RpcControllerConfigurer |
RpcController configurer
|
| RpcControllerUtils |
RpcController utility
|
| SpringContextHolder |
Spring container context holder
|
| SpringUtils |
Spring utils
|
| TransactionUtils |
Spring transaction utility.
|
| UtcInstantTypeHandler |
在国际化的项目中时间使用规范建议:created_at_utc
1)Java中使用`Instant`(也可以使用`OffsetDateTime`)
2)Database中使用`DATETIME(6)`
3)前后端交互使用UTC字符串`2000-01-01T00:00:00.000Z`,在前端JS代码中转换为本地时间展示`new Date("2000-01-01T00:00:00.000Z")`
4)Java把Instant转成LocalDateTime → 保存数据库:instant.atZone(ZoneOffset.UTC).toLocalDateTime();
5)读取数据库 → Java把LocalDateTime转成Instant:datetime.atZone(ZoneOffset.UTC).toInstant()
Java Instant与Mysql datetime之间的相互转换,在Mybatis的配置文件`mybatis-config.xml`中添加:
<typeHandlers>
<typeHandler handler="cn.ponfee.disjob.common.spring.UtcInstantTypeHandler" javaType="java.time.Instant" />
</typeHandlers>
|
| YamlProperties |
Yaml properties
|
| YamlPropertySourceFactory |
Spring yaml properties source factory,
for help use annotation
PropertySource
{@code |
| 注释类型 | 说明 |
|---|---|
| MybatisDataSourceConfigurer |
Configure mybatis dataSource
Bean顺序:
1)BeanDefinitionRegistryPostProcessor#postProcessBeanDefinitionRegistry:所有的常规bean定义都将被加载,但还没有任何bean被实例化,这允许在下一个后处理阶段开始之前添加更多的bean定义。
|
| RpcController |
RPC based spring mvc RestController
|
Copyright © 2025. All rights reserved.