CommonService.php 888 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace app\api\servies\common;
  3. use app\api\servies\ZskkDefaultService;
  4. use app\api\dao\test\TestDao;
  5. use think\facade\Log;
  6. /**
  7. * 后台控制器基类
  8. * 接口方法权限 必传参数 接口返回 错误抛出 通用参数处理
  9. */
  10. class CommonService extends ZskkDefaultService {
  11. protected $logName = "CommonService";
  12. private $testDao = null;
  13. // protected function zskkInit(TestDao $testDao) {
  14. // $this->testDao;
  15. // }
  16. public function __construct(TestDao $testDao) {
  17. parent::__construct();
  18. $this->injectDao($testDao);
  19. }
  20. private function injectDao($testDao) {
  21. $this->testDao = $testDao;
  22. }
  23. public function test($params) {
  24. $this->log('自定义日志commonservice1');
  25. $this->log('自定义日志commonservice2');
  26. if($params['dao']) {
  27. return '\n---common service---\n';
  28. }
  29. return '\n---common service---\n';
  30. }
  31. }