mirror of
https://github.com/jiangrui1994/CloudSaver.git
synced 2026-01-10 23:28:46 +08:00
24 lines
732 B
TypeScript
24 lines
732 B
TypeScript
import { Request, Response } from "express";
|
|
import { injectable, inject } from "inversify";
|
|
import { TYPES } from "../core/types";
|
|
import { Searcher } from "../services/Searcher";
|
|
import { BaseController } from "./BaseController";
|
|
|
|
@injectable()
|
|
export class ResourceController extends BaseController {
|
|
constructor(@inject(TYPES.Searcher) private searcher: Searcher) {
|
|
super();
|
|
}
|
|
|
|
async search(req: Request, res: Response): Promise<void> {
|
|
await this.handleRequest(req, res, async () => {
|
|
const { keyword, channelId = "", lastMessageId = "" } = req.query;
|
|
return await this.searcher.searchAll(
|
|
keyword as string,
|
|
channelId as string,
|
|
lastMessageId as string
|
|
);
|
|
});
|
|
}
|
|
}
|