import { Injectable } from '@nestjs/common' import { ServiceResponse } from '@/response/response.interface' import { HttpClientService } from '@/shared/http-client/http-client.service' @Injectable() export class AgentListHttpService { private readonly baseUrl = 'http://192.168.206.189:8083/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 getNativeAgentList( params: Record ): Promise> { return this.makeRequest('getNativeAgentList', params) } async getNativeAgentConfiguration( agent_id: string ): Promise> { return this.makeRequest( 'getNativeAgentConfiguration', { agent_id } ) } async saveNativeAgentConfiguration( params: SaveAgentConfigurationType ): Promise> { console.log(params) return this.makeRequestPost( 'saveNativeAgentConfiguration', params ) } async getToolList(): Promise> { return this.makeRequest('getToolList') } async deleteNativeAgentConfiguration( agent_id: number ): Promise> { return this.makeRequestPost('deleteNativeAgentConfiguration', { agent_id }) } }