forked from Q-1515/reggie_parent
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
113 additions
and
2 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
reggie_server/src/main/java/com/reggie/controller/admin/SetmealController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.reggie.controller.admin; | ||
|
||
import com.reggie.dto.SetmealDTO; | ||
import com.reggie.result.R; | ||
import com.reggie.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.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
@RequestMapping("/admin/setmeal") | ||
@Slf4j | ||
@Api(tags = "套餐管理接口") | ||
public class SetmealController { | ||
@Autowired | ||
private SetmealService setmealService; | ||
|
||
/** | ||
* 新增套餐 | ||
* | ||
* @param setmealDTO 套餐数据 | ||
* @return success | ||
*/ | ||
@PostMapping | ||
@ApiOperation("新增套餐") | ||
public R<String> save(@RequestBody SetmealDTO setmealDTO) { | ||
log.info("新增套餐:{}", setmealDTO); | ||
setmealService.saveWithDish(setmealDTO); | ||
return R.success("套餐添加成功"); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
reggie_server/src/main/java/com/reggie/service/SetmealService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
package com.reggie.service; | ||
|
||
import com.reggie.dto.SetmealDTO; | ||
|
||
public interface SetmealService { | ||
|
||
//新增套餐 | ||
void saveWithDish(SetmealDTO setmealDTO); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters