import { Injectable } from '@nestjs/common' import { ServiceResponse } from '@/response/response.interface' import { HttpClientService } from '@/shared/http-client/http-client.service' @Injectable() export class AgentTestHttpService { // private readonly baseUrl = 'http://192.168.206.189:8083/api' private readonly baseUrl = 'http://192.168.206.189:4090/api' constructor(private readonly httpClientService: HttpClientService) {} private async makeRequest( endpoint: string, params?: Record ): Promise> { const url = `${this.baseUrl}/${endpoint}` return this.httpClientService.get(url, params) } async makeRequestPost( endpoint: string, params?: Record ): Promise> { const url = `${this.baseUrl}/${endpoint}` return this.httpClientService.post(url, params) } async createTestTask( params: Record ): Promise> { console.log(params) return this.makeRequestPost('createTestTask', params) } async getEvaluateType(): Promise> { return this.makeRequest('getEvaluateType') } async getTestTaskList( params: Record ): Promise> { return this.makeRequest('getTestTaskList', params) } async stopTestTask( params: Record ): Promise> { return this.makeRequestPost('stopTestTask', params) } async resumeTestTask( params: Record ): Promise> { return this.makeRequestPost('resumeTestTask', params) } async getTestTaskConversations( params: Record ): Promise> { return this.makeRequest( 'getTestTaskConversations', params ) } }