feat: 初始化项目
This commit is contained in:
60
src/users/dto/security-monitoring.dto.ts
Normal file
60
src/users/dto/security-monitoring.dto.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
import { BaseResponseDto } from '../../base.dto';
|
||||
import { RestoreStatus, RestoreSource } from '../models/purchase-restore-log.model';
|
||||
|
||||
export interface SecurityAlertDto {
|
||||
id: string;
|
||||
userId: string;
|
||||
transactionId: string;
|
||||
productId: string;
|
||||
originalAppUserId: string;
|
||||
status: RestoreStatus;
|
||||
source: RestoreSource;
|
||||
clientIp: string;
|
||||
userAgent: string;
|
||||
failureReason?: string;
|
||||
createdAt: Date;
|
||||
riskScore: number;
|
||||
alertType: 'DUPLICATE_TRANSACTION' | 'SUSPICIOUS_IP' | 'RAPID_REQUESTS' | 'CROSS_ACCOUNT_FRAUD';
|
||||
}
|
||||
|
||||
export interface SecurityStatsDto {
|
||||
totalRestoreAttempts: number;
|
||||
successfulRestores: number;
|
||||
failedRestores: number;
|
||||
duplicateAttempts: number;
|
||||
fraudDetected: number;
|
||||
uniqueUsers: number;
|
||||
uniqueIPs: number;
|
||||
topRiskTransactions: SecurityAlertDto[];
|
||||
}
|
||||
|
||||
export interface GetSecurityAlertsDto {
|
||||
page?: number;
|
||||
limit?: number;
|
||||
status?: RestoreStatus;
|
||||
alertType?: string;
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
userId?: string;
|
||||
riskScoreMin?: number;
|
||||
}
|
||||
|
||||
export interface SecurityAlertsResponseDto extends BaseResponseDto<{
|
||||
alerts: SecurityAlertDto[];
|
||||
total: number;
|
||||
page: number;
|
||||
limit: number;
|
||||
}> { }
|
||||
|
||||
export interface SecurityStatsResponseDto extends BaseResponseDto<SecurityStatsDto> { }
|
||||
|
||||
export interface BlockTransactionDto {
|
||||
transactionId: string;
|
||||
reason: string;
|
||||
}
|
||||
|
||||
export interface BlockTransactionResponseDto extends BaseResponseDto<{
|
||||
blocked: boolean;
|
||||
transactionId: string;
|
||||
reason: string;
|
||||
}> { }
|
||||
Reference in New Issue
Block a user