官方文档:https://www.ssssssss.org/
基本用法新建分组:
由于已经建好了就不再创建
return db.table('user').insert(body);
{
"id": 101,
"username": "小九",
"password": "123",
"addr": "中国南京",
"status": "启用"
}
点击右上角运行查看结果:
return db.update('delete from user where id=#{id}');
改
return db.table('user').primary('id',body.id).update(body);
{
"id": 101,
"username": "小八",
"password": "951",
"addr": "中国上海",
"status": "启用"
}
查
return db.table('user')
.where()
.eq('id',path.id)
.selectOne();
分页查
return db.table('user').page();
浏览器调用
http://localhost:8080/api/user/one/4
http://localhost:8080/api/user/page?page=1&size=2
注:http://ip:端口/分组前缀/请求路径



