forked from wangziqi/gongxue-base
refactor: remove User-based import and RBAC UserDingMapping endpoints
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
import { BadRequestException, Body, Controller, Get, Logger, Post, Query, UseGuards } from '@nestjs/common';
|
||||
import { BadRequestException, Controller, Get, Logger, Post, Query, UseGuards } from '@nestjs/common';
|
||||
import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard';
|
||||
import { RequirePermission } from '../auth/decorators/permission.decorator';
|
||||
import { SyncService } from './sync.service';
|
||||
import type { SyncPlatform } from '../entities/sync-log.entity';
|
||||
import { ImportUsersDto } from './dto/import-users.dto';
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Controller('sync')
|
||||
@@ -51,17 +50,6 @@ export class SyncController {
|
||||
return { success: true, data: tree };
|
||||
}
|
||||
|
||||
/** 导入钉钉用户:老师分配角色,学生创建 Student */
|
||||
@Post('dingtalk/import-users')
|
||||
@RequirePermission('sync:trigger')
|
||||
async importDingTalkUsers(@Body() body: ImportUsersDto) {
|
||||
this.logger.log(`[import] users=${body.users.length} classes=${body.classes?.length || 0}`);
|
||||
this.logger.log(`[import] sample user: ${JSON.stringify(body.users[0])}`);
|
||||
const result = await this.syncService.importDingTalkUsers(body.users, body.classes);
|
||||
this.logger.log(`[import result] ${JSON.stringify(result)}`);
|
||||
return { success: true, ...result };
|
||||
}
|
||||
|
||||
@Get('logs')
|
||||
@RequirePermission('sync:read')
|
||||
async getLogs(
|
||||
|
||||
Reference in New Issue
Block a user