doc: update docs

This commit is contained in:
开源海哥 2023-08-28 17:22:06 +08:00
parent ed91a8b3b9
commit 85826dfc09
10 changed files with 214 additions and 24 deletions

View File

@ -1,5 +1,6 @@
# MyBatis-Flex ChangeLog
查看 [全部代码贡献者](/zh/intro/what-is-mybatisflex.html#贡献者)
## v1.6.1 20230827:
- 新增:添加 QueryWrapper.create(entity,SqlOperators) 支持通过 Entity 转换为 QueryWrapper

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

View File

@ -0,0 +1,20 @@
| | | | | |
|-----|-----|-----|-----|-----|
|![](https://foruda.gitee.com/avatar/1676898191051702081/61279_fuhai_1578915942.png!avatar60)<br />Michael Yang|![](https://foruda.gitee.com/avatar/1677105717059215385/7984572_suomm_1624454114.png!avatar60)<br />王帅|丌冰|![](https://foruda.gitee.com/avatar/1691044597656855579/7563907_lifejwang11_1691044597.png!avatar60)<br />life|snyk-bot|
|![](https://foruda.gitee.com/avatar/1691636027051962328/11233353_kamo-sama_1691636027.png!avatar60)<br />卡莫sama|lhzsdnu|![](https://foruda.gitee.com/avatar/1683858335519306352/15535_noear_admin_1683858335.png!avatar60)<br />西东|pengpeng|庄佳彬|
|Font_C|笨小孩|CloudPlayer|snow|Jerry|
|草语|Jerry_Zheng|wujl|![](https://foruda.gitee.com/avatar/1676895504036051867/8807_piggsoft_1578914592.jpg!avatar60)<br />piggsoft|![](https://foruda.gitee.com/avatar/1674286432514482953/4807650_fandai_fandaidzsw_1674286432.png!avatar60)<br />赤兮丷|
|![](https://foruda.gitee.com/avatar/1677053740056224121/5462387_i_tell_you_1618064317.png!avatar60)<br />liibang|cainiao3853|loong0306|yangs|barql|
|黄沐鸿|菜鸟3853|![](https://foruda.gitee.com/avatar/1677086127012961929/7598208_robot-l_1590219712.png!avatar60)<br />Robot.L|![](https://foruda.gitee.com/avatar/1677005791814507674/2130728_lemonbx_1622621180.png!avatar60)<br />落羽er|![](https://foruda.gitee.com/avatar/1691034002435340221/1920167_qimincow_1691034002.png!avatar60)<br />英雄路|
|tan90|BQ60ziOxlFI0R0|淡定|qixy|font-C|
|欢乐码农|yuanbaolong|zhijieqing|2han9wen71an|Shark|
|大周|庄佳彬|hans|zhongyong|![](https://foruda.gitee.com/avatar/1676978624694631546/1600987_youthdream_1592959590.png!avatar60)<br />锟斤拷|
|XiaoLin|![](https://foruda.gitee.com/avatar/1677237805724097193/11485875_bygkn_1660893367.png!avatar60)<br />bygkn|![](https://foruda.gitee.com/avatar/1674121508509280199/9288653_saoforestt_1674121508.png!avatar60)<br />Saoforest|![](https://foruda.gitee.com/avatar/1677162544015233775/9094323_lymph_java_1624796992.png!avatar60)<br />Ikko Eltociear Ashimine|dgmico|
|![](https://foruda.gitee.com/avatar/1677111694079591934/8088436_yang-zzu_1604969134.png!avatar60)<br />yang_zzu|![](https://foruda.gitee.com/avatar/1676895416224286260/8331_chaosforever_1578914555.png!avatar60)<br />锁力|![](https://foruda.gitee.com/avatar/1679885039814030308/5151444_yangbuyi_1679885039.png!avatar60)<br />阿志同学|chenjh3|![](https://foruda.gitee.com/avatar/1684129987239221781/1731138_toycat93_1684129987.png!avatar60)<br />玩具猫|
|chenjian835@163.com|![](https://foruda.gitee.com/avatar/1676896562075035262/20021_duxlei_1578915302.png!avatar60)<br />duxlei|meng.liu3|yaochen4|![](https://foruda.gitee.com/avatar/1676959401839738321/1269497_zhy_balck_1578947791.png!avatar60)<br />zhy_black|
|![](https://foruda.gitee.com/avatar/1676905453682965545/327218_gm173119755_1648555045.png!avatar60)<br />豌豆粉|![](https://foruda.gitee.com/avatar/1676974596171836113/1532463_1395961821_1578953848.png!avatar60)<br />ζั͡ ั͡ ั͡ ั͡Wm|18007559437|![](https://foruda.gitee.com/avatar/1676894749123859490/2132_hopper_1578914095.jpg!avatar60)<br />陈国正|凌尘|
|luy|gongzhongqiang|Alex|EafonYoung|乌鸦笑猪黑|
|wnp|![](https://foruda.gitee.com/avatar/1676901646505077446/106613_myron_1578917779.png!avatar60)<br />MyronLi|![](https://foruda.gitee.com/avatar/1677170868635098448/9319924_pioneer-sun_1624354686.png!avatar60)<br />Pioneer-Sun|norkts|![](https://foruda.gitee.com/avatar/1677166292370951564/9173563_q-alex_1627784508.png!avatar60)<br />Q_Alex|
|aqnghu|![](https://foruda.gitee.com/avatar/1677052070334379576/5421002_wlf213_1612139033.png!avatar60)<br />wlf|winnerself|![](https://foruda.gitee.com/avatar/1677182504887358627/9655223_animal553_1631088642.png!avatar60)<br />她出去赚钱了|XiaoLin|
|张春根|疾浪|![](https://foruda.gitee.com/avatar/1676983827162237415/1697554_xinjump_1654653784.png!avatar60)<br />xinjump|sppan|![](https://foruda.gitee.com/avatar/1662084101462823713/2079235_djxchi_1662084101.png!avatar60)<br />时间淡忘一切|

View File

@ -8,37 +8,27 @@ QueryWrapper<Badge type="tip" text="^亮点" /> 帮助我们极大的减少了 S
## 特征
**1、轻量**:除了 MyBatis没有任何第三方依赖<Badge type="tip" text="轻依赖" />、没有任何拦截器,其原理是通过 SqlProvider 的方式实现的<Badge type="tip" text="轻实现" />。同时,在执行的过程中,没有任何的 Sql 解析Parse<Badge type="tip" text="轻运行" />
这带来了几个好处1、极高的性能2、极易对代码进行跟踪和调试 3、把控性更高。
**1、轻量**
>除了 MyBatis没有任何第三方依赖<Badge type="tip" text="轻依赖" />、没有任何拦截器,其原理是通过 SqlProvider 的方式实现的<Badge type="tip" text="轻实现" />。同时,在执行的过程中,没有任何的 Sql 解析Parse<Badge type="tip" text="轻运行" />
这带来了几个好处1、极高的性能2、极易对代码进行跟踪和调试 3、更高的把控性。
**2、灵活**:支持 Entity 的增删改查、以及分页查询的同时MyBatis-Flex 提供了 Db + Row<Badge type="tip" text="^灵活" /> 工具,可以无需实体类对数据库进行增删改查以及分页查询。
**2、灵活**
>支持 Entity 的增删改查、以及分页查询的同时MyBatis-Flex 提供了 Db + Row<Badge type="tip" text="^灵活" /> 工具,可以无需实体类对数据库进行增删改查以及分页查询。
与此同时MyBatis-Flex 内置的 QueryWrapper<Badge type="tip" text="^灵活" /> 可以轻易的帮助我们实现 **多表查询**、**链接查询**、**子查询** 等等常见的 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) 获取:
<!--@include: ./parts/contributors.md-->

View File

@ -114,6 +114,12 @@
<version>2.14.2</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.16.1</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>

View File

@ -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<String> 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<String, String> 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 + ")<br />");
}
markdown.append(userName);
startIndex++;
if (startIndex == 5) {
markdown.append("|\n");
startIndex = 0;
}
}
return startIndex;
}
public static String get(String url, Map<String, String> 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<String, String> 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<String, String> 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);
}
}
}