Add production-ready SuperAdmin API features for tenants, SMS, servers, and plugins.
Includes mobile auth, get_user/get_version, SMS wallet parity endpoints, appearance backfill, and related Prisma migrations. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,7 +1,22 @@
|
||||
import { Body, Controller, Get, Param, Patch, Post, Query, UseGuards } from '@nestjs/common';
|
||||
import {
|
||||
Body,
|
||||
Controller,
|
||||
Get,
|
||||
Param,
|
||||
Patch,
|
||||
Post,
|
||||
Put,
|
||||
Query,
|
||||
UseGuards,
|
||||
} from '@nestjs/common';
|
||||
import { JwtAuthGuard } from '../auth/jwt-auth.guard';
|
||||
import { CurrentUser } from '../auth/current-user.decorator';
|
||||
import { ChargeSmsWalletDto, UpdateSmsAccountDto } from './dto/sms-account.dto';
|
||||
import {
|
||||
ChargeSmsWalletDto,
|
||||
SmsTableQueryDto,
|
||||
UpdateSmsAccountDto,
|
||||
UpdateSmsChargeInfoDto,
|
||||
} from './dto/sms-account.dto';
|
||||
import { SmsService } from './sms.service';
|
||||
|
||||
@Controller('sms')
|
||||
@@ -24,6 +39,48 @@ export class SmsController {
|
||||
return this.smsService.getAccount(id);
|
||||
}
|
||||
|
||||
@Get('tenants/:id/charge-info')
|
||||
getChargeInfo(@Param('id') id: string) {
|
||||
return this.smsService.getChargeInfo(id);
|
||||
}
|
||||
|
||||
@Put('tenants/:id/charge-info')
|
||||
updateChargeInfo(
|
||||
@Param('id') id: string,
|
||||
@Body() dto: UpdateSmsChargeInfoDto,
|
||||
@CurrentUser() user: { id: string },
|
||||
) {
|
||||
return this.smsService.updateChargeInfo(id, dto, user.id);
|
||||
}
|
||||
|
||||
@Get('tenants/:id/report')
|
||||
report(
|
||||
@Param('id') id: string,
|
||||
@Query('fromDate') fromDate?: string,
|
||||
@Query('toDate') toDate?: string,
|
||||
) {
|
||||
return this.smsService.getPeriodReport(id, fromDate, toDate);
|
||||
}
|
||||
|
||||
@Get('tenants/:id/report/charges')
|
||||
chargeReport(
|
||||
@Param('id') id: string,
|
||||
@Query('fromDate') fromDate?: string,
|
||||
@Query('toDate') toDate?: string,
|
||||
) {
|
||||
return this.smsService.getChargeReport(id, fromDate, toDate);
|
||||
}
|
||||
|
||||
@Post('tenants/:id/logs/table')
|
||||
logsTable(@Param('id') id: string, @Body() dto: SmsTableQueryDto) {
|
||||
return this.smsService.getLogsTable(id, dto);
|
||||
}
|
||||
|
||||
@Post('tenants/:id/ledger/table')
|
||||
ledgerTable(@Param('id') id: string, @Body() dto: SmsTableQueryDto) {
|
||||
return this.smsService.getLedgerTable(id, dto);
|
||||
}
|
||||
|
||||
@Patch('tenants/:id')
|
||||
updateAccount(
|
||||
@Param('id') id: string,
|
||||
|
||||
Reference in New Issue
Block a user