12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
- namespace app\api\servies\common;
- use app\api\servies\ZskkDefaultService;
- use app\api\dao\test\TestDao;
- use think\facade\Log;
- /**
- * 后台控制器基类
- * 接口方法权限 必传参数 接口返回 错误抛出 通用参数处理
- */
- class CommonService extends ZskkDefaultService {
- protected $logName = "CommonService";
- private $testDao = null;
- // protected function zskkInit(TestDao $testDao) {
- // $this->testDao;
- // }
- public function __construct(TestDao $testDao) {
- parent::__construct();
- $this->injectDao($testDao);
- }
- private function injectDao($testDao) {
- $this->testDao = $testDao;
- }
- public function test($params) {
- $this->log('自定义日志commonservice1');
- $this->log('自定义日志commonservice2');
- if($params['dao']) {
- return '\n---common service---\n';
- }
- return '\n---common service---\n';
- }
- }
|