package com.bonus.canteen.core.menu.controller;

import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.canteen.core.menu.dto.AppletDishesDetailDTO;
import com.bonus.canteen.core.menu.service.MenuDishesService;
import com.bonus.canteen.core.menu.vo.AppletDishesDetailVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import static com.bonus.common.core.web.domain.AjaxResult.success;

@RestController
@RequestMapping({"/api/v1/applet/menudishes"})
@Api(
   value = "appletmenudishes",
   tags = {"pfy_小程序菜品"}
)
public class AppletDishesController {
   private static final Logger log = LoggerFactory.getLogger(AppletDishesController.class);
   @Lazy
   @Autowired
   private MenuDishesService menuDishesService;

   @PostMapping({"/detail"})
   @ApiOperation("根据菜品id获取菜品详情")
   public AjaxResult getRecipeDetail(@RequestBody AppletDishesDetailDTO dto) {
      AppletDishesDetailVO dishesDetailVO = this.menuDishesService.getDishesDetailByDishesId(dto);
      return success(dishesDetailVO);
   }
}
