外卖项目day03-修改菜品-代码开发--2

This commit is contained in:
xx
2026-11-21 14:38:31 +08:00
parent 239c47fdc2
commit 096ce51807
6 changed files with 102 additions and 1 deletions
@@ -58,7 +58,17 @@ public class DishController {
@ApiOperation("根据id查询菜品")
public Result<DishVO> getById(@PathVariable Long id){
log.info("根据id查询菜品:{}",id);
//todo
DishVO dishVO = dishService.getByIdWithFlavor(id);
return Result.success(dishVO);
}
@PutMapping
@ApiOperation("根据id修改菜品")
public Result update(@RequestBody DishDTO dto){
log.info("根据id修改菜品:{}",dto);
//调用业务层修改菜品
dishService.updateWithFlavors(dto);
return Result.success();
}
}