item_logic = new ItemLogic(); } /** * 获取列表 * @return JsonResponse * @throws GeneralException */ public function lists(): JsonResponse { $response = $this->item_logic->getLists(); return jsonResponse(Response::HTTP_OK, 'success', ItemListsResource::make($response)->toArray()); } /** * 获取详情 * @param Request $request * @param int $type_id * @return JsonResponse * @throws GeneralException */ public function details(Request $request, int $type_id): JsonResponse { $response = $this->item_logic->getDetails($type_id); return jsonResponse(Response::HTTP_OK, 'success', ItemDetailsResource::make($response)->toArray()); } }