// packages/backend/src/modules/netaclaw/browser-daemon/controller/admin/inspect.ts
import { Provide, Inject, Controller, Post, Body } from '@midwayjs/core';
import { CoolTag, CoolUrlTag, TagTypes } from '@cool-midway/core';
import { BrowserDaemonService } from '../../service/daemon.service.js';

@Provide()
@CoolUrlTag()
@Controller('/admin/browser-daemon')
export class AdminBrowserDaemonInspectController {
  @Inject() daemonService: BrowserDaemonService;

  @CoolTag(TagTypes.IGNORE_TOKEN)
  @Post('/snapshot')
  async snapshot(@Body() dto: { sessionName: string }) {
    return { code: 1000, data: await this.daemonService.snapshot(dto.sessionName) };
  }
}
