Flight::route('GET /v1/main/userinfo', function () { $user = Flight::request()->query->user; try { if ($user) { $object = UserInfo::selectByUser($user); } else { $object = UserInfo::selectAll(); } Flight::ok($object); } catch (Exception $exception) { Flight::error($exception); } }); Flight::route('GET /v1/main/userinfo/@id', function ($id) { try { $object = UserInfo::select($id); Flight::ok($object); } catch (Exception $exception) { Flight::error($exception); } }); Flight::route('POST /v1/main/userinfo', function () { try { $object = UserInfo::insert(); Flight::ok($object); } catch (Exception $exception) { Flight::error($exception); } }); Flight::route('PUT /v1/main/userinfo/@id', function ($id) { try {