|
@@ -106,7 +106,7 @@ class PostController extends Controller
|
|
|
'video' => 'required_if:type,video|string|url',
|
|
|
'topic_ids' => 'required|string|max:64',
|
|
|
'title' => 'nullable|string|max:20',
|
|
|
- 'content' => 'required|string|max:20',
|
|
|
+ 'content' => 'required|string|max:1000',
|
|
|
'location' => 'required|string',
|
|
|
'imgs' => 'required_if:type,image|array|max:9',
|
|
|
'imgs.*' => 'required|url',
|
|
@@ -117,6 +117,22 @@ class PostController extends Controller
|
|
|
return $this->postRepository->create($request->all());
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 评论&回复
|
|
|
+ */
|
|
|
+ public function comment(Request $request)
|
|
|
+ {
|
|
|
+ $validator = Validator::make($request->all(), [
|
|
|
+ 'post_id' => 'required|integer',
|
|
|
+ 'uid' => 'required|integer',
|
|
|
+ 'content' => 'required|string|max:150',
|
|
|
+ ]);
|
|
|
+ if ($validator->fails()) {
|
|
|
+ return $this->response->error($validator->errors()->first(), 500);
|
|
|
+ }
|
|
|
+ return $this->postRepository->comment($request->all());
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 推荐内容
|
|
|
*/
|