From f4e64056030f31d129e2395529af3a0230537252 Mon Sep 17 00:00:00 2001 From: Jason Zhang <864068727@qq.com> Date: Mon, 25 Jan 2016 13:28:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E6=A1=A3=E7=BC=96=E5=86=99=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 156 ++++++++++++++++++++++++++++++++++++- dist/database/users.db | 30 +++---- src/bizs/commentBiz.coffee | 28 +++++++ src/bizs/uploadBiz.coffee | 2 +- src/routes/comment.coffee | 18 +++++ test/users.test.coffee | 24 +++++- 6 files changed, 239 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 8f2d911..c9e1c17 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ## The Server for UpHall (尚食堂) -> uphall is a simple app of dinner management ,and this repo is the server of the app, it can make cook(or worker for hall) to publish the infos of foods ,and people want to have a meal in hall can order the food that she/he want to eat refrain from the long queue. Read the restful api references for more details +> Uphall is a simple app of dinner management ,and this repo is the server of the app, it can make cook(or worker for hall) to publish the infos of foods ,and people want to have a meal in hall can order the food that she/he want to eat refrain from the long queue. Read the restful api references for more details @@ -23,7 +23,7 @@ $ gulp (for serve) ## RESTful API References (v1) -**访问处login/register两个api外的api均需要在headers中传入'x-token'以判断用户身份,不传一律拒绝操作,返回401 +> 访问除login/register两个api外的api均需要在headers中传入'x-token'以判断用户身份,不传一律拒绝操作,返回401 #### user(用户) @@ -387,8 +387,160 @@ $ gulp (for serve) #### 评价(comment) 1. 发表评价 + + description: 传入订单id 发表相应的评价,消费者评价可以上传图片,窗口管理员评价不需要传入图片,图片上传有两种方式,暂时不支持客户端自行上传到云数据库而只传递url到服务器,目前是调用上传部分的api进行图片上传到本服务器的操作,这点请注意一下 + + url: /api/comments/:id + + method: POST + + params: + + * id [required,query] 订单id + * rating: [required,number(0.0~5.0)] 评分 + * content: [optional,string] 评价内容,可以不传使用默认评价 + + return: + + * 404/400 + * 200 {id:评价的id} + +2. 获取窗口的评价 + + description: 获取指定窗口的评价,包括消费者和窗口管理员的评价 + + url: /api/comments/window/:id + + method: GET + + params: + + * id: [required,query] 窗口id + + return: + + * 404 + * 200 [{commentObj},{commentObj},...] + +3. 获取单个订单的评价 + + descripiton: 获取单个订单的双方评价 + + url: /api/comments/order/:id + + method: GET + + params: + + * id: [required,query] 订单id + + return: + + * 404 + * 200 [{commentObj},{commentObj},…] +#### 图片上传(upload) + +1. 窗口的icon上传 + + description: 窗口的icon的上传,身份认证必须是该窗口的拥有者 + + headers: + + * Content-Type: multipart-form-data 除上传api外都默认是application/x-www-form-urlencoded + * x-token: 默认必传 + + url: /api/upload/window/:id + + method: POST + + params: + + * id: [required,query] 窗口的id + * file: [required,file] 可以传入一张image,大小不超过200K,不限制属性名 + + return: + * 400/401 + * 200 body.text = 'success' + +2. 评论的图片上传 + + description: 某订单评论的图片上传,必须是该订单的消费者 + + headers: + + * Content-Type: multipart-form-data 除上传api外都默认是application/x-www-form-urlencoded + * x-token: 默认必传 + + url: /api/upload/comment/:id + + method: POST + + params: + + * id: [required,query] 订单的id + * files: [required,file] 可以传入多张图片,注意属性名不能相同,可用file1,file2... 代替,不限制属性名,可自由发挥 + + return + + * 400/401 + * 200 body.text = 'success' + +3. 用户头像上传 + + description: 用户头像的上传 + + headers: + + - Content-Type: multipart-form-data 除上传api外都默认是application/x-www-form-urlencoded + - x-token: 默认必传 + + url: /api/upload/avatar + + method: POST + + params: + + - file: [required,file] 文件名称无所谓,只需要传递一张图片即可,大小不超过200K + + return: + + - 400 + - 200 body.text = 'success' + +4. 食物的展示图片上传 + + description: 食物的展示图片的上传,图片最大尺寸为1M,规定自由该食物的拥有者能够上传食物的图片 + + headers: + + - Content-Type: multipart-form-data 除上传api外都默认是application/x-www-form-urlencoded + - x-token: 默认必传 + + url: /api/upload/food/:id + + method: POST + + params: + + - id: [required,query] 食物的id + - file: [required,file] 可以传入一张image,大小不超过200K,不限制属性名 + + return: + + - 400/401 + - 200 body.text = 'success' + + + + + + + +### NOTES + + *api(v1)如上,其余功能v2中陆续增加,推送以及IM拟采用[leancloud](https://leancloud.cn/docs/index.html),文档可以提前阅读* diff --git a/dist/database/users.db b/dist/database/users.db index 8c42a02..61a4245 100644 --- a/dist/database/users.db +++ b/dist/database/users.db @@ -1,15 +1,15 @@ -{"name":"匿名","username":"customer","password":"91ec1f9324753048c0096d036a694f86","token":"","expiredTime":1453655189780,"is_admin":false,"is_windower":false,"avatar_uri":"","score":0,"_id":"puiyhrrGmZN2V1Fr"} -{"name":"匿名","username":"windower","password":"d376867b1d99e6e188d5b658a4a51153","token":"","expiredTime":1453655189791,"is_admin":false,"is_windower":true,"avatar_uri":"","score":0,"_id":"3g060xAcf4i3o6bh"} -{"name":"匿名","username":"admin","password":"21232f297a57a5a743894a0e4a801fc3","token":"","expiredTime":1453655189799,"is_admin":true,"is_windower":false,"avatar_uri":"","score":0,"_id":"BUoAmFnrG3iOGoOr"} -{"name":"匿名","username":"admin","password":"21232f297a57a5a743894a0e4a801fc3","token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6IkJVb0FtRm5yRzNpT0dvT3IiLCJpYXQiOjE0NTM2NTUxODl9.ZSV1gnF1Y1xqa_zwIFpttig7OaqT4qJ2HETbbFgusMc","expiredTime":1454259989825,"is_admin":true,"is_windower":false,"avatar_uri":"","score":0,"_id":"BUoAmFnrG3iOGoOr"} -{"name":"匿名","username":"customer","password":"91ec1f9324753048c0096d036a694f86","token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6InB1aXlocnJHbVpOMlYxRnIiLCJpYXQiOjE0NTM2NTUxODl9.Bu2aK4RA71-9LWXmlDYKBvFrpW_BlvFrYiyMvf4OJUY","expiredTime":1454259989837,"is_admin":false,"is_windower":false,"avatar_uri":"","score":0,"_id":"puiyhrrGmZN2V1Fr"} -{"name":"匿名","username":"windower","password":"d376867b1d99e6e188d5b658a4a51153","token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6IjNnMDYweEFjZjRpM282YmgiLCJpYXQiOjE0NTM2NTUxODl9.f2C3Rx1YbvrPrRtO5AcgWKd0WccpsHzsN_Zr0eX5NLA","expiredTime":1454259989846,"is_admin":false,"is_windower":true,"avatar_uri":"","score":0,"_id":"3g060xAcf4i3o6bh"} -{"name":"张三","username":"customer","password":"91ec1f9324753048c0096d036a694f86","token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6InB1aXlocnJHbVpOMlYxRnIiLCJpYXQiOjE0NTM2NTUxODl9.Bu2aK4RA71-9LWXmlDYKBvFrpW_BlvFrYiyMvf4OJUY","expiredTime":1454259989837,"is_admin":false,"is_windower":false,"avatar_uri":"","score":0,"_id":"puiyhrrGmZN2V1Fr"} -{"name":"张三","username":"customer","password":"f5bb0c8de146c67b44babbf4e6584cc0","token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6InB1aXlocnJHbVpOMlYxRnIiLCJpYXQiOjE0NTM2NTUxODl9.Bu2aK4RA71-9LWXmlDYKBvFrpW_BlvFrYiyMvf4OJUY","expiredTime":1454259989837,"is_admin":false,"is_windower":false,"avatar_uri":"","score":0,"_id":"puiyhrrGmZN2V1Fr"} -{"name":"匿名","username":"admin","password":"21232f297a57a5a743894a0e4a801fc3","token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6IkJVb0FtRm5yRzNpT0dvT3IiLCJpYXQiOjE0NTM2NTUxODl9.ZSV1gnF1Y1xqa_zwIFpttig7OaqT4qJ2HETbbFgusMc","expiredTime":1454259989825,"is_admin":false,"is_windower":false,"avatar_uri":"","score":0,"_id":"BUoAmFnrG3iOGoOr"} -{"name":"匿名","username":"admin","password":"21232f297a57a5a743894a0e4a801fc3","token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6IkJVb0FtRm5yRzNpT0dvT3IiLCJpYXQiOjE0NTM2NTUxODl9.ZSV1gnF1Y1xqa_zwIFpttig7OaqT4qJ2HETbbFgusMc","expiredTime":1454259989825,"is_admin":true,"is_windower":false,"avatar_uri":"","score":0,"_id":"BUoAmFnrG3iOGoOr"} -{"name":"匿名","username":"windower","password":"d376867b1d99e6e188d5b658a4a51153","token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6IjNnMDYweEFjZjRpM282YmgiLCJpYXQiOjE0NTM2NTUxODl9.f2C3Rx1YbvrPrRtO5AcgWKd0WccpsHzsN_Zr0eX5NLA","expiredTime":1454259989846,"is_admin":false,"is_windower":true,"avatar_uri":"","score":0,"_id":"3g060xAcf4i3o6bh"} -{"name":"匿名","username":"windower","password":"d376867b1d99e6e188d5b658a4a51153","token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6IjNnMDYweEFjZjRpM282YmgiLCJpYXQiOjE0NTM2NTUxODl9.f2C3Rx1YbvrPrRtO5AcgWKd0WccpsHzsN_Zr0eX5NLA","expiredTime":1454259989846,"is_admin":false,"is_windower":false,"avatar_uri":"","score":0,"_id":"3g060xAcf4i3o6bh"} -{"name":"匿名","username":"windower","password":"d376867b1d99e6e188d5b658a4a51153","token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6IjNnMDYweEFjZjRpM282YmgiLCJpYXQiOjE0NTM2NTUxODl9.f2C3Rx1YbvrPrRtO5AcgWKd0WccpsHzsN_Zr0eX5NLA","expiredTime":1454259989846,"is_admin":false,"is_windower":true,"avatar_uri":"","score":0,"_id":"3g060xAcf4i3o6bh"} -{"name":"张三","username":"customer","password":"f5bb0c8de146c67b44babbf4e6584cc0","token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6InB1aXlocnJHbVpOMlYxRnIiLCJpYXQiOjE0NTM2NTUxODl9.Bu2aK4RA71-9LWXmlDYKBvFrpW_BlvFrYiyMvf4OJUY","expiredTime":1454259989837,"is_admin":false,"is_windower":false,"avatar_uri":"http://localhost:7410/api/images/avatar/0ade89f64874bb4462c43740e715dd82.jpg","score":0,"_id":"puiyhrrGmZN2V1Fr"} -{"name":"张三","username":"customer","password":"f5bb0c8de146c67b44babbf4e6584cc0","token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6InB1aXlocnJHbVpOMlYxRnIiLCJpYXQiOjE0NTM2NTUxODl9.Bu2aK4RA71-9LWXmlDYKBvFrpW_BlvFrYiyMvf4OJUY","expiredTime":1454259989837,"is_admin":false,"is_windower":false,"avatar_uri":"http://localhost:7410/api/images/avatar/0ade89f64874bb4462c43740e715dd82.jpg","score":25,"_id":"puiyhrrGmZN2V1Fr"} +{"name":"匿名","username":"customer","password":"91ec1f9324753048c0096d036a694f86","token":"","expiredTime":1453697174195,"is_admin":false,"is_windower":false,"avatar_uri":"","score":0,"_id":"d0GrbREQcWbjcgal"} +{"name":"匿名","username":"windower","password":"d376867b1d99e6e188d5b658a4a51153","token":"","expiredTime":1453697174199,"is_admin":false,"is_windower":true,"avatar_uri":"","score":0,"_id":"pVCBn2S4ssoMSeeD"} +{"name":"匿名","username":"admin","password":"21232f297a57a5a743894a0e4a801fc3","token":"","expiredTime":1453697174203,"is_admin":true,"is_windower":false,"avatar_uri":"","score":0,"_id":"QtE8pb7eLJdmWMCG"} +{"name":"匿名","username":"admin","password":"21232f297a57a5a743894a0e4a801fc3","token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6IlF0RThwYjdlTEpkbVdNQ0ciLCJpYXQiOjE0NTM2OTcxNzR9.HndOf-YG8lA7-gfROjQx84VgeHeuFwa1RSxozgxwD_o","expiredTime":1454301974213,"is_admin":true,"is_windower":false,"avatar_uri":"","score":0,"_id":"QtE8pb7eLJdmWMCG"} +{"name":"匿名","username":"customer","password":"91ec1f9324753048c0096d036a694f86","token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6ImQwR3JiUkVRY1diamNnYWwiLCJpYXQiOjE0NTM2OTcxNzR9.-JXpFXAr7AGbkzSL_oajHPXDu8dOud5kU-U2vtDHp48","expiredTime":1454301974221,"is_admin":false,"is_windower":false,"avatar_uri":"","score":0,"_id":"d0GrbREQcWbjcgal"} +{"name":"匿名","username":"windower","password":"d376867b1d99e6e188d5b658a4a51153","token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6InBWQ0JuMlM0c3NvTVNlZUQiLCJpYXQiOjE0NTM2OTcxNzR9.1XxPMRNMPG2lkW3WseLc2-9hEEmPwpNjwGTs_8RPFZM","expiredTime":1454301974228,"is_admin":false,"is_windower":true,"avatar_uri":"","score":0,"_id":"pVCBn2S4ssoMSeeD"} +{"name":"张三","username":"customer","password":"91ec1f9324753048c0096d036a694f86","token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6ImQwR3JiUkVRY1diamNnYWwiLCJpYXQiOjE0NTM2OTcxNzR9.-JXpFXAr7AGbkzSL_oajHPXDu8dOud5kU-U2vtDHp48","expiredTime":1454301974221,"is_admin":false,"is_windower":false,"avatar_uri":"","score":0,"_id":"d0GrbREQcWbjcgal"} +{"name":"张三","username":"customer","password":"f5bb0c8de146c67b44babbf4e6584cc0","token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6ImQwR3JiUkVRY1diamNnYWwiLCJpYXQiOjE0NTM2OTcxNzR9.-JXpFXAr7AGbkzSL_oajHPXDu8dOud5kU-U2vtDHp48","expiredTime":1454301974221,"is_admin":false,"is_windower":false,"avatar_uri":"","score":0,"_id":"d0GrbREQcWbjcgal"} +{"name":"匿名","username":"admin","password":"21232f297a57a5a743894a0e4a801fc3","token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6IlF0RThwYjdlTEpkbVdNQ0ciLCJpYXQiOjE0NTM2OTcxNzR9.HndOf-YG8lA7-gfROjQx84VgeHeuFwa1RSxozgxwD_o","expiredTime":1454301974213,"is_admin":false,"is_windower":false,"avatar_uri":"","score":0,"_id":"QtE8pb7eLJdmWMCG"} +{"name":"匿名","username":"admin","password":"21232f297a57a5a743894a0e4a801fc3","token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6IlF0RThwYjdlTEpkbVdNQ0ciLCJpYXQiOjE0NTM2OTcxNzR9.HndOf-YG8lA7-gfROjQx84VgeHeuFwa1RSxozgxwD_o","expiredTime":1454301974213,"is_admin":true,"is_windower":false,"avatar_uri":"","score":0,"_id":"QtE8pb7eLJdmWMCG"} +{"name":"匿名","username":"windower","password":"d376867b1d99e6e188d5b658a4a51153","token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6InBWQ0JuMlM0c3NvTVNlZUQiLCJpYXQiOjE0NTM2OTcxNzR9.1XxPMRNMPG2lkW3WseLc2-9hEEmPwpNjwGTs_8RPFZM","expiredTime":1454301974228,"is_admin":false,"is_windower":true,"avatar_uri":"","score":0,"_id":"pVCBn2S4ssoMSeeD"} +{"name":"匿名","username":"windower","password":"d376867b1d99e6e188d5b658a4a51153","token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6InBWQ0JuMlM0c3NvTVNlZUQiLCJpYXQiOjE0NTM2OTcxNzR9.1XxPMRNMPG2lkW3WseLc2-9hEEmPwpNjwGTs_8RPFZM","expiredTime":1454301974228,"is_admin":false,"is_windower":false,"avatar_uri":"","score":0,"_id":"pVCBn2S4ssoMSeeD"} +{"name":"匿名","username":"windower","password":"d376867b1d99e6e188d5b658a4a51153","token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6InBWQ0JuMlM0c3NvTVNlZUQiLCJpYXQiOjE0NTM2OTcxNzR9.1XxPMRNMPG2lkW3WseLc2-9hEEmPwpNjwGTs_8RPFZM","expiredTime":1454301974228,"is_admin":false,"is_windower":true,"avatar_uri":"","score":0,"_id":"pVCBn2S4ssoMSeeD"} +{"name":"张三","username":"customer","password":"f5bb0c8de146c67b44babbf4e6584cc0","token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6ImQwR3JiUkVRY1diamNnYWwiLCJpYXQiOjE0NTM2OTcxNzR9.-JXpFXAr7AGbkzSL_oajHPXDu8dOud5kU-U2vtDHp48","expiredTime":1454301974221,"is_admin":false,"is_windower":false,"avatar_uri":"http://localhost:7410/api/images/avatar/8d2d4ecafec71960331b073b6af145e0.jpg","score":0,"_id":"d0GrbREQcWbjcgal"} +{"name":"张三","username":"customer","password":"f5bb0c8de146c67b44babbf4e6584cc0","token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6ImQwR3JiUkVRY1diamNnYWwiLCJpYXQiOjE0NTM2OTcxNzR9.-JXpFXAr7AGbkzSL_oajHPXDu8dOud5kU-U2vtDHp48","expiredTime":1454301974221,"is_admin":false,"is_windower":false,"avatar_uri":"http://localhost:7410/api/images/avatar/8d2d4ecafec71960331b073b6af145e0.jpg","score":25,"_id":"d0GrbREQcWbjcgal"} diff --git a/src/bizs/commentBiz.coffee b/src/bizs/commentBiz.coffee index c9b50ba..ed4c6c5 100644 --- a/src/bizs/commentBiz.coffee +++ b/src/bizs/commentBiz.coffee @@ -33,7 +33,10 @@ addCommentToOrder = (req,res,next) -> # TODO 卖家评分的使用场景暂定 db.comments.insert({ content: content ?= '这家伙很懒,没有写评价' + windowId: doc.windowId + orderId: orderId userId: req.userInfo._id + is_windower: true },(err,comment) -> return next(err) if err return next(commonBiz.customError(400,'评价失败')) if not comment @@ -51,6 +54,9 @@ addCommentToOrder = (req,res,next) -> db.comments.insert({ content: content ?= '这家伙很懒,没有写评价' userId: req.userInfo._id + windowId: doc.windowId + orderId: orderId + is_windower: false pics: [] },(err,comment) -> return next(err) if err @@ -107,10 +113,32 @@ addCommentToOrder = (req,res,next) -> +# 获取窗口所有的评价 +getWindowComments = (req,res,next) -> + windowId = req.params['id'] + db.comments.find({windowId: windowId},(err,doc) -> + return next(err) if err + return next(commonBiz.customError(404,'找不到该窗口的评价')) if not doc + return res.json(doc) + ) + + + +# 获取订单的评价 +getOrder = (req,res,next) -> +# console.log('asdfasdfs') + orderId = req.params['id'] + db.comments.find({orderId:orderId},(err,doc) -> + return next(err) if err + return next(commonBiz.customError(404,'找不到该订单的评价')) if not doc + return res.json(doc) + ) module.exports = { addCommentToOrder: addCommentToOrder + getWindowComments: getWindowComments + getOrder:getOrder } diff --git a/src/bizs/uploadBiz.coffee b/src/bizs/uploadBiz.coffee index f07b09b..5953b97 100644 --- a/src/bizs/uploadBiz.coffee +++ b/src/bizs/uploadBiz.coffee @@ -120,7 +120,7 @@ uploadFoodIcon = (req,res,next) -> form.keepExtensions = true form.encoding = 'utf-8' # 窗口icon的最大尺寸为200k - form.maxFieldsSize = 200 * 1024 + form.maxFieldsSize = 1024 * 1024 form.parse(req,(err,fields,files) -> return next(err) if err diff --git a/src/routes/comment.coffee b/src/routes/comment.coffee index 816dd0c..351761d 100755 --- a/src/routes/comment.coffee +++ b/src/routes/comment.coffee @@ -16,6 +16,24 @@ router.post( ) +# 获取单个评论 +router.get( + '/order/:id' + commonBiz.authAndSetUserInfo + commentBiz.getOrder +) + +# 获取窗口的所有评价 +router.get( + '/window/:id' + commonBiz.authAndSetUserInfo + commentBiz.getWindowComments +) + + + + + module.exports = router diff --git a/test/users.test.coffee b/test/users.test.coffee index 39c9fe9..9c2ee46 100644 --- a/test/users.test.coffee +++ b/test/users.test.coffee @@ -791,10 +791,32 @@ describe('上传相关', -> ).end(done) ) +) -) +describe('评价相关',-> + it('获取窗口的所有评价',(done) -> + request(app) + .get('/api/comments/window/' + windowId ) + .set('x-token',windowerToken) + .expect(200) + .expect((res) -> + console.log(res.body) + + ).end(done) + ) + it('获取该订单的所有评价',(done) -> + request(app) + .get('/api/comments/order/' + orderId) + .set('x-token',windowerToken) + .expect(200) + .expect((res) -> + console.log(res.body) + + ).end(done) + ) +)