diff --git a/changes.md b/changes.md index 105f4959..b9c0a276 100644 --- a/changes.md +++ b/changes.md @@ -1,5 +1,6 @@ # MyBatis-Flex ChangeLog +查看 [全部代码贡献者](/zh/intro/what-is-mybatisflex.html#贡献者) ## v1.6.1 20230827: - 新增:添加 QueryWrapper.create(entity,SqlOperators) 支持通过 Entity 转换为 QueryWrapper diff --git a/docs/assets/images/comments/01.png b/docs/assets/images/comments/01.png deleted file mode 100644 index e7abda39..00000000 Binary files a/docs/assets/images/comments/01.png and /dev/null differ diff --git a/docs/assets/images/comments/02.png b/docs/assets/images/comments/02.png deleted file mode 100644 index 03f1dda1..00000000 Binary files a/docs/assets/images/comments/02.png and /dev/null differ diff --git a/docs/assets/images/comments/03.png b/docs/assets/images/comments/03.png deleted file mode 100644 index bed7ecb1..00000000 Binary files a/docs/assets/images/comments/03.png and /dev/null differ diff --git a/docs/assets/images/comments/04.png b/docs/assets/images/comments/04.png deleted file mode 100644 index b0695054..00000000 Binary files a/docs/assets/images/comments/04.png and /dev/null differ diff --git a/docs/assets/images/comments/05.png b/docs/assets/images/comments/05.png deleted file mode 100644 index fd7ff50a..00000000 Binary files a/docs/assets/images/comments/05.png and /dev/null differ diff --git a/docs/zh/intro/parts/contributors.md b/docs/zh/intro/parts/contributors.md new file mode 100644 index 00000000..a6718baf --- /dev/null +++ b/docs/zh/intro/parts/contributors.md @@ -0,0 +1,20 @@ +| | | | | | +|-----|-----|-----|-----|-----| +|![](https://foruda.gitee.com/avatar/1676898191051702081/61279_fuhai_1578915942.png!avatar60)
Michael Yang|![](https://foruda.gitee.com/avatar/1677105717059215385/7984572_suomm_1624454114.png!avatar60)
王帅|丌冰|![](https://foruda.gitee.com/avatar/1691044597656855579/7563907_lifejwang11_1691044597.png!avatar60)
life|snyk-bot| +|![](https://foruda.gitee.com/avatar/1691636027051962328/11233353_kamo-sama_1691636027.png!avatar60)
卡莫sama|lhzsdnu|![](https://foruda.gitee.com/avatar/1683858335519306352/15535_noear_admin_1683858335.png!avatar60)
西东|pengpeng|庄佳彬| +|Font_C|笨小孩|CloudPlayer|snow|Jerry| +|草语|Jerry_Zheng|wujl|![](https://foruda.gitee.com/avatar/1676895504036051867/8807_piggsoft_1578914592.jpg!avatar60)
piggsoft|![](https://foruda.gitee.com/avatar/1674286432514482953/4807650_fandai_fandaidzsw_1674286432.png!avatar60)
赤兮丷| +|![](https://foruda.gitee.com/avatar/1677053740056224121/5462387_i_tell_you_1618064317.png!avatar60)
liibang|cainiao3853|loong0306|yangs|barql| +|黄沐鸿|菜鸟3853|![](https://foruda.gitee.com/avatar/1677086127012961929/7598208_robot-l_1590219712.png!avatar60)
Robot.L|![](https://foruda.gitee.com/avatar/1677005791814507674/2130728_lemonbx_1622621180.png!avatar60)
落羽er|![](https://foruda.gitee.com/avatar/1691034002435340221/1920167_qimincow_1691034002.png!avatar60)
英雄路| +|tan90|BQ60ziOxlFI0R0|淡定|qixy|font-C| +|欢乐码农|yuanbaolong|zhijieqing|2han9wen71an|Shark| +|大周|庄佳彬|hans|zhongyong|![](https://foruda.gitee.com/avatar/1676978624694631546/1600987_youthdream_1592959590.png!avatar60)
锟斤拷| +|XiaoLin|![](https://foruda.gitee.com/avatar/1677237805724097193/11485875_bygkn_1660893367.png!avatar60)
bygkn|![](https://foruda.gitee.com/avatar/1674121508509280199/9288653_saoforestt_1674121508.png!avatar60)
Saoforest|![](https://foruda.gitee.com/avatar/1677162544015233775/9094323_lymph_java_1624796992.png!avatar60)
Ikko Eltociear Ashimine|dgmico| +|![](https://foruda.gitee.com/avatar/1677111694079591934/8088436_yang-zzu_1604969134.png!avatar60)
yang_zzu|![](https://foruda.gitee.com/avatar/1676895416224286260/8331_chaosforever_1578914555.png!avatar60)
锁力|![](https://foruda.gitee.com/avatar/1679885039814030308/5151444_yangbuyi_1679885039.png!avatar60)
阿志同学|chenjh3|![](https://foruda.gitee.com/avatar/1684129987239221781/1731138_toycat93_1684129987.png!avatar60)
玩具猫| +|chenjian835@163.com|![](https://foruda.gitee.com/avatar/1676896562075035262/20021_duxlei_1578915302.png!avatar60)
duxlei|meng.liu3|yaochen4|![](https://foruda.gitee.com/avatar/1676959401839738321/1269497_zhy_balck_1578947791.png!avatar60)
zhy_black| +|![](https://foruda.gitee.com/avatar/1676905453682965545/327218_gm173119755_1648555045.png!avatar60)
豌豆粉|![](https://foruda.gitee.com/avatar/1676974596171836113/1532463_1395961821_1578953848.png!avatar60)
ζั͡ ั͡ ั͡ ั͡Wm|18007559437|![](https://foruda.gitee.com/avatar/1676894749123859490/2132_hopper_1578914095.jpg!avatar60)
陈国正|凌尘| +|luy|gongzhongqiang|Alex|EafonYoung|乌鸦笑猪黑| +|wnp|![](https://foruda.gitee.com/avatar/1676901646505077446/106613_myron_1578917779.png!avatar60)
MyronLi|![](https://foruda.gitee.com/avatar/1677170868635098448/9319924_pioneer-sun_1624354686.png!avatar60)
Pioneer-Sun|norkts|![](https://foruda.gitee.com/avatar/1677166292370951564/9173563_q-alex_1627784508.png!avatar60)
Q_Alex| +|aqnghu|![](https://foruda.gitee.com/avatar/1677052070334379576/5421002_wlf213_1612139033.png!avatar60)
wlf|winnerself|![](https://foruda.gitee.com/avatar/1677182504887358627/9655223_animal553_1631088642.png!avatar60)
她出去赚钱了|XiaoLin| +|张春根|疾浪|![](https://foruda.gitee.com/avatar/1676983827162237415/1697554_xinjump_1654653784.png!avatar60)
xinjump|sppan|![](https://foruda.gitee.com/avatar/1662084101462823713/2079235_djxchi_1662084101.png!avatar60)
时间淡忘一切| + diff --git a/docs/zh/intro/what-is-mybatisflex.md b/docs/zh/intro/what-is-mybatisflex.md index ea52153e..d1b40e0b 100644 --- a/docs/zh/intro/what-is-mybatisflex.md +++ b/docs/zh/intro/what-is-mybatisflex.md @@ -8,37 +8,27 @@ QueryWrapper 帮助我们极大的减少了 S ## 特征 -**1、轻量**:除了 MyBatis,没有任何第三方依赖、没有任何拦截器,其原理是通过 SqlProvider 的方式实现的。同时,在执行的过程中,没有任何的 Sql 解析(Parse)。 -这带来了几个好处:1、极高的性能;2、极易对代码进行跟踪和调试; 3、把控性更高。 +**1、轻量** +>除了 MyBatis,没有任何第三方依赖、没有任何拦截器,其原理是通过 SqlProvider 的方式实现的。同时,在执行的过程中,没有任何的 Sql 解析(Parse)。 +这带来了几个好处:1、极高的性能;2、极易对代码进行跟踪和调试; 3、更高的把控性。 -**2、灵活**:支持 Entity 的增删改查、以及分页查询的同时,MyBatis-Flex 提供了 Db + Row 工具,可以无需实体类对数据库进行增删改查以及分页查询。 +**2、灵活** +>支持 Entity 的增删改查、以及分页查询的同时,MyBatis-Flex 提供了 Db + Row 工具,可以无需实体类对数据库进行增删改查以及分页查询。 与此同时,MyBatis-Flex 内置的 QueryWrapper 可以轻易的帮助我们实现 **多表查询**、**链接查询**、**子查询** 等等常见的 SQL 场景。 -**3、强大**:支持任意关系型数据库,还可以通过方言持续扩展,同时支持 **多(复合)主键**、**逻辑删除**、**乐观锁配置**、**数据脱敏**、**数据审计**、 +**3、强大** +>支持任意关系型数据库,还可以通过方言持续扩展,同时支持 **多(复合)主键**、**逻辑删除**、**乐观锁配置**、**数据脱敏**、**数据审计**、 **数据填充** 等等功能。 +## 贡献者 -## 一些评价 - - -![](../../assets/images/comments/01.png) - ---- - -![](../../assets/images/comments/02.png) - ---- - -![](../../assets/images/comments/03.png) - ---- - -![](../../assets/images/comments/04.png) - ---- - -![](../../assets/images/comments/05.png) +这个项目得以存在,要感谢以下所有做出贡献的人。他们有的是学生,有的 10+ 年开发经验的工程师,也有来至于 **阿里巴巴**、**腾讯**、**科大讯飞**、 +**网宿科技**、**新东方** 等企业的同学,感谢你们。 + +>以下贡献者,由程序定时从 [Gitee](https://gitee.com/mybatis-flex/mybatis-flex/contributors?ref=main) 获取: + + diff --git a/mybatis-flex-test/mybatis-flex-native-test/pom.xml b/mybatis-flex-test/mybatis-flex-native-test/pom.xml index 2f4f6f70..6af3b31d 100644 --- a/mybatis-flex-test/mybatis-flex-native-test/pom.xml +++ b/mybatis-flex-test/mybatis-flex-native-test/pom.xml @@ -114,6 +114,12 @@ 2.14.2 + + org.jsoup + jsoup + 1.16.1 + + org.assertj diff --git a/mybatis-flex-test/mybatis-flex-native-test/src/main/java/com/mybatisflex/test/ContributorsDocGen.java b/mybatis-flex-test/mybatis-flex-native-test/src/main/java/com/mybatisflex/test/ContributorsDocGen.java new file mode 100644 index 00000000..e21d1bca --- /dev/null +++ b/mybatis-flex-test/mybatis-flex-native-test/src/main/java/com/mybatisflex/test/ContributorsDocGen.java @@ -0,0 +1,173 @@ +package com.mybatisflex.test; + +import com.mybatisflex.core.audit.http.HttpUtil; +import com.mybatisflex.core.util.StringUtil; +import org.apache.ibatis.logging.LogFactory; +import org.jsoup.Jsoup; +import org.jsoup.nodes.Document; +import org.jsoup.nodes.Element; +import org.jsoup.select.Elements; + +import javax.net.ssl.*; +import java.io.*; +import java.net.HttpURLConnection; +import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ContributorsDocGen { + + public static void main(String[] args) throws Exception { + + //请先配置 cookie 后再运行 + String cookie = ""; + + List urls = Arrays.asList( + "https://gitee.com/mybatis-flex/mybatis-flex/contributors?ref=main" + , "https://gitee.com/mybatis-flex/mybatis-flex/contributors?page=2&ref=main" + ); + StringBuilder markdown = new StringBuilder(); + markdown.append("| | | | | |\n" + + "|-----|-----|-----|-----|-----|\n"); + + int startIndex = 0; + for (String url : urls) { + startIndex = getMdContent(markdown, url, cookie, startIndex); + } + if (startIndex != 0){ + markdown.append("|\n"); + } + + System.out.println(markdown); + + + String mdDir = System.getProperty("user.dir") + "/docs/zh/intro/parts/"; + writeString(new File(mdDir, "contributors.md"), markdown); + } + + public static void writeString(File file, StringBuilder markdown) throws IOException { + try (FileWriter fw = new FileWriter(file, false); + BufferedWriter bw = new BufferedWriter(fw)) { + bw.write(markdown.toString()); + bw.newLine(); + } + } + + + private static int getMdContent(StringBuilder markdown, String url, String cookie, int startIndex) { + Map headers = new HashMap<>(); + headers.put("Cookie", cookie); + String html = get(url, headers); + Document document = Jsoup.parse(html); + Elements userListItems = document.getElementsByClass("user-list-item"); + + for (Element userListItem : userListItems) { + Element img = userListItem.selectFirst("img"); + String src = img.attr("src"); + String userName = userListItem.selectFirst(".username").text(); + + markdown.append("|"); + if (StringUtil.isNotBlank(src)) { + markdown.append("![](" + src + ")
"); + } + markdown.append(userName); + + startIndex++; + + if (startIndex == 5) { + markdown.append("|\n"); + startIndex = 0; + } + } + + return startIndex; + } + + + public static String get(String url, Map headers) { + HttpURLConnection conn = null; + try { + conn = getHttpConnection(url, headers); + conn.connect(); + + return readString(conn); + } catch (IOException e) { + LogFactory.getLog(HttpUtil.class).error("post error.", e); + return null; + } catch (Exception e) { + throw new RuntimeException(e); + } finally { + if (conn != null) { + conn.disconnect(); + } + } + } + + private static String readString(HttpURLConnection conn) throws IOException { + try (InputStreamReader isr = new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8)) { + StringBuilder ret = new StringBuilder(); + char[] buf = new char[1024]; + for (int num; (num = isr.read(buf, 0, buf.length)) != -1; ) { + ret.append(buf, 0, num); + } + return ret.toString(); + } + } + + + private static HttpURLConnection getHttpConnection(String url, Map headers) throws IOException { + URL _url = new URL(url); + HttpURLConnection conn = (HttpURLConnection) _url.openConnection(); + if (conn instanceof HttpsURLConnection) { + ((HttpsURLConnection) conn).setSSLSocketFactory(createSSLSocketFactory()); + ((HttpsURLConnection) conn).setHostnameVerifier((s, sslSession) -> true); + } + + conn.setRequestMethod("GET"); + conn.setDoOutput(true); + conn.setDoInput(true); + + conn.setConnectTimeout(5000); + conn.setReadTimeout(5000); + + if (headers != null && !headers.isEmpty()) { + for (Map.Entry entry : headers.entrySet()) { + conn.setRequestProperty(entry.getKey(), entry.getValue()); + } + } + + return conn; + } + + private static class TrustAnyTrustManager implements X509TrustManager { + @Override + public X509Certificate[] getAcceptedIssuers() { + return null; + } + + @Override + public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { + } + + } + + private static SSLSocketFactory createSSLSocketFactory() { + try { + TrustManager[] tm = {new TrustAnyTrustManager()}; + SSLContext sslContext = SSLContext.getInstance("TLS"); // "TLS", "SunJSSE" + sslContext.init(null, tm, new java.security.SecureRandom()); + return sslContext.getSocketFactory(); + } catch (Exception e) { + throw new RuntimeException(e); + } + } +}