Commit 06adbc0c authored by nanahira's avatar nanahira

readme

parent 2a4c8634
Pipeline #14516 failed with stages
in 2 minutes and 10 seconds
# Wenyuanwall Fetch
Data fetcher for https://twitter.com/Hamimelon7/
## Config
Refer to `config.example.yaml` in project, and put it in `config.yaml`.
## API
### Blacklist
GET /api/blacklist
#### Query
- `since` Since time, in `YYYY-MM-DD` format.
import { Controller, Get, Query } from '@nestjs/common';
import { BlacklistService } from './blacklist.service';
import { ApiOkResponse, ApiOperation, ApiQuery } from '@nestjs/swagger';
import { ReturnMessageDto } from '../dto/ReturnMessage.dto';
import {
BlankReturnMessageDto,
ReturnMessageDto,
} from '../dto/ReturnMessage.dto';
import { HamiResult } from '../dto/hami.dto';
const HamiResultDto = ReturnMessageDto([HamiResult]);
......@@ -15,6 +18,9 @@ export class BlacklistController {
@ApiQuery({ name: 'since', description: '获取黑名单的起始时间' })
@ApiOkResponse({ type: HamiResultDto })
async getBlacklist(@Query('since') since: string) {
if (!since) {
throw new BlankReturnMessageDto(400, 'since is required');
}
const data = await this.blacklist.fetchBlacklist(since);
return new HamiResultDto(200, 'success', data);
}
......
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