mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage-server
synced 2026-04-11 18:08:16 +00:00
feat: wire sidecar to platform — auth proxy with workspace subdomain, GraphQL proxy, health check
This commit is contained in:
43
src/ozonetel/ozonetel-agent.controller.ts
Normal file
43
src/ozonetel/ozonetel-agent.controller.ts
Normal 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,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user