notify.controller.ts 571 B

1234567891011121314151617
  1. import { Body, Controller, Headers, HttpCode, Post } from '@nestjs/common'
  2. import { NotifyService } from './notify.service'
  3. import { Public } from 'src/auth/public.decorator'
  4. import { ApiTags } from '@nestjs/swagger'
  5. @ApiTags('notify')
  6. @Controller('/notify')
  7. export class NotifyController {
  8. constructor(private readonly notifyService: NotifyService) {}
  9. @Public()
  10. @Post('/weixin')
  11. @HttpCode(200)
  12. public async weixin(@Headers() headers, @Body() body: WechatPay.NotifyEvent) {
  13. await this.notifyService.handleWeixinNotify(headers, body)
  14. }
  15. }