目前学习的是黑马与动力节点
1.一个基础的项目
包含mvc三层+一个实体类(pojo)
实体类需要与数据库中表对应
全部基于注解开发
2.mapper(dao)层(@Mapper)
mybatis:需要的是一个接口+xml文件
mybatis-plus:一个接口继承BaseMapper<>即可,其自带有基础的curd,省去了配置xml这步。
3.service层(@Service)
mybatis:一个接口+实现类
mybatis-plus:
使用@Autowired自动填充引用对象(上一层的实现类)
接口:public interface IuserService extends IService
实现类:public class UserServiceImpl extends ServiceImpl
4.controller层(@Controller)
REST风格:不再使用有?的传参方式
通过不同的访问方式访问不同路径
形如:http://127.0.0.1:8080/users/1
@Controller或者@RestController
使用@RequestMapping(“url”)
可以使用GetMapper或者指定method



