公共字段自动填充
问题:代码冗余,不便于后期维护
自定义注解AutoFill,用于标识需要需要进行公共字段填充的方法


自定义切面AutoFillAspect,统一拦截加入了AutoFill注解的方法, 通过反射为公共字段赋值



在Mapper的方法上加入AutoFill注解


serviceImpl





技术点:枚举,注解,AOP,反射
新增菜品
文件上传

yml

dev-yml

OssConfiguration

CommonController


无法显示图片需要在阿里云上设置公共读
新增菜品
Dishcontroller

Dishservice

Dishcontroller

DishServiceImpl

DishMapper

DishMapper.xml

DishServiceImpl

DishFlavorMapper

DishServiceMapper


DishFlavorMapper

DishFlavorMapper.xml

DishServiceImpl

DishMapper

DishServiceImpl

功能测试



菜品分页查询
Discotroller

DishService

DishServiceImpl


删除菜品
代码实现
DishController

判断菜品是否能够删除
DishServiceImpl

DishMapper

DishServiceImpl

当前菜品是否被套餐关联
SetMealDishMapper

DishServiceImpl

SetMealDishMapper.xml

删除菜品表中菜品数据
DishServiceImpl

DishMapper

删除关联的口味数据
DishServiceMapper

DishMapper

修改菜品
代码开发
DishController

DishService

跟据id查询菜品数据
DishServiceImpl

根据菜品id查询口味
DishServiceImpl

DishFlavorMapper

将查询到的数据封装到VO

DishServiceImpl

修改
DishCotroller

DishService
修改菜品表基本信息
DishServiceImpl

DishMapper

DishMapper.xml

删除原有的口味数据
DishServiceImpl

重新插入口味数据
DishServiceImpl
