123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <?php
- namespace catchAdmin\domain\controller;
- use catchAdmin\domain\support\contract\DomainRecordInterface;
- use catcher\base\CatchRequest as Request;
- use catcher\CatchResponse;
- use catcher\base\CatchController;
- class DomainRecord extends CatchController
- {
- protected $domainRecord;
- public function __construct(DomainRecordInterface $record)
- {
- $this->domainRecord = $record;
- }
-
- public function index(Request $request): \think\Response
- {
- return CatchResponse::paginate($this->domainRecord->getList($request->param()));
- }
-
- public function save(Request $request): \think\Response
- {
- return CatchResponse::success($this->domainRecord->store($request->post()));
- }
-
- public function read($name): \think\Response
- {
- return CatchResponse::success($this->domainRecord->read($name));
- }
-
- public function update($id, Request $request): \think\Response
- {
- return CatchResponse::success($this->domainRecord->update($id, $request->post()));
- }
-
- public function delete($id): \think\Response
- {
- return CatchResponse::success($this->domainRecord->delete($id));
- }
-
- public function enable($id, $status)
- {
- return CatchResponse::success($this->domainRecord->enable($id, $status));
- }
- }
|