Commit f9f67a78 authored by nanahira's avatar nanahira

add cache control header

parent ddce805c
Pipeline #14539 passed with stages
in 41 seconds
import { Controller, Get, Query } from '@nestjs/common';
import { Controller, Get, Header, Query } from '@nestjs/common';
import { BlacklistService } from './blacklist.service';
import { ApiOkResponse, ApiOperation, ApiQuery } from '@nestjs/swagger';
import {
......@@ -17,6 +17,10 @@ export class BlacklistController {
@ApiOperation({ summary: '获取黑名单' })
@ApiQuery({ name: 'since', description: '获取黑名单的起始时间' })
@ApiOkResponse({ type: HamiResultDto })
@Header(
'Cache-Control',
'public, max-age=600, stale-while-revalidate=600, stale-if-error=604800',
)
async getBlacklist(@Query('since') since: string) {
if (!since) {
throw new BlankReturnMessageDto(400, 'since is required');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment