temp
This commit is contained in:
52
test/examples.ts
Normal file
52
test/examples.ts
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
|
||||||
|
import { createQueryApi } from '../src/query-api.ts';
|
||||||
|
const api = {
|
||||||
|
"app_domain_manager": {
|
||||||
|
/**
|
||||||
|
* 获取域名信息,可以通过id或者domain进行查询
|
||||||
|
*
|
||||||
|
* @param data - Request parameters
|
||||||
|
* @param data.data - {object}
|
||||||
|
*/
|
||||||
|
"get": {
|
||||||
|
"path": "app_domain_manager",
|
||||||
|
"key": "get",
|
||||||
|
"description": "获取域名信息,可以通过id或者domain进行查询",
|
||||||
|
"metadata": {
|
||||||
|
"args": {
|
||||||
|
"data": {
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"domain": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"viewItem": {
|
||||||
|
"api": {
|
||||||
|
"url": "/api/router"
|
||||||
|
},
|
||||||
|
"type": "api",
|
||||||
|
"title": "路由"
|
||||||
|
},
|
||||||
|
"url": "/api/router",
|
||||||
|
"source": "query-proxy-api"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} as const;
|
||||||
|
const queryApi = createQueryApi({ api });
|
||||||
|
export { queryApi };
|
||||||
|
|
||||||
|
queryApi.app_domain_manager.get({
|
||||||
|
data: {
|
||||||
|
id: '123',
|
||||||
|
domain: 'example.com'
|
||||||
|
}
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user