Commit 038ba694 authored by 宋欢's avatar 宋欢

README.md

parent 513ceb50
No preview for this file type
......@@ -2,4 +2,50 @@
MyBatis 简单示例
http://127.0.0.1:8080/swagger-ui.html
接口文档 http://127.0.0.1:8080/swagger-ui.html
<pre>
数据库配置
DB-IP:127.0.0.1
DB-端口:3306
DB-库名:test
DB-username:root
DB-password:123456
</pre>
<pre>
修改数据库配置:demo-web/src/main/resources/data-source.xml
&lt;bean id="dataSource" parent="abstractDataSource" primary="false"&gt;
&lt;property name="url"
value="jdbc:mysql://127.0.0.1:3306/test?characterEncoding=utf-8&amp;useSSL=false&amp;serverTimezone=Asia/Shanghai&amp;allowMultiQueries=true"/&gt;
&lt;property name="username" value="root"/&gt;
&lt;property name="password" value="123456"/&gt;
&lt;/bean>
</pre>
<pre>
测试用的表
CREATE TABLE user
(
id bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户id',
phone varchar(32) DEFAULT NULL COMMENT '手机号',
username varchar(255) DEFAULT NULL COMMENT '姓名',
gender int(11) unsigned DEFAULT NULL COMMENT '性别,0-未知、1-男性、2-女性、3-疑似男性、4-疑似女性',
birthday date DEFAULT NULL COMMENT '出生日,年-月-日,如:2006-01-02',
email varchar(255) DEFAULT NULL COMMENT '邮箱',
is_active int(11) unsigned DEFAULT NULL COMMENT '有效?1-有效、0-无效',
remark varchar(255) DEFAULT NULL COMMENT '备注',
is_deleted bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '删除?id-是、0-否',
created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
updated_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
deleted_at datetime DEFAULT NULL COMMENT '删除时间',
PRIMARY KEY (id),
UNIQUE KEY uk_phone (phone, is_deleted),
KEY idx_username (username, is_deleted),
KEY idx_created_at (is_deleted, created_at)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT = '用户';
</pre>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment