配餐软件
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

193 lines
4.2 KiB

<h1>1. 查询食谱(根据ID获取基础信息)</h1>
<blockquote>
<p>GET /api/menu</p>
</blockquote>
<h3>输入:</h3>
<pre><code class="text">id=1
</code></pre>
<h3>输出:</h3>
<pre><code class="json">{
&quot;body&quot;: {
&quot;created&quot;: 1694014254000,
&quot;crows&quot;: [
&quot;轻体力&quot;,
&quot;重体力&quot;
],
&quot;day&quot;: [1,3,5],
&quot;id&quot;: 1,
&quot;meals&quot;: [
&quot;早餐&quot;,
&quot;午餐&quot;,
&quot;晚餐&quot;
],
&quot;modify&quot;: 1695404897000,
&quot;month&quot;: [
1,
2,
3,
4,
5,
6,
7,
8,
9
],
&quot;name&quot;: &quot;23年度43周食谱&quot;,
&quot;nutrient&quot;: 1,
&quot;operate&quot;: &quot;system&quot;,
&quot;scale&quot;: {
&quot;轻体力&quot;: 0,
&quot;重体力&quot;: 0
},
&quot;status&quot;: &quot;草稿&quot;,
&quot;vender&quot;: 1
},
&quot;code&quot;: 200,
&quot;desc&quot;: &quot;成功&quot;,
&quot;success&quot;: true
}
</code></pre>
<h1>2. 查询食谱列表</h1>
<blockquote>
<p>GET /api/menu</p>
</blockquote>
<h3>输入:</h3>
<pre><code class="text">pageSize=20 // 默认20, 全部非必填
pageNo=0 // 默认0, 从0开始
name=番茄鸡蛋汤 // 根据名称查
vender=1 // 根据单位查
status=1 // 根据状态查
startTime=2023-03-01 // 根据时间段查
endTime=2024-03-01
</code></pre>
<h3>输出:</h3>
<pre><code class="json">{
&quot;body&quot;: {
&quot;content&quot;: [
{
&quot;created&quot;: 1694014254000,
&quot;crows&quot;: [
&quot;轻体力&quot;,
&quot;重体力&quot;
],
&quot;day&quot;: [1,3,5],
&quot;id&quot;: 1,
&quot;meals&quot;: [
&quot;早餐&quot;,
&quot;午餐&quot;,
&quot;晚餐&quot;
],
&quot;modify&quot;: 1695404897000,
&quot;month&quot;: [
1,
2,
3,
4,
5,
6,
7,
8,
9
],
&quot;name&quot;: &quot;23年度43周食谱&quot;,
&quot;nutrient&quot;: 1,
&quot;operate&quot;: &quot;system&quot;,
&quot;scale&quot;: {
&quot;轻体力&quot;: 0,
&quot;重体力&quot;: 0
},
&quot;status&quot;: &quot;草稿&quot;,
&quot;vender&quot;: 1
}
],
&quot;number&quot;: 0,
&quot;size&quot;: 20,
&quot;totalElements&quot;: 1,
&quot;totalPages&quot;: 1
},
&quot;code&quot;: 200,
&quot;desc&quot;: &quot;成功&quot;,
&quot;success&quot;: true
}
</code></pre>
<h1>3. 创建新食谱</h1>
<blockquote>
<p>PUT /api/menu</p>
</blockquote>
<h3>输入:</h3>
<pre><code class="text">vendors=1,2,3 // 管理端有效,业务端不用
name=番茄鸡蛋汤 // 名称
nutrient=1 // 营养计划编号
day=1,3,5 // 代表周一,周三,周五
meals=早餐,午餐,晚餐 // 餐次
month=1,2,3,4,5,6,7,8,9,10,11,12 // 适用月份
crows=重体力,轻体力 //人群
</code></pre>
<h3>输出:</h3>
<pre><code class="json">{
&quot;body&quot;: [
1,
2,
3
],
&quot;code&quot;: 200,
&quot;desc&quot;: &quot;成功&quot;,
&quot;success&quot;: true
}
</code></pre>
<h1>4. 修改食谱</h1>
<blockquote>
<p>POST /api/menu</p>
</blockquote>
<h3>输入:</h3>
<pre><code class="text">id=1 // 食谱ID
name=番茄鸡蛋汤 // 名称
nutrient=1 // 营养计划编号
day=1,3,5 // 代表周一,周三,周五
meals=早餐,午餐,晚餐 // 餐次
month=1,2,3,4,5,6,7,8,9,10,11,12 // 适用月份
crows=重体力,轻体力 //人群
</code></pre>
<h3>输出:</h3>
<pre><code class="json">{
&quot;code&quot;: 200,
&quot;desc&quot;: &quot;成功&quot;,
&quot;success&quot;: true
}
</code></pre>
<h1>5. 删除食谱</h1>
<blockquote>
<p>DELETE /api/menu</p>
</blockquote>
<h3>输入:</h3>
<pre><code class="text">id=1 // 食谱ID
</code></pre>
<h3>输出:</h3>
<pre><code class="json">{
&quot;code&quot;: 200,
&quot;desc&quot;: &quot;成功&quot;,
&quot;success&quot;: true
}
</code></pre>
<h1>6. 复制食谱</h1>
<blockquote>
<p>PUT /api/menu/copy</p>
</blockquote>
<h3>输入:</h3>
<pre><code class="text">vendors=1,2,3 // 管理端有效,业务端不用
name=番茄鸡蛋汤 // 名称, 选填
id=1 // 源食谱编号, 必填
</code></pre>
<h3>输出:</h3>
<pre><code class="json">{
&quot;body&quot;: [
1,
2,
3
],
&quot;code&quot;: 200,
&quot;desc&quot;: &quot;成功&quot;,
&quot;success&quot;: true
}
</code></pre>