feat: 新增赔率版本和玩法配置版本的删除接口,支持删除草稿版本
This commit is contained in:
@@ -147,6 +147,26 @@ final class PlayConfigStreamService
|
||||
);
|
||||
}
|
||||
|
||||
public function deleteVersion(PlayConfigVersion $version, AdminUser $admin, ?Request $request = null): void
|
||||
{
|
||||
$before = $this->snapshotVersion($version);
|
||||
|
||||
DB::transaction(function () use ($version): void {
|
||||
$version->delete();
|
||||
});
|
||||
|
||||
AuditLogger::recordForAdmin(
|
||||
$admin,
|
||||
$request,
|
||||
moduleCode: 'play_config',
|
||||
actionCode: 'delete',
|
||||
targetType: 'play_config_version',
|
||||
targetId: (string) $version->id,
|
||||
beforeJson: $before,
|
||||
afterJson: null,
|
||||
);
|
||||
}
|
||||
|
||||
/** @return array<string, mixed> */
|
||||
private function snapshotVersion(PlayConfigVersion $v): array
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user