您现在的位置是:首页 > 文章详情

easy_trans 1.0.1 更新,好用的 springboot 数据/字典翻译组件

日期:2021-03-13点击:928

1、1.0.1更新内容

  • 支持翻译结果绑定到pojo的字段中(v1.0.0是只支持将翻译结果put到transmap中)

2、Easy Trans简介

    easy trans是一个springboot的字典/外键 翻译组件,可以不用表关联查询 根据字典码 外键翻译  字典描述 和title/name 等信息,使用效果和方法如下图:

输入图片说明  

3、Easy Trans集成

EasyTrans支持 进程缓存翻译,redis缓存翻译,动态查表三种方式,集成步骤如下:

1 、先把maven 引用加上

       <dependency>
            <groupId>com.fhs-opensource</groupId>
            <artifactId>easy-trans-spring-boot-starter</artifactId>
            <version>1.0.1</version>
        </dependency>

2、如果使用Redis 换存翻译请添加redis的引用(如果之前加过了请不要重复添加)

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-redis</artifactId>
        </dependency>

3、在yaml中添加如下配置

easy-trans:
   autotrans:
       #您的service所在的包 支持通配符比如com.*.**.service.**,他的默认值是com.*.*.service.impl
       package: com.fhs.test.service.** 
	   #启用redis缓存
   is-enable-redis: true
  
spring:
  redis:
    host: 192.168.0.213
    port: 6379
    password: 123456
    database: 0
    timeout: 6000

4、如果不使用redis,请在启动类加禁用掉redis的自动配置类

@SpringBootApplication(exclude = { RedisAutoConfiguration.class })

4. 传送门

源码和使用教程 https://gitee.com/fhs-opensource/easy_trans

集成demo:https://gitee.com/fhs-opensource/easy_trans_springboot_demo

原文链接:https://www.oschina.net/news/133001/easy-trans-1-0--1released
关注公众号

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。

持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。

转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。

文章评论

共有0条评论来说两句吧...

文章二维码

扫描即可查看该文章

点击排行

推荐阅读

最新文章