fix: 后端代码格式化

This commit is contained in:
Tim
2025-09-18 14:42:25 +08:00
parent 70f7442f0c
commit 72b2b82e02
325 changed files with 15341 additions and 12370 deletions

View File

@@ -1,14 +1,14 @@
import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
import type { BaseLayoutProps } from "fumadocs-ui/layouts/shared";
/**
* Shared layout configurations
*/
export function baseOptions(): BaseLayoutProps {
return {
githubUrl: 'https://github.com/nagisa77/OpenIsle',
githubUrl: "https://github.com/nagisa77/OpenIsle",
nav: {
title: 'OpenIsle Docs',
url: '/',
title: "OpenIsle Docs",
url: "/",
},
searchToggle: {
enabled: false,

View File

@@ -1,4 +1,4 @@
'use client';
"use client";
// forward them so that Fumadocs can also use your media adapter in a client component
export { OpenIsleMediaAdapter } from './media-adapter';
export { OpenIsleMediaAdapter } from "./media-adapter";

View File

@@ -1,4 +1,4 @@
import type { MediaAdapter } from 'fumadocs-openapi';
import type { MediaAdapter } from "fumadocs-openapi";
export const OpenIsleMediaAdapter: MediaAdapter = {
encode(data) {
@@ -6,16 +6,16 @@ export const OpenIsleMediaAdapter: MediaAdapter = {
},
// returns code that inits a `body` variable, used for request body
generateExample(data, ctx) {
if (ctx.lang === 'js') {
if (ctx.lang === "js") {
return `const body = "hello world"`;
}
if (ctx.lang === 'python') {
if (ctx.lang === "python") {
return `body = "hello world"`;
}
if (ctx.lang === 'go' && 'addImport' in ctx) {
ctx.addImport('strings');
if (ctx.lang === "go" && "addImport" in ctx) {
ctx.addImport("strings");
return `body := strings.NewReader("hello world")`;
}

View File

@@ -1,5 +1,5 @@
import { createOpenAPI } from 'fumadocs-openapi/server';
import { createOpenAPI } from "fumadocs-openapi/server";
export const openapi = createOpenAPI({
input: ['https://staging.open-isle.com/api/v3/api-docs'],
input: ["https://staging.open-isle.com/api/v3/api-docs"],
});

View File

@@ -1,16 +1,16 @@
import { createElement } from 'react';
import { icons } from 'lucide-react';
import { loader } from 'fumadocs-core/source';
import { transformerOpenAPI } from 'fumadocs-openapi/server';
import { createOpenAPI } from 'fumadocs-openapi/server';
import { docs } from '@/.source';
import * as Adapters from './media-adapter';
import * as ClientAdapters from './media-adapter.client';
import { createElement } from "react";
import { icons } from "lucide-react";
import { loader } from "fumadocs-core/source";
import { transformerOpenAPI } from "fumadocs-openapi/server";
import { createOpenAPI } from "fumadocs-openapi/server";
import { docs } from "@/.source";
import * as Adapters from "./media-adapter";
import * as ClientAdapters from "./media-adapter.client";
// See https://fumadocs.vercel.app/docs/headless/source-api for more info
export const source = loader({
// it assigns a URL to your pages
baseUrl: '/',
baseUrl: "/",
source: docs.toFumadocsSource(),
pageTree: {
transformers: [transformerOpenAPI()],
@@ -26,10 +26,10 @@ export const source = loader({
});
export const openapi = createOpenAPI({
proxyUrl: '/api/proxy',
proxyUrl: "/api/proxy",
mediaAdapters: {
// override the default adapter of `application/json`
'application/json': {
"application/json": {
...Adapters.OpenIsleMediaAdapter,
client: ClientAdapters.OpenIsleMediaAdapter,
},