|
|
|
|
@ -6,6 +6,7 @@ import com.sky.dto.DishPageQueryDTO;
|
|
|
|
|
import com.sky.result.PageResult;
|
|
|
|
|
import com.sky.result.Result;
|
|
|
|
|
import com.sky.service.DishService;
|
|
|
|
|
import com.sky.vo.DishVO;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
@ -84,5 +85,30 @@ public class DishController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据id查询菜品和对应的口味数据
|
|
|
|
|
*
|
|
|
|
|
* @param id
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/{id}")
|
|
|
|
|
public Result<DishVO> getById(@PathVariable Long id){
|
|
|
|
|
log.info("根据id查询菜品信息:{}", id);
|
|
|
|
|
DishVO dishVO = dishService.getById(id);
|
|
|
|
|
return Result.success(dishVO);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 修改菜品
|
|
|
|
|
*
|
|
|
|
|
* @param dishDTO
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@PutMapping
|
|
|
|
|
public Result update(@RequestBody DishDTO dishDTO){
|
|
|
|
|
log.info("修改菜品:{}", dishDTO);
|
|
|
|
|
dishService.updateWithFlavor(dishDTO);
|
|
|
|
|
return Result.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|