|
@@ -27,7 +27,7 @@ class InteractionController extends Controller
|
|
* @apiParam {int} id 梦想ID
|
|
* @apiParam {int} id 梦想ID
|
|
* @apiParam {string} title 互动标题
|
|
* @apiParam {string} title 互动标题
|
|
* @apiParam {string} [video] 视频
|
|
* @apiParam {string} [video] 视频
|
|
- * @apiParam {array} pics[] 图片数组
|
|
|
|
|
|
+ * @apiParam {array} [pics[]] 图片数组
|
|
* @apiSuccessExample {json} Success-Response:
|
|
* @apiSuccessExample {json} Success-Response:
|
|
* HTTP/1.1 200 OK
|
|
* HTTP/1.1 200 OK
|
|
*{
|
|
*{
|
|
@@ -298,4 +298,54 @@ class InteractionController extends Controller
|
|
return $this->error(ErrorCode::OPERATION_FAILED);
|
|
return $this->error(ErrorCode::OPERATION_FAILED);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @api {get} /api/interaction/destroy 删除动态
|
|
|
|
+ * @apiDescription 删除动态
|
|
|
|
+ * @apiGroup Interaction
|
|
|
|
+ * @apiParam {int} id 动态ID
|
|
|
|
+ * @apiPermission Passport
|
|
|
|
+ * @apiVersion 0.1.0
|
|
|
|
+ * @apiSuccessExample {json} Success-Response:
|
|
|
|
+ * {
|
|
|
|
+ * "status": true,
|
|
|
|
+ * "status_code": 0,
|
|
|
|
+ * "message": "",
|
|
|
|
+ * "data": ""
|
|
|
|
+ *}
|
|
|
|
+ * HTTP/1.1 200 OK
|
|
|
|
+ * @apiErrorExample {json} Error-Response:
|
|
|
|
+ * {
|
|
|
|
+ * "status": false,
|
|
|
|
+ * "status_code": 700,
|
|
|
|
+ * "message": "操作失败",
|
|
|
|
+ * "data": null
|
|
|
|
+ *}
|
|
|
|
+ * HTTP/1.1 400 Bad Request
|
|
|
|
+ */
|
|
|
|
+ public function destroy(Request $request)
|
|
|
|
+ {
|
|
|
|
+ $validator = \Validator::make($request->all(),
|
|
|
|
+ [
|
|
|
|
+ 'id' => 'required',
|
|
|
|
+ ],
|
|
|
|
+ [
|
|
|
|
+ 'id.required' => '动态ID不存在',
|
|
|
|
+ ]
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ if($validator->fails()) return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
|
|
|
|
+
|
|
|
|
+// $user = $this->getUser();
|
|
|
|
+
|
|
|
|
+ $id = $request->input('id');
|
|
|
|
+ CommentInfoModel::where('interaction_id',$id)->delete();
|
|
|
|
+ $ok = InteractionInfo::destroy($id);
|
|
|
|
+
|
|
|
|
+ if ($ok) {
|
|
|
|
+ return $this->api('');
|
|
|
|
+ }else{
|
|
|
|
+ return $this->error(ErrorCode::OPERATION_FAILED);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|