oauth response array

This commit is contained in:
xiaomlove
2024-04-05 22:40:06 +08:00
parent 8d07ad98f7
commit ff1b88a25f
15 changed files with 418 additions and 3 deletions

View File

@@ -0,0 +1,93 @@
<?php
namespace App\Http\Controllers;
use App\Http\Resources\ForumResource;
use App\Models\Forum;
use Illuminate\Http\Request;
class ForumController extends Controller
{
/**
* Display a listing of the resource.
*
* @return array
*/
public function index(Request $request)
{
$forId = $request->forid;
$query = Forum::query()->orderBy("sort", "asc")->with("moderators");
if ($forId) {
$query->where("forid", $forId);
}
$list = $query->get();
$resource = ForumResource::collection($list);
return $this->success($resource);
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
//
}
/**
* Display the specified resource.
*
* @param \App\Models\OverForum $overForum
* @return \Illuminate\Http\Response
*/
public function show(OverForum $overForum)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param \App\Models\OverForum $overForum
* @return \Illuminate\Http\Response
*/
public function edit(OverForum $overForum)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\Models\OverForum $overForum
* @return \Illuminate\Http\Response
*/
public function update(Request $request, OverForum $overForum)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param \App\Models\OverForum $overForum
* @return \Illuminate\Http\Response
*/
public function destroy(OverForum $overForum)
{
//
}
}