CRUD流程:
1. 在pojo里写User表
1 | package com.learn.learn.pojo; |
2. 在pojo.dto里写UserDTO,表示从前端接收的字段名
1 | package com.learn.learn.pojo.dto; |
3. 在pojo里写ResponseMessage泛型类,表示要返回给前端的数据结构
1 | package com.learn.learn.pojo; |
4. 在controller里写UserController类用来控制实际的请求
1 | package com.learn.learn.controller; |
5. 在service里写UserService类用来操作数据
1 | package com.learn.learn.service; |
6. 在repository里写UserRepository类,用来真正对数据库进行操作
1 | package com.learn.learn.repository; |