mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-18 10:18:14 +08:00
🎨 代码格式化
This commit is contained in:
@@ -11,9 +11,11 @@ import {
|
||||
AvatarUpRateApi,
|
||||
AvatarUseRateApi,
|
||||
DataUploadApi,
|
||||
OverviewApi, TeamCombinationApi,
|
||||
OverviewApi,
|
||||
TeamCombinationApi,
|
||||
UidCheckApi,
|
||||
UidRankApi, WeaponCollocationApi,
|
||||
UidRankApi,
|
||||
WeaponCollocationApi,
|
||||
} from "./abyss";
|
||||
|
||||
const HutaoApi = {
|
||||
|
||||
@@ -15,13 +15,15 @@ import HutaoApi from "../api";
|
||||
* @since Alpha v0.2.0
|
||||
* @return {Promise<TGApp.Plugins.Hutao.AbyssAvatarCollocation[]>}
|
||||
*/
|
||||
async function getAvatarCollect (): Promise<TGApp.Plugins.Hutao.AbyssAvatarCollocation[]> {
|
||||
async function getAvatarCollect(): Promise<TGApp.Plugins.Hutao.AbyssAvatarCollocation[]> {
|
||||
const url = HutaoApi.Abyss.avatar.collect;
|
||||
return await http.fetch<TGApp.Plugins.Hutao.AbyssAvatarCollocationResponse>(url, {
|
||||
method: "GET",
|
||||
}).then((res) => {
|
||||
return res.data.data;
|
||||
});
|
||||
return await http
|
||||
.fetch<TGApp.Plugins.Hutao.AbyssAvatarCollocationResponse>(url, {
|
||||
method: "GET",
|
||||
})
|
||||
.then((res) => {
|
||||
return res.data.data;
|
||||
});
|
||||
}
|
||||
|
||||
export default getAvatarCollect;
|
||||
|
||||
@@ -15,13 +15,15 @@ import HutaoApi from "../api";
|
||||
* @since Alpha v0.2.0
|
||||
* @returns {Promise<TGApp.Plugins.Hutao.AbyssAvatarHoldRate[]>}
|
||||
*/
|
||||
async function getAvatarHoldRate (): Promise<TGApp.Plugins.Hutao.AbyssAvatarHoldRate[]> {
|
||||
async function getAvatarHoldRate(): Promise<TGApp.Plugins.Hutao.AbyssAvatarHoldRate[]> {
|
||||
const url = HutaoApi.Abyss.avatar.holdRate;
|
||||
return await http.fetch<TGApp.Plugins.Hutao.AbyssAvatarHoldRateResponse>(url, {
|
||||
method: "GET",
|
||||
}).then((res) => {
|
||||
return res.data.data;
|
||||
});
|
||||
return await http
|
||||
.fetch<TGApp.Plugins.Hutao.AbyssAvatarHoldRateResponse>(url, {
|
||||
method: "GET",
|
||||
})
|
||||
.then((res) => {
|
||||
return res.data.data;
|
||||
});
|
||||
}
|
||||
|
||||
export default getAvatarHoldRate;
|
||||
|
||||
@@ -15,13 +15,15 @@ import HutaoApi from "../api";
|
||||
* @since Alpha v0.2.0
|
||||
* @return {Promise<TGApp.Plugins.Hutao.AbyssAvatarUpRate[]>}
|
||||
*/
|
||||
async function getAvatarUpRate (): Promise<TGApp.Plugins.Hutao.AbyssAvatarUpRate[]> {
|
||||
async function getAvatarUpRate(): Promise<TGApp.Plugins.Hutao.AbyssAvatarUpRate[]> {
|
||||
const url = HutaoApi.Abyss.avatar.upRate;
|
||||
return await http.fetch<TGApp.Plugins.Hutao.AbyssAvatarUpRateResponse>(url, {
|
||||
method: "GET",
|
||||
}).then((res) => {
|
||||
return res.data.data;
|
||||
});
|
||||
return await http
|
||||
.fetch<TGApp.Plugins.Hutao.AbyssAvatarUpRateResponse>(url, {
|
||||
method: "GET",
|
||||
})
|
||||
.then((res) => {
|
||||
return res.data.data;
|
||||
});
|
||||
}
|
||||
|
||||
export default getAvatarUpRate;
|
||||
|
||||
@@ -15,13 +15,15 @@ import HutaoApi from "../api";
|
||||
* @since Alpha v0.2.0
|
||||
* @return {Promise<TGApp.Plugins.Hutao.AbyssAvatarUseRate[]>}
|
||||
*/
|
||||
async function getAvatarUseRate (): Promise<TGApp.Plugins.Hutao.AbyssAvatarUseRate[]> {
|
||||
async function getAvatarUseRate(): Promise<TGApp.Plugins.Hutao.AbyssAvatarUseRate[]> {
|
||||
const url = HutaoApi.Abyss.avatar.useRate;
|
||||
return await http.fetch<TGApp.Plugins.Hutao.AbyssAvatarUseRateResponse>(url, {
|
||||
method: "GET",
|
||||
}).then((res) => {
|
||||
return res.data.data;
|
||||
});
|
||||
return await http
|
||||
.fetch<TGApp.Plugins.Hutao.AbyssAvatarUseRateResponse>(url, {
|
||||
method: "GET",
|
||||
})
|
||||
.then((res) => {
|
||||
return res.data.data;
|
||||
});
|
||||
}
|
||||
|
||||
export default getAvatarUseRate;
|
||||
|
||||
@@ -15,13 +15,15 @@ import HutaoApi from "../api";
|
||||
* @since Alpha v0.2.0
|
||||
* @return {Promise<TGApp.Plugins.Hutao.AbyssOverview>}
|
||||
*/
|
||||
async function getOverview (): Promise<TGApp.Plugins.Hutao.AbyssOverview> {
|
||||
async function getOverview(): Promise<TGApp.Plugins.Hutao.AbyssOverview> {
|
||||
const url = HutaoApi.Abyss.overview;
|
||||
return await http.fetch<TGApp.Plugins.Hutao.AbyssOverviewResponse>(url, {
|
||||
method: "GET",
|
||||
}).then((res) => {
|
||||
return res.data.data;
|
||||
});
|
||||
return await http
|
||||
.fetch<TGApp.Plugins.Hutao.AbyssOverviewResponse>(url, {
|
||||
method: "GET",
|
||||
})
|
||||
.then((res) => {
|
||||
return res.data.data;
|
||||
});
|
||||
}
|
||||
|
||||
export default getOverview;
|
||||
|
||||
@@ -15,13 +15,15 @@ import HutaoApi from "../api";
|
||||
* @since Alpha v0.2.0
|
||||
* @return {Promise<TGApp.Plugins.Hutao.AbyssTeamCombination[]>}
|
||||
*/
|
||||
async function getTeamCollect (): Promise<TGApp.Plugins.Hutao.AbyssTeamCombination[]> {
|
||||
async function getTeamCollect(): Promise<TGApp.Plugins.Hutao.AbyssTeamCombination[]> {
|
||||
const url = HutaoApi.Abyss.team;
|
||||
return await http.fetch<TGApp.Plugins.Hutao.AbyssTeamCombinationResponse>(url, {
|
||||
method: "GET",
|
||||
}).then((res) => {
|
||||
return res.data.data;
|
||||
});
|
||||
return await http
|
||||
.fetch<TGApp.Plugins.Hutao.AbyssTeamCombinationResponse>(url, {
|
||||
method: "GET",
|
||||
})
|
||||
.then((res) => {
|
||||
return res.data.data;
|
||||
});
|
||||
}
|
||||
|
||||
export default getTeamCollect;
|
||||
|
||||
@@ -17,13 +17,15 @@ import HutaoApi from "../api";
|
||||
* @param {string} uid
|
||||
* @return {Promise<boolean>}
|
||||
*/
|
||||
export async function checkUid (uid: string): Promise<boolean> {
|
||||
export async function checkUid(uid: string): Promise<boolean> {
|
||||
const url = HutaoApi.Abyss.user.check.replace("{uid}", uid);
|
||||
return await http.fetch<TGApp.Plugins.Hutao.AbyssRecordExistResponse>(url, {
|
||||
method: "GET",
|
||||
}).then((res) => {
|
||||
return res.data.data;
|
||||
});
|
||||
return await http
|
||||
.fetch<TGApp.Plugins.Hutao.AbyssRecordExistResponse>(url, {
|
||||
method: "GET",
|
||||
})
|
||||
.then((res) => {
|
||||
return res.data.data;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -33,11 +35,13 @@ export async function checkUid (uid: string): Promise<boolean> {
|
||||
* @param {string} uid
|
||||
* @return {Promise<TGApp.Plugins.Hutao.AbyssRecordRank>}
|
||||
*/
|
||||
export async function getUserData (uid: string): Promise<TGApp.Plugins.Hutao.AbyssRecordRank> {
|
||||
export async function getUserData(uid: string): Promise<TGApp.Plugins.Hutao.AbyssRecordRank> {
|
||||
const url = HutaoApi.Abyss.user.rank.replace("{uid}", uid);
|
||||
return await http.fetch<TGApp.Plugins.Hutao.AbyssRecordRankResponse>(url, {
|
||||
method: "GET",
|
||||
}).then((res) => {
|
||||
return res.data.data;
|
||||
});
|
||||
return await http
|
||||
.fetch<TGApp.Plugins.Hutao.AbyssRecordRankResponse>(url, {
|
||||
method: "GET",
|
||||
})
|
||||
.then((res) => {
|
||||
return res.data.data;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -15,13 +15,15 @@ import HutaoApi from "../api";
|
||||
* @since Alpha v0.2.0
|
||||
* @return {Promise<TGApp.Plugins.Hutao.AbyssWeaponCollocation[]>}
|
||||
*/
|
||||
async function getWeaponCollect (): Promise<TGApp.Plugins.Hutao.AbyssWeaponCollocation[]> {
|
||||
async function getWeaponCollect(): Promise<TGApp.Plugins.Hutao.AbyssWeaponCollocation[]> {
|
||||
const url = HutaoApi.Abyss.weapon;
|
||||
return await http.fetch<TGApp.Plugins.Hutao.AbyssWeaponCollocationResponse>(url, {
|
||||
method: "GET",
|
||||
}).then((res) => {
|
||||
return res.data.data;
|
||||
});
|
||||
return await http
|
||||
.fetch<TGApp.Plugins.Hutao.AbyssWeaponCollocationResponse>(url, {
|
||||
method: "GET",
|
||||
})
|
||||
.then((res) => {
|
||||
return res.data.data;
|
||||
});
|
||||
}
|
||||
|
||||
export default getWeaponCollect;
|
||||
|
||||
@@ -17,12 +17,14 @@ import HutaoApi from "../api";
|
||||
* @param {TGApp.Plugins.Hutao.AbyssRecordUpload} data 用户数据
|
||||
* @returns {Promise<unknown>} 上传结果
|
||||
*/
|
||||
async function uploadData (data: TGApp.Plugins.Hutao.AbyssRecordUpload): Promise<unknown> {
|
||||
async function uploadData(data: TGApp.Plugins.Hutao.AbyssRecordUpload): Promise<unknown> {
|
||||
const url = HutaoApi.Abyss.upload;
|
||||
return await http.fetch(url, {
|
||||
method: "POST",
|
||||
body: http.Body.json(data),
|
||||
}).then(res => res.data);
|
||||
return await http
|
||||
.fetch(url, {
|
||||
method: "POST",
|
||||
body: http.Body.json(data),
|
||||
})
|
||||
.then((res) => res.data);
|
||||
}
|
||||
|
||||
export default uploadData;
|
||||
|
||||
Reference in New Issue
Block a user