配餐软件
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.

247 lines
6.3 KiB

2 years ago
<h1>��Ʒ����</h1>
<h1>1. ��ѯ��Ʒ(��������ģ����ѯ)</h1>
<blockquote>
<p>GET /api/dish</p>
</blockquote>
<h3>����:</h3>
<pre><code class="text">pageSize=20 // Ĭ��20, ȫ���DZ���
pageNo=0 // Ĭ��0, ��0��ʼ
keyword=���Ѽ����� // ��ѯ�ؼ���
mark=���� // ��ǩ ȡֵ����GET /api/basic/enum �ӿ��е� mark
2 years ago
poly=�� // �����ַ� ȡֵ����GET /api/basic/enum �ӿ��е� poly
2 years ago
</code></pre>
<h3>����:</h3>
<pre><code class="json">{
&quot;body&quot;: {
&quot;content&quot;: [
{
2 years ago
&quot;icon&quot;: &quot;112342343.jpg&quot;,
2 years ago
&quot;id&quot;: 2,
&quot;ingredient&quot;: [
{
&quot;isMain&quot;: true,
&quot;key&quot;: &quot;011101&quot;,
&quot;value&quot;: 500
}
],
&quot;marks&quot;: &quot;��ʳ&quot;,
2 years ago
&quot;poly&quot;: &quot;��&quot;,
2 years ago
&quot;modify&quot;: 1695277128000,
&quot;month&quot;: [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
1,
12
],
&quot;name&quot;: &quot;���ѳ�����&quot;,
&quot;vender&quot;: 4
}
],
&quot;number&quot;: 0,
&quot;size&quot;: 20,
&quot;totalElements&quot;: 2,
&quot;totalPages&quot;: 1
},
&quot;code&quot;: 200,
&quot;desc&quot;: &quot;�ɹ�&quot;,
&quot;success&quot;: true
}
</code></pre>
<h1>2. ��ѯ��Ʒ(����ID��ȷ��ѯ)</h1>
<blockquote>
<p>GET /api/dish</p>
</blockquote>
<h3>����:</h3>
<pre><code class="text">id=1
</code></pre>
<h3>����:</h3>
<pre><code class="json">{
&quot;icon&quot;: &quot;data:image/png;base64,iVBORkJggg==&quot;,
&quot;id&quot;: 1,
&quot;ingredient&quot;: [
{
&quot;isMain&quot;: true,
&quot;key&quot;: &quot;011101&quot;,
&quot;value&quot;: 500
}
],
&quot;marks&quot;: &quot;����&quot;,
2 years ago
&quot;poly&quot;: &quot;��&quot;,
2 years ago
&quot;month&quot;: [
1,
3,
5,
7,
9,
12
],
&quot;name&quot;: &quot;���Ѽ�����&quot;,
&quot;vender&quot;: 1
}
</code></pre>
<h1>3. ��������ģ����ѯ(����ʳ�ײ���ѡ����Ʒ)</h1>
<blockquote>
<p>GET /api/dish/select</p>
</blockquote>
<h3>����:</h3>
<pre><code class="text">keyword=��
</code></pre>
<h3>����:</h3>
<pre><code class="json">{
&quot;body&quot;: [
{
&quot;id&quot;: 25,
&quot;ingredient&quot;: [
{
&quot;key&quot;: &quot;3355&quot;,
&quot;value&quot;: 22
},
{
&quot;key&quot;: &quot;3378&quot;,
&quot;value&quot;: 111
}
],
&quot;marks&quot;: &quot;��ʳ&quot;,
2 years ago
&quot;poly&quot;: &quot;��&quot;,
2 years ago
&quot;name&quot;: &quot;���Ŷ���&quot;
},
{
&quot;id&quot;: 24,
&quot;ingredient&quot;: [
{
&quot;isMain&quot;: false,
&quot;key&quot;: &quot;3355&quot;,
&quot;value&quot;: 22
},
{
&quot;isMain&quot;: true,
&quot;key&quot;: &quot;3378&quot;,
&quot;value&quot;: 111
}
],
&quot;marks&quot;: &quot;��ʳ&quot;,
2 years ago
&quot;poly&quot;: &quot;��&quot;,
2 years ago
&quot;name&quot;: &quot;���Ŷ���&quot;
}
],
&quot;code&quot;: 200,
&quot;desc&quot;: &quot;�ɹ�&quot;,
&quot;success&quot;: true
}
</code></pre>
<h1>4. Ӫ����ǩ</h1>
<blockquote>
<p>GET /api/dish/label</p>
</blockquote>
<h3>����:</h3>
<pre><code class="text">ids=1,2,3 // ����ID����ָ����ǩ�������������в�Ʒ�ı�ǩ�б�
</code></pre>
<h3>����:</h3>
<pre><code class="json">{
&quot;body&quot;: [
{
&quot;component&quot;: [
{
&quot;name&quot;: &quot;��&quot;,
&quot;nutrition&quot;: &quot;60.00(mg)&quot;,
&quot;nvr&quot;: &quot;0.00%&quot;
},
{
&quot;name&quot;: &quot;vitamin-a&quot;,
&quot;nutrition&quot;: &quot;115.00(-)&quot;,
&quot;nvr&quot;: &quot;-&quot;
},
{
&quot;name&quot;: &quot;������&quot;,
&quot;nutrition&quot;: &quot;75.00(g)&quot;,
&quot;nvr&quot;: &quot;1.00%&quot;
},
{
&quot;name&quot;: &quot;֬��&quot;,
&quot;nutrition&quot;: &quot;50.00(g)&quot;,
&quot;nvr&quot;: &quot;1.00%&quot;
},
{
&quot;name&quot;: &quot;����kcal&quot;,
&quot;nutrition&quot;: &quot;50.00(kcal)&quot;,
&quot;nvr&quot;: &quot;0.00%&quot;
}
],
&quot;ingredients&quot;: [
&quot;��&quot;
],
&quot;name&quot;: &quot;���ѳ�����&quot;
}
],
&quot;code&quot;: 200,
&quot;desc&quot;: &quot;�ɹ�&quot;,
&quot;success&quot;: true
}
</code></pre>
<h1>5. ���Ӳ�Ʒ</h1>
<blockquote>
<p>PUT /api/dish</p>
</blockquote>
<h3>����:</h3>
<pre><code class="text">Content-Type:application/x-www-form-urlencoded
name=���ѳ����� // ���� ����
vendors=1,2,3 // ��λ�б�, �����˱��ҵ����û��
icon= // ͼƬ
month=1,2,3 //�·�
mark=���� // ���� ��ǩ ȡֵ����GET /api/basic/enum �ӿ��е� mark
2 years ago
poly=�� // ���� �����ַ� ȡֵ����GET /api/basic/enum �ӿ��е� poly
2 years ago
ingredient=[{&quot;key&quot;: &quot;011101&quot;, &quot;value&quot;: 500, &quot;isMain&quot;: true}] // ʳ���б�
</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>POST /api/dish</p>
</blockquote>
<h3>����:</h3>
<pre><code class="text">Content-Type:application/x-www-form-urlencoded
id=1 // ����
name=���ѳ����� // ���� ����
vendors=1,2,3 // ��λ�б�
icon= // ͼƬ
month=1,2,3 // �·�
mark=���� // ��ǩ ȡֵ����GET /api/basic/enum �ӿ��е� mark
2 years ago
poly=�� // ���� �����ַ� ȡֵ����GET /api/basic/enum �ӿ��е� poly
2 years ago
ingredient=[{&quot;key&quot;: &quot;011101&quot;, &quot;value&quot;: 500, &quot;isMain&quot;: true}] // ʳ���б�
</code></pre>
<h3>����:</h3>
<pre><code class="json">{
&quot;code&quot;: 200,
&quot;desc&quot;: &quot;�ɹ�&quot;,
&quot;success&quot;: true
}
</code></pre>
<h1>7. ɾ��</h1>
<blockquote>
<p>DELETE /api/dish</p>
</blockquote>
<h3>����:</h3>
<p>Content-Type:application/x-www-form-urlencoded
ids=9,10 // ����</p>
<p>����:</p>
<pre><code class="text">{
&quot;code&quot;: 200,
&quot;desc&quot;: &quot;�ɹ�&quot;,
&quot;success&quot;: true
}
</code></pre>