1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?php
- namespace App\Http\Controllers\Api\V1\Mentality;
- use Illuminate\Http\Request;
- use App\Http\Controllers\Api\V1\BaseController;
- use App\Facades\CollectFacade;
- class CollectController extends BaseController
- {
- /**
- * Display a listing of the resource.
- *
- * @return \Illuminate\Http\Response
- */
- public function index()
- {
- $conditions = [
- 'uid' => $this->auth()
- ];
- $fields = ['*'];
- $sort = '`id` desc';
- $page = request('page', 1);
- $limit = request('limit', 20);
- return CollectFacade::getList($conditions, $fields, $sort, $page, $limit);
- }
- /**
- * Store a newly created resource in storage.
- *
- * @param \Illuminate\Http\Request $request
- * @return \Illuminate\Http\Response
- */
- public function store(Request $request)
- {
- $data = $request->only(['column','object_id']);
- $data['uid'] = $this->auth();
- $data['repeat'] = 'uid:'.$data['uid'].' column:'.$data['column'].' object_id:'.$data['object_id'];
- return CollectFacade::create($data);
- }
- /**
- * Display the specified resource.
- *
- * @param int $id
- * @return \Illuminate\Http\Response
- */
- public function show($id)
- {
- //
- }
- /**
- * Update the specified resource in storage.
- *
- * @param \Illuminate\Http\Request $request
- * @param int $id
- * @return \Illuminate\Http\Response
- */
- public function update(Request $request, $id)
- {
- //
- }
- /**
- * Remove the specified resource from storage.
- *
- * @param int $id
- * @return \Illuminate\Http\Response
- */
- public function destroy($id)
- {
- //
- }
- }
|