mirror of
https://github.com/jiangrui1994/CloudSaver.git
synced 2026-01-10 23:28:46 +08:00
feat:版本迭代
This commit is contained in:
22
backend/src/controllers/douban.ts
Normal file
22
backend/src/controllers/douban.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Request, Response, NextFunction } from "express";
|
||||
import DoubanService from "../services/DoubanService";
|
||||
import { sendSuccess, sendError } from "../utils/response";
|
||||
|
||||
const doubanService = new DoubanService();
|
||||
|
||||
export const doubanController = {
|
||||
async getDoubanHotList(req: Request, res: Response, next: NextFunction) {
|
||||
try {
|
||||
const { type = "movie", tag = "热门", page_limit = "50", page_start = "0" } = req.query;
|
||||
const result = await doubanService.getHotList({
|
||||
type: type as string,
|
||||
tag: tag as string,
|
||||
page_limit: page_limit as string,
|
||||
page_start: page_start as string,
|
||||
});
|
||||
sendSuccess(res, result);
|
||||
} catch (error) {
|
||||
sendError(res, { message: "获取热门列表失败" });
|
||||
}
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user