mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-06 16:48:24 +08:00
doc: update docs
This commit is contained in:
parent
ed91a8b3b9
commit
85826dfc09
@ -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 |
20
docs/zh/intro/parts/contributors.md
Normal file
20
docs/zh/intro/parts/contributors.md
Normal file
@ -0,0 +1,20 @@
|
||||
| | | | | |
|
||||
|-----|-----|-----|-----|-----|
|
||||
|<br />Michael Yang|<br />王帅|丌冰|<br />life|snyk-bot|
|
||||
|<br />卡莫sama|lhzsdnu|<br />西东|pengpeng|庄佳彬|
|
||||
|Font_C|笨小孩|CloudPlayer|snow|Jerry|
|
||||
|草语|Jerry_Zheng|wujl|<br />piggsoft|<br />赤兮丷|
|
||||
|<br />liibang|cainiao3853|loong0306|yangs|barql|
|
||||
|黄沐鸿|菜鸟3853|<br />Robot.L|<br />落羽er|<br />英雄路|
|
||||
|tan90|BQ60ziOxlFI0R0|淡定|qixy|font-C|
|
||||
|欢乐码农|yuanbaolong|zhijieqing|2han9wen71an|Shark|
|
||||
|大周|庄佳彬|hans|zhongyong|<br />锟斤拷|
|
||||
|XiaoLin|<br />bygkn|<br />Saoforest|<br />Ikko Eltociear Ashimine|dgmico|
|
||||
|<br />yang_zzu|<br />锁力|<br />阿志同学|chenjh3|<br />玩具猫|
|
||||
|chenjian835@163.com|<br />duxlei|meng.liu3|yaochen4|<br />zhy_black|
|
||||
|<br />豌豆粉|<br />ζั͡ ั͡ ั͡ ั͡Wm|18007559437|<br />陈国正|凌尘|
|
||||
|luy|gongzhongqiang|Alex|EafonYoung|乌鸦笑猪黑|
|
||||
|wnp|<br />MyronLi|<br />Pioneer-Sun|norkts|<br />Q_Alex|
|
||||
|aqnghu|<br />wlf|winnerself|<br />她出去赚钱了|XiaoLin|
|
||||
|张春根|疾浪|<br />xinjump|sppan|<br />时间淡忘一切|
|
||||
|
||||
@ -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、强大**
|
||||
>支持任意关系型数据库,还可以通过方言持续扩展,同时支持 **多(复合)主键**、**逻辑删除**、**乐观锁配置**、**数据脱敏**、**数据审计**、
|
||||
**数据填充** 等等功能。
|
||||
|
||||
## 贡献者
|
||||
|
||||
## 一些评价
|
||||
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||

|
||||
这个项目得以存在,要感谢以下所有做出贡献的人。他们有的是学生,有的 10+ 年开发经验的工程师,也有来至于 **阿里巴巴**、**腾讯**、**科大讯飞**、
|
||||
**网宿科技**、**新东方** 等企业的同学,感谢你们。
|
||||
|
||||
>以下贡献者,由程序定时从 [Gitee](https://gitee.com/mybatis-flex/mybatis-flex/contributors?ref=main) 获取:
|
||||
|
||||
<!--@include: ./parts/contributors.md-->
|
||||
|
||||
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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("<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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user