/**
* Translates a data type from an integer (java.sql.Types value) to a string
* that represents the corresponding class.
*
* REFER: https://www.cis.upenn.edu/~bcpierce/courses/629/jdkdocs/guide/jdbc/getstart/mapping.doc.html
*
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Translates a data type from an integer (java.sql.Types value) to a string | |
* that represents the corresponding class. | |
* | |
* REFER: https://www.cis.upenn.edu/~bcpierce/courses/629/jdkdocs/guide/jdbc/getstart/mapping.doc.html | |
* | |
* @param type | |
* The java.sql.Types value to convert to its corresponding class. | |
* @return The class that corresponds to the given java.sql.Types | |
* value, or Object.class if the type has no known mapping. |
你在 github 上发布了一个项目,如果网友有疑问,通常的做法是提一个 Issue,然后等我们有空时才能看见。 能不能弄一个 IM ,立马把Issue推送给作者呢?Gitter 就是这样的一个应用,使用步骤概述:
- 有Github项目
对 API 的认识,要提升到“划时代”的高度。
- API: 页面彻底分离。
- 文档: 文档被提升到新的高度,否则API没有使用价值。如何提高API开发者和使用者之间的沟通效率。
- 互联: OAuth2.0 不同所有权的站点开始互联。
- 分层: API Gateway 可以完成很多API共同的东西,让API的开发者只专注业务。比如授权呀,监控呀。
- 自动化: API 生成自动化。只要写数据库脚本,然后API就自动生成了,而且是运行时。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.vertx.core.Vertx; | |
import io.vertx.core.http.HttpMethod; | |
import io.vertx.core.http.HttpServer; | |
import io.vertx.core.json.JsonObject; | |
import io.vertx.ext.web.Router; | |
public class RestCrudHttpd { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.vertx.core.json.JsonObject; | |
import io.vertx.ext.web.RoutingContext; | |
public class DbapiAction implements Restlet { | |
@Override | |
public void index(RoutingContext routingContext) { | |
String dbname = routingContext.request().getParam("dbname"); | |
JsonObject json = new JsonObject().put("action", "index").put("dbname", dbname); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
/** | |
* Java字符串文本反序列化成Java对象: Object有toString()方法,String得有个toObject方法。 | |
* */ | |
public class TypeDecoder { | |
/** | |
* convert filed value of pojo from String format to Object format |
OlderNewer