该美食社区是参照【下厨房】而制作的
主要功能是提供各种美食做法以及烹饪技巧,给美食爱好者们提供一个交流分享的平台。用户作为内容的创建者,可以通过平台学习内容,进行分享交流。
成员 | 工作内容 |
---|---|
林凯迪 | 1. 对后端部分所有接口进行编写,并进行数据库设计 2. 对前端部分的个人空间进行编写 3. 对前端部分的菜谱首页,搜索页进行编写 |
植秀月 | 1. 对前端部分的首页进行编写 2. 对前端部分的用户关注进行编写 |
王泽育 | 1. 对前端部分的菜谱创建进行编写 2. 对前端部分的登录注册进行编写 3. 对前端部分的标签页查询菜谱展示进行编写 |
何沣洛 | 1. 对前端部分的菜谱浏览进行编写 2. 对前端部分的菜谱评价进行编写 |
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const UserSchema = new Schema({
username: {
type: String,
require: true
},
password: {
type: String,
require: true
}
});
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const InfoSchema = new Schema({
username: {
type: String,
require: true
},
Avatar: {
type: String,
require: true
},
address: {
type: String,
require: true
},
join_time: {
type: String,
require: true
},
signature: {
type: String
}
});
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const AboutConcernSchema = new Schema({
username: {
type: String,
require: true
},
concern: [{
username: {
type: String,
require: true
},
Avatar: {
type: String,
require: true
}
}],
concerned: [{
username: {
type: String,
require: true
},
Avatar: {
type: String,
require: true
}
}]
})
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const MenuSchema = new Schema({
username: {
type: String,
require: true
},
menu_id: {
type: String,
require: true
},
title: {
type: String,
require: true
},
menu_pic: {
type: String,
require: true
},
// 简介
synopsis: {
type: String,
require: true
},
material: [{
mat_name: {
type: String,
require: true
},
mat_weight: {
type: String,
require: true
}
}],
practice: [{
step: {
type: Number,
require: true
},
step_info: {
type: String,
require: true
},
step_pic: {
type: String,
require: true
}
}],
// 分类
classification: [{
menu_label_id: {
type: Number,
require: true
},
classify_name: {
type: String,
require: true
}
}],
// 小贴士
Tips: {
type: String,
require: true
},
// 点赞数
like_num: {
type: Number,
require: true
}
})
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const MenuMapUser = new Schema({
menu_id: {
type: String,
require: true
},
username: {
type: String,
require: true
}
});
在这里,没有二级评论:
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const MenuMapComment = new Schema({
menu_id: {
type: String,
require: true
},
comments: [{
username: {
type: String,
require: true
},
Avatar: {
type: String,
require: true
},
comment_content: {
type: String,
require: true
}
}]
});
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const MenuLabel = new Schema({
menu_label_id: {
type: Number,
require: true
},
classify_name: {
type: String,
require: true
}
})
作品不进行评论
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const CookingWorks = new Schema({
cooking_works_id: {
type: String,
require: true
},
cooking_works_pic: {
type: String,
require: true
},
experience: {
type: String,
require: true
},
like_num: {
type: Number,
require: true
},
cooking_works_time: {
type: String,
require: true
}
});
const mongoose = require('mongoose');const Schema = mongoose.Schema;const CookingWorkMapUser = new Schema({ cooking_works_id: { type: String, require: true }, username: { type: String, require: true }});
const mongoose = require('mongoose');const Schema = mongoose.Schema;const ListingSchema = new Schema({ username: { type: String, require: true }, menu_id: { type: String, require: true }});
React框架
Redux状态管理工具
antd组件库
基于字节轻服务的express框架
采用轻服务的云数据库
前缀网址:https://bk201-drama.app.cloudendpoint.cn/api
**方式:**POST
路由:/login
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | none |
password | String | none |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | none |
password | String | none |
**方式:**POST
路由:/sign
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | none |
password | String | none |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | none |
password | String | none |
**方式:**POST
路由:/updatePwd
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
password | String | |
newPwd | String |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
password | String |
**方式:**GET
路由:/info
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
Avatar | String | 头像 |
address | String | 地址 |
join_time | String | 加入时间 |
concern_num | Number | 关注人数 |
concerned_num | Number | 粉丝人数 |
signature | String | 个性签名 |
**方式:**GET
路由:/info
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
Avatar | String | 头像 |
address | String | 地址 |
join_time | String | 加入时间 |
concern_num | Number | 关注人数 |
concerned_num | Number | 粉丝人数 |
signature | String | 个性签名 |
**方式:**GET
路由:/menu
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
menu_list | Array | 菜谱列表,这个返回参数之后,下面的参数全是菜谱列表内部元素对象的属性 |
menu_id | String | 菜谱id |
title | String | 菜谱标题 |
synopsis | String | 菜谱简介 |
menu_pic | String | 菜谱图片 |
like_num | Number | 点赞数 |
**方式:**GET
路由:/cooking-work
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
cooking_works_list | Array | 作品列表,这个返回参数之后,下面的参数全是作品列表内元素的属性 |
cooking_works_id | String | 作品id |
cooking_works_pic | String | 作品图片 |
experience | String | 作品内容简介 |
like_num | Number | 作品点赞数 |
cooking_works_time | String | 作品创建时间 |
**方式:**PATCH
路由:/menu
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
Avatar | String | 头像 |
address | String | 地址 |
join_time | String | 加入时间 |
concern_num | Number | 关注人数 |
concerned_num | Number | 粉丝人数 |
signature | String | 个性签名 |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
Avatar | String | 头像 |
address | String | 地址 |
join_time | String | 加入时间 |
concern_num | Number | 关注人数 |
concerned_num | Number | 粉丝人数 |
signature | String | 个性签名 |
**方式:**GET
路由:/concern
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
concern_list | Array | 关注列表,这个返回参数之后,下面的参数全是关注列表内元素的属性 |
username | String | 关注的用户的账户 |
Avatar | String | 关注的用户的头像 |
**方式:**GET
路由:/concerned
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
concerned_list | Array | 粉丝列表,这个返回参数之后,下面的参数全是粉丝列表内元素的属性 |
username | String | 关注的用户的账户 |
Avatar | String | 关注的用户的头像 |
**方式:**PATCH
路由:/addConcern
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | 关注者 |
username_concerned | String | 被关注者 |
Avatar | String | 关注者头像 |
Avatar_concerned | String | 被关注者头像 |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username_concerned | String | 是用户所关注的人的账户 |
concerned_num | Number | 粉丝人数 |
**方式:**PATCH
路由:/cancelConcern
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | 关注者 |
username_concerned | String | 被关注者 |
Avatar | String | 关注者头像 |
Avatar_concerned | String | 被关注者头像 |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username_concerned | String | 是用户所关注的人的账户 |
concerned_num | Number | 粉丝人数 |
**方式:**PATCH
路由:/isConcern
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | 关注者 |
username_concerned | String | 被关注者 |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
is_concern | Boolean | 用于判断自己是否关注对方 |
【只能收藏菜谱,不能收藏作品】
**方式:**POST
路由:/Listing
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
menu_id | String | 菜谱id |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
listing | Array | 菜谱数组列表,下面的参数都是收藏菜谱的对象属性 |
menu_id | String | 菜谱id |
title | String | 菜谱标题 |
synopsis | String | 菜谱简介 |
menu_pic | String | 菜谱图片 |
like_num | Number | 菜谱点赞数目 |
**方式:**POST
路由:/deleteListing
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
menu_id | String | 菜谱id |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
listing | Array | 菜谱数组列表,下面的参数都是收藏菜谱的对象属性 |
menu_id | String | 菜谱id |
title | String | 菜谱标题 |
synopsis | String | 菜谱简介 |
menu_pic | String | 菜谱图片 |
**方式:**GET
路由:/Listing
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
listing | Array | 菜谱数组列表,下面的参数都是收藏菜谱的对象属性 |
menu_id | String | 菜谱id |
title | String | 菜谱标题 |
synopsis | String | 菜谱简介 |
menu_pic | String | 菜谱图片 |
**方式:**GET
路由:/isList
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
menu_id | String | 菜谱id |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
isListed | Boolean | 判断菜谱是否已经被收藏 |
**方式:**POST
路由:/addMenu
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
title | String | 菜谱标题 |
menu_pic | String | 菜谱封面图片 |
synopsis | String | 菜谱简介 |
material | Array | 菜谱材料,为数组,下面的mat_name和mat_weight为其数组元素的属性 |
mat_name | String | 菜谱材料名称 |
mat_weight | String | 菜谱材料重量 |
practice | Array | 菜谱步骤,下面的step,step_info和step_pic为其数组元素的属性 |
step | Number | 菜谱步骤序号 |
step_info | String | 菜谱步骤简介 |
step_pic | String | 菜谱步骤对应图片 |
classification | Array | 菜谱分类,下面的menu_label_id和classify_name为其数组元素的属性 |
menu_label_id | String | 菜谱标签id |
classify_name | String | 菜谱标签名称 |
Tips | String | 菜谱小贴士 |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
menu_id | String | 菜谱id |
title | String | 菜谱标题 |
menu_pic | String | 菜谱封面图片 |
synopsis | String | 菜谱简介 |
material | Array | 菜谱材料,为数组,下面的mat_name和mat_weight为其数组元素的属性 |
mat_name | String | 菜谱材料名称 |
mat_weight | String | 菜谱材料重量 |
practice | Array | 菜谱步骤,下面的step,step_info和step_pic为其数组元素的属性 |
step | Number | 菜谱步骤序号 |
step_info | String | 菜谱步骤简介 |
step_pic | String | 菜谱步骤对应图片 |
classification | Array | 菜谱分类,下面的menu_label_id和classify_name为其数组元素的属性 |
menu_label_id | String | 菜谱标签id |
classify_name | String | 菜谱标签名称 |
Tips | String | 菜谱小贴士 |
like_num | String | 点赞数 |
**方式:**POST
路由:/deleteMenu
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
menu_id | String | 菜谱id |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
menu_id | String | 菜谱id |
title | String | 菜谱标题 |
menu_pic | String | 菜谱封面图片 |
synopsis | String | 菜谱简介 |
material | Array | 菜谱材料,为数组,下面的mat_name和mat_weight为其数组元素的属性 |
mat_name | String | 菜谱材料名称 |
mat_weight | String | 菜谱材料重量 |
practice | Array | 菜谱步骤,下面的step,step_info和step_pic为其数组元素的属性 |
step | Number | 菜谱步骤序号 |
step_info | String | 菜谱步骤简介 |
step_pic | String | 菜谱步骤对应图片 |
classification | Array | 菜谱分类,下面的menu_label_id和classify_name为其数组元素的属性 |
menu_label_id | String | 菜谱标签id |
classify_name | String | 菜谱标签名称 |
Tips | String | 菜谱小贴士 |
like_num | String | 点赞数 |
**方式:**POST
路由:/updateMenu
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
menu_id | String | 菜谱id |
title | String | 菜谱标题 |
menu_pic | String | 菜谱封面图片 |
synopsis | String | 菜谱简介 |
material | Array | 菜谱材料,为数组,下面的mat_name和mat_weight为其数组元素的属性 |
mat_name | String | 菜谱材料名称 |
mat_weight | String | 菜谱材料重量 |
practice | Array | 菜谱步骤,下面的step,step_info和step_pic为其数组元素的属性 |
step | Number | 菜谱步骤序号 |
step_info | String | 菜谱步骤简介 |
step_pic | String | 菜谱步骤对应图片 |
classification | Array | 菜谱分类,下面的menu_label_id和classify_name为其数组元素的属性 |
menu_label_id | String | 菜谱标签id |
classify_name | String | 菜谱标签名称 |
Tips | String | 菜谱小贴士 |
like_num | String | 点赞数 |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
menu_id | String | 菜谱id |
title | String | 菜谱标题 |
menu_pic | String | 菜谱封面图片 |
synopsis | String | 菜谱简介 |
material | Array | 菜谱材料,为数组,下面的mat_name和mat_weight为其数组元素的属性 |
mat_name | String | 菜谱材料名称 |
mat_weight | String | 菜谱材料重量 |
practice | Array | 菜谱步骤,下面的step,step_info和step_pic为其数组元素的属性 |
step | Number | 菜谱步骤序号 |
step_info | String | 菜谱步骤简介 |
step_pic | String | 菜谱步骤对应图片 |
classification | Array | 菜谱分类,下面的menu_label_id和classify_name为其数组元素的属性 |
menu_label_id | String | 菜谱标签id |
classify_name | String | 菜谱标签名称 |
Tips | String | 菜谱小贴士 |
like_num | String | 点赞数 |
**方式:**POST
路由:/like
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
menu_id | String | 菜谱id |
like_num | String | 点赞数 |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
menu_id | String | 菜谱id |
like_num | String | 点赞数 |
**方式:**GET
路由:/menu/:menu_id
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
menu_id | String | 菜谱id |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | 创建人账户 |
Avatar | String | 创建人头像 |
menu_id | String | 菜谱id |
title | String | 菜谱标题 |
menu_pic | String | 菜谱封面图片 |
synopsis | String | 菜谱简介 |
material | Array | 菜谱材料,为数组,下面的mat_name和mat_weight为其数组元素的属性 |
mat_name | String | 菜谱材料名称 |
mat_weight | String | 菜谱材料重量 |
practice | Array | 菜谱步骤,下面的step,step_info和step_pic为其数组元素的属性 |
step | Number | 菜谱步骤序号 |
step_info | String | 菜谱步骤简介 |
step_pic | String | 菜谱步骤对应图片 |
classification | Array | 菜谱分类,下面的menu_label_id和classify_name为其数组元素的属性 |
menu_label_id | String | 菜谱标签id |
classify_name | String | 菜谱标签名称 |
Tips | String | 菜谱小贴士 |
like_num | String | 点赞数 |
comments | Array | 评论,数组内部的元素包含下列属性:username,Avatar和comment_content |
username | String | 评论人账号 |
Avatar | String | 评论人头像 |
comment_content | String | 评论内容 |
**方式:**GET
路由:/avatar
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
menu_id | String | 菜谱id |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
Avatar | String |
**方式:**POST
路由:/searchMenu
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
input | String | 搜索字段 |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
menuList | Array | 菜谱列表,以下参数为菜谱列表元素的属性 |
menu_id | String | 菜谱id |
username | String | 菜谱创建人 |
like_num | String | 点赞数 |
synopsis | String | 简介 |
**方式:**POST
路由:/addCookingWork
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
cooking_works_pic | String | 作品图片 |
experience | String | 作品文本内容 |
like_num | Number | 作品点赞数 |
cooking_works_time | String | 作品创建时间 |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
cooking_works_id | String | 作品id |
cooking_works_pic | String | 作品图片 |
experience | String | 作品文本内容 |
like_num | Number | 作品点赞数 |
cooking_works_time | String | 作品创建时间 |
**方式:**POST
路由:/deleteCookingWork
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
cooking_works_id | String | 作品id |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
cooking_works_id | String | 作品id |
cooking_works_pic | String | 作品图片 |
experience | String | 作品文本内容 |
like_num | Number | 作品点赞数 |
cooking_works_time | String | 作品创建时间 |
方式:
路由:
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
cooking_works_pic | String | 作品图片 |
like_num | Number | 作品点赞数 |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
cooking_works_pic | String | 作品图片 |
like_num | Number | 作品点赞数 |
**方式:**POST
路由:/addComment
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
Avatar | String | 用户头像 |
menu_id | String | 用户所评价的菜谱 |
comment | String | 用户的评价 |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
Avatar | String | 用户头像 |
menu_id | String | 用户所评价的菜谱 |
comment | String | 用户的评价 |
**方式:**POST
路由:/deleteComment
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
Avatar | String | 用户头像 |
menu_id | String | 用户所评价的菜谱 |
comment | String | 用户的评价 |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
username | String | |
Avatar | String | 用户头像 |
menu_id | String | 用户所评价的菜谱 |
comment | String | 用户的评价 |
**方式:**GET
路由:/commentList
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
menu_id | String |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
menu_id | String | |
comments | Array | 评论数组,下面的属性皆为comments内部元素的属性 |
username | String | 评论的用户 |
Avatar | String | 评论用户的头像 |
comment_content | String | 评论用户的内容 |
**方式:**GET
路由:/menuList
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
none |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
menuList | Array | 菜谱列表,以下参数为菜谱列表元素的属性 |
menu_id | String | 菜谱id |
username | String | 菜谱创建人 |
like_num | String | 点赞数 |
synopsis | String | 简介 |
**方式:**GET
路由:/menuTagList
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
classify_name | String | 标签分类类型 |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
menuList | Array | 菜谱列表,以下参数为菜谱列表元素的属性 |
menu_id | String | 菜谱id |
username | String | 菜谱创建人 |
like_num | String | 点赞数 |
synopsis | String | 简介 |
**方式:**GET
路由:/tagList
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
none |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
tagList | Array | 标签列表,以下参数为列表元素属性 |
menu_label_id | String | 标签id |
classify_name | String | 分类名称 |
**方式:**POST 【图片只能使用POST】
路由:/upload
参数:
参数名 | 参数类型 | 备注 |
---|---|---|
file | png/jpeg | 图片 |
返回参数:
参数名 | 参数类型 | 备注 |
---|---|---|
url | String | 该图片的网络链接 |