forked from wangziqi/gongxue-base
refactor: resolve remaining field audit issues
This commit is contained in:
@@ -2,7 +2,7 @@ import { Controller, Get, Post, Body, Param, UseGuards } from '@nestjs/common';
|
||||
import { JwtAuthGuard } from '../../auth/guards/jwt-auth.guard';
|
||||
import { RequirePermission } from '../../auth/decorators/permission.decorator';
|
||||
import { IntegrationConfigService } from './integration-config.service';
|
||||
import type { SaveConfigRequest } from './dto/config.dto';
|
||||
import { SaveIntegrationConfigDto, TestIntegrationConfigDto } from './dto/config.dto';
|
||||
|
||||
@Controller('integration/config')
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@@ -31,7 +31,7 @@ export class IntegrationConfigController {
|
||||
/** 保存配置 */
|
||||
@Post()
|
||||
@RequirePermission('integration:trigger')
|
||||
async saveConfig(@Body() body: SaveConfigRequest) {
|
||||
async saveConfig(@Body() body: SaveIntegrationConfigDto) {
|
||||
await this.service.saveConfig(body);
|
||||
return { success: true, message: '配置已保存' };
|
||||
}
|
||||
@@ -39,7 +39,7 @@ export class IntegrationConfigController {
|
||||
/** 测试连接 */
|
||||
@Post('test')
|
||||
@RequirePermission('integration:read')
|
||||
async testConnection(@Body() body: SaveConfigRequest) {
|
||||
async testConnection(@Body() body: TestIntegrationConfigDto) {
|
||||
const success = await this.service.testConnection(body.type, body.config);
|
||||
return { success, message: success ? '连接成功' : '连接失败,请检查配置信息' };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user