mirror of
https://github.com/jiangrui1994/CloudSaver.git
synced 2026-01-11 15:48:47 +08:00
format:format and fix code
This commit is contained in:
@@ -1,22 +1,9 @@
|
||||
import { Request, Response, NextFunction } from "express";
|
||||
import { RSSSearcher } from "../services/RSSSearcher";
|
||||
import { Request, Response } from "express";
|
||||
import Searcher from "../services/Searcher";
|
||||
import { sendSuccess, sendError } from "../utils/response";
|
||||
|
||||
export const resourceController = {
|
||||
async rssSearch(req: Request, res: Response, next: NextFunction) {
|
||||
try {
|
||||
const { keyword } = req.query;
|
||||
const searcher = new RSSSearcher();
|
||||
const result = await searcher.searchAll(keyword as string);
|
||||
sendSuccess(res, result);
|
||||
} catch (error) {
|
||||
sendError(res, {
|
||||
message: (error as Error).message || "RSS 搜索失败",
|
||||
});
|
||||
}
|
||||
},
|
||||
async search(req: Request, res: Response, next: NextFunction) {
|
||||
async search(req: Request, res: Response): Promise<void> {
|
||||
try {
|
||||
const { keyword, channelId = "", lastMessageId = "" } = req.query; // Remove `: string` from here
|
||||
const result = await Searcher.searchAll(
|
||||
|
||||
Reference in New Issue
Block a user