♻️ 重构收藏数据库,更加beauty

This commit is contained in:
目棃
2024-03-20 02:25:51 +08:00
parent 66c6d3a3a5
commit 5d59245761
12 changed files with 609 additions and 187 deletions

View File

@@ -12,15 +12,17 @@ import TGUtils from "../utils/TGUtils";
* @description 获取用户收藏帖子
* @since Beta v0.4.5
* @param {Record<string, string>} cookie - 用户 cookie
* @param {string} uid - 用户 uid
* @param {string} offset - 偏移量
* @returns {Promise<TGApp.BBS.Collection.PostRespData|TGApp.BBS.Response.Base>} 用户收藏帖子
*/
export async function getUserCollect(
cookie: Record<string, string>,
uid: string,
offset: string = "",
): Promise<TGApp.BBS.Collection.PostRespData | TGApp.BBS.Response.Base> {
const url = "https://bbs-api.miyoushe.com/post/wapi/userFavouritePost";
const params = { size: "20", offset };
const params = { size: "20", uid, offset };
const header = TGUtils.User.getHeader(cookie, "GET", params, "common");
return await http
.fetch<TGApp.BBS.Collection.PostResponse | TGApp.BBS.Response.Base>(url, {