|
@@ -2,8 +2,10 @@ import { Controller, Get, Query, Post, Body } from '@nestjs/common'
|
|
import { ApiOperation, ApiTags } from '@nestjs/swagger'
|
|
import { ApiOperation, ApiTags } from '@nestjs/swagger'
|
|
|
|
|
|
import {
|
|
import {
|
|
|
|
+ GetModuleListDto,
|
|
GetModuleConfigurationDto,
|
|
GetModuleConfigurationDto,
|
|
- SaveModuleConfigurationDto
|
|
|
|
|
|
+ SaveModuleConfigurationDto,
|
|
|
|
+ DeleteModuleConfigurationDto
|
|
} from '@/dto/agent-module'
|
|
} from '@/dto/agent-module'
|
|
|
|
|
|
import { AgentModuleService } from './service/agent-module.service'
|
|
import { AgentModuleService } from './service/agent-module.service'
|
|
@@ -15,8 +17,8 @@ export class AgentModuleController {
|
|
|
|
|
|
@Get('get-module-list')
|
|
@Get('get-module-list')
|
|
@ApiOperation({ summary: '获取模块列表' })
|
|
@ApiOperation({ summary: '获取模块列表' })
|
|
- async getModuleList() {
|
|
|
|
- return this.agentModuleService.getModuleList()
|
|
|
|
|
|
+ async getModuleList(@Query() query: GetModuleListDto) {
|
|
|
|
+ return this.agentModuleService.getModuleList(query.page, query.pageSize)
|
|
}
|
|
}
|
|
|
|
|
|
@Get('get-module-configuration')
|
|
@Get('get-module-configuration')
|
|
@@ -29,11 +31,11 @@ export class AgentModuleController {
|
|
@ApiOperation({ summary: '保存模块配置' })
|
|
@ApiOperation({ summary: '保存模块配置' })
|
|
async saveModuleConfiguration(@Body() body: SaveModuleConfigurationDto) {
|
|
async saveModuleConfiguration(@Body() body: SaveModuleConfigurationDto) {
|
|
return this.agentModuleService.saveModuleConfiguration(
|
|
return this.agentModuleService.saveModuleConfiguration(
|
|
- body.id,
|
|
|
|
|
|
+ body.moduleId,
|
|
body.name,
|
|
body.name,
|
|
body.displayName,
|
|
body.displayName,
|
|
- body.defaultAgentType,
|
|
|
|
- body.defaultAgentId
|
|
|
|
|
|
+ body.type,
|
|
|
|
+ body.agentId
|
|
)
|
|
)
|
|
}
|
|
}
|
|
|
|
|
|
@@ -42,4 +44,10 @@ export class AgentModuleController {
|
|
async getModuleAgentTypes() {
|
|
async getModuleAgentTypes() {
|
|
return this.agentModuleService.getModuleAgentTypes()
|
|
return this.agentModuleService.getModuleAgentTypes()
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Post('delete-module-configuration')
|
|
|
|
+ @ApiOperation({ summary: '删除模块配置' })
|
|
|
|
+ async deleteModuleConfiguration(@Body() body: DeleteModuleConfigurationDto) {
|
|
|
|
+ return this.agentModuleService.deleteModuleConfiguration(body.moduleId)
|
|
|
|
+ }
|
|
}
|
|
}
|