新增套餐、套餐分页查询、根据分类id查询菜品
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
package com.sky.controller.admin;
|
||||
|
||||
import com.sky.dto.SetmealDTO;
|
||||
import com.sky.dto.SetmealPageQueryDTO;
|
||||
import com.sky.result.PageResult;
|
||||
import com.sky.result.Result;
|
||||
import com.sky.service.SetmealService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/admin/setmeal")
|
||||
@Slf4j
|
||||
@Api(tags = "套餐相关接口")
|
||||
public class SetmealController {
|
||||
|
||||
@Autowired
|
||||
private SetmealService setmealService;
|
||||
|
||||
/**
|
||||
* 套餐分页查询
|
||||
* @param setmealPageQueryDTO
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("套餐分页查询")
|
||||
public Result<PageResult> pageQuery(SetmealPageQueryDTO setmealPageQueryDTO){
|
||||
log.info("套餐分页查询: {}",setmealPageQueryDTO);
|
||||
PageResult pageResult = setmealService.pageQuery(setmealPageQueryDTO);
|
||||
return Result.success(pageResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增套餐
|
||||
* @param setmealDTO
|
||||
* @return
|
||||
*/
|
||||
@PostMapping
|
||||
@ApiOperation("新增套餐")
|
||||
public Result insert(@RequestBody SetmealDTO setmealDTO){
|
||||
log.info("新增套餐: {}",setmealDTO);
|
||||
setmealService.insert(setmealDTO);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user