query(@RequestParam(required = false) Long menuId) {
+ //TODO 清理代码
if (menuId == null) {
Long currentMenuId = menuService.current(getVender());
return menuDishService.query(currentMenuId, getVender(), (long) LocalDate.now().getDayOfWeek().getValue());
diff --git a/diet-web/src/main/java/com/mathvision/diet/controller/MenuDisplayController.java b/diet-web/src/main/java/com/mathvision/diet/controller/MenuDisplayController.java
new file mode 100644
index 0000000..fda072a
--- /dev/null
+++ b/diet-web/src/main/java/com/mathvision/diet/controller/MenuDisplayController.java
@@ -0,0 +1,31 @@
+package com.mathvision.diet.controller;
+
+import com.mathvision.diet.service.MenuDishService;
+import com.mathvision.diet.service.MenuReleaseService;
+import org.springframework.stereotype.Controller;
+import org.springframework.util.Assert;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.annotation.Resource;
+import java.time.LocalDate;
+
+@RequestMapping("/api/menu/display")
+@Controller
+public class MenuDisplayController extends BaseController {
+ @Resource
+ MenuDishService menuDishService;
+ @Resource
+ MenuReleaseService menuReleaseService;
+ @ResponseBody
+ @RequestMapping(method = RequestMethod.GET)
+ public Object query(@RequestParam(required = false) Long menuId) {
+ Assert.isTrue(!isAdmin(), "[参数错误] 非管理端操作!");
+ if (menuId == null) {
+ return menuReleaseService.list(getVender());
+ }
+ return menuDishService.query(menuId, getVender(), (long) LocalDate.now().getDayOfWeek().getValue());
+ }
+}
\ No newline at end of file
diff --git a/diet-web/src/main/resources/static/index.html b/diet-web/src/main/resources/static/index.html
index 2feac94..879234d 100644
--- a/diet-web/src/main/resources/static/index.html
+++ b/diet-web/src/main/resources/static/index.html
@@ -20,6 +20,7 @@
ʳЭ
ʳЭ
ʳЭ
+ ʳ״Э
ͼƬЭ
diff --git a/diet-web/src/main/resources/static/menu/display.html b/diet-web/src/main/resources/static/menu/display.html
new file mode 100644
index 0000000..daaf8fd
--- /dev/null
+++ b/diet-web/src/main/resources/static/menu/display.html
@@ -0,0 +1,78 @@
+չʾ
+1. ѯʳб(ʾ)
+
+ GET /api/menu/display
+
+:
+{
+ "body": [
+ {"id": 1, "name": "ʳ"}
+ ],
+ "code": 200,
+ "desc": "ɹ",
+ "success": true
+}
+
+2. ѯմƷ(ʾ)
+
+ GET /api/menu/display?menuId=1
+
+:
+{
+ "body": [
+ {
+ "day": 1,
+ "dish": 1,
+ "id": 1,
+ "ingredient": [
+ {
+ "isMain": true,
+ "key": "011101",
+ "value": {
+ "": 500,
+ "": 300
+ }
+ },
+ {
+ "isMain": false,
+ "key": "2101001",
+ "value": {
+ "": 500,
+ "": 300
+ }
+ }
+ ],
+ "marks": "ʳ",
+ "poly": "",
+ "meal": "",
+ "menu": 1,
+ "name": "ѳ",
+ "vender": 1
+ },
+ {
+ "day": 1,
+ "dish": 2,
+ "id": 3,
+ "ingredient": [
+ {
+ "isMain": true,
+ "key": "011101",
+ "value": {
+ "": 500,
+ "": 300
+ }
+ }
+ ],
+ "marks": "ʳ",
+ "poly": "",
+ "meal": "",
+ "menu": 1,
+ "name": "ѳ",
+ "vender": 1
+ }
+ ],
+ "code": 200,
+ "desc": "ɹ",
+ "success": true
+}
+
diff --git a/doc/index.md b/doc/index.md
index 5c9855f..a0ea60b 100644
--- a/doc/index.md
+++ b/doc/index.md
@@ -20,6 +20,7 @@
* [食谱审批协议](menu/review.md)
* [食谱发布协议](menu/release.md)
* [食谱分析协议](menu/report.md)
+ * [食谱大屏协议](menu/display.md)
* [图片协议](icon.md)
### 响应示例
diff --git a/doc/menu/display.md b/doc/menu/display.md
new file mode 100644
index 0000000..44651ff
--- /dev/null
+++ b/doc/menu/display.md
@@ -0,0 +1,81 @@
+# 大屏展示
+
+# 1. 查询今日食谱列表(大屏显示)
+
+> GET /api/menu/display
+
+### 输出:
+~~~json
+{
+ "body": [
+ {"id": 1, "name": "食谱名字"}
+ ],
+ "code": 200,
+ "desc": "成功",
+ "success": true
+}
+~~~
+
+# 2. 查询今日带量菜品(大屏显示)
+
+> GET /api/menu/display?menuId=1
+
+### 输出:
+~~~json
+{
+ "body": [
+ {
+ "day": 1,
+ "dish": 1,
+ "id": 1,
+ "ingredient": [
+ {
+ "isMain": true,
+ "key": "011101",
+ "value": {
+ "轻体力": 500,
+ "重体力": 300
+ }
+ },
+ {
+ "isMain": false,
+ "key": "2101001",
+ "value": {
+ "轻体力": 500,
+ "重体力": 300
+ }
+ }
+ ],
+ "marks": "主食",
+ "poly": "蒸",
+ "meal": "早餐",
+ "menu": 1,
+ "name": "番茄炒蛋",
+ "vender": 1
+ },
+ {
+ "day": 1,
+ "dish": 2,
+ "id": 3,
+ "ingredient": [
+ {
+ "isMain": true,
+ "key": "011101",
+ "value": {
+ "轻体力": 500,
+ "重体力": 300
+ }
+ }
+ ],
+ "marks": "主食",
+ "poly": "蒸",
+ "meal": "早餐",
+ "menu": 1,
+ "name": "番茄炒鸡蛋",
+ "vender": 1
+ }
+ ],
+ "code": 200,
+ "desc": "成功",
+ "success": true
+}
\ No newline at end of file