### Install simple-ddl-parser
Source: https://doc.iocoder.cn/sql-update
Install the necessary Python library for DDL parsing.
```bash
pip install simple-ddl-parser
# pip3 install simple-ddl-parser
```
--------------------------------
### Dependency Upgrade Example
Source: https://doc.iocoder.cn/changelog/2.4.2
Example of a dependency upgrade from weixin-java version 4.6.0 to 4.7.2.B.
```markdown
【升级】weixin-java from 4.6.0 to 4.7.2.B
```
--------------------------------
### 引入 yudao-spring-boot-starter-job 依赖
Source: https://doc.iocoder.cn/async-task
在 `yudao-module-system-infra` 模块中,引入 `yudao-spring-boot-starter-job` 技术组件。
```xml
cn.iocoder.boot
yudao-spring-boot-starter-job
```
--------------------------------
### Backend receiving time parameters in Query
Source: https://doc.iocoder.cn/validator
Example of using @DateTimeFormat annotation to receive time parameters in GET or POST form-data requests.
```java
// JobLogPageReqVO.java
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime beginTime;
// UserPageReqVO.java
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
```
--------------------------------
### View Component Name Declaration for Page Caching
Source: https://doc.iocoder.cn/vue3/route
Example of declaring the 'name' property for a view component using `
```
--------------------------------
### Cache Configuration Example
Source: https://doc.iocoder.cn/vben5/util
Demonstrates how to use the StorageManager class for local storage management, including setting items with expiration, retrieving items, removing items, and clearing storage.
```javascript
import { StorageManager } from '@vben/utils';
// Create a storage manager instance
const storage = new StorageManager({
prefix: 'vben',
storageType: 'localStorage' // storage type: 'localStorage' | 'sessionStorage'
});
// Set storage item (optional expiration time, in milliseconds)
storage.setItem('user', { name: '芋道源码' }, 3600000); // Expires in 1 hour
// Get storage item
const user = storage.getItem('user');
// Get storage item (with default value)
const config = storage.getItem('config', { theme: 'light' });
// Remove storage item
storage.removeItem('user');
// Clear all prefixed storage items
storage.clear();
// Clear all expired storage items
storage.clearExpiredItems();
```
--------------------------------
### Install vue-count-to
Source: https://doc.iocoder.cn/vue2/components
Command to install the vue-count-to component and save it to package.json.
```bash
npm install vue-count-to --save
```
--------------------------------
### DesensitizedUtil Examples
Source: https://doc.iocoder.cn/desensitize
Examples of using DesensitizedUtil for various data types.
```java
DesensitizedUtil.desensitized("100", DesensitizedUtils.DesensitizedType.USER_ID)) = "0"
DesensitizedUtil.desensitized("段正淳", DesensitizedUtils.DesensitizedType.CHINESE_NAME)) = "段**"
DesensitizedUtil.desensitized("51343620000320711X", DesensitizedUtils.DesensitizedType.ID_CARD)) = "5***************1X"
DesensitizedUtil.desensitized("09157518479", DesensitizedUtils.DesensitizedType.FIXED_PHONE)) = "0915*****79"
DesensitizedUtil.desensitized("18049531999", DesensitizedUtils.DesensitizedType.MOBILE_PHONE)) = "180****1999"
DesensitizedUtil.desensitized("北京市海淀区马连洼街道289号", DesensitizedUtils.DesensitizedType.ADDRESS)) = "北京市海淀区马********"
DesensitizedUtil.desensitized("duandazhi-jack@gmail.com.cn", DesensitizedUtils.DesensitizedType.EMAIL)) = "d*************@gmail.com.cn"
DesensitizedUtil.desensitized("1234567890", DesensitizedUtils.DesensitizedType.PASSWORD)) = "**********"
DesensitizedUtil.desensitized("苏D40000", DesensitizedUtils.DesensitizedType.CAR_LICENSE)) = "苏D4***0"
DesensitizedUtil.desensitized("11011111222233333256", DesensitizedUtils.DesensitizedType.BANK_CARD)) = "1101 **** **** **** 3256"
```
--------------------------------
### Maven 编译命令
Source: https://doc.iocoder.cn/quick-start
使用 Maven 命令编译项目的示例。
```bash
mvn clean install package -Dmaven.test.skip=true
```
--------------------------------
### Vue3 + vben5(ant-design-vue、element-plus) 版本启动命令
Source: https://doc.iocoder.cn/quick-start-front
安装 pnpm,提升依赖的安装速度,安装依赖,并启动对应的前端模版。
```bash
# 安装 pnpm,提升依赖的安装速度
npm config set registry https://registry.npmmirror.com
npm install -g pnpm
# 安装依赖
pnpm install
# 如下命令,二选一即可,启动对应的前端模版:
# 启动服务(ant-design-vue)
npm run dev:antd
# 启动服务(element-plus)
npm run dev:ele
```
--------------------------------
### External Link Example
Source: https://doc.iocoder.cn/vue3/route
An example of how to configure an external link as a route.
```javascript
{
path: '/external-link',
component: Layout,
meta: {
name: 'ExternalLink'
},
children: [
{
path: 'https://www.iocoder.cn',
meta: { name: 'Link', title: '芋道源码' }
}
]
}
__
```
--------------------------------
### Error Response Example
Source: https://doc.iocoder.cn/validator
Example of an error response when parameter validation fails.
```json
{
"code": 400,
"data": null,
"msg": "请求参数不正确:密码不能为空"
}
```
--------------------------------
### 华为 OpenGauss Docker 启动脚本
Source: https://doc.iocoder.cn/xinchuang-db
This script starts a Docker container for Huawei OpenGauss 5.0.0, mapping port 5432 and setting environment variables for the username and password.
```bash
docker run -d \
--name opengauss-test \
--restart unless-stopped \
-e GS_USERNAME=root \
-e GS_PASSWORD=Yudao@2024 \
-e LD_LIBRARY_PATH=/usr/local/opengauss/lib:/usr/lib \
-p 5432:5432 \
opengauss/opengauss:5.0.0
```
--------------------------------
### DM 达梦数据库 Docker 启动脚本
Source: https://doc.iocoder.cn/xinchuang-db
This script starts a Docker container for DM 8.0, mapping port 5236 and mounting a volume for data persistence. It also sets several environment variables for database configuration.
```bash
docker load -i dm8_20240715_x86_rh6_rq_single.tar
docker run -d -p 5236:5236 \
--restart=unless-stopped \
--name dm8_test \
--privileged=true \
-e PAGE_SIZE=16 \
-e LD_LIBRARY_PATH=/opt/dmdbms/binn \
-e EXTENT_SIZE=32 \
-e BLANK_PAD_MODE=1 \
-e LOG_SIZE=1024 \
-e UNICODE_FLAG=1 \
-e LENGTH_IN_CHAR=1 \
-e INSTANCE_NAME=dm8_test \
-v $PWD/dm8_test:/opt/dmdbms/data \
dm8_single:dm8_20240715_rev232765_x86_rh6_64
```
--------------------------------
### KingbaseES 大金数据库 Docker 启动脚本
Source: https://doc.iocoder.cn/xinchuang-db
This script starts a Docker container for KingbaseES, mapping port 54321 and setting environment variables for the database user, password, and mode.
```bash
docker load -i kdb_x86_64_V009R001C001B0025.tar
docker run -d -p 54321:54321 \
--restart=unless-stopped \
--name kingbase_test \
--privileged=true \
-e NEED_START=yes \
-e DB_USER=root \
-e DB_PASSWORD=123456 \
-e DB_MODE=oracle \
kingbase_v009r001c001b0025_single_x86:v1
```
--------------------------------
### Custom baseURL Example
Source: https://doc.iocoder.cn/vue2/dev-spec
This example demonstrates how to override the default baseURL to a custom one for a specific request.
```javascript
export function listUser(query) {
return request({
url: '/system/user/page',
method: 'get',
params: query,
baseURL: 'https://www.iocoder.cn' // 自定义
})
}
```
--------------------------------
### Start mock Redis service
Source: https://doc.iocoder.cn/remove-redis
Add code to the YudaoServerApplication main method to start the mock Redis service.
```java
import com.github.fppt.jedismock.RedisServer;
public class YudaoServerApplication {
public static void main(String[] args) {
// 启动 Redis 服务
RedisServer redisServer = new RedisServer(6379);
try {
redisServer.start();
} catch (IOException e) {
throw new RuntimeException(e);
}
SpringApplication.run(YudaoServerApplication.class, args);
}
}
```
--------------------------------
### Vue3 + uni-app 版本启动命令
Source: https://doc.iocoder.cn/quick-start-front
安装 pnpm,提升依赖的安装速度,安装依赖,并启动 h5 平台或 wx 小程序平台。
```bash
# 安装 pnpm,提升依赖的安装速度
npm config set registry https://registry.npmmirror.com
npm install -g pnpm
# 安装依赖
pnpm install
# 启动 h5 平台
npm run dev
# (可选)启动 wx 小程序平台
npm run dev:mp-weixin
```
--------------------------------
### Normal Route Example
Source: https://doc.iocoder.cn/vue3/route
An example demonstrating the configuration of a multi-level nested route with various meta properties.
```javascript
{
path: '/level',
component: Layout,
redirect: '/level/menu1/menu1-1/menu1-1-1',
name: 'Level',
meta: {
title: t('router.level'),
icon: 'carbon:skill-level-advanced'
},
children: [
{
path: 'menu1',
name: 'Menu1',
component: getParentLayout(),
redirect: '/level/menu1/menu1-1/menu1-1-1',
meta: {
title: t('router.menu1')
},
children: [
{
path: 'menu1-1',
name: 'Menu11',
component: getParentLayout(),
redirect: '/level/menu1/menu1-1/menu1-1-1',
meta: {
title: t('router.menu11'),
alwaysShow: true
},
children: [
{
path: 'menu1-1-1',
name: 'Menu111',
component: () => import('@/views/Level/Menu111.vue'),
meta: {
title: t('router.menu111')
}
}
]
},
{
path: 'menu1-2',
name: 'Menu12',
component: () => import('@/views/Level/Menu12.vue'),
meta: {
title: t('router.menu12')
}
}
]
},
{
path: 'menu2',
name: 'Menu2Demo',
component: () => import('@/views/Level/Menu2.vue'),
meta: {
title: t('router.menu2')
}
}
]
}
__
```
--------------------------------
### 表单项 - 使用 getDictOptions 配合 wd-picker 实现字典选择
Source: https://doc.iocoder.cn/admin-uniapp/dict
使用 `getDictOptions` 配合 `wd-picker` 实现字典选择:
```vue
```
--------------------------------
### selectList Method Example
Source: https://doc.iocoder.cn/mybatis
Example of using the #selectList(...) method from BaseMapperX to query multiple records based on specified conditions.
```java
List userList = adminUserMapper.selectList(new LambdaQueryWrapper().like(AdminUserDO::getUsername, "yudao"));
```
--------------------------------
### Vue2 + element-ui 版本启动命令
Source: https://doc.iocoder.cn/quick-start-front
安装 Yarn,提升依赖的安装速度,安装依赖,并启动服务。
```bash
# 安装 Yarn,提升依赖的安装速度
npm install --global yarn
# 安装依赖
yarn install
# 启动服务
npm run local
```
--------------------------------
### Vue3 + element-plus 版本启动命令
Source: https://doc.iocoder.cn/quick-start-front
安装 pnpm,提升依赖的安装速度,安装依赖,并启动服务。
```bash
# 安装 pnpm,提升依赖的安装速度
npm config set registry https://registry.npmmirror.com
npm install -g pnpm
# 安装依赖
pnpm install
# 启动服务
npm run dev
```
--------------------------------
### selectCount Method Example
Source: https://doc.iocoder.cn/mybatis
Example of using the #selectCount(...) method from BaseMapperX to query the number of records matching specified conditions.
```java
long count = adminUserMapper.selectCount(new LambdaQueryWrapper().eq(AdminUserDO::getUsername, "yudao"));
```