attachment-controller.ts 828 B

12345678910111213141516171819202122232425262728
  1. /**
  2. * Generated by orval v7.0.1 🍺
  3. * Do not edit manually.
  4. * Serve API
  5. * Serve应用接口文档
  6. * OpenAPI spec version: 0.0.1-SNAPSHOT
  7. */
  8. import type { ResponseUploadVo, UploadBody, UploadParams } from "./models";
  9. import { customAxiosInstance } from "../util/axios-instance";
  10. export const getAttachmentController = () => {
  11. /**
  12. * @summary 上传附件到OSS(需对接OSS配置)
  13. */
  14. const upload = (uploadBody: UploadBody, params?: UploadParams) => {
  15. return customAxiosInstance<ResponseUploadVo>({
  16. url: `/attachments/upload`,
  17. method: "POST",
  18. headers: { "Content-Type": "application/json" },
  19. data: uploadBody,
  20. params,
  21. });
  22. };
  23. return { upload };
  24. };
  25. export type UploadResult = NonNullable<
  26. Awaited<ReturnType<ReturnType<typeof getAttachmentController>["upload"]>>
  27. >;