emqx.controller.ts
文件内容:
import { Body, Controller, HttpStatus, Post, Res } from '@nestjs/common'; import { Response } from 'express'; class EmqxAuthReqDto { clientid: string; username: string; password: string; } @Controller('emqx') export class EmqxController { @Post('auth') auth(@Body() body: EmqxAuthReqDto, @Res() res: Response) { console.log(body); const result = { result: 'allow', is_superuser: true, }; return res.status(HttpStatus.OK).send(result); } }