TestServiceInterface.php 933 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace App\Module\Test\Services;
  3. use App\Module\Test\Models\Test as TestModel;
  4. interface TestServiceInterface
  5. {
  6. /**
  7. * 创建测试数据
  8. *
  9. * @param array $data
  10. * @return TestModel
  11. */
  12. public function create(array $data): TestModel;
  13. /**
  14. * 更新测试数据
  15. *
  16. * @param TestModel $test
  17. * @param array $data
  18. * @return bool
  19. */
  20. public function update(TestModel $test, array $data): bool;
  21. /**
  22. * 删除测试数据
  23. *
  24. * @param TestModel $test
  25. * @return bool
  26. */
  27. public function delete(TestModel $test): bool;
  28. /**
  29. * 恢复测试数据
  30. *
  31. * @param TestModel $test
  32. * @return bool
  33. */
  34. public function restore(TestModel $test): bool;
  35. /**
  36. * 强制删除测试数据
  37. *
  38. * @param TestModel $test
  39. * @return bool
  40. */
  41. public function forceDelete(TestModel $test): bool;
  42. }