You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
import http, { type EnumInfoDto } from "../api/index";
|
|
|
|
|
|
|
|
|
|
export interface Pill {
|
|
|
|
|
id: number;
|
|
|
|
|
name: string;
|
|
|
|
|
type?: number;
|
|
|
|
|
rarity?: number;
|
|
|
|
|
description: string;
|
|
|
|
|
requirdLevelId?: number;
|
|
|
|
|
effectValue?: number;
|
|
|
|
|
duration?: number;
|
|
|
|
|
icon?: string | null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取所有
|
|
|
|
|
export const GetPillList = (): Promise<Pill[]> => {
|
|
|
|
|
return http.get("pill/all");
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//添加丹药
|
|
|
|
|
export const AddPill = (data: Pill): Promise<boolean> => {
|
|
|
|
|
return http.post("pill", data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//修改丹药
|
|
|
|
|
export const UpdatePill = (data: Pill): Promise<boolean> => {
|
|
|
|
|
return http.put("pill", data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//删除丹药
|
|
|
|
|
export const DeletePill = (id: number): Promise<boolean> => {
|
|
|
|
|
return http.delete(`pill/${id}`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取丹药等级
|
|
|
|
|
export const getPillGrades = (): Promise<EnumInfoDto[]> => {
|
|
|
|
|
return http.get('pill/grades');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取丹药类型
|
|
|
|
|
export const getPillTypes = (): Promise<EnumInfoDto[]> => {
|
|
|
|
|
return http.get('pill/types');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取丹药稀有度
|
|
|
|
|
export const getPillRarities = (): Promise<EnumInfoDto[]> => {
|
|
|
|
|
return http.get('pill/rarities');
|
|
|
|
|
}
|