update docs

This commit is contained in:
开源海哥 2023-04-25 10:20:25 +08:00
parent 321314e860
commit 75a25163a4
18 changed files with 27 additions and 200 deletions

View File

@ -1,162 +0,0 @@
// node_modules/@vue/devtools-api/lib/esm/env.js
function getDevtoolsGlobalHook() {
return getTarget().__VUE_DEVTOOLS_GLOBAL_HOOK__;
}
function getTarget() {
return typeof navigator !== "undefined" && typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {};
}
var isProxyAvailable = typeof Proxy === "function";
// node_modules/@vue/devtools-api/lib/esm/const.js
var HOOK_SETUP = "devtools-plugin:setup";
var HOOK_PLUGIN_SETTINGS_SET = "plugin:settings:set";
// node_modules/@vue/devtools-api/lib/esm/time.js
var supported;
var perf;
function isPerformanceSupported() {
var _a;
if (supported !== void 0) {
return supported;
}
if (typeof window !== "undefined" && window.performance) {
supported = true;
perf = window.performance;
} else if (typeof global !== "undefined" && ((_a = global.perf_hooks) === null || _a === void 0 ? void 0 : _a.performance)) {
supported = true;
perf = global.perf_hooks.performance;
} else {
supported = false;
}
return supported;
}
function now() {
return isPerformanceSupported() ? perf.now() : Date.now();
}
// node_modules/@vue/devtools-api/lib/esm/proxy.js
var ApiProxy = class {
constructor(plugin, hook) {
this.target = null;
this.targetQueue = [];
this.onQueue = [];
this.plugin = plugin;
this.hook = hook;
const defaultSettings = {};
if (plugin.settings) {
for (const id in plugin.settings) {
const item = plugin.settings[id];
defaultSettings[id] = item.defaultValue;
}
}
const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`;
let currentSettings = Object.assign({}, defaultSettings);
try {
const raw = localStorage.getItem(localSettingsSaveId);
const data = JSON.parse(raw);
Object.assign(currentSettings, data);
} catch (e) {
}
this.fallbacks = {
getSettings() {
return currentSettings;
},
setSettings(value) {
try {
localStorage.setItem(localSettingsSaveId, JSON.stringify(value));
} catch (e) {
}
currentSettings = value;
},
now() {
return now();
}
};
if (hook) {
hook.on(HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {
if (pluginId === this.plugin.id) {
this.fallbacks.setSettings(value);
}
});
}
this.proxiedOn = new Proxy({}, {
get: (_target, prop) => {
if (this.target) {
return this.target.on[prop];
} else {
return (...args) => {
this.onQueue.push({
method: prop,
args
});
};
}
}
});
this.proxiedTarget = new Proxy({}, {
get: (_target, prop) => {
if (this.target) {
return this.target[prop];
} else if (prop === "on") {
return this.proxiedOn;
} else if (Object.keys(this.fallbacks).includes(prop)) {
return (...args) => {
this.targetQueue.push({
method: prop,
args,
resolve: () => {
}
});
return this.fallbacks[prop](...args);
};
} else {
return (...args) => {
return new Promise((resolve) => {
this.targetQueue.push({
method: prop,
args,
resolve
});
});
};
}
}
});
}
async setRealTarget(target) {
this.target = target;
for (const item of this.onQueue) {
this.target.on[item.method](...item.args);
}
for (const item of this.targetQueue) {
item.resolve(await this.target[item.method](...item.args));
}
}
};
// node_modules/@vue/devtools-api/lib/esm/index.js
function setupDevtoolsPlugin(pluginDescriptor, setupFn) {
const descriptor = pluginDescriptor;
const target = getTarget();
const hook = getDevtoolsGlobalHook();
const enableProxy = isProxyAvailable && descriptor.enableEarlyProxy;
if (hook && (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !enableProxy)) {
hook.emit(HOOK_SETUP, pluginDescriptor, setupFn);
} else {
const proxy = enableProxy ? new ApiProxy(descriptor, hook) : null;
const list = target.__VUE_DEVTOOLS_PLUGINS__ = target.__VUE_DEVTOOLS_PLUGINS__ || [];
list.push({
pluginDescriptor: descriptor,
setupFn,
proxy
});
if (proxy)
setupFn(proxy.proxiedTarget);
}
}
export {
isPerformanceSupported,
now,
setupDevtoolsPlugin
};
//# sourceMappingURL=@vue_devtools-api.js.map

File diff suppressed because one or more lines are too long

View File

@ -1,23 +1,17 @@
{
"hash": "14110bcc",
"browserHash": "8dc88e09",
"hash": "02c07141",
"browserHash": "e1f90fb9",
"optimized": {
"vue": {
"src": "../../../node_modules/vue/dist/vue.runtime.esm-bundler.js",
"file": "vue.js",
"fileHash": "a62e771b",
"needsInterop": false
},
"@vue/devtools-api": {
"src": "../../../node_modules/@vue/devtools-api/lib/esm/index.js",
"file": "@vue_devtools-api.js",
"fileHash": "d5c641bb",
"fileHash": "129bee0c",
"needsInterop": false
},
"@theme/index": {
"src": "../../../node_modules/vitepress/dist/client/theme-default/index.js",
"file": "@theme_index.js",
"fileHash": "0ec9b2ee",
"fileHash": "7f1d5583",
"needsInterop": false
}
},

View File

@ -1 +1,3 @@
{"type":"module"}
{
"type": "module"
}

View File

@ -13,7 +13,7 @@ export default defineConfig({
// logo: '/assets/images/logo01.png',
nav: [
{text: '首页', link: '/'},
{text: '帮助文档', link: '/zh/what-is-mybatisflex'},
{text: '帮助文档', link: '/zh/intro/what-is-mybatisflex'},
{text: '常见问题', link: '/zh/faq'},
{
text: '周边', items: [
@ -33,14 +33,14 @@ export default defineConfig({
{
text: '简介',
items: [
{text: 'Mybatis-Flex 是什么', link: '/zh/introduction/what-is-mybatisflex'},
{text: '快速开始', link: '/zh/introduction/getting-started'},
{text: 'Maven 依赖', link: '/zh/introduction/maven'},
{text: '和同类框架「功能」对比', link: '/zh/introduction/comparison'},
{text: '和同类框架「性能」对比', link: '/zh/introduction/benchmark'},
{text: '使用 Mybatis 原生功能', link: '/zh/introduction/use-mybatis-native'},
{text: '支持的数据库类型', link: '/zh/introduction/support-database'},
{text: 'QQ 交流群', link: '/zh/introduction/qq-group'},
{text: 'Mybatis-Flex 是什么', link: '/zh/intro/what-is-mybatisflex'},
{text: '快速开始', link: '/zh/intro/getting-started'},
{text: 'Maven 依赖', link: '/zh/intro/maven'},
{text: '和同类框架「功能」对比', link: '/zh/intro/comparison'},
{text: '和同类框架「性能」对比', link: '/zh/intro/benchmark'},
{text: '使用 Mybatis 原生功能', link: '/zh/intro/use-mybatis-native'},
{text: '支持的数据库类型', link: '/zh/intro/support-database'},
{text: 'QQ 交流群', link: '/zh/intro/qq-group'},
]
},
{

View File

@ -11,10 +11,10 @@ hero:
actions:
- theme: brand
text: 快速开始
link: /zh/getting-started
link: /zh/intro/getting-started
- theme: alt
text: 和同类框架对比
link: /zh/comparison
link: /zh/intro/comparison
features:
- title: 更轻量

View File

@ -5,6 +5,6 @@
"docs:preview": "vitepress preview"
},
"devDependencies": {
"vitepress": "^1.0.0-alpha.61"
"vitepress": "^1.0.0-alpha.74"
}
}

View File

@ -11,6 +11,7 @@ Mybatis-Flex 内置了一个名为 `BaseMapper` 的接口,它实现了基本
- **insert** 新增 1 条数据
- **insertSelective** 新增 1 条数据,忽略 null 值的字段
- **insertBatch** 新增多条数据
- **insertBatch(entities, int size)** 批量插入 entity 数据,按 size 切分
## 删除数据

View File

@ -3,7 +3,7 @@
强有力工具,也是 Mybatis-Flex 的亮点和特色。
::: tip 提示
>QueryWrapper 可以被序列化通过 RPC 进行传输因此在微服务项目中我们可以在客户端网关、Controller 层等)构造出 QueryWrapper传给
QueryWrapper 可以被序列化通过 RPC 进行传输因此在微服务项目中我们可以在客户端网关、Controller 层等)构造出 QueryWrapper传给
Provider 层进行查询返回数据。
:::

View File

@ -41,7 +41,7 @@ ext {
dependencies {
implementation("com.mybatis-flex:mybatis-flex-core:${mybatis_flex_version}")
// 启用APT
annotationProcessor("com.mybatis-flex:mybatis-flex-annotation:${mybatis_flex_version}")
annotationProcessor("com.mybatis-flex:mybatis-flex-annotation:${mybatis_flex_version}")
}
```
@ -65,7 +65,7 @@ public class Account {
- 使用 `@Table("tb_account")` 设置实体类与表名的映射关系
- 使用 `@Id(keyType = KeyType.Auto)` 标识主键为自增
Mapper
Mapper 接口继承 BaseMapper 接口:
```java
public interface AccountMapper extends BaseMapper<Account> {
@ -76,9 +76,8 @@ public interface AccountMapper extends BaseMapper<Account> {
Mybatis-Flex 使用了 APTAnnotation Processing Tool技术在项目编译的时会自动生成辅助操作类。
maven中 `mvn clean package`
gradle中 `gradlew classes`
- Maven 编译: `mvn clean package`
- Gradle 编译: `gradlew classes`
@ -86,7 +85,7 @@ gradle中 `gradlew classes`
**第 5 步:通过 main 方法开始使用(无 Spring 的场景)**
**第 5 步:通过 main 方法开始使用 Mybatis-Flex(无 Spring 的场景)**
```java
public class HelloWorld {

View File

@ -83,7 +83,7 @@ public interface BaseMapper<T> {
int insertBatch(@Param(FlexConsts.ENTITIES) List<T> entities);
/**
* 批量插入 entity 数据,按size切分
* 批量插入 entity 数据 size 切分
*
* @param entities 插入的数据列表
* @param size 切分大小