Skip to content

Commit

Permalink
refactor: generate api client and refactor http request (#121)
Browse files Browse the repository at this point in the history
使用 halo-sigs/halo-gradle-plugin#16 提供的 api client 生成方法生成 http 请求客户端代码,并重构插件的请求逻辑。

/kind improvement

```release-note
None
```
  • Loading branch information
ruibaby authored Aug 27, 2024
1 parent d8f5638 commit 4db48c9
Show file tree
Hide file tree
Showing 64 changed files with 6,925 additions and 1,556 deletions.
1,155 changes: 1,155 additions & 0 deletions api-docs/openapi/v3_0/momentsApi.json

Large diffs are not rendered by default.

25 changes: 24 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id "com.github.node-gradle.node" version "5.0.0"
id "io.freefair.lombok" version "8.0.0-rc2"
id "run.halo.plugin.devtools" version "0.0.7"
id "run.halo.plugin.devtools" version "0.1.1"
id 'java'
}

Expand Down Expand Up @@ -49,3 +49,26 @@ halo {
version = '2.17.0'
debug = true;
}


haloPlugin {
openApi {
outputDir = file("$rootDir/api-docs/openapi/v3_0")
groupingRules {
momentsApi {
displayName = 'Extension API for Moments Plugin'
pathsToMatch = [
'/apis/moment.halo.run/v1alpha1/**',
'/apis/console.api.moment.halo.run/v1alpha1/**',
'/apis/uc.api.moment.halo.run/v1alpha1/**'
]
}
}
groupedApiMappings = [
'/v3/api-docs/momentsApi': 'momentsApi.json'
]
generator {
outputDir = file("${projectDir}/console/src/api/generated")
}
}
}
61 changes: 30 additions & 31 deletions console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,56 +5,55 @@
"build": "vite build",
"preview": "vite preview --port 4173",
"test:unit": "vitest --environment jsdom",
"type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
"type-check": "vue-tsc --build --force",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"prettier": "prettier --write src/"
},
"dependencies": {
"@halo-dev/api-client": "^2.17.0",
"@halo-dev/components": "^1.10.0",
"@halo-dev/console-shared": "^2.11.0",
"@halo-dev/richtext-editor": "^2.12.0",
"@tanstack/vue-query": "^4.26.1",
"@tiptap/suggestion": "^2.1.13",
"@types/lodash.clonedeep": "^4.5.7",
"@types/lodash.debounce": "^4.0.7",
"@halo-dev/api-client": "^2.18.0",
"@halo-dev/components": "^2.18.0",
"@halo-dev/console-shared": "^2.18.0",
"@halo-dev/richtext-editor": "^2.18.0",
"@tanstack/vue-query": "^4.37.1",
"@tiptap/suggestion": "^2.5.9",
"@vueuse/core": "^9.13.0",
"@vueuse/router": "^10.0.2",
"axios": "^1.3.4",
"dayjs": "^1.11.7",
"@vueuse/router": "^10.11.1",
"axios": "^1.7.3",
"dayjs": "^1.11.12",
"floating-vue": "2.0.0-beta.20",
"highlight.js": "^11.7.0",
"lodash.clonedeep": "^4.5.0",
"lodash.debounce": "^4.0.8",
"highlight.js": "^11.10.0",
"lodash-es": "^4.17.21",
"tippy.js": "^6.3.7",
"vue": "^3.2.47",
"vue": "^3.4.37",
"vue-datepicker-next": "^1.0.3",
"vue-router": "^4.1.6"
"vue-router": "^4.4.3"
},
"devDependencies": {
"@halo-dev/ui-plugin-bundler-kit": "^2.17.0",
"@iconify/json": "^2.2.180",
"@rushstack/eslint-patch": "^1.2.0",
"@halo-dev/ui-plugin-bundler-kit": "^2.18.0",
"@iconify/json": "^2.2.235",
"@rushstack/eslint-patch": "^1.10.4",
"@tailwindcss/aspect-ratio": "^0.4.2",
"@types/jsdom": "^16.2.15",
"@types/node": "^16.18.14",
"@unocss/eslint-config": "^0.61.5",
"@vitejs/plugin-vue": "^4.5.1",
"@types/lodash-es": "^4.17.12",
"@types/node": "^20.14.9",
"@unocss/eslint-config": "^0.61.9",
"@vitejs/plugin-vue": "^5.1.2",
"@tsconfig/node20": "^20.1.4",
"@vue/eslint-config-prettier": "^7.1.0",
"@vue/eslint-config-typescript": "^10.0.0",
"@vue/test-utils": "^2.3.0",
"@vue/tsconfig": "^0.1.3",
"@vue/test-utils": "^2.4.6",
"@vue/tsconfig": "^0.5.1",
"eslint": "^8.57.0",
"eslint-plugin-vue": "^8.7.1",
"jsdom": "^19.0.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.4",
"sass": "^1.69.5",
"typescript": "~4.7.4",
"unocss": "^0.61.5",
"prettier": "^2.8.8",
"sass": "^1.77.8",
"typescript": "~5.5.4",
"unocss": "^0.61.9",
"unplugin-icons": "^0.15.3",
"vite": "^4.5.0",
"vite": "^5.4.0",
"vitest": "^0.13.1",
"vue-tsc": "^0.35.2"
"vue-tsc": "^2.0.24"
}
}
Loading

0 comments on commit 4db48c9

Please sign in to comment.