Skip to content

Commit 76cac97

Browse files
authored
Merge pull request kvnZero#14 from kvnZero/feat/测试中修改
update 查询执行后事件增加方法 方便直接对不同的方法进行处理
2 parents 1a70ba9 + 211206e commit 76cac97

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

Diff for: app/ApiJson/Method/DeleteMethod.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ protected function process()
3939
}
4040
$result = $this->parseManyResponse($deletedIds, $queryMany);
4141

42-
$event = new QueryExecuteAfter($this->query->toSql(), $result);
42+
$event = new QueryExecuteAfter($this->query->toSql(), $this->method, $result);
4343
ApplicationContext::getContainer()->get(EventDispatcherInterface::class)->dispatch($event);
4444

4545
return $result;

Diff for: app/ApiJson/Method/GetMethod.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ protected function process()
4343
$result = current($result);
4444
}
4545

46-
$event = new QueryExecuteAfter($this->query->toSql(), $result);
46+
$event = new QueryExecuteAfter($this->query->toSql(), $this->method, $result);
4747
ApplicationContext::getContainer()->get(EventDispatcherInterface::class)->dispatch($event);
4848

4949
return $result ?: [];

Diff for: app/ApiJson/Method/HeadMethod.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ protected function process()
2929
$count = $event->result;
3030
}
3131

32-
$event = new QueryExecuteAfter($this->query->toSql(), $count);
32+
$event = new QueryExecuteAfter($this->query->toSql(), $this->method, $count);
3333
ApplicationContext::getContainer()->get(EventDispatcherInterface::class)->dispatch($event);
3434

3535
return [

Diff for: app/ApiJson/Method/PostMethod.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protected function process()
3030
}
3131
$result = $this->parseManyResponse($insertIds, $this->isQueryMany());
3232

33-
$event = new QueryExecuteAfter($this->query->toSql(), $result);
33+
$event = new QueryExecuteAfter($this->query->toSql(), $this->method, $result);
3434
ApplicationContext::getContainer()->get(EventDispatcherInterface::class)->dispatch($event);
3535

3636
return $result;

Diff for: app/ApiJson/Method/PutMethod.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ protected function process()
4646
}
4747
$result = $this->parseManyResponse($updateIds, $queryMany);
4848

49-
$event = new QueryExecuteAfter($this->query->toSql(), $result);
49+
$event = new QueryExecuteAfter($this->query->toSql(), $this->method, $result);
5050
ApplicationContext::getContainer()->get(EventDispatcherInterface::class)->dispatch($event);
5151

5252
return $result;

Diff for: app/Event/ApiJson/QueryExecuteAfter.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88
class QueryExecuteAfter
99
{
10-
public function __construct(public string $sql, public $result)
10+
public function __construct(public string $sql, public string $method, public $result)
1111
{
1212
}
1313
}

0 commit comments

Comments
 (0)