/** * Generated by orval v7.0.1 🍺 * Do not edit manually. * OpenAPI definition * OpenAPI spec version: v0 */ import type { DewormingDto, PetDto, RBoolean, RDewormingVo, RListDewormingVo, RListPetVo, RListVaccinationVo, RPetVo, RVaccinationVo, VaccinationDto, } from "./models"; import { customAxiosInstance } from "../util/axios-instance"; export const getPetController = () => { /** * @summary 获取宠物详情 */ const getById = (id: number) => { return customAxiosInstance({ url: `/pets/${id}`, method: "GET" }); }; /** * @summary 修改宠物信息 */ const update = (id: number, petDto: PetDto) => { return customAxiosInstance({ url: `/pets/${id}`, method: "PUT", headers: { "Content-Type": "application/json" }, data: petDto, }); }; /** * @summary 删除宠物 */ const _delete = (id: number) => { return customAxiosInstance({ url: `/pets/${id}`, method: "DELETE", }); }; /** * @summary 获取当前用户宠物列表 */ const list = () => { return customAxiosInstance({ url: `/pets`, method: "GET" }); }; /** * @summary 新增宠物 */ const add1 = (petDto: PetDto) => { return customAxiosInstance({ url: `/pets`, method: "POST", headers: { "Content-Type": "application/json" }, data: petDto, }); }; /** * @summary 获取疫苗记录 */ const getVaccinations = (id: number) => { return customAxiosInstance({ url: `/pets/${id}/vaccinations`, method: "GET", }); }; /** * @summary 新增疫苗记录 */ const addVaccination = (id: number, vaccinationDto: VaccinationDto) => { return customAxiosInstance({ url: `/pets/${id}/vaccinations`, method: "POST", headers: { "Content-Type": "application/json" }, data: vaccinationDto, }); }; /** * @summary 获取驱虫记录 */ const getDeworming = (id: number) => { return customAxiosInstance({ url: `/pets/${id}/deworming`, method: "GET", }); }; /** * @summary 新增驱虫记录 */ const addDeworming = (id: number, dewormingDto: DewormingDto) => { return customAxiosInstance({ url: `/pets/${id}/deworming`, method: "POST", headers: { "Content-Type": "application/json" }, data: dewormingDto, }); }; return { getById, update, _delete, list, add1, getVaccinations, addVaccination, getDeworming, addDeworming, }; }; export type GetByIdResult = NonNullable< Awaited["getById"]>> >; export type UpdateResult = NonNullable< Awaited["update"]>> >; export type _DeleteResult = NonNullable< Awaited["_delete"]>> >; export type ListResult = NonNullable< Awaited["list"]>> >; export type Add1Result = NonNullable< Awaited["add1"]>> >; export type GetVaccinationsResult = NonNullable< Awaited["getVaccinations"]>> >; export type AddVaccinationResult = NonNullable< Awaited["addVaccination"]>> >; export type GetDewormingResult = NonNullable< Awaited["getDeworming"]>> >; export type AddDewormingResult = NonNullable< Awaited["addDeworming"]>> >;