|
@@ -25,6 +25,7 @@ class TopicGroupController extends Controller {
|
|
|
{
|
|
|
$this->topicGroupRepository = $topicGroupRepository;
|
|
|
}
|
|
|
+
|
|
|
//列表
|
|
|
public function index(Request $request){
|
|
|
$topicGroup = $this->topicGroupRepository->index($request->all());
|
|
@@ -84,5 +85,16 @@ class TopicGroupController extends Controller {
|
|
|
$info = $this->topicGroupRepository->view($data);
|
|
|
return $this->response->item($info, new DetailTopicGroupTransformer());
|
|
|
}
|
|
|
+ //删除
|
|
|
+ public function delete(Request $request){
|
|
|
+ $data = $request->only('id','status');
|
|
|
+ $validator = Validator::make($data, [
|
|
|
+ 'id' => 'required|integer|max:12',
|
|
|
+ ]);
|
|
|
+ if ($validator->fails()) {
|
|
|
+ return $this->response->error($validator->errors()->first(), 500);
|
|
|
+ }
|
|
|
+ return $this->topicGroupRepository->delete($data);
|
|
|
+ }
|
|
|
|
|
|
}
|