|
@@ -126,6 +126,21 @@ class PostController extends Controller
|
|
|
return $this->response->item($post, new DetailTransformer());
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 内容类型
|
|
|
+ */
|
|
|
+ public function getType(Request $request)
|
|
|
+ {
|
|
|
+ $validator = Validator::make($request->all(), [
|
|
|
+ 'id' => 'required|exists:post'
|
|
|
+ ]);
|
|
|
+ if ($validator->fails()) {
|
|
|
+ return $this->response->error($validator->errors()->first(), 500);
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this->postRepository->getType($request->all());
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 评论列表
|
|
|
*/
|