外卖项目day03-修改菜品-代码开发--2
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user