| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- /**
- * 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<RPetVo>({ url: `/pets/${id}`, method: "GET" });
- };
- /**
- * @summary 修改宠物信息
- */
- const update = (id: number, petDto: PetDto) => {
- return customAxiosInstance<RBoolean>({
- url: `/pets/${id}`,
- method: "PUT",
- headers: { "Content-Type": "application/json" },
- data: petDto,
- });
- };
- /**
- * @summary 删除宠物
- */
- const _delete = (id: number) => {
- return customAxiosInstance<RBoolean>({
- url: `/pets/${id}`,
- method: "DELETE",
- });
- };
- /**
- * @summary 获取当前用户宠物列表
- */
- const list = () => {
- return customAxiosInstance<RListPetVo>({ url: `/pets`, method: "GET" });
- };
- /**
- * @summary 新增宠物
- */
- const add1 = (petDto: PetDto) => {
- return customAxiosInstance<RPetVo>({
- url: `/pets`,
- method: "POST",
- headers: { "Content-Type": "application/json" },
- data: petDto,
- });
- };
- /**
- * @summary 获取疫苗记录
- */
- const getVaccinations = (id: number) => {
- return customAxiosInstance<RListVaccinationVo>({
- url: `/pets/${id}/vaccinations`,
- method: "GET",
- });
- };
- /**
- * @summary 新增疫苗记录
- */
- const addVaccination = (id: number, vaccinationDto: VaccinationDto) => {
- return customAxiosInstance<RVaccinationVo>({
- url: `/pets/${id}/vaccinations`,
- method: "POST",
- headers: { "Content-Type": "application/json" },
- data: vaccinationDto,
- });
- };
- /**
- * @summary 获取驱虫记录
- */
- const getDeworming = (id: number) => {
- return customAxiosInstance<RListDewormingVo>({
- url: `/pets/${id}/deworming`,
- method: "GET",
- });
- };
- /**
- * @summary 新增驱虫记录
- */
- const addDeworming = (id: number, dewormingDto: DewormingDto) => {
- return customAxiosInstance<RDewormingVo>({
- 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<ReturnType<ReturnType<typeof getPetController>["getById"]>>
- >;
- export type UpdateResult = NonNullable<
- Awaited<ReturnType<ReturnType<typeof getPetController>["update"]>>
- >;
- export type _DeleteResult = NonNullable<
- Awaited<ReturnType<ReturnType<typeof getPetController>["_delete"]>>
- >;
- export type ListResult = NonNullable<
- Awaited<ReturnType<ReturnType<typeof getPetController>["list"]>>
- >;
- export type Add1Result = NonNullable<
- Awaited<ReturnType<ReturnType<typeof getPetController>["add1"]>>
- >;
- export type GetVaccinationsResult = NonNullable<
- Awaited<ReturnType<ReturnType<typeof getPetController>["getVaccinations"]>>
- >;
- export type AddVaccinationResult = NonNullable<
- Awaited<ReturnType<ReturnType<typeof getPetController>["addVaccination"]>>
- >;
- export type GetDewormingResult = NonNullable<
- Awaited<ReturnType<ReturnType<typeof getPetController>["getDeworming"]>>
- >;
- export type AddDewormingResult = NonNullable<
- Awaited<ReturnType<ReturnType<typeof getPetController>["addDeworming"]>>
- >;
|