import { http } from "@/utils/http"; import { interfaceUrlApi } from "../utils"; export interface BasicResponseModel { code: number; msg: string; list: T; data: T; total: number; } /** * 获取接口列表 * @param query */ export const getIpInterfaceList = (query?: object) => { return http.get( interfaceUrlApi("ipInterface/list"), { params: query } ); }; /** * 新增或编辑接口 * @param data */ export const addOrEditIpInterface = (data?: object) => { return http.post( interfaceUrlApi("ipInterface/saveOrUpdate"), { data } ); }; /** * 删除接口 * @param id */ export const deleteIpInterface = (id: number) => { return http.request( "delete", interfaceUrlApi(`ipInterface/delete/${id}`) ); }; /** * 查询账号下关联的接口列表 * @param query */ export const getIpAccountInterfaceList = (query?: object) => { return http.post( interfaceUrlApi("ipInterface/account/ref/list"), { data: query } ); }; /** * 接口下拉列表 * @param query */ export const getIpInterfaceOptionList = (query?: object) => { return http.post( interfaceUrlApi("ipInterface/optionList"), { params: query } ); }; /** * 保存账号关联的接口 * @param data */ export const addOrEditIpAccountInterfaceRef = (data?: object) => { return http.post( interfaceUrlApi("ipInterface/interfaceConfig"), { data } ); }; /** * 切换接口状态 * @param data */ export const switchIpInterfaceStatus = (data?: object) => { return http.post( interfaceUrlApi(`ipInterface/switchStatus`), { data } ); }; /** * 切换账号关联的接口状态 * @param data */ export const switchIpAccountInterfaceStatus = (data?: object) => { return http.post( interfaceUrlApi(`ipInterface/account/interface/ref/switchStatus`), { data } ); }; /** * 生成token */ export const generateIpAccountToken = () => { return http.request( "post", interfaceUrlApi(`ipInterface/token/generate`) ); };