This commit is contained in:
阿不叮咚
2025-09-24 16:37:22 +08:00
parent 998f8d8356
commit 1f6b60ee0f
8 changed files with 217 additions and 360 deletions

View File

@@ -34,7 +34,7 @@ abstract class AetherController
/**
* 获取单个资源 (RESTFul: GET /resources/{id})
*/
public function show(int $id): array
public function detail(int $id): array
{
$result = $this->getService()->detail($id);
return AetherResponse::success($result);
@@ -43,7 +43,7 @@ abstract class AetherController
/**
* 创建资源 (RESTFul: POST /resources)
*/
public function store(): array
public function create(): array
{
$data = $this->request->all();
$id = $this->getService()->create($data);
@@ -63,7 +63,7 @@ abstract class AetherController
/**
* 删除资源 (RESTFul: DELETE /resources/{id})
*/
public function destroy(int $id): array
public function delete(int $id): array
{
$this->getService()->delete($id);
return AetherResponse::success(null, '删除成功');
@@ -71,8 +71,7 @@ abstract class AetherController
/**
* 获取对应的服务类
* @return AbstractService
* @return AetherCrudService
*/
abstract protected function getService(): AbstractService;
abstract protected function getService(): AetherCrudService;
}