网上资料很多,主要找了 如何搭建springboot工程、springboot jdbc配置。
代码也是从网上抄的,只是练习。遇到一些小问题,都解决了。
drop table if exists student;
create table if not exists student
(
id bigint NOT NULL AUTO_INCREMENT,
name VARCHAR(100) NULL comment '姓名',
age int comment '年龄' ,
sex VARCHAR(20) NULL comment '性别:男,女' ,
address VARCHAR(100) NULL comment '地址' ,
isDelete tinyint comment '0:未删除,1:已删除' ,
PRIMARY KEY ( id )
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
curl -H "Content-Type:application/json" -X POST --data '{"name":"小明","sex":"男","age":20,"address":"江苏省"}' http://192.168.2.122:8081/springboot-demo/student/save
curl -H "Content-Type: application/json" -X POST http://192.168.2.122:8081/springboot-demo/student/query
curl -H "Content-Type: application/json" -X POST --data '{"id":1,"name":"","sex":"","age":22,"address":"海南省"}' http://192.168.2.122:8081/springboot-demo/student/update
curl -H "Content-Type:application/json" -X POST --data '{"id":1}' http://192.168.2.122:8081/springboot-demo/student/delete