From b1fab440272c9eb5b717ee47d4d1087c135e06ea Mon Sep 17 00:00:00 2001 From: shikong <919411476@qq.com> Date: Sat, 17 Feb 2024 21:45:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=85=E5=B5=8C=20http=20=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + .idea/git_toolbox_prj.xml | 15 + .idea/inspectionProfiles/Project_Default.xml | 6 + .idea/jpa-buddy.xml | 6 + .idea/misc.xml | 9 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + .idea/wails-app-dock.iml | 10 + README.MD | 2 + frontend/src/App.vue | 4 +- frontend/wailsjs/go/core/App.d.ts | 9 + frontend/wailsjs/go/core/App.js | 15 + frontend/wailsjs/go/main/App.d.ts | 4 - frontend/wailsjs/go/main/App.js | 7 - go.mod | 49 ++- go.sum | 187 ++++++++- main.go | 29 +- pkg/config/config.go | 28 ++ pkg/config/toml/config.go | 50 +++ pkg/config/toml/toml_test.go | 10 + pkg/core/app.go | 132 ++++++ pkg/global/global.go | 5 + pkg/logger/adapter.go | 63 +++ pkg/logger/logger.go | 57 +++ pkg/logger/logger_test.go | 17 + pkg/pid/pid.go | 24 ++ pkg/pid/pid_test.go | 21 + pkg/pid/pid_unix.go | 36 ++ pkg/pid/pid_windows.go | 119 ++++++ pkg/server/controller/config.go | 22 + pkg/server/controller/file.go | 88 ++++ pkg/server/controller/wol.go | 43 ++ pkg/server/docs/docs.go | 409 +++++++++++++++++++ pkg/server/docs/swagger.json | 384 +++++++++++++++++ pkg/server/docs/swagger.yaml | 248 +++++++++++ pkg/server/init.go | 10 + pkg/server/main.go | 70 ++++ pkg/server/middleware/cors.go | 14 + pkg/server/middleware/error.go | 39 ++ pkg/server/router/error.go | 26 ++ pkg/server/router/router.go | 36 ++ pkg/server/router/swagger.go | 11 + pkg/server/server.go | 28 ++ pkg/server/services/wol/wol.go | 87 ++++ pkg/server/services/wol/wol_test.go | 92 +++++ pkg/utils/errorx/errorx.go | 59 +++ pkg/utils/idutils/sonyflake.go | 20 + pkg/utils/json/json.go | 10 + pkg/utils/resources/relativefs.go | 27 ++ pkg/utils/response/response.go | 40 ++ pkg/utils/time/time.go | 31 ++ pkg/utils/validator/validator.go | 44 ++ 52 files changed, 2729 insertions(+), 38 deletions(-) create mode 100644 .idea/git_toolbox_prj.xml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/jpa-buddy.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/wails-app-dock.iml create mode 100644 frontend/wailsjs/go/core/App.d.ts create mode 100644 frontend/wailsjs/go/core/App.js delete mode 100644 frontend/wailsjs/go/main/App.d.ts delete mode 100644 frontend/wailsjs/go/main/App.js create mode 100644 pkg/config/config.go create mode 100644 pkg/config/toml/config.go create mode 100644 pkg/config/toml/toml_test.go create mode 100644 pkg/core/app.go create mode 100644 pkg/global/global.go create mode 100644 pkg/logger/adapter.go create mode 100644 pkg/logger/logger.go create mode 100644 pkg/logger/logger_test.go create mode 100644 pkg/pid/pid.go create mode 100644 pkg/pid/pid_test.go create mode 100644 pkg/pid/pid_unix.go create mode 100644 pkg/pid/pid_windows.go create mode 100644 pkg/server/controller/config.go create mode 100644 pkg/server/controller/file.go create mode 100644 pkg/server/controller/wol.go create mode 100644 pkg/server/docs/docs.go create mode 100644 pkg/server/docs/swagger.json create mode 100644 pkg/server/docs/swagger.yaml create mode 100644 pkg/server/init.go create mode 100644 pkg/server/main.go create mode 100644 pkg/server/middleware/cors.go create mode 100644 pkg/server/middleware/error.go create mode 100644 pkg/server/router/error.go create mode 100644 pkg/server/router/router.go create mode 100644 pkg/server/router/swagger.go create mode 100644 pkg/server/server.go create mode 100644 pkg/server/services/wol/wol.go create mode 100644 pkg/server/services/wol/wol_test.go create mode 100644 pkg/utils/errorx/errorx.go create mode 100644 pkg/utils/idutils/sonyflake.go create mode 100644 pkg/utils/json/json.go create mode 100644 pkg/utils/resources/relativefs.go create mode 100644 pkg/utils/response/response.go create mode 100644 pkg/utils/time/time.go create mode 100644 pkg/utils/validator/validator.go diff --git a/.gitignore b/.gitignore index 0456ffc..36ff731 100644 --- a/.gitignore +++ b/.gitignore @@ -61,3 +61,4 @@ dist/ npm-debug.log yarn-error.log +./config.toml diff --git a/.idea/git_toolbox_prj.xml b/.idea/git_toolbox_prj.xml new file mode 100644 index 0000000..02b915b --- /dev/null +++ b/.idea/git_toolbox_prj.xml @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..03d9549 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/jpa-buddy.xml b/.idea/jpa-buddy.xml new file mode 100644 index 0000000..966d5f5 --- /dev/null +++ b/.idea/jpa-buddy.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..d79bd4e --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..0693dba --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/wails-app-dock.iml b/.idea/wails-app-dock.iml new file mode 100644 index 0000000..25ed3f6 --- /dev/null +++ b/.idea/wails-app-dock.iml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/README.MD b/README.MD index bbd0bd9..3000c65 100644 --- a/README.MD +++ b/README.MD @@ -13,3 +13,5 @@ wails init -n [项目名称] -t wails-vue3-template ```shell wails init -n [项目名称] -t https://github.com/misitebao/wails-template-vue ``` + +### 生成 wails binding diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 782564e..c8d999c 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,7 +1,7 @@