feat: wire sidecar to platform — auth proxy with workspace subdomain, GraphQL proxy, health check

This commit is contained in:
2026-03-18 07:15:47 +05:30
parent d488d551ed
commit a42d479f06
9 changed files with 281 additions and 25 deletions

View File

@@ -0,0 +1,43 @@
import { Controller, Post, Body, Logger, HttpException } from '@nestjs/common';
import { OzonetelAgentService } from './ozonetel-agent.service';
@Controller('api/ozonetel')
export class OzonetelAgentController {
private readonly logger = new Logger(OzonetelAgentController.name);
constructor(private readonly ozonetelAgent: OzonetelAgentService) {}
@Post('agent-login')
async agentLogin(
@Body() body: { agentId: string; password: string; phoneNumber: string; mode?: string },
) {
this.logger.log(`Agent login request for ${body.agentId}`);
try {
const result = await this.ozonetelAgent.loginAgent(body);
return result;
} catch (error: any) {
throw new HttpException(
error.response?.data?.message ?? 'Agent login failed',
error.response?.status ?? 500,
);
}
}
@Post('agent-logout')
async agentLogout(
@Body() body: { agentId: string; password: string },
) {
this.logger.log(`Agent logout request for ${body.agentId}`);
try {
const result = await this.ozonetelAgent.logoutAgent(body);
return result;
} catch (error: any) {
throw new HttpException(
error.response?.data?.message ?? 'Agent logout failed',
error.response?.status ?? 500,
);
}
}
}