|
|
@@ -1,7 +1,11 @@
|
|
|
-import { Body, Controller, Get, HttpCode, Logger, Param, Post, Query } from '@nestjs/common'
|
|
|
+import { Body, Controller, Get, HttpCode, Post, Query, Headers } from '@nestjs/common'
|
|
|
import { WeixinService } from './weixin.service'
|
|
|
import { Public } from 'src/auth/public.decorator'
|
|
|
+import { WeixinNotifyDto } from './dto/notify.dto'
|
|
|
+import { ApiTags } from '@nestjs/swagger'
|
|
|
+import { Request } from 'express'
|
|
|
|
|
|
+@ApiTags('weixin')
|
|
|
@Controller('/weixin')
|
|
|
export class WeixinController {
|
|
|
constructor(private readonly weixinService: WeixinService) {}
|
|
|
@@ -43,7 +47,7 @@ export class WeixinController {
|
|
|
@Public()
|
|
|
@Post('/notify')
|
|
|
@HttpCode(200)
|
|
|
- public async notify(@Body() body) {
|
|
|
- Logger.log(body, 'weixin notify')
|
|
|
+ public async notify(@Headers() headers, @Body() body: WeixinNotifyDto) {
|
|
|
+ await this.weixinService.notify(headers, body)
|
|
|
}
|
|
|
}
|