Giter Club home page Giter Club logo

trans4j's Introduction

文档地址

https://trans4j.gomyck.com

序言

Trans4J 的使命: 减少无用 SQL 编写, 减少无用数据结构设计, 减少循环调用, 新手10分钟快速入门

Trans4J 的设计理念: 实用, 简单, 只为解决指定场景问题, 拒绝过度设计, 拒绝设计模式

解决的问题

返回给前端的任意码值(用户ID, 商品ID, 性别, 支付状态...), 自动翻译成中文。无需额外联查字典表, 或单独写翻译逻辑

0  ->  男    
1  ->  女  

[0,1] -> 男,女

excel 导入, 把单元格的中文转成码值

男  -> 0

女  -> 1

使用前:

@GetMapping("/findOrderById")
public BizOrder findOrderById(String id) {
  BizOrder order = orderMapper.findOrderById(id);
  return order;
}

返回报文:

{
  ...
  "payState": "1",
  "goodsType": "E00F2FCC80C2D5C66B5786AF94718420",
  "userId": "53378A85-0BF5-42F6-9A83-CFD91D614252",
  ...
}

使用后:

@TransEnhance
@GetMapping("/findOrderById")
public BizOrder findOrderById(String id) {
  BizOrder order = orderMapper.findOrderById(id);
  return order;
}

返回报文:

{
  ...
  "payState": "1",
  "payState$V": "待支付",
  "goodsType": "E00F2FCC80C2D5C66B5786AF94718420",
  "goodsType$V": "数码",
  "userId": "53378A85-0BF5-42F6-9A83-CFD91D614252",
  "userId$V": "张三",
  ...
}

快速体验

Clone下面的仓库 本地运行即可快速体验 Trans4J:

https://gitee.com/mzxc_admin/trans4j-test

trans4j's People

Contributors

mzxc avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.