From b88abf5315e2262c3114def436981fd6b1cb8778 Mon Sep 17 00:00:00 2001 From: tx7do Date: Mon, 15 Jan 2024 21:59:49 +0800 Subject: [PATCH 1/2] feat: add Monolithic Application example, including frontend and backend. --- README-CN.md | 57 +- README.md | 44 +- monolithic/.gitignore | 21 + monolithic/LICENSE | 21 + monolithic/README.md | 4 + monolithic/backend/.gitignore | 35 + monolithic/backend/.markdownlint.yaml | 4 + monolithic/backend/.yamllint | 10 + monolithic/backend/Makefile | 95 + monolithic/backend/README.md | 89 + .../api/admin/service/v1/admin_error.proto | 34 + .../api/admin/service/v1/buf.openapi.gen.yaml | 35 + .../api/admin/service/v1/i_admin.proto | 148 + .../admin/service/v1/i_authentication.proto | 123 + .../backend/api/admin/service/v1/i_dict.proto | 70 + .../api/admin/service/v1/i_dict_detail.proto | 70 + .../backend/api/admin/service/v1/i_menu.proto | 70 + .../api/admin/service/v1/i_organization.proto | 70 + .../api/admin/service/v1/i_position.proto | 70 + .../backend/api/admin/service/v1/i_role.proto | 70 + .../api/admin/service/v1/i_router.proto | 78 + .../backend/api/admin/service/v1/i_user.proto | 70 + monolithic/backend/api/buf.lock | 33 + monolithic/backend/api/buf.yaml | 20 + .../api/file/service/v1/attachment.proto | 73 + .../backend/api/system/service/v1/dict.proto | 70 + .../api/system/service/v1/dict_detail.proto | 75 + .../backend/api/system/service/v1/menu.proto | 111 + .../api/user/service/v1/organization.proto | 73 + .../api/user/service/v1/position.proto | 74 + .../backend/api/user/service/v1/role.proto | 74 + .../backend/api/user/service/v1/user.proto | 165 + .../api/user/service/v1/user_error.proto | 24 + monolithic/backend/app.mk | 121 + monolithic/backend/app/admin/service/Makefile | 1 + .../backend/app/admin/service/README.md | 1 + .../admin/service/cmd/server/assets/assets.go | 6 + .../service/cmd/server/assets/openapi.yaml | 1825 ++++ .../app/admin/service/cmd/server/main.go | 50 + .../app/admin/service/cmd/server/wire.go | 25 + .../app/admin/service/cmd/server/wire_gen.go | 53 + .../app/admin/service/configs/data.yaml | 16 + .../app/admin/service/configs/logger.yaml | 31 + .../app/admin/service/configs/registry.yaml | 52 + .../app/admin/service/configs/remote.yaml | 7 + .../app/admin/service/configs/trace.yaml | 6 + .../app/admin/service/configs/transport.yaml | 47 + .../app/admin/service/internal/data/README.md | 1 + .../app/admin/service/internal/data/data.go | 77 + .../app/admin/service/internal/data/dict.go | 152 + .../service/internal/data/dict_detail.go | 158 + .../admin/service/internal/data/ent/client.go | 1319 +++ .../admin/service/internal/data/ent/dict.go | 180 + .../service/internal/data/ent/dict/dict.go | 92 + .../service/internal/data/ent/dict/where.go | 450 + .../service/internal/data/ent/dict_create.go | 871 ++ .../service/internal/data/ent/dict_delete.go | 88 + .../service/internal/data/ent/dict_query.go | 548 + .../service/internal/data/ent/dict_update.go | 478 + .../service/internal/data/ent/dictdetail.go | 208 + .../data/ent/dictdetail/dictdetail.go | 112 + .../internal/data/ent/dictdetail/where.go | 555 + .../internal/data/ent/dictdetail_create.go | 1081 ++ .../internal/data/ent/dictdetail_delete.go | 88 + .../internal/data/ent/dictdetail_query.go | 548 + .../internal/data/ent/dictdetail_update.go | 622 ++ .../admin/service/internal/data/ent/ent.go | 620 ++ .../admin/service/internal/data/ent/entql.go | 1138 ++ .../internal/data/ent/enttest/enttest.go | 84 + .../service/internal/data/ent/hook/hook.go | 270 + .../admin/service/internal/data/ent/menu.go | 468 + .../service/internal/data/ent/menu/menu.go | 355 + .../service/internal/data/ent/menu/where.go | 1287 +++ .../service/internal/data/ent/menu_create.go | 2346 ++++ .../service/internal/data/ent/menu_delete.go | 88 + .../service/internal/data/ent/menu_query.go | 706 ++ .../service/internal/data/ent/menu_update.go | 1695 +++ .../internal/data/ent/migrate/migrate.go | 64 + .../internal/data/ent/migrate/schema.go | 301 + .../service/internal/data/ent/mutation.go | 9579 +++++++++++++++++ .../service/internal/data/ent/organization.go | 268 + .../data/ent/organization/organization.go | 200 + .../internal/data/ent/organization/where.go | 617 ++ .../internal/data/ent/organization_create.go | 1206 +++ .../internal/data/ent/organization_delete.go | 88 + .../internal/data/ent/organization_query.go | 706 ++ .../internal/data/ent/organization_update.go | 920 ++ .../service/internal/data/ent/position.go | 270 + .../internal/data/ent/position/position.go | 214 + .../internal/data/ent/position/where.go | 667 ++ .../internal/data/ent/position_create.go | 1246 +++ .../internal/data/ent/position_delete.go | 88 + .../internal/data/ent/position_query.go | 700 ++ .../internal/data/ent/position_update.go | 928 ++ .../internal/data/ent/predicate/predicate.go | 28 + .../internal/data/ent/privacy/privacy.go | 354 + .../admin/service/internal/data/ent/role.go | 282 + .../service/internal/data/ent/role/role.go | 210 + .../service/internal/data/ent/role/where.go | 697 ++ .../service/internal/data/ent/role_create.go | 1289 +++ .../service/internal/data/ent/role_delete.go | 88 + .../service/internal/data/ent/role_query.go | 706 ++ .../service/internal/data/ent/role_update.go | 982 ++ .../service/internal/data/ent/runtime.go | 308 + .../internal/data/ent/runtime/runtime.go | 10 + .../service/internal/data/ent/schema/dict.go | 51 + .../internal/data/ent/schema/dict_detail.go | 62 + .../service/internal/data/ent/schema/menu.go | 172 + .../internal/data/ent/schema/organization.go | 73 + .../internal/data/ent/schema/position.go | 72 + .../service/internal/data/ent/schema/role.go | 76 + .../service/internal/data/ent/schema/user.go | 169 + .../app/admin/service/internal/data/ent/tx.go | 228 + .../admin/service/internal/data/ent/user.go | 404 + .../service/internal/data/ent/user/user.go | 326 + .../service/internal/data/ent/user/where.go | 1455 +++ .../service/internal/data/ent/user_create.go | 2256 ++++ .../service/internal/data/ent/user_delete.go | 88 + .../service/internal/data/ent/user_query.go | 548 + .../service/internal/data/ent/user_update.go | 1500 +++ .../admin/service/internal/data/ent_client.go | 48 + .../app/admin/service/internal/data/init.go | 26 + .../app/admin/service/internal/data/menu.go | 240 + .../service/internal/data/organization.go | 203 + .../admin/service/internal/data/position.go | 156 + .../app/admin/service/internal/data/role.go | 156 + .../app/admin/service/internal/data/user.go | 279 + .../admin/service/internal/data/user_test.go | 101 + .../admin/service/internal/data/user_token.go | 177 + .../admin/service/internal/server/asynq.go | 30 + .../app/admin/service/internal/server/init.go | 14 + .../app/admin/service/internal/server/rest.go | 89 + .../admin/service/internal/service/README.md | 1 + .../internal/service/authentication.go | 104 + .../admin/service/internal/service/dict.go | 77 + .../service/internal/service/dict_detail.go | 90 + .../admin/service/internal/service/init.go | 22 + .../admin/service/internal/service/menu.go | 81 + .../service/internal/service/organization.go | 67 + .../service/internal/service/position.go | 66 + .../admin/service/internal/service/role.go | 65 + .../admin/service/internal/service/router.go | 91 + .../admin/service/internal/service/task.go | 36 + .../admin/service/internal/service/user.go | 101 + monolithic/backend/buf.gen.yaml | 50 + monolithic/backend/buf.lock | 2 + monolithic/backend/buf.work.yaml | 4 + monolithic/backend/buf.yaml | 9 + .../api/go/admin/service/v1/admin_error.pb.go | 235 + .../service/v1/admin_error.pb.validate.go | 36 + .../admin/service/v1/admin_error_errors.pb.go | 300 + .../gen/api/go/admin/service/v1/i_admin.pb.go | 118 + .../admin/service/v1/i_admin.pb.validate.go | 36 + .../admin/service/v1/i_authentication.pb.go | 639 ++ .../v1/i_authentication.pb.validate.go | 672 ++ .../service/v1/i_authentication_grpc.pb.go | 230 + .../service/v1/i_authentication_http.pb.go | 198 + .../gen/api/go/admin/service/v1/i_dict.pb.go | 152 + .../go/admin/service/v1/i_dict.pb.validate.go | 36 + .../go/admin/service/v1/i_dict_detail.pb.go | 161 + .../service/v1/i_dict_detail.pb.validate.go | 36 + .../admin/service/v1/i_dict_detail_grpc.pb.go | 270 + .../admin/service/v1/i_dict_detail_http.pb.go | 242 + .../api/go/admin/service/v1/i_dict_grpc.pb.go | 270 + .../api/go/admin/service/v1/i_dict_http.pb.go | 242 + .../gen/api/go/admin/service/v1/i_menu.pb.go | 152 + .../go/admin/service/v1/i_menu.pb.validate.go | 36 + .../api/go/admin/service/v1/i_menu_grpc.pb.go | 270 + .../api/go/admin/service/v1/i_menu_http.pb.go | 242 + .../go/admin/service/v1/i_organization.pb.go | 159 + .../service/v1/i_organization.pb.validate.go | 36 + .../service/v1/i_organization_grpc.pb.go | 270 + .../service/v1/i_organization_http.pb.go | 242 + .../api/go/admin/service/v1/i_position.pb.go | 157 + .../service/v1/i_position.pb.validate.go | 36 + .../go/admin/service/v1/i_position_grpc.pb.go | 270 + .../go/admin/service/v1/i_position_http.pb.go | 242 + .../gen/api/go/admin/service/v1/i_role.pb.go | 151 + .../go/admin/service/v1/i_role.pb.validate.go | 36 + .../api/go/admin/service/v1/i_role_grpc.pb.go | 270 + .../api/go/admin/service/v1/i_role_http.pb.go | 242 + .../api/go/admin/service/v1/i_router.pb.go | 682 ++ .../admin/service/v1/i_router.pb.validate.go | 643 ++ .../go/admin/service/v1/i_router_grpc.pb.go | 151 + .../go/admin/service/v1/i_router_http.pb.go | 114 + .../gen/api/go/admin/service/v1/i_user.pb.go | 152 + .../go/admin/service/v1/i_user.pb.validate.go | 36 + .../api/go/admin/service/v1/i_user_grpc.pb.go | 270 + .../api/go/admin/service/v1/i_user_http.pb.go | 242 + .../api/go/file/service/v1/attachment.pb.go | 726 ++ .../file/service/v1/attachment.pb.validate.go | 811 ++ .../go/file/service/v1/attachment_grpc.pb.go | 269 + .../gen/api/go/system/service/v1/dict.pb.go | 668 ++ .../go/system/service/v1/dict.pb.validate.go | 784 ++ .../go/system/service/v1/dict_detail.pb.go | 708 ++ .../service/v1/dict_detail.pb.validate.go | 797 ++ .../system/service/v1/dict_detail_grpc.pb.go | 306 + .../api/go/system/service/v1/dict_grpc.pb.go | 269 + .../gen/api/go/system/service/v1/menu.pb.go | 913 ++ .../go/system/service/v1/menu.pb.validate.go | 878 ++ .../api/go/system/service/v1/menu_grpc.pb.go | 269 + .../api/go/user/service/v1/organization.pb.go | 684 ++ .../service/v1/organization.pb.validate.go | 823 ++ .../user/service/v1/organization_grpc.pb.go | 269 + .../gen/api/go/user/service/v1/position.pb.go | 677 ++ .../user/service/v1/position.pb.validate.go | 793 ++ .../go/user/service/v1/position_grpc.pb.go | 269 + .../gen/api/go/user/service/v1/role.pb.go | 670 ++ .../go/user/service/v1/role.pb.validate.go | 788 ++ .../api/go/user/service/v1/role_grpc.pb.go | 269 + .../gen/api/go/user/service/v1/user.pb.go | 1364 +++ .../go/user/service/v1/user.pb.validate.go | 1387 +++ .../api/go/user/service/v1/user_error.pb.go | 168 + .../user/service/v1/user_error.pb.validate.go | 36 + .../user/service/v1/user_error_errors.pb.go | 110 + .../api/go/user/service/v1/user_grpc.pb.go | 386 + monolithic/backend/go.mod | 229 + monolithic/backend/go.sum | 2533 +++++ monolithic/backend/pkg/README.md | 1 + .../backend/pkg/middleware/auth/auth.go | 68 + .../backend/pkg/middleware/auth/errors.go | 13 + monolithic/backend/pkg/service/name.go | 5 + monolithic/backend/script/prepare_centos.sh | 73 + monolithic/backend/script/prepare_ubuntu.sh | 72 + monolithic/backend/sql/default-data.sql | 4 + monolithic/backend/sql/demo-data.sql | 23 + monolithic/frontend/.editorconfig | 19 + monolithic/frontend/.env | 8 + monolithic/frontend/.env.development | 18 + monolithic/frontend/.env.production | 32 + monolithic/frontend/.eslintignore | 15 + monolithic/frontend/.eslintrc.yml | 69 + monolithic/frontend/.gitignore | 33 + monolithic/frontend/.gitpod.yml | 6 + monolithic/frontend/.prettierignore | 9 + monolithic/frontend/.stylelintignore | 3 + monolithic/frontend/LICENSE | 21 + monolithic/frontend/README.md | 27 + .../frontend/build/config/themeConfig.ts | 79 + monolithic/frontend/build/constant.ts | 6 + .../build/generate/generateModifyVars.ts | 37 + .../frontend/build/generate/icon/index.ts | 72 + .../frontend/build/getConfigFileName.ts | 9 + monolithic/frontend/build/script/buildConf.ts | 47 + monolithic/frontend/build/script/postBuild.ts | 23 + monolithic/frontend/build/utils.ts | 92 + .../frontend/build/vite/plugin/compress.ts | 35 + monolithic/frontend/build/vite/plugin/html.ts | 40 + .../frontend/build/vite/plugin/imagemin.ts | 34 + .../frontend/build/vite/plugin/index.ts | 77 + monolithic/frontend/build/vite/plugin/pwa.ts | 33 + .../frontend/build/vite/plugin/styleImport.ts | 81 + .../frontend/build/vite/plugin/svgSprite.ts | 17 + .../frontend/build/vite/plugin/theme.ts | 89 + .../frontend/build/vite/plugin/visualizer.ts | 17 + monolithic/frontend/build/vite/proxy.ts | 34 + monolithic/frontend/commitlint.config.js | 107 + monolithic/frontend/index.html | 159 + monolithic/frontend/package.json | 188 + monolithic/frontend/postcss.config.js | 5 + monolithic/frontend/prettier.config.js | 10 + monolithic/frontend/public/favicon.ico | Bin 0 -> 4286 bytes .../frontend/public/resource/img/logo.png | Bin 0 -> 4042 bytes .../public/resource/img/pwa-192x192.png | Bin 0 -> 12205 bytes .../public/resource/img/pwa-512x512.png | Bin 0 -> 52656 bytes .../public/resource/tinymce/langs/en.js | 419 + .../public/resource/tinymce/langs/zh_CN.js | 389 + .../ui/oxide-dark/content.inline.min.css | 239 + .../skins/ui/oxide-dark/content.min.css | 235 + .../ui/oxide-dark/content.mobile.min.css | 17 + .../tinymce/skins/ui/oxide-dark/skin.min.css | 875 ++ .../skins/ui/oxide-dark/skin.mobile.min.css | 239 + .../skins/ui/oxide/content.inline.min.css | 239 + .../tinymce/skins/ui/oxide/content.min.css | 235 + .../skins/ui/oxide/content.mobile.min.css | 17 + .../skins/ui/oxide/fonts/tinymce-mobile.woff | Bin 0 -> 4624 bytes .../tinymce/skins/ui/oxide/skin.min.css | 875 ++ .../skins/ui/oxide/skin.mobile.min.css | 239 + monolithic/frontend/src/App.vue | 21 + .../frontend/src/api/app/authentication.ts | 30 + monolithic/frontend/src/api/app/index.ts | 14 + monolithic/frontend/src/api/app/menu.ts | 65 + .../frontend/src/api/app/organization.ts | 65 + monolithic/frontend/src/api/app/position.ts | 65 + monolithic/frontend/src/api/app/role.ts | 65 + monolithic/frontend/src/api/app/user.ts | 65 + monolithic/frontend/src/api/sys/routes.ts | 0 monolithic/frontend/src/api/sys/upload.ts | 27 + .../src/assets/icons/comment-count.svg | 1 + .../src/assets/icons/download-count.svg | 1 + .../src/assets/icons/dynamic-avatar-1.svg | 1 + .../src/assets/icons/dynamic-avatar-2.svg | 1 + .../src/assets/icons/dynamic-avatar-3.svg | 1 + .../src/assets/icons/dynamic-avatar-4.svg | 1 + .../src/assets/icons/dynamic-avatar-5.svg | 1 + .../src/assets/icons/dynamic-avatar-6.svg | 1 + monolithic/frontend/src/assets/icons/moon.svg | 16 + .../frontend/src/assets/icons/post-count.svg | 1 + .../frontend/src/assets/icons/posts.svg | 1 + .../src/assets/icons/reading-count.svg | 1 + monolithic/frontend/src/assets/icons/sun.svg | 42 + monolithic/frontend/src/assets/icons/test.svg | 21 + .../frontend/src/assets/icons/visit-count.svg | 1 + .../frontend/src/assets/images/demo.png | Bin 0 -> 33342 bytes .../frontend/src/assets/images/header.jpg | Bin 0 -> 16880 bytes .../frontend/src/assets/images/logo.png | Bin 0 -> 28304 bytes .../frontend/src/assets/svg/illustration.svg | 1 + .../frontend/src/assets/svg/login-bg-dark.svg | 19 + .../frontend/src/assets/svg/login-bg.svg | 17 + .../frontend/src/assets/svg/login-box-bg.svg | 1 + .../frontend/src/assets/svg/net-error.svg | 1 + .../frontend/src/assets/svg/no-data.svg | 1 + .../src/assets/svg/preview/p-rotate.svg | 1 + .../src/assets/svg/preview/resume.svg | 1 + .../frontend/src/assets/svg/preview/scale.svg | 1 + .../src/assets/svg/preview/unrotate.svg | 1 + .../src/assets/svg/preview/unscale.svg | 1 + .../src/components/Application/index.ts | 15 + .../Application/src/AppDarkModeToggle.vue | 76 + .../Application/src/AppLocalePicker.vue | 76 + .../components/Application/src/AppLogo.vue | 94 + .../Application/src/AppProvider.vue | 82 + .../Application/src/search/AppSearch.vue | 33 + .../src/search/AppSearchFooter.vue | 56 + .../src/search/AppSearchKeyItem.vue | 11 + .../Application/src/search/AppSearchModal.vue | 267 + .../Application/src/search/useMenuSearch.ts | 166 + .../Application/src/useAppContext.ts | 17 + .../src/components/Authority/index.ts | 4 + .../components/Authority/src/Authority.vue | 45 + .../frontend/src/components/Basic/index.ts | 8 + .../src/components/Basic/src/BasicArrow.vue | 84 + .../src/components/Basic/src/BasicHelp.vue | 114 + .../src/components/Basic/src/BasicTitle.vue | 76 + .../frontend/src/components/Button/index.ts | 9 + .../src/components/Button/src/BasicButton.vue | 40 + .../Button/src/PopConfirmButton.vue | 54 + .../src/components/Button/src/props.ts | 19 + .../frontend/src/components/CardList/index.ts | 4 + .../src/components/CardList/src/CardList.vue | 177 + .../src/components/CardList/src/data.ts | 25 + .../src/components/ClickOutSide/index.ts | 4 + .../ClickOutSide/src/ClickOutSide.vue | 19 + .../src/components/CodeEditor/index.ts | 8 + .../components/CodeEditor/src/CodeEditor.vue | 54 + .../CodeEditor/src/codemirror/CodeMirror.vue | 113 + .../CodeEditor/src/codemirror/codeMirror.ts | 21 + .../CodeEditor/src/codemirror/codemirror.css | 525 + .../src/json-preview/JsonPreview.vue | 12 + .../src/components/CodeEditor/src/typing.ts | 5 + .../src/components/Container/index.ts | 10 + .../Container/src/LazyContainer.vue | 145 + .../Container/src/ScrollContainer.vue | 93 + .../src/collapse/CollapseContainer.vue | 110 + .../Container/src/collapse/CollapseHeader.vue | 38 + .../src/components/Container/src/typing.ts | 17 + .../src/components/ContextMenu/index.ts | 3 + .../ContextMenu/src/ContextMenu.vue | 209 + .../ContextMenu/src/createContextMenu.ts | 75 + .../src/components/ContextMenu/src/typing.ts | 36 + .../src/components/CountDown/index.ts | 6 + .../components/CountDown/src/CountButton.vue | 62 + .../CountDown/src/CountdownInput.vue | 54 + .../components/CountDown/src/useCountdown.ts | 51 + .../frontend/src/components/CountTo/index.ts | 4 + .../src/components/CountTo/src/CountTo.vue | 110 + .../frontend/src/components/Cropper/index.ts | 7 + .../components/Cropper/src/CopperModal.vue | 283 + .../src/components/Cropper/src/Cropper.vue | 188 + .../components/Cropper/src/CropperAvatar.vue | 161 + .../src/components/Cropper/src/typing.ts | 8 + .../src/components/Description/index.ts | 6 + .../Description/src/Description.vue | 184 + .../src/components/Description/src/typing.ts | 50 + .../Description/src/useDescription.ts | 28 + .../frontend/src/components/Drawer/index.ts | 6 + .../src/components/Drawer/src/BasicDrawer.vue | 256 + .../Drawer/src/components/DrawerFooter.vue | 82 + .../Drawer/src/components/DrawerHeader.vue | 74 + .../src/components/Drawer/src/props.ts | 44 + .../src/components/Drawer/src/typing.ts | 193 + .../src/components/Drawer/src/useDrawer.ts | 161 + .../frontend/src/components/Dropdown/index.ts | 5 + .../src/components/Dropdown/src/Dropdown.vue | 96 + .../src/components/Dropdown/src/typing.ts | 9 + .../frontend/src/components/Excel/index.ts | 8 + .../src/components/Excel/src/Export2Excel.ts | 59 + .../components/Excel/src/ExportExcelModal.vue | 91 + .../src/components/Excel/src/ImportExcel.vue | 166 + .../src/components/Excel/src/typing.ts | 27 + .../src/components/FlowChart/index.ts | 4 + .../components/FlowChart/src/FlowChart.vue | 158 + .../FlowChart/src/FlowChartToolbar.vue | 162 + .../FlowChart/src/adpterForTurbo.ts | 75 + .../src/components/FlowChart/src/config.ts | 96 + .../src/components/FlowChart/src/enum.ts | 11 + .../src/components/FlowChart/src/types.ts | 14 + .../FlowChart/src/useFlowContext.ts | 17 + .../frontend/src/components/Form/index.ts | 17 + .../src/components/Form/src/BasicForm.vue | 353 + .../src/components/Form/src/componentMap.ts | 83 + .../Form/src/components/ApiCascader.vue | 198 + .../Form/src/components/ApiRadioGroup.vue | 130 + .../Form/src/components/ApiSelect.vue | 147 + .../Form/src/components/ApiTransfer.vue | 135 + .../Form/src/components/ApiTree.vue | 90 + .../Form/src/components/ApiTreeSelect.vue | 86 + .../Form/src/components/FormAction.vue | 135 + .../Form/src/components/FormItem.vue | 392 + .../Form/src/components/RadioButtonGroup.vue | 57 + .../src/components/Form/src/helper.ts | 74 + .../components/Form/src/hooks/useAdvanced.ts | 170 + .../components/Form/src/hooks/useAutoFocus.ts | 40 + .../Form/src/hooks/useComponentRegister.ts | 11 + .../src/components/Form/src/hooks/useForm.ts | 122 + .../Form/src/hooks/useFormContext.ts | 17 + .../Form/src/hooks/useFormEvents.ts | 314 + .../Form/src/hooks/useFormValues.ts | 131 + .../Form/src/hooks/useLabelWidth.ts | 42 + .../frontend/src/components/Form/src/props.ts | 103 + .../src/components/Form/src/types/form.ts | 223 + .../src/components/Form/src/types/formItem.ts | 91 + .../src/components/Form/src/types/hooks.ts | 6 + .../src/components/Form/src/types/index.ts | 117 + .../src/components/Icon/data/icons.data.ts | 793 ++ .../frontend/src/components/Icon/index.ts | 7 + .../frontend/src/components/Icon/src/Icon.vue | 121 + .../src/components/Icon/src/IconPicker.vue | 191 + .../src/components/Icon/src/SvgIcon.vue | 65 + .../frontend/src/components/Loading/index.ts | 5 + .../src/components/Loading/src/Loading.vue | 79 + .../components/Loading/src/createLoading.ts | 65 + .../src/components/Loading/src/typing.ts | 10 + .../src/components/Loading/src/useLoading.ts | 49 + .../frontend/src/components/Markdown/index.ts | 7 + .../src/components/Markdown/src/Markdown.vue | 158 + .../Markdown/src/MarkdownViewer.vue | 62 + .../src/components/Markdown/src/getTheme.ts | 19 + .../src/components/Markdown/src/typing.ts | 4 + .../frontend/src/components/Menu/index.ts | 3 + .../src/components/Menu/src/BasicMenu.vue | 164 + .../Menu/src/components/BasicMenuItem.vue | 20 + .../Menu/src/components/BasicSubMenuItem.vue | 55 + .../Menu/src/components/MenuItemContent.vue | 34 + .../src/components/Menu/src/index.less | 74 + .../frontend/src/components/Menu/src/props.ts | 60 + .../frontend/src/components/Menu/src/types.ts | 25 + .../src/components/Menu/src/useOpenKeys.ts | 83 + .../frontend/src/components/Modal/index.ts | 8 + .../src/components/Modal/src/BasicModal.vue | 242 + .../components/Modal/src/components/Modal.tsx | 31 + .../Modal/src/components/ModalClose.vue | 106 + .../Modal/src/components/ModalFooter.vue | 40 + .../Modal/src/components/ModalHeader.vue | 22 + .../Modal/src/components/ModalWrapper.vue | 169 + .../components/Modal/src/hooks/useModal.ts | 163 + .../Modal/src/hooks/useModalContext.ts | 16 + .../Modal/src/hooks/useModalDrag.ts | 107 + .../Modal/src/hooks/useModalFullScreen.ts | 43 + .../src/components/Modal/src/index.less | 127 + .../src/components/Modal/src/props.ts | 83 + .../src/components/Modal/src/typing.ts | 209 + .../frontend/src/components/Page/index.ts | 9 + .../src/components/Page/src/PageFooter.vue | 50 + .../src/components/Page/src/PageWrapper.vue | 191 + .../frontend/src/components/Preview/index.ts | 2 + .../src/components/Preview/src/Functional.vue | 546 + .../src/components/Preview/src/Preview.vue | 94 + .../src/components/Preview/src/functional.ts | 17 + .../src/components/Preview/src/typing.ts | 49 + .../frontend/src/components/Qrcode/index.ts | 5 + .../src/components/Qrcode/src/Qrcode.vue | 112 + .../src/components/Qrcode/src/drawCanvas.ts | 37 + .../src/components/Qrcode/src/drawLogo.ts | 88 + .../src/components/Qrcode/src/qrcodePlus.ts | 4 + .../src/components/Qrcode/src/toCanvas.ts | 10 + .../src/components/Qrcode/src/typing.ts | 38 + .../src/components/Scrollbar/index.ts | 8 + .../components/Scrollbar/src/Scrollbar.vue | 206 + .../src/components/Scrollbar/src/bar.ts | 110 + .../src/components/Scrollbar/src/types.d.ts | 18 + .../src/components/Scrollbar/src/util.ts | 50 + .../src/components/SimpleMenu/index.ts | 2 + .../components/SimpleMenu/src/SimpleMenu.vue | 160 + .../SimpleMenu/src/SimpleMenuTag.vue | 68 + .../SimpleMenu/src/SimpleSubMenu.vue | 116 + .../SimpleMenu/src/components/Menu.vue | 158 + .../src/components/MenuCollapseTransition.vue | 78 + .../SimpleMenu/src/components/MenuItem.vue | 107 + .../SimpleMenu/src/components/SubMenuItem.vue | 334 + .../SimpleMenu/src/components/menu.less | 309 + .../SimpleMenu/src/components/types.ts | 25 + .../SimpleMenu/src/components/useMenu.ts | 84 + .../src/components/useSimpleMenuContext.ts | 18 + .../src/components/SimpleMenu/src/index.less | 77 + .../src/components/SimpleMenu/src/types.ts | 5 + .../components/SimpleMenu/src/useOpenKeys.ts | 50 + .../src/components/StrengthMeter/index.ts | 4 + .../StrengthMeter/src/StrengthMeter.vue | 142 + .../frontend/src/components/Table/index.ts | 11 + .../src/components/Table/src/BasicTable.vue | 452 + .../src/components/Table/src/componentMap.ts | 36 + .../src/components/EditTableHeaderIcon.vue | 16 + .../Table/src/components/HeaderCell.vue | 48 + .../Table/src/components/TableAction.vue | 202 + .../Table/src/components/TableFooter.vue | 94 + .../Table/src/components/TableHeader.vue | 81 + .../Table/src/components/TableImg.vue | 85 + .../Table/src/components/TableTitle.vue | 53 + .../src/components/editable/CellComponent.ts | 44 + .../src/components/editable/EditableCell.vue | 531 + .../Table/src/components/editable/helper.ts | 28 + .../Table/src/components/editable/index.ts | 68 + .../src/components/settings/ColumnSetting.vue | 482 + .../components/settings/FullScreenSetting.vue | 38 + .../src/components/settings/RedoSetting.vue | 33 + .../src/components/settings/SizeSetting.vue | 64 + .../Table/src/components/settings/index.vue | 76 + .../src/components/Table/src/const.ts | 38 + .../components/Table/src/hooks/useColumns.ts | 317 + .../Table/src/hooks/useCustomRow.ts | 100 + .../Table/src/hooks/useDataSource.ts | 403 + .../components/Table/src/hooks/useLoading.ts | 21 + .../Table/src/hooks/usePagination.tsx | 85 + .../Table/src/hooks/useRowSelection.ts | 122 + .../components/Table/src/hooks/useScrollTo.ts | 55 + .../components/Table/src/hooks/useTable.ts | 167 + .../Table/src/hooks/useTableContext.ts | 22 + .../Table/src/hooks/useTableExpand.ts | 65 + .../Table/src/hooks/useTableFooter.ts | 56 + .../Table/src/hooks/useTableForm.ts | 50 + .../Table/src/hooks/useTableHeader.ts | 54 + .../Table/src/hooks/useTableScroll.ts | 220 + .../Table/src/hooks/useTableStyle.ts | 20 + .../src/components/Table/src/props.ts | 151 + .../src/components/Table/src/types/column.ts | 198 + .../Table/src/types/componentType.ts | 11 + .../components/Table/src/types/pagination.ts | 115 + .../src/components/Table/src/types/table.ts | 478 + .../components/Table/src/types/tableAction.ts | 39 + .../frontend/src/components/Time/index.ts | 4 + .../frontend/src/components/Time/src/Time.vue | 108 + .../frontend/src/components/Tinymce/index.ts | 4 + .../src/components/Tinymce/src/Editor.vue | 346 + .../src/components/Tinymce/src/ImgUpload.vue | 96 + .../src/components/Tinymce/src/helper.ts | 81 + .../src/components/Tinymce/src/tinymce.ts | 13 + .../src/components/Transition/index.ts | 27 + .../Transition/src/CollapseTransition.vue | 78 + .../Transition/src/CreateTransition.tsx | 73 + .../Transition/src/ExpandTransition.ts | 89 + .../frontend/src/components/Tree/index.ts | 6 + .../src/components/Tree/src/BasicTree.vue | 455 + .../src/components/Tree/src/TreeIcon.ts | 13 + .../Tree/src/components/TreeHeader.vue | 170 + .../src/components/Tree/src/hooks/useTree.ts | 207 + .../src/components/Tree/src/types/tree.ts | 194 + .../src/components/Tree/style/index.less | 52 + .../src/components/Tree/style/index.ts | 1 + .../frontend/src/components/Upload/index.ts | 4 + .../src/components/Upload/src/BasicUpload.vue | 123 + .../src/components/Upload/src/FileList.vue | 104 + .../src/components/Upload/src/ThumbUrl.vue | 29 + .../src/components/Upload/src/UploadModal.vue | 322 + .../Upload/src/UploadPreviewModal.vue | 99 + .../src/components/Upload/src/data.tsx | 153 + .../src/components/Upload/src/helper.ts | 27 + .../src/components/Upload/src/props.ts | 83 + .../src/components/Upload/src/typing.ts | 55 + .../src/components/Upload/src/useUpload.ts | 60 + .../frontend/src/components/Verify/index.ts | 7 + .../src/components/Verify/src/DragVerify.vue | 371 + .../src/components/Verify/src/ImgRotate.vue | 220 + .../src/components/Verify/src/props.ts | 87 + .../src/components/Verify/src/typing.ts | 14 + .../src/components/VirtualScroll/index.ts | 4 + .../VirtualScroll/src/VirtualScroll.vue | 190 + .../src/components/registerGlobComp.ts | 7 + monolithic/frontend/src/design/ant/btn.less | 285 + monolithic/frontend/src/design/ant/index.less | 59 + monolithic/frontend/src/design/ant/input.less | 31 + .../frontend/src/design/ant/pagination.less | 96 + monolithic/frontend/src/design/ant/table.less | 76 + monolithic/frontend/src/design/color.less | 138 + monolithic/frontend/src/design/config.less | 2 + monolithic/frontend/src/design/index.less | 44 + monolithic/frontend/src/design/public.less | 51 + monolithic/frontend/src/design/theme.less | 52 + .../frontend/src/design/transition/base.less | 18 + .../frontend/src/design/transition/fade.less | 93 + .../frontend/src/design/transition/index.less | 10 + .../frontend/src/design/transition/scale.less | 21 + .../src/design/transition/scroll.less | 67 + .../frontend/src/design/transition/slide.less | 39 + .../frontend/src/design/transition/zoom.less | 27 + .../frontend/src/design/var/breakpoint.less | 33 + .../frontend/src/design/var/easing.less | 18 + monolithic/frontend/src/design/var/index.less | 39 + .../frontend/src/directives/clickOutside.ts | 86 + monolithic/frontend/src/directives/index.ts | 11 + monolithic/frontend/src/directives/loading.ts | 39 + .../frontend/src/directives/permission.ts | 32 + .../frontend/src/directives/repeatClick.ts | 31 + .../frontend/src/directives/ripple/index.less | 21 + .../frontend/src/directives/ripple/index.ts | 191 + monolithic/frontend/src/enums/appEnum.ts | 52 + .../frontend/src/enums/breakpointEnum.ts | 28 + monolithic/frontend/src/enums/cacheEnum.ts | 31 + .../frontend/src/enums/exceptionEnum.ts | 27 + monolithic/frontend/src/enums/httpEnum.ts | 57 + monolithic/frontend/src/enums/menuEnum.ts | 50 + monolithic/frontend/src/enums/pageEnum.ts | 10 + monolithic/frontend/src/enums/roleEnum.ts | 7 + monolithic/frontend/src/enums/sizeEnum.ts | 19 + .../src/hooks/component/useFormItem.ts | 60 + .../src/hooks/component/usePageContext.ts | 18 + .../src/hooks/core/onMountedOrActivated.ts | 18 + .../frontend/src/hooks/core/useAttrs.ts | 40 + .../frontend/src/hooks/core/useContext.ts | 44 + .../frontend/src/hooks/core/useLockFn.ts | 17 + monolithic/frontend/src/hooks/core/useRefs.ts | 16 + .../frontend/src/hooks/core/useTimeout.ts | 45 + .../frontend/src/hooks/event/useBreakpoint.ts | 89 + .../src/hooks/event/useEventListener.ts | 58 + .../hooks/event/useIntersectionObserver.ts | 48 + .../frontend/src/hooks/event/useScroll.ts | 65 + .../frontend/src/hooks/event/useScrollTo.ts | 59 + .../src/hooks/event/useWindowSizeFn.ts | 35 + .../frontend/src/hooks/setting/index.ts | 30 + .../src/hooks/setting/useHeaderSetting.ts | 105 + .../src/hooks/setting/useMenuSetting.ts | 170 + .../hooks/setting/useMultipleTabSetting.ts | 28 + .../src/hooks/setting/useRootSetting.ts | 95 + .../src/hooks/setting/useTransitionSetting.ts | 31 + .../frontend/src/hooks/web/useAppInject.ts | 10 + .../src/hooks/web/useContentHeight.ts | 191 + .../frontend/src/hooks/web/useContextMenu.ts | 12 + .../src/hooks/web/useCopyToClipboard.ts | 69 + .../frontend/src/hooks/web/useDesign.ts | 22 + .../frontend/src/hooks/web/useECharts.ts | 121 + .../frontend/src/hooks/web/useFullContent.ts | 28 + monolithic/frontend/src/hooks/web/useI18n.ts | 55 + .../frontend/src/hooks/web/useLockPage.ts | 72 + .../frontend/src/hooks/web/useMessage.tsx | 123 + monolithic/frontend/src/hooks/web/usePage.ts | 53 + .../frontend/src/hooks/web/usePagination.ts | 34 + .../frontend/src/hooks/web/usePermission.ts | 111 + .../frontend/src/hooks/web/useScript.ts | 46 + .../frontend/src/hooks/web/useSortable.ts | 21 + monolithic/frontend/src/hooks/web/useTabs.ts | 103 + monolithic/frontend/src/hooks/web/useTitle.ts | 35 + .../frontend/src/hooks/web/useWatermark.ts | 100 + .../src/layouts/default/content/index.vue | 51 + .../default/content/useContentContext.ts | 17 + .../default/content/useContentViewHeight.ts | 42 + .../src/layouts/default/feature/index.vue | 83 + .../src/layouts/default/footer/index.vue | 95 + .../layouts/default/header/MultipleHeader.vue | 126 + .../default/header/components/Breadcrumb.vue | 204 + .../default/header/components/ErrorAction.vue | 48 + .../default/header/components/FullScreen.vue | 37 + .../default/header/components/index.ts | 14 + .../header/components/lock/LockModal.vue | 126 + .../header/components/notify/NoticeList.vue | 189 + .../default/header/components/notify/data.ts | 193 + .../header/components/notify/index.vue | 91 + .../components/user-dropdown/DropMenuItem.vue | 32 + .../header/components/user-dropdown/index.vue | 177 + .../src/layouts/default/header/index.less | 196 + .../src/layouts/default/header/index.vue | 201 + .../frontend/src/layouts/default/index.vue | 92 + .../src/layouts/default/menu/index.vue | 197 + .../src/layouts/default/menu/useLayoutMenu.ts | 109 + .../layouts/default/setting/SettingDrawer.tsx | 427 + .../setting/components/InputNumberItem.vue | 56 + .../default/setting/components/SelectItem.vue | 75 + .../setting/components/SettingFooter.vue | 99 + .../default/setting/components/SwitchItem.vue | 66 + .../setting/components/ThemeColorPicker.vue | 88 + .../default/setting/components/TypePicker.vue | 178 + .../default/setting/components/index.ts | 8 + .../src/layouts/default/setting/enum.ts | 156 + .../src/layouts/default/setting/handler.ts | 174 + .../src/layouts/default/setting/index.vue | 26 + .../src/layouts/default/sider/DragBar.vue | 66 + .../src/layouts/default/sider/LayoutSider.vue | 185 + .../src/layouts/default/sider/MixSider.vue | 591 + .../src/layouts/default/sider/index.vue | 57 + .../layouts/default/sider/useLayoutSider.ts | 143 + .../default/tabs/components/FoldButton.vue | 42 + .../default/tabs/components/TabContent.vue | 76 + .../default/tabs/components/TabRedo.vue | 33 + .../src/layouts/default/tabs/index.less | 207 + .../src/layouts/default/tabs/index.vue | 144 + .../src/layouts/default/tabs/types.ts | 25 + .../layouts/default/tabs/useMultipleTabs.ts | 80 + .../layouts/default/tabs/useTabDropdown.ts | 140 + .../layouts/default/trigger/HeaderTrigger.vue | 25 + .../layouts/default/trigger/SiderTrigger.vue | 21 + .../src/layouts/default/trigger/index.vue | 22 + .../frontend/src/layouts/iframe/index.vue | 29 + .../src/layouts/iframe/useFrameKeepAlive.ts | 59 + .../frontend/src/layouts/page/index.vue | 72 + .../frontend/src/layouts/page/transition.ts | 33 + monolithic/frontend/src/locales/helper.ts | 37 + monolithic/frontend/src/locales/lang/en.ts | 12 + .../frontend/src/locales/lang/en/common.ts | 20 + .../frontend/src/locales/lang/en/component.ts | 129 + .../frontend/src/locales/lang/en/layout.ts | 116 + .../src/locales/lang/en/routes/app.ts | 14 + .../src/locales/lang/en/routes/basic.ts | 4 + .../src/locales/lang/en/routes/dashboard.ts | 6 + .../frontend/src/locales/lang/en/sys.ts | 109 + .../lang/zh-CN/antdLocale/DatePicker.ts | 19 + .../frontend/src/locales/lang/zh-CN/common.ts | 20 + .../src/locales/lang/zh-CN/component.ts | 134 + .../frontend/src/locales/lang/zh-CN/layout.ts | 116 + .../src/locales/lang/zh-CN/routes/basic.ts | 4 + .../locales/lang/zh-CN/routes/dashboard.ts | 6 + .../src/locales/lang/zh-CN/routes/menu.ts | 27 + .../frontend/src/locales/lang/zh-CN/sys.ts | 102 + monolithic/frontend/src/locales/lang/zh_CN.ts | 10 + monolithic/frontend/src/locales/setupI18n.ts | 44 + monolithic/frontend/src/locales/useLocale.ts | 69 + .../frontend/src/logics/error-handle/index.ts | 184 + .../frontend/src/logics/initAppConfig.ts | 84 + .../frontend/src/logics/mitt/routeChange.ts | 31 + monolithic/frontend/src/logics/theme/dark.ts | 24 + monolithic/frontend/src/logics/theme/index.ts | 17 + .../src/logics/theme/updateBackground.ts | 75 + .../src/logics/theme/updateColorWeak.ts | 9 + .../src/logics/theme/updateGrayMode.ts | 9 + monolithic/frontend/src/logics/theme/util.ts | 11 + monolithic/frontend/src/main.ts | 61 + monolithic/frontend/src/router/constant.ts | 24 + monolithic/frontend/src/router/guard/index.ts | 147 + .../src/router/guard/paramMenuGuard.ts | 47 + .../src/router/guard/permissionGuard.ts | 118 + .../frontend/src/router/guard/stateGuard.ts | 24 + .../frontend/src/router/helper/menuHelper.ts | 106 + .../frontend/src/router/helper/routeHelper.ts | 178 + monolithic/frontend/src/router/index.ts | 42 + monolithic/frontend/src/router/menus/index.ts | 126 + .../frontend/src/router/routes/basic.ts | 78 + .../frontend/src/router/routes/index.ts | 49 + .../frontend/src/router/routes/mainOut.ts | 22 + .../src/router/routes/modules/app/system.ts | 94 + .../src/router/routes/modules/dashboard.ts | 38 + monolithic/frontend/src/router/types.ts | 58 + .../frontend/src/settings/componentSetting.ts | 51 + .../frontend/src/settings/designSetting.ts | 48 + .../src/settings/encryptionSetting.ts | 13 + .../frontend/src/settings/localeSetting.ts | 29 + .../frontend/src/settings/projectSetting.ts | 182 + .../frontend/src/settings/siteSetting.ts | 3 + monolithic/frontend/src/store/index.ts | 10 + monolithic/frontend/src/store/modules/app.ts | 108 + .../frontend/src/store/modules/errorLog.ts | 78 + .../frontend/src/store/modules/locale.ts | 55 + monolithic/frontend/src/store/modules/lock.ts | 62 + .../frontend/src/store/modules/multipleTab.ts | 359 + .../frontend/src/store/modules/permission.ts | 260 + monolithic/frontend/src/store/modules/user.ts | 169 + monolithic/frontend/src/utils/auth/index.ts | 26 + monolithic/frontend/src/utils/bem.ts | 52 + monolithic/frontend/src/utils/cache/index.ts | 32 + monolithic/frontend/src/utils/cache/memory.ts | 107 + .../frontend/src/utils/cache/persistent.ts | 132 + .../frontend/src/utils/cache/storageCache.ts | 111 + monolithic/frontend/src/utils/cipher.ts | 55 + monolithic/frontend/src/utils/color.ts | 151 + monolithic/frontend/src/utils/dateUtil.ts | 23 + monolithic/frontend/src/utils/domUtils.ts | 180 + monolithic/frontend/src/utils/env.ts | 83 + monolithic/frontend/src/utils/event/index.ts | 42 + .../utils/factory/createAsyncComponent.tsx | 63 + .../frontend/src/utils/file/base64Conver.ts | 41 + .../frontend/src/utils/file/download.ts | 96 + .../frontend/src/utils/helper/treeHelper.ts | 216 + .../frontend/src/utils/helper/tsxHelper.tsx | 35 + .../frontend/src/utils/http/axios/Axios.ts | 237 + .../src/utils/http/axios/axiosCancel.ts | 60 + .../src/utils/http/axios/axiosRetry.ts | 28 + .../src/utils/http/axios/axiosTransform.ts | 52 + .../src/utils/http/axios/checkStatus.ts | 100 + .../frontend/src/utils/http/axios/helper.ts | 48 + .../frontend/src/utils/http/axios/index.ts | 278 + monolithic/frontend/src/utils/index.ts | 92 + monolithic/frontend/src/utils/is.ts | 99 + monolithic/frontend/src/utils/lib/echarts.ts | 57 + monolithic/frontend/src/utils/log.ts | 9 + monolithic/frontend/src/utils/mitt.ts | 101 + .../frontend/src/utils/openapi-axios/index.ts | 245 + monolithic/frontend/src/utils/propTypes.ts | 34 + monolithic/frontend/src/utils/props.ts | 185 + monolithic/frontend/src/utils/types.ts | 42 + monolithic/frontend/src/utils/uuid.ts | 28 + .../views/app/system/account/AccountBind.vue | 59 + .../views/app/system/account/BaseSetting.vue | 92 + .../views/app/system/account/MsgNotify.vue | 55 + .../app/system/account/SecureSetting.vue | 49 + .../src/views/app/system/account/data.tsx | 149 + .../src/views/app/system/account/index.vue | 61 + .../src/views/app/system/menu/index.vue | 106 + .../src/views/app/system/menu/menu-drawer.vue | 76 + .../src/views/app/system/menu/menu.data.tsx | 210 + .../src/views/app/system/org/index.vue | 93 + .../src/views/app/system/org/org-modal.vue | 71 + .../src/views/app/system/org/org.data.tsx | 110 + .../src/views/app/system/position/index.vue | 104 + .../app/system/position/position-drawer.vue | 89 + .../app/system/position/position.data.tsx | 112 + .../src/views/app/system/role/index.vue | 104 + .../src/views/app/system/role/role-drawer.vue | 90 + .../src/views/app/system/role/role.data.tsx | 123 + .../views/app/system/users/detail/index.vue | 64 + .../src/views/app/system/users/index.vue | 120 + .../src/views/app/system/users/org-tree.vue | 35 + .../src/views/app/system/users/user-modal.vue | 79 + .../src/views/app/system/users/users.data.tsx | 158 + .../analysis/components/GrowCard.vue | 40 + .../analysis/components/SalesProductPie.vue | 64 + .../analysis/components/SiteAnalysis.vue | 38 + .../analysis/components/VisitAnalysis.vue | 89 + .../analysis/components/VisitAnalysisBar.vue | 47 + .../analysis/components/VisitRadar.vue | 94 + .../analysis/components/VisitSource.vue | 81 + .../dashboard/analysis/components/props.ts | 16 + .../src/views/dashboard/analysis/data.tsx | 43 + .../src/views/dashboard/analysis/index.vue | 18 + .../workbench/components/DynamicInfo.vue | 31 + .../workbench/components/ProjectCard.vue | 32 + .../workbench/components/QuickNav.vue | 17 + .../workbench/components/SaleRadar.vue | 94 + .../workbench/components/WorkbenchHeader.vue | 20 + .../dashboard/workbench/components/data.ts | 156 + .../src/views/dashboard/workbench/index.vue | 37 + .../src/views/sys/error-log/DetailModal.vue | 27 + .../frontend/src/views/sys/error-log/data.tsx | 67 + .../src/views/sys/error-log/index.vue | 94 + .../src/views/sys/exception/Exception.vue | 148 + .../frontend/src/views/sys/exception/index.ts | 1 + .../src/views/sys/iframe/FrameBlank.vue | 9 + .../frontend/src/views/sys/iframe/index.vue | 90 + .../frontend/src/views/sys/lock/LockPage.vue | 234 + .../frontend/src/views/sys/lock/index.vue | 13 + .../frontend/src/views/sys/lock/useNow.ts | 60 + .../views/sys/login/ForgetPasswordForm.vue | 65 + .../frontend/src/views/sys/login/Login.vue | 217 + .../src/views/sys/login/LoginForm.vue | 135 + .../src/views/sys/login/LoginFormTitle.vue | 25 + .../src/views/sys/login/MobileForm.vue | 64 + .../src/views/sys/login/QrCodeForm.vue | 32 + .../src/views/sys/login/RegisterForm.vue | 105 + .../views/sys/login/SessionTimeoutLogin.vue | 53 + .../frontend/src/views/sys/login/useLogin.ts | 132 + .../frontend/src/views/sys/main-out/index.vue | 6 + .../frontend/src/views/sys/redirect/index.vue | 30 + monolithic/frontend/stylelint.config.js | 100 + monolithic/frontend/tsconfig.json | 57 + monolithic/frontend/types/axios.d.ts | 61 + monolithic/frontend/types/config.d.ts | 162 + monolithic/frontend/types/global.d.ts | 100 + monolithic/frontend/types/index.d.ts | 27 + monolithic/frontend/types/module.d.ts | 16 + monolithic/frontend/types/openapi.d.ts | 1381 +++ monolithic/frontend/types/store.d.ts | 68 + monolithic/frontend/types/utils.d.ts | 5 + monolithic/frontend/types/vue-router.d.ts | 45 + monolithic/frontend/vite.config.ts | 115 + monolithic/frontend/windi.config.ts | 74 + 871 files changed, 137563 insertions(+), 42 deletions(-) create mode 100644 monolithic/.gitignore create mode 100644 monolithic/LICENSE create mode 100644 monolithic/README.md create mode 100644 monolithic/backend/.gitignore create mode 100644 monolithic/backend/.markdownlint.yaml create mode 100644 monolithic/backend/.yamllint create mode 100644 monolithic/backend/Makefile create mode 100644 monolithic/backend/README.md create mode 100644 monolithic/backend/api/admin/service/v1/admin_error.proto create mode 100644 monolithic/backend/api/admin/service/v1/buf.openapi.gen.yaml create mode 100644 monolithic/backend/api/admin/service/v1/i_admin.proto create mode 100644 monolithic/backend/api/admin/service/v1/i_authentication.proto create mode 100644 monolithic/backend/api/admin/service/v1/i_dict.proto create mode 100644 monolithic/backend/api/admin/service/v1/i_dict_detail.proto create mode 100644 monolithic/backend/api/admin/service/v1/i_menu.proto create mode 100644 monolithic/backend/api/admin/service/v1/i_organization.proto create mode 100644 monolithic/backend/api/admin/service/v1/i_position.proto create mode 100644 monolithic/backend/api/admin/service/v1/i_role.proto create mode 100644 monolithic/backend/api/admin/service/v1/i_router.proto create mode 100644 monolithic/backend/api/admin/service/v1/i_user.proto create mode 100644 monolithic/backend/api/buf.lock create mode 100644 monolithic/backend/api/buf.yaml create mode 100644 monolithic/backend/api/file/service/v1/attachment.proto create mode 100644 monolithic/backend/api/system/service/v1/dict.proto create mode 100644 monolithic/backend/api/system/service/v1/dict_detail.proto create mode 100644 monolithic/backend/api/system/service/v1/menu.proto create mode 100644 monolithic/backend/api/user/service/v1/organization.proto create mode 100644 monolithic/backend/api/user/service/v1/position.proto create mode 100644 monolithic/backend/api/user/service/v1/role.proto create mode 100644 monolithic/backend/api/user/service/v1/user.proto create mode 100644 monolithic/backend/api/user/service/v1/user_error.proto create mode 100644 monolithic/backend/app.mk create mode 100644 monolithic/backend/app/admin/service/Makefile create mode 100644 monolithic/backend/app/admin/service/README.md create mode 100644 monolithic/backend/app/admin/service/cmd/server/assets/assets.go create mode 100644 monolithic/backend/app/admin/service/cmd/server/assets/openapi.yaml create mode 100644 monolithic/backend/app/admin/service/cmd/server/main.go create mode 100644 monolithic/backend/app/admin/service/cmd/server/wire.go create mode 100644 monolithic/backend/app/admin/service/cmd/server/wire_gen.go create mode 100644 monolithic/backend/app/admin/service/configs/data.yaml create mode 100644 monolithic/backend/app/admin/service/configs/logger.yaml create mode 100644 monolithic/backend/app/admin/service/configs/registry.yaml create mode 100644 monolithic/backend/app/admin/service/configs/remote.yaml create mode 100644 monolithic/backend/app/admin/service/configs/trace.yaml create mode 100644 monolithic/backend/app/admin/service/configs/transport.yaml create mode 100644 monolithic/backend/app/admin/service/internal/data/README.md create mode 100644 monolithic/backend/app/admin/service/internal/data/data.go create mode 100644 monolithic/backend/app/admin/service/internal/data/dict.go create mode 100644 monolithic/backend/app/admin/service/internal/data/dict_detail.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/client.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/dict.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/dict/dict.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/dict/where.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/dict_create.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/dict_delete.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/dict_query.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/dict_update.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/dictdetail.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/dictdetail/dictdetail.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/dictdetail/where.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/dictdetail_create.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/dictdetail_delete.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/dictdetail_query.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/dictdetail_update.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/ent.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/entql.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/enttest/enttest.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/hook/hook.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/menu.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/menu/menu.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/menu/where.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/menu_create.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/menu_delete.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/menu_query.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/menu_update.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/migrate/migrate.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/migrate/schema.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/mutation.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/organization.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/organization/organization.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/organization/where.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/organization_create.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/organization_delete.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/organization_query.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/organization_update.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/position.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/position/position.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/position/where.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/position_create.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/position_delete.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/position_query.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/position_update.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/predicate/predicate.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/privacy/privacy.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/role.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/role/role.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/role/where.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/role_create.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/role_delete.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/role_query.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/role_update.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/runtime.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/runtime/runtime.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/schema/dict.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/schema/dict_detail.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/schema/menu.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/schema/organization.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/schema/position.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/schema/role.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/schema/user.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/tx.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/user.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/user/user.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/user/where.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/user_create.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/user_delete.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/user_query.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent/user_update.go create mode 100644 monolithic/backend/app/admin/service/internal/data/ent_client.go create mode 100644 monolithic/backend/app/admin/service/internal/data/init.go create mode 100644 monolithic/backend/app/admin/service/internal/data/menu.go create mode 100644 monolithic/backend/app/admin/service/internal/data/organization.go create mode 100644 monolithic/backend/app/admin/service/internal/data/position.go create mode 100644 monolithic/backend/app/admin/service/internal/data/role.go create mode 100644 monolithic/backend/app/admin/service/internal/data/user.go create mode 100644 monolithic/backend/app/admin/service/internal/data/user_test.go create mode 100644 monolithic/backend/app/admin/service/internal/data/user_token.go create mode 100644 monolithic/backend/app/admin/service/internal/server/asynq.go create mode 100644 monolithic/backend/app/admin/service/internal/server/init.go create mode 100644 monolithic/backend/app/admin/service/internal/server/rest.go create mode 100644 monolithic/backend/app/admin/service/internal/service/README.md create mode 100644 monolithic/backend/app/admin/service/internal/service/authentication.go create mode 100644 monolithic/backend/app/admin/service/internal/service/dict.go create mode 100644 monolithic/backend/app/admin/service/internal/service/dict_detail.go create mode 100644 monolithic/backend/app/admin/service/internal/service/init.go create mode 100644 monolithic/backend/app/admin/service/internal/service/menu.go create mode 100644 monolithic/backend/app/admin/service/internal/service/organization.go create mode 100644 monolithic/backend/app/admin/service/internal/service/position.go create mode 100644 monolithic/backend/app/admin/service/internal/service/role.go create mode 100644 monolithic/backend/app/admin/service/internal/service/router.go create mode 100644 monolithic/backend/app/admin/service/internal/service/task.go create mode 100644 monolithic/backend/app/admin/service/internal/service/user.go create mode 100644 monolithic/backend/buf.gen.yaml create mode 100644 monolithic/backend/buf.lock create mode 100644 monolithic/backend/buf.work.yaml create mode 100644 monolithic/backend/buf.yaml create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/admin_error.pb.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/admin_error.pb.validate.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/admin_error_errors.pb.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_admin.pb.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_admin.pb.validate.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_authentication.pb.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_authentication.pb.validate.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_authentication_grpc.pb.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_authentication_http.pb.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_dict.pb.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_dict.pb.validate.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_dict_detail.pb.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_dict_detail.pb.validate.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_dict_detail_grpc.pb.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_dict_detail_http.pb.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_dict_grpc.pb.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_dict_http.pb.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_menu.pb.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_menu.pb.validate.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_menu_grpc.pb.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_menu_http.pb.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_organization.pb.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_organization.pb.validate.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_organization_grpc.pb.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_organization_http.pb.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_position.pb.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_position.pb.validate.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_position_grpc.pb.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_position_http.pb.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_role.pb.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_role.pb.validate.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_role_grpc.pb.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_role_http.pb.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_router.pb.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_router.pb.validate.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_router_grpc.pb.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_router_http.pb.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_user.pb.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_user.pb.validate.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_user_grpc.pb.go create mode 100644 monolithic/backend/gen/api/go/admin/service/v1/i_user_http.pb.go create mode 100644 monolithic/backend/gen/api/go/file/service/v1/attachment.pb.go create mode 100644 monolithic/backend/gen/api/go/file/service/v1/attachment.pb.validate.go create mode 100644 monolithic/backend/gen/api/go/file/service/v1/attachment_grpc.pb.go create mode 100644 monolithic/backend/gen/api/go/system/service/v1/dict.pb.go create mode 100644 monolithic/backend/gen/api/go/system/service/v1/dict.pb.validate.go create mode 100644 monolithic/backend/gen/api/go/system/service/v1/dict_detail.pb.go create mode 100644 monolithic/backend/gen/api/go/system/service/v1/dict_detail.pb.validate.go create mode 100644 monolithic/backend/gen/api/go/system/service/v1/dict_detail_grpc.pb.go create mode 100644 monolithic/backend/gen/api/go/system/service/v1/dict_grpc.pb.go create mode 100644 monolithic/backend/gen/api/go/system/service/v1/menu.pb.go create mode 100644 monolithic/backend/gen/api/go/system/service/v1/menu.pb.validate.go create mode 100644 monolithic/backend/gen/api/go/system/service/v1/menu_grpc.pb.go create mode 100644 monolithic/backend/gen/api/go/user/service/v1/organization.pb.go create mode 100644 monolithic/backend/gen/api/go/user/service/v1/organization.pb.validate.go create mode 100644 monolithic/backend/gen/api/go/user/service/v1/organization_grpc.pb.go create mode 100644 monolithic/backend/gen/api/go/user/service/v1/position.pb.go create mode 100644 monolithic/backend/gen/api/go/user/service/v1/position.pb.validate.go create mode 100644 monolithic/backend/gen/api/go/user/service/v1/position_grpc.pb.go create mode 100644 monolithic/backend/gen/api/go/user/service/v1/role.pb.go create mode 100644 monolithic/backend/gen/api/go/user/service/v1/role.pb.validate.go create mode 100644 monolithic/backend/gen/api/go/user/service/v1/role_grpc.pb.go create mode 100644 monolithic/backend/gen/api/go/user/service/v1/user.pb.go create mode 100644 monolithic/backend/gen/api/go/user/service/v1/user.pb.validate.go create mode 100644 monolithic/backend/gen/api/go/user/service/v1/user_error.pb.go create mode 100644 monolithic/backend/gen/api/go/user/service/v1/user_error.pb.validate.go create mode 100644 monolithic/backend/gen/api/go/user/service/v1/user_error_errors.pb.go create mode 100644 monolithic/backend/gen/api/go/user/service/v1/user_grpc.pb.go create mode 100644 monolithic/backend/go.mod create mode 100644 monolithic/backend/go.sum create mode 100644 monolithic/backend/pkg/README.md create mode 100644 monolithic/backend/pkg/middleware/auth/auth.go create mode 100644 monolithic/backend/pkg/middleware/auth/errors.go create mode 100644 monolithic/backend/pkg/service/name.go create mode 100644 monolithic/backend/script/prepare_centos.sh create mode 100644 monolithic/backend/script/prepare_ubuntu.sh create mode 100644 monolithic/backend/sql/default-data.sql create mode 100644 monolithic/backend/sql/demo-data.sql create mode 100644 monolithic/frontend/.editorconfig create mode 100644 monolithic/frontend/.env create mode 100644 monolithic/frontend/.env.development create mode 100644 monolithic/frontend/.env.production create mode 100644 monolithic/frontend/.eslintignore create mode 100644 monolithic/frontend/.eslintrc.yml create mode 100644 monolithic/frontend/.gitignore create mode 100644 monolithic/frontend/.gitpod.yml create mode 100644 monolithic/frontend/.prettierignore create mode 100644 monolithic/frontend/.stylelintignore create mode 100644 monolithic/frontend/LICENSE create mode 100644 monolithic/frontend/README.md create mode 100644 monolithic/frontend/build/config/themeConfig.ts create mode 100644 monolithic/frontend/build/constant.ts create mode 100644 monolithic/frontend/build/generate/generateModifyVars.ts create mode 100644 monolithic/frontend/build/generate/icon/index.ts create mode 100644 monolithic/frontend/build/getConfigFileName.ts create mode 100644 monolithic/frontend/build/script/buildConf.ts create mode 100644 monolithic/frontend/build/script/postBuild.ts create mode 100644 monolithic/frontend/build/utils.ts create mode 100644 monolithic/frontend/build/vite/plugin/compress.ts create mode 100644 monolithic/frontend/build/vite/plugin/html.ts create mode 100644 monolithic/frontend/build/vite/plugin/imagemin.ts create mode 100644 monolithic/frontend/build/vite/plugin/index.ts create mode 100644 monolithic/frontend/build/vite/plugin/pwa.ts create mode 100644 monolithic/frontend/build/vite/plugin/styleImport.ts create mode 100644 monolithic/frontend/build/vite/plugin/svgSprite.ts create mode 100644 monolithic/frontend/build/vite/plugin/theme.ts create mode 100644 monolithic/frontend/build/vite/plugin/visualizer.ts create mode 100644 monolithic/frontend/build/vite/proxy.ts create mode 100644 monolithic/frontend/commitlint.config.js create mode 100644 monolithic/frontend/index.html create mode 100644 monolithic/frontend/package.json create mode 100644 monolithic/frontend/postcss.config.js create mode 100644 monolithic/frontend/prettier.config.js create mode 100644 monolithic/frontend/public/favicon.ico create mode 100644 monolithic/frontend/public/resource/img/logo.png create mode 100644 monolithic/frontend/public/resource/img/pwa-192x192.png create mode 100644 monolithic/frontend/public/resource/img/pwa-512x512.png create mode 100644 monolithic/frontend/public/resource/tinymce/langs/en.js create mode 100644 monolithic/frontend/public/resource/tinymce/langs/zh_CN.js create mode 100644 monolithic/frontend/public/resource/tinymce/skins/ui/oxide-dark/content.inline.min.css create mode 100644 monolithic/frontend/public/resource/tinymce/skins/ui/oxide-dark/content.min.css create mode 100644 monolithic/frontend/public/resource/tinymce/skins/ui/oxide-dark/content.mobile.min.css create mode 100644 monolithic/frontend/public/resource/tinymce/skins/ui/oxide-dark/skin.min.css create mode 100644 monolithic/frontend/public/resource/tinymce/skins/ui/oxide-dark/skin.mobile.min.css create mode 100644 monolithic/frontend/public/resource/tinymce/skins/ui/oxide/content.inline.min.css create mode 100644 monolithic/frontend/public/resource/tinymce/skins/ui/oxide/content.min.css create mode 100644 monolithic/frontend/public/resource/tinymce/skins/ui/oxide/content.mobile.min.css create mode 100644 monolithic/frontend/public/resource/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff create mode 100644 monolithic/frontend/public/resource/tinymce/skins/ui/oxide/skin.min.css create mode 100644 monolithic/frontend/public/resource/tinymce/skins/ui/oxide/skin.mobile.min.css create mode 100644 monolithic/frontend/src/App.vue create mode 100644 monolithic/frontend/src/api/app/authentication.ts create mode 100644 monolithic/frontend/src/api/app/index.ts create mode 100644 monolithic/frontend/src/api/app/menu.ts create mode 100644 monolithic/frontend/src/api/app/organization.ts create mode 100644 monolithic/frontend/src/api/app/position.ts create mode 100644 monolithic/frontend/src/api/app/role.ts create mode 100644 monolithic/frontend/src/api/app/user.ts create mode 100644 monolithic/frontend/src/api/sys/routes.ts create mode 100644 monolithic/frontend/src/api/sys/upload.ts create mode 100644 monolithic/frontend/src/assets/icons/comment-count.svg create mode 100644 monolithic/frontend/src/assets/icons/download-count.svg create mode 100644 monolithic/frontend/src/assets/icons/dynamic-avatar-1.svg create mode 100644 monolithic/frontend/src/assets/icons/dynamic-avatar-2.svg create mode 100644 monolithic/frontend/src/assets/icons/dynamic-avatar-3.svg create mode 100644 monolithic/frontend/src/assets/icons/dynamic-avatar-4.svg create mode 100644 monolithic/frontend/src/assets/icons/dynamic-avatar-5.svg create mode 100644 monolithic/frontend/src/assets/icons/dynamic-avatar-6.svg create mode 100644 monolithic/frontend/src/assets/icons/moon.svg create mode 100644 monolithic/frontend/src/assets/icons/post-count.svg create mode 100644 monolithic/frontend/src/assets/icons/posts.svg create mode 100644 monolithic/frontend/src/assets/icons/reading-count.svg create mode 100644 monolithic/frontend/src/assets/icons/sun.svg create mode 100644 monolithic/frontend/src/assets/icons/test.svg create mode 100644 monolithic/frontend/src/assets/icons/visit-count.svg create mode 100644 monolithic/frontend/src/assets/images/demo.png create mode 100644 monolithic/frontend/src/assets/images/header.jpg create mode 100644 monolithic/frontend/src/assets/images/logo.png create mode 100644 monolithic/frontend/src/assets/svg/illustration.svg create mode 100644 monolithic/frontend/src/assets/svg/login-bg-dark.svg create mode 100644 monolithic/frontend/src/assets/svg/login-bg.svg create mode 100644 monolithic/frontend/src/assets/svg/login-box-bg.svg create mode 100644 monolithic/frontend/src/assets/svg/net-error.svg create mode 100644 monolithic/frontend/src/assets/svg/no-data.svg create mode 100644 monolithic/frontend/src/assets/svg/preview/p-rotate.svg create mode 100644 monolithic/frontend/src/assets/svg/preview/resume.svg create mode 100644 monolithic/frontend/src/assets/svg/preview/scale.svg create mode 100644 monolithic/frontend/src/assets/svg/preview/unrotate.svg create mode 100644 monolithic/frontend/src/assets/svg/preview/unscale.svg create mode 100644 monolithic/frontend/src/components/Application/index.ts create mode 100644 monolithic/frontend/src/components/Application/src/AppDarkModeToggle.vue create mode 100644 monolithic/frontend/src/components/Application/src/AppLocalePicker.vue create mode 100644 monolithic/frontend/src/components/Application/src/AppLogo.vue create mode 100644 monolithic/frontend/src/components/Application/src/AppProvider.vue create mode 100644 monolithic/frontend/src/components/Application/src/search/AppSearch.vue create mode 100644 monolithic/frontend/src/components/Application/src/search/AppSearchFooter.vue create mode 100644 monolithic/frontend/src/components/Application/src/search/AppSearchKeyItem.vue create mode 100644 monolithic/frontend/src/components/Application/src/search/AppSearchModal.vue create mode 100644 monolithic/frontend/src/components/Application/src/search/useMenuSearch.ts create mode 100644 monolithic/frontend/src/components/Application/src/useAppContext.ts create mode 100644 monolithic/frontend/src/components/Authority/index.ts create mode 100644 monolithic/frontend/src/components/Authority/src/Authority.vue create mode 100644 monolithic/frontend/src/components/Basic/index.ts create mode 100644 monolithic/frontend/src/components/Basic/src/BasicArrow.vue create mode 100644 monolithic/frontend/src/components/Basic/src/BasicHelp.vue create mode 100644 monolithic/frontend/src/components/Basic/src/BasicTitle.vue create mode 100644 monolithic/frontend/src/components/Button/index.ts create mode 100644 monolithic/frontend/src/components/Button/src/BasicButton.vue create mode 100644 monolithic/frontend/src/components/Button/src/PopConfirmButton.vue create mode 100644 monolithic/frontend/src/components/Button/src/props.ts create mode 100644 monolithic/frontend/src/components/CardList/index.ts create mode 100644 monolithic/frontend/src/components/CardList/src/CardList.vue create mode 100644 monolithic/frontend/src/components/CardList/src/data.ts create mode 100644 monolithic/frontend/src/components/ClickOutSide/index.ts create mode 100644 monolithic/frontend/src/components/ClickOutSide/src/ClickOutSide.vue create mode 100644 monolithic/frontend/src/components/CodeEditor/index.ts create mode 100644 monolithic/frontend/src/components/CodeEditor/src/CodeEditor.vue create mode 100644 monolithic/frontend/src/components/CodeEditor/src/codemirror/CodeMirror.vue create mode 100644 monolithic/frontend/src/components/CodeEditor/src/codemirror/codeMirror.ts create mode 100644 monolithic/frontend/src/components/CodeEditor/src/codemirror/codemirror.css create mode 100644 monolithic/frontend/src/components/CodeEditor/src/json-preview/JsonPreview.vue create mode 100644 monolithic/frontend/src/components/CodeEditor/src/typing.ts create mode 100644 monolithic/frontend/src/components/Container/index.ts create mode 100644 monolithic/frontend/src/components/Container/src/LazyContainer.vue create mode 100644 monolithic/frontend/src/components/Container/src/ScrollContainer.vue create mode 100644 monolithic/frontend/src/components/Container/src/collapse/CollapseContainer.vue create mode 100644 monolithic/frontend/src/components/Container/src/collapse/CollapseHeader.vue create mode 100644 monolithic/frontend/src/components/Container/src/typing.ts create mode 100644 monolithic/frontend/src/components/ContextMenu/index.ts create mode 100644 monolithic/frontend/src/components/ContextMenu/src/ContextMenu.vue create mode 100644 monolithic/frontend/src/components/ContextMenu/src/createContextMenu.ts create mode 100644 monolithic/frontend/src/components/ContextMenu/src/typing.ts create mode 100644 monolithic/frontend/src/components/CountDown/index.ts create mode 100644 monolithic/frontend/src/components/CountDown/src/CountButton.vue create mode 100644 monolithic/frontend/src/components/CountDown/src/CountdownInput.vue create mode 100644 monolithic/frontend/src/components/CountDown/src/useCountdown.ts create mode 100644 monolithic/frontend/src/components/CountTo/index.ts create mode 100644 monolithic/frontend/src/components/CountTo/src/CountTo.vue create mode 100644 monolithic/frontend/src/components/Cropper/index.ts create mode 100644 monolithic/frontend/src/components/Cropper/src/CopperModal.vue create mode 100644 monolithic/frontend/src/components/Cropper/src/Cropper.vue create mode 100644 monolithic/frontend/src/components/Cropper/src/CropperAvatar.vue create mode 100644 monolithic/frontend/src/components/Cropper/src/typing.ts create mode 100644 monolithic/frontend/src/components/Description/index.ts create mode 100644 monolithic/frontend/src/components/Description/src/Description.vue create mode 100644 monolithic/frontend/src/components/Description/src/typing.ts create mode 100644 monolithic/frontend/src/components/Description/src/useDescription.ts create mode 100644 monolithic/frontend/src/components/Drawer/index.ts create mode 100644 monolithic/frontend/src/components/Drawer/src/BasicDrawer.vue create mode 100644 monolithic/frontend/src/components/Drawer/src/components/DrawerFooter.vue create mode 100644 monolithic/frontend/src/components/Drawer/src/components/DrawerHeader.vue create mode 100644 monolithic/frontend/src/components/Drawer/src/props.ts create mode 100644 monolithic/frontend/src/components/Drawer/src/typing.ts create mode 100644 monolithic/frontend/src/components/Drawer/src/useDrawer.ts create mode 100644 monolithic/frontend/src/components/Dropdown/index.ts create mode 100644 monolithic/frontend/src/components/Dropdown/src/Dropdown.vue create mode 100644 monolithic/frontend/src/components/Dropdown/src/typing.ts create mode 100644 monolithic/frontend/src/components/Excel/index.ts create mode 100644 monolithic/frontend/src/components/Excel/src/Export2Excel.ts create mode 100644 monolithic/frontend/src/components/Excel/src/ExportExcelModal.vue create mode 100644 monolithic/frontend/src/components/Excel/src/ImportExcel.vue create mode 100644 monolithic/frontend/src/components/Excel/src/typing.ts create mode 100644 monolithic/frontend/src/components/FlowChart/index.ts create mode 100644 monolithic/frontend/src/components/FlowChart/src/FlowChart.vue create mode 100644 monolithic/frontend/src/components/FlowChart/src/FlowChartToolbar.vue create mode 100644 monolithic/frontend/src/components/FlowChart/src/adpterForTurbo.ts create mode 100644 monolithic/frontend/src/components/FlowChart/src/config.ts create mode 100644 monolithic/frontend/src/components/FlowChart/src/enum.ts create mode 100644 monolithic/frontend/src/components/FlowChart/src/types.ts create mode 100644 monolithic/frontend/src/components/FlowChart/src/useFlowContext.ts create mode 100644 monolithic/frontend/src/components/Form/index.ts create mode 100644 monolithic/frontend/src/components/Form/src/BasicForm.vue create mode 100644 monolithic/frontend/src/components/Form/src/componentMap.ts create mode 100644 monolithic/frontend/src/components/Form/src/components/ApiCascader.vue create mode 100644 monolithic/frontend/src/components/Form/src/components/ApiRadioGroup.vue create mode 100644 monolithic/frontend/src/components/Form/src/components/ApiSelect.vue create mode 100644 monolithic/frontend/src/components/Form/src/components/ApiTransfer.vue create mode 100644 monolithic/frontend/src/components/Form/src/components/ApiTree.vue create mode 100644 monolithic/frontend/src/components/Form/src/components/ApiTreeSelect.vue create mode 100644 monolithic/frontend/src/components/Form/src/components/FormAction.vue create mode 100644 monolithic/frontend/src/components/Form/src/components/FormItem.vue create mode 100644 monolithic/frontend/src/components/Form/src/components/RadioButtonGroup.vue create mode 100644 monolithic/frontend/src/components/Form/src/helper.ts create mode 100644 monolithic/frontend/src/components/Form/src/hooks/useAdvanced.ts create mode 100644 monolithic/frontend/src/components/Form/src/hooks/useAutoFocus.ts create mode 100644 monolithic/frontend/src/components/Form/src/hooks/useComponentRegister.ts create mode 100644 monolithic/frontend/src/components/Form/src/hooks/useForm.ts create mode 100644 monolithic/frontend/src/components/Form/src/hooks/useFormContext.ts create mode 100644 monolithic/frontend/src/components/Form/src/hooks/useFormEvents.ts create mode 100644 monolithic/frontend/src/components/Form/src/hooks/useFormValues.ts create mode 100644 monolithic/frontend/src/components/Form/src/hooks/useLabelWidth.ts create mode 100644 monolithic/frontend/src/components/Form/src/props.ts create mode 100644 monolithic/frontend/src/components/Form/src/types/form.ts create mode 100644 monolithic/frontend/src/components/Form/src/types/formItem.ts create mode 100644 monolithic/frontend/src/components/Form/src/types/hooks.ts create mode 100644 monolithic/frontend/src/components/Form/src/types/index.ts create mode 100644 monolithic/frontend/src/components/Icon/data/icons.data.ts create mode 100644 monolithic/frontend/src/components/Icon/index.ts create mode 100644 monolithic/frontend/src/components/Icon/src/Icon.vue create mode 100644 monolithic/frontend/src/components/Icon/src/IconPicker.vue create mode 100644 monolithic/frontend/src/components/Icon/src/SvgIcon.vue create mode 100644 monolithic/frontend/src/components/Loading/index.ts create mode 100644 monolithic/frontend/src/components/Loading/src/Loading.vue create mode 100644 monolithic/frontend/src/components/Loading/src/createLoading.ts create mode 100644 monolithic/frontend/src/components/Loading/src/typing.ts create mode 100644 monolithic/frontend/src/components/Loading/src/useLoading.ts create mode 100644 monolithic/frontend/src/components/Markdown/index.ts create mode 100644 monolithic/frontend/src/components/Markdown/src/Markdown.vue create mode 100644 monolithic/frontend/src/components/Markdown/src/MarkdownViewer.vue create mode 100644 monolithic/frontend/src/components/Markdown/src/getTheme.ts create mode 100644 monolithic/frontend/src/components/Markdown/src/typing.ts create mode 100644 monolithic/frontend/src/components/Menu/index.ts create mode 100644 monolithic/frontend/src/components/Menu/src/BasicMenu.vue create mode 100644 monolithic/frontend/src/components/Menu/src/components/BasicMenuItem.vue create mode 100644 monolithic/frontend/src/components/Menu/src/components/BasicSubMenuItem.vue create mode 100644 monolithic/frontend/src/components/Menu/src/components/MenuItemContent.vue create mode 100644 monolithic/frontend/src/components/Menu/src/index.less create mode 100644 monolithic/frontend/src/components/Menu/src/props.ts create mode 100644 monolithic/frontend/src/components/Menu/src/types.ts create mode 100644 monolithic/frontend/src/components/Menu/src/useOpenKeys.ts create mode 100644 monolithic/frontend/src/components/Modal/index.ts create mode 100644 monolithic/frontend/src/components/Modal/src/BasicModal.vue create mode 100644 monolithic/frontend/src/components/Modal/src/components/Modal.tsx create mode 100644 monolithic/frontend/src/components/Modal/src/components/ModalClose.vue create mode 100644 monolithic/frontend/src/components/Modal/src/components/ModalFooter.vue create mode 100644 monolithic/frontend/src/components/Modal/src/components/ModalHeader.vue create mode 100644 monolithic/frontend/src/components/Modal/src/components/ModalWrapper.vue create mode 100644 monolithic/frontend/src/components/Modal/src/hooks/useModal.ts create mode 100644 monolithic/frontend/src/components/Modal/src/hooks/useModalContext.ts create mode 100644 monolithic/frontend/src/components/Modal/src/hooks/useModalDrag.ts create mode 100644 monolithic/frontend/src/components/Modal/src/hooks/useModalFullScreen.ts create mode 100644 monolithic/frontend/src/components/Modal/src/index.less create mode 100644 monolithic/frontend/src/components/Modal/src/props.ts create mode 100644 monolithic/frontend/src/components/Modal/src/typing.ts create mode 100644 monolithic/frontend/src/components/Page/index.ts create mode 100644 monolithic/frontend/src/components/Page/src/PageFooter.vue create mode 100644 monolithic/frontend/src/components/Page/src/PageWrapper.vue create mode 100644 monolithic/frontend/src/components/Preview/index.ts create mode 100644 monolithic/frontend/src/components/Preview/src/Functional.vue create mode 100644 monolithic/frontend/src/components/Preview/src/Preview.vue create mode 100644 monolithic/frontend/src/components/Preview/src/functional.ts create mode 100644 monolithic/frontend/src/components/Preview/src/typing.ts create mode 100644 monolithic/frontend/src/components/Qrcode/index.ts create mode 100644 monolithic/frontend/src/components/Qrcode/src/Qrcode.vue create mode 100644 monolithic/frontend/src/components/Qrcode/src/drawCanvas.ts create mode 100644 monolithic/frontend/src/components/Qrcode/src/drawLogo.ts create mode 100644 monolithic/frontend/src/components/Qrcode/src/qrcodePlus.ts create mode 100644 monolithic/frontend/src/components/Qrcode/src/toCanvas.ts create mode 100644 monolithic/frontend/src/components/Qrcode/src/typing.ts create mode 100644 monolithic/frontend/src/components/Scrollbar/index.ts create mode 100644 monolithic/frontend/src/components/Scrollbar/src/Scrollbar.vue create mode 100644 monolithic/frontend/src/components/Scrollbar/src/bar.ts create mode 100644 monolithic/frontend/src/components/Scrollbar/src/types.d.ts create mode 100644 monolithic/frontend/src/components/Scrollbar/src/util.ts create mode 100644 monolithic/frontend/src/components/SimpleMenu/index.ts create mode 100644 monolithic/frontend/src/components/SimpleMenu/src/SimpleMenu.vue create mode 100644 monolithic/frontend/src/components/SimpleMenu/src/SimpleMenuTag.vue create mode 100644 monolithic/frontend/src/components/SimpleMenu/src/SimpleSubMenu.vue create mode 100644 monolithic/frontend/src/components/SimpleMenu/src/components/Menu.vue create mode 100644 monolithic/frontend/src/components/SimpleMenu/src/components/MenuCollapseTransition.vue create mode 100644 monolithic/frontend/src/components/SimpleMenu/src/components/MenuItem.vue create mode 100644 monolithic/frontend/src/components/SimpleMenu/src/components/SubMenuItem.vue create mode 100644 monolithic/frontend/src/components/SimpleMenu/src/components/menu.less create mode 100644 monolithic/frontend/src/components/SimpleMenu/src/components/types.ts create mode 100644 monolithic/frontend/src/components/SimpleMenu/src/components/useMenu.ts create mode 100644 monolithic/frontend/src/components/SimpleMenu/src/components/useSimpleMenuContext.ts create mode 100644 monolithic/frontend/src/components/SimpleMenu/src/index.less create mode 100644 monolithic/frontend/src/components/SimpleMenu/src/types.ts create mode 100644 monolithic/frontend/src/components/SimpleMenu/src/useOpenKeys.ts create mode 100644 monolithic/frontend/src/components/StrengthMeter/index.ts create mode 100644 monolithic/frontend/src/components/StrengthMeter/src/StrengthMeter.vue create mode 100644 monolithic/frontend/src/components/Table/index.ts create mode 100644 monolithic/frontend/src/components/Table/src/BasicTable.vue create mode 100644 monolithic/frontend/src/components/Table/src/componentMap.ts create mode 100644 monolithic/frontend/src/components/Table/src/components/EditTableHeaderIcon.vue create mode 100644 monolithic/frontend/src/components/Table/src/components/HeaderCell.vue create mode 100644 monolithic/frontend/src/components/Table/src/components/TableAction.vue create mode 100644 monolithic/frontend/src/components/Table/src/components/TableFooter.vue create mode 100644 monolithic/frontend/src/components/Table/src/components/TableHeader.vue create mode 100644 monolithic/frontend/src/components/Table/src/components/TableImg.vue create mode 100644 monolithic/frontend/src/components/Table/src/components/TableTitle.vue create mode 100644 monolithic/frontend/src/components/Table/src/components/editable/CellComponent.ts create mode 100644 monolithic/frontend/src/components/Table/src/components/editable/EditableCell.vue create mode 100644 monolithic/frontend/src/components/Table/src/components/editable/helper.ts create mode 100644 monolithic/frontend/src/components/Table/src/components/editable/index.ts create mode 100644 monolithic/frontend/src/components/Table/src/components/settings/ColumnSetting.vue create mode 100644 monolithic/frontend/src/components/Table/src/components/settings/FullScreenSetting.vue create mode 100644 monolithic/frontend/src/components/Table/src/components/settings/RedoSetting.vue create mode 100644 monolithic/frontend/src/components/Table/src/components/settings/SizeSetting.vue create mode 100644 monolithic/frontend/src/components/Table/src/components/settings/index.vue create mode 100644 monolithic/frontend/src/components/Table/src/const.ts create mode 100644 monolithic/frontend/src/components/Table/src/hooks/useColumns.ts create mode 100644 monolithic/frontend/src/components/Table/src/hooks/useCustomRow.ts create mode 100644 monolithic/frontend/src/components/Table/src/hooks/useDataSource.ts create mode 100644 monolithic/frontend/src/components/Table/src/hooks/useLoading.ts create mode 100644 monolithic/frontend/src/components/Table/src/hooks/usePagination.tsx create mode 100644 monolithic/frontend/src/components/Table/src/hooks/useRowSelection.ts create mode 100644 monolithic/frontend/src/components/Table/src/hooks/useScrollTo.ts create mode 100644 monolithic/frontend/src/components/Table/src/hooks/useTable.ts create mode 100644 monolithic/frontend/src/components/Table/src/hooks/useTableContext.ts create mode 100644 monolithic/frontend/src/components/Table/src/hooks/useTableExpand.ts create mode 100644 monolithic/frontend/src/components/Table/src/hooks/useTableFooter.ts create mode 100644 monolithic/frontend/src/components/Table/src/hooks/useTableForm.ts create mode 100644 monolithic/frontend/src/components/Table/src/hooks/useTableHeader.ts create mode 100644 monolithic/frontend/src/components/Table/src/hooks/useTableScroll.ts create mode 100644 monolithic/frontend/src/components/Table/src/hooks/useTableStyle.ts create mode 100644 monolithic/frontend/src/components/Table/src/props.ts create mode 100644 monolithic/frontend/src/components/Table/src/types/column.ts create mode 100644 monolithic/frontend/src/components/Table/src/types/componentType.ts create mode 100644 monolithic/frontend/src/components/Table/src/types/pagination.ts create mode 100644 monolithic/frontend/src/components/Table/src/types/table.ts create mode 100644 monolithic/frontend/src/components/Table/src/types/tableAction.ts create mode 100644 monolithic/frontend/src/components/Time/index.ts create mode 100644 monolithic/frontend/src/components/Time/src/Time.vue create mode 100644 monolithic/frontend/src/components/Tinymce/index.ts create mode 100644 monolithic/frontend/src/components/Tinymce/src/Editor.vue create mode 100644 monolithic/frontend/src/components/Tinymce/src/ImgUpload.vue create mode 100644 monolithic/frontend/src/components/Tinymce/src/helper.ts create mode 100644 monolithic/frontend/src/components/Tinymce/src/tinymce.ts create mode 100644 monolithic/frontend/src/components/Transition/index.ts create mode 100644 monolithic/frontend/src/components/Transition/src/CollapseTransition.vue create mode 100644 monolithic/frontend/src/components/Transition/src/CreateTransition.tsx create mode 100644 monolithic/frontend/src/components/Transition/src/ExpandTransition.ts create mode 100644 monolithic/frontend/src/components/Tree/index.ts create mode 100644 monolithic/frontend/src/components/Tree/src/BasicTree.vue create mode 100644 monolithic/frontend/src/components/Tree/src/TreeIcon.ts create mode 100644 monolithic/frontend/src/components/Tree/src/components/TreeHeader.vue create mode 100644 monolithic/frontend/src/components/Tree/src/hooks/useTree.ts create mode 100644 monolithic/frontend/src/components/Tree/src/types/tree.ts create mode 100644 monolithic/frontend/src/components/Tree/style/index.less create mode 100644 monolithic/frontend/src/components/Tree/style/index.ts create mode 100644 monolithic/frontend/src/components/Upload/index.ts create mode 100644 monolithic/frontend/src/components/Upload/src/BasicUpload.vue create mode 100644 monolithic/frontend/src/components/Upload/src/FileList.vue create mode 100644 monolithic/frontend/src/components/Upload/src/ThumbUrl.vue create mode 100644 monolithic/frontend/src/components/Upload/src/UploadModal.vue create mode 100644 monolithic/frontend/src/components/Upload/src/UploadPreviewModal.vue create mode 100644 monolithic/frontend/src/components/Upload/src/data.tsx create mode 100644 monolithic/frontend/src/components/Upload/src/helper.ts create mode 100644 monolithic/frontend/src/components/Upload/src/props.ts create mode 100644 monolithic/frontend/src/components/Upload/src/typing.ts create mode 100644 monolithic/frontend/src/components/Upload/src/useUpload.ts create mode 100644 monolithic/frontend/src/components/Verify/index.ts create mode 100644 monolithic/frontend/src/components/Verify/src/DragVerify.vue create mode 100644 monolithic/frontend/src/components/Verify/src/ImgRotate.vue create mode 100644 monolithic/frontend/src/components/Verify/src/props.ts create mode 100644 monolithic/frontend/src/components/Verify/src/typing.ts create mode 100644 monolithic/frontend/src/components/VirtualScroll/index.ts create mode 100644 monolithic/frontend/src/components/VirtualScroll/src/VirtualScroll.vue create mode 100644 monolithic/frontend/src/components/registerGlobComp.ts create mode 100644 monolithic/frontend/src/design/ant/btn.less create mode 100644 monolithic/frontend/src/design/ant/index.less create mode 100644 monolithic/frontend/src/design/ant/input.less create mode 100644 monolithic/frontend/src/design/ant/pagination.less create mode 100644 monolithic/frontend/src/design/ant/table.less create mode 100644 monolithic/frontend/src/design/color.less create mode 100644 monolithic/frontend/src/design/config.less create mode 100644 monolithic/frontend/src/design/index.less create mode 100644 monolithic/frontend/src/design/public.less create mode 100644 monolithic/frontend/src/design/theme.less create mode 100644 monolithic/frontend/src/design/transition/base.less create mode 100644 monolithic/frontend/src/design/transition/fade.less create mode 100644 monolithic/frontend/src/design/transition/index.less create mode 100644 monolithic/frontend/src/design/transition/scale.less create mode 100644 monolithic/frontend/src/design/transition/scroll.less create mode 100644 monolithic/frontend/src/design/transition/slide.less create mode 100644 monolithic/frontend/src/design/transition/zoom.less create mode 100644 monolithic/frontend/src/design/var/breakpoint.less create mode 100644 monolithic/frontend/src/design/var/easing.less create mode 100644 monolithic/frontend/src/design/var/index.less create mode 100644 monolithic/frontend/src/directives/clickOutside.ts create mode 100644 monolithic/frontend/src/directives/index.ts create mode 100644 monolithic/frontend/src/directives/loading.ts create mode 100644 monolithic/frontend/src/directives/permission.ts create mode 100644 monolithic/frontend/src/directives/repeatClick.ts create mode 100644 monolithic/frontend/src/directives/ripple/index.less create mode 100644 monolithic/frontend/src/directives/ripple/index.ts create mode 100644 monolithic/frontend/src/enums/appEnum.ts create mode 100644 monolithic/frontend/src/enums/breakpointEnum.ts create mode 100644 monolithic/frontend/src/enums/cacheEnum.ts create mode 100644 monolithic/frontend/src/enums/exceptionEnum.ts create mode 100644 monolithic/frontend/src/enums/httpEnum.ts create mode 100644 monolithic/frontend/src/enums/menuEnum.ts create mode 100644 monolithic/frontend/src/enums/pageEnum.ts create mode 100644 monolithic/frontend/src/enums/roleEnum.ts create mode 100644 monolithic/frontend/src/enums/sizeEnum.ts create mode 100644 monolithic/frontend/src/hooks/component/useFormItem.ts create mode 100644 monolithic/frontend/src/hooks/component/usePageContext.ts create mode 100644 monolithic/frontend/src/hooks/core/onMountedOrActivated.ts create mode 100644 monolithic/frontend/src/hooks/core/useAttrs.ts create mode 100644 monolithic/frontend/src/hooks/core/useContext.ts create mode 100644 monolithic/frontend/src/hooks/core/useLockFn.ts create mode 100644 monolithic/frontend/src/hooks/core/useRefs.ts create mode 100644 monolithic/frontend/src/hooks/core/useTimeout.ts create mode 100644 monolithic/frontend/src/hooks/event/useBreakpoint.ts create mode 100644 monolithic/frontend/src/hooks/event/useEventListener.ts create mode 100644 monolithic/frontend/src/hooks/event/useIntersectionObserver.ts create mode 100644 monolithic/frontend/src/hooks/event/useScroll.ts create mode 100644 monolithic/frontend/src/hooks/event/useScrollTo.ts create mode 100644 monolithic/frontend/src/hooks/event/useWindowSizeFn.ts create mode 100644 monolithic/frontend/src/hooks/setting/index.ts create mode 100644 monolithic/frontend/src/hooks/setting/useHeaderSetting.ts create mode 100644 monolithic/frontend/src/hooks/setting/useMenuSetting.ts create mode 100644 monolithic/frontend/src/hooks/setting/useMultipleTabSetting.ts create mode 100644 monolithic/frontend/src/hooks/setting/useRootSetting.ts create mode 100644 monolithic/frontend/src/hooks/setting/useTransitionSetting.ts create mode 100644 monolithic/frontend/src/hooks/web/useAppInject.ts create mode 100644 monolithic/frontend/src/hooks/web/useContentHeight.ts create mode 100644 monolithic/frontend/src/hooks/web/useContextMenu.ts create mode 100644 monolithic/frontend/src/hooks/web/useCopyToClipboard.ts create mode 100644 monolithic/frontend/src/hooks/web/useDesign.ts create mode 100644 monolithic/frontend/src/hooks/web/useECharts.ts create mode 100644 monolithic/frontend/src/hooks/web/useFullContent.ts create mode 100644 monolithic/frontend/src/hooks/web/useI18n.ts create mode 100644 monolithic/frontend/src/hooks/web/useLockPage.ts create mode 100644 monolithic/frontend/src/hooks/web/useMessage.tsx create mode 100644 monolithic/frontend/src/hooks/web/usePage.ts create mode 100644 monolithic/frontend/src/hooks/web/usePagination.ts create mode 100644 monolithic/frontend/src/hooks/web/usePermission.ts create mode 100644 monolithic/frontend/src/hooks/web/useScript.ts create mode 100644 monolithic/frontend/src/hooks/web/useSortable.ts create mode 100644 monolithic/frontend/src/hooks/web/useTabs.ts create mode 100644 monolithic/frontend/src/hooks/web/useTitle.ts create mode 100644 monolithic/frontend/src/hooks/web/useWatermark.ts create mode 100644 monolithic/frontend/src/layouts/default/content/index.vue create mode 100644 monolithic/frontend/src/layouts/default/content/useContentContext.ts create mode 100644 monolithic/frontend/src/layouts/default/content/useContentViewHeight.ts create mode 100644 monolithic/frontend/src/layouts/default/feature/index.vue create mode 100644 monolithic/frontend/src/layouts/default/footer/index.vue create mode 100644 monolithic/frontend/src/layouts/default/header/MultipleHeader.vue create mode 100644 monolithic/frontend/src/layouts/default/header/components/Breadcrumb.vue create mode 100644 monolithic/frontend/src/layouts/default/header/components/ErrorAction.vue create mode 100644 monolithic/frontend/src/layouts/default/header/components/FullScreen.vue create mode 100644 monolithic/frontend/src/layouts/default/header/components/index.ts create mode 100644 monolithic/frontend/src/layouts/default/header/components/lock/LockModal.vue create mode 100644 monolithic/frontend/src/layouts/default/header/components/notify/NoticeList.vue create mode 100644 monolithic/frontend/src/layouts/default/header/components/notify/data.ts create mode 100644 monolithic/frontend/src/layouts/default/header/components/notify/index.vue create mode 100644 monolithic/frontend/src/layouts/default/header/components/user-dropdown/DropMenuItem.vue create mode 100644 monolithic/frontend/src/layouts/default/header/components/user-dropdown/index.vue create mode 100644 monolithic/frontend/src/layouts/default/header/index.less create mode 100644 monolithic/frontend/src/layouts/default/header/index.vue create mode 100644 monolithic/frontend/src/layouts/default/index.vue create mode 100644 monolithic/frontend/src/layouts/default/menu/index.vue create mode 100644 monolithic/frontend/src/layouts/default/menu/useLayoutMenu.ts create mode 100644 monolithic/frontend/src/layouts/default/setting/SettingDrawer.tsx create mode 100644 monolithic/frontend/src/layouts/default/setting/components/InputNumberItem.vue create mode 100644 monolithic/frontend/src/layouts/default/setting/components/SelectItem.vue create mode 100644 monolithic/frontend/src/layouts/default/setting/components/SettingFooter.vue create mode 100644 monolithic/frontend/src/layouts/default/setting/components/SwitchItem.vue create mode 100644 monolithic/frontend/src/layouts/default/setting/components/ThemeColorPicker.vue create mode 100644 monolithic/frontend/src/layouts/default/setting/components/TypePicker.vue create mode 100644 monolithic/frontend/src/layouts/default/setting/components/index.ts create mode 100644 monolithic/frontend/src/layouts/default/setting/enum.ts create mode 100644 monolithic/frontend/src/layouts/default/setting/handler.ts create mode 100644 monolithic/frontend/src/layouts/default/setting/index.vue create mode 100644 monolithic/frontend/src/layouts/default/sider/DragBar.vue create mode 100644 monolithic/frontend/src/layouts/default/sider/LayoutSider.vue create mode 100644 monolithic/frontend/src/layouts/default/sider/MixSider.vue create mode 100644 monolithic/frontend/src/layouts/default/sider/index.vue create mode 100644 monolithic/frontend/src/layouts/default/sider/useLayoutSider.ts create mode 100644 monolithic/frontend/src/layouts/default/tabs/components/FoldButton.vue create mode 100644 monolithic/frontend/src/layouts/default/tabs/components/TabContent.vue create mode 100644 monolithic/frontend/src/layouts/default/tabs/components/TabRedo.vue create mode 100644 monolithic/frontend/src/layouts/default/tabs/index.less create mode 100644 monolithic/frontend/src/layouts/default/tabs/index.vue create mode 100644 monolithic/frontend/src/layouts/default/tabs/types.ts create mode 100644 monolithic/frontend/src/layouts/default/tabs/useMultipleTabs.ts create mode 100644 monolithic/frontend/src/layouts/default/tabs/useTabDropdown.ts create mode 100644 monolithic/frontend/src/layouts/default/trigger/HeaderTrigger.vue create mode 100644 monolithic/frontend/src/layouts/default/trigger/SiderTrigger.vue create mode 100644 monolithic/frontend/src/layouts/default/trigger/index.vue create mode 100644 monolithic/frontend/src/layouts/iframe/index.vue create mode 100644 monolithic/frontend/src/layouts/iframe/useFrameKeepAlive.ts create mode 100644 monolithic/frontend/src/layouts/page/index.vue create mode 100644 monolithic/frontend/src/layouts/page/transition.ts create mode 100644 monolithic/frontend/src/locales/helper.ts create mode 100644 monolithic/frontend/src/locales/lang/en.ts create mode 100644 monolithic/frontend/src/locales/lang/en/common.ts create mode 100644 monolithic/frontend/src/locales/lang/en/component.ts create mode 100644 monolithic/frontend/src/locales/lang/en/layout.ts create mode 100644 monolithic/frontend/src/locales/lang/en/routes/app.ts create mode 100644 monolithic/frontend/src/locales/lang/en/routes/basic.ts create mode 100644 monolithic/frontend/src/locales/lang/en/routes/dashboard.ts create mode 100644 monolithic/frontend/src/locales/lang/en/sys.ts create mode 100644 monolithic/frontend/src/locales/lang/zh-CN/antdLocale/DatePicker.ts create mode 100644 monolithic/frontend/src/locales/lang/zh-CN/common.ts create mode 100644 monolithic/frontend/src/locales/lang/zh-CN/component.ts create mode 100644 monolithic/frontend/src/locales/lang/zh-CN/layout.ts create mode 100644 monolithic/frontend/src/locales/lang/zh-CN/routes/basic.ts create mode 100644 monolithic/frontend/src/locales/lang/zh-CN/routes/dashboard.ts create mode 100644 monolithic/frontend/src/locales/lang/zh-CN/routes/menu.ts create mode 100644 monolithic/frontend/src/locales/lang/zh-CN/sys.ts create mode 100644 monolithic/frontend/src/locales/lang/zh_CN.ts create mode 100644 monolithic/frontend/src/locales/setupI18n.ts create mode 100644 monolithic/frontend/src/locales/useLocale.ts create mode 100644 monolithic/frontend/src/logics/error-handle/index.ts create mode 100644 monolithic/frontend/src/logics/initAppConfig.ts create mode 100644 monolithic/frontend/src/logics/mitt/routeChange.ts create mode 100644 monolithic/frontend/src/logics/theme/dark.ts create mode 100644 monolithic/frontend/src/logics/theme/index.ts create mode 100644 monolithic/frontend/src/logics/theme/updateBackground.ts create mode 100644 monolithic/frontend/src/logics/theme/updateColorWeak.ts create mode 100644 monolithic/frontend/src/logics/theme/updateGrayMode.ts create mode 100644 monolithic/frontend/src/logics/theme/util.ts create mode 100644 monolithic/frontend/src/main.ts create mode 100644 monolithic/frontend/src/router/constant.ts create mode 100644 monolithic/frontend/src/router/guard/index.ts create mode 100644 monolithic/frontend/src/router/guard/paramMenuGuard.ts create mode 100644 monolithic/frontend/src/router/guard/permissionGuard.ts create mode 100644 monolithic/frontend/src/router/guard/stateGuard.ts create mode 100644 monolithic/frontend/src/router/helper/menuHelper.ts create mode 100644 monolithic/frontend/src/router/helper/routeHelper.ts create mode 100644 monolithic/frontend/src/router/index.ts create mode 100644 monolithic/frontend/src/router/menus/index.ts create mode 100644 monolithic/frontend/src/router/routes/basic.ts create mode 100644 monolithic/frontend/src/router/routes/index.ts create mode 100644 monolithic/frontend/src/router/routes/mainOut.ts create mode 100644 monolithic/frontend/src/router/routes/modules/app/system.ts create mode 100644 monolithic/frontend/src/router/routes/modules/dashboard.ts create mode 100644 monolithic/frontend/src/router/types.ts create mode 100644 monolithic/frontend/src/settings/componentSetting.ts create mode 100644 monolithic/frontend/src/settings/designSetting.ts create mode 100644 monolithic/frontend/src/settings/encryptionSetting.ts create mode 100644 monolithic/frontend/src/settings/localeSetting.ts create mode 100644 monolithic/frontend/src/settings/projectSetting.ts create mode 100644 monolithic/frontend/src/settings/siteSetting.ts create mode 100644 monolithic/frontend/src/store/index.ts create mode 100644 monolithic/frontend/src/store/modules/app.ts create mode 100644 monolithic/frontend/src/store/modules/errorLog.ts create mode 100644 monolithic/frontend/src/store/modules/locale.ts create mode 100644 monolithic/frontend/src/store/modules/lock.ts create mode 100644 monolithic/frontend/src/store/modules/multipleTab.ts create mode 100644 monolithic/frontend/src/store/modules/permission.ts create mode 100644 monolithic/frontend/src/store/modules/user.ts create mode 100644 monolithic/frontend/src/utils/auth/index.ts create mode 100644 monolithic/frontend/src/utils/bem.ts create mode 100644 monolithic/frontend/src/utils/cache/index.ts create mode 100644 monolithic/frontend/src/utils/cache/memory.ts create mode 100644 monolithic/frontend/src/utils/cache/persistent.ts create mode 100644 monolithic/frontend/src/utils/cache/storageCache.ts create mode 100644 monolithic/frontend/src/utils/cipher.ts create mode 100644 monolithic/frontend/src/utils/color.ts create mode 100644 monolithic/frontend/src/utils/dateUtil.ts create mode 100644 monolithic/frontend/src/utils/domUtils.ts create mode 100644 monolithic/frontend/src/utils/env.ts create mode 100644 monolithic/frontend/src/utils/event/index.ts create mode 100644 monolithic/frontend/src/utils/factory/createAsyncComponent.tsx create mode 100644 monolithic/frontend/src/utils/file/base64Conver.ts create mode 100644 monolithic/frontend/src/utils/file/download.ts create mode 100644 monolithic/frontend/src/utils/helper/treeHelper.ts create mode 100644 monolithic/frontend/src/utils/helper/tsxHelper.tsx create mode 100644 monolithic/frontend/src/utils/http/axios/Axios.ts create mode 100644 monolithic/frontend/src/utils/http/axios/axiosCancel.ts create mode 100644 monolithic/frontend/src/utils/http/axios/axiosRetry.ts create mode 100644 monolithic/frontend/src/utils/http/axios/axiosTransform.ts create mode 100644 monolithic/frontend/src/utils/http/axios/checkStatus.ts create mode 100644 monolithic/frontend/src/utils/http/axios/helper.ts create mode 100644 monolithic/frontend/src/utils/http/axios/index.ts create mode 100644 monolithic/frontend/src/utils/index.ts create mode 100644 monolithic/frontend/src/utils/is.ts create mode 100644 monolithic/frontend/src/utils/lib/echarts.ts create mode 100644 monolithic/frontend/src/utils/log.ts create mode 100644 monolithic/frontend/src/utils/mitt.ts create mode 100644 monolithic/frontend/src/utils/openapi-axios/index.ts create mode 100644 monolithic/frontend/src/utils/propTypes.ts create mode 100644 monolithic/frontend/src/utils/props.ts create mode 100644 monolithic/frontend/src/utils/types.ts create mode 100644 monolithic/frontend/src/utils/uuid.ts create mode 100644 monolithic/frontend/src/views/app/system/account/AccountBind.vue create mode 100644 monolithic/frontend/src/views/app/system/account/BaseSetting.vue create mode 100644 monolithic/frontend/src/views/app/system/account/MsgNotify.vue create mode 100644 monolithic/frontend/src/views/app/system/account/SecureSetting.vue create mode 100644 monolithic/frontend/src/views/app/system/account/data.tsx create mode 100644 monolithic/frontend/src/views/app/system/account/index.vue create mode 100644 monolithic/frontend/src/views/app/system/menu/index.vue create mode 100644 monolithic/frontend/src/views/app/system/menu/menu-drawer.vue create mode 100644 monolithic/frontend/src/views/app/system/menu/menu.data.tsx create mode 100644 monolithic/frontend/src/views/app/system/org/index.vue create mode 100644 monolithic/frontend/src/views/app/system/org/org-modal.vue create mode 100644 monolithic/frontend/src/views/app/system/org/org.data.tsx create mode 100644 monolithic/frontend/src/views/app/system/position/index.vue create mode 100644 monolithic/frontend/src/views/app/system/position/position-drawer.vue create mode 100644 monolithic/frontend/src/views/app/system/position/position.data.tsx create mode 100644 monolithic/frontend/src/views/app/system/role/index.vue create mode 100644 monolithic/frontend/src/views/app/system/role/role-drawer.vue create mode 100644 monolithic/frontend/src/views/app/system/role/role.data.tsx create mode 100644 monolithic/frontend/src/views/app/system/users/detail/index.vue create mode 100644 monolithic/frontend/src/views/app/system/users/index.vue create mode 100644 monolithic/frontend/src/views/app/system/users/org-tree.vue create mode 100644 monolithic/frontend/src/views/app/system/users/user-modal.vue create mode 100644 monolithic/frontend/src/views/app/system/users/users.data.tsx create mode 100644 monolithic/frontend/src/views/dashboard/analysis/components/GrowCard.vue create mode 100644 monolithic/frontend/src/views/dashboard/analysis/components/SalesProductPie.vue create mode 100644 monolithic/frontend/src/views/dashboard/analysis/components/SiteAnalysis.vue create mode 100644 monolithic/frontend/src/views/dashboard/analysis/components/VisitAnalysis.vue create mode 100644 monolithic/frontend/src/views/dashboard/analysis/components/VisitAnalysisBar.vue create mode 100644 monolithic/frontend/src/views/dashboard/analysis/components/VisitRadar.vue create mode 100644 monolithic/frontend/src/views/dashboard/analysis/components/VisitSource.vue create mode 100644 monolithic/frontend/src/views/dashboard/analysis/components/props.ts create mode 100644 monolithic/frontend/src/views/dashboard/analysis/data.tsx create mode 100644 monolithic/frontend/src/views/dashboard/analysis/index.vue create mode 100644 monolithic/frontend/src/views/dashboard/workbench/components/DynamicInfo.vue create mode 100644 monolithic/frontend/src/views/dashboard/workbench/components/ProjectCard.vue create mode 100644 monolithic/frontend/src/views/dashboard/workbench/components/QuickNav.vue create mode 100644 monolithic/frontend/src/views/dashboard/workbench/components/SaleRadar.vue create mode 100644 monolithic/frontend/src/views/dashboard/workbench/components/WorkbenchHeader.vue create mode 100644 monolithic/frontend/src/views/dashboard/workbench/components/data.ts create mode 100644 monolithic/frontend/src/views/dashboard/workbench/index.vue create mode 100644 monolithic/frontend/src/views/sys/error-log/DetailModal.vue create mode 100644 monolithic/frontend/src/views/sys/error-log/data.tsx create mode 100644 monolithic/frontend/src/views/sys/error-log/index.vue create mode 100644 monolithic/frontend/src/views/sys/exception/Exception.vue create mode 100644 monolithic/frontend/src/views/sys/exception/index.ts create mode 100644 monolithic/frontend/src/views/sys/iframe/FrameBlank.vue create mode 100644 monolithic/frontend/src/views/sys/iframe/index.vue create mode 100644 monolithic/frontend/src/views/sys/lock/LockPage.vue create mode 100644 monolithic/frontend/src/views/sys/lock/index.vue create mode 100644 monolithic/frontend/src/views/sys/lock/useNow.ts create mode 100644 monolithic/frontend/src/views/sys/login/ForgetPasswordForm.vue create mode 100644 monolithic/frontend/src/views/sys/login/Login.vue create mode 100644 monolithic/frontend/src/views/sys/login/LoginForm.vue create mode 100644 monolithic/frontend/src/views/sys/login/LoginFormTitle.vue create mode 100644 monolithic/frontend/src/views/sys/login/MobileForm.vue create mode 100644 monolithic/frontend/src/views/sys/login/QrCodeForm.vue create mode 100644 monolithic/frontend/src/views/sys/login/RegisterForm.vue create mode 100644 monolithic/frontend/src/views/sys/login/SessionTimeoutLogin.vue create mode 100644 monolithic/frontend/src/views/sys/login/useLogin.ts create mode 100644 monolithic/frontend/src/views/sys/main-out/index.vue create mode 100644 monolithic/frontend/src/views/sys/redirect/index.vue create mode 100644 monolithic/frontend/stylelint.config.js create mode 100644 monolithic/frontend/tsconfig.json create mode 100644 monolithic/frontend/types/axios.d.ts create mode 100644 monolithic/frontend/types/config.d.ts create mode 100644 monolithic/frontend/types/global.d.ts create mode 100644 monolithic/frontend/types/index.d.ts create mode 100644 monolithic/frontend/types/module.d.ts create mode 100644 monolithic/frontend/types/openapi.d.ts create mode 100644 monolithic/frontend/types/store.d.ts create mode 100644 monolithic/frontend/types/utils.d.ts create mode 100644 monolithic/frontend/types/vue-router.d.ts create mode 100644 monolithic/frontend/vite.config.ts create mode 100644 monolithic/frontend/windi.config.ts diff --git a/README-CN.md b/README-CN.md index 21fa60f..03de883 100644 --- a/README-CN.md +++ b/README-CN.md @@ -2,31 +2,32 @@ [English](README.md) | 简体中文 -| 项目名 | 说明 | -|------------------------------|----------------------------------| -| [auth/jwt](./auth/jwt) | JWT使用示例 | -| [blog](./blog) | 博客系统,简单的CRUD示例 | -| [casbin](./casbin) | JWT认证和Casbin鉴权的示例 | -| [chatroom](./chatroom) | 最简单的Websocket聊天室示例 | -| [config](./config) | 文件配置和远程配置中心使用示例 | -| [cqrs](./cqrs) | CQRS模式实现示例,主要是Kafka的使用。 | -| [errors](./errors) | 错误处理示例 | -| [event](./event) | 使用Kafka等MQ收发消息示例 | -| [header](./header) | 自定义HTTP的Header示例 | -| [helloworld](./helloworld) | RPC调用示例 | -| [http](./http) | HTTP相关应用的示例,如:CORS、上传文件等。 | -| [i18n](./i18n) | 国际化与本地化的示例 | -| [log](./log) | 日志使用示例 | -| [metadata](./metadata) | 元数据使用示例 | -| [metrics](./metrics) | 度量系统使用示例 | -| [middleware](./middleware) | 中间件使用示例 | -| [realtimemap](./realtimemap) | 实时公交地图,主要是MQTT、Websocket、RPC综合使用 | -| [registry](./registry) | 注册中心使用示例 | -| [selector](./selector) | 节点选择器使用示例 | -| [stream](./stream) | | -| [swagger](./swagger) | swagger api使用示例 | -| [tls](./tls) | TLS证书使用示例 | -| [traces](./traces) | 链路追踪系统使用示例 | -| [transaction](./transaction) | 数据库事务使用示例 | -| [validate](./validate) | Protobuf参数校验器使用示例 | -| [ws](./ws) | 最简单的Websocket示例 | +| 项目名 | 说明 | +| ---------------------------- | -------------------------------------------------- | +| [auth/jwt](./auth/jwt) | JWT 使用示例 | +| [blog](./blog) | 博客系统,简单的 CRUD 示例 | +| [casbin](./casbin) | JWT 认证和 Casbin 鉴权的示例 | +| [chatroom](./chatroom) | 最简单的 Websocket 聊天室示例 | +| [config](./config) | 文件配置和远程配置中心使用示例 | +| [cqrs](./cqrs) | CQRS 模式实现示例,主要是 Kafka 的使用。 | +| [errors](./errors) | 错误处理示例 | +| [event](./event) | 使用 Kafka 等 MQ 收发消息示例 | +| [header](./header) | 自定义 HTTP 的 Header 示例 | +| [helloworld](./helloworld) | RPC 调用示例 | +| [http](./http) | HTTP 相关应用的示例,如:CORS、上传文件等。 | +| [i18n](./i18n) | 国际化与本地化的示例 | +| [log](./log) | 日志使用示例 | +| [metadata](./metadata) | 元数据使用示例 | +| [metrics](./metrics) | 度量系统使用示例 | +| [middleware](./middleware) | 中间件使用示例 | +| [realtimemap](./realtimemap) | 实时公交地图,主要是 MQTT、Websocket、RPC 综合使用 | +| [registry](./registry) | 注册中心使用示例 | +| [selector](./selector) | 节点选择器使用示例 | +| [stream](./stream) | | +| [swagger](./swagger) | swagger api 使用示例 | +| [tls](./tls) | TLS 证书使用示例 | +| [traces](./traces) | 链路追踪系统使用示例 | +| [transaction](./transaction) | 数据库事务使用示例 | +| [validate](./validate) | Protobuf 参数校验器使用示例 | +| [ws](./ws) | 最简单的 Websocket 示例 | +| [monolithic](./monolithic) | 巨石系统(单体系统)应用实例,包含前后端。 | diff --git a/README.md b/README.md index 19b2b6e..1aba29a 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,33 @@ -# examples +# Kratos examples English | [简体中文](README-CN.md) -- blog is simple crud project. -- config is kratos config example. -- errors is kratos errors example, it is generated through proto-gen-go-errors. -- helloworld is helloworld example. -- http is transport/http some examples of usage. -- log is log example, including、logger、helper、filter、valuer, etc. -- metadata is metadata example. -- metrics is metrics example, in the example, prom is used to collect data. -- registry is registration and discovery examples,including Etcd, Consul, Nacos. -- traces is middleware/tracing example,middleware/tracing is implemented by opentelemetry. -- validate is middleware/validate example, the verification code is generated by proto-gen-validate. -- ws is implementation of transport interface with websocket example. -- swagger is implementation of server with embed swagger api. +| Project Name | Description | +| ---------------------------- | ----------------------------------------------------------------------- | +| [auth/jwt](./auth/jwt) | Examples of JWT usage | +| [blog](./blog) | Blog system, simple CRUD example | +| [casbin](./casbin) | Examples of JWT authentication and Casbin authentication | +| [chatroom](./chatroom) | The simplest Websocket chat room example | +| [config](./config) | Examples of file configuration and remote configuration Center usage | +| [cqrs](./cqrs) | Examples of CQRS pattern implementation, mainly the use of Kafka. | +| [errors](./errors) | Error handling example | +| [event](./event) | Example of sending and receiving messages using MQ like Kafka | +| [header](./header) | Example of a custom HTTP Header | +| [helloworld](./helloworld) | RPC Call example | +| [http](./http) | Examples of HTTP-related applications, such as CORS and uploading files | +| [i18n](./i18n) | Examples of internationalization and localization | +| [log](./log) | Log usage example | +| [metadata](./metadata) | Examples of metadata usage | +| [metrics](./metrics) | Measurement system usage examples | +| [middleware](./middleware) | Middleware usage Examples | +| [realtimemap](./realtimemap) | Real-time bus map, mainly MQTT, Websocket, RPC integrated use | +| [registry](./registry) | Registry center usage examples | +| [selector](./selector) | Examples of node selector usage | +| [stream](./stream) | | +| [swagger](./swagger) | swagger is implementation of server with embed swagger api | +| [tls](./tls) | Example of TLS certificate usage | +| [traces](./traces) | Example of Distributed Tracing system | +| [transaction](./transaction) | Sample database transaction usage | +| [validate](./validate) | Example of Protobuf parameter validator usage | +| [ws](./ws) | ws is implementation of transport interface with websocket example | +| [monolithic](./monolithic) | Monolithic Application example, including frontend and backends. | diff --git a/monolithic/.gitignore b/monolithic/.gitignore new file mode 100644 index 0000000..3b735ec --- /dev/null +++ b/monolithic/.gitignore @@ -0,0 +1,21 @@ +# If you prefer the allow list template instead of the deny list, see community template: +# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore +# +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ + +# Go workspace file +go.work diff --git a/monolithic/LICENSE b/monolithic/LICENSE new file mode 100644 index 0000000..0ceaadc --- /dev/null +++ b/monolithic/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Bobo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/monolithic/README.md b/monolithic/README.md new file mode 100644 index 0000000..f8a9bf6 --- /dev/null +++ b/monolithic/README.md @@ -0,0 +1,4 @@ +# Golang微服务框架Kratos的巨石应用实践 + +- 后端基于 golang微服务框架 [go-kratos](https://go-kratos.dev/) +- 前端基于 [VUE3](https://vuejs.org/) + [TypeScript](https://www.typescriptlang.org/) diff --git a/monolithic/backend/.gitignore b/monolithic/backend/.gitignore new file mode 100644 index 0000000..5904cde --- /dev/null +++ b/monolithic/backend/.gitignore @@ -0,0 +1,35 @@ +# Reference https://github.com/github/gitignore/blob/master/Go.gitignore +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +vendor/ + +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a + +# OS General +Thumbs.db +.DS_Store + +# project +*.cert +*.key +*.log +bin/ + +# Develop tools +.vscode/ +.idea/ +*.swp diff --git a/monolithic/backend/.markdownlint.yaml b/monolithic/backend/.markdownlint.yaml new file mode 100644 index 0000000..8071999 --- /dev/null +++ b/monolithic/backend/.markdownlint.yaml @@ -0,0 +1,4 @@ +--- +line-length: false +no-hard-tabs: false +no-inline-html: false \ No newline at end of file diff --git a/monolithic/backend/.yamllint b/monolithic/backend/.yamllint new file mode 100644 index 0000000..7a8e34b --- /dev/null +++ b/monolithic/backend/.yamllint @@ -0,0 +1,10 @@ +# vim: ft=yaml +--- +yaml-files: + - "*.yaml" + - "*.yml" + - ".yamllint" +extends: "default" +rules: + quoted-strings: "enable" + line-length: "disable" \ No newline at end of file diff --git a/monolithic/backend/Makefile b/monolithic/backend/Makefile new file mode 100644 index 0000000..5b48260 --- /dev/null +++ b/monolithic/backend/Makefile @@ -0,0 +1,95 @@ +# Not Support Windows + +.PHONY: help wire gen ent build api openapi init all + +ifeq ($(OS),Windows_NT) + IS_WINDOWS:=1 +endif + +CURRENT_DIR := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST))))) +ROOT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST)))) + +SRCS_MK := $(foreach dir, app, $(wildcard $(dir)/*/*/Makefile)) + +# initialize develop environment +init: plugin cli + +# install protoc plugin +plugin: + @go install google.golang.org/protobuf/cmd/protoc-gen-go@latest + @go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest + @go install github.com/go-kratos/kratos/cmd/protoc-gen-go-http/v2@latest + @go install github.com/go-kratos/kratos/cmd/protoc-gen-go-errors/v2@latest + @go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@latest + @go install github.com/google/gnostic/cmd/protoc-gen-openapi@latest + @go install github.com/envoyproxy/protoc-gen-validate@latest + +# install cli tools +cli: + @go install github.com/go-kratos/kratos/cmd/kratos/v2@latest + @go install github.com/google/gnostic@latest + @go install github.com/bufbuild/buf/cmd/buf@latest + @go install entgo.io/ent/cmd/ent@latest + @go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest + +# generate wire code +wire: + $(foreach dir, $(dir $(realpath $(SRCS_MK))),\ + cd $(dir);\ + make wire;\ + ) + +# generate code by go:generate +gen: + $(foreach dir, $(dir $(realpath $(SRCS_MK))),\ + cd $(dir);\ + make gen;\ + ) + +# generate ent code +ent: + $(foreach dir, $(dir $(realpath $(SRCS_MK))),\ + cd $(dir);\ + make ent;\ + ) + +# generate protobuf api go code +api: + buf generate + +# generate OpenAPI v3 docs. +openapi: + buf generate --path api/admin/service/v1 --template api/admin/service/v1/buf.openapi.gen.yaml + +# build all service applications +build: + $(foreach dir, $(dir $(realpath $(SRCS_MK))),\ + cd $(dir);\ + make build;\ + ) + +# generate & build all service applications +all: + $(foreach dir, $(dir $(realpath $(SRCS_MK))),\ + cd $(dir);\ + make app;\ + ) + +# show help +help: + @echo "" + @echo "Usage:" + @echo " make [target]" + @echo "" + @echo 'Targets:' + @awk '/^[a-zA-Z\-_0-9]+:/ { \ + helpMessage = match(lastLine, /^# (.*)/); \ + if (helpMessage) { \ + helpCommand = substr($$1, 0, index($$1, ":")-1); \ + helpMessage = substr(lastLine, RSTART + 2, RLENGTH); \ + printf "\033[36m%-22s\033[0m %s\n", helpCommand,helpMessage; \ + } \ + } \ + { lastLine = $$0 }' $(MAKEFILE_LIST) + +.DEFAULT_GOAL := help diff --git a/monolithic/backend/README.md b/monolithic/backend/README.md new file mode 100644 index 0000000..8c3f493 --- /dev/null +++ b/monolithic/backend/README.md @@ -0,0 +1,89 @@ +# GO后端 + +## API文档 + +### Swagger UI + +- [Admin Swagger UI](http://localhost:7788/docs/) + +### openapi.yaml + +- [Admin openapi.yaml](http://localhost:7788/docs/openapi.yaml) + +## Buf.Build使用 + +使用[buf.build](https://buf.build/)进行Protobuf API的工程化构建。 + +相关命令行工具和插件的具体安装方法请参见:[Kratos微服务框架API工程化指南](https://juejin.cn/post/7191095845096259641) + +在`backend`根目录下执行命令: + +### 更新buf.lock + +```bash +buf mod update +``` + +### 生成GO代码 + +```bash +buf generate +``` + +### 生成OpenAPI v3文档 + +```bash +buf generate --path api/admin/service/v1 --template api/admin/service/v1/buf.openapi.gen.yaml +``` + +## Make构建 + +请在`app/{服务名}/service`下执行: + +### 初始化开发环境 + +```bash +make init +``` + +### 生成API的go代码 + +```bash +make api +``` + +### 生成API的OpenAPI v3 文档 + +```bash +make openapi +``` + +### 生成ent代码 + +```bash +make ent +``` + +### 生成wire代码 + +```bash +make wire +``` + +### 构建程序 + +```bash +make build +``` + +### 调试运行 + +```bash +make run +``` + +### 构建Docker镜像 + +```bash +make docker +``` diff --git a/monolithic/backend/api/admin/service/v1/admin_error.proto b/monolithic/backend/api/admin/service/v1/admin_error.proto new file mode 100644 index 0000000..5390855 --- /dev/null +++ b/monolithic/backend/api/admin/service/v1/admin_error.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; + +package admin.service.v1; + +import "errors/errors.proto"; + +enum AdminErrorReason { + option (errors.default_code) = 500; + + NOT_LOGGED_IN = 0 [(errors.code) = 401];// 401 + ACCESS_FORBIDDEN = 1 [(errors.code) = 403]; // 403 + RESOURCE_NOT_FOUND = 2 [(errors.code) = 404]; // 404 + METHOD_NOT_ALLOWED = 3 [(errors.code) = 405]; // 405 + REQUEST_TIMEOUT = 4 [(errors.code) = 408]; // 408 + INTERNAL_SERVER_ERROR = 5 [(errors.code) = 500]; // 500 + NOT_IMPLEMENTED = 6 [(errors.code) = 501]; // 501 + NETWORK_ERROR = 7 [(errors.code) = 502]; // 502 + SERVICE_UNAVAILABLE = 8 [(errors.code) = 503]; // 503 + NETWORK_TIMEOUT = 9 [(errors.code) = 504]; // 504 + REQUEST_NOT_SUPPORT = 10 [(errors.code) = 505]; // 505 + + USER_NOT_FOUND = 11 [(errors.code) = 600]; + INCORRECT_PASSWORD = 12 [(errors.code) = 599]; + USER_FREEZE = 13 [(errors.code) = 598]; + + INVALID_USERID = 14 [(errors.code) = 400];// 用户ID无效 + INVALID_PASSWORD = 15 [(errors.code) = 400];// 密码无效 + TOKEN_EXPIRED = 16 [(errors.code) = 400];// token过期 + INVALID_TOKEN = 17 [(errors.code) = 400];// token无效 + TOKEN_NOT_EXIST = 18 [(errors.code) = 404];// token不存在 + USER_NOT_EXIST = 19 [(errors.code) = 404];// 用户不存在 + + BAD_REQUEST = 20 [(errors.code) = 400];// 400 +} diff --git a/monolithic/backend/api/admin/service/v1/buf.openapi.gen.yaml b/monolithic/backend/api/admin/service/v1/buf.openapi.gen.yaml new file mode 100644 index 0000000..5595a9b --- /dev/null +++ b/monolithic/backend/api/admin/service/v1/buf.openapi.gen.yaml @@ -0,0 +1,35 @@ +# 配置protoc生成规则 +version: v1 + +managed: + enabled: true + optimize_for: SPEED + + go_package_prefix: + default: kratos-monolithic-demo/gen/api/go + except: + - 'buf.build/googleapis/googleapis' + - 'buf.build/envoyproxy/protoc-gen-validate' + - 'buf.build/kratos/apis' + - 'buf.build/gnostic/gnostic' + - 'buf.build/gogo/protobuf' + - 'buf.build/tx7do/pagination' + +plugins: + # generate openapi v2 json doc +# - name: openapiv2 +# out: ../docs +# opt: +# - json_names_for_fields=true +# - logtostderr=true + + # generate openapi v3 yaml doc + - name: openapi + out: ./app/admin/service/cmd/server/assets + opt: + - naming=json # 命名约定。使用"proto"则直接从proto文件传递名称。默认为:json + - depth=2 # 循环消息的递归深度,默认为:2 + - default_response=false # 添加默认响应消息。如果为“true”,则自动为使用google.rpc.Status消息的操作添加默认响应。如果您使用envoy或grpc-gateway进行转码,则非常有用,因为它们使用此类型作为默认错误响应。默认为:true。 + - enum_type=string # 枚举类型的序列化的类型。使用"string"则进行基于字符串的序列化。默认为:integer。 + - output_mode=merged # 输出文件生成模式。默认情况下,只有一个openapi.yaml文件会生成在输出文件夹。使用“source_relative”则会为每一个'[inputfile].proto'文件单独生成一个“[inputfile].openapi.yaml”文件。默认为:merged。 + - fq_schema_naming=false # Schema的命名是否加上包名,为true,则会加上包名,例如:system.service.v1.ListDictDetailResponse,否则为:ListDictDetailResponse。默认为:false。 diff --git a/monolithic/backend/api/admin/service/v1/i_admin.proto b/monolithic/backend/api/admin/service/v1/i_admin.proto new file mode 100644 index 0000000..f5ab0db --- /dev/null +++ b/monolithic/backend/api/admin/service/v1/i_admin.proto @@ -0,0 +1,148 @@ +syntax = "proto3"; + +package admin.service.v1; + +import "gnostic/openapi/v3/annotations.proto"; + +option (gnostic.openapi.v3.document) = { + info: { + title: "Kratos巨石应用实践API"; + version: "1.0"; + description: "Kratos巨石应用实践API"; + contact: { + name: "tx7do"; + url: "https://github.com/tx7do/kratos-monolithic-demo"; + email: "yanglinbo@gmail.com"; + } + license: { + name: "MIT License"; + url: "https://github.com/tx7do/kratos-monolithic-demo/blob/master/LICENSE"; + } + } + components: { + security_schemes: { + additional_properties: [ + { + name: "OAuth2PasswordBearer"; + value: { + security_scheme: { + type: "oauth2"; + flows: { + password: { + token_url: "/admin/v1/login"; + refresh_url: "/admin/v1/refresh_token"; + scopes: {} + } + } + } + } + } + ] + } + + schemas: { + additional_properties: [ + { + name: "KratosStatus"; + value: { + schema: { + type: "object" + description: "Kratos错误返回" + properties: { + additional_properties: [ + { + name: "code" + value: { + schema: { + type: "number" + format: "int32" + description: "错误码" + } + } + }, + { + name: "message" + value: { + schema: { + type: "string" + description: "错误消息" + } + } + }, + { + name: "reason" + value: { + schema: { + type: "string" + description: "错误原因" + } + } + }, + { + name: "metadata" + value: { + schema: { + type: "object" + description: "元数据" + } + } + } + ] + } + } + } + } + ] + } + + responses: { + additional_properties: [ + { + name: "default" + value: { + response: { + description: "default kratos response" + content: { + additional_properties: [ + { + name: "application/json" + value: { + schema: { + reference: { + _ref: "#/components/schemas/KratosStatus" + } + } + } + } + ] + } + } + } + } + + // { + // name: "500" + // value: { + // response: { + // description: "default kratos response" + // content: { + // additional_properties: [ + // { + // name: "application/json" + // value: { + // schema: { + // reference: { + // _ref: "#/components/schemas/KratosStatus" + // } + // } + // } + // } + // ] + // } + // } + // } + // } + ] + } + } +}; diff --git a/monolithic/backend/api/admin/service/v1/i_authentication.proto b/monolithic/backend/api/admin/service/v1/i_authentication.proto new file mode 100644 index 0000000..b411d70 --- /dev/null +++ b/monolithic/backend/api/admin/service/v1/i_authentication.proto @@ -0,0 +1,123 @@ +syntax = "proto3"; + +package admin.service.v1; + +import "gnostic/openapi/v3/annotations.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; +import "google/api/field_behavior.proto"; + +import "user/service/v1/user.proto"; + +// 用户后台登陆认证服务 +service AuthenticationService { + // 登陆 + rpc Login (LoginRequest) returns (LoginResponse) { + option (google.api.http) = { + post: "/admin/v1/login" + body: "*" + }; + } + + // 登出 + rpc Logout (LogoutRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/admin/v1/logout" + body: "*" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 刷新认证令牌 + rpc RefreshToken (RefreshTokenRequest) returns (LoginResponse) { + option (google.api.http) = { + post: "/admin/v1/refresh_token" + body: "*" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 后台获取已经登陆的用户的数据 + rpc GetMe (GetMeRequest) returns (user.service.v1.User) { + option (google.api.http) = { + get: "/admin/v1/me" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } +} + +// 用户后台登陆 - 请求 +message LoginRequest { + string username = 1 [ + json_name = "username", + (google.api.field_behavior) = REQUIRED + ]; // 用户名,必选项。 + string password = 2 [ + json_name = "password", + (google.api.field_behavior) = REQUIRED + ]; // 用户的密码,必选项。 + string grand_type = 3 [ + json_name = "grand_type", + (google.api.field_behavior) = REQUIRED, + (gnostic.openapi.v3.property) = { + description: "授权类型,此处的值固定为\"password\",必选项。", + default: {string: "password"} + } + ]; // 授权类型,此处的值固定为"password",必选项。 + optional string scope = 4 [ + json_name = "scope", + (google.api.field_behavior) = OPTIONAL + ]; // 以空格分隔的范围列表。如果未提供,scope则授权任何范围,默认为空列表。 +} +// 用户后台登陆 - 回应 +message LoginResponse { + string access_token = 1 [json_name = "access_token"]; // 访问令牌,必选项。 + string refresh_token = 2 [json_name = "refresh_token"]; // 更新令牌,用来获取下一次的访问令牌,可选项。 + string token_type = 3 [json_name = "token_type"]; // 令牌类型,该值大小写不敏感,必选项,可以是bearer类型或mac类型。 + int64 expires_in = 4 [json_name = "expires_in"]; // 过期时间,单位为秒。如果省略该参数,必须其他方式设置过期时间。 +} + +// 用户后台登出 - 请求 +message LogoutRequest { + uint32 id = 1; +} + +// 获取当前用户信息 - 请求 +message GetMeRequest { + uint32 id = 1; +} + +// 用户刷新令牌 - 请求 +message RefreshTokenRequest { + string refresh_token = 1 [ + json_name = "refresh_token", + (google.api.field_behavior) = REQUIRED + ]; // 更新令牌,用来获取下一次的访问令牌,必选项。 + string grand_type = 2 [ + json_name = "grand_type", + (google.api.field_behavior) = REQUIRED, + (gnostic.openapi.v3.property) = { + description: "授权类型,此处的值固定为\"password\",必选项。", + default: {string: "password"} + } + ]; // 授权类型,此处的值固定为"password",必选项。 + optional string scope = 3 [ + json_name = "scope", + (google.api.field_behavior) = OPTIONAL + ]; // 以空格分隔的范围列表。如果未提供,scope则授权任何范围,默认为空列表。 +} + +// 用户刷新令牌 - 回应 +message RefreshTokenResponse { + string refresh_token = 1 [json_name = "refresh_token"]; // 更新令牌,用来获取下一次的访问令牌,可选项。 + string grand_type = 2 [json_name = "grand_type"]; // 授权类型,此处的值固定为"password",必选项。 +} diff --git a/monolithic/backend/api/admin/service/v1/i_dict.proto b/monolithic/backend/api/admin/service/v1/i_dict.proto new file mode 100644 index 0000000..2e37125 --- /dev/null +++ b/monolithic/backend/api/admin/service/v1/i_dict.proto @@ -0,0 +1,70 @@ +syntax = "proto3"; + +package admin.service.v1; + +import "gnostic/openapi/v3/annotations.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; + +import "pagination/v1/pagination.proto"; +import "system/service/v1/dict.proto"; + +// 字典服务 +service DictService { + // 查询字典列表 + rpc ListDict (pagination.PagingRequest) returns (system.service.v1.ListDictResponse) { + option (google.api.http) = { + get: "/admin/v1/dicts" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 查询字典 + rpc GetDict (system.service.v1.GetDictRequest) returns (system.service.v1.Dict) { + option (google.api.http) = { + get: "/admin/v1/dicts/{id}" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 创建字典 + rpc CreateDict (system.service.v1.CreateDictRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/admin/v1/dicts" + body: "*" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 更新字典 + rpc UpdateDict (system.service.v1.UpdateDictRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + put: "/admin/v1/dicts/{dict.id}" + body: "dict" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 删除字典 + rpc DeleteDict (system.service.v1.DeleteDictRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/admin/v1/dicts/{id}" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } +} diff --git a/monolithic/backend/api/admin/service/v1/i_dict_detail.proto b/monolithic/backend/api/admin/service/v1/i_dict_detail.proto new file mode 100644 index 0000000..21ca698 --- /dev/null +++ b/monolithic/backend/api/admin/service/v1/i_dict_detail.proto @@ -0,0 +1,70 @@ +syntax = "proto3"; + +package admin.service.v1; + +import "gnostic/openapi/v3/annotations.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; + +import "pagination/v1/pagination.proto"; +import "system/service/v1/dict_detail.proto"; + +// 数据字典详情服务 +service DictDetailService { + // 查询字典详情列表 + rpc ListDictDetail (pagination.PagingRequest) returns (system.service.v1.ListDictDetailResponse) { + option (google.api.http) = { + get: "/admin/v1/dict:details" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 查询字典详情 + rpc GetDictDetail (system.service.v1.GetDictDetailRequest) returns (system.service.v1.DictDetail) { + option (google.api.http) = { + get: "/admin/v1/dict:details/{id}" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 创建字典详情 + rpc CreateDictDetail (system.service.v1.CreateDictDetailRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/admin/v1/dict:details" + body: "*" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 更新字典详情 + rpc UpdateDictDetail (system.service.v1.UpdateDictDetailRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + put: "/admin/v1/dict:details/{detail.id}" + body: "detail" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 删除字典详情 + rpc DeleteDictDetail (system.service.v1.DeleteDictDetailRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/admin/v1/dict:details/{id}" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } +} diff --git a/monolithic/backend/api/admin/service/v1/i_menu.proto b/monolithic/backend/api/admin/service/v1/i_menu.proto new file mode 100644 index 0000000..a79a45a --- /dev/null +++ b/monolithic/backend/api/admin/service/v1/i_menu.proto @@ -0,0 +1,70 @@ +syntax = "proto3"; + +package admin.service.v1; + +import "gnostic/openapi/v3/annotations.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; + +import "pagination/v1/pagination.proto"; +import "system/service/v1/menu.proto"; + +// 后台菜单服务 +service MenuService { + // 查询菜单列表 + rpc ListMenu (pagination.PagingRequest) returns (system.service.v1.ListMenuResponse) { + option (google.api.http) = { + get: "/admin/v1/menus" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 查询菜单详情 + rpc GetMenu (system.service.v1.GetMenuRequest) returns (system.service.v1.Menu) { + option (google.api.http) = { + get: "/admin/v1/menus/{id}" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 创建菜单 + rpc CreateMenu (system.service.v1.CreateMenuRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/admin/v1/menus" + body: "*" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 更新菜单 + rpc UpdateMenu (system.service.v1.UpdateMenuRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + put: "/admin/v1/menus/{menu.id}" + body: "menu" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 删除菜单 + rpc DeleteMenu (system.service.v1.DeleteMenuRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/admin/v1/menus/{id}" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } +} diff --git a/monolithic/backend/api/admin/service/v1/i_organization.proto b/monolithic/backend/api/admin/service/v1/i_organization.proto new file mode 100644 index 0000000..66417c5 --- /dev/null +++ b/monolithic/backend/api/admin/service/v1/i_organization.proto @@ -0,0 +1,70 @@ +syntax = "proto3"; + +package admin.service.v1; + +import "gnostic/openapi/v3/annotations.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; + +import "user/service/v1/organization.proto"; +import "pagination/v1/pagination.proto"; + +// 部门管理服务 +service OrganizationService { + // 查询部门列表 + rpc ListOrganization (pagination.PagingRequest) returns (user.service.v1.ListOrganizationResponse) { + option (google.api.http) = { + get: "/admin/v1/orgs" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 查询部门详情 + rpc GetOrganization (user.service.v1.GetOrganizationRequest) returns (user.service.v1.Organization) { + option (google.api.http) = { + get: "/admin/v1/orgs/{id}" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 创建部门 + rpc CreateOrganization (user.service.v1.CreateOrganizationRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/admin/v1/orgs" + body: "*" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 更新部门 + rpc UpdateOrganization (user.service.v1.UpdateOrganizationRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + put: "/admin/v1/orgs/{org.id}" + body: "org" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 删除部门 + rpc DeleteOrganization (user.service.v1.DeleteOrganizationRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/admin/v1/orgs/{id}" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } +} diff --git a/monolithic/backend/api/admin/service/v1/i_position.proto b/monolithic/backend/api/admin/service/v1/i_position.proto new file mode 100644 index 0000000..95c5ef9 --- /dev/null +++ b/monolithic/backend/api/admin/service/v1/i_position.proto @@ -0,0 +1,70 @@ +syntax = "proto3"; + +package admin.service.v1; + +import "gnostic/openapi/v3/annotations.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; + +import "user/service/v1/position.proto"; +import "pagination/v1/pagination.proto"; + +// 职位服务 +service PositionService { + // 查询职位列表 + rpc ListPosition (pagination.PagingRequest) returns (user.service.v1.ListPositionResponse) { + option (google.api.http) = { + get: "/admin/v1/positions" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 查询职位详情 + rpc GetPosition (user.service.v1.GetPositionRequest) returns (user.service.v1.Position) { + option (google.api.http) = { + get: "/admin/v1/positions/{id}" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 创建职位 + rpc CreatePosition (user.service.v1.CreatePositionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/admin/v1/positions" + body: "*" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 更新职位 + rpc UpdatePosition (user.service.v1.UpdatePositionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + put: "/admin/v1/positions/{position.id}" + body: "position" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 删除职位 + rpc DeletePosition (user.service.v1.DeletePositionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/admin/v1/positions/{id}" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } +} diff --git a/monolithic/backend/api/admin/service/v1/i_role.proto b/monolithic/backend/api/admin/service/v1/i_role.proto new file mode 100644 index 0000000..72349ba --- /dev/null +++ b/monolithic/backend/api/admin/service/v1/i_role.proto @@ -0,0 +1,70 @@ +syntax = "proto3"; + +package admin.service.v1; + +import "gnostic/openapi/v3/annotations.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; + +import "user/service/v1/role.proto"; +import "pagination/v1/pagination.proto"; + +// 角色服务 +service RoleService { + // 查询角色列表 + rpc ListRole (pagination.PagingRequest) returns (user.service.v1.ListRoleResponse) { + option (google.api.http) = { + get: "/admin/v1/roles" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 查询角色详情 + rpc GetRole (user.service.v1.GetRoleRequest) returns (user.service.v1.Role) { + option (google.api.http) = { + get: "/admin/v1/roles/{id}" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 创建角色 + rpc CreateRole (user.service.v1.CreateRoleRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/admin/v1/roles" + body: "*" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 更新角色 + rpc UpdateRole (user.service.v1.UpdateRoleRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + put: "/admin/v1/roles/{role.id}" + body: "role" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 删除角色 + rpc DeleteRole (user.service.v1.DeleteRoleRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/admin/v1/roles/{id}" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } +} diff --git a/monolithic/backend/api/admin/service/v1/i_router.proto b/monolithic/backend/api/admin/service/v1/i_router.proto new file mode 100644 index 0000000..6654485 --- /dev/null +++ b/monolithic/backend/api/admin/service/v1/i_router.proto @@ -0,0 +1,78 @@ +syntax = "proto3"; + +package admin.service.v1; + +import "gnostic/openapi/v3/annotations.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; + +// 网站后台动态路由服务 +service RouterService { + // 查询路由列表 + rpc ListRoute (google.protobuf.Empty) returns (ListRouteResponse) { + option (google.api.http) = { + get: "/admin/v1/routes" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 查询权限码列表 + rpc ListPermissionCode (google.protobuf.Empty) returns (ListPermissionCodeResponse) { + option (google.api.http) = { + get: "/admin/v1/perm-codes" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } +} + +// 路由元数据 +message RouteMeta { + optional int32 order_no = 1 [json_name = "orderNo"]; + optional string title = 2 [json_name = "title"]; + optional int32 dynamicLevel = 3 [json_name = "dynamicLevel"]; + optional string realPath = 4 [json_name = "realPath"]; + optional string icon = 5 [json_name = "icon"]; + optional string frameSrc = 6 [json_name = "frameSrc"]; + optional string transitionName = 7 [json_name = "transitionName"]; + optional bool affix = 8 [json_name = "affix"]; + optional bool carryParam = 9 [json_name = "carryParam"]; + optional bool single = 10 [json_name = "single"]; + optional bool ignoreAuth = 11 [json_name = "ignoreAuth"]; + optional bool ignoreKeepAlive = 12 [json_name = "ignoreKeepAlive"]; + optional bool ignoreRoute = 13 [json_name = "ignoreRoute"]; + optional bool hideBreadcrumb = 14 [json_name = "hideBreadcrumb"]; + optional bool hideChildrenInMenu = 15 [json_name = "hideChildrenInMenu"]; + optional bool hideTab = 16 [json_name = "hideTab"]; + optional bool hideMenu = 17 [json_name = "hideMenu"]; + optional bool isLink = 18 [json_name = "isLink"]; + optional bool hidePathForChildren = 19 [json_name = "hidePathForChildren"]; + optional string currentActiveMenu = 20 [json_name = "currentActiveMenu"]; +} + +// 路由项 +message RouteItem { + optional string name = 1 [json_name = "name"]; + optional string alias = 2 [json_name = "alias"]; + optional string path = 3 [json_name = "path"]; + optional string component = 4 [json_name = "component"]; + optional string redirect = 5 [json_name = "redirect"]; + optional bool caseSensitive = 6 [json_name = "caseSensitive"]; + optional RouteMeta meta = 7 [json_name = "meta"]; + repeated RouteItem children = 8 [json_name = "children"]; +} + +// 查询路由列表 - 回应 +message ListRouteResponse { + repeated RouteItem items = 1; +} + +// 查询权限码列表 - 回应 +message ListPermissionCodeResponse { + repeated string codes = 1; +} diff --git a/monolithic/backend/api/admin/service/v1/i_user.proto b/monolithic/backend/api/admin/service/v1/i_user.proto new file mode 100644 index 0000000..a428b3d --- /dev/null +++ b/monolithic/backend/api/admin/service/v1/i_user.proto @@ -0,0 +1,70 @@ +syntax = "proto3"; + +package admin.service.v1; + +import "gnostic/openapi/v3/annotations.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; + +import "user/service/v1/user.proto"; +import "pagination/v1/pagination.proto"; + +// 用户管理服务 +service UserService { + // 获取用户列表 + rpc ListUser (pagination.PagingRequest) returns (user.service.v1.ListUserResponse) { + option (google.api.http) = { + get: "/admin/v1/users" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 获取用户数据 + rpc GetUser (user.service.v1.GetUserRequest) returns (user.service.v1.User) { + option (google.api.http) = { + get: "/admin/v1/users/{id}" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 创建用户 + rpc CreateUser (user.service.v1.CreateUserRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/admin/v1/users" + body: "user" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 更新用户 + rpc UpdateUser (user.service.v1.UpdateUserRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + put: "/admin/v1/users/{user.id}" + body: "user" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } + + // 删除用户 + rpc DeleteUser (user.service.v1.DeleteUserRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/admin/v1/users/{id}" + }; + + option(gnostic.openapi.v3.operation) = { + security: [{additional_properties: [{name: "OAuth2PasswordBearer"; value: {}}]}] + }; + } +} diff --git a/monolithic/backend/api/buf.lock b/monolithic/backend/api/buf.lock new file mode 100644 index 0000000..79bc2ac --- /dev/null +++ b/monolithic/backend/api/buf.lock @@ -0,0 +1,33 @@ +# Generated by buf. DO NOT EDIT. +version: v1 +deps: + - remote: buf.build + owner: envoyproxy + repository: protoc-gen-validate + commit: eac44469a7af47e7839a7f1f3d7ac004 + digest: shake256:0feabcde01b6b11e3c75a5e3f807968d5995626546f39c37e5d4205892b3a59cced0ed83b35a2eb9e6dddd3309660ad46b737c9dcd224b425de0a6654ce04417 + - remote: buf.build + owner: gnostic + repository: gnostic + commit: 087bc8072ce44e339f213209e4d57bf0 + digest: shake256:4689c26f0460fea84c4c277c1b9c7e7d657388c5b4116d1065f907a92100ffbea87de05bbd138a0166411361e1f6ce063b4c0c6002358d39710f3c4a8de788d5 + - remote: buf.build + owner: gogo + repository: protobuf + commit: 5461a3dfa9d941da82028ab185dc2a0e + digest: shake256:37c7c75224982038cb1abf45b481ef06716c1f806ffaa162018d0df092bd11a2a9b62c2d0dc0a2ae43beff86b6014fc0eb8c594ffd84d52ade4b08fca901eadc + - remote: buf.build + owner: googleapis + repository: googleapis + commit: 28151c0d0a1641bf938a7672c500e01d + digest: shake256:49215edf8ef57f7863004539deff8834cfb2195113f0b890dd1f67815d9353e28e668019165b9d872395871eeafcbab3ccfdb2b5f11734d3cca95be9e8d139de + - remote: buf.build + owner: kratos + repository: apis + commit: c2de25f14fa445a79a054214f31d17a8 + digest: shake256:91c024935d46f7966667c29e4fc933435959f93c3f0e675e1227c99db09905d44f8ec275b770da7659df5a6b18f4710da157b6d8ad760a4a95f60365b231e637 + - remote: buf.build + owner: tx7do + repository: pagination + commit: 66a7080a8ac446d0abfb0250f17cad60 + digest: shake256:cb27e819fe006fad3688c7f6c882a65ebd1511c26301fc498d652d2d3b203d6afc46346bf6173243afc854914f256cd3ac77c2c5c18638809b2d31197873bcd1 diff --git a/monolithic/backend/api/buf.yaml b/monolithic/backend/api/buf.yaml new file mode 100644 index 0000000..ba2a0b5 --- /dev/null +++ b/monolithic/backend/api/buf.yaml @@ -0,0 +1,20 @@ +version: v1 + +build: + excludes: [third_party] + +deps: + - 'buf.build/googleapis/googleapis' + - 'buf.build/envoyproxy/protoc-gen-validate' + - 'buf.build/kratos/apis' + - 'buf.build/gnostic/gnostic' + - 'buf.build/gogo/protobuf' + - 'buf.build/tx7do/pagination' + +breaking: + use: + - FILE + +lint: + use: + - DEFAULT diff --git a/monolithic/backend/api/file/service/v1/attachment.proto b/monolithic/backend/api/file/service/v1/attachment.proto new file mode 100644 index 0000000..afc2c1a --- /dev/null +++ b/monolithic/backend/api/file/service/v1/attachment.proto @@ -0,0 +1,73 @@ +syntax = "proto3"; + +package file.service.v1; + +import "google/protobuf/empty.proto"; + +import "pagination/v1/pagination.proto"; + +// 附件服务 +service AttachmentService { + // 获取附件列表 + rpc ListAttachment (pagination.PagingRequest) returns (ListAttachmentResponse) {} + + // 获取附件数据 + rpc GetAttachment (GetAttachmentRequest) returns (Attachment) {} + + // 创建附件 + rpc CreateAttachment (CreateAttachmentRequest) returns (google.protobuf.Empty) {} + + // 更新附件 + rpc UpdateAttachment (UpdateAttachmentRequest) returns (google.protobuf.Empty) {} + + // 删除附件 + rpc DeleteAttachment (DeleteAttachmentRequest) returns (google.protobuf.Empty) {} +} + +// 附件 +message Attachment { + uint32 id = 1; + optional string name = 2; + optional string path = 3; + optional string fileKey = 4; + optional string thumbPath = 5; + optional string mediaType = 6; + optional string suffix = 7; + optional int32 width = 8; + optional int32 height = 9; + optional uint64 size = 10; + optional int32 type = 11; + optional string createTime = 12; + optional string updateTime = 13; + optional string deleteTime = 14; +} + +// 附件列表 - 回应 +message ListAttachmentResponse { + repeated Attachment items = 1; + int32 total = 2; +} + +// 附件数据 - 请求 +message GetAttachmentRequest { + uint32 id = 1; +} + +// 创建附件 - 请求 +message CreateAttachmentRequest { + Attachment attachment = 1; + optional uint32 operatorId = 2; +} + +// 更新附件 - 请求 +message UpdateAttachmentRequest { + uint32 id = 1; + Attachment attachment = 2; + optional uint32 operatorId = 3; +} + +// 删除附件 - 请求 +message DeleteAttachmentRequest { + uint32 id = 1; + optional uint32 operatorId = 2; +} diff --git a/monolithic/backend/api/system/service/v1/dict.proto b/monolithic/backend/api/system/service/v1/dict.proto new file mode 100644 index 0000000..1628d23 --- /dev/null +++ b/monolithic/backend/api/system/service/v1/dict.proto @@ -0,0 +1,70 @@ +syntax = "proto3"; + +package system.service.v1; + +import "gnostic/openapi/v3/annotations.proto"; +import "google/protobuf/empty.proto"; + +import "pagination/v1/pagination.proto"; + +// 字典服务 +service DictService { + // 查询字典列表 + rpc ListDict (pagination.PagingRequest) returns (ListDictResponse) {} + + // 查询字典 + rpc GetDict (GetDictRequest) returns (Dict) {} + + // 创建字典 + rpc CreateDict (CreateDictRequest) returns (google.protobuf.Empty) {} + + // 更新字典 + rpc UpdateDict (UpdateDictRequest) returns (google.protobuf.Empty) {} + + // 删除字典 + rpc DeleteDict (DeleteDictRequest) returns (google.protobuf.Empty) {} +} + +// 数据字典 +message Dict { + uint32 id = 1 [(gnostic.openapi.v3.property) = {description: "ID"}];// ID + optional string name = 2 [(gnostic.openapi.v3.property) = {description: "字典名称"}];// 字典名称 + optional string description = 3 [(gnostic.openapi.v3.property) = {description: "描述"}];// 描述 + + optional uint32 creatorId = 10 [(gnostic.openapi.v3.property) = {description: "创建者ID"}]; // 创建者ID + optional uint32 creatorName = 11 [(gnostic.openapi.v3.property) = {description: "创建者名字"}]; // 创建者名字 + + optional string createTime = 20;// 创建时间 + optional string updateTime = 21;// 更新时间 + optional string deleteTime = 22;// 删除时间 +} + +// 查询字典列表 - 答复 +message ListDictResponse { + repeated Dict items = 1; + int32 total = 2; +} + +// 查询字典 - 请求 +message GetDictRequest { + uint32 id = 1; + optional string name = 2; +} + +// 创建字典 - 请求 +message CreateDictRequest { + Dict dict = 1; + optional uint32 operatorId = 2; +} + +// 更新字典 - 请求 +message UpdateDictRequest { + Dict dict = 1; + optional uint32 operatorId = 2; +} + +// 删除字典 - 请求 +message DeleteDictRequest { + uint32 id = 1; + optional uint32 operatorId = 2; +} diff --git a/monolithic/backend/api/system/service/v1/dict_detail.proto b/monolithic/backend/api/system/service/v1/dict_detail.proto new file mode 100644 index 0000000..885b4ab --- /dev/null +++ b/monolithic/backend/api/system/service/v1/dict_detail.proto @@ -0,0 +1,75 @@ +syntax = "proto3"; + +package system.service.v1; + +import "gnostic/openapi/v3/annotations.proto"; +import "google/protobuf/empty.proto"; + +import "pagination/v1/pagination.proto"; + +// 数据字典详情服务 +service DictDetailService { + // 查询字典详情列表 + rpc ListDictDetail (pagination.PagingRequest) returns (ListDictDetailResponse) {} + + // 查询字典详情 + rpc GetDictDetail (GetDictDetailRequest) returns (DictDetail) {} + + // 创建字典详情 + rpc CreateDictDetail (CreateDictDetailRequest) returns (google.protobuf.Empty) {} + + // 更新字典详情 + rpc UpdateDictDetail (UpdateDictDetailRequest) returns (google.protobuf.Empty) {} + + // 删除字典详情 + rpc DeleteDictDetail (DeleteDictDetailRequest) returns (google.protobuf.Empty) {} + + rpc GetDictDetailByCode (system.service.v1.GetDictDetailRequest) returns (system.service.v1.DictDetail) {} +} + +// 数据字典详情 +message DictDetail { + uint32 id = 1 [(gnostic.openapi.v3.property) = {description: "字典详情ID"}];// ID + optional uint32 dictId = 2 [(gnostic.openapi.v3.property) = {description: "字典ID"}];// ID + optional int32 orderNo = 3[(gnostic.openapi.v3.property) = {description: "排序号"}]; + + optional string label = 4[(gnostic.openapi.v3.property) = {description: "字典标签"}];// 字典标签 + optional string value = 5[(gnostic.openapi.v3.property) = {description: "字典值"}];// 字典值 + + optional uint32 creatorId = 10 [(gnostic.openapi.v3.property) = {description: "创建者ID"}]; // 创建者ID + optional uint32 creatorName = 11 [(gnostic.openapi.v3.property) = {description: "创建者名字"}]; // 创建者名字 + + optional string createTime = 20;// 创建时间 + optional string updateTime = 21;// 更新时间 + optional string deleteTime = 22;// 删除时间 +} + +// 查询字典详情列表 - 答复 +message ListDictDetailResponse { + repeated DictDetail items = 1; + int32 total = 2; +} + +// 查询字典详情 - 请求 +message GetDictDetailRequest { + uint32 id = 1; + optional string code = 3; +} + +// 创建字典详情 - 请求 +message CreateDictDetailRequest { + DictDetail detail = 1; + optional uint32 operatorId = 2; +} + +// 更新字典详情 - 请求 +message UpdateDictDetailRequest { + DictDetail detail = 1; + optional uint32 operatorId = 2; +} + +// 删除字典详情 - 请求 +message DeleteDictDetailRequest { + uint32 id = 1; + optional uint32 operatorId = 2; +} diff --git a/monolithic/backend/api/system/service/v1/menu.proto b/monolithic/backend/api/system/service/v1/menu.proto new file mode 100644 index 0000000..2e7b5a4 --- /dev/null +++ b/monolithic/backend/api/system/service/v1/menu.proto @@ -0,0 +1,111 @@ +syntax = "proto3"; + +package system.service.v1; + +import "gnostic/openapi/v3/annotations.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; + +import "pagination/v1/pagination.proto"; + +// 后台菜单服务 +service MenuService { + // 查询菜单列表 + rpc ListMenu (pagination.PagingRequest) returns (ListMenuResponse) {} + + // 查询菜单详情 + rpc GetMenu (GetMenuRequest) returns (Menu) {} + + // 创建菜单 + rpc CreateMenu (CreateMenuRequest) returns (google.protobuf.Empty) {} + + // 更新菜单 + rpc UpdateMenu (UpdateMenuRequest) returns (google.protobuf.Empty) {} + + // 删除菜单 + rpc DeleteMenu (DeleteMenuRequest) returns (google.protobuf.Empty) {} +} + +enum MenuType { + FOLDER = 0; // 菜单夹 + MENU = 1; // 菜单项 + BUTTON = 2; // 按钮 +} + +// 菜单 +message Menu { + int32 id = 1; + optional int32 parentId = 2; + optional int32 orderNo = 3; + + optional string name = 4; + optional MenuType type = 5 [ + (gnostic.openapi.v3.property) = { + description: "类型" + default: {string: "FOLDER"} + } + ]; + optional string status = 6 [ + (gnostic.openapi.v3.property) = { + description: "状态" + default: {string: "ON"} + enum: [{yaml: "ON"}, {yaml: "OFF"}] + } + ]; + + optional string path = 7; + optional string title = 8; + optional string component = 9; + optional string icon = 10; + + repeated string permissions = 11; + repeated Menu children = 12; + + optional bool keepAlive = 13; + optional bool show = 14; + + optional bool isExt = 15; + optional string extUrl = 16; + + optional bool hideBreadcrumb = 17; + optional bool hideTab = 18; + optional bool hideMenu = 19; + optional bool hideChildrenInMenu = 20; + optional bool hidePathForChildren = 21; + + optional string currentActiveMenu = 22; + optional string redirect = 23; + + optional string createTime = 30; + optional string updateTime = 31; + optional string deleteTime = 32; +} + +// 查询菜单列表 - 回应 +message ListMenuResponse { + repeated Menu items = 1; + int32 total = 2; +} + +// 查询菜单详情 - 请求 +message GetMenuRequest { + int32 id = 1; +} + +// 创建菜单 - 请求 +message CreateMenuRequest { + Menu menu = 1; + optional uint32 operatorId = 2; +} + +// 更新菜单 - 请求 +message UpdateMenuRequest { + Menu menu = 1; + optional uint32 operatorId = 3; +} + +// 删除菜单 - 请求 +message DeleteMenuRequest { + int32 id = 1; + optional uint32 operatorId = 2; +} diff --git a/monolithic/backend/api/user/service/v1/organization.proto b/monolithic/backend/api/user/service/v1/organization.proto new file mode 100644 index 0000000..8192eee --- /dev/null +++ b/monolithic/backend/api/user/service/v1/organization.proto @@ -0,0 +1,73 @@ +syntax = "proto3"; + +package user.service.v1; + +import "gnostic/openapi/v3/annotations.proto"; +import "google/protobuf/empty.proto"; + +import "pagination/v1/pagination.proto"; + +// 部门管理服务 +service OrganizationService { + // 查询部门列表 + rpc ListOrganization (pagination.PagingRequest) returns (ListOrganizationResponse) {} + + // 查询部门详情 + rpc GetOrganization (GetOrganizationRequest) returns (Organization) {} + + // 创建部门 + rpc CreateOrganization (CreateOrganizationRequest) returns (google.protobuf.Empty) {} + + // 更新部门 + rpc UpdateOrganization (UpdateOrganizationRequest) returns (google.protobuf.Empty) {} + + // 删除部门 + rpc DeleteOrganization (DeleteOrganizationRequest) returns (google.protobuf.Empty) {} +} + +// 部门 +message Organization { + uint32 id = 1; + optional string name = 2; + optional uint32 parentId = 3; + optional int32 orderNo = 4; + optional string status = 5 [(gnostic.openapi.v3.property) = { + description: "状态" + default: {string: "ON"} + enum: [{yaml: "ON"}, {yaml: "OFF"}] + }]; + optional string remark = 6; + repeated Organization children = 7; + + optional string createTime = 20;// 创建时间 + optional string updateTime = 21;// 更新时间 + optional string deleteTime = 22;// 删除时间 +} +// 部门列表 - 答复 +message ListOrganizationResponse { + repeated Organization items = 1; + int32 total = 2; +} + +// 部门数据 - 请求 +message GetOrganizationRequest { + uint32 id = 1; +} + +// 创建部门 - 请求 +message CreateOrganizationRequest { + optional uint32 operatorId = 1 [json_name = "operatorId"]; + Organization org = 2; +} + +// 更新部门 - 请求 +message UpdateOrganizationRequest { + optional uint32 operatorId = 1 [json_name = "operatorId"]; + Organization org = 2; +} + +// 删除部门 - 请求 +message DeleteOrganizationRequest { + uint32 id = 1; + optional uint32 operatorId = 2 [json_name = "operatorId"]; +} diff --git a/monolithic/backend/api/user/service/v1/position.proto b/monolithic/backend/api/user/service/v1/position.proto new file mode 100644 index 0000000..c4d6184 --- /dev/null +++ b/monolithic/backend/api/user/service/v1/position.proto @@ -0,0 +1,74 @@ +syntax = "proto3"; + +package user.service.v1; + +import "gnostic/openapi/v3/annotations.proto"; +import "google/protobuf/empty.proto"; + +import "pagination/v1/pagination.proto"; + +// 职位服务 +service PositionService { + // 查询职位列表 + rpc ListPosition (pagination.PagingRequest) returns (ListPositionResponse) {} + + // 查询职位详情 + rpc GetPosition (GetPositionRequest) returns (Position) {} + + // 创建职位 + rpc CreatePosition (CreatePositionRequest) returns (google.protobuf.Empty) {} + + // 更新职位 + rpc UpdatePosition (UpdatePositionRequest) returns (google.protobuf.Empty) {} + + // 删除职位 + rpc DeletePosition (DeletePositionRequest) returns (google.protobuf.Empty) {} +} + +// 职位 +message Position { + uint32 id = 1; + optional string name = 2; + optional uint32 parentId = 3; + optional int32 orderNo = 4; + optional string code = 5; + optional string status = 6 [(gnostic.openapi.v3.property) = { + description: "状态" + default: { string: "ON" } + enum: [{yaml: "ON"}, {yaml: "OFF"}] + }]; + optional string remark = 7; + + optional string createTime = 20;// 创建时间 + optional string updateTime = 21;// 更新时间 + optional string deleteTime = 22;// 删除时间 +} + +// 获取职位列表 - 答复 +message ListPositionResponse { + repeated Position items = 1; + int32 total = 2; +} + +// 获取职位数据 - 请求 +message GetPositionRequest { + uint32 id = 1; +} + +// 创建职位 - 请求 +message CreatePositionRequest { + Position position = 1; + optional uint32 operatorId = 2 [json_name = "operatorId"]; +} + +// 更新职位 - 请求 +message UpdatePositionRequest { + Position position = 1; + optional uint32 operatorId = 2 [json_name = "operatorId"]; +} + +// 删除职位 - 请求 +message DeletePositionRequest { + uint32 id = 1; + optional uint32 operatorId = 2 [json_name = "operatorId"]; +} diff --git a/monolithic/backend/api/user/service/v1/role.proto b/monolithic/backend/api/user/service/v1/role.proto new file mode 100644 index 0000000..22600ee --- /dev/null +++ b/monolithic/backend/api/user/service/v1/role.proto @@ -0,0 +1,74 @@ +syntax = "proto3"; + +package user.service.v1; + +import "gnostic/openapi/v3/annotations.proto"; +import "google/protobuf/empty.proto"; + +import "pagination/v1/pagination.proto"; + +// 角色服务 +service RoleService { + // 查询角色列表 + rpc ListRole (pagination.PagingRequest) returns (ListRoleResponse) {} + + // 查询角色详情 + rpc GetRole (GetRoleRequest) returns (Role) {} + + // 创建角色 + rpc CreateRole (CreateRoleRequest) returns (google.protobuf.Empty) {} + + // 更新角色 + rpc UpdateRole (UpdateRoleRequest) returns (google.protobuf.Empty) {} + + // 删除角色 + rpc DeleteRole (DeleteRoleRequest) returns (google.protobuf.Empty) {} +} + +// 角色 +message Role { + uint32 id = 1; + optional string name = 2; + optional uint32 parentId = 3; + optional int32 orderNo = 4; + optional string code = 5; + optional string status = 6 [(gnostic.openapi.v3.property) = { + description: "状态" + default: { string: "ON" } + enum: [{yaml: "ON"}, {yaml: "OFF"}] + }]; + optional string remark = 7; + + optional string createTime = 20;// 创建时间 + optional string updateTime = 21;// 更新时间 + optional string deleteTime = 22;// 删除时间 +} + +// 角色列表 - 答复 +message ListRoleResponse { + repeated Role items = 1; + int32 total = 2; +} + +// 角色数据 - 请求 +message GetRoleRequest { + uint32 id = 1; +} + +// 创建角色 - 请求 +message CreateRoleRequest { + Role role = 1; + optional uint32 operatorId = 2 [json_name = "operatorId"]; +} + +// 更新角色 - 请求 +message UpdateRoleRequest { + Role role = 1; + optional uint32 operatorId = 2 [json_name = "operatorId"]; +} + +// 删除角色 - 请求 +message DeleteRoleRequest { + uint32 id = 1; + optional uint32 operatorId = 2 [json_name = "operatorId"]; +} diff --git a/monolithic/backend/api/user/service/v1/user.proto b/monolithic/backend/api/user/service/v1/user.proto new file mode 100644 index 0000000..370a14a --- /dev/null +++ b/monolithic/backend/api/user/service/v1/user.proto @@ -0,0 +1,165 @@ +syntax = "proto3"; + +package user.service.v1; + +import "gnostic/openapi/v3/annotations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/api/field_behavior.proto"; + +import "pagination/v1/pagination.proto"; + +// 用户服务 +service UserService { + // 查询用户列表 + rpc ListUser (pagination.PagingRequest) returns (ListUserResponse) {} + + // 查询用户详情 + rpc GetUser (GetUserRequest) returns (User) {} + + // 创建用户 + rpc CreateUser (CreateUserRequest) returns (google.protobuf.Empty) {} + + // 更新用户 + rpc UpdateUser (UpdateUserRequest) returns (google.protobuf.Empty) {} + + // 删除用户 + rpc DeleteUser (DeleteUserRequest) returns (google.protobuf.Empty) {} + + // 查询用户详情 + rpc GetUserByUserName (GetUserByUserNameRequest) returns (User) {} + + // 验证密码 + rpc VerifyPassword (VerifyPasswordRequest) returns (VerifyPasswordResponse) {} + + // 用户是否存在 + rpc UserExists (UserExistsRequest) returns (UserExistsResponse) {} +} + +// 验证密码结果码 +enum VerifyPasswordResult { + SUCCESS = 0; // 验证成功 + ACCOUNT_NOT_EXISTS = 1; // 账号不存在 + WRONG_PASSWORD = 2;// 密码错误 + FREEZE = 3;// 已冻结 + DELETED = 4;// 已删除 +} + +// 用户权限 +enum UserAuthority { + SYS_ADMIN = 0; // 系统超级用户 + CUSTOMER_USER = 1; // 普通用户 + GUEST_USER = 2; // 游客 + REFRESH_TOKEN = 3; // 刷新令牌 +} + +// 用户 +message User { + uint32 id = 1; // 用户ID + optional uint32 roleId = 2 [json_name = "roleId", (gnostic.openapi.v3.property) = {description: "角色ID"}]; // 角色ID + optional uint32 workId = 3 [json_name = "workId", (gnostic.openapi.v3.property) = {description: "工号"}]; // 工号 + optional uint32 orgId = 4 [json_name = "orgId", (gnostic.openapi.v3.property) = {description: "部门ID"}]; // 部门ID + optional uint32 positionId = 5 [json_name = "positionId", (gnostic.openapi.v3.property) = {description: "岗位ID"}]; // 岗位ID + optional uint32 creatorId = 6 [json_name = "creatorId", (gnostic.openapi.v3.property) = {description: "创建者ID"}]; // 创建者ID + + optional string userName = 10 [json_name = "userName", (gnostic.openapi.v3.property) = {description: "登录名"}]; // 登录名 + optional string nickName = 11 [json_name = "nickName", (gnostic.openapi.v3.property) = {description: "昵称"}]; // 昵称 + optional string realName = 12 [json_name = "realName", (gnostic.openapi.v3.property) = {description: "真实姓名"}]; // 真实姓名 + optional string avatar = 13 [json_name = "avatar", (gnostic.openapi.v3.property) = {description: "头像"}]; // 头像 + optional string email = 14 [json_name = "email", (gnostic.openapi.v3.property) = {description: "邮箱"}]; // 邮箱 + optional string phone = 15 [json_name = "phone", (gnostic.openapi.v3.property) = {description: "手机号"}]; // 手机号 + optional string gender = 16 [json_name = "gender", (gnostic.openapi.v3.property) = {description: "性别"}]; // 性别 + optional string address = 17 [json_name = "address", (gnostic.openapi.v3.property) = {description: "住址"}]; // 住址 + optional string description = 18 [json_name = "description", (gnostic.openapi.v3.property) = {description: "个人描述"}]; // 个人描述 + + optional int64 lastLoginTime = 20 [json_name = "lastLoginTime", (gnostic.openapi.v3.property) = {description: "最后登录时间"}]; // 最后登录时间 + optional string lastLoginIp = 21 [json_name = "lastLoginIp", (gnostic.openapi.v3.property) = {description: "最后登录IP"}]; // 最后登录IP + optional string status = 22 [(gnostic.openapi.v3.property) = { + description: "用户状态" + default: {string: "ON"} + enum: [{yaml: "ON"}, {yaml: "OFF"}] + }]; // 用户状态 + optional UserAuthority authority = 23 [(gnostic.openapi.v3.property) = { + description: "权限" + default: {string: "CUSTOMER_USER"} + }]; // 权限 + + optional string createTime = 30;// 创建时间 + optional string updateTime = 31;// 更新时间 + optional string deleteTime = 32;// 删除时间 +} + +// 获取用户列表 - 答复 +message ListUserResponse { + repeated User items = 1; + int32 total = 2; +} + +// 获取用户数据 - 请求 +message GetUserRequest { + uint32 id = 1; +} +message GetUserByUserNameRequest { + string userName = 1; +} + +// 创建用户 - 请求 +message CreateUserRequest { + uint32 operatorId = 1; + User user = 2; + string password = 3; +} + +// 更新用户 - 请求 +message UpdateUserRequest { + uint32 operator_id = 1 [ + (gnostic.openapi.v3.property) = {description: "操作用户ID", read_only: true}, + json_name = "operatorId" + ]; + + User user = 2 [ + (google.api.field_behavior) = REQUIRED, + (gnostic.openapi.v3.property) = {description: "用户的数据"}, + json_name = "user" + ]; + + string password = 3; + + google.protobuf.FieldMask update_mask = 4 [ + (gnostic.openapi.v3.property) = { + description: "要更新的字段列表", + example: {yaml : "id,realName,userName"} + }, + json_name = "updateMask" + ]; + + bool allow_missing = 5 [ + (gnostic.openapi.v3.property) = {description: "如果设置为true的时候,资源不存在则会新增,并且在这种情况下`updateMask`字段将会被忽略。"}, + json_name = "allowMissing" + ]; +} + +// 删除用户 - 请求 +message DeleteUserRequest { + uint32 id = 1; + uint32 operatorId = 2; +} + +// 验证密码 - 请求 +message VerifyPasswordRequest { + string userName = 1; // 用户名 + string password = 2; // 密码 +} +// 验证密码 - 答复 +message VerifyPasswordResponse { + VerifyPasswordResult result = 1; +} + +// 用户是否存在 - 请求 +message UserExistsRequest { + string userName = 1; +} +// 用户是否存在 - 答复 +message UserExistsResponse { + bool exist = 1; +} diff --git a/monolithic/backend/api/user/service/v1/user_error.proto b/monolithic/backend/api/user/service/v1/user_error.proto new file mode 100644 index 0000000..f5e3d39 --- /dev/null +++ b/monolithic/backend/api/user/service/v1/user_error.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; + +package user.service.v1; + +import "errors/errors.proto"; + +// 信息性回复 ( 100 – 199) +// 成功回复 ( 200 – 299) +// 重定向消息 ( 300 – 399) +// 客户端错误响应 ( 400 – 499) +// 服务器错误响应 ( 500 – 599) + +enum UserErrorReason { + option (errors.default_code) = 500; + + NOT_LOGGED_IN = 0 [(errors.code) = 401];// 401 + + INVALID_USERID = 14 [(errors.code) = 400];// 用户ID无效 + INVALID_PASSWORD = 15 [(errors.code) = 400];// 密码无效 + TOKEN_EXPIRED = 16 [(errors.code) = 400];// token过期 + INVALID_TOKEN = 17 [(errors.code) = 400];// token无效 + TOKEN_NOT_EXIST = 18 [(errors.code) = 404];// token不存在 + USER_NOT_EXIST = 19 [(errors.code) = 404];// 用户不存在 +} diff --git a/monolithic/backend/app.mk b/monolithic/backend/app.mk new file mode 100644 index 0000000..106eefd --- /dev/null +++ b/monolithic/backend/app.mk @@ -0,0 +1,121 @@ +GOPATH ?= $(shell go env GOPATH) + +# Ensure GOPATH is set before running build process. +ifeq "$(GOPATH)" "" + $(error Please set the environment variable GOPATH before running `make`) +endif +FAIL_ON_STDOUT := awk '{ print } END { if (NR > 0) { exit 1 } }' + +GO := GO111MODULE=on go + +ARCH := "`uname -s`" +LINUX := "Linux" +MAC := "Darwin" + +ifeq ($(OS),Windows_NT) + IS_WINDOWS:=1 +endif + +APP_VERSION=$(shell git describe --tags --always) +APP_RELATIVE_PATH=$(shell a=`basename $$PWD` && cd .. && b=`basename $$PWD` && echo $$b/$$a) +APP_NAME=$(shell echo $(APP_RELATIVE_PATH) | sed -En "s/\//-/p") +APP_DOCKER_IMAGE=$(shell echo $(APP_NAME) |awk -F '@' '{print "kratos-monolithic-demo/" $$0 ":0.1.0"}') + + +.PHONY: dep vendor build clean docker gen ent wire api openapi run test cover vet lint app + +# download dependencies of module +dep: + @go mod download + +# create vendor +vendor: + @go mod vendor + +# build golang application +build: +ifeq ("$(wildcard ./bin/)","") + mkdir bin +endif + @go build -ldflags "-X main.Service.Version=$(APP_VERSION)" -o ./bin/ ./... + +# clean build files +clean: + @go clean + $(if $(IS_WINDOWS), del "coverage.out", rm -f "coverage.out") + +# build docker image +docker: + @docker build -t $(APP_DOCKER_IMAGE) . \ + -f ../../../.docker/Dockerfile \ + --build-arg APP_RELATIVE_PATH=$(APP_RELATIVE_PATH) GRPC_PORT=9000 REST_PORT=8000 + +# generate code +gen: ent wire api openapi + +# generate ent code +ent: +ifneq ("$(wildcard ./internal/data/ent)","") + @go run -mod=mod entgo.io/ent/cmd/ent generate \ + --feature privacy \ + --feature sql/modifier \ + --feature entql \ + --feature sql/upsert \ + ./internal/data/ent/schema +endif + +# generate wire code +wire: + @go run -mod=mod github.com/google/wire/cmd/wire ./cmd/server + +# generate protobuf api go code +api: + @cd ../../../ && \ + buf generate + +# generate OpenAPI v3 doc +openapi: + @cd ../../../ && \ + buf generate --path api/admin/service/v1 --template api/admin/service/v1/buf.openapi.gen.yaml + +# run application +run: api openapi + @go run ./cmd/server -conf ./configs + +# run tests +test: + @go test ./... + +# run coverage tests +cover: + @go test -v ./... -coverprofile=coverage.out + +# run static analysis +vet: + @go vet + +# run lint +lint: + @golangci-lint run + +# build service app +app: api wire conf ent build + +# show help +help: + @echo "" + @echo "Usage:" + @echo " make [target]" + @echo "" + @echo 'Targets:' + @awk '/^[a-zA-Z\-_0-9]+:/ { \ + helpMessage = match(lastLine, /^# (.*)/); \ + if (helpMessage) { \ + helpCommand = substr($$1, 0, index($$1, ":")-1); \ + helpMessage = substr(lastLine, RSTART + 2, RLENGTH); \ + printf "\033[36m%-22s\033[0m %s\n", helpCommand,helpMessage; \ + } \ + } \ + { lastLine = $$0 }' $(MAKEFILE_LIST) + +.DEFAULT_GOAL := help diff --git a/monolithic/backend/app/admin/service/Makefile b/monolithic/backend/app/admin/service/Makefile new file mode 100644 index 0000000..bc1a63c --- /dev/null +++ b/monolithic/backend/app/admin/service/Makefile @@ -0,0 +1 @@ +include ../../../app.mk \ No newline at end of file diff --git a/monolithic/backend/app/admin/service/README.md b/monolithic/backend/app/admin/service/README.md new file mode 100644 index 0000000..2950e1a --- /dev/null +++ b/monolithic/backend/app/admin/service/README.md @@ -0,0 +1 @@ +# Admin diff --git a/monolithic/backend/app/admin/service/cmd/server/assets/assets.go b/monolithic/backend/app/admin/service/cmd/server/assets/assets.go new file mode 100644 index 0000000..ca11220 --- /dev/null +++ b/monolithic/backend/app/admin/service/cmd/server/assets/assets.go @@ -0,0 +1,6 @@ +package assets + +import _ "embed" + +//go:embed openapi.yaml +var OpenApiData []byte diff --git a/monolithic/backend/app/admin/service/cmd/server/assets/openapi.yaml b/monolithic/backend/app/admin/service/cmd/server/assets/openapi.yaml new file mode 100644 index 0000000..4bf4466 --- /dev/null +++ b/monolithic/backend/app/admin/service/cmd/server/assets/openapi.yaml @@ -0,0 +1,1825 @@ +# Generated with protoc-gen-openapi +# https://github.com/google/gnostic/tree/master/cmd/protoc-gen-openapi + +openapi: 3.0.3 +info: + title: Kratos巨石应用实践API + description: Kratos巨石应用实践API + contact: + name: tx7do + url: https://github.com/tx7do/kratos-monolithic-demo + email: yanglinbo@gmail.com + license: + name: MIT License + url: https://github.com/tx7do/kratos-monolithic-demo/blob/master/LICENSE + version: "1.0" +paths: + /admin/v1/dict:details: + get: + tags: + - DictDetailService + description: 查询字典详情列表 + operationId: DictDetailService_ListDictDetail + parameters: + - name: page + in: query + description: 当前页码 + schema: + type: integer + format: int32 + - name: pageSize + in: query + description: 每页的行数 + schema: + type: integer + format: int32 + - name: query + in: query + description: 与过滤参数 + schema: + type: string + - name: or + in: query + description: 或过滤参数 + schema: + type: string + - name: orderBy + in: query + description: 排序条件 + schema: + type: array + items: + type: string + - name: nopaging + in: query + description: 是否不分页 + schema: + type: boolean + - name: fieldMask + in: query + description: 字段掩码 + schema: + type: string + format: field-mask + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListDictDetailResponse' + security: + - OAuth2PasswordBearer: [] + post: + tags: + - DictDetailService + description: 创建字典详情 + operationId: DictDetailService_CreateDictDetail + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateDictDetailRequest' + required: true + responses: + "200": + description: OK + content: {} + security: + - OAuth2PasswordBearer: [] + /admin/v1/dict:details/{detail.id}: + put: + tags: + - DictDetailService + description: 更新字典详情 + operationId: DictDetailService_UpdateDictDetail + parameters: + - name: detail.id + in: path + required: true + schema: + type: string + - name: operatorId + in: query + schema: + type: integer + format: uint32 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DictDetail' + required: true + responses: + "200": + description: OK + content: {} + security: + - OAuth2PasswordBearer: [] + /admin/v1/dict:details/{id}: + get: + tags: + - DictDetailService + description: 查询字典详情 + operationId: DictDetailService_GetDictDetail + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: uint32 + - name: code + in: query + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DictDetail' + security: + - OAuth2PasswordBearer: [] + delete: + tags: + - DictDetailService + description: 删除字典详情 + operationId: DictDetailService_DeleteDictDetail + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: uint32 + - name: operatorId + in: query + schema: + type: integer + format: uint32 + responses: + "200": + description: OK + content: {} + security: + - OAuth2PasswordBearer: [] + /admin/v1/dicts: + get: + tags: + - DictService + description: 查询字典列表 + operationId: DictService_ListDict + parameters: + - name: page + in: query + description: 当前页码 + schema: + type: integer + format: int32 + - name: pageSize + in: query + description: 每页的行数 + schema: + type: integer + format: int32 + - name: query + in: query + description: 与过滤参数 + schema: + type: string + - name: or + in: query + description: 或过滤参数 + schema: + type: string + - name: orderBy + in: query + description: 排序条件 + schema: + type: array + items: + type: string + - name: nopaging + in: query + description: 是否不分页 + schema: + type: boolean + - name: fieldMask + in: query + description: 字段掩码 + schema: + type: string + format: field-mask + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListDictResponse' + security: + - OAuth2PasswordBearer: [] + post: + tags: + - DictService + description: 创建字典 + operationId: DictService_CreateDict + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateDictRequest' + required: true + responses: + "200": + description: OK + content: {} + security: + - OAuth2PasswordBearer: [] + /admin/v1/dicts/{dict.id}: + put: + tags: + - DictService + description: 更新字典 + operationId: DictService_UpdateDict + parameters: + - name: dict.id + in: path + required: true + schema: + type: string + - name: operatorId + in: query + schema: + type: integer + format: uint32 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Dict' + required: true + responses: + "200": + description: OK + content: {} + security: + - OAuth2PasswordBearer: [] + /admin/v1/dicts/{id}: + get: + tags: + - DictService + description: 查询字典 + operationId: DictService_GetDict + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: uint32 + - name: name + in: query + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Dict' + security: + - OAuth2PasswordBearer: [] + delete: + tags: + - DictService + description: 删除字典 + operationId: DictService_DeleteDict + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: uint32 + - name: operatorId + in: query + schema: + type: integer + format: uint32 + responses: + "200": + description: OK + content: {} + security: + - OAuth2PasswordBearer: [] + /admin/v1/login: + post: + tags: + - AuthenticationService + description: 登陆 + operationId: AuthenticationService_Login + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LoginRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/LoginResponse' + /admin/v1/logout: + post: + tags: + - AuthenticationService + description: 登出 + operationId: AuthenticationService_Logout + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LogoutRequest' + required: true + responses: + "200": + description: OK + content: {} + security: + - OAuth2PasswordBearer: [] + /admin/v1/me: + get: + tags: + - AuthenticationService + description: 后台获取已经登陆的用户的数据 + operationId: AuthenticationService_GetMe + parameters: + - name: id + in: query + schema: + type: integer + format: uint32 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/User' + security: + - OAuth2PasswordBearer: [] + /admin/v1/menus: + get: + tags: + - MenuService + description: 查询菜单列表 + operationId: MenuService_ListMenu + parameters: + - name: page + in: query + description: 当前页码 + schema: + type: integer + format: int32 + - name: pageSize + in: query + description: 每页的行数 + schema: + type: integer + format: int32 + - name: query + in: query + description: 与过滤参数 + schema: + type: string + - name: or + in: query + description: 或过滤参数 + schema: + type: string + - name: orderBy + in: query + description: 排序条件 + schema: + type: array + items: + type: string + - name: nopaging + in: query + description: 是否不分页 + schema: + type: boolean + - name: fieldMask + in: query + description: 字段掩码 + schema: + type: string + format: field-mask + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListMenuResponse' + security: + - OAuth2PasswordBearer: [] + post: + tags: + - MenuService + description: 创建菜单 + operationId: MenuService_CreateMenu + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateMenuRequest' + required: true + responses: + "200": + description: OK + content: {} + security: + - OAuth2PasswordBearer: [] + /admin/v1/menus/{id}: + get: + tags: + - MenuService + description: 查询菜单详情 + operationId: MenuService_GetMenu + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int32 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Menu' + security: + - OAuth2PasswordBearer: [] + delete: + tags: + - MenuService + description: 删除菜单 + operationId: MenuService_DeleteMenu + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int32 + - name: operatorId + in: query + schema: + type: integer + format: uint32 + responses: + "200": + description: OK + content: {} + security: + - OAuth2PasswordBearer: [] + /admin/v1/menus/{menu.id}: + put: + tags: + - MenuService + description: 更新菜单 + operationId: MenuService_UpdateMenu + parameters: + - name: menu.id + in: path + required: true + schema: + type: string + - name: operatorId + in: query + schema: + type: integer + format: uint32 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Menu' + required: true + responses: + "200": + description: OK + content: {} + security: + - OAuth2PasswordBearer: [] + /admin/v1/orgs: + get: + tags: + - OrganizationService + description: 查询部门列表 + operationId: OrganizationService_ListOrganization + parameters: + - name: page + in: query + description: 当前页码 + schema: + type: integer + format: int32 + - name: pageSize + in: query + description: 每页的行数 + schema: + type: integer + format: int32 + - name: query + in: query + description: 与过滤参数 + schema: + type: string + - name: or + in: query + description: 或过滤参数 + schema: + type: string + - name: orderBy + in: query + description: 排序条件 + schema: + type: array + items: + type: string + - name: nopaging + in: query + description: 是否不分页 + schema: + type: boolean + - name: fieldMask + in: query + description: 字段掩码 + schema: + type: string + format: field-mask + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListOrganizationResponse' + security: + - OAuth2PasswordBearer: [] + post: + tags: + - OrganizationService + description: 创建部门 + operationId: OrganizationService_CreateOrganization + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateOrganizationRequest' + required: true + responses: + "200": + description: OK + content: {} + security: + - OAuth2PasswordBearer: [] + /admin/v1/orgs/{id}: + get: + tags: + - OrganizationService + description: 查询部门详情 + operationId: OrganizationService_GetOrganization + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: uint32 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Organization' + security: + - OAuth2PasswordBearer: [] + delete: + tags: + - OrganizationService + description: 删除部门 + operationId: OrganizationService_DeleteOrganization + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: uint32 + - name: operatorId + in: query + schema: + type: integer + format: uint32 + responses: + "200": + description: OK + content: {} + security: + - OAuth2PasswordBearer: [] + /admin/v1/orgs/{org.id}: + put: + tags: + - OrganizationService + description: 更新部门 + operationId: OrganizationService_UpdateOrganization + parameters: + - name: org.id + in: path + required: true + schema: + type: string + - name: operatorId + in: query + schema: + type: integer + format: uint32 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Organization' + required: true + responses: + "200": + description: OK + content: {} + security: + - OAuth2PasswordBearer: [] + /admin/v1/perm-codes: + get: + tags: + - RouterService + description: 查询权限码列表 + operationId: RouterService_ListPermissionCode + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListPermissionCodeResponse' + security: + - OAuth2PasswordBearer: [] + /admin/v1/positions: + get: + tags: + - PositionService + description: 查询职位列表 + operationId: PositionService_ListPosition + parameters: + - name: page + in: query + description: 当前页码 + schema: + type: integer + format: int32 + - name: pageSize + in: query + description: 每页的行数 + schema: + type: integer + format: int32 + - name: query + in: query + description: 与过滤参数 + schema: + type: string + - name: or + in: query + description: 或过滤参数 + schema: + type: string + - name: orderBy + in: query + description: 排序条件 + schema: + type: array + items: + type: string + - name: nopaging + in: query + description: 是否不分页 + schema: + type: boolean + - name: fieldMask + in: query + description: 字段掩码 + schema: + type: string + format: field-mask + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListPositionResponse' + security: + - OAuth2PasswordBearer: [] + post: + tags: + - PositionService + description: 创建职位 + operationId: PositionService_CreatePosition + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreatePositionRequest' + required: true + responses: + "200": + description: OK + content: {} + security: + - OAuth2PasswordBearer: [] + /admin/v1/positions/{id}: + get: + tags: + - PositionService + description: 查询职位详情 + operationId: PositionService_GetPosition + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: uint32 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Position' + security: + - OAuth2PasswordBearer: [] + delete: + tags: + - PositionService + description: 删除职位 + operationId: PositionService_DeletePosition + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: uint32 + - name: operatorId + in: query + schema: + type: integer + format: uint32 + responses: + "200": + description: OK + content: {} + security: + - OAuth2PasswordBearer: [] + /admin/v1/positions/{position.id}: + put: + tags: + - PositionService + description: 更新职位 + operationId: PositionService_UpdatePosition + parameters: + - name: position.id + in: path + required: true + schema: + type: string + - name: operatorId + in: query + schema: + type: integer + format: uint32 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Position' + required: true + responses: + "200": + description: OK + content: {} + security: + - OAuth2PasswordBearer: [] + /admin/v1/refresh_token: + post: + tags: + - AuthenticationService + description: 刷新认证令牌 + operationId: AuthenticationService_RefreshToken + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RefreshTokenRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/LoginResponse' + security: + - OAuth2PasswordBearer: [] + /admin/v1/roles: + get: + tags: + - RoleService + description: 查询角色列表 + operationId: RoleService_ListRole + parameters: + - name: page + in: query + description: 当前页码 + schema: + type: integer + format: int32 + - name: pageSize + in: query + description: 每页的行数 + schema: + type: integer + format: int32 + - name: query + in: query + description: 与过滤参数 + schema: + type: string + - name: or + in: query + description: 或过滤参数 + schema: + type: string + - name: orderBy + in: query + description: 排序条件 + schema: + type: array + items: + type: string + - name: nopaging + in: query + description: 是否不分页 + schema: + type: boolean + - name: fieldMask + in: query + description: 字段掩码 + schema: + type: string + format: field-mask + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListRoleResponse' + security: + - OAuth2PasswordBearer: [] + post: + tags: + - RoleService + description: 创建角色 + operationId: RoleService_CreateRole + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateRoleRequest' + required: true + responses: + "200": + description: OK + content: {} + security: + - OAuth2PasswordBearer: [] + /admin/v1/roles/{id}: + get: + tags: + - RoleService + description: 查询角色详情 + operationId: RoleService_GetRole + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: uint32 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Role' + security: + - OAuth2PasswordBearer: [] + delete: + tags: + - RoleService + description: 删除角色 + operationId: RoleService_DeleteRole + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: uint32 + - name: operatorId + in: query + schema: + type: integer + format: uint32 + responses: + "200": + description: OK + content: {} + security: + - OAuth2PasswordBearer: [] + /admin/v1/roles/{role.id}: + put: + tags: + - RoleService + description: 更新角色 + operationId: RoleService_UpdateRole + parameters: + - name: role.id + in: path + required: true + schema: + type: string + - name: operatorId + in: query + schema: + type: integer + format: uint32 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Role' + required: true + responses: + "200": + description: OK + content: {} + security: + - OAuth2PasswordBearer: [] + /admin/v1/routes: + get: + tags: + - RouterService + description: 查询路由列表 + operationId: RouterService_ListRoute + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListRouteResponse' + security: + - OAuth2PasswordBearer: [] + /admin/v1/users: + get: + tags: + - UserService + description: 获取用户列表 + operationId: UserService_ListUser + parameters: + - name: page + in: query + description: 当前页码 + schema: + type: integer + format: int32 + - name: pageSize + in: query + description: 每页的行数 + schema: + type: integer + format: int32 + - name: query + in: query + description: 与过滤参数 + schema: + type: string + - name: or + in: query + description: 或过滤参数 + schema: + type: string + - name: orderBy + in: query + description: 排序条件 + schema: + type: array + items: + type: string + - name: nopaging + in: query + description: 是否不分页 + schema: + type: boolean + - name: fieldMask + in: query + description: 字段掩码 + schema: + type: string + format: field-mask + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListUserResponse' + security: + - OAuth2PasswordBearer: [] + post: + tags: + - UserService + description: 创建用户 + operationId: UserService_CreateUser + parameters: + - name: operatorId + in: query + schema: + type: integer + format: uint32 + - name: password + in: query + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "200": + description: OK + content: {} + security: + - OAuth2PasswordBearer: [] + /admin/v1/users/{id}: + get: + tags: + - UserService + description: 获取用户数据 + operationId: UserService_GetUser + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: uint32 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/User' + security: + - OAuth2PasswordBearer: [] + delete: + tags: + - UserService + description: 删除用户 + operationId: UserService_DeleteUser + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: uint32 + - name: operatorId + in: query + schema: + type: integer + format: uint32 + responses: + "200": + description: OK + content: {} + security: + - OAuth2PasswordBearer: [] + /admin/v1/users/{user.id}: + put: + tags: + - UserService + description: 更新用户 + operationId: UserService_UpdateUser + parameters: + - name: user.id + in: path + required: true + schema: + type: string + - name: operatorId + in: query + schema: + type: integer + format: uint32 + - name: password + in: query + schema: + type: string + - name: updateMask + in: query + schema: + type: string + format: field-mask + - name: allowMissing + in: query + schema: + type: boolean + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "200": + description: OK + content: {} + security: + - OAuth2PasswordBearer: [] +components: + schemas: + CreateDictDetailRequest: + type: object + properties: + detail: + $ref: '#/components/schemas/DictDetail' + operatorId: + type: integer + format: uint32 + description: 创建字典详情 - 请求 + CreateDictRequest: + type: object + properties: + dict: + $ref: '#/components/schemas/Dict' + operatorId: + type: integer + format: uint32 + description: 创建字典 - 请求 + CreateMenuRequest: + type: object + properties: + menu: + $ref: '#/components/schemas/Menu' + operatorId: + type: integer + format: uint32 + description: 创建菜单 - 请求 + CreateOrganizationRequest: + type: object + properties: + operatorId: + type: integer + format: uint32 + org: + $ref: '#/components/schemas/Organization' + description: 创建部门 - 请求 + CreatePositionRequest: + type: object + properties: + position: + $ref: '#/components/schemas/Position' + operatorId: + type: integer + format: uint32 + description: 创建职位 - 请求 + CreateRoleRequest: + type: object + properties: + role: + $ref: '#/components/schemas/Role' + operatorId: + type: integer + format: uint32 + description: 创建角色 - 请求 + Dict: + type: object + properties: + id: + type: integer + description: ID + format: uint32 + name: + type: string + description: 字典名称 + description: + type: string + description: 描述 + creatorId: + type: integer + description: 创建者ID + format: uint32 + creatorName: + type: integer + description: 创建者名字 + format: uint32 + createTime: + type: string + updateTime: + type: string + deleteTime: + type: string + description: 数据字典 + DictDetail: + type: object + properties: + id: + type: integer + description: 字典详情ID + format: uint32 + dictId: + type: integer + description: 字典ID + format: uint32 + orderNo: + type: integer + description: 排序号 + format: int32 + label: + type: string + description: 字典标签 + value: + type: string + description: 字典值 + creatorId: + type: integer + description: 创建者ID + format: uint32 + creatorName: + type: integer + description: 创建者名字 + format: uint32 + createTime: + type: string + updateTime: + type: string + deleteTime: + type: string + description: 数据字典详情 + KratosStatus: + type: object + properties: + code: + type: number + description: 错误码 + format: int32 + message: + type: string + description: 错误消息 + reason: + type: string + description: 错误原因 + metadata: + type: object + description: 元数据 + description: Kratos错误返回 + ListDictDetailResponse: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/DictDetail' + total: + type: integer + format: int32 + description: 查询字典详情列表 - 答复 + ListDictResponse: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/Dict' + total: + type: integer + format: int32 + description: 查询字典列表 - 答复 + ListMenuResponse: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/Menu' + total: + type: integer + format: int32 + description: 查询菜单列表 - 回应 + ListOrganizationResponse: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/Organization' + total: + type: integer + format: int32 + description: 部门列表 - 答复 + ListPermissionCodeResponse: + type: object + properties: + codes: + type: array + items: + type: string + description: 查询权限码列表 - 回应 + ListPositionResponse: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/Position' + total: + type: integer + format: int32 + description: 获取职位列表 - 答复 + ListRoleResponse: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/Role' + total: + type: integer + format: int32 + description: 角色列表 - 答复 + ListRouteResponse: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/RouteItem' + description: 查询路由列表 - 回应 + ListUserResponse: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/User' + total: + type: integer + format: int32 + description: 获取用户列表 - 答复 + LoginRequest: + required: + - username + - password + - grand_type + type: object + properties: + username: + type: string + password: + type: string + grand_type: + type: string + default: password + description: 授权类型,此处的值固定为"password",必选项。 + scope: + type: string + description: 用户后台登陆 - 请求 + LoginResponse: + type: object + properties: + access_token: + type: string + refresh_token: + type: string + token_type: + type: string + expires_in: + type: string + description: 用户后台登陆 - 回应 + LogoutRequest: + type: object + properties: + id: + type: integer + format: uint32 + description: 用户后台登出 - 请求 + Menu: + type: object + properties: + id: + type: integer + format: int32 + parentId: + type: integer + format: int32 + orderNo: + type: integer + format: int32 + name: + type: string + type: + enum: + - FOLDER + - MENU + - BUTTON + type: string + default: FOLDER + description: 类型 + format: enum + status: + enum: + - ON + - OFF + type: string + default: ON + description: 状态 + path: + type: string + title: + type: string + component: + type: string + icon: + type: string + permissions: + type: array + items: + type: string + children: + type: array + items: + $ref: '#/components/schemas/Menu' + keepAlive: + type: boolean + show: + type: boolean + isExt: + type: boolean + extUrl: + type: string + hideBreadcrumb: + type: boolean + hideTab: + type: boolean + hideMenu: + type: boolean + hideChildrenInMenu: + type: boolean + hidePathForChildren: + type: boolean + currentActiveMenu: + type: string + redirect: + type: string + createTime: + type: string + updateTime: + type: string + deleteTime: + type: string + description: 菜单 + Organization: + type: object + properties: + id: + type: integer + format: uint32 + name: + type: string + parentId: + type: integer + format: uint32 + orderNo: + type: integer + format: int32 + status: + enum: + - ON + - OFF + type: string + default: ON + description: 状态 + remark: + type: string + children: + type: array + items: + $ref: '#/components/schemas/Organization' + createTime: + type: string + updateTime: + type: string + deleteTime: + type: string + description: 部门 + Position: + type: object + properties: + id: + type: integer + format: uint32 + name: + type: string + parentId: + type: integer + format: uint32 + orderNo: + type: integer + format: int32 + code: + type: string + status: + enum: + - ON + - OFF + type: string + default: ON + description: 状态 + remark: + type: string + createTime: + type: string + updateTime: + type: string + deleteTime: + type: string + description: 职位 + RefreshTokenRequest: + required: + - refresh_token + - grand_type + type: object + properties: + refresh_token: + type: string + grand_type: + type: string + default: password + description: 授权类型,此处的值固定为"password",必选项。 + scope: + type: string + description: 用户刷新令牌 - 请求 + Role: + type: object + properties: + id: + type: integer + format: uint32 + name: + type: string + parentId: + type: integer + format: uint32 + orderNo: + type: integer + format: int32 + code: + type: string + status: + enum: + - ON + - OFF + type: string + default: ON + description: 状态 + remark: + type: string + createTime: + type: string + updateTime: + type: string + deleteTime: + type: string + description: 角色 + RouteItem: + type: object + properties: + name: + type: string + alias: + type: string + path: + type: string + component: + type: string + redirect: + type: string + caseSensitive: + type: boolean + meta: + $ref: '#/components/schemas/RouteMeta' + children: + type: array + items: + $ref: '#/components/schemas/RouteItem' + description: 路由项 + RouteMeta: + type: object + properties: + orderNo: + type: integer + format: int32 + title: + type: string + dynamicLevel: + type: integer + format: int32 + realPath: + type: string + icon: + type: string + frameSrc: + type: string + transitionName: + type: string + affix: + type: boolean + carryParam: + type: boolean + single: + type: boolean + ignoreAuth: + type: boolean + ignoreKeepAlive: + type: boolean + ignoreRoute: + type: boolean + hideBreadcrumb: + type: boolean + hideChildrenInMenu: + type: boolean + hideTab: + type: boolean + hideMenu: + type: boolean + isLink: + type: boolean + hidePathForChildren: + type: boolean + currentActiveMenu: + type: string + description: 路由元数据 + User: + type: object + properties: + id: + type: integer + format: uint32 + roleId: + type: integer + description: 角色ID + format: uint32 + workId: + type: integer + description: 工号 + format: uint32 + orgId: + type: integer + description: 部门ID + format: uint32 + positionId: + type: integer + description: 岗位ID + format: uint32 + creatorId: + type: integer + description: 创建者ID + format: uint32 + userName: + type: string + description: 登录名 + nickName: + type: string + description: 昵称 + realName: + type: string + description: 真实姓名 + avatar: + type: string + description: 头像 + email: + type: string + description: 邮箱 + phone: + type: string + description: 手机号 + gender: + type: string + description: 性别 + address: + type: string + description: 住址 + description: + type: string + description: 个人描述 + lastLoginTime: + type: string + description: 最后登录时间 + lastLoginIp: + type: string + description: 最后登录IP + status: + enum: + - ON + - OFF + type: string + default: ON + description: 用户状态 + authority: + enum: + - SYS_ADMIN + - CUSTOMER_USER + - GUEST_USER + - REFRESH_TOKEN + type: string + default: CUSTOMER_USER + description: 权限 + format: enum + createTime: + type: string + updateTime: + type: string + deleteTime: + type: string + description: 用户 + responses: + default: + description: default kratos response + content: + application/json: + schema: + $ref: '#/components/schemas/KratosStatus' + securitySchemes: + OAuth2PasswordBearer: + type: oauth2 + flows: + password: + tokenUrl: /admin/v1/login + refreshUrl: /admin/v1/refresh_token + scopes: {} +tags: + - name: AuthenticationService + description: 用户后台登陆认证服务 + - name: DictDetailService + description: 数据字典详情服务 + - name: DictService + description: 字典服务 + - name: MenuService + description: 后台菜单服务 + - name: OrganizationService + description: 部门管理服务 + - name: PositionService + description: 职位服务 + - name: RoleService + description: 角色服务 + - name: RouterService + description: 网站后台动态路由服务 + - name: UserService + description: 用户管理服务 diff --git a/monolithic/backend/app/admin/service/cmd/server/main.go b/monolithic/backend/app/admin/service/cmd/server/main.go new file mode 100644 index 0000000..f1a009d --- /dev/null +++ b/monolithic/backend/app/admin/service/cmd/server/main.go @@ -0,0 +1,50 @@ +package main + +import ( + "github.com/go-kratos/kratos/v2" + "github.com/go-kratos/kratos/v2/log" + "github.com/go-kratos/kratos/v2/registry" + "github.com/go-kratos/kratos/v2/transport/http" + "github.com/tx7do/kratos-bootstrap" + + "kratos-monolithic-demo/pkg/service" +) + +// go build -ldflags "-X main.Service.Version=x.y.z" + +var ( + Service = bootstrap.NewServiceInfo( + service.AdminService, + "1.0.0", + "", + ) +) + +func newApp(ll log.Logger, rr registry.Registrar, hs *http.Server) *kratos.App { + return kratos.New( + kratos.ID(Service.GetInstanceId()), + kratos.Name(Service.Name), + kratos.Version(Service.Version), + kratos.Metadata(Service.Metadata), + kratos.Logger(ll), + kratos.Server( + hs, + ), + kratos.Registrar(rr), + ) +} + +func main() { + // bootstrap + cfg, ll, reg := bootstrap.Bootstrap(Service) + + app, cleanup, err := initApp(ll, reg, cfg) + if err != nil { + panic(err) + } + defer cleanup() + + if err := app.Run(); err != nil { + panic(err) + } +} diff --git a/monolithic/backend/app/admin/service/cmd/server/wire.go b/monolithic/backend/app/admin/service/cmd/server/wire.go new file mode 100644 index 0000000..4839e6d --- /dev/null +++ b/monolithic/backend/app/admin/service/cmd/server/wire.go @@ -0,0 +1,25 @@ +//go:build wireinject +// +build wireinject + +// The build tag makes sure the stub is not built in the final build. + +package main + +import ( + "github.com/google/wire" + + "github.com/go-kratos/kratos/v2" + "github.com/go-kratos/kratos/v2/log" + "github.com/go-kratos/kratos/v2/registry" + + conf "github.com/tx7do/kratos-bootstrap/gen/api/go/conf/v1" + + "kratos-monolithic-demo/app/admin/service/internal/data" + "kratos-monolithic-demo/app/admin/service/internal/server" + "kratos-monolithic-demo/app/admin/service/internal/service" +) + +// initApp init kratos application. +func initApp(log.Logger, registry.Registrar, *conf.Bootstrap) (*kratos.App, func(), error) { + panic(wire.Build(server.ProviderSet, service.ProviderSet, data.ProviderSet, newApp)) +} diff --git a/monolithic/backend/app/admin/service/cmd/server/wire_gen.go b/monolithic/backend/app/admin/service/cmd/server/wire_gen.go new file mode 100644 index 0000000..d6a25dc --- /dev/null +++ b/monolithic/backend/app/admin/service/cmd/server/wire_gen.go @@ -0,0 +1,53 @@ +// Code generated by Wire. DO NOT EDIT. + +//go:generate go run github.com/google/wire/cmd/wire +//go:build !wireinject +// +build !wireinject + +package main + +import ( + "github.com/go-kratos/kratos/v2" + "github.com/go-kratos/kratos/v2/log" + "github.com/go-kratos/kratos/v2/registry" + "github.com/tx7do/kratos-bootstrap/gen/api/go/conf/v1" + "kratos-monolithic-demo/app/admin/service/internal/data" + "kratos-monolithic-demo/app/admin/service/internal/server" + "kratos-monolithic-demo/app/admin/service/internal/service" +) + +// Injectors from wire.go: + +// initApp init kratos application. +func initApp(logger log.Logger, registrar registry.Registrar, bootstrap *v1.Bootstrap) (*kratos.App, func(), error) { + authenticator := data.NewAuthenticator(bootstrap) + engine := data.NewAuthorizer() + entClient := data.NewEntClient(bootstrap, logger) + client := data.NewRedisClient(bootstrap, logger) + dataData, cleanup, err := data.NewData(entClient, client, authenticator, engine, logger) + if err != nil { + return nil, nil, err + } + userRepo := data.NewUserRepo(dataData, logger) + userTokenRepo := data.NewUserTokenRepo(dataData, authenticator, logger) + authenticationService := service.NewAuthenticationService(logger, userRepo, userTokenRepo) + userService := service.NewUserService(logger, userRepo) + dictRepo := data.NewDictRepo(dataData, logger) + dictService := service.NewDictService(logger, dictRepo) + dictDetailRepo := data.NewDictDetailRepo(dataData, logger) + dictDetailService := service.NewDictDetailService(logger, dictDetailRepo) + menuRepo := data.NewMenuRepo(dataData, logger) + menuService := service.NewMenuService(menuRepo, logger) + routerService := service.NewRouterService(logger, menuRepo) + organizationRepo := data.NewOrganizationRepo(dataData, logger) + organizationService := service.NewOrganizationService(organizationRepo, logger) + roleRepo := data.NewRoleRepo(dataData, logger) + roleService := service.NewRoleService(roleRepo, logger) + positionRepo := data.NewPositionRepo(dataData, logger) + positionService := service.NewPositionService(positionRepo, logger) + httpServer := server.NewRESTServer(bootstrap, logger, authenticator, engine, authenticationService, userService, dictService, dictDetailService, menuService, routerService, organizationService, roleService, positionService) + app := newApp(logger, registrar, httpServer) + return app, func() { + cleanup() + }, nil +} diff --git a/monolithic/backend/app/admin/service/configs/data.yaml b/monolithic/backend/app/admin/service/configs/data.yaml new file mode 100644 index 0000000..9386fa8 --- /dev/null +++ b/monolithic/backend/app/admin/service/configs/data.yaml @@ -0,0 +1,16 @@ +data: + database: + driver: "postgres" + source: "host=localhost port=5432 user=postgres password=@Abcd123456 dbname=kratos_monolithic sslmode=disable" + migrate: true + debug: false + max_idle_connections: 25 + max_open_connections: 25 + connection_max_lifetime: 300s + + redis: + addr: "localhost:6379" + password: "123456" + dial_timeout: 10s + read_timeout: 0.4s + write_timeout: 0.6s \ No newline at end of file diff --git a/monolithic/backend/app/admin/service/configs/logger.yaml b/monolithic/backend/app/admin/service/configs/logger.yaml new file mode 100644 index 0000000..dcd307b --- /dev/null +++ b/monolithic/backend/app/admin/service/configs/logger.yaml @@ -0,0 +1,31 @@ +logger: + type: std + + fluent: + endpoint: "tcp://localhost:24224" + + zap: + level: "debug" + filename: "./logs/info.log" + max_size: 1 + max_age: 30 + max_backups: 5 + + logrus: + level: "debug" + formatter: "text" + timestamp_format: "2006-01-02 15:04:05" + disable_colors: false + disable_timestamp: false + + aliyun: + endpoint: "" + project: "" + access_key: "" + access_secret: "" + + tencent: + endpoint: "" + topic_id: + access_key: "" + access_secret: "" diff --git a/monolithic/backend/app/admin/service/configs/registry.yaml b/monolithic/backend/app/admin/service/configs/registry.yaml new file mode 100644 index 0000000..afd1228 --- /dev/null +++ b/monolithic/backend/app/admin/service/configs/registry.yaml @@ -0,0 +1,52 @@ +registry: + type: "consul" + + consul: + address: "localhost:8500" + scheme: "http" + heartbeat: false + health_check: false + health_check_interval: 5 + + etcd: + endpoints: + - "localhost:8500" + + zookeeper: + endpoints: + - "localhost:8500" + timeout: 10s + + nacos: + address: "localhost" + port: 8848 + namespace_id: "public" + log_level: "../../configs/cache" + cache_dir: "../../configs/log" + log_dir: "debug" + update_thread_num: 20 + timeout: 10s + beat_interval: 5s + not_load_cache_at_start: true + update_cache_when_empty: true + + kubernetes: + + eureka: + endpoints: + - "localhost:18761" + heartbeat_interval: 10s + refresh_interval: 10s + path: + + polaris: + address: + port: + instance_count: + namespace: + service: + token: + + servicecomb: + endpoints: + - "localhost:8500" diff --git a/monolithic/backend/app/admin/service/configs/remote.yaml b/monolithic/backend/app/admin/service/configs/remote.yaml new file mode 100644 index 0000000..148e9df --- /dev/null +++ b/monolithic/backend/app/admin/service/configs/remote.yaml @@ -0,0 +1,7 @@ +config: + type: "consul" + + consul: + scheme: "http" + address: "localhost:8500" + key: "kratos-monolithic-demo/admin/service" diff --git a/monolithic/backend/app/admin/service/configs/trace.yaml b/monolithic/backend/app/admin/service/configs/trace.yaml new file mode 100644 index 0000000..8d5380c --- /dev/null +++ b/monolithic/backend/app/admin/service/configs/trace.yaml @@ -0,0 +1,6 @@ +trace: + endpoint: "localhost:4317" + batcher: "otlp-grpc" + sampler: 1.0 + env: "dev" + insecure: true \ No newline at end of file diff --git a/monolithic/backend/app/admin/service/configs/transport.yaml b/monolithic/backend/app/admin/service/configs/transport.yaml new file mode 100644 index 0000000..efda25e --- /dev/null +++ b/monolithic/backend/app/admin/service/configs/transport.yaml @@ -0,0 +1,47 @@ +server: + rest: + addr: "0.0.0.0:7788" + timeout: 10s + enable_swagger: true + enable_pprof: true + cors: + headers: + - "X-Requested-With" + - "Content-Type" + - "Authorization" + methods: + - "GET" + - "POST" + - "PUT" + - "DELETE" + - "HEAD" + - "OPTIONS" + origins: + - "*" + middleware: + auth: + method: "HS256" + key: "some_api_key" + + grpc: + addr: "0.0.0.0:0" + timeout: 10s + middleware: + + asynq: + endpoint: "localhost:6379" + password: "123456" + db: 1 + +client: + grpc: + timeout: 10s + middleware: + enable_logging: true + enable_recovery: true + enable_tracing: true + enable_validate: true + enable_circuit_breaker: true + auth: + method: "" + key: "some_api_key" diff --git a/monolithic/backend/app/admin/service/internal/data/README.md b/monolithic/backend/app/admin/service/internal/data/README.md new file mode 100644 index 0000000..1cda725 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/README.md @@ -0,0 +1 @@ +# Data diff --git a/monolithic/backend/app/admin/service/internal/data/data.go b/monolithic/backend/app/admin/service/internal/data/data.go new file mode 100644 index 0000000..d0efca1 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/data.go @@ -0,0 +1,77 @@ +package data + +import ( + authnEngine "github.com/tx7do/kratos-authn/engine" + "github.com/tx7do/kratos-authn/engine/jwt" + + authzEngine "github.com/tx7do/kratos-authz/engine" + "github.com/tx7do/kratos-authz/engine/noop" + + "github.com/go-kratos/kratos/v2/log" + "github.com/redis/go-redis/v9" + + "github.com/tx7do/go-utils/entgo" + "github.com/tx7do/kratos-bootstrap" + + "kratos-monolithic-demo/app/admin/service/internal/data/ent" + + conf "github.com/tx7do/kratos-bootstrap/gen/api/go/conf/v1" +) + +// Data . +type Data struct { + log *log.Helper + + rdb *redis.Client + db *entgo.EntClient[*ent.Client] + + authenticator authnEngine.Authenticator + authorizer authzEngine.Engine +} + +// NewData . +func NewData( + entClient *entgo.EntClient[*ent.Client], + redisClient *redis.Client, + authenticator authnEngine.Authenticator, + authorizer authzEngine.Engine, + logger log.Logger, +) (*Data, func(), error) { + l := log.NewHelper(log.With(logger, "module", "data/admin-service")) + + d := &Data{ + db: entClient, + rdb: redisClient, + log: l, + authenticator: authenticator, + authorizer: authorizer, + } + + return d, func() { + l.Info("message", "closing the data resources") + d.db.Close() + if err := d.rdb.Close(); err != nil { + l.Error(err) + } + }, nil +} + +// NewRedisClient 创建Redis客户端 +func NewRedisClient(cfg *conf.Bootstrap, _ log.Logger) *redis.Client { + //l := log.NewHelper(log.With(logger, "module", "redis/data/admin-service")) + return bootstrap.NewRedisClient(cfg.Data) +} + +// NewAuthenticator 创建认证器 +func NewAuthenticator(cfg *conf.Bootstrap) authnEngine.Authenticator { + authenticator, _ := jwt.NewAuthenticator( + jwt.WithKey([]byte(cfg.Server.Rest.Middleware.Auth.Key)), + jwt.WithSigningMethod(cfg.Server.Rest.Middleware.Auth.Method), + ) + return authenticator +} + +// NewAuthorizer 创建权鉴器 +func NewAuthorizer() authzEngine.Engine { + return noop.State{} +} diff --git a/monolithic/backend/app/admin/service/internal/data/dict.go b/monolithic/backend/app/admin/service/internal/data/dict.go new file mode 100644 index 0000000..6a0a1ad --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/dict.go @@ -0,0 +1,152 @@ +package data + +import ( + "context" + "time" + + "entgo.io/ent/dialect/sql" + "github.com/go-kratos/kratos/v2/log" + + "github.com/tx7do/go-utils/entgo/query" + util "github.com/tx7do/go-utils/timeutil" + + "kratos-monolithic-demo/app/admin/service/internal/data/ent" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/dict" + + pagination "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + v1 "kratos-monolithic-demo/gen/api/go/system/service/v1" +) + +type DictRepo struct { + data *Data + log *log.Helper +} + +func NewDictRepo(data *Data, logger log.Logger) *DictRepo { + l := log.NewHelper(log.With(logger, "module", "dict/repo/admin-service")) + return &DictRepo{ + data: data, + log: l, + } +} + +func (r *DictRepo) convertEntToProto(in *ent.Dict) *v1.Dict { + if in == nil { + return nil + } + return &v1.Dict{ + Id: in.ID, + Name: in.Name, + Description: in.Description, + CreatorId: in.CreateBy, + CreateTime: util.TimeToTimeString(in.CreateTime), + UpdateTime: util.TimeToTimeString(in.UpdateTime), + DeleteTime: util.TimeToTimeString(in.DeleteTime), + } +} + +func (r *DictRepo) Count(ctx context.Context, whereCond []func(s *sql.Selector)) (int, error) { + builder := r.data.db.Client().Dict.Query() + if len(whereCond) != 0 { + builder.Modify(whereCond...) + } + + count, err := builder.Count(ctx) + if err != nil { + r.log.Errorf("query count failed: %s", err.Error()) + } + + return count, err +} + +func (r *DictRepo) List(ctx context.Context, req *pagination.PagingRequest) (*v1.ListDictResponse, error) { + builder := r.data.db.Client().Dict.Query() + + err, whereSelectors, querySelectors := entgo.BuildQuerySelector( + req.GetQuery(), req.GetOrQuery(), + req.GetPage(), req.GetPageSize(), req.GetNoPaging(), + req.GetOrderBy(), dict.FieldCreateTime, + req.GetFieldMask().GetPaths(), + ) + if err != nil { + r.log.Errorf("解析SELECT条件发生错误[%s]", err.Error()) + return nil, err + } + + if querySelectors != nil { + builder.Modify(querySelectors...) + } + + results, err := builder.All(ctx) + if err != nil { + r.log.Errorf("query list failed: %s", err.Error()) + return nil, err + } + + items := make([]*v1.Dict, 0, len(results)) + for _, res := range results { + item := r.convertEntToProto(res) + items = append(items, item) + } + + count, err := r.Count(ctx, whereSelectors) + if err != nil { + return nil, err + } + + return &v1.ListDictResponse{ + Total: int32(count), + Items: items, + }, nil +} + +func (r *DictRepo) Get(ctx context.Context, req *v1.GetDictRequest) (*v1.Dict, error) { + ret, err := r.data.db.Client().Dict.Get(ctx, req.GetId()) + if err != nil && !ent.IsNotFound(err) { + r.log.Errorf("query one data failed: %s", err.Error()) + return nil, err + } + + return r.convertEntToProto(ret), err +} + +func (r *DictRepo) Create(ctx context.Context, req *v1.CreateDictRequest) error { + err := r.data.db.Client().Dict.Create(). + SetNillableName(req.Dict.Name). + SetNillableDescription(req.Dict.Description). + SetCreateBy(req.GetOperatorId()). + SetCreateTime(time.Now()). + Exec(ctx) + if err != nil { + r.log.Errorf("insert one data failed: %s", err.Error()) + return err + } + + return err +} + +func (r *DictRepo) Update(ctx context.Context, req *v1.UpdateDictRequest) error { + builder := r.data.db.Client().Dict.UpdateOneID(req.Dict.Id). + SetNillableName(req.Dict.Name). + SetNillableDescription(req.Dict.Description). + SetUpdateTime(time.Now()) + + err := builder.Exec(ctx) + if err != nil { + r.log.Errorf("update one data failed: %s", err.Error()) + return err + } + + return err +} + +func (r *DictRepo) Delete(ctx context.Context, req *v1.DeleteDictRequest) (bool, error) { + err := r.data.db.Client().Dict. + DeleteOneID(req.GetId()). + Exec(ctx) + if err != nil { + r.log.Errorf("delete one data failed: %s", err.Error()) + } + + return err == nil, err +} diff --git a/monolithic/backend/app/admin/service/internal/data/dict_detail.go b/monolithic/backend/app/admin/service/internal/data/dict_detail.go new file mode 100644 index 0000000..d69f858 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/dict_detail.go @@ -0,0 +1,158 @@ +package data + +import ( + "context" + "time" + + "entgo.io/ent/dialect/sql" + "github.com/go-kratos/kratos/v2/log" + + "github.com/tx7do/go-utils/entgo/query" + util "github.com/tx7do/go-utils/timeutil" + + "kratos-monolithic-demo/app/admin/service/internal/data/ent" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/dictdetail" + + pagination "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + v1 "kratos-monolithic-demo/gen/api/go/system/service/v1" +) + +type DictDetailRepo struct { + data *Data + log *log.Helper +} + +func NewDictDetailRepo(data *Data, logger log.Logger) *DictDetailRepo { + l := log.NewHelper(log.With(logger, "module", "dict-detail/repo/admin-service")) + return &DictDetailRepo{ + data: data, + log: l, + } +} + +func (r *DictDetailRepo) convertEntToProto(in *ent.DictDetail) *v1.DictDetail { + if in == nil { + return nil + } + return &v1.DictDetail{ + Id: in.ID, + DictId: in.DictID, + OrderNo: in.OrderNo, + Label: in.Label, + Value: in.Value, + CreatorId: in.CreateBy, + CreateTime: util.TimeToTimeString(in.CreateTime), + UpdateTime: util.TimeToTimeString(in.UpdateTime), + DeleteTime: util.TimeToTimeString(in.DeleteTime), + } +} + +func (r *DictDetailRepo) Count(ctx context.Context, whereCond []func(s *sql.Selector)) (int, error) { + builder := r.data.db.Client().DictDetail.Query() + if len(whereCond) != 0 { + builder.Modify(whereCond...) + } + + count, err := builder.Count(ctx) + if err != nil { + r.log.Errorf("query count failed: %s", err.Error()) + } + + return count, err +} + +func (r *DictDetailRepo) List(ctx context.Context, req *pagination.PagingRequest) (*v1.ListDictDetailResponse, error) { + builder := r.data.db.Client().DictDetail.Query() + + err, whereSelectors, querySelectors := entgo.BuildQuerySelector( + req.GetQuery(), req.GetOrQuery(), + req.GetPage(), req.GetPageSize(), req.GetNoPaging(), + req.GetOrderBy(), dictdetail.FieldCreateTime, + req.GetFieldMask().GetPaths(), + ) + if err != nil { + r.log.Errorf("解析SELECT条件发生错误[%s]", err.Error()) + return nil, err + } + + if querySelectors != nil { + builder.Modify(querySelectors...) + } + + results, err := builder.All(ctx) + if err != nil { + r.log.Errorf("query list failed: %s", err.Error()) + return nil, err + } + + items := make([]*v1.DictDetail, 0, len(results)) + for _, res := range results { + item := r.convertEntToProto(res) + items = append(items, item) + } + + count, err := r.Count(ctx, whereSelectors) + if err != nil { + return nil, err + } + + return &v1.ListDictDetailResponse{ + Total: int32(count), + Items: items, + }, nil +} + +func (r *DictDetailRepo) Get(ctx context.Context, req *v1.GetDictDetailRequest) (*v1.DictDetail, error) { + ret, err := r.data.db.Client().DictDetail.Get(ctx, req.GetId()) + if err != nil && !ent.IsNotFound(err) { + r.log.Errorf("query one data failed: %s", err.Error()) + return nil, err + } + + return r.convertEntToProto(ret), err +} + +func (r *DictDetailRepo) Create(ctx context.Context, req *v1.CreateDictDetailRequest) error { + err := r.data.db.Client().DictDetail.Create(). + SetNillableDictID(req.Detail.DictId). + SetNillableOrderNo(req.Detail.OrderNo). + SetNillableLabel(req.Detail.Label). + SetNillableValue(req.Detail.Value). + SetCreateBy(req.GetOperatorId()). + SetCreateTime(time.Now()). + Exec(ctx) + if err != nil { + r.log.Errorf("insert one data failed: %s", err.Error()) + return err + } + + return err +} + +func (r *DictDetailRepo) Update(ctx context.Context, req *v1.UpdateDictDetailRequest) error { + builder := r.data.db.Client().DictDetail.UpdateOneID(req.Detail.Id). + SetNillableDictID(req.Detail.DictId). + SetNillableOrderNo(req.Detail.OrderNo). + SetNillableLabel(req.Detail.Label). + SetNillableValue(req.Detail.Value). + SetUpdateTime(time.Now()) + + err := builder.Exec(ctx) + if err != nil { + r.log.Errorf("update one data failed: %s", err.Error()) + return err + } + + return err +} + +func (r *DictDetailRepo) Delete(ctx context.Context, req *v1.DeleteDictDetailRequest) (bool, error) { + err := r.data.db.Client().DictDetail. + DeleteOneID(req.GetId()). + Exec(ctx) + if err != nil { + r.log.Errorf("delete one data failed: %s", err.Error()) + } + + return err == nil, err +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/client.go b/monolithic/backend/app/admin/service/internal/data/ent/client.go new file mode 100644 index 0000000..3845d6d --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/client.go @@ -0,0 +1,1319 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "errors" + "fmt" + "log" + "reflect" + + "kratos-monolithic-demo/app/admin/service/internal/data/ent/migrate" + + "kratos-monolithic-demo/app/admin/service/internal/data/ent/dict" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/dictdetail" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/menu" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/organization" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/position" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/role" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/user" + + "entgo.io/ent" + "entgo.io/ent/dialect" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +// Client is the client that holds all ent builders. +type Client struct { + config + // Schema is the client for creating, migrating and dropping schema. + Schema *migrate.Schema + // Dict is the client for interacting with the Dict builders. + Dict *DictClient + // DictDetail is the client for interacting with the DictDetail builders. + DictDetail *DictDetailClient + // Menu is the client for interacting with the Menu builders. + Menu *MenuClient + // Organization is the client for interacting with the Organization builders. + Organization *OrganizationClient + // Position is the client for interacting with the Position builders. + Position *PositionClient + // Role is the client for interacting with the Role builders. + Role *RoleClient + // User is the client for interacting with the User builders. + User *UserClient +} + +// NewClient creates a new client configured with the given options. +func NewClient(opts ...Option) *Client { + cfg := config{log: log.Println, hooks: &hooks{}, inters: &inters{}} + cfg.options(opts...) + client := &Client{config: cfg} + client.init() + return client +} + +func (c *Client) init() { + c.Schema = migrate.NewSchema(c.driver) + c.Dict = NewDictClient(c.config) + c.DictDetail = NewDictDetailClient(c.config) + c.Menu = NewMenuClient(c.config) + c.Organization = NewOrganizationClient(c.config) + c.Position = NewPositionClient(c.config) + c.Role = NewRoleClient(c.config) + c.User = NewUserClient(c.config) +} + +type ( + // config is the configuration for the client and its builder. + config struct { + // driver used for executing database requests. + driver dialect.Driver + // debug enable a debug logging. + debug bool + // log used for logging on debug mode. + log func(...any) + // hooks to execute on mutations. + hooks *hooks + // interceptors to execute on queries. + inters *inters + } + // Option function to configure the client. + Option func(*config) +) + +// options applies the options on the config object. +func (c *config) options(opts ...Option) { + for _, opt := range opts { + opt(c) + } + if c.debug { + c.driver = dialect.Debug(c.driver, c.log) + } +} + +// Debug enables debug logging on the ent.Driver. +func Debug() Option { + return func(c *config) { + c.debug = true + } +} + +// Log sets the logging function for debug mode. +func Log(fn func(...any)) Option { + return func(c *config) { + c.log = fn + } +} + +// Driver configures the client driver. +func Driver(driver dialect.Driver) Option { + return func(c *config) { + c.driver = driver + } +} + +// Open opens a database/sql.DB specified by the driver name and +// the data source name, and returns a new client attached to it. +// Optional parameters can be added for configuring the client. +func Open(driverName, dataSourceName string, options ...Option) (*Client, error) { + switch driverName { + case dialect.MySQL, dialect.Postgres, dialect.SQLite: + drv, err := sql.Open(driverName, dataSourceName) + if err != nil { + return nil, err + } + return NewClient(append(options, Driver(drv))...), nil + default: + return nil, fmt.Errorf("unsupported driver: %q", driverName) + } +} + +// ErrTxStarted is returned when trying to start a new transaction from a transactional client. +var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction") + +// Tx returns a new transactional client. The provided context +// is used until the transaction is committed or rolled back. +func (c *Client) Tx(ctx context.Context) (*Tx, error) { + if _, ok := c.driver.(*txDriver); ok { + return nil, ErrTxStarted + } + tx, err := newTx(ctx, c.driver) + if err != nil { + return nil, fmt.Errorf("ent: starting a transaction: %w", err) + } + cfg := c.config + cfg.driver = tx + return &Tx{ + ctx: ctx, + config: cfg, + Dict: NewDictClient(cfg), + DictDetail: NewDictDetailClient(cfg), + Menu: NewMenuClient(cfg), + Organization: NewOrganizationClient(cfg), + Position: NewPositionClient(cfg), + Role: NewRoleClient(cfg), + User: NewUserClient(cfg), + }, nil +} + +// BeginTx returns a transactional client with specified options. +func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) { + if _, ok := c.driver.(*txDriver); ok { + return nil, errors.New("ent: cannot start a transaction within a transaction") + } + tx, err := c.driver.(interface { + BeginTx(context.Context, *sql.TxOptions) (dialect.Tx, error) + }).BeginTx(ctx, opts) + if err != nil { + return nil, fmt.Errorf("ent: starting a transaction: %w", err) + } + cfg := c.config + cfg.driver = &txDriver{tx: tx, drv: c.driver} + return &Tx{ + ctx: ctx, + config: cfg, + Dict: NewDictClient(cfg), + DictDetail: NewDictDetailClient(cfg), + Menu: NewMenuClient(cfg), + Organization: NewOrganizationClient(cfg), + Position: NewPositionClient(cfg), + Role: NewRoleClient(cfg), + User: NewUserClient(cfg), + }, nil +} + +// Debug returns a new debug-client. It's used to get verbose logging on specific operations. +// +// client.Debug(). +// Dict. +// Query(). +// Count(ctx) +func (c *Client) Debug() *Client { + if c.debug { + return c + } + cfg := c.config + cfg.driver = dialect.Debug(c.driver, c.log) + client := &Client{config: cfg} + client.init() + return client +} + +// Close closes the database connection and prevents new queries from starting. +func (c *Client) Close() error { + return c.driver.Close() +} + +// Use adds the mutation hooks to all the entity clients. +// In order to add hooks to a specific client, call: `client.Node.Use(...)`. +func (c *Client) Use(hooks ...Hook) { + for _, n := range []interface{ Use(...Hook) }{ + c.Dict, c.DictDetail, c.Menu, c.Organization, c.Position, c.Role, c.User, + } { + n.Use(hooks...) + } +} + +// Intercept adds the query interceptors to all the entity clients. +// In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`. +func (c *Client) Intercept(interceptors ...Interceptor) { + for _, n := range []interface{ Intercept(...Interceptor) }{ + c.Dict, c.DictDetail, c.Menu, c.Organization, c.Position, c.Role, c.User, + } { + n.Intercept(interceptors...) + } +} + +// Mutate implements the ent.Mutator interface. +func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error) { + switch m := m.(type) { + case *DictMutation: + return c.Dict.mutate(ctx, m) + case *DictDetailMutation: + return c.DictDetail.mutate(ctx, m) + case *MenuMutation: + return c.Menu.mutate(ctx, m) + case *OrganizationMutation: + return c.Organization.mutate(ctx, m) + case *PositionMutation: + return c.Position.mutate(ctx, m) + case *RoleMutation: + return c.Role.mutate(ctx, m) + case *UserMutation: + return c.User.mutate(ctx, m) + default: + return nil, fmt.Errorf("ent: unknown mutation type %T", m) + } +} + +// DictClient is a client for the Dict schema. +type DictClient struct { + config +} + +// NewDictClient returns a client for the Dict from the given config. +func NewDictClient(c config) *DictClient { + return &DictClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `dict.Hooks(f(g(h())))`. +func (c *DictClient) Use(hooks ...Hook) { + c.hooks.Dict = append(c.hooks.Dict, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `dict.Intercept(f(g(h())))`. +func (c *DictClient) Intercept(interceptors ...Interceptor) { + c.inters.Dict = append(c.inters.Dict, interceptors...) +} + +// Create returns a builder for creating a Dict entity. +func (c *DictClient) Create() *DictCreate { + mutation := newDictMutation(c.config, OpCreate) + return &DictCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of Dict entities. +func (c *DictClient) CreateBulk(builders ...*DictCreate) *DictCreateBulk { + return &DictCreateBulk{config: c.config, builders: builders} +} + +// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates +// a builder and applies setFunc on it. +func (c *DictClient) MapCreateBulk(slice any, setFunc func(*DictCreate, int)) *DictCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &DictCreateBulk{err: fmt.Errorf("calling to DictClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*DictCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &DictCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for Dict. +func (c *DictClient) Update() *DictUpdate { + mutation := newDictMutation(c.config, OpUpdate) + return &DictUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *DictClient) UpdateOne(d *Dict) *DictUpdateOne { + mutation := newDictMutation(c.config, OpUpdateOne, withDict(d)) + return &DictUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *DictClient) UpdateOneID(id uint32) *DictUpdateOne { + mutation := newDictMutation(c.config, OpUpdateOne, withDictID(id)) + return &DictUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for Dict. +func (c *DictClient) Delete() *DictDelete { + mutation := newDictMutation(c.config, OpDelete) + return &DictDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *DictClient) DeleteOne(d *Dict) *DictDeleteOne { + return c.DeleteOneID(d.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *DictClient) DeleteOneID(id uint32) *DictDeleteOne { + builder := c.Delete().Where(dict.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &DictDeleteOne{builder} +} + +// Query returns a query builder for Dict. +func (c *DictClient) Query() *DictQuery { + return &DictQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeDict}, + inters: c.Interceptors(), + } +} + +// Get returns a Dict entity by its id. +func (c *DictClient) Get(ctx context.Context, id uint32) (*Dict, error) { + return c.Query().Where(dict.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *DictClient) GetX(ctx context.Context, id uint32) *Dict { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// Hooks returns the client hooks. +func (c *DictClient) Hooks() []Hook { + return c.hooks.Dict +} + +// Interceptors returns the client interceptors. +func (c *DictClient) Interceptors() []Interceptor { + return c.inters.Dict +} + +func (c *DictClient) mutate(ctx context.Context, m *DictMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&DictCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&DictUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&DictUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&DictDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("ent: unknown Dict mutation op: %q", m.Op()) + } +} + +// DictDetailClient is a client for the DictDetail schema. +type DictDetailClient struct { + config +} + +// NewDictDetailClient returns a client for the DictDetail from the given config. +func NewDictDetailClient(c config) *DictDetailClient { + return &DictDetailClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `dictdetail.Hooks(f(g(h())))`. +func (c *DictDetailClient) Use(hooks ...Hook) { + c.hooks.DictDetail = append(c.hooks.DictDetail, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `dictdetail.Intercept(f(g(h())))`. +func (c *DictDetailClient) Intercept(interceptors ...Interceptor) { + c.inters.DictDetail = append(c.inters.DictDetail, interceptors...) +} + +// Create returns a builder for creating a DictDetail entity. +func (c *DictDetailClient) Create() *DictDetailCreate { + mutation := newDictDetailMutation(c.config, OpCreate) + return &DictDetailCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of DictDetail entities. +func (c *DictDetailClient) CreateBulk(builders ...*DictDetailCreate) *DictDetailCreateBulk { + return &DictDetailCreateBulk{config: c.config, builders: builders} +} + +// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates +// a builder and applies setFunc on it. +func (c *DictDetailClient) MapCreateBulk(slice any, setFunc func(*DictDetailCreate, int)) *DictDetailCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &DictDetailCreateBulk{err: fmt.Errorf("calling to DictDetailClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*DictDetailCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &DictDetailCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for DictDetail. +func (c *DictDetailClient) Update() *DictDetailUpdate { + mutation := newDictDetailMutation(c.config, OpUpdate) + return &DictDetailUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *DictDetailClient) UpdateOne(dd *DictDetail) *DictDetailUpdateOne { + mutation := newDictDetailMutation(c.config, OpUpdateOne, withDictDetail(dd)) + return &DictDetailUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *DictDetailClient) UpdateOneID(id uint32) *DictDetailUpdateOne { + mutation := newDictDetailMutation(c.config, OpUpdateOne, withDictDetailID(id)) + return &DictDetailUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for DictDetail. +func (c *DictDetailClient) Delete() *DictDetailDelete { + mutation := newDictDetailMutation(c.config, OpDelete) + return &DictDetailDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *DictDetailClient) DeleteOne(dd *DictDetail) *DictDetailDeleteOne { + return c.DeleteOneID(dd.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *DictDetailClient) DeleteOneID(id uint32) *DictDetailDeleteOne { + builder := c.Delete().Where(dictdetail.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &DictDetailDeleteOne{builder} +} + +// Query returns a query builder for DictDetail. +func (c *DictDetailClient) Query() *DictDetailQuery { + return &DictDetailQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeDictDetail}, + inters: c.Interceptors(), + } +} + +// Get returns a DictDetail entity by its id. +func (c *DictDetailClient) Get(ctx context.Context, id uint32) (*DictDetail, error) { + return c.Query().Where(dictdetail.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *DictDetailClient) GetX(ctx context.Context, id uint32) *DictDetail { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// Hooks returns the client hooks. +func (c *DictDetailClient) Hooks() []Hook { + return c.hooks.DictDetail +} + +// Interceptors returns the client interceptors. +func (c *DictDetailClient) Interceptors() []Interceptor { + return c.inters.DictDetail +} + +func (c *DictDetailClient) mutate(ctx context.Context, m *DictDetailMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&DictDetailCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&DictDetailUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&DictDetailUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&DictDetailDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("ent: unknown DictDetail mutation op: %q", m.Op()) + } +} + +// MenuClient is a client for the Menu schema. +type MenuClient struct { + config +} + +// NewMenuClient returns a client for the Menu from the given config. +func NewMenuClient(c config) *MenuClient { + return &MenuClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `menu.Hooks(f(g(h())))`. +func (c *MenuClient) Use(hooks ...Hook) { + c.hooks.Menu = append(c.hooks.Menu, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `menu.Intercept(f(g(h())))`. +func (c *MenuClient) Intercept(interceptors ...Interceptor) { + c.inters.Menu = append(c.inters.Menu, interceptors...) +} + +// Create returns a builder for creating a Menu entity. +func (c *MenuClient) Create() *MenuCreate { + mutation := newMenuMutation(c.config, OpCreate) + return &MenuCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of Menu entities. +func (c *MenuClient) CreateBulk(builders ...*MenuCreate) *MenuCreateBulk { + return &MenuCreateBulk{config: c.config, builders: builders} +} + +// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates +// a builder and applies setFunc on it. +func (c *MenuClient) MapCreateBulk(slice any, setFunc func(*MenuCreate, int)) *MenuCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &MenuCreateBulk{err: fmt.Errorf("calling to MenuClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*MenuCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &MenuCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for Menu. +func (c *MenuClient) Update() *MenuUpdate { + mutation := newMenuMutation(c.config, OpUpdate) + return &MenuUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *MenuClient) UpdateOne(m *Menu) *MenuUpdateOne { + mutation := newMenuMutation(c.config, OpUpdateOne, withMenu(m)) + return &MenuUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *MenuClient) UpdateOneID(id int32) *MenuUpdateOne { + mutation := newMenuMutation(c.config, OpUpdateOne, withMenuID(id)) + return &MenuUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for Menu. +func (c *MenuClient) Delete() *MenuDelete { + mutation := newMenuMutation(c.config, OpDelete) + return &MenuDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *MenuClient) DeleteOne(m *Menu) *MenuDeleteOne { + return c.DeleteOneID(m.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *MenuClient) DeleteOneID(id int32) *MenuDeleteOne { + builder := c.Delete().Where(menu.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &MenuDeleteOne{builder} +} + +// Query returns a query builder for Menu. +func (c *MenuClient) Query() *MenuQuery { + return &MenuQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeMenu}, + inters: c.Interceptors(), + } +} + +// Get returns a Menu entity by its id. +func (c *MenuClient) Get(ctx context.Context, id int32) (*Menu, error) { + return c.Query().Where(menu.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *MenuClient) GetX(ctx context.Context, id int32) *Menu { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryParent queries the parent edge of a Menu. +func (c *MenuClient) QueryParent(m *Menu) *MenuQuery { + query := (&MenuClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := m.ID + step := sqlgraph.NewStep( + sqlgraph.From(menu.Table, menu.FieldID, id), + sqlgraph.To(menu.Table, menu.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, menu.ParentTable, menu.ParentColumn), + ) + fromV = sqlgraph.Neighbors(m.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryChildren queries the children edge of a Menu. +func (c *MenuClient) QueryChildren(m *Menu) *MenuQuery { + query := (&MenuClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := m.ID + step := sqlgraph.NewStep( + sqlgraph.From(menu.Table, menu.FieldID, id), + sqlgraph.To(menu.Table, menu.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, menu.ChildrenTable, menu.ChildrenColumn), + ) + fromV = sqlgraph.Neighbors(m.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *MenuClient) Hooks() []Hook { + return c.hooks.Menu +} + +// Interceptors returns the client interceptors. +func (c *MenuClient) Interceptors() []Interceptor { + return c.inters.Menu +} + +func (c *MenuClient) mutate(ctx context.Context, m *MenuMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&MenuCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&MenuUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&MenuUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&MenuDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("ent: unknown Menu mutation op: %q", m.Op()) + } +} + +// OrganizationClient is a client for the Organization schema. +type OrganizationClient struct { + config +} + +// NewOrganizationClient returns a client for the Organization from the given config. +func NewOrganizationClient(c config) *OrganizationClient { + return &OrganizationClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `organization.Hooks(f(g(h())))`. +func (c *OrganizationClient) Use(hooks ...Hook) { + c.hooks.Organization = append(c.hooks.Organization, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `organization.Intercept(f(g(h())))`. +func (c *OrganizationClient) Intercept(interceptors ...Interceptor) { + c.inters.Organization = append(c.inters.Organization, interceptors...) +} + +// Create returns a builder for creating a Organization entity. +func (c *OrganizationClient) Create() *OrganizationCreate { + mutation := newOrganizationMutation(c.config, OpCreate) + return &OrganizationCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of Organization entities. +func (c *OrganizationClient) CreateBulk(builders ...*OrganizationCreate) *OrganizationCreateBulk { + return &OrganizationCreateBulk{config: c.config, builders: builders} +} + +// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates +// a builder and applies setFunc on it. +func (c *OrganizationClient) MapCreateBulk(slice any, setFunc func(*OrganizationCreate, int)) *OrganizationCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &OrganizationCreateBulk{err: fmt.Errorf("calling to OrganizationClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*OrganizationCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &OrganizationCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for Organization. +func (c *OrganizationClient) Update() *OrganizationUpdate { + mutation := newOrganizationMutation(c.config, OpUpdate) + return &OrganizationUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *OrganizationClient) UpdateOne(o *Organization) *OrganizationUpdateOne { + mutation := newOrganizationMutation(c.config, OpUpdateOne, withOrganization(o)) + return &OrganizationUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *OrganizationClient) UpdateOneID(id uint32) *OrganizationUpdateOne { + mutation := newOrganizationMutation(c.config, OpUpdateOne, withOrganizationID(id)) + return &OrganizationUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for Organization. +func (c *OrganizationClient) Delete() *OrganizationDelete { + mutation := newOrganizationMutation(c.config, OpDelete) + return &OrganizationDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *OrganizationClient) DeleteOne(o *Organization) *OrganizationDeleteOne { + return c.DeleteOneID(o.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *OrganizationClient) DeleteOneID(id uint32) *OrganizationDeleteOne { + builder := c.Delete().Where(organization.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &OrganizationDeleteOne{builder} +} + +// Query returns a query builder for Organization. +func (c *OrganizationClient) Query() *OrganizationQuery { + return &OrganizationQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeOrganization}, + inters: c.Interceptors(), + } +} + +// Get returns a Organization entity by its id. +func (c *OrganizationClient) Get(ctx context.Context, id uint32) (*Organization, error) { + return c.Query().Where(organization.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *OrganizationClient) GetX(ctx context.Context, id uint32) *Organization { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryParent queries the parent edge of a Organization. +func (c *OrganizationClient) QueryParent(o *Organization) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := o.ID + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, organization.ParentTable, organization.ParentColumn), + ) + fromV = sqlgraph.Neighbors(o.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryChildren queries the children edge of a Organization. +func (c *OrganizationClient) QueryChildren(o *Organization) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := o.ID + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.ChildrenTable, organization.ChildrenColumn), + ) + fromV = sqlgraph.Neighbors(o.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *OrganizationClient) Hooks() []Hook { + return c.hooks.Organization +} + +// Interceptors returns the client interceptors. +func (c *OrganizationClient) Interceptors() []Interceptor { + return c.inters.Organization +} + +func (c *OrganizationClient) mutate(ctx context.Context, m *OrganizationMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&OrganizationCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&OrganizationUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&OrganizationUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&OrganizationDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("ent: unknown Organization mutation op: %q", m.Op()) + } +} + +// PositionClient is a client for the Position schema. +type PositionClient struct { + config +} + +// NewPositionClient returns a client for the Position from the given config. +func NewPositionClient(c config) *PositionClient { + return &PositionClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `position.Hooks(f(g(h())))`. +func (c *PositionClient) Use(hooks ...Hook) { + c.hooks.Position = append(c.hooks.Position, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `position.Intercept(f(g(h())))`. +func (c *PositionClient) Intercept(interceptors ...Interceptor) { + c.inters.Position = append(c.inters.Position, interceptors...) +} + +// Create returns a builder for creating a Position entity. +func (c *PositionClient) Create() *PositionCreate { + mutation := newPositionMutation(c.config, OpCreate) + return &PositionCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of Position entities. +func (c *PositionClient) CreateBulk(builders ...*PositionCreate) *PositionCreateBulk { + return &PositionCreateBulk{config: c.config, builders: builders} +} + +// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates +// a builder and applies setFunc on it. +func (c *PositionClient) MapCreateBulk(slice any, setFunc func(*PositionCreate, int)) *PositionCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &PositionCreateBulk{err: fmt.Errorf("calling to PositionClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*PositionCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &PositionCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for Position. +func (c *PositionClient) Update() *PositionUpdate { + mutation := newPositionMutation(c.config, OpUpdate) + return &PositionUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *PositionClient) UpdateOne(po *Position) *PositionUpdateOne { + mutation := newPositionMutation(c.config, OpUpdateOne, withPosition(po)) + return &PositionUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *PositionClient) UpdateOneID(id uint32) *PositionUpdateOne { + mutation := newPositionMutation(c.config, OpUpdateOne, withPositionID(id)) + return &PositionUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for Position. +func (c *PositionClient) Delete() *PositionDelete { + mutation := newPositionMutation(c.config, OpDelete) + return &PositionDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *PositionClient) DeleteOne(po *Position) *PositionDeleteOne { + return c.DeleteOneID(po.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *PositionClient) DeleteOneID(id uint32) *PositionDeleteOne { + builder := c.Delete().Where(position.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &PositionDeleteOne{builder} +} + +// Query returns a query builder for Position. +func (c *PositionClient) Query() *PositionQuery { + return &PositionQuery{ + config: c.config, + ctx: &QueryContext{Type: TypePosition}, + inters: c.Interceptors(), + } +} + +// Get returns a Position entity by its id. +func (c *PositionClient) Get(ctx context.Context, id uint32) (*Position, error) { + return c.Query().Where(position.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *PositionClient) GetX(ctx context.Context, id uint32) *Position { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryParent queries the parent edge of a Position. +func (c *PositionClient) QueryParent(po *Position) *PositionQuery { + query := (&PositionClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := po.ID + step := sqlgraph.NewStep( + sqlgraph.From(position.Table, position.FieldID, id), + sqlgraph.To(position.Table, position.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, position.ParentTable, position.ParentColumn), + ) + fromV = sqlgraph.Neighbors(po.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryChildren queries the children edge of a Position. +func (c *PositionClient) QueryChildren(po *Position) *PositionQuery { + query := (&PositionClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := po.ID + step := sqlgraph.NewStep( + sqlgraph.From(position.Table, position.FieldID, id), + sqlgraph.To(position.Table, position.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, position.ChildrenTable, position.ChildrenColumn), + ) + fromV = sqlgraph.Neighbors(po.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *PositionClient) Hooks() []Hook { + return c.hooks.Position +} + +// Interceptors returns the client interceptors. +func (c *PositionClient) Interceptors() []Interceptor { + return c.inters.Position +} + +func (c *PositionClient) mutate(ctx context.Context, m *PositionMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&PositionCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&PositionUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&PositionUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&PositionDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("ent: unknown Position mutation op: %q", m.Op()) + } +} + +// RoleClient is a client for the Role schema. +type RoleClient struct { + config +} + +// NewRoleClient returns a client for the Role from the given config. +func NewRoleClient(c config) *RoleClient { + return &RoleClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `role.Hooks(f(g(h())))`. +func (c *RoleClient) Use(hooks ...Hook) { + c.hooks.Role = append(c.hooks.Role, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `role.Intercept(f(g(h())))`. +func (c *RoleClient) Intercept(interceptors ...Interceptor) { + c.inters.Role = append(c.inters.Role, interceptors...) +} + +// Create returns a builder for creating a Role entity. +func (c *RoleClient) Create() *RoleCreate { + mutation := newRoleMutation(c.config, OpCreate) + return &RoleCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of Role entities. +func (c *RoleClient) CreateBulk(builders ...*RoleCreate) *RoleCreateBulk { + return &RoleCreateBulk{config: c.config, builders: builders} +} + +// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates +// a builder and applies setFunc on it. +func (c *RoleClient) MapCreateBulk(slice any, setFunc func(*RoleCreate, int)) *RoleCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &RoleCreateBulk{err: fmt.Errorf("calling to RoleClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*RoleCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &RoleCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for Role. +func (c *RoleClient) Update() *RoleUpdate { + mutation := newRoleMutation(c.config, OpUpdate) + return &RoleUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *RoleClient) UpdateOne(r *Role) *RoleUpdateOne { + mutation := newRoleMutation(c.config, OpUpdateOne, withRole(r)) + return &RoleUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *RoleClient) UpdateOneID(id uint32) *RoleUpdateOne { + mutation := newRoleMutation(c.config, OpUpdateOne, withRoleID(id)) + return &RoleUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for Role. +func (c *RoleClient) Delete() *RoleDelete { + mutation := newRoleMutation(c.config, OpDelete) + return &RoleDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *RoleClient) DeleteOne(r *Role) *RoleDeleteOne { + return c.DeleteOneID(r.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *RoleClient) DeleteOneID(id uint32) *RoleDeleteOne { + builder := c.Delete().Where(role.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &RoleDeleteOne{builder} +} + +// Query returns a query builder for Role. +func (c *RoleClient) Query() *RoleQuery { + return &RoleQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeRole}, + inters: c.Interceptors(), + } +} + +// Get returns a Role entity by its id. +func (c *RoleClient) Get(ctx context.Context, id uint32) (*Role, error) { + return c.Query().Where(role.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *RoleClient) GetX(ctx context.Context, id uint32) *Role { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryParent queries the parent edge of a Role. +func (c *RoleClient) QueryParent(r *Role) *RoleQuery { + query := (&RoleClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := r.ID + step := sqlgraph.NewStep( + sqlgraph.From(role.Table, role.FieldID, id), + sqlgraph.To(role.Table, role.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, role.ParentTable, role.ParentColumn), + ) + fromV = sqlgraph.Neighbors(r.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryChildren queries the children edge of a Role. +func (c *RoleClient) QueryChildren(r *Role) *RoleQuery { + query := (&RoleClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := r.ID + step := sqlgraph.NewStep( + sqlgraph.From(role.Table, role.FieldID, id), + sqlgraph.To(role.Table, role.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, role.ChildrenTable, role.ChildrenColumn), + ) + fromV = sqlgraph.Neighbors(r.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *RoleClient) Hooks() []Hook { + return c.hooks.Role +} + +// Interceptors returns the client interceptors. +func (c *RoleClient) Interceptors() []Interceptor { + return c.inters.Role +} + +func (c *RoleClient) mutate(ctx context.Context, m *RoleMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&RoleCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&RoleUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&RoleUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&RoleDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("ent: unknown Role mutation op: %q", m.Op()) + } +} + +// UserClient is a client for the User schema. +type UserClient struct { + config +} + +// NewUserClient returns a client for the User from the given config. +func NewUserClient(c config) *UserClient { + return &UserClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`. +func (c *UserClient) Use(hooks ...Hook) { + c.hooks.User = append(c.hooks.User, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`. +func (c *UserClient) Intercept(interceptors ...Interceptor) { + c.inters.User = append(c.inters.User, interceptors...) +} + +// Create returns a builder for creating a User entity. +func (c *UserClient) Create() *UserCreate { + mutation := newUserMutation(c.config, OpCreate) + return &UserCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of User entities. +func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk { + return &UserCreateBulk{config: c.config, builders: builders} +} + +// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates +// a builder and applies setFunc on it. +func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &UserCreateBulk{err: fmt.Errorf("calling to UserClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*UserCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &UserCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for User. +func (c *UserClient) Update() *UserUpdate { + mutation := newUserMutation(c.config, OpUpdate) + return &UserUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *UserClient) UpdateOne(u *User) *UserUpdateOne { + mutation := newUserMutation(c.config, OpUpdateOne, withUser(u)) + return &UserUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *UserClient) UpdateOneID(id uint32) *UserUpdateOne { + mutation := newUserMutation(c.config, OpUpdateOne, withUserID(id)) + return &UserUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for User. +func (c *UserClient) Delete() *UserDelete { + mutation := newUserMutation(c.config, OpDelete) + return &UserDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *UserClient) DeleteOne(u *User) *UserDeleteOne { + return c.DeleteOneID(u.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *UserClient) DeleteOneID(id uint32) *UserDeleteOne { + builder := c.Delete().Where(user.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &UserDeleteOne{builder} +} + +// Query returns a query builder for User. +func (c *UserClient) Query() *UserQuery { + return &UserQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeUser}, + inters: c.Interceptors(), + } +} + +// Get returns a User entity by its id. +func (c *UserClient) Get(ctx context.Context, id uint32) (*User, error) { + return c.Query().Where(user.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *UserClient) GetX(ctx context.Context, id uint32) *User { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// Hooks returns the client hooks. +func (c *UserClient) Hooks() []Hook { + return c.hooks.User +} + +// Interceptors returns the client interceptors. +func (c *UserClient) Interceptors() []Interceptor { + return c.inters.User +} + +func (c *UserClient) mutate(ctx context.Context, m *UserMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&UserCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&UserUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&UserUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&UserDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("ent: unknown User mutation op: %q", m.Op()) + } +} + +// hooks and interceptors per client, for fast access. +type ( + hooks struct { + Dict, DictDetail, Menu, Organization, Position, Role, User []ent.Hook + } + inters struct { + Dict, DictDetail, Menu, Organization, Position, Role, User []ent.Interceptor + } +) diff --git a/monolithic/backend/app/admin/service/internal/data/ent/dict.go b/monolithic/backend/app/admin/service/internal/data/ent/dict.go new file mode 100644 index 0000000..42fa3bb --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/dict.go @@ -0,0 +1,180 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/dict" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" +) + +// Dict is the model entity for the Dict schema. +type Dict struct { + config `json:"-"` + // ID of the ent. + // id + ID uint32 `json:"id,omitempty"` + // 创建时间 + CreateTime *time.Time `json:"create_time,omitempty"` + // 更新时间 + UpdateTime *time.Time `json:"update_time,omitempty"` + // 删除时间 + DeleteTime *time.Time `json:"delete_time,omitempty"` + // 创建者ID + CreateBy *uint32 `json:"create_by,omitempty"` + // 字典名称 + Name *string `json:"name,omitempty"` + // 描述 + Description *string `json:"description,omitempty"` + selectValues sql.SelectValues +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*Dict) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case dict.FieldID, dict.FieldCreateBy: + values[i] = new(sql.NullInt64) + case dict.FieldName, dict.FieldDescription: + values[i] = new(sql.NullString) + case dict.FieldCreateTime, dict.FieldUpdateTime, dict.FieldDeleteTime: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the Dict fields. +func (d *Dict) assignValues(columns []string, values []any) error { + if m, n := len(values), len(columns); m < n { + return fmt.Errorf("mismatch number of scan values: %d != %d", m, n) + } + for i := range columns { + switch columns[i] { + case dict.FieldID: + value, ok := values[i].(*sql.NullInt64) + if !ok { + return fmt.Errorf("unexpected type %T for field id", value) + } + d.ID = uint32(value.Int64) + case dict.FieldCreateTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field create_time", values[i]) + } else if value.Valid { + d.CreateTime = new(time.Time) + *d.CreateTime = value.Time + } + case dict.FieldUpdateTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field update_time", values[i]) + } else if value.Valid { + d.UpdateTime = new(time.Time) + *d.UpdateTime = value.Time + } + case dict.FieldDeleteTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field delete_time", values[i]) + } else if value.Valid { + d.DeleteTime = new(time.Time) + *d.DeleteTime = value.Time + } + case dict.FieldCreateBy: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field create_by", values[i]) + } else if value.Valid { + d.CreateBy = new(uint32) + *d.CreateBy = uint32(value.Int64) + } + case dict.FieldName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[i]) + } else if value.Valid { + d.Name = new(string) + *d.Name = value.String + } + case dict.FieldDescription: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field description", values[i]) + } else if value.Valid { + d.Description = new(string) + *d.Description = value.String + } + default: + d.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the Dict. +// This includes values selected through modifiers, order, etc. +func (d *Dict) Value(name string) (ent.Value, error) { + return d.selectValues.Get(name) +} + +// Update returns a builder for updating this Dict. +// Note that you need to call Dict.Unwrap() before calling this method if this Dict +// was returned from a transaction, and the transaction was committed or rolled back. +func (d *Dict) Update() *DictUpdateOne { + return NewDictClient(d.config).UpdateOne(d) +} + +// Unwrap unwraps the Dict entity that was returned from a transaction after it was closed, +// so that all future queries will be executed through the driver which created the transaction. +func (d *Dict) Unwrap() *Dict { + _tx, ok := d.config.driver.(*txDriver) + if !ok { + panic("ent: Dict is not a transactional entity") + } + d.config.driver = _tx.drv + return d +} + +// String implements the fmt.Stringer. +func (d *Dict) String() string { + var builder strings.Builder + builder.WriteString("Dict(") + builder.WriteString(fmt.Sprintf("id=%v, ", d.ID)) + if v := d.CreateTime; v != nil { + builder.WriteString("create_time=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + if v := d.UpdateTime; v != nil { + builder.WriteString("update_time=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + if v := d.DeleteTime; v != nil { + builder.WriteString("delete_time=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + if v := d.CreateBy; v != nil { + builder.WriteString("create_by=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := d.Name; v != nil { + builder.WriteString("name=") + builder.WriteString(*v) + } + builder.WriteString(", ") + if v := d.Description; v != nil { + builder.WriteString("description=") + builder.WriteString(*v) + } + builder.WriteByte(')') + return builder.String() +} + +// Dicts is a parsable slice of Dict. +type Dicts []*Dict diff --git a/monolithic/backend/app/admin/service/internal/data/ent/dict/dict.go b/monolithic/backend/app/admin/service/internal/data/ent/dict/dict.go new file mode 100644 index 0000000..5fdcbcc --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/dict/dict.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package dict + +import ( + "entgo.io/ent/dialect/sql" +) + +const ( + // Label holds the string label denoting the dict type in the database. + Label = "dict" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreateTime holds the string denoting the create_time field in the database. + FieldCreateTime = "create_time" + // FieldUpdateTime holds the string denoting the update_time field in the database. + FieldUpdateTime = "update_time" + // FieldDeleteTime holds the string denoting the delete_time field in the database. + FieldDeleteTime = "delete_time" + // FieldCreateBy holds the string denoting the create_by field in the database. + FieldCreateBy = "create_by" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // FieldDescription holds the string denoting the description field in the database. + FieldDescription = "description" + // Table holds the table name of the dict in the database. + Table = "dict" +) + +// Columns holds all SQL columns for dict fields. +var Columns = []string{ + FieldID, + FieldCreateTime, + FieldUpdateTime, + FieldDeleteTime, + FieldCreateBy, + FieldName, + FieldDescription, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +var ( + // IDValidator is a validator for the "id" field. It is called by the builders before save. + IDValidator func(uint32) error +) + +// OrderOption defines the ordering options for the Dict queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreateTime orders the results by the create_time field. +func ByCreateTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreateTime, opts...).ToFunc() +} + +// ByUpdateTime orders the results by the update_time field. +func ByUpdateTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdateTime, opts...).ToFunc() +} + +// ByDeleteTime orders the results by the delete_time field. +func ByDeleteTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeleteTime, opts...).ToFunc() +} + +// ByCreateBy orders the results by the create_by field. +func ByCreateBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreateBy, opts...).ToFunc() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +// ByDescription orders the results by the description field. +func ByDescription(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDescription, opts...).ToFunc() +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/dict/where.go b/monolithic/backend/app/admin/service/internal/data/ent/dict/where.go new file mode 100644 index 0000000..0e108b4 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/dict/where.go @@ -0,0 +1,450 @@ +// Code generated by ent, DO NOT EDIT. + +package dict + +import ( + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + "time" + + "entgo.io/ent/dialect/sql" +) + +// ID filters vertices based on their ID field. +func ID(id uint32) predicate.Dict { + return predicate.Dict(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id uint32) predicate.Dict { + return predicate.Dict(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id uint32) predicate.Dict { + return predicate.Dict(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...uint32) predicate.Dict { + return predicate.Dict(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...uint32) predicate.Dict { + return predicate.Dict(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id uint32) predicate.Dict { + return predicate.Dict(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id uint32) predicate.Dict { + return predicate.Dict(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id uint32) predicate.Dict { + return predicate.Dict(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id uint32) predicate.Dict { + return predicate.Dict(sql.FieldLTE(FieldID, id)) +} + +// CreateTime applies equality check predicate on the "create_time" field. It's identical to CreateTimeEQ. +func CreateTime(v time.Time) predicate.Dict { + return predicate.Dict(sql.FieldEQ(FieldCreateTime, v)) +} + +// UpdateTime applies equality check predicate on the "update_time" field. It's identical to UpdateTimeEQ. +func UpdateTime(v time.Time) predicate.Dict { + return predicate.Dict(sql.FieldEQ(FieldUpdateTime, v)) +} + +// DeleteTime applies equality check predicate on the "delete_time" field. It's identical to DeleteTimeEQ. +func DeleteTime(v time.Time) predicate.Dict { + return predicate.Dict(sql.FieldEQ(FieldDeleteTime, v)) +} + +// CreateBy applies equality check predicate on the "create_by" field. It's identical to CreateByEQ. +func CreateBy(v uint32) predicate.Dict { + return predicate.Dict(sql.FieldEQ(FieldCreateBy, v)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.Dict { + return predicate.Dict(sql.FieldEQ(FieldName, v)) +} + +// Description applies equality check predicate on the "description" field. It's identical to DescriptionEQ. +func Description(v string) predicate.Dict { + return predicate.Dict(sql.FieldEQ(FieldDescription, v)) +} + +// CreateTimeEQ applies the EQ predicate on the "create_time" field. +func CreateTimeEQ(v time.Time) predicate.Dict { + return predicate.Dict(sql.FieldEQ(FieldCreateTime, v)) +} + +// CreateTimeNEQ applies the NEQ predicate on the "create_time" field. +func CreateTimeNEQ(v time.Time) predicate.Dict { + return predicate.Dict(sql.FieldNEQ(FieldCreateTime, v)) +} + +// CreateTimeIn applies the In predicate on the "create_time" field. +func CreateTimeIn(vs ...time.Time) predicate.Dict { + return predicate.Dict(sql.FieldIn(FieldCreateTime, vs...)) +} + +// CreateTimeNotIn applies the NotIn predicate on the "create_time" field. +func CreateTimeNotIn(vs ...time.Time) predicate.Dict { + return predicate.Dict(sql.FieldNotIn(FieldCreateTime, vs...)) +} + +// CreateTimeGT applies the GT predicate on the "create_time" field. +func CreateTimeGT(v time.Time) predicate.Dict { + return predicate.Dict(sql.FieldGT(FieldCreateTime, v)) +} + +// CreateTimeGTE applies the GTE predicate on the "create_time" field. +func CreateTimeGTE(v time.Time) predicate.Dict { + return predicate.Dict(sql.FieldGTE(FieldCreateTime, v)) +} + +// CreateTimeLT applies the LT predicate on the "create_time" field. +func CreateTimeLT(v time.Time) predicate.Dict { + return predicate.Dict(sql.FieldLT(FieldCreateTime, v)) +} + +// CreateTimeLTE applies the LTE predicate on the "create_time" field. +func CreateTimeLTE(v time.Time) predicate.Dict { + return predicate.Dict(sql.FieldLTE(FieldCreateTime, v)) +} + +// CreateTimeIsNil applies the IsNil predicate on the "create_time" field. +func CreateTimeIsNil() predicate.Dict { + return predicate.Dict(sql.FieldIsNull(FieldCreateTime)) +} + +// CreateTimeNotNil applies the NotNil predicate on the "create_time" field. +func CreateTimeNotNil() predicate.Dict { + return predicate.Dict(sql.FieldNotNull(FieldCreateTime)) +} + +// UpdateTimeEQ applies the EQ predicate on the "update_time" field. +func UpdateTimeEQ(v time.Time) predicate.Dict { + return predicate.Dict(sql.FieldEQ(FieldUpdateTime, v)) +} + +// UpdateTimeNEQ applies the NEQ predicate on the "update_time" field. +func UpdateTimeNEQ(v time.Time) predicate.Dict { + return predicate.Dict(sql.FieldNEQ(FieldUpdateTime, v)) +} + +// UpdateTimeIn applies the In predicate on the "update_time" field. +func UpdateTimeIn(vs ...time.Time) predicate.Dict { + return predicate.Dict(sql.FieldIn(FieldUpdateTime, vs...)) +} + +// UpdateTimeNotIn applies the NotIn predicate on the "update_time" field. +func UpdateTimeNotIn(vs ...time.Time) predicate.Dict { + return predicate.Dict(sql.FieldNotIn(FieldUpdateTime, vs...)) +} + +// UpdateTimeGT applies the GT predicate on the "update_time" field. +func UpdateTimeGT(v time.Time) predicate.Dict { + return predicate.Dict(sql.FieldGT(FieldUpdateTime, v)) +} + +// UpdateTimeGTE applies the GTE predicate on the "update_time" field. +func UpdateTimeGTE(v time.Time) predicate.Dict { + return predicate.Dict(sql.FieldGTE(FieldUpdateTime, v)) +} + +// UpdateTimeLT applies the LT predicate on the "update_time" field. +func UpdateTimeLT(v time.Time) predicate.Dict { + return predicate.Dict(sql.FieldLT(FieldUpdateTime, v)) +} + +// UpdateTimeLTE applies the LTE predicate on the "update_time" field. +func UpdateTimeLTE(v time.Time) predicate.Dict { + return predicate.Dict(sql.FieldLTE(FieldUpdateTime, v)) +} + +// UpdateTimeIsNil applies the IsNil predicate on the "update_time" field. +func UpdateTimeIsNil() predicate.Dict { + return predicate.Dict(sql.FieldIsNull(FieldUpdateTime)) +} + +// UpdateTimeNotNil applies the NotNil predicate on the "update_time" field. +func UpdateTimeNotNil() predicate.Dict { + return predicate.Dict(sql.FieldNotNull(FieldUpdateTime)) +} + +// DeleteTimeEQ applies the EQ predicate on the "delete_time" field. +func DeleteTimeEQ(v time.Time) predicate.Dict { + return predicate.Dict(sql.FieldEQ(FieldDeleteTime, v)) +} + +// DeleteTimeNEQ applies the NEQ predicate on the "delete_time" field. +func DeleteTimeNEQ(v time.Time) predicate.Dict { + return predicate.Dict(sql.FieldNEQ(FieldDeleteTime, v)) +} + +// DeleteTimeIn applies the In predicate on the "delete_time" field. +func DeleteTimeIn(vs ...time.Time) predicate.Dict { + return predicate.Dict(sql.FieldIn(FieldDeleteTime, vs...)) +} + +// DeleteTimeNotIn applies the NotIn predicate on the "delete_time" field. +func DeleteTimeNotIn(vs ...time.Time) predicate.Dict { + return predicate.Dict(sql.FieldNotIn(FieldDeleteTime, vs...)) +} + +// DeleteTimeGT applies the GT predicate on the "delete_time" field. +func DeleteTimeGT(v time.Time) predicate.Dict { + return predicate.Dict(sql.FieldGT(FieldDeleteTime, v)) +} + +// DeleteTimeGTE applies the GTE predicate on the "delete_time" field. +func DeleteTimeGTE(v time.Time) predicate.Dict { + return predicate.Dict(sql.FieldGTE(FieldDeleteTime, v)) +} + +// DeleteTimeLT applies the LT predicate on the "delete_time" field. +func DeleteTimeLT(v time.Time) predicate.Dict { + return predicate.Dict(sql.FieldLT(FieldDeleteTime, v)) +} + +// DeleteTimeLTE applies the LTE predicate on the "delete_time" field. +func DeleteTimeLTE(v time.Time) predicate.Dict { + return predicate.Dict(sql.FieldLTE(FieldDeleteTime, v)) +} + +// DeleteTimeIsNil applies the IsNil predicate on the "delete_time" field. +func DeleteTimeIsNil() predicate.Dict { + return predicate.Dict(sql.FieldIsNull(FieldDeleteTime)) +} + +// DeleteTimeNotNil applies the NotNil predicate on the "delete_time" field. +func DeleteTimeNotNil() predicate.Dict { + return predicate.Dict(sql.FieldNotNull(FieldDeleteTime)) +} + +// CreateByEQ applies the EQ predicate on the "create_by" field. +func CreateByEQ(v uint32) predicate.Dict { + return predicate.Dict(sql.FieldEQ(FieldCreateBy, v)) +} + +// CreateByNEQ applies the NEQ predicate on the "create_by" field. +func CreateByNEQ(v uint32) predicate.Dict { + return predicate.Dict(sql.FieldNEQ(FieldCreateBy, v)) +} + +// CreateByIn applies the In predicate on the "create_by" field. +func CreateByIn(vs ...uint32) predicate.Dict { + return predicate.Dict(sql.FieldIn(FieldCreateBy, vs...)) +} + +// CreateByNotIn applies the NotIn predicate on the "create_by" field. +func CreateByNotIn(vs ...uint32) predicate.Dict { + return predicate.Dict(sql.FieldNotIn(FieldCreateBy, vs...)) +} + +// CreateByGT applies the GT predicate on the "create_by" field. +func CreateByGT(v uint32) predicate.Dict { + return predicate.Dict(sql.FieldGT(FieldCreateBy, v)) +} + +// CreateByGTE applies the GTE predicate on the "create_by" field. +func CreateByGTE(v uint32) predicate.Dict { + return predicate.Dict(sql.FieldGTE(FieldCreateBy, v)) +} + +// CreateByLT applies the LT predicate on the "create_by" field. +func CreateByLT(v uint32) predicate.Dict { + return predicate.Dict(sql.FieldLT(FieldCreateBy, v)) +} + +// CreateByLTE applies the LTE predicate on the "create_by" field. +func CreateByLTE(v uint32) predicate.Dict { + return predicate.Dict(sql.FieldLTE(FieldCreateBy, v)) +} + +// CreateByIsNil applies the IsNil predicate on the "create_by" field. +func CreateByIsNil() predicate.Dict { + return predicate.Dict(sql.FieldIsNull(FieldCreateBy)) +} + +// CreateByNotNil applies the NotNil predicate on the "create_by" field. +func CreateByNotNil() predicate.Dict { + return predicate.Dict(sql.FieldNotNull(FieldCreateBy)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.Dict { + return predicate.Dict(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.Dict { + return predicate.Dict(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.Dict { + return predicate.Dict(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.Dict { + return predicate.Dict(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.Dict { + return predicate.Dict(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.Dict { + return predicate.Dict(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.Dict { + return predicate.Dict(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.Dict { + return predicate.Dict(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.Dict { + return predicate.Dict(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.Dict { + return predicate.Dict(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.Dict { + return predicate.Dict(sql.FieldHasSuffix(FieldName, v)) +} + +// NameIsNil applies the IsNil predicate on the "name" field. +func NameIsNil() predicate.Dict { + return predicate.Dict(sql.FieldIsNull(FieldName)) +} + +// NameNotNil applies the NotNil predicate on the "name" field. +func NameNotNil() predicate.Dict { + return predicate.Dict(sql.FieldNotNull(FieldName)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.Dict { + return predicate.Dict(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.Dict { + return predicate.Dict(sql.FieldContainsFold(FieldName, v)) +} + +// DescriptionEQ applies the EQ predicate on the "description" field. +func DescriptionEQ(v string) predicate.Dict { + return predicate.Dict(sql.FieldEQ(FieldDescription, v)) +} + +// DescriptionNEQ applies the NEQ predicate on the "description" field. +func DescriptionNEQ(v string) predicate.Dict { + return predicate.Dict(sql.FieldNEQ(FieldDescription, v)) +} + +// DescriptionIn applies the In predicate on the "description" field. +func DescriptionIn(vs ...string) predicate.Dict { + return predicate.Dict(sql.FieldIn(FieldDescription, vs...)) +} + +// DescriptionNotIn applies the NotIn predicate on the "description" field. +func DescriptionNotIn(vs ...string) predicate.Dict { + return predicate.Dict(sql.FieldNotIn(FieldDescription, vs...)) +} + +// DescriptionGT applies the GT predicate on the "description" field. +func DescriptionGT(v string) predicate.Dict { + return predicate.Dict(sql.FieldGT(FieldDescription, v)) +} + +// DescriptionGTE applies the GTE predicate on the "description" field. +func DescriptionGTE(v string) predicate.Dict { + return predicate.Dict(sql.FieldGTE(FieldDescription, v)) +} + +// DescriptionLT applies the LT predicate on the "description" field. +func DescriptionLT(v string) predicate.Dict { + return predicate.Dict(sql.FieldLT(FieldDescription, v)) +} + +// DescriptionLTE applies the LTE predicate on the "description" field. +func DescriptionLTE(v string) predicate.Dict { + return predicate.Dict(sql.FieldLTE(FieldDescription, v)) +} + +// DescriptionContains applies the Contains predicate on the "description" field. +func DescriptionContains(v string) predicate.Dict { + return predicate.Dict(sql.FieldContains(FieldDescription, v)) +} + +// DescriptionHasPrefix applies the HasPrefix predicate on the "description" field. +func DescriptionHasPrefix(v string) predicate.Dict { + return predicate.Dict(sql.FieldHasPrefix(FieldDescription, v)) +} + +// DescriptionHasSuffix applies the HasSuffix predicate on the "description" field. +func DescriptionHasSuffix(v string) predicate.Dict { + return predicate.Dict(sql.FieldHasSuffix(FieldDescription, v)) +} + +// DescriptionIsNil applies the IsNil predicate on the "description" field. +func DescriptionIsNil() predicate.Dict { + return predicate.Dict(sql.FieldIsNull(FieldDescription)) +} + +// DescriptionNotNil applies the NotNil predicate on the "description" field. +func DescriptionNotNil() predicate.Dict { + return predicate.Dict(sql.FieldNotNull(FieldDescription)) +} + +// DescriptionEqualFold applies the EqualFold predicate on the "description" field. +func DescriptionEqualFold(v string) predicate.Dict { + return predicate.Dict(sql.FieldEqualFold(FieldDescription, v)) +} + +// DescriptionContainsFold applies the ContainsFold predicate on the "description" field. +func DescriptionContainsFold(v string) predicate.Dict { + return predicate.Dict(sql.FieldContainsFold(FieldDescription, v)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.Dict) predicate.Dict { + return predicate.Dict(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.Dict) predicate.Dict { + return predicate.Dict(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.Dict) predicate.Dict { + return predicate.Dict(sql.NotPredicates(p)) +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/dict_create.go b/monolithic/backend/app/admin/service/internal/data/ent/dict_create.go new file mode 100644 index 0000000..5f6a4f8 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/dict_create.go @@ -0,0 +1,871 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "errors" + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/dict" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// DictCreate is the builder for creating a Dict entity. +type DictCreate struct { + config + mutation *DictMutation + hooks []Hook + conflict []sql.ConflictOption +} + +// SetCreateTime sets the "create_time" field. +func (dc *DictCreate) SetCreateTime(t time.Time) *DictCreate { + dc.mutation.SetCreateTime(t) + return dc +} + +// SetNillableCreateTime sets the "create_time" field if the given value is not nil. +func (dc *DictCreate) SetNillableCreateTime(t *time.Time) *DictCreate { + if t != nil { + dc.SetCreateTime(*t) + } + return dc +} + +// SetUpdateTime sets the "update_time" field. +func (dc *DictCreate) SetUpdateTime(t time.Time) *DictCreate { + dc.mutation.SetUpdateTime(t) + return dc +} + +// SetNillableUpdateTime sets the "update_time" field if the given value is not nil. +func (dc *DictCreate) SetNillableUpdateTime(t *time.Time) *DictCreate { + if t != nil { + dc.SetUpdateTime(*t) + } + return dc +} + +// SetDeleteTime sets the "delete_time" field. +func (dc *DictCreate) SetDeleteTime(t time.Time) *DictCreate { + dc.mutation.SetDeleteTime(t) + return dc +} + +// SetNillableDeleteTime sets the "delete_time" field if the given value is not nil. +func (dc *DictCreate) SetNillableDeleteTime(t *time.Time) *DictCreate { + if t != nil { + dc.SetDeleteTime(*t) + } + return dc +} + +// SetCreateBy sets the "create_by" field. +func (dc *DictCreate) SetCreateBy(u uint32) *DictCreate { + dc.mutation.SetCreateBy(u) + return dc +} + +// SetNillableCreateBy sets the "create_by" field if the given value is not nil. +func (dc *DictCreate) SetNillableCreateBy(u *uint32) *DictCreate { + if u != nil { + dc.SetCreateBy(*u) + } + return dc +} + +// SetName sets the "name" field. +func (dc *DictCreate) SetName(s string) *DictCreate { + dc.mutation.SetName(s) + return dc +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (dc *DictCreate) SetNillableName(s *string) *DictCreate { + if s != nil { + dc.SetName(*s) + } + return dc +} + +// SetDescription sets the "description" field. +func (dc *DictCreate) SetDescription(s string) *DictCreate { + dc.mutation.SetDescription(s) + return dc +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (dc *DictCreate) SetNillableDescription(s *string) *DictCreate { + if s != nil { + dc.SetDescription(*s) + } + return dc +} + +// SetID sets the "id" field. +func (dc *DictCreate) SetID(u uint32) *DictCreate { + dc.mutation.SetID(u) + return dc +} + +// Mutation returns the DictMutation object of the builder. +func (dc *DictCreate) Mutation() *DictMutation { + return dc.mutation +} + +// Save creates the Dict in the database. +func (dc *DictCreate) Save(ctx context.Context) (*Dict, error) { + return withHooks(ctx, dc.sqlSave, dc.mutation, dc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (dc *DictCreate) SaveX(ctx context.Context) *Dict { + v, err := dc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (dc *DictCreate) Exec(ctx context.Context) error { + _, err := dc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (dc *DictCreate) ExecX(ctx context.Context) { + if err := dc.Exec(ctx); err != nil { + panic(err) + } +} + +// check runs all checks and user-defined validators on the builder. +func (dc *DictCreate) check() error { + if v, ok := dc.mutation.ID(); ok { + if err := dict.IDValidator(v); err != nil { + return &ValidationError{Name: "id", err: fmt.Errorf(`ent: validator failed for field "Dict.id": %w`, err)} + } + } + return nil +} + +func (dc *DictCreate) sqlSave(ctx context.Context) (*Dict, error) { + if err := dc.check(); err != nil { + return nil, err + } + _node, _spec := dc.createSpec() + if err := sqlgraph.CreateNode(ctx, dc.driver, _spec); err != nil { + if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + if _spec.ID.Value != _node.ID { + id := _spec.ID.Value.(int64) + _node.ID = uint32(id) + } + dc.mutation.id = &_node.ID + dc.mutation.done = true + return _node, nil +} + +func (dc *DictCreate) createSpec() (*Dict, *sqlgraph.CreateSpec) { + var ( + _node = &Dict{config: dc.config} + _spec = sqlgraph.NewCreateSpec(dict.Table, sqlgraph.NewFieldSpec(dict.FieldID, field.TypeUint32)) + ) + _spec.OnConflict = dc.conflict + if id, ok := dc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := dc.mutation.CreateTime(); ok { + _spec.SetField(dict.FieldCreateTime, field.TypeTime, value) + _node.CreateTime = &value + } + if value, ok := dc.mutation.UpdateTime(); ok { + _spec.SetField(dict.FieldUpdateTime, field.TypeTime, value) + _node.UpdateTime = &value + } + if value, ok := dc.mutation.DeleteTime(); ok { + _spec.SetField(dict.FieldDeleteTime, field.TypeTime, value) + _node.DeleteTime = &value + } + if value, ok := dc.mutation.CreateBy(); ok { + _spec.SetField(dict.FieldCreateBy, field.TypeUint32, value) + _node.CreateBy = &value + } + if value, ok := dc.mutation.Name(); ok { + _spec.SetField(dict.FieldName, field.TypeString, value) + _node.Name = &value + } + if value, ok := dc.mutation.Description(); ok { + _spec.SetField(dict.FieldDescription, field.TypeString, value) + _node.Description = &value + } + return _node, _spec +} + +// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause +// of the `INSERT` statement. For example: +// +// client.Dict.Create(). +// SetCreateTime(v). +// OnConflict( +// // Update the row with the new values +// // the was proposed for insertion. +// sql.ResolveWithNewValues(), +// ). +// // Override some of the fields with custom +// // update values. +// Update(func(u *ent.DictUpsert) { +// SetCreateTime(v+v). +// }). +// Exec(ctx) +func (dc *DictCreate) OnConflict(opts ...sql.ConflictOption) *DictUpsertOne { + dc.conflict = opts + return &DictUpsertOne{ + create: dc, + } +} + +// OnConflictColumns calls `OnConflict` and configures the columns +// as conflict target. Using this option is equivalent to using: +// +// client.Dict.Create(). +// OnConflict(sql.ConflictColumns(columns...)). +// Exec(ctx) +func (dc *DictCreate) OnConflictColumns(columns ...string) *DictUpsertOne { + dc.conflict = append(dc.conflict, sql.ConflictColumns(columns...)) + return &DictUpsertOne{ + create: dc, + } +} + +type ( + // DictUpsertOne is the builder for "upsert"-ing + // one Dict node. + DictUpsertOne struct { + create *DictCreate + } + + // DictUpsert is the "OnConflict" setter. + DictUpsert struct { + *sql.UpdateSet + } +) + +// SetUpdateTime sets the "update_time" field. +func (u *DictUpsert) SetUpdateTime(v time.Time) *DictUpsert { + u.Set(dict.FieldUpdateTime, v) + return u +} + +// UpdateUpdateTime sets the "update_time" field to the value that was provided on create. +func (u *DictUpsert) UpdateUpdateTime() *DictUpsert { + u.SetExcluded(dict.FieldUpdateTime) + return u +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (u *DictUpsert) ClearUpdateTime() *DictUpsert { + u.SetNull(dict.FieldUpdateTime) + return u +} + +// SetDeleteTime sets the "delete_time" field. +func (u *DictUpsert) SetDeleteTime(v time.Time) *DictUpsert { + u.Set(dict.FieldDeleteTime, v) + return u +} + +// UpdateDeleteTime sets the "delete_time" field to the value that was provided on create. +func (u *DictUpsert) UpdateDeleteTime() *DictUpsert { + u.SetExcluded(dict.FieldDeleteTime) + return u +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (u *DictUpsert) ClearDeleteTime() *DictUpsert { + u.SetNull(dict.FieldDeleteTime) + return u +} + +// SetCreateBy sets the "create_by" field. +func (u *DictUpsert) SetCreateBy(v uint32) *DictUpsert { + u.Set(dict.FieldCreateBy, v) + return u +} + +// UpdateCreateBy sets the "create_by" field to the value that was provided on create. +func (u *DictUpsert) UpdateCreateBy() *DictUpsert { + u.SetExcluded(dict.FieldCreateBy) + return u +} + +// AddCreateBy adds v to the "create_by" field. +func (u *DictUpsert) AddCreateBy(v uint32) *DictUpsert { + u.Add(dict.FieldCreateBy, v) + return u +} + +// ClearCreateBy clears the value of the "create_by" field. +func (u *DictUpsert) ClearCreateBy() *DictUpsert { + u.SetNull(dict.FieldCreateBy) + return u +} + +// SetName sets the "name" field. +func (u *DictUpsert) SetName(v string) *DictUpsert { + u.Set(dict.FieldName, v) + return u +} + +// UpdateName sets the "name" field to the value that was provided on create. +func (u *DictUpsert) UpdateName() *DictUpsert { + u.SetExcluded(dict.FieldName) + return u +} + +// ClearName clears the value of the "name" field. +func (u *DictUpsert) ClearName() *DictUpsert { + u.SetNull(dict.FieldName) + return u +} + +// SetDescription sets the "description" field. +func (u *DictUpsert) SetDescription(v string) *DictUpsert { + u.Set(dict.FieldDescription, v) + return u +} + +// UpdateDescription sets the "description" field to the value that was provided on create. +func (u *DictUpsert) UpdateDescription() *DictUpsert { + u.SetExcluded(dict.FieldDescription) + return u +} + +// ClearDescription clears the value of the "description" field. +func (u *DictUpsert) ClearDescription() *DictUpsert { + u.SetNull(dict.FieldDescription) + return u +} + +// UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. +// Using this option is equivalent to using: +// +// client.Dict.Create(). +// OnConflict( +// sql.ResolveWithNewValues(), +// sql.ResolveWith(func(u *sql.UpdateSet) { +// u.SetIgnore(dict.FieldID) +// }), +// ). +// Exec(ctx) +func (u *DictUpsertOne) UpdateNewValues() *DictUpsertOne { + u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues()) + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) { + if _, exists := u.create.mutation.ID(); exists { + s.SetIgnore(dict.FieldID) + } + if _, exists := u.create.mutation.CreateTime(); exists { + s.SetIgnore(dict.FieldCreateTime) + } + })) + return u +} + +// Ignore sets each column to itself in case of conflict. +// Using this option is equivalent to using: +// +// client.Dict.Create(). +// OnConflict(sql.ResolveWithIgnore()). +// Exec(ctx) +func (u *DictUpsertOne) Ignore() *DictUpsertOne { + u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore()) + return u +} + +// DoNothing configures the conflict_action to `DO NOTHING`. +// Supported only by SQLite and PostgreSQL. +func (u *DictUpsertOne) DoNothing() *DictUpsertOne { + u.create.conflict = append(u.create.conflict, sql.DoNothing()) + return u +} + +// Update allows overriding fields `UPDATE` values. See the DictCreate.OnConflict +// documentation for more info. +func (u *DictUpsertOne) Update(set func(*DictUpsert)) *DictUpsertOne { + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) { + set(&DictUpsert{UpdateSet: update}) + })) + return u +} + +// SetUpdateTime sets the "update_time" field. +func (u *DictUpsertOne) SetUpdateTime(v time.Time) *DictUpsertOne { + return u.Update(func(s *DictUpsert) { + s.SetUpdateTime(v) + }) +} + +// UpdateUpdateTime sets the "update_time" field to the value that was provided on create. +func (u *DictUpsertOne) UpdateUpdateTime() *DictUpsertOne { + return u.Update(func(s *DictUpsert) { + s.UpdateUpdateTime() + }) +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (u *DictUpsertOne) ClearUpdateTime() *DictUpsertOne { + return u.Update(func(s *DictUpsert) { + s.ClearUpdateTime() + }) +} + +// SetDeleteTime sets the "delete_time" field. +func (u *DictUpsertOne) SetDeleteTime(v time.Time) *DictUpsertOne { + return u.Update(func(s *DictUpsert) { + s.SetDeleteTime(v) + }) +} + +// UpdateDeleteTime sets the "delete_time" field to the value that was provided on create. +func (u *DictUpsertOne) UpdateDeleteTime() *DictUpsertOne { + return u.Update(func(s *DictUpsert) { + s.UpdateDeleteTime() + }) +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (u *DictUpsertOne) ClearDeleteTime() *DictUpsertOne { + return u.Update(func(s *DictUpsert) { + s.ClearDeleteTime() + }) +} + +// SetCreateBy sets the "create_by" field. +func (u *DictUpsertOne) SetCreateBy(v uint32) *DictUpsertOne { + return u.Update(func(s *DictUpsert) { + s.SetCreateBy(v) + }) +} + +// AddCreateBy adds v to the "create_by" field. +func (u *DictUpsertOne) AddCreateBy(v uint32) *DictUpsertOne { + return u.Update(func(s *DictUpsert) { + s.AddCreateBy(v) + }) +} + +// UpdateCreateBy sets the "create_by" field to the value that was provided on create. +func (u *DictUpsertOne) UpdateCreateBy() *DictUpsertOne { + return u.Update(func(s *DictUpsert) { + s.UpdateCreateBy() + }) +} + +// ClearCreateBy clears the value of the "create_by" field. +func (u *DictUpsertOne) ClearCreateBy() *DictUpsertOne { + return u.Update(func(s *DictUpsert) { + s.ClearCreateBy() + }) +} + +// SetName sets the "name" field. +func (u *DictUpsertOne) SetName(v string) *DictUpsertOne { + return u.Update(func(s *DictUpsert) { + s.SetName(v) + }) +} + +// UpdateName sets the "name" field to the value that was provided on create. +func (u *DictUpsertOne) UpdateName() *DictUpsertOne { + return u.Update(func(s *DictUpsert) { + s.UpdateName() + }) +} + +// ClearName clears the value of the "name" field. +func (u *DictUpsertOne) ClearName() *DictUpsertOne { + return u.Update(func(s *DictUpsert) { + s.ClearName() + }) +} + +// SetDescription sets the "description" field. +func (u *DictUpsertOne) SetDescription(v string) *DictUpsertOne { + return u.Update(func(s *DictUpsert) { + s.SetDescription(v) + }) +} + +// UpdateDescription sets the "description" field to the value that was provided on create. +func (u *DictUpsertOne) UpdateDescription() *DictUpsertOne { + return u.Update(func(s *DictUpsert) { + s.UpdateDescription() + }) +} + +// ClearDescription clears the value of the "description" field. +func (u *DictUpsertOne) ClearDescription() *DictUpsertOne { + return u.Update(func(s *DictUpsert) { + s.ClearDescription() + }) +} + +// Exec executes the query. +func (u *DictUpsertOne) Exec(ctx context.Context) error { + if len(u.create.conflict) == 0 { + return errors.New("ent: missing options for DictCreate.OnConflict") + } + return u.create.Exec(ctx) +} + +// ExecX is like Exec, but panics if an error occurs. +func (u *DictUpsertOne) ExecX(ctx context.Context) { + if err := u.create.Exec(ctx); err != nil { + panic(err) + } +} + +// Exec executes the UPSERT query and returns the inserted/updated ID. +func (u *DictUpsertOne) ID(ctx context.Context) (id uint32, err error) { + node, err := u.create.Save(ctx) + if err != nil { + return id, err + } + return node.ID, nil +} + +// IDX is like ID, but panics if an error occurs. +func (u *DictUpsertOne) IDX(ctx context.Context) uint32 { + id, err := u.ID(ctx) + if err != nil { + panic(err) + } + return id +} + +// DictCreateBulk is the builder for creating many Dict entities in bulk. +type DictCreateBulk struct { + config + err error + builders []*DictCreate + conflict []sql.ConflictOption +} + +// Save creates the Dict entities in the database. +func (dcb *DictCreateBulk) Save(ctx context.Context) ([]*Dict, error) { + if dcb.err != nil { + return nil, dcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(dcb.builders)) + nodes := make([]*Dict, len(dcb.builders)) + mutators := make([]Mutator, len(dcb.builders)) + for i := range dcb.builders { + func(i int, root context.Context) { + builder := dcb.builders[i] + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*DictMutation) + if !ok { + return nil, fmt.Errorf("unexpected mutation type %T", m) + } + if err := builder.check(); err != nil { + return nil, err + } + builder.mutation = mutation + var err error + nodes[i], specs[i] = builder.createSpec() + if i < len(mutators)-1 { + _, err = mutators[i+1].Mutate(root, dcb.builders[i+1].mutation) + } else { + spec := &sqlgraph.BatchCreateSpec{Nodes: specs} + spec.OnConflict = dcb.conflict + // Invoke the actual operation on the latest mutation in the chain. + if err = sqlgraph.BatchCreate(ctx, dcb.driver, spec); err != nil { + if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + } + } + if err != nil { + return nil, err + } + mutation.id = &nodes[i].ID + if specs[i].ID.Value != nil && nodes[i].ID == 0 { + id := specs[i].ID.Value.(int64) + nodes[i].ID = uint32(id) + } + mutation.done = true + return nodes[i], nil + }) + for i := len(builder.hooks) - 1; i >= 0; i-- { + mut = builder.hooks[i](mut) + } + mutators[i] = mut + }(i, ctx) + } + if len(mutators) > 0 { + if _, err := mutators[0].Mutate(ctx, dcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (dcb *DictCreateBulk) SaveX(ctx context.Context) []*Dict { + v, err := dcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (dcb *DictCreateBulk) Exec(ctx context.Context) error { + _, err := dcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (dcb *DictCreateBulk) ExecX(ctx context.Context) { + if err := dcb.Exec(ctx); err != nil { + panic(err) + } +} + +// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause +// of the `INSERT` statement. For example: +// +// client.Dict.CreateBulk(builders...). +// OnConflict( +// // Update the row with the new values +// // the was proposed for insertion. +// sql.ResolveWithNewValues(), +// ). +// // Override some of the fields with custom +// // update values. +// Update(func(u *ent.DictUpsert) { +// SetCreateTime(v+v). +// }). +// Exec(ctx) +func (dcb *DictCreateBulk) OnConflict(opts ...sql.ConflictOption) *DictUpsertBulk { + dcb.conflict = opts + return &DictUpsertBulk{ + create: dcb, + } +} + +// OnConflictColumns calls `OnConflict` and configures the columns +// as conflict target. Using this option is equivalent to using: +// +// client.Dict.Create(). +// OnConflict(sql.ConflictColumns(columns...)). +// Exec(ctx) +func (dcb *DictCreateBulk) OnConflictColumns(columns ...string) *DictUpsertBulk { + dcb.conflict = append(dcb.conflict, sql.ConflictColumns(columns...)) + return &DictUpsertBulk{ + create: dcb, + } +} + +// DictUpsertBulk is the builder for "upsert"-ing +// a bulk of Dict nodes. +type DictUpsertBulk struct { + create *DictCreateBulk +} + +// UpdateNewValues updates the mutable fields using the new values that +// were set on create. Using this option is equivalent to using: +// +// client.Dict.Create(). +// OnConflict( +// sql.ResolveWithNewValues(), +// sql.ResolveWith(func(u *sql.UpdateSet) { +// u.SetIgnore(dict.FieldID) +// }), +// ). +// Exec(ctx) +func (u *DictUpsertBulk) UpdateNewValues() *DictUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues()) + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) { + for _, b := range u.create.builders { + if _, exists := b.mutation.ID(); exists { + s.SetIgnore(dict.FieldID) + } + if _, exists := b.mutation.CreateTime(); exists { + s.SetIgnore(dict.FieldCreateTime) + } + } + })) + return u +} + +// Ignore sets each column to itself in case of conflict. +// Using this option is equivalent to using: +// +// client.Dict.Create(). +// OnConflict(sql.ResolveWithIgnore()). +// Exec(ctx) +func (u *DictUpsertBulk) Ignore() *DictUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore()) + return u +} + +// DoNothing configures the conflict_action to `DO NOTHING`. +// Supported only by SQLite and PostgreSQL. +func (u *DictUpsertBulk) DoNothing() *DictUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.DoNothing()) + return u +} + +// Update allows overriding fields `UPDATE` values. See the DictCreateBulk.OnConflict +// documentation for more info. +func (u *DictUpsertBulk) Update(set func(*DictUpsert)) *DictUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) { + set(&DictUpsert{UpdateSet: update}) + })) + return u +} + +// SetUpdateTime sets the "update_time" field. +func (u *DictUpsertBulk) SetUpdateTime(v time.Time) *DictUpsertBulk { + return u.Update(func(s *DictUpsert) { + s.SetUpdateTime(v) + }) +} + +// UpdateUpdateTime sets the "update_time" field to the value that was provided on create. +func (u *DictUpsertBulk) UpdateUpdateTime() *DictUpsertBulk { + return u.Update(func(s *DictUpsert) { + s.UpdateUpdateTime() + }) +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (u *DictUpsertBulk) ClearUpdateTime() *DictUpsertBulk { + return u.Update(func(s *DictUpsert) { + s.ClearUpdateTime() + }) +} + +// SetDeleteTime sets the "delete_time" field. +func (u *DictUpsertBulk) SetDeleteTime(v time.Time) *DictUpsertBulk { + return u.Update(func(s *DictUpsert) { + s.SetDeleteTime(v) + }) +} + +// UpdateDeleteTime sets the "delete_time" field to the value that was provided on create. +func (u *DictUpsertBulk) UpdateDeleteTime() *DictUpsertBulk { + return u.Update(func(s *DictUpsert) { + s.UpdateDeleteTime() + }) +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (u *DictUpsertBulk) ClearDeleteTime() *DictUpsertBulk { + return u.Update(func(s *DictUpsert) { + s.ClearDeleteTime() + }) +} + +// SetCreateBy sets the "create_by" field. +func (u *DictUpsertBulk) SetCreateBy(v uint32) *DictUpsertBulk { + return u.Update(func(s *DictUpsert) { + s.SetCreateBy(v) + }) +} + +// AddCreateBy adds v to the "create_by" field. +func (u *DictUpsertBulk) AddCreateBy(v uint32) *DictUpsertBulk { + return u.Update(func(s *DictUpsert) { + s.AddCreateBy(v) + }) +} + +// UpdateCreateBy sets the "create_by" field to the value that was provided on create. +func (u *DictUpsertBulk) UpdateCreateBy() *DictUpsertBulk { + return u.Update(func(s *DictUpsert) { + s.UpdateCreateBy() + }) +} + +// ClearCreateBy clears the value of the "create_by" field. +func (u *DictUpsertBulk) ClearCreateBy() *DictUpsertBulk { + return u.Update(func(s *DictUpsert) { + s.ClearCreateBy() + }) +} + +// SetName sets the "name" field. +func (u *DictUpsertBulk) SetName(v string) *DictUpsertBulk { + return u.Update(func(s *DictUpsert) { + s.SetName(v) + }) +} + +// UpdateName sets the "name" field to the value that was provided on create. +func (u *DictUpsertBulk) UpdateName() *DictUpsertBulk { + return u.Update(func(s *DictUpsert) { + s.UpdateName() + }) +} + +// ClearName clears the value of the "name" field. +func (u *DictUpsertBulk) ClearName() *DictUpsertBulk { + return u.Update(func(s *DictUpsert) { + s.ClearName() + }) +} + +// SetDescription sets the "description" field. +func (u *DictUpsertBulk) SetDescription(v string) *DictUpsertBulk { + return u.Update(func(s *DictUpsert) { + s.SetDescription(v) + }) +} + +// UpdateDescription sets the "description" field to the value that was provided on create. +func (u *DictUpsertBulk) UpdateDescription() *DictUpsertBulk { + return u.Update(func(s *DictUpsert) { + s.UpdateDescription() + }) +} + +// ClearDescription clears the value of the "description" field. +func (u *DictUpsertBulk) ClearDescription() *DictUpsertBulk { + return u.Update(func(s *DictUpsert) { + s.ClearDescription() + }) +} + +// Exec executes the query. +func (u *DictUpsertBulk) Exec(ctx context.Context) error { + if u.create.err != nil { + return u.create.err + } + for i, b := range u.create.builders { + if len(b.conflict) != 0 { + return fmt.Errorf("ent: OnConflict was set for builder %d. Set it on the DictCreateBulk instead", i) + } + } + if len(u.create.conflict) == 0 { + return errors.New("ent: missing options for DictCreateBulk.OnConflict") + } + return u.create.Exec(ctx) +} + +// ExecX is like Exec, but panics if an error occurs. +func (u *DictUpsertBulk) ExecX(ctx context.Context) { + if err := u.create.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/dict_delete.go b/monolithic/backend/app/admin/service/internal/data/ent/dict_delete.go new file mode 100644 index 0000000..a6b3a40 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/dict_delete.go @@ -0,0 +1,88 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/dict" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// DictDelete is the builder for deleting a Dict entity. +type DictDelete struct { + config + hooks []Hook + mutation *DictMutation +} + +// Where appends a list predicates to the DictDelete builder. +func (dd *DictDelete) Where(ps ...predicate.Dict) *DictDelete { + dd.mutation.Where(ps...) + return dd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (dd *DictDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, dd.sqlExec, dd.mutation, dd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (dd *DictDelete) ExecX(ctx context.Context) int { + n, err := dd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (dd *DictDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(dict.Table, sqlgraph.NewFieldSpec(dict.FieldID, field.TypeUint32)) + if ps := dd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, dd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + dd.mutation.done = true + return affected, err +} + +// DictDeleteOne is the builder for deleting a single Dict entity. +type DictDeleteOne struct { + dd *DictDelete +} + +// Where appends a list predicates to the DictDelete builder. +func (ddo *DictDeleteOne) Where(ps ...predicate.Dict) *DictDeleteOne { + ddo.dd.mutation.Where(ps...) + return ddo +} + +// Exec executes the deletion query. +func (ddo *DictDeleteOne) Exec(ctx context.Context) error { + n, err := ddo.dd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{dict.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (ddo *DictDeleteOne) ExecX(ctx context.Context) { + if err := ddo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/dict_query.go b/monolithic/backend/app/admin/service/internal/data/ent/dict_query.go new file mode 100644 index 0000000..4a6a682 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/dict_query.go @@ -0,0 +1,548 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/dict" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + "math" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// DictQuery is the builder for querying Dict entities. +type DictQuery struct { + config + ctx *QueryContext + order []dict.OrderOption + inters []Interceptor + predicates []predicate.Dict + modifiers []func(*sql.Selector) + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the DictQuery builder. +func (dq *DictQuery) Where(ps ...predicate.Dict) *DictQuery { + dq.predicates = append(dq.predicates, ps...) + return dq +} + +// Limit the number of records to be returned by this query. +func (dq *DictQuery) Limit(limit int) *DictQuery { + dq.ctx.Limit = &limit + return dq +} + +// Offset to start from. +func (dq *DictQuery) Offset(offset int) *DictQuery { + dq.ctx.Offset = &offset + return dq +} + +// Unique configures the query builder to filter duplicate records on query. +// By default, unique is set to true, and can be disabled using this method. +func (dq *DictQuery) Unique(unique bool) *DictQuery { + dq.ctx.Unique = &unique + return dq +} + +// Order specifies how the records should be ordered. +func (dq *DictQuery) Order(o ...dict.OrderOption) *DictQuery { + dq.order = append(dq.order, o...) + return dq +} + +// First returns the first Dict entity from the query. +// Returns a *NotFoundError when no Dict was found. +func (dq *DictQuery) First(ctx context.Context) (*Dict, error) { + nodes, err := dq.Limit(1).All(setContextOp(ctx, dq.ctx, "First")) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{dict.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (dq *DictQuery) FirstX(ctx context.Context) *Dict { + node, err := dq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first Dict ID from the query. +// Returns a *NotFoundError when no Dict ID was found. +func (dq *DictQuery) FirstID(ctx context.Context) (id uint32, err error) { + var ids []uint32 + if ids, err = dq.Limit(1).IDs(setContextOp(ctx, dq.ctx, "FirstID")); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{dict.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (dq *DictQuery) FirstIDX(ctx context.Context) uint32 { + id, err := dq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single Dict entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one Dict entity is found. +// Returns a *NotFoundError when no Dict entities are found. +func (dq *DictQuery) Only(ctx context.Context) (*Dict, error) { + nodes, err := dq.Limit(2).All(setContextOp(ctx, dq.ctx, "Only")) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{dict.Label} + default: + return nil, &NotSingularError{dict.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (dq *DictQuery) OnlyX(ctx context.Context) *Dict { + node, err := dq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only Dict ID in the query. +// Returns a *NotSingularError when more than one Dict ID is found. +// Returns a *NotFoundError when no entities are found. +func (dq *DictQuery) OnlyID(ctx context.Context) (id uint32, err error) { + var ids []uint32 + if ids, err = dq.Limit(2).IDs(setContextOp(ctx, dq.ctx, "OnlyID")); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{dict.Label} + default: + err = &NotSingularError{dict.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (dq *DictQuery) OnlyIDX(ctx context.Context) uint32 { + id, err := dq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of Dicts. +func (dq *DictQuery) All(ctx context.Context) ([]*Dict, error) { + ctx = setContextOp(ctx, dq.ctx, "All") + if err := dq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*Dict, *DictQuery]() + return withInterceptors[[]*Dict](ctx, dq, qr, dq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (dq *DictQuery) AllX(ctx context.Context) []*Dict { + nodes, err := dq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of Dict IDs. +func (dq *DictQuery) IDs(ctx context.Context) (ids []uint32, err error) { + if dq.ctx.Unique == nil && dq.path != nil { + dq.Unique(true) + } + ctx = setContextOp(ctx, dq.ctx, "IDs") + if err = dq.Select(dict.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (dq *DictQuery) IDsX(ctx context.Context) []uint32 { + ids, err := dq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (dq *DictQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, dq.ctx, "Count") + if err := dq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, dq, querierCount[*DictQuery](), dq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (dq *DictQuery) CountX(ctx context.Context) int { + count, err := dq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (dq *DictQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, dq.ctx, "Exist") + switch _, err := dq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("ent: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (dq *DictQuery) ExistX(ctx context.Context) bool { + exist, err := dq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the DictQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (dq *DictQuery) Clone() *DictQuery { + if dq == nil { + return nil + } + return &DictQuery{ + config: dq.config, + ctx: dq.ctx.Clone(), + order: append([]dict.OrderOption{}, dq.order...), + inters: append([]Interceptor{}, dq.inters...), + predicates: append([]predicate.Dict{}, dq.predicates...), + // clone intermediate query. + sql: dq.sql.Clone(), + path: dq.path, + } +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreateTime time.Time `json:"create_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.Dict.Query(). +// GroupBy(dict.FieldCreateTime). +// Aggregate(ent.Count()). +// Scan(ctx, &v) +func (dq *DictQuery) GroupBy(field string, fields ...string) *DictGroupBy { + dq.ctx.Fields = append([]string{field}, fields...) + grbuild := &DictGroupBy{build: dq} + grbuild.flds = &dq.ctx.Fields + grbuild.label = dict.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreateTime time.Time `json:"create_time,omitempty"` +// } +// +// client.Dict.Query(). +// Select(dict.FieldCreateTime). +// Scan(ctx, &v) +func (dq *DictQuery) Select(fields ...string) *DictSelect { + dq.ctx.Fields = append(dq.ctx.Fields, fields...) + sbuild := &DictSelect{DictQuery: dq} + sbuild.label = dict.Label + sbuild.flds, sbuild.scan = &dq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a DictSelect configured with the given aggregations. +func (dq *DictQuery) Aggregate(fns ...AggregateFunc) *DictSelect { + return dq.Select().Aggregate(fns...) +} + +func (dq *DictQuery) prepareQuery(ctx context.Context) error { + for _, inter := range dq.inters { + if inter == nil { + return fmt.Errorf("ent: uninitialized interceptor (forgotten import ent/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, dq); err != nil { + return err + } + } + } + for _, f := range dq.ctx.Fields { + if !dict.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)} + } + } + if dq.path != nil { + prev, err := dq.path(ctx) + if err != nil { + return err + } + dq.sql = prev + } + return nil +} + +func (dq *DictQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Dict, error) { + var ( + nodes = []*Dict{} + _spec = dq.querySpec() + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*Dict).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &Dict{config: dq.config} + nodes = append(nodes, node) + return node.assignValues(columns, values) + } + if len(dq.modifiers) > 0 { + _spec.Modifiers = dq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, dq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + return nodes, nil +} + +func (dq *DictQuery) sqlCount(ctx context.Context) (int, error) { + _spec := dq.querySpec() + if len(dq.modifiers) > 0 { + _spec.Modifiers = dq.modifiers + } + _spec.Node.Columns = dq.ctx.Fields + if len(dq.ctx.Fields) > 0 { + _spec.Unique = dq.ctx.Unique != nil && *dq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, dq.driver, _spec) +} + +func (dq *DictQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(dict.Table, dict.Columns, sqlgraph.NewFieldSpec(dict.FieldID, field.TypeUint32)) + _spec.From = dq.sql + if unique := dq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if dq.path != nil { + _spec.Unique = true + } + if fields := dq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, dict.FieldID) + for i := range fields { + if fields[i] != dict.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := dq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := dq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := dq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := dq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (dq *DictQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(dq.driver.Dialect()) + t1 := builder.Table(dict.Table) + columns := dq.ctx.Fields + if len(columns) == 0 { + columns = dict.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if dq.sql != nil { + selector = dq.sql + selector.Select(selector.Columns(columns...)...) + } + if dq.ctx.Unique != nil && *dq.ctx.Unique { + selector.Distinct() + } + for _, m := range dq.modifiers { + m(selector) + } + for _, p := range dq.predicates { + p(selector) + } + for _, p := range dq.order { + p(selector) + } + if offset := dq.ctx.Offset; offset != nil { + // limit is mandatory for offset clause. We start + // with default value, and override it below if needed. + selector.Offset(*offset).Limit(math.MaxInt32) + } + if limit := dq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// Modify adds a query modifier for attaching custom logic to queries. +func (dq *DictQuery) Modify(modifiers ...func(s *sql.Selector)) *DictSelect { + dq.modifiers = append(dq.modifiers, modifiers...) + return dq.Select() +} + +// DictGroupBy is the group-by builder for Dict entities. +type DictGroupBy struct { + selector + build *DictQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (dgb *DictGroupBy) Aggregate(fns ...AggregateFunc) *DictGroupBy { + dgb.fns = append(dgb.fns, fns...) + return dgb +} + +// Scan applies the selector query and scans the result into the given value. +func (dgb *DictGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, dgb.build.ctx, "GroupBy") + if err := dgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*DictQuery, *DictGroupBy](ctx, dgb.build, dgb, dgb.build.inters, v) +} + +func (dgb *DictGroupBy) sqlScan(ctx context.Context, root *DictQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(dgb.fns)) + for _, fn := range dgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*dgb.flds)+len(dgb.fns)) + for _, f := range *dgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*dgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := dgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// DictSelect is the builder for selecting fields of Dict entities. +type DictSelect struct { + *DictQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (ds *DictSelect) Aggregate(fns ...AggregateFunc) *DictSelect { + ds.fns = append(ds.fns, fns...) + return ds +} + +// Scan applies the selector query and scans the result into the given value. +func (ds *DictSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ds.ctx, "Select") + if err := ds.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*DictQuery, *DictSelect](ctx, ds.DictQuery, ds, ds.inters, v) +} + +func (ds *DictSelect) sqlScan(ctx context.Context, root *DictQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(ds.fns)) + for _, fn := range ds.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*ds.selector.flds); { + case n == 0 && len(aggregation) > 0: + selector.Select(aggregation...) + case n != 0 && len(aggregation) > 0: + selector.AppendSelect(aggregation...) + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := ds.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// Modify adds a query modifier for attaching custom logic to queries. +func (ds *DictSelect) Modify(modifiers ...func(s *sql.Selector)) *DictSelect { + ds.modifiers = append(ds.modifiers, modifiers...) + return ds +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/dict_update.go b/monolithic/backend/app/admin/service/internal/data/ent/dict_update.go new file mode 100644 index 0000000..c339b48 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/dict_update.go @@ -0,0 +1,478 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "errors" + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/dict" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// DictUpdate is the builder for updating Dict entities. +type DictUpdate struct { + config + hooks []Hook + mutation *DictMutation + modifiers []func(*sql.UpdateBuilder) +} + +// Where appends a list predicates to the DictUpdate builder. +func (du *DictUpdate) Where(ps ...predicate.Dict) *DictUpdate { + du.mutation.Where(ps...) + return du +} + +// SetUpdateTime sets the "update_time" field. +func (du *DictUpdate) SetUpdateTime(t time.Time) *DictUpdate { + du.mutation.SetUpdateTime(t) + return du +} + +// SetNillableUpdateTime sets the "update_time" field if the given value is not nil. +func (du *DictUpdate) SetNillableUpdateTime(t *time.Time) *DictUpdate { + if t != nil { + du.SetUpdateTime(*t) + } + return du +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (du *DictUpdate) ClearUpdateTime() *DictUpdate { + du.mutation.ClearUpdateTime() + return du +} + +// SetDeleteTime sets the "delete_time" field. +func (du *DictUpdate) SetDeleteTime(t time.Time) *DictUpdate { + du.mutation.SetDeleteTime(t) + return du +} + +// SetNillableDeleteTime sets the "delete_time" field if the given value is not nil. +func (du *DictUpdate) SetNillableDeleteTime(t *time.Time) *DictUpdate { + if t != nil { + du.SetDeleteTime(*t) + } + return du +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (du *DictUpdate) ClearDeleteTime() *DictUpdate { + du.mutation.ClearDeleteTime() + return du +} + +// SetCreateBy sets the "create_by" field. +func (du *DictUpdate) SetCreateBy(u uint32) *DictUpdate { + du.mutation.ResetCreateBy() + du.mutation.SetCreateBy(u) + return du +} + +// SetNillableCreateBy sets the "create_by" field if the given value is not nil. +func (du *DictUpdate) SetNillableCreateBy(u *uint32) *DictUpdate { + if u != nil { + du.SetCreateBy(*u) + } + return du +} + +// AddCreateBy adds u to the "create_by" field. +func (du *DictUpdate) AddCreateBy(u int32) *DictUpdate { + du.mutation.AddCreateBy(u) + return du +} + +// ClearCreateBy clears the value of the "create_by" field. +func (du *DictUpdate) ClearCreateBy() *DictUpdate { + du.mutation.ClearCreateBy() + return du +} + +// SetName sets the "name" field. +func (du *DictUpdate) SetName(s string) *DictUpdate { + du.mutation.SetName(s) + return du +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (du *DictUpdate) SetNillableName(s *string) *DictUpdate { + if s != nil { + du.SetName(*s) + } + return du +} + +// ClearName clears the value of the "name" field. +func (du *DictUpdate) ClearName() *DictUpdate { + du.mutation.ClearName() + return du +} + +// SetDescription sets the "description" field. +func (du *DictUpdate) SetDescription(s string) *DictUpdate { + du.mutation.SetDescription(s) + return du +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (du *DictUpdate) SetNillableDescription(s *string) *DictUpdate { + if s != nil { + du.SetDescription(*s) + } + return du +} + +// ClearDescription clears the value of the "description" field. +func (du *DictUpdate) ClearDescription() *DictUpdate { + du.mutation.ClearDescription() + return du +} + +// Mutation returns the DictMutation object of the builder. +func (du *DictUpdate) Mutation() *DictMutation { + return du.mutation +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (du *DictUpdate) Save(ctx context.Context) (int, error) { + return withHooks(ctx, du.sqlSave, du.mutation, du.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (du *DictUpdate) SaveX(ctx context.Context) int { + affected, err := du.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (du *DictUpdate) Exec(ctx context.Context) error { + _, err := du.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (du *DictUpdate) ExecX(ctx context.Context) { + if err := du.Exec(ctx); err != nil { + panic(err) + } +} + +// Modify adds a statement modifier for attaching custom logic to the UPDATE statement. +func (du *DictUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *DictUpdate { + du.modifiers = append(du.modifiers, modifiers...) + return du +} + +func (du *DictUpdate) sqlSave(ctx context.Context) (n int, err error) { + _spec := sqlgraph.NewUpdateSpec(dict.Table, dict.Columns, sqlgraph.NewFieldSpec(dict.FieldID, field.TypeUint32)) + if ps := du.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if du.mutation.CreateTimeCleared() { + _spec.ClearField(dict.FieldCreateTime, field.TypeTime) + } + if value, ok := du.mutation.UpdateTime(); ok { + _spec.SetField(dict.FieldUpdateTime, field.TypeTime, value) + } + if du.mutation.UpdateTimeCleared() { + _spec.ClearField(dict.FieldUpdateTime, field.TypeTime) + } + if value, ok := du.mutation.DeleteTime(); ok { + _spec.SetField(dict.FieldDeleteTime, field.TypeTime, value) + } + if du.mutation.DeleteTimeCleared() { + _spec.ClearField(dict.FieldDeleteTime, field.TypeTime) + } + if value, ok := du.mutation.CreateBy(); ok { + _spec.SetField(dict.FieldCreateBy, field.TypeUint32, value) + } + if value, ok := du.mutation.AddedCreateBy(); ok { + _spec.AddField(dict.FieldCreateBy, field.TypeUint32, value) + } + if du.mutation.CreateByCleared() { + _spec.ClearField(dict.FieldCreateBy, field.TypeUint32) + } + if value, ok := du.mutation.Name(); ok { + _spec.SetField(dict.FieldName, field.TypeString, value) + } + if du.mutation.NameCleared() { + _spec.ClearField(dict.FieldName, field.TypeString) + } + if value, ok := du.mutation.Description(); ok { + _spec.SetField(dict.FieldDescription, field.TypeString, value) + } + if du.mutation.DescriptionCleared() { + _spec.ClearField(dict.FieldDescription, field.TypeString) + } + _spec.AddModifiers(du.modifiers...) + if n, err = sqlgraph.UpdateNodes(ctx, du.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{dict.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + du.mutation.done = true + return n, nil +} + +// DictUpdateOne is the builder for updating a single Dict entity. +type DictUpdateOne struct { + config + fields []string + hooks []Hook + mutation *DictMutation + modifiers []func(*sql.UpdateBuilder) +} + +// SetUpdateTime sets the "update_time" field. +func (duo *DictUpdateOne) SetUpdateTime(t time.Time) *DictUpdateOne { + duo.mutation.SetUpdateTime(t) + return duo +} + +// SetNillableUpdateTime sets the "update_time" field if the given value is not nil. +func (duo *DictUpdateOne) SetNillableUpdateTime(t *time.Time) *DictUpdateOne { + if t != nil { + duo.SetUpdateTime(*t) + } + return duo +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (duo *DictUpdateOne) ClearUpdateTime() *DictUpdateOne { + duo.mutation.ClearUpdateTime() + return duo +} + +// SetDeleteTime sets the "delete_time" field. +func (duo *DictUpdateOne) SetDeleteTime(t time.Time) *DictUpdateOne { + duo.mutation.SetDeleteTime(t) + return duo +} + +// SetNillableDeleteTime sets the "delete_time" field if the given value is not nil. +func (duo *DictUpdateOne) SetNillableDeleteTime(t *time.Time) *DictUpdateOne { + if t != nil { + duo.SetDeleteTime(*t) + } + return duo +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (duo *DictUpdateOne) ClearDeleteTime() *DictUpdateOne { + duo.mutation.ClearDeleteTime() + return duo +} + +// SetCreateBy sets the "create_by" field. +func (duo *DictUpdateOne) SetCreateBy(u uint32) *DictUpdateOne { + duo.mutation.ResetCreateBy() + duo.mutation.SetCreateBy(u) + return duo +} + +// SetNillableCreateBy sets the "create_by" field if the given value is not nil. +func (duo *DictUpdateOne) SetNillableCreateBy(u *uint32) *DictUpdateOne { + if u != nil { + duo.SetCreateBy(*u) + } + return duo +} + +// AddCreateBy adds u to the "create_by" field. +func (duo *DictUpdateOne) AddCreateBy(u int32) *DictUpdateOne { + duo.mutation.AddCreateBy(u) + return duo +} + +// ClearCreateBy clears the value of the "create_by" field. +func (duo *DictUpdateOne) ClearCreateBy() *DictUpdateOne { + duo.mutation.ClearCreateBy() + return duo +} + +// SetName sets the "name" field. +func (duo *DictUpdateOne) SetName(s string) *DictUpdateOne { + duo.mutation.SetName(s) + return duo +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (duo *DictUpdateOne) SetNillableName(s *string) *DictUpdateOne { + if s != nil { + duo.SetName(*s) + } + return duo +} + +// ClearName clears the value of the "name" field. +func (duo *DictUpdateOne) ClearName() *DictUpdateOne { + duo.mutation.ClearName() + return duo +} + +// SetDescription sets the "description" field. +func (duo *DictUpdateOne) SetDescription(s string) *DictUpdateOne { + duo.mutation.SetDescription(s) + return duo +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (duo *DictUpdateOne) SetNillableDescription(s *string) *DictUpdateOne { + if s != nil { + duo.SetDescription(*s) + } + return duo +} + +// ClearDescription clears the value of the "description" field. +func (duo *DictUpdateOne) ClearDescription() *DictUpdateOne { + duo.mutation.ClearDescription() + return duo +} + +// Mutation returns the DictMutation object of the builder. +func (duo *DictUpdateOne) Mutation() *DictMutation { + return duo.mutation +} + +// Where appends a list predicates to the DictUpdate builder. +func (duo *DictUpdateOne) Where(ps ...predicate.Dict) *DictUpdateOne { + duo.mutation.Where(ps...) + return duo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (duo *DictUpdateOne) Select(field string, fields ...string) *DictUpdateOne { + duo.fields = append([]string{field}, fields...) + return duo +} + +// Save executes the query and returns the updated Dict entity. +func (duo *DictUpdateOne) Save(ctx context.Context) (*Dict, error) { + return withHooks(ctx, duo.sqlSave, duo.mutation, duo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (duo *DictUpdateOne) SaveX(ctx context.Context) *Dict { + node, err := duo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (duo *DictUpdateOne) Exec(ctx context.Context) error { + _, err := duo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (duo *DictUpdateOne) ExecX(ctx context.Context) { + if err := duo.Exec(ctx); err != nil { + panic(err) + } +} + +// Modify adds a statement modifier for attaching custom logic to the UPDATE statement. +func (duo *DictUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *DictUpdateOne { + duo.modifiers = append(duo.modifiers, modifiers...) + return duo +} + +func (duo *DictUpdateOne) sqlSave(ctx context.Context) (_node *Dict, err error) { + _spec := sqlgraph.NewUpdateSpec(dict.Table, dict.Columns, sqlgraph.NewFieldSpec(dict.FieldID, field.TypeUint32)) + id, ok := duo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`ent: missing "Dict.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := duo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, dict.FieldID) + for _, f := range fields { + if !dict.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)} + } + if f != dict.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := duo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if duo.mutation.CreateTimeCleared() { + _spec.ClearField(dict.FieldCreateTime, field.TypeTime) + } + if value, ok := duo.mutation.UpdateTime(); ok { + _spec.SetField(dict.FieldUpdateTime, field.TypeTime, value) + } + if duo.mutation.UpdateTimeCleared() { + _spec.ClearField(dict.FieldUpdateTime, field.TypeTime) + } + if value, ok := duo.mutation.DeleteTime(); ok { + _spec.SetField(dict.FieldDeleteTime, field.TypeTime, value) + } + if duo.mutation.DeleteTimeCleared() { + _spec.ClearField(dict.FieldDeleteTime, field.TypeTime) + } + if value, ok := duo.mutation.CreateBy(); ok { + _spec.SetField(dict.FieldCreateBy, field.TypeUint32, value) + } + if value, ok := duo.mutation.AddedCreateBy(); ok { + _spec.AddField(dict.FieldCreateBy, field.TypeUint32, value) + } + if duo.mutation.CreateByCleared() { + _spec.ClearField(dict.FieldCreateBy, field.TypeUint32) + } + if value, ok := duo.mutation.Name(); ok { + _spec.SetField(dict.FieldName, field.TypeString, value) + } + if duo.mutation.NameCleared() { + _spec.ClearField(dict.FieldName, field.TypeString) + } + if value, ok := duo.mutation.Description(); ok { + _spec.SetField(dict.FieldDescription, field.TypeString, value) + } + if duo.mutation.DescriptionCleared() { + _spec.ClearField(dict.FieldDescription, field.TypeString) + } + _spec.AddModifiers(duo.modifiers...) + _node = &Dict{config: duo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, duo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{dict.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + duo.mutation.done = true + return _node, nil +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/dictdetail.go b/monolithic/backend/app/admin/service/internal/data/ent/dictdetail.go new file mode 100644 index 0000000..8d98dd9 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/dictdetail.go @@ -0,0 +1,208 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/dictdetail" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" +) + +// DictDetail is the model entity for the DictDetail schema. +type DictDetail struct { + config `json:"-"` + // ID of the ent. + // id + ID uint32 `json:"id,omitempty"` + // 创建时间 + CreateTime *time.Time `json:"create_time,omitempty"` + // 更新时间 + UpdateTime *time.Time `json:"update_time,omitempty"` + // 删除时间 + DeleteTime *time.Time `json:"delete_time,omitempty"` + // 创建者ID + CreateBy *uint32 `json:"create_by,omitempty"` + // 字典ID + DictID *uint32 `json:"dict_id,omitempty"` + // 排序ID + OrderNo *int32 `json:"order_no,omitempty"` + // 字典标签 + Label *string `json:"label,omitempty"` + // 字典值 + Value *string `json:"value,omitempty"` + selectValues sql.SelectValues +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*DictDetail) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case dictdetail.FieldID, dictdetail.FieldCreateBy, dictdetail.FieldDictID, dictdetail.FieldOrderNo: + values[i] = new(sql.NullInt64) + case dictdetail.FieldLabel, dictdetail.FieldValue: + values[i] = new(sql.NullString) + case dictdetail.FieldCreateTime, dictdetail.FieldUpdateTime, dictdetail.FieldDeleteTime: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the DictDetail fields. +func (dd *DictDetail) assignValues(columns []string, values []any) error { + if m, n := len(values), len(columns); m < n { + return fmt.Errorf("mismatch number of scan values: %d != %d", m, n) + } + for i := range columns { + switch columns[i] { + case dictdetail.FieldID: + value, ok := values[i].(*sql.NullInt64) + if !ok { + return fmt.Errorf("unexpected type %T for field id", value) + } + dd.ID = uint32(value.Int64) + case dictdetail.FieldCreateTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field create_time", values[i]) + } else if value.Valid { + dd.CreateTime = new(time.Time) + *dd.CreateTime = value.Time + } + case dictdetail.FieldUpdateTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field update_time", values[i]) + } else if value.Valid { + dd.UpdateTime = new(time.Time) + *dd.UpdateTime = value.Time + } + case dictdetail.FieldDeleteTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field delete_time", values[i]) + } else if value.Valid { + dd.DeleteTime = new(time.Time) + *dd.DeleteTime = value.Time + } + case dictdetail.FieldCreateBy: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field create_by", values[i]) + } else if value.Valid { + dd.CreateBy = new(uint32) + *dd.CreateBy = uint32(value.Int64) + } + case dictdetail.FieldDictID: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field dict_id", values[i]) + } else if value.Valid { + dd.DictID = new(uint32) + *dd.DictID = uint32(value.Int64) + } + case dictdetail.FieldOrderNo: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field order_no", values[i]) + } else if value.Valid { + dd.OrderNo = new(int32) + *dd.OrderNo = int32(value.Int64) + } + case dictdetail.FieldLabel: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field label", values[i]) + } else if value.Valid { + dd.Label = new(string) + *dd.Label = value.String + } + case dictdetail.FieldValue: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field value", values[i]) + } else if value.Valid { + dd.Value = new(string) + *dd.Value = value.String + } + default: + dd.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// GetValue returns the ent.Value that was dynamically selected and assigned to the DictDetail. +// This includes values selected through modifiers, order, etc. +func (dd *DictDetail) GetValue(name string) (ent.Value, error) { + return dd.selectValues.Get(name) +} + +// Update returns a builder for updating this DictDetail. +// Note that you need to call DictDetail.Unwrap() before calling this method if this DictDetail +// was returned from a transaction, and the transaction was committed or rolled back. +func (dd *DictDetail) Update() *DictDetailUpdateOne { + return NewDictDetailClient(dd.config).UpdateOne(dd) +} + +// Unwrap unwraps the DictDetail entity that was returned from a transaction after it was closed, +// so that all future queries will be executed through the driver which created the transaction. +func (dd *DictDetail) Unwrap() *DictDetail { + _tx, ok := dd.config.driver.(*txDriver) + if !ok { + panic("ent: DictDetail is not a transactional entity") + } + dd.config.driver = _tx.drv + return dd +} + +// String implements the fmt.Stringer. +func (dd *DictDetail) String() string { + var builder strings.Builder + builder.WriteString("DictDetail(") + builder.WriteString(fmt.Sprintf("id=%v, ", dd.ID)) + if v := dd.CreateTime; v != nil { + builder.WriteString("create_time=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + if v := dd.UpdateTime; v != nil { + builder.WriteString("update_time=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + if v := dd.DeleteTime; v != nil { + builder.WriteString("delete_time=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + if v := dd.CreateBy; v != nil { + builder.WriteString("create_by=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := dd.DictID; v != nil { + builder.WriteString("dict_id=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := dd.OrderNo; v != nil { + builder.WriteString("order_no=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := dd.Label; v != nil { + builder.WriteString("label=") + builder.WriteString(*v) + } + builder.WriteString(", ") + if v := dd.Value; v != nil { + builder.WriteString("value=") + builder.WriteString(*v) + } + builder.WriteByte(')') + return builder.String() +} + +// DictDetails is a parsable slice of DictDetail. +type DictDetails []*DictDetail diff --git a/monolithic/backend/app/admin/service/internal/data/ent/dictdetail/dictdetail.go b/monolithic/backend/app/admin/service/internal/data/ent/dictdetail/dictdetail.go new file mode 100644 index 0000000..ebe9d06 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/dictdetail/dictdetail.go @@ -0,0 +1,112 @@ +// Code generated by ent, DO NOT EDIT. + +package dictdetail + +import ( + "entgo.io/ent/dialect/sql" +) + +const ( + // Label holds the string label denoting the dictdetail type in the database. + Label = "dict_detail" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreateTime holds the string denoting the create_time field in the database. + FieldCreateTime = "create_time" + // FieldUpdateTime holds the string denoting the update_time field in the database. + FieldUpdateTime = "update_time" + // FieldDeleteTime holds the string denoting the delete_time field in the database. + FieldDeleteTime = "delete_time" + // FieldCreateBy holds the string denoting the create_by field in the database. + FieldCreateBy = "create_by" + // FieldDictID holds the string denoting the dict_id field in the database. + FieldDictID = "dict_id" + // FieldOrderNo holds the string denoting the order_no field in the database. + FieldOrderNo = "order_no" + // FieldLabel holds the string denoting the label field in the database. + FieldLabel = "label" + // FieldValue holds the string denoting the value field in the database. + FieldValue = "value" + // Table holds the table name of the dictdetail in the database. + Table = "dict_detail" +) + +// Columns holds all SQL columns for dictdetail fields. +var Columns = []string{ + FieldID, + FieldCreateTime, + FieldUpdateTime, + FieldDeleteTime, + FieldCreateBy, + FieldDictID, + FieldOrderNo, + FieldLabel, + FieldValue, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +var ( + // DefaultDictID holds the default value on creation for the "dict_id" field. + DefaultDictID uint32 + // DefaultOrderNo holds the default value on creation for the "order_no" field. + DefaultOrderNo int32 + // IDValidator is a validator for the "id" field. It is called by the builders before save. + IDValidator func(uint32) error +) + +// OrderOption defines the ordering options for the DictDetail queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreateTime orders the results by the create_time field. +func ByCreateTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreateTime, opts...).ToFunc() +} + +// ByUpdateTime orders the results by the update_time field. +func ByUpdateTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdateTime, opts...).ToFunc() +} + +// ByDeleteTime orders the results by the delete_time field. +func ByDeleteTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeleteTime, opts...).ToFunc() +} + +// ByCreateBy orders the results by the create_by field. +func ByCreateBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreateBy, opts...).ToFunc() +} + +// ByDictID orders the results by the dict_id field. +func ByDictID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDictID, opts...).ToFunc() +} + +// ByOrderNo orders the results by the order_no field. +func ByOrderNo(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOrderNo, opts...).ToFunc() +} + +// ByLabel orders the results by the label field. +func ByLabel(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldLabel, opts...).ToFunc() +} + +// ByValue orders the results by the value field. +func ByValue(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldValue, opts...).ToFunc() +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/dictdetail/where.go b/monolithic/backend/app/admin/service/internal/data/ent/dictdetail/where.go new file mode 100644 index 0000000..c8f1e1a --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/dictdetail/where.go @@ -0,0 +1,555 @@ +// Code generated by ent, DO NOT EDIT. + +package dictdetail + +import ( + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + "time" + + "entgo.io/ent/dialect/sql" +) + +// ID filters vertices based on their ID field. +func ID(id uint32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id uint32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id uint32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...uint32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...uint32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id uint32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id uint32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id uint32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id uint32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldLTE(FieldID, id)) +} + +// CreateTime applies equality check predicate on the "create_time" field. It's identical to CreateTimeEQ. +func CreateTime(v time.Time) predicate.DictDetail { + return predicate.DictDetail(sql.FieldEQ(FieldCreateTime, v)) +} + +// UpdateTime applies equality check predicate on the "update_time" field. It's identical to UpdateTimeEQ. +func UpdateTime(v time.Time) predicate.DictDetail { + return predicate.DictDetail(sql.FieldEQ(FieldUpdateTime, v)) +} + +// DeleteTime applies equality check predicate on the "delete_time" field. It's identical to DeleteTimeEQ. +func DeleteTime(v time.Time) predicate.DictDetail { + return predicate.DictDetail(sql.FieldEQ(FieldDeleteTime, v)) +} + +// CreateBy applies equality check predicate on the "create_by" field. It's identical to CreateByEQ. +func CreateBy(v uint32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldEQ(FieldCreateBy, v)) +} + +// DictID applies equality check predicate on the "dict_id" field. It's identical to DictIDEQ. +func DictID(v uint32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldEQ(FieldDictID, v)) +} + +// OrderNo applies equality check predicate on the "order_no" field. It's identical to OrderNoEQ. +func OrderNo(v int32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldEQ(FieldOrderNo, v)) +} + +// Value applies equality check predicate on the "value" field. It's identical to ValueEQ. +func Value(v string) predicate.DictDetail { + return predicate.DictDetail(sql.FieldEQ(FieldValue, v)) +} + +// CreateTimeEQ applies the EQ predicate on the "create_time" field. +func CreateTimeEQ(v time.Time) predicate.DictDetail { + return predicate.DictDetail(sql.FieldEQ(FieldCreateTime, v)) +} + +// CreateTimeNEQ applies the NEQ predicate on the "create_time" field. +func CreateTimeNEQ(v time.Time) predicate.DictDetail { + return predicate.DictDetail(sql.FieldNEQ(FieldCreateTime, v)) +} + +// CreateTimeIn applies the In predicate on the "create_time" field. +func CreateTimeIn(vs ...time.Time) predicate.DictDetail { + return predicate.DictDetail(sql.FieldIn(FieldCreateTime, vs...)) +} + +// CreateTimeNotIn applies the NotIn predicate on the "create_time" field. +func CreateTimeNotIn(vs ...time.Time) predicate.DictDetail { + return predicate.DictDetail(sql.FieldNotIn(FieldCreateTime, vs...)) +} + +// CreateTimeGT applies the GT predicate on the "create_time" field. +func CreateTimeGT(v time.Time) predicate.DictDetail { + return predicate.DictDetail(sql.FieldGT(FieldCreateTime, v)) +} + +// CreateTimeGTE applies the GTE predicate on the "create_time" field. +func CreateTimeGTE(v time.Time) predicate.DictDetail { + return predicate.DictDetail(sql.FieldGTE(FieldCreateTime, v)) +} + +// CreateTimeLT applies the LT predicate on the "create_time" field. +func CreateTimeLT(v time.Time) predicate.DictDetail { + return predicate.DictDetail(sql.FieldLT(FieldCreateTime, v)) +} + +// CreateTimeLTE applies the LTE predicate on the "create_time" field. +func CreateTimeLTE(v time.Time) predicate.DictDetail { + return predicate.DictDetail(sql.FieldLTE(FieldCreateTime, v)) +} + +// CreateTimeIsNil applies the IsNil predicate on the "create_time" field. +func CreateTimeIsNil() predicate.DictDetail { + return predicate.DictDetail(sql.FieldIsNull(FieldCreateTime)) +} + +// CreateTimeNotNil applies the NotNil predicate on the "create_time" field. +func CreateTimeNotNil() predicate.DictDetail { + return predicate.DictDetail(sql.FieldNotNull(FieldCreateTime)) +} + +// UpdateTimeEQ applies the EQ predicate on the "update_time" field. +func UpdateTimeEQ(v time.Time) predicate.DictDetail { + return predicate.DictDetail(sql.FieldEQ(FieldUpdateTime, v)) +} + +// UpdateTimeNEQ applies the NEQ predicate on the "update_time" field. +func UpdateTimeNEQ(v time.Time) predicate.DictDetail { + return predicate.DictDetail(sql.FieldNEQ(FieldUpdateTime, v)) +} + +// UpdateTimeIn applies the In predicate on the "update_time" field. +func UpdateTimeIn(vs ...time.Time) predicate.DictDetail { + return predicate.DictDetail(sql.FieldIn(FieldUpdateTime, vs...)) +} + +// UpdateTimeNotIn applies the NotIn predicate on the "update_time" field. +func UpdateTimeNotIn(vs ...time.Time) predicate.DictDetail { + return predicate.DictDetail(sql.FieldNotIn(FieldUpdateTime, vs...)) +} + +// UpdateTimeGT applies the GT predicate on the "update_time" field. +func UpdateTimeGT(v time.Time) predicate.DictDetail { + return predicate.DictDetail(sql.FieldGT(FieldUpdateTime, v)) +} + +// UpdateTimeGTE applies the GTE predicate on the "update_time" field. +func UpdateTimeGTE(v time.Time) predicate.DictDetail { + return predicate.DictDetail(sql.FieldGTE(FieldUpdateTime, v)) +} + +// UpdateTimeLT applies the LT predicate on the "update_time" field. +func UpdateTimeLT(v time.Time) predicate.DictDetail { + return predicate.DictDetail(sql.FieldLT(FieldUpdateTime, v)) +} + +// UpdateTimeLTE applies the LTE predicate on the "update_time" field. +func UpdateTimeLTE(v time.Time) predicate.DictDetail { + return predicate.DictDetail(sql.FieldLTE(FieldUpdateTime, v)) +} + +// UpdateTimeIsNil applies the IsNil predicate on the "update_time" field. +func UpdateTimeIsNil() predicate.DictDetail { + return predicate.DictDetail(sql.FieldIsNull(FieldUpdateTime)) +} + +// UpdateTimeNotNil applies the NotNil predicate on the "update_time" field. +func UpdateTimeNotNil() predicate.DictDetail { + return predicate.DictDetail(sql.FieldNotNull(FieldUpdateTime)) +} + +// DeleteTimeEQ applies the EQ predicate on the "delete_time" field. +func DeleteTimeEQ(v time.Time) predicate.DictDetail { + return predicate.DictDetail(sql.FieldEQ(FieldDeleteTime, v)) +} + +// DeleteTimeNEQ applies the NEQ predicate on the "delete_time" field. +func DeleteTimeNEQ(v time.Time) predicate.DictDetail { + return predicate.DictDetail(sql.FieldNEQ(FieldDeleteTime, v)) +} + +// DeleteTimeIn applies the In predicate on the "delete_time" field. +func DeleteTimeIn(vs ...time.Time) predicate.DictDetail { + return predicate.DictDetail(sql.FieldIn(FieldDeleteTime, vs...)) +} + +// DeleteTimeNotIn applies the NotIn predicate on the "delete_time" field. +func DeleteTimeNotIn(vs ...time.Time) predicate.DictDetail { + return predicate.DictDetail(sql.FieldNotIn(FieldDeleteTime, vs...)) +} + +// DeleteTimeGT applies the GT predicate on the "delete_time" field. +func DeleteTimeGT(v time.Time) predicate.DictDetail { + return predicate.DictDetail(sql.FieldGT(FieldDeleteTime, v)) +} + +// DeleteTimeGTE applies the GTE predicate on the "delete_time" field. +func DeleteTimeGTE(v time.Time) predicate.DictDetail { + return predicate.DictDetail(sql.FieldGTE(FieldDeleteTime, v)) +} + +// DeleteTimeLT applies the LT predicate on the "delete_time" field. +func DeleteTimeLT(v time.Time) predicate.DictDetail { + return predicate.DictDetail(sql.FieldLT(FieldDeleteTime, v)) +} + +// DeleteTimeLTE applies the LTE predicate on the "delete_time" field. +func DeleteTimeLTE(v time.Time) predicate.DictDetail { + return predicate.DictDetail(sql.FieldLTE(FieldDeleteTime, v)) +} + +// DeleteTimeIsNil applies the IsNil predicate on the "delete_time" field. +func DeleteTimeIsNil() predicate.DictDetail { + return predicate.DictDetail(sql.FieldIsNull(FieldDeleteTime)) +} + +// DeleteTimeNotNil applies the NotNil predicate on the "delete_time" field. +func DeleteTimeNotNil() predicate.DictDetail { + return predicate.DictDetail(sql.FieldNotNull(FieldDeleteTime)) +} + +// CreateByEQ applies the EQ predicate on the "create_by" field. +func CreateByEQ(v uint32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldEQ(FieldCreateBy, v)) +} + +// CreateByNEQ applies the NEQ predicate on the "create_by" field. +func CreateByNEQ(v uint32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldNEQ(FieldCreateBy, v)) +} + +// CreateByIn applies the In predicate on the "create_by" field. +func CreateByIn(vs ...uint32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldIn(FieldCreateBy, vs...)) +} + +// CreateByNotIn applies the NotIn predicate on the "create_by" field. +func CreateByNotIn(vs ...uint32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldNotIn(FieldCreateBy, vs...)) +} + +// CreateByGT applies the GT predicate on the "create_by" field. +func CreateByGT(v uint32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldGT(FieldCreateBy, v)) +} + +// CreateByGTE applies the GTE predicate on the "create_by" field. +func CreateByGTE(v uint32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldGTE(FieldCreateBy, v)) +} + +// CreateByLT applies the LT predicate on the "create_by" field. +func CreateByLT(v uint32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldLT(FieldCreateBy, v)) +} + +// CreateByLTE applies the LTE predicate on the "create_by" field. +func CreateByLTE(v uint32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldLTE(FieldCreateBy, v)) +} + +// CreateByIsNil applies the IsNil predicate on the "create_by" field. +func CreateByIsNil() predicate.DictDetail { + return predicate.DictDetail(sql.FieldIsNull(FieldCreateBy)) +} + +// CreateByNotNil applies the NotNil predicate on the "create_by" field. +func CreateByNotNil() predicate.DictDetail { + return predicate.DictDetail(sql.FieldNotNull(FieldCreateBy)) +} + +// DictIDEQ applies the EQ predicate on the "dict_id" field. +func DictIDEQ(v uint32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldEQ(FieldDictID, v)) +} + +// DictIDNEQ applies the NEQ predicate on the "dict_id" field. +func DictIDNEQ(v uint32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldNEQ(FieldDictID, v)) +} + +// DictIDIn applies the In predicate on the "dict_id" field. +func DictIDIn(vs ...uint32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldIn(FieldDictID, vs...)) +} + +// DictIDNotIn applies the NotIn predicate on the "dict_id" field. +func DictIDNotIn(vs ...uint32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldNotIn(FieldDictID, vs...)) +} + +// DictIDGT applies the GT predicate on the "dict_id" field. +func DictIDGT(v uint32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldGT(FieldDictID, v)) +} + +// DictIDGTE applies the GTE predicate on the "dict_id" field. +func DictIDGTE(v uint32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldGTE(FieldDictID, v)) +} + +// DictIDLT applies the LT predicate on the "dict_id" field. +func DictIDLT(v uint32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldLT(FieldDictID, v)) +} + +// DictIDLTE applies the LTE predicate on the "dict_id" field. +func DictIDLTE(v uint32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldLTE(FieldDictID, v)) +} + +// DictIDIsNil applies the IsNil predicate on the "dict_id" field. +func DictIDIsNil() predicate.DictDetail { + return predicate.DictDetail(sql.FieldIsNull(FieldDictID)) +} + +// DictIDNotNil applies the NotNil predicate on the "dict_id" field. +func DictIDNotNil() predicate.DictDetail { + return predicate.DictDetail(sql.FieldNotNull(FieldDictID)) +} + +// OrderNoEQ applies the EQ predicate on the "order_no" field. +func OrderNoEQ(v int32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldEQ(FieldOrderNo, v)) +} + +// OrderNoNEQ applies the NEQ predicate on the "order_no" field. +func OrderNoNEQ(v int32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldNEQ(FieldOrderNo, v)) +} + +// OrderNoIn applies the In predicate on the "order_no" field. +func OrderNoIn(vs ...int32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldIn(FieldOrderNo, vs...)) +} + +// OrderNoNotIn applies the NotIn predicate on the "order_no" field. +func OrderNoNotIn(vs ...int32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldNotIn(FieldOrderNo, vs...)) +} + +// OrderNoGT applies the GT predicate on the "order_no" field. +func OrderNoGT(v int32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldGT(FieldOrderNo, v)) +} + +// OrderNoGTE applies the GTE predicate on the "order_no" field. +func OrderNoGTE(v int32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldGTE(FieldOrderNo, v)) +} + +// OrderNoLT applies the LT predicate on the "order_no" field. +func OrderNoLT(v int32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldLT(FieldOrderNo, v)) +} + +// OrderNoLTE applies the LTE predicate on the "order_no" field. +func OrderNoLTE(v int32) predicate.DictDetail { + return predicate.DictDetail(sql.FieldLTE(FieldOrderNo, v)) +} + +// OrderNoIsNil applies the IsNil predicate on the "order_no" field. +func OrderNoIsNil() predicate.DictDetail { + return predicate.DictDetail(sql.FieldIsNull(FieldOrderNo)) +} + +// OrderNoNotNil applies the NotNil predicate on the "order_no" field. +func OrderNoNotNil() predicate.DictDetail { + return predicate.DictDetail(sql.FieldNotNull(FieldOrderNo)) +} + +// LabelEQ applies the EQ predicate on the "label" field. +func LabelEQ(v string) predicate.DictDetail { + return predicate.DictDetail(sql.FieldEQ(FieldLabel, v)) +} + +// LabelNEQ applies the NEQ predicate on the "label" field. +func LabelNEQ(v string) predicate.DictDetail { + return predicate.DictDetail(sql.FieldNEQ(FieldLabel, v)) +} + +// LabelIn applies the In predicate on the "label" field. +func LabelIn(vs ...string) predicate.DictDetail { + return predicate.DictDetail(sql.FieldIn(FieldLabel, vs...)) +} + +// LabelNotIn applies the NotIn predicate on the "label" field. +func LabelNotIn(vs ...string) predicate.DictDetail { + return predicate.DictDetail(sql.FieldNotIn(FieldLabel, vs...)) +} + +// LabelGT applies the GT predicate on the "label" field. +func LabelGT(v string) predicate.DictDetail { + return predicate.DictDetail(sql.FieldGT(FieldLabel, v)) +} + +// LabelGTE applies the GTE predicate on the "label" field. +func LabelGTE(v string) predicate.DictDetail { + return predicate.DictDetail(sql.FieldGTE(FieldLabel, v)) +} + +// LabelLT applies the LT predicate on the "label" field. +func LabelLT(v string) predicate.DictDetail { + return predicate.DictDetail(sql.FieldLT(FieldLabel, v)) +} + +// LabelLTE applies the LTE predicate on the "label" field. +func LabelLTE(v string) predicate.DictDetail { + return predicate.DictDetail(sql.FieldLTE(FieldLabel, v)) +} + +// LabelContains applies the Contains predicate on the "label" field. +func LabelContains(v string) predicate.DictDetail { + return predicate.DictDetail(sql.FieldContains(FieldLabel, v)) +} + +// LabelHasPrefix applies the HasPrefix predicate on the "label" field. +func LabelHasPrefix(v string) predicate.DictDetail { + return predicate.DictDetail(sql.FieldHasPrefix(FieldLabel, v)) +} + +// LabelHasSuffix applies the HasSuffix predicate on the "label" field. +func LabelHasSuffix(v string) predicate.DictDetail { + return predicate.DictDetail(sql.FieldHasSuffix(FieldLabel, v)) +} + +// LabelIsNil applies the IsNil predicate on the "label" field. +func LabelIsNil() predicate.DictDetail { + return predicate.DictDetail(sql.FieldIsNull(FieldLabel)) +} + +// LabelNotNil applies the NotNil predicate on the "label" field. +func LabelNotNil() predicate.DictDetail { + return predicate.DictDetail(sql.FieldNotNull(FieldLabel)) +} + +// LabelEqualFold applies the EqualFold predicate on the "label" field. +func LabelEqualFold(v string) predicate.DictDetail { + return predicate.DictDetail(sql.FieldEqualFold(FieldLabel, v)) +} + +// LabelContainsFold applies the ContainsFold predicate on the "label" field. +func LabelContainsFold(v string) predicate.DictDetail { + return predicate.DictDetail(sql.FieldContainsFold(FieldLabel, v)) +} + +// ValueEQ applies the EQ predicate on the "value" field. +func ValueEQ(v string) predicate.DictDetail { + return predicate.DictDetail(sql.FieldEQ(FieldValue, v)) +} + +// ValueNEQ applies the NEQ predicate on the "value" field. +func ValueNEQ(v string) predicate.DictDetail { + return predicate.DictDetail(sql.FieldNEQ(FieldValue, v)) +} + +// ValueIn applies the In predicate on the "value" field. +func ValueIn(vs ...string) predicate.DictDetail { + return predicate.DictDetail(sql.FieldIn(FieldValue, vs...)) +} + +// ValueNotIn applies the NotIn predicate on the "value" field. +func ValueNotIn(vs ...string) predicate.DictDetail { + return predicate.DictDetail(sql.FieldNotIn(FieldValue, vs...)) +} + +// ValueGT applies the GT predicate on the "value" field. +func ValueGT(v string) predicate.DictDetail { + return predicate.DictDetail(sql.FieldGT(FieldValue, v)) +} + +// ValueGTE applies the GTE predicate on the "value" field. +func ValueGTE(v string) predicate.DictDetail { + return predicate.DictDetail(sql.FieldGTE(FieldValue, v)) +} + +// ValueLT applies the LT predicate on the "value" field. +func ValueLT(v string) predicate.DictDetail { + return predicate.DictDetail(sql.FieldLT(FieldValue, v)) +} + +// ValueLTE applies the LTE predicate on the "value" field. +func ValueLTE(v string) predicate.DictDetail { + return predicate.DictDetail(sql.FieldLTE(FieldValue, v)) +} + +// ValueContains applies the Contains predicate on the "value" field. +func ValueContains(v string) predicate.DictDetail { + return predicate.DictDetail(sql.FieldContains(FieldValue, v)) +} + +// ValueHasPrefix applies the HasPrefix predicate on the "value" field. +func ValueHasPrefix(v string) predicate.DictDetail { + return predicate.DictDetail(sql.FieldHasPrefix(FieldValue, v)) +} + +// ValueHasSuffix applies the HasSuffix predicate on the "value" field. +func ValueHasSuffix(v string) predicate.DictDetail { + return predicate.DictDetail(sql.FieldHasSuffix(FieldValue, v)) +} + +// ValueIsNil applies the IsNil predicate on the "value" field. +func ValueIsNil() predicate.DictDetail { + return predicate.DictDetail(sql.FieldIsNull(FieldValue)) +} + +// ValueNotNil applies the NotNil predicate on the "value" field. +func ValueNotNil() predicate.DictDetail { + return predicate.DictDetail(sql.FieldNotNull(FieldValue)) +} + +// ValueEqualFold applies the EqualFold predicate on the "value" field. +func ValueEqualFold(v string) predicate.DictDetail { + return predicate.DictDetail(sql.FieldEqualFold(FieldValue, v)) +} + +// ValueContainsFold applies the ContainsFold predicate on the "value" field. +func ValueContainsFold(v string) predicate.DictDetail { + return predicate.DictDetail(sql.FieldContainsFold(FieldValue, v)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.DictDetail) predicate.DictDetail { + return predicate.DictDetail(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.DictDetail) predicate.DictDetail { + return predicate.DictDetail(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.DictDetail) predicate.DictDetail { + return predicate.DictDetail(sql.NotPredicates(p)) +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/dictdetail_create.go b/monolithic/backend/app/admin/service/internal/data/ent/dictdetail_create.go new file mode 100644 index 0000000..96880f9 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/dictdetail_create.go @@ -0,0 +1,1081 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "errors" + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/dictdetail" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// DictDetailCreate is the builder for creating a DictDetail entity. +type DictDetailCreate struct { + config + mutation *DictDetailMutation + hooks []Hook + conflict []sql.ConflictOption +} + +// SetCreateTime sets the "create_time" field. +func (ddc *DictDetailCreate) SetCreateTime(t time.Time) *DictDetailCreate { + ddc.mutation.SetCreateTime(t) + return ddc +} + +// SetNillableCreateTime sets the "create_time" field if the given value is not nil. +func (ddc *DictDetailCreate) SetNillableCreateTime(t *time.Time) *DictDetailCreate { + if t != nil { + ddc.SetCreateTime(*t) + } + return ddc +} + +// SetUpdateTime sets the "update_time" field. +func (ddc *DictDetailCreate) SetUpdateTime(t time.Time) *DictDetailCreate { + ddc.mutation.SetUpdateTime(t) + return ddc +} + +// SetNillableUpdateTime sets the "update_time" field if the given value is not nil. +func (ddc *DictDetailCreate) SetNillableUpdateTime(t *time.Time) *DictDetailCreate { + if t != nil { + ddc.SetUpdateTime(*t) + } + return ddc +} + +// SetDeleteTime sets the "delete_time" field. +func (ddc *DictDetailCreate) SetDeleteTime(t time.Time) *DictDetailCreate { + ddc.mutation.SetDeleteTime(t) + return ddc +} + +// SetNillableDeleteTime sets the "delete_time" field if the given value is not nil. +func (ddc *DictDetailCreate) SetNillableDeleteTime(t *time.Time) *DictDetailCreate { + if t != nil { + ddc.SetDeleteTime(*t) + } + return ddc +} + +// SetCreateBy sets the "create_by" field. +func (ddc *DictDetailCreate) SetCreateBy(u uint32) *DictDetailCreate { + ddc.mutation.SetCreateBy(u) + return ddc +} + +// SetNillableCreateBy sets the "create_by" field if the given value is not nil. +func (ddc *DictDetailCreate) SetNillableCreateBy(u *uint32) *DictDetailCreate { + if u != nil { + ddc.SetCreateBy(*u) + } + return ddc +} + +// SetDictID sets the "dict_id" field. +func (ddc *DictDetailCreate) SetDictID(u uint32) *DictDetailCreate { + ddc.mutation.SetDictID(u) + return ddc +} + +// SetNillableDictID sets the "dict_id" field if the given value is not nil. +func (ddc *DictDetailCreate) SetNillableDictID(u *uint32) *DictDetailCreate { + if u != nil { + ddc.SetDictID(*u) + } + return ddc +} + +// SetOrderNo sets the "order_no" field. +func (ddc *DictDetailCreate) SetOrderNo(i int32) *DictDetailCreate { + ddc.mutation.SetOrderNo(i) + return ddc +} + +// SetNillableOrderNo sets the "order_no" field if the given value is not nil. +func (ddc *DictDetailCreate) SetNillableOrderNo(i *int32) *DictDetailCreate { + if i != nil { + ddc.SetOrderNo(*i) + } + return ddc +} + +// SetLabel sets the "label" field. +func (ddc *DictDetailCreate) SetLabel(s string) *DictDetailCreate { + ddc.mutation.SetLabel(s) + return ddc +} + +// SetNillableLabel sets the "label" field if the given value is not nil. +func (ddc *DictDetailCreate) SetNillableLabel(s *string) *DictDetailCreate { + if s != nil { + ddc.SetLabel(*s) + } + return ddc +} + +// SetValue sets the "value" field. +func (ddc *DictDetailCreate) SetValue(s string) *DictDetailCreate { + ddc.mutation.SetValue(s) + return ddc +} + +// SetNillableValue sets the "value" field if the given value is not nil. +func (ddc *DictDetailCreate) SetNillableValue(s *string) *DictDetailCreate { + if s != nil { + ddc.SetValue(*s) + } + return ddc +} + +// SetID sets the "id" field. +func (ddc *DictDetailCreate) SetID(u uint32) *DictDetailCreate { + ddc.mutation.SetID(u) + return ddc +} + +// Mutation returns the DictDetailMutation object of the builder. +func (ddc *DictDetailCreate) Mutation() *DictDetailMutation { + return ddc.mutation +} + +// Save creates the DictDetail in the database. +func (ddc *DictDetailCreate) Save(ctx context.Context) (*DictDetail, error) { + ddc.defaults() + return withHooks(ctx, ddc.sqlSave, ddc.mutation, ddc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (ddc *DictDetailCreate) SaveX(ctx context.Context) *DictDetail { + v, err := ddc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ddc *DictDetailCreate) Exec(ctx context.Context) error { + _, err := ddc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ddc *DictDetailCreate) ExecX(ctx context.Context) { + if err := ddc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ddc *DictDetailCreate) defaults() { + if _, ok := ddc.mutation.DictID(); !ok { + v := dictdetail.DefaultDictID + ddc.mutation.SetDictID(v) + } + if _, ok := ddc.mutation.OrderNo(); !ok { + v := dictdetail.DefaultOrderNo + ddc.mutation.SetOrderNo(v) + } +} + +// check runs all checks and user-defined validators on the builder. +func (ddc *DictDetailCreate) check() error { + if v, ok := ddc.mutation.ID(); ok { + if err := dictdetail.IDValidator(v); err != nil { + return &ValidationError{Name: "id", err: fmt.Errorf(`ent: validator failed for field "DictDetail.id": %w`, err)} + } + } + return nil +} + +func (ddc *DictDetailCreate) sqlSave(ctx context.Context) (*DictDetail, error) { + if err := ddc.check(); err != nil { + return nil, err + } + _node, _spec := ddc.createSpec() + if err := sqlgraph.CreateNode(ctx, ddc.driver, _spec); err != nil { + if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + if _spec.ID.Value != _node.ID { + id := _spec.ID.Value.(int64) + _node.ID = uint32(id) + } + ddc.mutation.id = &_node.ID + ddc.mutation.done = true + return _node, nil +} + +func (ddc *DictDetailCreate) createSpec() (*DictDetail, *sqlgraph.CreateSpec) { + var ( + _node = &DictDetail{config: ddc.config} + _spec = sqlgraph.NewCreateSpec(dictdetail.Table, sqlgraph.NewFieldSpec(dictdetail.FieldID, field.TypeUint32)) + ) + _spec.OnConflict = ddc.conflict + if id, ok := ddc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := ddc.mutation.CreateTime(); ok { + _spec.SetField(dictdetail.FieldCreateTime, field.TypeTime, value) + _node.CreateTime = &value + } + if value, ok := ddc.mutation.UpdateTime(); ok { + _spec.SetField(dictdetail.FieldUpdateTime, field.TypeTime, value) + _node.UpdateTime = &value + } + if value, ok := ddc.mutation.DeleteTime(); ok { + _spec.SetField(dictdetail.FieldDeleteTime, field.TypeTime, value) + _node.DeleteTime = &value + } + if value, ok := ddc.mutation.CreateBy(); ok { + _spec.SetField(dictdetail.FieldCreateBy, field.TypeUint32, value) + _node.CreateBy = &value + } + if value, ok := ddc.mutation.DictID(); ok { + _spec.SetField(dictdetail.FieldDictID, field.TypeUint32, value) + _node.DictID = &value + } + if value, ok := ddc.mutation.OrderNo(); ok { + _spec.SetField(dictdetail.FieldOrderNo, field.TypeInt32, value) + _node.OrderNo = &value + } + if value, ok := ddc.mutation.Label(); ok { + _spec.SetField(dictdetail.FieldLabel, field.TypeString, value) + _node.Label = &value + } + if value, ok := ddc.mutation.Value(); ok { + _spec.SetField(dictdetail.FieldValue, field.TypeString, value) + _node.Value = &value + } + return _node, _spec +} + +// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause +// of the `INSERT` statement. For example: +// +// client.DictDetail.Create(). +// SetCreateTime(v). +// OnConflict( +// // Update the row with the new values +// // the was proposed for insertion. +// sql.ResolveWithNewValues(), +// ). +// // Override some of the fields with custom +// // update values. +// Update(func(u *ent.DictDetailUpsert) { +// SetCreateTime(v+v). +// }). +// Exec(ctx) +func (ddc *DictDetailCreate) OnConflict(opts ...sql.ConflictOption) *DictDetailUpsertOne { + ddc.conflict = opts + return &DictDetailUpsertOne{ + create: ddc, + } +} + +// OnConflictColumns calls `OnConflict` and configures the columns +// as conflict target. Using this option is equivalent to using: +// +// client.DictDetail.Create(). +// OnConflict(sql.ConflictColumns(columns...)). +// Exec(ctx) +func (ddc *DictDetailCreate) OnConflictColumns(columns ...string) *DictDetailUpsertOne { + ddc.conflict = append(ddc.conflict, sql.ConflictColumns(columns...)) + return &DictDetailUpsertOne{ + create: ddc, + } +} + +type ( + // DictDetailUpsertOne is the builder for "upsert"-ing + // one DictDetail node. + DictDetailUpsertOne struct { + create *DictDetailCreate + } + + // DictDetailUpsert is the "OnConflict" setter. + DictDetailUpsert struct { + *sql.UpdateSet + } +) + +// SetUpdateTime sets the "update_time" field. +func (u *DictDetailUpsert) SetUpdateTime(v time.Time) *DictDetailUpsert { + u.Set(dictdetail.FieldUpdateTime, v) + return u +} + +// UpdateUpdateTime sets the "update_time" field to the value that was provided on create. +func (u *DictDetailUpsert) UpdateUpdateTime() *DictDetailUpsert { + u.SetExcluded(dictdetail.FieldUpdateTime) + return u +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (u *DictDetailUpsert) ClearUpdateTime() *DictDetailUpsert { + u.SetNull(dictdetail.FieldUpdateTime) + return u +} + +// SetDeleteTime sets the "delete_time" field. +func (u *DictDetailUpsert) SetDeleteTime(v time.Time) *DictDetailUpsert { + u.Set(dictdetail.FieldDeleteTime, v) + return u +} + +// UpdateDeleteTime sets the "delete_time" field to the value that was provided on create. +func (u *DictDetailUpsert) UpdateDeleteTime() *DictDetailUpsert { + u.SetExcluded(dictdetail.FieldDeleteTime) + return u +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (u *DictDetailUpsert) ClearDeleteTime() *DictDetailUpsert { + u.SetNull(dictdetail.FieldDeleteTime) + return u +} + +// SetCreateBy sets the "create_by" field. +func (u *DictDetailUpsert) SetCreateBy(v uint32) *DictDetailUpsert { + u.Set(dictdetail.FieldCreateBy, v) + return u +} + +// UpdateCreateBy sets the "create_by" field to the value that was provided on create. +func (u *DictDetailUpsert) UpdateCreateBy() *DictDetailUpsert { + u.SetExcluded(dictdetail.FieldCreateBy) + return u +} + +// AddCreateBy adds v to the "create_by" field. +func (u *DictDetailUpsert) AddCreateBy(v uint32) *DictDetailUpsert { + u.Add(dictdetail.FieldCreateBy, v) + return u +} + +// ClearCreateBy clears the value of the "create_by" field. +func (u *DictDetailUpsert) ClearCreateBy() *DictDetailUpsert { + u.SetNull(dictdetail.FieldCreateBy) + return u +} + +// SetDictID sets the "dict_id" field. +func (u *DictDetailUpsert) SetDictID(v uint32) *DictDetailUpsert { + u.Set(dictdetail.FieldDictID, v) + return u +} + +// UpdateDictID sets the "dict_id" field to the value that was provided on create. +func (u *DictDetailUpsert) UpdateDictID() *DictDetailUpsert { + u.SetExcluded(dictdetail.FieldDictID) + return u +} + +// AddDictID adds v to the "dict_id" field. +func (u *DictDetailUpsert) AddDictID(v uint32) *DictDetailUpsert { + u.Add(dictdetail.FieldDictID, v) + return u +} + +// ClearDictID clears the value of the "dict_id" field. +func (u *DictDetailUpsert) ClearDictID() *DictDetailUpsert { + u.SetNull(dictdetail.FieldDictID) + return u +} + +// SetOrderNo sets the "order_no" field. +func (u *DictDetailUpsert) SetOrderNo(v int32) *DictDetailUpsert { + u.Set(dictdetail.FieldOrderNo, v) + return u +} + +// UpdateOrderNo sets the "order_no" field to the value that was provided on create. +func (u *DictDetailUpsert) UpdateOrderNo() *DictDetailUpsert { + u.SetExcluded(dictdetail.FieldOrderNo) + return u +} + +// AddOrderNo adds v to the "order_no" field. +func (u *DictDetailUpsert) AddOrderNo(v int32) *DictDetailUpsert { + u.Add(dictdetail.FieldOrderNo, v) + return u +} + +// ClearOrderNo clears the value of the "order_no" field. +func (u *DictDetailUpsert) ClearOrderNo() *DictDetailUpsert { + u.SetNull(dictdetail.FieldOrderNo) + return u +} + +// SetLabel sets the "label" field. +func (u *DictDetailUpsert) SetLabel(v string) *DictDetailUpsert { + u.Set(dictdetail.FieldLabel, v) + return u +} + +// UpdateLabel sets the "label" field to the value that was provided on create. +func (u *DictDetailUpsert) UpdateLabel() *DictDetailUpsert { + u.SetExcluded(dictdetail.FieldLabel) + return u +} + +// ClearLabel clears the value of the "label" field. +func (u *DictDetailUpsert) ClearLabel() *DictDetailUpsert { + u.SetNull(dictdetail.FieldLabel) + return u +} + +// SetValue sets the "value" field. +func (u *DictDetailUpsert) SetValue(v string) *DictDetailUpsert { + u.Set(dictdetail.FieldValue, v) + return u +} + +// UpdateValue sets the "value" field to the value that was provided on create. +func (u *DictDetailUpsert) UpdateValue() *DictDetailUpsert { + u.SetExcluded(dictdetail.FieldValue) + return u +} + +// ClearValue clears the value of the "value" field. +func (u *DictDetailUpsert) ClearValue() *DictDetailUpsert { + u.SetNull(dictdetail.FieldValue) + return u +} + +// UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. +// Using this option is equivalent to using: +// +// client.DictDetail.Create(). +// OnConflict( +// sql.ResolveWithNewValues(), +// sql.ResolveWith(func(u *sql.UpdateSet) { +// u.SetIgnore(dictdetail.FieldID) +// }), +// ). +// Exec(ctx) +func (u *DictDetailUpsertOne) UpdateNewValues() *DictDetailUpsertOne { + u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues()) + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) { + if _, exists := u.create.mutation.ID(); exists { + s.SetIgnore(dictdetail.FieldID) + } + if _, exists := u.create.mutation.CreateTime(); exists { + s.SetIgnore(dictdetail.FieldCreateTime) + } + })) + return u +} + +// Ignore sets each column to itself in case of conflict. +// Using this option is equivalent to using: +// +// client.DictDetail.Create(). +// OnConflict(sql.ResolveWithIgnore()). +// Exec(ctx) +func (u *DictDetailUpsertOne) Ignore() *DictDetailUpsertOne { + u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore()) + return u +} + +// DoNothing configures the conflict_action to `DO NOTHING`. +// Supported only by SQLite and PostgreSQL. +func (u *DictDetailUpsertOne) DoNothing() *DictDetailUpsertOne { + u.create.conflict = append(u.create.conflict, sql.DoNothing()) + return u +} + +// Update allows overriding fields `UPDATE` values. See the DictDetailCreate.OnConflict +// documentation for more info. +func (u *DictDetailUpsertOne) Update(set func(*DictDetailUpsert)) *DictDetailUpsertOne { + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) { + set(&DictDetailUpsert{UpdateSet: update}) + })) + return u +} + +// SetUpdateTime sets the "update_time" field. +func (u *DictDetailUpsertOne) SetUpdateTime(v time.Time) *DictDetailUpsertOne { + return u.Update(func(s *DictDetailUpsert) { + s.SetUpdateTime(v) + }) +} + +// UpdateUpdateTime sets the "update_time" field to the value that was provided on create. +func (u *DictDetailUpsertOne) UpdateUpdateTime() *DictDetailUpsertOne { + return u.Update(func(s *DictDetailUpsert) { + s.UpdateUpdateTime() + }) +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (u *DictDetailUpsertOne) ClearUpdateTime() *DictDetailUpsertOne { + return u.Update(func(s *DictDetailUpsert) { + s.ClearUpdateTime() + }) +} + +// SetDeleteTime sets the "delete_time" field. +func (u *DictDetailUpsertOne) SetDeleteTime(v time.Time) *DictDetailUpsertOne { + return u.Update(func(s *DictDetailUpsert) { + s.SetDeleteTime(v) + }) +} + +// UpdateDeleteTime sets the "delete_time" field to the value that was provided on create. +func (u *DictDetailUpsertOne) UpdateDeleteTime() *DictDetailUpsertOne { + return u.Update(func(s *DictDetailUpsert) { + s.UpdateDeleteTime() + }) +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (u *DictDetailUpsertOne) ClearDeleteTime() *DictDetailUpsertOne { + return u.Update(func(s *DictDetailUpsert) { + s.ClearDeleteTime() + }) +} + +// SetCreateBy sets the "create_by" field. +func (u *DictDetailUpsertOne) SetCreateBy(v uint32) *DictDetailUpsertOne { + return u.Update(func(s *DictDetailUpsert) { + s.SetCreateBy(v) + }) +} + +// AddCreateBy adds v to the "create_by" field. +func (u *DictDetailUpsertOne) AddCreateBy(v uint32) *DictDetailUpsertOne { + return u.Update(func(s *DictDetailUpsert) { + s.AddCreateBy(v) + }) +} + +// UpdateCreateBy sets the "create_by" field to the value that was provided on create. +func (u *DictDetailUpsertOne) UpdateCreateBy() *DictDetailUpsertOne { + return u.Update(func(s *DictDetailUpsert) { + s.UpdateCreateBy() + }) +} + +// ClearCreateBy clears the value of the "create_by" field. +func (u *DictDetailUpsertOne) ClearCreateBy() *DictDetailUpsertOne { + return u.Update(func(s *DictDetailUpsert) { + s.ClearCreateBy() + }) +} + +// SetDictID sets the "dict_id" field. +func (u *DictDetailUpsertOne) SetDictID(v uint32) *DictDetailUpsertOne { + return u.Update(func(s *DictDetailUpsert) { + s.SetDictID(v) + }) +} + +// AddDictID adds v to the "dict_id" field. +func (u *DictDetailUpsertOne) AddDictID(v uint32) *DictDetailUpsertOne { + return u.Update(func(s *DictDetailUpsert) { + s.AddDictID(v) + }) +} + +// UpdateDictID sets the "dict_id" field to the value that was provided on create. +func (u *DictDetailUpsertOne) UpdateDictID() *DictDetailUpsertOne { + return u.Update(func(s *DictDetailUpsert) { + s.UpdateDictID() + }) +} + +// ClearDictID clears the value of the "dict_id" field. +func (u *DictDetailUpsertOne) ClearDictID() *DictDetailUpsertOne { + return u.Update(func(s *DictDetailUpsert) { + s.ClearDictID() + }) +} + +// SetOrderNo sets the "order_no" field. +func (u *DictDetailUpsertOne) SetOrderNo(v int32) *DictDetailUpsertOne { + return u.Update(func(s *DictDetailUpsert) { + s.SetOrderNo(v) + }) +} + +// AddOrderNo adds v to the "order_no" field. +func (u *DictDetailUpsertOne) AddOrderNo(v int32) *DictDetailUpsertOne { + return u.Update(func(s *DictDetailUpsert) { + s.AddOrderNo(v) + }) +} + +// UpdateOrderNo sets the "order_no" field to the value that was provided on create. +func (u *DictDetailUpsertOne) UpdateOrderNo() *DictDetailUpsertOne { + return u.Update(func(s *DictDetailUpsert) { + s.UpdateOrderNo() + }) +} + +// ClearOrderNo clears the value of the "order_no" field. +func (u *DictDetailUpsertOne) ClearOrderNo() *DictDetailUpsertOne { + return u.Update(func(s *DictDetailUpsert) { + s.ClearOrderNo() + }) +} + +// SetLabel sets the "label" field. +func (u *DictDetailUpsertOne) SetLabel(v string) *DictDetailUpsertOne { + return u.Update(func(s *DictDetailUpsert) { + s.SetLabel(v) + }) +} + +// UpdateLabel sets the "label" field to the value that was provided on create. +func (u *DictDetailUpsertOne) UpdateLabel() *DictDetailUpsertOne { + return u.Update(func(s *DictDetailUpsert) { + s.UpdateLabel() + }) +} + +// ClearLabel clears the value of the "label" field. +func (u *DictDetailUpsertOne) ClearLabel() *DictDetailUpsertOne { + return u.Update(func(s *DictDetailUpsert) { + s.ClearLabel() + }) +} + +// SetValue sets the "value" field. +func (u *DictDetailUpsertOne) SetValue(v string) *DictDetailUpsertOne { + return u.Update(func(s *DictDetailUpsert) { + s.SetValue(v) + }) +} + +// UpdateValue sets the "value" field to the value that was provided on create. +func (u *DictDetailUpsertOne) UpdateValue() *DictDetailUpsertOne { + return u.Update(func(s *DictDetailUpsert) { + s.UpdateValue() + }) +} + +// ClearValue clears the value of the "value" field. +func (u *DictDetailUpsertOne) ClearValue() *DictDetailUpsertOne { + return u.Update(func(s *DictDetailUpsert) { + s.ClearValue() + }) +} + +// Exec executes the query. +func (u *DictDetailUpsertOne) Exec(ctx context.Context) error { + if len(u.create.conflict) == 0 { + return errors.New("ent: missing options for DictDetailCreate.OnConflict") + } + return u.create.Exec(ctx) +} + +// ExecX is like Exec, but panics if an error occurs. +func (u *DictDetailUpsertOne) ExecX(ctx context.Context) { + if err := u.create.Exec(ctx); err != nil { + panic(err) + } +} + +// Exec executes the UPSERT query and returns the inserted/updated ID. +func (u *DictDetailUpsertOne) ID(ctx context.Context) (id uint32, err error) { + node, err := u.create.Save(ctx) + if err != nil { + return id, err + } + return node.ID, nil +} + +// IDX is like ID, but panics if an error occurs. +func (u *DictDetailUpsertOne) IDX(ctx context.Context) uint32 { + id, err := u.ID(ctx) + if err != nil { + panic(err) + } + return id +} + +// DictDetailCreateBulk is the builder for creating many DictDetail entities in bulk. +type DictDetailCreateBulk struct { + config + err error + builders []*DictDetailCreate + conflict []sql.ConflictOption +} + +// Save creates the DictDetail entities in the database. +func (ddcb *DictDetailCreateBulk) Save(ctx context.Context) ([]*DictDetail, error) { + if ddcb.err != nil { + return nil, ddcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(ddcb.builders)) + nodes := make([]*DictDetail, len(ddcb.builders)) + mutators := make([]Mutator, len(ddcb.builders)) + for i := range ddcb.builders { + func(i int, root context.Context) { + builder := ddcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*DictDetailMutation) + if !ok { + return nil, fmt.Errorf("unexpected mutation type %T", m) + } + if err := builder.check(); err != nil { + return nil, err + } + builder.mutation = mutation + var err error + nodes[i], specs[i] = builder.createSpec() + if i < len(mutators)-1 { + _, err = mutators[i+1].Mutate(root, ddcb.builders[i+1].mutation) + } else { + spec := &sqlgraph.BatchCreateSpec{Nodes: specs} + spec.OnConflict = ddcb.conflict + // Invoke the actual operation on the latest mutation in the chain. + if err = sqlgraph.BatchCreate(ctx, ddcb.driver, spec); err != nil { + if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + } + } + if err != nil { + return nil, err + } + mutation.id = &nodes[i].ID + if specs[i].ID.Value != nil && nodes[i].ID == 0 { + id := specs[i].ID.Value.(int64) + nodes[i].ID = uint32(id) + } + mutation.done = true + return nodes[i], nil + }) + for i := len(builder.hooks) - 1; i >= 0; i-- { + mut = builder.hooks[i](mut) + } + mutators[i] = mut + }(i, ctx) + } + if len(mutators) > 0 { + if _, err := mutators[0].Mutate(ctx, ddcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (ddcb *DictDetailCreateBulk) SaveX(ctx context.Context) []*DictDetail { + v, err := ddcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ddcb *DictDetailCreateBulk) Exec(ctx context.Context) error { + _, err := ddcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ddcb *DictDetailCreateBulk) ExecX(ctx context.Context) { + if err := ddcb.Exec(ctx); err != nil { + panic(err) + } +} + +// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause +// of the `INSERT` statement. For example: +// +// client.DictDetail.CreateBulk(builders...). +// OnConflict( +// // Update the row with the new values +// // the was proposed for insertion. +// sql.ResolveWithNewValues(), +// ). +// // Override some of the fields with custom +// // update values. +// Update(func(u *ent.DictDetailUpsert) { +// SetCreateTime(v+v). +// }). +// Exec(ctx) +func (ddcb *DictDetailCreateBulk) OnConflict(opts ...sql.ConflictOption) *DictDetailUpsertBulk { + ddcb.conflict = opts + return &DictDetailUpsertBulk{ + create: ddcb, + } +} + +// OnConflictColumns calls `OnConflict` and configures the columns +// as conflict target. Using this option is equivalent to using: +// +// client.DictDetail.Create(). +// OnConflict(sql.ConflictColumns(columns...)). +// Exec(ctx) +func (ddcb *DictDetailCreateBulk) OnConflictColumns(columns ...string) *DictDetailUpsertBulk { + ddcb.conflict = append(ddcb.conflict, sql.ConflictColumns(columns...)) + return &DictDetailUpsertBulk{ + create: ddcb, + } +} + +// DictDetailUpsertBulk is the builder for "upsert"-ing +// a bulk of DictDetail nodes. +type DictDetailUpsertBulk struct { + create *DictDetailCreateBulk +} + +// UpdateNewValues updates the mutable fields using the new values that +// were set on create. Using this option is equivalent to using: +// +// client.DictDetail.Create(). +// OnConflict( +// sql.ResolveWithNewValues(), +// sql.ResolveWith(func(u *sql.UpdateSet) { +// u.SetIgnore(dictdetail.FieldID) +// }), +// ). +// Exec(ctx) +func (u *DictDetailUpsertBulk) UpdateNewValues() *DictDetailUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues()) + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) { + for _, b := range u.create.builders { + if _, exists := b.mutation.ID(); exists { + s.SetIgnore(dictdetail.FieldID) + } + if _, exists := b.mutation.CreateTime(); exists { + s.SetIgnore(dictdetail.FieldCreateTime) + } + } + })) + return u +} + +// Ignore sets each column to itself in case of conflict. +// Using this option is equivalent to using: +// +// client.DictDetail.Create(). +// OnConflict(sql.ResolveWithIgnore()). +// Exec(ctx) +func (u *DictDetailUpsertBulk) Ignore() *DictDetailUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore()) + return u +} + +// DoNothing configures the conflict_action to `DO NOTHING`. +// Supported only by SQLite and PostgreSQL. +func (u *DictDetailUpsertBulk) DoNothing() *DictDetailUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.DoNothing()) + return u +} + +// Update allows overriding fields `UPDATE` values. See the DictDetailCreateBulk.OnConflict +// documentation for more info. +func (u *DictDetailUpsertBulk) Update(set func(*DictDetailUpsert)) *DictDetailUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) { + set(&DictDetailUpsert{UpdateSet: update}) + })) + return u +} + +// SetUpdateTime sets the "update_time" field. +func (u *DictDetailUpsertBulk) SetUpdateTime(v time.Time) *DictDetailUpsertBulk { + return u.Update(func(s *DictDetailUpsert) { + s.SetUpdateTime(v) + }) +} + +// UpdateUpdateTime sets the "update_time" field to the value that was provided on create. +func (u *DictDetailUpsertBulk) UpdateUpdateTime() *DictDetailUpsertBulk { + return u.Update(func(s *DictDetailUpsert) { + s.UpdateUpdateTime() + }) +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (u *DictDetailUpsertBulk) ClearUpdateTime() *DictDetailUpsertBulk { + return u.Update(func(s *DictDetailUpsert) { + s.ClearUpdateTime() + }) +} + +// SetDeleteTime sets the "delete_time" field. +func (u *DictDetailUpsertBulk) SetDeleteTime(v time.Time) *DictDetailUpsertBulk { + return u.Update(func(s *DictDetailUpsert) { + s.SetDeleteTime(v) + }) +} + +// UpdateDeleteTime sets the "delete_time" field to the value that was provided on create. +func (u *DictDetailUpsertBulk) UpdateDeleteTime() *DictDetailUpsertBulk { + return u.Update(func(s *DictDetailUpsert) { + s.UpdateDeleteTime() + }) +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (u *DictDetailUpsertBulk) ClearDeleteTime() *DictDetailUpsertBulk { + return u.Update(func(s *DictDetailUpsert) { + s.ClearDeleteTime() + }) +} + +// SetCreateBy sets the "create_by" field. +func (u *DictDetailUpsertBulk) SetCreateBy(v uint32) *DictDetailUpsertBulk { + return u.Update(func(s *DictDetailUpsert) { + s.SetCreateBy(v) + }) +} + +// AddCreateBy adds v to the "create_by" field. +func (u *DictDetailUpsertBulk) AddCreateBy(v uint32) *DictDetailUpsertBulk { + return u.Update(func(s *DictDetailUpsert) { + s.AddCreateBy(v) + }) +} + +// UpdateCreateBy sets the "create_by" field to the value that was provided on create. +func (u *DictDetailUpsertBulk) UpdateCreateBy() *DictDetailUpsertBulk { + return u.Update(func(s *DictDetailUpsert) { + s.UpdateCreateBy() + }) +} + +// ClearCreateBy clears the value of the "create_by" field. +func (u *DictDetailUpsertBulk) ClearCreateBy() *DictDetailUpsertBulk { + return u.Update(func(s *DictDetailUpsert) { + s.ClearCreateBy() + }) +} + +// SetDictID sets the "dict_id" field. +func (u *DictDetailUpsertBulk) SetDictID(v uint32) *DictDetailUpsertBulk { + return u.Update(func(s *DictDetailUpsert) { + s.SetDictID(v) + }) +} + +// AddDictID adds v to the "dict_id" field. +func (u *DictDetailUpsertBulk) AddDictID(v uint32) *DictDetailUpsertBulk { + return u.Update(func(s *DictDetailUpsert) { + s.AddDictID(v) + }) +} + +// UpdateDictID sets the "dict_id" field to the value that was provided on create. +func (u *DictDetailUpsertBulk) UpdateDictID() *DictDetailUpsertBulk { + return u.Update(func(s *DictDetailUpsert) { + s.UpdateDictID() + }) +} + +// ClearDictID clears the value of the "dict_id" field. +func (u *DictDetailUpsertBulk) ClearDictID() *DictDetailUpsertBulk { + return u.Update(func(s *DictDetailUpsert) { + s.ClearDictID() + }) +} + +// SetOrderNo sets the "order_no" field. +func (u *DictDetailUpsertBulk) SetOrderNo(v int32) *DictDetailUpsertBulk { + return u.Update(func(s *DictDetailUpsert) { + s.SetOrderNo(v) + }) +} + +// AddOrderNo adds v to the "order_no" field. +func (u *DictDetailUpsertBulk) AddOrderNo(v int32) *DictDetailUpsertBulk { + return u.Update(func(s *DictDetailUpsert) { + s.AddOrderNo(v) + }) +} + +// UpdateOrderNo sets the "order_no" field to the value that was provided on create. +func (u *DictDetailUpsertBulk) UpdateOrderNo() *DictDetailUpsertBulk { + return u.Update(func(s *DictDetailUpsert) { + s.UpdateOrderNo() + }) +} + +// ClearOrderNo clears the value of the "order_no" field. +func (u *DictDetailUpsertBulk) ClearOrderNo() *DictDetailUpsertBulk { + return u.Update(func(s *DictDetailUpsert) { + s.ClearOrderNo() + }) +} + +// SetLabel sets the "label" field. +func (u *DictDetailUpsertBulk) SetLabel(v string) *DictDetailUpsertBulk { + return u.Update(func(s *DictDetailUpsert) { + s.SetLabel(v) + }) +} + +// UpdateLabel sets the "label" field to the value that was provided on create. +func (u *DictDetailUpsertBulk) UpdateLabel() *DictDetailUpsertBulk { + return u.Update(func(s *DictDetailUpsert) { + s.UpdateLabel() + }) +} + +// ClearLabel clears the value of the "label" field. +func (u *DictDetailUpsertBulk) ClearLabel() *DictDetailUpsertBulk { + return u.Update(func(s *DictDetailUpsert) { + s.ClearLabel() + }) +} + +// SetValue sets the "value" field. +func (u *DictDetailUpsertBulk) SetValue(v string) *DictDetailUpsertBulk { + return u.Update(func(s *DictDetailUpsert) { + s.SetValue(v) + }) +} + +// UpdateValue sets the "value" field to the value that was provided on create. +func (u *DictDetailUpsertBulk) UpdateValue() *DictDetailUpsertBulk { + return u.Update(func(s *DictDetailUpsert) { + s.UpdateValue() + }) +} + +// ClearValue clears the value of the "value" field. +func (u *DictDetailUpsertBulk) ClearValue() *DictDetailUpsertBulk { + return u.Update(func(s *DictDetailUpsert) { + s.ClearValue() + }) +} + +// Exec executes the query. +func (u *DictDetailUpsertBulk) Exec(ctx context.Context) error { + if u.create.err != nil { + return u.create.err + } + for i, b := range u.create.builders { + if len(b.conflict) != 0 { + return fmt.Errorf("ent: OnConflict was set for builder %d. Set it on the DictDetailCreateBulk instead", i) + } + } + if len(u.create.conflict) == 0 { + return errors.New("ent: missing options for DictDetailCreateBulk.OnConflict") + } + return u.create.Exec(ctx) +} + +// ExecX is like Exec, but panics if an error occurs. +func (u *DictDetailUpsertBulk) ExecX(ctx context.Context) { + if err := u.create.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/dictdetail_delete.go b/monolithic/backend/app/admin/service/internal/data/ent/dictdetail_delete.go new file mode 100644 index 0000000..b0a7344 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/dictdetail_delete.go @@ -0,0 +1,88 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/dictdetail" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// DictDetailDelete is the builder for deleting a DictDetail entity. +type DictDetailDelete struct { + config + hooks []Hook + mutation *DictDetailMutation +} + +// Where appends a list predicates to the DictDetailDelete builder. +func (ddd *DictDetailDelete) Where(ps ...predicate.DictDetail) *DictDetailDelete { + ddd.mutation.Where(ps...) + return ddd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (ddd *DictDetailDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, ddd.sqlExec, ddd.mutation, ddd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (ddd *DictDetailDelete) ExecX(ctx context.Context) int { + n, err := ddd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (ddd *DictDetailDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(dictdetail.Table, sqlgraph.NewFieldSpec(dictdetail.FieldID, field.TypeUint32)) + if ps := ddd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, ddd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + ddd.mutation.done = true + return affected, err +} + +// DictDetailDeleteOne is the builder for deleting a single DictDetail entity. +type DictDetailDeleteOne struct { + ddd *DictDetailDelete +} + +// Where appends a list predicates to the DictDetailDelete builder. +func (dddo *DictDetailDeleteOne) Where(ps ...predicate.DictDetail) *DictDetailDeleteOne { + dddo.ddd.mutation.Where(ps...) + return dddo +} + +// Exec executes the deletion query. +func (dddo *DictDetailDeleteOne) Exec(ctx context.Context) error { + n, err := dddo.ddd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{dictdetail.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (dddo *DictDetailDeleteOne) ExecX(ctx context.Context) { + if err := dddo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/dictdetail_query.go b/monolithic/backend/app/admin/service/internal/data/ent/dictdetail_query.go new file mode 100644 index 0000000..6a20043 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/dictdetail_query.go @@ -0,0 +1,548 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/dictdetail" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + "math" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// DictDetailQuery is the builder for querying DictDetail entities. +type DictDetailQuery struct { + config + ctx *QueryContext + order []dictdetail.OrderOption + inters []Interceptor + predicates []predicate.DictDetail + modifiers []func(*sql.Selector) + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the DictDetailQuery builder. +func (ddq *DictDetailQuery) Where(ps ...predicate.DictDetail) *DictDetailQuery { + ddq.predicates = append(ddq.predicates, ps...) + return ddq +} + +// Limit the number of records to be returned by this query. +func (ddq *DictDetailQuery) Limit(limit int) *DictDetailQuery { + ddq.ctx.Limit = &limit + return ddq +} + +// Offset to start from. +func (ddq *DictDetailQuery) Offset(offset int) *DictDetailQuery { + ddq.ctx.Offset = &offset + return ddq +} + +// Unique configures the query builder to filter duplicate records on query. +// By default, unique is set to true, and can be disabled using this method. +func (ddq *DictDetailQuery) Unique(unique bool) *DictDetailQuery { + ddq.ctx.Unique = &unique + return ddq +} + +// Order specifies how the records should be ordered. +func (ddq *DictDetailQuery) Order(o ...dictdetail.OrderOption) *DictDetailQuery { + ddq.order = append(ddq.order, o...) + return ddq +} + +// First returns the first DictDetail entity from the query. +// Returns a *NotFoundError when no DictDetail was found. +func (ddq *DictDetailQuery) First(ctx context.Context) (*DictDetail, error) { + nodes, err := ddq.Limit(1).All(setContextOp(ctx, ddq.ctx, "First")) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{dictdetail.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (ddq *DictDetailQuery) FirstX(ctx context.Context) *DictDetail { + node, err := ddq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first DictDetail ID from the query. +// Returns a *NotFoundError when no DictDetail ID was found. +func (ddq *DictDetailQuery) FirstID(ctx context.Context) (id uint32, err error) { + var ids []uint32 + if ids, err = ddq.Limit(1).IDs(setContextOp(ctx, ddq.ctx, "FirstID")); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{dictdetail.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (ddq *DictDetailQuery) FirstIDX(ctx context.Context) uint32 { + id, err := ddq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single DictDetail entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one DictDetail entity is found. +// Returns a *NotFoundError when no DictDetail entities are found. +func (ddq *DictDetailQuery) Only(ctx context.Context) (*DictDetail, error) { + nodes, err := ddq.Limit(2).All(setContextOp(ctx, ddq.ctx, "Only")) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{dictdetail.Label} + default: + return nil, &NotSingularError{dictdetail.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (ddq *DictDetailQuery) OnlyX(ctx context.Context) *DictDetail { + node, err := ddq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only DictDetail ID in the query. +// Returns a *NotSingularError when more than one DictDetail ID is found. +// Returns a *NotFoundError when no entities are found. +func (ddq *DictDetailQuery) OnlyID(ctx context.Context) (id uint32, err error) { + var ids []uint32 + if ids, err = ddq.Limit(2).IDs(setContextOp(ctx, ddq.ctx, "OnlyID")); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{dictdetail.Label} + default: + err = &NotSingularError{dictdetail.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (ddq *DictDetailQuery) OnlyIDX(ctx context.Context) uint32 { + id, err := ddq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of DictDetails. +func (ddq *DictDetailQuery) All(ctx context.Context) ([]*DictDetail, error) { + ctx = setContextOp(ctx, ddq.ctx, "All") + if err := ddq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*DictDetail, *DictDetailQuery]() + return withInterceptors[[]*DictDetail](ctx, ddq, qr, ddq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (ddq *DictDetailQuery) AllX(ctx context.Context) []*DictDetail { + nodes, err := ddq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of DictDetail IDs. +func (ddq *DictDetailQuery) IDs(ctx context.Context) (ids []uint32, err error) { + if ddq.ctx.Unique == nil && ddq.path != nil { + ddq.Unique(true) + } + ctx = setContextOp(ctx, ddq.ctx, "IDs") + if err = ddq.Select(dictdetail.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (ddq *DictDetailQuery) IDsX(ctx context.Context) []uint32 { + ids, err := ddq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (ddq *DictDetailQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, ddq.ctx, "Count") + if err := ddq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, ddq, querierCount[*DictDetailQuery](), ddq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (ddq *DictDetailQuery) CountX(ctx context.Context) int { + count, err := ddq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (ddq *DictDetailQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, ddq.ctx, "Exist") + switch _, err := ddq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("ent: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (ddq *DictDetailQuery) ExistX(ctx context.Context) bool { + exist, err := ddq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the DictDetailQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (ddq *DictDetailQuery) Clone() *DictDetailQuery { + if ddq == nil { + return nil + } + return &DictDetailQuery{ + config: ddq.config, + ctx: ddq.ctx.Clone(), + order: append([]dictdetail.OrderOption{}, ddq.order...), + inters: append([]Interceptor{}, ddq.inters...), + predicates: append([]predicate.DictDetail{}, ddq.predicates...), + // clone intermediate query. + sql: ddq.sql.Clone(), + path: ddq.path, + } +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreateTime time.Time `json:"create_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.DictDetail.Query(). +// GroupBy(dictdetail.FieldCreateTime). +// Aggregate(ent.Count()). +// Scan(ctx, &v) +func (ddq *DictDetailQuery) GroupBy(field string, fields ...string) *DictDetailGroupBy { + ddq.ctx.Fields = append([]string{field}, fields...) + grbuild := &DictDetailGroupBy{build: ddq} + grbuild.flds = &ddq.ctx.Fields + grbuild.label = dictdetail.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreateTime time.Time `json:"create_time,omitempty"` +// } +// +// client.DictDetail.Query(). +// Select(dictdetail.FieldCreateTime). +// Scan(ctx, &v) +func (ddq *DictDetailQuery) Select(fields ...string) *DictDetailSelect { + ddq.ctx.Fields = append(ddq.ctx.Fields, fields...) + sbuild := &DictDetailSelect{DictDetailQuery: ddq} + sbuild.label = dictdetail.Label + sbuild.flds, sbuild.scan = &ddq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a DictDetailSelect configured with the given aggregations. +func (ddq *DictDetailQuery) Aggregate(fns ...AggregateFunc) *DictDetailSelect { + return ddq.Select().Aggregate(fns...) +} + +func (ddq *DictDetailQuery) prepareQuery(ctx context.Context) error { + for _, inter := range ddq.inters { + if inter == nil { + return fmt.Errorf("ent: uninitialized interceptor (forgotten import ent/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, ddq); err != nil { + return err + } + } + } + for _, f := range ddq.ctx.Fields { + if !dictdetail.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)} + } + } + if ddq.path != nil { + prev, err := ddq.path(ctx) + if err != nil { + return err + } + ddq.sql = prev + } + return nil +} + +func (ddq *DictDetailQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*DictDetail, error) { + var ( + nodes = []*DictDetail{} + _spec = ddq.querySpec() + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*DictDetail).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &DictDetail{config: ddq.config} + nodes = append(nodes, node) + return node.assignValues(columns, values) + } + if len(ddq.modifiers) > 0 { + _spec.Modifiers = ddq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, ddq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + return nodes, nil +} + +func (ddq *DictDetailQuery) sqlCount(ctx context.Context) (int, error) { + _spec := ddq.querySpec() + if len(ddq.modifiers) > 0 { + _spec.Modifiers = ddq.modifiers + } + _spec.Node.Columns = ddq.ctx.Fields + if len(ddq.ctx.Fields) > 0 { + _spec.Unique = ddq.ctx.Unique != nil && *ddq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, ddq.driver, _spec) +} + +func (ddq *DictDetailQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(dictdetail.Table, dictdetail.Columns, sqlgraph.NewFieldSpec(dictdetail.FieldID, field.TypeUint32)) + _spec.From = ddq.sql + if unique := ddq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if ddq.path != nil { + _spec.Unique = true + } + if fields := ddq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, dictdetail.FieldID) + for i := range fields { + if fields[i] != dictdetail.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := ddq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := ddq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := ddq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := ddq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (ddq *DictDetailQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(ddq.driver.Dialect()) + t1 := builder.Table(dictdetail.Table) + columns := ddq.ctx.Fields + if len(columns) == 0 { + columns = dictdetail.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if ddq.sql != nil { + selector = ddq.sql + selector.Select(selector.Columns(columns...)...) + } + if ddq.ctx.Unique != nil && *ddq.ctx.Unique { + selector.Distinct() + } + for _, m := range ddq.modifiers { + m(selector) + } + for _, p := range ddq.predicates { + p(selector) + } + for _, p := range ddq.order { + p(selector) + } + if offset := ddq.ctx.Offset; offset != nil { + // limit is mandatory for offset clause. We start + // with default value, and override it below if needed. + selector.Offset(*offset).Limit(math.MaxInt32) + } + if limit := ddq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// Modify adds a query modifier for attaching custom logic to queries. +func (ddq *DictDetailQuery) Modify(modifiers ...func(s *sql.Selector)) *DictDetailSelect { + ddq.modifiers = append(ddq.modifiers, modifiers...) + return ddq.Select() +} + +// DictDetailGroupBy is the group-by builder for DictDetail entities. +type DictDetailGroupBy struct { + selector + build *DictDetailQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (ddgb *DictDetailGroupBy) Aggregate(fns ...AggregateFunc) *DictDetailGroupBy { + ddgb.fns = append(ddgb.fns, fns...) + return ddgb +} + +// Scan applies the selector query and scans the result into the given value. +func (ddgb *DictDetailGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ddgb.build.ctx, "GroupBy") + if err := ddgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*DictDetailQuery, *DictDetailGroupBy](ctx, ddgb.build, ddgb, ddgb.build.inters, v) +} + +func (ddgb *DictDetailGroupBy) sqlScan(ctx context.Context, root *DictDetailQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(ddgb.fns)) + for _, fn := range ddgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*ddgb.flds)+len(ddgb.fns)) + for _, f := range *ddgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*ddgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := ddgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// DictDetailSelect is the builder for selecting fields of DictDetail entities. +type DictDetailSelect struct { + *DictDetailQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (dds *DictDetailSelect) Aggregate(fns ...AggregateFunc) *DictDetailSelect { + dds.fns = append(dds.fns, fns...) + return dds +} + +// Scan applies the selector query and scans the result into the given value. +func (dds *DictDetailSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, dds.ctx, "Select") + if err := dds.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*DictDetailQuery, *DictDetailSelect](ctx, dds.DictDetailQuery, dds, dds.inters, v) +} + +func (dds *DictDetailSelect) sqlScan(ctx context.Context, root *DictDetailQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(dds.fns)) + for _, fn := range dds.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*dds.selector.flds); { + case n == 0 && len(aggregation) > 0: + selector.Select(aggregation...) + case n != 0 && len(aggregation) > 0: + selector.AppendSelect(aggregation...) + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := dds.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// Modify adds a query modifier for attaching custom logic to queries. +func (dds *DictDetailSelect) Modify(modifiers ...func(s *sql.Selector)) *DictDetailSelect { + dds.modifiers = append(dds.modifiers, modifiers...) + return dds +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/dictdetail_update.go b/monolithic/backend/app/admin/service/internal/data/ent/dictdetail_update.go new file mode 100644 index 0000000..8f8bf2f --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/dictdetail_update.go @@ -0,0 +1,622 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "errors" + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/dictdetail" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// DictDetailUpdate is the builder for updating DictDetail entities. +type DictDetailUpdate struct { + config + hooks []Hook + mutation *DictDetailMutation + modifiers []func(*sql.UpdateBuilder) +} + +// Where appends a list predicates to the DictDetailUpdate builder. +func (ddu *DictDetailUpdate) Where(ps ...predicate.DictDetail) *DictDetailUpdate { + ddu.mutation.Where(ps...) + return ddu +} + +// SetUpdateTime sets the "update_time" field. +func (ddu *DictDetailUpdate) SetUpdateTime(t time.Time) *DictDetailUpdate { + ddu.mutation.SetUpdateTime(t) + return ddu +} + +// SetNillableUpdateTime sets the "update_time" field if the given value is not nil. +func (ddu *DictDetailUpdate) SetNillableUpdateTime(t *time.Time) *DictDetailUpdate { + if t != nil { + ddu.SetUpdateTime(*t) + } + return ddu +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (ddu *DictDetailUpdate) ClearUpdateTime() *DictDetailUpdate { + ddu.mutation.ClearUpdateTime() + return ddu +} + +// SetDeleteTime sets the "delete_time" field. +func (ddu *DictDetailUpdate) SetDeleteTime(t time.Time) *DictDetailUpdate { + ddu.mutation.SetDeleteTime(t) + return ddu +} + +// SetNillableDeleteTime sets the "delete_time" field if the given value is not nil. +func (ddu *DictDetailUpdate) SetNillableDeleteTime(t *time.Time) *DictDetailUpdate { + if t != nil { + ddu.SetDeleteTime(*t) + } + return ddu +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (ddu *DictDetailUpdate) ClearDeleteTime() *DictDetailUpdate { + ddu.mutation.ClearDeleteTime() + return ddu +} + +// SetCreateBy sets the "create_by" field. +func (ddu *DictDetailUpdate) SetCreateBy(u uint32) *DictDetailUpdate { + ddu.mutation.ResetCreateBy() + ddu.mutation.SetCreateBy(u) + return ddu +} + +// SetNillableCreateBy sets the "create_by" field if the given value is not nil. +func (ddu *DictDetailUpdate) SetNillableCreateBy(u *uint32) *DictDetailUpdate { + if u != nil { + ddu.SetCreateBy(*u) + } + return ddu +} + +// AddCreateBy adds u to the "create_by" field. +func (ddu *DictDetailUpdate) AddCreateBy(u int32) *DictDetailUpdate { + ddu.mutation.AddCreateBy(u) + return ddu +} + +// ClearCreateBy clears the value of the "create_by" field. +func (ddu *DictDetailUpdate) ClearCreateBy() *DictDetailUpdate { + ddu.mutation.ClearCreateBy() + return ddu +} + +// SetDictID sets the "dict_id" field. +func (ddu *DictDetailUpdate) SetDictID(u uint32) *DictDetailUpdate { + ddu.mutation.ResetDictID() + ddu.mutation.SetDictID(u) + return ddu +} + +// SetNillableDictID sets the "dict_id" field if the given value is not nil. +func (ddu *DictDetailUpdate) SetNillableDictID(u *uint32) *DictDetailUpdate { + if u != nil { + ddu.SetDictID(*u) + } + return ddu +} + +// AddDictID adds u to the "dict_id" field. +func (ddu *DictDetailUpdate) AddDictID(u int32) *DictDetailUpdate { + ddu.mutation.AddDictID(u) + return ddu +} + +// ClearDictID clears the value of the "dict_id" field. +func (ddu *DictDetailUpdate) ClearDictID() *DictDetailUpdate { + ddu.mutation.ClearDictID() + return ddu +} + +// SetOrderNo sets the "order_no" field. +func (ddu *DictDetailUpdate) SetOrderNo(i int32) *DictDetailUpdate { + ddu.mutation.ResetOrderNo() + ddu.mutation.SetOrderNo(i) + return ddu +} + +// SetNillableOrderNo sets the "order_no" field if the given value is not nil. +func (ddu *DictDetailUpdate) SetNillableOrderNo(i *int32) *DictDetailUpdate { + if i != nil { + ddu.SetOrderNo(*i) + } + return ddu +} + +// AddOrderNo adds i to the "order_no" field. +func (ddu *DictDetailUpdate) AddOrderNo(i int32) *DictDetailUpdate { + ddu.mutation.AddOrderNo(i) + return ddu +} + +// ClearOrderNo clears the value of the "order_no" field. +func (ddu *DictDetailUpdate) ClearOrderNo() *DictDetailUpdate { + ddu.mutation.ClearOrderNo() + return ddu +} + +// SetLabel sets the "label" field. +func (ddu *DictDetailUpdate) SetLabel(s string) *DictDetailUpdate { + ddu.mutation.SetLabel(s) + return ddu +} + +// SetNillableLabel sets the "label" field if the given value is not nil. +func (ddu *DictDetailUpdate) SetNillableLabel(s *string) *DictDetailUpdate { + if s != nil { + ddu.SetLabel(*s) + } + return ddu +} + +// ClearLabel clears the value of the "label" field. +func (ddu *DictDetailUpdate) ClearLabel() *DictDetailUpdate { + ddu.mutation.ClearLabel() + return ddu +} + +// SetValue sets the "value" field. +func (ddu *DictDetailUpdate) SetValue(s string) *DictDetailUpdate { + ddu.mutation.SetValue(s) + return ddu +} + +// SetNillableValue sets the "value" field if the given value is not nil. +func (ddu *DictDetailUpdate) SetNillableValue(s *string) *DictDetailUpdate { + if s != nil { + ddu.SetValue(*s) + } + return ddu +} + +// ClearValue clears the value of the "value" field. +func (ddu *DictDetailUpdate) ClearValue() *DictDetailUpdate { + ddu.mutation.ClearValue() + return ddu +} + +// Mutation returns the DictDetailMutation object of the builder. +func (ddu *DictDetailUpdate) Mutation() *DictDetailMutation { + return ddu.mutation +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (ddu *DictDetailUpdate) Save(ctx context.Context) (int, error) { + return withHooks(ctx, ddu.sqlSave, ddu.mutation, ddu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ddu *DictDetailUpdate) SaveX(ctx context.Context) int { + affected, err := ddu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (ddu *DictDetailUpdate) Exec(ctx context.Context) error { + _, err := ddu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ddu *DictDetailUpdate) ExecX(ctx context.Context) { + if err := ddu.Exec(ctx); err != nil { + panic(err) + } +} + +// Modify adds a statement modifier for attaching custom logic to the UPDATE statement. +func (ddu *DictDetailUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *DictDetailUpdate { + ddu.modifiers = append(ddu.modifiers, modifiers...) + return ddu +} + +func (ddu *DictDetailUpdate) sqlSave(ctx context.Context) (n int, err error) { + _spec := sqlgraph.NewUpdateSpec(dictdetail.Table, dictdetail.Columns, sqlgraph.NewFieldSpec(dictdetail.FieldID, field.TypeUint32)) + if ps := ddu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ddu.mutation.CreateTimeCleared() { + _spec.ClearField(dictdetail.FieldCreateTime, field.TypeTime) + } + if value, ok := ddu.mutation.UpdateTime(); ok { + _spec.SetField(dictdetail.FieldUpdateTime, field.TypeTime, value) + } + if ddu.mutation.UpdateTimeCleared() { + _spec.ClearField(dictdetail.FieldUpdateTime, field.TypeTime) + } + if value, ok := ddu.mutation.DeleteTime(); ok { + _spec.SetField(dictdetail.FieldDeleteTime, field.TypeTime, value) + } + if ddu.mutation.DeleteTimeCleared() { + _spec.ClearField(dictdetail.FieldDeleteTime, field.TypeTime) + } + if value, ok := ddu.mutation.CreateBy(); ok { + _spec.SetField(dictdetail.FieldCreateBy, field.TypeUint32, value) + } + if value, ok := ddu.mutation.AddedCreateBy(); ok { + _spec.AddField(dictdetail.FieldCreateBy, field.TypeUint32, value) + } + if ddu.mutation.CreateByCleared() { + _spec.ClearField(dictdetail.FieldCreateBy, field.TypeUint32) + } + if value, ok := ddu.mutation.DictID(); ok { + _spec.SetField(dictdetail.FieldDictID, field.TypeUint32, value) + } + if value, ok := ddu.mutation.AddedDictID(); ok { + _spec.AddField(dictdetail.FieldDictID, field.TypeUint32, value) + } + if ddu.mutation.DictIDCleared() { + _spec.ClearField(dictdetail.FieldDictID, field.TypeUint32) + } + if value, ok := ddu.mutation.OrderNo(); ok { + _spec.SetField(dictdetail.FieldOrderNo, field.TypeInt32, value) + } + if value, ok := ddu.mutation.AddedOrderNo(); ok { + _spec.AddField(dictdetail.FieldOrderNo, field.TypeInt32, value) + } + if ddu.mutation.OrderNoCleared() { + _spec.ClearField(dictdetail.FieldOrderNo, field.TypeInt32) + } + if value, ok := ddu.mutation.Label(); ok { + _spec.SetField(dictdetail.FieldLabel, field.TypeString, value) + } + if ddu.mutation.LabelCleared() { + _spec.ClearField(dictdetail.FieldLabel, field.TypeString) + } + if value, ok := ddu.mutation.Value(); ok { + _spec.SetField(dictdetail.FieldValue, field.TypeString, value) + } + if ddu.mutation.ValueCleared() { + _spec.ClearField(dictdetail.FieldValue, field.TypeString) + } + _spec.AddModifiers(ddu.modifiers...) + if n, err = sqlgraph.UpdateNodes(ctx, ddu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{dictdetail.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + ddu.mutation.done = true + return n, nil +} + +// DictDetailUpdateOne is the builder for updating a single DictDetail entity. +type DictDetailUpdateOne struct { + config + fields []string + hooks []Hook + mutation *DictDetailMutation + modifiers []func(*sql.UpdateBuilder) +} + +// SetUpdateTime sets the "update_time" field. +func (dduo *DictDetailUpdateOne) SetUpdateTime(t time.Time) *DictDetailUpdateOne { + dduo.mutation.SetUpdateTime(t) + return dduo +} + +// SetNillableUpdateTime sets the "update_time" field if the given value is not nil. +func (dduo *DictDetailUpdateOne) SetNillableUpdateTime(t *time.Time) *DictDetailUpdateOne { + if t != nil { + dduo.SetUpdateTime(*t) + } + return dduo +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (dduo *DictDetailUpdateOne) ClearUpdateTime() *DictDetailUpdateOne { + dduo.mutation.ClearUpdateTime() + return dduo +} + +// SetDeleteTime sets the "delete_time" field. +func (dduo *DictDetailUpdateOne) SetDeleteTime(t time.Time) *DictDetailUpdateOne { + dduo.mutation.SetDeleteTime(t) + return dduo +} + +// SetNillableDeleteTime sets the "delete_time" field if the given value is not nil. +func (dduo *DictDetailUpdateOne) SetNillableDeleteTime(t *time.Time) *DictDetailUpdateOne { + if t != nil { + dduo.SetDeleteTime(*t) + } + return dduo +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (dduo *DictDetailUpdateOne) ClearDeleteTime() *DictDetailUpdateOne { + dduo.mutation.ClearDeleteTime() + return dduo +} + +// SetCreateBy sets the "create_by" field. +func (dduo *DictDetailUpdateOne) SetCreateBy(u uint32) *DictDetailUpdateOne { + dduo.mutation.ResetCreateBy() + dduo.mutation.SetCreateBy(u) + return dduo +} + +// SetNillableCreateBy sets the "create_by" field if the given value is not nil. +func (dduo *DictDetailUpdateOne) SetNillableCreateBy(u *uint32) *DictDetailUpdateOne { + if u != nil { + dduo.SetCreateBy(*u) + } + return dduo +} + +// AddCreateBy adds u to the "create_by" field. +func (dduo *DictDetailUpdateOne) AddCreateBy(u int32) *DictDetailUpdateOne { + dduo.mutation.AddCreateBy(u) + return dduo +} + +// ClearCreateBy clears the value of the "create_by" field. +func (dduo *DictDetailUpdateOne) ClearCreateBy() *DictDetailUpdateOne { + dduo.mutation.ClearCreateBy() + return dduo +} + +// SetDictID sets the "dict_id" field. +func (dduo *DictDetailUpdateOne) SetDictID(u uint32) *DictDetailUpdateOne { + dduo.mutation.ResetDictID() + dduo.mutation.SetDictID(u) + return dduo +} + +// SetNillableDictID sets the "dict_id" field if the given value is not nil. +func (dduo *DictDetailUpdateOne) SetNillableDictID(u *uint32) *DictDetailUpdateOne { + if u != nil { + dduo.SetDictID(*u) + } + return dduo +} + +// AddDictID adds u to the "dict_id" field. +func (dduo *DictDetailUpdateOne) AddDictID(u int32) *DictDetailUpdateOne { + dduo.mutation.AddDictID(u) + return dduo +} + +// ClearDictID clears the value of the "dict_id" field. +func (dduo *DictDetailUpdateOne) ClearDictID() *DictDetailUpdateOne { + dduo.mutation.ClearDictID() + return dduo +} + +// SetOrderNo sets the "order_no" field. +func (dduo *DictDetailUpdateOne) SetOrderNo(i int32) *DictDetailUpdateOne { + dduo.mutation.ResetOrderNo() + dduo.mutation.SetOrderNo(i) + return dduo +} + +// SetNillableOrderNo sets the "order_no" field if the given value is not nil. +func (dduo *DictDetailUpdateOne) SetNillableOrderNo(i *int32) *DictDetailUpdateOne { + if i != nil { + dduo.SetOrderNo(*i) + } + return dduo +} + +// AddOrderNo adds i to the "order_no" field. +func (dduo *DictDetailUpdateOne) AddOrderNo(i int32) *DictDetailUpdateOne { + dduo.mutation.AddOrderNo(i) + return dduo +} + +// ClearOrderNo clears the value of the "order_no" field. +func (dduo *DictDetailUpdateOne) ClearOrderNo() *DictDetailUpdateOne { + dduo.mutation.ClearOrderNo() + return dduo +} + +// SetLabel sets the "label" field. +func (dduo *DictDetailUpdateOne) SetLabel(s string) *DictDetailUpdateOne { + dduo.mutation.SetLabel(s) + return dduo +} + +// SetNillableLabel sets the "label" field if the given value is not nil. +func (dduo *DictDetailUpdateOne) SetNillableLabel(s *string) *DictDetailUpdateOne { + if s != nil { + dduo.SetLabel(*s) + } + return dduo +} + +// ClearLabel clears the value of the "label" field. +func (dduo *DictDetailUpdateOne) ClearLabel() *DictDetailUpdateOne { + dduo.mutation.ClearLabel() + return dduo +} + +// SetValue sets the "value" field. +func (dduo *DictDetailUpdateOne) SetValue(s string) *DictDetailUpdateOne { + dduo.mutation.SetValue(s) + return dduo +} + +// SetNillableValue sets the "value" field if the given value is not nil. +func (dduo *DictDetailUpdateOne) SetNillableValue(s *string) *DictDetailUpdateOne { + if s != nil { + dduo.SetValue(*s) + } + return dduo +} + +// ClearValue clears the value of the "value" field. +func (dduo *DictDetailUpdateOne) ClearValue() *DictDetailUpdateOne { + dduo.mutation.ClearValue() + return dduo +} + +// Mutation returns the DictDetailMutation object of the builder. +func (dduo *DictDetailUpdateOne) Mutation() *DictDetailMutation { + return dduo.mutation +} + +// Where appends a list predicates to the DictDetailUpdate builder. +func (dduo *DictDetailUpdateOne) Where(ps ...predicate.DictDetail) *DictDetailUpdateOne { + dduo.mutation.Where(ps...) + return dduo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (dduo *DictDetailUpdateOne) Select(field string, fields ...string) *DictDetailUpdateOne { + dduo.fields = append([]string{field}, fields...) + return dduo +} + +// Save executes the query and returns the updated DictDetail entity. +func (dduo *DictDetailUpdateOne) Save(ctx context.Context) (*DictDetail, error) { + return withHooks(ctx, dduo.sqlSave, dduo.mutation, dduo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (dduo *DictDetailUpdateOne) SaveX(ctx context.Context) *DictDetail { + node, err := dduo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (dduo *DictDetailUpdateOne) Exec(ctx context.Context) error { + _, err := dduo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (dduo *DictDetailUpdateOne) ExecX(ctx context.Context) { + if err := dduo.Exec(ctx); err != nil { + panic(err) + } +} + +// Modify adds a statement modifier for attaching custom logic to the UPDATE statement. +func (dduo *DictDetailUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *DictDetailUpdateOne { + dduo.modifiers = append(dduo.modifiers, modifiers...) + return dduo +} + +func (dduo *DictDetailUpdateOne) sqlSave(ctx context.Context) (_node *DictDetail, err error) { + _spec := sqlgraph.NewUpdateSpec(dictdetail.Table, dictdetail.Columns, sqlgraph.NewFieldSpec(dictdetail.FieldID, field.TypeUint32)) + id, ok := dduo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`ent: missing "DictDetail.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := dduo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, dictdetail.FieldID) + for _, f := range fields { + if !dictdetail.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)} + } + if f != dictdetail.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := dduo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if dduo.mutation.CreateTimeCleared() { + _spec.ClearField(dictdetail.FieldCreateTime, field.TypeTime) + } + if value, ok := dduo.mutation.UpdateTime(); ok { + _spec.SetField(dictdetail.FieldUpdateTime, field.TypeTime, value) + } + if dduo.mutation.UpdateTimeCleared() { + _spec.ClearField(dictdetail.FieldUpdateTime, field.TypeTime) + } + if value, ok := dduo.mutation.DeleteTime(); ok { + _spec.SetField(dictdetail.FieldDeleteTime, field.TypeTime, value) + } + if dduo.mutation.DeleteTimeCleared() { + _spec.ClearField(dictdetail.FieldDeleteTime, field.TypeTime) + } + if value, ok := dduo.mutation.CreateBy(); ok { + _spec.SetField(dictdetail.FieldCreateBy, field.TypeUint32, value) + } + if value, ok := dduo.mutation.AddedCreateBy(); ok { + _spec.AddField(dictdetail.FieldCreateBy, field.TypeUint32, value) + } + if dduo.mutation.CreateByCleared() { + _spec.ClearField(dictdetail.FieldCreateBy, field.TypeUint32) + } + if value, ok := dduo.mutation.DictID(); ok { + _spec.SetField(dictdetail.FieldDictID, field.TypeUint32, value) + } + if value, ok := dduo.mutation.AddedDictID(); ok { + _spec.AddField(dictdetail.FieldDictID, field.TypeUint32, value) + } + if dduo.mutation.DictIDCleared() { + _spec.ClearField(dictdetail.FieldDictID, field.TypeUint32) + } + if value, ok := dduo.mutation.OrderNo(); ok { + _spec.SetField(dictdetail.FieldOrderNo, field.TypeInt32, value) + } + if value, ok := dduo.mutation.AddedOrderNo(); ok { + _spec.AddField(dictdetail.FieldOrderNo, field.TypeInt32, value) + } + if dduo.mutation.OrderNoCleared() { + _spec.ClearField(dictdetail.FieldOrderNo, field.TypeInt32) + } + if value, ok := dduo.mutation.Label(); ok { + _spec.SetField(dictdetail.FieldLabel, field.TypeString, value) + } + if dduo.mutation.LabelCleared() { + _spec.ClearField(dictdetail.FieldLabel, field.TypeString) + } + if value, ok := dduo.mutation.Value(); ok { + _spec.SetField(dictdetail.FieldValue, field.TypeString, value) + } + if dduo.mutation.ValueCleared() { + _spec.ClearField(dictdetail.FieldValue, field.TypeString) + } + _spec.AddModifiers(dduo.modifiers...) + _node = &DictDetail{config: dduo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, dduo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{dictdetail.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + dduo.mutation.done = true + return _node, nil +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/ent.go b/monolithic/backend/app/admin/service/internal/data/ent/ent.go new file mode 100644 index 0000000..51ff5fd --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/ent.go @@ -0,0 +1,620 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "errors" + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/dict" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/dictdetail" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/menu" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/organization" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/position" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/role" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/user" + "reflect" + "sync" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +// ent aliases to avoid import conflicts in user's code. +type ( + Op = ent.Op + Hook = ent.Hook + Value = ent.Value + Query = ent.Query + QueryContext = ent.QueryContext + Querier = ent.Querier + QuerierFunc = ent.QuerierFunc + Interceptor = ent.Interceptor + InterceptFunc = ent.InterceptFunc + Traverser = ent.Traverser + TraverseFunc = ent.TraverseFunc + Policy = ent.Policy + Mutator = ent.Mutator + Mutation = ent.Mutation + MutateFunc = ent.MutateFunc +) + +type clientCtxKey struct{} + +// FromContext returns a Client stored inside a context, or nil if there isn't one. +func FromContext(ctx context.Context) *Client { + c, _ := ctx.Value(clientCtxKey{}).(*Client) + return c +} + +// NewContext returns a new context with the given Client attached. +func NewContext(parent context.Context, c *Client) context.Context { + return context.WithValue(parent, clientCtxKey{}, c) +} + +type txCtxKey struct{} + +// TxFromContext returns a Tx stored inside a context, or nil if there isn't one. +func TxFromContext(ctx context.Context) *Tx { + tx, _ := ctx.Value(txCtxKey{}).(*Tx) + return tx +} + +// NewTxContext returns a new context with the given Tx attached. +func NewTxContext(parent context.Context, tx *Tx) context.Context { + return context.WithValue(parent, txCtxKey{}, tx) +} + +// OrderFunc applies an ordering on the sql selector. +// Deprecated: Use Asc/Desc functions or the package builders instead. +type OrderFunc func(*sql.Selector) + +var ( + initCheck sync.Once + columnCheck sql.ColumnCheck +) + +// columnChecker checks if the column exists in the given table. +func checkColumn(table, column string) error { + initCheck.Do(func() { + columnCheck = sql.NewColumnCheck(map[string]func(string) bool{ + dict.Table: dict.ValidColumn, + dictdetail.Table: dictdetail.ValidColumn, + menu.Table: menu.ValidColumn, + organization.Table: organization.ValidColumn, + position.Table: position.ValidColumn, + role.Table: role.ValidColumn, + user.Table: user.ValidColumn, + }) + }) + return columnCheck(table, column) +} + +// Asc applies the given fields in ASC order. +func Asc(fields ...string) func(*sql.Selector) { + return func(s *sql.Selector) { + for _, f := range fields { + if err := checkColumn(s.TableName(), f); err != nil { + s.AddError(&ValidationError{Name: f, err: fmt.Errorf("ent: %w", err)}) + } + s.OrderBy(sql.Asc(s.C(f))) + } + } +} + +// Desc applies the given fields in DESC order. +func Desc(fields ...string) func(*sql.Selector) { + return func(s *sql.Selector) { + for _, f := range fields { + if err := checkColumn(s.TableName(), f); err != nil { + s.AddError(&ValidationError{Name: f, err: fmt.Errorf("ent: %w", err)}) + } + s.OrderBy(sql.Desc(s.C(f))) + } + } +} + +// AggregateFunc applies an aggregation step on the group-by traversal/selector. +type AggregateFunc func(*sql.Selector) string + +// As is a pseudo aggregation function for renaming another other functions with custom names. For example: +// +// GroupBy(field1, field2). +// Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). +// Scan(ctx, &v) +func As(fn AggregateFunc, end string) AggregateFunc { + return func(s *sql.Selector) string { + return sql.As(fn(s), end) + } +} + +// Count applies the "count" aggregation function on each group. +func Count() AggregateFunc { + return func(s *sql.Selector) string { + return sql.Count("*") + } +} + +// Max applies the "max" aggregation function on the given field of each group. +func Max(field string) AggregateFunc { + return func(s *sql.Selector) string { + if err := checkColumn(s.TableName(), field); err != nil { + s.AddError(&ValidationError{Name: field, err: fmt.Errorf("ent: %w", err)}) + return "" + } + return sql.Max(s.C(field)) + } +} + +// Mean applies the "mean" aggregation function on the given field of each group. +func Mean(field string) AggregateFunc { + return func(s *sql.Selector) string { + if err := checkColumn(s.TableName(), field); err != nil { + s.AddError(&ValidationError{Name: field, err: fmt.Errorf("ent: %w", err)}) + return "" + } + return sql.Avg(s.C(field)) + } +} + +// Min applies the "min" aggregation function on the given field of each group. +func Min(field string) AggregateFunc { + return func(s *sql.Selector) string { + if err := checkColumn(s.TableName(), field); err != nil { + s.AddError(&ValidationError{Name: field, err: fmt.Errorf("ent: %w", err)}) + return "" + } + return sql.Min(s.C(field)) + } +} + +// Sum applies the "sum" aggregation function on the given field of each group. +func Sum(field string) AggregateFunc { + return func(s *sql.Selector) string { + if err := checkColumn(s.TableName(), field); err != nil { + s.AddError(&ValidationError{Name: field, err: fmt.Errorf("ent: %w", err)}) + return "" + } + return sql.Sum(s.C(field)) + } +} + +// ValidationError returns when validating a field or edge fails. +type ValidationError struct { + Name string // Field or edge name. + err error +} + +// Error implements the error interface. +func (e *ValidationError) Error() string { + return e.err.Error() +} + +// Unwrap implements the errors.Wrapper interface. +func (e *ValidationError) Unwrap() error { + return e.err +} + +// IsValidationError returns a boolean indicating whether the error is a validation error. +func IsValidationError(err error) bool { + if err == nil { + return false + } + var e *ValidationError + return errors.As(err, &e) +} + +// NotFoundError returns when trying to fetch a specific entity and it was not found in the database. +type NotFoundError struct { + label string +} + +// Error implements the error interface. +func (e *NotFoundError) Error() string { + return "ent: " + e.label + " not found" +} + +// IsNotFound returns a boolean indicating whether the error is a not found error. +func IsNotFound(err error) bool { + if err == nil { + return false + } + var e *NotFoundError + return errors.As(err, &e) +} + +// MaskNotFound masks not found error. +func MaskNotFound(err error) error { + if IsNotFound(err) { + return nil + } + return err +} + +// NotSingularError returns when trying to fetch a singular entity and more then one was found in the database. +type NotSingularError struct { + label string +} + +// Error implements the error interface. +func (e *NotSingularError) Error() string { + return "ent: " + e.label + " not singular" +} + +// IsNotSingular returns a boolean indicating whether the error is a not singular error. +func IsNotSingular(err error) bool { + if err == nil { + return false + } + var e *NotSingularError + return errors.As(err, &e) +} + +// NotLoadedError returns when trying to get a node that was not loaded by the query. +type NotLoadedError struct { + edge string +} + +// Error implements the error interface. +func (e *NotLoadedError) Error() string { + return "ent: " + e.edge + " edge was not loaded" +} + +// IsNotLoaded returns a boolean indicating whether the error is a not loaded error. +func IsNotLoaded(err error) bool { + if err == nil { + return false + } + var e *NotLoadedError + return errors.As(err, &e) +} + +// ConstraintError returns when trying to create/update one or more entities and +// one or more of their constraints failed. For example, violation of edge or +// field uniqueness. +type ConstraintError struct { + msg string + wrap error +} + +// Error implements the error interface. +func (e ConstraintError) Error() string { + return "ent: constraint failed: " + e.msg +} + +// Unwrap implements the errors.Wrapper interface. +func (e *ConstraintError) Unwrap() error { + return e.wrap +} + +// IsConstraintError returns a boolean indicating whether the error is a constraint failure. +func IsConstraintError(err error) bool { + if err == nil { + return false + } + var e *ConstraintError + return errors.As(err, &e) +} + +// selector embedded by the different Select/GroupBy builders. +type selector struct { + label string + flds *[]string + fns []AggregateFunc + scan func(context.Context, any) error +} + +// ScanX is like Scan, but panics if an error occurs. +func (s *selector) ScanX(ctx context.Context, v any) { + if err := s.scan(ctx, v); err != nil { + panic(err) + } +} + +// Strings returns list of strings from a selector. It is only allowed when selecting one field. +func (s *selector) Strings(ctx context.Context) ([]string, error) { + if len(*s.flds) > 1 { + return nil, errors.New("ent: Strings is not achievable when selecting more than 1 field") + } + var v []string + if err := s.scan(ctx, &v); err != nil { + return nil, err + } + return v, nil +} + +// StringsX is like Strings, but panics if an error occurs. +func (s *selector) StringsX(ctx context.Context) []string { + v, err := s.Strings(ctx) + if err != nil { + panic(err) + } + return v +} + +// String returns a single string from a selector. It is only allowed when selecting one field. +func (s *selector) String(ctx context.Context) (_ string, err error) { + var v []string + if v, err = s.Strings(ctx); err != nil { + return + } + switch len(v) { + case 1: + return v[0], nil + case 0: + err = &NotFoundError{s.label} + default: + err = fmt.Errorf("ent: Strings returned %d results when one was expected", len(v)) + } + return +} + +// StringX is like String, but panics if an error occurs. +func (s *selector) StringX(ctx context.Context) string { + v, err := s.String(ctx) + if err != nil { + panic(err) + } + return v +} + +// Ints returns list of ints from a selector. It is only allowed when selecting one field. +func (s *selector) Ints(ctx context.Context) ([]int, error) { + if len(*s.flds) > 1 { + return nil, errors.New("ent: Ints is not achievable when selecting more than 1 field") + } + var v []int + if err := s.scan(ctx, &v); err != nil { + return nil, err + } + return v, nil +} + +// IntsX is like Ints, but panics if an error occurs. +func (s *selector) IntsX(ctx context.Context) []int { + v, err := s.Ints(ctx) + if err != nil { + panic(err) + } + return v +} + +// Int returns a single int from a selector. It is only allowed when selecting one field. +func (s *selector) Int(ctx context.Context) (_ int, err error) { + var v []int + if v, err = s.Ints(ctx); err != nil { + return + } + switch len(v) { + case 1: + return v[0], nil + case 0: + err = &NotFoundError{s.label} + default: + err = fmt.Errorf("ent: Ints returned %d results when one was expected", len(v)) + } + return +} + +// IntX is like Int, but panics if an error occurs. +func (s *selector) IntX(ctx context.Context) int { + v, err := s.Int(ctx) + if err != nil { + panic(err) + } + return v +} + +// Float64s returns list of float64s from a selector. It is only allowed when selecting one field. +func (s *selector) Float64s(ctx context.Context) ([]float64, error) { + if len(*s.flds) > 1 { + return nil, errors.New("ent: Float64s is not achievable when selecting more than 1 field") + } + var v []float64 + if err := s.scan(ctx, &v); err != nil { + return nil, err + } + return v, nil +} + +// Float64sX is like Float64s, but panics if an error occurs. +func (s *selector) Float64sX(ctx context.Context) []float64 { + v, err := s.Float64s(ctx) + if err != nil { + panic(err) + } + return v +} + +// Float64 returns a single float64 from a selector. It is only allowed when selecting one field. +func (s *selector) Float64(ctx context.Context) (_ float64, err error) { + var v []float64 + if v, err = s.Float64s(ctx); err != nil { + return + } + switch len(v) { + case 1: + return v[0], nil + case 0: + err = &NotFoundError{s.label} + default: + err = fmt.Errorf("ent: Float64s returned %d results when one was expected", len(v)) + } + return +} + +// Float64X is like Float64, but panics if an error occurs. +func (s *selector) Float64X(ctx context.Context) float64 { + v, err := s.Float64(ctx) + if err != nil { + panic(err) + } + return v +} + +// Bools returns list of bools from a selector. It is only allowed when selecting one field. +func (s *selector) Bools(ctx context.Context) ([]bool, error) { + if len(*s.flds) > 1 { + return nil, errors.New("ent: Bools is not achievable when selecting more than 1 field") + } + var v []bool + if err := s.scan(ctx, &v); err != nil { + return nil, err + } + return v, nil +} + +// BoolsX is like Bools, but panics if an error occurs. +func (s *selector) BoolsX(ctx context.Context) []bool { + v, err := s.Bools(ctx) + if err != nil { + panic(err) + } + return v +} + +// Bool returns a single bool from a selector. It is only allowed when selecting one field. +func (s *selector) Bool(ctx context.Context) (_ bool, err error) { + var v []bool + if v, err = s.Bools(ctx); err != nil { + return + } + switch len(v) { + case 1: + return v[0], nil + case 0: + err = &NotFoundError{s.label} + default: + err = fmt.Errorf("ent: Bools returned %d results when one was expected", len(v)) + } + return +} + +// BoolX is like Bool, but panics if an error occurs. +func (s *selector) BoolX(ctx context.Context) bool { + v, err := s.Bool(ctx) + if err != nil { + panic(err) + } + return v +} + +// withHooks invokes the builder operation with the given hooks, if any. +func withHooks[V Value, M any, PM interface { + *M + Mutation +}](ctx context.Context, exec func(context.Context) (V, error), mutation PM, hooks []Hook) (value V, err error) { + if len(hooks) == 0 { + return exec(ctx) + } + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutationT, ok := any(m).(PM) + if !ok { + return nil, fmt.Errorf("unexpected mutation type %T", m) + } + // Set the mutation to the builder. + *mutation = *mutationT + return exec(ctx) + }) + for i := len(hooks) - 1; i >= 0; i-- { + if hooks[i] == nil { + return value, fmt.Errorf("ent: uninitialized hook (forgotten import ent/runtime?)") + } + mut = hooks[i](mut) + } + v, err := mut.Mutate(ctx, mutation) + if err != nil { + return value, err + } + nv, ok := v.(V) + if !ok { + return value, fmt.Errorf("unexpected node type %T returned from %T", v, mutation) + } + return nv, nil +} + +// setContextOp returns a new context with the given QueryContext attached (including its op) in case it does not exist. +func setContextOp(ctx context.Context, qc *QueryContext, op string) context.Context { + if ent.QueryFromContext(ctx) == nil { + qc.Op = op + ctx = ent.NewQueryContext(ctx, qc) + } + return ctx +} + +func querierAll[V Value, Q interface { + sqlAll(context.Context, ...queryHook) (V, error) +}]() Querier { + return QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + query, ok := q.(Q) + if !ok { + return nil, fmt.Errorf("unexpected query type %T", q) + } + return query.sqlAll(ctx) + }) +} + +func querierCount[Q interface { + sqlCount(context.Context) (int, error) +}]() Querier { + return QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + query, ok := q.(Q) + if !ok { + return nil, fmt.Errorf("unexpected query type %T", q) + } + return query.sqlCount(ctx) + }) +} + +func withInterceptors[V Value](ctx context.Context, q Query, qr Querier, inters []Interceptor) (v V, err error) { + for i := len(inters) - 1; i >= 0; i-- { + qr = inters[i].Intercept(qr) + } + rv, err := qr.Query(ctx, q) + if err != nil { + return v, err + } + vt, ok := rv.(V) + if !ok { + return v, fmt.Errorf("unexpected type %T returned from %T. expected type: %T", vt, q, v) + } + return vt, nil +} + +func scanWithInterceptors[Q1 ent.Query, Q2 interface { + sqlScan(context.Context, Q1, any) error +}](ctx context.Context, rootQuery Q1, selectOrGroup Q2, inters []Interceptor, v any) error { + rv := reflect.ValueOf(v) + var qr Querier = QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + query, ok := q.(Q1) + if !ok { + return nil, fmt.Errorf("unexpected query type %T", q) + } + if err := selectOrGroup.sqlScan(ctx, query, v); err != nil { + return nil, err + } + if k := rv.Kind(); k == reflect.Pointer && rv.Elem().CanInterface() { + return rv.Elem().Interface(), nil + } + return v, nil + }) + for i := len(inters) - 1; i >= 0; i-- { + qr = inters[i].Intercept(qr) + } + vv, err := qr.Query(ctx, rootQuery) + if err != nil { + return err + } + switch rv2 := reflect.ValueOf(vv); { + case rv.IsNil(), rv2.IsNil(), rv.Kind() != reflect.Pointer: + case rv.Type() == rv2.Type(): + rv.Elem().Set(rv2.Elem()) + case rv.Elem().Type() == rv2.Type(): + rv.Elem().Set(rv2) + } + return nil +} + +// queryHook describes an internal hook for the different sqlAll methods. +type queryHook func(context.Context, *sqlgraph.QuerySpec) diff --git a/monolithic/backend/app/admin/service/internal/data/ent/entql.go b/monolithic/backend/app/admin/service/internal/data/ent/entql.go new file mode 100644 index 0000000..37284b5 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/entql.go @@ -0,0 +1,1138 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "kratos-monolithic-demo/app/admin/service/internal/data/ent/dict" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/dictdetail" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/menu" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/organization" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/position" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/role" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/user" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/entql" + "entgo.io/ent/schema/field" +) + +// schemaGraph holds a representation of ent/schema at runtime. +var schemaGraph = func() *sqlgraph.Schema { + graph := &sqlgraph.Schema{Nodes: make([]*sqlgraph.Node, 7)} + graph.Nodes[0] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: dict.Table, + Columns: dict.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeUint32, + Column: dict.FieldID, + }, + }, + Type: "Dict", + Fields: map[string]*sqlgraph.FieldSpec{ + dict.FieldCreateTime: {Type: field.TypeTime, Column: dict.FieldCreateTime}, + dict.FieldUpdateTime: {Type: field.TypeTime, Column: dict.FieldUpdateTime}, + dict.FieldDeleteTime: {Type: field.TypeTime, Column: dict.FieldDeleteTime}, + dict.FieldCreateBy: {Type: field.TypeUint32, Column: dict.FieldCreateBy}, + dict.FieldName: {Type: field.TypeString, Column: dict.FieldName}, + dict.FieldDescription: {Type: field.TypeString, Column: dict.FieldDescription}, + }, + } + graph.Nodes[1] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: dictdetail.Table, + Columns: dictdetail.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeUint32, + Column: dictdetail.FieldID, + }, + }, + Type: "DictDetail", + Fields: map[string]*sqlgraph.FieldSpec{ + dictdetail.FieldCreateTime: {Type: field.TypeTime, Column: dictdetail.FieldCreateTime}, + dictdetail.FieldUpdateTime: {Type: field.TypeTime, Column: dictdetail.FieldUpdateTime}, + dictdetail.FieldDeleteTime: {Type: field.TypeTime, Column: dictdetail.FieldDeleteTime}, + dictdetail.FieldCreateBy: {Type: field.TypeUint32, Column: dictdetail.FieldCreateBy}, + dictdetail.FieldDictID: {Type: field.TypeUint32, Column: dictdetail.FieldDictID}, + dictdetail.FieldOrderNo: {Type: field.TypeInt32, Column: dictdetail.FieldOrderNo}, + dictdetail.FieldLabel: {Type: field.TypeString, Column: dictdetail.FieldLabel}, + dictdetail.FieldValue: {Type: field.TypeString, Column: dictdetail.FieldValue}, + }, + } + graph.Nodes[2] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: menu.Table, + Columns: menu.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeInt32, + Column: menu.FieldID, + }, + }, + Type: "Menu", + Fields: map[string]*sqlgraph.FieldSpec{ + menu.FieldStatus: {Type: field.TypeEnum, Column: menu.FieldStatus}, + menu.FieldCreateTime: {Type: field.TypeTime, Column: menu.FieldCreateTime}, + menu.FieldUpdateTime: {Type: field.TypeTime, Column: menu.FieldUpdateTime}, + menu.FieldDeleteTime: {Type: field.TypeTime, Column: menu.FieldDeleteTime}, + menu.FieldCreateBy: {Type: field.TypeUint32, Column: menu.FieldCreateBy}, + menu.FieldParentID: {Type: field.TypeInt32, Column: menu.FieldParentID}, + menu.FieldOrderNo: {Type: field.TypeInt32, Column: menu.FieldOrderNo}, + menu.FieldName: {Type: field.TypeString, Column: menu.FieldName}, + menu.FieldTitle: {Type: field.TypeString, Column: menu.FieldTitle}, + menu.FieldType: {Type: field.TypeEnum, Column: menu.FieldType}, + menu.FieldPath: {Type: field.TypeString, Column: menu.FieldPath}, + menu.FieldComponent: {Type: field.TypeString, Column: menu.FieldComponent}, + menu.FieldIcon: {Type: field.TypeString, Column: menu.FieldIcon}, + menu.FieldIsExt: {Type: field.TypeBool, Column: menu.FieldIsExt}, + menu.FieldExtURL: {Type: field.TypeString, Column: menu.FieldExtURL}, + menu.FieldPermissions: {Type: field.TypeJSON, Column: menu.FieldPermissions}, + menu.FieldRedirect: {Type: field.TypeString, Column: menu.FieldRedirect}, + menu.FieldCurrentActiveMenu: {Type: field.TypeString, Column: menu.FieldCurrentActiveMenu}, + menu.FieldKeepAlive: {Type: field.TypeBool, Column: menu.FieldKeepAlive}, + menu.FieldShow: {Type: field.TypeBool, Column: menu.FieldShow}, + menu.FieldHideTab: {Type: field.TypeBool, Column: menu.FieldHideTab}, + menu.FieldHideMenu: {Type: field.TypeBool, Column: menu.FieldHideMenu}, + menu.FieldHideBreadcrumb: {Type: field.TypeBool, Column: menu.FieldHideBreadcrumb}, + }, + } + graph.Nodes[3] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: organization.Table, + Columns: organization.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeUint32, + Column: organization.FieldID, + }, + }, + Type: "Organization", + Fields: map[string]*sqlgraph.FieldSpec{ + organization.FieldCreateTime: {Type: field.TypeTime, Column: organization.FieldCreateTime}, + organization.FieldUpdateTime: {Type: field.TypeTime, Column: organization.FieldUpdateTime}, + organization.FieldDeleteTime: {Type: field.TypeTime, Column: organization.FieldDeleteTime}, + organization.FieldStatus: {Type: field.TypeEnum, Column: organization.FieldStatus}, + organization.FieldCreateBy: {Type: field.TypeUint32, Column: organization.FieldCreateBy}, + organization.FieldRemark: {Type: field.TypeString, Column: organization.FieldRemark}, + organization.FieldName: {Type: field.TypeString, Column: organization.FieldName}, + organization.FieldParentID: {Type: field.TypeUint32, Column: organization.FieldParentID}, + organization.FieldOrderNo: {Type: field.TypeInt32, Column: organization.FieldOrderNo}, + }, + } + graph.Nodes[4] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: position.Table, + Columns: position.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeUint32, + Column: position.FieldID, + }, + }, + Type: "Position", + Fields: map[string]*sqlgraph.FieldSpec{ + position.FieldCreateTime: {Type: field.TypeTime, Column: position.FieldCreateTime}, + position.FieldUpdateTime: {Type: field.TypeTime, Column: position.FieldUpdateTime}, + position.FieldDeleteTime: {Type: field.TypeTime, Column: position.FieldDeleteTime}, + position.FieldStatus: {Type: field.TypeEnum, Column: position.FieldStatus}, + position.FieldCreateBy: {Type: field.TypeUint32, Column: position.FieldCreateBy}, + position.FieldRemark: {Type: field.TypeString, Column: position.FieldRemark}, + position.FieldName: {Type: field.TypeString, Column: position.FieldName}, + position.FieldCode: {Type: field.TypeString, Column: position.FieldCode}, + position.FieldParentID: {Type: field.TypeUint32, Column: position.FieldParentID}, + position.FieldOrderNo: {Type: field.TypeInt32, Column: position.FieldOrderNo}, + }, + } + graph.Nodes[5] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: role.Table, + Columns: role.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeUint32, + Column: role.FieldID, + }, + }, + Type: "Role", + Fields: map[string]*sqlgraph.FieldSpec{ + role.FieldCreateTime: {Type: field.TypeTime, Column: role.FieldCreateTime}, + role.FieldUpdateTime: {Type: field.TypeTime, Column: role.FieldUpdateTime}, + role.FieldDeleteTime: {Type: field.TypeTime, Column: role.FieldDeleteTime}, + role.FieldStatus: {Type: field.TypeEnum, Column: role.FieldStatus}, + role.FieldCreateBy: {Type: field.TypeUint32, Column: role.FieldCreateBy}, + role.FieldRemark: {Type: field.TypeString, Column: role.FieldRemark}, + role.FieldName: {Type: field.TypeString, Column: role.FieldName}, + role.FieldCode: {Type: field.TypeString, Column: role.FieldCode}, + role.FieldParentID: {Type: field.TypeUint32, Column: role.FieldParentID}, + role.FieldOrderNo: {Type: field.TypeInt32, Column: role.FieldOrderNo}, + }, + } + graph.Nodes[6] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: user.Table, + Columns: user.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeUint32, + Column: user.FieldID, + }, + }, + Type: "User", + Fields: map[string]*sqlgraph.FieldSpec{ + user.FieldCreateBy: {Type: field.TypeUint32, Column: user.FieldCreateBy}, + user.FieldCreateTime: {Type: field.TypeTime, Column: user.FieldCreateTime}, + user.FieldUpdateTime: {Type: field.TypeTime, Column: user.FieldUpdateTime}, + user.FieldDeleteTime: {Type: field.TypeTime, Column: user.FieldDeleteTime}, + user.FieldStatus: {Type: field.TypeEnum, Column: user.FieldStatus}, + user.FieldUsername: {Type: field.TypeString, Column: user.FieldUsername}, + user.FieldPassword: {Type: field.TypeString, Column: user.FieldPassword}, + user.FieldRoleID: {Type: field.TypeUint32, Column: user.FieldRoleID}, + user.FieldOrgID: {Type: field.TypeUint32, Column: user.FieldOrgID}, + user.FieldPositionID: {Type: field.TypeUint32, Column: user.FieldPositionID}, + user.FieldWorkID: {Type: field.TypeUint32, Column: user.FieldWorkID}, + user.FieldNickName: {Type: field.TypeString, Column: user.FieldNickName}, + user.FieldRealName: {Type: field.TypeString, Column: user.FieldRealName}, + user.FieldEmail: {Type: field.TypeString, Column: user.FieldEmail}, + user.FieldPhone: {Type: field.TypeString, Column: user.FieldPhone}, + user.FieldAvatar: {Type: field.TypeString, Column: user.FieldAvatar}, + user.FieldGender: {Type: field.TypeEnum, Column: user.FieldGender}, + user.FieldAddress: {Type: field.TypeString, Column: user.FieldAddress}, + user.FieldDescription: {Type: field.TypeString, Column: user.FieldDescription}, + user.FieldAuthority: {Type: field.TypeEnum, Column: user.FieldAuthority}, + user.FieldLastLoginTime: {Type: field.TypeInt64, Column: user.FieldLastLoginTime}, + user.FieldLastLoginIP: {Type: field.TypeString, Column: user.FieldLastLoginIP}, + }, + } + graph.MustAddE( + "parent", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: menu.ParentTable, + Columns: []string{menu.ParentColumn}, + Bidi: false, + }, + "Menu", + "Menu", + ) + graph.MustAddE( + "children", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: menu.ChildrenTable, + Columns: []string{menu.ChildrenColumn}, + Bidi: false, + }, + "Menu", + "Menu", + ) + graph.MustAddE( + "parent", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: organization.ParentTable, + Columns: []string{organization.ParentColumn}, + Bidi: false, + }, + "Organization", + "Organization", + ) + graph.MustAddE( + "children", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.ChildrenTable, + Columns: []string{organization.ChildrenColumn}, + Bidi: false, + }, + "Organization", + "Organization", + ) + graph.MustAddE( + "parent", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: position.ParentTable, + Columns: []string{position.ParentColumn}, + Bidi: false, + }, + "Position", + "Position", + ) + graph.MustAddE( + "children", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: position.ChildrenTable, + Columns: []string{position.ChildrenColumn}, + Bidi: false, + }, + "Position", + "Position", + ) + graph.MustAddE( + "parent", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: role.ParentTable, + Columns: []string{role.ParentColumn}, + Bidi: false, + }, + "Role", + "Role", + ) + graph.MustAddE( + "children", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: role.ChildrenTable, + Columns: []string{role.ChildrenColumn}, + Bidi: false, + }, + "Role", + "Role", + ) + return graph +}() + +// predicateAdder wraps the addPredicate method. +// All update, update-one and query builders implement this interface. +type predicateAdder interface { + addPredicate(func(s *sql.Selector)) +} + +// addPredicate implements the predicateAdder interface. +func (dq *DictQuery) addPredicate(pred func(s *sql.Selector)) { + dq.predicates = append(dq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the DictQuery builder. +func (dq *DictQuery) Filter() *DictFilter { + return &DictFilter{config: dq.config, predicateAdder: dq} +} + +// addPredicate implements the predicateAdder interface. +func (m *DictMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the DictMutation builder. +func (m *DictMutation) Filter() *DictFilter { + return &DictFilter{config: m.config, predicateAdder: m} +} + +// DictFilter provides a generic filtering capability at runtime for DictQuery. +type DictFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *DictFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[0].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql uint32 predicate on the id field. +func (f *DictFilter) WhereID(p entql.Uint32P) { + f.Where(p.Field(dict.FieldID)) +} + +// WhereCreateTime applies the entql time.Time predicate on the create_time field. +func (f *DictFilter) WhereCreateTime(p entql.TimeP) { + f.Where(p.Field(dict.FieldCreateTime)) +} + +// WhereUpdateTime applies the entql time.Time predicate on the update_time field. +func (f *DictFilter) WhereUpdateTime(p entql.TimeP) { + f.Where(p.Field(dict.FieldUpdateTime)) +} + +// WhereDeleteTime applies the entql time.Time predicate on the delete_time field. +func (f *DictFilter) WhereDeleteTime(p entql.TimeP) { + f.Where(p.Field(dict.FieldDeleteTime)) +} + +// WhereCreateBy applies the entql uint32 predicate on the create_by field. +func (f *DictFilter) WhereCreateBy(p entql.Uint32P) { + f.Where(p.Field(dict.FieldCreateBy)) +} + +// WhereName applies the entql string predicate on the name field. +func (f *DictFilter) WhereName(p entql.StringP) { + f.Where(p.Field(dict.FieldName)) +} + +// WhereDescription applies the entql string predicate on the description field. +func (f *DictFilter) WhereDescription(p entql.StringP) { + f.Where(p.Field(dict.FieldDescription)) +} + +// addPredicate implements the predicateAdder interface. +func (ddq *DictDetailQuery) addPredicate(pred func(s *sql.Selector)) { + ddq.predicates = append(ddq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the DictDetailQuery builder. +func (ddq *DictDetailQuery) Filter() *DictDetailFilter { + return &DictDetailFilter{config: ddq.config, predicateAdder: ddq} +} + +// addPredicate implements the predicateAdder interface. +func (m *DictDetailMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the DictDetailMutation builder. +func (m *DictDetailMutation) Filter() *DictDetailFilter { + return &DictDetailFilter{config: m.config, predicateAdder: m} +} + +// DictDetailFilter provides a generic filtering capability at runtime for DictDetailQuery. +type DictDetailFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *DictDetailFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[1].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql uint32 predicate on the id field. +func (f *DictDetailFilter) WhereID(p entql.Uint32P) { + f.Where(p.Field(dictdetail.FieldID)) +} + +// WhereCreateTime applies the entql time.Time predicate on the create_time field. +func (f *DictDetailFilter) WhereCreateTime(p entql.TimeP) { + f.Where(p.Field(dictdetail.FieldCreateTime)) +} + +// WhereUpdateTime applies the entql time.Time predicate on the update_time field. +func (f *DictDetailFilter) WhereUpdateTime(p entql.TimeP) { + f.Where(p.Field(dictdetail.FieldUpdateTime)) +} + +// WhereDeleteTime applies the entql time.Time predicate on the delete_time field. +func (f *DictDetailFilter) WhereDeleteTime(p entql.TimeP) { + f.Where(p.Field(dictdetail.FieldDeleteTime)) +} + +// WhereCreateBy applies the entql uint32 predicate on the create_by field. +func (f *DictDetailFilter) WhereCreateBy(p entql.Uint32P) { + f.Where(p.Field(dictdetail.FieldCreateBy)) +} + +// WhereDictID applies the entql uint32 predicate on the dict_id field. +func (f *DictDetailFilter) WhereDictID(p entql.Uint32P) { + f.Where(p.Field(dictdetail.FieldDictID)) +} + +// WhereOrderNo applies the entql int32 predicate on the order_no field. +func (f *DictDetailFilter) WhereOrderNo(p entql.Int32P) { + f.Where(p.Field(dictdetail.FieldOrderNo)) +} + +// WhereLabel applies the entql string predicate on the label field. +func (f *DictDetailFilter) WhereLabel(p entql.StringP) { + f.Where(p.Field(dictdetail.FieldLabel)) +} + +// WhereValue applies the entql string predicate on the value field. +func (f *DictDetailFilter) WhereValue(p entql.StringP) { + f.Where(p.Field(dictdetail.FieldValue)) +} + +// addPredicate implements the predicateAdder interface. +func (mq *MenuQuery) addPredicate(pred func(s *sql.Selector)) { + mq.predicates = append(mq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the MenuQuery builder. +func (mq *MenuQuery) Filter() *MenuFilter { + return &MenuFilter{config: mq.config, predicateAdder: mq} +} + +// addPredicate implements the predicateAdder interface. +func (m *MenuMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the MenuMutation builder. +func (m *MenuMutation) Filter() *MenuFilter { + return &MenuFilter{config: m.config, predicateAdder: m} +} + +// MenuFilter provides a generic filtering capability at runtime for MenuQuery. +type MenuFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *MenuFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[2].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql int32 predicate on the id field. +func (f *MenuFilter) WhereID(p entql.Int32P) { + f.Where(p.Field(menu.FieldID)) +} + +// WhereStatus applies the entql string predicate on the status field. +func (f *MenuFilter) WhereStatus(p entql.StringP) { + f.Where(p.Field(menu.FieldStatus)) +} + +// WhereCreateTime applies the entql time.Time predicate on the create_time field. +func (f *MenuFilter) WhereCreateTime(p entql.TimeP) { + f.Where(p.Field(menu.FieldCreateTime)) +} + +// WhereUpdateTime applies the entql time.Time predicate on the update_time field. +func (f *MenuFilter) WhereUpdateTime(p entql.TimeP) { + f.Where(p.Field(menu.FieldUpdateTime)) +} + +// WhereDeleteTime applies the entql time.Time predicate on the delete_time field. +func (f *MenuFilter) WhereDeleteTime(p entql.TimeP) { + f.Where(p.Field(menu.FieldDeleteTime)) +} + +// WhereCreateBy applies the entql uint32 predicate on the create_by field. +func (f *MenuFilter) WhereCreateBy(p entql.Uint32P) { + f.Where(p.Field(menu.FieldCreateBy)) +} + +// WhereParentID applies the entql int32 predicate on the parent_id field. +func (f *MenuFilter) WhereParentID(p entql.Int32P) { + f.Where(p.Field(menu.FieldParentID)) +} + +// WhereOrderNo applies the entql int32 predicate on the order_no field. +func (f *MenuFilter) WhereOrderNo(p entql.Int32P) { + f.Where(p.Field(menu.FieldOrderNo)) +} + +// WhereName applies the entql string predicate on the name field. +func (f *MenuFilter) WhereName(p entql.StringP) { + f.Where(p.Field(menu.FieldName)) +} + +// WhereTitle applies the entql string predicate on the title field. +func (f *MenuFilter) WhereTitle(p entql.StringP) { + f.Where(p.Field(menu.FieldTitle)) +} + +// WhereType applies the entql string predicate on the type field. +func (f *MenuFilter) WhereType(p entql.StringP) { + f.Where(p.Field(menu.FieldType)) +} + +// WherePath applies the entql string predicate on the path field. +func (f *MenuFilter) WherePath(p entql.StringP) { + f.Where(p.Field(menu.FieldPath)) +} + +// WhereComponent applies the entql string predicate on the component field. +func (f *MenuFilter) WhereComponent(p entql.StringP) { + f.Where(p.Field(menu.FieldComponent)) +} + +// WhereIcon applies the entql string predicate on the icon field. +func (f *MenuFilter) WhereIcon(p entql.StringP) { + f.Where(p.Field(menu.FieldIcon)) +} + +// WhereIsExt applies the entql bool predicate on the is_ext field. +func (f *MenuFilter) WhereIsExt(p entql.BoolP) { + f.Where(p.Field(menu.FieldIsExt)) +} + +// WhereExtURL applies the entql string predicate on the ext_url field. +func (f *MenuFilter) WhereExtURL(p entql.StringP) { + f.Where(p.Field(menu.FieldExtURL)) +} + +// WherePermissions applies the entql json.RawMessage predicate on the permissions field. +func (f *MenuFilter) WherePermissions(p entql.BytesP) { + f.Where(p.Field(menu.FieldPermissions)) +} + +// WhereRedirect applies the entql string predicate on the redirect field. +func (f *MenuFilter) WhereRedirect(p entql.StringP) { + f.Where(p.Field(menu.FieldRedirect)) +} + +// WhereCurrentActiveMenu applies the entql string predicate on the current_active_menu field. +func (f *MenuFilter) WhereCurrentActiveMenu(p entql.StringP) { + f.Where(p.Field(menu.FieldCurrentActiveMenu)) +} + +// WhereKeepAlive applies the entql bool predicate on the keep_alive field. +func (f *MenuFilter) WhereKeepAlive(p entql.BoolP) { + f.Where(p.Field(menu.FieldKeepAlive)) +} + +// WhereShow applies the entql bool predicate on the show field. +func (f *MenuFilter) WhereShow(p entql.BoolP) { + f.Where(p.Field(menu.FieldShow)) +} + +// WhereHideTab applies the entql bool predicate on the hide_tab field. +func (f *MenuFilter) WhereHideTab(p entql.BoolP) { + f.Where(p.Field(menu.FieldHideTab)) +} + +// WhereHideMenu applies the entql bool predicate on the hide_menu field. +func (f *MenuFilter) WhereHideMenu(p entql.BoolP) { + f.Where(p.Field(menu.FieldHideMenu)) +} + +// WhereHideBreadcrumb applies the entql bool predicate on the hide_breadcrumb field. +func (f *MenuFilter) WhereHideBreadcrumb(p entql.BoolP) { + f.Where(p.Field(menu.FieldHideBreadcrumb)) +} + +// WhereHasParent applies a predicate to check if query has an edge parent. +func (f *MenuFilter) WhereHasParent() { + f.Where(entql.HasEdge("parent")) +} + +// WhereHasParentWith applies a predicate to check if query has an edge parent with a given conditions (other predicates). +func (f *MenuFilter) WhereHasParentWith(preds ...predicate.Menu) { + f.Where(entql.HasEdgeWith("parent", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasChildren applies a predicate to check if query has an edge children. +func (f *MenuFilter) WhereHasChildren() { + f.Where(entql.HasEdge("children")) +} + +// WhereHasChildrenWith applies a predicate to check if query has an edge children with a given conditions (other predicates). +func (f *MenuFilter) WhereHasChildrenWith(preds ...predicate.Menu) { + f.Where(entql.HasEdgeWith("children", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (oq *OrganizationQuery) addPredicate(pred func(s *sql.Selector)) { + oq.predicates = append(oq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the OrganizationQuery builder. +func (oq *OrganizationQuery) Filter() *OrganizationFilter { + return &OrganizationFilter{config: oq.config, predicateAdder: oq} +} + +// addPredicate implements the predicateAdder interface. +func (m *OrganizationMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the OrganizationMutation builder. +func (m *OrganizationMutation) Filter() *OrganizationFilter { + return &OrganizationFilter{config: m.config, predicateAdder: m} +} + +// OrganizationFilter provides a generic filtering capability at runtime for OrganizationQuery. +type OrganizationFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *OrganizationFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[3].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql uint32 predicate on the id field. +func (f *OrganizationFilter) WhereID(p entql.Uint32P) { + f.Where(p.Field(organization.FieldID)) +} + +// WhereCreateTime applies the entql time.Time predicate on the create_time field. +func (f *OrganizationFilter) WhereCreateTime(p entql.TimeP) { + f.Where(p.Field(organization.FieldCreateTime)) +} + +// WhereUpdateTime applies the entql time.Time predicate on the update_time field. +func (f *OrganizationFilter) WhereUpdateTime(p entql.TimeP) { + f.Where(p.Field(organization.FieldUpdateTime)) +} + +// WhereDeleteTime applies the entql time.Time predicate on the delete_time field. +func (f *OrganizationFilter) WhereDeleteTime(p entql.TimeP) { + f.Where(p.Field(organization.FieldDeleteTime)) +} + +// WhereStatus applies the entql string predicate on the status field. +func (f *OrganizationFilter) WhereStatus(p entql.StringP) { + f.Where(p.Field(organization.FieldStatus)) +} + +// WhereCreateBy applies the entql uint32 predicate on the create_by field. +func (f *OrganizationFilter) WhereCreateBy(p entql.Uint32P) { + f.Where(p.Field(organization.FieldCreateBy)) +} + +// WhereRemark applies the entql string predicate on the remark field. +func (f *OrganizationFilter) WhereRemark(p entql.StringP) { + f.Where(p.Field(organization.FieldRemark)) +} + +// WhereName applies the entql string predicate on the name field. +func (f *OrganizationFilter) WhereName(p entql.StringP) { + f.Where(p.Field(organization.FieldName)) +} + +// WhereParentID applies the entql uint32 predicate on the parent_id field. +func (f *OrganizationFilter) WhereParentID(p entql.Uint32P) { + f.Where(p.Field(organization.FieldParentID)) +} + +// WhereOrderNo applies the entql int32 predicate on the order_no field. +func (f *OrganizationFilter) WhereOrderNo(p entql.Int32P) { + f.Where(p.Field(organization.FieldOrderNo)) +} + +// WhereHasParent applies a predicate to check if query has an edge parent. +func (f *OrganizationFilter) WhereHasParent() { + f.Where(entql.HasEdge("parent")) +} + +// WhereHasParentWith applies a predicate to check if query has an edge parent with a given conditions (other predicates). +func (f *OrganizationFilter) WhereHasParentWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("parent", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasChildren applies a predicate to check if query has an edge children. +func (f *OrganizationFilter) WhereHasChildren() { + f.Where(entql.HasEdge("children")) +} + +// WhereHasChildrenWith applies a predicate to check if query has an edge children with a given conditions (other predicates). +func (f *OrganizationFilter) WhereHasChildrenWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("children", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (pq *PositionQuery) addPredicate(pred func(s *sql.Selector)) { + pq.predicates = append(pq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the PositionQuery builder. +func (pq *PositionQuery) Filter() *PositionFilter { + return &PositionFilter{config: pq.config, predicateAdder: pq} +} + +// addPredicate implements the predicateAdder interface. +func (m *PositionMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the PositionMutation builder. +func (m *PositionMutation) Filter() *PositionFilter { + return &PositionFilter{config: m.config, predicateAdder: m} +} + +// PositionFilter provides a generic filtering capability at runtime for PositionQuery. +type PositionFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *PositionFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[4].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql uint32 predicate on the id field. +func (f *PositionFilter) WhereID(p entql.Uint32P) { + f.Where(p.Field(position.FieldID)) +} + +// WhereCreateTime applies the entql time.Time predicate on the create_time field. +func (f *PositionFilter) WhereCreateTime(p entql.TimeP) { + f.Where(p.Field(position.FieldCreateTime)) +} + +// WhereUpdateTime applies the entql time.Time predicate on the update_time field. +func (f *PositionFilter) WhereUpdateTime(p entql.TimeP) { + f.Where(p.Field(position.FieldUpdateTime)) +} + +// WhereDeleteTime applies the entql time.Time predicate on the delete_time field. +func (f *PositionFilter) WhereDeleteTime(p entql.TimeP) { + f.Where(p.Field(position.FieldDeleteTime)) +} + +// WhereStatus applies the entql string predicate on the status field. +func (f *PositionFilter) WhereStatus(p entql.StringP) { + f.Where(p.Field(position.FieldStatus)) +} + +// WhereCreateBy applies the entql uint32 predicate on the create_by field. +func (f *PositionFilter) WhereCreateBy(p entql.Uint32P) { + f.Where(p.Field(position.FieldCreateBy)) +} + +// WhereRemark applies the entql string predicate on the remark field. +func (f *PositionFilter) WhereRemark(p entql.StringP) { + f.Where(p.Field(position.FieldRemark)) +} + +// WhereName applies the entql string predicate on the name field. +func (f *PositionFilter) WhereName(p entql.StringP) { + f.Where(p.Field(position.FieldName)) +} + +// WhereCode applies the entql string predicate on the code field. +func (f *PositionFilter) WhereCode(p entql.StringP) { + f.Where(p.Field(position.FieldCode)) +} + +// WhereParentID applies the entql uint32 predicate on the parent_id field. +func (f *PositionFilter) WhereParentID(p entql.Uint32P) { + f.Where(p.Field(position.FieldParentID)) +} + +// WhereOrderNo applies the entql int32 predicate on the order_no field. +func (f *PositionFilter) WhereOrderNo(p entql.Int32P) { + f.Where(p.Field(position.FieldOrderNo)) +} + +// WhereHasParent applies a predicate to check if query has an edge parent. +func (f *PositionFilter) WhereHasParent() { + f.Where(entql.HasEdge("parent")) +} + +// WhereHasParentWith applies a predicate to check if query has an edge parent with a given conditions (other predicates). +func (f *PositionFilter) WhereHasParentWith(preds ...predicate.Position) { + f.Where(entql.HasEdgeWith("parent", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasChildren applies a predicate to check if query has an edge children. +func (f *PositionFilter) WhereHasChildren() { + f.Where(entql.HasEdge("children")) +} + +// WhereHasChildrenWith applies a predicate to check if query has an edge children with a given conditions (other predicates). +func (f *PositionFilter) WhereHasChildrenWith(preds ...predicate.Position) { + f.Where(entql.HasEdgeWith("children", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (rq *RoleQuery) addPredicate(pred func(s *sql.Selector)) { + rq.predicates = append(rq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the RoleQuery builder. +func (rq *RoleQuery) Filter() *RoleFilter { + return &RoleFilter{config: rq.config, predicateAdder: rq} +} + +// addPredicate implements the predicateAdder interface. +func (m *RoleMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the RoleMutation builder. +func (m *RoleMutation) Filter() *RoleFilter { + return &RoleFilter{config: m.config, predicateAdder: m} +} + +// RoleFilter provides a generic filtering capability at runtime for RoleQuery. +type RoleFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *RoleFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[5].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql uint32 predicate on the id field. +func (f *RoleFilter) WhereID(p entql.Uint32P) { + f.Where(p.Field(role.FieldID)) +} + +// WhereCreateTime applies the entql time.Time predicate on the create_time field. +func (f *RoleFilter) WhereCreateTime(p entql.TimeP) { + f.Where(p.Field(role.FieldCreateTime)) +} + +// WhereUpdateTime applies the entql time.Time predicate on the update_time field. +func (f *RoleFilter) WhereUpdateTime(p entql.TimeP) { + f.Where(p.Field(role.FieldUpdateTime)) +} + +// WhereDeleteTime applies the entql time.Time predicate on the delete_time field. +func (f *RoleFilter) WhereDeleteTime(p entql.TimeP) { + f.Where(p.Field(role.FieldDeleteTime)) +} + +// WhereStatus applies the entql string predicate on the status field. +func (f *RoleFilter) WhereStatus(p entql.StringP) { + f.Where(p.Field(role.FieldStatus)) +} + +// WhereCreateBy applies the entql uint32 predicate on the create_by field. +func (f *RoleFilter) WhereCreateBy(p entql.Uint32P) { + f.Where(p.Field(role.FieldCreateBy)) +} + +// WhereRemark applies the entql string predicate on the remark field. +func (f *RoleFilter) WhereRemark(p entql.StringP) { + f.Where(p.Field(role.FieldRemark)) +} + +// WhereName applies the entql string predicate on the name field. +func (f *RoleFilter) WhereName(p entql.StringP) { + f.Where(p.Field(role.FieldName)) +} + +// WhereCode applies the entql string predicate on the code field. +func (f *RoleFilter) WhereCode(p entql.StringP) { + f.Where(p.Field(role.FieldCode)) +} + +// WhereParentID applies the entql uint32 predicate on the parent_id field. +func (f *RoleFilter) WhereParentID(p entql.Uint32P) { + f.Where(p.Field(role.FieldParentID)) +} + +// WhereOrderNo applies the entql int32 predicate on the order_no field. +func (f *RoleFilter) WhereOrderNo(p entql.Int32P) { + f.Where(p.Field(role.FieldOrderNo)) +} + +// WhereHasParent applies a predicate to check if query has an edge parent. +func (f *RoleFilter) WhereHasParent() { + f.Where(entql.HasEdge("parent")) +} + +// WhereHasParentWith applies a predicate to check if query has an edge parent with a given conditions (other predicates). +func (f *RoleFilter) WhereHasParentWith(preds ...predicate.Role) { + f.Where(entql.HasEdgeWith("parent", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasChildren applies a predicate to check if query has an edge children. +func (f *RoleFilter) WhereHasChildren() { + f.Where(entql.HasEdge("children")) +} + +// WhereHasChildrenWith applies a predicate to check if query has an edge children with a given conditions (other predicates). +func (f *RoleFilter) WhereHasChildrenWith(preds ...predicate.Role) { + f.Where(entql.HasEdgeWith("children", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (uq *UserQuery) addPredicate(pred func(s *sql.Selector)) { + uq.predicates = append(uq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the UserQuery builder. +func (uq *UserQuery) Filter() *UserFilter { + return &UserFilter{config: uq.config, predicateAdder: uq} +} + +// addPredicate implements the predicateAdder interface. +func (m *UserMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the UserMutation builder. +func (m *UserMutation) Filter() *UserFilter { + return &UserFilter{config: m.config, predicateAdder: m} +} + +// UserFilter provides a generic filtering capability at runtime for UserQuery. +type UserFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *UserFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[6].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql uint32 predicate on the id field. +func (f *UserFilter) WhereID(p entql.Uint32P) { + f.Where(p.Field(user.FieldID)) +} + +// WhereCreateBy applies the entql uint32 predicate on the create_by field. +func (f *UserFilter) WhereCreateBy(p entql.Uint32P) { + f.Where(p.Field(user.FieldCreateBy)) +} + +// WhereCreateTime applies the entql time.Time predicate on the create_time field. +func (f *UserFilter) WhereCreateTime(p entql.TimeP) { + f.Where(p.Field(user.FieldCreateTime)) +} + +// WhereUpdateTime applies the entql time.Time predicate on the update_time field. +func (f *UserFilter) WhereUpdateTime(p entql.TimeP) { + f.Where(p.Field(user.FieldUpdateTime)) +} + +// WhereDeleteTime applies the entql time.Time predicate on the delete_time field. +func (f *UserFilter) WhereDeleteTime(p entql.TimeP) { + f.Where(p.Field(user.FieldDeleteTime)) +} + +// WhereStatus applies the entql string predicate on the status field. +func (f *UserFilter) WhereStatus(p entql.StringP) { + f.Where(p.Field(user.FieldStatus)) +} + +// WhereUsername applies the entql string predicate on the username field. +func (f *UserFilter) WhereUsername(p entql.StringP) { + f.Where(p.Field(user.FieldUsername)) +} + +// WherePassword applies the entql string predicate on the password field. +func (f *UserFilter) WherePassword(p entql.StringP) { + f.Where(p.Field(user.FieldPassword)) +} + +// WhereRoleID applies the entql uint32 predicate on the role_id field. +func (f *UserFilter) WhereRoleID(p entql.Uint32P) { + f.Where(p.Field(user.FieldRoleID)) +} + +// WhereOrgID applies the entql uint32 predicate on the org_id field. +func (f *UserFilter) WhereOrgID(p entql.Uint32P) { + f.Where(p.Field(user.FieldOrgID)) +} + +// WherePositionID applies the entql uint32 predicate on the position_id field. +func (f *UserFilter) WherePositionID(p entql.Uint32P) { + f.Where(p.Field(user.FieldPositionID)) +} + +// WhereWorkID applies the entql uint32 predicate on the work_id field. +func (f *UserFilter) WhereWorkID(p entql.Uint32P) { + f.Where(p.Field(user.FieldWorkID)) +} + +// WhereNickName applies the entql string predicate on the nick_name field. +func (f *UserFilter) WhereNickName(p entql.StringP) { + f.Where(p.Field(user.FieldNickName)) +} + +// WhereRealName applies the entql string predicate on the real_name field. +func (f *UserFilter) WhereRealName(p entql.StringP) { + f.Where(p.Field(user.FieldRealName)) +} + +// WhereEmail applies the entql string predicate on the email field. +func (f *UserFilter) WhereEmail(p entql.StringP) { + f.Where(p.Field(user.FieldEmail)) +} + +// WherePhone applies the entql string predicate on the phone field. +func (f *UserFilter) WherePhone(p entql.StringP) { + f.Where(p.Field(user.FieldPhone)) +} + +// WhereAvatar applies the entql string predicate on the avatar field. +func (f *UserFilter) WhereAvatar(p entql.StringP) { + f.Where(p.Field(user.FieldAvatar)) +} + +// WhereGender applies the entql string predicate on the gender field. +func (f *UserFilter) WhereGender(p entql.StringP) { + f.Where(p.Field(user.FieldGender)) +} + +// WhereAddress applies the entql string predicate on the address field. +func (f *UserFilter) WhereAddress(p entql.StringP) { + f.Where(p.Field(user.FieldAddress)) +} + +// WhereDescription applies the entql string predicate on the description field. +func (f *UserFilter) WhereDescription(p entql.StringP) { + f.Where(p.Field(user.FieldDescription)) +} + +// WhereAuthority applies the entql string predicate on the authority field. +func (f *UserFilter) WhereAuthority(p entql.StringP) { + f.Where(p.Field(user.FieldAuthority)) +} + +// WhereLastLoginTime applies the entql int64 predicate on the last_login_time field. +func (f *UserFilter) WhereLastLoginTime(p entql.Int64P) { + f.Where(p.Field(user.FieldLastLoginTime)) +} + +// WhereLastLoginIP applies the entql string predicate on the last_login_ip field. +func (f *UserFilter) WhereLastLoginIP(p entql.StringP) { + f.Where(p.Field(user.FieldLastLoginIP)) +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/enttest/enttest.go b/monolithic/backend/app/admin/service/internal/data/ent/enttest/enttest.go new file mode 100644 index 0000000..84fe892 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/enttest/enttest.go @@ -0,0 +1,84 @@ +// Code generated by ent, DO NOT EDIT. + +package enttest + +import ( + "context" + "kratos-monolithic-demo/app/admin/service/internal/data/ent" + // required by schema hooks. + _ "kratos-monolithic-demo/app/admin/service/internal/data/ent/runtime" + + "kratos-monolithic-demo/app/admin/service/internal/data/ent/migrate" + + "entgo.io/ent/dialect/sql/schema" +) + +type ( + // TestingT is the interface that is shared between + // testing.T and testing.B and used by enttest. + TestingT interface { + FailNow() + Error(...any) + } + + // Option configures client creation. + Option func(*options) + + options struct { + opts []ent.Option + migrateOpts []schema.MigrateOption + } +) + +// WithOptions forwards options to client creation. +func WithOptions(opts ...ent.Option) Option { + return func(o *options) { + o.opts = append(o.opts, opts...) + } +} + +// WithMigrateOptions forwards options to auto migration. +func WithMigrateOptions(opts ...schema.MigrateOption) Option { + return func(o *options) { + o.migrateOpts = append(o.migrateOpts, opts...) + } +} + +func newOptions(opts []Option) *options { + o := &options{} + for _, opt := range opts { + opt(o) + } + return o +} + +// Open calls ent.Open and auto-run migration. +func Open(t TestingT, driverName, dataSourceName string, opts ...Option) *ent.Client { + o := newOptions(opts) + c, err := ent.Open(driverName, dataSourceName, o.opts...) + if err != nil { + t.Error(err) + t.FailNow() + } + migrateSchema(t, c, o) + return c +} + +// NewClient calls ent.NewClient and auto-run migration. +func NewClient(t TestingT, opts ...Option) *ent.Client { + o := newOptions(opts) + c := ent.NewClient(o.opts...) + migrateSchema(t, c, o) + return c +} +func migrateSchema(t TestingT, c *ent.Client, o *options) { + tables, err := schema.CopyTables(migrate.Tables) + if err != nil { + t.Error(err) + t.FailNow() + } + if err := migrate.Create(context.Background(), c.Schema, tables, o.migrateOpts...); err != nil { + t.Error(err) + t.FailNow() + } +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/hook/hook.go b/monolithic/backend/app/admin/service/internal/data/ent/hook/hook.go new file mode 100644 index 0000000..8c37146 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/hook/hook.go @@ -0,0 +1,270 @@ +// Code generated by ent, DO NOT EDIT. + +package hook + +import ( + "context" + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent" +) + +// The DictFunc type is an adapter to allow the use of ordinary +// function as Dict mutator. +type DictFunc func(context.Context, *ent.DictMutation) (ent.Value, error) + +// Mutate calls f(ctx, m). +func (f DictFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if mv, ok := m.(*ent.DictMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.DictMutation", m) +} + +// The DictDetailFunc type is an adapter to allow the use of ordinary +// function as DictDetail mutator. +type DictDetailFunc func(context.Context, *ent.DictDetailMutation) (ent.Value, error) + +// Mutate calls f(ctx, m). +func (f DictDetailFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if mv, ok := m.(*ent.DictDetailMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.DictDetailMutation", m) +} + +// The MenuFunc type is an adapter to allow the use of ordinary +// function as Menu mutator. +type MenuFunc func(context.Context, *ent.MenuMutation) (ent.Value, error) + +// Mutate calls f(ctx, m). +func (f MenuFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if mv, ok := m.(*ent.MenuMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.MenuMutation", m) +} + +// The OrganizationFunc type is an adapter to allow the use of ordinary +// function as Organization mutator. +type OrganizationFunc func(context.Context, *ent.OrganizationMutation) (ent.Value, error) + +// Mutate calls f(ctx, m). +func (f OrganizationFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if mv, ok := m.(*ent.OrganizationMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.OrganizationMutation", m) +} + +// The PositionFunc type is an adapter to allow the use of ordinary +// function as Position mutator. +type PositionFunc func(context.Context, *ent.PositionMutation) (ent.Value, error) + +// Mutate calls f(ctx, m). +func (f PositionFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if mv, ok := m.(*ent.PositionMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.PositionMutation", m) +} + +// The RoleFunc type is an adapter to allow the use of ordinary +// function as Role mutator. +type RoleFunc func(context.Context, *ent.RoleMutation) (ent.Value, error) + +// Mutate calls f(ctx, m). +func (f RoleFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if mv, ok := m.(*ent.RoleMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.RoleMutation", m) +} + +// The UserFunc type is an adapter to allow the use of ordinary +// function as User mutator. +type UserFunc func(context.Context, *ent.UserMutation) (ent.Value, error) + +// Mutate calls f(ctx, m). +func (f UserFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if mv, ok := m.(*ent.UserMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.UserMutation", m) +} + +// Condition is a hook condition function. +type Condition func(context.Context, ent.Mutation) bool + +// And groups conditions with the AND operator. +func And(first, second Condition, rest ...Condition) Condition { + return func(ctx context.Context, m ent.Mutation) bool { + if !first(ctx, m) || !second(ctx, m) { + return false + } + for _, cond := range rest { + if !cond(ctx, m) { + return false + } + } + return true + } +} + +// Or groups conditions with the OR operator. +func Or(first, second Condition, rest ...Condition) Condition { + return func(ctx context.Context, m ent.Mutation) bool { + if first(ctx, m) || second(ctx, m) { + return true + } + for _, cond := range rest { + if cond(ctx, m) { + return true + } + } + return false + } +} + +// Not negates a given condition. +func Not(cond Condition) Condition { + return func(ctx context.Context, m ent.Mutation) bool { + return !cond(ctx, m) + } +} + +// HasOp is a condition testing mutation operation. +func HasOp(op ent.Op) Condition { + return func(_ context.Context, m ent.Mutation) bool { + return m.Op().Is(op) + } +} + +// HasAddedFields is a condition validating `.AddedField` on fields. +func HasAddedFields(field string, fields ...string) Condition { + return func(_ context.Context, m ent.Mutation) bool { + if _, exists := m.AddedField(field); !exists { + return false + } + for _, field := range fields { + if _, exists := m.AddedField(field); !exists { + return false + } + } + return true + } +} + +// HasClearedFields is a condition validating `.FieldCleared` on fields. +func HasClearedFields(field string, fields ...string) Condition { + return func(_ context.Context, m ent.Mutation) bool { + if exists := m.FieldCleared(field); !exists { + return false + } + for _, field := range fields { + if exists := m.FieldCleared(field); !exists { + return false + } + } + return true + } +} + +// HasFields is a condition validating `.Field` on fields. +func HasFields(field string, fields ...string) Condition { + return func(_ context.Context, m ent.Mutation) bool { + if _, exists := m.Field(field); !exists { + return false + } + for _, field := range fields { + if _, exists := m.Field(field); !exists { + return false + } + } + return true + } +} + +// If executes the given hook under condition. +// +// hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...))) +func If(hk ent.Hook, cond Condition) ent.Hook { + return func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if cond(ctx, m) { + return hk(next).Mutate(ctx, m) + } + return next.Mutate(ctx, m) + }) + } +} + +// On executes the given hook only for the given operation. +// +// hook.On(Log, ent.Delete|ent.Create) +func On(hk ent.Hook, op ent.Op) ent.Hook { + return If(hk, HasOp(op)) +} + +// Unless skips the given hook only for the given operation. +// +// hook.Unless(Log, ent.Update|ent.UpdateOne) +func Unless(hk ent.Hook, op ent.Op) ent.Hook { + return If(hk, Not(HasOp(op))) +} + +// FixedError is a hook returning a fixed error. +func FixedError(err error) ent.Hook { + return func(ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(context.Context, ent.Mutation) (ent.Value, error) { + return nil, err + }) + } +} + +// Reject returns a hook that rejects all operations that match op. +// +// func (T) Hooks() []ent.Hook { +// return []ent.Hook{ +// Reject(ent.Delete|ent.Update), +// } +// } +func Reject(op ent.Op) ent.Hook { + hk := FixedError(fmt.Errorf("%s operation is not allowed", op)) + return On(hk, op) +} + +// Chain acts as a list of hooks and is effectively immutable. +// Once created, it will always hold the same set of hooks in the same order. +type Chain struct { + hooks []ent.Hook +} + +// NewChain creates a new chain of hooks. +func NewChain(hooks ...ent.Hook) Chain { + return Chain{append([]ent.Hook(nil), hooks...)} +} + +// Hook chains the list of hooks and returns the final hook. +func (c Chain) Hook() ent.Hook { + return func(mutator ent.Mutator) ent.Mutator { + for i := len(c.hooks) - 1; i >= 0; i-- { + mutator = c.hooks[i](mutator) + } + return mutator + } +} + +// Append extends a chain, adding the specified hook +// as the last ones in the mutation flow. +func (c Chain) Append(hooks ...ent.Hook) Chain { + newHooks := make([]ent.Hook, 0, len(c.hooks)+len(hooks)) + newHooks = append(newHooks, c.hooks...) + newHooks = append(newHooks, hooks...) + return Chain{newHooks} +} + +// Extend extends a chain, adding the specified chain +// as the last ones in the mutation flow. +func (c Chain) Extend(chain Chain) Chain { + return c.Append(chain.hooks...) +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/menu.go b/monolithic/backend/app/admin/service/internal/data/ent/menu.go new file mode 100644 index 0000000..050a819 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/menu.go @@ -0,0 +1,468 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "encoding/json" + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/menu" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" +) + +// Menu is the model entity for the Menu schema. +type Menu struct { + config `json:"-"` + // ID of the ent. + // id + ID int32 `json:"id,omitempty"` + // 状态 + Status *menu.Status `json:"status,omitempty"` + // 创建时间 + CreateTime *time.Time `json:"create_time,omitempty"` + // 更新时间 + UpdateTime *time.Time `json:"update_time,omitempty"` + // 删除时间 + DeleteTime *time.Time `json:"delete_time,omitempty"` + // 创建者ID + CreateBy *uint32 `json:"create_by,omitempty"` + // 上一层菜单ID + ParentID *int32 `json:"parent_id,omitempty"` + // 排序ID + OrderNo *int32 `json:"order_no,omitempty"` + // 菜单名称 + Name *string `json:"name,omitempty"` + // 菜单标题 + Title *string `json:"title,omitempty"` + // 菜单类型 FOLDER: 目录 MENU: 菜单 BUTTON: 按钮 + Type *menu.Type `json:"type,omitempty"` + // 路径,当其类型为'按钮'的时候对应的数据操作名,例如:/user.service.v1.UserService/Login + Path *string `json:"path,omitempty"` + // 前端页面组件 + Component *string `json:"component,omitempty"` + // 图标 + Icon *string `json:"icon,omitempty"` + // 是否外链 + IsExt *bool `json:"is_ext,omitempty"` + // 外链地址 + ExtURL *string `json:"ext_url,omitempty"` + // 权限代码 例如:sys:menu + Permissions []string `json:"permissions,omitempty"` + // 跳转路径 + Redirect *string `json:"redirect,omitempty"` + // 当前激活路径 + CurrentActiveMenu *string `json:"current_active_menu,omitempty"` + // 是否缓存 + KeepAlive *bool `json:"keep_alive,omitempty"` + // 是否显示 + Show *bool `json:"show,omitempty"` + // 是否显示在标签页导航 + HideTab *bool `json:"hide_tab,omitempty"` + // 是否显示在菜单导航 + HideMenu *bool `json:"hide_menu,omitempty"` + // 是否显示在面包屑导航 + HideBreadcrumb *bool `json:"hide_breadcrumb,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the MenuQuery when eager-loading is set. + Edges MenuEdges `json:"edges"` + selectValues sql.SelectValues +} + +// MenuEdges holds the relations/edges for other nodes in the graph. +type MenuEdges struct { + // Parent holds the value of the parent edge. + Parent *Menu `json:"parent,omitempty"` + // Children holds the value of the children edge. + Children []*Menu `json:"children,omitempty"` + // loadedTypes holds the information for reporting if a + // type was loaded (or requested) in eager-loading or not. + loadedTypes [2]bool +} + +// ParentOrErr returns the Parent value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e MenuEdges) ParentOrErr() (*Menu, error) { + if e.loadedTypes[0] { + if e.Parent == nil { + // Edge was loaded but was not found. + return nil, &NotFoundError{label: menu.Label} + } + return e.Parent, nil + } + return nil, &NotLoadedError{edge: "parent"} +} + +// ChildrenOrErr returns the Children value or an error if the edge +// was not loaded in eager-loading. +func (e MenuEdges) ChildrenOrErr() ([]*Menu, error) { + if e.loadedTypes[1] { + return e.Children, nil + } + return nil, &NotLoadedError{edge: "children"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*Menu) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case menu.FieldPermissions: + values[i] = new([]byte) + case menu.FieldIsExt, menu.FieldKeepAlive, menu.FieldShow, menu.FieldHideTab, menu.FieldHideMenu, menu.FieldHideBreadcrumb: + values[i] = new(sql.NullBool) + case menu.FieldID, menu.FieldCreateBy, menu.FieldParentID, menu.FieldOrderNo: + values[i] = new(sql.NullInt64) + case menu.FieldStatus, menu.FieldName, menu.FieldTitle, menu.FieldType, menu.FieldPath, menu.FieldComponent, menu.FieldIcon, menu.FieldExtURL, menu.FieldRedirect, menu.FieldCurrentActiveMenu: + values[i] = new(sql.NullString) + case menu.FieldCreateTime, menu.FieldUpdateTime, menu.FieldDeleteTime: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the Menu fields. +func (m *Menu) assignValues(columns []string, values []any) error { + if m, n := len(values), len(columns); m < n { + return fmt.Errorf("mismatch number of scan values: %d != %d", m, n) + } + for i := range columns { + switch columns[i] { + case menu.FieldID: + value, ok := values[i].(*sql.NullInt64) + if !ok { + return fmt.Errorf("unexpected type %T for field id", value) + } + m.ID = int32(value.Int64) + case menu.FieldStatus: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field status", values[i]) + } else if value.Valid { + m.Status = new(menu.Status) + *m.Status = menu.Status(value.String) + } + case menu.FieldCreateTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field create_time", values[i]) + } else if value.Valid { + m.CreateTime = new(time.Time) + *m.CreateTime = value.Time + } + case menu.FieldUpdateTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field update_time", values[i]) + } else if value.Valid { + m.UpdateTime = new(time.Time) + *m.UpdateTime = value.Time + } + case menu.FieldDeleteTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field delete_time", values[i]) + } else if value.Valid { + m.DeleteTime = new(time.Time) + *m.DeleteTime = value.Time + } + case menu.FieldCreateBy: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field create_by", values[i]) + } else if value.Valid { + m.CreateBy = new(uint32) + *m.CreateBy = uint32(value.Int64) + } + case menu.FieldParentID: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field parent_id", values[i]) + } else if value.Valid { + m.ParentID = new(int32) + *m.ParentID = int32(value.Int64) + } + case menu.FieldOrderNo: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field order_no", values[i]) + } else if value.Valid { + m.OrderNo = new(int32) + *m.OrderNo = int32(value.Int64) + } + case menu.FieldName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[i]) + } else if value.Valid { + m.Name = new(string) + *m.Name = value.String + } + case menu.FieldTitle: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field title", values[i]) + } else if value.Valid { + m.Title = new(string) + *m.Title = value.String + } + case menu.FieldType: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field type", values[i]) + } else if value.Valid { + m.Type = new(menu.Type) + *m.Type = menu.Type(value.String) + } + case menu.FieldPath: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field path", values[i]) + } else if value.Valid { + m.Path = new(string) + *m.Path = value.String + } + case menu.FieldComponent: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field component", values[i]) + } else if value.Valid { + m.Component = new(string) + *m.Component = value.String + } + case menu.FieldIcon: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field icon", values[i]) + } else if value.Valid { + m.Icon = new(string) + *m.Icon = value.String + } + case menu.FieldIsExt: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field is_ext", values[i]) + } else if value.Valid { + m.IsExt = new(bool) + *m.IsExt = value.Bool + } + case menu.FieldExtURL: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field ext_url", values[i]) + } else if value.Valid { + m.ExtURL = new(string) + *m.ExtURL = value.String + } + case menu.FieldPermissions: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field permissions", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &m.Permissions); err != nil { + return fmt.Errorf("unmarshal field permissions: %w", err) + } + } + case menu.FieldRedirect: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field redirect", values[i]) + } else if value.Valid { + m.Redirect = new(string) + *m.Redirect = value.String + } + case menu.FieldCurrentActiveMenu: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field current_active_menu", values[i]) + } else if value.Valid { + m.CurrentActiveMenu = new(string) + *m.CurrentActiveMenu = value.String + } + case menu.FieldKeepAlive: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field keep_alive", values[i]) + } else if value.Valid { + m.KeepAlive = new(bool) + *m.KeepAlive = value.Bool + } + case menu.FieldShow: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field show", values[i]) + } else if value.Valid { + m.Show = new(bool) + *m.Show = value.Bool + } + case menu.FieldHideTab: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field hide_tab", values[i]) + } else if value.Valid { + m.HideTab = new(bool) + *m.HideTab = value.Bool + } + case menu.FieldHideMenu: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field hide_menu", values[i]) + } else if value.Valid { + m.HideMenu = new(bool) + *m.HideMenu = value.Bool + } + case menu.FieldHideBreadcrumb: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field hide_breadcrumb", values[i]) + } else if value.Valid { + m.HideBreadcrumb = new(bool) + *m.HideBreadcrumb = value.Bool + } + default: + m.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the Menu. +// This includes values selected through modifiers, order, etc. +func (m *Menu) Value(name string) (ent.Value, error) { + return m.selectValues.Get(name) +} + +// QueryParent queries the "parent" edge of the Menu entity. +func (m *Menu) QueryParent() *MenuQuery { + return NewMenuClient(m.config).QueryParent(m) +} + +// QueryChildren queries the "children" edge of the Menu entity. +func (m *Menu) QueryChildren() *MenuQuery { + return NewMenuClient(m.config).QueryChildren(m) +} + +// Update returns a builder for updating this Menu. +// Note that you need to call Menu.Unwrap() before calling this method if this Menu +// was returned from a transaction, and the transaction was committed or rolled back. +func (m *Menu) Update() *MenuUpdateOne { + return NewMenuClient(m.config).UpdateOne(m) +} + +// Unwrap unwraps the Menu entity that was returned from a transaction after it was closed, +// so that all future queries will be executed through the driver which created the transaction. +func (m *Menu) Unwrap() *Menu { + _tx, ok := m.config.driver.(*txDriver) + if !ok { + panic("ent: Menu is not a transactional entity") + } + m.config.driver = _tx.drv + return m +} + +// String implements the fmt.Stringer. +func (m *Menu) String() string { + var builder strings.Builder + builder.WriteString("Menu(") + builder.WriteString(fmt.Sprintf("id=%v, ", m.ID)) + if v := m.Status; v != nil { + builder.WriteString("status=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := m.CreateTime; v != nil { + builder.WriteString("create_time=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + if v := m.UpdateTime; v != nil { + builder.WriteString("update_time=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + if v := m.DeleteTime; v != nil { + builder.WriteString("delete_time=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + if v := m.CreateBy; v != nil { + builder.WriteString("create_by=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := m.ParentID; v != nil { + builder.WriteString("parent_id=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := m.OrderNo; v != nil { + builder.WriteString("order_no=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := m.Name; v != nil { + builder.WriteString("name=") + builder.WriteString(*v) + } + builder.WriteString(", ") + if v := m.Title; v != nil { + builder.WriteString("title=") + builder.WriteString(*v) + } + builder.WriteString(", ") + if v := m.Type; v != nil { + builder.WriteString("type=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := m.Path; v != nil { + builder.WriteString("path=") + builder.WriteString(*v) + } + builder.WriteString(", ") + if v := m.Component; v != nil { + builder.WriteString("component=") + builder.WriteString(*v) + } + builder.WriteString(", ") + if v := m.Icon; v != nil { + builder.WriteString("icon=") + builder.WriteString(*v) + } + builder.WriteString(", ") + if v := m.IsExt; v != nil { + builder.WriteString("is_ext=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := m.ExtURL; v != nil { + builder.WriteString("ext_url=") + builder.WriteString(*v) + } + builder.WriteString(", ") + builder.WriteString("permissions=") + builder.WriteString(fmt.Sprintf("%v", m.Permissions)) + builder.WriteString(", ") + if v := m.Redirect; v != nil { + builder.WriteString("redirect=") + builder.WriteString(*v) + } + builder.WriteString(", ") + if v := m.CurrentActiveMenu; v != nil { + builder.WriteString("current_active_menu=") + builder.WriteString(*v) + } + builder.WriteString(", ") + if v := m.KeepAlive; v != nil { + builder.WriteString("keep_alive=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := m.Show; v != nil { + builder.WriteString("show=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := m.HideTab; v != nil { + builder.WriteString("hide_tab=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := m.HideMenu; v != nil { + builder.WriteString("hide_menu=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := m.HideBreadcrumb; v != nil { + builder.WriteString("hide_breadcrumb=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteByte(')') + return builder.String() +} + +// Menus is a parsable slice of Menu. +type Menus []*Menu diff --git a/monolithic/backend/app/admin/service/internal/data/ent/menu/menu.go b/monolithic/backend/app/admin/service/internal/data/ent/menu/menu.go new file mode 100644 index 0000000..69aa59a --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/menu/menu.go @@ -0,0 +1,355 @@ +// Code generated by ent, DO NOT EDIT. + +package menu + +import ( + "fmt" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +const ( + // Label holds the string label denoting the menu type in the database. + Label = "menu" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldStatus holds the string denoting the status field in the database. + FieldStatus = "status" + // FieldCreateTime holds the string denoting the create_time field in the database. + FieldCreateTime = "create_time" + // FieldUpdateTime holds the string denoting the update_time field in the database. + FieldUpdateTime = "update_time" + // FieldDeleteTime holds the string denoting the delete_time field in the database. + FieldDeleteTime = "delete_time" + // FieldCreateBy holds the string denoting the create_by field in the database. + FieldCreateBy = "create_by" + // FieldParentID holds the string denoting the parent_id field in the database. + FieldParentID = "parent_id" + // FieldOrderNo holds the string denoting the order_no field in the database. + FieldOrderNo = "order_no" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // FieldTitle holds the string denoting the title field in the database. + FieldTitle = "title" + // FieldType holds the string denoting the type field in the database. + FieldType = "type" + // FieldPath holds the string denoting the path field in the database. + FieldPath = "path" + // FieldComponent holds the string denoting the component field in the database. + FieldComponent = "component" + // FieldIcon holds the string denoting the icon field in the database. + FieldIcon = "icon" + // FieldIsExt holds the string denoting the is_ext field in the database. + FieldIsExt = "is_ext" + // FieldExtURL holds the string denoting the ext_url field in the database. + FieldExtURL = "ext_url" + // FieldPermissions holds the string denoting the permissions field in the database. + FieldPermissions = "permissions" + // FieldRedirect holds the string denoting the redirect field in the database. + FieldRedirect = "redirect" + // FieldCurrentActiveMenu holds the string denoting the current_active_menu field in the database. + FieldCurrentActiveMenu = "current_active_menu" + // FieldKeepAlive holds the string denoting the keep_alive field in the database. + FieldKeepAlive = "keep_alive" + // FieldShow holds the string denoting the show field in the database. + FieldShow = "show" + // FieldHideTab holds the string denoting the hide_tab field in the database. + FieldHideTab = "hide_tab" + // FieldHideMenu holds the string denoting the hide_menu field in the database. + FieldHideMenu = "hide_menu" + // FieldHideBreadcrumb holds the string denoting the hide_breadcrumb field in the database. + FieldHideBreadcrumb = "hide_breadcrumb" + // EdgeParent holds the string denoting the parent edge name in mutations. + EdgeParent = "parent" + // EdgeChildren holds the string denoting the children edge name in mutations. + EdgeChildren = "children" + // Table holds the table name of the menu in the database. + Table = "menu" + // ParentTable is the table that holds the parent relation/edge. + ParentTable = "menu" + // ParentColumn is the table column denoting the parent relation/edge. + ParentColumn = "parent_id" + // ChildrenTable is the table that holds the children relation/edge. + ChildrenTable = "menu" + // ChildrenColumn is the table column denoting the children relation/edge. + ChildrenColumn = "parent_id" +) + +// Columns holds all SQL columns for menu fields. +var Columns = []string{ + FieldID, + FieldStatus, + FieldCreateTime, + FieldUpdateTime, + FieldDeleteTime, + FieldCreateBy, + FieldParentID, + FieldOrderNo, + FieldName, + FieldTitle, + FieldType, + FieldPath, + FieldComponent, + FieldIcon, + FieldIsExt, + FieldExtURL, + FieldPermissions, + FieldRedirect, + FieldCurrentActiveMenu, + FieldKeepAlive, + FieldShow, + FieldHideTab, + FieldHideMenu, + FieldHideBreadcrumb, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +var ( + // DefaultOrderNo holds the default value on creation for the "order_no" field. + DefaultOrderNo int32 + // DefaultName holds the default value on creation for the "name" field. + DefaultName string + // NameValidator is a validator for the "name" field. It is called by the builders before save. + NameValidator func(string) error + // DefaultTitle holds the default value on creation for the "title" field. + DefaultTitle string + // TitleValidator is a validator for the "title" field. It is called by the builders before save. + TitleValidator func(string) error + // DefaultPath holds the default value on creation for the "path" field. + DefaultPath string + // DefaultComponent holds the default value on creation for the "component" field. + DefaultComponent string + // DefaultIcon holds the default value on creation for the "icon" field. + DefaultIcon string + // IconValidator is a validator for the "icon" field. It is called by the builders before save. + IconValidator func(string) error + // DefaultIsExt holds the default value on creation for the "is_ext" field. + DefaultIsExt bool + // ExtURLValidator is a validator for the "ext_url" field. It is called by the builders before save. + ExtURLValidator func(string) error + // DefaultKeepAlive holds the default value on creation for the "keep_alive" field. + DefaultKeepAlive bool + // DefaultShow holds the default value on creation for the "show" field. + DefaultShow bool + // DefaultHideTab holds the default value on creation for the "hide_tab" field. + DefaultHideTab bool + // DefaultHideMenu holds the default value on creation for the "hide_menu" field. + DefaultHideMenu bool + // DefaultHideBreadcrumb holds the default value on creation for the "hide_breadcrumb" field. + DefaultHideBreadcrumb bool + // IDValidator is a validator for the "id" field. It is called by the builders before save. + IDValidator func(int32) error +) + +// Status defines the type for the "status" enum field. +type Status string + +// StatusON is the default value of the Status enum. +const DefaultStatus = StatusON + +// Status values. +const ( + StatusOFF Status = "OFF" + StatusON Status = "ON" +) + +func (s Status) String() string { + return string(s) +} + +// StatusValidator is a validator for the "status" field enum values. It is called by the builders before save. +func StatusValidator(s Status) error { + switch s { + case StatusOFF, StatusON: + return nil + default: + return fmt.Errorf("menu: invalid enum value for status field: %q", s) + } +} + +// Type defines the type for the "type" enum field. +type Type string + +// Type values. +const ( + TypeFOLDER Type = "FOLDER" + TypeMENU Type = "MENU" + TypeBUTTON Type = "BUTTON" +) + +func (_type Type) String() string { + return string(_type) +} + +// TypeValidator is a validator for the "type" field enum values. It is called by the builders before save. +func TypeValidator(_type Type) error { + switch _type { + case TypeFOLDER, TypeMENU, TypeBUTTON: + return nil + default: + return fmt.Errorf("menu: invalid enum value for type field: %q", _type) + } +} + +// OrderOption defines the ordering options for the Menu queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByStatus orders the results by the status field. +func ByStatus(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldStatus, opts...).ToFunc() +} + +// ByCreateTime orders the results by the create_time field. +func ByCreateTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreateTime, opts...).ToFunc() +} + +// ByUpdateTime orders the results by the update_time field. +func ByUpdateTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdateTime, opts...).ToFunc() +} + +// ByDeleteTime orders the results by the delete_time field. +func ByDeleteTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeleteTime, opts...).ToFunc() +} + +// ByCreateBy orders the results by the create_by field. +func ByCreateBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreateBy, opts...).ToFunc() +} + +// ByParentID orders the results by the parent_id field. +func ByParentID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldParentID, opts...).ToFunc() +} + +// ByOrderNo orders the results by the order_no field. +func ByOrderNo(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOrderNo, opts...).ToFunc() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +// ByTitle orders the results by the title field. +func ByTitle(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldTitle, opts...).ToFunc() +} + +// ByType orders the results by the type field. +func ByType(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldType, opts...).ToFunc() +} + +// ByPath orders the results by the path field. +func ByPath(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldPath, opts...).ToFunc() +} + +// ByComponent orders the results by the component field. +func ByComponent(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldComponent, opts...).ToFunc() +} + +// ByIcon orders the results by the icon field. +func ByIcon(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldIcon, opts...).ToFunc() +} + +// ByIsExt orders the results by the is_ext field. +func ByIsExt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldIsExt, opts...).ToFunc() +} + +// ByExtURL orders the results by the ext_url field. +func ByExtURL(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldExtURL, opts...).ToFunc() +} + +// ByRedirect orders the results by the redirect field. +func ByRedirect(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRedirect, opts...).ToFunc() +} + +// ByCurrentActiveMenu orders the results by the current_active_menu field. +func ByCurrentActiveMenu(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCurrentActiveMenu, opts...).ToFunc() +} + +// ByKeepAlive orders the results by the keep_alive field. +func ByKeepAlive(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldKeepAlive, opts...).ToFunc() +} + +// ByShow orders the results by the show field. +func ByShow(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldShow, opts...).ToFunc() +} + +// ByHideTab orders the results by the hide_tab field. +func ByHideTab(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldHideTab, opts...).ToFunc() +} + +// ByHideMenu orders the results by the hide_menu field. +func ByHideMenu(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldHideMenu, opts...).ToFunc() +} + +// ByHideBreadcrumb orders the results by the hide_breadcrumb field. +func ByHideBreadcrumb(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldHideBreadcrumb, opts...).ToFunc() +} + +// ByParentField orders the results by parent field. +func ByParentField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newParentStep(), sql.OrderByField(field, opts...)) + } +} + +// ByChildrenCount orders the results by children count. +func ByChildrenCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newChildrenStep(), opts...) + } +} + +// ByChildren orders the results by children terms. +func ByChildren(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newChildrenStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} +func newParentStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, ParentTable, ParentColumn), + ) +} +func newChildrenStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, ChildrenTable, ChildrenColumn), + ) +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/menu/where.go b/monolithic/backend/app/admin/service/internal/data/ent/menu/where.go new file mode 100644 index 0000000..854949a --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/menu/where.go @@ -0,0 +1,1287 @@ +// Code generated by ent, DO NOT EDIT. + +package menu + +import ( + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +// ID filters vertices based on their ID field. +func ID(id int32) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id int32) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id int32) predicate.Menu { + return predicate.Menu(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...int32) predicate.Menu { + return predicate.Menu(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...int32) predicate.Menu { + return predicate.Menu(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id int32) predicate.Menu { + return predicate.Menu(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id int32) predicate.Menu { + return predicate.Menu(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id int32) predicate.Menu { + return predicate.Menu(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id int32) predicate.Menu { + return predicate.Menu(sql.FieldLTE(FieldID, id)) +} + +// CreateTime applies equality check predicate on the "create_time" field. It's identical to CreateTimeEQ. +func CreateTime(v time.Time) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldCreateTime, v)) +} + +// UpdateTime applies equality check predicate on the "update_time" field. It's identical to UpdateTimeEQ. +func UpdateTime(v time.Time) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldUpdateTime, v)) +} + +// DeleteTime applies equality check predicate on the "delete_time" field. It's identical to DeleteTimeEQ. +func DeleteTime(v time.Time) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldDeleteTime, v)) +} + +// CreateBy applies equality check predicate on the "create_by" field. It's identical to CreateByEQ. +func CreateBy(v uint32) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldCreateBy, v)) +} + +// ParentID applies equality check predicate on the "parent_id" field. It's identical to ParentIDEQ. +func ParentID(v int32) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldParentID, v)) +} + +// OrderNo applies equality check predicate on the "order_no" field. It's identical to OrderNoEQ. +func OrderNo(v int32) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldOrderNo, v)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldName, v)) +} + +// Title applies equality check predicate on the "title" field. It's identical to TitleEQ. +func Title(v string) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldTitle, v)) +} + +// Path applies equality check predicate on the "path" field. It's identical to PathEQ. +func Path(v string) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldPath, v)) +} + +// Component applies equality check predicate on the "component" field. It's identical to ComponentEQ. +func Component(v string) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldComponent, v)) +} + +// Icon applies equality check predicate on the "icon" field. It's identical to IconEQ. +func Icon(v string) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldIcon, v)) +} + +// IsExt applies equality check predicate on the "is_ext" field. It's identical to IsExtEQ. +func IsExt(v bool) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldIsExt, v)) +} + +// ExtURL applies equality check predicate on the "ext_url" field. It's identical to ExtURLEQ. +func ExtURL(v string) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldExtURL, v)) +} + +// Redirect applies equality check predicate on the "redirect" field. It's identical to RedirectEQ. +func Redirect(v string) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldRedirect, v)) +} + +// CurrentActiveMenu applies equality check predicate on the "current_active_menu" field. It's identical to CurrentActiveMenuEQ. +func CurrentActiveMenu(v string) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldCurrentActiveMenu, v)) +} + +// KeepAlive applies equality check predicate on the "keep_alive" field. It's identical to KeepAliveEQ. +func KeepAlive(v bool) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldKeepAlive, v)) +} + +// Show applies equality check predicate on the "show" field. It's identical to ShowEQ. +func Show(v bool) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldShow, v)) +} + +// HideTab applies equality check predicate on the "hide_tab" field. It's identical to HideTabEQ. +func HideTab(v bool) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldHideTab, v)) +} + +// HideMenu applies equality check predicate on the "hide_menu" field. It's identical to HideMenuEQ. +func HideMenu(v bool) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldHideMenu, v)) +} + +// HideBreadcrumb applies equality check predicate on the "hide_breadcrumb" field. It's identical to HideBreadcrumbEQ. +func HideBreadcrumb(v bool) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldHideBreadcrumb, v)) +} + +// StatusEQ applies the EQ predicate on the "status" field. +func StatusEQ(v Status) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldStatus, v)) +} + +// StatusNEQ applies the NEQ predicate on the "status" field. +func StatusNEQ(v Status) predicate.Menu { + return predicate.Menu(sql.FieldNEQ(FieldStatus, v)) +} + +// StatusIn applies the In predicate on the "status" field. +func StatusIn(vs ...Status) predicate.Menu { + return predicate.Menu(sql.FieldIn(FieldStatus, vs...)) +} + +// StatusNotIn applies the NotIn predicate on the "status" field. +func StatusNotIn(vs ...Status) predicate.Menu { + return predicate.Menu(sql.FieldNotIn(FieldStatus, vs...)) +} + +// StatusIsNil applies the IsNil predicate on the "status" field. +func StatusIsNil() predicate.Menu { + return predicate.Menu(sql.FieldIsNull(FieldStatus)) +} + +// StatusNotNil applies the NotNil predicate on the "status" field. +func StatusNotNil() predicate.Menu { + return predicate.Menu(sql.FieldNotNull(FieldStatus)) +} + +// CreateTimeEQ applies the EQ predicate on the "create_time" field. +func CreateTimeEQ(v time.Time) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldCreateTime, v)) +} + +// CreateTimeNEQ applies the NEQ predicate on the "create_time" field. +func CreateTimeNEQ(v time.Time) predicate.Menu { + return predicate.Menu(sql.FieldNEQ(FieldCreateTime, v)) +} + +// CreateTimeIn applies the In predicate on the "create_time" field. +func CreateTimeIn(vs ...time.Time) predicate.Menu { + return predicate.Menu(sql.FieldIn(FieldCreateTime, vs...)) +} + +// CreateTimeNotIn applies the NotIn predicate on the "create_time" field. +func CreateTimeNotIn(vs ...time.Time) predicate.Menu { + return predicate.Menu(sql.FieldNotIn(FieldCreateTime, vs...)) +} + +// CreateTimeGT applies the GT predicate on the "create_time" field. +func CreateTimeGT(v time.Time) predicate.Menu { + return predicate.Menu(sql.FieldGT(FieldCreateTime, v)) +} + +// CreateTimeGTE applies the GTE predicate on the "create_time" field. +func CreateTimeGTE(v time.Time) predicate.Menu { + return predicate.Menu(sql.FieldGTE(FieldCreateTime, v)) +} + +// CreateTimeLT applies the LT predicate on the "create_time" field. +func CreateTimeLT(v time.Time) predicate.Menu { + return predicate.Menu(sql.FieldLT(FieldCreateTime, v)) +} + +// CreateTimeLTE applies the LTE predicate on the "create_time" field. +func CreateTimeLTE(v time.Time) predicate.Menu { + return predicate.Menu(sql.FieldLTE(FieldCreateTime, v)) +} + +// CreateTimeIsNil applies the IsNil predicate on the "create_time" field. +func CreateTimeIsNil() predicate.Menu { + return predicate.Menu(sql.FieldIsNull(FieldCreateTime)) +} + +// CreateTimeNotNil applies the NotNil predicate on the "create_time" field. +func CreateTimeNotNil() predicate.Menu { + return predicate.Menu(sql.FieldNotNull(FieldCreateTime)) +} + +// UpdateTimeEQ applies the EQ predicate on the "update_time" field. +func UpdateTimeEQ(v time.Time) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldUpdateTime, v)) +} + +// UpdateTimeNEQ applies the NEQ predicate on the "update_time" field. +func UpdateTimeNEQ(v time.Time) predicate.Menu { + return predicate.Menu(sql.FieldNEQ(FieldUpdateTime, v)) +} + +// UpdateTimeIn applies the In predicate on the "update_time" field. +func UpdateTimeIn(vs ...time.Time) predicate.Menu { + return predicate.Menu(sql.FieldIn(FieldUpdateTime, vs...)) +} + +// UpdateTimeNotIn applies the NotIn predicate on the "update_time" field. +func UpdateTimeNotIn(vs ...time.Time) predicate.Menu { + return predicate.Menu(sql.FieldNotIn(FieldUpdateTime, vs...)) +} + +// UpdateTimeGT applies the GT predicate on the "update_time" field. +func UpdateTimeGT(v time.Time) predicate.Menu { + return predicate.Menu(sql.FieldGT(FieldUpdateTime, v)) +} + +// UpdateTimeGTE applies the GTE predicate on the "update_time" field. +func UpdateTimeGTE(v time.Time) predicate.Menu { + return predicate.Menu(sql.FieldGTE(FieldUpdateTime, v)) +} + +// UpdateTimeLT applies the LT predicate on the "update_time" field. +func UpdateTimeLT(v time.Time) predicate.Menu { + return predicate.Menu(sql.FieldLT(FieldUpdateTime, v)) +} + +// UpdateTimeLTE applies the LTE predicate on the "update_time" field. +func UpdateTimeLTE(v time.Time) predicate.Menu { + return predicate.Menu(sql.FieldLTE(FieldUpdateTime, v)) +} + +// UpdateTimeIsNil applies the IsNil predicate on the "update_time" field. +func UpdateTimeIsNil() predicate.Menu { + return predicate.Menu(sql.FieldIsNull(FieldUpdateTime)) +} + +// UpdateTimeNotNil applies the NotNil predicate on the "update_time" field. +func UpdateTimeNotNil() predicate.Menu { + return predicate.Menu(sql.FieldNotNull(FieldUpdateTime)) +} + +// DeleteTimeEQ applies the EQ predicate on the "delete_time" field. +func DeleteTimeEQ(v time.Time) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldDeleteTime, v)) +} + +// DeleteTimeNEQ applies the NEQ predicate on the "delete_time" field. +func DeleteTimeNEQ(v time.Time) predicate.Menu { + return predicate.Menu(sql.FieldNEQ(FieldDeleteTime, v)) +} + +// DeleteTimeIn applies the In predicate on the "delete_time" field. +func DeleteTimeIn(vs ...time.Time) predicate.Menu { + return predicate.Menu(sql.FieldIn(FieldDeleteTime, vs...)) +} + +// DeleteTimeNotIn applies the NotIn predicate on the "delete_time" field. +func DeleteTimeNotIn(vs ...time.Time) predicate.Menu { + return predicate.Menu(sql.FieldNotIn(FieldDeleteTime, vs...)) +} + +// DeleteTimeGT applies the GT predicate on the "delete_time" field. +func DeleteTimeGT(v time.Time) predicate.Menu { + return predicate.Menu(sql.FieldGT(FieldDeleteTime, v)) +} + +// DeleteTimeGTE applies the GTE predicate on the "delete_time" field. +func DeleteTimeGTE(v time.Time) predicate.Menu { + return predicate.Menu(sql.FieldGTE(FieldDeleteTime, v)) +} + +// DeleteTimeLT applies the LT predicate on the "delete_time" field. +func DeleteTimeLT(v time.Time) predicate.Menu { + return predicate.Menu(sql.FieldLT(FieldDeleteTime, v)) +} + +// DeleteTimeLTE applies the LTE predicate on the "delete_time" field. +func DeleteTimeLTE(v time.Time) predicate.Menu { + return predicate.Menu(sql.FieldLTE(FieldDeleteTime, v)) +} + +// DeleteTimeIsNil applies the IsNil predicate on the "delete_time" field. +func DeleteTimeIsNil() predicate.Menu { + return predicate.Menu(sql.FieldIsNull(FieldDeleteTime)) +} + +// DeleteTimeNotNil applies the NotNil predicate on the "delete_time" field. +func DeleteTimeNotNil() predicate.Menu { + return predicate.Menu(sql.FieldNotNull(FieldDeleteTime)) +} + +// CreateByEQ applies the EQ predicate on the "create_by" field. +func CreateByEQ(v uint32) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldCreateBy, v)) +} + +// CreateByNEQ applies the NEQ predicate on the "create_by" field. +func CreateByNEQ(v uint32) predicate.Menu { + return predicate.Menu(sql.FieldNEQ(FieldCreateBy, v)) +} + +// CreateByIn applies the In predicate on the "create_by" field. +func CreateByIn(vs ...uint32) predicate.Menu { + return predicate.Menu(sql.FieldIn(FieldCreateBy, vs...)) +} + +// CreateByNotIn applies the NotIn predicate on the "create_by" field. +func CreateByNotIn(vs ...uint32) predicate.Menu { + return predicate.Menu(sql.FieldNotIn(FieldCreateBy, vs...)) +} + +// CreateByGT applies the GT predicate on the "create_by" field. +func CreateByGT(v uint32) predicate.Menu { + return predicate.Menu(sql.FieldGT(FieldCreateBy, v)) +} + +// CreateByGTE applies the GTE predicate on the "create_by" field. +func CreateByGTE(v uint32) predicate.Menu { + return predicate.Menu(sql.FieldGTE(FieldCreateBy, v)) +} + +// CreateByLT applies the LT predicate on the "create_by" field. +func CreateByLT(v uint32) predicate.Menu { + return predicate.Menu(sql.FieldLT(FieldCreateBy, v)) +} + +// CreateByLTE applies the LTE predicate on the "create_by" field. +func CreateByLTE(v uint32) predicate.Menu { + return predicate.Menu(sql.FieldLTE(FieldCreateBy, v)) +} + +// CreateByIsNil applies the IsNil predicate on the "create_by" field. +func CreateByIsNil() predicate.Menu { + return predicate.Menu(sql.FieldIsNull(FieldCreateBy)) +} + +// CreateByNotNil applies the NotNil predicate on the "create_by" field. +func CreateByNotNil() predicate.Menu { + return predicate.Menu(sql.FieldNotNull(FieldCreateBy)) +} + +// ParentIDEQ applies the EQ predicate on the "parent_id" field. +func ParentIDEQ(v int32) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldParentID, v)) +} + +// ParentIDNEQ applies the NEQ predicate on the "parent_id" field. +func ParentIDNEQ(v int32) predicate.Menu { + return predicate.Menu(sql.FieldNEQ(FieldParentID, v)) +} + +// ParentIDIn applies the In predicate on the "parent_id" field. +func ParentIDIn(vs ...int32) predicate.Menu { + return predicate.Menu(sql.FieldIn(FieldParentID, vs...)) +} + +// ParentIDNotIn applies the NotIn predicate on the "parent_id" field. +func ParentIDNotIn(vs ...int32) predicate.Menu { + return predicate.Menu(sql.FieldNotIn(FieldParentID, vs...)) +} + +// ParentIDIsNil applies the IsNil predicate on the "parent_id" field. +func ParentIDIsNil() predicate.Menu { + return predicate.Menu(sql.FieldIsNull(FieldParentID)) +} + +// ParentIDNotNil applies the NotNil predicate on the "parent_id" field. +func ParentIDNotNil() predicate.Menu { + return predicate.Menu(sql.FieldNotNull(FieldParentID)) +} + +// OrderNoEQ applies the EQ predicate on the "order_no" field. +func OrderNoEQ(v int32) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldOrderNo, v)) +} + +// OrderNoNEQ applies the NEQ predicate on the "order_no" field. +func OrderNoNEQ(v int32) predicate.Menu { + return predicate.Menu(sql.FieldNEQ(FieldOrderNo, v)) +} + +// OrderNoIn applies the In predicate on the "order_no" field. +func OrderNoIn(vs ...int32) predicate.Menu { + return predicate.Menu(sql.FieldIn(FieldOrderNo, vs...)) +} + +// OrderNoNotIn applies the NotIn predicate on the "order_no" field. +func OrderNoNotIn(vs ...int32) predicate.Menu { + return predicate.Menu(sql.FieldNotIn(FieldOrderNo, vs...)) +} + +// OrderNoGT applies the GT predicate on the "order_no" field. +func OrderNoGT(v int32) predicate.Menu { + return predicate.Menu(sql.FieldGT(FieldOrderNo, v)) +} + +// OrderNoGTE applies the GTE predicate on the "order_no" field. +func OrderNoGTE(v int32) predicate.Menu { + return predicate.Menu(sql.FieldGTE(FieldOrderNo, v)) +} + +// OrderNoLT applies the LT predicate on the "order_no" field. +func OrderNoLT(v int32) predicate.Menu { + return predicate.Menu(sql.FieldLT(FieldOrderNo, v)) +} + +// OrderNoLTE applies the LTE predicate on the "order_no" field. +func OrderNoLTE(v int32) predicate.Menu { + return predicate.Menu(sql.FieldLTE(FieldOrderNo, v)) +} + +// OrderNoIsNil applies the IsNil predicate on the "order_no" field. +func OrderNoIsNil() predicate.Menu { + return predicate.Menu(sql.FieldIsNull(FieldOrderNo)) +} + +// OrderNoNotNil applies the NotNil predicate on the "order_no" field. +func OrderNoNotNil() predicate.Menu { + return predicate.Menu(sql.FieldNotNull(FieldOrderNo)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.Menu { + return predicate.Menu(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.Menu { + return predicate.Menu(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.Menu { + return predicate.Menu(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.Menu { + return predicate.Menu(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.Menu { + return predicate.Menu(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.Menu { + return predicate.Menu(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.Menu { + return predicate.Menu(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.Menu { + return predicate.Menu(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.Menu { + return predicate.Menu(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.Menu { + return predicate.Menu(sql.FieldHasSuffix(FieldName, v)) +} + +// NameIsNil applies the IsNil predicate on the "name" field. +func NameIsNil() predicate.Menu { + return predicate.Menu(sql.FieldIsNull(FieldName)) +} + +// NameNotNil applies the NotNil predicate on the "name" field. +func NameNotNil() predicate.Menu { + return predicate.Menu(sql.FieldNotNull(FieldName)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.Menu { + return predicate.Menu(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.Menu { + return predicate.Menu(sql.FieldContainsFold(FieldName, v)) +} + +// TitleEQ applies the EQ predicate on the "title" field. +func TitleEQ(v string) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldTitle, v)) +} + +// TitleNEQ applies the NEQ predicate on the "title" field. +func TitleNEQ(v string) predicate.Menu { + return predicate.Menu(sql.FieldNEQ(FieldTitle, v)) +} + +// TitleIn applies the In predicate on the "title" field. +func TitleIn(vs ...string) predicate.Menu { + return predicate.Menu(sql.FieldIn(FieldTitle, vs...)) +} + +// TitleNotIn applies the NotIn predicate on the "title" field. +func TitleNotIn(vs ...string) predicate.Menu { + return predicate.Menu(sql.FieldNotIn(FieldTitle, vs...)) +} + +// TitleGT applies the GT predicate on the "title" field. +func TitleGT(v string) predicate.Menu { + return predicate.Menu(sql.FieldGT(FieldTitle, v)) +} + +// TitleGTE applies the GTE predicate on the "title" field. +func TitleGTE(v string) predicate.Menu { + return predicate.Menu(sql.FieldGTE(FieldTitle, v)) +} + +// TitleLT applies the LT predicate on the "title" field. +func TitleLT(v string) predicate.Menu { + return predicate.Menu(sql.FieldLT(FieldTitle, v)) +} + +// TitleLTE applies the LTE predicate on the "title" field. +func TitleLTE(v string) predicate.Menu { + return predicate.Menu(sql.FieldLTE(FieldTitle, v)) +} + +// TitleContains applies the Contains predicate on the "title" field. +func TitleContains(v string) predicate.Menu { + return predicate.Menu(sql.FieldContains(FieldTitle, v)) +} + +// TitleHasPrefix applies the HasPrefix predicate on the "title" field. +func TitleHasPrefix(v string) predicate.Menu { + return predicate.Menu(sql.FieldHasPrefix(FieldTitle, v)) +} + +// TitleHasSuffix applies the HasSuffix predicate on the "title" field. +func TitleHasSuffix(v string) predicate.Menu { + return predicate.Menu(sql.FieldHasSuffix(FieldTitle, v)) +} + +// TitleIsNil applies the IsNil predicate on the "title" field. +func TitleIsNil() predicate.Menu { + return predicate.Menu(sql.FieldIsNull(FieldTitle)) +} + +// TitleNotNil applies the NotNil predicate on the "title" field. +func TitleNotNil() predicate.Menu { + return predicate.Menu(sql.FieldNotNull(FieldTitle)) +} + +// TitleEqualFold applies the EqualFold predicate on the "title" field. +func TitleEqualFold(v string) predicate.Menu { + return predicate.Menu(sql.FieldEqualFold(FieldTitle, v)) +} + +// TitleContainsFold applies the ContainsFold predicate on the "title" field. +func TitleContainsFold(v string) predicate.Menu { + return predicate.Menu(sql.FieldContainsFold(FieldTitle, v)) +} + +// TypeEQ applies the EQ predicate on the "type" field. +func TypeEQ(v Type) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldType, v)) +} + +// TypeNEQ applies the NEQ predicate on the "type" field. +func TypeNEQ(v Type) predicate.Menu { + return predicate.Menu(sql.FieldNEQ(FieldType, v)) +} + +// TypeIn applies the In predicate on the "type" field. +func TypeIn(vs ...Type) predicate.Menu { + return predicate.Menu(sql.FieldIn(FieldType, vs...)) +} + +// TypeNotIn applies the NotIn predicate on the "type" field. +func TypeNotIn(vs ...Type) predicate.Menu { + return predicate.Menu(sql.FieldNotIn(FieldType, vs...)) +} + +// TypeIsNil applies the IsNil predicate on the "type" field. +func TypeIsNil() predicate.Menu { + return predicate.Menu(sql.FieldIsNull(FieldType)) +} + +// TypeNotNil applies the NotNil predicate on the "type" field. +func TypeNotNil() predicate.Menu { + return predicate.Menu(sql.FieldNotNull(FieldType)) +} + +// PathEQ applies the EQ predicate on the "path" field. +func PathEQ(v string) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldPath, v)) +} + +// PathNEQ applies the NEQ predicate on the "path" field. +func PathNEQ(v string) predicate.Menu { + return predicate.Menu(sql.FieldNEQ(FieldPath, v)) +} + +// PathIn applies the In predicate on the "path" field. +func PathIn(vs ...string) predicate.Menu { + return predicate.Menu(sql.FieldIn(FieldPath, vs...)) +} + +// PathNotIn applies the NotIn predicate on the "path" field. +func PathNotIn(vs ...string) predicate.Menu { + return predicate.Menu(sql.FieldNotIn(FieldPath, vs...)) +} + +// PathGT applies the GT predicate on the "path" field. +func PathGT(v string) predicate.Menu { + return predicate.Menu(sql.FieldGT(FieldPath, v)) +} + +// PathGTE applies the GTE predicate on the "path" field. +func PathGTE(v string) predicate.Menu { + return predicate.Menu(sql.FieldGTE(FieldPath, v)) +} + +// PathLT applies the LT predicate on the "path" field. +func PathLT(v string) predicate.Menu { + return predicate.Menu(sql.FieldLT(FieldPath, v)) +} + +// PathLTE applies the LTE predicate on the "path" field. +func PathLTE(v string) predicate.Menu { + return predicate.Menu(sql.FieldLTE(FieldPath, v)) +} + +// PathContains applies the Contains predicate on the "path" field. +func PathContains(v string) predicate.Menu { + return predicate.Menu(sql.FieldContains(FieldPath, v)) +} + +// PathHasPrefix applies the HasPrefix predicate on the "path" field. +func PathHasPrefix(v string) predicate.Menu { + return predicate.Menu(sql.FieldHasPrefix(FieldPath, v)) +} + +// PathHasSuffix applies the HasSuffix predicate on the "path" field. +func PathHasSuffix(v string) predicate.Menu { + return predicate.Menu(sql.FieldHasSuffix(FieldPath, v)) +} + +// PathIsNil applies the IsNil predicate on the "path" field. +func PathIsNil() predicate.Menu { + return predicate.Menu(sql.FieldIsNull(FieldPath)) +} + +// PathNotNil applies the NotNil predicate on the "path" field. +func PathNotNil() predicate.Menu { + return predicate.Menu(sql.FieldNotNull(FieldPath)) +} + +// PathEqualFold applies the EqualFold predicate on the "path" field. +func PathEqualFold(v string) predicate.Menu { + return predicate.Menu(sql.FieldEqualFold(FieldPath, v)) +} + +// PathContainsFold applies the ContainsFold predicate on the "path" field. +func PathContainsFold(v string) predicate.Menu { + return predicate.Menu(sql.FieldContainsFold(FieldPath, v)) +} + +// ComponentEQ applies the EQ predicate on the "component" field. +func ComponentEQ(v string) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldComponent, v)) +} + +// ComponentNEQ applies the NEQ predicate on the "component" field. +func ComponentNEQ(v string) predicate.Menu { + return predicate.Menu(sql.FieldNEQ(FieldComponent, v)) +} + +// ComponentIn applies the In predicate on the "component" field. +func ComponentIn(vs ...string) predicate.Menu { + return predicate.Menu(sql.FieldIn(FieldComponent, vs...)) +} + +// ComponentNotIn applies the NotIn predicate on the "component" field. +func ComponentNotIn(vs ...string) predicate.Menu { + return predicate.Menu(sql.FieldNotIn(FieldComponent, vs...)) +} + +// ComponentGT applies the GT predicate on the "component" field. +func ComponentGT(v string) predicate.Menu { + return predicate.Menu(sql.FieldGT(FieldComponent, v)) +} + +// ComponentGTE applies the GTE predicate on the "component" field. +func ComponentGTE(v string) predicate.Menu { + return predicate.Menu(sql.FieldGTE(FieldComponent, v)) +} + +// ComponentLT applies the LT predicate on the "component" field. +func ComponentLT(v string) predicate.Menu { + return predicate.Menu(sql.FieldLT(FieldComponent, v)) +} + +// ComponentLTE applies the LTE predicate on the "component" field. +func ComponentLTE(v string) predicate.Menu { + return predicate.Menu(sql.FieldLTE(FieldComponent, v)) +} + +// ComponentContains applies the Contains predicate on the "component" field. +func ComponentContains(v string) predicate.Menu { + return predicate.Menu(sql.FieldContains(FieldComponent, v)) +} + +// ComponentHasPrefix applies the HasPrefix predicate on the "component" field. +func ComponentHasPrefix(v string) predicate.Menu { + return predicate.Menu(sql.FieldHasPrefix(FieldComponent, v)) +} + +// ComponentHasSuffix applies the HasSuffix predicate on the "component" field. +func ComponentHasSuffix(v string) predicate.Menu { + return predicate.Menu(sql.FieldHasSuffix(FieldComponent, v)) +} + +// ComponentIsNil applies the IsNil predicate on the "component" field. +func ComponentIsNil() predicate.Menu { + return predicate.Menu(sql.FieldIsNull(FieldComponent)) +} + +// ComponentNotNil applies the NotNil predicate on the "component" field. +func ComponentNotNil() predicate.Menu { + return predicate.Menu(sql.FieldNotNull(FieldComponent)) +} + +// ComponentEqualFold applies the EqualFold predicate on the "component" field. +func ComponentEqualFold(v string) predicate.Menu { + return predicate.Menu(sql.FieldEqualFold(FieldComponent, v)) +} + +// ComponentContainsFold applies the ContainsFold predicate on the "component" field. +func ComponentContainsFold(v string) predicate.Menu { + return predicate.Menu(sql.FieldContainsFold(FieldComponent, v)) +} + +// IconEQ applies the EQ predicate on the "icon" field. +func IconEQ(v string) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldIcon, v)) +} + +// IconNEQ applies the NEQ predicate on the "icon" field. +func IconNEQ(v string) predicate.Menu { + return predicate.Menu(sql.FieldNEQ(FieldIcon, v)) +} + +// IconIn applies the In predicate on the "icon" field. +func IconIn(vs ...string) predicate.Menu { + return predicate.Menu(sql.FieldIn(FieldIcon, vs...)) +} + +// IconNotIn applies the NotIn predicate on the "icon" field. +func IconNotIn(vs ...string) predicate.Menu { + return predicate.Menu(sql.FieldNotIn(FieldIcon, vs...)) +} + +// IconGT applies the GT predicate on the "icon" field. +func IconGT(v string) predicate.Menu { + return predicate.Menu(sql.FieldGT(FieldIcon, v)) +} + +// IconGTE applies the GTE predicate on the "icon" field. +func IconGTE(v string) predicate.Menu { + return predicate.Menu(sql.FieldGTE(FieldIcon, v)) +} + +// IconLT applies the LT predicate on the "icon" field. +func IconLT(v string) predicate.Menu { + return predicate.Menu(sql.FieldLT(FieldIcon, v)) +} + +// IconLTE applies the LTE predicate on the "icon" field. +func IconLTE(v string) predicate.Menu { + return predicate.Menu(sql.FieldLTE(FieldIcon, v)) +} + +// IconContains applies the Contains predicate on the "icon" field. +func IconContains(v string) predicate.Menu { + return predicate.Menu(sql.FieldContains(FieldIcon, v)) +} + +// IconHasPrefix applies the HasPrefix predicate on the "icon" field. +func IconHasPrefix(v string) predicate.Menu { + return predicate.Menu(sql.FieldHasPrefix(FieldIcon, v)) +} + +// IconHasSuffix applies the HasSuffix predicate on the "icon" field. +func IconHasSuffix(v string) predicate.Menu { + return predicate.Menu(sql.FieldHasSuffix(FieldIcon, v)) +} + +// IconIsNil applies the IsNil predicate on the "icon" field. +func IconIsNil() predicate.Menu { + return predicate.Menu(sql.FieldIsNull(FieldIcon)) +} + +// IconNotNil applies the NotNil predicate on the "icon" field. +func IconNotNil() predicate.Menu { + return predicate.Menu(sql.FieldNotNull(FieldIcon)) +} + +// IconEqualFold applies the EqualFold predicate on the "icon" field. +func IconEqualFold(v string) predicate.Menu { + return predicate.Menu(sql.FieldEqualFold(FieldIcon, v)) +} + +// IconContainsFold applies the ContainsFold predicate on the "icon" field. +func IconContainsFold(v string) predicate.Menu { + return predicate.Menu(sql.FieldContainsFold(FieldIcon, v)) +} + +// IsExtEQ applies the EQ predicate on the "is_ext" field. +func IsExtEQ(v bool) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldIsExt, v)) +} + +// IsExtNEQ applies the NEQ predicate on the "is_ext" field. +func IsExtNEQ(v bool) predicate.Menu { + return predicate.Menu(sql.FieldNEQ(FieldIsExt, v)) +} + +// IsExtIsNil applies the IsNil predicate on the "is_ext" field. +func IsExtIsNil() predicate.Menu { + return predicate.Menu(sql.FieldIsNull(FieldIsExt)) +} + +// IsExtNotNil applies the NotNil predicate on the "is_ext" field. +func IsExtNotNil() predicate.Menu { + return predicate.Menu(sql.FieldNotNull(FieldIsExt)) +} + +// ExtURLEQ applies the EQ predicate on the "ext_url" field. +func ExtURLEQ(v string) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldExtURL, v)) +} + +// ExtURLNEQ applies the NEQ predicate on the "ext_url" field. +func ExtURLNEQ(v string) predicate.Menu { + return predicate.Menu(sql.FieldNEQ(FieldExtURL, v)) +} + +// ExtURLIn applies the In predicate on the "ext_url" field. +func ExtURLIn(vs ...string) predicate.Menu { + return predicate.Menu(sql.FieldIn(FieldExtURL, vs...)) +} + +// ExtURLNotIn applies the NotIn predicate on the "ext_url" field. +func ExtURLNotIn(vs ...string) predicate.Menu { + return predicate.Menu(sql.FieldNotIn(FieldExtURL, vs...)) +} + +// ExtURLGT applies the GT predicate on the "ext_url" field. +func ExtURLGT(v string) predicate.Menu { + return predicate.Menu(sql.FieldGT(FieldExtURL, v)) +} + +// ExtURLGTE applies the GTE predicate on the "ext_url" field. +func ExtURLGTE(v string) predicate.Menu { + return predicate.Menu(sql.FieldGTE(FieldExtURL, v)) +} + +// ExtURLLT applies the LT predicate on the "ext_url" field. +func ExtURLLT(v string) predicate.Menu { + return predicate.Menu(sql.FieldLT(FieldExtURL, v)) +} + +// ExtURLLTE applies the LTE predicate on the "ext_url" field. +func ExtURLLTE(v string) predicate.Menu { + return predicate.Menu(sql.FieldLTE(FieldExtURL, v)) +} + +// ExtURLContains applies the Contains predicate on the "ext_url" field. +func ExtURLContains(v string) predicate.Menu { + return predicate.Menu(sql.FieldContains(FieldExtURL, v)) +} + +// ExtURLHasPrefix applies the HasPrefix predicate on the "ext_url" field. +func ExtURLHasPrefix(v string) predicate.Menu { + return predicate.Menu(sql.FieldHasPrefix(FieldExtURL, v)) +} + +// ExtURLHasSuffix applies the HasSuffix predicate on the "ext_url" field. +func ExtURLHasSuffix(v string) predicate.Menu { + return predicate.Menu(sql.FieldHasSuffix(FieldExtURL, v)) +} + +// ExtURLIsNil applies the IsNil predicate on the "ext_url" field. +func ExtURLIsNil() predicate.Menu { + return predicate.Menu(sql.FieldIsNull(FieldExtURL)) +} + +// ExtURLNotNil applies the NotNil predicate on the "ext_url" field. +func ExtURLNotNil() predicate.Menu { + return predicate.Menu(sql.FieldNotNull(FieldExtURL)) +} + +// ExtURLEqualFold applies the EqualFold predicate on the "ext_url" field. +func ExtURLEqualFold(v string) predicate.Menu { + return predicate.Menu(sql.FieldEqualFold(FieldExtURL, v)) +} + +// ExtURLContainsFold applies the ContainsFold predicate on the "ext_url" field. +func ExtURLContainsFold(v string) predicate.Menu { + return predicate.Menu(sql.FieldContainsFold(FieldExtURL, v)) +} + +// PermissionsIsNil applies the IsNil predicate on the "permissions" field. +func PermissionsIsNil() predicate.Menu { + return predicate.Menu(sql.FieldIsNull(FieldPermissions)) +} + +// PermissionsNotNil applies the NotNil predicate on the "permissions" field. +func PermissionsNotNil() predicate.Menu { + return predicate.Menu(sql.FieldNotNull(FieldPermissions)) +} + +// RedirectEQ applies the EQ predicate on the "redirect" field. +func RedirectEQ(v string) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldRedirect, v)) +} + +// RedirectNEQ applies the NEQ predicate on the "redirect" field. +func RedirectNEQ(v string) predicate.Menu { + return predicate.Menu(sql.FieldNEQ(FieldRedirect, v)) +} + +// RedirectIn applies the In predicate on the "redirect" field. +func RedirectIn(vs ...string) predicate.Menu { + return predicate.Menu(sql.FieldIn(FieldRedirect, vs...)) +} + +// RedirectNotIn applies the NotIn predicate on the "redirect" field. +func RedirectNotIn(vs ...string) predicate.Menu { + return predicate.Menu(sql.FieldNotIn(FieldRedirect, vs...)) +} + +// RedirectGT applies the GT predicate on the "redirect" field. +func RedirectGT(v string) predicate.Menu { + return predicate.Menu(sql.FieldGT(FieldRedirect, v)) +} + +// RedirectGTE applies the GTE predicate on the "redirect" field. +func RedirectGTE(v string) predicate.Menu { + return predicate.Menu(sql.FieldGTE(FieldRedirect, v)) +} + +// RedirectLT applies the LT predicate on the "redirect" field. +func RedirectLT(v string) predicate.Menu { + return predicate.Menu(sql.FieldLT(FieldRedirect, v)) +} + +// RedirectLTE applies the LTE predicate on the "redirect" field. +func RedirectLTE(v string) predicate.Menu { + return predicate.Menu(sql.FieldLTE(FieldRedirect, v)) +} + +// RedirectContains applies the Contains predicate on the "redirect" field. +func RedirectContains(v string) predicate.Menu { + return predicate.Menu(sql.FieldContains(FieldRedirect, v)) +} + +// RedirectHasPrefix applies the HasPrefix predicate on the "redirect" field. +func RedirectHasPrefix(v string) predicate.Menu { + return predicate.Menu(sql.FieldHasPrefix(FieldRedirect, v)) +} + +// RedirectHasSuffix applies the HasSuffix predicate on the "redirect" field. +func RedirectHasSuffix(v string) predicate.Menu { + return predicate.Menu(sql.FieldHasSuffix(FieldRedirect, v)) +} + +// RedirectIsNil applies the IsNil predicate on the "redirect" field. +func RedirectIsNil() predicate.Menu { + return predicate.Menu(sql.FieldIsNull(FieldRedirect)) +} + +// RedirectNotNil applies the NotNil predicate on the "redirect" field. +func RedirectNotNil() predicate.Menu { + return predicate.Menu(sql.FieldNotNull(FieldRedirect)) +} + +// RedirectEqualFold applies the EqualFold predicate on the "redirect" field. +func RedirectEqualFold(v string) predicate.Menu { + return predicate.Menu(sql.FieldEqualFold(FieldRedirect, v)) +} + +// RedirectContainsFold applies the ContainsFold predicate on the "redirect" field. +func RedirectContainsFold(v string) predicate.Menu { + return predicate.Menu(sql.FieldContainsFold(FieldRedirect, v)) +} + +// CurrentActiveMenuEQ applies the EQ predicate on the "current_active_menu" field. +func CurrentActiveMenuEQ(v string) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldCurrentActiveMenu, v)) +} + +// CurrentActiveMenuNEQ applies the NEQ predicate on the "current_active_menu" field. +func CurrentActiveMenuNEQ(v string) predicate.Menu { + return predicate.Menu(sql.FieldNEQ(FieldCurrentActiveMenu, v)) +} + +// CurrentActiveMenuIn applies the In predicate on the "current_active_menu" field. +func CurrentActiveMenuIn(vs ...string) predicate.Menu { + return predicate.Menu(sql.FieldIn(FieldCurrentActiveMenu, vs...)) +} + +// CurrentActiveMenuNotIn applies the NotIn predicate on the "current_active_menu" field. +func CurrentActiveMenuNotIn(vs ...string) predicate.Menu { + return predicate.Menu(sql.FieldNotIn(FieldCurrentActiveMenu, vs...)) +} + +// CurrentActiveMenuGT applies the GT predicate on the "current_active_menu" field. +func CurrentActiveMenuGT(v string) predicate.Menu { + return predicate.Menu(sql.FieldGT(FieldCurrentActiveMenu, v)) +} + +// CurrentActiveMenuGTE applies the GTE predicate on the "current_active_menu" field. +func CurrentActiveMenuGTE(v string) predicate.Menu { + return predicate.Menu(sql.FieldGTE(FieldCurrentActiveMenu, v)) +} + +// CurrentActiveMenuLT applies the LT predicate on the "current_active_menu" field. +func CurrentActiveMenuLT(v string) predicate.Menu { + return predicate.Menu(sql.FieldLT(FieldCurrentActiveMenu, v)) +} + +// CurrentActiveMenuLTE applies the LTE predicate on the "current_active_menu" field. +func CurrentActiveMenuLTE(v string) predicate.Menu { + return predicate.Menu(sql.FieldLTE(FieldCurrentActiveMenu, v)) +} + +// CurrentActiveMenuContains applies the Contains predicate on the "current_active_menu" field. +func CurrentActiveMenuContains(v string) predicate.Menu { + return predicate.Menu(sql.FieldContains(FieldCurrentActiveMenu, v)) +} + +// CurrentActiveMenuHasPrefix applies the HasPrefix predicate on the "current_active_menu" field. +func CurrentActiveMenuHasPrefix(v string) predicate.Menu { + return predicate.Menu(sql.FieldHasPrefix(FieldCurrentActiveMenu, v)) +} + +// CurrentActiveMenuHasSuffix applies the HasSuffix predicate on the "current_active_menu" field. +func CurrentActiveMenuHasSuffix(v string) predicate.Menu { + return predicate.Menu(sql.FieldHasSuffix(FieldCurrentActiveMenu, v)) +} + +// CurrentActiveMenuIsNil applies the IsNil predicate on the "current_active_menu" field. +func CurrentActiveMenuIsNil() predicate.Menu { + return predicate.Menu(sql.FieldIsNull(FieldCurrentActiveMenu)) +} + +// CurrentActiveMenuNotNil applies the NotNil predicate on the "current_active_menu" field. +func CurrentActiveMenuNotNil() predicate.Menu { + return predicate.Menu(sql.FieldNotNull(FieldCurrentActiveMenu)) +} + +// CurrentActiveMenuEqualFold applies the EqualFold predicate on the "current_active_menu" field. +func CurrentActiveMenuEqualFold(v string) predicate.Menu { + return predicate.Menu(sql.FieldEqualFold(FieldCurrentActiveMenu, v)) +} + +// CurrentActiveMenuContainsFold applies the ContainsFold predicate on the "current_active_menu" field. +func CurrentActiveMenuContainsFold(v string) predicate.Menu { + return predicate.Menu(sql.FieldContainsFold(FieldCurrentActiveMenu, v)) +} + +// KeepAliveEQ applies the EQ predicate on the "keep_alive" field. +func KeepAliveEQ(v bool) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldKeepAlive, v)) +} + +// KeepAliveNEQ applies the NEQ predicate on the "keep_alive" field. +func KeepAliveNEQ(v bool) predicate.Menu { + return predicate.Menu(sql.FieldNEQ(FieldKeepAlive, v)) +} + +// KeepAliveIsNil applies the IsNil predicate on the "keep_alive" field. +func KeepAliveIsNil() predicate.Menu { + return predicate.Menu(sql.FieldIsNull(FieldKeepAlive)) +} + +// KeepAliveNotNil applies the NotNil predicate on the "keep_alive" field. +func KeepAliveNotNil() predicate.Menu { + return predicate.Menu(sql.FieldNotNull(FieldKeepAlive)) +} + +// ShowEQ applies the EQ predicate on the "show" field. +func ShowEQ(v bool) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldShow, v)) +} + +// ShowNEQ applies the NEQ predicate on the "show" field. +func ShowNEQ(v bool) predicate.Menu { + return predicate.Menu(sql.FieldNEQ(FieldShow, v)) +} + +// ShowIsNil applies the IsNil predicate on the "show" field. +func ShowIsNil() predicate.Menu { + return predicate.Menu(sql.FieldIsNull(FieldShow)) +} + +// ShowNotNil applies the NotNil predicate on the "show" field. +func ShowNotNil() predicate.Menu { + return predicate.Menu(sql.FieldNotNull(FieldShow)) +} + +// HideTabEQ applies the EQ predicate on the "hide_tab" field. +func HideTabEQ(v bool) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldHideTab, v)) +} + +// HideTabNEQ applies the NEQ predicate on the "hide_tab" field. +func HideTabNEQ(v bool) predicate.Menu { + return predicate.Menu(sql.FieldNEQ(FieldHideTab, v)) +} + +// HideTabIsNil applies the IsNil predicate on the "hide_tab" field. +func HideTabIsNil() predicate.Menu { + return predicate.Menu(sql.FieldIsNull(FieldHideTab)) +} + +// HideTabNotNil applies the NotNil predicate on the "hide_tab" field. +func HideTabNotNil() predicate.Menu { + return predicate.Menu(sql.FieldNotNull(FieldHideTab)) +} + +// HideMenuEQ applies the EQ predicate on the "hide_menu" field. +func HideMenuEQ(v bool) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldHideMenu, v)) +} + +// HideMenuNEQ applies the NEQ predicate on the "hide_menu" field. +func HideMenuNEQ(v bool) predicate.Menu { + return predicate.Menu(sql.FieldNEQ(FieldHideMenu, v)) +} + +// HideMenuIsNil applies the IsNil predicate on the "hide_menu" field. +func HideMenuIsNil() predicate.Menu { + return predicate.Menu(sql.FieldIsNull(FieldHideMenu)) +} + +// HideMenuNotNil applies the NotNil predicate on the "hide_menu" field. +func HideMenuNotNil() predicate.Menu { + return predicate.Menu(sql.FieldNotNull(FieldHideMenu)) +} + +// HideBreadcrumbEQ applies the EQ predicate on the "hide_breadcrumb" field. +func HideBreadcrumbEQ(v bool) predicate.Menu { + return predicate.Menu(sql.FieldEQ(FieldHideBreadcrumb, v)) +} + +// HideBreadcrumbNEQ applies the NEQ predicate on the "hide_breadcrumb" field. +func HideBreadcrumbNEQ(v bool) predicate.Menu { + return predicate.Menu(sql.FieldNEQ(FieldHideBreadcrumb, v)) +} + +// HideBreadcrumbIsNil applies the IsNil predicate on the "hide_breadcrumb" field. +func HideBreadcrumbIsNil() predicate.Menu { + return predicate.Menu(sql.FieldIsNull(FieldHideBreadcrumb)) +} + +// HideBreadcrumbNotNil applies the NotNil predicate on the "hide_breadcrumb" field. +func HideBreadcrumbNotNil() predicate.Menu { + return predicate.Menu(sql.FieldNotNull(FieldHideBreadcrumb)) +} + +// HasParent applies the HasEdge predicate on the "parent" edge. +func HasParent() predicate.Menu { + return predicate.Menu(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, ParentTable, ParentColumn), + ) + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasParentWith applies the HasEdge predicate on the "parent" edge with a given conditions (other predicates). +func HasParentWith(preds ...predicate.Menu) predicate.Menu { + return predicate.Menu(func(s *sql.Selector) { + step := newParentStep() + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasChildren applies the HasEdge predicate on the "children" edge. +func HasChildren() predicate.Menu { + return predicate.Menu(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, ChildrenTable, ChildrenColumn), + ) + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasChildrenWith applies the HasEdge predicate on the "children" edge with a given conditions (other predicates). +func HasChildrenWith(preds ...predicate.Menu) predicate.Menu { + return predicate.Menu(func(s *sql.Selector) { + step := newChildrenStep() + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.Menu) predicate.Menu { + return predicate.Menu(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.Menu) predicate.Menu { + return predicate.Menu(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.Menu) predicate.Menu { + return predicate.Menu(sql.NotPredicates(p)) +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/menu_create.go b/monolithic/backend/app/admin/service/internal/data/ent/menu_create.go new file mode 100644 index 0000000..1aa5191 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/menu_create.go @@ -0,0 +1,2346 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "errors" + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/menu" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// MenuCreate is the builder for creating a Menu entity. +type MenuCreate struct { + config + mutation *MenuMutation + hooks []Hook + conflict []sql.ConflictOption +} + +// SetStatus sets the "status" field. +func (mc *MenuCreate) SetStatus(m menu.Status) *MenuCreate { + mc.mutation.SetStatus(m) + return mc +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (mc *MenuCreate) SetNillableStatus(m *menu.Status) *MenuCreate { + if m != nil { + mc.SetStatus(*m) + } + return mc +} + +// SetCreateTime sets the "create_time" field. +func (mc *MenuCreate) SetCreateTime(t time.Time) *MenuCreate { + mc.mutation.SetCreateTime(t) + return mc +} + +// SetNillableCreateTime sets the "create_time" field if the given value is not nil. +func (mc *MenuCreate) SetNillableCreateTime(t *time.Time) *MenuCreate { + if t != nil { + mc.SetCreateTime(*t) + } + return mc +} + +// SetUpdateTime sets the "update_time" field. +func (mc *MenuCreate) SetUpdateTime(t time.Time) *MenuCreate { + mc.mutation.SetUpdateTime(t) + return mc +} + +// SetNillableUpdateTime sets the "update_time" field if the given value is not nil. +func (mc *MenuCreate) SetNillableUpdateTime(t *time.Time) *MenuCreate { + if t != nil { + mc.SetUpdateTime(*t) + } + return mc +} + +// SetDeleteTime sets the "delete_time" field. +func (mc *MenuCreate) SetDeleteTime(t time.Time) *MenuCreate { + mc.mutation.SetDeleteTime(t) + return mc +} + +// SetNillableDeleteTime sets the "delete_time" field if the given value is not nil. +func (mc *MenuCreate) SetNillableDeleteTime(t *time.Time) *MenuCreate { + if t != nil { + mc.SetDeleteTime(*t) + } + return mc +} + +// SetCreateBy sets the "create_by" field. +func (mc *MenuCreate) SetCreateBy(u uint32) *MenuCreate { + mc.mutation.SetCreateBy(u) + return mc +} + +// SetNillableCreateBy sets the "create_by" field if the given value is not nil. +func (mc *MenuCreate) SetNillableCreateBy(u *uint32) *MenuCreate { + if u != nil { + mc.SetCreateBy(*u) + } + return mc +} + +// SetParentID sets the "parent_id" field. +func (mc *MenuCreate) SetParentID(i int32) *MenuCreate { + mc.mutation.SetParentID(i) + return mc +} + +// SetNillableParentID sets the "parent_id" field if the given value is not nil. +func (mc *MenuCreate) SetNillableParentID(i *int32) *MenuCreate { + if i != nil { + mc.SetParentID(*i) + } + return mc +} + +// SetOrderNo sets the "order_no" field. +func (mc *MenuCreate) SetOrderNo(i int32) *MenuCreate { + mc.mutation.SetOrderNo(i) + return mc +} + +// SetNillableOrderNo sets the "order_no" field if the given value is not nil. +func (mc *MenuCreate) SetNillableOrderNo(i *int32) *MenuCreate { + if i != nil { + mc.SetOrderNo(*i) + } + return mc +} + +// SetName sets the "name" field. +func (mc *MenuCreate) SetName(s string) *MenuCreate { + mc.mutation.SetName(s) + return mc +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (mc *MenuCreate) SetNillableName(s *string) *MenuCreate { + if s != nil { + mc.SetName(*s) + } + return mc +} + +// SetTitle sets the "title" field. +func (mc *MenuCreate) SetTitle(s string) *MenuCreate { + mc.mutation.SetTitle(s) + return mc +} + +// SetNillableTitle sets the "title" field if the given value is not nil. +func (mc *MenuCreate) SetNillableTitle(s *string) *MenuCreate { + if s != nil { + mc.SetTitle(*s) + } + return mc +} + +// SetType sets the "type" field. +func (mc *MenuCreate) SetType(m menu.Type) *MenuCreate { + mc.mutation.SetType(m) + return mc +} + +// SetNillableType sets the "type" field if the given value is not nil. +func (mc *MenuCreate) SetNillableType(m *menu.Type) *MenuCreate { + if m != nil { + mc.SetType(*m) + } + return mc +} + +// SetPath sets the "path" field. +func (mc *MenuCreate) SetPath(s string) *MenuCreate { + mc.mutation.SetPath(s) + return mc +} + +// SetNillablePath sets the "path" field if the given value is not nil. +func (mc *MenuCreate) SetNillablePath(s *string) *MenuCreate { + if s != nil { + mc.SetPath(*s) + } + return mc +} + +// SetComponent sets the "component" field. +func (mc *MenuCreate) SetComponent(s string) *MenuCreate { + mc.mutation.SetComponent(s) + return mc +} + +// SetNillableComponent sets the "component" field if the given value is not nil. +func (mc *MenuCreate) SetNillableComponent(s *string) *MenuCreate { + if s != nil { + mc.SetComponent(*s) + } + return mc +} + +// SetIcon sets the "icon" field. +func (mc *MenuCreate) SetIcon(s string) *MenuCreate { + mc.mutation.SetIcon(s) + return mc +} + +// SetNillableIcon sets the "icon" field if the given value is not nil. +func (mc *MenuCreate) SetNillableIcon(s *string) *MenuCreate { + if s != nil { + mc.SetIcon(*s) + } + return mc +} + +// SetIsExt sets the "is_ext" field. +func (mc *MenuCreate) SetIsExt(b bool) *MenuCreate { + mc.mutation.SetIsExt(b) + return mc +} + +// SetNillableIsExt sets the "is_ext" field if the given value is not nil. +func (mc *MenuCreate) SetNillableIsExt(b *bool) *MenuCreate { + if b != nil { + mc.SetIsExt(*b) + } + return mc +} + +// SetExtURL sets the "ext_url" field. +func (mc *MenuCreate) SetExtURL(s string) *MenuCreate { + mc.mutation.SetExtURL(s) + return mc +} + +// SetNillableExtURL sets the "ext_url" field if the given value is not nil. +func (mc *MenuCreate) SetNillableExtURL(s *string) *MenuCreate { + if s != nil { + mc.SetExtURL(*s) + } + return mc +} + +// SetPermissions sets the "permissions" field. +func (mc *MenuCreate) SetPermissions(s []string) *MenuCreate { + mc.mutation.SetPermissions(s) + return mc +} + +// SetRedirect sets the "redirect" field. +func (mc *MenuCreate) SetRedirect(s string) *MenuCreate { + mc.mutation.SetRedirect(s) + return mc +} + +// SetNillableRedirect sets the "redirect" field if the given value is not nil. +func (mc *MenuCreate) SetNillableRedirect(s *string) *MenuCreate { + if s != nil { + mc.SetRedirect(*s) + } + return mc +} + +// SetCurrentActiveMenu sets the "current_active_menu" field. +func (mc *MenuCreate) SetCurrentActiveMenu(s string) *MenuCreate { + mc.mutation.SetCurrentActiveMenu(s) + return mc +} + +// SetNillableCurrentActiveMenu sets the "current_active_menu" field if the given value is not nil. +func (mc *MenuCreate) SetNillableCurrentActiveMenu(s *string) *MenuCreate { + if s != nil { + mc.SetCurrentActiveMenu(*s) + } + return mc +} + +// SetKeepAlive sets the "keep_alive" field. +func (mc *MenuCreate) SetKeepAlive(b bool) *MenuCreate { + mc.mutation.SetKeepAlive(b) + return mc +} + +// SetNillableKeepAlive sets the "keep_alive" field if the given value is not nil. +func (mc *MenuCreate) SetNillableKeepAlive(b *bool) *MenuCreate { + if b != nil { + mc.SetKeepAlive(*b) + } + return mc +} + +// SetShow sets the "show" field. +func (mc *MenuCreate) SetShow(b bool) *MenuCreate { + mc.mutation.SetShow(b) + return mc +} + +// SetNillableShow sets the "show" field if the given value is not nil. +func (mc *MenuCreate) SetNillableShow(b *bool) *MenuCreate { + if b != nil { + mc.SetShow(*b) + } + return mc +} + +// SetHideTab sets the "hide_tab" field. +func (mc *MenuCreate) SetHideTab(b bool) *MenuCreate { + mc.mutation.SetHideTab(b) + return mc +} + +// SetNillableHideTab sets the "hide_tab" field if the given value is not nil. +func (mc *MenuCreate) SetNillableHideTab(b *bool) *MenuCreate { + if b != nil { + mc.SetHideTab(*b) + } + return mc +} + +// SetHideMenu sets the "hide_menu" field. +func (mc *MenuCreate) SetHideMenu(b bool) *MenuCreate { + mc.mutation.SetHideMenu(b) + return mc +} + +// SetNillableHideMenu sets the "hide_menu" field if the given value is not nil. +func (mc *MenuCreate) SetNillableHideMenu(b *bool) *MenuCreate { + if b != nil { + mc.SetHideMenu(*b) + } + return mc +} + +// SetHideBreadcrumb sets the "hide_breadcrumb" field. +func (mc *MenuCreate) SetHideBreadcrumb(b bool) *MenuCreate { + mc.mutation.SetHideBreadcrumb(b) + return mc +} + +// SetNillableHideBreadcrumb sets the "hide_breadcrumb" field if the given value is not nil. +func (mc *MenuCreate) SetNillableHideBreadcrumb(b *bool) *MenuCreate { + if b != nil { + mc.SetHideBreadcrumb(*b) + } + return mc +} + +// SetID sets the "id" field. +func (mc *MenuCreate) SetID(i int32) *MenuCreate { + mc.mutation.SetID(i) + return mc +} + +// SetParent sets the "parent" edge to the Menu entity. +func (mc *MenuCreate) SetParent(m *Menu) *MenuCreate { + return mc.SetParentID(m.ID) +} + +// AddChildIDs adds the "children" edge to the Menu entity by IDs. +func (mc *MenuCreate) AddChildIDs(ids ...int32) *MenuCreate { + mc.mutation.AddChildIDs(ids...) + return mc +} + +// AddChildren adds the "children" edges to the Menu entity. +func (mc *MenuCreate) AddChildren(m ...*Menu) *MenuCreate { + ids := make([]int32, len(m)) + for i := range m { + ids[i] = m[i].ID + } + return mc.AddChildIDs(ids...) +} + +// Mutation returns the MenuMutation object of the builder. +func (mc *MenuCreate) Mutation() *MenuMutation { + return mc.mutation +} + +// Save creates the Menu in the database. +func (mc *MenuCreate) Save(ctx context.Context) (*Menu, error) { + mc.defaults() + return withHooks(ctx, mc.sqlSave, mc.mutation, mc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (mc *MenuCreate) SaveX(ctx context.Context) *Menu { + v, err := mc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (mc *MenuCreate) Exec(ctx context.Context) error { + _, err := mc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (mc *MenuCreate) ExecX(ctx context.Context) { + if err := mc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (mc *MenuCreate) defaults() { + if _, ok := mc.mutation.Status(); !ok { + v := menu.DefaultStatus + mc.mutation.SetStatus(v) + } + if _, ok := mc.mutation.OrderNo(); !ok { + v := menu.DefaultOrderNo + mc.mutation.SetOrderNo(v) + } + if _, ok := mc.mutation.Name(); !ok { + v := menu.DefaultName + mc.mutation.SetName(v) + } + if _, ok := mc.mutation.Title(); !ok { + v := menu.DefaultTitle + mc.mutation.SetTitle(v) + } + if _, ok := mc.mutation.Path(); !ok { + v := menu.DefaultPath + mc.mutation.SetPath(v) + } + if _, ok := mc.mutation.Component(); !ok { + v := menu.DefaultComponent + mc.mutation.SetComponent(v) + } + if _, ok := mc.mutation.Icon(); !ok { + v := menu.DefaultIcon + mc.mutation.SetIcon(v) + } + if _, ok := mc.mutation.IsExt(); !ok { + v := menu.DefaultIsExt + mc.mutation.SetIsExt(v) + } + if _, ok := mc.mutation.KeepAlive(); !ok { + v := menu.DefaultKeepAlive + mc.mutation.SetKeepAlive(v) + } + if _, ok := mc.mutation.Show(); !ok { + v := menu.DefaultShow + mc.mutation.SetShow(v) + } + if _, ok := mc.mutation.HideTab(); !ok { + v := menu.DefaultHideTab + mc.mutation.SetHideTab(v) + } + if _, ok := mc.mutation.HideMenu(); !ok { + v := menu.DefaultHideMenu + mc.mutation.SetHideMenu(v) + } + if _, ok := mc.mutation.HideBreadcrumb(); !ok { + v := menu.DefaultHideBreadcrumb + mc.mutation.SetHideBreadcrumb(v) + } +} + +// check runs all checks and user-defined validators on the builder. +func (mc *MenuCreate) check() error { + if v, ok := mc.mutation.Status(); ok { + if err := menu.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "Menu.status": %w`, err)} + } + } + if v, ok := mc.mutation.Name(); ok { + if err := menu.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "Menu.name": %w`, err)} + } + } + if v, ok := mc.mutation.Title(); ok { + if err := menu.TitleValidator(v); err != nil { + return &ValidationError{Name: "title", err: fmt.Errorf(`ent: validator failed for field "Menu.title": %w`, err)} + } + } + if v, ok := mc.mutation.GetType(); ok { + if err := menu.TypeValidator(v); err != nil { + return &ValidationError{Name: "type", err: fmt.Errorf(`ent: validator failed for field "Menu.type": %w`, err)} + } + } + if v, ok := mc.mutation.Icon(); ok { + if err := menu.IconValidator(v); err != nil { + return &ValidationError{Name: "icon", err: fmt.Errorf(`ent: validator failed for field "Menu.icon": %w`, err)} + } + } + if v, ok := mc.mutation.ExtURL(); ok { + if err := menu.ExtURLValidator(v); err != nil { + return &ValidationError{Name: "ext_url", err: fmt.Errorf(`ent: validator failed for field "Menu.ext_url": %w`, err)} + } + } + if v, ok := mc.mutation.ID(); ok { + if err := menu.IDValidator(v); err != nil { + return &ValidationError{Name: "id", err: fmt.Errorf(`ent: validator failed for field "Menu.id": %w`, err)} + } + } + return nil +} + +func (mc *MenuCreate) sqlSave(ctx context.Context) (*Menu, error) { + if err := mc.check(); err != nil { + return nil, err + } + _node, _spec := mc.createSpec() + if err := sqlgraph.CreateNode(ctx, mc.driver, _spec); err != nil { + if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + if _spec.ID.Value != _node.ID { + id := _spec.ID.Value.(int64) + _node.ID = int32(id) + } + mc.mutation.id = &_node.ID + mc.mutation.done = true + return _node, nil +} + +func (mc *MenuCreate) createSpec() (*Menu, *sqlgraph.CreateSpec) { + var ( + _node = &Menu{config: mc.config} + _spec = sqlgraph.NewCreateSpec(menu.Table, sqlgraph.NewFieldSpec(menu.FieldID, field.TypeInt32)) + ) + _spec.OnConflict = mc.conflict + if id, ok := mc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := mc.mutation.Status(); ok { + _spec.SetField(menu.FieldStatus, field.TypeEnum, value) + _node.Status = &value + } + if value, ok := mc.mutation.CreateTime(); ok { + _spec.SetField(menu.FieldCreateTime, field.TypeTime, value) + _node.CreateTime = &value + } + if value, ok := mc.mutation.UpdateTime(); ok { + _spec.SetField(menu.FieldUpdateTime, field.TypeTime, value) + _node.UpdateTime = &value + } + if value, ok := mc.mutation.DeleteTime(); ok { + _spec.SetField(menu.FieldDeleteTime, field.TypeTime, value) + _node.DeleteTime = &value + } + if value, ok := mc.mutation.CreateBy(); ok { + _spec.SetField(menu.FieldCreateBy, field.TypeUint32, value) + _node.CreateBy = &value + } + if value, ok := mc.mutation.OrderNo(); ok { + _spec.SetField(menu.FieldOrderNo, field.TypeInt32, value) + _node.OrderNo = &value + } + if value, ok := mc.mutation.Name(); ok { + _spec.SetField(menu.FieldName, field.TypeString, value) + _node.Name = &value + } + if value, ok := mc.mutation.Title(); ok { + _spec.SetField(menu.FieldTitle, field.TypeString, value) + _node.Title = &value + } + if value, ok := mc.mutation.GetType(); ok { + _spec.SetField(menu.FieldType, field.TypeEnum, value) + _node.Type = &value + } + if value, ok := mc.mutation.Path(); ok { + _spec.SetField(menu.FieldPath, field.TypeString, value) + _node.Path = &value + } + if value, ok := mc.mutation.Component(); ok { + _spec.SetField(menu.FieldComponent, field.TypeString, value) + _node.Component = &value + } + if value, ok := mc.mutation.Icon(); ok { + _spec.SetField(menu.FieldIcon, field.TypeString, value) + _node.Icon = &value + } + if value, ok := mc.mutation.IsExt(); ok { + _spec.SetField(menu.FieldIsExt, field.TypeBool, value) + _node.IsExt = &value + } + if value, ok := mc.mutation.ExtURL(); ok { + _spec.SetField(menu.FieldExtURL, field.TypeString, value) + _node.ExtURL = &value + } + if value, ok := mc.mutation.Permissions(); ok { + _spec.SetField(menu.FieldPermissions, field.TypeJSON, value) + _node.Permissions = value + } + if value, ok := mc.mutation.Redirect(); ok { + _spec.SetField(menu.FieldRedirect, field.TypeString, value) + _node.Redirect = &value + } + if value, ok := mc.mutation.CurrentActiveMenu(); ok { + _spec.SetField(menu.FieldCurrentActiveMenu, field.TypeString, value) + _node.CurrentActiveMenu = &value + } + if value, ok := mc.mutation.KeepAlive(); ok { + _spec.SetField(menu.FieldKeepAlive, field.TypeBool, value) + _node.KeepAlive = &value + } + if value, ok := mc.mutation.Show(); ok { + _spec.SetField(menu.FieldShow, field.TypeBool, value) + _node.Show = &value + } + if value, ok := mc.mutation.HideTab(); ok { + _spec.SetField(menu.FieldHideTab, field.TypeBool, value) + _node.HideTab = &value + } + if value, ok := mc.mutation.HideMenu(); ok { + _spec.SetField(menu.FieldHideMenu, field.TypeBool, value) + _node.HideMenu = &value + } + if value, ok := mc.mutation.HideBreadcrumb(); ok { + _spec.SetField(menu.FieldHideBreadcrumb, field.TypeBool, value) + _node.HideBreadcrumb = &value + } + if nodes := mc.mutation.ParentIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: menu.ParentTable, + Columns: []string{menu.ParentColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(menu.FieldID, field.TypeInt32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.ParentID = &nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := mc.mutation.ChildrenIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: menu.ChildrenTable, + Columns: []string{menu.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(menu.FieldID, field.TypeInt32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause +// of the `INSERT` statement. For example: +// +// client.Menu.Create(). +// SetStatus(v). +// OnConflict( +// // Update the row with the new values +// // the was proposed for insertion. +// sql.ResolveWithNewValues(), +// ). +// // Override some of the fields with custom +// // update values. +// Update(func(u *ent.MenuUpsert) { +// SetStatus(v+v). +// }). +// Exec(ctx) +func (mc *MenuCreate) OnConflict(opts ...sql.ConflictOption) *MenuUpsertOne { + mc.conflict = opts + return &MenuUpsertOne{ + create: mc, + } +} + +// OnConflictColumns calls `OnConflict` and configures the columns +// as conflict target. Using this option is equivalent to using: +// +// client.Menu.Create(). +// OnConflict(sql.ConflictColumns(columns...)). +// Exec(ctx) +func (mc *MenuCreate) OnConflictColumns(columns ...string) *MenuUpsertOne { + mc.conflict = append(mc.conflict, sql.ConflictColumns(columns...)) + return &MenuUpsertOne{ + create: mc, + } +} + +type ( + // MenuUpsertOne is the builder for "upsert"-ing + // one Menu node. + MenuUpsertOne struct { + create *MenuCreate + } + + // MenuUpsert is the "OnConflict" setter. + MenuUpsert struct { + *sql.UpdateSet + } +) + +// SetStatus sets the "status" field. +func (u *MenuUpsert) SetStatus(v menu.Status) *MenuUpsert { + u.Set(menu.FieldStatus, v) + return u +} + +// UpdateStatus sets the "status" field to the value that was provided on create. +func (u *MenuUpsert) UpdateStatus() *MenuUpsert { + u.SetExcluded(menu.FieldStatus) + return u +} + +// ClearStatus clears the value of the "status" field. +func (u *MenuUpsert) ClearStatus() *MenuUpsert { + u.SetNull(menu.FieldStatus) + return u +} + +// SetUpdateTime sets the "update_time" field. +func (u *MenuUpsert) SetUpdateTime(v time.Time) *MenuUpsert { + u.Set(menu.FieldUpdateTime, v) + return u +} + +// UpdateUpdateTime sets the "update_time" field to the value that was provided on create. +func (u *MenuUpsert) UpdateUpdateTime() *MenuUpsert { + u.SetExcluded(menu.FieldUpdateTime) + return u +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (u *MenuUpsert) ClearUpdateTime() *MenuUpsert { + u.SetNull(menu.FieldUpdateTime) + return u +} + +// SetDeleteTime sets the "delete_time" field. +func (u *MenuUpsert) SetDeleteTime(v time.Time) *MenuUpsert { + u.Set(menu.FieldDeleteTime, v) + return u +} + +// UpdateDeleteTime sets the "delete_time" field to the value that was provided on create. +func (u *MenuUpsert) UpdateDeleteTime() *MenuUpsert { + u.SetExcluded(menu.FieldDeleteTime) + return u +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (u *MenuUpsert) ClearDeleteTime() *MenuUpsert { + u.SetNull(menu.FieldDeleteTime) + return u +} + +// SetCreateBy sets the "create_by" field. +func (u *MenuUpsert) SetCreateBy(v uint32) *MenuUpsert { + u.Set(menu.FieldCreateBy, v) + return u +} + +// UpdateCreateBy sets the "create_by" field to the value that was provided on create. +func (u *MenuUpsert) UpdateCreateBy() *MenuUpsert { + u.SetExcluded(menu.FieldCreateBy) + return u +} + +// AddCreateBy adds v to the "create_by" field. +func (u *MenuUpsert) AddCreateBy(v uint32) *MenuUpsert { + u.Add(menu.FieldCreateBy, v) + return u +} + +// ClearCreateBy clears the value of the "create_by" field. +func (u *MenuUpsert) ClearCreateBy() *MenuUpsert { + u.SetNull(menu.FieldCreateBy) + return u +} + +// SetParentID sets the "parent_id" field. +func (u *MenuUpsert) SetParentID(v int32) *MenuUpsert { + u.Set(menu.FieldParentID, v) + return u +} + +// UpdateParentID sets the "parent_id" field to the value that was provided on create. +func (u *MenuUpsert) UpdateParentID() *MenuUpsert { + u.SetExcluded(menu.FieldParentID) + return u +} + +// ClearParentID clears the value of the "parent_id" field. +func (u *MenuUpsert) ClearParentID() *MenuUpsert { + u.SetNull(menu.FieldParentID) + return u +} + +// SetOrderNo sets the "order_no" field. +func (u *MenuUpsert) SetOrderNo(v int32) *MenuUpsert { + u.Set(menu.FieldOrderNo, v) + return u +} + +// UpdateOrderNo sets the "order_no" field to the value that was provided on create. +func (u *MenuUpsert) UpdateOrderNo() *MenuUpsert { + u.SetExcluded(menu.FieldOrderNo) + return u +} + +// AddOrderNo adds v to the "order_no" field. +func (u *MenuUpsert) AddOrderNo(v int32) *MenuUpsert { + u.Add(menu.FieldOrderNo, v) + return u +} + +// ClearOrderNo clears the value of the "order_no" field. +func (u *MenuUpsert) ClearOrderNo() *MenuUpsert { + u.SetNull(menu.FieldOrderNo) + return u +} + +// SetName sets the "name" field. +func (u *MenuUpsert) SetName(v string) *MenuUpsert { + u.Set(menu.FieldName, v) + return u +} + +// UpdateName sets the "name" field to the value that was provided on create. +func (u *MenuUpsert) UpdateName() *MenuUpsert { + u.SetExcluded(menu.FieldName) + return u +} + +// ClearName clears the value of the "name" field. +func (u *MenuUpsert) ClearName() *MenuUpsert { + u.SetNull(menu.FieldName) + return u +} + +// SetTitle sets the "title" field. +func (u *MenuUpsert) SetTitle(v string) *MenuUpsert { + u.Set(menu.FieldTitle, v) + return u +} + +// UpdateTitle sets the "title" field to the value that was provided on create. +func (u *MenuUpsert) UpdateTitle() *MenuUpsert { + u.SetExcluded(menu.FieldTitle) + return u +} + +// ClearTitle clears the value of the "title" field. +func (u *MenuUpsert) ClearTitle() *MenuUpsert { + u.SetNull(menu.FieldTitle) + return u +} + +// SetType sets the "type" field. +func (u *MenuUpsert) SetType(v menu.Type) *MenuUpsert { + u.Set(menu.FieldType, v) + return u +} + +// UpdateType sets the "type" field to the value that was provided on create. +func (u *MenuUpsert) UpdateType() *MenuUpsert { + u.SetExcluded(menu.FieldType) + return u +} + +// ClearType clears the value of the "type" field. +func (u *MenuUpsert) ClearType() *MenuUpsert { + u.SetNull(menu.FieldType) + return u +} + +// SetPath sets the "path" field. +func (u *MenuUpsert) SetPath(v string) *MenuUpsert { + u.Set(menu.FieldPath, v) + return u +} + +// UpdatePath sets the "path" field to the value that was provided on create. +func (u *MenuUpsert) UpdatePath() *MenuUpsert { + u.SetExcluded(menu.FieldPath) + return u +} + +// ClearPath clears the value of the "path" field. +func (u *MenuUpsert) ClearPath() *MenuUpsert { + u.SetNull(menu.FieldPath) + return u +} + +// SetComponent sets the "component" field. +func (u *MenuUpsert) SetComponent(v string) *MenuUpsert { + u.Set(menu.FieldComponent, v) + return u +} + +// UpdateComponent sets the "component" field to the value that was provided on create. +func (u *MenuUpsert) UpdateComponent() *MenuUpsert { + u.SetExcluded(menu.FieldComponent) + return u +} + +// ClearComponent clears the value of the "component" field. +func (u *MenuUpsert) ClearComponent() *MenuUpsert { + u.SetNull(menu.FieldComponent) + return u +} + +// SetIcon sets the "icon" field. +func (u *MenuUpsert) SetIcon(v string) *MenuUpsert { + u.Set(menu.FieldIcon, v) + return u +} + +// UpdateIcon sets the "icon" field to the value that was provided on create. +func (u *MenuUpsert) UpdateIcon() *MenuUpsert { + u.SetExcluded(menu.FieldIcon) + return u +} + +// ClearIcon clears the value of the "icon" field. +func (u *MenuUpsert) ClearIcon() *MenuUpsert { + u.SetNull(menu.FieldIcon) + return u +} + +// SetIsExt sets the "is_ext" field. +func (u *MenuUpsert) SetIsExt(v bool) *MenuUpsert { + u.Set(menu.FieldIsExt, v) + return u +} + +// UpdateIsExt sets the "is_ext" field to the value that was provided on create. +func (u *MenuUpsert) UpdateIsExt() *MenuUpsert { + u.SetExcluded(menu.FieldIsExt) + return u +} + +// ClearIsExt clears the value of the "is_ext" field. +func (u *MenuUpsert) ClearIsExt() *MenuUpsert { + u.SetNull(menu.FieldIsExt) + return u +} + +// SetExtURL sets the "ext_url" field. +func (u *MenuUpsert) SetExtURL(v string) *MenuUpsert { + u.Set(menu.FieldExtURL, v) + return u +} + +// UpdateExtURL sets the "ext_url" field to the value that was provided on create. +func (u *MenuUpsert) UpdateExtURL() *MenuUpsert { + u.SetExcluded(menu.FieldExtURL) + return u +} + +// ClearExtURL clears the value of the "ext_url" field. +func (u *MenuUpsert) ClearExtURL() *MenuUpsert { + u.SetNull(menu.FieldExtURL) + return u +} + +// SetPermissions sets the "permissions" field. +func (u *MenuUpsert) SetPermissions(v []string) *MenuUpsert { + u.Set(menu.FieldPermissions, v) + return u +} + +// UpdatePermissions sets the "permissions" field to the value that was provided on create. +func (u *MenuUpsert) UpdatePermissions() *MenuUpsert { + u.SetExcluded(menu.FieldPermissions) + return u +} + +// ClearPermissions clears the value of the "permissions" field. +func (u *MenuUpsert) ClearPermissions() *MenuUpsert { + u.SetNull(menu.FieldPermissions) + return u +} + +// SetRedirect sets the "redirect" field. +func (u *MenuUpsert) SetRedirect(v string) *MenuUpsert { + u.Set(menu.FieldRedirect, v) + return u +} + +// UpdateRedirect sets the "redirect" field to the value that was provided on create. +func (u *MenuUpsert) UpdateRedirect() *MenuUpsert { + u.SetExcluded(menu.FieldRedirect) + return u +} + +// ClearRedirect clears the value of the "redirect" field. +func (u *MenuUpsert) ClearRedirect() *MenuUpsert { + u.SetNull(menu.FieldRedirect) + return u +} + +// SetCurrentActiveMenu sets the "current_active_menu" field. +func (u *MenuUpsert) SetCurrentActiveMenu(v string) *MenuUpsert { + u.Set(menu.FieldCurrentActiveMenu, v) + return u +} + +// UpdateCurrentActiveMenu sets the "current_active_menu" field to the value that was provided on create. +func (u *MenuUpsert) UpdateCurrentActiveMenu() *MenuUpsert { + u.SetExcluded(menu.FieldCurrentActiveMenu) + return u +} + +// ClearCurrentActiveMenu clears the value of the "current_active_menu" field. +func (u *MenuUpsert) ClearCurrentActiveMenu() *MenuUpsert { + u.SetNull(menu.FieldCurrentActiveMenu) + return u +} + +// SetKeepAlive sets the "keep_alive" field. +func (u *MenuUpsert) SetKeepAlive(v bool) *MenuUpsert { + u.Set(menu.FieldKeepAlive, v) + return u +} + +// UpdateKeepAlive sets the "keep_alive" field to the value that was provided on create. +func (u *MenuUpsert) UpdateKeepAlive() *MenuUpsert { + u.SetExcluded(menu.FieldKeepAlive) + return u +} + +// ClearKeepAlive clears the value of the "keep_alive" field. +func (u *MenuUpsert) ClearKeepAlive() *MenuUpsert { + u.SetNull(menu.FieldKeepAlive) + return u +} + +// SetShow sets the "show" field. +func (u *MenuUpsert) SetShow(v bool) *MenuUpsert { + u.Set(menu.FieldShow, v) + return u +} + +// UpdateShow sets the "show" field to the value that was provided on create. +func (u *MenuUpsert) UpdateShow() *MenuUpsert { + u.SetExcluded(menu.FieldShow) + return u +} + +// ClearShow clears the value of the "show" field. +func (u *MenuUpsert) ClearShow() *MenuUpsert { + u.SetNull(menu.FieldShow) + return u +} + +// SetHideTab sets the "hide_tab" field. +func (u *MenuUpsert) SetHideTab(v bool) *MenuUpsert { + u.Set(menu.FieldHideTab, v) + return u +} + +// UpdateHideTab sets the "hide_tab" field to the value that was provided on create. +func (u *MenuUpsert) UpdateHideTab() *MenuUpsert { + u.SetExcluded(menu.FieldHideTab) + return u +} + +// ClearHideTab clears the value of the "hide_tab" field. +func (u *MenuUpsert) ClearHideTab() *MenuUpsert { + u.SetNull(menu.FieldHideTab) + return u +} + +// SetHideMenu sets the "hide_menu" field. +func (u *MenuUpsert) SetHideMenu(v bool) *MenuUpsert { + u.Set(menu.FieldHideMenu, v) + return u +} + +// UpdateHideMenu sets the "hide_menu" field to the value that was provided on create. +func (u *MenuUpsert) UpdateHideMenu() *MenuUpsert { + u.SetExcluded(menu.FieldHideMenu) + return u +} + +// ClearHideMenu clears the value of the "hide_menu" field. +func (u *MenuUpsert) ClearHideMenu() *MenuUpsert { + u.SetNull(menu.FieldHideMenu) + return u +} + +// SetHideBreadcrumb sets the "hide_breadcrumb" field. +func (u *MenuUpsert) SetHideBreadcrumb(v bool) *MenuUpsert { + u.Set(menu.FieldHideBreadcrumb, v) + return u +} + +// UpdateHideBreadcrumb sets the "hide_breadcrumb" field to the value that was provided on create. +func (u *MenuUpsert) UpdateHideBreadcrumb() *MenuUpsert { + u.SetExcluded(menu.FieldHideBreadcrumb) + return u +} + +// ClearHideBreadcrumb clears the value of the "hide_breadcrumb" field. +func (u *MenuUpsert) ClearHideBreadcrumb() *MenuUpsert { + u.SetNull(menu.FieldHideBreadcrumb) + return u +} + +// UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. +// Using this option is equivalent to using: +// +// client.Menu.Create(). +// OnConflict( +// sql.ResolveWithNewValues(), +// sql.ResolveWith(func(u *sql.UpdateSet) { +// u.SetIgnore(menu.FieldID) +// }), +// ). +// Exec(ctx) +func (u *MenuUpsertOne) UpdateNewValues() *MenuUpsertOne { + u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues()) + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) { + if _, exists := u.create.mutation.ID(); exists { + s.SetIgnore(menu.FieldID) + } + if _, exists := u.create.mutation.CreateTime(); exists { + s.SetIgnore(menu.FieldCreateTime) + } + })) + return u +} + +// Ignore sets each column to itself in case of conflict. +// Using this option is equivalent to using: +// +// client.Menu.Create(). +// OnConflict(sql.ResolveWithIgnore()). +// Exec(ctx) +func (u *MenuUpsertOne) Ignore() *MenuUpsertOne { + u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore()) + return u +} + +// DoNothing configures the conflict_action to `DO NOTHING`. +// Supported only by SQLite and PostgreSQL. +func (u *MenuUpsertOne) DoNothing() *MenuUpsertOne { + u.create.conflict = append(u.create.conflict, sql.DoNothing()) + return u +} + +// Update allows overriding fields `UPDATE` values. See the MenuCreate.OnConflict +// documentation for more info. +func (u *MenuUpsertOne) Update(set func(*MenuUpsert)) *MenuUpsertOne { + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) { + set(&MenuUpsert{UpdateSet: update}) + })) + return u +} + +// SetStatus sets the "status" field. +func (u *MenuUpsertOne) SetStatus(v menu.Status) *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.SetStatus(v) + }) +} + +// UpdateStatus sets the "status" field to the value that was provided on create. +func (u *MenuUpsertOne) UpdateStatus() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.UpdateStatus() + }) +} + +// ClearStatus clears the value of the "status" field. +func (u *MenuUpsertOne) ClearStatus() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.ClearStatus() + }) +} + +// SetUpdateTime sets the "update_time" field. +func (u *MenuUpsertOne) SetUpdateTime(v time.Time) *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.SetUpdateTime(v) + }) +} + +// UpdateUpdateTime sets the "update_time" field to the value that was provided on create. +func (u *MenuUpsertOne) UpdateUpdateTime() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.UpdateUpdateTime() + }) +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (u *MenuUpsertOne) ClearUpdateTime() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.ClearUpdateTime() + }) +} + +// SetDeleteTime sets the "delete_time" field. +func (u *MenuUpsertOne) SetDeleteTime(v time.Time) *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.SetDeleteTime(v) + }) +} + +// UpdateDeleteTime sets the "delete_time" field to the value that was provided on create. +func (u *MenuUpsertOne) UpdateDeleteTime() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.UpdateDeleteTime() + }) +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (u *MenuUpsertOne) ClearDeleteTime() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.ClearDeleteTime() + }) +} + +// SetCreateBy sets the "create_by" field. +func (u *MenuUpsertOne) SetCreateBy(v uint32) *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.SetCreateBy(v) + }) +} + +// AddCreateBy adds v to the "create_by" field. +func (u *MenuUpsertOne) AddCreateBy(v uint32) *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.AddCreateBy(v) + }) +} + +// UpdateCreateBy sets the "create_by" field to the value that was provided on create. +func (u *MenuUpsertOne) UpdateCreateBy() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.UpdateCreateBy() + }) +} + +// ClearCreateBy clears the value of the "create_by" field. +func (u *MenuUpsertOne) ClearCreateBy() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.ClearCreateBy() + }) +} + +// SetParentID sets the "parent_id" field. +func (u *MenuUpsertOne) SetParentID(v int32) *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.SetParentID(v) + }) +} + +// UpdateParentID sets the "parent_id" field to the value that was provided on create. +func (u *MenuUpsertOne) UpdateParentID() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.UpdateParentID() + }) +} + +// ClearParentID clears the value of the "parent_id" field. +func (u *MenuUpsertOne) ClearParentID() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.ClearParentID() + }) +} + +// SetOrderNo sets the "order_no" field. +func (u *MenuUpsertOne) SetOrderNo(v int32) *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.SetOrderNo(v) + }) +} + +// AddOrderNo adds v to the "order_no" field. +func (u *MenuUpsertOne) AddOrderNo(v int32) *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.AddOrderNo(v) + }) +} + +// UpdateOrderNo sets the "order_no" field to the value that was provided on create. +func (u *MenuUpsertOne) UpdateOrderNo() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.UpdateOrderNo() + }) +} + +// ClearOrderNo clears the value of the "order_no" field. +func (u *MenuUpsertOne) ClearOrderNo() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.ClearOrderNo() + }) +} + +// SetName sets the "name" field. +func (u *MenuUpsertOne) SetName(v string) *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.SetName(v) + }) +} + +// UpdateName sets the "name" field to the value that was provided on create. +func (u *MenuUpsertOne) UpdateName() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.UpdateName() + }) +} + +// ClearName clears the value of the "name" field. +func (u *MenuUpsertOne) ClearName() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.ClearName() + }) +} + +// SetTitle sets the "title" field. +func (u *MenuUpsertOne) SetTitle(v string) *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.SetTitle(v) + }) +} + +// UpdateTitle sets the "title" field to the value that was provided on create. +func (u *MenuUpsertOne) UpdateTitle() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.UpdateTitle() + }) +} + +// ClearTitle clears the value of the "title" field. +func (u *MenuUpsertOne) ClearTitle() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.ClearTitle() + }) +} + +// SetType sets the "type" field. +func (u *MenuUpsertOne) SetType(v menu.Type) *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.SetType(v) + }) +} + +// UpdateType sets the "type" field to the value that was provided on create. +func (u *MenuUpsertOne) UpdateType() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.UpdateType() + }) +} + +// ClearType clears the value of the "type" field. +func (u *MenuUpsertOne) ClearType() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.ClearType() + }) +} + +// SetPath sets the "path" field. +func (u *MenuUpsertOne) SetPath(v string) *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.SetPath(v) + }) +} + +// UpdatePath sets the "path" field to the value that was provided on create. +func (u *MenuUpsertOne) UpdatePath() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.UpdatePath() + }) +} + +// ClearPath clears the value of the "path" field. +func (u *MenuUpsertOne) ClearPath() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.ClearPath() + }) +} + +// SetComponent sets the "component" field. +func (u *MenuUpsertOne) SetComponent(v string) *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.SetComponent(v) + }) +} + +// UpdateComponent sets the "component" field to the value that was provided on create. +func (u *MenuUpsertOne) UpdateComponent() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.UpdateComponent() + }) +} + +// ClearComponent clears the value of the "component" field. +func (u *MenuUpsertOne) ClearComponent() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.ClearComponent() + }) +} + +// SetIcon sets the "icon" field. +func (u *MenuUpsertOne) SetIcon(v string) *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.SetIcon(v) + }) +} + +// UpdateIcon sets the "icon" field to the value that was provided on create. +func (u *MenuUpsertOne) UpdateIcon() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.UpdateIcon() + }) +} + +// ClearIcon clears the value of the "icon" field. +func (u *MenuUpsertOne) ClearIcon() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.ClearIcon() + }) +} + +// SetIsExt sets the "is_ext" field. +func (u *MenuUpsertOne) SetIsExt(v bool) *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.SetIsExt(v) + }) +} + +// UpdateIsExt sets the "is_ext" field to the value that was provided on create. +func (u *MenuUpsertOne) UpdateIsExt() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.UpdateIsExt() + }) +} + +// ClearIsExt clears the value of the "is_ext" field. +func (u *MenuUpsertOne) ClearIsExt() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.ClearIsExt() + }) +} + +// SetExtURL sets the "ext_url" field. +func (u *MenuUpsertOne) SetExtURL(v string) *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.SetExtURL(v) + }) +} + +// UpdateExtURL sets the "ext_url" field to the value that was provided on create. +func (u *MenuUpsertOne) UpdateExtURL() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.UpdateExtURL() + }) +} + +// ClearExtURL clears the value of the "ext_url" field. +func (u *MenuUpsertOne) ClearExtURL() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.ClearExtURL() + }) +} + +// SetPermissions sets the "permissions" field. +func (u *MenuUpsertOne) SetPermissions(v []string) *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.SetPermissions(v) + }) +} + +// UpdatePermissions sets the "permissions" field to the value that was provided on create. +func (u *MenuUpsertOne) UpdatePermissions() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.UpdatePermissions() + }) +} + +// ClearPermissions clears the value of the "permissions" field. +func (u *MenuUpsertOne) ClearPermissions() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.ClearPermissions() + }) +} + +// SetRedirect sets the "redirect" field. +func (u *MenuUpsertOne) SetRedirect(v string) *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.SetRedirect(v) + }) +} + +// UpdateRedirect sets the "redirect" field to the value that was provided on create. +func (u *MenuUpsertOne) UpdateRedirect() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.UpdateRedirect() + }) +} + +// ClearRedirect clears the value of the "redirect" field. +func (u *MenuUpsertOne) ClearRedirect() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.ClearRedirect() + }) +} + +// SetCurrentActiveMenu sets the "current_active_menu" field. +func (u *MenuUpsertOne) SetCurrentActiveMenu(v string) *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.SetCurrentActiveMenu(v) + }) +} + +// UpdateCurrentActiveMenu sets the "current_active_menu" field to the value that was provided on create. +func (u *MenuUpsertOne) UpdateCurrentActiveMenu() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.UpdateCurrentActiveMenu() + }) +} + +// ClearCurrentActiveMenu clears the value of the "current_active_menu" field. +func (u *MenuUpsertOne) ClearCurrentActiveMenu() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.ClearCurrentActiveMenu() + }) +} + +// SetKeepAlive sets the "keep_alive" field. +func (u *MenuUpsertOne) SetKeepAlive(v bool) *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.SetKeepAlive(v) + }) +} + +// UpdateKeepAlive sets the "keep_alive" field to the value that was provided on create. +func (u *MenuUpsertOne) UpdateKeepAlive() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.UpdateKeepAlive() + }) +} + +// ClearKeepAlive clears the value of the "keep_alive" field. +func (u *MenuUpsertOne) ClearKeepAlive() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.ClearKeepAlive() + }) +} + +// SetShow sets the "show" field. +func (u *MenuUpsertOne) SetShow(v bool) *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.SetShow(v) + }) +} + +// UpdateShow sets the "show" field to the value that was provided on create. +func (u *MenuUpsertOne) UpdateShow() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.UpdateShow() + }) +} + +// ClearShow clears the value of the "show" field. +func (u *MenuUpsertOne) ClearShow() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.ClearShow() + }) +} + +// SetHideTab sets the "hide_tab" field. +func (u *MenuUpsertOne) SetHideTab(v bool) *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.SetHideTab(v) + }) +} + +// UpdateHideTab sets the "hide_tab" field to the value that was provided on create. +func (u *MenuUpsertOne) UpdateHideTab() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.UpdateHideTab() + }) +} + +// ClearHideTab clears the value of the "hide_tab" field. +func (u *MenuUpsertOne) ClearHideTab() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.ClearHideTab() + }) +} + +// SetHideMenu sets the "hide_menu" field. +func (u *MenuUpsertOne) SetHideMenu(v bool) *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.SetHideMenu(v) + }) +} + +// UpdateHideMenu sets the "hide_menu" field to the value that was provided on create. +func (u *MenuUpsertOne) UpdateHideMenu() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.UpdateHideMenu() + }) +} + +// ClearHideMenu clears the value of the "hide_menu" field. +func (u *MenuUpsertOne) ClearHideMenu() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.ClearHideMenu() + }) +} + +// SetHideBreadcrumb sets the "hide_breadcrumb" field. +func (u *MenuUpsertOne) SetHideBreadcrumb(v bool) *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.SetHideBreadcrumb(v) + }) +} + +// UpdateHideBreadcrumb sets the "hide_breadcrumb" field to the value that was provided on create. +func (u *MenuUpsertOne) UpdateHideBreadcrumb() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.UpdateHideBreadcrumb() + }) +} + +// ClearHideBreadcrumb clears the value of the "hide_breadcrumb" field. +func (u *MenuUpsertOne) ClearHideBreadcrumb() *MenuUpsertOne { + return u.Update(func(s *MenuUpsert) { + s.ClearHideBreadcrumb() + }) +} + +// Exec executes the query. +func (u *MenuUpsertOne) Exec(ctx context.Context) error { + if len(u.create.conflict) == 0 { + return errors.New("ent: missing options for MenuCreate.OnConflict") + } + return u.create.Exec(ctx) +} + +// ExecX is like Exec, but panics if an error occurs. +func (u *MenuUpsertOne) ExecX(ctx context.Context) { + if err := u.create.Exec(ctx); err != nil { + panic(err) + } +} + +// Exec executes the UPSERT query and returns the inserted/updated ID. +func (u *MenuUpsertOne) ID(ctx context.Context) (id int32, err error) { + node, err := u.create.Save(ctx) + if err != nil { + return id, err + } + return node.ID, nil +} + +// IDX is like ID, but panics if an error occurs. +func (u *MenuUpsertOne) IDX(ctx context.Context) int32 { + id, err := u.ID(ctx) + if err != nil { + panic(err) + } + return id +} + +// MenuCreateBulk is the builder for creating many Menu entities in bulk. +type MenuCreateBulk struct { + config + err error + builders []*MenuCreate + conflict []sql.ConflictOption +} + +// Save creates the Menu entities in the database. +func (mcb *MenuCreateBulk) Save(ctx context.Context) ([]*Menu, error) { + if mcb.err != nil { + return nil, mcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(mcb.builders)) + nodes := make([]*Menu, len(mcb.builders)) + mutators := make([]Mutator, len(mcb.builders)) + for i := range mcb.builders { + func(i int, root context.Context) { + builder := mcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*MenuMutation) + if !ok { + return nil, fmt.Errorf("unexpected mutation type %T", m) + } + if err := builder.check(); err != nil { + return nil, err + } + builder.mutation = mutation + var err error + nodes[i], specs[i] = builder.createSpec() + if i < len(mutators)-1 { + _, err = mutators[i+1].Mutate(root, mcb.builders[i+1].mutation) + } else { + spec := &sqlgraph.BatchCreateSpec{Nodes: specs} + spec.OnConflict = mcb.conflict + // Invoke the actual operation on the latest mutation in the chain. + if err = sqlgraph.BatchCreate(ctx, mcb.driver, spec); err != nil { + if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + } + } + if err != nil { + return nil, err + } + mutation.id = &nodes[i].ID + if specs[i].ID.Value != nil && nodes[i].ID == 0 { + id := specs[i].ID.Value.(int64) + nodes[i].ID = int32(id) + } + mutation.done = true + return nodes[i], nil + }) + for i := len(builder.hooks) - 1; i >= 0; i-- { + mut = builder.hooks[i](mut) + } + mutators[i] = mut + }(i, ctx) + } + if len(mutators) > 0 { + if _, err := mutators[0].Mutate(ctx, mcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (mcb *MenuCreateBulk) SaveX(ctx context.Context) []*Menu { + v, err := mcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (mcb *MenuCreateBulk) Exec(ctx context.Context) error { + _, err := mcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (mcb *MenuCreateBulk) ExecX(ctx context.Context) { + if err := mcb.Exec(ctx); err != nil { + panic(err) + } +} + +// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause +// of the `INSERT` statement. For example: +// +// client.Menu.CreateBulk(builders...). +// OnConflict( +// // Update the row with the new values +// // the was proposed for insertion. +// sql.ResolveWithNewValues(), +// ). +// // Override some of the fields with custom +// // update values. +// Update(func(u *ent.MenuUpsert) { +// SetStatus(v+v). +// }). +// Exec(ctx) +func (mcb *MenuCreateBulk) OnConflict(opts ...sql.ConflictOption) *MenuUpsertBulk { + mcb.conflict = opts + return &MenuUpsertBulk{ + create: mcb, + } +} + +// OnConflictColumns calls `OnConflict` and configures the columns +// as conflict target. Using this option is equivalent to using: +// +// client.Menu.Create(). +// OnConflict(sql.ConflictColumns(columns...)). +// Exec(ctx) +func (mcb *MenuCreateBulk) OnConflictColumns(columns ...string) *MenuUpsertBulk { + mcb.conflict = append(mcb.conflict, sql.ConflictColumns(columns...)) + return &MenuUpsertBulk{ + create: mcb, + } +} + +// MenuUpsertBulk is the builder for "upsert"-ing +// a bulk of Menu nodes. +type MenuUpsertBulk struct { + create *MenuCreateBulk +} + +// UpdateNewValues updates the mutable fields using the new values that +// were set on create. Using this option is equivalent to using: +// +// client.Menu.Create(). +// OnConflict( +// sql.ResolveWithNewValues(), +// sql.ResolveWith(func(u *sql.UpdateSet) { +// u.SetIgnore(menu.FieldID) +// }), +// ). +// Exec(ctx) +func (u *MenuUpsertBulk) UpdateNewValues() *MenuUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues()) + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) { + for _, b := range u.create.builders { + if _, exists := b.mutation.ID(); exists { + s.SetIgnore(menu.FieldID) + } + if _, exists := b.mutation.CreateTime(); exists { + s.SetIgnore(menu.FieldCreateTime) + } + } + })) + return u +} + +// Ignore sets each column to itself in case of conflict. +// Using this option is equivalent to using: +// +// client.Menu.Create(). +// OnConflict(sql.ResolveWithIgnore()). +// Exec(ctx) +func (u *MenuUpsertBulk) Ignore() *MenuUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore()) + return u +} + +// DoNothing configures the conflict_action to `DO NOTHING`. +// Supported only by SQLite and PostgreSQL. +func (u *MenuUpsertBulk) DoNothing() *MenuUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.DoNothing()) + return u +} + +// Update allows overriding fields `UPDATE` values. See the MenuCreateBulk.OnConflict +// documentation for more info. +func (u *MenuUpsertBulk) Update(set func(*MenuUpsert)) *MenuUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) { + set(&MenuUpsert{UpdateSet: update}) + })) + return u +} + +// SetStatus sets the "status" field. +func (u *MenuUpsertBulk) SetStatus(v menu.Status) *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.SetStatus(v) + }) +} + +// UpdateStatus sets the "status" field to the value that was provided on create. +func (u *MenuUpsertBulk) UpdateStatus() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.UpdateStatus() + }) +} + +// ClearStatus clears the value of the "status" field. +func (u *MenuUpsertBulk) ClearStatus() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.ClearStatus() + }) +} + +// SetUpdateTime sets the "update_time" field. +func (u *MenuUpsertBulk) SetUpdateTime(v time.Time) *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.SetUpdateTime(v) + }) +} + +// UpdateUpdateTime sets the "update_time" field to the value that was provided on create. +func (u *MenuUpsertBulk) UpdateUpdateTime() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.UpdateUpdateTime() + }) +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (u *MenuUpsertBulk) ClearUpdateTime() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.ClearUpdateTime() + }) +} + +// SetDeleteTime sets the "delete_time" field. +func (u *MenuUpsertBulk) SetDeleteTime(v time.Time) *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.SetDeleteTime(v) + }) +} + +// UpdateDeleteTime sets the "delete_time" field to the value that was provided on create. +func (u *MenuUpsertBulk) UpdateDeleteTime() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.UpdateDeleteTime() + }) +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (u *MenuUpsertBulk) ClearDeleteTime() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.ClearDeleteTime() + }) +} + +// SetCreateBy sets the "create_by" field. +func (u *MenuUpsertBulk) SetCreateBy(v uint32) *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.SetCreateBy(v) + }) +} + +// AddCreateBy adds v to the "create_by" field. +func (u *MenuUpsertBulk) AddCreateBy(v uint32) *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.AddCreateBy(v) + }) +} + +// UpdateCreateBy sets the "create_by" field to the value that was provided on create. +func (u *MenuUpsertBulk) UpdateCreateBy() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.UpdateCreateBy() + }) +} + +// ClearCreateBy clears the value of the "create_by" field. +func (u *MenuUpsertBulk) ClearCreateBy() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.ClearCreateBy() + }) +} + +// SetParentID sets the "parent_id" field. +func (u *MenuUpsertBulk) SetParentID(v int32) *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.SetParentID(v) + }) +} + +// UpdateParentID sets the "parent_id" field to the value that was provided on create. +func (u *MenuUpsertBulk) UpdateParentID() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.UpdateParentID() + }) +} + +// ClearParentID clears the value of the "parent_id" field. +func (u *MenuUpsertBulk) ClearParentID() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.ClearParentID() + }) +} + +// SetOrderNo sets the "order_no" field. +func (u *MenuUpsertBulk) SetOrderNo(v int32) *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.SetOrderNo(v) + }) +} + +// AddOrderNo adds v to the "order_no" field. +func (u *MenuUpsertBulk) AddOrderNo(v int32) *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.AddOrderNo(v) + }) +} + +// UpdateOrderNo sets the "order_no" field to the value that was provided on create. +func (u *MenuUpsertBulk) UpdateOrderNo() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.UpdateOrderNo() + }) +} + +// ClearOrderNo clears the value of the "order_no" field. +func (u *MenuUpsertBulk) ClearOrderNo() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.ClearOrderNo() + }) +} + +// SetName sets the "name" field. +func (u *MenuUpsertBulk) SetName(v string) *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.SetName(v) + }) +} + +// UpdateName sets the "name" field to the value that was provided on create. +func (u *MenuUpsertBulk) UpdateName() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.UpdateName() + }) +} + +// ClearName clears the value of the "name" field. +func (u *MenuUpsertBulk) ClearName() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.ClearName() + }) +} + +// SetTitle sets the "title" field. +func (u *MenuUpsertBulk) SetTitle(v string) *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.SetTitle(v) + }) +} + +// UpdateTitle sets the "title" field to the value that was provided on create. +func (u *MenuUpsertBulk) UpdateTitle() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.UpdateTitle() + }) +} + +// ClearTitle clears the value of the "title" field. +func (u *MenuUpsertBulk) ClearTitle() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.ClearTitle() + }) +} + +// SetType sets the "type" field. +func (u *MenuUpsertBulk) SetType(v menu.Type) *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.SetType(v) + }) +} + +// UpdateType sets the "type" field to the value that was provided on create. +func (u *MenuUpsertBulk) UpdateType() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.UpdateType() + }) +} + +// ClearType clears the value of the "type" field. +func (u *MenuUpsertBulk) ClearType() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.ClearType() + }) +} + +// SetPath sets the "path" field. +func (u *MenuUpsertBulk) SetPath(v string) *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.SetPath(v) + }) +} + +// UpdatePath sets the "path" field to the value that was provided on create. +func (u *MenuUpsertBulk) UpdatePath() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.UpdatePath() + }) +} + +// ClearPath clears the value of the "path" field. +func (u *MenuUpsertBulk) ClearPath() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.ClearPath() + }) +} + +// SetComponent sets the "component" field. +func (u *MenuUpsertBulk) SetComponent(v string) *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.SetComponent(v) + }) +} + +// UpdateComponent sets the "component" field to the value that was provided on create. +func (u *MenuUpsertBulk) UpdateComponent() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.UpdateComponent() + }) +} + +// ClearComponent clears the value of the "component" field. +func (u *MenuUpsertBulk) ClearComponent() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.ClearComponent() + }) +} + +// SetIcon sets the "icon" field. +func (u *MenuUpsertBulk) SetIcon(v string) *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.SetIcon(v) + }) +} + +// UpdateIcon sets the "icon" field to the value that was provided on create. +func (u *MenuUpsertBulk) UpdateIcon() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.UpdateIcon() + }) +} + +// ClearIcon clears the value of the "icon" field. +func (u *MenuUpsertBulk) ClearIcon() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.ClearIcon() + }) +} + +// SetIsExt sets the "is_ext" field. +func (u *MenuUpsertBulk) SetIsExt(v bool) *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.SetIsExt(v) + }) +} + +// UpdateIsExt sets the "is_ext" field to the value that was provided on create. +func (u *MenuUpsertBulk) UpdateIsExt() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.UpdateIsExt() + }) +} + +// ClearIsExt clears the value of the "is_ext" field. +func (u *MenuUpsertBulk) ClearIsExt() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.ClearIsExt() + }) +} + +// SetExtURL sets the "ext_url" field. +func (u *MenuUpsertBulk) SetExtURL(v string) *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.SetExtURL(v) + }) +} + +// UpdateExtURL sets the "ext_url" field to the value that was provided on create. +func (u *MenuUpsertBulk) UpdateExtURL() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.UpdateExtURL() + }) +} + +// ClearExtURL clears the value of the "ext_url" field. +func (u *MenuUpsertBulk) ClearExtURL() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.ClearExtURL() + }) +} + +// SetPermissions sets the "permissions" field. +func (u *MenuUpsertBulk) SetPermissions(v []string) *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.SetPermissions(v) + }) +} + +// UpdatePermissions sets the "permissions" field to the value that was provided on create. +func (u *MenuUpsertBulk) UpdatePermissions() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.UpdatePermissions() + }) +} + +// ClearPermissions clears the value of the "permissions" field. +func (u *MenuUpsertBulk) ClearPermissions() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.ClearPermissions() + }) +} + +// SetRedirect sets the "redirect" field. +func (u *MenuUpsertBulk) SetRedirect(v string) *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.SetRedirect(v) + }) +} + +// UpdateRedirect sets the "redirect" field to the value that was provided on create. +func (u *MenuUpsertBulk) UpdateRedirect() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.UpdateRedirect() + }) +} + +// ClearRedirect clears the value of the "redirect" field. +func (u *MenuUpsertBulk) ClearRedirect() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.ClearRedirect() + }) +} + +// SetCurrentActiveMenu sets the "current_active_menu" field. +func (u *MenuUpsertBulk) SetCurrentActiveMenu(v string) *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.SetCurrentActiveMenu(v) + }) +} + +// UpdateCurrentActiveMenu sets the "current_active_menu" field to the value that was provided on create. +func (u *MenuUpsertBulk) UpdateCurrentActiveMenu() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.UpdateCurrentActiveMenu() + }) +} + +// ClearCurrentActiveMenu clears the value of the "current_active_menu" field. +func (u *MenuUpsertBulk) ClearCurrentActiveMenu() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.ClearCurrentActiveMenu() + }) +} + +// SetKeepAlive sets the "keep_alive" field. +func (u *MenuUpsertBulk) SetKeepAlive(v bool) *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.SetKeepAlive(v) + }) +} + +// UpdateKeepAlive sets the "keep_alive" field to the value that was provided on create. +func (u *MenuUpsertBulk) UpdateKeepAlive() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.UpdateKeepAlive() + }) +} + +// ClearKeepAlive clears the value of the "keep_alive" field. +func (u *MenuUpsertBulk) ClearKeepAlive() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.ClearKeepAlive() + }) +} + +// SetShow sets the "show" field. +func (u *MenuUpsertBulk) SetShow(v bool) *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.SetShow(v) + }) +} + +// UpdateShow sets the "show" field to the value that was provided on create. +func (u *MenuUpsertBulk) UpdateShow() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.UpdateShow() + }) +} + +// ClearShow clears the value of the "show" field. +func (u *MenuUpsertBulk) ClearShow() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.ClearShow() + }) +} + +// SetHideTab sets the "hide_tab" field. +func (u *MenuUpsertBulk) SetHideTab(v bool) *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.SetHideTab(v) + }) +} + +// UpdateHideTab sets the "hide_tab" field to the value that was provided on create. +func (u *MenuUpsertBulk) UpdateHideTab() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.UpdateHideTab() + }) +} + +// ClearHideTab clears the value of the "hide_tab" field. +func (u *MenuUpsertBulk) ClearHideTab() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.ClearHideTab() + }) +} + +// SetHideMenu sets the "hide_menu" field. +func (u *MenuUpsertBulk) SetHideMenu(v bool) *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.SetHideMenu(v) + }) +} + +// UpdateHideMenu sets the "hide_menu" field to the value that was provided on create. +func (u *MenuUpsertBulk) UpdateHideMenu() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.UpdateHideMenu() + }) +} + +// ClearHideMenu clears the value of the "hide_menu" field. +func (u *MenuUpsertBulk) ClearHideMenu() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.ClearHideMenu() + }) +} + +// SetHideBreadcrumb sets the "hide_breadcrumb" field. +func (u *MenuUpsertBulk) SetHideBreadcrumb(v bool) *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.SetHideBreadcrumb(v) + }) +} + +// UpdateHideBreadcrumb sets the "hide_breadcrumb" field to the value that was provided on create. +func (u *MenuUpsertBulk) UpdateHideBreadcrumb() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.UpdateHideBreadcrumb() + }) +} + +// ClearHideBreadcrumb clears the value of the "hide_breadcrumb" field. +func (u *MenuUpsertBulk) ClearHideBreadcrumb() *MenuUpsertBulk { + return u.Update(func(s *MenuUpsert) { + s.ClearHideBreadcrumb() + }) +} + +// Exec executes the query. +func (u *MenuUpsertBulk) Exec(ctx context.Context) error { + if u.create.err != nil { + return u.create.err + } + for i, b := range u.create.builders { + if len(b.conflict) != 0 { + return fmt.Errorf("ent: OnConflict was set for builder %d. Set it on the MenuCreateBulk instead", i) + } + } + if len(u.create.conflict) == 0 { + return errors.New("ent: missing options for MenuCreateBulk.OnConflict") + } + return u.create.Exec(ctx) +} + +// ExecX is like Exec, but panics if an error occurs. +func (u *MenuUpsertBulk) ExecX(ctx context.Context) { + if err := u.create.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/menu_delete.go b/monolithic/backend/app/admin/service/internal/data/ent/menu_delete.go new file mode 100644 index 0000000..63e6562 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/menu_delete.go @@ -0,0 +1,88 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/menu" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// MenuDelete is the builder for deleting a Menu entity. +type MenuDelete struct { + config + hooks []Hook + mutation *MenuMutation +} + +// Where appends a list predicates to the MenuDelete builder. +func (md *MenuDelete) Where(ps ...predicate.Menu) *MenuDelete { + md.mutation.Where(ps...) + return md +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (md *MenuDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, md.sqlExec, md.mutation, md.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (md *MenuDelete) ExecX(ctx context.Context) int { + n, err := md.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (md *MenuDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(menu.Table, sqlgraph.NewFieldSpec(menu.FieldID, field.TypeInt32)) + if ps := md.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, md.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + md.mutation.done = true + return affected, err +} + +// MenuDeleteOne is the builder for deleting a single Menu entity. +type MenuDeleteOne struct { + md *MenuDelete +} + +// Where appends a list predicates to the MenuDelete builder. +func (mdo *MenuDeleteOne) Where(ps ...predicate.Menu) *MenuDeleteOne { + mdo.md.mutation.Where(ps...) + return mdo +} + +// Exec executes the deletion query. +func (mdo *MenuDeleteOne) Exec(ctx context.Context) error { + n, err := mdo.md.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{menu.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (mdo *MenuDeleteOne) ExecX(ctx context.Context) { + if err := mdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/menu_query.go b/monolithic/backend/app/admin/service/internal/data/ent/menu_query.go new file mode 100644 index 0000000..d9bea6e --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/menu_query.go @@ -0,0 +1,706 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "database/sql/driver" + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/menu" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + "math" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// MenuQuery is the builder for querying Menu entities. +type MenuQuery struct { + config + ctx *QueryContext + order []menu.OrderOption + inters []Interceptor + predicates []predicate.Menu + withParent *MenuQuery + withChildren *MenuQuery + modifiers []func(*sql.Selector) + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the MenuQuery builder. +func (mq *MenuQuery) Where(ps ...predicate.Menu) *MenuQuery { + mq.predicates = append(mq.predicates, ps...) + return mq +} + +// Limit the number of records to be returned by this query. +func (mq *MenuQuery) Limit(limit int) *MenuQuery { + mq.ctx.Limit = &limit + return mq +} + +// Offset to start from. +func (mq *MenuQuery) Offset(offset int) *MenuQuery { + mq.ctx.Offset = &offset + return mq +} + +// Unique configures the query builder to filter duplicate records on query. +// By default, unique is set to true, and can be disabled using this method. +func (mq *MenuQuery) Unique(unique bool) *MenuQuery { + mq.ctx.Unique = &unique + return mq +} + +// Order specifies how the records should be ordered. +func (mq *MenuQuery) Order(o ...menu.OrderOption) *MenuQuery { + mq.order = append(mq.order, o...) + return mq +} + +// QueryParent chains the current query on the "parent" edge. +func (mq *MenuQuery) QueryParent() *MenuQuery { + query := (&MenuClient{config: mq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := mq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := mq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(menu.Table, menu.FieldID, selector), + sqlgraph.To(menu.Table, menu.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, menu.ParentTable, menu.ParentColumn), + ) + fromU = sqlgraph.SetNeighbors(mq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryChildren chains the current query on the "children" edge. +func (mq *MenuQuery) QueryChildren() *MenuQuery { + query := (&MenuClient{config: mq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := mq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := mq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(menu.Table, menu.FieldID, selector), + sqlgraph.To(menu.Table, menu.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, menu.ChildrenTable, menu.ChildrenColumn), + ) + fromU = sqlgraph.SetNeighbors(mq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first Menu entity from the query. +// Returns a *NotFoundError when no Menu was found. +func (mq *MenuQuery) First(ctx context.Context) (*Menu, error) { + nodes, err := mq.Limit(1).All(setContextOp(ctx, mq.ctx, "First")) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{menu.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (mq *MenuQuery) FirstX(ctx context.Context) *Menu { + node, err := mq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first Menu ID from the query. +// Returns a *NotFoundError when no Menu ID was found. +func (mq *MenuQuery) FirstID(ctx context.Context) (id int32, err error) { + var ids []int32 + if ids, err = mq.Limit(1).IDs(setContextOp(ctx, mq.ctx, "FirstID")); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{menu.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (mq *MenuQuery) FirstIDX(ctx context.Context) int32 { + id, err := mq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single Menu entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one Menu entity is found. +// Returns a *NotFoundError when no Menu entities are found. +func (mq *MenuQuery) Only(ctx context.Context) (*Menu, error) { + nodes, err := mq.Limit(2).All(setContextOp(ctx, mq.ctx, "Only")) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{menu.Label} + default: + return nil, &NotSingularError{menu.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (mq *MenuQuery) OnlyX(ctx context.Context) *Menu { + node, err := mq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only Menu ID in the query. +// Returns a *NotSingularError when more than one Menu ID is found. +// Returns a *NotFoundError when no entities are found. +func (mq *MenuQuery) OnlyID(ctx context.Context) (id int32, err error) { + var ids []int32 + if ids, err = mq.Limit(2).IDs(setContextOp(ctx, mq.ctx, "OnlyID")); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{menu.Label} + default: + err = &NotSingularError{menu.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (mq *MenuQuery) OnlyIDX(ctx context.Context) int32 { + id, err := mq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of Menus. +func (mq *MenuQuery) All(ctx context.Context) ([]*Menu, error) { + ctx = setContextOp(ctx, mq.ctx, "All") + if err := mq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*Menu, *MenuQuery]() + return withInterceptors[[]*Menu](ctx, mq, qr, mq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (mq *MenuQuery) AllX(ctx context.Context) []*Menu { + nodes, err := mq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of Menu IDs. +func (mq *MenuQuery) IDs(ctx context.Context) (ids []int32, err error) { + if mq.ctx.Unique == nil && mq.path != nil { + mq.Unique(true) + } + ctx = setContextOp(ctx, mq.ctx, "IDs") + if err = mq.Select(menu.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (mq *MenuQuery) IDsX(ctx context.Context) []int32 { + ids, err := mq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (mq *MenuQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, mq.ctx, "Count") + if err := mq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, mq, querierCount[*MenuQuery](), mq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (mq *MenuQuery) CountX(ctx context.Context) int { + count, err := mq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (mq *MenuQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, mq.ctx, "Exist") + switch _, err := mq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("ent: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (mq *MenuQuery) ExistX(ctx context.Context) bool { + exist, err := mq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the MenuQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (mq *MenuQuery) Clone() *MenuQuery { + if mq == nil { + return nil + } + return &MenuQuery{ + config: mq.config, + ctx: mq.ctx.Clone(), + order: append([]menu.OrderOption{}, mq.order...), + inters: append([]Interceptor{}, mq.inters...), + predicates: append([]predicate.Menu{}, mq.predicates...), + withParent: mq.withParent.Clone(), + withChildren: mq.withChildren.Clone(), + // clone intermediate query. + sql: mq.sql.Clone(), + path: mq.path, + } +} + +// WithParent tells the query-builder to eager-load the nodes that are connected to +// the "parent" edge. The optional arguments are used to configure the query builder of the edge. +func (mq *MenuQuery) WithParent(opts ...func(*MenuQuery)) *MenuQuery { + query := (&MenuClient{config: mq.config}).Query() + for _, opt := range opts { + opt(query) + } + mq.withParent = query + return mq +} + +// WithChildren tells the query-builder to eager-load the nodes that are connected to +// the "children" edge. The optional arguments are used to configure the query builder of the edge. +func (mq *MenuQuery) WithChildren(opts ...func(*MenuQuery)) *MenuQuery { + query := (&MenuClient{config: mq.config}).Query() + for _, opt := range opts { + opt(query) + } + mq.withChildren = query + return mq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// Status menu.Status `json:"status,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.Menu.Query(). +// GroupBy(menu.FieldStatus). +// Aggregate(ent.Count()). +// Scan(ctx, &v) +func (mq *MenuQuery) GroupBy(field string, fields ...string) *MenuGroupBy { + mq.ctx.Fields = append([]string{field}, fields...) + grbuild := &MenuGroupBy{build: mq} + grbuild.flds = &mq.ctx.Fields + grbuild.label = menu.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// Status menu.Status `json:"status,omitempty"` +// } +// +// client.Menu.Query(). +// Select(menu.FieldStatus). +// Scan(ctx, &v) +func (mq *MenuQuery) Select(fields ...string) *MenuSelect { + mq.ctx.Fields = append(mq.ctx.Fields, fields...) + sbuild := &MenuSelect{MenuQuery: mq} + sbuild.label = menu.Label + sbuild.flds, sbuild.scan = &mq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a MenuSelect configured with the given aggregations. +func (mq *MenuQuery) Aggregate(fns ...AggregateFunc) *MenuSelect { + return mq.Select().Aggregate(fns...) +} + +func (mq *MenuQuery) prepareQuery(ctx context.Context) error { + for _, inter := range mq.inters { + if inter == nil { + return fmt.Errorf("ent: uninitialized interceptor (forgotten import ent/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, mq); err != nil { + return err + } + } + } + for _, f := range mq.ctx.Fields { + if !menu.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)} + } + } + if mq.path != nil { + prev, err := mq.path(ctx) + if err != nil { + return err + } + mq.sql = prev + } + return nil +} + +func (mq *MenuQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Menu, error) { + var ( + nodes = []*Menu{} + _spec = mq.querySpec() + loadedTypes = [2]bool{ + mq.withParent != nil, + mq.withChildren != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*Menu).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &Menu{config: mq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + if len(mq.modifiers) > 0 { + _spec.Modifiers = mq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, mq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := mq.withParent; query != nil { + if err := mq.loadParent(ctx, query, nodes, nil, + func(n *Menu, e *Menu) { n.Edges.Parent = e }); err != nil { + return nil, err + } + } + if query := mq.withChildren; query != nil { + if err := mq.loadChildren(ctx, query, nodes, + func(n *Menu) { n.Edges.Children = []*Menu{} }, + func(n *Menu, e *Menu) { n.Edges.Children = append(n.Edges.Children, e) }); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (mq *MenuQuery) loadParent(ctx context.Context, query *MenuQuery, nodes []*Menu, init func(*Menu), assign func(*Menu, *Menu)) error { + ids := make([]int32, 0, len(nodes)) + nodeids := make(map[int32][]*Menu) + for i := range nodes { + if nodes[i].ParentID == nil { + continue + } + fk := *nodes[i].ParentID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(menu.IDIn(ids...)) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nodeids[n.ID] + if !ok { + return fmt.Errorf(`unexpected foreign-key "parent_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (mq *MenuQuery) loadChildren(ctx context.Context, query *MenuQuery, nodes []*Menu, init func(*Menu), assign func(*Menu, *Menu)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[int32]*Menu) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(menu.FieldParentID) + } + query.Where(predicate.Menu(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(menu.ChildrenColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.ParentID + if fk == nil { + return fmt.Errorf(`foreign-key "parent_id" is nil for node %v`, n.ID) + } + node, ok := nodeids[*fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "parent_id" returned %v for node %v`, *fk, n.ID) + } + assign(node, n) + } + return nil +} + +func (mq *MenuQuery) sqlCount(ctx context.Context) (int, error) { + _spec := mq.querySpec() + if len(mq.modifiers) > 0 { + _spec.Modifiers = mq.modifiers + } + _spec.Node.Columns = mq.ctx.Fields + if len(mq.ctx.Fields) > 0 { + _spec.Unique = mq.ctx.Unique != nil && *mq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, mq.driver, _spec) +} + +func (mq *MenuQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(menu.Table, menu.Columns, sqlgraph.NewFieldSpec(menu.FieldID, field.TypeInt32)) + _spec.From = mq.sql + if unique := mq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if mq.path != nil { + _spec.Unique = true + } + if fields := mq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, menu.FieldID) + for i := range fields { + if fields[i] != menu.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if mq.withParent != nil { + _spec.Node.AddColumnOnce(menu.FieldParentID) + } + } + if ps := mq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := mq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := mq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := mq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (mq *MenuQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(mq.driver.Dialect()) + t1 := builder.Table(menu.Table) + columns := mq.ctx.Fields + if len(columns) == 0 { + columns = menu.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if mq.sql != nil { + selector = mq.sql + selector.Select(selector.Columns(columns...)...) + } + if mq.ctx.Unique != nil && *mq.ctx.Unique { + selector.Distinct() + } + for _, m := range mq.modifiers { + m(selector) + } + for _, p := range mq.predicates { + p(selector) + } + for _, p := range mq.order { + p(selector) + } + if offset := mq.ctx.Offset; offset != nil { + // limit is mandatory for offset clause. We start + // with default value, and override it below if needed. + selector.Offset(*offset).Limit(math.MaxInt32) + } + if limit := mq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// Modify adds a query modifier for attaching custom logic to queries. +func (mq *MenuQuery) Modify(modifiers ...func(s *sql.Selector)) *MenuSelect { + mq.modifiers = append(mq.modifiers, modifiers...) + return mq.Select() +} + +// MenuGroupBy is the group-by builder for Menu entities. +type MenuGroupBy struct { + selector + build *MenuQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (mgb *MenuGroupBy) Aggregate(fns ...AggregateFunc) *MenuGroupBy { + mgb.fns = append(mgb.fns, fns...) + return mgb +} + +// Scan applies the selector query and scans the result into the given value. +func (mgb *MenuGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, mgb.build.ctx, "GroupBy") + if err := mgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*MenuQuery, *MenuGroupBy](ctx, mgb.build, mgb, mgb.build.inters, v) +} + +func (mgb *MenuGroupBy) sqlScan(ctx context.Context, root *MenuQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(mgb.fns)) + for _, fn := range mgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*mgb.flds)+len(mgb.fns)) + for _, f := range *mgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*mgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := mgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// MenuSelect is the builder for selecting fields of Menu entities. +type MenuSelect struct { + *MenuQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (ms *MenuSelect) Aggregate(fns ...AggregateFunc) *MenuSelect { + ms.fns = append(ms.fns, fns...) + return ms +} + +// Scan applies the selector query and scans the result into the given value. +func (ms *MenuSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ms.ctx, "Select") + if err := ms.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*MenuQuery, *MenuSelect](ctx, ms.MenuQuery, ms, ms.inters, v) +} + +func (ms *MenuSelect) sqlScan(ctx context.Context, root *MenuQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(ms.fns)) + for _, fn := range ms.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*ms.selector.flds); { + case n == 0 && len(aggregation) > 0: + selector.Select(aggregation...) + case n != 0 && len(aggregation) > 0: + selector.AppendSelect(aggregation...) + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := ms.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// Modify adds a query modifier for attaching custom logic to queries. +func (ms *MenuSelect) Modify(modifiers ...func(s *sql.Selector)) *MenuSelect { + ms.modifiers = append(ms.modifiers, modifiers...) + return ms +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/menu_update.go b/monolithic/backend/app/admin/service/internal/data/ent/menu_update.go new file mode 100644 index 0000000..7bb79c7 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/menu_update.go @@ -0,0 +1,1695 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "errors" + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/menu" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" +) + +// MenuUpdate is the builder for updating Menu entities. +type MenuUpdate struct { + config + hooks []Hook + mutation *MenuMutation + modifiers []func(*sql.UpdateBuilder) +} + +// Where appends a list predicates to the MenuUpdate builder. +func (mu *MenuUpdate) Where(ps ...predicate.Menu) *MenuUpdate { + mu.mutation.Where(ps...) + return mu +} + +// SetStatus sets the "status" field. +func (mu *MenuUpdate) SetStatus(m menu.Status) *MenuUpdate { + mu.mutation.SetStatus(m) + return mu +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (mu *MenuUpdate) SetNillableStatus(m *menu.Status) *MenuUpdate { + if m != nil { + mu.SetStatus(*m) + } + return mu +} + +// ClearStatus clears the value of the "status" field. +func (mu *MenuUpdate) ClearStatus() *MenuUpdate { + mu.mutation.ClearStatus() + return mu +} + +// SetUpdateTime sets the "update_time" field. +func (mu *MenuUpdate) SetUpdateTime(t time.Time) *MenuUpdate { + mu.mutation.SetUpdateTime(t) + return mu +} + +// SetNillableUpdateTime sets the "update_time" field if the given value is not nil. +func (mu *MenuUpdate) SetNillableUpdateTime(t *time.Time) *MenuUpdate { + if t != nil { + mu.SetUpdateTime(*t) + } + return mu +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (mu *MenuUpdate) ClearUpdateTime() *MenuUpdate { + mu.mutation.ClearUpdateTime() + return mu +} + +// SetDeleteTime sets the "delete_time" field. +func (mu *MenuUpdate) SetDeleteTime(t time.Time) *MenuUpdate { + mu.mutation.SetDeleteTime(t) + return mu +} + +// SetNillableDeleteTime sets the "delete_time" field if the given value is not nil. +func (mu *MenuUpdate) SetNillableDeleteTime(t *time.Time) *MenuUpdate { + if t != nil { + mu.SetDeleteTime(*t) + } + return mu +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (mu *MenuUpdate) ClearDeleteTime() *MenuUpdate { + mu.mutation.ClearDeleteTime() + return mu +} + +// SetCreateBy sets the "create_by" field. +func (mu *MenuUpdate) SetCreateBy(u uint32) *MenuUpdate { + mu.mutation.ResetCreateBy() + mu.mutation.SetCreateBy(u) + return mu +} + +// SetNillableCreateBy sets the "create_by" field if the given value is not nil. +func (mu *MenuUpdate) SetNillableCreateBy(u *uint32) *MenuUpdate { + if u != nil { + mu.SetCreateBy(*u) + } + return mu +} + +// AddCreateBy adds u to the "create_by" field. +func (mu *MenuUpdate) AddCreateBy(u int32) *MenuUpdate { + mu.mutation.AddCreateBy(u) + return mu +} + +// ClearCreateBy clears the value of the "create_by" field. +func (mu *MenuUpdate) ClearCreateBy() *MenuUpdate { + mu.mutation.ClearCreateBy() + return mu +} + +// SetParentID sets the "parent_id" field. +func (mu *MenuUpdate) SetParentID(i int32) *MenuUpdate { + mu.mutation.SetParentID(i) + return mu +} + +// SetNillableParentID sets the "parent_id" field if the given value is not nil. +func (mu *MenuUpdate) SetNillableParentID(i *int32) *MenuUpdate { + if i != nil { + mu.SetParentID(*i) + } + return mu +} + +// ClearParentID clears the value of the "parent_id" field. +func (mu *MenuUpdate) ClearParentID() *MenuUpdate { + mu.mutation.ClearParentID() + return mu +} + +// SetOrderNo sets the "order_no" field. +func (mu *MenuUpdate) SetOrderNo(i int32) *MenuUpdate { + mu.mutation.ResetOrderNo() + mu.mutation.SetOrderNo(i) + return mu +} + +// SetNillableOrderNo sets the "order_no" field if the given value is not nil. +func (mu *MenuUpdate) SetNillableOrderNo(i *int32) *MenuUpdate { + if i != nil { + mu.SetOrderNo(*i) + } + return mu +} + +// AddOrderNo adds i to the "order_no" field. +func (mu *MenuUpdate) AddOrderNo(i int32) *MenuUpdate { + mu.mutation.AddOrderNo(i) + return mu +} + +// ClearOrderNo clears the value of the "order_no" field. +func (mu *MenuUpdate) ClearOrderNo() *MenuUpdate { + mu.mutation.ClearOrderNo() + return mu +} + +// SetName sets the "name" field. +func (mu *MenuUpdate) SetName(s string) *MenuUpdate { + mu.mutation.SetName(s) + return mu +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (mu *MenuUpdate) SetNillableName(s *string) *MenuUpdate { + if s != nil { + mu.SetName(*s) + } + return mu +} + +// ClearName clears the value of the "name" field. +func (mu *MenuUpdate) ClearName() *MenuUpdate { + mu.mutation.ClearName() + return mu +} + +// SetTitle sets the "title" field. +func (mu *MenuUpdate) SetTitle(s string) *MenuUpdate { + mu.mutation.SetTitle(s) + return mu +} + +// SetNillableTitle sets the "title" field if the given value is not nil. +func (mu *MenuUpdate) SetNillableTitle(s *string) *MenuUpdate { + if s != nil { + mu.SetTitle(*s) + } + return mu +} + +// ClearTitle clears the value of the "title" field. +func (mu *MenuUpdate) ClearTitle() *MenuUpdate { + mu.mutation.ClearTitle() + return mu +} + +// SetType sets the "type" field. +func (mu *MenuUpdate) SetType(m menu.Type) *MenuUpdate { + mu.mutation.SetType(m) + return mu +} + +// SetNillableType sets the "type" field if the given value is not nil. +func (mu *MenuUpdate) SetNillableType(m *menu.Type) *MenuUpdate { + if m != nil { + mu.SetType(*m) + } + return mu +} + +// ClearType clears the value of the "type" field. +func (mu *MenuUpdate) ClearType() *MenuUpdate { + mu.mutation.ClearType() + return mu +} + +// SetPath sets the "path" field. +func (mu *MenuUpdate) SetPath(s string) *MenuUpdate { + mu.mutation.SetPath(s) + return mu +} + +// SetNillablePath sets the "path" field if the given value is not nil. +func (mu *MenuUpdate) SetNillablePath(s *string) *MenuUpdate { + if s != nil { + mu.SetPath(*s) + } + return mu +} + +// ClearPath clears the value of the "path" field. +func (mu *MenuUpdate) ClearPath() *MenuUpdate { + mu.mutation.ClearPath() + return mu +} + +// SetComponent sets the "component" field. +func (mu *MenuUpdate) SetComponent(s string) *MenuUpdate { + mu.mutation.SetComponent(s) + return mu +} + +// SetNillableComponent sets the "component" field if the given value is not nil. +func (mu *MenuUpdate) SetNillableComponent(s *string) *MenuUpdate { + if s != nil { + mu.SetComponent(*s) + } + return mu +} + +// ClearComponent clears the value of the "component" field. +func (mu *MenuUpdate) ClearComponent() *MenuUpdate { + mu.mutation.ClearComponent() + return mu +} + +// SetIcon sets the "icon" field. +func (mu *MenuUpdate) SetIcon(s string) *MenuUpdate { + mu.mutation.SetIcon(s) + return mu +} + +// SetNillableIcon sets the "icon" field if the given value is not nil. +func (mu *MenuUpdate) SetNillableIcon(s *string) *MenuUpdate { + if s != nil { + mu.SetIcon(*s) + } + return mu +} + +// ClearIcon clears the value of the "icon" field. +func (mu *MenuUpdate) ClearIcon() *MenuUpdate { + mu.mutation.ClearIcon() + return mu +} + +// SetIsExt sets the "is_ext" field. +func (mu *MenuUpdate) SetIsExt(b bool) *MenuUpdate { + mu.mutation.SetIsExt(b) + return mu +} + +// SetNillableIsExt sets the "is_ext" field if the given value is not nil. +func (mu *MenuUpdate) SetNillableIsExt(b *bool) *MenuUpdate { + if b != nil { + mu.SetIsExt(*b) + } + return mu +} + +// ClearIsExt clears the value of the "is_ext" field. +func (mu *MenuUpdate) ClearIsExt() *MenuUpdate { + mu.mutation.ClearIsExt() + return mu +} + +// SetExtURL sets the "ext_url" field. +func (mu *MenuUpdate) SetExtURL(s string) *MenuUpdate { + mu.mutation.SetExtURL(s) + return mu +} + +// SetNillableExtURL sets the "ext_url" field if the given value is not nil. +func (mu *MenuUpdate) SetNillableExtURL(s *string) *MenuUpdate { + if s != nil { + mu.SetExtURL(*s) + } + return mu +} + +// ClearExtURL clears the value of the "ext_url" field. +func (mu *MenuUpdate) ClearExtURL() *MenuUpdate { + mu.mutation.ClearExtURL() + return mu +} + +// SetPermissions sets the "permissions" field. +func (mu *MenuUpdate) SetPermissions(s []string) *MenuUpdate { + mu.mutation.SetPermissions(s) + return mu +} + +// AppendPermissions appends s to the "permissions" field. +func (mu *MenuUpdate) AppendPermissions(s []string) *MenuUpdate { + mu.mutation.AppendPermissions(s) + return mu +} + +// ClearPermissions clears the value of the "permissions" field. +func (mu *MenuUpdate) ClearPermissions() *MenuUpdate { + mu.mutation.ClearPermissions() + return mu +} + +// SetRedirect sets the "redirect" field. +func (mu *MenuUpdate) SetRedirect(s string) *MenuUpdate { + mu.mutation.SetRedirect(s) + return mu +} + +// SetNillableRedirect sets the "redirect" field if the given value is not nil. +func (mu *MenuUpdate) SetNillableRedirect(s *string) *MenuUpdate { + if s != nil { + mu.SetRedirect(*s) + } + return mu +} + +// ClearRedirect clears the value of the "redirect" field. +func (mu *MenuUpdate) ClearRedirect() *MenuUpdate { + mu.mutation.ClearRedirect() + return mu +} + +// SetCurrentActiveMenu sets the "current_active_menu" field. +func (mu *MenuUpdate) SetCurrentActiveMenu(s string) *MenuUpdate { + mu.mutation.SetCurrentActiveMenu(s) + return mu +} + +// SetNillableCurrentActiveMenu sets the "current_active_menu" field if the given value is not nil. +func (mu *MenuUpdate) SetNillableCurrentActiveMenu(s *string) *MenuUpdate { + if s != nil { + mu.SetCurrentActiveMenu(*s) + } + return mu +} + +// ClearCurrentActiveMenu clears the value of the "current_active_menu" field. +func (mu *MenuUpdate) ClearCurrentActiveMenu() *MenuUpdate { + mu.mutation.ClearCurrentActiveMenu() + return mu +} + +// SetKeepAlive sets the "keep_alive" field. +func (mu *MenuUpdate) SetKeepAlive(b bool) *MenuUpdate { + mu.mutation.SetKeepAlive(b) + return mu +} + +// SetNillableKeepAlive sets the "keep_alive" field if the given value is not nil. +func (mu *MenuUpdate) SetNillableKeepAlive(b *bool) *MenuUpdate { + if b != nil { + mu.SetKeepAlive(*b) + } + return mu +} + +// ClearKeepAlive clears the value of the "keep_alive" field. +func (mu *MenuUpdate) ClearKeepAlive() *MenuUpdate { + mu.mutation.ClearKeepAlive() + return mu +} + +// SetShow sets the "show" field. +func (mu *MenuUpdate) SetShow(b bool) *MenuUpdate { + mu.mutation.SetShow(b) + return mu +} + +// SetNillableShow sets the "show" field if the given value is not nil. +func (mu *MenuUpdate) SetNillableShow(b *bool) *MenuUpdate { + if b != nil { + mu.SetShow(*b) + } + return mu +} + +// ClearShow clears the value of the "show" field. +func (mu *MenuUpdate) ClearShow() *MenuUpdate { + mu.mutation.ClearShow() + return mu +} + +// SetHideTab sets the "hide_tab" field. +func (mu *MenuUpdate) SetHideTab(b bool) *MenuUpdate { + mu.mutation.SetHideTab(b) + return mu +} + +// SetNillableHideTab sets the "hide_tab" field if the given value is not nil. +func (mu *MenuUpdate) SetNillableHideTab(b *bool) *MenuUpdate { + if b != nil { + mu.SetHideTab(*b) + } + return mu +} + +// ClearHideTab clears the value of the "hide_tab" field. +func (mu *MenuUpdate) ClearHideTab() *MenuUpdate { + mu.mutation.ClearHideTab() + return mu +} + +// SetHideMenu sets the "hide_menu" field. +func (mu *MenuUpdate) SetHideMenu(b bool) *MenuUpdate { + mu.mutation.SetHideMenu(b) + return mu +} + +// SetNillableHideMenu sets the "hide_menu" field if the given value is not nil. +func (mu *MenuUpdate) SetNillableHideMenu(b *bool) *MenuUpdate { + if b != nil { + mu.SetHideMenu(*b) + } + return mu +} + +// ClearHideMenu clears the value of the "hide_menu" field. +func (mu *MenuUpdate) ClearHideMenu() *MenuUpdate { + mu.mutation.ClearHideMenu() + return mu +} + +// SetHideBreadcrumb sets the "hide_breadcrumb" field. +func (mu *MenuUpdate) SetHideBreadcrumb(b bool) *MenuUpdate { + mu.mutation.SetHideBreadcrumb(b) + return mu +} + +// SetNillableHideBreadcrumb sets the "hide_breadcrumb" field if the given value is not nil. +func (mu *MenuUpdate) SetNillableHideBreadcrumb(b *bool) *MenuUpdate { + if b != nil { + mu.SetHideBreadcrumb(*b) + } + return mu +} + +// ClearHideBreadcrumb clears the value of the "hide_breadcrumb" field. +func (mu *MenuUpdate) ClearHideBreadcrumb() *MenuUpdate { + mu.mutation.ClearHideBreadcrumb() + return mu +} + +// SetParent sets the "parent" edge to the Menu entity. +func (mu *MenuUpdate) SetParent(m *Menu) *MenuUpdate { + return mu.SetParentID(m.ID) +} + +// AddChildIDs adds the "children" edge to the Menu entity by IDs. +func (mu *MenuUpdate) AddChildIDs(ids ...int32) *MenuUpdate { + mu.mutation.AddChildIDs(ids...) + return mu +} + +// AddChildren adds the "children" edges to the Menu entity. +func (mu *MenuUpdate) AddChildren(m ...*Menu) *MenuUpdate { + ids := make([]int32, len(m)) + for i := range m { + ids[i] = m[i].ID + } + return mu.AddChildIDs(ids...) +} + +// Mutation returns the MenuMutation object of the builder. +func (mu *MenuUpdate) Mutation() *MenuMutation { + return mu.mutation +} + +// ClearParent clears the "parent" edge to the Menu entity. +func (mu *MenuUpdate) ClearParent() *MenuUpdate { + mu.mutation.ClearParent() + return mu +} + +// ClearChildren clears all "children" edges to the Menu entity. +func (mu *MenuUpdate) ClearChildren() *MenuUpdate { + mu.mutation.ClearChildren() + return mu +} + +// RemoveChildIDs removes the "children" edge to Menu entities by IDs. +func (mu *MenuUpdate) RemoveChildIDs(ids ...int32) *MenuUpdate { + mu.mutation.RemoveChildIDs(ids...) + return mu +} + +// RemoveChildren removes "children" edges to Menu entities. +func (mu *MenuUpdate) RemoveChildren(m ...*Menu) *MenuUpdate { + ids := make([]int32, len(m)) + for i := range m { + ids[i] = m[i].ID + } + return mu.RemoveChildIDs(ids...) +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (mu *MenuUpdate) Save(ctx context.Context) (int, error) { + return withHooks(ctx, mu.sqlSave, mu.mutation, mu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (mu *MenuUpdate) SaveX(ctx context.Context) int { + affected, err := mu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (mu *MenuUpdate) Exec(ctx context.Context) error { + _, err := mu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (mu *MenuUpdate) ExecX(ctx context.Context) { + if err := mu.Exec(ctx); err != nil { + panic(err) + } +} + +// check runs all checks and user-defined validators on the builder. +func (mu *MenuUpdate) check() error { + if v, ok := mu.mutation.Status(); ok { + if err := menu.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "Menu.status": %w`, err)} + } + } + if v, ok := mu.mutation.Name(); ok { + if err := menu.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "Menu.name": %w`, err)} + } + } + if v, ok := mu.mutation.Title(); ok { + if err := menu.TitleValidator(v); err != nil { + return &ValidationError{Name: "title", err: fmt.Errorf(`ent: validator failed for field "Menu.title": %w`, err)} + } + } + if v, ok := mu.mutation.GetType(); ok { + if err := menu.TypeValidator(v); err != nil { + return &ValidationError{Name: "type", err: fmt.Errorf(`ent: validator failed for field "Menu.type": %w`, err)} + } + } + if v, ok := mu.mutation.Icon(); ok { + if err := menu.IconValidator(v); err != nil { + return &ValidationError{Name: "icon", err: fmt.Errorf(`ent: validator failed for field "Menu.icon": %w`, err)} + } + } + if v, ok := mu.mutation.ExtURL(); ok { + if err := menu.ExtURLValidator(v); err != nil { + return &ValidationError{Name: "ext_url", err: fmt.Errorf(`ent: validator failed for field "Menu.ext_url": %w`, err)} + } + } + return nil +} + +// Modify adds a statement modifier for attaching custom logic to the UPDATE statement. +func (mu *MenuUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *MenuUpdate { + mu.modifiers = append(mu.modifiers, modifiers...) + return mu +} + +func (mu *MenuUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := mu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(menu.Table, menu.Columns, sqlgraph.NewFieldSpec(menu.FieldID, field.TypeInt32)) + if ps := mu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if value, ok := mu.mutation.Status(); ok { + _spec.SetField(menu.FieldStatus, field.TypeEnum, value) + } + if mu.mutation.StatusCleared() { + _spec.ClearField(menu.FieldStatus, field.TypeEnum) + } + if mu.mutation.CreateTimeCleared() { + _spec.ClearField(menu.FieldCreateTime, field.TypeTime) + } + if value, ok := mu.mutation.UpdateTime(); ok { + _spec.SetField(menu.FieldUpdateTime, field.TypeTime, value) + } + if mu.mutation.UpdateTimeCleared() { + _spec.ClearField(menu.FieldUpdateTime, field.TypeTime) + } + if value, ok := mu.mutation.DeleteTime(); ok { + _spec.SetField(menu.FieldDeleteTime, field.TypeTime, value) + } + if mu.mutation.DeleteTimeCleared() { + _spec.ClearField(menu.FieldDeleteTime, field.TypeTime) + } + if value, ok := mu.mutation.CreateBy(); ok { + _spec.SetField(menu.FieldCreateBy, field.TypeUint32, value) + } + if value, ok := mu.mutation.AddedCreateBy(); ok { + _spec.AddField(menu.FieldCreateBy, field.TypeUint32, value) + } + if mu.mutation.CreateByCleared() { + _spec.ClearField(menu.FieldCreateBy, field.TypeUint32) + } + if value, ok := mu.mutation.OrderNo(); ok { + _spec.SetField(menu.FieldOrderNo, field.TypeInt32, value) + } + if value, ok := mu.mutation.AddedOrderNo(); ok { + _spec.AddField(menu.FieldOrderNo, field.TypeInt32, value) + } + if mu.mutation.OrderNoCleared() { + _spec.ClearField(menu.FieldOrderNo, field.TypeInt32) + } + if value, ok := mu.mutation.Name(); ok { + _spec.SetField(menu.FieldName, field.TypeString, value) + } + if mu.mutation.NameCleared() { + _spec.ClearField(menu.FieldName, field.TypeString) + } + if value, ok := mu.mutation.Title(); ok { + _spec.SetField(menu.FieldTitle, field.TypeString, value) + } + if mu.mutation.TitleCleared() { + _spec.ClearField(menu.FieldTitle, field.TypeString) + } + if value, ok := mu.mutation.GetType(); ok { + _spec.SetField(menu.FieldType, field.TypeEnum, value) + } + if mu.mutation.TypeCleared() { + _spec.ClearField(menu.FieldType, field.TypeEnum) + } + if value, ok := mu.mutation.Path(); ok { + _spec.SetField(menu.FieldPath, field.TypeString, value) + } + if mu.mutation.PathCleared() { + _spec.ClearField(menu.FieldPath, field.TypeString) + } + if value, ok := mu.mutation.Component(); ok { + _spec.SetField(menu.FieldComponent, field.TypeString, value) + } + if mu.mutation.ComponentCleared() { + _spec.ClearField(menu.FieldComponent, field.TypeString) + } + if value, ok := mu.mutation.Icon(); ok { + _spec.SetField(menu.FieldIcon, field.TypeString, value) + } + if mu.mutation.IconCleared() { + _spec.ClearField(menu.FieldIcon, field.TypeString) + } + if value, ok := mu.mutation.IsExt(); ok { + _spec.SetField(menu.FieldIsExt, field.TypeBool, value) + } + if mu.mutation.IsExtCleared() { + _spec.ClearField(menu.FieldIsExt, field.TypeBool) + } + if value, ok := mu.mutation.ExtURL(); ok { + _spec.SetField(menu.FieldExtURL, field.TypeString, value) + } + if mu.mutation.ExtURLCleared() { + _spec.ClearField(menu.FieldExtURL, field.TypeString) + } + if value, ok := mu.mutation.Permissions(); ok { + _spec.SetField(menu.FieldPermissions, field.TypeJSON, value) + } + if value, ok := mu.mutation.AppendedPermissions(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, menu.FieldPermissions, value) + }) + } + if mu.mutation.PermissionsCleared() { + _spec.ClearField(menu.FieldPermissions, field.TypeJSON) + } + if value, ok := mu.mutation.Redirect(); ok { + _spec.SetField(menu.FieldRedirect, field.TypeString, value) + } + if mu.mutation.RedirectCleared() { + _spec.ClearField(menu.FieldRedirect, field.TypeString) + } + if value, ok := mu.mutation.CurrentActiveMenu(); ok { + _spec.SetField(menu.FieldCurrentActiveMenu, field.TypeString, value) + } + if mu.mutation.CurrentActiveMenuCleared() { + _spec.ClearField(menu.FieldCurrentActiveMenu, field.TypeString) + } + if value, ok := mu.mutation.KeepAlive(); ok { + _spec.SetField(menu.FieldKeepAlive, field.TypeBool, value) + } + if mu.mutation.KeepAliveCleared() { + _spec.ClearField(menu.FieldKeepAlive, field.TypeBool) + } + if value, ok := mu.mutation.Show(); ok { + _spec.SetField(menu.FieldShow, field.TypeBool, value) + } + if mu.mutation.ShowCleared() { + _spec.ClearField(menu.FieldShow, field.TypeBool) + } + if value, ok := mu.mutation.HideTab(); ok { + _spec.SetField(menu.FieldHideTab, field.TypeBool, value) + } + if mu.mutation.HideTabCleared() { + _spec.ClearField(menu.FieldHideTab, field.TypeBool) + } + if value, ok := mu.mutation.HideMenu(); ok { + _spec.SetField(menu.FieldHideMenu, field.TypeBool, value) + } + if mu.mutation.HideMenuCleared() { + _spec.ClearField(menu.FieldHideMenu, field.TypeBool) + } + if value, ok := mu.mutation.HideBreadcrumb(); ok { + _spec.SetField(menu.FieldHideBreadcrumb, field.TypeBool, value) + } + if mu.mutation.HideBreadcrumbCleared() { + _spec.ClearField(menu.FieldHideBreadcrumb, field.TypeBool) + } + if mu.mutation.ParentCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: menu.ParentTable, + Columns: []string{menu.ParentColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(menu.FieldID, field.TypeInt32), + }, + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := mu.mutation.ParentIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: menu.ParentTable, + Columns: []string{menu.ParentColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(menu.FieldID, field.TypeInt32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if mu.mutation.ChildrenCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: menu.ChildrenTable, + Columns: []string{menu.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(menu.FieldID, field.TypeInt32), + }, + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := mu.mutation.RemovedChildrenIDs(); len(nodes) > 0 && !mu.mutation.ChildrenCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: menu.ChildrenTable, + Columns: []string{menu.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(menu.FieldID, field.TypeInt32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := mu.mutation.ChildrenIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: menu.ChildrenTable, + Columns: []string{menu.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(menu.FieldID, field.TypeInt32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.AddModifiers(mu.modifiers...) + if n, err = sqlgraph.UpdateNodes(ctx, mu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{menu.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + mu.mutation.done = true + return n, nil +} + +// MenuUpdateOne is the builder for updating a single Menu entity. +type MenuUpdateOne struct { + config + fields []string + hooks []Hook + mutation *MenuMutation + modifiers []func(*sql.UpdateBuilder) +} + +// SetStatus sets the "status" field. +func (muo *MenuUpdateOne) SetStatus(m menu.Status) *MenuUpdateOne { + muo.mutation.SetStatus(m) + return muo +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (muo *MenuUpdateOne) SetNillableStatus(m *menu.Status) *MenuUpdateOne { + if m != nil { + muo.SetStatus(*m) + } + return muo +} + +// ClearStatus clears the value of the "status" field. +func (muo *MenuUpdateOne) ClearStatus() *MenuUpdateOne { + muo.mutation.ClearStatus() + return muo +} + +// SetUpdateTime sets the "update_time" field. +func (muo *MenuUpdateOne) SetUpdateTime(t time.Time) *MenuUpdateOne { + muo.mutation.SetUpdateTime(t) + return muo +} + +// SetNillableUpdateTime sets the "update_time" field if the given value is not nil. +func (muo *MenuUpdateOne) SetNillableUpdateTime(t *time.Time) *MenuUpdateOne { + if t != nil { + muo.SetUpdateTime(*t) + } + return muo +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (muo *MenuUpdateOne) ClearUpdateTime() *MenuUpdateOne { + muo.mutation.ClearUpdateTime() + return muo +} + +// SetDeleteTime sets the "delete_time" field. +func (muo *MenuUpdateOne) SetDeleteTime(t time.Time) *MenuUpdateOne { + muo.mutation.SetDeleteTime(t) + return muo +} + +// SetNillableDeleteTime sets the "delete_time" field if the given value is not nil. +func (muo *MenuUpdateOne) SetNillableDeleteTime(t *time.Time) *MenuUpdateOne { + if t != nil { + muo.SetDeleteTime(*t) + } + return muo +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (muo *MenuUpdateOne) ClearDeleteTime() *MenuUpdateOne { + muo.mutation.ClearDeleteTime() + return muo +} + +// SetCreateBy sets the "create_by" field. +func (muo *MenuUpdateOne) SetCreateBy(u uint32) *MenuUpdateOne { + muo.mutation.ResetCreateBy() + muo.mutation.SetCreateBy(u) + return muo +} + +// SetNillableCreateBy sets the "create_by" field if the given value is not nil. +func (muo *MenuUpdateOne) SetNillableCreateBy(u *uint32) *MenuUpdateOne { + if u != nil { + muo.SetCreateBy(*u) + } + return muo +} + +// AddCreateBy adds u to the "create_by" field. +func (muo *MenuUpdateOne) AddCreateBy(u int32) *MenuUpdateOne { + muo.mutation.AddCreateBy(u) + return muo +} + +// ClearCreateBy clears the value of the "create_by" field. +func (muo *MenuUpdateOne) ClearCreateBy() *MenuUpdateOne { + muo.mutation.ClearCreateBy() + return muo +} + +// SetParentID sets the "parent_id" field. +func (muo *MenuUpdateOne) SetParentID(i int32) *MenuUpdateOne { + muo.mutation.SetParentID(i) + return muo +} + +// SetNillableParentID sets the "parent_id" field if the given value is not nil. +func (muo *MenuUpdateOne) SetNillableParentID(i *int32) *MenuUpdateOne { + if i != nil { + muo.SetParentID(*i) + } + return muo +} + +// ClearParentID clears the value of the "parent_id" field. +func (muo *MenuUpdateOne) ClearParentID() *MenuUpdateOne { + muo.mutation.ClearParentID() + return muo +} + +// SetOrderNo sets the "order_no" field. +func (muo *MenuUpdateOne) SetOrderNo(i int32) *MenuUpdateOne { + muo.mutation.ResetOrderNo() + muo.mutation.SetOrderNo(i) + return muo +} + +// SetNillableOrderNo sets the "order_no" field if the given value is not nil. +func (muo *MenuUpdateOne) SetNillableOrderNo(i *int32) *MenuUpdateOne { + if i != nil { + muo.SetOrderNo(*i) + } + return muo +} + +// AddOrderNo adds i to the "order_no" field. +func (muo *MenuUpdateOne) AddOrderNo(i int32) *MenuUpdateOne { + muo.mutation.AddOrderNo(i) + return muo +} + +// ClearOrderNo clears the value of the "order_no" field. +func (muo *MenuUpdateOne) ClearOrderNo() *MenuUpdateOne { + muo.mutation.ClearOrderNo() + return muo +} + +// SetName sets the "name" field. +func (muo *MenuUpdateOne) SetName(s string) *MenuUpdateOne { + muo.mutation.SetName(s) + return muo +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (muo *MenuUpdateOne) SetNillableName(s *string) *MenuUpdateOne { + if s != nil { + muo.SetName(*s) + } + return muo +} + +// ClearName clears the value of the "name" field. +func (muo *MenuUpdateOne) ClearName() *MenuUpdateOne { + muo.mutation.ClearName() + return muo +} + +// SetTitle sets the "title" field. +func (muo *MenuUpdateOne) SetTitle(s string) *MenuUpdateOne { + muo.mutation.SetTitle(s) + return muo +} + +// SetNillableTitle sets the "title" field if the given value is not nil. +func (muo *MenuUpdateOne) SetNillableTitle(s *string) *MenuUpdateOne { + if s != nil { + muo.SetTitle(*s) + } + return muo +} + +// ClearTitle clears the value of the "title" field. +func (muo *MenuUpdateOne) ClearTitle() *MenuUpdateOne { + muo.mutation.ClearTitle() + return muo +} + +// SetType sets the "type" field. +func (muo *MenuUpdateOne) SetType(m menu.Type) *MenuUpdateOne { + muo.mutation.SetType(m) + return muo +} + +// SetNillableType sets the "type" field if the given value is not nil. +func (muo *MenuUpdateOne) SetNillableType(m *menu.Type) *MenuUpdateOne { + if m != nil { + muo.SetType(*m) + } + return muo +} + +// ClearType clears the value of the "type" field. +func (muo *MenuUpdateOne) ClearType() *MenuUpdateOne { + muo.mutation.ClearType() + return muo +} + +// SetPath sets the "path" field. +func (muo *MenuUpdateOne) SetPath(s string) *MenuUpdateOne { + muo.mutation.SetPath(s) + return muo +} + +// SetNillablePath sets the "path" field if the given value is not nil. +func (muo *MenuUpdateOne) SetNillablePath(s *string) *MenuUpdateOne { + if s != nil { + muo.SetPath(*s) + } + return muo +} + +// ClearPath clears the value of the "path" field. +func (muo *MenuUpdateOne) ClearPath() *MenuUpdateOne { + muo.mutation.ClearPath() + return muo +} + +// SetComponent sets the "component" field. +func (muo *MenuUpdateOne) SetComponent(s string) *MenuUpdateOne { + muo.mutation.SetComponent(s) + return muo +} + +// SetNillableComponent sets the "component" field if the given value is not nil. +func (muo *MenuUpdateOne) SetNillableComponent(s *string) *MenuUpdateOne { + if s != nil { + muo.SetComponent(*s) + } + return muo +} + +// ClearComponent clears the value of the "component" field. +func (muo *MenuUpdateOne) ClearComponent() *MenuUpdateOne { + muo.mutation.ClearComponent() + return muo +} + +// SetIcon sets the "icon" field. +func (muo *MenuUpdateOne) SetIcon(s string) *MenuUpdateOne { + muo.mutation.SetIcon(s) + return muo +} + +// SetNillableIcon sets the "icon" field if the given value is not nil. +func (muo *MenuUpdateOne) SetNillableIcon(s *string) *MenuUpdateOne { + if s != nil { + muo.SetIcon(*s) + } + return muo +} + +// ClearIcon clears the value of the "icon" field. +func (muo *MenuUpdateOne) ClearIcon() *MenuUpdateOne { + muo.mutation.ClearIcon() + return muo +} + +// SetIsExt sets the "is_ext" field. +func (muo *MenuUpdateOne) SetIsExt(b bool) *MenuUpdateOne { + muo.mutation.SetIsExt(b) + return muo +} + +// SetNillableIsExt sets the "is_ext" field if the given value is not nil. +func (muo *MenuUpdateOne) SetNillableIsExt(b *bool) *MenuUpdateOne { + if b != nil { + muo.SetIsExt(*b) + } + return muo +} + +// ClearIsExt clears the value of the "is_ext" field. +func (muo *MenuUpdateOne) ClearIsExt() *MenuUpdateOne { + muo.mutation.ClearIsExt() + return muo +} + +// SetExtURL sets the "ext_url" field. +func (muo *MenuUpdateOne) SetExtURL(s string) *MenuUpdateOne { + muo.mutation.SetExtURL(s) + return muo +} + +// SetNillableExtURL sets the "ext_url" field if the given value is not nil. +func (muo *MenuUpdateOne) SetNillableExtURL(s *string) *MenuUpdateOne { + if s != nil { + muo.SetExtURL(*s) + } + return muo +} + +// ClearExtURL clears the value of the "ext_url" field. +func (muo *MenuUpdateOne) ClearExtURL() *MenuUpdateOne { + muo.mutation.ClearExtURL() + return muo +} + +// SetPermissions sets the "permissions" field. +func (muo *MenuUpdateOne) SetPermissions(s []string) *MenuUpdateOne { + muo.mutation.SetPermissions(s) + return muo +} + +// AppendPermissions appends s to the "permissions" field. +func (muo *MenuUpdateOne) AppendPermissions(s []string) *MenuUpdateOne { + muo.mutation.AppendPermissions(s) + return muo +} + +// ClearPermissions clears the value of the "permissions" field. +func (muo *MenuUpdateOne) ClearPermissions() *MenuUpdateOne { + muo.mutation.ClearPermissions() + return muo +} + +// SetRedirect sets the "redirect" field. +func (muo *MenuUpdateOne) SetRedirect(s string) *MenuUpdateOne { + muo.mutation.SetRedirect(s) + return muo +} + +// SetNillableRedirect sets the "redirect" field if the given value is not nil. +func (muo *MenuUpdateOne) SetNillableRedirect(s *string) *MenuUpdateOne { + if s != nil { + muo.SetRedirect(*s) + } + return muo +} + +// ClearRedirect clears the value of the "redirect" field. +func (muo *MenuUpdateOne) ClearRedirect() *MenuUpdateOne { + muo.mutation.ClearRedirect() + return muo +} + +// SetCurrentActiveMenu sets the "current_active_menu" field. +func (muo *MenuUpdateOne) SetCurrentActiveMenu(s string) *MenuUpdateOne { + muo.mutation.SetCurrentActiveMenu(s) + return muo +} + +// SetNillableCurrentActiveMenu sets the "current_active_menu" field if the given value is not nil. +func (muo *MenuUpdateOne) SetNillableCurrentActiveMenu(s *string) *MenuUpdateOne { + if s != nil { + muo.SetCurrentActiveMenu(*s) + } + return muo +} + +// ClearCurrentActiveMenu clears the value of the "current_active_menu" field. +func (muo *MenuUpdateOne) ClearCurrentActiveMenu() *MenuUpdateOne { + muo.mutation.ClearCurrentActiveMenu() + return muo +} + +// SetKeepAlive sets the "keep_alive" field. +func (muo *MenuUpdateOne) SetKeepAlive(b bool) *MenuUpdateOne { + muo.mutation.SetKeepAlive(b) + return muo +} + +// SetNillableKeepAlive sets the "keep_alive" field if the given value is not nil. +func (muo *MenuUpdateOne) SetNillableKeepAlive(b *bool) *MenuUpdateOne { + if b != nil { + muo.SetKeepAlive(*b) + } + return muo +} + +// ClearKeepAlive clears the value of the "keep_alive" field. +func (muo *MenuUpdateOne) ClearKeepAlive() *MenuUpdateOne { + muo.mutation.ClearKeepAlive() + return muo +} + +// SetShow sets the "show" field. +func (muo *MenuUpdateOne) SetShow(b bool) *MenuUpdateOne { + muo.mutation.SetShow(b) + return muo +} + +// SetNillableShow sets the "show" field if the given value is not nil. +func (muo *MenuUpdateOne) SetNillableShow(b *bool) *MenuUpdateOne { + if b != nil { + muo.SetShow(*b) + } + return muo +} + +// ClearShow clears the value of the "show" field. +func (muo *MenuUpdateOne) ClearShow() *MenuUpdateOne { + muo.mutation.ClearShow() + return muo +} + +// SetHideTab sets the "hide_tab" field. +func (muo *MenuUpdateOne) SetHideTab(b bool) *MenuUpdateOne { + muo.mutation.SetHideTab(b) + return muo +} + +// SetNillableHideTab sets the "hide_tab" field if the given value is not nil. +func (muo *MenuUpdateOne) SetNillableHideTab(b *bool) *MenuUpdateOne { + if b != nil { + muo.SetHideTab(*b) + } + return muo +} + +// ClearHideTab clears the value of the "hide_tab" field. +func (muo *MenuUpdateOne) ClearHideTab() *MenuUpdateOne { + muo.mutation.ClearHideTab() + return muo +} + +// SetHideMenu sets the "hide_menu" field. +func (muo *MenuUpdateOne) SetHideMenu(b bool) *MenuUpdateOne { + muo.mutation.SetHideMenu(b) + return muo +} + +// SetNillableHideMenu sets the "hide_menu" field if the given value is not nil. +func (muo *MenuUpdateOne) SetNillableHideMenu(b *bool) *MenuUpdateOne { + if b != nil { + muo.SetHideMenu(*b) + } + return muo +} + +// ClearHideMenu clears the value of the "hide_menu" field. +func (muo *MenuUpdateOne) ClearHideMenu() *MenuUpdateOne { + muo.mutation.ClearHideMenu() + return muo +} + +// SetHideBreadcrumb sets the "hide_breadcrumb" field. +func (muo *MenuUpdateOne) SetHideBreadcrumb(b bool) *MenuUpdateOne { + muo.mutation.SetHideBreadcrumb(b) + return muo +} + +// SetNillableHideBreadcrumb sets the "hide_breadcrumb" field if the given value is not nil. +func (muo *MenuUpdateOne) SetNillableHideBreadcrumb(b *bool) *MenuUpdateOne { + if b != nil { + muo.SetHideBreadcrumb(*b) + } + return muo +} + +// ClearHideBreadcrumb clears the value of the "hide_breadcrumb" field. +func (muo *MenuUpdateOne) ClearHideBreadcrumb() *MenuUpdateOne { + muo.mutation.ClearHideBreadcrumb() + return muo +} + +// SetParent sets the "parent" edge to the Menu entity. +func (muo *MenuUpdateOne) SetParent(m *Menu) *MenuUpdateOne { + return muo.SetParentID(m.ID) +} + +// AddChildIDs adds the "children" edge to the Menu entity by IDs. +func (muo *MenuUpdateOne) AddChildIDs(ids ...int32) *MenuUpdateOne { + muo.mutation.AddChildIDs(ids...) + return muo +} + +// AddChildren adds the "children" edges to the Menu entity. +func (muo *MenuUpdateOne) AddChildren(m ...*Menu) *MenuUpdateOne { + ids := make([]int32, len(m)) + for i := range m { + ids[i] = m[i].ID + } + return muo.AddChildIDs(ids...) +} + +// Mutation returns the MenuMutation object of the builder. +func (muo *MenuUpdateOne) Mutation() *MenuMutation { + return muo.mutation +} + +// ClearParent clears the "parent" edge to the Menu entity. +func (muo *MenuUpdateOne) ClearParent() *MenuUpdateOne { + muo.mutation.ClearParent() + return muo +} + +// ClearChildren clears all "children" edges to the Menu entity. +func (muo *MenuUpdateOne) ClearChildren() *MenuUpdateOne { + muo.mutation.ClearChildren() + return muo +} + +// RemoveChildIDs removes the "children" edge to Menu entities by IDs. +func (muo *MenuUpdateOne) RemoveChildIDs(ids ...int32) *MenuUpdateOne { + muo.mutation.RemoveChildIDs(ids...) + return muo +} + +// RemoveChildren removes "children" edges to Menu entities. +func (muo *MenuUpdateOne) RemoveChildren(m ...*Menu) *MenuUpdateOne { + ids := make([]int32, len(m)) + for i := range m { + ids[i] = m[i].ID + } + return muo.RemoveChildIDs(ids...) +} + +// Where appends a list predicates to the MenuUpdate builder. +func (muo *MenuUpdateOne) Where(ps ...predicate.Menu) *MenuUpdateOne { + muo.mutation.Where(ps...) + return muo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (muo *MenuUpdateOne) Select(field string, fields ...string) *MenuUpdateOne { + muo.fields = append([]string{field}, fields...) + return muo +} + +// Save executes the query and returns the updated Menu entity. +func (muo *MenuUpdateOne) Save(ctx context.Context) (*Menu, error) { + return withHooks(ctx, muo.sqlSave, muo.mutation, muo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (muo *MenuUpdateOne) SaveX(ctx context.Context) *Menu { + node, err := muo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (muo *MenuUpdateOne) Exec(ctx context.Context) error { + _, err := muo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (muo *MenuUpdateOne) ExecX(ctx context.Context) { + if err := muo.Exec(ctx); err != nil { + panic(err) + } +} + +// check runs all checks and user-defined validators on the builder. +func (muo *MenuUpdateOne) check() error { + if v, ok := muo.mutation.Status(); ok { + if err := menu.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "Menu.status": %w`, err)} + } + } + if v, ok := muo.mutation.Name(); ok { + if err := menu.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "Menu.name": %w`, err)} + } + } + if v, ok := muo.mutation.Title(); ok { + if err := menu.TitleValidator(v); err != nil { + return &ValidationError{Name: "title", err: fmt.Errorf(`ent: validator failed for field "Menu.title": %w`, err)} + } + } + if v, ok := muo.mutation.GetType(); ok { + if err := menu.TypeValidator(v); err != nil { + return &ValidationError{Name: "type", err: fmt.Errorf(`ent: validator failed for field "Menu.type": %w`, err)} + } + } + if v, ok := muo.mutation.Icon(); ok { + if err := menu.IconValidator(v); err != nil { + return &ValidationError{Name: "icon", err: fmt.Errorf(`ent: validator failed for field "Menu.icon": %w`, err)} + } + } + if v, ok := muo.mutation.ExtURL(); ok { + if err := menu.ExtURLValidator(v); err != nil { + return &ValidationError{Name: "ext_url", err: fmt.Errorf(`ent: validator failed for field "Menu.ext_url": %w`, err)} + } + } + return nil +} + +// Modify adds a statement modifier for attaching custom logic to the UPDATE statement. +func (muo *MenuUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *MenuUpdateOne { + muo.modifiers = append(muo.modifiers, modifiers...) + return muo +} + +func (muo *MenuUpdateOne) sqlSave(ctx context.Context) (_node *Menu, err error) { + if err := muo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(menu.Table, menu.Columns, sqlgraph.NewFieldSpec(menu.FieldID, field.TypeInt32)) + id, ok := muo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`ent: missing "Menu.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := muo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, menu.FieldID) + for _, f := range fields { + if !menu.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)} + } + if f != menu.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := muo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if value, ok := muo.mutation.Status(); ok { + _spec.SetField(menu.FieldStatus, field.TypeEnum, value) + } + if muo.mutation.StatusCleared() { + _spec.ClearField(menu.FieldStatus, field.TypeEnum) + } + if muo.mutation.CreateTimeCleared() { + _spec.ClearField(menu.FieldCreateTime, field.TypeTime) + } + if value, ok := muo.mutation.UpdateTime(); ok { + _spec.SetField(menu.FieldUpdateTime, field.TypeTime, value) + } + if muo.mutation.UpdateTimeCleared() { + _spec.ClearField(menu.FieldUpdateTime, field.TypeTime) + } + if value, ok := muo.mutation.DeleteTime(); ok { + _spec.SetField(menu.FieldDeleteTime, field.TypeTime, value) + } + if muo.mutation.DeleteTimeCleared() { + _spec.ClearField(menu.FieldDeleteTime, field.TypeTime) + } + if value, ok := muo.mutation.CreateBy(); ok { + _spec.SetField(menu.FieldCreateBy, field.TypeUint32, value) + } + if value, ok := muo.mutation.AddedCreateBy(); ok { + _spec.AddField(menu.FieldCreateBy, field.TypeUint32, value) + } + if muo.mutation.CreateByCleared() { + _spec.ClearField(menu.FieldCreateBy, field.TypeUint32) + } + if value, ok := muo.mutation.OrderNo(); ok { + _spec.SetField(menu.FieldOrderNo, field.TypeInt32, value) + } + if value, ok := muo.mutation.AddedOrderNo(); ok { + _spec.AddField(menu.FieldOrderNo, field.TypeInt32, value) + } + if muo.mutation.OrderNoCleared() { + _spec.ClearField(menu.FieldOrderNo, field.TypeInt32) + } + if value, ok := muo.mutation.Name(); ok { + _spec.SetField(menu.FieldName, field.TypeString, value) + } + if muo.mutation.NameCleared() { + _spec.ClearField(menu.FieldName, field.TypeString) + } + if value, ok := muo.mutation.Title(); ok { + _spec.SetField(menu.FieldTitle, field.TypeString, value) + } + if muo.mutation.TitleCleared() { + _spec.ClearField(menu.FieldTitle, field.TypeString) + } + if value, ok := muo.mutation.GetType(); ok { + _spec.SetField(menu.FieldType, field.TypeEnum, value) + } + if muo.mutation.TypeCleared() { + _spec.ClearField(menu.FieldType, field.TypeEnum) + } + if value, ok := muo.mutation.Path(); ok { + _spec.SetField(menu.FieldPath, field.TypeString, value) + } + if muo.mutation.PathCleared() { + _spec.ClearField(menu.FieldPath, field.TypeString) + } + if value, ok := muo.mutation.Component(); ok { + _spec.SetField(menu.FieldComponent, field.TypeString, value) + } + if muo.mutation.ComponentCleared() { + _spec.ClearField(menu.FieldComponent, field.TypeString) + } + if value, ok := muo.mutation.Icon(); ok { + _spec.SetField(menu.FieldIcon, field.TypeString, value) + } + if muo.mutation.IconCleared() { + _spec.ClearField(menu.FieldIcon, field.TypeString) + } + if value, ok := muo.mutation.IsExt(); ok { + _spec.SetField(menu.FieldIsExt, field.TypeBool, value) + } + if muo.mutation.IsExtCleared() { + _spec.ClearField(menu.FieldIsExt, field.TypeBool) + } + if value, ok := muo.mutation.ExtURL(); ok { + _spec.SetField(menu.FieldExtURL, field.TypeString, value) + } + if muo.mutation.ExtURLCleared() { + _spec.ClearField(menu.FieldExtURL, field.TypeString) + } + if value, ok := muo.mutation.Permissions(); ok { + _spec.SetField(menu.FieldPermissions, field.TypeJSON, value) + } + if value, ok := muo.mutation.AppendedPermissions(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, menu.FieldPermissions, value) + }) + } + if muo.mutation.PermissionsCleared() { + _spec.ClearField(menu.FieldPermissions, field.TypeJSON) + } + if value, ok := muo.mutation.Redirect(); ok { + _spec.SetField(menu.FieldRedirect, field.TypeString, value) + } + if muo.mutation.RedirectCleared() { + _spec.ClearField(menu.FieldRedirect, field.TypeString) + } + if value, ok := muo.mutation.CurrentActiveMenu(); ok { + _spec.SetField(menu.FieldCurrentActiveMenu, field.TypeString, value) + } + if muo.mutation.CurrentActiveMenuCleared() { + _spec.ClearField(menu.FieldCurrentActiveMenu, field.TypeString) + } + if value, ok := muo.mutation.KeepAlive(); ok { + _spec.SetField(menu.FieldKeepAlive, field.TypeBool, value) + } + if muo.mutation.KeepAliveCleared() { + _spec.ClearField(menu.FieldKeepAlive, field.TypeBool) + } + if value, ok := muo.mutation.Show(); ok { + _spec.SetField(menu.FieldShow, field.TypeBool, value) + } + if muo.mutation.ShowCleared() { + _spec.ClearField(menu.FieldShow, field.TypeBool) + } + if value, ok := muo.mutation.HideTab(); ok { + _spec.SetField(menu.FieldHideTab, field.TypeBool, value) + } + if muo.mutation.HideTabCleared() { + _spec.ClearField(menu.FieldHideTab, field.TypeBool) + } + if value, ok := muo.mutation.HideMenu(); ok { + _spec.SetField(menu.FieldHideMenu, field.TypeBool, value) + } + if muo.mutation.HideMenuCleared() { + _spec.ClearField(menu.FieldHideMenu, field.TypeBool) + } + if value, ok := muo.mutation.HideBreadcrumb(); ok { + _spec.SetField(menu.FieldHideBreadcrumb, field.TypeBool, value) + } + if muo.mutation.HideBreadcrumbCleared() { + _spec.ClearField(menu.FieldHideBreadcrumb, field.TypeBool) + } + if muo.mutation.ParentCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: menu.ParentTable, + Columns: []string{menu.ParentColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(menu.FieldID, field.TypeInt32), + }, + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := muo.mutation.ParentIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: menu.ParentTable, + Columns: []string{menu.ParentColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(menu.FieldID, field.TypeInt32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if muo.mutation.ChildrenCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: menu.ChildrenTable, + Columns: []string{menu.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(menu.FieldID, field.TypeInt32), + }, + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := muo.mutation.RemovedChildrenIDs(); len(nodes) > 0 && !muo.mutation.ChildrenCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: menu.ChildrenTable, + Columns: []string{menu.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(menu.FieldID, field.TypeInt32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := muo.mutation.ChildrenIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: menu.ChildrenTable, + Columns: []string{menu.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(menu.FieldID, field.TypeInt32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.AddModifiers(muo.modifiers...) + _node = &Menu{config: muo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, muo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{menu.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + muo.mutation.done = true + return _node, nil +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/migrate/migrate.go b/monolithic/backend/app/admin/service/internal/data/ent/migrate/migrate.go new file mode 100644 index 0000000..1956a6b --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/migrate/migrate.go @@ -0,0 +1,64 @@ +// Code generated by ent, DO NOT EDIT. + +package migrate + +import ( + "context" + "fmt" + "io" + + "entgo.io/ent/dialect" + "entgo.io/ent/dialect/sql/schema" +) + +var ( + // WithGlobalUniqueID sets the universal ids options to the migration. + // If this option is enabled, ent migration will allocate a 1<<32 range + // for the ids of each entity (table). + // Note that this option cannot be applied on tables that already exist. + WithGlobalUniqueID = schema.WithGlobalUniqueID + // WithDropColumn sets the drop column option to the migration. + // If this option is enabled, ent migration will drop old columns + // that were used for both fields and edges. This defaults to false. + WithDropColumn = schema.WithDropColumn + // WithDropIndex sets the drop index option to the migration. + // If this option is enabled, ent migration will drop old indexes + // that were defined in the schema. This defaults to false. + // Note that unique constraints are defined using `UNIQUE INDEX`, + // and therefore, it's recommended to enable this option to get more + // flexibility in the schema changes. + WithDropIndex = schema.WithDropIndex + // WithForeignKeys enables creating foreign-key in schema DDL. This defaults to true. + WithForeignKeys = schema.WithForeignKeys +) + +// Schema is the API for creating, migrating and dropping a schema. +type Schema struct { + drv dialect.Driver +} + +// NewSchema creates a new schema client. +func NewSchema(drv dialect.Driver) *Schema { return &Schema{drv: drv} } + +// Create creates all schema resources. +func (s *Schema) Create(ctx context.Context, opts ...schema.MigrateOption) error { + return Create(ctx, s, Tables, opts...) +} + +// Create creates all table resources using the given schema driver. +func Create(ctx context.Context, s *Schema, tables []*schema.Table, opts ...schema.MigrateOption) error { + migrate, err := schema.NewMigrate(s.drv, opts...) + if err != nil { + return fmt.Errorf("ent/migrate: %w", err) + } + return migrate.Create(ctx, tables...) +} + +// WriteTo writes the schema changes to w instead of running them against the database. +// +// if err := client.Schema.WriteTo(context.Background(), os.Stdout); err != nil { +// log.Fatal(err) +// } +func (s *Schema) WriteTo(ctx context.Context, w io.Writer, opts ...schema.MigrateOption) error { + return Create(ctx, &Schema{drv: &schema.WriteDriver{Writer: w, Driver: s.drv}}, Tables, opts...) +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/migrate/schema.go b/monolithic/backend/app/admin/service/internal/data/ent/migrate/schema.go new file mode 100644 index 0000000..a46b618 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/migrate/schema.go @@ -0,0 +1,301 @@ +// Code generated by ent, DO NOT EDIT. + +package migrate + +import ( + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/dialect/sql/schema" + "entgo.io/ent/schema/field" +) + +var ( + // DictColumns holds the columns for the "dict" table. + DictColumns = []*schema.Column{ + {Name: "id", Type: field.TypeUint32, Increment: true, Comment: "id", SchemaType: map[string]string{"mysql": "int", "postgres": "serial"}}, + {Name: "create_time", Type: field.TypeTime, Nullable: true, Comment: "创建时间"}, + {Name: "update_time", Type: field.TypeTime, Nullable: true, Comment: "更新时间"}, + {Name: "delete_time", Type: field.TypeTime, Nullable: true, Comment: "删除时间"}, + {Name: "create_by", Type: field.TypeUint32, Nullable: true, Comment: "创建者ID"}, + {Name: "name", Type: field.TypeString, Unique: true, Nullable: true, Comment: "字典名称"}, + {Name: "description", Type: field.TypeString, Nullable: true, Comment: "描述"}, + } + // DictTable holds the schema information for the "dict" table. + DictTable = &schema.Table{ + Name: "dict", + Columns: DictColumns, + PrimaryKey: []*schema.Column{DictColumns[0]}, + Indexes: []*schema.Index{ + { + Name: "dict_id", + Unique: false, + Columns: []*schema.Column{DictColumns[0]}, + }, + }, + } + // DictDetailColumns holds the columns for the "dict_detail" table. + DictDetailColumns = []*schema.Column{ + {Name: "id", Type: field.TypeUint32, Increment: true, Comment: "id", SchemaType: map[string]string{"mysql": "int", "postgres": "serial"}}, + {Name: "create_time", Type: field.TypeTime, Nullable: true, Comment: "创建时间"}, + {Name: "update_time", Type: field.TypeTime, Nullable: true, Comment: "更新时间"}, + {Name: "delete_time", Type: field.TypeTime, Nullable: true, Comment: "删除时间"}, + {Name: "create_by", Type: field.TypeUint32, Nullable: true, Comment: "创建者ID"}, + {Name: "dict_id", Type: field.TypeUint32, Nullable: true, Comment: "字典ID", Default: 0}, + {Name: "order_no", Type: field.TypeInt32, Nullable: true, Comment: "排序ID", Default: 0}, + {Name: "label", Type: field.TypeString, Nullable: true, Comment: "字典标签"}, + {Name: "value", Type: field.TypeString, Nullable: true, Comment: "字典值"}, + } + // DictDetailTable holds the schema information for the "dict_detail" table. + DictDetailTable = &schema.Table{ + Name: "dict_detail", + Columns: DictDetailColumns, + PrimaryKey: []*schema.Column{DictDetailColumns[0]}, + Indexes: []*schema.Index{ + { + Name: "dictdetail_id", + Unique: false, + Columns: []*schema.Column{DictDetailColumns[0]}, + }, + }, + } + // MenuColumns holds the columns for the "menu" table. + MenuColumns = []*schema.Column{ + {Name: "id", Type: field.TypeInt32, Increment: true, Comment: "id"}, + {Name: "status", Type: field.TypeEnum, Nullable: true, Comment: "状态", Enums: []string{"OFF", "ON"}, Default: "ON"}, + {Name: "create_time", Type: field.TypeTime, Nullable: true, Comment: "创建时间"}, + {Name: "update_time", Type: field.TypeTime, Nullable: true, Comment: "更新时间"}, + {Name: "delete_time", Type: field.TypeTime, Nullable: true, Comment: "删除时间"}, + {Name: "create_by", Type: field.TypeUint32, Nullable: true, Comment: "创建者ID"}, + {Name: "order_no", Type: field.TypeInt32, Nullable: true, Comment: "排序ID", Default: 0}, + {Name: "name", Type: field.TypeString, Nullable: true, Size: 32, Comment: "菜单名称", Default: ""}, + {Name: "title", Type: field.TypeString, Nullable: true, Comment: "菜单标题", Default: ""}, + {Name: "type", Type: field.TypeEnum, Nullable: true, Comment: "菜单类型 FOLDER: 目录 MENU: 菜单 BUTTON: 按钮", Enums: []string{"FOLDER", "MENU", "BUTTON"}}, + {Name: "path", Type: field.TypeString, Nullable: true, Comment: "路径,当其类型为'按钮'的时候对应的数据操作名,例如:/user.service.v1.UserService/Login", Default: ""}, + {Name: "component", Type: field.TypeString, Nullable: true, Comment: "前端页面组件", Default: ""}, + {Name: "icon", Type: field.TypeString, Nullable: true, Size: 128, Comment: "图标", Default: ""}, + {Name: "is_ext", Type: field.TypeBool, Nullable: true, Comment: "是否外链", Default: false}, + {Name: "ext_url", Type: field.TypeString, Nullable: true, Size: 255, Comment: "外链地址"}, + {Name: "permissions", Type: field.TypeJSON, Nullable: true, Comment: "权限代码 例如:sys:menu", SchemaType: map[string]string{"mysql": "json", "postgres": "jsonb"}}, + {Name: "redirect", Type: field.TypeString, Nullable: true, Comment: "跳转路径"}, + {Name: "current_active_menu", Type: field.TypeString, Nullable: true, Comment: "当前激活路径"}, + {Name: "keep_alive", Type: field.TypeBool, Nullable: true, Comment: "是否缓存", Default: false}, + {Name: "show", Type: field.TypeBool, Nullable: true, Comment: "是否显示", Default: true}, + {Name: "hide_tab", Type: field.TypeBool, Nullable: true, Comment: "是否显示在标签页导航", Default: true}, + {Name: "hide_menu", Type: field.TypeBool, Nullable: true, Comment: "是否显示在菜单导航", Default: true}, + {Name: "hide_breadcrumb", Type: field.TypeBool, Nullable: true, Comment: "是否显示在面包屑导航", Default: true}, + {Name: "parent_id", Type: field.TypeInt32, Nullable: true, Comment: "上一层菜单ID"}, + } + // MenuTable holds the schema information for the "menu" table. + MenuTable = &schema.Table{ + Name: "menu", + Columns: MenuColumns, + PrimaryKey: []*schema.Column{MenuColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "menu_menu_children", + Columns: []*schema.Column{MenuColumns[23]}, + RefColumns: []*schema.Column{MenuColumns[0]}, + OnDelete: schema.SetNull, + }, + }, + } + // OrganizationColumns holds the columns for the "organization" table. + OrganizationColumns = []*schema.Column{ + {Name: "id", Type: field.TypeUint32, Increment: true, Comment: "id", SchemaType: map[string]string{"mysql": "int", "postgres": "serial"}}, + {Name: "create_time", Type: field.TypeTime, Nullable: true, Comment: "创建时间"}, + {Name: "update_time", Type: field.TypeTime, Nullable: true, Comment: "更新时间"}, + {Name: "delete_time", Type: field.TypeTime, Nullable: true, Comment: "删除时间"}, + {Name: "status", Type: field.TypeEnum, Nullable: true, Comment: "状态", Enums: []string{"OFF", "ON"}, Default: "ON"}, + {Name: "create_by", Type: field.TypeUint32, Nullable: true, Comment: "创建者ID"}, + {Name: "remark", Type: field.TypeString, Nullable: true, Comment: "备注", Default: ""}, + {Name: "name", Type: field.TypeString, Nullable: true, Size: 128, Comment: "名字", Default: ""}, + {Name: "order_no", Type: field.TypeInt32, Nullable: true, Comment: "排序ID", Default: 0}, + {Name: "parent_id", Type: field.TypeUint32, Nullable: true, Comment: "上一层部门ID", SchemaType: map[string]string{"mysql": "int", "postgres": "serial"}}, + } + // OrganizationTable holds the schema information for the "organization" table. + OrganizationTable = &schema.Table{ + Name: "organization", + Columns: OrganizationColumns, + PrimaryKey: []*schema.Column{OrganizationColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "organization_organization_children", + Columns: []*schema.Column{OrganizationColumns[9]}, + RefColumns: []*schema.Column{OrganizationColumns[0]}, + OnDelete: schema.SetNull, + }, + }, + Indexes: []*schema.Index{ + { + Name: "organization_id", + Unique: false, + Columns: []*schema.Column{OrganizationColumns[0]}, + }, + }, + } + // PositionColumns holds the columns for the "position" table. + PositionColumns = []*schema.Column{ + {Name: "id", Type: field.TypeUint32, Increment: true, Comment: "id", SchemaType: map[string]string{"mysql": "int", "postgres": "serial"}}, + {Name: "create_time", Type: field.TypeTime, Nullable: true, Comment: "创建时间"}, + {Name: "update_time", Type: field.TypeTime, Nullable: true, Comment: "更新时间"}, + {Name: "delete_time", Type: field.TypeTime, Nullable: true, Comment: "删除时间"}, + {Name: "status", Type: field.TypeEnum, Nullable: true, Comment: "状态", Enums: []string{"OFF", "ON"}, Default: "ON"}, + {Name: "create_by", Type: field.TypeUint32, Nullable: true, Comment: "创建者ID"}, + {Name: "remark", Type: field.TypeString, Nullable: true, Comment: "备注", Default: ""}, + {Name: "name", Type: field.TypeString, Size: 128, Comment: "角色名称", Default: ""}, + {Name: "code", Type: field.TypeString, Size: 128, Comment: "角色标识", Default: ""}, + {Name: "order_no", Type: field.TypeInt32, Comment: "排序ID", Default: 0}, + {Name: "parent_id", Type: field.TypeUint32, Nullable: true, Comment: "上一层角色ID", Default: 0, SchemaType: map[string]string{"mysql": "int", "postgres": "serial"}}, + } + // PositionTable holds the schema information for the "position" table. + PositionTable = &schema.Table{ + Name: "position", + Columns: PositionColumns, + PrimaryKey: []*schema.Column{PositionColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "position_position_children", + Columns: []*schema.Column{PositionColumns[10]}, + RefColumns: []*schema.Column{PositionColumns[0]}, + OnDelete: schema.SetNull, + }, + }, + Indexes: []*schema.Index{ + { + Name: "position_id", + Unique: false, + Columns: []*schema.Column{PositionColumns[0]}, + }, + }, + } + // RoleColumns holds the columns for the "role" table. + RoleColumns = []*schema.Column{ + {Name: "id", Type: field.TypeUint32, Increment: true, Comment: "id", SchemaType: map[string]string{"mysql": "int", "postgres": "serial"}}, + {Name: "create_time", Type: field.TypeTime, Nullable: true, Comment: "创建时间"}, + {Name: "update_time", Type: field.TypeTime, Nullable: true, Comment: "更新时间"}, + {Name: "delete_time", Type: field.TypeTime, Nullable: true, Comment: "删除时间"}, + {Name: "status", Type: field.TypeEnum, Nullable: true, Comment: "状态", Enums: []string{"OFF", "ON"}, Default: "ON"}, + {Name: "create_by", Type: field.TypeUint32, Nullable: true, Comment: "创建者ID"}, + {Name: "remark", Type: field.TypeString, Nullable: true, Comment: "备注", Default: ""}, + {Name: "name", Type: field.TypeString, Unique: true, Nullable: true, Size: 128, Comment: "角色名称"}, + {Name: "code", Type: field.TypeString, Nullable: true, Size: 128, Comment: "角色标识", Default: ""}, + {Name: "order_no", Type: field.TypeInt32, Nullable: true, Comment: "排序ID", Default: 0}, + {Name: "parent_id", Type: field.TypeUint32, Nullable: true, Comment: "上一层角色ID", SchemaType: map[string]string{"mysql": "int", "postgres": "serial"}}, + } + // RoleTable holds the schema information for the "role" table. + RoleTable = &schema.Table{ + Name: "role", + Columns: RoleColumns, + PrimaryKey: []*schema.Column{RoleColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "role_role_children", + Columns: []*schema.Column{RoleColumns[10]}, + RefColumns: []*schema.Column{RoleColumns[0]}, + OnDelete: schema.SetNull, + }, + }, + Indexes: []*schema.Index{ + { + Name: "role_id", + Unique: false, + Columns: []*schema.Column{RoleColumns[0]}, + }, + }, + } + // UserColumns holds the columns for the "user" table. + UserColumns = []*schema.Column{ + {Name: "id", Type: field.TypeUint32, Increment: true, Comment: "id", SchemaType: map[string]string{"mysql": "int", "postgres": "serial"}}, + {Name: "create_by", Type: field.TypeUint32, Nullable: true, Comment: "创建者ID"}, + {Name: "create_time", Type: field.TypeTime, Nullable: true, Comment: "创建时间"}, + {Name: "update_time", Type: field.TypeTime, Nullable: true, Comment: "更新时间"}, + {Name: "delete_time", Type: field.TypeTime, Nullable: true, Comment: "删除时间"}, + {Name: "status", Type: field.TypeEnum, Nullable: true, Comment: "状态", Enums: []string{"OFF", "ON"}, Default: "ON"}, + {Name: "username", Type: field.TypeString, Unique: true, Nullable: true, Size: 50, Comment: "用户名"}, + {Name: "password", Type: field.TypeString, Nullable: true, Size: 255, Comment: "登陆密码"}, + {Name: "role_id", Type: field.TypeUint32, Nullable: true, Comment: "角色ID"}, + {Name: "org_id", Type: field.TypeUint32, Nullable: true, Comment: "部门ID"}, + {Name: "position_id", Type: field.TypeUint32, Nullable: true, Comment: "职位ID"}, + {Name: "work_id", Type: field.TypeUint32, Nullable: true, Comment: "员工工号"}, + {Name: "nick_name", Type: field.TypeString, Nullable: true, Size: 128, Comment: "昵称"}, + {Name: "real_name", Type: field.TypeString, Nullable: true, Size: 128, Comment: "真实名字"}, + {Name: "email", Type: field.TypeString, Nullable: true, Size: 127, Comment: "电子邮箱"}, + {Name: "phone", Type: field.TypeString, Nullable: true, Size: 11, Comment: "手机号码", Default: ""}, + {Name: "avatar", Type: field.TypeString, Nullable: true, Size: 1023, Comment: "头像"}, + {Name: "gender", Type: field.TypeEnum, Nullable: true, Comment: "性别", Enums: []string{"UNKNOWN", "MALE", "FEMALE"}}, + {Name: "address", Type: field.TypeString, Nullable: true, Size: 2048, Comment: "地址", Default: ""}, + {Name: "description", Type: field.TypeString, Nullable: true, Size: 1023, Comment: "个人说明"}, + {Name: "authority", Type: field.TypeEnum, Nullable: true, Comment: "授权", Enums: []string{"SYS_ADMIN", "CUSTOMER_USER", "GUEST_USER", "REFRESH_TOKEN"}, Default: "CUSTOMER_USER"}, + {Name: "last_login_time", Type: field.TypeInt64, Nullable: true, Comment: "最后一次登陆的时间"}, + {Name: "last_login_ip", Type: field.TypeString, Nullable: true, Size: 64, Comment: "最后一次登陆的IP", Default: ""}, + } + // UserTable holds the schema information for the "user" table. + UserTable = &schema.Table{ + Name: "user", + Columns: UserColumns, + PrimaryKey: []*schema.Column{UserColumns[0]}, + Indexes: []*schema.Index{ + { + Name: "user_id", + Unique: false, + Columns: []*schema.Column{UserColumns[0]}, + }, + { + Name: "user_id_username", + Unique: true, + Columns: []*schema.Column{UserColumns[0], UserColumns[6]}, + }, + }, + } + // Tables holds all the tables in the schema. + Tables = []*schema.Table{ + DictTable, + DictDetailTable, + MenuTable, + OrganizationTable, + PositionTable, + RoleTable, + UserTable, + } +) + +func init() { + DictTable.Annotation = &entsql.Annotation{ + Table: "dict", + Charset: "utf8mb4", + Collation: "utf8mb4_bin", + } + DictDetailTable.Annotation = &entsql.Annotation{ + Table: "dict_detail", + Charset: "utf8mb4", + Collation: "utf8mb4_bin", + } + MenuTable.ForeignKeys[0].RefTable = MenuTable + MenuTable.Annotation = &entsql.Annotation{ + Table: "menu", + Charset: "utf8mb4", + Collation: "utf8mb4_bin", + } + OrganizationTable.ForeignKeys[0].RefTable = OrganizationTable + OrganizationTable.Annotation = &entsql.Annotation{ + Table: "organization", + Charset: "utf8mb4", + Collation: "utf8mb4_bin", + } + PositionTable.ForeignKeys[0].RefTable = PositionTable + PositionTable.Annotation = &entsql.Annotation{ + Table: "position", + Charset: "utf8mb4", + Collation: "utf8mb4_bin", + } + RoleTable.ForeignKeys[0].RefTable = RoleTable + RoleTable.Annotation = &entsql.Annotation{ + Table: "role", + Charset: "utf8mb4", + Collation: "utf8mb4_bin", + } + UserTable.Annotation = &entsql.Annotation{ + Table: "user", + Charset: "utf8mb4", + Collation: "utf8mb4_bin", + } +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/mutation.go b/monolithic/backend/app/admin/service/internal/data/ent/mutation.go new file mode 100644 index 0000000..1201508 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/mutation.go @@ -0,0 +1,9579 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "errors" + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/dict" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/dictdetail" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/menu" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/organization" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/position" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/role" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/user" + "sync" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" +) + +const ( + // Operation types. + OpCreate = ent.OpCreate + OpDelete = ent.OpDelete + OpDeleteOne = ent.OpDeleteOne + OpUpdate = ent.OpUpdate + OpUpdateOne = ent.OpUpdateOne + + // Node types. + TypeDict = "Dict" + TypeDictDetail = "DictDetail" + TypeMenu = "Menu" + TypeOrganization = "Organization" + TypePosition = "Position" + TypeRole = "Role" + TypeUser = "User" +) + +// DictMutation represents an operation that mutates the Dict nodes in the graph. +type DictMutation struct { + config + op Op + typ string + id *uint32 + create_time *time.Time + update_time *time.Time + delete_time *time.Time + create_by *uint32 + addcreate_by *int32 + name *string + description *string + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*Dict, error) + predicates []predicate.Dict +} + +var _ ent.Mutation = (*DictMutation)(nil) + +// dictOption allows management of the mutation configuration using functional options. +type dictOption func(*DictMutation) + +// newDictMutation creates new mutation for the Dict entity. +func newDictMutation(c config, op Op, opts ...dictOption) *DictMutation { + m := &DictMutation{ + config: c, + op: op, + typ: TypeDict, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withDictID sets the ID field of the mutation. +func withDictID(id uint32) dictOption { + return func(m *DictMutation) { + var ( + err error + once sync.Once + value *Dict + ) + m.oldValue = func(ctx context.Context) (*Dict, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Dict.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withDict sets the old Dict of the mutation. +func withDict(node *Dict) dictOption { + return func(m *DictMutation) { + m.oldValue = func(context.Context) (*Dict, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m DictMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m DictMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of Dict entities. +func (m *DictMutation) SetID(id uint32) { + m.id = &id +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *DictMutation) ID() (id uint32, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *DictMutation) IDs(ctx context.Context) ([]uint32, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []uint32{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().Dict.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreateTime sets the "create_time" field. +func (m *DictMutation) SetCreateTime(t time.Time) { + m.create_time = &t +} + +// CreateTime returns the value of the "create_time" field in the mutation. +func (m *DictMutation) CreateTime() (r time.Time, exists bool) { + v := m.create_time + if v == nil { + return + } + return *v, true +} + +// OldCreateTime returns the old "create_time" field's value of the Dict entity. +// If the Dict object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *DictMutation) OldCreateTime(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreateTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreateTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreateTime: %w", err) + } + return oldValue.CreateTime, nil +} + +// ClearCreateTime clears the value of the "create_time" field. +func (m *DictMutation) ClearCreateTime() { + m.create_time = nil + m.clearedFields[dict.FieldCreateTime] = struct{}{} +} + +// CreateTimeCleared returns if the "create_time" field was cleared in this mutation. +func (m *DictMutation) CreateTimeCleared() bool { + _, ok := m.clearedFields[dict.FieldCreateTime] + return ok +} + +// ResetCreateTime resets all changes to the "create_time" field. +func (m *DictMutation) ResetCreateTime() { + m.create_time = nil + delete(m.clearedFields, dict.FieldCreateTime) +} + +// SetUpdateTime sets the "update_time" field. +func (m *DictMutation) SetUpdateTime(t time.Time) { + m.update_time = &t +} + +// UpdateTime returns the value of the "update_time" field in the mutation. +func (m *DictMutation) UpdateTime() (r time.Time, exists bool) { + v := m.update_time + if v == nil { + return + } + return *v, true +} + +// OldUpdateTime returns the old "update_time" field's value of the Dict entity. +// If the Dict object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *DictMutation) OldUpdateTime(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdateTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdateTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdateTime: %w", err) + } + return oldValue.UpdateTime, nil +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (m *DictMutation) ClearUpdateTime() { + m.update_time = nil + m.clearedFields[dict.FieldUpdateTime] = struct{}{} +} + +// UpdateTimeCleared returns if the "update_time" field was cleared in this mutation. +func (m *DictMutation) UpdateTimeCleared() bool { + _, ok := m.clearedFields[dict.FieldUpdateTime] + return ok +} + +// ResetUpdateTime resets all changes to the "update_time" field. +func (m *DictMutation) ResetUpdateTime() { + m.update_time = nil + delete(m.clearedFields, dict.FieldUpdateTime) +} + +// SetDeleteTime sets the "delete_time" field. +func (m *DictMutation) SetDeleteTime(t time.Time) { + m.delete_time = &t +} + +// DeleteTime returns the value of the "delete_time" field in the mutation. +func (m *DictMutation) DeleteTime() (r time.Time, exists bool) { + v := m.delete_time + if v == nil { + return + } + return *v, true +} + +// OldDeleteTime returns the old "delete_time" field's value of the Dict entity. +// If the Dict object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *DictMutation) OldDeleteTime(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeleteTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeleteTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeleteTime: %w", err) + } + return oldValue.DeleteTime, nil +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (m *DictMutation) ClearDeleteTime() { + m.delete_time = nil + m.clearedFields[dict.FieldDeleteTime] = struct{}{} +} + +// DeleteTimeCleared returns if the "delete_time" field was cleared in this mutation. +func (m *DictMutation) DeleteTimeCleared() bool { + _, ok := m.clearedFields[dict.FieldDeleteTime] + return ok +} + +// ResetDeleteTime resets all changes to the "delete_time" field. +func (m *DictMutation) ResetDeleteTime() { + m.delete_time = nil + delete(m.clearedFields, dict.FieldDeleteTime) +} + +// SetCreateBy sets the "create_by" field. +func (m *DictMutation) SetCreateBy(u uint32) { + m.create_by = &u + m.addcreate_by = nil +} + +// CreateBy returns the value of the "create_by" field in the mutation. +func (m *DictMutation) CreateBy() (r uint32, exists bool) { + v := m.create_by + if v == nil { + return + } + return *v, true +} + +// OldCreateBy returns the old "create_by" field's value of the Dict entity. +// If the Dict object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *DictMutation) OldCreateBy(ctx context.Context) (v *uint32, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreateBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreateBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreateBy: %w", err) + } + return oldValue.CreateBy, nil +} + +// AddCreateBy adds u to the "create_by" field. +func (m *DictMutation) AddCreateBy(u int32) { + if m.addcreate_by != nil { + *m.addcreate_by += u + } else { + m.addcreate_by = &u + } +} + +// AddedCreateBy returns the value that was added to the "create_by" field in this mutation. +func (m *DictMutation) AddedCreateBy() (r int32, exists bool) { + v := m.addcreate_by + if v == nil { + return + } + return *v, true +} + +// ClearCreateBy clears the value of the "create_by" field. +func (m *DictMutation) ClearCreateBy() { + m.create_by = nil + m.addcreate_by = nil + m.clearedFields[dict.FieldCreateBy] = struct{}{} +} + +// CreateByCleared returns if the "create_by" field was cleared in this mutation. +func (m *DictMutation) CreateByCleared() bool { + _, ok := m.clearedFields[dict.FieldCreateBy] + return ok +} + +// ResetCreateBy resets all changes to the "create_by" field. +func (m *DictMutation) ResetCreateBy() { + m.create_by = nil + m.addcreate_by = nil + delete(m.clearedFields, dict.FieldCreateBy) +} + +// SetName sets the "name" field. +func (m *DictMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *DictMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the Dict entity. +// If the Dict object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *DictMutation) OldName(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ClearName clears the value of the "name" field. +func (m *DictMutation) ClearName() { + m.name = nil + m.clearedFields[dict.FieldName] = struct{}{} +} + +// NameCleared returns if the "name" field was cleared in this mutation. +func (m *DictMutation) NameCleared() bool { + _, ok := m.clearedFields[dict.FieldName] + return ok +} + +// ResetName resets all changes to the "name" field. +func (m *DictMutation) ResetName() { + m.name = nil + delete(m.clearedFields, dict.FieldName) +} + +// SetDescription sets the "description" field. +func (m *DictMutation) SetDescription(s string) { + m.description = &s +} + +// Description returns the value of the "description" field in the mutation. +func (m *DictMutation) Description() (r string, exists bool) { + v := m.description + if v == nil { + return + } + return *v, true +} + +// OldDescription returns the old "description" field's value of the Dict entity. +// If the Dict object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *DictMutation) OldDescription(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDescription is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDescription requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDescription: %w", err) + } + return oldValue.Description, nil +} + +// ClearDescription clears the value of the "description" field. +func (m *DictMutation) ClearDescription() { + m.description = nil + m.clearedFields[dict.FieldDescription] = struct{}{} +} + +// DescriptionCleared returns if the "description" field was cleared in this mutation. +func (m *DictMutation) DescriptionCleared() bool { + _, ok := m.clearedFields[dict.FieldDescription] + return ok +} + +// ResetDescription resets all changes to the "description" field. +func (m *DictMutation) ResetDescription() { + m.description = nil + delete(m.clearedFields, dict.FieldDescription) +} + +// Where appends a list predicates to the DictMutation builder. +func (m *DictMutation) Where(ps ...predicate.Dict) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the DictMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *DictMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.Dict, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *DictMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *DictMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (Dict). +func (m *DictMutation) Type() string { + return m.typ +} + +// Fields returns all fields that were changed during this mutation. Note that in +// order to get all numeric fields that were incremented/decremented, call +// AddedFields(). +func (m *DictMutation) Fields() []string { + fields := make([]string, 0, 6) + if m.create_time != nil { + fields = append(fields, dict.FieldCreateTime) + } + if m.update_time != nil { + fields = append(fields, dict.FieldUpdateTime) + } + if m.delete_time != nil { + fields = append(fields, dict.FieldDeleteTime) + } + if m.create_by != nil { + fields = append(fields, dict.FieldCreateBy) + } + if m.name != nil { + fields = append(fields, dict.FieldName) + } + if m.description != nil { + fields = append(fields, dict.FieldDescription) + } + return fields +} + +// Field returns the value of a field with the given name. The second boolean +// return value indicates that this field was not set, or was not defined in the +// schema. +func (m *DictMutation) Field(name string) (ent.Value, bool) { + switch name { + case dict.FieldCreateTime: + return m.CreateTime() + case dict.FieldUpdateTime: + return m.UpdateTime() + case dict.FieldDeleteTime: + return m.DeleteTime() + case dict.FieldCreateBy: + return m.CreateBy() + case dict.FieldName: + return m.Name() + case dict.FieldDescription: + return m.Description() + } + return nil, false +} + +// OldField returns the old value of the field from the database. An error is +// returned if the mutation operation is not UpdateOne, or the query to the +// database failed. +func (m *DictMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case dict.FieldCreateTime: + return m.OldCreateTime(ctx) + case dict.FieldUpdateTime: + return m.OldUpdateTime(ctx) + case dict.FieldDeleteTime: + return m.OldDeleteTime(ctx) + case dict.FieldCreateBy: + return m.OldCreateBy(ctx) + case dict.FieldName: + return m.OldName(ctx) + case dict.FieldDescription: + return m.OldDescription(ctx) + } + return nil, fmt.Errorf("unknown Dict field %s", name) +} + +// SetField sets the value of a field with the given name. It returns an error if +// the field is not defined in the schema, or if the type mismatched the field +// type. +func (m *DictMutation) SetField(name string, value ent.Value) error { + switch name { + case dict.FieldCreateTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreateTime(v) + return nil + case dict.FieldUpdateTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdateTime(v) + return nil + case dict.FieldDeleteTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeleteTime(v) + return nil + case dict.FieldCreateBy: + v, ok := value.(uint32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreateBy(v) + return nil + case dict.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + case dict.FieldDescription: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDescription(v) + return nil + } + return fmt.Errorf("unknown Dict field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *DictMutation) AddedFields() []string { + var fields []string + if m.addcreate_by != nil { + fields = append(fields, dict.FieldCreateBy) + } + return fields +} + +// AddedField returns the numeric value that was incremented/decremented on a field +// with the given name. The second boolean return value indicates that this field +// was not set, or was not defined in the schema. +func (m *DictMutation) AddedField(name string) (ent.Value, bool) { + switch name { + case dict.FieldCreateBy: + return m.AddedCreateBy() + } + return nil, false +} + +// AddField adds the value to the field with the given name. It returns an error if +// the field is not defined in the schema, or if the type mismatched the field +// type. +func (m *DictMutation) AddField(name string, value ent.Value) error { + switch name { + case dict.FieldCreateBy: + v, ok := value.(int32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddCreateBy(v) + return nil + } + return fmt.Errorf("unknown Dict numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *DictMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(dict.FieldCreateTime) { + fields = append(fields, dict.FieldCreateTime) + } + if m.FieldCleared(dict.FieldUpdateTime) { + fields = append(fields, dict.FieldUpdateTime) + } + if m.FieldCleared(dict.FieldDeleteTime) { + fields = append(fields, dict.FieldDeleteTime) + } + if m.FieldCleared(dict.FieldCreateBy) { + fields = append(fields, dict.FieldCreateBy) + } + if m.FieldCleared(dict.FieldName) { + fields = append(fields, dict.FieldName) + } + if m.FieldCleared(dict.FieldDescription) { + fields = append(fields, dict.FieldDescription) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *DictMutation) FieldCleared(name string) bool { + _, ok := m.clearedFields[name] + return ok +} + +// ClearField clears the value of the field with the given name. It returns an +// error if the field is not defined in the schema. +func (m *DictMutation) ClearField(name string) error { + switch name { + case dict.FieldCreateTime: + m.ClearCreateTime() + return nil + case dict.FieldUpdateTime: + m.ClearUpdateTime() + return nil + case dict.FieldDeleteTime: + m.ClearDeleteTime() + return nil + case dict.FieldCreateBy: + m.ClearCreateBy() + return nil + case dict.FieldName: + m.ClearName() + return nil + case dict.FieldDescription: + m.ClearDescription() + return nil + } + return fmt.Errorf("unknown Dict nullable field %s", name) +} + +// ResetField resets all changes in the mutation for the field with the given name. +// It returns an error if the field is not defined in the schema. +func (m *DictMutation) ResetField(name string) error { + switch name { + case dict.FieldCreateTime: + m.ResetCreateTime() + return nil + case dict.FieldUpdateTime: + m.ResetUpdateTime() + return nil + case dict.FieldDeleteTime: + m.ResetDeleteTime() + return nil + case dict.FieldCreateBy: + m.ResetCreateBy() + return nil + case dict.FieldName: + m.ResetName() + return nil + case dict.FieldDescription: + m.ResetDescription() + return nil + } + return fmt.Errorf("unknown Dict field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *DictMutation) AddedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *DictMutation) AddedIDs(name string) []ent.Value { + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *DictMutation) RemovedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *DictMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *DictMutation) ClearedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *DictMutation) EdgeCleared(name string) bool { + return false +} + +// ClearEdge clears the value of the edge with the given name. It returns an error +// if that edge is not defined in the schema. +func (m *DictMutation) ClearEdge(name string) error { + return fmt.Errorf("unknown Dict unique edge %s", name) +} + +// ResetEdge resets all changes to the edge with the given name in this mutation. +// It returns an error if the edge is not defined in the schema. +func (m *DictMutation) ResetEdge(name string) error { + return fmt.Errorf("unknown Dict edge %s", name) +} + +// DictDetailMutation represents an operation that mutates the DictDetail nodes in the graph. +type DictDetailMutation struct { + config + op Op + typ string + id *uint32 + create_time *time.Time + update_time *time.Time + delete_time *time.Time + create_by *uint32 + addcreate_by *int32 + dict_id *uint32 + adddict_id *int32 + order_no *int32 + addorder_no *int32 + label *string + value *string + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*DictDetail, error) + predicates []predicate.DictDetail +} + +var _ ent.Mutation = (*DictDetailMutation)(nil) + +// dictdetailOption allows management of the mutation configuration using functional options. +type dictdetailOption func(*DictDetailMutation) + +// newDictDetailMutation creates new mutation for the DictDetail entity. +func newDictDetailMutation(c config, op Op, opts ...dictdetailOption) *DictDetailMutation { + m := &DictDetailMutation{ + config: c, + op: op, + typ: TypeDictDetail, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withDictDetailID sets the ID field of the mutation. +func withDictDetailID(id uint32) dictdetailOption { + return func(m *DictDetailMutation) { + var ( + err error + once sync.Once + value *DictDetail + ) + m.oldValue = func(ctx context.Context) (*DictDetail, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().DictDetail.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withDictDetail sets the old DictDetail of the mutation. +func withDictDetail(node *DictDetail) dictdetailOption { + return func(m *DictDetailMutation) { + m.oldValue = func(context.Context) (*DictDetail, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m DictDetailMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m DictDetailMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of DictDetail entities. +func (m *DictDetailMutation) SetID(id uint32) { + m.id = &id +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *DictDetailMutation) ID() (id uint32, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *DictDetailMutation) IDs(ctx context.Context) ([]uint32, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []uint32{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().DictDetail.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreateTime sets the "create_time" field. +func (m *DictDetailMutation) SetCreateTime(t time.Time) { + m.create_time = &t +} + +// CreateTime returns the value of the "create_time" field in the mutation. +func (m *DictDetailMutation) CreateTime() (r time.Time, exists bool) { + v := m.create_time + if v == nil { + return + } + return *v, true +} + +// OldCreateTime returns the old "create_time" field's value of the DictDetail entity. +// If the DictDetail object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *DictDetailMutation) OldCreateTime(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreateTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreateTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreateTime: %w", err) + } + return oldValue.CreateTime, nil +} + +// ClearCreateTime clears the value of the "create_time" field. +func (m *DictDetailMutation) ClearCreateTime() { + m.create_time = nil + m.clearedFields[dictdetail.FieldCreateTime] = struct{}{} +} + +// CreateTimeCleared returns if the "create_time" field was cleared in this mutation. +func (m *DictDetailMutation) CreateTimeCleared() bool { + _, ok := m.clearedFields[dictdetail.FieldCreateTime] + return ok +} + +// ResetCreateTime resets all changes to the "create_time" field. +func (m *DictDetailMutation) ResetCreateTime() { + m.create_time = nil + delete(m.clearedFields, dictdetail.FieldCreateTime) +} + +// SetUpdateTime sets the "update_time" field. +func (m *DictDetailMutation) SetUpdateTime(t time.Time) { + m.update_time = &t +} + +// UpdateTime returns the value of the "update_time" field in the mutation. +func (m *DictDetailMutation) UpdateTime() (r time.Time, exists bool) { + v := m.update_time + if v == nil { + return + } + return *v, true +} + +// OldUpdateTime returns the old "update_time" field's value of the DictDetail entity. +// If the DictDetail object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *DictDetailMutation) OldUpdateTime(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdateTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdateTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdateTime: %w", err) + } + return oldValue.UpdateTime, nil +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (m *DictDetailMutation) ClearUpdateTime() { + m.update_time = nil + m.clearedFields[dictdetail.FieldUpdateTime] = struct{}{} +} + +// UpdateTimeCleared returns if the "update_time" field was cleared in this mutation. +func (m *DictDetailMutation) UpdateTimeCleared() bool { + _, ok := m.clearedFields[dictdetail.FieldUpdateTime] + return ok +} + +// ResetUpdateTime resets all changes to the "update_time" field. +func (m *DictDetailMutation) ResetUpdateTime() { + m.update_time = nil + delete(m.clearedFields, dictdetail.FieldUpdateTime) +} + +// SetDeleteTime sets the "delete_time" field. +func (m *DictDetailMutation) SetDeleteTime(t time.Time) { + m.delete_time = &t +} + +// DeleteTime returns the value of the "delete_time" field in the mutation. +func (m *DictDetailMutation) DeleteTime() (r time.Time, exists bool) { + v := m.delete_time + if v == nil { + return + } + return *v, true +} + +// OldDeleteTime returns the old "delete_time" field's value of the DictDetail entity. +// If the DictDetail object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *DictDetailMutation) OldDeleteTime(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeleteTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeleteTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeleteTime: %w", err) + } + return oldValue.DeleteTime, nil +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (m *DictDetailMutation) ClearDeleteTime() { + m.delete_time = nil + m.clearedFields[dictdetail.FieldDeleteTime] = struct{}{} +} + +// DeleteTimeCleared returns if the "delete_time" field was cleared in this mutation. +func (m *DictDetailMutation) DeleteTimeCleared() bool { + _, ok := m.clearedFields[dictdetail.FieldDeleteTime] + return ok +} + +// ResetDeleteTime resets all changes to the "delete_time" field. +func (m *DictDetailMutation) ResetDeleteTime() { + m.delete_time = nil + delete(m.clearedFields, dictdetail.FieldDeleteTime) +} + +// SetCreateBy sets the "create_by" field. +func (m *DictDetailMutation) SetCreateBy(u uint32) { + m.create_by = &u + m.addcreate_by = nil +} + +// CreateBy returns the value of the "create_by" field in the mutation. +func (m *DictDetailMutation) CreateBy() (r uint32, exists bool) { + v := m.create_by + if v == nil { + return + } + return *v, true +} + +// OldCreateBy returns the old "create_by" field's value of the DictDetail entity. +// If the DictDetail object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *DictDetailMutation) OldCreateBy(ctx context.Context) (v *uint32, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreateBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreateBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreateBy: %w", err) + } + return oldValue.CreateBy, nil +} + +// AddCreateBy adds u to the "create_by" field. +func (m *DictDetailMutation) AddCreateBy(u int32) { + if m.addcreate_by != nil { + *m.addcreate_by += u + } else { + m.addcreate_by = &u + } +} + +// AddedCreateBy returns the value that was added to the "create_by" field in this mutation. +func (m *DictDetailMutation) AddedCreateBy() (r int32, exists bool) { + v := m.addcreate_by + if v == nil { + return + } + return *v, true +} + +// ClearCreateBy clears the value of the "create_by" field. +func (m *DictDetailMutation) ClearCreateBy() { + m.create_by = nil + m.addcreate_by = nil + m.clearedFields[dictdetail.FieldCreateBy] = struct{}{} +} + +// CreateByCleared returns if the "create_by" field was cleared in this mutation. +func (m *DictDetailMutation) CreateByCleared() bool { + _, ok := m.clearedFields[dictdetail.FieldCreateBy] + return ok +} + +// ResetCreateBy resets all changes to the "create_by" field. +func (m *DictDetailMutation) ResetCreateBy() { + m.create_by = nil + m.addcreate_by = nil + delete(m.clearedFields, dictdetail.FieldCreateBy) +} + +// SetDictID sets the "dict_id" field. +func (m *DictDetailMutation) SetDictID(u uint32) { + m.dict_id = &u + m.adddict_id = nil +} + +// DictID returns the value of the "dict_id" field in the mutation. +func (m *DictDetailMutation) DictID() (r uint32, exists bool) { + v := m.dict_id + if v == nil { + return + } + return *v, true +} + +// OldDictID returns the old "dict_id" field's value of the DictDetail entity. +// If the DictDetail object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *DictDetailMutation) OldDictID(ctx context.Context) (v *uint32, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDictID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDictID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDictID: %w", err) + } + return oldValue.DictID, nil +} + +// AddDictID adds u to the "dict_id" field. +func (m *DictDetailMutation) AddDictID(u int32) { + if m.adddict_id != nil { + *m.adddict_id += u + } else { + m.adddict_id = &u + } +} + +// AddedDictID returns the value that was added to the "dict_id" field in this mutation. +func (m *DictDetailMutation) AddedDictID() (r int32, exists bool) { + v := m.adddict_id + if v == nil { + return + } + return *v, true +} + +// ClearDictID clears the value of the "dict_id" field. +func (m *DictDetailMutation) ClearDictID() { + m.dict_id = nil + m.adddict_id = nil + m.clearedFields[dictdetail.FieldDictID] = struct{}{} +} + +// DictIDCleared returns if the "dict_id" field was cleared in this mutation. +func (m *DictDetailMutation) DictIDCleared() bool { + _, ok := m.clearedFields[dictdetail.FieldDictID] + return ok +} + +// ResetDictID resets all changes to the "dict_id" field. +func (m *DictDetailMutation) ResetDictID() { + m.dict_id = nil + m.adddict_id = nil + delete(m.clearedFields, dictdetail.FieldDictID) +} + +// SetOrderNo sets the "order_no" field. +func (m *DictDetailMutation) SetOrderNo(i int32) { + m.order_no = &i + m.addorder_no = nil +} + +// OrderNo returns the value of the "order_no" field in the mutation. +func (m *DictDetailMutation) OrderNo() (r int32, exists bool) { + v := m.order_no + if v == nil { + return + } + return *v, true +} + +// OldOrderNo returns the old "order_no" field's value of the DictDetail entity. +// If the DictDetail object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *DictDetailMutation) OldOrderNo(ctx context.Context) (v *int32, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOrderNo is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOrderNo requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOrderNo: %w", err) + } + return oldValue.OrderNo, nil +} + +// AddOrderNo adds i to the "order_no" field. +func (m *DictDetailMutation) AddOrderNo(i int32) { + if m.addorder_no != nil { + *m.addorder_no += i + } else { + m.addorder_no = &i + } +} + +// AddedOrderNo returns the value that was added to the "order_no" field in this mutation. +func (m *DictDetailMutation) AddedOrderNo() (r int32, exists bool) { + v := m.addorder_no + if v == nil { + return + } + return *v, true +} + +// ClearOrderNo clears the value of the "order_no" field. +func (m *DictDetailMutation) ClearOrderNo() { + m.order_no = nil + m.addorder_no = nil + m.clearedFields[dictdetail.FieldOrderNo] = struct{}{} +} + +// OrderNoCleared returns if the "order_no" field was cleared in this mutation. +func (m *DictDetailMutation) OrderNoCleared() bool { + _, ok := m.clearedFields[dictdetail.FieldOrderNo] + return ok +} + +// ResetOrderNo resets all changes to the "order_no" field. +func (m *DictDetailMutation) ResetOrderNo() { + m.order_no = nil + m.addorder_no = nil + delete(m.clearedFields, dictdetail.FieldOrderNo) +} + +// SetLabel sets the "label" field. +func (m *DictDetailMutation) SetLabel(s string) { + m.label = &s +} + +// Label returns the value of the "label" field in the mutation. +func (m *DictDetailMutation) Label() (r string, exists bool) { + v := m.label + if v == nil { + return + } + return *v, true +} + +// OldLabel returns the old "label" field's value of the DictDetail entity. +// If the DictDetail object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *DictDetailMutation) OldLabel(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldLabel is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldLabel requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLabel: %w", err) + } + return oldValue.Label, nil +} + +// ClearLabel clears the value of the "label" field. +func (m *DictDetailMutation) ClearLabel() { + m.label = nil + m.clearedFields[dictdetail.FieldLabel] = struct{}{} +} + +// LabelCleared returns if the "label" field was cleared in this mutation. +func (m *DictDetailMutation) LabelCleared() bool { + _, ok := m.clearedFields[dictdetail.FieldLabel] + return ok +} + +// ResetLabel resets all changes to the "label" field. +func (m *DictDetailMutation) ResetLabel() { + m.label = nil + delete(m.clearedFields, dictdetail.FieldLabel) +} + +// SetValue sets the "value" field. +func (m *DictDetailMutation) SetValue(s string) { + m.value = &s +} + +// Value returns the value of the "value" field in the mutation. +func (m *DictDetailMutation) Value() (r string, exists bool) { + v := m.value + if v == nil { + return + } + return *v, true +} + +// OldValue returns the old "value" field's value of the DictDetail entity. +// If the DictDetail object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *DictDetailMutation) OldValue(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldValue is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldValue requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldValue: %w", err) + } + return oldValue.Value, nil +} + +// ClearValue clears the value of the "value" field. +func (m *DictDetailMutation) ClearValue() { + m.value = nil + m.clearedFields[dictdetail.FieldValue] = struct{}{} +} + +// ValueCleared returns if the "value" field was cleared in this mutation. +func (m *DictDetailMutation) ValueCleared() bool { + _, ok := m.clearedFields[dictdetail.FieldValue] + return ok +} + +// ResetValue resets all changes to the "value" field. +func (m *DictDetailMutation) ResetValue() { + m.value = nil + delete(m.clearedFields, dictdetail.FieldValue) +} + +// Where appends a list predicates to the DictDetailMutation builder. +func (m *DictDetailMutation) Where(ps ...predicate.DictDetail) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the DictDetailMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *DictDetailMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.DictDetail, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *DictDetailMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *DictDetailMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (DictDetail). +func (m *DictDetailMutation) Type() string { + return m.typ +} + +// Fields returns all fields that were changed during this mutation. Note that in +// order to get all numeric fields that were incremented/decremented, call +// AddedFields(). +func (m *DictDetailMutation) Fields() []string { + fields := make([]string, 0, 8) + if m.create_time != nil { + fields = append(fields, dictdetail.FieldCreateTime) + } + if m.update_time != nil { + fields = append(fields, dictdetail.FieldUpdateTime) + } + if m.delete_time != nil { + fields = append(fields, dictdetail.FieldDeleteTime) + } + if m.create_by != nil { + fields = append(fields, dictdetail.FieldCreateBy) + } + if m.dict_id != nil { + fields = append(fields, dictdetail.FieldDictID) + } + if m.order_no != nil { + fields = append(fields, dictdetail.FieldOrderNo) + } + if m.label != nil { + fields = append(fields, dictdetail.FieldLabel) + } + if m.value != nil { + fields = append(fields, dictdetail.FieldValue) + } + return fields +} + +// Field returns the value of a field with the given name. The second boolean +// return value indicates that this field was not set, or was not defined in the +// schema. +func (m *DictDetailMutation) Field(name string) (ent.Value, bool) { + switch name { + case dictdetail.FieldCreateTime: + return m.CreateTime() + case dictdetail.FieldUpdateTime: + return m.UpdateTime() + case dictdetail.FieldDeleteTime: + return m.DeleteTime() + case dictdetail.FieldCreateBy: + return m.CreateBy() + case dictdetail.FieldDictID: + return m.DictID() + case dictdetail.FieldOrderNo: + return m.OrderNo() + case dictdetail.FieldLabel: + return m.Label() + case dictdetail.FieldValue: + return m.Value() + } + return nil, false +} + +// OldField returns the old value of the field from the database. An error is +// returned if the mutation operation is not UpdateOne, or the query to the +// database failed. +func (m *DictDetailMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case dictdetail.FieldCreateTime: + return m.OldCreateTime(ctx) + case dictdetail.FieldUpdateTime: + return m.OldUpdateTime(ctx) + case dictdetail.FieldDeleteTime: + return m.OldDeleteTime(ctx) + case dictdetail.FieldCreateBy: + return m.OldCreateBy(ctx) + case dictdetail.FieldDictID: + return m.OldDictID(ctx) + case dictdetail.FieldOrderNo: + return m.OldOrderNo(ctx) + case dictdetail.FieldLabel: + return m.OldLabel(ctx) + case dictdetail.FieldValue: + return m.OldValue(ctx) + } + return nil, fmt.Errorf("unknown DictDetail field %s", name) +} + +// SetField sets the value of a field with the given name. It returns an error if +// the field is not defined in the schema, or if the type mismatched the field +// type. +func (m *DictDetailMutation) SetField(name string, value ent.Value) error { + switch name { + case dictdetail.FieldCreateTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreateTime(v) + return nil + case dictdetail.FieldUpdateTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdateTime(v) + return nil + case dictdetail.FieldDeleteTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeleteTime(v) + return nil + case dictdetail.FieldCreateBy: + v, ok := value.(uint32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreateBy(v) + return nil + case dictdetail.FieldDictID: + v, ok := value.(uint32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDictID(v) + return nil + case dictdetail.FieldOrderNo: + v, ok := value.(int32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOrderNo(v) + return nil + case dictdetail.FieldLabel: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetLabel(v) + return nil + case dictdetail.FieldValue: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetValue(v) + return nil + } + return fmt.Errorf("unknown DictDetail field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *DictDetailMutation) AddedFields() []string { + var fields []string + if m.addcreate_by != nil { + fields = append(fields, dictdetail.FieldCreateBy) + } + if m.adddict_id != nil { + fields = append(fields, dictdetail.FieldDictID) + } + if m.addorder_no != nil { + fields = append(fields, dictdetail.FieldOrderNo) + } + return fields +} + +// AddedField returns the numeric value that was incremented/decremented on a field +// with the given name. The second boolean return value indicates that this field +// was not set, or was not defined in the schema. +func (m *DictDetailMutation) AddedField(name string) (ent.Value, bool) { + switch name { + case dictdetail.FieldCreateBy: + return m.AddedCreateBy() + case dictdetail.FieldDictID: + return m.AddedDictID() + case dictdetail.FieldOrderNo: + return m.AddedOrderNo() + } + return nil, false +} + +// AddField adds the value to the field with the given name. It returns an error if +// the field is not defined in the schema, or if the type mismatched the field +// type. +func (m *DictDetailMutation) AddField(name string, value ent.Value) error { + switch name { + case dictdetail.FieldCreateBy: + v, ok := value.(int32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddCreateBy(v) + return nil + case dictdetail.FieldDictID: + v, ok := value.(int32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddDictID(v) + return nil + case dictdetail.FieldOrderNo: + v, ok := value.(int32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddOrderNo(v) + return nil + } + return fmt.Errorf("unknown DictDetail numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *DictDetailMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(dictdetail.FieldCreateTime) { + fields = append(fields, dictdetail.FieldCreateTime) + } + if m.FieldCleared(dictdetail.FieldUpdateTime) { + fields = append(fields, dictdetail.FieldUpdateTime) + } + if m.FieldCleared(dictdetail.FieldDeleteTime) { + fields = append(fields, dictdetail.FieldDeleteTime) + } + if m.FieldCleared(dictdetail.FieldCreateBy) { + fields = append(fields, dictdetail.FieldCreateBy) + } + if m.FieldCleared(dictdetail.FieldDictID) { + fields = append(fields, dictdetail.FieldDictID) + } + if m.FieldCleared(dictdetail.FieldOrderNo) { + fields = append(fields, dictdetail.FieldOrderNo) + } + if m.FieldCleared(dictdetail.FieldLabel) { + fields = append(fields, dictdetail.FieldLabel) + } + if m.FieldCleared(dictdetail.FieldValue) { + fields = append(fields, dictdetail.FieldValue) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *DictDetailMutation) FieldCleared(name string) bool { + _, ok := m.clearedFields[name] + return ok +} + +// ClearField clears the value of the field with the given name. It returns an +// error if the field is not defined in the schema. +func (m *DictDetailMutation) ClearField(name string) error { + switch name { + case dictdetail.FieldCreateTime: + m.ClearCreateTime() + return nil + case dictdetail.FieldUpdateTime: + m.ClearUpdateTime() + return nil + case dictdetail.FieldDeleteTime: + m.ClearDeleteTime() + return nil + case dictdetail.FieldCreateBy: + m.ClearCreateBy() + return nil + case dictdetail.FieldDictID: + m.ClearDictID() + return nil + case dictdetail.FieldOrderNo: + m.ClearOrderNo() + return nil + case dictdetail.FieldLabel: + m.ClearLabel() + return nil + case dictdetail.FieldValue: + m.ClearValue() + return nil + } + return fmt.Errorf("unknown DictDetail nullable field %s", name) +} + +// ResetField resets all changes in the mutation for the field with the given name. +// It returns an error if the field is not defined in the schema. +func (m *DictDetailMutation) ResetField(name string) error { + switch name { + case dictdetail.FieldCreateTime: + m.ResetCreateTime() + return nil + case dictdetail.FieldUpdateTime: + m.ResetUpdateTime() + return nil + case dictdetail.FieldDeleteTime: + m.ResetDeleteTime() + return nil + case dictdetail.FieldCreateBy: + m.ResetCreateBy() + return nil + case dictdetail.FieldDictID: + m.ResetDictID() + return nil + case dictdetail.FieldOrderNo: + m.ResetOrderNo() + return nil + case dictdetail.FieldLabel: + m.ResetLabel() + return nil + case dictdetail.FieldValue: + m.ResetValue() + return nil + } + return fmt.Errorf("unknown DictDetail field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *DictDetailMutation) AddedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *DictDetailMutation) AddedIDs(name string) []ent.Value { + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *DictDetailMutation) RemovedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *DictDetailMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *DictDetailMutation) ClearedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *DictDetailMutation) EdgeCleared(name string) bool { + return false +} + +// ClearEdge clears the value of the edge with the given name. It returns an error +// if that edge is not defined in the schema. +func (m *DictDetailMutation) ClearEdge(name string) error { + return fmt.Errorf("unknown DictDetail unique edge %s", name) +} + +// ResetEdge resets all changes to the edge with the given name in this mutation. +// It returns an error if the edge is not defined in the schema. +func (m *DictDetailMutation) ResetEdge(name string) error { + return fmt.Errorf("unknown DictDetail edge %s", name) +} + +// MenuMutation represents an operation that mutates the Menu nodes in the graph. +type MenuMutation struct { + config + op Op + typ string + id *int32 + status *menu.Status + create_time *time.Time + update_time *time.Time + delete_time *time.Time + create_by *uint32 + addcreate_by *int32 + order_no *int32 + addorder_no *int32 + name *string + title *string + _type *menu.Type + _path *string + component *string + icon *string + is_ext *bool + ext_url *string + permissions *[]string + appendpermissions []string + redirect *string + current_active_menu *string + keep_alive *bool + show *bool + hide_tab *bool + hide_menu *bool + hide_breadcrumb *bool + clearedFields map[string]struct{} + parent *int32 + clearedparent bool + children map[int32]struct{} + removedchildren map[int32]struct{} + clearedchildren bool + done bool + oldValue func(context.Context) (*Menu, error) + predicates []predicate.Menu +} + +var _ ent.Mutation = (*MenuMutation)(nil) + +// menuOption allows management of the mutation configuration using functional options. +type menuOption func(*MenuMutation) + +// newMenuMutation creates new mutation for the Menu entity. +func newMenuMutation(c config, op Op, opts ...menuOption) *MenuMutation { + m := &MenuMutation{ + config: c, + op: op, + typ: TypeMenu, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withMenuID sets the ID field of the mutation. +func withMenuID(id int32) menuOption { + return func(m *MenuMutation) { + var ( + err error + once sync.Once + value *Menu + ) + m.oldValue = func(ctx context.Context) (*Menu, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Menu.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withMenu sets the old Menu of the mutation. +func withMenu(node *Menu) menuOption { + return func(m *MenuMutation) { + m.oldValue = func(context.Context) (*Menu, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m MenuMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m MenuMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of Menu entities. +func (m *MenuMutation) SetID(id int32) { + m.id = &id +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *MenuMutation) ID() (id int32, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *MenuMutation) IDs(ctx context.Context) ([]int32, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []int32{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().Menu.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetStatus sets the "status" field. +func (m *MenuMutation) SetStatus(value menu.Status) { + m.status = &value +} + +// Status returns the value of the "status" field in the mutation. +func (m *MenuMutation) Status() (r menu.Status, exists bool) { + v := m.status + if v == nil { + return + } + return *v, true +} + +// OldStatus returns the old "status" field's value of the Menu entity. +// If the Menu object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *MenuMutation) OldStatus(ctx context.Context) (v *menu.Status, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldStatus is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldStatus requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldStatus: %w", err) + } + return oldValue.Status, nil +} + +// ClearStatus clears the value of the "status" field. +func (m *MenuMutation) ClearStatus() { + m.status = nil + m.clearedFields[menu.FieldStatus] = struct{}{} +} + +// StatusCleared returns if the "status" field was cleared in this mutation. +func (m *MenuMutation) StatusCleared() bool { + _, ok := m.clearedFields[menu.FieldStatus] + return ok +} + +// ResetStatus resets all changes to the "status" field. +func (m *MenuMutation) ResetStatus() { + m.status = nil + delete(m.clearedFields, menu.FieldStatus) +} + +// SetCreateTime sets the "create_time" field. +func (m *MenuMutation) SetCreateTime(t time.Time) { + m.create_time = &t +} + +// CreateTime returns the value of the "create_time" field in the mutation. +func (m *MenuMutation) CreateTime() (r time.Time, exists bool) { + v := m.create_time + if v == nil { + return + } + return *v, true +} + +// OldCreateTime returns the old "create_time" field's value of the Menu entity. +// If the Menu object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *MenuMutation) OldCreateTime(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreateTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreateTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreateTime: %w", err) + } + return oldValue.CreateTime, nil +} + +// ClearCreateTime clears the value of the "create_time" field. +func (m *MenuMutation) ClearCreateTime() { + m.create_time = nil + m.clearedFields[menu.FieldCreateTime] = struct{}{} +} + +// CreateTimeCleared returns if the "create_time" field was cleared in this mutation. +func (m *MenuMutation) CreateTimeCleared() bool { + _, ok := m.clearedFields[menu.FieldCreateTime] + return ok +} + +// ResetCreateTime resets all changes to the "create_time" field. +func (m *MenuMutation) ResetCreateTime() { + m.create_time = nil + delete(m.clearedFields, menu.FieldCreateTime) +} + +// SetUpdateTime sets the "update_time" field. +func (m *MenuMutation) SetUpdateTime(t time.Time) { + m.update_time = &t +} + +// UpdateTime returns the value of the "update_time" field in the mutation. +func (m *MenuMutation) UpdateTime() (r time.Time, exists bool) { + v := m.update_time + if v == nil { + return + } + return *v, true +} + +// OldUpdateTime returns the old "update_time" field's value of the Menu entity. +// If the Menu object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *MenuMutation) OldUpdateTime(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdateTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdateTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdateTime: %w", err) + } + return oldValue.UpdateTime, nil +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (m *MenuMutation) ClearUpdateTime() { + m.update_time = nil + m.clearedFields[menu.FieldUpdateTime] = struct{}{} +} + +// UpdateTimeCleared returns if the "update_time" field was cleared in this mutation. +func (m *MenuMutation) UpdateTimeCleared() bool { + _, ok := m.clearedFields[menu.FieldUpdateTime] + return ok +} + +// ResetUpdateTime resets all changes to the "update_time" field. +func (m *MenuMutation) ResetUpdateTime() { + m.update_time = nil + delete(m.clearedFields, menu.FieldUpdateTime) +} + +// SetDeleteTime sets the "delete_time" field. +func (m *MenuMutation) SetDeleteTime(t time.Time) { + m.delete_time = &t +} + +// DeleteTime returns the value of the "delete_time" field in the mutation. +func (m *MenuMutation) DeleteTime() (r time.Time, exists bool) { + v := m.delete_time + if v == nil { + return + } + return *v, true +} + +// OldDeleteTime returns the old "delete_time" field's value of the Menu entity. +// If the Menu object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *MenuMutation) OldDeleteTime(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeleteTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeleteTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeleteTime: %w", err) + } + return oldValue.DeleteTime, nil +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (m *MenuMutation) ClearDeleteTime() { + m.delete_time = nil + m.clearedFields[menu.FieldDeleteTime] = struct{}{} +} + +// DeleteTimeCleared returns if the "delete_time" field was cleared in this mutation. +func (m *MenuMutation) DeleteTimeCleared() bool { + _, ok := m.clearedFields[menu.FieldDeleteTime] + return ok +} + +// ResetDeleteTime resets all changes to the "delete_time" field. +func (m *MenuMutation) ResetDeleteTime() { + m.delete_time = nil + delete(m.clearedFields, menu.FieldDeleteTime) +} + +// SetCreateBy sets the "create_by" field. +func (m *MenuMutation) SetCreateBy(u uint32) { + m.create_by = &u + m.addcreate_by = nil +} + +// CreateBy returns the value of the "create_by" field in the mutation. +func (m *MenuMutation) CreateBy() (r uint32, exists bool) { + v := m.create_by + if v == nil { + return + } + return *v, true +} + +// OldCreateBy returns the old "create_by" field's value of the Menu entity. +// If the Menu object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *MenuMutation) OldCreateBy(ctx context.Context) (v *uint32, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreateBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreateBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreateBy: %w", err) + } + return oldValue.CreateBy, nil +} + +// AddCreateBy adds u to the "create_by" field. +func (m *MenuMutation) AddCreateBy(u int32) { + if m.addcreate_by != nil { + *m.addcreate_by += u + } else { + m.addcreate_by = &u + } +} + +// AddedCreateBy returns the value that was added to the "create_by" field in this mutation. +func (m *MenuMutation) AddedCreateBy() (r int32, exists bool) { + v := m.addcreate_by + if v == nil { + return + } + return *v, true +} + +// ClearCreateBy clears the value of the "create_by" field. +func (m *MenuMutation) ClearCreateBy() { + m.create_by = nil + m.addcreate_by = nil + m.clearedFields[menu.FieldCreateBy] = struct{}{} +} + +// CreateByCleared returns if the "create_by" field was cleared in this mutation. +func (m *MenuMutation) CreateByCleared() bool { + _, ok := m.clearedFields[menu.FieldCreateBy] + return ok +} + +// ResetCreateBy resets all changes to the "create_by" field. +func (m *MenuMutation) ResetCreateBy() { + m.create_by = nil + m.addcreate_by = nil + delete(m.clearedFields, menu.FieldCreateBy) +} + +// SetParentID sets the "parent_id" field. +func (m *MenuMutation) SetParentID(i int32) { + m.parent = &i +} + +// ParentID returns the value of the "parent_id" field in the mutation. +func (m *MenuMutation) ParentID() (r int32, exists bool) { + v := m.parent + if v == nil { + return + } + return *v, true +} + +// OldParentID returns the old "parent_id" field's value of the Menu entity. +// If the Menu object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *MenuMutation) OldParentID(ctx context.Context) (v *int32, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldParentID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldParentID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldParentID: %w", err) + } + return oldValue.ParentID, nil +} + +// ClearParentID clears the value of the "parent_id" field. +func (m *MenuMutation) ClearParentID() { + m.parent = nil + m.clearedFields[menu.FieldParentID] = struct{}{} +} + +// ParentIDCleared returns if the "parent_id" field was cleared in this mutation. +func (m *MenuMutation) ParentIDCleared() bool { + _, ok := m.clearedFields[menu.FieldParentID] + return ok +} + +// ResetParentID resets all changes to the "parent_id" field. +func (m *MenuMutation) ResetParentID() { + m.parent = nil + delete(m.clearedFields, menu.FieldParentID) +} + +// SetOrderNo sets the "order_no" field. +func (m *MenuMutation) SetOrderNo(i int32) { + m.order_no = &i + m.addorder_no = nil +} + +// OrderNo returns the value of the "order_no" field in the mutation. +func (m *MenuMutation) OrderNo() (r int32, exists bool) { + v := m.order_no + if v == nil { + return + } + return *v, true +} + +// OldOrderNo returns the old "order_no" field's value of the Menu entity. +// If the Menu object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *MenuMutation) OldOrderNo(ctx context.Context) (v *int32, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOrderNo is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOrderNo requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOrderNo: %w", err) + } + return oldValue.OrderNo, nil +} + +// AddOrderNo adds i to the "order_no" field. +func (m *MenuMutation) AddOrderNo(i int32) { + if m.addorder_no != nil { + *m.addorder_no += i + } else { + m.addorder_no = &i + } +} + +// AddedOrderNo returns the value that was added to the "order_no" field in this mutation. +func (m *MenuMutation) AddedOrderNo() (r int32, exists bool) { + v := m.addorder_no + if v == nil { + return + } + return *v, true +} + +// ClearOrderNo clears the value of the "order_no" field. +func (m *MenuMutation) ClearOrderNo() { + m.order_no = nil + m.addorder_no = nil + m.clearedFields[menu.FieldOrderNo] = struct{}{} +} + +// OrderNoCleared returns if the "order_no" field was cleared in this mutation. +func (m *MenuMutation) OrderNoCleared() bool { + _, ok := m.clearedFields[menu.FieldOrderNo] + return ok +} + +// ResetOrderNo resets all changes to the "order_no" field. +func (m *MenuMutation) ResetOrderNo() { + m.order_no = nil + m.addorder_no = nil + delete(m.clearedFields, menu.FieldOrderNo) +} + +// SetName sets the "name" field. +func (m *MenuMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *MenuMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the Menu entity. +// If the Menu object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *MenuMutation) OldName(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ClearName clears the value of the "name" field. +func (m *MenuMutation) ClearName() { + m.name = nil + m.clearedFields[menu.FieldName] = struct{}{} +} + +// NameCleared returns if the "name" field was cleared in this mutation. +func (m *MenuMutation) NameCleared() bool { + _, ok := m.clearedFields[menu.FieldName] + return ok +} + +// ResetName resets all changes to the "name" field. +func (m *MenuMutation) ResetName() { + m.name = nil + delete(m.clearedFields, menu.FieldName) +} + +// SetTitle sets the "title" field. +func (m *MenuMutation) SetTitle(s string) { + m.title = &s +} + +// Title returns the value of the "title" field in the mutation. +func (m *MenuMutation) Title() (r string, exists bool) { + v := m.title + if v == nil { + return + } + return *v, true +} + +// OldTitle returns the old "title" field's value of the Menu entity. +// If the Menu object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *MenuMutation) OldTitle(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTitle is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTitle requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTitle: %w", err) + } + return oldValue.Title, nil +} + +// ClearTitle clears the value of the "title" field. +func (m *MenuMutation) ClearTitle() { + m.title = nil + m.clearedFields[menu.FieldTitle] = struct{}{} +} + +// TitleCleared returns if the "title" field was cleared in this mutation. +func (m *MenuMutation) TitleCleared() bool { + _, ok := m.clearedFields[menu.FieldTitle] + return ok +} + +// ResetTitle resets all changes to the "title" field. +func (m *MenuMutation) ResetTitle() { + m.title = nil + delete(m.clearedFields, menu.FieldTitle) +} + +// SetType sets the "type" field. +func (m *MenuMutation) SetType(value menu.Type) { + m._type = &value +} + +// GetType returns the value of the "type" field in the mutation. +func (m *MenuMutation) GetType() (r menu.Type, exists bool) { + v := m._type + if v == nil { + return + } + return *v, true +} + +// OldType returns the old "type" field's value of the Menu entity. +// If the Menu object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *MenuMutation) OldType(ctx context.Context) (v *menu.Type, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldType is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldType requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldType: %w", err) + } + return oldValue.Type, nil +} + +// ClearType clears the value of the "type" field. +func (m *MenuMutation) ClearType() { + m._type = nil + m.clearedFields[menu.FieldType] = struct{}{} +} + +// TypeCleared returns if the "type" field was cleared in this mutation. +func (m *MenuMutation) TypeCleared() bool { + _, ok := m.clearedFields[menu.FieldType] + return ok +} + +// ResetType resets all changes to the "type" field. +func (m *MenuMutation) ResetType() { + m._type = nil + delete(m.clearedFields, menu.FieldType) +} + +// SetPath sets the "path" field. +func (m *MenuMutation) SetPath(s string) { + m._path = &s +} + +// Path returns the value of the "path" field in the mutation. +func (m *MenuMutation) Path() (r string, exists bool) { + v := m._path + if v == nil { + return + } + return *v, true +} + +// OldPath returns the old "path" field's value of the Menu entity. +// If the Menu object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *MenuMutation) OldPath(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldPath is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldPath requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPath: %w", err) + } + return oldValue.Path, nil +} + +// ClearPath clears the value of the "path" field. +func (m *MenuMutation) ClearPath() { + m._path = nil + m.clearedFields[menu.FieldPath] = struct{}{} +} + +// PathCleared returns if the "path" field was cleared in this mutation. +func (m *MenuMutation) PathCleared() bool { + _, ok := m.clearedFields[menu.FieldPath] + return ok +} + +// ResetPath resets all changes to the "path" field. +func (m *MenuMutation) ResetPath() { + m._path = nil + delete(m.clearedFields, menu.FieldPath) +} + +// SetComponent sets the "component" field. +func (m *MenuMutation) SetComponent(s string) { + m.component = &s +} + +// Component returns the value of the "component" field in the mutation. +func (m *MenuMutation) Component() (r string, exists bool) { + v := m.component + if v == nil { + return + } + return *v, true +} + +// OldComponent returns the old "component" field's value of the Menu entity. +// If the Menu object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *MenuMutation) OldComponent(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldComponent is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldComponent requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldComponent: %w", err) + } + return oldValue.Component, nil +} + +// ClearComponent clears the value of the "component" field. +func (m *MenuMutation) ClearComponent() { + m.component = nil + m.clearedFields[menu.FieldComponent] = struct{}{} +} + +// ComponentCleared returns if the "component" field was cleared in this mutation. +func (m *MenuMutation) ComponentCleared() bool { + _, ok := m.clearedFields[menu.FieldComponent] + return ok +} + +// ResetComponent resets all changes to the "component" field. +func (m *MenuMutation) ResetComponent() { + m.component = nil + delete(m.clearedFields, menu.FieldComponent) +} + +// SetIcon sets the "icon" field. +func (m *MenuMutation) SetIcon(s string) { + m.icon = &s +} + +// Icon returns the value of the "icon" field in the mutation. +func (m *MenuMutation) Icon() (r string, exists bool) { + v := m.icon + if v == nil { + return + } + return *v, true +} + +// OldIcon returns the old "icon" field's value of the Menu entity. +// If the Menu object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *MenuMutation) OldIcon(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldIcon is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldIcon requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldIcon: %w", err) + } + return oldValue.Icon, nil +} + +// ClearIcon clears the value of the "icon" field. +func (m *MenuMutation) ClearIcon() { + m.icon = nil + m.clearedFields[menu.FieldIcon] = struct{}{} +} + +// IconCleared returns if the "icon" field was cleared in this mutation. +func (m *MenuMutation) IconCleared() bool { + _, ok := m.clearedFields[menu.FieldIcon] + return ok +} + +// ResetIcon resets all changes to the "icon" field. +func (m *MenuMutation) ResetIcon() { + m.icon = nil + delete(m.clearedFields, menu.FieldIcon) +} + +// SetIsExt sets the "is_ext" field. +func (m *MenuMutation) SetIsExt(b bool) { + m.is_ext = &b +} + +// IsExt returns the value of the "is_ext" field in the mutation. +func (m *MenuMutation) IsExt() (r bool, exists bool) { + v := m.is_ext + if v == nil { + return + } + return *v, true +} + +// OldIsExt returns the old "is_ext" field's value of the Menu entity. +// If the Menu object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *MenuMutation) OldIsExt(ctx context.Context) (v *bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldIsExt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldIsExt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldIsExt: %w", err) + } + return oldValue.IsExt, nil +} + +// ClearIsExt clears the value of the "is_ext" field. +func (m *MenuMutation) ClearIsExt() { + m.is_ext = nil + m.clearedFields[menu.FieldIsExt] = struct{}{} +} + +// IsExtCleared returns if the "is_ext" field was cleared in this mutation. +func (m *MenuMutation) IsExtCleared() bool { + _, ok := m.clearedFields[menu.FieldIsExt] + return ok +} + +// ResetIsExt resets all changes to the "is_ext" field. +func (m *MenuMutation) ResetIsExt() { + m.is_ext = nil + delete(m.clearedFields, menu.FieldIsExt) +} + +// SetExtURL sets the "ext_url" field. +func (m *MenuMutation) SetExtURL(s string) { + m.ext_url = &s +} + +// ExtURL returns the value of the "ext_url" field in the mutation. +func (m *MenuMutation) ExtURL() (r string, exists bool) { + v := m.ext_url + if v == nil { + return + } + return *v, true +} + +// OldExtURL returns the old "ext_url" field's value of the Menu entity. +// If the Menu object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *MenuMutation) OldExtURL(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldExtURL is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldExtURL requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldExtURL: %w", err) + } + return oldValue.ExtURL, nil +} + +// ClearExtURL clears the value of the "ext_url" field. +func (m *MenuMutation) ClearExtURL() { + m.ext_url = nil + m.clearedFields[menu.FieldExtURL] = struct{}{} +} + +// ExtURLCleared returns if the "ext_url" field was cleared in this mutation. +func (m *MenuMutation) ExtURLCleared() bool { + _, ok := m.clearedFields[menu.FieldExtURL] + return ok +} + +// ResetExtURL resets all changes to the "ext_url" field. +func (m *MenuMutation) ResetExtURL() { + m.ext_url = nil + delete(m.clearedFields, menu.FieldExtURL) +} + +// SetPermissions sets the "permissions" field. +func (m *MenuMutation) SetPermissions(s []string) { + m.permissions = &s + m.appendpermissions = nil +} + +// Permissions returns the value of the "permissions" field in the mutation. +func (m *MenuMutation) Permissions() (r []string, exists bool) { + v := m.permissions + if v == nil { + return + } + return *v, true +} + +// OldPermissions returns the old "permissions" field's value of the Menu entity. +// If the Menu object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *MenuMutation) OldPermissions(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldPermissions is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldPermissions requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPermissions: %w", err) + } + return oldValue.Permissions, nil +} + +// AppendPermissions adds s to the "permissions" field. +func (m *MenuMutation) AppendPermissions(s []string) { + m.appendpermissions = append(m.appendpermissions, s...) +} + +// AppendedPermissions returns the list of values that were appended to the "permissions" field in this mutation. +func (m *MenuMutation) AppendedPermissions() ([]string, bool) { + if len(m.appendpermissions) == 0 { + return nil, false + } + return m.appendpermissions, true +} + +// ClearPermissions clears the value of the "permissions" field. +func (m *MenuMutation) ClearPermissions() { + m.permissions = nil + m.appendpermissions = nil + m.clearedFields[menu.FieldPermissions] = struct{}{} +} + +// PermissionsCleared returns if the "permissions" field was cleared in this mutation. +func (m *MenuMutation) PermissionsCleared() bool { + _, ok := m.clearedFields[menu.FieldPermissions] + return ok +} + +// ResetPermissions resets all changes to the "permissions" field. +func (m *MenuMutation) ResetPermissions() { + m.permissions = nil + m.appendpermissions = nil + delete(m.clearedFields, menu.FieldPermissions) +} + +// SetRedirect sets the "redirect" field. +func (m *MenuMutation) SetRedirect(s string) { + m.redirect = &s +} + +// Redirect returns the value of the "redirect" field in the mutation. +func (m *MenuMutation) Redirect() (r string, exists bool) { + v := m.redirect + if v == nil { + return + } + return *v, true +} + +// OldRedirect returns the old "redirect" field's value of the Menu entity. +// If the Menu object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *MenuMutation) OldRedirect(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRedirect is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRedirect requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRedirect: %w", err) + } + return oldValue.Redirect, nil +} + +// ClearRedirect clears the value of the "redirect" field. +func (m *MenuMutation) ClearRedirect() { + m.redirect = nil + m.clearedFields[menu.FieldRedirect] = struct{}{} +} + +// RedirectCleared returns if the "redirect" field was cleared in this mutation. +func (m *MenuMutation) RedirectCleared() bool { + _, ok := m.clearedFields[menu.FieldRedirect] + return ok +} + +// ResetRedirect resets all changes to the "redirect" field. +func (m *MenuMutation) ResetRedirect() { + m.redirect = nil + delete(m.clearedFields, menu.FieldRedirect) +} + +// SetCurrentActiveMenu sets the "current_active_menu" field. +func (m *MenuMutation) SetCurrentActiveMenu(s string) { + m.current_active_menu = &s +} + +// CurrentActiveMenu returns the value of the "current_active_menu" field in the mutation. +func (m *MenuMutation) CurrentActiveMenu() (r string, exists bool) { + v := m.current_active_menu + if v == nil { + return + } + return *v, true +} + +// OldCurrentActiveMenu returns the old "current_active_menu" field's value of the Menu entity. +// If the Menu object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *MenuMutation) OldCurrentActiveMenu(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCurrentActiveMenu is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCurrentActiveMenu requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCurrentActiveMenu: %w", err) + } + return oldValue.CurrentActiveMenu, nil +} + +// ClearCurrentActiveMenu clears the value of the "current_active_menu" field. +func (m *MenuMutation) ClearCurrentActiveMenu() { + m.current_active_menu = nil + m.clearedFields[menu.FieldCurrentActiveMenu] = struct{}{} +} + +// CurrentActiveMenuCleared returns if the "current_active_menu" field was cleared in this mutation. +func (m *MenuMutation) CurrentActiveMenuCleared() bool { + _, ok := m.clearedFields[menu.FieldCurrentActiveMenu] + return ok +} + +// ResetCurrentActiveMenu resets all changes to the "current_active_menu" field. +func (m *MenuMutation) ResetCurrentActiveMenu() { + m.current_active_menu = nil + delete(m.clearedFields, menu.FieldCurrentActiveMenu) +} + +// SetKeepAlive sets the "keep_alive" field. +func (m *MenuMutation) SetKeepAlive(b bool) { + m.keep_alive = &b +} + +// KeepAlive returns the value of the "keep_alive" field in the mutation. +func (m *MenuMutation) KeepAlive() (r bool, exists bool) { + v := m.keep_alive + if v == nil { + return + } + return *v, true +} + +// OldKeepAlive returns the old "keep_alive" field's value of the Menu entity. +// If the Menu object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *MenuMutation) OldKeepAlive(ctx context.Context) (v *bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldKeepAlive is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldKeepAlive requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldKeepAlive: %w", err) + } + return oldValue.KeepAlive, nil +} + +// ClearKeepAlive clears the value of the "keep_alive" field. +func (m *MenuMutation) ClearKeepAlive() { + m.keep_alive = nil + m.clearedFields[menu.FieldKeepAlive] = struct{}{} +} + +// KeepAliveCleared returns if the "keep_alive" field was cleared in this mutation. +func (m *MenuMutation) KeepAliveCleared() bool { + _, ok := m.clearedFields[menu.FieldKeepAlive] + return ok +} + +// ResetKeepAlive resets all changes to the "keep_alive" field. +func (m *MenuMutation) ResetKeepAlive() { + m.keep_alive = nil + delete(m.clearedFields, menu.FieldKeepAlive) +} + +// SetShow sets the "show" field. +func (m *MenuMutation) SetShow(b bool) { + m.show = &b +} + +// Show returns the value of the "show" field in the mutation. +func (m *MenuMutation) Show() (r bool, exists bool) { + v := m.show + if v == nil { + return + } + return *v, true +} + +// OldShow returns the old "show" field's value of the Menu entity. +// If the Menu object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *MenuMutation) OldShow(ctx context.Context) (v *bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldShow is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldShow requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldShow: %w", err) + } + return oldValue.Show, nil +} + +// ClearShow clears the value of the "show" field. +func (m *MenuMutation) ClearShow() { + m.show = nil + m.clearedFields[menu.FieldShow] = struct{}{} +} + +// ShowCleared returns if the "show" field was cleared in this mutation. +func (m *MenuMutation) ShowCleared() bool { + _, ok := m.clearedFields[menu.FieldShow] + return ok +} + +// ResetShow resets all changes to the "show" field. +func (m *MenuMutation) ResetShow() { + m.show = nil + delete(m.clearedFields, menu.FieldShow) +} + +// SetHideTab sets the "hide_tab" field. +func (m *MenuMutation) SetHideTab(b bool) { + m.hide_tab = &b +} + +// HideTab returns the value of the "hide_tab" field in the mutation. +func (m *MenuMutation) HideTab() (r bool, exists bool) { + v := m.hide_tab + if v == nil { + return + } + return *v, true +} + +// OldHideTab returns the old "hide_tab" field's value of the Menu entity. +// If the Menu object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *MenuMutation) OldHideTab(ctx context.Context) (v *bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldHideTab is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldHideTab requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldHideTab: %w", err) + } + return oldValue.HideTab, nil +} + +// ClearHideTab clears the value of the "hide_tab" field. +func (m *MenuMutation) ClearHideTab() { + m.hide_tab = nil + m.clearedFields[menu.FieldHideTab] = struct{}{} +} + +// HideTabCleared returns if the "hide_tab" field was cleared in this mutation. +func (m *MenuMutation) HideTabCleared() bool { + _, ok := m.clearedFields[menu.FieldHideTab] + return ok +} + +// ResetHideTab resets all changes to the "hide_tab" field. +func (m *MenuMutation) ResetHideTab() { + m.hide_tab = nil + delete(m.clearedFields, menu.FieldHideTab) +} + +// SetHideMenu sets the "hide_menu" field. +func (m *MenuMutation) SetHideMenu(b bool) { + m.hide_menu = &b +} + +// HideMenu returns the value of the "hide_menu" field in the mutation. +func (m *MenuMutation) HideMenu() (r bool, exists bool) { + v := m.hide_menu + if v == nil { + return + } + return *v, true +} + +// OldHideMenu returns the old "hide_menu" field's value of the Menu entity. +// If the Menu object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *MenuMutation) OldHideMenu(ctx context.Context) (v *bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldHideMenu is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldHideMenu requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldHideMenu: %w", err) + } + return oldValue.HideMenu, nil +} + +// ClearHideMenu clears the value of the "hide_menu" field. +func (m *MenuMutation) ClearHideMenu() { + m.hide_menu = nil + m.clearedFields[menu.FieldHideMenu] = struct{}{} +} + +// HideMenuCleared returns if the "hide_menu" field was cleared in this mutation. +func (m *MenuMutation) HideMenuCleared() bool { + _, ok := m.clearedFields[menu.FieldHideMenu] + return ok +} + +// ResetHideMenu resets all changes to the "hide_menu" field. +func (m *MenuMutation) ResetHideMenu() { + m.hide_menu = nil + delete(m.clearedFields, menu.FieldHideMenu) +} + +// SetHideBreadcrumb sets the "hide_breadcrumb" field. +func (m *MenuMutation) SetHideBreadcrumb(b bool) { + m.hide_breadcrumb = &b +} + +// HideBreadcrumb returns the value of the "hide_breadcrumb" field in the mutation. +func (m *MenuMutation) HideBreadcrumb() (r bool, exists bool) { + v := m.hide_breadcrumb + if v == nil { + return + } + return *v, true +} + +// OldHideBreadcrumb returns the old "hide_breadcrumb" field's value of the Menu entity. +// If the Menu object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *MenuMutation) OldHideBreadcrumb(ctx context.Context) (v *bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldHideBreadcrumb is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldHideBreadcrumb requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldHideBreadcrumb: %w", err) + } + return oldValue.HideBreadcrumb, nil +} + +// ClearHideBreadcrumb clears the value of the "hide_breadcrumb" field. +func (m *MenuMutation) ClearHideBreadcrumb() { + m.hide_breadcrumb = nil + m.clearedFields[menu.FieldHideBreadcrumb] = struct{}{} +} + +// HideBreadcrumbCleared returns if the "hide_breadcrumb" field was cleared in this mutation. +func (m *MenuMutation) HideBreadcrumbCleared() bool { + _, ok := m.clearedFields[menu.FieldHideBreadcrumb] + return ok +} + +// ResetHideBreadcrumb resets all changes to the "hide_breadcrumb" field. +func (m *MenuMutation) ResetHideBreadcrumb() { + m.hide_breadcrumb = nil + delete(m.clearedFields, menu.FieldHideBreadcrumb) +} + +// ClearParent clears the "parent" edge to the Menu entity. +func (m *MenuMutation) ClearParent() { + m.clearedparent = true + m.clearedFields[menu.FieldParentID] = struct{}{} +} + +// ParentCleared reports if the "parent" edge to the Menu entity was cleared. +func (m *MenuMutation) ParentCleared() bool { + return m.ParentIDCleared() || m.clearedparent +} + +// ParentIDs returns the "parent" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// ParentID instead. It exists only for internal usage by the builders. +func (m *MenuMutation) ParentIDs() (ids []int32) { + if id := m.parent; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetParent resets all changes to the "parent" edge. +func (m *MenuMutation) ResetParent() { + m.parent = nil + m.clearedparent = false +} + +// AddChildIDs adds the "children" edge to the Menu entity by ids. +func (m *MenuMutation) AddChildIDs(ids ...int32) { + if m.children == nil { + m.children = make(map[int32]struct{}) + } + for i := range ids { + m.children[ids[i]] = struct{}{} + } +} + +// ClearChildren clears the "children" edge to the Menu entity. +func (m *MenuMutation) ClearChildren() { + m.clearedchildren = true +} + +// ChildrenCleared reports if the "children" edge to the Menu entity was cleared. +func (m *MenuMutation) ChildrenCleared() bool { + return m.clearedchildren +} + +// RemoveChildIDs removes the "children" edge to the Menu entity by IDs. +func (m *MenuMutation) RemoveChildIDs(ids ...int32) { + if m.removedchildren == nil { + m.removedchildren = make(map[int32]struct{}) + } + for i := range ids { + delete(m.children, ids[i]) + m.removedchildren[ids[i]] = struct{}{} + } +} + +// RemovedChildren returns the removed IDs of the "children" edge to the Menu entity. +func (m *MenuMutation) RemovedChildrenIDs() (ids []int32) { + for id := range m.removedchildren { + ids = append(ids, id) + } + return +} + +// ChildrenIDs returns the "children" edge IDs in the mutation. +func (m *MenuMutation) ChildrenIDs() (ids []int32) { + for id := range m.children { + ids = append(ids, id) + } + return +} + +// ResetChildren resets all changes to the "children" edge. +func (m *MenuMutation) ResetChildren() { + m.children = nil + m.clearedchildren = false + m.removedchildren = nil +} + +// Where appends a list predicates to the MenuMutation builder. +func (m *MenuMutation) Where(ps ...predicate.Menu) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the MenuMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *MenuMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.Menu, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *MenuMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *MenuMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (Menu). +func (m *MenuMutation) Type() string { + return m.typ +} + +// Fields returns all fields that were changed during this mutation. Note that in +// order to get all numeric fields that were incremented/decremented, call +// AddedFields(). +func (m *MenuMutation) Fields() []string { + fields := make([]string, 0, 23) + if m.status != nil { + fields = append(fields, menu.FieldStatus) + } + if m.create_time != nil { + fields = append(fields, menu.FieldCreateTime) + } + if m.update_time != nil { + fields = append(fields, menu.FieldUpdateTime) + } + if m.delete_time != nil { + fields = append(fields, menu.FieldDeleteTime) + } + if m.create_by != nil { + fields = append(fields, menu.FieldCreateBy) + } + if m.parent != nil { + fields = append(fields, menu.FieldParentID) + } + if m.order_no != nil { + fields = append(fields, menu.FieldOrderNo) + } + if m.name != nil { + fields = append(fields, menu.FieldName) + } + if m.title != nil { + fields = append(fields, menu.FieldTitle) + } + if m._type != nil { + fields = append(fields, menu.FieldType) + } + if m._path != nil { + fields = append(fields, menu.FieldPath) + } + if m.component != nil { + fields = append(fields, menu.FieldComponent) + } + if m.icon != nil { + fields = append(fields, menu.FieldIcon) + } + if m.is_ext != nil { + fields = append(fields, menu.FieldIsExt) + } + if m.ext_url != nil { + fields = append(fields, menu.FieldExtURL) + } + if m.permissions != nil { + fields = append(fields, menu.FieldPermissions) + } + if m.redirect != nil { + fields = append(fields, menu.FieldRedirect) + } + if m.current_active_menu != nil { + fields = append(fields, menu.FieldCurrentActiveMenu) + } + if m.keep_alive != nil { + fields = append(fields, menu.FieldKeepAlive) + } + if m.show != nil { + fields = append(fields, menu.FieldShow) + } + if m.hide_tab != nil { + fields = append(fields, menu.FieldHideTab) + } + if m.hide_menu != nil { + fields = append(fields, menu.FieldHideMenu) + } + if m.hide_breadcrumb != nil { + fields = append(fields, menu.FieldHideBreadcrumb) + } + return fields +} + +// Field returns the value of a field with the given name. The second boolean +// return value indicates that this field was not set, or was not defined in the +// schema. +func (m *MenuMutation) Field(name string) (ent.Value, bool) { + switch name { + case menu.FieldStatus: + return m.Status() + case menu.FieldCreateTime: + return m.CreateTime() + case menu.FieldUpdateTime: + return m.UpdateTime() + case menu.FieldDeleteTime: + return m.DeleteTime() + case menu.FieldCreateBy: + return m.CreateBy() + case menu.FieldParentID: + return m.ParentID() + case menu.FieldOrderNo: + return m.OrderNo() + case menu.FieldName: + return m.Name() + case menu.FieldTitle: + return m.Title() + case menu.FieldType: + return m.GetType() + case menu.FieldPath: + return m.Path() + case menu.FieldComponent: + return m.Component() + case menu.FieldIcon: + return m.Icon() + case menu.FieldIsExt: + return m.IsExt() + case menu.FieldExtURL: + return m.ExtURL() + case menu.FieldPermissions: + return m.Permissions() + case menu.FieldRedirect: + return m.Redirect() + case menu.FieldCurrentActiveMenu: + return m.CurrentActiveMenu() + case menu.FieldKeepAlive: + return m.KeepAlive() + case menu.FieldShow: + return m.Show() + case menu.FieldHideTab: + return m.HideTab() + case menu.FieldHideMenu: + return m.HideMenu() + case menu.FieldHideBreadcrumb: + return m.HideBreadcrumb() + } + return nil, false +} + +// OldField returns the old value of the field from the database. An error is +// returned if the mutation operation is not UpdateOne, or the query to the +// database failed. +func (m *MenuMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case menu.FieldStatus: + return m.OldStatus(ctx) + case menu.FieldCreateTime: + return m.OldCreateTime(ctx) + case menu.FieldUpdateTime: + return m.OldUpdateTime(ctx) + case menu.FieldDeleteTime: + return m.OldDeleteTime(ctx) + case menu.FieldCreateBy: + return m.OldCreateBy(ctx) + case menu.FieldParentID: + return m.OldParentID(ctx) + case menu.FieldOrderNo: + return m.OldOrderNo(ctx) + case menu.FieldName: + return m.OldName(ctx) + case menu.FieldTitle: + return m.OldTitle(ctx) + case menu.FieldType: + return m.OldType(ctx) + case menu.FieldPath: + return m.OldPath(ctx) + case menu.FieldComponent: + return m.OldComponent(ctx) + case menu.FieldIcon: + return m.OldIcon(ctx) + case menu.FieldIsExt: + return m.OldIsExt(ctx) + case menu.FieldExtURL: + return m.OldExtURL(ctx) + case menu.FieldPermissions: + return m.OldPermissions(ctx) + case menu.FieldRedirect: + return m.OldRedirect(ctx) + case menu.FieldCurrentActiveMenu: + return m.OldCurrentActiveMenu(ctx) + case menu.FieldKeepAlive: + return m.OldKeepAlive(ctx) + case menu.FieldShow: + return m.OldShow(ctx) + case menu.FieldHideTab: + return m.OldHideTab(ctx) + case menu.FieldHideMenu: + return m.OldHideMenu(ctx) + case menu.FieldHideBreadcrumb: + return m.OldHideBreadcrumb(ctx) + } + return nil, fmt.Errorf("unknown Menu field %s", name) +} + +// SetField sets the value of a field with the given name. It returns an error if +// the field is not defined in the schema, or if the type mismatched the field +// type. +func (m *MenuMutation) SetField(name string, value ent.Value) error { + switch name { + case menu.FieldStatus: + v, ok := value.(menu.Status) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetStatus(v) + return nil + case menu.FieldCreateTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreateTime(v) + return nil + case menu.FieldUpdateTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdateTime(v) + return nil + case menu.FieldDeleteTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeleteTime(v) + return nil + case menu.FieldCreateBy: + v, ok := value.(uint32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreateBy(v) + return nil + case menu.FieldParentID: + v, ok := value.(int32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetParentID(v) + return nil + case menu.FieldOrderNo: + v, ok := value.(int32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOrderNo(v) + return nil + case menu.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + case menu.FieldTitle: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTitle(v) + return nil + case menu.FieldType: + v, ok := value.(menu.Type) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetType(v) + return nil + case menu.FieldPath: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetPath(v) + return nil + case menu.FieldComponent: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetComponent(v) + return nil + case menu.FieldIcon: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetIcon(v) + return nil + case menu.FieldIsExt: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetIsExt(v) + return nil + case menu.FieldExtURL: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetExtURL(v) + return nil + case menu.FieldPermissions: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetPermissions(v) + return nil + case menu.FieldRedirect: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRedirect(v) + return nil + case menu.FieldCurrentActiveMenu: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCurrentActiveMenu(v) + return nil + case menu.FieldKeepAlive: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetKeepAlive(v) + return nil + case menu.FieldShow: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetShow(v) + return nil + case menu.FieldHideTab: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetHideTab(v) + return nil + case menu.FieldHideMenu: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetHideMenu(v) + return nil + case menu.FieldHideBreadcrumb: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetHideBreadcrumb(v) + return nil + } + return fmt.Errorf("unknown Menu field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *MenuMutation) AddedFields() []string { + var fields []string + if m.addcreate_by != nil { + fields = append(fields, menu.FieldCreateBy) + } + if m.addorder_no != nil { + fields = append(fields, menu.FieldOrderNo) + } + return fields +} + +// AddedField returns the numeric value that was incremented/decremented on a field +// with the given name. The second boolean return value indicates that this field +// was not set, or was not defined in the schema. +func (m *MenuMutation) AddedField(name string) (ent.Value, bool) { + switch name { + case menu.FieldCreateBy: + return m.AddedCreateBy() + case menu.FieldOrderNo: + return m.AddedOrderNo() + } + return nil, false +} + +// AddField adds the value to the field with the given name. It returns an error if +// the field is not defined in the schema, or if the type mismatched the field +// type. +func (m *MenuMutation) AddField(name string, value ent.Value) error { + switch name { + case menu.FieldCreateBy: + v, ok := value.(int32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddCreateBy(v) + return nil + case menu.FieldOrderNo: + v, ok := value.(int32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddOrderNo(v) + return nil + } + return fmt.Errorf("unknown Menu numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *MenuMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(menu.FieldStatus) { + fields = append(fields, menu.FieldStatus) + } + if m.FieldCleared(menu.FieldCreateTime) { + fields = append(fields, menu.FieldCreateTime) + } + if m.FieldCleared(menu.FieldUpdateTime) { + fields = append(fields, menu.FieldUpdateTime) + } + if m.FieldCleared(menu.FieldDeleteTime) { + fields = append(fields, menu.FieldDeleteTime) + } + if m.FieldCleared(menu.FieldCreateBy) { + fields = append(fields, menu.FieldCreateBy) + } + if m.FieldCleared(menu.FieldParentID) { + fields = append(fields, menu.FieldParentID) + } + if m.FieldCleared(menu.FieldOrderNo) { + fields = append(fields, menu.FieldOrderNo) + } + if m.FieldCleared(menu.FieldName) { + fields = append(fields, menu.FieldName) + } + if m.FieldCleared(menu.FieldTitle) { + fields = append(fields, menu.FieldTitle) + } + if m.FieldCleared(menu.FieldType) { + fields = append(fields, menu.FieldType) + } + if m.FieldCleared(menu.FieldPath) { + fields = append(fields, menu.FieldPath) + } + if m.FieldCleared(menu.FieldComponent) { + fields = append(fields, menu.FieldComponent) + } + if m.FieldCleared(menu.FieldIcon) { + fields = append(fields, menu.FieldIcon) + } + if m.FieldCleared(menu.FieldIsExt) { + fields = append(fields, menu.FieldIsExt) + } + if m.FieldCleared(menu.FieldExtURL) { + fields = append(fields, menu.FieldExtURL) + } + if m.FieldCleared(menu.FieldPermissions) { + fields = append(fields, menu.FieldPermissions) + } + if m.FieldCleared(menu.FieldRedirect) { + fields = append(fields, menu.FieldRedirect) + } + if m.FieldCleared(menu.FieldCurrentActiveMenu) { + fields = append(fields, menu.FieldCurrentActiveMenu) + } + if m.FieldCleared(menu.FieldKeepAlive) { + fields = append(fields, menu.FieldKeepAlive) + } + if m.FieldCleared(menu.FieldShow) { + fields = append(fields, menu.FieldShow) + } + if m.FieldCleared(menu.FieldHideTab) { + fields = append(fields, menu.FieldHideTab) + } + if m.FieldCleared(menu.FieldHideMenu) { + fields = append(fields, menu.FieldHideMenu) + } + if m.FieldCleared(menu.FieldHideBreadcrumb) { + fields = append(fields, menu.FieldHideBreadcrumb) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *MenuMutation) FieldCleared(name string) bool { + _, ok := m.clearedFields[name] + return ok +} + +// ClearField clears the value of the field with the given name. It returns an +// error if the field is not defined in the schema. +func (m *MenuMutation) ClearField(name string) error { + switch name { + case menu.FieldStatus: + m.ClearStatus() + return nil + case menu.FieldCreateTime: + m.ClearCreateTime() + return nil + case menu.FieldUpdateTime: + m.ClearUpdateTime() + return nil + case menu.FieldDeleteTime: + m.ClearDeleteTime() + return nil + case menu.FieldCreateBy: + m.ClearCreateBy() + return nil + case menu.FieldParentID: + m.ClearParentID() + return nil + case menu.FieldOrderNo: + m.ClearOrderNo() + return nil + case menu.FieldName: + m.ClearName() + return nil + case menu.FieldTitle: + m.ClearTitle() + return nil + case menu.FieldType: + m.ClearType() + return nil + case menu.FieldPath: + m.ClearPath() + return nil + case menu.FieldComponent: + m.ClearComponent() + return nil + case menu.FieldIcon: + m.ClearIcon() + return nil + case menu.FieldIsExt: + m.ClearIsExt() + return nil + case menu.FieldExtURL: + m.ClearExtURL() + return nil + case menu.FieldPermissions: + m.ClearPermissions() + return nil + case menu.FieldRedirect: + m.ClearRedirect() + return nil + case menu.FieldCurrentActiveMenu: + m.ClearCurrentActiveMenu() + return nil + case menu.FieldKeepAlive: + m.ClearKeepAlive() + return nil + case menu.FieldShow: + m.ClearShow() + return nil + case menu.FieldHideTab: + m.ClearHideTab() + return nil + case menu.FieldHideMenu: + m.ClearHideMenu() + return nil + case menu.FieldHideBreadcrumb: + m.ClearHideBreadcrumb() + return nil + } + return fmt.Errorf("unknown Menu nullable field %s", name) +} + +// ResetField resets all changes in the mutation for the field with the given name. +// It returns an error if the field is not defined in the schema. +func (m *MenuMutation) ResetField(name string) error { + switch name { + case menu.FieldStatus: + m.ResetStatus() + return nil + case menu.FieldCreateTime: + m.ResetCreateTime() + return nil + case menu.FieldUpdateTime: + m.ResetUpdateTime() + return nil + case menu.FieldDeleteTime: + m.ResetDeleteTime() + return nil + case menu.FieldCreateBy: + m.ResetCreateBy() + return nil + case menu.FieldParentID: + m.ResetParentID() + return nil + case menu.FieldOrderNo: + m.ResetOrderNo() + return nil + case menu.FieldName: + m.ResetName() + return nil + case menu.FieldTitle: + m.ResetTitle() + return nil + case menu.FieldType: + m.ResetType() + return nil + case menu.FieldPath: + m.ResetPath() + return nil + case menu.FieldComponent: + m.ResetComponent() + return nil + case menu.FieldIcon: + m.ResetIcon() + return nil + case menu.FieldIsExt: + m.ResetIsExt() + return nil + case menu.FieldExtURL: + m.ResetExtURL() + return nil + case menu.FieldPermissions: + m.ResetPermissions() + return nil + case menu.FieldRedirect: + m.ResetRedirect() + return nil + case menu.FieldCurrentActiveMenu: + m.ResetCurrentActiveMenu() + return nil + case menu.FieldKeepAlive: + m.ResetKeepAlive() + return nil + case menu.FieldShow: + m.ResetShow() + return nil + case menu.FieldHideTab: + m.ResetHideTab() + return nil + case menu.FieldHideMenu: + m.ResetHideMenu() + return nil + case menu.FieldHideBreadcrumb: + m.ResetHideBreadcrumb() + return nil + } + return fmt.Errorf("unknown Menu field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *MenuMutation) AddedEdges() []string { + edges := make([]string, 0, 2) + if m.parent != nil { + edges = append(edges, menu.EdgeParent) + } + if m.children != nil { + edges = append(edges, menu.EdgeChildren) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *MenuMutation) AddedIDs(name string) []ent.Value { + switch name { + case menu.EdgeParent: + if id := m.parent; id != nil { + return []ent.Value{*id} + } + case menu.EdgeChildren: + ids := make([]ent.Value, 0, len(m.children)) + for id := range m.children { + ids = append(ids, id) + } + return ids + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *MenuMutation) RemovedEdges() []string { + edges := make([]string, 0, 2) + if m.removedchildren != nil { + edges = append(edges, menu.EdgeChildren) + } + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *MenuMutation) RemovedIDs(name string) []ent.Value { + switch name { + case menu.EdgeChildren: + ids := make([]ent.Value, 0, len(m.removedchildren)) + for id := range m.removedchildren { + ids = append(ids, id) + } + return ids + } + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *MenuMutation) ClearedEdges() []string { + edges := make([]string, 0, 2) + if m.clearedparent { + edges = append(edges, menu.EdgeParent) + } + if m.clearedchildren { + edges = append(edges, menu.EdgeChildren) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *MenuMutation) EdgeCleared(name string) bool { + switch name { + case menu.EdgeParent: + return m.clearedparent + case menu.EdgeChildren: + return m.clearedchildren + } + return false +} + +// ClearEdge clears the value of the edge with the given name. It returns an error +// if that edge is not defined in the schema. +func (m *MenuMutation) ClearEdge(name string) error { + switch name { + case menu.EdgeParent: + m.ClearParent() + return nil + } + return fmt.Errorf("unknown Menu unique edge %s", name) +} + +// ResetEdge resets all changes to the edge with the given name in this mutation. +// It returns an error if the edge is not defined in the schema. +func (m *MenuMutation) ResetEdge(name string) error { + switch name { + case menu.EdgeParent: + m.ResetParent() + return nil + case menu.EdgeChildren: + m.ResetChildren() + return nil + } + return fmt.Errorf("unknown Menu edge %s", name) +} + +// OrganizationMutation represents an operation that mutates the Organization nodes in the graph. +type OrganizationMutation struct { + config + op Op + typ string + id *uint32 + create_time *time.Time + update_time *time.Time + delete_time *time.Time + status *organization.Status + create_by *uint32 + addcreate_by *int32 + remark *string + name *string + order_no *int32 + addorder_no *int32 + clearedFields map[string]struct{} + parent *uint32 + clearedparent bool + children map[uint32]struct{} + removedchildren map[uint32]struct{} + clearedchildren bool + done bool + oldValue func(context.Context) (*Organization, error) + predicates []predicate.Organization +} + +var _ ent.Mutation = (*OrganizationMutation)(nil) + +// organizationOption allows management of the mutation configuration using functional options. +type organizationOption func(*OrganizationMutation) + +// newOrganizationMutation creates new mutation for the Organization entity. +func newOrganizationMutation(c config, op Op, opts ...organizationOption) *OrganizationMutation { + m := &OrganizationMutation{ + config: c, + op: op, + typ: TypeOrganization, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withOrganizationID sets the ID field of the mutation. +func withOrganizationID(id uint32) organizationOption { + return func(m *OrganizationMutation) { + var ( + err error + once sync.Once + value *Organization + ) + m.oldValue = func(ctx context.Context) (*Organization, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Organization.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withOrganization sets the old Organization of the mutation. +func withOrganization(node *Organization) organizationOption { + return func(m *OrganizationMutation) { + m.oldValue = func(context.Context) (*Organization, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m OrganizationMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m OrganizationMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of Organization entities. +func (m *OrganizationMutation) SetID(id uint32) { + m.id = &id +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *OrganizationMutation) ID() (id uint32, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *OrganizationMutation) IDs(ctx context.Context) ([]uint32, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []uint32{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().Organization.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreateTime sets the "create_time" field. +func (m *OrganizationMutation) SetCreateTime(t time.Time) { + m.create_time = &t +} + +// CreateTime returns the value of the "create_time" field in the mutation. +func (m *OrganizationMutation) CreateTime() (r time.Time, exists bool) { + v := m.create_time + if v == nil { + return + } + return *v, true +} + +// OldCreateTime returns the old "create_time" field's value of the Organization entity. +// If the Organization object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *OrganizationMutation) OldCreateTime(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreateTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreateTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreateTime: %w", err) + } + return oldValue.CreateTime, nil +} + +// ClearCreateTime clears the value of the "create_time" field. +func (m *OrganizationMutation) ClearCreateTime() { + m.create_time = nil + m.clearedFields[organization.FieldCreateTime] = struct{}{} +} + +// CreateTimeCleared returns if the "create_time" field was cleared in this mutation. +func (m *OrganizationMutation) CreateTimeCleared() bool { + _, ok := m.clearedFields[organization.FieldCreateTime] + return ok +} + +// ResetCreateTime resets all changes to the "create_time" field. +func (m *OrganizationMutation) ResetCreateTime() { + m.create_time = nil + delete(m.clearedFields, organization.FieldCreateTime) +} + +// SetUpdateTime sets the "update_time" field. +func (m *OrganizationMutation) SetUpdateTime(t time.Time) { + m.update_time = &t +} + +// UpdateTime returns the value of the "update_time" field in the mutation. +func (m *OrganizationMutation) UpdateTime() (r time.Time, exists bool) { + v := m.update_time + if v == nil { + return + } + return *v, true +} + +// OldUpdateTime returns the old "update_time" field's value of the Organization entity. +// If the Organization object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *OrganizationMutation) OldUpdateTime(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdateTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdateTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdateTime: %w", err) + } + return oldValue.UpdateTime, nil +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (m *OrganizationMutation) ClearUpdateTime() { + m.update_time = nil + m.clearedFields[organization.FieldUpdateTime] = struct{}{} +} + +// UpdateTimeCleared returns if the "update_time" field was cleared in this mutation. +func (m *OrganizationMutation) UpdateTimeCleared() bool { + _, ok := m.clearedFields[organization.FieldUpdateTime] + return ok +} + +// ResetUpdateTime resets all changes to the "update_time" field. +func (m *OrganizationMutation) ResetUpdateTime() { + m.update_time = nil + delete(m.clearedFields, organization.FieldUpdateTime) +} + +// SetDeleteTime sets the "delete_time" field. +func (m *OrganizationMutation) SetDeleteTime(t time.Time) { + m.delete_time = &t +} + +// DeleteTime returns the value of the "delete_time" field in the mutation. +func (m *OrganizationMutation) DeleteTime() (r time.Time, exists bool) { + v := m.delete_time + if v == nil { + return + } + return *v, true +} + +// OldDeleteTime returns the old "delete_time" field's value of the Organization entity. +// If the Organization object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *OrganizationMutation) OldDeleteTime(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeleteTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeleteTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeleteTime: %w", err) + } + return oldValue.DeleteTime, nil +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (m *OrganizationMutation) ClearDeleteTime() { + m.delete_time = nil + m.clearedFields[organization.FieldDeleteTime] = struct{}{} +} + +// DeleteTimeCleared returns if the "delete_time" field was cleared in this mutation. +func (m *OrganizationMutation) DeleteTimeCleared() bool { + _, ok := m.clearedFields[organization.FieldDeleteTime] + return ok +} + +// ResetDeleteTime resets all changes to the "delete_time" field. +func (m *OrganizationMutation) ResetDeleteTime() { + m.delete_time = nil + delete(m.clearedFields, organization.FieldDeleteTime) +} + +// SetStatus sets the "status" field. +func (m *OrganizationMutation) SetStatus(o organization.Status) { + m.status = &o +} + +// Status returns the value of the "status" field in the mutation. +func (m *OrganizationMutation) Status() (r organization.Status, exists bool) { + v := m.status + if v == nil { + return + } + return *v, true +} + +// OldStatus returns the old "status" field's value of the Organization entity. +// If the Organization object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *OrganizationMutation) OldStatus(ctx context.Context) (v *organization.Status, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldStatus is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldStatus requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldStatus: %w", err) + } + return oldValue.Status, nil +} + +// ClearStatus clears the value of the "status" field. +func (m *OrganizationMutation) ClearStatus() { + m.status = nil + m.clearedFields[organization.FieldStatus] = struct{}{} +} + +// StatusCleared returns if the "status" field was cleared in this mutation. +func (m *OrganizationMutation) StatusCleared() bool { + _, ok := m.clearedFields[organization.FieldStatus] + return ok +} + +// ResetStatus resets all changes to the "status" field. +func (m *OrganizationMutation) ResetStatus() { + m.status = nil + delete(m.clearedFields, organization.FieldStatus) +} + +// SetCreateBy sets the "create_by" field. +func (m *OrganizationMutation) SetCreateBy(u uint32) { + m.create_by = &u + m.addcreate_by = nil +} + +// CreateBy returns the value of the "create_by" field in the mutation. +func (m *OrganizationMutation) CreateBy() (r uint32, exists bool) { + v := m.create_by + if v == nil { + return + } + return *v, true +} + +// OldCreateBy returns the old "create_by" field's value of the Organization entity. +// If the Organization object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *OrganizationMutation) OldCreateBy(ctx context.Context) (v *uint32, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreateBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreateBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreateBy: %w", err) + } + return oldValue.CreateBy, nil +} + +// AddCreateBy adds u to the "create_by" field. +func (m *OrganizationMutation) AddCreateBy(u int32) { + if m.addcreate_by != nil { + *m.addcreate_by += u + } else { + m.addcreate_by = &u + } +} + +// AddedCreateBy returns the value that was added to the "create_by" field in this mutation. +func (m *OrganizationMutation) AddedCreateBy() (r int32, exists bool) { + v := m.addcreate_by + if v == nil { + return + } + return *v, true +} + +// ClearCreateBy clears the value of the "create_by" field. +func (m *OrganizationMutation) ClearCreateBy() { + m.create_by = nil + m.addcreate_by = nil + m.clearedFields[organization.FieldCreateBy] = struct{}{} +} + +// CreateByCleared returns if the "create_by" field was cleared in this mutation. +func (m *OrganizationMutation) CreateByCleared() bool { + _, ok := m.clearedFields[organization.FieldCreateBy] + return ok +} + +// ResetCreateBy resets all changes to the "create_by" field. +func (m *OrganizationMutation) ResetCreateBy() { + m.create_by = nil + m.addcreate_by = nil + delete(m.clearedFields, organization.FieldCreateBy) +} + +// SetRemark sets the "remark" field. +func (m *OrganizationMutation) SetRemark(s string) { + m.remark = &s +} + +// Remark returns the value of the "remark" field in the mutation. +func (m *OrganizationMutation) Remark() (r string, exists bool) { + v := m.remark + if v == nil { + return + } + return *v, true +} + +// OldRemark returns the old "remark" field's value of the Organization entity. +// If the Organization object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *OrganizationMutation) OldRemark(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRemark is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRemark requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRemark: %w", err) + } + return oldValue.Remark, nil +} + +// ClearRemark clears the value of the "remark" field. +func (m *OrganizationMutation) ClearRemark() { + m.remark = nil + m.clearedFields[organization.FieldRemark] = struct{}{} +} + +// RemarkCleared returns if the "remark" field was cleared in this mutation. +func (m *OrganizationMutation) RemarkCleared() bool { + _, ok := m.clearedFields[organization.FieldRemark] + return ok +} + +// ResetRemark resets all changes to the "remark" field. +func (m *OrganizationMutation) ResetRemark() { + m.remark = nil + delete(m.clearedFields, organization.FieldRemark) +} + +// SetName sets the "name" field. +func (m *OrganizationMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *OrganizationMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the Organization entity. +// If the Organization object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *OrganizationMutation) OldName(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ClearName clears the value of the "name" field. +func (m *OrganizationMutation) ClearName() { + m.name = nil + m.clearedFields[organization.FieldName] = struct{}{} +} + +// NameCleared returns if the "name" field was cleared in this mutation. +func (m *OrganizationMutation) NameCleared() bool { + _, ok := m.clearedFields[organization.FieldName] + return ok +} + +// ResetName resets all changes to the "name" field. +func (m *OrganizationMutation) ResetName() { + m.name = nil + delete(m.clearedFields, organization.FieldName) +} + +// SetParentID sets the "parent_id" field. +func (m *OrganizationMutation) SetParentID(u uint32) { + m.parent = &u +} + +// ParentID returns the value of the "parent_id" field in the mutation. +func (m *OrganizationMutation) ParentID() (r uint32, exists bool) { + v := m.parent + if v == nil { + return + } + return *v, true +} + +// OldParentID returns the old "parent_id" field's value of the Organization entity. +// If the Organization object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *OrganizationMutation) OldParentID(ctx context.Context) (v *uint32, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldParentID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldParentID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldParentID: %w", err) + } + return oldValue.ParentID, nil +} + +// ClearParentID clears the value of the "parent_id" field. +func (m *OrganizationMutation) ClearParentID() { + m.parent = nil + m.clearedFields[organization.FieldParentID] = struct{}{} +} + +// ParentIDCleared returns if the "parent_id" field was cleared in this mutation. +func (m *OrganizationMutation) ParentIDCleared() bool { + _, ok := m.clearedFields[organization.FieldParentID] + return ok +} + +// ResetParentID resets all changes to the "parent_id" field. +func (m *OrganizationMutation) ResetParentID() { + m.parent = nil + delete(m.clearedFields, organization.FieldParentID) +} + +// SetOrderNo sets the "order_no" field. +func (m *OrganizationMutation) SetOrderNo(i int32) { + m.order_no = &i + m.addorder_no = nil +} + +// OrderNo returns the value of the "order_no" field in the mutation. +func (m *OrganizationMutation) OrderNo() (r int32, exists bool) { + v := m.order_no + if v == nil { + return + } + return *v, true +} + +// OldOrderNo returns the old "order_no" field's value of the Organization entity. +// If the Organization object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *OrganizationMutation) OldOrderNo(ctx context.Context) (v *int32, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOrderNo is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOrderNo requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOrderNo: %w", err) + } + return oldValue.OrderNo, nil +} + +// AddOrderNo adds i to the "order_no" field. +func (m *OrganizationMutation) AddOrderNo(i int32) { + if m.addorder_no != nil { + *m.addorder_no += i + } else { + m.addorder_no = &i + } +} + +// AddedOrderNo returns the value that was added to the "order_no" field in this mutation. +func (m *OrganizationMutation) AddedOrderNo() (r int32, exists bool) { + v := m.addorder_no + if v == nil { + return + } + return *v, true +} + +// ClearOrderNo clears the value of the "order_no" field. +func (m *OrganizationMutation) ClearOrderNo() { + m.order_no = nil + m.addorder_no = nil + m.clearedFields[organization.FieldOrderNo] = struct{}{} +} + +// OrderNoCleared returns if the "order_no" field was cleared in this mutation. +func (m *OrganizationMutation) OrderNoCleared() bool { + _, ok := m.clearedFields[organization.FieldOrderNo] + return ok +} + +// ResetOrderNo resets all changes to the "order_no" field. +func (m *OrganizationMutation) ResetOrderNo() { + m.order_no = nil + m.addorder_no = nil + delete(m.clearedFields, organization.FieldOrderNo) +} + +// ClearParent clears the "parent" edge to the Organization entity. +func (m *OrganizationMutation) ClearParent() { + m.clearedparent = true + m.clearedFields[organization.FieldParentID] = struct{}{} +} + +// ParentCleared reports if the "parent" edge to the Organization entity was cleared. +func (m *OrganizationMutation) ParentCleared() bool { + return m.ParentIDCleared() || m.clearedparent +} + +// ParentIDs returns the "parent" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// ParentID instead. It exists only for internal usage by the builders. +func (m *OrganizationMutation) ParentIDs() (ids []uint32) { + if id := m.parent; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetParent resets all changes to the "parent" edge. +func (m *OrganizationMutation) ResetParent() { + m.parent = nil + m.clearedparent = false +} + +// AddChildIDs adds the "children" edge to the Organization entity by ids. +func (m *OrganizationMutation) AddChildIDs(ids ...uint32) { + if m.children == nil { + m.children = make(map[uint32]struct{}) + } + for i := range ids { + m.children[ids[i]] = struct{}{} + } +} + +// ClearChildren clears the "children" edge to the Organization entity. +func (m *OrganizationMutation) ClearChildren() { + m.clearedchildren = true +} + +// ChildrenCleared reports if the "children" edge to the Organization entity was cleared. +func (m *OrganizationMutation) ChildrenCleared() bool { + return m.clearedchildren +} + +// RemoveChildIDs removes the "children" edge to the Organization entity by IDs. +func (m *OrganizationMutation) RemoveChildIDs(ids ...uint32) { + if m.removedchildren == nil { + m.removedchildren = make(map[uint32]struct{}) + } + for i := range ids { + delete(m.children, ids[i]) + m.removedchildren[ids[i]] = struct{}{} + } +} + +// RemovedChildren returns the removed IDs of the "children" edge to the Organization entity. +func (m *OrganizationMutation) RemovedChildrenIDs() (ids []uint32) { + for id := range m.removedchildren { + ids = append(ids, id) + } + return +} + +// ChildrenIDs returns the "children" edge IDs in the mutation. +func (m *OrganizationMutation) ChildrenIDs() (ids []uint32) { + for id := range m.children { + ids = append(ids, id) + } + return +} + +// ResetChildren resets all changes to the "children" edge. +func (m *OrganizationMutation) ResetChildren() { + m.children = nil + m.clearedchildren = false + m.removedchildren = nil +} + +// Where appends a list predicates to the OrganizationMutation builder. +func (m *OrganizationMutation) Where(ps ...predicate.Organization) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the OrganizationMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *OrganizationMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.Organization, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *OrganizationMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *OrganizationMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (Organization). +func (m *OrganizationMutation) Type() string { + return m.typ +} + +// Fields returns all fields that were changed during this mutation. Note that in +// order to get all numeric fields that were incremented/decremented, call +// AddedFields(). +func (m *OrganizationMutation) Fields() []string { + fields := make([]string, 0, 9) + if m.create_time != nil { + fields = append(fields, organization.FieldCreateTime) + } + if m.update_time != nil { + fields = append(fields, organization.FieldUpdateTime) + } + if m.delete_time != nil { + fields = append(fields, organization.FieldDeleteTime) + } + if m.status != nil { + fields = append(fields, organization.FieldStatus) + } + if m.create_by != nil { + fields = append(fields, organization.FieldCreateBy) + } + if m.remark != nil { + fields = append(fields, organization.FieldRemark) + } + if m.name != nil { + fields = append(fields, organization.FieldName) + } + if m.parent != nil { + fields = append(fields, organization.FieldParentID) + } + if m.order_no != nil { + fields = append(fields, organization.FieldOrderNo) + } + return fields +} + +// Field returns the value of a field with the given name. The second boolean +// return value indicates that this field was not set, or was not defined in the +// schema. +func (m *OrganizationMutation) Field(name string) (ent.Value, bool) { + switch name { + case organization.FieldCreateTime: + return m.CreateTime() + case organization.FieldUpdateTime: + return m.UpdateTime() + case organization.FieldDeleteTime: + return m.DeleteTime() + case organization.FieldStatus: + return m.Status() + case organization.FieldCreateBy: + return m.CreateBy() + case organization.FieldRemark: + return m.Remark() + case organization.FieldName: + return m.Name() + case organization.FieldParentID: + return m.ParentID() + case organization.FieldOrderNo: + return m.OrderNo() + } + return nil, false +} + +// OldField returns the old value of the field from the database. An error is +// returned if the mutation operation is not UpdateOne, or the query to the +// database failed. +func (m *OrganizationMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case organization.FieldCreateTime: + return m.OldCreateTime(ctx) + case organization.FieldUpdateTime: + return m.OldUpdateTime(ctx) + case organization.FieldDeleteTime: + return m.OldDeleteTime(ctx) + case organization.FieldStatus: + return m.OldStatus(ctx) + case organization.FieldCreateBy: + return m.OldCreateBy(ctx) + case organization.FieldRemark: + return m.OldRemark(ctx) + case organization.FieldName: + return m.OldName(ctx) + case organization.FieldParentID: + return m.OldParentID(ctx) + case organization.FieldOrderNo: + return m.OldOrderNo(ctx) + } + return nil, fmt.Errorf("unknown Organization field %s", name) +} + +// SetField sets the value of a field with the given name. It returns an error if +// the field is not defined in the schema, or if the type mismatched the field +// type. +func (m *OrganizationMutation) SetField(name string, value ent.Value) error { + switch name { + case organization.FieldCreateTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreateTime(v) + return nil + case organization.FieldUpdateTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdateTime(v) + return nil + case organization.FieldDeleteTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeleteTime(v) + return nil + case organization.FieldStatus: + v, ok := value.(organization.Status) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetStatus(v) + return nil + case organization.FieldCreateBy: + v, ok := value.(uint32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreateBy(v) + return nil + case organization.FieldRemark: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRemark(v) + return nil + case organization.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + case organization.FieldParentID: + v, ok := value.(uint32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetParentID(v) + return nil + case organization.FieldOrderNo: + v, ok := value.(int32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOrderNo(v) + return nil + } + return fmt.Errorf("unknown Organization field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *OrganizationMutation) AddedFields() []string { + var fields []string + if m.addcreate_by != nil { + fields = append(fields, organization.FieldCreateBy) + } + if m.addorder_no != nil { + fields = append(fields, organization.FieldOrderNo) + } + return fields +} + +// AddedField returns the numeric value that was incremented/decremented on a field +// with the given name. The second boolean return value indicates that this field +// was not set, or was not defined in the schema. +func (m *OrganizationMutation) AddedField(name string) (ent.Value, bool) { + switch name { + case organization.FieldCreateBy: + return m.AddedCreateBy() + case organization.FieldOrderNo: + return m.AddedOrderNo() + } + return nil, false +} + +// AddField adds the value to the field with the given name. It returns an error if +// the field is not defined in the schema, or if the type mismatched the field +// type. +func (m *OrganizationMutation) AddField(name string, value ent.Value) error { + switch name { + case organization.FieldCreateBy: + v, ok := value.(int32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddCreateBy(v) + return nil + case organization.FieldOrderNo: + v, ok := value.(int32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddOrderNo(v) + return nil + } + return fmt.Errorf("unknown Organization numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *OrganizationMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(organization.FieldCreateTime) { + fields = append(fields, organization.FieldCreateTime) + } + if m.FieldCleared(organization.FieldUpdateTime) { + fields = append(fields, organization.FieldUpdateTime) + } + if m.FieldCleared(organization.FieldDeleteTime) { + fields = append(fields, organization.FieldDeleteTime) + } + if m.FieldCleared(organization.FieldStatus) { + fields = append(fields, organization.FieldStatus) + } + if m.FieldCleared(organization.FieldCreateBy) { + fields = append(fields, organization.FieldCreateBy) + } + if m.FieldCleared(organization.FieldRemark) { + fields = append(fields, organization.FieldRemark) + } + if m.FieldCleared(organization.FieldName) { + fields = append(fields, organization.FieldName) + } + if m.FieldCleared(organization.FieldParentID) { + fields = append(fields, organization.FieldParentID) + } + if m.FieldCleared(organization.FieldOrderNo) { + fields = append(fields, organization.FieldOrderNo) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *OrganizationMutation) FieldCleared(name string) bool { + _, ok := m.clearedFields[name] + return ok +} + +// ClearField clears the value of the field with the given name. It returns an +// error if the field is not defined in the schema. +func (m *OrganizationMutation) ClearField(name string) error { + switch name { + case organization.FieldCreateTime: + m.ClearCreateTime() + return nil + case organization.FieldUpdateTime: + m.ClearUpdateTime() + return nil + case organization.FieldDeleteTime: + m.ClearDeleteTime() + return nil + case organization.FieldStatus: + m.ClearStatus() + return nil + case organization.FieldCreateBy: + m.ClearCreateBy() + return nil + case organization.FieldRemark: + m.ClearRemark() + return nil + case organization.FieldName: + m.ClearName() + return nil + case organization.FieldParentID: + m.ClearParentID() + return nil + case organization.FieldOrderNo: + m.ClearOrderNo() + return nil + } + return fmt.Errorf("unknown Organization nullable field %s", name) +} + +// ResetField resets all changes in the mutation for the field with the given name. +// It returns an error if the field is not defined in the schema. +func (m *OrganizationMutation) ResetField(name string) error { + switch name { + case organization.FieldCreateTime: + m.ResetCreateTime() + return nil + case organization.FieldUpdateTime: + m.ResetUpdateTime() + return nil + case organization.FieldDeleteTime: + m.ResetDeleteTime() + return nil + case organization.FieldStatus: + m.ResetStatus() + return nil + case organization.FieldCreateBy: + m.ResetCreateBy() + return nil + case organization.FieldRemark: + m.ResetRemark() + return nil + case organization.FieldName: + m.ResetName() + return nil + case organization.FieldParentID: + m.ResetParentID() + return nil + case organization.FieldOrderNo: + m.ResetOrderNo() + return nil + } + return fmt.Errorf("unknown Organization field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *OrganizationMutation) AddedEdges() []string { + edges := make([]string, 0, 2) + if m.parent != nil { + edges = append(edges, organization.EdgeParent) + } + if m.children != nil { + edges = append(edges, organization.EdgeChildren) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *OrganizationMutation) AddedIDs(name string) []ent.Value { + switch name { + case organization.EdgeParent: + if id := m.parent; id != nil { + return []ent.Value{*id} + } + case organization.EdgeChildren: + ids := make([]ent.Value, 0, len(m.children)) + for id := range m.children { + ids = append(ids, id) + } + return ids + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *OrganizationMutation) RemovedEdges() []string { + edges := make([]string, 0, 2) + if m.removedchildren != nil { + edges = append(edges, organization.EdgeChildren) + } + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *OrganizationMutation) RemovedIDs(name string) []ent.Value { + switch name { + case organization.EdgeChildren: + ids := make([]ent.Value, 0, len(m.removedchildren)) + for id := range m.removedchildren { + ids = append(ids, id) + } + return ids + } + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *OrganizationMutation) ClearedEdges() []string { + edges := make([]string, 0, 2) + if m.clearedparent { + edges = append(edges, organization.EdgeParent) + } + if m.clearedchildren { + edges = append(edges, organization.EdgeChildren) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *OrganizationMutation) EdgeCleared(name string) bool { + switch name { + case organization.EdgeParent: + return m.clearedparent + case organization.EdgeChildren: + return m.clearedchildren + } + return false +} + +// ClearEdge clears the value of the edge with the given name. It returns an error +// if that edge is not defined in the schema. +func (m *OrganizationMutation) ClearEdge(name string) error { + switch name { + case organization.EdgeParent: + m.ClearParent() + return nil + } + return fmt.Errorf("unknown Organization unique edge %s", name) +} + +// ResetEdge resets all changes to the edge with the given name in this mutation. +// It returns an error if the edge is not defined in the schema. +func (m *OrganizationMutation) ResetEdge(name string) error { + switch name { + case organization.EdgeParent: + m.ResetParent() + return nil + case organization.EdgeChildren: + m.ResetChildren() + return nil + } + return fmt.Errorf("unknown Organization edge %s", name) +} + +// PositionMutation represents an operation that mutates the Position nodes in the graph. +type PositionMutation struct { + config + op Op + typ string + id *uint32 + create_time *time.Time + update_time *time.Time + delete_time *time.Time + status *position.Status + create_by *uint32 + addcreate_by *int32 + remark *string + name *string + code *string + order_no *int32 + addorder_no *int32 + clearedFields map[string]struct{} + parent *uint32 + clearedparent bool + children map[uint32]struct{} + removedchildren map[uint32]struct{} + clearedchildren bool + done bool + oldValue func(context.Context) (*Position, error) + predicates []predicate.Position +} + +var _ ent.Mutation = (*PositionMutation)(nil) + +// positionOption allows management of the mutation configuration using functional options. +type positionOption func(*PositionMutation) + +// newPositionMutation creates new mutation for the Position entity. +func newPositionMutation(c config, op Op, opts ...positionOption) *PositionMutation { + m := &PositionMutation{ + config: c, + op: op, + typ: TypePosition, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withPositionID sets the ID field of the mutation. +func withPositionID(id uint32) positionOption { + return func(m *PositionMutation) { + var ( + err error + once sync.Once + value *Position + ) + m.oldValue = func(ctx context.Context) (*Position, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Position.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withPosition sets the old Position of the mutation. +func withPosition(node *Position) positionOption { + return func(m *PositionMutation) { + m.oldValue = func(context.Context) (*Position, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m PositionMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m PositionMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of Position entities. +func (m *PositionMutation) SetID(id uint32) { + m.id = &id +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *PositionMutation) ID() (id uint32, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *PositionMutation) IDs(ctx context.Context) ([]uint32, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []uint32{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().Position.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreateTime sets the "create_time" field. +func (m *PositionMutation) SetCreateTime(t time.Time) { + m.create_time = &t +} + +// CreateTime returns the value of the "create_time" field in the mutation. +func (m *PositionMutation) CreateTime() (r time.Time, exists bool) { + v := m.create_time + if v == nil { + return + } + return *v, true +} + +// OldCreateTime returns the old "create_time" field's value of the Position entity. +// If the Position object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *PositionMutation) OldCreateTime(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreateTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreateTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreateTime: %w", err) + } + return oldValue.CreateTime, nil +} + +// ClearCreateTime clears the value of the "create_time" field. +func (m *PositionMutation) ClearCreateTime() { + m.create_time = nil + m.clearedFields[position.FieldCreateTime] = struct{}{} +} + +// CreateTimeCleared returns if the "create_time" field was cleared in this mutation. +func (m *PositionMutation) CreateTimeCleared() bool { + _, ok := m.clearedFields[position.FieldCreateTime] + return ok +} + +// ResetCreateTime resets all changes to the "create_time" field. +func (m *PositionMutation) ResetCreateTime() { + m.create_time = nil + delete(m.clearedFields, position.FieldCreateTime) +} + +// SetUpdateTime sets the "update_time" field. +func (m *PositionMutation) SetUpdateTime(t time.Time) { + m.update_time = &t +} + +// UpdateTime returns the value of the "update_time" field in the mutation. +func (m *PositionMutation) UpdateTime() (r time.Time, exists bool) { + v := m.update_time + if v == nil { + return + } + return *v, true +} + +// OldUpdateTime returns the old "update_time" field's value of the Position entity. +// If the Position object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *PositionMutation) OldUpdateTime(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdateTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdateTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdateTime: %w", err) + } + return oldValue.UpdateTime, nil +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (m *PositionMutation) ClearUpdateTime() { + m.update_time = nil + m.clearedFields[position.FieldUpdateTime] = struct{}{} +} + +// UpdateTimeCleared returns if the "update_time" field was cleared in this mutation. +func (m *PositionMutation) UpdateTimeCleared() bool { + _, ok := m.clearedFields[position.FieldUpdateTime] + return ok +} + +// ResetUpdateTime resets all changes to the "update_time" field. +func (m *PositionMutation) ResetUpdateTime() { + m.update_time = nil + delete(m.clearedFields, position.FieldUpdateTime) +} + +// SetDeleteTime sets the "delete_time" field. +func (m *PositionMutation) SetDeleteTime(t time.Time) { + m.delete_time = &t +} + +// DeleteTime returns the value of the "delete_time" field in the mutation. +func (m *PositionMutation) DeleteTime() (r time.Time, exists bool) { + v := m.delete_time + if v == nil { + return + } + return *v, true +} + +// OldDeleteTime returns the old "delete_time" field's value of the Position entity. +// If the Position object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *PositionMutation) OldDeleteTime(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeleteTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeleteTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeleteTime: %w", err) + } + return oldValue.DeleteTime, nil +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (m *PositionMutation) ClearDeleteTime() { + m.delete_time = nil + m.clearedFields[position.FieldDeleteTime] = struct{}{} +} + +// DeleteTimeCleared returns if the "delete_time" field was cleared in this mutation. +func (m *PositionMutation) DeleteTimeCleared() bool { + _, ok := m.clearedFields[position.FieldDeleteTime] + return ok +} + +// ResetDeleteTime resets all changes to the "delete_time" field. +func (m *PositionMutation) ResetDeleteTime() { + m.delete_time = nil + delete(m.clearedFields, position.FieldDeleteTime) +} + +// SetStatus sets the "status" field. +func (m *PositionMutation) SetStatus(po position.Status) { + m.status = &po +} + +// Status returns the value of the "status" field in the mutation. +func (m *PositionMutation) Status() (r position.Status, exists bool) { + v := m.status + if v == nil { + return + } + return *v, true +} + +// OldStatus returns the old "status" field's value of the Position entity. +// If the Position object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *PositionMutation) OldStatus(ctx context.Context) (v *position.Status, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldStatus is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldStatus requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldStatus: %w", err) + } + return oldValue.Status, nil +} + +// ClearStatus clears the value of the "status" field. +func (m *PositionMutation) ClearStatus() { + m.status = nil + m.clearedFields[position.FieldStatus] = struct{}{} +} + +// StatusCleared returns if the "status" field was cleared in this mutation. +func (m *PositionMutation) StatusCleared() bool { + _, ok := m.clearedFields[position.FieldStatus] + return ok +} + +// ResetStatus resets all changes to the "status" field. +func (m *PositionMutation) ResetStatus() { + m.status = nil + delete(m.clearedFields, position.FieldStatus) +} + +// SetCreateBy sets the "create_by" field. +func (m *PositionMutation) SetCreateBy(u uint32) { + m.create_by = &u + m.addcreate_by = nil +} + +// CreateBy returns the value of the "create_by" field in the mutation. +func (m *PositionMutation) CreateBy() (r uint32, exists bool) { + v := m.create_by + if v == nil { + return + } + return *v, true +} + +// OldCreateBy returns the old "create_by" field's value of the Position entity. +// If the Position object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *PositionMutation) OldCreateBy(ctx context.Context) (v *uint32, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreateBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreateBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreateBy: %w", err) + } + return oldValue.CreateBy, nil +} + +// AddCreateBy adds u to the "create_by" field. +func (m *PositionMutation) AddCreateBy(u int32) { + if m.addcreate_by != nil { + *m.addcreate_by += u + } else { + m.addcreate_by = &u + } +} + +// AddedCreateBy returns the value that was added to the "create_by" field in this mutation. +func (m *PositionMutation) AddedCreateBy() (r int32, exists bool) { + v := m.addcreate_by + if v == nil { + return + } + return *v, true +} + +// ClearCreateBy clears the value of the "create_by" field. +func (m *PositionMutation) ClearCreateBy() { + m.create_by = nil + m.addcreate_by = nil + m.clearedFields[position.FieldCreateBy] = struct{}{} +} + +// CreateByCleared returns if the "create_by" field was cleared in this mutation. +func (m *PositionMutation) CreateByCleared() bool { + _, ok := m.clearedFields[position.FieldCreateBy] + return ok +} + +// ResetCreateBy resets all changes to the "create_by" field. +func (m *PositionMutation) ResetCreateBy() { + m.create_by = nil + m.addcreate_by = nil + delete(m.clearedFields, position.FieldCreateBy) +} + +// SetRemark sets the "remark" field. +func (m *PositionMutation) SetRemark(s string) { + m.remark = &s +} + +// Remark returns the value of the "remark" field in the mutation. +func (m *PositionMutation) Remark() (r string, exists bool) { + v := m.remark + if v == nil { + return + } + return *v, true +} + +// OldRemark returns the old "remark" field's value of the Position entity. +// If the Position object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *PositionMutation) OldRemark(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRemark is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRemark requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRemark: %w", err) + } + return oldValue.Remark, nil +} + +// ClearRemark clears the value of the "remark" field. +func (m *PositionMutation) ClearRemark() { + m.remark = nil + m.clearedFields[position.FieldRemark] = struct{}{} +} + +// RemarkCleared returns if the "remark" field was cleared in this mutation. +func (m *PositionMutation) RemarkCleared() bool { + _, ok := m.clearedFields[position.FieldRemark] + return ok +} + +// ResetRemark resets all changes to the "remark" field. +func (m *PositionMutation) ResetRemark() { + m.remark = nil + delete(m.clearedFields, position.FieldRemark) +} + +// SetName sets the "name" field. +func (m *PositionMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *PositionMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the Position entity. +// If the Position object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *PositionMutation) OldName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ResetName resets all changes to the "name" field. +func (m *PositionMutation) ResetName() { + m.name = nil +} + +// SetCode sets the "code" field. +func (m *PositionMutation) SetCode(s string) { + m.code = &s +} + +// Code returns the value of the "code" field in the mutation. +func (m *PositionMutation) Code() (r string, exists bool) { + v := m.code + if v == nil { + return + } + return *v, true +} + +// OldCode returns the old "code" field's value of the Position entity. +// If the Position object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *PositionMutation) OldCode(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCode is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCode requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCode: %w", err) + } + return oldValue.Code, nil +} + +// ResetCode resets all changes to the "code" field. +func (m *PositionMutation) ResetCode() { + m.code = nil +} + +// SetParentID sets the "parent_id" field. +func (m *PositionMutation) SetParentID(u uint32) { + m.parent = &u +} + +// ParentID returns the value of the "parent_id" field in the mutation. +func (m *PositionMutation) ParentID() (r uint32, exists bool) { + v := m.parent + if v == nil { + return + } + return *v, true +} + +// OldParentID returns the old "parent_id" field's value of the Position entity. +// If the Position object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *PositionMutation) OldParentID(ctx context.Context) (v uint32, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldParentID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldParentID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldParentID: %w", err) + } + return oldValue.ParentID, nil +} + +// ClearParentID clears the value of the "parent_id" field. +func (m *PositionMutation) ClearParentID() { + m.parent = nil + m.clearedFields[position.FieldParentID] = struct{}{} +} + +// ParentIDCleared returns if the "parent_id" field was cleared in this mutation. +func (m *PositionMutation) ParentIDCleared() bool { + _, ok := m.clearedFields[position.FieldParentID] + return ok +} + +// ResetParentID resets all changes to the "parent_id" field. +func (m *PositionMutation) ResetParentID() { + m.parent = nil + delete(m.clearedFields, position.FieldParentID) +} + +// SetOrderNo sets the "order_no" field. +func (m *PositionMutation) SetOrderNo(i int32) { + m.order_no = &i + m.addorder_no = nil +} + +// OrderNo returns the value of the "order_no" field in the mutation. +func (m *PositionMutation) OrderNo() (r int32, exists bool) { + v := m.order_no + if v == nil { + return + } + return *v, true +} + +// OldOrderNo returns the old "order_no" field's value of the Position entity. +// If the Position object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *PositionMutation) OldOrderNo(ctx context.Context) (v int32, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOrderNo is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOrderNo requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOrderNo: %w", err) + } + return oldValue.OrderNo, nil +} + +// AddOrderNo adds i to the "order_no" field. +func (m *PositionMutation) AddOrderNo(i int32) { + if m.addorder_no != nil { + *m.addorder_no += i + } else { + m.addorder_no = &i + } +} + +// AddedOrderNo returns the value that was added to the "order_no" field in this mutation. +func (m *PositionMutation) AddedOrderNo() (r int32, exists bool) { + v := m.addorder_no + if v == nil { + return + } + return *v, true +} + +// ResetOrderNo resets all changes to the "order_no" field. +func (m *PositionMutation) ResetOrderNo() { + m.order_no = nil + m.addorder_no = nil +} + +// ClearParent clears the "parent" edge to the Position entity. +func (m *PositionMutation) ClearParent() { + m.clearedparent = true + m.clearedFields[position.FieldParentID] = struct{}{} +} + +// ParentCleared reports if the "parent" edge to the Position entity was cleared. +func (m *PositionMutation) ParentCleared() bool { + return m.ParentIDCleared() || m.clearedparent +} + +// ParentIDs returns the "parent" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// ParentID instead. It exists only for internal usage by the builders. +func (m *PositionMutation) ParentIDs() (ids []uint32) { + if id := m.parent; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetParent resets all changes to the "parent" edge. +func (m *PositionMutation) ResetParent() { + m.parent = nil + m.clearedparent = false +} + +// AddChildIDs adds the "children" edge to the Position entity by ids. +func (m *PositionMutation) AddChildIDs(ids ...uint32) { + if m.children == nil { + m.children = make(map[uint32]struct{}) + } + for i := range ids { + m.children[ids[i]] = struct{}{} + } +} + +// ClearChildren clears the "children" edge to the Position entity. +func (m *PositionMutation) ClearChildren() { + m.clearedchildren = true +} + +// ChildrenCleared reports if the "children" edge to the Position entity was cleared. +func (m *PositionMutation) ChildrenCleared() bool { + return m.clearedchildren +} + +// RemoveChildIDs removes the "children" edge to the Position entity by IDs. +func (m *PositionMutation) RemoveChildIDs(ids ...uint32) { + if m.removedchildren == nil { + m.removedchildren = make(map[uint32]struct{}) + } + for i := range ids { + delete(m.children, ids[i]) + m.removedchildren[ids[i]] = struct{}{} + } +} + +// RemovedChildren returns the removed IDs of the "children" edge to the Position entity. +func (m *PositionMutation) RemovedChildrenIDs() (ids []uint32) { + for id := range m.removedchildren { + ids = append(ids, id) + } + return +} + +// ChildrenIDs returns the "children" edge IDs in the mutation. +func (m *PositionMutation) ChildrenIDs() (ids []uint32) { + for id := range m.children { + ids = append(ids, id) + } + return +} + +// ResetChildren resets all changes to the "children" edge. +func (m *PositionMutation) ResetChildren() { + m.children = nil + m.clearedchildren = false + m.removedchildren = nil +} + +// Where appends a list predicates to the PositionMutation builder. +func (m *PositionMutation) Where(ps ...predicate.Position) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the PositionMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *PositionMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.Position, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *PositionMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *PositionMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (Position). +func (m *PositionMutation) Type() string { + return m.typ +} + +// Fields returns all fields that were changed during this mutation. Note that in +// order to get all numeric fields that were incremented/decremented, call +// AddedFields(). +func (m *PositionMutation) Fields() []string { + fields := make([]string, 0, 10) + if m.create_time != nil { + fields = append(fields, position.FieldCreateTime) + } + if m.update_time != nil { + fields = append(fields, position.FieldUpdateTime) + } + if m.delete_time != nil { + fields = append(fields, position.FieldDeleteTime) + } + if m.status != nil { + fields = append(fields, position.FieldStatus) + } + if m.create_by != nil { + fields = append(fields, position.FieldCreateBy) + } + if m.remark != nil { + fields = append(fields, position.FieldRemark) + } + if m.name != nil { + fields = append(fields, position.FieldName) + } + if m.code != nil { + fields = append(fields, position.FieldCode) + } + if m.parent != nil { + fields = append(fields, position.FieldParentID) + } + if m.order_no != nil { + fields = append(fields, position.FieldOrderNo) + } + return fields +} + +// Field returns the value of a field with the given name. The second boolean +// return value indicates that this field was not set, or was not defined in the +// schema. +func (m *PositionMutation) Field(name string) (ent.Value, bool) { + switch name { + case position.FieldCreateTime: + return m.CreateTime() + case position.FieldUpdateTime: + return m.UpdateTime() + case position.FieldDeleteTime: + return m.DeleteTime() + case position.FieldStatus: + return m.Status() + case position.FieldCreateBy: + return m.CreateBy() + case position.FieldRemark: + return m.Remark() + case position.FieldName: + return m.Name() + case position.FieldCode: + return m.Code() + case position.FieldParentID: + return m.ParentID() + case position.FieldOrderNo: + return m.OrderNo() + } + return nil, false +} + +// OldField returns the old value of the field from the database. An error is +// returned if the mutation operation is not UpdateOne, or the query to the +// database failed. +func (m *PositionMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case position.FieldCreateTime: + return m.OldCreateTime(ctx) + case position.FieldUpdateTime: + return m.OldUpdateTime(ctx) + case position.FieldDeleteTime: + return m.OldDeleteTime(ctx) + case position.FieldStatus: + return m.OldStatus(ctx) + case position.FieldCreateBy: + return m.OldCreateBy(ctx) + case position.FieldRemark: + return m.OldRemark(ctx) + case position.FieldName: + return m.OldName(ctx) + case position.FieldCode: + return m.OldCode(ctx) + case position.FieldParentID: + return m.OldParentID(ctx) + case position.FieldOrderNo: + return m.OldOrderNo(ctx) + } + return nil, fmt.Errorf("unknown Position field %s", name) +} + +// SetField sets the value of a field with the given name. It returns an error if +// the field is not defined in the schema, or if the type mismatched the field +// type. +func (m *PositionMutation) SetField(name string, value ent.Value) error { + switch name { + case position.FieldCreateTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreateTime(v) + return nil + case position.FieldUpdateTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdateTime(v) + return nil + case position.FieldDeleteTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeleteTime(v) + return nil + case position.FieldStatus: + v, ok := value.(position.Status) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetStatus(v) + return nil + case position.FieldCreateBy: + v, ok := value.(uint32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreateBy(v) + return nil + case position.FieldRemark: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRemark(v) + return nil + case position.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + case position.FieldCode: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCode(v) + return nil + case position.FieldParentID: + v, ok := value.(uint32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetParentID(v) + return nil + case position.FieldOrderNo: + v, ok := value.(int32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOrderNo(v) + return nil + } + return fmt.Errorf("unknown Position field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *PositionMutation) AddedFields() []string { + var fields []string + if m.addcreate_by != nil { + fields = append(fields, position.FieldCreateBy) + } + if m.addorder_no != nil { + fields = append(fields, position.FieldOrderNo) + } + return fields +} + +// AddedField returns the numeric value that was incremented/decremented on a field +// with the given name. The second boolean return value indicates that this field +// was not set, or was not defined in the schema. +func (m *PositionMutation) AddedField(name string) (ent.Value, bool) { + switch name { + case position.FieldCreateBy: + return m.AddedCreateBy() + case position.FieldOrderNo: + return m.AddedOrderNo() + } + return nil, false +} + +// AddField adds the value to the field with the given name. It returns an error if +// the field is not defined in the schema, or if the type mismatched the field +// type. +func (m *PositionMutation) AddField(name string, value ent.Value) error { + switch name { + case position.FieldCreateBy: + v, ok := value.(int32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddCreateBy(v) + return nil + case position.FieldOrderNo: + v, ok := value.(int32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddOrderNo(v) + return nil + } + return fmt.Errorf("unknown Position numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *PositionMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(position.FieldCreateTime) { + fields = append(fields, position.FieldCreateTime) + } + if m.FieldCleared(position.FieldUpdateTime) { + fields = append(fields, position.FieldUpdateTime) + } + if m.FieldCleared(position.FieldDeleteTime) { + fields = append(fields, position.FieldDeleteTime) + } + if m.FieldCleared(position.FieldStatus) { + fields = append(fields, position.FieldStatus) + } + if m.FieldCleared(position.FieldCreateBy) { + fields = append(fields, position.FieldCreateBy) + } + if m.FieldCleared(position.FieldRemark) { + fields = append(fields, position.FieldRemark) + } + if m.FieldCleared(position.FieldParentID) { + fields = append(fields, position.FieldParentID) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *PositionMutation) FieldCleared(name string) bool { + _, ok := m.clearedFields[name] + return ok +} + +// ClearField clears the value of the field with the given name. It returns an +// error if the field is not defined in the schema. +func (m *PositionMutation) ClearField(name string) error { + switch name { + case position.FieldCreateTime: + m.ClearCreateTime() + return nil + case position.FieldUpdateTime: + m.ClearUpdateTime() + return nil + case position.FieldDeleteTime: + m.ClearDeleteTime() + return nil + case position.FieldStatus: + m.ClearStatus() + return nil + case position.FieldCreateBy: + m.ClearCreateBy() + return nil + case position.FieldRemark: + m.ClearRemark() + return nil + case position.FieldParentID: + m.ClearParentID() + return nil + } + return fmt.Errorf("unknown Position nullable field %s", name) +} + +// ResetField resets all changes in the mutation for the field with the given name. +// It returns an error if the field is not defined in the schema. +func (m *PositionMutation) ResetField(name string) error { + switch name { + case position.FieldCreateTime: + m.ResetCreateTime() + return nil + case position.FieldUpdateTime: + m.ResetUpdateTime() + return nil + case position.FieldDeleteTime: + m.ResetDeleteTime() + return nil + case position.FieldStatus: + m.ResetStatus() + return nil + case position.FieldCreateBy: + m.ResetCreateBy() + return nil + case position.FieldRemark: + m.ResetRemark() + return nil + case position.FieldName: + m.ResetName() + return nil + case position.FieldCode: + m.ResetCode() + return nil + case position.FieldParentID: + m.ResetParentID() + return nil + case position.FieldOrderNo: + m.ResetOrderNo() + return nil + } + return fmt.Errorf("unknown Position field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *PositionMutation) AddedEdges() []string { + edges := make([]string, 0, 2) + if m.parent != nil { + edges = append(edges, position.EdgeParent) + } + if m.children != nil { + edges = append(edges, position.EdgeChildren) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *PositionMutation) AddedIDs(name string) []ent.Value { + switch name { + case position.EdgeParent: + if id := m.parent; id != nil { + return []ent.Value{*id} + } + case position.EdgeChildren: + ids := make([]ent.Value, 0, len(m.children)) + for id := range m.children { + ids = append(ids, id) + } + return ids + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *PositionMutation) RemovedEdges() []string { + edges := make([]string, 0, 2) + if m.removedchildren != nil { + edges = append(edges, position.EdgeChildren) + } + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *PositionMutation) RemovedIDs(name string) []ent.Value { + switch name { + case position.EdgeChildren: + ids := make([]ent.Value, 0, len(m.removedchildren)) + for id := range m.removedchildren { + ids = append(ids, id) + } + return ids + } + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *PositionMutation) ClearedEdges() []string { + edges := make([]string, 0, 2) + if m.clearedparent { + edges = append(edges, position.EdgeParent) + } + if m.clearedchildren { + edges = append(edges, position.EdgeChildren) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *PositionMutation) EdgeCleared(name string) bool { + switch name { + case position.EdgeParent: + return m.clearedparent + case position.EdgeChildren: + return m.clearedchildren + } + return false +} + +// ClearEdge clears the value of the edge with the given name. It returns an error +// if that edge is not defined in the schema. +func (m *PositionMutation) ClearEdge(name string) error { + switch name { + case position.EdgeParent: + m.ClearParent() + return nil + } + return fmt.Errorf("unknown Position unique edge %s", name) +} + +// ResetEdge resets all changes to the edge with the given name in this mutation. +// It returns an error if the edge is not defined in the schema. +func (m *PositionMutation) ResetEdge(name string) error { + switch name { + case position.EdgeParent: + m.ResetParent() + return nil + case position.EdgeChildren: + m.ResetChildren() + return nil + } + return fmt.Errorf("unknown Position edge %s", name) +} + +// RoleMutation represents an operation that mutates the Role nodes in the graph. +type RoleMutation struct { + config + op Op + typ string + id *uint32 + create_time *time.Time + update_time *time.Time + delete_time *time.Time + status *role.Status + create_by *uint32 + addcreate_by *int32 + remark *string + name *string + code *string + order_no *int32 + addorder_no *int32 + clearedFields map[string]struct{} + parent *uint32 + clearedparent bool + children map[uint32]struct{} + removedchildren map[uint32]struct{} + clearedchildren bool + done bool + oldValue func(context.Context) (*Role, error) + predicates []predicate.Role +} + +var _ ent.Mutation = (*RoleMutation)(nil) + +// roleOption allows management of the mutation configuration using functional options. +type roleOption func(*RoleMutation) + +// newRoleMutation creates new mutation for the Role entity. +func newRoleMutation(c config, op Op, opts ...roleOption) *RoleMutation { + m := &RoleMutation{ + config: c, + op: op, + typ: TypeRole, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withRoleID sets the ID field of the mutation. +func withRoleID(id uint32) roleOption { + return func(m *RoleMutation) { + var ( + err error + once sync.Once + value *Role + ) + m.oldValue = func(ctx context.Context) (*Role, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Role.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withRole sets the old Role of the mutation. +func withRole(node *Role) roleOption { + return func(m *RoleMutation) { + m.oldValue = func(context.Context) (*Role, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m RoleMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m RoleMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of Role entities. +func (m *RoleMutation) SetID(id uint32) { + m.id = &id +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *RoleMutation) ID() (id uint32, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *RoleMutation) IDs(ctx context.Context) ([]uint32, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []uint32{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().Role.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreateTime sets the "create_time" field. +func (m *RoleMutation) SetCreateTime(t time.Time) { + m.create_time = &t +} + +// CreateTime returns the value of the "create_time" field in the mutation. +func (m *RoleMutation) CreateTime() (r time.Time, exists bool) { + v := m.create_time + if v == nil { + return + } + return *v, true +} + +// OldCreateTime returns the old "create_time" field's value of the Role entity. +// If the Role object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *RoleMutation) OldCreateTime(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreateTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreateTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreateTime: %w", err) + } + return oldValue.CreateTime, nil +} + +// ClearCreateTime clears the value of the "create_time" field. +func (m *RoleMutation) ClearCreateTime() { + m.create_time = nil + m.clearedFields[role.FieldCreateTime] = struct{}{} +} + +// CreateTimeCleared returns if the "create_time" field was cleared in this mutation. +func (m *RoleMutation) CreateTimeCleared() bool { + _, ok := m.clearedFields[role.FieldCreateTime] + return ok +} + +// ResetCreateTime resets all changes to the "create_time" field. +func (m *RoleMutation) ResetCreateTime() { + m.create_time = nil + delete(m.clearedFields, role.FieldCreateTime) +} + +// SetUpdateTime sets the "update_time" field. +func (m *RoleMutation) SetUpdateTime(t time.Time) { + m.update_time = &t +} + +// UpdateTime returns the value of the "update_time" field in the mutation. +func (m *RoleMutation) UpdateTime() (r time.Time, exists bool) { + v := m.update_time + if v == nil { + return + } + return *v, true +} + +// OldUpdateTime returns the old "update_time" field's value of the Role entity. +// If the Role object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *RoleMutation) OldUpdateTime(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdateTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdateTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdateTime: %w", err) + } + return oldValue.UpdateTime, nil +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (m *RoleMutation) ClearUpdateTime() { + m.update_time = nil + m.clearedFields[role.FieldUpdateTime] = struct{}{} +} + +// UpdateTimeCleared returns if the "update_time" field was cleared in this mutation. +func (m *RoleMutation) UpdateTimeCleared() bool { + _, ok := m.clearedFields[role.FieldUpdateTime] + return ok +} + +// ResetUpdateTime resets all changes to the "update_time" field. +func (m *RoleMutation) ResetUpdateTime() { + m.update_time = nil + delete(m.clearedFields, role.FieldUpdateTime) +} + +// SetDeleteTime sets the "delete_time" field. +func (m *RoleMutation) SetDeleteTime(t time.Time) { + m.delete_time = &t +} + +// DeleteTime returns the value of the "delete_time" field in the mutation. +func (m *RoleMutation) DeleteTime() (r time.Time, exists bool) { + v := m.delete_time + if v == nil { + return + } + return *v, true +} + +// OldDeleteTime returns the old "delete_time" field's value of the Role entity. +// If the Role object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *RoleMutation) OldDeleteTime(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeleteTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeleteTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeleteTime: %w", err) + } + return oldValue.DeleteTime, nil +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (m *RoleMutation) ClearDeleteTime() { + m.delete_time = nil + m.clearedFields[role.FieldDeleteTime] = struct{}{} +} + +// DeleteTimeCleared returns if the "delete_time" field was cleared in this mutation. +func (m *RoleMutation) DeleteTimeCleared() bool { + _, ok := m.clearedFields[role.FieldDeleteTime] + return ok +} + +// ResetDeleteTime resets all changes to the "delete_time" field. +func (m *RoleMutation) ResetDeleteTime() { + m.delete_time = nil + delete(m.clearedFields, role.FieldDeleteTime) +} + +// SetStatus sets the "status" field. +func (m *RoleMutation) SetStatus(r role.Status) { + m.status = &r +} + +// Status returns the value of the "status" field in the mutation. +func (m *RoleMutation) Status() (r role.Status, exists bool) { + v := m.status + if v == nil { + return + } + return *v, true +} + +// OldStatus returns the old "status" field's value of the Role entity. +// If the Role object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *RoleMutation) OldStatus(ctx context.Context) (v *role.Status, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldStatus is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldStatus requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldStatus: %w", err) + } + return oldValue.Status, nil +} + +// ClearStatus clears the value of the "status" field. +func (m *RoleMutation) ClearStatus() { + m.status = nil + m.clearedFields[role.FieldStatus] = struct{}{} +} + +// StatusCleared returns if the "status" field was cleared in this mutation. +func (m *RoleMutation) StatusCleared() bool { + _, ok := m.clearedFields[role.FieldStatus] + return ok +} + +// ResetStatus resets all changes to the "status" field. +func (m *RoleMutation) ResetStatus() { + m.status = nil + delete(m.clearedFields, role.FieldStatus) +} + +// SetCreateBy sets the "create_by" field. +func (m *RoleMutation) SetCreateBy(u uint32) { + m.create_by = &u + m.addcreate_by = nil +} + +// CreateBy returns the value of the "create_by" field in the mutation. +func (m *RoleMutation) CreateBy() (r uint32, exists bool) { + v := m.create_by + if v == nil { + return + } + return *v, true +} + +// OldCreateBy returns the old "create_by" field's value of the Role entity. +// If the Role object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *RoleMutation) OldCreateBy(ctx context.Context) (v *uint32, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreateBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreateBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreateBy: %w", err) + } + return oldValue.CreateBy, nil +} + +// AddCreateBy adds u to the "create_by" field. +func (m *RoleMutation) AddCreateBy(u int32) { + if m.addcreate_by != nil { + *m.addcreate_by += u + } else { + m.addcreate_by = &u + } +} + +// AddedCreateBy returns the value that was added to the "create_by" field in this mutation. +func (m *RoleMutation) AddedCreateBy() (r int32, exists bool) { + v := m.addcreate_by + if v == nil { + return + } + return *v, true +} + +// ClearCreateBy clears the value of the "create_by" field. +func (m *RoleMutation) ClearCreateBy() { + m.create_by = nil + m.addcreate_by = nil + m.clearedFields[role.FieldCreateBy] = struct{}{} +} + +// CreateByCleared returns if the "create_by" field was cleared in this mutation. +func (m *RoleMutation) CreateByCleared() bool { + _, ok := m.clearedFields[role.FieldCreateBy] + return ok +} + +// ResetCreateBy resets all changes to the "create_by" field. +func (m *RoleMutation) ResetCreateBy() { + m.create_by = nil + m.addcreate_by = nil + delete(m.clearedFields, role.FieldCreateBy) +} + +// SetRemark sets the "remark" field. +func (m *RoleMutation) SetRemark(s string) { + m.remark = &s +} + +// Remark returns the value of the "remark" field in the mutation. +func (m *RoleMutation) Remark() (r string, exists bool) { + v := m.remark + if v == nil { + return + } + return *v, true +} + +// OldRemark returns the old "remark" field's value of the Role entity. +// If the Role object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *RoleMutation) OldRemark(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRemark is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRemark requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRemark: %w", err) + } + return oldValue.Remark, nil +} + +// ClearRemark clears the value of the "remark" field. +func (m *RoleMutation) ClearRemark() { + m.remark = nil + m.clearedFields[role.FieldRemark] = struct{}{} +} + +// RemarkCleared returns if the "remark" field was cleared in this mutation. +func (m *RoleMutation) RemarkCleared() bool { + _, ok := m.clearedFields[role.FieldRemark] + return ok +} + +// ResetRemark resets all changes to the "remark" field. +func (m *RoleMutation) ResetRemark() { + m.remark = nil + delete(m.clearedFields, role.FieldRemark) +} + +// SetName sets the "name" field. +func (m *RoleMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *RoleMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the Role entity. +// If the Role object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *RoleMutation) OldName(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ClearName clears the value of the "name" field. +func (m *RoleMutation) ClearName() { + m.name = nil + m.clearedFields[role.FieldName] = struct{}{} +} + +// NameCleared returns if the "name" field was cleared in this mutation. +func (m *RoleMutation) NameCleared() bool { + _, ok := m.clearedFields[role.FieldName] + return ok +} + +// ResetName resets all changes to the "name" field. +func (m *RoleMutation) ResetName() { + m.name = nil + delete(m.clearedFields, role.FieldName) +} + +// SetCode sets the "code" field. +func (m *RoleMutation) SetCode(s string) { + m.code = &s +} + +// Code returns the value of the "code" field in the mutation. +func (m *RoleMutation) Code() (r string, exists bool) { + v := m.code + if v == nil { + return + } + return *v, true +} + +// OldCode returns the old "code" field's value of the Role entity. +// If the Role object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *RoleMutation) OldCode(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCode is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCode requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCode: %w", err) + } + return oldValue.Code, nil +} + +// ClearCode clears the value of the "code" field. +func (m *RoleMutation) ClearCode() { + m.code = nil + m.clearedFields[role.FieldCode] = struct{}{} +} + +// CodeCleared returns if the "code" field was cleared in this mutation. +func (m *RoleMutation) CodeCleared() bool { + _, ok := m.clearedFields[role.FieldCode] + return ok +} + +// ResetCode resets all changes to the "code" field. +func (m *RoleMutation) ResetCode() { + m.code = nil + delete(m.clearedFields, role.FieldCode) +} + +// SetParentID sets the "parent_id" field. +func (m *RoleMutation) SetParentID(u uint32) { + m.parent = &u +} + +// ParentID returns the value of the "parent_id" field in the mutation. +func (m *RoleMutation) ParentID() (r uint32, exists bool) { + v := m.parent + if v == nil { + return + } + return *v, true +} + +// OldParentID returns the old "parent_id" field's value of the Role entity. +// If the Role object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *RoleMutation) OldParentID(ctx context.Context) (v *uint32, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldParentID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldParentID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldParentID: %w", err) + } + return oldValue.ParentID, nil +} + +// ClearParentID clears the value of the "parent_id" field. +func (m *RoleMutation) ClearParentID() { + m.parent = nil + m.clearedFields[role.FieldParentID] = struct{}{} +} + +// ParentIDCleared returns if the "parent_id" field was cleared in this mutation. +func (m *RoleMutation) ParentIDCleared() bool { + _, ok := m.clearedFields[role.FieldParentID] + return ok +} + +// ResetParentID resets all changes to the "parent_id" field. +func (m *RoleMutation) ResetParentID() { + m.parent = nil + delete(m.clearedFields, role.FieldParentID) +} + +// SetOrderNo sets the "order_no" field. +func (m *RoleMutation) SetOrderNo(i int32) { + m.order_no = &i + m.addorder_no = nil +} + +// OrderNo returns the value of the "order_no" field in the mutation. +func (m *RoleMutation) OrderNo() (r int32, exists bool) { + v := m.order_no + if v == nil { + return + } + return *v, true +} + +// OldOrderNo returns the old "order_no" field's value of the Role entity. +// If the Role object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *RoleMutation) OldOrderNo(ctx context.Context) (v *int32, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOrderNo is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOrderNo requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOrderNo: %w", err) + } + return oldValue.OrderNo, nil +} + +// AddOrderNo adds i to the "order_no" field. +func (m *RoleMutation) AddOrderNo(i int32) { + if m.addorder_no != nil { + *m.addorder_no += i + } else { + m.addorder_no = &i + } +} + +// AddedOrderNo returns the value that was added to the "order_no" field in this mutation. +func (m *RoleMutation) AddedOrderNo() (r int32, exists bool) { + v := m.addorder_no + if v == nil { + return + } + return *v, true +} + +// ClearOrderNo clears the value of the "order_no" field. +func (m *RoleMutation) ClearOrderNo() { + m.order_no = nil + m.addorder_no = nil + m.clearedFields[role.FieldOrderNo] = struct{}{} +} + +// OrderNoCleared returns if the "order_no" field was cleared in this mutation. +func (m *RoleMutation) OrderNoCleared() bool { + _, ok := m.clearedFields[role.FieldOrderNo] + return ok +} + +// ResetOrderNo resets all changes to the "order_no" field. +func (m *RoleMutation) ResetOrderNo() { + m.order_no = nil + m.addorder_no = nil + delete(m.clearedFields, role.FieldOrderNo) +} + +// ClearParent clears the "parent" edge to the Role entity. +func (m *RoleMutation) ClearParent() { + m.clearedparent = true + m.clearedFields[role.FieldParentID] = struct{}{} +} + +// ParentCleared reports if the "parent" edge to the Role entity was cleared. +func (m *RoleMutation) ParentCleared() bool { + return m.ParentIDCleared() || m.clearedparent +} + +// ParentIDs returns the "parent" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// ParentID instead. It exists only for internal usage by the builders. +func (m *RoleMutation) ParentIDs() (ids []uint32) { + if id := m.parent; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetParent resets all changes to the "parent" edge. +func (m *RoleMutation) ResetParent() { + m.parent = nil + m.clearedparent = false +} + +// AddChildIDs adds the "children" edge to the Role entity by ids. +func (m *RoleMutation) AddChildIDs(ids ...uint32) { + if m.children == nil { + m.children = make(map[uint32]struct{}) + } + for i := range ids { + m.children[ids[i]] = struct{}{} + } +} + +// ClearChildren clears the "children" edge to the Role entity. +func (m *RoleMutation) ClearChildren() { + m.clearedchildren = true +} + +// ChildrenCleared reports if the "children" edge to the Role entity was cleared. +func (m *RoleMutation) ChildrenCleared() bool { + return m.clearedchildren +} + +// RemoveChildIDs removes the "children" edge to the Role entity by IDs. +func (m *RoleMutation) RemoveChildIDs(ids ...uint32) { + if m.removedchildren == nil { + m.removedchildren = make(map[uint32]struct{}) + } + for i := range ids { + delete(m.children, ids[i]) + m.removedchildren[ids[i]] = struct{}{} + } +} + +// RemovedChildren returns the removed IDs of the "children" edge to the Role entity. +func (m *RoleMutation) RemovedChildrenIDs() (ids []uint32) { + for id := range m.removedchildren { + ids = append(ids, id) + } + return +} + +// ChildrenIDs returns the "children" edge IDs in the mutation. +func (m *RoleMutation) ChildrenIDs() (ids []uint32) { + for id := range m.children { + ids = append(ids, id) + } + return +} + +// ResetChildren resets all changes to the "children" edge. +func (m *RoleMutation) ResetChildren() { + m.children = nil + m.clearedchildren = false + m.removedchildren = nil +} + +// Where appends a list predicates to the RoleMutation builder. +func (m *RoleMutation) Where(ps ...predicate.Role) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the RoleMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *RoleMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.Role, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *RoleMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *RoleMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (Role). +func (m *RoleMutation) Type() string { + return m.typ +} + +// Fields returns all fields that were changed during this mutation. Note that in +// order to get all numeric fields that were incremented/decremented, call +// AddedFields(). +func (m *RoleMutation) Fields() []string { + fields := make([]string, 0, 10) + if m.create_time != nil { + fields = append(fields, role.FieldCreateTime) + } + if m.update_time != nil { + fields = append(fields, role.FieldUpdateTime) + } + if m.delete_time != nil { + fields = append(fields, role.FieldDeleteTime) + } + if m.status != nil { + fields = append(fields, role.FieldStatus) + } + if m.create_by != nil { + fields = append(fields, role.FieldCreateBy) + } + if m.remark != nil { + fields = append(fields, role.FieldRemark) + } + if m.name != nil { + fields = append(fields, role.FieldName) + } + if m.code != nil { + fields = append(fields, role.FieldCode) + } + if m.parent != nil { + fields = append(fields, role.FieldParentID) + } + if m.order_no != nil { + fields = append(fields, role.FieldOrderNo) + } + return fields +} + +// Field returns the value of a field with the given name. The second boolean +// return value indicates that this field was not set, or was not defined in the +// schema. +func (m *RoleMutation) Field(name string) (ent.Value, bool) { + switch name { + case role.FieldCreateTime: + return m.CreateTime() + case role.FieldUpdateTime: + return m.UpdateTime() + case role.FieldDeleteTime: + return m.DeleteTime() + case role.FieldStatus: + return m.Status() + case role.FieldCreateBy: + return m.CreateBy() + case role.FieldRemark: + return m.Remark() + case role.FieldName: + return m.Name() + case role.FieldCode: + return m.Code() + case role.FieldParentID: + return m.ParentID() + case role.FieldOrderNo: + return m.OrderNo() + } + return nil, false +} + +// OldField returns the old value of the field from the database. An error is +// returned if the mutation operation is not UpdateOne, or the query to the +// database failed. +func (m *RoleMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case role.FieldCreateTime: + return m.OldCreateTime(ctx) + case role.FieldUpdateTime: + return m.OldUpdateTime(ctx) + case role.FieldDeleteTime: + return m.OldDeleteTime(ctx) + case role.FieldStatus: + return m.OldStatus(ctx) + case role.FieldCreateBy: + return m.OldCreateBy(ctx) + case role.FieldRemark: + return m.OldRemark(ctx) + case role.FieldName: + return m.OldName(ctx) + case role.FieldCode: + return m.OldCode(ctx) + case role.FieldParentID: + return m.OldParentID(ctx) + case role.FieldOrderNo: + return m.OldOrderNo(ctx) + } + return nil, fmt.Errorf("unknown Role field %s", name) +} + +// SetField sets the value of a field with the given name. It returns an error if +// the field is not defined in the schema, or if the type mismatched the field +// type. +func (m *RoleMutation) SetField(name string, value ent.Value) error { + switch name { + case role.FieldCreateTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreateTime(v) + return nil + case role.FieldUpdateTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdateTime(v) + return nil + case role.FieldDeleteTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeleteTime(v) + return nil + case role.FieldStatus: + v, ok := value.(role.Status) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetStatus(v) + return nil + case role.FieldCreateBy: + v, ok := value.(uint32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreateBy(v) + return nil + case role.FieldRemark: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRemark(v) + return nil + case role.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + case role.FieldCode: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCode(v) + return nil + case role.FieldParentID: + v, ok := value.(uint32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetParentID(v) + return nil + case role.FieldOrderNo: + v, ok := value.(int32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOrderNo(v) + return nil + } + return fmt.Errorf("unknown Role field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *RoleMutation) AddedFields() []string { + var fields []string + if m.addcreate_by != nil { + fields = append(fields, role.FieldCreateBy) + } + if m.addorder_no != nil { + fields = append(fields, role.FieldOrderNo) + } + return fields +} + +// AddedField returns the numeric value that was incremented/decremented on a field +// with the given name. The second boolean return value indicates that this field +// was not set, or was not defined in the schema. +func (m *RoleMutation) AddedField(name string) (ent.Value, bool) { + switch name { + case role.FieldCreateBy: + return m.AddedCreateBy() + case role.FieldOrderNo: + return m.AddedOrderNo() + } + return nil, false +} + +// AddField adds the value to the field with the given name. It returns an error if +// the field is not defined in the schema, or if the type mismatched the field +// type. +func (m *RoleMutation) AddField(name string, value ent.Value) error { + switch name { + case role.FieldCreateBy: + v, ok := value.(int32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddCreateBy(v) + return nil + case role.FieldOrderNo: + v, ok := value.(int32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddOrderNo(v) + return nil + } + return fmt.Errorf("unknown Role numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *RoleMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(role.FieldCreateTime) { + fields = append(fields, role.FieldCreateTime) + } + if m.FieldCleared(role.FieldUpdateTime) { + fields = append(fields, role.FieldUpdateTime) + } + if m.FieldCleared(role.FieldDeleteTime) { + fields = append(fields, role.FieldDeleteTime) + } + if m.FieldCleared(role.FieldStatus) { + fields = append(fields, role.FieldStatus) + } + if m.FieldCleared(role.FieldCreateBy) { + fields = append(fields, role.FieldCreateBy) + } + if m.FieldCleared(role.FieldRemark) { + fields = append(fields, role.FieldRemark) + } + if m.FieldCleared(role.FieldName) { + fields = append(fields, role.FieldName) + } + if m.FieldCleared(role.FieldCode) { + fields = append(fields, role.FieldCode) + } + if m.FieldCleared(role.FieldParentID) { + fields = append(fields, role.FieldParentID) + } + if m.FieldCleared(role.FieldOrderNo) { + fields = append(fields, role.FieldOrderNo) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *RoleMutation) FieldCleared(name string) bool { + _, ok := m.clearedFields[name] + return ok +} + +// ClearField clears the value of the field with the given name. It returns an +// error if the field is not defined in the schema. +func (m *RoleMutation) ClearField(name string) error { + switch name { + case role.FieldCreateTime: + m.ClearCreateTime() + return nil + case role.FieldUpdateTime: + m.ClearUpdateTime() + return nil + case role.FieldDeleteTime: + m.ClearDeleteTime() + return nil + case role.FieldStatus: + m.ClearStatus() + return nil + case role.FieldCreateBy: + m.ClearCreateBy() + return nil + case role.FieldRemark: + m.ClearRemark() + return nil + case role.FieldName: + m.ClearName() + return nil + case role.FieldCode: + m.ClearCode() + return nil + case role.FieldParentID: + m.ClearParentID() + return nil + case role.FieldOrderNo: + m.ClearOrderNo() + return nil + } + return fmt.Errorf("unknown Role nullable field %s", name) +} + +// ResetField resets all changes in the mutation for the field with the given name. +// It returns an error if the field is not defined in the schema. +func (m *RoleMutation) ResetField(name string) error { + switch name { + case role.FieldCreateTime: + m.ResetCreateTime() + return nil + case role.FieldUpdateTime: + m.ResetUpdateTime() + return nil + case role.FieldDeleteTime: + m.ResetDeleteTime() + return nil + case role.FieldStatus: + m.ResetStatus() + return nil + case role.FieldCreateBy: + m.ResetCreateBy() + return nil + case role.FieldRemark: + m.ResetRemark() + return nil + case role.FieldName: + m.ResetName() + return nil + case role.FieldCode: + m.ResetCode() + return nil + case role.FieldParentID: + m.ResetParentID() + return nil + case role.FieldOrderNo: + m.ResetOrderNo() + return nil + } + return fmt.Errorf("unknown Role field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *RoleMutation) AddedEdges() []string { + edges := make([]string, 0, 2) + if m.parent != nil { + edges = append(edges, role.EdgeParent) + } + if m.children != nil { + edges = append(edges, role.EdgeChildren) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *RoleMutation) AddedIDs(name string) []ent.Value { + switch name { + case role.EdgeParent: + if id := m.parent; id != nil { + return []ent.Value{*id} + } + case role.EdgeChildren: + ids := make([]ent.Value, 0, len(m.children)) + for id := range m.children { + ids = append(ids, id) + } + return ids + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *RoleMutation) RemovedEdges() []string { + edges := make([]string, 0, 2) + if m.removedchildren != nil { + edges = append(edges, role.EdgeChildren) + } + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *RoleMutation) RemovedIDs(name string) []ent.Value { + switch name { + case role.EdgeChildren: + ids := make([]ent.Value, 0, len(m.removedchildren)) + for id := range m.removedchildren { + ids = append(ids, id) + } + return ids + } + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *RoleMutation) ClearedEdges() []string { + edges := make([]string, 0, 2) + if m.clearedparent { + edges = append(edges, role.EdgeParent) + } + if m.clearedchildren { + edges = append(edges, role.EdgeChildren) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *RoleMutation) EdgeCleared(name string) bool { + switch name { + case role.EdgeParent: + return m.clearedparent + case role.EdgeChildren: + return m.clearedchildren + } + return false +} + +// ClearEdge clears the value of the edge with the given name. It returns an error +// if that edge is not defined in the schema. +func (m *RoleMutation) ClearEdge(name string) error { + switch name { + case role.EdgeParent: + m.ClearParent() + return nil + } + return fmt.Errorf("unknown Role unique edge %s", name) +} + +// ResetEdge resets all changes to the edge with the given name in this mutation. +// It returns an error if the edge is not defined in the schema. +func (m *RoleMutation) ResetEdge(name string) error { + switch name { + case role.EdgeParent: + m.ResetParent() + return nil + case role.EdgeChildren: + m.ResetChildren() + return nil + } + return fmt.Errorf("unknown Role edge %s", name) +} + +// UserMutation represents an operation that mutates the User nodes in the graph. +type UserMutation struct { + config + op Op + typ string + id *uint32 + create_by *uint32 + addcreate_by *int32 + create_time *time.Time + update_time *time.Time + delete_time *time.Time + status *user.Status + username *string + password *string + role_id *uint32 + addrole_id *int32 + org_id *uint32 + addorg_id *int32 + position_id *uint32 + addposition_id *int32 + work_id *uint32 + addwork_id *int32 + nick_name *string + real_name *string + email *string + phone *string + avatar *string + gender *user.Gender + address *string + description *string + authority *user.Authority + last_login_time *int64 + addlast_login_time *int64 + last_login_ip *string + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*User, error) + predicates []predicate.User +} + +var _ ent.Mutation = (*UserMutation)(nil) + +// userOption allows management of the mutation configuration using functional options. +type userOption func(*UserMutation) + +// newUserMutation creates new mutation for the User entity. +func newUserMutation(c config, op Op, opts ...userOption) *UserMutation { + m := &UserMutation{ + config: c, + op: op, + typ: TypeUser, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withUserID sets the ID field of the mutation. +func withUserID(id uint32) userOption { + return func(m *UserMutation) { + var ( + err error + once sync.Once + value *User + ) + m.oldValue = func(ctx context.Context) (*User, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().User.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withUser sets the old User of the mutation. +func withUser(node *User) userOption { + return func(m *UserMutation) { + m.oldValue = func(context.Context) (*User, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m UserMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m UserMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of User entities. +func (m *UserMutation) SetID(id uint32) { + m.id = &id +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *UserMutation) ID() (id uint32, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *UserMutation) IDs(ctx context.Context) ([]uint32, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []uint32{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().User.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreateBy sets the "create_by" field. +func (m *UserMutation) SetCreateBy(u uint32) { + m.create_by = &u + m.addcreate_by = nil +} + +// CreateBy returns the value of the "create_by" field in the mutation. +func (m *UserMutation) CreateBy() (r uint32, exists bool) { + v := m.create_by + if v == nil { + return + } + return *v, true +} + +// OldCreateBy returns the old "create_by" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldCreateBy(ctx context.Context) (v *uint32, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreateBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreateBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreateBy: %w", err) + } + return oldValue.CreateBy, nil +} + +// AddCreateBy adds u to the "create_by" field. +func (m *UserMutation) AddCreateBy(u int32) { + if m.addcreate_by != nil { + *m.addcreate_by += u + } else { + m.addcreate_by = &u + } +} + +// AddedCreateBy returns the value that was added to the "create_by" field in this mutation. +func (m *UserMutation) AddedCreateBy() (r int32, exists bool) { + v := m.addcreate_by + if v == nil { + return + } + return *v, true +} + +// ClearCreateBy clears the value of the "create_by" field. +func (m *UserMutation) ClearCreateBy() { + m.create_by = nil + m.addcreate_by = nil + m.clearedFields[user.FieldCreateBy] = struct{}{} +} + +// CreateByCleared returns if the "create_by" field was cleared in this mutation. +func (m *UserMutation) CreateByCleared() bool { + _, ok := m.clearedFields[user.FieldCreateBy] + return ok +} + +// ResetCreateBy resets all changes to the "create_by" field. +func (m *UserMutation) ResetCreateBy() { + m.create_by = nil + m.addcreate_by = nil + delete(m.clearedFields, user.FieldCreateBy) +} + +// SetCreateTime sets the "create_time" field. +func (m *UserMutation) SetCreateTime(t time.Time) { + m.create_time = &t +} + +// CreateTime returns the value of the "create_time" field in the mutation. +func (m *UserMutation) CreateTime() (r time.Time, exists bool) { + v := m.create_time + if v == nil { + return + } + return *v, true +} + +// OldCreateTime returns the old "create_time" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldCreateTime(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreateTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreateTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreateTime: %w", err) + } + return oldValue.CreateTime, nil +} + +// ClearCreateTime clears the value of the "create_time" field. +func (m *UserMutation) ClearCreateTime() { + m.create_time = nil + m.clearedFields[user.FieldCreateTime] = struct{}{} +} + +// CreateTimeCleared returns if the "create_time" field was cleared in this mutation. +func (m *UserMutation) CreateTimeCleared() bool { + _, ok := m.clearedFields[user.FieldCreateTime] + return ok +} + +// ResetCreateTime resets all changes to the "create_time" field. +func (m *UserMutation) ResetCreateTime() { + m.create_time = nil + delete(m.clearedFields, user.FieldCreateTime) +} + +// SetUpdateTime sets the "update_time" field. +func (m *UserMutation) SetUpdateTime(t time.Time) { + m.update_time = &t +} + +// UpdateTime returns the value of the "update_time" field in the mutation. +func (m *UserMutation) UpdateTime() (r time.Time, exists bool) { + v := m.update_time + if v == nil { + return + } + return *v, true +} + +// OldUpdateTime returns the old "update_time" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldUpdateTime(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdateTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdateTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdateTime: %w", err) + } + return oldValue.UpdateTime, nil +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (m *UserMutation) ClearUpdateTime() { + m.update_time = nil + m.clearedFields[user.FieldUpdateTime] = struct{}{} +} + +// UpdateTimeCleared returns if the "update_time" field was cleared in this mutation. +func (m *UserMutation) UpdateTimeCleared() bool { + _, ok := m.clearedFields[user.FieldUpdateTime] + return ok +} + +// ResetUpdateTime resets all changes to the "update_time" field. +func (m *UserMutation) ResetUpdateTime() { + m.update_time = nil + delete(m.clearedFields, user.FieldUpdateTime) +} + +// SetDeleteTime sets the "delete_time" field. +func (m *UserMutation) SetDeleteTime(t time.Time) { + m.delete_time = &t +} + +// DeleteTime returns the value of the "delete_time" field in the mutation. +func (m *UserMutation) DeleteTime() (r time.Time, exists bool) { + v := m.delete_time + if v == nil { + return + } + return *v, true +} + +// OldDeleteTime returns the old "delete_time" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldDeleteTime(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeleteTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeleteTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeleteTime: %w", err) + } + return oldValue.DeleteTime, nil +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (m *UserMutation) ClearDeleteTime() { + m.delete_time = nil + m.clearedFields[user.FieldDeleteTime] = struct{}{} +} + +// DeleteTimeCleared returns if the "delete_time" field was cleared in this mutation. +func (m *UserMutation) DeleteTimeCleared() bool { + _, ok := m.clearedFields[user.FieldDeleteTime] + return ok +} + +// ResetDeleteTime resets all changes to the "delete_time" field. +func (m *UserMutation) ResetDeleteTime() { + m.delete_time = nil + delete(m.clearedFields, user.FieldDeleteTime) +} + +// SetStatus sets the "status" field. +func (m *UserMutation) SetStatus(u user.Status) { + m.status = &u +} + +// Status returns the value of the "status" field in the mutation. +func (m *UserMutation) Status() (r user.Status, exists bool) { + v := m.status + if v == nil { + return + } + return *v, true +} + +// OldStatus returns the old "status" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldStatus(ctx context.Context) (v *user.Status, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldStatus is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldStatus requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldStatus: %w", err) + } + return oldValue.Status, nil +} + +// ClearStatus clears the value of the "status" field. +func (m *UserMutation) ClearStatus() { + m.status = nil + m.clearedFields[user.FieldStatus] = struct{}{} +} + +// StatusCleared returns if the "status" field was cleared in this mutation. +func (m *UserMutation) StatusCleared() bool { + _, ok := m.clearedFields[user.FieldStatus] + return ok +} + +// ResetStatus resets all changes to the "status" field. +func (m *UserMutation) ResetStatus() { + m.status = nil + delete(m.clearedFields, user.FieldStatus) +} + +// SetUsername sets the "username" field. +func (m *UserMutation) SetUsername(s string) { + m.username = &s +} + +// Username returns the value of the "username" field in the mutation. +func (m *UserMutation) Username() (r string, exists bool) { + v := m.username + if v == nil { + return + } + return *v, true +} + +// OldUsername returns the old "username" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldUsername(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUsername is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUsername requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUsername: %w", err) + } + return oldValue.Username, nil +} + +// ClearUsername clears the value of the "username" field. +func (m *UserMutation) ClearUsername() { + m.username = nil + m.clearedFields[user.FieldUsername] = struct{}{} +} + +// UsernameCleared returns if the "username" field was cleared in this mutation. +func (m *UserMutation) UsernameCleared() bool { + _, ok := m.clearedFields[user.FieldUsername] + return ok +} + +// ResetUsername resets all changes to the "username" field. +func (m *UserMutation) ResetUsername() { + m.username = nil + delete(m.clearedFields, user.FieldUsername) +} + +// SetPassword sets the "password" field. +func (m *UserMutation) SetPassword(s string) { + m.password = &s +} + +// Password returns the value of the "password" field in the mutation. +func (m *UserMutation) Password() (r string, exists bool) { + v := m.password + if v == nil { + return + } + return *v, true +} + +// OldPassword returns the old "password" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldPassword(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldPassword is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldPassword requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPassword: %w", err) + } + return oldValue.Password, nil +} + +// ClearPassword clears the value of the "password" field. +func (m *UserMutation) ClearPassword() { + m.password = nil + m.clearedFields[user.FieldPassword] = struct{}{} +} + +// PasswordCleared returns if the "password" field was cleared in this mutation. +func (m *UserMutation) PasswordCleared() bool { + _, ok := m.clearedFields[user.FieldPassword] + return ok +} + +// ResetPassword resets all changes to the "password" field. +func (m *UserMutation) ResetPassword() { + m.password = nil + delete(m.clearedFields, user.FieldPassword) +} + +// SetRoleID sets the "role_id" field. +func (m *UserMutation) SetRoleID(u uint32) { + m.role_id = &u + m.addrole_id = nil +} + +// RoleID returns the value of the "role_id" field in the mutation. +func (m *UserMutation) RoleID() (r uint32, exists bool) { + v := m.role_id + if v == nil { + return + } + return *v, true +} + +// OldRoleID returns the old "role_id" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldRoleID(ctx context.Context) (v *uint32, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRoleID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRoleID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRoleID: %w", err) + } + return oldValue.RoleID, nil +} + +// AddRoleID adds u to the "role_id" field. +func (m *UserMutation) AddRoleID(u int32) { + if m.addrole_id != nil { + *m.addrole_id += u + } else { + m.addrole_id = &u + } +} + +// AddedRoleID returns the value that was added to the "role_id" field in this mutation. +func (m *UserMutation) AddedRoleID() (r int32, exists bool) { + v := m.addrole_id + if v == nil { + return + } + return *v, true +} + +// ClearRoleID clears the value of the "role_id" field. +func (m *UserMutation) ClearRoleID() { + m.role_id = nil + m.addrole_id = nil + m.clearedFields[user.FieldRoleID] = struct{}{} +} + +// RoleIDCleared returns if the "role_id" field was cleared in this mutation. +func (m *UserMutation) RoleIDCleared() bool { + _, ok := m.clearedFields[user.FieldRoleID] + return ok +} + +// ResetRoleID resets all changes to the "role_id" field. +func (m *UserMutation) ResetRoleID() { + m.role_id = nil + m.addrole_id = nil + delete(m.clearedFields, user.FieldRoleID) +} + +// SetOrgID sets the "org_id" field. +func (m *UserMutation) SetOrgID(u uint32) { + m.org_id = &u + m.addorg_id = nil +} + +// OrgID returns the value of the "org_id" field in the mutation. +func (m *UserMutation) OrgID() (r uint32, exists bool) { + v := m.org_id + if v == nil { + return + } + return *v, true +} + +// OldOrgID returns the old "org_id" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldOrgID(ctx context.Context) (v *uint32, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOrgID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOrgID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOrgID: %w", err) + } + return oldValue.OrgID, nil +} + +// AddOrgID adds u to the "org_id" field. +func (m *UserMutation) AddOrgID(u int32) { + if m.addorg_id != nil { + *m.addorg_id += u + } else { + m.addorg_id = &u + } +} + +// AddedOrgID returns the value that was added to the "org_id" field in this mutation. +func (m *UserMutation) AddedOrgID() (r int32, exists bool) { + v := m.addorg_id + if v == nil { + return + } + return *v, true +} + +// ClearOrgID clears the value of the "org_id" field. +func (m *UserMutation) ClearOrgID() { + m.org_id = nil + m.addorg_id = nil + m.clearedFields[user.FieldOrgID] = struct{}{} +} + +// OrgIDCleared returns if the "org_id" field was cleared in this mutation. +func (m *UserMutation) OrgIDCleared() bool { + _, ok := m.clearedFields[user.FieldOrgID] + return ok +} + +// ResetOrgID resets all changes to the "org_id" field. +func (m *UserMutation) ResetOrgID() { + m.org_id = nil + m.addorg_id = nil + delete(m.clearedFields, user.FieldOrgID) +} + +// SetPositionID sets the "position_id" field. +func (m *UserMutation) SetPositionID(u uint32) { + m.position_id = &u + m.addposition_id = nil +} + +// PositionID returns the value of the "position_id" field in the mutation. +func (m *UserMutation) PositionID() (r uint32, exists bool) { + v := m.position_id + if v == nil { + return + } + return *v, true +} + +// OldPositionID returns the old "position_id" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldPositionID(ctx context.Context) (v *uint32, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldPositionID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldPositionID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPositionID: %w", err) + } + return oldValue.PositionID, nil +} + +// AddPositionID adds u to the "position_id" field. +func (m *UserMutation) AddPositionID(u int32) { + if m.addposition_id != nil { + *m.addposition_id += u + } else { + m.addposition_id = &u + } +} + +// AddedPositionID returns the value that was added to the "position_id" field in this mutation. +func (m *UserMutation) AddedPositionID() (r int32, exists bool) { + v := m.addposition_id + if v == nil { + return + } + return *v, true +} + +// ClearPositionID clears the value of the "position_id" field. +func (m *UserMutation) ClearPositionID() { + m.position_id = nil + m.addposition_id = nil + m.clearedFields[user.FieldPositionID] = struct{}{} +} + +// PositionIDCleared returns if the "position_id" field was cleared in this mutation. +func (m *UserMutation) PositionIDCleared() bool { + _, ok := m.clearedFields[user.FieldPositionID] + return ok +} + +// ResetPositionID resets all changes to the "position_id" field. +func (m *UserMutation) ResetPositionID() { + m.position_id = nil + m.addposition_id = nil + delete(m.clearedFields, user.FieldPositionID) +} + +// SetWorkID sets the "work_id" field. +func (m *UserMutation) SetWorkID(u uint32) { + m.work_id = &u + m.addwork_id = nil +} + +// WorkID returns the value of the "work_id" field in the mutation. +func (m *UserMutation) WorkID() (r uint32, exists bool) { + v := m.work_id + if v == nil { + return + } + return *v, true +} + +// OldWorkID returns the old "work_id" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldWorkID(ctx context.Context) (v *uint32, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldWorkID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldWorkID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldWorkID: %w", err) + } + return oldValue.WorkID, nil +} + +// AddWorkID adds u to the "work_id" field. +func (m *UserMutation) AddWorkID(u int32) { + if m.addwork_id != nil { + *m.addwork_id += u + } else { + m.addwork_id = &u + } +} + +// AddedWorkID returns the value that was added to the "work_id" field in this mutation. +func (m *UserMutation) AddedWorkID() (r int32, exists bool) { + v := m.addwork_id + if v == nil { + return + } + return *v, true +} + +// ClearWorkID clears the value of the "work_id" field. +func (m *UserMutation) ClearWorkID() { + m.work_id = nil + m.addwork_id = nil + m.clearedFields[user.FieldWorkID] = struct{}{} +} + +// WorkIDCleared returns if the "work_id" field was cleared in this mutation. +func (m *UserMutation) WorkIDCleared() bool { + _, ok := m.clearedFields[user.FieldWorkID] + return ok +} + +// ResetWorkID resets all changes to the "work_id" field. +func (m *UserMutation) ResetWorkID() { + m.work_id = nil + m.addwork_id = nil + delete(m.clearedFields, user.FieldWorkID) +} + +// SetNickName sets the "nick_name" field. +func (m *UserMutation) SetNickName(s string) { + m.nick_name = &s +} + +// NickName returns the value of the "nick_name" field in the mutation. +func (m *UserMutation) NickName() (r string, exists bool) { + v := m.nick_name + if v == nil { + return + } + return *v, true +} + +// OldNickName returns the old "nick_name" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldNickName(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldNickName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldNickName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNickName: %w", err) + } + return oldValue.NickName, nil +} + +// ClearNickName clears the value of the "nick_name" field. +func (m *UserMutation) ClearNickName() { + m.nick_name = nil + m.clearedFields[user.FieldNickName] = struct{}{} +} + +// NickNameCleared returns if the "nick_name" field was cleared in this mutation. +func (m *UserMutation) NickNameCleared() bool { + _, ok := m.clearedFields[user.FieldNickName] + return ok +} + +// ResetNickName resets all changes to the "nick_name" field. +func (m *UserMutation) ResetNickName() { + m.nick_name = nil + delete(m.clearedFields, user.FieldNickName) +} + +// SetRealName sets the "real_name" field. +func (m *UserMutation) SetRealName(s string) { + m.real_name = &s +} + +// RealName returns the value of the "real_name" field in the mutation. +func (m *UserMutation) RealName() (r string, exists bool) { + v := m.real_name + if v == nil { + return + } + return *v, true +} + +// OldRealName returns the old "real_name" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldRealName(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRealName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRealName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRealName: %w", err) + } + return oldValue.RealName, nil +} + +// ClearRealName clears the value of the "real_name" field. +func (m *UserMutation) ClearRealName() { + m.real_name = nil + m.clearedFields[user.FieldRealName] = struct{}{} +} + +// RealNameCleared returns if the "real_name" field was cleared in this mutation. +func (m *UserMutation) RealNameCleared() bool { + _, ok := m.clearedFields[user.FieldRealName] + return ok +} + +// ResetRealName resets all changes to the "real_name" field. +func (m *UserMutation) ResetRealName() { + m.real_name = nil + delete(m.clearedFields, user.FieldRealName) +} + +// SetEmail sets the "email" field. +func (m *UserMutation) SetEmail(s string) { + m.email = &s +} + +// Email returns the value of the "email" field in the mutation. +func (m *UserMutation) Email() (r string, exists bool) { + v := m.email + if v == nil { + return + } + return *v, true +} + +// OldEmail returns the old "email" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldEmail(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldEmail is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldEmail requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldEmail: %w", err) + } + return oldValue.Email, nil +} + +// ClearEmail clears the value of the "email" field. +func (m *UserMutation) ClearEmail() { + m.email = nil + m.clearedFields[user.FieldEmail] = struct{}{} +} + +// EmailCleared returns if the "email" field was cleared in this mutation. +func (m *UserMutation) EmailCleared() bool { + _, ok := m.clearedFields[user.FieldEmail] + return ok +} + +// ResetEmail resets all changes to the "email" field. +func (m *UserMutation) ResetEmail() { + m.email = nil + delete(m.clearedFields, user.FieldEmail) +} + +// SetPhone sets the "phone" field. +func (m *UserMutation) SetPhone(s string) { + m.phone = &s +} + +// Phone returns the value of the "phone" field in the mutation. +func (m *UserMutation) Phone() (r string, exists bool) { + v := m.phone + if v == nil { + return + } + return *v, true +} + +// OldPhone returns the old "phone" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldPhone(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldPhone is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldPhone requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPhone: %w", err) + } + return oldValue.Phone, nil +} + +// ClearPhone clears the value of the "phone" field. +func (m *UserMutation) ClearPhone() { + m.phone = nil + m.clearedFields[user.FieldPhone] = struct{}{} +} + +// PhoneCleared returns if the "phone" field was cleared in this mutation. +func (m *UserMutation) PhoneCleared() bool { + _, ok := m.clearedFields[user.FieldPhone] + return ok +} + +// ResetPhone resets all changes to the "phone" field. +func (m *UserMutation) ResetPhone() { + m.phone = nil + delete(m.clearedFields, user.FieldPhone) +} + +// SetAvatar sets the "avatar" field. +func (m *UserMutation) SetAvatar(s string) { + m.avatar = &s +} + +// Avatar returns the value of the "avatar" field in the mutation. +func (m *UserMutation) Avatar() (r string, exists bool) { + v := m.avatar + if v == nil { + return + } + return *v, true +} + +// OldAvatar returns the old "avatar" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldAvatar(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldAvatar is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldAvatar requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAvatar: %w", err) + } + return oldValue.Avatar, nil +} + +// ClearAvatar clears the value of the "avatar" field. +func (m *UserMutation) ClearAvatar() { + m.avatar = nil + m.clearedFields[user.FieldAvatar] = struct{}{} +} + +// AvatarCleared returns if the "avatar" field was cleared in this mutation. +func (m *UserMutation) AvatarCleared() bool { + _, ok := m.clearedFields[user.FieldAvatar] + return ok +} + +// ResetAvatar resets all changes to the "avatar" field. +func (m *UserMutation) ResetAvatar() { + m.avatar = nil + delete(m.clearedFields, user.FieldAvatar) +} + +// SetGender sets the "gender" field. +func (m *UserMutation) SetGender(u user.Gender) { + m.gender = &u +} + +// Gender returns the value of the "gender" field in the mutation. +func (m *UserMutation) Gender() (r user.Gender, exists bool) { + v := m.gender + if v == nil { + return + } + return *v, true +} + +// OldGender returns the old "gender" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldGender(ctx context.Context) (v *user.Gender, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldGender is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldGender requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldGender: %w", err) + } + return oldValue.Gender, nil +} + +// ClearGender clears the value of the "gender" field. +func (m *UserMutation) ClearGender() { + m.gender = nil + m.clearedFields[user.FieldGender] = struct{}{} +} + +// GenderCleared returns if the "gender" field was cleared in this mutation. +func (m *UserMutation) GenderCleared() bool { + _, ok := m.clearedFields[user.FieldGender] + return ok +} + +// ResetGender resets all changes to the "gender" field. +func (m *UserMutation) ResetGender() { + m.gender = nil + delete(m.clearedFields, user.FieldGender) +} + +// SetAddress sets the "address" field. +func (m *UserMutation) SetAddress(s string) { + m.address = &s +} + +// Address returns the value of the "address" field in the mutation. +func (m *UserMutation) Address() (r string, exists bool) { + v := m.address + if v == nil { + return + } + return *v, true +} + +// OldAddress returns the old "address" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldAddress(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldAddress is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldAddress requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAddress: %w", err) + } + return oldValue.Address, nil +} + +// ClearAddress clears the value of the "address" field. +func (m *UserMutation) ClearAddress() { + m.address = nil + m.clearedFields[user.FieldAddress] = struct{}{} +} + +// AddressCleared returns if the "address" field was cleared in this mutation. +func (m *UserMutation) AddressCleared() bool { + _, ok := m.clearedFields[user.FieldAddress] + return ok +} + +// ResetAddress resets all changes to the "address" field. +func (m *UserMutation) ResetAddress() { + m.address = nil + delete(m.clearedFields, user.FieldAddress) +} + +// SetDescription sets the "description" field. +func (m *UserMutation) SetDescription(s string) { + m.description = &s +} + +// Description returns the value of the "description" field in the mutation. +func (m *UserMutation) Description() (r string, exists bool) { + v := m.description + if v == nil { + return + } + return *v, true +} + +// OldDescription returns the old "description" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldDescription(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDescription is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDescription requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDescription: %w", err) + } + return oldValue.Description, nil +} + +// ClearDescription clears the value of the "description" field. +func (m *UserMutation) ClearDescription() { + m.description = nil + m.clearedFields[user.FieldDescription] = struct{}{} +} + +// DescriptionCleared returns if the "description" field was cleared in this mutation. +func (m *UserMutation) DescriptionCleared() bool { + _, ok := m.clearedFields[user.FieldDescription] + return ok +} + +// ResetDescription resets all changes to the "description" field. +func (m *UserMutation) ResetDescription() { + m.description = nil + delete(m.clearedFields, user.FieldDescription) +} + +// SetAuthority sets the "authority" field. +func (m *UserMutation) SetAuthority(u user.Authority) { + m.authority = &u +} + +// Authority returns the value of the "authority" field in the mutation. +func (m *UserMutation) Authority() (r user.Authority, exists bool) { + v := m.authority + if v == nil { + return + } + return *v, true +} + +// OldAuthority returns the old "authority" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldAuthority(ctx context.Context) (v *user.Authority, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldAuthority is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldAuthority requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAuthority: %w", err) + } + return oldValue.Authority, nil +} + +// ClearAuthority clears the value of the "authority" field. +func (m *UserMutation) ClearAuthority() { + m.authority = nil + m.clearedFields[user.FieldAuthority] = struct{}{} +} + +// AuthorityCleared returns if the "authority" field was cleared in this mutation. +func (m *UserMutation) AuthorityCleared() bool { + _, ok := m.clearedFields[user.FieldAuthority] + return ok +} + +// ResetAuthority resets all changes to the "authority" field. +func (m *UserMutation) ResetAuthority() { + m.authority = nil + delete(m.clearedFields, user.FieldAuthority) +} + +// SetLastLoginTime sets the "last_login_time" field. +func (m *UserMutation) SetLastLoginTime(i int64) { + m.last_login_time = &i + m.addlast_login_time = nil +} + +// LastLoginTime returns the value of the "last_login_time" field in the mutation. +func (m *UserMutation) LastLoginTime() (r int64, exists bool) { + v := m.last_login_time + if v == nil { + return + } + return *v, true +} + +// OldLastLoginTime returns the old "last_login_time" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldLastLoginTime(ctx context.Context) (v *int64, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldLastLoginTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldLastLoginTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLastLoginTime: %w", err) + } + return oldValue.LastLoginTime, nil +} + +// AddLastLoginTime adds i to the "last_login_time" field. +func (m *UserMutation) AddLastLoginTime(i int64) { + if m.addlast_login_time != nil { + *m.addlast_login_time += i + } else { + m.addlast_login_time = &i + } +} + +// AddedLastLoginTime returns the value that was added to the "last_login_time" field in this mutation. +func (m *UserMutation) AddedLastLoginTime() (r int64, exists bool) { + v := m.addlast_login_time + if v == nil { + return + } + return *v, true +} + +// ClearLastLoginTime clears the value of the "last_login_time" field. +func (m *UserMutation) ClearLastLoginTime() { + m.last_login_time = nil + m.addlast_login_time = nil + m.clearedFields[user.FieldLastLoginTime] = struct{}{} +} + +// LastLoginTimeCleared returns if the "last_login_time" field was cleared in this mutation. +func (m *UserMutation) LastLoginTimeCleared() bool { + _, ok := m.clearedFields[user.FieldLastLoginTime] + return ok +} + +// ResetLastLoginTime resets all changes to the "last_login_time" field. +func (m *UserMutation) ResetLastLoginTime() { + m.last_login_time = nil + m.addlast_login_time = nil + delete(m.clearedFields, user.FieldLastLoginTime) +} + +// SetLastLoginIP sets the "last_login_ip" field. +func (m *UserMutation) SetLastLoginIP(s string) { + m.last_login_ip = &s +} + +// LastLoginIP returns the value of the "last_login_ip" field in the mutation. +func (m *UserMutation) LastLoginIP() (r string, exists bool) { + v := m.last_login_ip + if v == nil { + return + } + return *v, true +} + +// OldLastLoginIP returns the old "last_login_ip" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldLastLoginIP(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldLastLoginIP is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldLastLoginIP requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLastLoginIP: %w", err) + } + return oldValue.LastLoginIP, nil +} + +// ClearLastLoginIP clears the value of the "last_login_ip" field. +func (m *UserMutation) ClearLastLoginIP() { + m.last_login_ip = nil + m.clearedFields[user.FieldLastLoginIP] = struct{}{} +} + +// LastLoginIPCleared returns if the "last_login_ip" field was cleared in this mutation. +func (m *UserMutation) LastLoginIPCleared() bool { + _, ok := m.clearedFields[user.FieldLastLoginIP] + return ok +} + +// ResetLastLoginIP resets all changes to the "last_login_ip" field. +func (m *UserMutation) ResetLastLoginIP() { + m.last_login_ip = nil + delete(m.clearedFields, user.FieldLastLoginIP) +} + +// Where appends a list predicates to the UserMutation builder. +func (m *UserMutation) Where(ps ...predicate.User) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the UserMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *UserMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.User, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *UserMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *UserMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (User). +func (m *UserMutation) Type() string { + return m.typ +} + +// Fields returns all fields that were changed during this mutation. Note that in +// order to get all numeric fields that were incremented/decremented, call +// AddedFields(). +func (m *UserMutation) Fields() []string { + fields := make([]string, 0, 22) + if m.create_by != nil { + fields = append(fields, user.FieldCreateBy) + } + if m.create_time != nil { + fields = append(fields, user.FieldCreateTime) + } + if m.update_time != nil { + fields = append(fields, user.FieldUpdateTime) + } + if m.delete_time != nil { + fields = append(fields, user.FieldDeleteTime) + } + if m.status != nil { + fields = append(fields, user.FieldStatus) + } + if m.username != nil { + fields = append(fields, user.FieldUsername) + } + if m.password != nil { + fields = append(fields, user.FieldPassword) + } + if m.role_id != nil { + fields = append(fields, user.FieldRoleID) + } + if m.org_id != nil { + fields = append(fields, user.FieldOrgID) + } + if m.position_id != nil { + fields = append(fields, user.FieldPositionID) + } + if m.work_id != nil { + fields = append(fields, user.FieldWorkID) + } + if m.nick_name != nil { + fields = append(fields, user.FieldNickName) + } + if m.real_name != nil { + fields = append(fields, user.FieldRealName) + } + if m.email != nil { + fields = append(fields, user.FieldEmail) + } + if m.phone != nil { + fields = append(fields, user.FieldPhone) + } + if m.avatar != nil { + fields = append(fields, user.FieldAvatar) + } + if m.gender != nil { + fields = append(fields, user.FieldGender) + } + if m.address != nil { + fields = append(fields, user.FieldAddress) + } + if m.description != nil { + fields = append(fields, user.FieldDescription) + } + if m.authority != nil { + fields = append(fields, user.FieldAuthority) + } + if m.last_login_time != nil { + fields = append(fields, user.FieldLastLoginTime) + } + if m.last_login_ip != nil { + fields = append(fields, user.FieldLastLoginIP) + } + return fields +} + +// Field returns the value of a field with the given name. The second boolean +// return value indicates that this field was not set, or was not defined in the +// schema. +func (m *UserMutation) Field(name string) (ent.Value, bool) { + switch name { + case user.FieldCreateBy: + return m.CreateBy() + case user.FieldCreateTime: + return m.CreateTime() + case user.FieldUpdateTime: + return m.UpdateTime() + case user.FieldDeleteTime: + return m.DeleteTime() + case user.FieldStatus: + return m.Status() + case user.FieldUsername: + return m.Username() + case user.FieldPassword: + return m.Password() + case user.FieldRoleID: + return m.RoleID() + case user.FieldOrgID: + return m.OrgID() + case user.FieldPositionID: + return m.PositionID() + case user.FieldWorkID: + return m.WorkID() + case user.FieldNickName: + return m.NickName() + case user.FieldRealName: + return m.RealName() + case user.FieldEmail: + return m.Email() + case user.FieldPhone: + return m.Phone() + case user.FieldAvatar: + return m.Avatar() + case user.FieldGender: + return m.Gender() + case user.FieldAddress: + return m.Address() + case user.FieldDescription: + return m.Description() + case user.FieldAuthority: + return m.Authority() + case user.FieldLastLoginTime: + return m.LastLoginTime() + case user.FieldLastLoginIP: + return m.LastLoginIP() + } + return nil, false +} + +// OldField returns the old value of the field from the database. An error is +// returned if the mutation operation is not UpdateOne, or the query to the +// database failed. +func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case user.FieldCreateBy: + return m.OldCreateBy(ctx) + case user.FieldCreateTime: + return m.OldCreateTime(ctx) + case user.FieldUpdateTime: + return m.OldUpdateTime(ctx) + case user.FieldDeleteTime: + return m.OldDeleteTime(ctx) + case user.FieldStatus: + return m.OldStatus(ctx) + case user.FieldUsername: + return m.OldUsername(ctx) + case user.FieldPassword: + return m.OldPassword(ctx) + case user.FieldRoleID: + return m.OldRoleID(ctx) + case user.FieldOrgID: + return m.OldOrgID(ctx) + case user.FieldPositionID: + return m.OldPositionID(ctx) + case user.FieldWorkID: + return m.OldWorkID(ctx) + case user.FieldNickName: + return m.OldNickName(ctx) + case user.FieldRealName: + return m.OldRealName(ctx) + case user.FieldEmail: + return m.OldEmail(ctx) + case user.FieldPhone: + return m.OldPhone(ctx) + case user.FieldAvatar: + return m.OldAvatar(ctx) + case user.FieldGender: + return m.OldGender(ctx) + case user.FieldAddress: + return m.OldAddress(ctx) + case user.FieldDescription: + return m.OldDescription(ctx) + case user.FieldAuthority: + return m.OldAuthority(ctx) + case user.FieldLastLoginTime: + return m.OldLastLoginTime(ctx) + case user.FieldLastLoginIP: + return m.OldLastLoginIP(ctx) + } + return nil, fmt.Errorf("unknown User field %s", name) +} + +// SetField sets the value of a field with the given name. It returns an error if +// the field is not defined in the schema, or if the type mismatched the field +// type. +func (m *UserMutation) SetField(name string, value ent.Value) error { + switch name { + case user.FieldCreateBy: + v, ok := value.(uint32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreateBy(v) + return nil + case user.FieldCreateTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreateTime(v) + return nil + case user.FieldUpdateTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdateTime(v) + return nil + case user.FieldDeleteTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeleteTime(v) + return nil + case user.FieldStatus: + v, ok := value.(user.Status) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetStatus(v) + return nil + case user.FieldUsername: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUsername(v) + return nil + case user.FieldPassword: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetPassword(v) + return nil + case user.FieldRoleID: + v, ok := value.(uint32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRoleID(v) + return nil + case user.FieldOrgID: + v, ok := value.(uint32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOrgID(v) + return nil + case user.FieldPositionID: + v, ok := value.(uint32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetPositionID(v) + return nil + case user.FieldWorkID: + v, ok := value.(uint32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetWorkID(v) + return nil + case user.FieldNickName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetNickName(v) + return nil + case user.FieldRealName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRealName(v) + return nil + case user.FieldEmail: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetEmail(v) + return nil + case user.FieldPhone: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetPhone(v) + return nil + case user.FieldAvatar: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetAvatar(v) + return nil + case user.FieldGender: + v, ok := value.(user.Gender) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetGender(v) + return nil + case user.FieldAddress: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetAddress(v) + return nil + case user.FieldDescription: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDescription(v) + return nil + case user.FieldAuthority: + v, ok := value.(user.Authority) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetAuthority(v) + return nil + case user.FieldLastLoginTime: + v, ok := value.(int64) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetLastLoginTime(v) + return nil + case user.FieldLastLoginIP: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetLastLoginIP(v) + return nil + } + return fmt.Errorf("unknown User field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *UserMutation) AddedFields() []string { + var fields []string + if m.addcreate_by != nil { + fields = append(fields, user.FieldCreateBy) + } + if m.addrole_id != nil { + fields = append(fields, user.FieldRoleID) + } + if m.addorg_id != nil { + fields = append(fields, user.FieldOrgID) + } + if m.addposition_id != nil { + fields = append(fields, user.FieldPositionID) + } + if m.addwork_id != nil { + fields = append(fields, user.FieldWorkID) + } + if m.addlast_login_time != nil { + fields = append(fields, user.FieldLastLoginTime) + } + return fields +} + +// AddedField returns the numeric value that was incremented/decremented on a field +// with the given name. The second boolean return value indicates that this field +// was not set, or was not defined in the schema. +func (m *UserMutation) AddedField(name string) (ent.Value, bool) { + switch name { + case user.FieldCreateBy: + return m.AddedCreateBy() + case user.FieldRoleID: + return m.AddedRoleID() + case user.FieldOrgID: + return m.AddedOrgID() + case user.FieldPositionID: + return m.AddedPositionID() + case user.FieldWorkID: + return m.AddedWorkID() + case user.FieldLastLoginTime: + return m.AddedLastLoginTime() + } + return nil, false +} + +// AddField adds the value to the field with the given name. It returns an error if +// the field is not defined in the schema, or if the type mismatched the field +// type. +func (m *UserMutation) AddField(name string, value ent.Value) error { + switch name { + case user.FieldCreateBy: + v, ok := value.(int32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddCreateBy(v) + return nil + case user.FieldRoleID: + v, ok := value.(int32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddRoleID(v) + return nil + case user.FieldOrgID: + v, ok := value.(int32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddOrgID(v) + return nil + case user.FieldPositionID: + v, ok := value.(int32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddPositionID(v) + return nil + case user.FieldWorkID: + v, ok := value.(int32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddWorkID(v) + return nil + case user.FieldLastLoginTime: + v, ok := value.(int64) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddLastLoginTime(v) + return nil + } + return fmt.Errorf("unknown User numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *UserMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(user.FieldCreateBy) { + fields = append(fields, user.FieldCreateBy) + } + if m.FieldCleared(user.FieldCreateTime) { + fields = append(fields, user.FieldCreateTime) + } + if m.FieldCleared(user.FieldUpdateTime) { + fields = append(fields, user.FieldUpdateTime) + } + if m.FieldCleared(user.FieldDeleteTime) { + fields = append(fields, user.FieldDeleteTime) + } + if m.FieldCleared(user.FieldStatus) { + fields = append(fields, user.FieldStatus) + } + if m.FieldCleared(user.FieldUsername) { + fields = append(fields, user.FieldUsername) + } + if m.FieldCleared(user.FieldPassword) { + fields = append(fields, user.FieldPassword) + } + if m.FieldCleared(user.FieldRoleID) { + fields = append(fields, user.FieldRoleID) + } + if m.FieldCleared(user.FieldOrgID) { + fields = append(fields, user.FieldOrgID) + } + if m.FieldCleared(user.FieldPositionID) { + fields = append(fields, user.FieldPositionID) + } + if m.FieldCleared(user.FieldWorkID) { + fields = append(fields, user.FieldWorkID) + } + if m.FieldCleared(user.FieldNickName) { + fields = append(fields, user.FieldNickName) + } + if m.FieldCleared(user.FieldRealName) { + fields = append(fields, user.FieldRealName) + } + if m.FieldCleared(user.FieldEmail) { + fields = append(fields, user.FieldEmail) + } + if m.FieldCleared(user.FieldPhone) { + fields = append(fields, user.FieldPhone) + } + if m.FieldCleared(user.FieldAvatar) { + fields = append(fields, user.FieldAvatar) + } + if m.FieldCleared(user.FieldGender) { + fields = append(fields, user.FieldGender) + } + if m.FieldCleared(user.FieldAddress) { + fields = append(fields, user.FieldAddress) + } + if m.FieldCleared(user.FieldDescription) { + fields = append(fields, user.FieldDescription) + } + if m.FieldCleared(user.FieldAuthority) { + fields = append(fields, user.FieldAuthority) + } + if m.FieldCleared(user.FieldLastLoginTime) { + fields = append(fields, user.FieldLastLoginTime) + } + if m.FieldCleared(user.FieldLastLoginIP) { + fields = append(fields, user.FieldLastLoginIP) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *UserMutation) FieldCleared(name string) bool { + _, ok := m.clearedFields[name] + return ok +} + +// ClearField clears the value of the field with the given name. It returns an +// error if the field is not defined in the schema. +func (m *UserMutation) ClearField(name string) error { + switch name { + case user.FieldCreateBy: + m.ClearCreateBy() + return nil + case user.FieldCreateTime: + m.ClearCreateTime() + return nil + case user.FieldUpdateTime: + m.ClearUpdateTime() + return nil + case user.FieldDeleteTime: + m.ClearDeleteTime() + return nil + case user.FieldStatus: + m.ClearStatus() + return nil + case user.FieldUsername: + m.ClearUsername() + return nil + case user.FieldPassword: + m.ClearPassword() + return nil + case user.FieldRoleID: + m.ClearRoleID() + return nil + case user.FieldOrgID: + m.ClearOrgID() + return nil + case user.FieldPositionID: + m.ClearPositionID() + return nil + case user.FieldWorkID: + m.ClearWorkID() + return nil + case user.FieldNickName: + m.ClearNickName() + return nil + case user.FieldRealName: + m.ClearRealName() + return nil + case user.FieldEmail: + m.ClearEmail() + return nil + case user.FieldPhone: + m.ClearPhone() + return nil + case user.FieldAvatar: + m.ClearAvatar() + return nil + case user.FieldGender: + m.ClearGender() + return nil + case user.FieldAddress: + m.ClearAddress() + return nil + case user.FieldDescription: + m.ClearDescription() + return nil + case user.FieldAuthority: + m.ClearAuthority() + return nil + case user.FieldLastLoginTime: + m.ClearLastLoginTime() + return nil + case user.FieldLastLoginIP: + m.ClearLastLoginIP() + return nil + } + return fmt.Errorf("unknown User nullable field %s", name) +} + +// ResetField resets all changes in the mutation for the field with the given name. +// It returns an error if the field is not defined in the schema. +func (m *UserMutation) ResetField(name string) error { + switch name { + case user.FieldCreateBy: + m.ResetCreateBy() + return nil + case user.FieldCreateTime: + m.ResetCreateTime() + return nil + case user.FieldUpdateTime: + m.ResetUpdateTime() + return nil + case user.FieldDeleteTime: + m.ResetDeleteTime() + return nil + case user.FieldStatus: + m.ResetStatus() + return nil + case user.FieldUsername: + m.ResetUsername() + return nil + case user.FieldPassword: + m.ResetPassword() + return nil + case user.FieldRoleID: + m.ResetRoleID() + return nil + case user.FieldOrgID: + m.ResetOrgID() + return nil + case user.FieldPositionID: + m.ResetPositionID() + return nil + case user.FieldWorkID: + m.ResetWorkID() + return nil + case user.FieldNickName: + m.ResetNickName() + return nil + case user.FieldRealName: + m.ResetRealName() + return nil + case user.FieldEmail: + m.ResetEmail() + return nil + case user.FieldPhone: + m.ResetPhone() + return nil + case user.FieldAvatar: + m.ResetAvatar() + return nil + case user.FieldGender: + m.ResetGender() + return nil + case user.FieldAddress: + m.ResetAddress() + return nil + case user.FieldDescription: + m.ResetDescription() + return nil + case user.FieldAuthority: + m.ResetAuthority() + return nil + case user.FieldLastLoginTime: + m.ResetLastLoginTime() + return nil + case user.FieldLastLoginIP: + m.ResetLastLoginIP() + return nil + } + return fmt.Errorf("unknown User field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *UserMutation) AddedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *UserMutation) AddedIDs(name string) []ent.Value { + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *UserMutation) RemovedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *UserMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *UserMutation) ClearedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *UserMutation) EdgeCleared(name string) bool { + return false +} + +// ClearEdge clears the value of the edge with the given name. It returns an error +// if that edge is not defined in the schema. +func (m *UserMutation) ClearEdge(name string) error { + return fmt.Errorf("unknown User unique edge %s", name) +} + +// ResetEdge resets all changes to the edge with the given name in this mutation. +// It returns an error if the edge is not defined in the schema. +func (m *UserMutation) ResetEdge(name string) error { + return fmt.Errorf("unknown User edge %s", name) +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/organization.go b/monolithic/backend/app/admin/service/internal/data/ent/organization.go new file mode 100644 index 0000000..8af1518 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/organization.go @@ -0,0 +1,268 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/organization" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" +) + +// Organization is the model entity for the Organization schema. +type Organization struct { + config `json:"-"` + // ID of the ent. + // id + ID uint32 `json:"id,omitempty"` + // 创建时间 + CreateTime *time.Time `json:"create_time,omitempty"` + // 更新时间 + UpdateTime *time.Time `json:"update_time,omitempty"` + // 删除时间 + DeleteTime *time.Time `json:"delete_time,omitempty"` + // 状态 + Status *organization.Status `json:"status,omitempty"` + // 创建者ID + CreateBy *uint32 `json:"create_by,omitempty"` + // 备注 + Remark *string `json:"remark,omitempty"` + // 名字 + Name *string `json:"name,omitempty"` + // 上一层部门ID + ParentID *uint32 `json:"parent_id,omitempty"` + // 排序ID + OrderNo *int32 `json:"order_no,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the OrganizationQuery when eager-loading is set. + Edges OrganizationEdges `json:"edges"` + selectValues sql.SelectValues +} + +// OrganizationEdges holds the relations/edges for other nodes in the graph. +type OrganizationEdges struct { + // Parent holds the value of the parent edge. + Parent *Organization `json:"parent,omitempty"` + // Children holds the value of the children edge. + Children []*Organization `json:"children,omitempty"` + // loadedTypes holds the information for reporting if a + // type was loaded (or requested) in eager-loading or not. + loadedTypes [2]bool +} + +// ParentOrErr returns the Parent value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e OrganizationEdges) ParentOrErr() (*Organization, error) { + if e.loadedTypes[0] { + if e.Parent == nil { + // Edge was loaded but was not found. + return nil, &NotFoundError{label: organization.Label} + } + return e.Parent, nil + } + return nil, &NotLoadedError{edge: "parent"} +} + +// ChildrenOrErr returns the Children value or an error if the edge +// was not loaded in eager-loading. +func (e OrganizationEdges) ChildrenOrErr() ([]*Organization, error) { + if e.loadedTypes[1] { + return e.Children, nil + } + return nil, &NotLoadedError{edge: "children"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*Organization) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case organization.FieldID, organization.FieldCreateBy, organization.FieldParentID, organization.FieldOrderNo: + values[i] = new(sql.NullInt64) + case organization.FieldStatus, organization.FieldRemark, organization.FieldName: + values[i] = new(sql.NullString) + case organization.FieldCreateTime, organization.FieldUpdateTime, organization.FieldDeleteTime: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the Organization fields. +func (o *Organization) assignValues(columns []string, values []any) error { + if m, n := len(values), len(columns); m < n { + return fmt.Errorf("mismatch number of scan values: %d != %d", m, n) + } + for i := range columns { + switch columns[i] { + case organization.FieldID: + value, ok := values[i].(*sql.NullInt64) + if !ok { + return fmt.Errorf("unexpected type %T for field id", value) + } + o.ID = uint32(value.Int64) + case organization.FieldCreateTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field create_time", values[i]) + } else if value.Valid { + o.CreateTime = new(time.Time) + *o.CreateTime = value.Time + } + case organization.FieldUpdateTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field update_time", values[i]) + } else if value.Valid { + o.UpdateTime = new(time.Time) + *o.UpdateTime = value.Time + } + case organization.FieldDeleteTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field delete_time", values[i]) + } else if value.Valid { + o.DeleteTime = new(time.Time) + *o.DeleteTime = value.Time + } + case organization.FieldStatus: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field status", values[i]) + } else if value.Valid { + o.Status = new(organization.Status) + *o.Status = organization.Status(value.String) + } + case organization.FieldCreateBy: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field create_by", values[i]) + } else if value.Valid { + o.CreateBy = new(uint32) + *o.CreateBy = uint32(value.Int64) + } + case organization.FieldRemark: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field remark", values[i]) + } else if value.Valid { + o.Remark = new(string) + *o.Remark = value.String + } + case organization.FieldName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[i]) + } else if value.Valid { + o.Name = new(string) + *o.Name = value.String + } + case organization.FieldParentID: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field parent_id", values[i]) + } else if value.Valid { + o.ParentID = new(uint32) + *o.ParentID = uint32(value.Int64) + } + case organization.FieldOrderNo: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field order_no", values[i]) + } else if value.Valid { + o.OrderNo = new(int32) + *o.OrderNo = int32(value.Int64) + } + default: + o.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the Organization. +// This includes values selected through modifiers, order, etc. +func (o *Organization) Value(name string) (ent.Value, error) { + return o.selectValues.Get(name) +} + +// QueryParent queries the "parent" edge of the Organization entity. +func (o *Organization) QueryParent() *OrganizationQuery { + return NewOrganizationClient(o.config).QueryParent(o) +} + +// QueryChildren queries the "children" edge of the Organization entity. +func (o *Organization) QueryChildren() *OrganizationQuery { + return NewOrganizationClient(o.config).QueryChildren(o) +} + +// Update returns a builder for updating this Organization. +// Note that you need to call Organization.Unwrap() before calling this method if this Organization +// was returned from a transaction, and the transaction was committed or rolled back. +func (o *Organization) Update() *OrganizationUpdateOne { + return NewOrganizationClient(o.config).UpdateOne(o) +} + +// Unwrap unwraps the Organization entity that was returned from a transaction after it was closed, +// so that all future queries will be executed through the driver which created the transaction. +func (o *Organization) Unwrap() *Organization { + _tx, ok := o.config.driver.(*txDriver) + if !ok { + panic("ent: Organization is not a transactional entity") + } + o.config.driver = _tx.drv + return o +} + +// String implements the fmt.Stringer. +func (o *Organization) String() string { + var builder strings.Builder + builder.WriteString("Organization(") + builder.WriteString(fmt.Sprintf("id=%v, ", o.ID)) + if v := o.CreateTime; v != nil { + builder.WriteString("create_time=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + if v := o.UpdateTime; v != nil { + builder.WriteString("update_time=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + if v := o.DeleteTime; v != nil { + builder.WriteString("delete_time=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + if v := o.Status; v != nil { + builder.WriteString("status=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := o.CreateBy; v != nil { + builder.WriteString("create_by=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := o.Remark; v != nil { + builder.WriteString("remark=") + builder.WriteString(*v) + } + builder.WriteString(", ") + if v := o.Name; v != nil { + builder.WriteString("name=") + builder.WriteString(*v) + } + builder.WriteString(", ") + if v := o.ParentID; v != nil { + builder.WriteString("parent_id=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := o.OrderNo; v != nil { + builder.WriteString("order_no=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteByte(')') + return builder.String() +} + +// Organizations is a parsable slice of Organization. +type Organizations []*Organization diff --git a/monolithic/backend/app/admin/service/internal/data/ent/organization/organization.go b/monolithic/backend/app/admin/service/internal/data/ent/organization/organization.go new file mode 100644 index 0000000..6cc564a --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/organization/organization.go @@ -0,0 +1,200 @@ +// Code generated by ent, DO NOT EDIT. + +package organization + +import ( + "fmt" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +const ( + // Label holds the string label denoting the organization type in the database. + Label = "organization" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreateTime holds the string denoting the create_time field in the database. + FieldCreateTime = "create_time" + // FieldUpdateTime holds the string denoting the update_time field in the database. + FieldUpdateTime = "update_time" + // FieldDeleteTime holds the string denoting the delete_time field in the database. + FieldDeleteTime = "delete_time" + // FieldStatus holds the string denoting the status field in the database. + FieldStatus = "status" + // FieldCreateBy holds the string denoting the create_by field in the database. + FieldCreateBy = "create_by" + // FieldRemark holds the string denoting the remark field in the database. + FieldRemark = "remark" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // FieldParentID holds the string denoting the parent_id field in the database. + FieldParentID = "parent_id" + // FieldOrderNo holds the string denoting the order_no field in the database. + FieldOrderNo = "order_no" + // EdgeParent holds the string denoting the parent edge name in mutations. + EdgeParent = "parent" + // EdgeChildren holds the string denoting the children edge name in mutations. + EdgeChildren = "children" + // Table holds the table name of the organization in the database. + Table = "organization" + // ParentTable is the table that holds the parent relation/edge. + ParentTable = "organization" + // ParentColumn is the table column denoting the parent relation/edge. + ParentColumn = "parent_id" + // ChildrenTable is the table that holds the children relation/edge. + ChildrenTable = "organization" + // ChildrenColumn is the table column denoting the children relation/edge. + ChildrenColumn = "parent_id" +) + +// Columns holds all SQL columns for organization fields. +var Columns = []string{ + FieldID, + FieldCreateTime, + FieldUpdateTime, + FieldDeleteTime, + FieldStatus, + FieldCreateBy, + FieldRemark, + FieldName, + FieldParentID, + FieldOrderNo, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +var ( + // DefaultRemark holds the default value on creation for the "remark" field. + DefaultRemark string + // DefaultName holds the default value on creation for the "name" field. + DefaultName string + // NameValidator is a validator for the "name" field. It is called by the builders before save. + NameValidator func(string) error + // DefaultOrderNo holds the default value on creation for the "order_no" field. + DefaultOrderNo int32 + // IDValidator is a validator for the "id" field. It is called by the builders before save. + IDValidator func(uint32) error +) + +// Status defines the type for the "status" enum field. +type Status string + +// StatusON is the default value of the Status enum. +const DefaultStatus = StatusON + +// Status values. +const ( + StatusOFF Status = "OFF" + StatusON Status = "ON" +) + +func (s Status) String() string { + return string(s) +} + +// StatusValidator is a validator for the "status" field enum values. It is called by the builders before save. +func StatusValidator(s Status) error { + switch s { + case StatusOFF, StatusON: + return nil + default: + return fmt.Errorf("organization: invalid enum value for status field: %q", s) + } +} + +// OrderOption defines the ordering options for the Organization queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreateTime orders the results by the create_time field. +func ByCreateTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreateTime, opts...).ToFunc() +} + +// ByUpdateTime orders the results by the update_time field. +func ByUpdateTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdateTime, opts...).ToFunc() +} + +// ByDeleteTime orders the results by the delete_time field. +func ByDeleteTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeleteTime, opts...).ToFunc() +} + +// ByStatus orders the results by the status field. +func ByStatus(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldStatus, opts...).ToFunc() +} + +// ByCreateBy orders the results by the create_by field. +func ByCreateBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreateBy, opts...).ToFunc() +} + +// ByRemark orders the results by the remark field. +func ByRemark(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRemark, opts...).ToFunc() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +// ByParentID orders the results by the parent_id field. +func ByParentID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldParentID, opts...).ToFunc() +} + +// ByOrderNo orders the results by the order_no field. +func ByOrderNo(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOrderNo, opts...).ToFunc() +} + +// ByParentField orders the results by parent field. +func ByParentField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newParentStep(), sql.OrderByField(field, opts...)) + } +} + +// ByChildrenCount orders the results by children count. +func ByChildrenCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newChildrenStep(), opts...) + } +} + +// ByChildren orders the results by children terms. +func ByChildren(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newChildrenStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} +func newParentStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, ParentTable, ParentColumn), + ) +} +func newChildrenStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, ChildrenTable, ChildrenColumn), + ) +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/organization/where.go b/monolithic/backend/app/admin/service/internal/data/ent/organization/where.go new file mode 100644 index 0000000..86dec5b --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/organization/where.go @@ -0,0 +1,617 @@ +// Code generated by ent, DO NOT EDIT. + +package organization + +import ( + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +// ID filters vertices based on their ID field. +func ID(id uint32) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id uint32) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id uint32) predicate.Organization { + return predicate.Organization(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...uint32) predicate.Organization { + return predicate.Organization(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...uint32) predicate.Organization { + return predicate.Organization(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id uint32) predicate.Organization { + return predicate.Organization(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id uint32) predicate.Organization { + return predicate.Organization(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id uint32) predicate.Organization { + return predicate.Organization(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id uint32) predicate.Organization { + return predicate.Organization(sql.FieldLTE(FieldID, id)) +} + +// CreateTime applies equality check predicate on the "create_time" field. It's identical to CreateTimeEQ. +func CreateTime(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldCreateTime, v)) +} + +// UpdateTime applies equality check predicate on the "update_time" field. It's identical to UpdateTimeEQ. +func UpdateTime(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldUpdateTime, v)) +} + +// DeleteTime applies equality check predicate on the "delete_time" field. It's identical to DeleteTimeEQ. +func DeleteTime(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldDeleteTime, v)) +} + +// CreateBy applies equality check predicate on the "create_by" field. It's identical to CreateByEQ. +func CreateBy(v uint32) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldCreateBy, v)) +} + +// Remark applies equality check predicate on the "remark" field. It's identical to RemarkEQ. +func Remark(v string) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldRemark, v)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldName, v)) +} + +// ParentID applies equality check predicate on the "parent_id" field. It's identical to ParentIDEQ. +func ParentID(v uint32) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldParentID, v)) +} + +// OrderNo applies equality check predicate on the "order_no" field. It's identical to OrderNoEQ. +func OrderNo(v int32) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldOrderNo, v)) +} + +// CreateTimeEQ applies the EQ predicate on the "create_time" field. +func CreateTimeEQ(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldCreateTime, v)) +} + +// CreateTimeNEQ applies the NEQ predicate on the "create_time" field. +func CreateTimeNEQ(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldNEQ(FieldCreateTime, v)) +} + +// CreateTimeIn applies the In predicate on the "create_time" field. +func CreateTimeIn(vs ...time.Time) predicate.Organization { + return predicate.Organization(sql.FieldIn(FieldCreateTime, vs...)) +} + +// CreateTimeNotIn applies the NotIn predicate on the "create_time" field. +func CreateTimeNotIn(vs ...time.Time) predicate.Organization { + return predicate.Organization(sql.FieldNotIn(FieldCreateTime, vs...)) +} + +// CreateTimeGT applies the GT predicate on the "create_time" field. +func CreateTimeGT(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldGT(FieldCreateTime, v)) +} + +// CreateTimeGTE applies the GTE predicate on the "create_time" field. +func CreateTimeGTE(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldGTE(FieldCreateTime, v)) +} + +// CreateTimeLT applies the LT predicate on the "create_time" field. +func CreateTimeLT(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldLT(FieldCreateTime, v)) +} + +// CreateTimeLTE applies the LTE predicate on the "create_time" field. +func CreateTimeLTE(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldLTE(FieldCreateTime, v)) +} + +// CreateTimeIsNil applies the IsNil predicate on the "create_time" field. +func CreateTimeIsNil() predicate.Organization { + return predicate.Organization(sql.FieldIsNull(FieldCreateTime)) +} + +// CreateTimeNotNil applies the NotNil predicate on the "create_time" field. +func CreateTimeNotNil() predicate.Organization { + return predicate.Organization(sql.FieldNotNull(FieldCreateTime)) +} + +// UpdateTimeEQ applies the EQ predicate on the "update_time" field. +func UpdateTimeEQ(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldUpdateTime, v)) +} + +// UpdateTimeNEQ applies the NEQ predicate on the "update_time" field. +func UpdateTimeNEQ(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldNEQ(FieldUpdateTime, v)) +} + +// UpdateTimeIn applies the In predicate on the "update_time" field. +func UpdateTimeIn(vs ...time.Time) predicate.Organization { + return predicate.Organization(sql.FieldIn(FieldUpdateTime, vs...)) +} + +// UpdateTimeNotIn applies the NotIn predicate on the "update_time" field. +func UpdateTimeNotIn(vs ...time.Time) predicate.Organization { + return predicate.Organization(sql.FieldNotIn(FieldUpdateTime, vs...)) +} + +// UpdateTimeGT applies the GT predicate on the "update_time" field. +func UpdateTimeGT(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldGT(FieldUpdateTime, v)) +} + +// UpdateTimeGTE applies the GTE predicate on the "update_time" field. +func UpdateTimeGTE(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldGTE(FieldUpdateTime, v)) +} + +// UpdateTimeLT applies the LT predicate on the "update_time" field. +func UpdateTimeLT(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldLT(FieldUpdateTime, v)) +} + +// UpdateTimeLTE applies the LTE predicate on the "update_time" field. +func UpdateTimeLTE(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldLTE(FieldUpdateTime, v)) +} + +// UpdateTimeIsNil applies the IsNil predicate on the "update_time" field. +func UpdateTimeIsNil() predicate.Organization { + return predicate.Organization(sql.FieldIsNull(FieldUpdateTime)) +} + +// UpdateTimeNotNil applies the NotNil predicate on the "update_time" field. +func UpdateTimeNotNil() predicate.Organization { + return predicate.Organization(sql.FieldNotNull(FieldUpdateTime)) +} + +// DeleteTimeEQ applies the EQ predicate on the "delete_time" field. +func DeleteTimeEQ(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldDeleteTime, v)) +} + +// DeleteTimeNEQ applies the NEQ predicate on the "delete_time" field. +func DeleteTimeNEQ(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldNEQ(FieldDeleteTime, v)) +} + +// DeleteTimeIn applies the In predicate on the "delete_time" field. +func DeleteTimeIn(vs ...time.Time) predicate.Organization { + return predicate.Organization(sql.FieldIn(FieldDeleteTime, vs...)) +} + +// DeleteTimeNotIn applies the NotIn predicate on the "delete_time" field. +func DeleteTimeNotIn(vs ...time.Time) predicate.Organization { + return predicate.Organization(sql.FieldNotIn(FieldDeleteTime, vs...)) +} + +// DeleteTimeGT applies the GT predicate on the "delete_time" field. +func DeleteTimeGT(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldGT(FieldDeleteTime, v)) +} + +// DeleteTimeGTE applies the GTE predicate on the "delete_time" field. +func DeleteTimeGTE(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldGTE(FieldDeleteTime, v)) +} + +// DeleteTimeLT applies the LT predicate on the "delete_time" field. +func DeleteTimeLT(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldLT(FieldDeleteTime, v)) +} + +// DeleteTimeLTE applies the LTE predicate on the "delete_time" field. +func DeleteTimeLTE(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldLTE(FieldDeleteTime, v)) +} + +// DeleteTimeIsNil applies the IsNil predicate on the "delete_time" field. +func DeleteTimeIsNil() predicate.Organization { + return predicate.Organization(sql.FieldIsNull(FieldDeleteTime)) +} + +// DeleteTimeNotNil applies the NotNil predicate on the "delete_time" field. +func DeleteTimeNotNil() predicate.Organization { + return predicate.Organization(sql.FieldNotNull(FieldDeleteTime)) +} + +// StatusEQ applies the EQ predicate on the "status" field. +func StatusEQ(v Status) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldStatus, v)) +} + +// StatusNEQ applies the NEQ predicate on the "status" field. +func StatusNEQ(v Status) predicate.Organization { + return predicate.Organization(sql.FieldNEQ(FieldStatus, v)) +} + +// StatusIn applies the In predicate on the "status" field. +func StatusIn(vs ...Status) predicate.Organization { + return predicate.Organization(sql.FieldIn(FieldStatus, vs...)) +} + +// StatusNotIn applies the NotIn predicate on the "status" field. +func StatusNotIn(vs ...Status) predicate.Organization { + return predicate.Organization(sql.FieldNotIn(FieldStatus, vs...)) +} + +// StatusIsNil applies the IsNil predicate on the "status" field. +func StatusIsNil() predicate.Organization { + return predicate.Organization(sql.FieldIsNull(FieldStatus)) +} + +// StatusNotNil applies the NotNil predicate on the "status" field. +func StatusNotNil() predicate.Organization { + return predicate.Organization(sql.FieldNotNull(FieldStatus)) +} + +// CreateByEQ applies the EQ predicate on the "create_by" field. +func CreateByEQ(v uint32) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldCreateBy, v)) +} + +// CreateByNEQ applies the NEQ predicate on the "create_by" field. +func CreateByNEQ(v uint32) predicate.Organization { + return predicate.Organization(sql.FieldNEQ(FieldCreateBy, v)) +} + +// CreateByIn applies the In predicate on the "create_by" field. +func CreateByIn(vs ...uint32) predicate.Organization { + return predicate.Organization(sql.FieldIn(FieldCreateBy, vs...)) +} + +// CreateByNotIn applies the NotIn predicate on the "create_by" field. +func CreateByNotIn(vs ...uint32) predicate.Organization { + return predicate.Organization(sql.FieldNotIn(FieldCreateBy, vs...)) +} + +// CreateByGT applies the GT predicate on the "create_by" field. +func CreateByGT(v uint32) predicate.Organization { + return predicate.Organization(sql.FieldGT(FieldCreateBy, v)) +} + +// CreateByGTE applies the GTE predicate on the "create_by" field. +func CreateByGTE(v uint32) predicate.Organization { + return predicate.Organization(sql.FieldGTE(FieldCreateBy, v)) +} + +// CreateByLT applies the LT predicate on the "create_by" field. +func CreateByLT(v uint32) predicate.Organization { + return predicate.Organization(sql.FieldLT(FieldCreateBy, v)) +} + +// CreateByLTE applies the LTE predicate on the "create_by" field. +func CreateByLTE(v uint32) predicate.Organization { + return predicate.Organization(sql.FieldLTE(FieldCreateBy, v)) +} + +// CreateByIsNil applies the IsNil predicate on the "create_by" field. +func CreateByIsNil() predicate.Organization { + return predicate.Organization(sql.FieldIsNull(FieldCreateBy)) +} + +// CreateByNotNil applies the NotNil predicate on the "create_by" field. +func CreateByNotNil() predicate.Organization { + return predicate.Organization(sql.FieldNotNull(FieldCreateBy)) +} + +// RemarkEQ applies the EQ predicate on the "remark" field. +func RemarkEQ(v string) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldRemark, v)) +} + +// RemarkNEQ applies the NEQ predicate on the "remark" field. +func RemarkNEQ(v string) predicate.Organization { + return predicate.Organization(sql.FieldNEQ(FieldRemark, v)) +} + +// RemarkIn applies the In predicate on the "remark" field. +func RemarkIn(vs ...string) predicate.Organization { + return predicate.Organization(sql.FieldIn(FieldRemark, vs...)) +} + +// RemarkNotIn applies the NotIn predicate on the "remark" field. +func RemarkNotIn(vs ...string) predicate.Organization { + return predicate.Organization(sql.FieldNotIn(FieldRemark, vs...)) +} + +// RemarkGT applies the GT predicate on the "remark" field. +func RemarkGT(v string) predicate.Organization { + return predicate.Organization(sql.FieldGT(FieldRemark, v)) +} + +// RemarkGTE applies the GTE predicate on the "remark" field. +func RemarkGTE(v string) predicate.Organization { + return predicate.Organization(sql.FieldGTE(FieldRemark, v)) +} + +// RemarkLT applies the LT predicate on the "remark" field. +func RemarkLT(v string) predicate.Organization { + return predicate.Organization(sql.FieldLT(FieldRemark, v)) +} + +// RemarkLTE applies the LTE predicate on the "remark" field. +func RemarkLTE(v string) predicate.Organization { + return predicate.Organization(sql.FieldLTE(FieldRemark, v)) +} + +// RemarkContains applies the Contains predicate on the "remark" field. +func RemarkContains(v string) predicate.Organization { + return predicate.Organization(sql.FieldContains(FieldRemark, v)) +} + +// RemarkHasPrefix applies the HasPrefix predicate on the "remark" field. +func RemarkHasPrefix(v string) predicate.Organization { + return predicate.Organization(sql.FieldHasPrefix(FieldRemark, v)) +} + +// RemarkHasSuffix applies the HasSuffix predicate on the "remark" field. +func RemarkHasSuffix(v string) predicate.Organization { + return predicate.Organization(sql.FieldHasSuffix(FieldRemark, v)) +} + +// RemarkIsNil applies the IsNil predicate on the "remark" field. +func RemarkIsNil() predicate.Organization { + return predicate.Organization(sql.FieldIsNull(FieldRemark)) +} + +// RemarkNotNil applies the NotNil predicate on the "remark" field. +func RemarkNotNil() predicate.Organization { + return predicate.Organization(sql.FieldNotNull(FieldRemark)) +} + +// RemarkEqualFold applies the EqualFold predicate on the "remark" field. +func RemarkEqualFold(v string) predicate.Organization { + return predicate.Organization(sql.FieldEqualFold(FieldRemark, v)) +} + +// RemarkContainsFold applies the ContainsFold predicate on the "remark" field. +func RemarkContainsFold(v string) predicate.Organization { + return predicate.Organization(sql.FieldContainsFold(FieldRemark, v)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.Organization { + return predicate.Organization(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.Organization { + return predicate.Organization(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.Organization { + return predicate.Organization(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.Organization { + return predicate.Organization(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.Organization { + return predicate.Organization(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.Organization { + return predicate.Organization(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.Organization { + return predicate.Organization(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.Organization { + return predicate.Organization(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.Organization { + return predicate.Organization(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.Organization { + return predicate.Organization(sql.FieldHasSuffix(FieldName, v)) +} + +// NameIsNil applies the IsNil predicate on the "name" field. +func NameIsNil() predicate.Organization { + return predicate.Organization(sql.FieldIsNull(FieldName)) +} + +// NameNotNil applies the NotNil predicate on the "name" field. +func NameNotNil() predicate.Organization { + return predicate.Organization(sql.FieldNotNull(FieldName)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.Organization { + return predicate.Organization(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.Organization { + return predicate.Organization(sql.FieldContainsFold(FieldName, v)) +} + +// ParentIDEQ applies the EQ predicate on the "parent_id" field. +func ParentIDEQ(v uint32) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldParentID, v)) +} + +// ParentIDNEQ applies the NEQ predicate on the "parent_id" field. +func ParentIDNEQ(v uint32) predicate.Organization { + return predicate.Organization(sql.FieldNEQ(FieldParentID, v)) +} + +// ParentIDIn applies the In predicate on the "parent_id" field. +func ParentIDIn(vs ...uint32) predicate.Organization { + return predicate.Organization(sql.FieldIn(FieldParentID, vs...)) +} + +// ParentIDNotIn applies the NotIn predicate on the "parent_id" field. +func ParentIDNotIn(vs ...uint32) predicate.Organization { + return predicate.Organization(sql.FieldNotIn(FieldParentID, vs...)) +} + +// ParentIDIsNil applies the IsNil predicate on the "parent_id" field. +func ParentIDIsNil() predicate.Organization { + return predicate.Organization(sql.FieldIsNull(FieldParentID)) +} + +// ParentIDNotNil applies the NotNil predicate on the "parent_id" field. +func ParentIDNotNil() predicate.Organization { + return predicate.Organization(sql.FieldNotNull(FieldParentID)) +} + +// OrderNoEQ applies the EQ predicate on the "order_no" field. +func OrderNoEQ(v int32) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldOrderNo, v)) +} + +// OrderNoNEQ applies the NEQ predicate on the "order_no" field. +func OrderNoNEQ(v int32) predicate.Organization { + return predicate.Organization(sql.FieldNEQ(FieldOrderNo, v)) +} + +// OrderNoIn applies the In predicate on the "order_no" field. +func OrderNoIn(vs ...int32) predicate.Organization { + return predicate.Organization(sql.FieldIn(FieldOrderNo, vs...)) +} + +// OrderNoNotIn applies the NotIn predicate on the "order_no" field. +func OrderNoNotIn(vs ...int32) predicate.Organization { + return predicate.Organization(sql.FieldNotIn(FieldOrderNo, vs...)) +} + +// OrderNoGT applies the GT predicate on the "order_no" field. +func OrderNoGT(v int32) predicate.Organization { + return predicate.Organization(sql.FieldGT(FieldOrderNo, v)) +} + +// OrderNoGTE applies the GTE predicate on the "order_no" field. +func OrderNoGTE(v int32) predicate.Organization { + return predicate.Organization(sql.FieldGTE(FieldOrderNo, v)) +} + +// OrderNoLT applies the LT predicate on the "order_no" field. +func OrderNoLT(v int32) predicate.Organization { + return predicate.Organization(sql.FieldLT(FieldOrderNo, v)) +} + +// OrderNoLTE applies the LTE predicate on the "order_no" field. +func OrderNoLTE(v int32) predicate.Organization { + return predicate.Organization(sql.FieldLTE(FieldOrderNo, v)) +} + +// OrderNoIsNil applies the IsNil predicate on the "order_no" field. +func OrderNoIsNil() predicate.Organization { + return predicate.Organization(sql.FieldIsNull(FieldOrderNo)) +} + +// OrderNoNotNil applies the NotNil predicate on the "order_no" field. +func OrderNoNotNil() predicate.Organization { + return predicate.Organization(sql.FieldNotNull(FieldOrderNo)) +} + +// HasParent applies the HasEdge predicate on the "parent" edge. +func HasParent() predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, ParentTable, ParentColumn), + ) + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasParentWith applies the HasEdge predicate on the "parent" edge with a given conditions (other predicates). +func HasParentWith(preds ...predicate.Organization) predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := newParentStep() + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasChildren applies the HasEdge predicate on the "children" edge. +func HasChildren() predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, ChildrenTable, ChildrenColumn), + ) + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasChildrenWith applies the HasEdge predicate on the "children" edge with a given conditions (other predicates). +func HasChildrenWith(preds ...predicate.Organization) predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := newChildrenStep() + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.Organization) predicate.Organization { + return predicate.Organization(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.Organization) predicate.Organization { + return predicate.Organization(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.Organization) predicate.Organization { + return predicate.Organization(sql.NotPredicates(p)) +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/organization_create.go b/monolithic/backend/app/admin/service/internal/data/ent/organization_create.go new file mode 100644 index 0000000..eb0a115 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/organization_create.go @@ -0,0 +1,1206 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "errors" + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/organization" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// OrganizationCreate is the builder for creating a Organization entity. +type OrganizationCreate struct { + config + mutation *OrganizationMutation + hooks []Hook + conflict []sql.ConflictOption +} + +// SetCreateTime sets the "create_time" field. +func (oc *OrganizationCreate) SetCreateTime(t time.Time) *OrganizationCreate { + oc.mutation.SetCreateTime(t) + return oc +} + +// SetNillableCreateTime sets the "create_time" field if the given value is not nil. +func (oc *OrganizationCreate) SetNillableCreateTime(t *time.Time) *OrganizationCreate { + if t != nil { + oc.SetCreateTime(*t) + } + return oc +} + +// SetUpdateTime sets the "update_time" field. +func (oc *OrganizationCreate) SetUpdateTime(t time.Time) *OrganizationCreate { + oc.mutation.SetUpdateTime(t) + return oc +} + +// SetNillableUpdateTime sets the "update_time" field if the given value is not nil. +func (oc *OrganizationCreate) SetNillableUpdateTime(t *time.Time) *OrganizationCreate { + if t != nil { + oc.SetUpdateTime(*t) + } + return oc +} + +// SetDeleteTime sets the "delete_time" field. +func (oc *OrganizationCreate) SetDeleteTime(t time.Time) *OrganizationCreate { + oc.mutation.SetDeleteTime(t) + return oc +} + +// SetNillableDeleteTime sets the "delete_time" field if the given value is not nil. +func (oc *OrganizationCreate) SetNillableDeleteTime(t *time.Time) *OrganizationCreate { + if t != nil { + oc.SetDeleteTime(*t) + } + return oc +} + +// SetStatus sets the "status" field. +func (oc *OrganizationCreate) SetStatus(o organization.Status) *OrganizationCreate { + oc.mutation.SetStatus(o) + return oc +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (oc *OrganizationCreate) SetNillableStatus(o *organization.Status) *OrganizationCreate { + if o != nil { + oc.SetStatus(*o) + } + return oc +} + +// SetCreateBy sets the "create_by" field. +func (oc *OrganizationCreate) SetCreateBy(u uint32) *OrganizationCreate { + oc.mutation.SetCreateBy(u) + return oc +} + +// SetNillableCreateBy sets the "create_by" field if the given value is not nil. +func (oc *OrganizationCreate) SetNillableCreateBy(u *uint32) *OrganizationCreate { + if u != nil { + oc.SetCreateBy(*u) + } + return oc +} + +// SetRemark sets the "remark" field. +func (oc *OrganizationCreate) SetRemark(s string) *OrganizationCreate { + oc.mutation.SetRemark(s) + return oc +} + +// SetNillableRemark sets the "remark" field if the given value is not nil. +func (oc *OrganizationCreate) SetNillableRemark(s *string) *OrganizationCreate { + if s != nil { + oc.SetRemark(*s) + } + return oc +} + +// SetName sets the "name" field. +func (oc *OrganizationCreate) SetName(s string) *OrganizationCreate { + oc.mutation.SetName(s) + return oc +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (oc *OrganizationCreate) SetNillableName(s *string) *OrganizationCreate { + if s != nil { + oc.SetName(*s) + } + return oc +} + +// SetParentID sets the "parent_id" field. +func (oc *OrganizationCreate) SetParentID(u uint32) *OrganizationCreate { + oc.mutation.SetParentID(u) + return oc +} + +// SetNillableParentID sets the "parent_id" field if the given value is not nil. +func (oc *OrganizationCreate) SetNillableParentID(u *uint32) *OrganizationCreate { + if u != nil { + oc.SetParentID(*u) + } + return oc +} + +// SetOrderNo sets the "order_no" field. +func (oc *OrganizationCreate) SetOrderNo(i int32) *OrganizationCreate { + oc.mutation.SetOrderNo(i) + return oc +} + +// SetNillableOrderNo sets the "order_no" field if the given value is not nil. +func (oc *OrganizationCreate) SetNillableOrderNo(i *int32) *OrganizationCreate { + if i != nil { + oc.SetOrderNo(*i) + } + return oc +} + +// SetID sets the "id" field. +func (oc *OrganizationCreate) SetID(u uint32) *OrganizationCreate { + oc.mutation.SetID(u) + return oc +} + +// SetParent sets the "parent" edge to the Organization entity. +func (oc *OrganizationCreate) SetParent(o *Organization) *OrganizationCreate { + return oc.SetParentID(o.ID) +} + +// AddChildIDs adds the "children" edge to the Organization entity by IDs. +func (oc *OrganizationCreate) AddChildIDs(ids ...uint32) *OrganizationCreate { + oc.mutation.AddChildIDs(ids...) + return oc +} + +// AddChildren adds the "children" edges to the Organization entity. +func (oc *OrganizationCreate) AddChildren(o ...*Organization) *OrganizationCreate { + ids := make([]uint32, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return oc.AddChildIDs(ids...) +} + +// Mutation returns the OrganizationMutation object of the builder. +func (oc *OrganizationCreate) Mutation() *OrganizationMutation { + return oc.mutation +} + +// Save creates the Organization in the database. +func (oc *OrganizationCreate) Save(ctx context.Context) (*Organization, error) { + oc.defaults() + return withHooks(ctx, oc.sqlSave, oc.mutation, oc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (oc *OrganizationCreate) SaveX(ctx context.Context) *Organization { + v, err := oc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (oc *OrganizationCreate) Exec(ctx context.Context) error { + _, err := oc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (oc *OrganizationCreate) ExecX(ctx context.Context) { + if err := oc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (oc *OrganizationCreate) defaults() { + if _, ok := oc.mutation.Status(); !ok { + v := organization.DefaultStatus + oc.mutation.SetStatus(v) + } + if _, ok := oc.mutation.Remark(); !ok { + v := organization.DefaultRemark + oc.mutation.SetRemark(v) + } + if _, ok := oc.mutation.Name(); !ok { + v := organization.DefaultName + oc.mutation.SetName(v) + } + if _, ok := oc.mutation.OrderNo(); !ok { + v := organization.DefaultOrderNo + oc.mutation.SetOrderNo(v) + } +} + +// check runs all checks and user-defined validators on the builder. +func (oc *OrganizationCreate) check() error { + if v, ok := oc.mutation.Status(); ok { + if err := organization.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "Organization.status": %w`, err)} + } + } + if v, ok := oc.mutation.Name(); ok { + if err := organization.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "Organization.name": %w`, err)} + } + } + if v, ok := oc.mutation.ID(); ok { + if err := organization.IDValidator(v); err != nil { + return &ValidationError{Name: "id", err: fmt.Errorf(`ent: validator failed for field "Organization.id": %w`, err)} + } + } + return nil +} + +func (oc *OrganizationCreate) sqlSave(ctx context.Context) (*Organization, error) { + if err := oc.check(); err != nil { + return nil, err + } + _node, _spec := oc.createSpec() + if err := sqlgraph.CreateNode(ctx, oc.driver, _spec); err != nil { + if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + if _spec.ID.Value != _node.ID { + id := _spec.ID.Value.(int64) + _node.ID = uint32(id) + } + oc.mutation.id = &_node.ID + oc.mutation.done = true + return _node, nil +} + +func (oc *OrganizationCreate) createSpec() (*Organization, *sqlgraph.CreateSpec) { + var ( + _node = &Organization{config: oc.config} + _spec = sqlgraph.NewCreateSpec(organization.Table, sqlgraph.NewFieldSpec(organization.FieldID, field.TypeUint32)) + ) + _spec.OnConflict = oc.conflict + if id, ok := oc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := oc.mutation.CreateTime(); ok { + _spec.SetField(organization.FieldCreateTime, field.TypeTime, value) + _node.CreateTime = &value + } + if value, ok := oc.mutation.UpdateTime(); ok { + _spec.SetField(organization.FieldUpdateTime, field.TypeTime, value) + _node.UpdateTime = &value + } + if value, ok := oc.mutation.DeleteTime(); ok { + _spec.SetField(organization.FieldDeleteTime, field.TypeTime, value) + _node.DeleteTime = &value + } + if value, ok := oc.mutation.Status(); ok { + _spec.SetField(organization.FieldStatus, field.TypeEnum, value) + _node.Status = &value + } + if value, ok := oc.mutation.CreateBy(); ok { + _spec.SetField(organization.FieldCreateBy, field.TypeUint32, value) + _node.CreateBy = &value + } + if value, ok := oc.mutation.Remark(); ok { + _spec.SetField(organization.FieldRemark, field.TypeString, value) + _node.Remark = &value + } + if value, ok := oc.mutation.Name(); ok { + _spec.SetField(organization.FieldName, field.TypeString, value) + _node.Name = &value + } + if value, ok := oc.mutation.OrderNo(); ok { + _spec.SetField(organization.FieldOrderNo, field.TypeInt32, value) + _node.OrderNo = &value + } + if nodes := oc.mutation.ParentIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: organization.ParentTable, + Columns: []string{organization.ParentColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeUint32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.ParentID = &nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := oc.mutation.ChildrenIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.ChildrenTable, + Columns: []string{organization.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeUint32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause +// of the `INSERT` statement. For example: +// +// client.Organization.Create(). +// SetCreateTime(v). +// OnConflict( +// // Update the row with the new values +// // the was proposed for insertion. +// sql.ResolveWithNewValues(), +// ). +// // Override some of the fields with custom +// // update values. +// Update(func(u *ent.OrganizationUpsert) { +// SetCreateTime(v+v). +// }). +// Exec(ctx) +func (oc *OrganizationCreate) OnConflict(opts ...sql.ConflictOption) *OrganizationUpsertOne { + oc.conflict = opts + return &OrganizationUpsertOne{ + create: oc, + } +} + +// OnConflictColumns calls `OnConflict` and configures the columns +// as conflict target. Using this option is equivalent to using: +// +// client.Organization.Create(). +// OnConflict(sql.ConflictColumns(columns...)). +// Exec(ctx) +func (oc *OrganizationCreate) OnConflictColumns(columns ...string) *OrganizationUpsertOne { + oc.conflict = append(oc.conflict, sql.ConflictColumns(columns...)) + return &OrganizationUpsertOne{ + create: oc, + } +} + +type ( + // OrganizationUpsertOne is the builder for "upsert"-ing + // one Organization node. + OrganizationUpsertOne struct { + create *OrganizationCreate + } + + // OrganizationUpsert is the "OnConflict" setter. + OrganizationUpsert struct { + *sql.UpdateSet + } +) + +// SetUpdateTime sets the "update_time" field. +func (u *OrganizationUpsert) SetUpdateTime(v time.Time) *OrganizationUpsert { + u.Set(organization.FieldUpdateTime, v) + return u +} + +// UpdateUpdateTime sets the "update_time" field to the value that was provided on create. +func (u *OrganizationUpsert) UpdateUpdateTime() *OrganizationUpsert { + u.SetExcluded(organization.FieldUpdateTime) + return u +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (u *OrganizationUpsert) ClearUpdateTime() *OrganizationUpsert { + u.SetNull(organization.FieldUpdateTime) + return u +} + +// SetDeleteTime sets the "delete_time" field. +func (u *OrganizationUpsert) SetDeleteTime(v time.Time) *OrganizationUpsert { + u.Set(organization.FieldDeleteTime, v) + return u +} + +// UpdateDeleteTime sets the "delete_time" field to the value that was provided on create. +func (u *OrganizationUpsert) UpdateDeleteTime() *OrganizationUpsert { + u.SetExcluded(organization.FieldDeleteTime) + return u +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (u *OrganizationUpsert) ClearDeleteTime() *OrganizationUpsert { + u.SetNull(organization.FieldDeleteTime) + return u +} + +// SetStatus sets the "status" field. +func (u *OrganizationUpsert) SetStatus(v organization.Status) *OrganizationUpsert { + u.Set(organization.FieldStatus, v) + return u +} + +// UpdateStatus sets the "status" field to the value that was provided on create. +func (u *OrganizationUpsert) UpdateStatus() *OrganizationUpsert { + u.SetExcluded(organization.FieldStatus) + return u +} + +// ClearStatus clears the value of the "status" field. +func (u *OrganizationUpsert) ClearStatus() *OrganizationUpsert { + u.SetNull(organization.FieldStatus) + return u +} + +// SetCreateBy sets the "create_by" field. +func (u *OrganizationUpsert) SetCreateBy(v uint32) *OrganizationUpsert { + u.Set(organization.FieldCreateBy, v) + return u +} + +// UpdateCreateBy sets the "create_by" field to the value that was provided on create. +func (u *OrganizationUpsert) UpdateCreateBy() *OrganizationUpsert { + u.SetExcluded(organization.FieldCreateBy) + return u +} + +// AddCreateBy adds v to the "create_by" field. +func (u *OrganizationUpsert) AddCreateBy(v uint32) *OrganizationUpsert { + u.Add(organization.FieldCreateBy, v) + return u +} + +// ClearCreateBy clears the value of the "create_by" field. +func (u *OrganizationUpsert) ClearCreateBy() *OrganizationUpsert { + u.SetNull(organization.FieldCreateBy) + return u +} + +// SetRemark sets the "remark" field. +func (u *OrganizationUpsert) SetRemark(v string) *OrganizationUpsert { + u.Set(organization.FieldRemark, v) + return u +} + +// UpdateRemark sets the "remark" field to the value that was provided on create. +func (u *OrganizationUpsert) UpdateRemark() *OrganizationUpsert { + u.SetExcluded(organization.FieldRemark) + return u +} + +// ClearRemark clears the value of the "remark" field. +func (u *OrganizationUpsert) ClearRemark() *OrganizationUpsert { + u.SetNull(organization.FieldRemark) + return u +} + +// SetName sets the "name" field. +func (u *OrganizationUpsert) SetName(v string) *OrganizationUpsert { + u.Set(organization.FieldName, v) + return u +} + +// UpdateName sets the "name" field to the value that was provided on create. +func (u *OrganizationUpsert) UpdateName() *OrganizationUpsert { + u.SetExcluded(organization.FieldName) + return u +} + +// ClearName clears the value of the "name" field. +func (u *OrganizationUpsert) ClearName() *OrganizationUpsert { + u.SetNull(organization.FieldName) + return u +} + +// SetParentID sets the "parent_id" field. +func (u *OrganizationUpsert) SetParentID(v uint32) *OrganizationUpsert { + u.Set(organization.FieldParentID, v) + return u +} + +// UpdateParentID sets the "parent_id" field to the value that was provided on create. +func (u *OrganizationUpsert) UpdateParentID() *OrganizationUpsert { + u.SetExcluded(organization.FieldParentID) + return u +} + +// ClearParentID clears the value of the "parent_id" field. +func (u *OrganizationUpsert) ClearParentID() *OrganizationUpsert { + u.SetNull(organization.FieldParentID) + return u +} + +// SetOrderNo sets the "order_no" field. +func (u *OrganizationUpsert) SetOrderNo(v int32) *OrganizationUpsert { + u.Set(organization.FieldOrderNo, v) + return u +} + +// UpdateOrderNo sets the "order_no" field to the value that was provided on create. +func (u *OrganizationUpsert) UpdateOrderNo() *OrganizationUpsert { + u.SetExcluded(organization.FieldOrderNo) + return u +} + +// AddOrderNo adds v to the "order_no" field. +func (u *OrganizationUpsert) AddOrderNo(v int32) *OrganizationUpsert { + u.Add(organization.FieldOrderNo, v) + return u +} + +// ClearOrderNo clears the value of the "order_no" field. +func (u *OrganizationUpsert) ClearOrderNo() *OrganizationUpsert { + u.SetNull(organization.FieldOrderNo) + return u +} + +// UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. +// Using this option is equivalent to using: +// +// client.Organization.Create(). +// OnConflict( +// sql.ResolveWithNewValues(), +// sql.ResolveWith(func(u *sql.UpdateSet) { +// u.SetIgnore(organization.FieldID) +// }), +// ). +// Exec(ctx) +func (u *OrganizationUpsertOne) UpdateNewValues() *OrganizationUpsertOne { + u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues()) + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) { + if _, exists := u.create.mutation.ID(); exists { + s.SetIgnore(organization.FieldID) + } + if _, exists := u.create.mutation.CreateTime(); exists { + s.SetIgnore(organization.FieldCreateTime) + } + })) + return u +} + +// Ignore sets each column to itself in case of conflict. +// Using this option is equivalent to using: +// +// client.Organization.Create(). +// OnConflict(sql.ResolveWithIgnore()). +// Exec(ctx) +func (u *OrganizationUpsertOne) Ignore() *OrganizationUpsertOne { + u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore()) + return u +} + +// DoNothing configures the conflict_action to `DO NOTHING`. +// Supported only by SQLite and PostgreSQL. +func (u *OrganizationUpsertOne) DoNothing() *OrganizationUpsertOne { + u.create.conflict = append(u.create.conflict, sql.DoNothing()) + return u +} + +// Update allows overriding fields `UPDATE` values. See the OrganizationCreate.OnConflict +// documentation for more info. +func (u *OrganizationUpsertOne) Update(set func(*OrganizationUpsert)) *OrganizationUpsertOne { + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) { + set(&OrganizationUpsert{UpdateSet: update}) + })) + return u +} + +// SetUpdateTime sets the "update_time" field. +func (u *OrganizationUpsertOne) SetUpdateTime(v time.Time) *OrganizationUpsertOne { + return u.Update(func(s *OrganizationUpsert) { + s.SetUpdateTime(v) + }) +} + +// UpdateUpdateTime sets the "update_time" field to the value that was provided on create. +func (u *OrganizationUpsertOne) UpdateUpdateTime() *OrganizationUpsertOne { + return u.Update(func(s *OrganizationUpsert) { + s.UpdateUpdateTime() + }) +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (u *OrganizationUpsertOne) ClearUpdateTime() *OrganizationUpsertOne { + return u.Update(func(s *OrganizationUpsert) { + s.ClearUpdateTime() + }) +} + +// SetDeleteTime sets the "delete_time" field. +func (u *OrganizationUpsertOne) SetDeleteTime(v time.Time) *OrganizationUpsertOne { + return u.Update(func(s *OrganizationUpsert) { + s.SetDeleteTime(v) + }) +} + +// UpdateDeleteTime sets the "delete_time" field to the value that was provided on create. +func (u *OrganizationUpsertOne) UpdateDeleteTime() *OrganizationUpsertOne { + return u.Update(func(s *OrganizationUpsert) { + s.UpdateDeleteTime() + }) +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (u *OrganizationUpsertOne) ClearDeleteTime() *OrganizationUpsertOne { + return u.Update(func(s *OrganizationUpsert) { + s.ClearDeleteTime() + }) +} + +// SetStatus sets the "status" field. +func (u *OrganizationUpsertOne) SetStatus(v organization.Status) *OrganizationUpsertOne { + return u.Update(func(s *OrganizationUpsert) { + s.SetStatus(v) + }) +} + +// UpdateStatus sets the "status" field to the value that was provided on create. +func (u *OrganizationUpsertOne) UpdateStatus() *OrganizationUpsertOne { + return u.Update(func(s *OrganizationUpsert) { + s.UpdateStatus() + }) +} + +// ClearStatus clears the value of the "status" field. +func (u *OrganizationUpsertOne) ClearStatus() *OrganizationUpsertOne { + return u.Update(func(s *OrganizationUpsert) { + s.ClearStatus() + }) +} + +// SetCreateBy sets the "create_by" field. +func (u *OrganizationUpsertOne) SetCreateBy(v uint32) *OrganizationUpsertOne { + return u.Update(func(s *OrganizationUpsert) { + s.SetCreateBy(v) + }) +} + +// AddCreateBy adds v to the "create_by" field. +func (u *OrganizationUpsertOne) AddCreateBy(v uint32) *OrganizationUpsertOne { + return u.Update(func(s *OrganizationUpsert) { + s.AddCreateBy(v) + }) +} + +// UpdateCreateBy sets the "create_by" field to the value that was provided on create. +func (u *OrganizationUpsertOne) UpdateCreateBy() *OrganizationUpsertOne { + return u.Update(func(s *OrganizationUpsert) { + s.UpdateCreateBy() + }) +} + +// ClearCreateBy clears the value of the "create_by" field. +func (u *OrganizationUpsertOne) ClearCreateBy() *OrganizationUpsertOne { + return u.Update(func(s *OrganizationUpsert) { + s.ClearCreateBy() + }) +} + +// SetRemark sets the "remark" field. +func (u *OrganizationUpsertOne) SetRemark(v string) *OrganizationUpsertOne { + return u.Update(func(s *OrganizationUpsert) { + s.SetRemark(v) + }) +} + +// UpdateRemark sets the "remark" field to the value that was provided on create. +func (u *OrganizationUpsertOne) UpdateRemark() *OrganizationUpsertOne { + return u.Update(func(s *OrganizationUpsert) { + s.UpdateRemark() + }) +} + +// ClearRemark clears the value of the "remark" field. +func (u *OrganizationUpsertOne) ClearRemark() *OrganizationUpsertOne { + return u.Update(func(s *OrganizationUpsert) { + s.ClearRemark() + }) +} + +// SetName sets the "name" field. +func (u *OrganizationUpsertOne) SetName(v string) *OrganizationUpsertOne { + return u.Update(func(s *OrganizationUpsert) { + s.SetName(v) + }) +} + +// UpdateName sets the "name" field to the value that was provided on create. +func (u *OrganizationUpsertOne) UpdateName() *OrganizationUpsertOne { + return u.Update(func(s *OrganizationUpsert) { + s.UpdateName() + }) +} + +// ClearName clears the value of the "name" field. +func (u *OrganizationUpsertOne) ClearName() *OrganizationUpsertOne { + return u.Update(func(s *OrganizationUpsert) { + s.ClearName() + }) +} + +// SetParentID sets the "parent_id" field. +func (u *OrganizationUpsertOne) SetParentID(v uint32) *OrganizationUpsertOne { + return u.Update(func(s *OrganizationUpsert) { + s.SetParentID(v) + }) +} + +// UpdateParentID sets the "parent_id" field to the value that was provided on create. +func (u *OrganizationUpsertOne) UpdateParentID() *OrganizationUpsertOne { + return u.Update(func(s *OrganizationUpsert) { + s.UpdateParentID() + }) +} + +// ClearParentID clears the value of the "parent_id" field. +func (u *OrganizationUpsertOne) ClearParentID() *OrganizationUpsertOne { + return u.Update(func(s *OrganizationUpsert) { + s.ClearParentID() + }) +} + +// SetOrderNo sets the "order_no" field. +func (u *OrganizationUpsertOne) SetOrderNo(v int32) *OrganizationUpsertOne { + return u.Update(func(s *OrganizationUpsert) { + s.SetOrderNo(v) + }) +} + +// AddOrderNo adds v to the "order_no" field. +func (u *OrganizationUpsertOne) AddOrderNo(v int32) *OrganizationUpsertOne { + return u.Update(func(s *OrganizationUpsert) { + s.AddOrderNo(v) + }) +} + +// UpdateOrderNo sets the "order_no" field to the value that was provided on create. +func (u *OrganizationUpsertOne) UpdateOrderNo() *OrganizationUpsertOne { + return u.Update(func(s *OrganizationUpsert) { + s.UpdateOrderNo() + }) +} + +// ClearOrderNo clears the value of the "order_no" field. +func (u *OrganizationUpsertOne) ClearOrderNo() *OrganizationUpsertOne { + return u.Update(func(s *OrganizationUpsert) { + s.ClearOrderNo() + }) +} + +// Exec executes the query. +func (u *OrganizationUpsertOne) Exec(ctx context.Context) error { + if len(u.create.conflict) == 0 { + return errors.New("ent: missing options for OrganizationCreate.OnConflict") + } + return u.create.Exec(ctx) +} + +// ExecX is like Exec, but panics if an error occurs. +func (u *OrganizationUpsertOne) ExecX(ctx context.Context) { + if err := u.create.Exec(ctx); err != nil { + panic(err) + } +} + +// Exec executes the UPSERT query and returns the inserted/updated ID. +func (u *OrganizationUpsertOne) ID(ctx context.Context) (id uint32, err error) { + node, err := u.create.Save(ctx) + if err != nil { + return id, err + } + return node.ID, nil +} + +// IDX is like ID, but panics if an error occurs. +func (u *OrganizationUpsertOne) IDX(ctx context.Context) uint32 { + id, err := u.ID(ctx) + if err != nil { + panic(err) + } + return id +} + +// OrganizationCreateBulk is the builder for creating many Organization entities in bulk. +type OrganizationCreateBulk struct { + config + err error + builders []*OrganizationCreate + conflict []sql.ConflictOption +} + +// Save creates the Organization entities in the database. +func (ocb *OrganizationCreateBulk) Save(ctx context.Context) ([]*Organization, error) { + if ocb.err != nil { + return nil, ocb.err + } + specs := make([]*sqlgraph.CreateSpec, len(ocb.builders)) + nodes := make([]*Organization, len(ocb.builders)) + mutators := make([]Mutator, len(ocb.builders)) + for i := range ocb.builders { + func(i int, root context.Context) { + builder := ocb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*OrganizationMutation) + if !ok { + return nil, fmt.Errorf("unexpected mutation type %T", m) + } + if err := builder.check(); err != nil { + return nil, err + } + builder.mutation = mutation + var err error + nodes[i], specs[i] = builder.createSpec() + if i < len(mutators)-1 { + _, err = mutators[i+1].Mutate(root, ocb.builders[i+1].mutation) + } else { + spec := &sqlgraph.BatchCreateSpec{Nodes: specs} + spec.OnConflict = ocb.conflict + // Invoke the actual operation on the latest mutation in the chain. + if err = sqlgraph.BatchCreate(ctx, ocb.driver, spec); err != nil { + if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + } + } + if err != nil { + return nil, err + } + mutation.id = &nodes[i].ID + if specs[i].ID.Value != nil && nodes[i].ID == 0 { + id := specs[i].ID.Value.(int64) + nodes[i].ID = uint32(id) + } + mutation.done = true + return nodes[i], nil + }) + for i := len(builder.hooks) - 1; i >= 0; i-- { + mut = builder.hooks[i](mut) + } + mutators[i] = mut + }(i, ctx) + } + if len(mutators) > 0 { + if _, err := mutators[0].Mutate(ctx, ocb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (ocb *OrganizationCreateBulk) SaveX(ctx context.Context) []*Organization { + v, err := ocb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ocb *OrganizationCreateBulk) Exec(ctx context.Context) error { + _, err := ocb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ocb *OrganizationCreateBulk) ExecX(ctx context.Context) { + if err := ocb.Exec(ctx); err != nil { + panic(err) + } +} + +// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause +// of the `INSERT` statement. For example: +// +// client.Organization.CreateBulk(builders...). +// OnConflict( +// // Update the row with the new values +// // the was proposed for insertion. +// sql.ResolveWithNewValues(), +// ). +// // Override some of the fields with custom +// // update values. +// Update(func(u *ent.OrganizationUpsert) { +// SetCreateTime(v+v). +// }). +// Exec(ctx) +func (ocb *OrganizationCreateBulk) OnConflict(opts ...sql.ConflictOption) *OrganizationUpsertBulk { + ocb.conflict = opts + return &OrganizationUpsertBulk{ + create: ocb, + } +} + +// OnConflictColumns calls `OnConflict` and configures the columns +// as conflict target. Using this option is equivalent to using: +// +// client.Organization.Create(). +// OnConflict(sql.ConflictColumns(columns...)). +// Exec(ctx) +func (ocb *OrganizationCreateBulk) OnConflictColumns(columns ...string) *OrganizationUpsertBulk { + ocb.conflict = append(ocb.conflict, sql.ConflictColumns(columns...)) + return &OrganizationUpsertBulk{ + create: ocb, + } +} + +// OrganizationUpsertBulk is the builder for "upsert"-ing +// a bulk of Organization nodes. +type OrganizationUpsertBulk struct { + create *OrganizationCreateBulk +} + +// UpdateNewValues updates the mutable fields using the new values that +// were set on create. Using this option is equivalent to using: +// +// client.Organization.Create(). +// OnConflict( +// sql.ResolveWithNewValues(), +// sql.ResolveWith(func(u *sql.UpdateSet) { +// u.SetIgnore(organization.FieldID) +// }), +// ). +// Exec(ctx) +func (u *OrganizationUpsertBulk) UpdateNewValues() *OrganizationUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues()) + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) { + for _, b := range u.create.builders { + if _, exists := b.mutation.ID(); exists { + s.SetIgnore(organization.FieldID) + } + if _, exists := b.mutation.CreateTime(); exists { + s.SetIgnore(organization.FieldCreateTime) + } + } + })) + return u +} + +// Ignore sets each column to itself in case of conflict. +// Using this option is equivalent to using: +// +// client.Organization.Create(). +// OnConflict(sql.ResolveWithIgnore()). +// Exec(ctx) +func (u *OrganizationUpsertBulk) Ignore() *OrganizationUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore()) + return u +} + +// DoNothing configures the conflict_action to `DO NOTHING`. +// Supported only by SQLite and PostgreSQL. +func (u *OrganizationUpsertBulk) DoNothing() *OrganizationUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.DoNothing()) + return u +} + +// Update allows overriding fields `UPDATE` values. See the OrganizationCreateBulk.OnConflict +// documentation for more info. +func (u *OrganizationUpsertBulk) Update(set func(*OrganizationUpsert)) *OrganizationUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) { + set(&OrganizationUpsert{UpdateSet: update}) + })) + return u +} + +// SetUpdateTime sets the "update_time" field. +func (u *OrganizationUpsertBulk) SetUpdateTime(v time.Time) *OrganizationUpsertBulk { + return u.Update(func(s *OrganizationUpsert) { + s.SetUpdateTime(v) + }) +} + +// UpdateUpdateTime sets the "update_time" field to the value that was provided on create. +func (u *OrganizationUpsertBulk) UpdateUpdateTime() *OrganizationUpsertBulk { + return u.Update(func(s *OrganizationUpsert) { + s.UpdateUpdateTime() + }) +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (u *OrganizationUpsertBulk) ClearUpdateTime() *OrganizationUpsertBulk { + return u.Update(func(s *OrganizationUpsert) { + s.ClearUpdateTime() + }) +} + +// SetDeleteTime sets the "delete_time" field. +func (u *OrganizationUpsertBulk) SetDeleteTime(v time.Time) *OrganizationUpsertBulk { + return u.Update(func(s *OrganizationUpsert) { + s.SetDeleteTime(v) + }) +} + +// UpdateDeleteTime sets the "delete_time" field to the value that was provided on create. +func (u *OrganizationUpsertBulk) UpdateDeleteTime() *OrganizationUpsertBulk { + return u.Update(func(s *OrganizationUpsert) { + s.UpdateDeleteTime() + }) +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (u *OrganizationUpsertBulk) ClearDeleteTime() *OrganizationUpsertBulk { + return u.Update(func(s *OrganizationUpsert) { + s.ClearDeleteTime() + }) +} + +// SetStatus sets the "status" field. +func (u *OrganizationUpsertBulk) SetStatus(v organization.Status) *OrganizationUpsertBulk { + return u.Update(func(s *OrganizationUpsert) { + s.SetStatus(v) + }) +} + +// UpdateStatus sets the "status" field to the value that was provided on create. +func (u *OrganizationUpsertBulk) UpdateStatus() *OrganizationUpsertBulk { + return u.Update(func(s *OrganizationUpsert) { + s.UpdateStatus() + }) +} + +// ClearStatus clears the value of the "status" field. +func (u *OrganizationUpsertBulk) ClearStatus() *OrganizationUpsertBulk { + return u.Update(func(s *OrganizationUpsert) { + s.ClearStatus() + }) +} + +// SetCreateBy sets the "create_by" field. +func (u *OrganizationUpsertBulk) SetCreateBy(v uint32) *OrganizationUpsertBulk { + return u.Update(func(s *OrganizationUpsert) { + s.SetCreateBy(v) + }) +} + +// AddCreateBy adds v to the "create_by" field. +func (u *OrganizationUpsertBulk) AddCreateBy(v uint32) *OrganizationUpsertBulk { + return u.Update(func(s *OrganizationUpsert) { + s.AddCreateBy(v) + }) +} + +// UpdateCreateBy sets the "create_by" field to the value that was provided on create. +func (u *OrganizationUpsertBulk) UpdateCreateBy() *OrganizationUpsertBulk { + return u.Update(func(s *OrganizationUpsert) { + s.UpdateCreateBy() + }) +} + +// ClearCreateBy clears the value of the "create_by" field. +func (u *OrganizationUpsertBulk) ClearCreateBy() *OrganizationUpsertBulk { + return u.Update(func(s *OrganizationUpsert) { + s.ClearCreateBy() + }) +} + +// SetRemark sets the "remark" field. +func (u *OrganizationUpsertBulk) SetRemark(v string) *OrganizationUpsertBulk { + return u.Update(func(s *OrganizationUpsert) { + s.SetRemark(v) + }) +} + +// UpdateRemark sets the "remark" field to the value that was provided on create. +func (u *OrganizationUpsertBulk) UpdateRemark() *OrganizationUpsertBulk { + return u.Update(func(s *OrganizationUpsert) { + s.UpdateRemark() + }) +} + +// ClearRemark clears the value of the "remark" field. +func (u *OrganizationUpsertBulk) ClearRemark() *OrganizationUpsertBulk { + return u.Update(func(s *OrganizationUpsert) { + s.ClearRemark() + }) +} + +// SetName sets the "name" field. +func (u *OrganizationUpsertBulk) SetName(v string) *OrganizationUpsertBulk { + return u.Update(func(s *OrganizationUpsert) { + s.SetName(v) + }) +} + +// UpdateName sets the "name" field to the value that was provided on create. +func (u *OrganizationUpsertBulk) UpdateName() *OrganizationUpsertBulk { + return u.Update(func(s *OrganizationUpsert) { + s.UpdateName() + }) +} + +// ClearName clears the value of the "name" field. +func (u *OrganizationUpsertBulk) ClearName() *OrganizationUpsertBulk { + return u.Update(func(s *OrganizationUpsert) { + s.ClearName() + }) +} + +// SetParentID sets the "parent_id" field. +func (u *OrganizationUpsertBulk) SetParentID(v uint32) *OrganizationUpsertBulk { + return u.Update(func(s *OrganizationUpsert) { + s.SetParentID(v) + }) +} + +// UpdateParentID sets the "parent_id" field to the value that was provided on create. +func (u *OrganizationUpsertBulk) UpdateParentID() *OrganizationUpsertBulk { + return u.Update(func(s *OrganizationUpsert) { + s.UpdateParentID() + }) +} + +// ClearParentID clears the value of the "parent_id" field. +func (u *OrganizationUpsertBulk) ClearParentID() *OrganizationUpsertBulk { + return u.Update(func(s *OrganizationUpsert) { + s.ClearParentID() + }) +} + +// SetOrderNo sets the "order_no" field. +func (u *OrganizationUpsertBulk) SetOrderNo(v int32) *OrganizationUpsertBulk { + return u.Update(func(s *OrganizationUpsert) { + s.SetOrderNo(v) + }) +} + +// AddOrderNo adds v to the "order_no" field. +func (u *OrganizationUpsertBulk) AddOrderNo(v int32) *OrganizationUpsertBulk { + return u.Update(func(s *OrganizationUpsert) { + s.AddOrderNo(v) + }) +} + +// UpdateOrderNo sets the "order_no" field to the value that was provided on create. +func (u *OrganizationUpsertBulk) UpdateOrderNo() *OrganizationUpsertBulk { + return u.Update(func(s *OrganizationUpsert) { + s.UpdateOrderNo() + }) +} + +// ClearOrderNo clears the value of the "order_no" field. +func (u *OrganizationUpsertBulk) ClearOrderNo() *OrganizationUpsertBulk { + return u.Update(func(s *OrganizationUpsert) { + s.ClearOrderNo() + }) +} + +// Exec executes the query. +func (u *OrganizationUpsertBulk) Exec(ctx context.Context) error { + if u.create.err != nil { + return u.create.err + } + for i, b := range u.create.builders { + if len(b.conflict) != 0 { + return fmt.Errorf("ent: OnConflict was set for builder %d. Set it on the OrganizationCreateBulk instead", i) + } + } + if len(u.create.conflict) == 0 { + return errors.New("ent: missing options for OrganizationCreateBulk.OnConflict") + } + return u.create.Exec(ctx) +} + +// ExecX is like Exec, but panics if an error occurs. +func (u *OrganizationUpsertBulk) ExecX(ctx context.Context) { + if err := u.create.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/organization_delete.go b/monolithic/backend/app/admin/service/internal/data/ent/organization_delete.go new file mode 100644 index 0000000..d0e7f20 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/organization_delete.go @@ -0,0 +1,88 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/organization" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// OrganizationDelete is the builder for deleting a Organization entity. +type OrganizationDelete struct { + config + hooks []Hook + mutation *OrganizationMutation +} + +// Where appends a list predicates to the OrganizationDelete builder. +func (od *OrganizationDelete) Where(ps ...predicate.Organization) *OrganizationDelete { + od.mutation.Where(ps...) + return od +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (od *OrganizationDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, od.sqlExec, od.mutation, od.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (od *OrganizationDelete) ExecX(ctx context.Context) int { + n, err := od.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (od *OrganizationDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(organization.Table, sqlgraph.NewFieldSpec(organization.FieldID, field.TypeUint32)) + if ps := od.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, od.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + od.mutation.done = true + return affected, err +} + +// OrganizationDeleteOne is the builder for deleting a single Organization entity. +type OrganizationDeleteOne struct { + od *OrganizationDelete +} + +// Where appends a list predicates to the OrganizationDelete builder. +func (odo *OrganizationDeleteOne) Where(ps ...predicate.Organization) *OrganizationDeleteOne { + odo.od.mutation.Where(ps...) + return odo +} + +// Exec executes the deletion query. +func (odo *OrganizationDeleteOne) Exec(ctx context.Context) error { + n, err := odo.od.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{organization.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (odo *OrganizationDeleteOne) ExecX(ctx context.Context) { + if err := odo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/organization_query.go b/monolithic/backend/app/admin/service/internal/data/ent/organization_query.go new file mode 100644 index 0000000..fc30c8e --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/organization_query.go @@ -0,0 +1,706 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "database/sql/driver" + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/organization" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + "math" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// OrganizationQuery is the builder for querying Organization entities. +type OrganizationQuery struct { + config + ctx *QueryContext + order []organization.OrderOption + inters []Interceptor + predicates []predicate.Organization + withParent *OrganizationQuery + withChildren *OrganizationQuery + modifiers []func(*sql.Selector) + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the OrganizationQuery builder. +func (oq *OrganizationQuery) Where(ps ...predicate.Organization) *OrganizationQuery { + oq.predicates = append(oq.predicates, ps...) + return oq +} + +// Limit the number of records to be returned by this query. +func (oq *OrganizationQuery) Limit(limit int) *OrganizationQuery { + oq.ctx.Limit = &limit + return oq +} + +// Offset to start from. +func (oq *OrganizationQuery) Offset(offset int) *OrganizationQuery { + oq.ctx.Offset = &offset + return oq +} + +// Unique configures the query builder to filter duplicate records on query. +// By default, unique is set to true, and can be disabled using this method. +func (oq *OrganizationQuery) Unique(unique bool) *OrganizationQuery { + oq.ctx.Unique = &unique + return oq +} + +// Order specifies how the records should be ordered. +func (oq *OrganizationQuery) Order(o ...organization.OrderOption) *OrganizationQuery { + oq.order = append(oq.order, o...) + return oq +} + +// QueryParent chains the current query on the "parent" edge. +func (oq *OrganizationQuery) QueryParent() *OrganizationQuery { + query := (&OrganizationClient{config: oq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, organization.ParentTable, organization.ParentColumn), + ) + fromU = sqlgraph.SetNeighbors(oq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryChildren chains the current query on the "children" edge. +func (oq *OrganizationQuery) QueryChildren() *OrganizationQuery { + query := (&OrganizationClient{config: oq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.ChildrenTable, organization.ChildrenColumn), + ) + fromU = sqlgraph.SetNeighbors(oq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first Organization entity from the query. +// Returns a *NotFoundError when no Organization was found. +func (oq *OrganizationQuery) First(ctx context.Context) (*Organization, error) { + nodes, err := oq.Limit(1).All(setContextOp(ctx, oq.ctx, "First")) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{organization.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (oq *OrganizationQuery) FirstX(ctx context.Context) *Organization { + node, err := oq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first Organization ID from the query. +// Returns a *NotFoundError when no Organization ID was found. +func (oq *OrganizationQuery) FirstID(ctx context.Context) (id uint32, err error) { + var ids []uint32 + if ids, err = oq.Limit(1).IDs(setContextOp(ctx, oq.ctx, "FirstID")); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{organization.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (oq *OrganizationQuery) FirstIDX(ctx context.Context) uint32 { + id, err := oq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single Organization entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one Organization entity is found. +// Returns a *NotFoundError when no Organization entities are found. +func (oq *OrganizationQuery) Only(ctx context.Context) (*Organization, error) { + nodes, err := oq.Limit(2).All(setContextOp(ctx, oq.ctx, "Only")) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{organization.Label} + default: + return nil, &NotSingularError{organization.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (oq *OrganizationQuery) OnlyX(ctx context.Context) *Organization { + node, err := oq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only Organization ID in the query. +// Returns a *NotSingularError when more than one Organization ID is found. +// Returns a *NotFoundError when no entities are found. +func (oq *OrganizationQuery) OnlyID(ctx context.Context) (id uint32, err error) { + var ids []uint32 + if ids, err = oq.Limit(2).IDs(setContextOp(ctx, oq.ctx, "OnlyID")); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{organization.Label} + default: + err = &NotSingularError{organization.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (oq *OrganizationQuery) OnlyIDX(ctx context.Context) uint32 { + id, err := oq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of Organizations. +func (oq *OrganizationQuery) All(ctx context.Context) ([]*Organization, error) { + ctx = setContextOp(ctx, oq.ctx, "All") + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*Organization, *OrganizationQuery]() + return withInterceptors[[]*Organization](ctx, oq, qr, oq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (oq *OrganizationQuery) AllX(ctx context.Context) []*Organization { + nodes, err := oq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of Organization IDs. +func (oq *OrganizationQuery) IDs(ctx context.Context) (ids []uint32, err error) { + if oq.ctx.Unique == nil && oq.path != nil { + oq.Unique(true) + } + ctx = setContextOp(ctx, oq.ctx, "IDs") + if err = oq.Select(organization.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (oq *OrganizationQuery) IDsX(ctx context.Context) []uint32 { + ids, err := oq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (oq *OrganizationQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, oq.ctx, "Count") + if err := oq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, oq, querierCount[*OrganizationQuery](), oq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (oq *OrganizationQuery) CountX(ctx context.Context) int { + count, err := oq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (oq *OrganizationQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, oq.ctx, "Exist") + switch _, err := oq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("ent: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (oq *OrganizationQuery) ExistX(ctx context.Context) bool { + exist, err := oq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the OrganizationQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (oq *OrganizationQuery) Clone() *OrganizationQuery { + if oq == nil { + return nil + } + return &OrganizationQuery{ + config: oq.config, + ctx: oq.ctx.Clone(), + order: append([]organization.OrderOption{}, oq.order...), + inters: append([]Interceptor{}, oq.inters...), + predicates: append([]predicate.Organization{}, oq.predicates...), + withParent: oq.withParent.Clone(), + withChildren: oq.withChildren.Clone(), + // clone intermediate query. + sql: oq.sql.Clone(), + path: oq.path, + } +} + +// WithParent tells the query-builder to eager-load the nodes that are connected to +// the "parent" edge. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithParent(opts ...func(*OrganizationQuery)) *OrganizationQuery { + query := (&OrganizationClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + oq.withParent = query + return oq +} + +// WithChildren tells the query-builder to eager-load the nodes that are connected to +// the "children" edge. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithChildren(opts ...func(*OrganizationQuery)) *OrganizationQuery { + query := (&OrganizationClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + oq.withChildren = query + return oq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreateTime time.Time `json:"create_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.Organization.Query(). +// GroupBy(organization.FieldCreateTime). +// Aggregate(ent.Count()). +// Scan(ctx, &v) +func (oq *OrganizationQuery) GroupBy(field string, fields ...string) *OrganizationGroupBy { + oq.ctx.Fields = append([]string{field}, fields...) + grbuild := &OrganizationGroupBy{build: oq} + grbuild.flds = &oq.ctx.Fields + grbuild.label = organization.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreateTime time.Time `json:"create_time,omitempty"` +// } +// +// client.Organization.Query(). +// Select(organization.FieldCreateTime). +// Scan(ctx, &v) +func (oq *OrganizationQuery) Select(fields ...string) *OrganizationSelect { + oq.ctx.Fields = append(oq.ctx.Fields, fields...) + sbuild := &OrganizationSelect{OrganizationQuery: oq} + sbuild.label = organization.Label + sbuild.flds, sbuild.scan = &oq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a OrganizationSelect configured with the given aggregations. +func (oq *OrganizationQuery) Aggregate(fns ...AggregateFunc) *OrganizationSelect { + return oq.Select().Aggregate(fns...) +} + +func (oq *OrganizationQuery) prepareQuery(ctx context.Context) error { + for _, inter := range oq.inters { + if inter == nil { + return fmt.Errorf("ent: uninitialized interceptor (forgotten import ent/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, oq); err != nil { + return err + } + } + } + for _, f := range oq.ctx.Fields { + if !organization.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)} + } + } + if oq.path != nil { + prev, err := oq.path(ctx) + if err != nil { + return err + } + oq.sql = prev + } + return nil +} + +func (oq *OrganizationQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Organization, error) { + var ( + nodes = []*Organization{} + _spec = oq.querySpec() + loadedTypes = [2]bool{ + oq.withParent != nil, + oq.withChildren != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*Organization).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &Organization{config: oq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + if len(oq.modifiers) > 0 { + _spec.Modifiers = oq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, oq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := oq.withParent; query != nil { + if err := oq.loadParent(ctx, query, nodes, nil, + func(n *Organization, e *Organization) { n.Edges.Parent = e }); err != nil { + return nil, err + } + } + if query := oq.withChildren; query != nil { + if err := oq.loadChildren(ctx, query, nodes, + func(n *Organization) { n.Edges.Children = []*Organization{} }, + func(n *Organization, e *Organization) { n.Edges.Children = append(n.Edges.Children, e) }); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (oq *OrganizationQuery) loadParent(ctx context.Context, query *OrganizationQuery, nodes []*Organization, init func(*Organization), assign func(*Organization, *Organization)) error { + ids := make([]uint32, 0, len(nodes)) + nodeids := make(map[uint32][]*Organization) + for i := range nodes { + if nodes[i].ParentID == nil { + continue + } + fk := *nodes[i].ParentID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(organization.IDIn(ids...)) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nodeids[n.ID] + if !ok { + return fmt.Errorf(`unexpected foreign-key "parent_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (oq *OrganizationQuery) loadChildren(ctx context.Context, query *OrganizationQuery, nodes []*Organization, init func(*Organization), assign func(*Organization, *Organization)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[uint32]*Organization) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(organization.FieldParentID) + } + query.Where(predicate.Organization(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(organization.ChildrenColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.ParentID + if fk == nil { + return fmt.Errorf(`foreign-key "parent_id" is nil for node %v`, n.ID) + } + node, ok := nodeids[*fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "parent_id" returned %v for node %v`, *fk, n.ID) + } + assign(node, n) + } + return nil +} + +func (oq *OrganizationQuery) sqlCount(ctx context.Context) (int, error) { + _spec := oq.querySpec() + if len(oq.modifiers) > 0 { + _spec.Modifiers = oq.modifiers + } + _spec.Node.Columns = oq.ctx.Fields + if len(oq.ctx.Fields) > 0 { + _spec.Unique = oq.ctx.Unique != nil && *oq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, oq.driver, _spec) +} + +func (oq *OrganizationQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(organization.Table, organization.Columns, sqlgraph.NewFieldSpec(organization.FieldID, field.TypeUint32)) + _spec.From = oq.sql + if unique := oq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if oq.path != nil { + _spec.Unique = true + } + if fields := oq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, organization.FieldID) + for i := range fields { + if fields[i] != organization.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if oq.withParent != nil { + _spec.Node.AddColumnOnce(organization.FieldParentID) + } + } + if ps := oq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := oq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := oq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := oq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (oq *OrganizationQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(oq.driver.Dialect()) + t1 := builder.Table(organization.Table) + columns := oq.ctx.Fields + if len(columns) == 0 { + columns = organization.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if oq.sql != nil { + selector = oq.sql + selector.Select(selector.Columns(columns...)...) + } + if oq.ctx.Unique != nil && *oq.ctx.Unique { + selector.Distinct() + } + for _, m := range oq.modifiers { + m(selector) + } + for _, p := range oq.predicates { + p(selector) + } + for _, p := range oq.order { + p(selector) + } + if offset := oq.ctx.Offset; offset != nil { + // limit is mandatory for offset clause. We start + // with default value, and override it below if needed. + selector.Offset(*offset).Limit(math.MaxInt32) + } + if limit := oq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// Modify adds a query modifier for attaching custom logic to queries. +func (oq *OrganizationQuery) Modify(modifiers ...func(s *sql.Selector)) *OrganizationSelect { + oq.modifiers = append(oq.modifiers, modifiers...) + return oq.Select() +} + +// OrganizationGroupBy is the group-by builder for Organization entities. +type OrganizationGroupBy struct { + selector + build *OrganizationQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (ogb *OrganizationGroupBy) Aggregate(fns ...AggregateFunc) *OrganizationGroupBy { + ogb.fns = append(ogb.fns, fns...) + return ogb +} + +// Scan applies the selector query and scans the result into the given value. +func (ogb *OrganizationGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ogb.build.ctx, "GroupBy") + if err := ogb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*OrganizationQuery, *OrganizationGroupBy](ctx, ogb.build, ogb, ogb.build.inters, v) +} + +func (ogb *OrganizationGroupBy) sqlScan(ctx context.Context, root *OrganizationQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(ogb.fns)) + for _, fn := range ogb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*ogb.flds)+len(ogb.fns)) + for _, f := range *ogb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*ogb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := ogb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// OrganizationSelect is the builder for selecting fields of Organization entities. +type OrganizationSelect struct { + *OrganizationQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (os *OrganizationSelect) Aggregate(fns ...AggregateFunc) *OrganizationSelect { + os.fns = append(os.fns, fns...) + return os +} + +// Scan applies the selector query and scans the result into the given value. +func (os *OrganizationSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, os.ctx, "Select") + if err := os.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*OrganizationQuery, *OrganizationSelect](ctx, os.OrganizationQuery, os, os.inters, v) +} + +func (os *OrganizationSelect) sqlScan(ctx context.Context, root *OrganizationQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(os.fns)) + for _, fn := range os.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*os.selector.flds); { + case n == 0 && len(aggregation) > 0: + selector.Select(aggregation...) + case n != 0 && len(aggregation) > 0: + selector.AppendSelect(aggregation...) + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := os.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// Modify adds a query modifier for attaching custom logic to queries. +func (os *OrganizationSelect) Modify(modifiers ...func(s *sql.Selector)) *OrganizationSelect { + os.modifiers = append(os.modifiers, modifiers...) + return os +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/organization_update.go b/monolithic/backend/app/admin/service/internal/data/ent/organization_update.go new file mode 100644 index 0000000..9f129c7 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/organization_update.go @@ -0,0 +1,920 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "errors" + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/organization" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// OrganizationUpdate is the builder for updating Organization entities. +type OrganizationUpdate struct { + config + hooks []Hook + mutation *OrganizationMutation + modifiers []func(*sql.UpdateBuilder) +} + +// Where appends a list predicates to the OrganizationUpdate builder. +func (ou *OrganizationUpdate) Where(ps ...predicate.Organization) *OrganizationUpdate { + ou.mutation.Where(ps...) + return ou +} + +// SetUpdateTime sets the "update_time" field. +func (ou *OrganizationUpdate) SetUpdateTime(t time.Time) *OrganizationUpdate { + ou.mutation.SetUpdateTime(t) + return ou +} + +// SetNillableUpdateTime sets the "update_time" field if the given value is not nil. +func (ou *OrganizationUpdate) SetNillableUpdateTime(t *time.Time) *OrganizationUpdate { + if t != nil { + ou.SetUpdateTime(*t) + } + return ou +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (ou *OrganizationUpdate) ClearUpdateTime() *OrganizationUpdate { + ou.mutation.ClearUpdateTime() + return ou +} + +// SetDeleteTime sets the "delete_time" field. +func (ou *OrganizationUpdate) SetDeleteTime(t time.Time) *OrganizationUpdate { + ou.mutation.SetDeleteTime(t) + return ou +} + +// SetNillableDeleteTime sets the "delete_time" field if the given value is not nil. +func (ou *OrganizationUpdate) SetNillableDeleteTime(t *time.Time) *OrganizationUpdate { + if t != nil { + ou.SetDeleteTime(*t) + } + return ou +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (ou *OrganizationUpdate) ClearDeleteTime() *OrganizationUpdate { + ou.mutation.ClearDeleteTime() + return ou +} + +// SetStatus sets the "status" field. +func (ou *OrganizationUpdate) SetStatus(o organization.Status) *OrganizationUpdate { + ou.mutation.SetStatus(o) + return ou +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (ou *OrganizationUpdate) SetNillableStatus(o *organization.Status) *OrganizationUpdate { + if o != nil { + ou.SetStatus(*o) + } + return ou +} + +// ClearStatus clears the value of the "status" field. +func (ou *OrganizationUpdate) ClearStatus() *OrganizationUpdate { + ou.mutation.ClearStatus() + return ou +} + +// SetCreateBy sets the "create_by" field. +func (ou *OrganizationUpdate) SetCreateBy(u uint32) *OrganizationUpdate { + ou.mutation.ResetCreateBy() + ou.mutation.SetCreateBy(u) + return ou +} + +// SetNillableCreateBy sets the "create_by" field if the given value is not nil. +func (ou *OrganizationUpdate) SetNillableCreateBy(u *uint32) *OrganizationUpdate { + if u != nil { + ou.SetCreateBy(*u) + } + return ou +} + +// AddCreateBy adds u to the "create_by" field. +func (ou *OrganizationUpdate) AddCreateBy(u int32) *OrganizationUpdate { + ou.mutation.AddCreateBy(u) + return ou +} + +// ClearCreateBy clears the value of the "create_by" field. +func (ou *OrganizationUpdate) ClearCreateBy() *OrganizationUpdate { + ou.mutation.ClearCreateBy() + return ou +} + +// SetRemark sets the "remark" field. +func (ou *OrganizationUpdate) SetRemark(s string) *OrganizationUpdate { + ou.mutation.SetRemark(s) + return ou +} + +// SetNillableRemark sets the "remark" field if the given value is not nil. +func (ou *OrganizationUpdate) SetNillableRemark(s *string) *OrganizationUpdate { + if s != nil { + ou.SetRemark(*s) + } + return ou +} + +// ClearRemark clears the value of the "remark" field. +func (ou *OrganizationUpdate) ClearRemark() *OrganizationUpdate { + ou.mutation.ClearRemark() + return ou +} + +// SetName sets the "name" field. +func (ou *OrganizationUpdate) SetName(s string) *OrganizationUpdate { + ou.mutation.SetName(s) + return ou +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (ou *OrganizationUpdate) SetNillableName(s *string) *OrganizationUpdate { + if s != nil { + ou.SetName(*s) + } + return ou +} + +// ClearName clears the value of the "name" field. +func (ou *OrganizationUpdate) ClearName() *OrganizationUpdate { + ou.mutation.ClearName() + return ou +} + +// SetParentID sets the "parent_id" field. +func (ou *OrganizationUpdate) SetParentID(u uint32) *OrganizationUpdate { + ou.mutation.SetParentID(u) + return ou +} + +// SetNillableParentID sets the "parent_id" field if the given value is not nil. +func (ou *OrganizationUpdate) SetNillableParentID(u *uint32) *OrganizationUpdate { + if u != nil { + ou.SetParentID(*u) + } + return ou +} + +// ClearParentID clears the value of the "parent_id" field. +func (ou *OrganizationUpdate) ClearParentID() *OrganizationUpdate { + ou.mutation.ClearParentID() + return ou +} + +// SetOrderNo sets the "order_no" field. +func (ou *OrganizationUpdate) SetOrderNo(i int32) *OrganizationUpdate { + ou.mutation.ResetOrderNo() + ou.mutation.SetOrderNo(i) + return ou +} + +// SetNillableOrderNo sets the "order_no" field if the given value is not nil. +func (ou *OrganizationUpdate) SetNillableOrderNo(i *int32) *OrganizationUpdate { + if i != nil { + ou.SetOrderNo(*i) + } + return ou +} + +// AddOrderNo adds i to the "order_no" field. +func (ou *OrganizationUpdate) AddOrderNo(i int32) *OrganizationUpdate { + ou.mutation.AddOrderNo(i) + return ou +} + +// ClearOrderNo clears the value of the "order_no" field. +func (ou *OrganizationUpdate) ClearOrderNo() *OrganizationUpdate { + ou.mutation.ClearOrderNo() + return ou +} + +// SetParent sets the "parent" edge to the Organization entity. +func (ou *OrganizationUpdate) SetParent(o *Organization) *OrganizationUpdate { + return ou.SetParentID(o.ID) +} + +// AddChildIDs adds the "children" edge to the Organization entity by IDs. +func (ou *OrganizationUpdate) AddChildIDs(ids ...uint32) *OrganizationUpdate { + ou.mutation.AddChildIDs(ids...) + return ou +} + +// AddChildren adds the "children" edges to the Organization entity. +func (ou *OrganizationUpdate) AddChildren(o ...*Organization) *OrganizationUpdate { + ids := make([]uint32, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return ou.AddChildIDs(ids...) +} + +// Mutation returns the OrganizationMutation object of the builder. +func (ou *OrganizationUpdate) Mutation() *OrganizationMutation { + return ou.mutation +} + +// ClearParent clears the "parent" edge to the Organization entity. +func (ou *OrganizationUpdate) ClearParent() *OrganizationUpdate { + ou.mutation.ClearParent() + return ou +} + +// ClearChildren clears all "children" edges to the Organization entity. +func (ou *OrganizationUpdate) ClearChildren() *OrganizationUpdate { + ou.mutation.ClearChildren() + return ou +} + +// RemoveChildIDs removes the "children" edge to Organization entities by IDs. +func (ou *OrganizationUpdate) RemoveChildIDs(ids ...uint32) *OrganizationUpdate { + ou.mutation.RemoveChildIDs(ids...) + return ou +} + +// RemoveChildren removes "children" edges to Organization entities. +func (ou *OrganizationUpdate) RemoveChildren(o ...*Organization) *OrganizationUpdate { + ids := make([]uint32, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return ou.RemoveChildIDs(ids...) +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (ou *OrganizationUpdate) Save(ctx context.Context) (int, error) { + return withHooks(ctx, ou.sqlSave, ou.mutation, ou.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ou *OrganizationUpdate) SaveX(ctx context.Context) int { + affected, err := ou.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (ou *OrganizationUpdate) Exec(ctx context.Context) error { + _, err := ou.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ou *OrganizationUpdate) ExecX(ctx context.Context) { + if err := ou.Exec(ctx); err != nil { + panic(err) + } +} + +// check runs all checks and user-defined validators on the builder. +func (ou *OrganizationUpdate) check() error { + if v, ok := ou.mutation.Status(); ok { + if err := organization.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "Organization.status": %w`, err)} + } + } + if v, ok := ou.mutation.Name(); ok { + if err := organization.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "Organization.name": %w`, err)} + } + } + return nil +} + +// Modify adds a statement modifier for attaching custom logic to the UPDATE statement. +func (ou *OrganizationUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *OrganizationUpdate { + ou.modifiers = append(ou.modifiers, modifiers...) + return ou +} + +func (ou *OrganizationUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := ou.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(organization.Table, organization.Columns, sqlgraph.NewFieldSpec(organization.FieldID, field.TypeUint32)) + if ps := ou.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ou.mutation.CreateTimeCleared() { + _spec.ClearField(organization.FieldCreateTime, field.TypeTime) + } + if value, ok := ou.mutation.UpdateTime(); ok { + _spec.SetField(organization.FieldUpdateTime, field.TypeTime, value) + } + if ou.mutation.UpdateTimeCleared() { + _spec.ClearField(organization.FieldUpdateTime, field.TypeTime) + } + if value, ok := ou.mutation.DeleteTime(); ok { + _spec.SetField(organization.FieldDeleteTime, field.TypeTime, value) + } + if ou.mutation.DeleteTimeCleared() { + _spec.ClearField(organization.FieldDeleteTime, field.TypeTime) + } + if value, ok := ou.mutation.Status(); ok { + _spec.SetField(organization.FieldStatus, field.TypeEnum, value) + } + if ou.mutation.StatusCleared() { + _spec.ClearField(organization.FieldStatus, field.TypeEnum) + } + if value, ok := ou.mutation.CreateBy(); ok { + _spec.SetField(organization.FieldCreateBy, field.TypeUint32, value) + } + if value, ok := ou.mutation.AddedCreateBy(); ok { + _spec.AddField(organization.FieldCreateBy, field.TypeUint32, value) + } + if ou.mutation.CreateByCleared() { + _spec.ClearField(organization.FieldCreateBy, field.TypeUint32) + } + if value, ok := ou.mutation.Remark(); ok { + _spec.SetField(organization.FieldRemark, field.TypeString, value) + } + if ou.mutation.RemarkCleared() { + _spec.ClearField(organization.FieldRemark, field.TypeString) + } + if value, ok := ou.mutation.Name(); ok { + _spec.SetField(organization.FieldName, field.TypeString, value) + } + if ou.mutation.NameCleared() { + _spec.ClearField(organization.FieldName, field.TypeString) + } + if value, ok := ou.mutation.OrderNo(); ok { + _spec.SetField(organization.FieldOrderNo, field.TypeInt32, value) + } + if value, ok := ou.mutation.AddedOrderNo(); ok { + _spec.AddField(organization.FieldOrderNo, field.TypeInt32, value) + } + if ou.mutation.OrderNoCleared() { + _spec.ClearField(organization.FieldOrderNo, field.TypeInt32) + } + if ou.mutation.ParentCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: organization.ParentTable, + Columns: []string{organization.ParentColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeUint32), + }, + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.ParentIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: organization.ParentTable, + Columns: []string{organization.ParentColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeUint32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ou.mutation.ChildrenCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.ChildrenTable, + Columns: []string{organization.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeUint32), + }, + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.RemovedChildrenIDs(); len(nodes) > 0 && !ou.mutation.ChildrenCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.ChildrenTable, + Columns: []string{organization.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeUint32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.ChildrenIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.ChildrenTable, + Columns: []string{organization.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeUint32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.AddModifiers(ou.modifiers...) + if n, err = sqlgraph.UpdateNodes(ctx, ou.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{organization.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + ou.mutation.done = true + return n, nil +} + +// OrganizationUpdateOne is the builder for updating a single Organization entity. +type OrganizationUpdateOne struct { + config + fields []string + hooks []Hook + mutation *OrganizationMutation + modifiers []func(*sql.UpdateBuilder) +} + +// SetUpdateTime sets the "update_time" field. +func (ouo *OrganizationUpdateOne) SetUpdateTime(t time.Time) *OrganizationUpdateOne { + ouo.mutation.SetUpdateTime(t) + return ouo +} + +// SetNillableUpdateTime sets the "update_time" field if the given value is not nil. +func (ouo *OrganizationUpdateOne) SetNillableUpdateTime(t *time.Time) *OrganizationUpdateOne { + if t != nil { + ouo.SetUpdateTime(*t) + } + return ouo +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (ouo *OrganizationUpdateOne) ClearUpdateTime() *OrganizationUpdateOne { + ouo.mutation.ClearUpdateTime() + return ouo +} + +// SetDeleteTime sets the "delete_time" field. +func (ouo *OrganizationUpdateOne) SetDeleteTime(t time.Time) *OrganizationUpdateOne { + ouo.mutation.SetDeleteTime(t) + return ouo +} + +// SetNillableDeleteTime sets the "delete_time" field if the given value is not nil. +func (ouo *OrganizationUpdateOne) SetNillableDeleteTime(t *time.Time) *OrganizationUpdateOne { + if t != nil { + ouo.SetDeleteTime(*t) + } + return ouo +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (ouo *OrganizationUpdateOne) ClearDeleteTime() *OrganizationUpdateOne { + ouo.mutation.ClearDeleteTime() + return ouo +} + +// SetStatus sets the "status" field. +func (ouo *OrganizationUpdateOne) SetStatus(o organization.Status) *OrganizationUpdateOne { + ouo.mutation.SetStatus(o) + return ouo +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (ouo *OrganizationUpdateOne) SetNillableStatus(o *organization.Status) *OrganizationUpdateOne { + if o != nil { + ouo.SetStatus(*o) + } + return ouo +} + +// ClearStatus clears the value of the "status" field. +func (ouo *OrganizationUpdateOne) ClearStatus() *OrganizationUpdateOne { + ouo.mutation.ClearStatus() + return ouo +} + +// SetCreateBy sets the "create_by" field. +func (ouo *OrganizationUpdateOne) SetCreateBy(u uint32) *OrganizationUpdateOne { + ouo.mutation.ResetCreateBy() + ouo.mutation.SetCreateBy(u) + return ouo +} + +// SetNillableCreateBy sets the "create_by" field if the given value is not nil. +func (ouo *OrganizationUpdateOne) SetNillableCreateBy(u *uint32) *OrganizationUpdateOne { + if u != nil { + ouo.SetCreateBy(*u) + } + return ouo +} + +// AddCreateBy adds u to the "create_by" field. +func (ouo *OrganizationUpdateOne) AddCreateBy(u int32) *OrganizationUpdateOne { + ouo.mutation.AddCreateBy(u) + return ouo +} + +// ClearCreateBy clears the value of the "create_by" field. +func (ouo *OrganizationUpdateOne) ClearCreateBy() *OrganizationUpdateOne { + ouo.mutation.ClearCreateBy() + return ouo +} + +// SetRemark sets the "remark" field. +func (ouo *OrganizationUpdateOne) SetRemark(s string) *OrganizationUpdateOne { + ouo.mutation.SetRemark(s) + return ouo +} + +// SetNillableRemark sets the "remark" field if the given value is not nil. +func (ouo *OrganizationUpdateOne) SetNillableRemark(s *string) *OrganizationUpdateOne { + if s != nil { + ouo.SetRemark(*s) + } + return ouo +} + +// ClearRemark clears the value of the "remark" field. +func (ouo *OrganizationUpdateOne) ClearRemark() *OrganizationUpdateOne { + ouo.mutation.ClearRemark() + return ouo +} + +// SetName sets the "name" field. +func (ouo *OrganizationUpdateOne) SetName(s string) *OrganizationUpdateOne { + ouo.mutation.SetName(s) + return ouo +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (ouo *OrganizationUpdateOne) SetNillableName(s *string) *OrganizationUpdateOne { + if s != nil { + ouo.SetName(*s) + } + return ouo +} + +// ClearName clears the value of the "name" field. +func (ouo *OrganizationUpdateOne) ClearName() *OrganizationUpdateOne { + ouo.mutation.ClearName() + return ouo +} + +// SetParentID sets the "parent_id" field. +func (ouo *OrganizationUpdateOne) SetParentID(u uint32) *OrganizationUpdateOne { + ouo.mutation.SetParentID(u) + return ouo +} + +// SetNillableParentID sets the "parent_id" field if the given value is not nil. +func (ouo *OrganizationUpdateOne) SetNillableParentID(u *uint32) *OrganizationUpdateOne { + if u != nil { + ouo.SetParentID(*u) + } + return ouo +} + +// ClearParentID clears the value of the "parent_id" field. +func (ouo *OrganizationUpdateOne) ClearParentID() *OrganizationUpdateOne { + ouo.mutation.ClearParentID() + return ouo +} + +// SetOrderNo sets the "order_no" field. +func (ouo *OrganizationUpdateOne) SetOrderNo(i int32) *OrganizationUpdateOne { + ouo.mutation.ResetOrderNo() + ouo.mutation.SetOrderNo(i) + return ouo +} + +// SetNillableOrderNo sets the "order_no" field if the given value is not nil. +func (ouo *OrganizationUpdateOne) SetNillableOrderNo(i *int32) *OrganizationUpdateOne { + if i != nil { + ouo.SetOrderNo(*i) + } + return ouo +} + +// AddOrderNo adds i to the "order_no" field. +func (ouo *OrganizationUpdateOne) AddOrderNo(i int32) *OrganizationUpdateOne { + ouo.mutation.AddOrderNo(i) + return ouo +} + +// ClearOrderNo clears the value of the "order_no" field. +func (ouo *OrganizationUpdateOne) ClearOrderNo() *OrganizationUpdateOne { + ouo.mutation.ClearOrderNo() + return ouo +} + +// SetParent sets the "parent" edge to the Organization entity. +func (ouo *OrganizationUpdateOne) SetParent(o *Organization) *OrganizationUpdateOne { + return ouo.SetParentID(o.ID) +} + +// AddChildIDs adds the "children" edge to the Organization entity by IDs. +func (ouo *OrganizationUpdateOne) AddChildIDs(ids ...uint32) *OrganizationUpdateOne { + ouo.mutation.AddChildIDs(ids...) + return ouo +} + +// AddChildren adds the "children" edges to the Organization entity. +func (ouo *OrganizationUpdateOne) AddChildren(o ...*Organization) *OrganizationUpdateOne { + ids := make([]uint32, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return ouo.AddChildIDs(ids...) +} + +// Mutation returns the OrganizationMutation object of the builder. +func (ouo *OrganizationUpdateOne) Mutation() *OrganizationMutation { + return ouo.mutation +} + +// ClearParent clears the "parent" edge to the Organization entity. +func (ouo *OrganizationUpdateOne) ClearParent() *OrganizationUpdateOne { + ouo.mutation.ClearParent() + return ouo +} + +// ClearChildren clears all "children" edges to the Organization entity. +func (ouo *OrganizationUpdateOne) ClearChildren() *OrganizationUpdateOne { + ouo.mutation.ClearChildren() + return ouo +} + +// RemoveChildIDs removes the "children" edge to Organization entities by IDs. +func (ouo *OrganizationUpdateOne) RemoveChildIDs(ids ...uint32) *OrganizationUpdateOne { + ouo.mutation.RemoveChildIDs(ids...) + return ouo +} + +// RemoveChildren removes "children" edges to Organization entities. +func (ouo *OrganizationUpdateOne) RemoveChildren(o ...*Organization) *OrganizationUpdateOne { + ids := make([]uint32, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return ouo.RemoveChildIDs(ids...) +} + +// Where appends a list predicates to the OrganizationUpdate builder. +func (ouo *OrganizationUpdateOne) Where(ps ...predicate.Organization) *OrganizationUpdateOne { + ouo.mutation.Where(ps...) + return ouo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (ouo *OrganizationUpdateOne) Select(field string, fields ...string) *OrganizationUpdateOne { + ouo.fields = append([]string{field}, fields...) + return ouo +} + +// Save executes the query and returns the updated Organization entity. +func (ouo *OrganizationUpdateOne) Save(ctx context.Context) (*Organization, error) { + return withHooks(ctx, ouo.sqlSave, ouo.mutation, ouo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ouo *OrganizationUpdateOne) SaveX(ctx context.Context) *Organization { + node, err := ouo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (ouo *OrganizationUpdateOne) Exec(ctx context.Context) error { + _, err := ouo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ouo *OrganizationUpdateOne) ExecX(ctx context.Context) { + if err := ouo.Exec(ctx); err != nil { + panic(err) + } +} + +// check runs all checks and user-defined validators on the builder. +func (ouo *OrganizationUpdateOne) check() error { + if v, ok := ouo.mutation.Status(); ok { + if err := organization.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "Organization.status": %w`, err)} + } + } + if v, ok := ouo.mutation.Name(); ok { + if err := organization.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "Organization.name": %w`, err)} + } + } + return nil +} + +// Modify adds a statement modifier for attaching custom logic to the UPDATE statement. +func (ouo *OrganizationUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *OrganizationUpdateOne { + ouo.modifiers = append(ouo.modifiers, modifiers...) + return ouo +} + +func (ouo *OrganizationUpdateOne) sqlSave(ctx context.Context) (_node *Organization, err error) { + if err := ouo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(organization.Table, organization.Columns, sqlgraph.NewFieldSpec(organization.FieldID, field.TypeUint32)) + id, ok := ouo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`ent: missing "Organization.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := ouo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, organization.FieldID) + for _, f := range fields { + if !organization.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)} + } + if f != organization.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := ouo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ouo.mutation.CreateTimeCleared() { + _spec.ClearField(organization.FieldCreateTime, field.TypeTime) + } + if value, ok := ouo.mutation.UpdateTime(); ok { + _spec.SetField(organization.FieldUpdateTime, field.TypeTime, value) + } + if ouo.mutation.UpdateTimeCleared() { + _spec.ClearField(organization.FieldUpdateTime, field.TypeTime) + } + if value, ok := ouo.mutation.DeleteTime(); ok { + _spec.SetField(organization.FieldDeleteTime, field.TypeTime, value) + } + if ouo.mutation.DeleteTimeCleared() { + _spec.ClearField(organization.FieldDeleteTime, field.TypeTime) + } + if value, ok := ouo.mutation.Status(); ok { + _spec.SetField(organization.FieldStatus, field.TypeEnum, value) + } + if ouo.mutation.StatusCleared() { + _spec.ClearField(organization.FieldStatus, field.TypeEnum) + } + if value, ok := ouo.mutation.CreateBy(); ok { + _spec.SetField(organization.FieldCreateBy, field.TypeUint32, value) + } + if value, ok := ouo.mutation.AddedCreateBy(); ok { + _spec.AddField(organization.FieldCreateBy, field.TypeUint32, value) + } + if ouo.mutation.CreateByCleared() { + _spec.ClearField(organization.FieldCreateBy, field.TypeUint32) + } + if value, ok := ouo.mutation.Remark(); ok { + _spec.SetField(organization.FieldRemark, field.TypeString, value) + } + if ouo.mutation.RemarkCleared() { + _spec.ClearField(organization.FieldRemark, field.TypeString) + } + if value, ok := ouo.mutation.Name(); ok { + _spec.SetField(organization.FieldName, field.TypeString, value) + } + if ouo.mutation.NameCleared() { + _spec.ClearField(organization.FieldName, field.TypeString) + } + if value, ok := ouo.mutation.OrderNo(); ok { + _spec.SetField(organization.FieldOrderNo, field.TypeInt32, value) + } + if value, ok := ouo.mutation.AddedOrderNo(); ok { + _spec.AddField(organization.FieldOrderNo, field.TypeInt32, value) + } + if ouo.mutation.OrderNoCleared() { + _spec.ClearField(organization.FieldOrderNo, field.TypeInt32) + } + if ouo.mutation.ParentCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: organization.ParentTable, + Columns: []string{organization.ParentColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeUint32), + }, + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.ParentIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: organization.ParentTable, + Columns: []string{organization.ParentColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeUint32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ouo.mutation.ChildrenCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.ChildrenTable, + Columns: []string{organization.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeUint32), + }, + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.RemovedChildrenIDs(); len(nodes) > 0 && !ouo.mutation.ChildrenCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.ChildrenTable, + Columns: []string{organization.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeUint32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.ChildrenIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.ChildrenTable, + Columns: []string{organization.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeUint32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.AddModifiers(ouo.modifiers...) + _node = &Organization{config: ouo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, ouo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{organization.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + ouo.mutation.done = true + return _node, nil +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/position.go b/monolithic/backend/app/admin/service/internal/data/ent/position.go new file mode 100644 index 0000000..0ab900b --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/position.go @@ -0,0 +1,270 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/position" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" +) + +// Position is the model entity for the Position schema. +type Position struct { + config `json:"-"` + // ID of the ent. + // id + ID uint32 `json:"id,omitempty"` + // 创建时间 + CreateTime *time.Time `json:"create_time,omitempty"` + // 更新时间 + UpdateTime *time.Time `json:"update_time,omitempty"` + // 删除时间 + DeleteTime *time.Time `json:"delete_time,omitempty"` + // 状态 + Status *position.Status `json:"status,omitempty"` + // 创建者ID + CreateBy *uint32 `json:"create_by,omitempty"` + // 备注 + Remark *string `json:"remark,omitempty"` + // 角色名称 + Name string `json:"name,omitempty"` + // 角色标识 + Code string `json:"code,omitempty"` + // 上一层角色ID + ParentID uint32 `json:"parent_id,omitempty"` + // 排序ID + OrderNo int32 `json:"order_no,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the PositionQuery when eager-loading is set. + Edges PositionEdges `json:"edges"` + selectValues sql.SelectValues +} + +// PositionEdges holds the relations/edges for other nodes in the graph. +type PositionEdges struct { + // Parent holds the value of the parent edge. + Parent *Position `json:"parent,omitempty"` + // Children holds the value of the children edge. + Children []*Position `json:"children,omitempty"` + // loadedTypes holds the information for reporting if a + // type was loaded (or requested) in eager-loading or not. + loadedTypes [2]bool +} + +// ParentOrErr returns the Parent value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e PositionEdges) ParentOrErr() (*Position, error) { + if e.loadedTypes[0] { + if e.Parent == nil { + // Edge was loaded but was not found. + return nil, &NotFoundError{label: position.Label} + } + return e.Parent, nil + } + return nil, &NotLoadedError{edge: "parent"} +} + +// ChildrenOrErr returns the Children value or an error if the edge +// was not loaded in eager-loading. +func (e PositionEdges) ChildrenOrErr() ([]*Position, error) { + if e.loadedTypes[1] { + return e.Children, nil + } + return nil, &NotLoadedError{edge: "children"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*Position) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case position.FieldID, position.FieldCreateBy, position.FieldParentID, position.FieldOrderNo: + values[i] = new(sql.NullInt64) + case position.FieldStatus, position.FieldRemark, position.FieldName, position.FieldCode: + values[i] = new(sql.NullString) + case position.FieldCreateTime, position.FieldUpdateTime, position.FieldDeleteTime: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the Position fields. +func (po *Position) assignValues(columns []string, values []any) error { + if m, n := len(values), len(columns); m < n { + return fmt.Errorf("mismatch number of scan values: %d != %d", m, n) + } + for i := range columns { + switch columns[i] { + case position.FieldID: + value, ok := values[i].(*sql.NullInt64) + if !ok { + return fmt.Errorf("unexpected type %T for field id", value) + } + po.ID = uint32(value.Int64) + case position.FieldCreateTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field create_time", values[i]) + } else if value.Valid { + po.CreateTime = new(time.Time) + *po.CreateTime = value.Time + } + case position.FieldUpdateTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field update_time", values[i]) + } else if value.Valid { + po.UpdateTime = new(time.Time) + *po.UpdateTime = value.Time + } + case position.FieldDeleteTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field delete_time", values[i]) + } else if value.Valid { + po.DeleteTime = new(time.Time) + *po.DeleteTime = value.Time + } + case position.FieldStatus: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field status", values[i]) + } else if value.Valid { + po.Status = new(position.Status) + *po.Status = position.Status(value.String) + } + case position.FieldCreateBy: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field create_by", values[i]) + } else if value.Valid { + po.CreateBy = new(uint32) + *po.CreateBy = uint32(value.Int64) + } + case position.FieldRemark: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field remark", values[i]) + } else if value.Valid { + po.Remark = new(string) + *po.Remark = value.String + } + case position.FieldName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[i]) + } else if value.Valid { + po.Name = value.String + } + case position.FieldCode: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field code", values[i]) + } else if value.Valid { + po.Code = value.String + } + case position.FieldParentID: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field parent_id", values[i]) + } else if value.Valid { + po.ParentID = uint32(value.Int64) + } + case position.FieldOrderNo: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field order_no", values[i]) + } else if value.Valid { + po.OrderNo = int32(value.Int64) + } + default: + po.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the Position. +// This includes values selected through modifiers, order, etc. +func (po *Position) Value(name string) (ent.Value, error) { + return po.selectValues.Get(name) +} + +// QueryParent queries the "parent" edge of the Position entity. +func (po *Position) QueryParent() *PositionQuery { + return NewPositionClient(po.config).QueryParent(po) +} + +// QueryChildren queries the "children" edge of the Position entity. +func (po *Position) QueryChildren() *PositionQuery { + return NewPositionClient(po.config).QueryChildren(po) +} + +// Update returns a builder for updating this Position. +// Note that you need to call Position.Unwrap() before calling this method if this Position +// was returned from a transaction, and the transaction was committed or rolled back. +func (po *Position) Update() *PositionUpdateOne { + return NewPositionClient(po.config).UpdateOne(po) +} + +// Unwrap unwraps the Position entity that was returned from a transaction after it was closed, +// so that all future queries will be executed through the driver which created the transaction. +func (po *Position) Unwrap() *Position { + _tx, ok := po.config.driver.(*txDriver) + if !ok { + panic("ent: Position is not a transactional entity") + } + po.config.driver = _tx.drv + return po +} + +// String implements the fmt.Stringer. +func (po *Position) String() string { + var builder strings.Builder + builder.WriteString("Position(") + builder.WriteString(fmt.Sprintf("id=%v, ", po.ID)) + if v := po.CreateTime; v != nil { + builder.WriteString("create_time=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + if v := po.UpdateTime; v != nil { + builder.WriteString("update_time=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + if v := po.DeleteTime; v != nil { + builder.WriteString("delete_time=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + if v := po.Status; v != nil { + builder.WriteString("status=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := po.CreateBy; v != nil { + builder.WriteString("create_by=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := po.Remark; v != nil { + builder.WriteString("remark=") + builder.WriteString(*v) + } + builder.WriteString(", ") + builder.WriteString("name=") + builder.WriteString(po.Name) + builder.WriteString(", ") + builder.WriteString("code=") + builder.WriteString(po.Code) + builder.WriteString(", ") + builder.WriteString("parent_id=") + builder.WriteString(fmt.Sprintf("%v", po.ParentID)) + builder.WriteString(", ") + builder.WriteString("order_no=") + builder.WriteString(fmt.Sprintf("%v", po.OrderNo)) + builder.WriteByte(')') + return builder.String() +} + +// Positions is a parsable slice of Position. +type Positions []*Position diff --git a/monolithic/backend/app/admin/service/internal/data/ent/position/position.go b/monolithic/backend/app/admin/service/internal/data/ent/position/position.go new file mode 100644 index 0000000..d0521dc --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/position/position.go @@ -0,0 +1,214 @@ +// Code generated by ent, DO NOT EDIT. + +package position + +import ( + "fmt" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +const ( + // Label holds the string label denoting the position type in the database. + Label = "position" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreateTime holds the string denoting the create_time field in the database. + FieldCreateTime = "create_time" + // FieldUpdateTime holds the string denoting the update_time field in the database. + FieldUpdateTime = "update_time" + // FieldDeleteTime holds the string denoting the delete_time field in the database. + FieldDeleteTime = "delete_time" + // FieldStatus holds the string denoting the status field in the database. + FieldStatus = "status" + // FieldCreateBy holds the string denoting the create_by field in the database. + FieldCreateBy = "create_by" + // FieldRemark holds the string denoting the remark field in the database. + FieldRemark = "remark" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // FieldCode holds the string denoting the code field in the database. + FieldCode = "code" + // FieldParentID holds the string denoting the parent_id field in the database. + FieldParentID = "parent_id" + // FieldOrderNo holds the string denoting the order_no field in the database. + FieldOrderNo = "order_no" + // EdgeParent holds the string denoting the parent edge name in mutations. + EdgeParent = "parent" + // EdgeChildren holds the string denoting the children edge name in mutations. + EdgeChildren = "children" + // Table holds the table name of the position in the database. + Table = "position" + // ParentTable is the table that holds the parent relation/edge. + ParentTable = "position" + // ParentColumn is the table column denoting the parent relation/edge. + ParentColumn = "parent_id" + // ChildrenTable is the table that holds the children relation/edge. + ChildrenTable = "position" + // ChildrenColumn is the table column denoting the children relation/edge. + ChildrenColumn = "parent_id" +) + +// Columns holds all SQL columns for position fields. +var Columns = []string{ + FieldID, + FieldCreateTime, + FieldUpdateTime, + FieldDeleteTime, + FieldStatus, + FieldCreateBy, + FieldRemark, + FieldName, + FieldCode, + FieldParentID, + FieldOrderNo, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +var ( + // DefaultRemark holds the default value on creation for the "remark" field. + DefaultRemark string + // DefaultName holds the default value on creation for the "name" field. + DefaultName string + // NameValidator is a validator for the "name" field. It is called by the builders before save. + NameValidator func(string) error + // DefaultCode holds the default value on creation for the "code" field. + DefaultCode string + // CodeValidator is a validator for the "code" field. It is called by the builders before save. + CodeValidator func(string) error + // DefaultParentID holds the default value on creation for the "parent_id" field. + DefaultParentID uint32 + // DefaultOrderNo holds the default value on creation for the "order_no" field. + DefaultOrderNo int32 + // IDValidator is a validator for the "id" field. It is called by the builders before save. + IDValidator func(uint32) error +) + +// Status defines the type for the "status" enum field. +type Status string + +// StatusON is the default value of the Status enum. +const DefaultStatus = StatusON + +// Status values. +const ( + StatusOFF Status = "OFF" + StatusON Status = "ON" +) + +func (s Status) String() string { + return string(s) +} + +// StatusValidator is a validator for the "status" field enum values. It is called by the builders before save. +func StatusValidator(s Status) error { + switch s { + case StatusOFF, StatusON: + return nil + default: + return fmt.Errorf("position: invalid enum value for status field: %q", s) + } +} + +// OrderOption defines the ordering options for the Position queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreateTime orders the results by the create_time field. +func ByCreateTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreateTime, opts...).ToFunc() +} + +// ByUpdateTime orders the results by the update_time field. +func ByUpdateTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdateTime, opts...).ToFunc() +} + +// ByDeleteTime orders the results by the delete_time field. +func ByDeleteTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeleteTime, opts...).ToFunc() +} + +// ByStatus orders the results by the status field. +func ByStatus(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldStatus, opts...).ToFunc() +} + +// ByCreateBy orders the results by the create_by field. +func ByCreateBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreateBy, opts...).ToFunc() +} + +// ByRemark orders the results by the remark field. +func ByRemark(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRemark, opts...).ToFunc() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +// ByCode orders the results by the code field. +func ByCode(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCode, opts...).ToFunc() +} + +// ByParentID orders the results by the parent_id field. +func ByParentID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldParentID, opts...).ToFunc() +} + +// ByOrderNo orders the results by the order_no field. +func ByOrderNo(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOrderNo, opts...).ToFunc() +} + +// ByParentField orders the results by parent field. +func ByParentField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newParentStep(), sql.OrderByField(field, opts...)) + } +} + +// ByChildrenCount orders the results by children count. +func ByChildrenCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newChildrenStep(), opts...) + } +} + +// ByChildren orders the results by children terms. +func ByChildren(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newChildrenStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} +func newParentStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, ParentTable, ParentColumn), + ) +} +func newChildrenStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, ChildrenTable, ChildrenColumn), + ) +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/position/where.go b/monolithic/backend/app/admin/service/internal/data/ent/position/where.go new file mode 100644 index 0000000..6037862 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/position/where.go @@ -0,0 +1,667 @@ +// Code generated by ent, DO NOT EDIT. + +package position + +import ( + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +// ID filters vertices based on their ID field. +func ID(id uint32) predicate.Position { + return predicate.Position(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id uint32) predicate.Position { + return predicate.Position(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id uint32) predicate.Position { + return predicate.Position(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...uint32) predicate.Position { + return predicate.Position(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...uint32) predicate.Position { + return predicate.Position(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id uint32) predicate.Position { + return predicate.Position(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id uint32) predicate.Position { + return predicate.Position(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id uint32) predicate.Position { + return predicate.Position(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id uint32) predicate.Position { + return predicate.Position(sql.FieldLTE(FieldID, id)) +} + +// CreateTime applies equality check predicate on the "create_time" field. It's identical to CreateTimeEQ. +func CreateTime(v time.Time) predicate.Position { + return predicate.Position(sql.FieldEQ(FieldCreateTime, v)) +} + +// UpdateTime applies equality check predicate on the "update_time" field. It's identical to UpdateTimeEQ. +func UpdateTime(v time.Time) predicate.Position { + return predicate.Position(sql.FieldEQ(FieldUpdateTime, v)) +} + +// DeleteTime applies equality check predicate on the "delete_time" field. It's identical to DeleteTimeEQ. +func DeleteTime(v time.Time) predicate.Position { + return predicate.Position(sql.FieldEQ(FieldDeleteTime, v)) +} + +// CreateBy applies equality check predicate on the "create_by" field. It's identical to CreateByEQ. +func CreateBy(v uint32) predicate.Position { + return predicate.Position(sql.FieldEQ(FieldCreateBy, v)) +} + +// Remark applies equality check predicate on the "remark" field. It's identical to RemarkEQ. +func Remark(v string) predicate.Position { + return predicate.Position(sql.FieldEQ(FieldRemark, v)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.Position { + return predicate.Position(sql.FieldEQ(FieldName, v)) +} + +// Code applies equality check predicate on the "code" field. It's identical to CodeEQ. +func Code(v string) predicate.Position { + return predicate.Position(sql.FieldEQ(FieldCode, v)) +} + +// ParentID applies equality check predicate on the "parent_id" field. It's identical to ParentIDEQ. +func ParentID(v uint32) predicate.Position { + return predicate.Position(sql.FieldEQ(FieldParentID, v)) +} + +// OrderNo applies equality check predicate on the "order_no" field. It's identical to OrderNoEQ. +func OrderNo(v int32) predicate.Position { + return predicate.Position(sql.FieldEQ(FieldOrderNo, v)) +} + +// CreateTimeEQ applies the EQ predicate on the "create_time" field. +func CreateTimeEQ(v time.Time) predicate.Position { + return predicate.Position(sql.FieldEQ(FieldCreateTime, v)) +} + +// CreateTimeNEQ applies the NEQ predicate on the "create_time" field. +func CreateTimeNEQ(v time.Time) predicate.Position { + return predicate.Position(sql.FieldNEQ(FieldCreateTime, v)) +} + +// CreateTimeIn applies the In predicate on the "create_time" field. +func CreateTimeIn(vs ...time.Time) predicate.Position { + return predicate.Position(sql.FieldIn(FieldCreateTime, vs...)) +} + +// CreateTimeNotIn applies the NotIn predicate on the "create_time" field. +func CreateTimeNotIn(vs ...time.Time) predicate.Position { + return predicate.Position(sql.FieldNotIn(FieldCreateTime, vs...)) +} + +// CreateTimeGT applies the GT predicate on the "create_time" field. +func CreateTimeGT(v time.Time) predicate.Position { + return predicate.Position(sql.FieldGT(FieldCreateTime, v)) +} + +// CreateTimeGTE applies the GTE predicate on the "create_time" field. +func CreateTimeGTE(v time.Time) predicate.Position { + return predicate.Position(sql.FieldGTE(FieldCreateTime, v)) +} + +// CreateTimeLT applies the LT predicate on the "create_time" field. +func CreateTimeLT(v time.Time) predicate.Position { + return predicate.Position(sql.FieldLT(FieldCreateTime, v)) +} + +// CreateTimeLTE applies the LTE predicate on the "create_time" field. +func CreateTimeLTE(v time.Time) predicate.Position { + return predicate.Position(sql.FieldLTE(FieldCreateTime, v)) +} + +// CreateTimeIsNil applies the IsNil predicate on the "create_time" field. +func CreateTimeIsNil() predicate.Position { + return predicate.Position(sql.FieldIsNull(FieldCreateTime)) +} + +// CreateTimeNotNil applies the NotNil predicate on the "create_time" field. +func CreateTimeNotNil() predicate.Position { + return predicate.Position(sql.FieldNotNull(FieldCreateTime)) +} + +// UpdateTimeEQ applies the EQ predicate on the "update_time" field. +func UpdateTimeEQ(v time.Time) predicate.Position { + return predicate.Position(sql.FieldEQ(FieldUpdateTime, v)) +} + +// UpdateTimeNEQ applies the NEQ predicate on the "update_time" field. +func UpdateTimeNEQ(v time.Time) predicate.Position { + return predicate.Position(sql.FieldNEQ(FieldUpdateTime, v)) +} + +// UpdateTimeIn applies the In predicate on the "update_time" field. +func UpdateTimeIn(vs ...time.Time) predicate.Position { + return predicate.Position(sql.FieldIn(FieldUpdateTime, vs...)) +} + +// UpdateTimeNotIn applies the NotIn predicate on the "update_time" field. +func UpdateTimeNotIn(vs ...time.Time) predicate.Position { + return predicate.Position(sql.FieldNotIn(FieldUpdateTime, vs...)) +} + +// UpdateTimeGT applies the GT predicate on the "update_time" field. +func UpdateTimeGT(v time.Time) predicate.Position { + return predicate.Position(sql.FieldGT(FieldUpdateTime, v)) +} + +// UpdateTimeGTE applies the GTE predicate on the "update_time" field. +func UpdateTimeGTE(v time.Time) predicate.Position { + return predicate.Position(sql.FieldGTE(FieldUpdateTime, v)) +} + +// UpdateTimeLT applies the LT predicate on the "update_time" field. +func UpdateTimeLT(v time.Time) predicate.Position { + return predicate.Position(sql.FieldLT(FieldUpdateTime, v)) +} + +// UpdateTimeLTE applies the LTE predicate on the "update_time" field. +func UpdateTimeLTE(v time.Time) predicate.Position { + return predicate.Position(sql.FieldLTE(FieldUpdateTime, v)) +} + +// UpdateTimeIsNil applies the IsNil predicate on the "update_time" field. +func UpdateTimeIsNil() predicate.Position { + return predicate.Position(sql.FieldIsNull(FieldUpdateTime)) +} + +// UpdateTimeNotNil applies the NotNil predicate on the "update_time" field. +func UpdateTimeNotNil() predicate.Position { + return predicate.Position(sql.FieldNotNull(FieldUpdateTime)) +} + +// DeleteTimeEQ applies the EQ predicate on the "delete_time" field. +func DeleteTimeEQ(v time.Time) predicate.Position { + return predicate.Position(sql.FieldEQ(FieldDeleteTime, v)) +} + +// DeleteTimeNEQ applies the NEQ predicate on the "delete_time" field. +func DeleteTimeNEQ(v time.Time) predicate.Position { + return predicate.Position(sql.FieldNEQ(FieldDeleteTime, v)) +} + +// DeleteTimeIn applies the In predicate on the "delete_time" field. +func DeleteTimeIn(vs ...time.Time) predicate.Position { + return predicate.Position(sql.FieldIn(FieldDeleteTime, vs...)) +} + +// DeleteTimeNotIn applies the NotIn predicate on the "delete_time" field. +func DeleteTimeNotIn(vs ...time.Time) predicate.Position { + return predicate.Position(sql.FieldNotIn(FieldDeleteTime, vs...)) +} + +// DeleteTimeGT applies the GT predicate on the "delete_time" field. +func DeleteTimeGT(v time.Time) predicate.Position { + return predicate.Position(sql.FieldGT(FieldDeleteTime, v)) +} + +// DeleteTimeGTE applies the GTE predicate on the "delete_time" field. +func DeleteTimeGTE(v time.Time) predicate.Position { + return predicate.Position(sql.FieldGTE(FieldDeleteTime, v)) +} + +// DeleteTimeLT applies the LT predicate on the "delete_time" field. +func DeleteTimeLT(v time.Time) predicate.Position { + return predicate.Position(sql.FieldLT(FieldDeleteTime, v)) +} + +// DeleteTimeLTE applies the LTE predicate on the "delete_time" field. +func DeleteTimeLTE(v time.Time) predicate.Position { + return predicate.Position(sql.FieldLTE(FieldDeleteTime, v)) +} + +// DeleteTimeIsNil applies the IsNil predicate on the "delete_time" field. +func DeleteTimeIsNil() predicate.Position { + return predicate.Position(sql.FieldIsNull(FieldDeleteTime)) +} + +// DeleteTimeNotNil applies the NotNil predicate on the "delete_time" field. +func DeleteTimeNotNil() predicate.Position { + return predicate.Position(sql.FieldNotNull(FieldDeleteTime)) +} + +// StatusEQ applies the EQ predicate on the "status" field. +func StatusEQ(v Status) predicate.Position { + return predicate.Position(sql.FieldEQ(FieldStatus, v)) +} + +// StatusNEQ applies the NEQ predicate on the "status" field. +func StatusNEQ(v Status) predicate.Position { + return predicate.Position(sql.FieldNEQ(FieldStatus, v)) +} + +// StatusIn applies the In predicate on the "status" field. +func StatusIn(vs ...Status) predicate.Position { + return predicate.Position(sql.FieldIn(FieldStatus, vs...)) +} + +// StatusNotIn applies the NotIn predicate on the "status" field. +func StatusNotIn(vs ...Status) predicate.Position { + return predicate.Position(sql.FieldNotIn(FieldStatus, vs...)) +} + +// StatusIsNil applies the IsNil predicate on the "status" field. +func StatusIsNil() predicate.Position { + return predicate.Position(sql.FieldIsNull(FieldStatus)) +} + +// StatusNotNil applies the NotNil predicate on the "status" field. +func StatusNotNil() predicate.Position { + return predicate.Position(sql.FieldNotNull(FieldStatus)) +} + +// CreateByEQ applies the EQ predicate on the "create_by" field. +func CreateByEQ(v uint32) predicate.Position { + return predicate.Position(sql.FieldEQ(FieldCreateBy, v)) +} + +// CreateByNEQ applies the NEQ predicate on the "create_by" field. +func CreateByNEQ(v uint32) predicate.Position { + return predicate.Position(sql.FieldNEQ(FieldCreateBy, v)) +} + +// CreateByIn applies the In predicate on the "create_by" field. +func CreateByIn(vs ...uint32) predicate.Position { + return predicate.Position(sql.FieldIn(FieldCreateBy, vs...)) +} + +// CreateByNotIn applies the NotIn predicate on the "create_by" field. +func CreateByNotIn(vs ...uint32) predicate.Position { + return predicate.Position(sql.FieldNotIn(FieldCreateBy, vs...)) +} + +// CreateByGT applies the GT predicate on the "create_by" field. +func CreateByGT(v uint32) predicate.Position { + return predicate.Position(sql.FieldGT(FieldCreateBy, v)) +} + +// CreateByGTE applies the GTE predicate on the "create_by" field. +func CreateByGTE(v uint32) predicate.Position { + return predicate.Position(sql.FieldGTE(FieldCreateBy, v)) +} + +// CreateByLT applies the LT predicate on the "create_by" field. +func CreateByLT(v uint32) predicate.Position { + return predicate.Position(sql.FieldLT(FieldCreateBy, v)) +} + +// CreateByLTE applies the LTE predicate on the "create_by" field. +func CreateByLTE(v uint32) predicate.Position { + return predicate.Position(sql.FieldLTE(FieldCreateBy, v)) +} + +// CreateByIsNil applies the IsNil predicate on the "create_by" field. +func CreateByIsNil() predicate.Position { + return predicate.Position(sql.FieldIsNull(FieldCreateBy)) +} + +// CreateByNotNil applies the NotNil predicate on the "create_by" field. +func CreateByNotNil() predicate.Position { + return predicate.Position(sql.FieldNotNull(FieldCreateBy)) +} + +// RemarkEQ applies the EQ predicate on the "remark" field. +func RemarkEQ(v string) predicate.Position { + return predicate.Position(sql.FieldEQ(FieldRemark, v)) +} + +// RemarkNEQ applies the NEQ predicate on the "remark" field. +func RemarkNEQ(v string) predicate.Position { + return predicate.Position(sql.FieldNEQ(FieldRemark, v)) +} + +// RemarkIn applies the In predicate on the "remark" field. +func RemarkIn(vs ...string) predicate.Position { + return predicate.Position(sql.FieldIn(FieldRemark, vs...)) +} + +// RemarkNotIn applies the NotIn predicate on the "remark" field. +func RemarkNotIn(vs ...string) predicate.Position { + return predicate.Position(sql.FieldNotIn(FieldRemark, vs...)) +} + +// RemarkGT applies the GT predicate on the "remark" field. +func RemarkGT(v string) predicate.Position { + return predicate.Position(sql.FieldGT(FieldRemark, v)) +} + +// RemarkGTE applies the GTE predicate on the "remark" field. +func RemarkGTE(v string) predicate.Position { + return predicate.Position(sql.FieldGTE(FieldRemark, v)) +} + +// RemarkLT applies the LT predicate on the "remark" field. +func RemarkLT(v string) predicate.Position { + return predicate.Position(sql.FieldLT(FieldRemark, v)) +} + +// RemarkLTE applies the LTE predicate on the "remark" field. +func RemarkLTE(v string) predicate.Position { + return predicate.Position(sql.FieldLTE(FieldRemark, v)) +} + +// RemarkContains applies the Contains predicate on the "remark" field. +func RemarkContains(v string) predicate.Position { + return predicate.Position(sql.FieldContains(FieldRemark, v)) +} + +// RemarkHasPrefix applies the HasPrefix predicate on the "remark" field. +func RemarkHasPrefix(v string) predicate.Position { + return predicate.Position(sql.FieldHasPrefix(FieldRemark, v)) +} + +// RemarkHasSuffix applies the HasSuffix predicate on the "remark" field. +func RemarkHasSuffix(v string) predicate.Position { + return predicate.Position(sql.FieldHasSuffix(FieldRemark, v)) +} + +// RemarkIsNil applies the IsNil predicate on the "remark" field. +func RemarkIsNil() predicate.Position { + return predicate.Position(sql.FieldIsNull(FieldRemark)) +} + +// RemarkNotNil applies the NotNil predicate on the "remark" field. +func RemarkNotNil() predicate.Position { + return predicate.Position(sql.FieldNotNull(FieldRemark)) +} + +// RemarkEqualFold applies the EqualFold predicate on the "remark" field. +func RemarkEqualFold(v string) predicate.Position { + return predicate.Position(sql.FieldEqualFold(FieldRemark, v)) +} + +// RemarkContainsFold applies the ContainsFold predicate on the "remark" field. +func RemarkContainsFold(v string) predicate.Position { + return predicate.Position(sql.FieldContainsFold(FieldRemark, v)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.Position { + return predicate.Position(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.Position { + return predicate.Position(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.Position { + return predicate.Position(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.Position { + return predicate.Position(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.Position { + return predicate.Position(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.Position { + return predicate.Position(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.Position { + return predicate.Position(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.Position { + return predicate.Position(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.Position { + return predicate.Position(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.Position { + return predicate.Position(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.Position { + return predicate.Position(sql.FieldHasSuffix(FieldName, v)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.Position { + return predicate.Position(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.Position { + return predicate.Position(sql.FieldContainsFold(FieldName, v)) +} + +// CodeEQ applies the EQ predicate on the "code" field. +func CodeEQ(v string) predicate.Position { + return predicate.Position(sql.FieldEQ(FieldCode, v)) +} + +// CodeNEQ applies the NEQ predicate on the "code" field. +func CodeNEQ(v string) predicate.Position { + return predicate.Position(sql.FieldNEQ(FieldCode, v)) +} + +// CodeIn applies the In predicate on the "code" field. +func CodeIn(vs ...string) predicate.Position { + return predicate.Position(sql.FieldIn(FieldCode, vs...)) +} + +// CodeNotIn applies the NotIn predicate on the "code" field. +func CodeNotIn(vs ...string) predicate.Position { + return predicate.Position(sql.FieldNotIn(FieldCode, vs...)) +} + +// CodeGT applies the GT predicate on the "code" field. +func CodeGT(v string) predicate.Position { + return predicate.Position(sql.FieldGT(FieldCode, v)) +} + +// CodeGTE applies the GTE predicate on the "code" field. +func CodeGTE(v string) predicate.Position { + return predicate.Position(sql.FieldGTE(FieldCode, v)) +} + +// CodeLT applies the LT predicate on the "code" field. +func CodeLT(v string) predicate.Position { + return predicate.Position(sql.FieldLT(FieldCode, v)) +} + +// CodeLTE applies the LTE predicate on the "code" field. +func CodeLTE(v string) predicate.Position { + return predicate.Position(sql.FieldLTE(FieldCode, v)) +} + +// CodeContains applies the Contains predicate on the "code" field. +func CodeContains(v string) predicate.Position { + return predicate.Position(sql.FieldContains(FieldCode, v)) +} + +// CodeHasPrefix applies the HasPrefix predicate on the "code" field. +func CodeHasPrefix(v string) predicate.Position { + return predicate.Position(sql.FieldHasPrefix(FieldCode, v)) +} + +// CodeHasSuffix applies the HasSuffix predicate on the "code" field. +func CodeHasSuffix(v string) predicate.Position { + return predicate.Position(sql.FieldHasSuffix(FieldCode, v)) +} + +// CodeEqualFold applies the EqualFold predicate on the "code" field. +func CodeEqualFold(v string) predicate.Position { + return predicate.Position(sql.FieldEqualFold(FieldCode, v)) +} + +// CodeContainsFold applies the ContainsFold predicate on the "code" field. +func CodeContainsFold(v string) predicate.Position { + return predicate.Position(sql.FieldContainsFold(FieldCode, v)) +} + +// ParentIDEQ applies the EQ predicate on the "parent_id" field. +func ParentIDEQ(v uint32) predicate.Position { + return predicate.Position(sql.FieldEQ(FieldParentID, v)) +} + +// ParentIDNEQ applies the NEQ predicate on the "parent_id" field. +func ParentIDNEQ(v uint32) predicate.Position { + return predicate.Position(sql.FieldNEQ(FieldParentID, v)) +} + +// ParentIDIn applies the In predicate on the "parent_id" field. +func ParentIDIn(vs ...uint32) predicate.Position { + return predicate.Position(sql.FieldIn(FieldParentID, vs...)) +} + +// ParentIDNotIn applies the NotIn predicate on the "parent_id" field. +func ParentIDNotIn(vs ...uint32) predicate.Position { + return predicate.Position(sql.FieldNotIn(FieldParentID, vs...)) +} + +// ParentIDIsNil applies the IsNil predicate on the "parent_id" field. +func ParentIDIsNil() predicate.Position { + return predicate.Position(sql.FieldIsNull(FieldParentID)) +} + +// ParentIDNotNil applies the NotNil predicate on the "parent_id" field. +func ParentIDNotNil() predicate.Position { + return predicate.Position(sql.FieldNotNull(FieldParentID)) +} + +// OrderNoEQ applies the EQ predicate on the "order_no" field. +func OrderNoEQ(v int32) predicate.Position { + return predicate.Position(sql.FieldEQ(FieldOrderNo, v)) +} + +// OrderNoNEQ applies the NEQ predicate on the "order_no" field. +func OrderNoNEQ(v int32) predicate.Position { + return predicate.Position(sql.FieldNEQ(FieldOrderNo, v)) +} + +// OrderNoIn applies the In predicate on the "order_no" field. +func OrderNoIn(vs ...int32) predicate.Position { + return predicate.Position(sql.FieldIn(FieldOrderNo, vs...)) +} + +// OrderNoNotIn applies the NotIn predicate on the "order_no" field. +func OrderNoNotIn(vs ...int32) predicate.Position { + return predicate.Position(sql.FieldNotIn(FieldOrderNo, vs...)) +} + +// OrderNoGT applies the GT predicate on the "order_no" field. +func OrderNoGT(v int32) predicate.Position { + return predicate.Position(sql.FieldGT(FieldOrderNo, v)) +} + +// OrderNoGTE applies the GTE predicate on the "order_no" field. +func OrderNoGTE(v int32) predicate.Position { + return predicate.Position(sql.FieldGTE(FieldOrderNo, v)) +} + +// OrderNoLT applies the LT predicate on the "order_no" field. +func OrderNoLT(v int32) predicate.Position { + return predicate.Position(sql.FieldLT(FieldOrderNo, v)) +} + +// OrderNoLTE applies the LTE predicate on the "order_no" field. +func OrderNoLTE(v int32) predicate.Position { + return predicate.Position(sql.FieldLTE(FieldOrderNo, v)) +} + +// HasParent applies the HasEdge predicate on the "parent" edge. +func HasParent() predicate.Position { + return predicate.Position(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, ParentTable, ParentColumn), + ) + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasParentWith applies the HasEdge predicate on the "parent" edge with a given conditions (other predicates). +func HasParentWith(preds ...predicate.Position) predicate.Position { + return predicate.Position(func(s *sql.Selector) { + step := newParentStep() + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasChildren applies the HasEdge predicate on the "children" edge. +func HasChildren() predicate.Position { + return predicate.Position(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, ChildrenTable, ChildrenColumn), + ) + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasChildrenWith applies the HasEdge predicate on the "children" edge with a given conditions (other predicates). +func HasChildrenWith(preds ...predicate.Position) predicate.Position { + return predicate.Position(func(s *sql.Selector) { + step := newChildrenStep() + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.Position) predicate.Position { + return predicate.Position(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.Position) predicate.Position { + return predicate.Position(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.Position) predicate.Position { + return predicate.Position(sql.NotPredicates(p)) +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/position_create.go b/monolithic/backend/app/admin/service/internal/data/ent/position_create.go new file mode 100644 index 0000000..ca21f90 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/position_create.go @@ -0,0 +1,1246 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "errors" + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/position" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// PositionCreate is the builder for creating a Position entity. +type PositionCreate struct { + config + mutation *PositionMutation + hooks []Hook + conflict []sql.ConflictOption +} + +// SetCreateTime sets the "create_time" field. +func (pc *PositionCreate) SetCreateTime(t time.Time) *PositionCreate { + pc.mutation.SetCreateTime(t) + return pc +} + +// SetNillableCreateTime sets the "create_time" field if the given value is not nil. +func (pc *PositionCreate) SetNillableCreateTime(t *time.Time) *PositionCreate { + if t != nil { + pc.SetCreateTime(*t) + } + return pc +} + +// SetUpdateTime sets the "update_time" field. +func (pc *PositionCreate) SetUpdateTime(t time.Time) *PositionCreate { + pc.mutation.SetUpdateTime(t) + return pc +} + +// SetNillableUpdateTime sets the "update_time" field if the given value is not nil. +func (pc *PositionCreate) SetNillableUpdateTime(t *time.Time) *PositionCreate { + if t != nil { + pc.SetUpdateTime(*t) + } + return pc +} + +// SetDeleteTime sets the "delete_time" field. +func (pc *PositionCreate) SetDeleteTime(t time.Time) *PositionCreate { + pc.mutation.SetDeleteTime(t) + return pc +} + +// SetNillableDeleteTime sets the "delete_time" field if the given value is not nil. +func (pc *PositionCreate) SetNillableDeleteTime(t *time.Time) *PositionCreate { + if t != nil { + pc.SetDeleteTime(*t) + } + return pc +} + +// SetStatus sets the "status" field. +func (pc *PositionCreate) SetStatus(po position.Status) *PositionCreate { + pc.mutation.SetStatus(po) + return pc +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (pc *PositionCreate) SetNillableStatus(po *position.Status) *PositionCreate { + if po != nil { + pc.SetStatus(*po) + } + return pc +} + +// SetCreateBy sets the "create_by" field. +func (pc *PositionCreate) SetCreateBy(u uint32) *PositionCreate { + pc.mutation.SetCreateBy(u) + return pc +} + +// SetNillableCreateBy sets the "create_by" field if the given value is not nil. +func (pc *PositionCreate) SetNillableCreateBy(u *uint32) *PositionCreate { + if u != nil { + pc.SetCreateBy(*u) + } + return pc +} + +// SetRemark sets the "remark" field. +func (pc *PositionCreate) SetRemark(s string) *PositionCreate { + pc.mutation.SetRemark(s) + return pc +} + +// SetNillableRemark sets the "remark" field if the given value is not nil. +func (pc *PositionCreate) SetNillableRemark(s *string) *PositionCreate { + if s != nil { + pc.SetRemark(*s) + } + return pc +} + +// SetName sets the "name" field. +func (pc *PositionCreate) SetName(s string) *PositionCreate { + pc.mutation.SetName(s) + return pc +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (pc *PositionCreate) SetNillableName(s *string) *PositionCreate { + if s != nil { + pc.SetName(*s) + } + return pc +} + +// SetCode sets the "code" field. +func (pc *PositionCreate) SetCode(s string) *PositionCreate { + pc.mutation.SetCode(s) + return pc +} + +// SetNillableCode sets the "code" field if the given value is not nil. +func (pc *PositionCreate) SetNillableCode(s *string) *PositionCreate { + if s != nil { + pc.SetCode(*s) + } + return pc +} + +// SetParentID sets the "parent_id" field. +func (pc *PositionCreate) SetParentID(u uint32) *PositionCreate { + pc.mutation.SetParentID(u) + return pc +} + +// SetNillableParentID sets the "parent_id" field if the given value is not nil. +func (pc *PositionCreate) SetNillableParentID(u *uint32) *PositionCreate { + if u != nil { + pc.SetParentID(*u) + } + return pc +} + +// SetOrderNo sets the "order_no" field. +func (pc *PositionCreate) SetOrderNo(i int32) *PositionCreate { + pc.mutation.SetOrderNo(i) + return pc +} + +// SetNillableOrderNo sets the "order_no" field if the given value is not nil. +func (pc *PositionCreate) SetNillableOrderNo(i *int32) *PositionCreate { + if i != nil { + pc.SetOrderNo(*i) + } + return pc +} + +// SetID sets the "id" field. +func (pc *PositionCreate) SetID(u uint32) *PositionCreate { + pc.mutation.SetID(u) + return pc +} + +// SetParent sets the "parent" edge to the Position entity. +func (pc *PositionCreate) SetParent(p *Position) *PositionCreate { + return pc.SetParentID(p.ID) +} + +// AddChildIDs adds the "children" edge to the Position entity by IDs. +func (pc *PositionCreate) AddChildIDs(ids ...uint32) *PositionCreate { + pc.mutation.AddChildIDs(ids...) + return pc +} + +// AddChildren adds the "children" edges to the Position entity. +func (pc *PositionCreate) AddChildren(p ...*Position) *PositionCreate { + ids := make([]uint32, len(p)) + for i := range p { + ids[i] = p[i].ID + } + return pc.AddChildIDs(ids...) +} + +// Mutation returns the PositionMutation object of the builder. +func (pc *PositionCreate) Mutation() *PositionMutation { + return pc.mutation +} + +// Save creates the Position in the database. +func (pc *PositionCreate) Save(ctx context.Context) (*Position, error) { + pc.defaults() + return withHooks(ctx, pc.sqlSave, pc.mutation, pc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (pc *PositionCreate) SaveX(ctx context.Context) *Position { + v, err := pc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (pc *PositionCreate) Exec(ctx context.Context) error { + _, err := pc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (pc *PositionCreate) ExecX(ctx context.Context) { + if err := pc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (pc *PositionCreate) defaults() { + if _, ok := pc.mutation.Status(); !ok { + v := position.DefaultStatus + pc.mutation.SetStatus(v) + } + if _, ok := pc.mutation.Remark(); !ok { + v := position.DefaultRemark + pc.mutation.SetRemark(v) + } + if _, ok := pc.mutation.Name(); !ok { + v := position.DefaultName + pc.mutation.SetName(v) + } + if _, ok := pc.mutation.Code(); !ok { + v := position.DefaultCode + pc.mutation.SetCode(v) + } + if _, ok := pc.mutation.ParentID(); !ok { + v := position.DefaultParentID + pc.mutation.SetParentID(v) + } + if _, ok := pc.mutation.OrderNo(); !ok { + v := position.DefaultOrderNo + pc.mutation.SetOrderNo(v) + } +} + +// check runs all checks and user-defined validators on the builder. +func (pc *PositionCreate) check() error { + if v, ok := pc.mutation.Status(); ok { + if err := position.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "Position.status": %w`, err)} + } + } + if _, ok := pc.mutation.Name(); !ok { + return &ValidationError{Name: "name", err: errors.New(`ent: missing required field "Position.name"`)} + } + if v, ok := pc.mutation.Name(); ok { + if err := position.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "Position.name": %w`, err)} + } + } + if _, ok := pc.mutation.Code(); !ok { + return &ValidationError{Name: "code", err: errors.New(`ent: missing required field "Position.code"`)} + } + if v, ok := pc.mutation.Code(); ok { + if err := position.CodeValidator(v); err != nil { + return &ValidationError{Name: "code", err: fmt.Errorf(`ent: validator failed for field "Position.code": %w`, err)} + } + } + if _, ok := pc.mutation.OrderNo(); !ok { + return &ValidationError{Name: "order_no", err: errors.New(`ent: missing required field "Position.order_no"`)} + } + if v, ok := pc.mutation.ID(); ok { + if err := position.IDValidator(v); err != nil { + return &ValidationError{Name: "id", err: fmt.Errorf(`ent: validator failed for field "Position.id": %w`, err)} + } + } + return nil +} + +func (pc *PositionCreate) sqlSave(ctx context.Context) (*Position, error) { + if err := pc.check(); err != nil { + return nil, err + } + _node, _spec := pc.createSpec() + if err := sqlgraph.CreateNode(ctx, pc.driver, _spec); err != nil { + if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + if _spec.ID.Value != _node.ID { + id := _spec.ID.Value.(int64) + _node.ID = uint32(id) + } + pc.mutation.id = &_node.ID + pc.mutation.done = true + return _node, nil +} + +func (pc *PositionCreate) createSpec() (*Position, *sqlgraph.CreateSpec) { + var ( + _node = &Position{config: pc.config} + _spec = sqlgraph.NewCreateSpec(position.Table, sqlgraph.NewFieldSpec(position.FieldID, field.TypeUint32)) + ) + _spec.OnConflict = pc.conflict + if id, ok := pc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := pc.mutation.CreateTime(); ok { + _spec.SetField(position.FieldCreateTime, field.TypeTime, value) + _node.CreateTime = &value + } + if value, ok := pc.mutation.UpdateTime(); ok { + _spec.SetField(position.FieldUpdateTime, field.TypeTime, value) + _node.UpdateTime = &value + } + if value, ok := pc.mutation.DeleteTime(); ok { + _spec.SetField(position.FieldDeleteTime, field.TypeTime, value) + _node.DeleteTime = &value + } + if value, ok := pc.mutation.Status(); ok { + _spec.SetField(position.FieldStatus, field.TypeEnum, value) + _node.Status = &value + } + if value, ok := pc.mutation.CreateBy(); ok { + _spec.SetField(position.FieldCreateBy, field.TypeUint32, value) + _node.CreateBy = &value + } + if value, ok := pc.mutation.Remark(); ok { + _spec.SetField(position.FieldRemark, field.TypeString, value) + _node.Remark = &value + } + if value, ok := pc.mutation.Name(); ok { + _spec.SetField(position.FieldName, field.TypeString, value) + _node.Name = value + } + if value, ok := pc.mutation.Code(); ok { + _spec.SetField(position.FieldCode, field.TypeString, value) + _node.Code = value + } + if value, ok := pc.mutation.OrderNo(); ok { + _spec.SetField(position.FieldOrderNo, field.TypeInt32, value) + _node.OrderNo = value + } + if nodes := pc.mutation.ParentIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: position.ParentTable, + Columns: []string{position.ParentColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(position.FieldID, field.TypeUint32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.ParentID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := pc.mutation.ChildrenIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: position.ChildrenTable, + Columns: []string{position.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(position.FieldID, field.TypeUint32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause +// of the `INSERT` statement. For example: +// +// client.Position.Create(). +// SetCreateTime(v). +// OnConflict( +// // Update the row with the new values +// // the was proposed for insertion. +// sql.ResolveWithNewValues(), +// ). +// // Override some of the fields with custom +// // update values. +// Update(func(u *ent.PositionUpsert) { +// SetCreateTime(v+v). +// }). +// Exec(ctx) +func (pc *PositionCreate) OnConflict(opts ...sql.ConflictOption) *PositionUpsertOne { + pc.conflict = opts + return &PositionUpsertOne{ + create: pc, + } +} + +// OnConflictColumns calls `OnConflict` and configures the columns +// as conflict target. Using this option is equivalent to using: +// +// client.Position.Create(). +// OnConflict(sql.ConflictColumns(columns...)). +// Exec(ctx) +func (pc *PositionCreate) OnConflictColumns(columns ...string) *PositionUpsertOne { + pc.conflict = append(pc.conflict, sql.ConflictColumns(columns...)) + return &PositionUpsertOne{ + create: pc, + } +} + +type ( + // PositionUpsertOne is the builder for "upsert"-ing + // one Position node. + PositionUpsertOne struct { + create *PositionCreate + } + + // PositionUpsert is the "OnConflict" setter. + PositionUpsert struct { + *sql.UpdateSet + } +) + +// SetUpdateTime sets the "update_time" field. +func (u *PositionUpsert) SetUpdateTime(v time.Time) *PositionUpsert { + u.Set(position.FieldUpdateTime, v) + return u +} + +// UpdateUpdateTime sets the "update_time" field to the value that was provided on create. +func (u *PositionUpsert) UpdateUpdateTime() *PositionUpsert { + u.SetExcluded(position.FieldUpdateTime) + return u +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (u *PositionUpsert) ClearUpdateTime() *PositionUpsert { + u.SetNull(position.FieldUpdateTime) + return u +} + +// SetDeleteTime sets the "delete_time" field. +func (u *PositionUpsert) SetDeleteTime(v time.Time) *PositionUpsert { + u.Set(position.FieldDeleteTime, v) + return u +} + +// UpdateDeleteTime sets the "delete_time" field to the value that was provided on create. +func (u *PositionUpsert) UpdateDeleteTime() *PositionUpsert { + u.SetExcluded(position.FieldDeleteTime) + return u +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (u *PositionUpsert) ClearDeleteTime() *PositionUpsert { + u.SetNull(position.FieldDeleteTime) + return u +} + +// SetStatus sets the "status" field. +func (u *PositionUpsert) SetStatus(v position.Status) *PositionUpsert { + u.Set(position.FieldStatus, v) + return u +} + +// UpdateStatus sets the "status" field to the value that was provided on create. +func (u *PositionUpsert) UpdateStatus() *PositionUpsert { + u.SetExcluded(position.FieldStatus) + return u +} + +// ClearStatus clears the value of the "status" field. +func (u *PositionUpsert) ClearStatus() *PositionUpsert { + u.SetNull(position.FieldStatus) + return u +} + +// SetCreateBy sets the "create_by" field. +func (u *PositionUpsert) SetCreateBy(v uint32) *PositionUpsert { + u.Set(position.FieldCreateBy, v) + return u +} + +// UpdateCreateBy sets the "create_by" field to the value that was provided on create. +func (u *PositionUpsert) UpdateCreateBy() *PositionUpsert { + u.SetExcluded(position.FieldCreateBy) + return u +} + +// AddCreateBy adds v to the "create_by" field. +func (u *PositionUpsert) AddCreateBy(v uint32) *PositionUpsert { + u.Add(position.FieldCreateBy, v) + return u +} + +// ClearCreateBy clears the value of the "create_by" field. +func (u *PositionUpsert) ClearCreateBy() *PositionUpsert { + u.SetNull(position.FieldCreateBy) + return u +} + +// SetRemark sets the "remark" field. +func (u *PositionUpsert) SetRemark(v string) *PositionUpsert { + u.Set(position.FieldRemark, v) + return u +} + +// UpdateRemark sets the "remark" field to the value that was provided on create. +func (u *PositionUpsert) UpdateRemark() *PositionUpsert { + u.SetExcluded(position.FieldRemark) + return u +} + +// ClearRemark clears the value of the "remark" field. +func (u *PositionUpsert) ClearRemark() *PositionUpsert { + u.SetNull(position.FieldRemark) + return u +} + +// SetName sets the "name" field. +func (u *PositionUpsert) SetName(v string) *PositionUpsert { + u.Set(position.FieldName, v) + return u +} + +// UpdateName sets the "name" field to the value that was provided on create. +func (u *PositionUpsert) UpdateName() *PositionUpsert { + u.SetExcluded(position.FieldName) + return u +} + +// SetCode sets the "code" field. +func (u *PositionUpsert) SetCode(v string) *PositionUpsert { + u.Set(position.FieldCode, v) + return u +} + +// UpdateCode sets the "code" field to the value that was provided on create. +func (u *PositionUpsert) UpdateCode() *PositionUpsert { + u.SetExcluded(position.FieldCode) + return u +} + +// SetParentID sets the "parent_id" field. +func (u *PositionUpsert) SetParentID(v uint32) *PositionUpsert { + u.Set(position.FieldParentID, v) + return u +} + +// UpdateParentID sets the "parent_id" field to the value that was provided on create. +func (u *PositionUpsert) UpdateParentID() *PositionUpsert { + u.SetExcluded(position.FieldParentID) + return u +} + +// ClearParentID clears the value of the "parent_id" field. +func (u *PositionUpsert) ClearParentID() *PositionUpsert { + u.SetNull(position.FieldParentID) + return u +} + +// SetOrderNo sets the "order_no" field. +func (u *PositionUpsert) SetOrderNo(v int32) *PositionUpsert { + u.Set(position.FieldOrderNo, v) + return u +} + +// UpdateOrderNo sets the "order_no" field to the value that was provided on create. +func (u *PositionUpsert) UpdateOrderNo() *PositionUpsert { + u.SetExcluded(position.FieldOrderNo) + return u +} + +// AddOrderNo adds v to the "order_no" field. +func (u *PositionUpsert) AddOrderNo(v int32) *PositionUpsert { + u.Add(position.FieldOrderNo, v) + return u +} + +// UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. +// Using this option is equivalent to using: +// +// client.Position.Create(). +// OnConflict( +// sql.ResolveWithNewValues(), +// sql.ResolveWith(func(u *sql.UpdateSet) { +// u.SetIgnore(position.FieldID) +// }), +// ). +// Exec(ctx) +func (u *PositionUpsertOne) UpdateNewValues() *PositionUpsertOne { + u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues()) + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) { + if _, exists := u.create.mutation.ID(); exists { + s.SetIgnore(position.FieldID) + } + if _, exists := u.create.mutation.CreateTime(); exists { + s.SetIgnore(position.FieldCreateTime) + } + })) + return u +} + +// Ignore sets each column to itself in case of conflict. +// Using this option is equivalent to using: +// +// client.Position.Create(). +// OnConflict(sql.ResolveWithIgnore()). +// Exec(ctx) +func (u *PositionUpsertOne) Ignore() *PositionUpsertOne { + u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore()) + return u +} + +// DoNothing configures the conflict_action to `DO NOTHING`. +// Supported only by SQLite and PostgreSQL. +func (u *PositionUpsertOne) DoNothing() *PositionUpsertOne { + u.create.conflict = append(u.create.conflict, sql.DoNothing()) + return u +} + +// Update allows overriding fields `UPDATE` values. See the PositionCreate.OnConflict +// documentation for more info. +func (u *PositionUpsertOne) Update(set func(*PositionUpsert)) *PositionUpsertOne { + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) { + set(&PositionUpsert{UpdateSet: update}) + })) + return u +} + +// SetUpdateTime sets the "update_time" field. +func (u *PositionUpsertOne) SetUpdateTime(v time.Time) *PositionUpsertOne { + return u.Update(func(s *PositionUpsert) { + s.SetUpdateTime(v) + }) +} + +// UpdateUpdateTime sets the "update_time" field to the value that was provided on create. +func (u *PositionUpsertOne) UpdateUpdateTime() *PositionUpsertOne { + return u.Update(func(s *PositionUpsert) { + s.UpdateUpdateTime() + }) +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (u *PositionUpsertOne) ClearUpdateTime() *PositionUpsertOne { + return u.Update(func(s *PositionUpsert) { + s.ClearUpdateTime() + }) +} + +// SetDeleteTime sets the "delete_time" field. +func (u *PositionUpsertOne) SetDeleteTime(v time.Time) *PositionUpsertOne { + return u.Update(func(s *PositionUpsert) { + s.SetDeleteTime(v) + }) +} + +// UpdateDeleteTime sets the "delete_time" field to the value that was provided on create. +func (u *PositionUpsertOne) UpdateDeleteTime() *PositionUpsertOne { + return u.Update(func(s *PositionUpsert) { + s.UpdateDeleteTime() + }) +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (u *PositionUpsertOne) ClearDeleteTime() *PositionUpsertOne { + return u.Update(func(s *PositionUpsert) { + s.ClearDeleteTime() + }) +} + +// SetStatus sets the "status" field. +func (u *PositionUpsertOne) SetStatus(v position.Status) *PositionUpsertOne { + return u.Update(func(s *PositionUpsert) { + s.SetStatus(v) + }) +} + +// UpdateStatus sets the "status" field to the value that was provided on create. +func (u *PositionUpsertOne) UpdateStatus() *PositionUpsertOne { + return u.Update(func(s *PositionUpsert) { + s.UpdateStatus() + }) +} + +// ClearStatus clears the value of the "status" field. +func (u *PositionUpsertOne) ClearStatus() *PositionUpsertOne { + return u.Update(func(s *PositionUpsert) { + s.ClearStatus() + }) +} + +// SetCreateBy sets the "create_by" field. +func (u *PositionUpsertOne) SetCreateBy(v uint32) *PositionUpsertOne { + return u.Update(func(s *PositionUpsert) { + s.SetCreateBy(v) + }) +} + +// AddCreateBy adds v to the "create_by" field. +func (u *PositionUpsertOne) AddCreateBy(v uint32) *PositionUpsertOne { + return u.Update(func(s *PositionUpsert) { + s.AddCreateBy(v) + }) +} + +// UpdateCreateBy sets the "create_by" field to the value that was provided on create. +func (u *PositionUpsertOne) UpdateCreateBy() *PositionUpsertOne { + return u.Update(func(s *PositionUpsert) { + s.UpdateCreateBy() + }) +} + +// ClearCreateBy clears the value of the "create_by" field. +func (u *PositionUpsertOne) ClearCreateBy() *PositionUpsertOne { + return u.Update(func(s *PositionUpsert) { + s.ClearCreateBy() + }) +} + +// SetRemark sets the "remark" field. +func (u *PositionUpsertOne) SetRemark(v string) *PositionUpsertOne { + return u.Update(func(s *PositionUpsert) { + s.SetRemark(v) + }) +} + +// UpdateRemark sets the "remark" field to the value that was provided on create. +func (u *PositionUpsertOne) UpdateRemark() *PositionUpsertOne { + return u.Update(func(s *PositionUpsert) { + s.UpdateRemark() + }) +} + +// ClearRemark clears the value of the "remark" field. +func (u *PositionUpsertOne) ClearRemark() *PositionUpsertOne { + return u.Update(func(s *PositionUpsert) { + s.ClearRemark() + }) +} + +// SetName sets the "name" field. +func (u *PositionUpsertOne) SetName(v string) *PositionUpsertOne { + return u.Update(func(s *PositionUpsert) { + s.SetName(v) + }) +} + +// UpdateName sets the "name" field to the value that was provided on create. +func (u *PositionUpsertOne) UpdateName() *PositionUpsertOne { + return u.Update(func(s *PositionUpsert) { + s.UpdateName() + }) +} + +// SetCode sets the "code" field. +func (u *PositionUpsertOne) SetCode(v string) *PositionUpsertOne { + return u.Update(func(s *PositionUpsert) { + s.SetCode(v) + }) +} + +// UpdateCode sets the "code" field to the value that was provided on create. +func (u *PositionUpsertOne) UpdateCode() *PositionUpsertOne { + return u.Update(func(s *PositionUpsert) { + s.UpdateCode() + }) +} + +// SetParentID sets the "parent_id" field. +func (u *PositionUpsertOne) SetParentID(v uint32) *PositionUpsertOne { + return u.Update(func(s *PositionUpsert) { + s.SetParentID(v) + }) +} + +// UpdateParentID sets the "parent_id" field to the value that was provided on create. +func (u *PositionUpsertOne) UpdateParentID() *PositionUpsertOne { + return u.Update(func(s *PositionUpsert) { + s.UpdateParentID() + }) +} + +// ClearParentID clears the value of the "parent_id" field. +func (u *PositionUpsertOne) ClearParentID() *PositionUpsertOne { + return u.Update(func(s *PositionUpsert) { + s.ClearParentID() + }) +} + +// SetOrderNo sets the "order_no" field. +func (u *PositionUpsertOne) SetOrderNo(v int32) *PositionUpsertOne { + return u.Update(func(s *PositionUpsert) { + s.SetOrderNo(v) + }) +} + +// AddOrderNo adds v to the "order_no" field. +func (u *PositionUpsertOne) AddOrderNo(v int32) *PositionUpsertOne { + return u.Update(func(s *PositionUpsert) { + s.AddOrderNo(v) + }) +} + +// UpdateOrderNo sets the "order_no" field to the value that was provided on create. +func (u *PositionUpsertOne) UpdateOrderNo() *PositionUpsertOne { + return u.Update(func(s *PositionUpsert) { + s.UpdateOrderNo() + }) +} + +// Exec executes the query. +func (u *PositionUpsertOne) Exec(ctx context.Context) error { + if len(u.create.conflict) == 0 { + return errors.New("ent: missing options for PositionCreate.OnConflict") + } + return u.create.Exec(ctx) +} + +// ExecX is like Exec, but panics if an error occurs. +func (u *PositionUpsertOne) ExecX(ctx context.Context) { + if err := u.create.Exec(ctx); err != nil { + panic(err) + } +} + +// Exec executes the UPSERT query and returns the inserted/updated ID. +func (u *PositionUpsertOne) ID(ctx context.Context) (id uint32, err error) { + node, err := u.create.Save(ctx) + if err != nil { + return id, err + } + return node.ID, nil +} + +// IDX is like ID, but panics if an error occurs. +func (u *PositionUpsertOne) IDX(ctx context.Context) uint32 { + id, err := u.ID(ctx) + if err != nil { + panic(err) + } + return id +} + +// PositionCreateBulk is the builder for creating many Position entities in bulk. +type PositionCreateBulk struct { + config + err error + builders []*PositionCreate + conflict []sql.ConflictOption +} + +// Save creates the Position entities in the database. +func (pcb *PositionCreateBulk) Save(ctx context.Context) ([]*Position, error) { + if pcb.err != nil { + return nil, pcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(pcb.builders)) + nodes := make([]*Position, len(pcb.builders)) + mutators := make([]Mutator, len(pcb.builders)) + for i := range pcb.builders { + func(i int, root context.Context) { + builder := pcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*PositionMutation) + if !ok { + return nil, fmt.Errorf("unexpected mutation type %T", m) + } + if err := builder.check(); err != nil { + return nil, err + } + builder.mutation = mutation + var err error + nodes[i], specs[i] = builder.createSpec() + if i < len(mutators)-1 { + _, err = mutators[i+1].Mutate(root, pcb.builders[i+1].mutation) + } else { + spec := &sqlgraph.BatchCreateSpec{Nodes: specs} + spec.OnConflict = pcb.conflict + // Invoke the actual operation on the latest mutation in the chain. + if err = sqlgraph.BatchCreate(ctx, pcb.driver, spec); err != nil { + if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + } + } + if err != nil { + return nil, err + } + mutation.id = &nodes[i].ID + if specs[i].ID.Value != nil && nodes[i].ID == 0 { + id := specs[i].ID.Value.(int64) + nodes[i].ID = uint32(id) + } + mutation.done = true + return nodes[i], nil + }) + for i := len(builder.hooks) - 1; i >= 0; i-- { + mut = builder.hooks[i](mut) + } + mutators[i] = mut + }(i, ctx) + } + if len(mutators) > 0 { + if _, err := mutators[0].Mutate(ctx, pcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (pcb *PositionCreateBulk) SaveX(ctx context.Context) []*Position { + v, err := pcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (pcb *PositionCreateBulk) Exec(ctx context.Context) error { + _, err := pcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (pcb *PositionCreateBulk) ExecX(ctx context.Context) { + if err := pcb.Exec(ctx); err != nil { + panic(err) + } +} + +// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause +// of the `INSERT` statement. For example: +// +// client.Position.CreateBulk(builders...). +// OnConflict( +// // Update the row with the new values +// // the was proposed for insertion. +// sql.ResolveWithNewValues(), +// ). +// // Override some of the fields with custom +// // update values. +// Update(func(u *ent.PositionUpsert) { +// SetCreateTime(v+v). +// }). +// Exec(ctx) +func (pcb *PositionCreateBulk) OnConflict(opts ...sql.ConflictOption) *PositionUpsertBulk { + pcb.conflict = opts + return &PositionUpsertBulk{ + create: pcb, + } +} + +// OnConflictColumns calls `OnConflict` and configures the columns +// as conflict target. Using this option is equivalent to using: +// +// client.Position.Create(). +// OnConflict(sql.ConflictColumns(columns...)). +// Exec(ctx) +func (pcb *PositionCreateBulk) OnConflictColumns(columns ...string) *PositionUpsertBulk { + pcb.conflict = append(pcb.conflict, sql.ConflictColumns(columns...)) + return &PositionUpsertBulk{ + create: pcb, + } +} + +// PositionUpsertBulk is the builder for "upsert"-ing +// a bulk of Position nodes. +type PositionUpsertBulk struct { + create *PositionCreateBulk +} + +// UpdateNewValues updates the mutable fields using the new values that +// were set on create. Using this option is equivalent to using: +// +// client.Position.Create(). +// OnConflict( +// sql.ResolveWithNewValues(), +// sql.ResolveWith(func(u *sql.UpdateSet) { +// u.SetIgnore(position.FieldID) +// }), +// ). +// Exec(ctx) +func (u *PositionUpsertBulk) UpdateNewValues() *PositionUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues()) + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) { + for _, b := range u.create.builders { + if _, exists := b.mutation.ID(); exists { + s.SetIgnore(position.FieldID) + } + if _, exists := b.mutation.CreateTime(); exists { + s.SetIgnore(position.FieldCreateTime) + } + } + })) + return u +} + +// Ignore sets each column to itself in case of conflict. +// Using this option is equivalent to using: +// +// client.Position.Create(). +// OnConflict(sql.ResolveWithIgnore()). +// Exec(ctx) +func (u *PositionUpsertBulk) Ignore() *PositionUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore()) + return u +} + +// DoNothing configures the conflict_action to `DO NOTHING`. +// Supported only by SQLite and PostgreSQL. +func (u *PositionUpsertBulk) DoNothing() *PositionUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.DoNothing()) + return u +} + +// Update allows overriding fields `UPDATE` values. See the PositionCreateBulk.OnConflict +// documentation for more info. +func (u *PositionUpsertBulk) Update(set func(*PositionUpsert)) *PositionUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) { + set(&PositionUpsert{UpdateSet: update}) + })) + return u +} + +// SetUpdateTime sets the "update_time" field. +func (u *PositionUpsertBulk) SetUpdateTime(v time.Time) *PositionUpsertBulk { + return u.Update(func(s *PositionUpsert) { + s.SetUpdateTime(v) + }) +} + +// UpdateUpdateTime sets the "update_time" field to the value that was provided on create. +func (u *PositionUpsertBulk) UpdateUpdateTime() *PositionUpsertBulk { + return u.Update(func(s *PositionUpsert) { + s.UpdateUpdateTime() + }) +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (u *PositionUpsertBulk) ClearUpdateTime() *PositionUpsertBulk { + return u.Update(func(s *PositionUpsert) { + s.ClearUpdateTime() + }) +} + +// SetDeleteTime sets the "delete_time" field. +func (u *PositionUpsertBulk) SetDeleteTime(v time.Time) *PositionUpsertBulk { + return u.Update(func(s *PositionUpsert) { + s.SetDeleteTime(v) + }) +} + +// UpdateDeleteTime sets the "delete_time" field to the value that was provided on create. +func (u *PositionUpsertBulk) UpdateDeleteTime() *PositionUpsertBulk { + return u.Update(func(s *PositionUpsert) { + s.UpdateDeleteTime() + }) +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (u *PositionUpsertBulk) ClearDeleteTime() *PositionUpsertBulk { + return u.Update(func(s *PositionUpsert) { + s.ClearDeleteTime() + }) +} + +// SetStatus sets the "status" field. +func (u *PositionUpsertBulk) SetStatus(v position.Status) *PositionUpsertBulk { + return u.Update(func(s *PositionUpsert) { + s.SetStatus(v) + }) +} + +// UpdateStatus sets the "status" field to the value that was provided on create. +func (u *PositionUpsertBulk) UpdateStatus() *PositionUpsertBulk { + return u.Update(func(s *PositionUpsert) { + s.UpdateStatus() + }) +} + +// ClearStatus clears the value of the "status" field. +func (u *PositionUpsertBulk) ClearStatus() *PositionUpsertBulk { + return u.Update(func(s *PositionUpsert) { + s.ClearStatus() + }) +} + +// SetCreateBy sets the "create_by" field. +func (u *PositionUpsertBulk) SetCreateBy(v uint32) *PositionUpsertBulk { + return u.Update(func(s *PositionUpsert) { + s.SetCreateBy(v) + }) +} + +// AddCreateBy adds v to the "create_by" field. +func (u *PositionUpsertBulk) AddCreateBy(v uint32) *PositionUpsertBulk { + return u.Update(func(s *PositionUpsert) { + s.AddCreateBy(v) + }) +} + +// UpdateCreateBy sets the "create_by" field to the value that was provided on create. +func (u *PositionUpsertBulk) UpdateCreateBy() *PositionUpsertBulk { + return u.Update(func(s *PositionUpsert) { + s.UpdateCreateBy() + }) +} + +// ClearCreateBy clears the value of the "create_by" field. +func (u *PositionUpsertBulk) ClearCreateBy() *PositionUpsertBulk { + return u.Update(func(s *PositionUpsert) { + s.ClearCreateBy() + }) +} + +// SetRemark sets the "remark" field. +func (u *PositionUpsertBulk) SetRemark(v string) *PositionUpsertBulk { + return u.Update(func(s *PositionUpsert) { + s.SetRemark(v) + }) +} + +// UpdateRemark sets the "remark" field to the value that was provided on create. +func (u *PositionUpsertBulk) UpdateRemark() *PositionUpsertBulk { + return u.Update(func(s *PositionUpsert) { + s.UpdateRemark() + }) +} + +// ClearRemark clears the value of the "remark" field. +func (u *PositionUpsertBulk) ClearRemark() *PositionUpsertBulk { + return u.Update(func(s *PositionUpsert) { + s.ClearRemark() + }) +} + +// SetName sets the "name" field. +func (u *PositionUpsertBulk) SetName(v string) *PositionUpsertBulk { + return u.Update(func(s *PositionUpsert) { + s.SetName(v) + }) +} + +// UpdateName sets the "name" field to the value that was provided on create. +func (u *PositionUpsertBulk) UpdateName() *PositionUpsertBulk { + return u.Update(func(s *PositionUpsert) { + s.UpdateName() + }) +} + +// SetCode sets the "code" field. +func (u *PositionUpsertBulk) SetCode(v string) *PositionUpsertBulk { + return u.Update(func(s *PositionUpsert) { + s.SetCode(v) + }) +} + +// UpdateCode sets the "code" field to the value that was provided on create. +func (u *PositionUpsertBulk) UpdateCode() *PositionUpsertBulk { + return u.Update(func(s *PositionUpsert) { + s.UpdateCode() + }) +} + +// SetParentID sets the "parent_id" field. +func (u *PositionUpsertBulk) SetParentID(v uint32) *PositionUpsertBulk { + return u.Update(func(s *PositionUpsert) { + s.SetParentID(v) + }) +} + +// UpdateParentID sets the "parent_id" field to the value that was provided on create. +func (u *PositionUpsertBulk) UpdateParentID() *PositionUpsertBulk { + return u.Update(func(s *PositionUpsert) { + s.UpdateParentID() + }) +} + +// ClearParentID clears the value of the "parent_id" field. +func (u *PositionUpsertBulk) ClearParentID() *PositionUpsertBulk { + return u.Update(func(s *PositionUpsert) { + s.ClearParentID() + }) +} + +// SetOrderNo sets the "order_no" field. +func (u *PositionUpsertBulk) SetOrderNo(v int32) *PositionUpsertBulk { + return u.Update(func(s *PositionUpsert) { + s.SetOrderNo(v) + }) +} + +// AddOrderNo adds v to the "order_no" field. +func (u *PositionUpsertBulk) AddOrderNo(v int32) *PositionUpsertBulk { + return u.Update(func(s *PositionUpsert) { + s.AddOrderNo(v) + }) +} + +// UpdateOrderNo sets the "order_no" field to the value that was provided on create. +func (u *PositionUpsertBulk) UpdateOrderNo() *PositionUpsertBulk { + return u.Update(func(s *PositionUpsert) { + s.UpdateOrderNo() + }) +} + +// Exec executes the query. +func (u *PositionUpsertBulk) Exec(ctx context.Context) error { + if u.create.err != nil { + return u.create.err + } + for i, b := range u.create.builders { + if len(b.conflict) != 0 { + return fmt.Errorf("ent: OnConflict was set for builder %d. Set it on the PositionCreateBulk instead", i) + } + } + if len(u.create.conflict) == 0 { + return errors.New("ent: missing options for PositionCreateBulk.OnConflict") + } + return u.create.Exec(ctx) +} + +// ExecX is like Exec, but panics if an error occurs. +func (u *PositionUpsertBulk) ExecX(ctx context.Context) { + if err := u.create.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/position_delete.go b/monolithic/backend/app/admin/service/internal/data/ent/position_delete.go new file mode 100644 index 0000000..1da1cbf --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/position_delete.go @@ -0,0 +1,88 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/position" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// PositionDelete is the builder for deleting a Position entity. +type PositionDelete struct { + config + hooks []Hook + mutation *PositionMutation +} + +// Where appends a list predicates to the PositionDelete builder. +func (pd *PositionDelete) Where(ps ...predicate.Position) *PositionDelete { + pd.mutation.Where(ps...) + return pd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (pd *PositionDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, pd.sqlExec, pd.mutation, pd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (pd *PositionDelete) ExecX(ctx context.Context) int { + n, err := pd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (pd *PositionDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(position.Table, sqlgraph.NewFieldSpec(position.FieldID, field.TypeUint32)) + if ps := pd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, pd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + pd.mutation.done = true + return affected, err +} + +// PositionDeleteOne is the builder for deleting a single Position entity. +type PositionDeleteOne struct { + pd *PositionDelete +} + +// Where appends a list predicates to the PositionDelete builder. +func (pdo *PositionDeleteOne) Where(ps ...predicate.Position) *PositionDeleteOne { + pdo.pd.mutation.Where(ps...) + return pdo +} + +// Exec executes the deletion query. +func (pdo *PositionDeleteOne) Exec(ctx context.Context) error { + n, err := pdo.pd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{position.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (pdo *PositionDeleteOne) ExecX(ctx context.Context) { + if err := pdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/position_query.go b/monolithic/backend/app/admin/service/internal/data/ent/position_query.go new file mode 100644 index 0000000..0cf4d36 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/position_query.go @@ -0,0 +1,700 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "database/sql/driver" + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/position" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + "math" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// PositionQuery is the builder for querying Position entities. +type PositionQuery struct { + config + ctx *QueryContext + order []position.OrderOption + inters []Interceptor + predicates []predicate.Position + withParent *PositionQuery + withChildren *PositionQuery + modifiers []func(*sql.Selector) + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the PositionQuery builder. +func (pq *PositionQuery) Where(ps ...predicate.Position) *PositionQuery { + pq.predicates = append(pq.predicates, ps...) + return pq +} + +// Limit the number of records to be returned by this query. +func (pq *PositionQuery) Limit(limit int) *PositionQuery { + pq.ctx.Limit = &limit + return pq +} + +// Offset to start from. +func (pq *PositionQuery) Offset(offset int) *PositionQuery { + pq.ctx.Offset = &offset + return pq +} + +// Unique configures the query builder to filter duplicate records on query. +// By default, unique is set to true, and can be disabled using this method. +func (pq *PositionQuery) Unique(unique bool) *PositionQuery { + pq.ctx.Unique = &unique + return pq +} + +// Order specifies how the records should be ordered. +func (pq *PositionQuery) Order(o ...position.OrderOption) *PositionQuery { + pq.order = append(pq.order, o...) + return pq +} + +// QueryParent chains the current query on the "parent" edge. +func (pq *PositionQuery) QueryParent() *PositionQuery { + query := (&PositionClient{config: pq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := pq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := pq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(position.Table, position.FieldID, selector), + sqlgraph.To(position.Table, position.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, position.ParentTable, position.ParentColumn), + ) + fromU = sqlgraph.SetNeighbors(pq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryChildren chains the current query on the "children" edge. +func (pq *PositionQuery) QueryChildren() *PositionQuery { + query := (&PositionClient{config: pq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := pq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := pq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(position.Table, position.FieldID, selector), + sqlgraph.To(position.Table, position.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, position.ChildrenTable, position.ChildrenColumn), + ) + fromU = sqlgraph.SetNeighbors(pq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first Position entity from the query. +// Returns a *NotFoundError when no Position was found. +func (pq *PositionQuery) First(ctx context.Context) (*Position, error) { + nodes, err := pq.Limit(1).All(setContextOp(ctx, pq.ctx, "First")) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{position.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (pq *PositionQuery) FirstX(ctx context.Context) *Position { + node, err := pq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first Position ID from the query. +// Returns a *NotFoundError when no Position ID was found. +func (pq *PositionQuery) FirstID(ctx context.Context) (id uint32, err error) { + var ids []uint32 + if ids, err = pq.Limit(1).IDs(setContextOp(ctx, pq.ctx, "FirstID")); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{position.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (pq *PositionQuery) FirstIDX(ctx context.Context) uint32 { + id, err := pq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single Position entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one Position entity is found. +// Returns a *NotFoundError when no Position entities are found. +func (pq *PositionQuery) Only(ctx context.Context) (*Position, error) { + nodes, err := pq.Limit(2).All(setContextOp(ctx, pq.ctx, "Only")) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{position.Label} + default: + return nil, &NotSingularError{position.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (pq *PositionQuery) OnlyX(ctx context.Context) *Position { + node, err := pq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only Position ID in the query. +// Returns a *NotSingularError when more than one Position ID is found. +// Returns a *NotFoundError when no entities are found. +func (pq *PositionQuery) OnlyID(ctx context.Context) (id uint32, err error) { + var ids []uint32 + if ids, err = pq.Limit(2).IDs(setContextOp(ctx, pq.ctx, "OnlyID")); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{position.Label} + default: + err = &NotSingularError{position.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (pq *PositionQuery) OnlyIDX(ctx context.Context) uint32 { + id, err := pq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of Positions. +func (pq *PositionQuery) All(ctx context.Context) ([]*Position, error) { + ctx = setContextOp(ctx, pq.ctx, "All") + if err := pq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*Position, *PositionQuery]() + return withInterceptors[[]*Position](ctx, pq, qr, pq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (pq *PositionQuery) AllX(ctx context.Context) []*Position { + nodes, err := pq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of Position IDs. +func (pq *PositionQuery) IDs(ctx context.Context) (ids []uint32, err error) { + if pq.ctx.Unique == nil && pq.path != nil { + pq.Unique(true) + } + ctx = setContextOp(ctx, pq.ctx, "IDs") + if err = pq.Select(position.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (pq *PositionQuery) IDsX(ctx context.Context) []uint32 { + ids, err := pq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (pq *PositionQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, pq.ctx, "Count") + if err := pq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, pq, querierCount[*PositionQuery](), pq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (pq *PositionQuery) CountX(ctx context.Context) int { + count, err := pq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (pq *PositionQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, pq.ctx, "Exist") + switch _, err := pq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("ent: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (pq *PositionQuery) ExistX(ctx context.Context) bool { + exist, err := pq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the PositionQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (pq *PositionQuery) Clone() *PositionQuery { + if pq == nil { + return nil + } + return &PositionQuery{ + config: pq.config, + ctx: pq.ctx.Clone(), + order: append([]position.OrderOption{}, pq.order...), + inters: append([]Interceptor{}, pq.inters...), + predicates: append([]predicate.Position{}, pq.predicates...), + withParent: pq.withParent.Clone(), + withChildren: pq.withChildren.Clone(), + // clone intermediate query. + sql: pq.sql.Clone(), + path: pq.path, + } +} + +// WithParent tells the query-builder to eager-load the nodes that are connected to +// the "parent" edge. The optional arguments are used to configure the query builder of the edge. +func (pq *PositionQuery) WithParent(opts ...func(*PositionQuery)) *PositionQuery { + query := (&PositionClient{config: pq.config}).Query() + for _, opt := range opts { + opt(query) + } + pq.withParent = query + return pq +} + +// WithChildren tells the query-builder to eager-load the nodes that are connected to +// the "children" edge. The optional arguments are used to configure the query builder of the edge. +func (pq *PositionQuery) WithChildren(opts ...func(*PositionQuery)) *PositionQuery { + query := (&PositionClient{config: pq.config}).Query() + for _, opt := range opts { + opt(query) + } + pq.withChildren = query + return pq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreateTime time.Time `json:"create_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.Position.Query(). +// GroupBy(position.FieldCreateTime). +// Aggregate(ent.Count()). +// Scan(ctx, &v) +func (pq *PositionQuery) GroupBy(field string, fields ...string) *PositionGroupBy { + pq.ctx.Fields = append([]string{field}, fields...) + grbuild := &PositionGroupBy{build: pq} + grbuild.flds = &pq.ctx.Fields + grbuild.label = position.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreateTime time.Time `json:"create_time,omitempty"` +// } +// +// client.Position.Query(). +// Select(position.FieldCreateTime). +// Scan(ctx, &v) +func (pq *PositionQuery) Select(fields ...string) *PositionSelect { + pq.ctx.Fields = append(pq.ctx.Fields, fields...) + sbuild := &PositionSelect{PositionQuery: pq} + sbuild.label = position.Label + sbuild.flds, sbuild.scan = &pq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a PositionSelect configured with the given aggregations. +func (pq *PositionQuery) Aggregate(fns ...AggregateFunc) *PositionSelect { + return pq.Select().Aggregate(fns...) +} + +func (pq *PositionQuery) prepareQuery(ctx context.Context) error { + for _, inter := range pq.inters { + if inter == nil { + return fmt.Errorf("ent: uninitialized interceptor (forgotten import ent/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, pq); err != nil { + return err + } + } + } + for _, f := range pq.ctx.Fields { + if !position.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)} + } + } + if pq.path != nil { + prev, err := pq.path(ctx) + if err != nil { + return err + } + pq.sql = prev + } + return nil +} + +func (pq *PositionQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Position, error) { + var ( + nodes = []*Position{} + _spec = pq.querySpec() + loadedTypes = [2]bool{ + pq.withParent != nil, + pq.withChildren != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*Position).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &Position{config: pq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + if len(pq.modifiers) > 0 { + _spec.Modifiers = pq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, pq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := pq.withParent; query != nil { + if err := pq.loadParent(ctx, query, nodes, nil, + func(n *Position, e *Position) { n.Edges.Parent = e }); err != nil { + return nil, err + } + } + if query := pq.withChildren; query != nil { + if err := pq.loadChildren(ctx, query, nodes, + func(n *Position) { n.Edges.Children = []*Position{} }, + func(n *Position, e *Position) { n.Edges.Children = append(n.Edges.Children, e) }); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (pq *PositionQuery) loadParent(ctx context.Context, query *PositionQuery, nodes []*Position, init func(*Position), assign func(*Position, *Position)) error { + ids := make([]uint32, 0, len(nodes)) + nodeids := make(map[uint32][]*Position) + for i := range nodes { + fk := nodes[i].ParentID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(position.IDIn(ids...)) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nodeids[n.ID] + if !ok { + return fmt.Errorf(`unexpected foreign-key "parent_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (pq *PositionQuery) loadChildren(ctx context.Context, query *PositionQuery, nodes []*Position, init func(*Position), assign func(*Position, *Position)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[uint32]*Position) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(position.FieldParentID) + } + query.Where(predicate.Position(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(position.ChildrenColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.ParentID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "parent_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} + +func (pq *PositionQuery) sqlCount(ctx context.Context) (int, error) { + _spec := pq.querySpec() + if len(pq.modifiers) > 0 { + _spec.Modifiers = pq.modifiers + } + _spec.Node.Columns = pq.ctx.Fields + if len(pq.ctx.Fields) > 0 { + _spec.Unique = pq.ctx.Unique != nil && *pq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, pq.driver, _spec) +} + +func (pq *PositionQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(position.Table, position.Columns, sqlgraph.NewFieldSpec(position.FieldID, field.TypeUint32)) + _spec.From = pq.sql + if unique := pq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if pq.path != nil { + _spec.Unique = true + } + if fields := pq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, position.FieldID) + for i := range fields { + if fields[i] != position.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if pq.withParent != nil { + _spec.Node.AddColumnOnce(position.FieldParentID) + } + } + if ps := pq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := pq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := pq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := pq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (pq *PositionQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(pq.driver.Dialect()) + t1 := builder.Table(position.Table) + columns := pq.ctx.Fields + if len(columns) == 0 { + columns = position.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if pq.sql != nil { + selector = pq.sql + selector.Select(selector.Columns(columns...)...) + } + if pq.ctx.Unique != nil && *pq.ctx.Unique { + selector.Distinct() + } + for _, m := range pq.modifiers { + m(selector) + } + for _, p := range pq.predicates { + p(selector) + } + for _, p := range pq.order { + p(selector) + } + if offset := pq.ctx.Offset; offset != nil { + // limit is mandatory for offset clause. We start + // with default value, and override it below if needed. + selector.Offset(*offset).Limit(math.MaxInt32) + } + if limit := pq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// Modify adds a query modifier for attaching custom logic to queries. +func (pq *PositionQuery) Modify(modifiers ...func(s *sql.Selector)) *PositionSelect { + pq.modifiers = append(pq.modifiers, modifiers...) + return pq.Select() +} + +// PositionGroupBy is the group-by builder for Position entities. +type PositionGroupBy struct { + selector + build *PositionQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (pgb *PositionGroupBy) Aggregate(fns ...AggregateFunc) *PositionGroupBy { + pgb.fns = append(pgb.fns, fns...) + return pgb +} + +// Scan applies the selector query and scans the result into the given value. +func (pgb *PositionGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, pgb.build.ctx, "GroupBy") + if err := pgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*PositionQuery, *PositionGroupBy](ctx, pgb.build, pgb, pgb.build.inters, v) +} + +func (pgb *PositionGroupBy) sqlScan(ctx context.Context, root *PositionQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(pgb.fns)) + for _, fn := range pgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*pgb.flds)+len(pgb.fns)) + for _, f := range *pgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*pgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := pgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// PositionSelect is the builder for selecting fields of Position entities. +type PositionSelect struct { + *PositionQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (ps *PositionSelect) Aggregate(fns ...AggregateFunc) *PositionSelect { + ps.fns = append(ps.fns, fns...) + return ps +} + +// Scan applies the selector query and scans the result into the given value. +func (ps *PositionSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ps.ctx, "Select") + if err := ps.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*PositionQuery, *PositionSelect](ctx, ps.PositionQuery, ps, ps.inters, v) +} + +func (ps *PositionSelect) sqlScan(ctx context.Context, root *PositionQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(ps.fns)) + for _, fn := range ps.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*ps.selector.flds); { + case n == 0 && len(aggregation) > 0: + selector.Select(aggregation...) + case n != 0 && len(aggregation) > 0: + selector.AppendSelect(aggregation...) + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := ps.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// Modify adds a query modifier for attaching custom logic to queries. +func (ps *PositionSelect) Modify(modifiers ...func(s *sql.Selector)) *PositionSelect { + ps.modifiers = append(ps.modifiers, modifiers...) + return ps +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/position_update.go b/monolithic/backend/app/admin/service/internal/data/ent/position_update.go new file mode 100644 index 0000000..996c4bc --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/position_update.go @@ -0,0 +1,928 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "errors" + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/position" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// PositionUpdate is the builder for updating Position entities. +type PositionUpdate struct { + config + hooks []Hook + mutation *PositionMutation + modifiers []func(*sql.UpdateBuilder) +} + +// Where appends a list predicates to the PositionUpdate builder. +func (pu *PositionUpdate) Where(ps ...predicate.Position) *PositionUpdate { + pu.mutation.Where(ps...) + return pu +} + +// SetUpdateTime sets the "update_time" field. +func (pu *PositionUpdate) SetUpdateTime(t time.Time) *PositionUpdate { + pu.mutation.SetUpdateTime(t) + return pu +} + +// SetNillableUpdateTime sets the "update_time" field if the given value is not nil. +func (pu *PositionUpdate) SetNillableUpdateTime(t *time.Time) *PositionUpdate { + if t != nil { + pu.SetUpdateTime(*t) + } + return pu +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (pu *PositionUpdate) ClearUpdateTime() *PositionUpdate { + pu.mutation.ClearUpdateTime() + return pu +} + +// SetDeleteTime sets the "delete_time" field. +func (pu *PositionUpdate) SetDeleteTime(t time.Time) *PositionUpdate { + pu.mutation.SetDeleteTime(t) + return pu +} + +// SetNillableDeleteTime sets the "delete_time" field if the given value is not nil. +func (pu *PositionUpdate) SetNillableDeleteTime(t *time.Time) *PositionUpdate { + if t != nil { + pu.SetDeleteTime(*t) + } + return pu +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (pu *PositionUpdate) ClearDeleteTime() *PositionUpdate { + pu.mutation.ClearDeleteTime() + return pu +} + +// SetStatus sets the "status" field. +func (pu *PositionUpdate) SetStatus(po position.Status) *PositionUpdate { + pu.mutation.SetStatus(po) + return pu +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (pu *PositionUpdate) SetNillableStatus(po *position.Status) *PositionUpdate { + if po != nil { + pu.SetStatus(*po) + } + return pu +} + +// ClearStatus clears the value of the "status" field. +func (pu *PositionUpdate) ClearStatus() *PositionUpdate { + pu.mutation.ClearStatus() + return pu +} + +// SetCreateBy sets the "create_by" field. +func (pu *PositionUpdate) SetCreateBy(u uint32) *PositionUpdate { + pu.mutation.ResetCreateBy() + pu.mutation.SetCreateBy(u) + return pu +} + +// SetNillableCreateBy sets the "create_by" field if the given value is not nil. +func (pu *PositionUpdate) SetNillableCreateBy(u *uint32) *PositionUpdate { + if u != nil { + pu.SetCreateBy(*u) + } + return pu +} + +// AddCreateBy adds u to the "create_by" field. +func (pu *PositionUpdate) AddCreateBy(u int32) *PositionUpdate { + pu.mutation.AddCreateBy(u) + return pu +} + +// ClearCreateBy clears the value of the "create_by" field. +func (pu *PositionUpdate) ClearCreateBy() *PositionUpdate { + pu.mutation.ClearCreateBy() + return pu +} + +// SetRemark sets the "remark" field. +func (pu *PositionUpdate) SetRemark(s string) *PositionUpdate { + pu.mutation.SetRemark(s) + return pu +} + +// SetNillableRemark sets the "remark" field if the given value is not nil. +func (pu *PositionUpdate) SetNillableRemark(s *string) *PositionUpdate { + if s != nil { + pu.SetRemark(*s) + } + return pu +} + +// ClearRemark clears the value of the "remark" field. +func (pu *PositionUpdate) ClearRemark() *PositionUpdate { + pu.mutation.ClearRemark() + return pu +} + +// SetName sets the "name" field. +func (pu *PositionUpdate) SetName(s string) *PositionUpdate { + pu.mutation.SetName(s) + return pu +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (pu *PositionUpdate) SetNillableName(s *string) *PositionUpdate { + if s != nil { + pu.SetName(*s) + } + return pu +} + +// SetCode sets the "code" field. +func (pu *PositionUpdate) SetCode(s string) *PositionUpdate { + pu.mutation.SetCode(s) + return pu +} + +// SetNillableCode sets the "code" field if the given value is not nil. +func (pu *PositionUpdate) SetNillableCode(s *string) *PositionUpdate { + if s != nil { + pu.SetCode(*s) + } + return pu +} + +// SetParentID sets the "parent_id" field. +func (pu *PositionUpdate) SetParentID(u uint32) *PositionUpdate { + pu.mutation.SetParentID(u) + return pu +} + +// SetNillableParentID sets the "parent_id" field if the given value is not nil. +func (pu *PositionUpdate) SetNillableParentID(u *uint32) *PositionUpdate { + if u != nil { + pu.SetParentID(*u) + } + return pu +} + +// ClearParentID clears the value of the "parent_id" field. +func (pu *PositionUpdate) ClearParentID() *PositionUpdate { + pu.mutation.ClearParentID() + return pu +} + +// SetOrderNo sets the "order_no" field. +func (pu *PositionUpdate) SetOrderNo(i int32) *PositionUpdate { + pu.mutation.ResetOrderNo() + pu.mutation.SetOrderNo(i) + return pu +} + +// SetNillableOrderNo sets the "order_no" field if the given value is not nil. +func (pu *PositionUpdate) SetNillableOrderNo(i *int32) *PositionUpdate { + if i != nil { + pu.SetOrderNo(*i) + } + return pu +} + +// AddOrderNo adds i to the "order_no" field. +func (pu *PositionUpdate) AddOrderNo(i int32) *PositionUpdate { + pu.mutation.AddOrderNo(i) + return pu +} + +// SetParent sets the "parent" edge to the Position entity. +func (pu *PositionUpdate) SetParent(p *Position) *PositionUpdate { + return pu.SetParentID(p.ID) +} + +// AddChildIDs adds the "children" edge to the Position entity by IDs. +func (pu *PositionUpdate) AddChildIDs(ids ...uint32) *PositionUpdate { + pu.mutation.AddChildIDs(ids...) + return pu +} + +// AddChildren adds the "children" edges to the Position entity. +func (pu *PositionUpdate) AddChildren(p ...*Position) *PositionUpdate { + ids := make([]uint32, len(p)) + for i := range p { + ids[i] = p[i].ID + } + return pu.AddChildIDs(ids...) +} + +// Mutation returns the PositionMutation object of the builder. +func (pu *PositionUpdate) Mutation() *PositionMutation { + return pu.mutation +} + +// ClearParent clears the "parent" edge to the Position entity. +func (pu *PositionUpdate) ClearParent() *PositionUpdate { + pu.mutation.ClearParent() + return pu +} + +// ClearChildren clears all "children" edges to the Position entity. +func (pu *PositionUpdate) ClearChildren() *PositionUpdate { + pu.mutation.ClearChildren() + return pu +} + +// RemoveChildIDs removes the "children" edge to Position entities by IDs. +func (pu *PositionUpdate) RemoveChildIDs(ids ...uint32) *PositionUpdate { + pu.mutation.RemoveChildIDs(ids...) + return pu +} + +// RemoveChildren removes "children" edges to Position entities. +func (pu *PositionUpdate) RemoveChildren(p ...*Position) *PositionUpdate { + ids := make([]uint32, len(p)) + for i := range p { + ids[i] = p[i].ID + } + return pu.RemoveChildIDs(ids...) +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (pu *PositionUpdate) Save(ctx context.Context) (int, error) { + return withHooks(ctx, pu.sqlSave, pu.mutation, pu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (pu *PositionUpdate) SaveX(ctx context.Context) int { + affected, err := pu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (pu *PositionUpdate) Exec(ctx context.Context) error { + _, err := pu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (pu *PositionUpdate) ExecX(ctx context.Context) { + if err := pu.Exec(ctx); err != nil { + panic(err) + } +} + +// check runs all checks and user-defined validators on the builder. +func (pu *PositionUpdate) check() error { + if v, ok := pu.mutation.Status(); ok { + if err := position.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "Position.status": %w`, err)} + } + } + if v, ok := pu.mutation.Name(); ok { + if err := position.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "Position.name": %w`, err)} + } + } + if v, ok := pu.mutation.Code(); ok { + if err := position.CodeValidator(v); err != nil { + return &ValidationError{Name: "code", err: fmt.Errorf(`ent: validator failed for field "Position.code": %w`, err)} + } + } + return nil +} + +// Modify adds a statement modifier for attaching custom logic to the UPDATE statement. +func (pu *PositionUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *PositionUpdate { + pu.modifiers = append(pu.modifiers, modifiers...) + return pu +} + +func (pu *PositionUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := pu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(position.Table, position.Columns, sqlgraph.NewFieldSpec(position.FieldID, field.TypeUint32)) + if ps := pu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if pu.mutation.CreateTimeCleared() { + _spec.ClearField(position.FieldCreateTime, field.TypeTime) + } + if value, ok := pu.mutation.UpdateTime(); ok { + _spec.SetField(position.FieldUpdateTime, field.TypeTime, value) + } + if pu.mutation.UpdateTimeCleared() { + _spec.ClearField(position.FieldUpdateTime, field.TypeTime) + } + if value, ok := pu.mutation.DeleteTime(); ok { + _spec.SetField(position.FieldDeleteTime, field.TypeTime, value) + } + if pu.mutation.DeleteTimeCleared() { + _spec.ClearField(position.FieldDeleteTime, field.TypeTime) + } + if value, ok := pu.mutation.Status(); ok { + _spec.SetField(position.FieldStatus, field.TypeEnum, value) + } + if pu.mutation.StatusCleared() { + _spec.ClearField(position.FieldStatus, field.TypeEnum) + } + if value, ok := pu.mutation.CreateBy(); ok { + _spec.SetField(position.FieldCreateBy, field.TypeUint32, value) + } + if value, ok := pu.mutation.AddedCreateBy(); ok { + _spec.AddField(position.FieldCreateBy, field.TypeUint32, value) + } + if pu.mutation.CreateByCleared() { + _spec.ClearField(position.FieldCreateBy, field.TypeUint32) + } + if value, ok := pu.mutation.Remark(); ok { + _spec.SetField(position.FieldRemark, field.TypeString, value) + } + if pu.mutation.RemarkCleared() { + _spec.ClearField(position.FieldRemark, field.TypeString) + } + if value, ok := pu.mutation.Name(); ok { + _spec.SetField(position.FieldName, field.TypeString, value) + } + if value, ok := pu.mutation.Code(); ok { + _spec.SetField(position.FieldCode, field.TypeString, value) + } + if value, ok := pu.mutation.OrderNo(); ok { + _spec.SetField(position.FieldOrderNo, field.TypeInt32, value) + } + if value, ok := pu.mutation.AddedOrderNo(); ok { + _spec.AddField(position.FieldOrderNo, field.TypeInt32, value) + } + if pu.mutation.ParentCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: position.ParentTable, + Columns: []string{position.ParentColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(position.FieldID, field.TypeUint32), + }, + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := pu.mutation.ParentIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: position.ParentTable, + Columns: []string{position.ParentColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(position.FieldID, field.TypeUint32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if pu.mutation.ChildrenCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: position.ChildrenTable, + Columns: []string{position.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(position.FieldID, field.TypeUint32), + }, + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := pu.mutation.RemovedChildrenIDs(); len(nodes) > 0 && !pu.mutation.ChildrenCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: position.ChildrenTable, + Columns: []string{position.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(position.FieldID, field.TypeUint32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := pu.mutation.ChildrenIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: position.ChildrenTable, + Columns: []string{position.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(position.FieldID, field.TypeUint32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.AddModifiers(pu.modifiers...) + if n, err = sqlgraph.UpdateNodes(ctx, pu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{position.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + pu.mutation.done = true + return n, nil +} + +// PositionUpdateOne is the builder for updating a single Position entity. +type PositionUpdateOne struct { + config + fields []string + hooks []Hook + mutation *PositionMutation + modifiers []func(*sql.UpdateBuilder) +} + +// SetUpdateTime sets the "update_time" field. +func (puo *PositionUpdateOne) SetUpdateTime(t time.Time) *PositionUpdateOne { + puo.mutation.SetUpdateTime(t) + return puo +} + +// SetNillableUpdateTime sets the "update_time" field if the given value is not nil. +func (puo *PositionUpdateOne) SetNillableUpdateTime(t *time.Time) *PositionUpdateOne { + if t != nil { + puo.SetUpdateTime(*t) + } + return puo +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (puo *PositionUpdateOne) ClearUpdateTime() *PositionUpdateOne { + puo.mutation.ClearUpdateTime() + return puo +} + +// SetDeleteTime sets the "delete_time" field. +func (puo *PositionUpdateOne) SetDeleteTime(t time.Time) *PositionUpdateOne { + puo.mutation.SetDeleteTime(t) + return puo +} + +// SetNillableDeleteTime sets the "delete_time" field if the given value is not nil. +func (puo *PositionUpdateOne) SetNillableDeleteTime(t *time.Time) *PositionUpdateOne { + if t != nil { + puo.SetDeleteTime(*t) + } + return puo +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (puo *PositionUpdateOne) ClearDeleteTime() *PositionUpdateOne { + puo.mutation.ClearDeleteTime() + return puo +} + +// SetStatus sets the "status" field. +func (puo *PositionUpdateOne) SetStatus(po position.Status) *PositionUpdateOne { + puo.mutation.SetStatus(po) + return puo +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (puo *PositionUpdateOne) SetNillableStatus(po *position.Status) *PositionUpdateOne { + if po != nil { + puo.SetStatus(*po) + } + return puo +} + +// ClearStatus clears the value of the "status" field. +func (puo *PositionUpdateOne) ClearStatus() *PositionUpdateOne { + puo.mutation.ClearStatus() + return puo +} + +// SetCreateBy sets the "create_by" field. +func (puo *PositionUpdateOne) SetCreateBy(u uint32) *PositionUpdateOne { + puo.mutation.ResetCreateBy() + puo.mutation.SetCreateBy(u) + return puo +} + +// SetNillableCreateBy sets the "create_by" field if the given value is not nil. +func (puo *PositionUpdateOne) SetNillableCreateBy(u *uint32) *PositionUpdateOne { + if u != nil { + puo.SetCreateBy(*u) + } + return puo +} + +// AddCreateBy adds u to the "create_by" field. +func (puo *PositionUpdateOne) AddCreateBy(u int32) *PositionUpdateOne { + puo.mutation.AddCreateBy(u) + return puo +} + +// ClearCreateBy clears the value of the "create_by" field. +func (puo *PositionUpdateOne) ClearCreateBy() *PositionUpdateOne { + puo.mutation.ClearCreateBy() + return puo +} + +// SetRemark sets the "remark" field. +func (puo *PositionUpdateOne) SetRemark(s string) *PositionUpdateOne { + puo.mutation.SetRemark(s) + return puo +} + +// SetNillableRemark sets the "remark" field if the given value is not nil. +func (puo *PositionUpdateOne) SetNillableRemark(s *string) *PositionUpdateOne { + if s != nil { + puo.SetRemark(*s) + } + return puo +} + +// ClearRemark clears the value of the "remark" field. +func (puo *PositionUpdateOne) ClearRemark() *PositionUpdateOne { + puo.mutation.ClearRemark() + return puo +} + +// SetName sets the "name" field. +func (puo *PositionUpdateOne) SetName(s string) *PositionUpdateOne { + puo.mutation.SetName(s) + return puo +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (puo *PositionUpdateOne) SetNillableName(s *string) *PositionUpdateOne { + if s != nil { + puo.SetName(*s) + } + return puo +} + +// SetCode sets the "code" field. +func (puo *PositionUpdateOne) SetCode(s string) *PositionUpdateOne { + puo.mutation.SetCode(s) + return puo +} + +// SetNillableCode sets the "code" field if the given value is not nil. +func (puo *PositionUpdateOne) SetNillableCode(s *string) *PositionUpdateOne { + if s != nil { + puo.SetCode(*s) + } + return puo +} + +// SetParentID sets the "parent_id" field. +func (puo *PositionUpdateOne) SetParentID(u uint32) *PositionUpdateOne { + puo.mutation.SetParentID(u) + return puo +} + +// SetNillableParentID sets the "parent_id" field if the given value is not nil. +func (puo *PositionUpdateOne) SetNillableParentID(u *uint32) *PositionUpdateOne { + if u != nil { + puo.SetParentID(*u) + } + return puo +} + +// ClearParentID clears the value of the "parent_id" field. +func (puo *PositionUpdateOne) ClearParentID() *PositionUpdateOne { + puo.mutation.ClearParentID() + return puo +} + +// SetOrderNo sets the "order_no" field. +func (puo *PositionUpdateOne) SetOrderNo(i int32) *PositionUpdateOne { + puo.mutation.ResetOrderNo() + puo.mutation.SetOrderNo(i) + return puo +} + +// SetNillableOrderNo sets the "order_no" field if the given value is not nil. +func (puo *PositionUpdateOne) SetNillableOrderNo(i *int32) *PositionUpdateOne { + if i != nil { + puo.SetOrderNo(*i) + } + return puo +} + +// AddOrderNo adds i to the "order_no" field. +func (puo *PositionUpdateOne) AddOrderNo(i int32) *PositionUpdateOne { + puo.mutation.AddOrderNo(i) + return puo +} + +// SetParent sets the "parent" edge to the Position entity. +func (puo *PositionUpdateOne) SetParent(p *Position) *PositionUpdateOne { + return puo.SetParentID(p.ID) +} + +// AddChildIDs adds the "children" edge to the Position entity by IDs. +func (puo *PositionUpdateOne) AddChildIDs(ids ...uint32) *PositionUpdateOne { + puo.mutation.AddChildIDs(ids...) + return puo +} + +// AddChildren adds the "children" edges to the Position entity. +func (puo *PositionUpdateOne) AddChildren(p ...*Position) *PositionUpdateOne { + ids := make([]uint32, len(p)) + for i := range p { + ids[i] = p[i].ID + } + return puo.AddChildIDs(ids...) +} + +// Mutation returns the PositionMutation object of the builder. +func (puo *PositionUpdateOne) Mutation() *PositionMutation { + return puo.mutation +} + +// ClearParent clears the "parent" edge to the Position entity. +func (puo *PositionUpdateOne) ClearParent() *PositionUpdateOne { + puo.mutation.ClearParent() + return puo +} + +// ClearChildren clears all "children" edges to the Position entity. +func (puo *PositionUpdateOne) ClearChildren() *PositionUpdateOne { + puo.mutation.ClearChildren() + return puo +} + +// RemoveChildIDs removes the "children" edge to Position entities by IDs. +func (puo *PositionUpdateOne) RemoveChildIDs(ids ...uint32) *PositionUpdateOne { + puo.mutation.RemoveChildIDs(ids...) + return puo +} + +// RemoveChildren removes "children" edges to Position entities. +func (puo *PositionUpdateOne) RemoveChildren(p ...*Position) *PositionUpdateOne { + ids := make([]uint32, len(p)) + for i := range p { + ids[i] = p[i].ID + } + return puo.RemoveChildIDs(ids...) +} + +// Where appends a list predicates to the PositionUpdate builder. +func (puo *PositionUpdateOne) Where(ps ...predicate.Position) *PositionUpdateOne { + puo.mutation.Where(ps...) + return puo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (puo *PositionUpdateOne) Select(field string, fields ...string) *PositionUpdateOne { + puo.fields = append([]string{field}, fields...) + return puo +} + +// Save executes the query and returns the updated Position entity. +func (puo *PositionUpdateOne) Save(ctx context.Context) (*Position, error) { + return withHooks(ctx, puo.sqlSave, puo.mutation, puo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (puo *PositionUpdateOne) SaveX(ctx context.Context) *Position { + node, err := puo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (puo *PositionUpdateOne) Exec(ctx context.Context) error { + _, err := puo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (puo *PositionUpdateOne) ExecX(ctx context.Context) { + if err := puo.Exec(ctx); err != nil { + panic(err) + } +} + +// check runs all checks and user-defined validators on the builder. +func (puo *PositionUpdateOne) check() error { + if v, ok := puo.mutation.Status(); ok { + if err := position.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "Position.status": %w`, err)} + } + } + if v, ok := puo.mutation.Name(); ok { + if err := position.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "Position.name": %w`, err)} + } + } + if v, ok := puo.mutation.Code(); ok { + if err := position.CodeValidator(v); err != nil { + return &ValidationError{Name: "code", err: fmt.Errorf(`ent: validator failed for field "Position.code": %w`, err)} + } + } + return nil +} + +// Modify adds a statement modifier for attaching custom logic to the UPDATE statement. +func (puo *PositionUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *PositionUpdateOne { + puo.modifiers = append(puo.modifiers, modifiers...) + return puo +} + +func (puo *PositionUpdateOne) sqlSave(ctx context.Context) (_node *Position, err error) { + if err := puo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(position.Table, position.Columns, sqlgraph.NewFieldSpec(position.FieldID, field.TypeUint32)) + id, ok := puo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`ent: missing "Position.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := puo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, position.FieldID) + for _, f := range fields { + if !position.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)} + } + if f != position.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := puo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if puo.mutation.CreateTimeCleared() { + _spec.ClearField(position.FieldCreateTime, field.TypeTime) + } + if value, ok := puo.mutation.UpdateTime(); ok { + _spec.SetField(position.FieldUpdateTime, field.TypeTime, value) + } + if puo.mutation.UpdateTimeCleared() { + _spec.ClearField(position.FieldUpdateTime, field.TypeTime) + } + if value, ok := puo.mutation.DeleteTime(); ok { + _spec.SetField(position.FieldDeleteTime, field.TypeTime, value) + } + if puo.mutation.DeleteTimeCleared() { + _spec.ClearField(position.FieldDeleteTime, field.TypeTime) + } + if value, ok := puo.mutation.Status(); ok { + _spec.SetField(position.FieldStatus, field.TypeEnum, value) + } + if puo.mutation.StatusCleared() { + _spec.ClearField(position.FieldStatus, field.TypeEnum) + } + if value, ok := puo.mutation.CreateBy(); ok { + _spec.SetField(position.FieldCreateBy, field.TypeUint32, value) + } + if value, ok := puo.mutation.AddedCreateBy(); ok { + _spec.AddField(position.FieldCreateBy, field.TypeUint32, value) + } + if puo.mutation.CreateByCleared() { + _spec.ClearField(position.FieldCreateBy, field.TypeUint32) + } + if value, ok := puo.mutation.Remark(); ok { + _spec.SetField(position.FieldRemark, field.TypeString, value) + } + if puo.mutation.RemarkCleared() { + _spec.ClearField(position.FieldRemark, field.TypeString) + } + if value, ok := puo.mutation.Name(); ok { + _spec.SetField(position.FieldName, field.TypeString, value) + } + if value, ok := puo.mutation.Code(); ok { + _spec.SetField(position.FieldCode, field.TypeString, value) + } + if value, ok := puo.mutation.OrderNo(); ok { + _spec.SetField(position.FieldOrderNo, field.TypeInt32, value) + } + if value, ok := puo.mutation.AddedOrderNo(); ok { + _spec.AddField(position.FieldOrderNo, field.TypeInt32, value) + } + if puo.mutation.ParentCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: position.ParentTable, + Columns: []string{position.ParentColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(position.FieldID, field.TypeUint32), + }, + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := puo.mutation.ParentIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: position.ParentTable, + Columns: []string{position.ParentColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(position.FieldID, field.TypeUint32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if puo.mutation.ChildrenCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: position.ChildrenTable, + Columns: []string{position.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(position.FieldID, field.TypeUint32), + }, + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := puo.mutation.RemovedChildrenIDs(); len(nodes) > 0 && !puo.mutation.ChildrenCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: position.ChildrenTable, + Columns: []string{position.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(position.FieldID, field.TypeUint32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := puo.mutation.ChildrenIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: position.ChildrenTable, + Columns: []string{position.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(position.FieldID, field.TypeUint32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.AddModifiers(puo.modifiers...) + _node = &Position{config: puo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, puo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{position.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + puo.mutation.done = true + return _node, nil +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/predicate/predicate.go b/monolithic/backend/app/admin/service/internal/data/ent/predicate/predicate.go new file mode 100644 index 0000000..f81c339 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/predicate/predicate.go @@ -0,0 +1,28 @@ +// Code generated by ent, DO NOT EDIT. + +package predicate + +import ( + "entgo.io/ent/dialect/sql" +) + +// Dict is the predicate function for dict builders. +type Dict func(*sql.Selector) + +// DictDetail is the predicate function for dictdetail builders. +type DictDetail func(*sql.Selector) + +// Menu is the predicate function for menu builders. +type Menu func(*sql.Selector) + +// Organization is the predicate function for organization builders. +type Organization func(*sql.Selector) + +// Position is the predicate function for position builders. +type Position func(*sql.Selector) + +// Role is the predicate function for role builders. +type Role func(*sql.Selector) + +// User is the predicate function for user builders. +type User func(*sql.Selector) diff --git a/monolithic/backend/app/admin/service/internal/data/ent/privacy/privacy.go b/monolithic/backend/app/admin/service/internal/data/ent/privacy/privacy.go new file mode 100644 index 0000000..2b07d37 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/privacy/privacy.go @@ -0,0 +1,354 @@ +// Code generated by ent, DO NOT EDIT. + +package privacy + +import ( + "context" + "kratos-monolithic-demo/app/admin/service/internal/data/ent" + + "entgo.io/ent/entql" + "entgo.io/ent/privacy" +) + +var ( + // Allow may be returned by rules to indicate that the policy + // evaluation should terminate with allow decision. + Allow = privacy.Allow + + // Deny may be returned by rules to indicate that the policy + // evaluation should terminate with deny decision. + Deny = privacy.Deny + + // Skip may be returned by rules to indicate that the policy + // evaluation should continue to the next rule. + Skip = privacy.Skip +) + +// Allowf returns a formatted wrapped Allow decision. +func Allowf(format string, a ...any) error { + return privacy.Allowf(format, a...) +} + +// Denyf returns a formatted wrapped Deny decision. +func Denyf(format string, a ...any) error { + return privacy.Denyf(format, a...) +} + +// Skipf returns a formatted wrapped Skip decision. +func Skipf(format string, a ...any) error { + return privacy.Skipf(format, a...) +} + +// DecisionContext creates a new context from the given parent context with +// a policy decision attach to it. +func DecisionContext(parent context.Context, decision error) context.Context { + return privacy.DecisionContext(parent, decision) +} + +// DecisionFromContext retrieves the policy decision from the context. +func DecisionFromContext(ctx context.Context) (error, bool) { + return privacy.DecisionFromContext(ctx) +} + +type ( + // Policy groups query and mutation policies. + Policy = privacy.Policy + + // QueryRule defines the interface deciding whether a + // query is allowed and optionally modify it. + QueryRule = privacy.QueryRule + // QueryPolicy combines multiple query rules into a single policy. + QueryPolicy = privacy.QueryPolicy + + // MutationRule defines the interface which decides whether a + // mutation is allowed and optionally modifies it. + MutationRule = privacy.MutationRule + // MutationPolicy combines multiple mutation rules into a single policy. + MutationPolicy = privacy.MutationPolicy + // MutationRuleFunc type is an adapter which allows the use of + // ordinary functions as mutation rules. + MutationRuleFunc = privacy.MutationRuleFunc + + // QueryMutationRule is an interface which groups query and mutation rules. + QueryMutationRule = privacy.QueryMutationRule +) + +// QueryRuleFunc type is an adapter to allow the use of +// ordinary functions as query rules. +type QueryRuleFunc func(context.Context, ent.Query) error + +// Eval returns f(ctx, q). +func (f QueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error { + return f(ctx, q) +} + +// AlwaysAllowRule returns a rule that returns an allow decision. +func AlwaysAllowRule() QueryMutationRule { + return privacy.AlwaysAllowRule() +} + +// AlwaysDenyRule returns a rule that returns a deny decision. +func AlwaysDenyRule() QueryMutationRule { + return privacy.AlwaysDenyRule() +} + +// ContextQueryMutationRule creates a query/mutation rule from a context eval func. +func ContextQueryMutationRule(eval func(context.Context) error) QueryMutationRule { + return privacy.ContextQueryMutationRule(eval) +} + +// OnMutationOperation evaluates the given rule only on a given mutation operation. +func OnMutationOperation(rule MutationRule, op ent.Op) MutationRule { + return privacy.OnMutationOperation(rule, op) +} + +// DenyMutationOperationRule returns a rule denying specified mutation operation. +func DenyMutationOperationRule(op ent.Op) MutationRule { + rule := MutationRuleFunc(func(_ context.Context, m ent.Mutation) error { + return Denyf("ent/privacy: operation %s is not allowed", m.Op()) + }) + return OnMutationOperation(rule, op) +} + +// The DictQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type DictQueryRuleFunc func(context.Context, *ent.DictQuery) error + +// EvalQuery return f(ctx, q). +func (f DictQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error { + if q, ok := q.(*ent.DictQuery); ok { + return f(ctx, q) + } + return Denyf("ent/privacy: unexpected query type %T, expect *ent.DictQuery", q) +} + +// The DictMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type DictMutationRuleFunc func(context.Context, *ent.DictMutation) error + +// EvalMutation calls f(ctx, m). +func (f DictMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error { + if m, ok := m.(*ent.DictMutation); ok { + return f(ctx, m) + } + return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.DictMutation", m) +} + +// The DictDetailQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type DictDetailQueryRuleFunc func(context.Context, *ent.DictDetailQuery) error + +// EvalQuery return f(ctx, q). +func (f DictDetailQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error { + if q, ok := q.(*ent.DictDetailQuery); ok { + return f(ctx, q) + } + return Denyf("ent/privacy: unexpected query type %T, expect *ent.DictDetailQuery", q) +} + +// The DictDetailMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type DictDetailMutationRuleFunc func(context.Context, *ent.DictDetailMutation) error + +// EvalMutation calls f(ctx, m). +func (f DictDetailMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error { + if m, ok := m.(*ent.DictDetailMutation); ok { + return f(ctx, m) + } + return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.DictDetailMutation", m) +} + +// The MenuQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type MenuQueryRuleFunc func(context.Context, *ent.MenuQuery) error + +// EvalQuery return f(ctx, q). +func (f MenuQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error { + if q, ok := q.(*ent.MenuQuery); ok { + return f(ctx, q) + } + return Denyf("ent/privacy: unexpected query type %T, expect *ent.MenuQuery", q) +} + +// The MenuMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type MenuMutationRuleFunc func(context.Context, *ent.MenuMutation) error + +// EvalMutation calls f(ctx, m). +func (f MenuMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error { + if m, ok := m.(*ent.MenuMutation); ok { + return f(ctx, m) + } + return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.MenuMutation", m) +} + +// The OrganizationQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type OrganizationQueryRuleFunc func(context.Context, *ent.OrganizationQuery) error + +// EvalQuery return f(ctx, q). +func (f OrganizationQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error { + if q, ok := q.(*ent.OrganizationQuery); ok { + return f(ctx, q) + } + return Denyf("ent/privacy: unexpected query type %T, expect *ent.OrganizationQuery", q) +} + +// The OrganizationMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type OrganizationMutationRuleFunc func(context.Context, *ent.OrganizationMutation) error + +// EvalMutation calls f(ctx, m). +func (f OrganizationMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error { + if m, ok := m.(*ent.OrganizationMutation); ok { + return f(ctx, m) + } + return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.OrganizationMutation", m) +} + +// The PositionQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type PositionQueryRuleFunc func(context.Context, *ent.PositionQuery) error + +// EvalQuery return f(ctx, q). +func (f PositionQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error { + if q, ok := q.(*ent.PositionQuery); ok { + return f(ctx, q) + } + return Denyf("ent/privacy: unexpected query type %T, expect *ent.PositionQuery", q) +} + +// The PositionMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type PositionMutationRuleFunc func(context.Context, *ent.PositionMutation) error + +// EvalMutation calls f(ctx, m). +func (f PositionMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error { + if m, ok := m.(*ent.PositionMutation); ok { + return f(ctx, m) + } + return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.PositionMutation", m) +} + +// The RoleQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type RoleQueryRuleFunc func(context.Context, *ent.RoleQuery) error + +// EvalQuery return f(ctx, q). +func (f RoleQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error { + if q, ok := q.(*ent.RoleQuery); ok { + return f(ctx, q) + } + return Denyf("ent/privacy: unexpected query type %T, expect *ent.RoleQuery", q) +} + +// The RoleMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type RoleMutationRuleFunc func(context.Context, *ent.RoleMutation) error + +// EvalMutation calls f(ctx, m). +func (f RoleMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error { + if m, ok := m.(*ent.RoleMutation); ok { + return f(ctx, m) + } + return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.RoleMutation", m) +} + +// The UserQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type UserQueryRuleFunc func(context.Context, *ent.UserQuery) error + +// EvalQuery return f(ctx, q). +func (f UserQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error { + if q, ok := q.(*ent.UserQuery); ok { + return f(ctx, q) + } + return Denyf("ent/privacy: unexpected query type %T, expect *ent.UserQuery", q) +} + +// The UserMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type UserMutationRuleFunc func(context.Context, *ent.UserMutation) error + +// EvalMutation calls f(ctx, m). +func (f UserMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error { + if m, ok := m.(*ent.UserMutation); ok { + return f(ctx, m) + } + return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.UserMutation", m) +} + +type ( + // Filter is the interface that wraps the Where function + // for filtering nodes in queries and mutations. + Filter interface { + // Where applies a filter on the executed query/mutation. + Where(entql.P) + } + + // The FilterFunc type is an adapter that allows the use of ordinary + // functions as filters for query and mutation types. + FilterFunc func(context.Context, Filter) error +) + +// EvalQuery calls f(ctx, q) if the query implements the Filter interface, otherwise it is denied. +func (f FilterFunc) EvalQuery(ctx context.Context, q ent.Query) error { + fr, err := queryFilter(q) + if err != nil { + return err + } + return f(ctx, fr) +} + +// EvalMutation calls f(ctx, q) if the mutation implements the Filter interface, otherwise it is denied. +func (f FilterFunc) EvalMutation(ctx context.Context, m ent.Mutation) error { + fr, err := mutationFilter(m) + if err != nil { + return err + } + return f(ctx, fr) +} + +var _ QueryMutationRule = FilterFunc(nil) + +func queryFilter(q ent.Query) (Filter, error) { + switch q := q.(type) { + case *ent.DictQuery: + return q.Filter(), nil + case *ent.DictDetailQuery: + return q.Filter(), nil + case *ent.MenuQuery: + return q.Filter(), nil + case *ent.OrganizationQuery: + return q.Filter(), nil + case *ent.PositionQuery: + return q.Filter(), nil + case *ent.RoleQuery: + return q.Filter(), nil + case *ent.UserQuery: + return q.Filter(), nil + default: + return nil, Denyf("ent/privacy: unexpected query type %T for query filter", q) + } +} + +func mutationFilter(m ent.Mutation) (Filter, error) { + switch m := m.(type) { + case *ent.DictMutation: + return m.Filter(), nil + case *ent.DictDetailMutation: + return m.Filter(), nil + case *ent.MenuMutation: + return m.Filter(), nil + case *ent.OrganizationMutation: + return m.Filter(), nil + case *ent.PositionMutation: + return m.Filter(), nil + case *ent.RoleMutation: + return m.Filter(), nil + case *ent.UserMutation: + return m.Filter(), nil + default: + return nil, Denyf("ent/privacy: unexpected mutation type %T for mutation filter", m) + } +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/role.go b/monolithic/backend/app/admin/service/internal/data/ent/role.go new file mode 100644 index 0000000..5e174aa --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/role.go @@ -0,0 +1,282 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/role" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" +) + +// Role is the model entity for the Role schema. +type Role struct { + config `json:"-"` + // ID of the ent. + // id + ID uint32 `json:"id,omitempty"` + // 创建时间 + CreateTime *time.Time `json:"create_time,omitempty"` + // 更新时间 + UpdateTime *time.Time `json:"update_time,omitempty"` + // 删除时间 + DeleteTime *time.Time `json:"delete_time,omitempty"` + // 状态 + Status *role.Status `json:"status,omitempty"` + // 创建者ID + CreateBy *uint32 `json:"create_by,omitempty"` + // 备注 + Remark *string `json:"remark,omitempty"` + // 角色名称 + Name *string `json:"name,omitempty"` + // 角色标识 + Code *string `json:"code,omitempty"` + // 上一层角色ID + ParentID *uint32 `json:"parent_id,omitempty"` + // 排序ID + OrderNo *int32 `json:"order_no,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the RoleQuery when eager-loading is set. + Edges RoleEdges `json:"edges"` + selectValues sql.SelectValues +} + +// RoleEdges holds the relations/edges for other nodes in the graph. +type RoleEdges struct { + // Parent holds the value of the parent edge. + Parent *Role `json:"parent,omitempty"` + // Children holds the value of the children edge. + Children []*Role `json:"children,omitempty"` + // loadedTypes holds the information for reporting if a + // type was loaded (or requested) in eager-loading or not. + loadedTypes [2]bool +} + +// ParentOrErr returns the Parent value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e RoleEdges) ParentOrErr() (*Role, error) { + if e.loadedTypes[0] { + if e.Parent == nil { + // Edge was loaded but was not found. + return nil, &NotFoundError{label: role.Label} + } + return e.Parent, nil + } + return nil, &NotLoadedError{edge: "parent"} +} + +// ChildrenOrErr returns the Children value or an error if the edge +// was not loaded in eager-loading. +func (e RoleEdges) ChildrenOrErr() ([]*Role, error) { + if e.loadedTypes[1] { + return e.Children, nil + } + return nil, &NotLoadedError{edge: "children"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*Role) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case role.FieldID, role.FieldCreateBy, role.FieldParentID, role.FieldOrderNo: + values[i] = new(sql.NullInt64) + case role.FieldStatus, role.FieldRemark, role.FieldName, role.FieldCode: + values[i] = new(sql.NullString) + case role.FieldCreateTime, role.FieldUpdateTime, role.FieldDeleteTime: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the Role fields. +func (r *Role) assignValues(columns []string, values []any) error { + if m, n := len(values), len(columns); m < n { + return fmt.Errorf("mismatch number of scan values: %d != %d", m, n) + } + for i := range columns { + switch columns[i] { + case role.FieldID: + value, ok := values[i].(*sql.NullInt64) + if !ok { + return fmt.Errorf("unexpected type %T for field id", value) + } + r.ID = uint32(value.Int64) + case role.FieldCreateTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field create_time", values[i]) + } else if value.Valid { + r.CreateTime = new(time.Time) + *r.CreateTime = value.Time + } + case role.FieldUpdateTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field update_time", values[i]) + } else if value.Valid { + r.UpdateTime = new(time.Time) + *r.UpdateTime = value.Time + } + case role.FieldDeleteTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field delete_time", values[i]) + } else if value.Valid { + r.DeleteTime = new(time.Time) + *r.DeleteTime = value.Time + } + case role.FieldStatus: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field status", values[i]) + } else if value.Valid { + r.Status = new(role.Status) + *r.Status = role.Status(value.String) + } + case role.FieldCreateBy: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field create_by", values[i]) + } else if value.Valid { + r.CreateBy = new(uint32) + *r.CreateBy = uint32(value.Int64) + } + case role.FieldRemark: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field remark", values[i]) + } else if value.Valid { + r.Remark = new(string) + *r.Remark = value.String + } + case role.FieldName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[i]) + } else if value.Valid { + r.Name = new(string) + *r.Name = value.String + } + case role.FieldCode: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field code", values[i]) + } else if value.Valid { + r.Code = new(string) + *r.Code = value.String + } + case role.FieldParentID: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field parent_id", values[i]) + } else if value.Valid { + r.ParentID = new(uint32) + *r.ParentID = uint32(value.Int64) + } + case role.FieldOrderNo: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field order_no", values[i]) + } else if value.Valid { + r.OrderNo = new(int32) + *r.OrderNo = int32(value.Int64) + } + default: + r.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the Role. +// This includes values selected through modifiers, order, etc. +func (r *Role) Value(name string) (ent.Value, error) { + return r.selectValues.Get(name) +} + +// QueryParent queries the "parent" edge of the Role entity. +func (r *Role) QueryParent() *RoleQuery { + return NewRoleClient(r.config).QueryParent(r) +} + +// QueryChildren queries the "children" edge of the Role entity. +func (r *Role) QueryChildren() *RoleQuery { + return NewRoleClient(r.config).QueryChildren(r) +} + +// Update returns a builder for updating this Role. +// Note that you need to call Role.Unwrap() before calling this method if this Role +// was returned from a transaction, and the transaction was committed or rolled back. +func (r *Role) Update() *RoleUpdateOne { + return NewRoleClient(r.config).UpdateOne(r) +} + +// Unwrap unwraps the Role entity that was returned from a transaction after it was closed, +// so that all future queries will be executed through the driver which created the transaction. +func (r *Role) Unwrap() *Role { + _tx, ok := r.config.driver.(*txDriver) + if !ok { + panic("ent: Role is not a transactional entity") + } + r.config.driver = _tx.drv + return r +} + +// String implements the fmt.Stringer. +func (r *Role) String() string { + var builder strings.Builder + builder.WriteString("Role(") + builder.WriteString(fmt.Sprintf("id=%v, ", r.ID)) + if v := r.CreateTime; v != nil { + builder.WriteString("create_time=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + if v := r.UpdateTime; v != nil { + builder.WriteString("update_time=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + if v := r.DeleteTime; v != nil { + builder.WriteString("delete_time=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + if v := r.Status; v != nil { + builder.WriteString("status=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := r.CreateBy; v != nil { + builder.WriteString("create_by=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := r.Remark; v != nil { + builder.WriteString("remark=") + builder.WriteString(*v) + } + builder.WriteString(", ") + if v := r.Name; v != nil { + builder.WriteString("name=") + builder.WriteString(*v) + } + builder.WriteString(", ") + if v := r.Code; v != nil { + builder.WriteString("code=") + builder.WriteString(*v) + } + builder.WriteString(", ") + if v := r.ParentID; v != nil { + builder.WriteString("parent_id=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := r.OrderNo; v != nil { + builder.WriteString("order_no=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteByte(')') + return builder.String() +} + +// Roles is a parsable slice of Role. +type Roles []*Role diff --git a/monolithic/backend/app/admin/service/internal/data/ent/role/role.go b/monolithic/backend/app/admin/service/internal/data/ent/role/role.go new file mode 100644 index 0000000..bf85115 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/role/role.go @@ -0,0 +1,210 @@ +// Code generated by ent, DO NOT EDIT. + +package role + +import ( + "fmt" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +const ( + // Label holds the string label denoting the role type in the database. + Label = "role" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreateTime holds the string denoting the create_time field in the database. + FieldCreateTime = "create_time" + // FieldUpdateTime holds the string denoting the update_time field in the database. + FieldUpdateTime = "update_time" + // FieldDeleteTime holds the string denoting the delete_time field in the database. + FieldDeleteTime = "delete_time" + // FieldStatus holds the string denoting the status field in the database. + FieldStatus = "status" + // FieldCreateBy holds the string denoting the create_by field in the database. + FieldCreateBy = "create_by" + // FieldRemark holds the string denoting the remark field in the database. + FieldRemark = "remark" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // FieldCode holds the string denoting the code field in the database. + FieldCode = "code" + // FieldParentID holds the string denoting the parent_id field in the database. + FieldParentID = "parent_id" + // FieldOrderNo holds the string denoting the order_no field in the database. + FieldOrderNo = "order_no" + // EdgeParent holds the string denoting the parent edge name in mutations. + EdgeParent = "parent" + // EdgeChildren holds the string denoting the children edge name in mutations. + EdgeChildren = "children" + // Table holds the table name of the role in the database. + Table = "role" + // ParentTable is the table that holds the parent relation/edge. + ParentTable = "role" + // ParentColumn is the table column denoting the parent relation/edge. + ParentColumn = "parent_id" + // ChildrenTable is the table that holds the children relation/edge. + ChildrenTable = "role" + // ChildrenColumn is the table column denoting the children relation/edge. + ChildrenColumn = "parent_id" +) + +// Columns holds all SQL columns for role fields. +var Columns = []string{ + FieldID, + FieldCreateTime, + FieldUpdateTime, + FieldDeleteTime, + FieldStatus, + FieldCreateBy, + FieldRemark, + FieldName, + FieldCode, + FieldParentID, + FieldOrderNo, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +var ( + // DefaultRemark holds the default value on creation for the "remark" field. + DefaultRemark string + // NameValidator is a validator for the "name" field. It is called by the builders before save. + NameValidator func(string) error + // DefaultCode holds the default value on creation for the "code" field. + DefaultCode string + // CodeValidator is a validator for the "code" field. It is called by the builders before save. + CodeValidator func(string) error + // DefaultOrderNo holds the default value on creation for the "order_no" field. + DefaultOrderNo int32 + // IDValidator is a validator for the "id" field. It is called by the builders before save. + IDValidator func(uint32) error +) + +// Status defines the type for the "status" enum field. +type Status string + +// StatusON is the default value of the Status enum. +const DefaultStatus = StatusON + +// Status values. +const ( + StatusOFF Status = "OFF" + StatusON Status = "ON" +) + +func (s Status) String() string { + return string(s) +} + +// StatusValidator is a validator for the "status" field enum values. It is called by the builders before save. +func StatusValidator(s Status) error { + switch s { + case StatusOFF, StatusON: + return nil + default: + return fmt.Errorf("role: invalid enum value for status field: %q", s) + } +} + +// OrderOption defines the ordering options for the Role queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreateTime orders the results by the create_time field. +func ByCreateTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreateTime, opts...).ToFunc() +} + +// ByUpdateTime orders the results by the update_time field. +func ByUpdateTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdateTime, opts...).ToFunc() +} + +// ByDeleteTime orders the results by the delete_time field. +func ByDeleteTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeleteTime, opts...).ToFunc() +} + +// ByStatus orders the results by the status field. +func ByStatus(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldStatus, opts...).ToFunc() +} + +// ByCreateBy orders the results by the create_by field. +func ByCreateBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreateBy, opts...).ToFunc() +} + +// ByRemark orders the results by the remark field. +func ByRemark(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRemark, opts...).ToFunc() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +// ByCode orders the results by the code field. +func ByCode(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCode, opts...).ToFunc() +} + +// ByParentID orders the results by the parent_id field. +func ByParentID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldParentID, opts...).ToFunc() +} + +// ByOrderNo orders the results by the order_no field. +func ByOrderNo(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOrderNo, opts...).ToFunc() +} + +// ByParentField orders the results by parent field. +func ByParentField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newParentStep(), sql.OrderByField(field, opts...)) + } +} + +// ByChildrenCount orders the results by children count. +func ByChildrenCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newChildrenStep(), opts...) + } +} + +// ByChildren orders the results by children terms. +func ByChildren(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newChildrenStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} +func newParentStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, ParentTable, ParentColumn), + ) +} +func newChildrenStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, ChildrenTable, ChildrenColumn), + ) +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/role/where.go b/monolithic/backend/app/admin/service/internal/data/ent/role/where.go new file mode 100644 index 0000000..4c6d4fc --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/role/where.go @@ -0,0 +1,697 @@ +// Code generated by ent, DO NOT EDIT. + +package role + +import ( + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +// ID filters vertices based on their ID field. +func ID(id uint32) predicate.Role { + return predicate.Role(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id uint32) predicate.Role { + return predicate.Role(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id uint32) predicate.Role { + return predicate.Role(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...uint32) predicate.Role { + return predicate.Role(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...uint32) predicate.Role { + return predicate.Role(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id uint32) predicate.Role { + return predicate.Role(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id uint32) predicate.Role { + return predicate.Role(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id uint32) predicate.Role { + return predicate.Role(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id uint32) predicate.Role { + return predicate.Role(sql.FieldLTE(FieldID, id)) +} + +// CreateTime applies equality check predicate on the "create_time" field. It's identical to CreateTimeEQ. +func CreateTime(v time.Time) predicate.Role { + return predicate.Role(sql.FieldEQ(FieldCreateTime, v)) +} + +// UpdateTime applies equality check predicate on the "update_time" field. It's identical to UpdateTimeEQ. +func UpdateTime(v time.Time) predicate.Role { + return predicate.Role(sql.FieldEQ(FieldUpdateTime, v)) +} + +// DeleteTime applies equality check predicate on the "delete_time" field. It's identical to DeleteTimeEQ. +func DeleteTime(v time.Time) predicate.Role { + return predicate.Role(sql.FieldEQ(FieldDeleteTime, v)) +} + +// CreateBy applies equality check predicate on the "create_by" field. It's identical to CreateByEQ. +func CreateBy(v uint32) predicate.Role { + return predicate.Role(sql.FieldEQ(FieldCreateBy, v)) +} + +// Remark applies equality check predicate on the "remark" field. It's identical to RemarkEQ. +func Remark(v string) predicate.Role { + return predicate.Role(sql.FieldEQ(FieldRemark, v)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.Role { + return predicate.Role(sql.FieldEQ(FieldName, v)) +} + +// Code applies equality check predicate on the "code" field. It's identical to CodeEQ. +func Code(v string) predicate.Role { + return predicate.Role(sql.FieldEQ(FieldCode, v)) +} + +// ParentID applies equality check predicate on the "parent_id" field. It's identical to ParentIDEQ. +func ParentID(v uint32) predicate.Role { + return predicate.Role(sql.FieldEQ(FieldParentID, v)) +} + +// OrderNo applies equality check predicate on the "order_no" field. It's identical to OrderNoEQ. +func OrderNo(v int32) predicate.Role { + return predicate.Role(sql.FieldEQ(FieldOrderNo, v)) +} + +// CreateTimeEQ applies the EQ predicate on the "create_time" field. +func CreateTimeEQ(v time.Time) predicate.Role { + return predicate.Role(sql.FieldEQ(FieldCreateTime, v)) +} + +// CreateTimeNEQ applies the NEQ predicate on the "create_time" field. +func CreateTimeNEQ(v time.Time) predicate.Role { + return predicate.Role(sql.FieldNEQ(FieldCreateTime, v)) +} + +// CreateTimeIn applies the In predicate on the "create_time" field. +func CreateTimeIn(vs ...time.Time) predicate.Role { + return predicate.Role(sql.FieldIn(FieldCreateTime, vs...)) +} + +// CreateTimeNotIn applies the NotIn predicate on the "create_time" field. +func CreateTimeNotIn(vs ...time.Time) predicate.Role { + return predicate.Role(sql.FieldNotIn(FieldCreateTime, vs...)) +} + +// CreateTimeGT applies the GT predicate on the "create_time" field. +func CreateTimeGT(v time.Time) predicate.Role { + return predicate.Role(sql.FieldGT(FieldCreateTime, v)) +} + +// CreateTimeGTE applies the GTE predicate on the "create_time" field. +func CreateTimeGTE(v time.Time) predicate.Role { + return predicate.Role(sql.FieldGTE(FieldCreateTime, v)) +} + +// CreateTimeLT applies the LT predicate on the "create_time" field. +func CreateTimeLT(v time.Time) predicate.Role { + return predicate.Role(sql.FieldLT(FieldCreateTime, v)) +} + +// CreateTimeLTE applies the LTE predicate on the "create_time" field. +func CreateTimeLTE(v time.Time) predicate.Role { + return predicate.Role(sql.FieldLTE(FieldCreateTime, v)) +} + +// CreateTimeIsNil applies the IsNil predicate on the "create_time" field. +func CreateTimeIsNil() predicate.Role { + return predicate.Role(sql.FieldIsNull(FieldCreateTime)) +} + +// CreateTimeNotNil applies the NotNil predicate on the "create_time" field. +func CreateTimeNotNil() predicate.Role { + return predicate.Role(sql.FieldNotNull(FieldCreateTime)) +} + +// UpdateTimeEQ applies the EQ predicate on the "update_time" field. +func UpdateTimeEQ(v time.Time) predicate.Role { + return predicate.Role(sql.FieldEQ(FieldUpdateTime, v)) +} + +// UpdateTimeNEQ applies the NEQ predicate on the "update_time" field. +func UpdateTimeNEQ(v time.Time) predicate.Role { + return predicate.Role(sql.FieldNEQ(FieldUpdateTime, v)) +} + +// UpdateTimeIn applies the In predicate on the "update_time" field. +func UpdateTimeIn(vs ...time.Time) predicate.Role { + return predicate.Role(sql.FieldIn(FieldUpdateTime, vs...)) +} + +// UpdateTimeNotIn applies the NotIn predicate on the "update_time" field. +func UpdateTimeNotIn(vs ...time.Time) predicate.Role { + return predicate.Role(sql.FieldNotIn(FieldUpdateTime, vs...)) +} + +// UpdateTimeGT applies the GT predicate on the "update_time" field. +func UpdateTimeGT(v time.Time) predicate.Role { + return predicate.Role(sql.FieldGT(FieldUpdateTime, v)) +} + +// UpdateTimeGTE applies the GTE predicate on the "update_time" field. +func UpdateTimeGTE(v time.Time) predicate.Role { + return predicate.Role(sql.FieldGTE(FieldUpdateTime, v)) +} + +// UpdateTimeLT applies the LT predicate on the "update_time" field. +func UpdateTimeLT(v time.Time) predicate.Role { + return predicate.Role(sql.FieldLT(FieldUpdateTime, v)) +} + +// UpdateTimeLTE applies the LTE predicate on the "update_time" field. +func UpdateTimeLTE(v time.Time) predicate.Role { + return predicate.Role(sql.FieldLTE(FieldUpdateTime, v)) +} + +// UpdateTimeIsNil applies the IsNil predicate on the "update_time" field. +func UpdateTimeIsNil() predicate.Role { + return predicate.Role(sql.FieldIsNull(FieldUpdateTime)) +} + +// UpdateTimeNotNil applies the NotNil predicate on the "update_time" field. +func UpdateTimeNotNil() predicate.Role { + return predicate.Role(sql.FieldNotNull(FieldUpdateTime)) +} + +// DeleteTimeEQ applies the EQ predicate on the "delete_time" field. +func DeleteTimeEQ(v time.Time) predicate.Role { + return predicate.Role(sql.FieldEQ(FieldDeleteTime, v)) +} + +// DeleteTimeNEQ applies the NEQ predicate on the "delete_time" field. +func DeleteTimeNEQ(v time.Time) predicate.Role { + return predicate.Role(sql.FieldNEQ(FieldDeleteTime, v)) +} + +// DeleteTimeIn applies the In predicate on the "delete_time" field. +func DeleteTimeIn(vs ...time.Time) predicate.Role { + return predicate.Role(sql.FieldIn(FieldDeleteTime, vs...)) +} + +// DeleteTimeNotIn applies the NotIn predicate on the "delete_time" field. +func DeleteTimeNotIn(vs ...time.Time) predicate.Role { + return predicate.Role(sql.FieldNotIn(FieldDeleteTime, vs...)) +} + +// DeleteTimeGT applies the GT predicate on the "delete_time" field. +func DeleteTimeGT(v time.Time) predicate.Role { + return predicate.Role(sql.FieldGT(FieldDeleteTime, v)) +} + +// DeleteTimeGTE applies the GTE predicate on the "delete_time" field. +func DeleteTimeGTE(v time.Time) predicate.Role { + return predicate.Role(sql.FieldGTE(FieldDeleteTime, v)) +} + +// DeleteTimeLT applies the LT predicate on the "delete_time" field. +func DeleteTimeLT(v time.Time) predicate.Role { + return predicate.Role(sql.FieldLT(FieldDeleteTime, v)) +} + +// DeleteTimeLTE applies the LTE predicate on the "delete_time" field. +func DeleteTimeLTE(v time.Time) predicate.Role { + return predicate.Role(sql.FieldLTE(FieldDeleteTime, v)) +} + +// DeleteTimeIsNil applies the IsNil predicate on the "delete_time" field. +func DeleteTimeIsNil() predicate.Role { + return predicate.Role(sql.FieldIsNull(FieldDeleteTime)) +} + +// DeleteTimeNotNil applies the NotNil predicate on the "delete_time" field. +func DeleteTimeNotNil() predicate.Role { + return predicate.Role(sql.FieldNotNull(FieldDeleteTime)) +} + +// StatusEQ applies the EQ predicate on the "status" field. +func StatusEQ(v Status) predicate.Role { + return predicate.Role(sql.FieldEQ(FieldStatus, v)) +} + +// StatusNEQ applies the NEQ predicate on the "status" field. +func StatusNEQ(v Status) predicate.Role { + return predicate.Role(sql.FieldNEQ(FieldStatus, v)) +} + +// StatusIn applies the In predicate on the "status" field. +func StatusIn(vs ...Status) predicate.Role { + return predicate.Role(sql.FieldIn(FieldStatus, vs...)) +} + +// StatusNotIn applies the NotIn predicate on the "status" field. +func StatusNotIn(vs ...Status) predicate.Role { + return predicate.Role(sql.FieldNotIn(FieldStatus, vs...)) +} + +// StatusIsNil applies the IsNil predicate on the "status" field. +func StatusIsNil() predicate.Role { + return predicate.Role(sql.FieldIsNull(FieldStatus)) +} + +// StatusNotNil applies the NotNil predicate on the "status" field. +func StatusNotNil() predicate.Role { + return predicate.Role(sql.FieldNotNull(FieldStatus)) +} + +// CreateByEQ applies the EQ predicate on the "create_by" field. +func CreateByEQ(v uint32) predicate.Role { + return predicate.Role(sql.FieldEQ(FieldCreateBy, v)) +} + +// CreateByNEQ applies the NEQ predicate on the "create_by" field. +func CreateByNEQ(v uint32) predicate.Role { + return predicate.Role(sql.FieldNEQ(FieldCreateBy, v)) +} + +// CreateByIn applies the In predicate on the "create_by" field. +func CreateByIn(vs ...uint32) predicate.Role { + return predicate.Role(sql.FieldIn(FieldCreateBy, vs...)) +} + +// CreateByNotIn applies the NotIn predicate on the "create_by" field. +func CreateByNotIn(vs ...uint32) predicate.Role { + return predicate.Role(sql.FieldNotIn(FieldCreateBy, vs...)) +} + +// CreateByGT applies the GT predicate on the "create_by" field. +func CreateByGT(v uint32) predicate.Role { + return predicate.Role(sql.FieldGT(FieldCreateBy, v)) +} + +// CreateByGTE applies the GTE predicate on the "create_by" field. +func CreateByGTE(v uint32) predicate.Role { + return predicate.Role(sql.FieldGTE(FieldCreateBy, v)) +} + +// CreateByLT applies the LT predicate on the "create_by" field. +func CreateByLT(v uint32) predicate.Role { + return predicate.Role(sql.FieldLT(FieldCreateBy, v)) +} + +// CreateByLTE applies the LTE predicate on the "create_by" field. +func CreateByLTE(v uint32) predicate.Role { + return predicate.Role(sql.FieldLTE(FieldCreateBy, v)) +} + +// CreateByIsNil applies the IsNil predicate on the "create_by" field. +func CreateByIsNil() predicate.Role { + return predicate.Role(sql.FieldIsNull(FieldCreateBy)) +} + +// CreateByNotNil applies the NotNil predicate on the "create_by" field. +func CreateByNotNil() predicate.Role { + return predicate.Role(sql.FieldNotNull(FieldCreateBy)) +} + +// RemarkEQ applies the EQ predicate on the "remark" field. +func RemarkEQ(v string) predicate.Role { + return predicate.Role(sql.FieldEQ(FieldRemark, v)) +} + +// RemarkNEQ applies the NEQ predicate on the "remark" field. +func RemarkNEQ(v string) predicate.Role { + return predicate.Role(sql.FieldNEQ(FieldRemark, v)) +} + +// RemarkIn applies the In predicate on the "remark" field. +func RemarkIn(vs ...string) predicate.Role { + return predicate.Role(sql.FieldIn(FieldRemark, vs...)) +} + +// RemarkNotIn applies the NotIn predicate on the "remark" field. +func RemarkNotIn(vs ...string) predicate.Role { + return predicate.Role(sql.FieldNotIn(FieldRemark, vs...)) +} + +// RemarkGT applies the GT predicate on the "remark" field. +func RemarkGT(v string) predicate.Role { + return predicate.Role(sql.FieldGT(FieldRemark, v)) +} + +// RemarkGTE applies the GTE predicate on the "remark" field. +func RemarkGTE(v string) predicate.Role { + return predicate.Role(sql.FieldGTE(FieldRemark, v)) +} + +// RemarkLT applies the LT predicate on the "remark" field. +func RemarkLT(v string) predicate.Role { + return predicate.Role(sql.FieldLT(FieldRemark, v)) +} + +// RemarkLTE applies the LTE predicate on the "remark" field. +func RemarkLTE(v string) predicate.Role { + return predicate.Role(sql.FieldLTE(FieldRemark, v)) +} + +// RemarkContains applies the Contains predicate on the "remark" field. +func RemarkContains(v string) predicate.Role { + return predicate.Role(sql.FieldContains(FieldRemark, v)) +} + +// RemarkHasPrefix applies the HasPrefix predicate on the "remark" field. +func RemarkHasPrefix(v string) predicate.Role { + return predicate.Role(sql.FieldHasPrefix(FieldRemark, v)) +} + +// RemarkHasSuffix applies the HasSuffix predicate on the "remark" field. +func RemarkHasSuffix(v string) predicate.Role { + return predicate.Role(sql.FieldHasSuffix(FieldRemark, v)) +} + +// RemarkIsNil applies the IsNil predicate on the "remark" field. +func RemarkIsNil() predicate.Role { + return predicate.Role(sql.FieldIsNull(FieldRemark)) +} + +// RemarkNotNil applies the NotNil predicate on the "remark" field. +func RemarkNotNil() predicate.Role { + return predicate.Role(sql.FieldNotNull(FieldRemark)) +} + +// RemarkEqualFold applies the EqualFold predicate on the "remark" field. +func RemarkEqualFold(v string) predicate.Role { + return predicate.Role(sql.FieldEqualFold(FieldRemark, v)) +} + +// RemarkContainsFold applies the ContainsFold predicate on the "remark" field. +func RemarkContainsFold(v string) predicate.Role { + return predicate.Role(sql.FieldContainsFold(FieldRemark, v)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.Role { + return predicate.Role(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.Role { + return predicate.Role(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.Role { + return predicate.Role(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.Role { + return predicate.Role(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.Role { + return predicate.Role(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.Role { + return predicate.Role(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.Role { + return predicate.Role(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.Role { + return predicate.Role(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.Role { + return predicate.Role(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.Role { + return predicate.Role(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.Role { + return predicate.Role(sql.FieldHasSuffix(FieldName, v)) +} + +// NameIsNil applies the IsNil predicate on the "name" field. +func NameIsNil() predicate.Role { + return predicate.Role(sql.FieldIsNull(FieldName)) +} + +// NameNotNil applies the NotNil predicate on the "name" field. +func NameNotNil() predicate.Role { + return predicate.Role(sql.FieldNotNull(FieldName)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.Role { + return predicate.Role(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.Role { + return predicate.Role(sql.FieldContainsFold(FieldName, v)) +} + +// CodeEQ applies the EQ predicate on the "code" field. +func CodeEQ(v string) predicate.Role { + return predicate.Role(sql.FieldEQ(FieldCode, v)) +} + +// CodeNEQ applies the NEQ predicate on the "code" field. +func CodeNEQ(v string) predicate.Role { + return predicate.Role(sql.FieldNEQ(FieldCode, v)) +} + +// CodeIn applies the In predicate on the "code" field. +func CodeIn(vs ...string) predicate.Role { + return predicate.Role(sql.FieldIn(FieldCode, vs...)) +} + +// CodeNotIn applies the NotIn predicate on the "code" field. +func CodeNotIn(vs ...string) predicate.Role { + return predicate.Role(sql.FieldNotIn(FieldCode, vs...)) +} + +// CodeGT applies the GT predicate on the "code" field. +func CodeGT(v string) predicate.Role { + return predicate.Role(sql.FieldGT(FieldCode, v)) +} + +// CodeGTE applies the GTE predicate on the "code" field. +func CodeGTE(v string) predicate.Role { + return predicate.Role(sql.FieldGTE(FieldCode, v)) +} + +// CodeLT applies the LT predicate on the "code" field. +func CodeLT(v string) predicate.Role { + return predicate.Role(sql.FieldLT(FieldCode, v)) +} + +// CodeLTE applies the LTE predicate on the "code" field. +func CodeLTE(v string) predicate.Role { + return predicate.Role(sql.FieldLTE(FieldCode, v)) +} + +// CodeContains applies the Contains predicate on the "code" field. +func CodeContains(v string) predicate.Role { + return predicate.Role(sql.FieldContains(FieldCode, v)) +} + +// CodeHasPrefix applies the HasPrefix predicate on the "code" field. +func CodeHasPrefix(v string) predicate.Role { + return predicate.Role(sql.FieldHasPrefix(FieldCode, v)) +} + +// CodeHasSuffix applies the HasSuffix predicate on the "code" field. +func CodeHasSuffix(v string) predicate.Role { + return predicate.Role(sql.FieldHasSuffix(FieldCode, v)) +} + +// CodeIsNil applies the IsNil predicate on the "code" field. +func CodeIsNil() predicate.Role { + return predicate.Role(sql.FieldIsNull(FieldCode)) +} + +// CodeNotNil applies the NotNil predicate on the "code" field. +func CodeNotNil() predicate.Role { + return predicate.Role(sql.FieldNotNull(FieldCode)) +} + +// CodeEqualFold applies the EqualFold predicate on the "code" field. +func CodeEqualFold(v string) predicate.Role { + return predicate.Role(sql.FieldEqualFold(FieldCode, v)) +} + +// CodeContainsFold applies the ContainsFold predicate on the "code" field. +func CodeContainsFold(v string) predicate.Role { + return predicate.Role(sql.FieldContainsFold(FieldCode, v)) +} + +// ParentIDEQ applies the EQ predicate on the "parent_id" field. +func ParentIDEQ(v uint32) predicate.Role { + return predicate.Role(sql.FieldEQ(FieldParentID, v)) +} + +// ParentIDNEQ applies the NEQ predicate on the "parent_id" field. +func ParentIDNEQ(v uint32) predicate.Role { + return predicate.Role(sql.FieldNEQ(FieldParentID, v)) +} + +// ParentIDIn applies the In predicate on the "parent_id" field. +func ParentIDIn(vs ...uint32) predicate.Role { + return predicate.Role(sql.FieldIn(FieldParentID, vs...)) +} + +// ParentIDNotIn applies the NotIn predicate on the "parent_id" field. +func ParentIDNotIn(vs ...uint32) predicate.Role { + return predicate.Role(sql.FieldNotIn(FieldParentID, vs...)) +} + +// ParentIDIsNil applies the IsNil predicate on the "parent_id" field. +func ParentIDIsNil() predicate.Role { + return predicate.Role(sql.FieldIsNull(FieldParentID)) +} + +// ParentIDNotNil applies the NotNil predicate on the "parent_id" field. +func ParentIDNotNil() predicate.Role { + return predicate.Role(sql.FieldNotNull(FieldParentID)) +} + +// OrderNoEQ applies the EQ predicate on the "order_no" field. +func OrderNoEQ(v int32) predicate.Role { + return predicate.Role(sql.FieldEQ(FieldOrderNo, v)) +} + +// OrderNoNEQ applies the NEQ predicate on the "order_no" field. +func OrderNoNEQ(v int32) predicate.Role { + return predicate.Role(sql.FieldNEQ(FieldOrderNo, v)) +} + +// OrderNoIn applies the In predicate on the "order_no" field. +func OrderNoIn(vs ...int32) predicate.Role { + return predicate.Role(sql.FieldIn(FieldOrderNo, vs...)) +} + +// OrderNoNotIn applies the NotIn predicate on the "order_no" field. +func OrderNoNotIn(vs ...int32) predicate.Role { + return predicate.Role(sql.FieldNotIn(FieldOrderNo, vs...)) +} + +// OrderNoGT applies the GT predicate on the "order_no" field. +func OrderNoGT(v int32) predicate.Role { + return predicate.Role(sql.FieldGT(FieldOrderNo, v)) +} + +// OrderNoGTE applies the GTE predicate on the "order_no" field. +func OrderNoGTE(v int32) predicate.Role { + return predicate.Role(sql.FieldGTE(FieldOrderNo, v)) +} + +// OrderNoLT applies the LT predicate on the "order_no" field. +func OrderNoLT(v int32) predicate.Role { + return predicate.Role(sql.FieldLT(FieldOrderNo, v)) +} + +// OrderNoLTE applies the LTE predicate on the "order_no" field. +func OrderNoLTE(v int32) predicate.Role { + return predicate.Role(sql.FieldLTE(FieldOrderNo, v)) +} + +// OrderNoIsNil applies the IsNil predicate on the "order_no" field. +func OrderNoIsNil() predicate.Role { + return predicate.Role(sql.FieldIsNull(FieldOrderNo)) +} + +// OrderNoNotNil applies the NotNil predicate on the "order_no" field. +func OrderNoNotNil() predicate.Role { + return predicate.Role(sql.FieldNotNull(FieldOrderNo)) +} + +// HasParent applies the HasEdge predicate on the "parent" edge. +func HasParent() predicate.Role { + return predicate.Role(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, ParentTable, ParentColumn), + ) + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasParentWith applies the HasEdge predicate on the "parent" edge with a given conditions (other predicates). +func HasParentWith(preds ...predicate.Role) predicate.Role { + return predicate.Role(func(s *sql.Selector) { + step := newParentStep() + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasChildren applies the HasEdge predicate on the "children" edge. +func HasChildren() predicate.Role { + return predicate.Role(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, ChildrenTable, ChildrenColumn), + ) + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasChildrenWith applies the HasEdge predicate on the "children" edge with a given conditions (other predicates). +func HasChildrenWith(preds ...predicate.Role) predicate.Role { + return predicate.Role(func(s *sql.Selector) { + step := newChildrenStep() + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.Role) predicate.Role { + return predicate.Role(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.Role) predicate.Role { + return predicate.Role(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.Role) predicate.Role { + return predicate.Role(sql.NotPredicates(p)) +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/role_create.go b/monolithic/backend/app/admin/service/internal/data/ent/role_create.go new file mode 100644 index 0000000..a368973 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/role_create.go @@ -0,0 +1,1289 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "errors" + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/role" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// RoleCreate is the builder for creating a Role entity. +type RoleCreate struct { + config + mutation *RoleMutation + hooks []Hook + conflict []sql.ConflictOption +} + +// SetCreateTime sets the "create_time" field. +func (rc *RoleCreate) SetCreateTime(t time.Time) *RoleCreate { + rc.mutation.SetCreateTime(t) + return rc +} + +// SetNillableCreateTime sets the "create_time" field if the given value is not nil. +func (rc *RoleCreate) SetNillableCreateTime(t *time.Time) *RoleCreate { + if t != nil { + rc.SetCreateTime(*t) + } + return rc +} + +// SetUpdateTime sets the "update_time" field. +func (rc *RoleCreate) SetUpdateTime(t time.Time) *RoleCreate { + rc.mutation.SetUpdateTime(t) + return rc +} + +// SetNillableUpdateTime sets the "update_time" field if the given value is not nil. +func (rc *RoleCreate) SetNillableUpdateTime(t *time.Time) *RoleCreate { + if t != nil { + rc.SetUpdateTime(*t) + } + return rc +} + +// SetDeleteTime sets the "delete_time" field. +func (rc *RoleCreate) SetDeleteTime(t time.Time) *RoleCreate { + rc.mutation.SetDeleteTime(t) + return rc +} + +// SetNillableDeleteTime sets the "delete_time" field if the given value is not nil. +func (rc *RoleCreate) SetNillableDeleteTime(t *time.Time) *RoleCreate { + if t != nil { + rc.SetDeleteTime(*t) + } + return rc +} + +// SetStatus sets the "status" field. +func (rc *RoleCreate) SetStatus(r role.Status) *RoleCreate { + rc.mutation.SetStatus(r) + return rc +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (rc *RoleCreate) SetNillableStatus(r *role.Status) *RoleCreate { + if r != nil { + rc.SetStatus(*r) + } + return rc +} + +// SetCreateBy sets the "create_by" field. +func (rc *RoleCreate) SetCreateBy(u uint32) *RoleCreate { + rc.mutation.SetCreateBy(u) + return rc +} + +// SetNillableCreateBy sets the "create_by" field if the given value is not nil. +func (rc *RoleCreate) SetNillableCreateBy(u *uint32) *RoleCreate { + if u != nil { + rc.SetCreateBy(*u) + } + return rc +} + +// SetRemark sets the "remark" field. +func (rc *RoleCreate) SetRemark(s string) *RoleCreate { + rc.mutation.SetRemark(s) + return rc +} + +// SetNillableRemark sets the "remark" field if the given value is not nil. +func (rc *RoleCreate) SetNillableRemark(s *string) *RoleCreate { + if s != nil { + rc.SetRemark(*s) + } + return rc +} + +// SetName sets the "name" field. +func (rc *RoleCreate) SetName(s string) *RoleCreate { + rc.mutation.SetName(s) + return rc +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (rc *RoleCreate) SetNillableName(s *string) *RoleCreate { + if s != nil { + rc.SetName(*s) + } + return rc +} + +// SetCode sets the "code" field. +func (rc *RoleCreate) SetCode(s string) *RoleCreate { + rc.mutation.SetCode(s) + return rc +} + +// SetNillableCode sets the "code" field if the given value is not nil. +func (rc *RoleCreate) SetNillableCode(s *string) *RoleCreate { + if s != nil { + rc.SetCode(*s) + } + return rc +} + +// SetParentID sets the "parent_id" field. +func (rc *RoleCreate) SetParentID(u uint32) *RoleCreate { + rc.mutation.SetParentID(u) + return rc +} + +// SetNillableParentID sets the "parent_id" field if the given value is not nil. +func (rc *RoleCreate) SetNillableParentID(u *uint32) *RoleCreate { + if u != nil { + rc.SetParentID(*u) + } + return rc +} + +// SetOrderNo sets the "order_no" field. +func (rc *RoleCreate) SetOrderNo(i int32) *RoleCreate { + rc.mutation.SetOrderNo(i) + return rc +} + +// SetNillableOrderNo sets the "order_no" field if the given value is not nil. +func (rc *RoleCreate) SetNillableOrderNo(i *int32) *RoleCreate { + if i != nil { + rc.SetOrderNo(*i) + } + return rc +} + +// SetID sets the "id" field. +func (rc *RoleCreate) SetID(u uint32) *RoleCreate { + rc.mutation.SetID(u) + return rc +} + +// SetParent sets the "parent" edge to the Role entity. +func (rc *RoleCreate) SetParent(r *Role) *RoleCreate { + return rc.SetParentID(r.ID) +} + +// AddChildIDs adds the "children" edge to the Role entity by IDs. +func (rc *RoleCreate) AddChildIDs(ids ...uint32) *RoleCreate { + rc.mutation.AddChildIDs(ids...) + return rc +} + +// AddChildren adds the "children" edges to the Role entity. +func (rc *RoleCreate) AddChildren(r ...*Role) *RoleCreate { + ids := make([]uint32, len(r)) + for i := range r { + ids[i] = r[i].ID + } + return rc.AddChildIDs(ids...) +} + +// Mutation returns the RoleMutation object of the builder. +func (rc *RoleCreate) Mutation() *RoleMutation { + return rc.mutation +} + +// Save creates the Role in the database. +func (rc *RoleCreate) Save(ctx context.Context) (*Role, error) { + rc.defaults() + return withHooks(ctx, rc.sqlSave, rc.mutation, rc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (rc *RoleCreate) SaveX(ctx context.Context) *Role { + v, err := rc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (rc *RoleCreate) Exec(ctx context.Context) error { + _, err := rc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (rc *RoleCreate) ExecX(ctx context.Context) { + if err := rc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (rc *RoleCreate) defaults() { + if _, ok := rc.mutation.Status(); !ok { + v := role.DefaultStatus + rc.mutation.SetStatus(v) + } + if _, ok := rc.mutation.Remark(); !ok { + v := role.DefaultRemark + rc.mutation.SetRemark(v) + } + if _, ok := rc.mutation.Code(); !ok { + v := role.DefaultCode + rc.mutation.SetCode(v) + } + if _, ok := rc.mutation.OrderNo(); !ok { + v := role.DefaultOrderNo + rc.mutation.SetOrderNo(v) + } +} + +// check runs all checks and user-defined validators on the builder. +func (rc *RoleCreate) check() error { + if v, ok := rc.mutation.Status(); ok { + if err := role.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "Role.status": %w`, err)} + } + } + if v, ok := rc.mutation.Name(); ok { + if err := role.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "Role.name": %w`, err)} + } + } + if v, ok := rc.mutation.Code(); ok { + if err := role.CodeValidator(v); err != nil { + return &ValidationError{Name: "code", err: fmt.Errorf(`ent: validator failed for field "Role.code": %w`, err)} + } + } + if v, ok := rc.mutation.ID(); ok { + if err := role.IDValidator(v); err != nil { + return &ValidationError{Name: "id", err: fmt.Errorf(`ent: validator failed for field "Role.id": %w`, err)} + } + } + return nil +} + +func (rc *RoleCreate) sqlSave(ctx context.Context) (*Role, error) { + if err := rc.check(); err != nil { + return nil, err + } + _node, _spec := rc.createSpec() + if err := sqlgraph.CreateNode(ctx, rc.driver, _spec); err != nil { + if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + if _spec.ID.Value != _node.ID { + id := _spec.ID.Value.(int64) + _node.ID = uint32(id) + } + rc.mutation.id = &_node.ID + rc.mutation.done = true + return _node, nil +} + +func (rc *RoleCreate) createSpec() (*Role, *sqlgraph.CreateSpec) { + var ( + _node = &Role{config: rc.config} + _spec = sqlgraph.NewCreateSpec(role.Table, sqlgraph.NewFieldSpec(role.FieldID, field.TypeUint32)) + ) + _spec.OnConflict = rc.conflict + if id, ok := rc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := rc.mutation.CreateTime(); ok { + _spec.SetField(role.FieldCreateTime, field.TypeTime, value) + _node.CreateTime = &value + } + if value, ok := rc.mutation.UpdateTime(); ok { + _spec.SetField(role.FieldUpdateTime, field.TypeTime, value) + _node.UpdateTime = &value + } + if value, ok := rc.mutation.DeleteTime(); ok { + _spec.SetField(role.FieldDeleteTime, field.TypeTime, value) + _node.DeleteTime = &value + } + if value, ok := rc.mutation.Status(); ok { + _spec.SetField(role.FieldStatus, field.TypeEnum, value) + _node.Status = &value + } + if value, ok := rc.mutation.CreateBy(); ok { + _spec.SetField(role.FieldCreateBy, field.TypeUint32, value) + _node.CreateBy = &value + } + if value, ok := rc.mutation.Remark(); ok { + _spec.SetField(role.FieldRemark, field.TypeString, value) + _node.Remark = &value + } + if value, ok := rc.mutation.Name(); ok { + _spec.SetField(role.FieldName, field.TypeString, value) + _node.Name = &value + } + if value, ok := rc.mutation.Code(); ok { + _spec.SetField(role.FieldCode, field.TypeString, value) + _node.Code = &value + } + if value, ok := rc.mutation.OrderNo(); ok { + _spec.SetField(role.FieldOrderNo, field.TypeInt32, value) + _node.OrderNo = &value + } + if nodes := rc.mutation.ParentIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: role.ParentTable, + Columns: []string{role.ParentColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(role.FieldID, field.TypeUint32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.ParentID = &nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := rc.mutation.ChildrenIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: role.ChildrenTable, + Columns: []string{role.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(role.FieldID, field.TypeUint32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause +// of the `INSERT` statement. For example: +// +// client.Role.Create(). +// SetCreateTime(v). +// OnConflict( +// // Update the row with the new values +// // the was proposed for insertion. +// sql.ResolveWithNewValues(), +// ). +// // Override some of the fields with custom +// // update values. +// Update(func(u *ent.RoleUpsert) { +// SetCreateTime(v+v). +// }). +// Exec(ctx) +func (rc *RoleCreate) OnConflict(opts ...sql.ConflictOption) *RoleUpsertOne { + rc.conflict = opts + return &RoleUpsertOne{ + create: rc, + } +} + +// OnConflictColumns calls `OnConflict` and configures the columns +// as conflict target. Using this option is equivalent to using: +// +// client.Role.Create(). +// OnConflict(sql.ConflictColumns(columns...)). +// Exec(ctx) +func (rc *RoleCreate) OnConflictColumns(columns ...string) *RoleUpsertOne { + rc.conflict = append(rc.conflict, sql.ConflictColumns(columns...)) + return &RoleUpsertOne{ + create: rc, + } +} + +type ( + // RoleUpsertOne is the builder for "upsert"-ing + // one Role node. + RoleUpsertOne struct { + create *RoleCreate + } + + // RoleUpsert is the "OnConflict" setter. + RoleUpsert struct { + *sql.UpdateSet + } +) + +// SetUpdateTime sets the "update_time" field. +func (u *RoleUpsert) SetUpdateTime(v time.Time) *RoleUpsert { + u.Set(role.FieldUpdateTime, v) + return u +} + +// UpdateUpdateTime sets the "update_time" field to the value that was provided on create. +func (u *RoleUpsert) UpdateUpdateTime() *RoleUpsert { + u.SetExcluded(role.FieldUpdateTime) + return u +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (u *RoleUpsert) ClearUpdateTime() *RoleUpsert { + u.SetNull(role.FieldUpdateTime) + return u +} + +// SetDeleteTime sets the "delete_time" field. +func (u *RoleUpsert) SetDeleteTime(v time.Time) *RoleUpsert { + u.Set(role.FieldDeleteTime, v) + return u +} + +// UpdateDeleteTime sets the "delete_time" field to the value that was provided on create. +func (u *RoleUpsert) UpdateDeleteTime() *RoleUpsert { + u.SetExcluded(role.FieldDeleteTime) + return u +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (u *RoleUpsert) ClearDeleteTime() *RoleUpsert { + u.SetNull(role.FieldDeleteTime) + return u +} + +// SetStatus sets the "status" field. +func (u *RoleUpsert) SetStatus(v role.Status) *RoleUpsert { + u.Set(role.FieldStatus, v) + return u +} + +// UpdateStatus sets the "status" field to the value that was provided on create. +func (u *RoleUpsert) UpdateStatus() *RoleUpsert { + u.SetExcluded(role.FieldStatus) + return u +} + +// ClearStatus clears the value of the "status" field. +func (u *RoleUpsert) ClearStatus() *RoleUpsert { + u.SetNull(role.FieldStatus) + return u +} + +// SetCreateBy sets the "create_by" field. +func (u *RoleUpsert) SetCreateBy(v uint32) *RoleUpsert { + u.Set(role.FieldCreateBy, v) + return u +} + +// UpdateCreateBy sets the "create_by" field to the value that was provided on create. +func (u *RoleUpsert) UpdateCreateBy() *RoleUpsert { + u.SetExcluded(role.FieldCreateBy) + return u +} + +// AddCreateBy adds v to the "create_by" field. +func (u *RoleUpsert) AddCreateBy(v uint32) *RoleUpsert { + u.Add(role.FieldCreateBy, v) + return u +} + +// ClearCreateBy clears the value of the "create_by" field. +func (u *RoleUpsert) ClearCreateBy() *RoleUpsert { + u.SetNull(role.FieldCreateBy) + return u +} + +// SetRemark sets the "remark" field. +func (u *RoleUpsert) SetRemark(v string) *RoleUpsert { + u.Set(role.FieldRemark, v) + return u +} + +// UpdateRemark sets the "remark" field to the value that was provided on create. +func (u *RoleUpsert) UpdateRemark() *RoleUpsert { + u.SetExcluded(role.FieldRemark) + return u +} + +// ClearRemark clears the value of the "remark" field. +func (u *RoleUpsert) ClearRemark() *RoleUpsert { + u.SetNull(role.FieldRemark) + return u +} + +// SetName sets the "name" field. +func (u *RoleUpsert) SetName(v string) *RoleUpsert { + u.Set(role.FieldName, v) + return u +} + +// UpdateName sets the "name" field to the value that was provided on create. +func (u *RoleUpsert) UpdateName() *RoleUpsert { + u.SetExcluded(role.FieldName) + return u +} + +// ClearName clears the value of the "name" field. +func (u *RoleUpsert) ClearName() *RoleUpsert { + u.SetNull(role.FieldName) + return u +} + +// SetCode sets the "code" field. +func (u *RoleUpsert) SetCode(v string) *RoleUpsert { + u.Set(role.FieldCode, v) + return u +} + +// UpdateCode sets the "code" field to the value that was provided on create. +func (u *RoleUpsert) UpdateCode() *RoleUpsert { + u.SetExcluded(role.FieldCode) + return u +} + +// ClearCode clears the value of the "code" field. +func (u *RoleUpsert) ClearCode() *RoleUpsert { + u.SetNull(role.FieldCode) + return u +} + +// SetParentID sets the "parent_id" field. +func (u *RoleUpsert) SetParentID(v uint32) *RoleUpsert { + u.Set(role.FieldParentID, v) + return u +} + +// UpdateParentID sets the "parent_id" field to the value that was provided on create. +func (u *RoleUpsert) UpdateParentID() *RoleUpsert { + u.SetExcluded(role.FieldParentID) + return u +} + +// ClearParentID clears the value of the "parent_id" field. +func (u *RoleUpsert) ClearParentID() *RoleUpsert { + u.SetNull(role.FieldParentID) + return u +} + +// SetOrderNo sets the "order_no" field. +func (u *RoleUpsert) SetOrderNo(v int32) *RoleUpsert { + u.Set(role.FieldOrderNo, v) + return u +} + +// UpdateOrderNo sets the "order_no" field to the value that was provided on create. +func (u *RoleUpsert) UpdateOrderNo() *RoleUpsert { + u.SetExcluded(role.FieldOrderNo) + return u +} + +// AddOrderNo adds v to the "order_no" field. +func (u *RoleUpsert) AddOrderNo(v int32) *RoleUpsert { + u.Add(role.FieldOrderNo, v) + return u +} + +// ClearOrderNo clears the value of the "order_no" field. +func (u *RoleUpsert) ClearOrderNo() *RoleUpsert { + u.SetNull(role.FieldOrderNo) + return u +} + +// UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. +// Using this option is equivalent to using: +// +// client.Role.Create(). +// OnConflict( +// sql.ResolveWithNewValues(), +// sql.ResolveWith(func(u *sql.UpdateSet) { +// u.SetIgnore(role.FieldID) +// }), +// ). +// Exec(ctx) +func (u *RoleUpsertOne) UpdateNewValues() *RoleUpsertOne { + u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues()) + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) { + if _, exists := u.create.mutation.ID(); exists { + s.SetIgnore(role.FieldID) + } + if _, exists := u.create.mutation.CreateTime(); exists { + s.SetIgnore(role.FieldCreateTime) + } + })) + return u +} + +// Ignore sets each column to itself in case of conflict. +// Using this option is equivalent to using: +// +// client.Role.Create(). +// OnConflict(sql.ResolveWithIgnore()). +// Exec(ctx) +func (u *RoleUpsertOne) Ignore() *RoleUpsertOne { + u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore()) + return u +} + +// DoNothing configures the conflict_action to `DO NOTHING`. +// Supported only by SQLite and PostgreSQL. +func (u *RoleUpsertOne) DoNothing() *RoleUpsertOne { + u.create.conflict = append(u.create.conflict, sql.DoNothing()) + return u +} + +// Update allows overriding fields `UPDATE` values. See the RoleCreate.OnConflict +// documentation for more info. +func (u *RoleUpsertOne) Update(set func(*RoleUpsert)) *RoleUpsertOne { + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) { + set(&RoleUpsert{UpdateSet: update}) + })) + return u +} + +// SetUpdateTime sets the "update_time" field. +func (u *RoleUpsertOne) SetUpdateTime(v time.Time) *RoleUpsertOne { + return u.Update(func(s *RoleUpsert) { + s.SetUpdateTime(v) + }) +} + +// UpdateUpdateTime sets the "update_time" field to the value that was provided on create. +func (u *RoleUpsertOne) UpdateUpdateTime() *RoleUpsertOne { + return u.Update(func(s *RoleUpsert) { + s.UpdateUpdateTime() + }) +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (u *RoleUpsertOne) ClearUpdateTime() *RoleUpsertOne { + return u.Update(func(s *RoleUpsert) { + s.ClearUpdateTime() + }) +} + +// SetDeleteTime sets the "delete_time" field. +func (u *RoleUpsertOne) SetDeleteTime(v time.Time) *RoleUpsertOne { + return u.Update(func(s *RoleUpsert) { + s.SetDeleteTime(v) + }) +} + +// UpdateDeleteTime sets the "delete_time" field to the value that was provided on create. +func (u *RoleUpsertOne) UpdateDeleteTime() *RoleUpsertOne { + return u.Update(func(s *RoleUpsert) { + s.UpdateDeleteTime() + }) +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (u *RoleUpsertOne) ClearDeleteTime() *RoleUpsertOne { + return u.Update(func(s *RoleUpsert) { + s.ClearDeleteTime() + }) +} + +// SetStatus sets the "status" field. +func (u *RoleUpsertOne) SetStatus(v role.Status) *RoleUpsertOne { + return u.Update(func(s *RoleUpsert) { + s.SetStatus(v) + }) +} + +// UpdateStatus sets the "status" field to the value that was provided on create. +func (u *RoleUpsertOne) UpdateStatus() *RoleUpsertOne { + return u.Update(func(s *RoleUpsert) { + s.UpdateStatus() + }) +} + +// ClearStatus clears the value of the "status" field. +func (u *RoleUpsertOne) ClearStatus() *RoleUpsertOne { + return u.Update(func(s *RoleUpsert) { + s.ClearStatus() + }) +} + +// SetCreateBy sets the "create_by" field. +func (u *RoleUpsertOne) SetCreateBy(v uint32) *RoleUpsertOne { + return u.Update(func(s *RoleUpsert) { + s.SetCreateBy(v) + }) +} + +// AddCreateBy adds v to the "create_by" field. +func (u *RoleUpsertOne) AddCreateBy(v uint32) *RoleUpsertOne { + return u.Update(func(s *RoleUpsert) { + s.AddCreateBy(v) + }) +} + +// UpdateCreateBy sets the "create_by" field to the value that was provided on create. +func (u *RoleUpsertOne) UpdateCreateBy() *RoleUpsertOne { + return u.Update(func(s *RoleUpsert) { + s.UpdateCreateBy() + }) +} + +// ClearCreateBy clears the value of the "create_by" field. +func (u *RoleUpsertOne) ClearCreateBy() *RoleUpsertOne { + return u.Update(func(s *RoleUpsert) { + s.ClearCreateBy() + }) +} + +// SetRemark sets the "remark" field. +func (u *RoleUpsertOne) SetRemark(v string) *RoleUpsertOne { + return u.Update(func(s *RoleUpsert) { + s.SetRemark(v) + }) +} + +// UpdateRemark sets the "remark" field to the value that was provided on create. +func (u *RoleUpsertOne) UpdateRemark() *RoleUpsertOne { + return u.Update(func(s *RoleUpsert) { + s.UpdateRemark() + }) +} + +// ClearRemark clears the value of the "remark" field. +func (u *RoleUpsertOne) ClearRemark() *RoleUpsertOne { + return u.Update(func(s *RoleUpsert) { + s.ClearRemark() + }) +} + +// SetName sets the "name" field. +func (u *RoleUpsertOne) SetName(v string) *RoleUpsertOne { + return u.Update(func(s *RoleUpsert) { + s.SetName(v) + }) +} + +// UpdateName sets the "name" field to the value that was provided on create. +func (u *RoleUpsertOne) UpdateName() *RoleUpsertOne { + return u.Update(func(s *RoleUpsert) { + s.UpdateName() + }) +} + +// ClearName clears the value of the "name" field. +func (u *RoleUpsertOne) ClearName() *RoleUpsertOne { + return u.Update(func(s *RoleUpsert) { + s.ClearName() + }) +} + +// SetCode sets the "code" field. +func (u *RoleUpsertOne) SetCode(v string) *RoleUpsertOne { + return u.Update(func(s *RoleUpsert) { + s.SetCode(v) + }) +} + +// UpdateCode sets the "code" field to the value that was provided on create. +func (u *RoleUpsertOne) UpdateCode() *RoleUpsertOne { + return u.Update(func(s *RoleUpsert) { + s.UpdateCode() + }) +} + +// ClearCode clears the value of the "code" field. +func (u *RoleUpsertOne) ClearCode() *RoleUpsertOne { + return u.Update(func(s *RoleUpsert) { + s.ClearCode() + }) +} + +// SetParentID sets the "parent_id" field. +func (u *RoleUpsertOne) SetParentID(v uint32) *RoleUpsertOne { + return u.Update(func(s *RoleUpsert) { + s.SetParentID(v) + }) +} + +// UpdateParentID sets the "parent_id" field to the value that was provided on create. +func (u *RoleUpsertOne) UpdateParentID() *RoleUpsertOne { + return u.Update(func(s *RoleUpsert) { + s.UpdateParentID() + }) +} + +// ClearParentID clears the value of the "parent_id" field. +func (u *RoleUpsertOne) ClearParentID() *RoleUpsertOne { + return u.Update(func(s *RoleUpsert) { + s.ClearParentID() + }) +} + +// SetOrderNo sets the "order_no" field. +func (u *RoleUpsertOne) SetOrderNo(v int32) *RoleUpsertOne { + return u.Update(func(s *RoleUpsert) { + s.SetOrderNo(v) + }) +} + +// AddOrderNo adds v to the "order_no" field. +func (u *RoleUpsertOne) AddOrderNo(v int32) *RoleUpsertOne { + return u.Update(func(s *RoleUpsert) { + s.AddOrderNo(v) + }) +} + +// UpdateOrderNo sets the "order_no" field to the value that was provided on create. +func (u *RoleUpsertOne) UpdateOrderNo() *RoleUpsertOne { + return u.Update(func(s *RoleUpsert) { + s.UpdateOrderNo() + }) +} + +// ClearOrderNo clears the value of the "order_no" field. +func (u *RoleUpsertOne) ClearOrderNo() *RoleUpsertOne { + return u.Update(func(s *RoleUpsert) { + s.ClearOrderNo() + }) +} + +// Exec executes the query. +func (u *RoleUpsertOne) Exec(ctx context.Context) error { + if len(u.create.conflict) == 0 { + return errors.New("ent: missing options for RoleCreate.OnConflict") + } + return u.create.Exec(ctx) +} + +// ExecX is like Exec, but panics if an error occurs. +func (u *RoleUpsertOne) ExecX(ctx context.Context) { + if err := u.create.Exec(ctx); err != nil { + panic(err) + } +} + +// Exec executes the UPSERT query and returns the inserted/updated ID. +func (u *RoleUpsertOne) ID(ctx context.Context) (id uint32, err error) { + node, err := u.create.Save(ctx) + if err != nil { + return id, err + } + return node.ID, nil +} + +// IDX is like ID, but panics if an error occurs. +func (u *RoleUpsertOne) IDX(ctx context.Context) uint32 { + id, err := u.ID(ctx) + if err != nil { + panic(err) + } + return id +} + +// RoleCreateBulk is the builder for creating many Role entities in bulk. +type RoleCreateBulk struct { + config + err error + builders []*RoleCreate + conflict []sql.ConflictOption +} + +// Save creates the Role entities in the database. +func (rcb *RoleCreateBulk) Save(ctx context.Context) ([]*Role, error) { + if rcb.err != nil { + return nil, rcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(rcb.builders)) + nodes := make([]*Role, len(rcb.builders)) + mutators := make([]Mutator, len(rcb.builders)) + for i := range rcb.builders { + func(i int, root context.Context) { + builder := rcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*RoleMutation) + if !ok { + return nil, fmt.Errorf("unexpected mutation type %T", m) + } + if err := builder.check(); err != nil { + return nil, err + } + builder.mutation = mutation + var err error + nodes[i], specs[i] = builder.createSpec() + if i < len(mutators)-1 { + _, err = mutators[i+1].Mutate(root, rcb.builders[i+1].mutation) + } else { + spec := &sqlgraph.BatchCreateSpec{Nodes: specs} + spec.OnConflict = rcb.conflict + // Invoke the actual operation on the latest mutation in the chain. + if err = sqlgraph.BatchCreate(ctx, rcb.driver, spec); err != nil { + if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + } + } + if err != nil { + return nil, err + } + mutation.id = &nodes[i].ID + if specs[i].ID.Value != nil && nodes[i].ID == 0 { + id := specs[i].ID.Value.(int64) + nodes[i].ID = uint32(id) + } + mutation.done = true + return nodes[i], nil + }) + for i := len(builder.hooks) - 1; i >= 0; i-- { + mut = builder.hooks[i](mut) + } + mutators[i] = mut + }(i, ctx) + } + if len(mutators) > 0 { + if _, err := mutators[0].Mutate(ctx, rcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (rcb *RoleCreateBulk) SaveX(ctx context.Context) []*Role { + v, err := rcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (rcb *RoleCreateBulk) Exec(ctx context.Context) error { + _, err := rcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (rcb *RoleCreateBulk) ExecX(ctx context.Context) { + if err := rcb.Exec(ctx); err != nil { + panic(err) + } +} + +// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause +// of the `INSERT` statement. For example: +// +// client.Role.CreateBulk(builders...). +// OnConflict( +// // Update the row with the new values +// // the was proposed for insertion. +// sql.ResolveWithNewValues(), +// ). +// // Override some of the fields with custom +// // update values. +// Update(func(u *ent.RoleUpsert) { +// SetCreateTime(v+v). +// }). +// Exec(ctx) +func (rcb *RoleCreateBulk) OnConflict(opts ...sql.ConflictOption) *RoleUpsertBulk { + rcb.conflict = opts + return &RoleUpsertBulk{ + create: rcb, + } +} + +// OnConflictColumns calls `OnConflict` and configures the columns +// as conflict target. Using this option is equivalent to using: +// +// client.Role.Create(). +// OnConflict(sql.ConflictColumns(columns...)). +// Exec(ctx) +func (rcb *RoleCreateBulk) OnConflictColumns(columns ...string) *RoleUpsertBulk { + rcb.conflict = append(rcb.conflict, sql.ConflictColumns(columns...)) + return &RoleUpsertBulk{ + create: rcb, + } +} + +// RoleUpsertBulk is the builder for "upsert"-ing +// a bulk of Role nodes. +type RoleUpsertBulk struct { + create *RoleCreateBulk +} + +// UpdateNewValues updates the mutable fields using the new values that +// were set on create. Using this option is equivalent to using: +// +// client.Role.Create(). +// OnConflict( +// sql.ResolveWithNewValues(), +// sql.ResolveWith(func(u *sql.UpdateSet) { +// u.SetIgnore(role.FieldID) +// }), +// ). +// Exec(ctx) +func (u *RoleUpsertBulk) UpdateNewValues() *RoleUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues()) + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) { + for _, b := range u.create.builders { + if _, exists := b.mutation.ID(); exists { + s.SetIgnore(role.FieldID) + } + if _, exists := b.mutation.CreateTime(); exists { + s.SetIgnore(role.FieldCreateTime) + } + } + })) + return u +} + +// Ignore sets each column to itself in case of conflict. +// Using this option is equivalent to using: +// +// client.Role.Create(). +// OnConflict(sql.ResolveWithIgnore()). +// Exec(ctx) +func (u *RoleUpsertBulk) Ignore() *RoleUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore()) + return u +} + +// DoNothing configures the conflict_action to `DO NOTHING`. +// Supported only by SQLite and PostgreSQL. +func (u *RoleUpsertBulk) DoNothing() *RoleUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.DoNothing()) + return u +} + +// Update allows overriding fields `UPDATE` values. See the RoleCreateBulk.OnConflict +// documentation for more info. +func (u *RoleUpsertBulk) Update(set func(*RoleUpsert)) *RoleUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) { + set(&RoleUpsert{UpdateSet: update}) + })) + return u +} + +// SetUpdateTime sets the "update_time" field. +func (u *RoleUpsertBulk) SetUpdateTime(v time.Time) *RoleUpsertBulk { + return u.Update(func(s *RoleUpsert) { + s.SetUpdateTime(v) + }) +} + +// UpdateUpdateTime sets the "update_time" field to the value that was provided on create. +func (u *RoleUpsertBulk) UpdateUpdateTime() *RoleUpsertBulk { + return u.Update(func(s *RoleUpsert) { + s.UpdateUpdateTime() + }) +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (u *RoleUpsertBulk) ClearUpdateTime() *RoleUpsertBulk { + return u.Update(func(s *RoleUpsert) { + s.ClearUpdateTime() + }) +} + +// SetDeleteTime sets the "delete_time" field. +func (u *RoleUpsertBulk) SetDeleteTime(v time.Time) *RoleUpsertBulk { + return u.Update(func(s *RoleUpsert) { + s.SetDeleteTime(v) + }) +} + +// UpdateDeleteTime sets the "delete_time" field to the value that was provided on create. +func (u *RoleUpsertBulk) UpdateDeleteTime() *RoleUpsertBulk { + return u.Update(func(s *RoleUpsert) { + s.UpdateDeleteTime() + }) +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (u *RoleUpsertBulk) ClearDeleteTime() *RoleUpsertBulk { + return u.Update(func(s *RoleUpsert) { + s.ClearDeleteTime() + }) +} + +// SetStatus sets the "status" field. +func (u *RoleUpsertBulk) SetStatus(v role.Status) *RoleUpsertBulk { + return u.Update(func(s *RoleUpsert) { + s.SetStatus(v) + }) +} + +// UpdateStatus sets the "status" field to the value that was provided on create. +func (u *RoleUpsertBulk) UpdateStatus() *RoleUpsertBulk { + return u.Update(func(s *RoleUpsert) { + s.UpdateStatus() + }) +} + +// ClearStatus clears the value of the "status" field. +func (u *RoleUpsertBulk) ClearStatus() *RoleUpsertBulk { + return u.Update(func(s *RoleUpsert) { + s.ClearStatus() + }) +} + +// SetCreateBy sets the "create_by" field. +func (u *RoleUpsertBulk) SetCreateBy(v uint32) *RoleUpsertBulk { + return u.Update(func(s *RoleUpsert) { + s.SetCreateBy(v) + }) +} + +// AddCreateBy adds v to the "create_by" field. +func (u *RoleUpsertBulk) AddCreateBy(v uint32) *RoleUpsertBulk { + return u.Update(func(s *RoleUpsert) { + s.AddCreateBy(v) + }) +} + +// UpdateCreateBy sets the "create_by" field to the value that was provided on create. +func (u *RoleUpsertBulk) UpdateCreateBy() *RoleUpsertBulk { + return u.Update(func(s *RoleUpsert) { + s.UpdateCreateBy() + }) +} + +// ClearCreateBy clears the value of the "create_by" field. +func (u *RoleUpsertBulk) ClearCreateBy() *RoleUpsertBulk { + return u.Update(func(s *RoleUpsert) { + s.ClearCreateBy() + }) +} + +// SetRemark sets the "remark" field. +func (u *RoleUpsertBulk) SetRemark(v string) *RoleUpsertBulk { + return u.Update(func(s *RoleUpsert) { + s.SetRemark(v) + }) +} + +// UpdateRemark sets the "remark" field to the value that was provided on create. +func (u *RoleUpsertBulk) UpdateRemark() *RoleUpsertBulk { + return u.Update(func(s *RoleUpsert) { + s.UpdateRemark() + }) +} + +// ClearRemark clears the value of the "remark" field. +func (u *RoleUpsertBulk) ClearRemark() *RoleUpsertBulk { + return u.Update(func(s *RoleUpsert) { + s.ClearRemark() + }) +} + +// SetName sets the "name" field. +func (u *RoleUpsertBulk) SetName(v string) *RoleUpsertBulk { + return u.Update(func(s *RoleUpsert) { + s.SetName(v) + }) +} + +// UpdateName sets the "name" field to the value that was provided on create. +func (u *RoleUpsertBulk) UpdateName() *RoleUpsertBulk { + return u.Update(func(s *RoleUpsert) { + s.UpdateName() + }) +} + +// ClearName clears the value of the "name" field. +func (u *RoleUpsertBulk) ClearName() *RoleUpsertBulk { + return u.Update(func(s *RoleUpsert) { + s.ClearName() + }) +} + +// SetCode sets the "code" field. +func (u *RoleUpsertBulk) SetCode(v string) *RoleUpsertBulk { + return u.Update(func(s *RoleUpsert) { + s.SetCode(v) + }) +} + +// UpdateCode sets the "code" field to the value that was provided on create. +func (u *RoleUpsertBulk) UpdateCode() *RoleUpsertBulk { + return u.Update(func(s *RoleUpsert) { + s.UpdateCode() + }) +} + +// ClearCode clears the value of the "code" field. +func (u *RoleUpsertBulk) ClearCode() *RoleUpsertBulk { + return u.Update(func(s *RoleUpsert) { + s.ClearCode() + }) +} + +// SetParentID sets the "parent_id" field. +func (u *RoleUpsertBulk) SetParentID(v uint32) *RoleUpsertBulk { + return u.Update(func(s *RoleUpsert) { + s.SetParentID(v) + }) +} + +// UpdateParentID sets the "parent_id" field to the value that was provided on create. +func (u *RoleUpsertBulk) UpdateParentID() *RoleUpsertBulk { + return u.Update(func(s *RoleUpsert) { + s.UpdateParentID() + }) +} + +// ClearParentID clears the value of the "parent_id" field. +func (u *RoleUpsertBulk) ClearParentID() *RoleUpsertBulk { + return u.Update(func(s *RoleUpsert) { + s.ClearParentID() + }) +} + +// SetOrderNo sets the "order_no" field. +func (u *RoleUpsertBulk) SetOrderNo(v int32) *RoleUpsertBulk { + return u.Update(func(s *RoleUpsert) { + s.SetOrderNo(v) + }) +} + +// AddOrderNo adds v to the "order_no" field. +func (u *RoleUpsertBulk) AddOrderNo(v int32) *RoleUpsertBulk { + return u.Update(func(s *RoleUpsert) { + s.AddOrderNo(v) + }) +} + +// UpdateOrderNo sets the "order_no" field to the value that was provided on create. +func (u *RoleUpsertBulk) UpdateOrderNo() *RoleUpsertBulk { + return u.Update(func(s *RoleUpsert) { + s.UpdateOrderNo() + }) +} + +// ClearOrderNo clears the value of the "order_no" field. +func (u *RoleUpsertBulk) ClearOrderNo() *RoleUpsertBulk { + return u.Update(func(s *RoleUpsert) { + s.ClearOrderNo() + }) +} + +// Exec executes the query. +func (u *RoleUpsertBulk) Exec(ctx context.Context) error { + if u.create.err != nil { + return u.create.err + } + for i, b := range u.create.builders { + if len(b.conflict) != 0 { + return fmt.Errorf("ent: OnConflict was set for builder %d. Set it on the RoleCreateBulk instead", i) + } + } + if len(u.create.conflict) == 0 { + return errors.New("ent: missing options for RoleCreateBulk.OnConflict") + } + return u.create.Exec(ctx) +} + +// ExecX is like Exec, but panics if an error occurs. +func (u *RoleUpsertBulk) ExecX(ctx context.Context) { + if err := u.create.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/role_delete.go b/monolithic/backend/app/admin/service/internal/data/ent/role_delete.go new file mode 100644 index 0000000..ccf636c --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/role_delete.go @@ -0,0 +1,88 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/role" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// RoleDelete is the builder for deleting a Role entity. +type RoleDelete struct { + config + hooks []Hook + mutation *RoleMutation +} + +// Where appends a list predicates to the RoleDelete builder. +func (rd *RoleDelete) Where(ps ...predicate.Role) *RoleDelete { + rd.mutation.Where(ps...) + return rd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (rd *RoleDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, rd.sqlExec, rd.mutation, rd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (rd *RoleDelete) ExecX(ctx context.Context) int { + n, err := rd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (rd *RoleDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(role.Table, sqlgraph.NewFieldSpec(role.FieldID, field.TypeUint32)) + if ps := rd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, rd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + rd.mutation.done = true + return affected, err +} + +// RoleDeleteOne is the builder for deleting a single Role entity. +type RoleDeleteOne struct { + rd *RoleDelete +} + +// Where appends a list predicates to the RoleDelete builder. +func (rdo *RoleDeleteOne) Where(ps ...predicate.Role) *RoleDeleteOne { + rdo.rd.mutation.Where(ps...) + return rdo +} + +// Exec executes the deletion query. +func (rdo *RoleDeleteOne) Exec(ctx context.Context) error { + n, err := rdo.rd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{role.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (rdo *RoleDeleteOne) ExecX(ctx context.Context) { + if err := rdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/role_query.go b/monolithic/backend/app/admin/service/internal/data/ent/role_query.go new file mode 100644 index 0000000..9668be7 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/role_query.go @@ -0,0 +1,706 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "database/sql/driver" + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/role" + "math" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// RoleQuery is the builder for querying Role entities. +type RoleQuery struct { + config + ctx *QueryContext + order []role.OrderOption + inters []Interceptor + predicates []predicate.Role + withParent *RoleQuery + withChildren *RoleQuery + modifiers []func(*sql.Selector) + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the RoleQuery builder. +func (rq *RoleQuery) Where(ps ...predicate.Role) *RoleQuery { + rq.predicates = append(rq.predicates, ps...) + return rq +} + +// Limit the number of records to be returned by this query. +func (rq *RoleQuery) Limit(limit int) *RoleQuery { + rq.ctx.Limit = &limit + return rq +} + +// Offset to start from. +func (rq *RoleQuery) Offset(offset int) *RoleQuery { + rq.ctx.Offset = &offset + return rq +} + +// Unique configures the query builder to filter duplicate records on query. +// By default, unique is set to true, and can be disabled using this method. +func (rq *RoleQuery) Unique(unique bool) *RoleQuery { + rq.ctx.Unique = &unique + return rq +} + +// Order specifies how the records should be ordered. +func (rq *RoleQuery) Order(o ...role.OrderOption) *RoleQuery { + rq.order = append(rq.order, o...) + return rq +} + +// QueryParent chains the current query on the "parent" edge. +func (rq *RoleQuery) QueryParent() *RoleQuery { + query := (&RoleClient{config: rq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := rq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := rq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(role.Table, role.FieldID, selector), + sqlgraph.To(role.Table, role.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, role.ParentTable, role.ParentColumn), + ) + fromU = sqlgraph.SetNeighbors(rq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryChildren chains the current query on the "children" edge. +func (rq *RoleQuery) QueryChildren() *RoleQuery { + query := (&RoleClient{config: rq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := rq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := rq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(role.Table, role.FieldID, selector), + sqlgraph.To(role.Table, role.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, role.ChildrenTable, role.ChildrenColumn), + ) + fromU = sqlgraph.SetNeighbors(rq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first Role entity from the query. +// Returns a *NotFoundError when no Role was found. +func (rq *RoleQuery) First(ctx context.Context) (*Role, error) { + nodes, err := rq.Limit(1).All(setContextOp(ctx, rq.ctx, "First")) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{role.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (rq *RoleQuery) FirstX(ctx context.Context) *Role { + node, err := rq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first Role ID from the query. +// Returns a *NotFoundError when no Role ID was found. +func (rq *RoleQuery) FirstID(ctx context.Context) (id uint32, err error) { + var ids []uint32 + if ids, err = rq.Limit(1).IDs(setContextOp(ctx, rq.ctx, "FirstID")); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{role.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (rq *RoleQuery) FirstIDX(ctx context.Context) uint32 { + id, err := rq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single Role entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one Role entity is found. +// Returns a *NotFoundError when no Role entities are found. +func (rq *RoleQuery) Only(ctx context.Context) (*Role, error) { + nodes, err := rq.Limit(2).All(setContextOp(ctx, rq.ctx, "Only")) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{role.Label} + default: + return nil, &NotSingularError{role.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (rq *RoleQuery) OnlyX(ctx context.Context) *Role { + node, err := rq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only Role ID in the query. +// Returns a *NotSingularError when more than one Role ID is found. +// Returns a *NotFoundError when no entities are found. +func (rq *RoleQuery) OnlyID(ctx context.Context) (id uint32, err error) { + var ids []uint32 + if ids, err = rq.Limit(2).IDs(setContextOp(ctx, rq.ctx, "OnlyID")); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{role.Label} + default: + err = &NotSingularError{role.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (rq *RoleQuery) OnlyIDX(ctx context.Context) uint32 { + id, err := rq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of Roles. +func (rq *RoleQuery) All(ctx context.Context) ([]*Role, error) { + ctx = setContextOp(ctx, rq.ctx, "All") + if err := rq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*Role, *RoleQuery]() + return withInterceptors[[]*Role](ctx, rq, qr, rq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (rq *RoleQuery) AllX(ctx context.Context) []*Role { + nodes, err := rq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of Role IDs. +func (rq *RoleQuery) IDs(ctx context.Context) (ids []uint32, err error) { + if rq.ctx.Unique == nil && rq.path != nil { + rq.Unique(true) + } + ctx = setContextOp(ctx, rq.ctx, "IDs") + if err = rq.Select(role.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (rq *RoleQuery) IDsX(ctx context.Context) []uint32 { + ids, err := rq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (rq *RoleQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, rq.ctx, "Count") + if err := rq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, rq, querierCount[*RoleQuery](), rq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (rq *RoleQuery) CountX(ctx context.Context) int { + count, err := rq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (rq *RoleQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, rq.ctx, "Exist") + switch _, err := rq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("ent: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (rq *RoleQuery) ExistX(ctx context.Context) bool { + exist, err := rq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the RoleQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (rq *RoleQuery) Clone() *RoleQuery { + if rq == nil { + return nil + } + return &RoleQuery{ + config: rq.config, + ctx: rq.ctx.Clone(), + order: append([]role.OrderOption{}, rq.order...), + inters: append([]Interceptor{}, rq.inters...), + predicates: append([]predicate.Role{}, rq.predicates...), + withParent: rq.withParent.Clone(), + withChildren: rq.withChildren.Clone(), + // clone intermediate query. + sql: rq.sql.Clone(), + path: rq.path, + } +} + +// WithParent tells the query-builder to eager-load the nodes that are connected to +// the "parent" edge. The optional arguments are used to configure the query builder of the edge. +func (rq *RoleQuery) WithParent(opts ...func(*RoleQuery)) *RoleQuery { + query := (&RoleClient{config: rq.config}).Query() + for _, opt := range opts { + opt(query) + } + rq.withParent = query + return rq +} + +// WithChildren tells the query-builder to eager-load the nodes that are connected to +// the "children" edge. The optional arguments are used to configure the query builder of the edge. +func (rq *RoleQuery) WithChildren(opts ...func(*RoleQuery)) *RoleQuery { + query := (&RoleClient{config: rq.config}).Query() + for _, opt := range opts { + opt(query) + } + rq.withChildren = query + return rq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreateTime time.Time `json:"create_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.Role.Query(). +// GroupBy(role.FieldCreateTime). +// Aggregate(ent.Count()). +// Scan(ctx, &v) +func (rq *RoleQuery) GroupBy(field string, fields ...string) *RoleGroupBy { + rq.ctx.Fields = append([]string{field}, fields...) + grbuild := &RoleGroupBy{build: rq} + grbuild.flds = &rq.ctx.Fields + grbuild.label = role.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreateTime time.Time `json:"create_time,omitempty"` +// } +// +// client.Role.Query(). +// Select(role.FieldCreateTime). +// Scan(ctx, &v) +func (rq *RoleQuery) Select(fields ...string) *RoleSelect { + rq.ctx.Fields = append(rq.ctx.Fields, fields...) + sbuild := &RoleSelect{RoleQuery: rq} + sbuild.label = role.Label + sbuild.flds, sbuild.scan = &rq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a RoleSelect configured with the given aggregations. +func (rq *RoleQuery) Aggregate(fns ...AggregateFunc) *RoleSelect { + return rq.Select().Aggregate(fns...) +} + +func (rq *RoleQuery) prepareQuery(ctx context.Context) error { + for _, inter := range rq.inters { + if inter == nil { + return fmt.Errorf("ent: uninitialized interceptor (forgotten import ent/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, rq); err != nil { + return err + } + } + } + for _, f := range rq.ctx.Fields { + if !role.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)} + } + } + if rq.path != nil { + prev, err := rq.path(ctx) + if err != nil { + return err + } + rq.sql = prev + } + return nil +} + +func (rq *RoleQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Role, error) { + var ( + nodes = []*Role{} + _spec = rq.querySpec() + loadedTypes = [2]bool{ + rq.withParent != nil, + rq.withChildren != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*Role).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &Role{config: rq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + if len(rq.modifiers) > 0 { + _spec.Modifiers = rq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, rq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := rq.withParent; query != nil { + if err := rq.loadParent(ctx, query, nodes, nil, + func(n *Role, e *Role) { n.Edges.Parent = e }); err != nil { + return nil, err + } + } + if query := rq.withChildren; query != nil { + if err := rq.loadChildren(ctx, query, nodes, + func(n *Role) { n.Edges.Children = []*Role{} }, + func(n *Role, e *Role) { n.Edges.Children = append(n.Edges.Children, e) }); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (rq *RoleQuery) loadParent(ctx context.Context, query *RoleQuery, nodes []*Role, init func(*Role), assign func(*Role, *Role)) error { + ids := make([]uint32, 0, len(nodes)) + nodeids := make(map[uint32][]*Role) + for i := range nodes { + if nodes[i].ParentID == nil { + continue + } + fk := *nodes[i].ParentID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(role.IDIn(ids...)) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nodeids[n.ID] + if !ok { + return fmt.Errorf(`unexpected foreign-key "parent_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (rq *RoleQuery) loadChildren(ctx context.Context, query *RoleQuery, nodes []*Role, init func(*Role), assign func(*Role, *Role)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[uint32]*Role) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(role.FieldParentID) + } + query.Where(predicate.Role(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(role.ChildrenColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.ParentID + if fk == nil { + return fmt.Errorf(`foreign-key "parent_id" is nil for node %v`, n.ID) + } + node, ok := nodeids[*fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "parent_id" returned %v for node %v`, *fk, n.ID) + } + assign(node, n) + } + return nil +} + +func (rq *RoleQuery) sqlCount(ctx context.Context) (int, error) { + _spec := rq.querySpec() + if len(rq.modifiers) > 0 { + _spec.Modifiers = rq.modifiers + } + _spec.Node.Columns = rq.ctx.Fields + if len(rq.ctx.Fields) > 0 { + _spec.Unique = rq.ctx.Unique != nil && *rq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, rq.driver, _spec) +} + +func (rq *RoleQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(role.Table, role.Columns, sqlgraph.NewFieldSpec(role.FieldID, field.TypeUint32)) + _spec.From = rq.sql + if unique := rq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if rq.path != nil { + _spec.Unique = true + } + if fields := rq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, role.FieldID) + for i := range fields { + if fields[i] != role.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if rq.withParent != nil { + _spec.Node.AddColumnOnce(role.FieldParentID) + } + } + if ps := rq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := rq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := rq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := rq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (rq *RoleQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(rq.driver.Dialect()) + t1 := builder.Table(role.Table) + columns := rq.ctx.Fields + if len(columns) == 0 { + columns = role.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if rq.sql != nil { + selector = rq.sql + selector.Select(selector.Columns(columns...)...) + } + if rq.ctx.Unique != nil && *rq.ctx.Unique { + selector.Distinct() + } + for _, m := range rq.modifiers { + m(selector) + } + for _, p := range rq.predicates { + p(selector) + } + for _, p := range rq.order { + p(selector) + } + if offset := rq.ctx.Offset; offset != nil { + // limit is mandatory for offset clause. We start + // with default value, and override it below if needed. + selector.Offset(*offset).Limit(math.MaxInt32) + } + if limit := rq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// Modify adds a query modifier for attaching custom logic to queries. +func (rq *RoleQuery) Modify(modifiers ...func(s *sql.Selector)) *RoleSelect { + rq.modifiers = append(rq.modifiers, modifiers...) + return rq.Select() +} + +// RoleGroupBy is the group-by builder for Role entities. +type RoleGroupBy struct { + selector + build *RoleQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (rgb *RoleGroupBy) Aggregate(fns ...AggregateFunc) *RoleGroupBy { + rgb.fns = append(rgb.fns, fns...) + return rgb +} + +// Scan applies the selector query and scans the result into the given value. +func (rgb *RoleGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, rgb.build.ctx, "GroupBy") + if err := rgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*RoleQuery, *RoleGroupBy](ctx, rgb.build, rgb, rgb.build.inters, v) +} + +func (rgb *RoleGroupBy) sqlScan(ctx context.Context, root *RoleQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(rgb.fns)) + for _, fn := range rgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*rgb.flds)+len(rgb.fns)) + for _, f := range *rgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*rgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := rgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// RoleSelect is the builder for selecting fields of Role entities. +type RoleSelect struct { + *RoleQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (rs *RoleSelect) Aggregate(fns ...AggregateFunc) *RoleSelect { + rs.fns = append(rs.fns, fns...) + return rs +} + +// Scan applies the selector query and scans the result into the given value. +func (rs *RoleSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, rs.ctx, "Select") + if err := rs.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*RoleQuery, *RoleSelect](ctx, rs.RoleQuery, rs, rs.inters, v) +} + +func (rs *RoleSelect) sqlScan(ctx context.Context, root *RoleQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(rs.fns)) + for _, fn := range rs.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*rs.selector.flds); { + case n == 0 && len(aggregation) > 0: + selector.Select(aggregation...) + case n != 0 && len(aggregation) > 0: + selector.AppendSelect(aggregation...) + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := rs.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// Modify adds a query modifier for attaching custom logic to queries. +func (rs *RoleSelect) Modify(modifiers ...func(s *sql.Selector)) *RoleSelect { + rs.modifiers = append(rs.modifiers, modifiers...) + return rs +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/role_update.go b/monolithic/backend/app/admin/service/internal/data/ent/role_update.go new file mode 100644 index 0000000..e000dca --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/role_update.go @@ -0,0 +1,982 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "errors" + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/role" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// RoleUpdate is the builder for updating Role entities. +type RoleUpdate struct { + config + hooks []Hook + mutation *RoleMutation + modifiers []func(*sql.UpdateBuilder) +} + +// Where appends a list predicates to the RoleUpdate builder. +func (ru *RoleUpdate) Where(ps ...predicate.Role) *RoleUpdate { + ru.mutation.Where(ps...) + return ru +} + +// SetUpdateTime sets the "update_time" field. +func (ru *RoleUpdate) SetUpdateTime(t time.Time) *RoleUpdate { + ru.mutation.SetUpdateTime(t) + return ru +} + +// SetNillableUpdateTime sets the "update_time" field if the given value is not nil. +func (ru *RoleUpdate) SetNillableUpdateTime(t *time.Time) *RoleUpdate { + if t != nil { + ru.SetUpdateTime(*t) + } + return ru +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (ru *RoleUpdate) ClearUpdateTime() *RoleUpdate { + ru.mutation.ClearUpdateTime() + return ru +} + +// SetDeleteTime sets the "delete_time" field. +func (ru *RoleUpdate) SetDeleteTime(t time.Time) *RoleUpdate { + ru.mutation.SetDeleteTime(t) + return ru +} + +// SetNillableDeleteTime sets the "delete_time" field if the given value is not nil. +func (ru *RoleUpdate) SetNillableDeleteTime(t *time.Time) *RoleUpdate { + if t != nil { + ru.SetDeleteTime(*t) + } + return ru +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (ru *RoleUpdate) ClearDeleteTime() *RoleUpdate { + ru.mutation.ClearDeleteTime() + return ru +} + +// SetStatus sets the "status" field. +func (ru *RoleUpdate) SetStatus(r role.Status) *RoleUpdate { + ru.mutation.SetStatus(r) + return ru +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (ru *RoleUpdate) SetNillableStatus(r *role.Status) *RoleUpdate { + if r != nil { + ru.SetStatus(*r) + } + return ru +} + +// ClearStatus clears the value of the "status" field. +func (ru *RoleUpdate) ClearStatus() *RoleUpdate { + ru.mutation.ClearStatus() + return ru +} + +// SetCreateBy sets the "create_by" field. +func (ru *RoleUpdate) SetCreateBy(u uint32) *RoleUpdate { + ru.mutation.ResetCreateBy() + ru.mutation.SetCreateBy(u) + return ru +} + +// SetNillableCreateBy sets the "create_by" field if the given value is not nil. +func (ru *RoleUpdate) SetNillableCreateBy(u *uint32) *RoleUpdate { + if u != nil { + ru.SetCreateBy(*u) + } + return ru +} + +// AddCreateBy adds u to the "create_by" field. +func (ru *RoleUpdate) AddCreateBy(u int32) *RoleUpdate { + ru.mutation.AddCreateBy(u) + return ru +} + +// ClearCreateBy clears the value of the "create_by" field. +func (ru *RoleUpdate) ClearCreateBy() *RoleUpdate { + ru.mutation.ClearCreateBy() + return ru +} + +// SetRemark sets the "remark" field. +func (ru *RoleUpdate) SetRemark(s string) *RoleUpdate { + ru.mutation.SetRemark(s) + return ru +} + +// SetNillableRemark sets the "remark" field if the given value is not nil. +func (ru *RoleUpdate) SetNillableRemark(s *string) *RoleUpdate { + if s != nil { + ru.SetRemark(*s) + } + return ru +} + +// ClearRemark clears the value of the "remark" field. +func (ru *RoleUpdate) ClearRemark() *RoleUpdate { + ru.mutation.ClearRemark() + return ru +} + +// SetName sets the "name" field. +func (ru *RoleUpdate) SetName(s string) *RoleUpdate { + ru.mutation.SetName(s) + return ru +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (ru *RoleUpdate) SetNillableName(s *string) *RoleUpdate { + if s != nil { + ru.SetName(*s) + } + return ru +} + +// ClearName clears the value of the "name" field. +func (ru *RoleUpdate) ClearName() *RoleUpdate { + ru.mutation.ClearName() + return ru +} + +// SetCode sets the "code" field. +func (ru *RoleUpdate) SetCode(s string) *RoleUpdate { + ru.mutation.SetCode(s) + return ru +} + +// SetNillableCode sets the "code" field if the given value is not nil. +func (ru *RoleUpdate) SetNillableCode(s *string) *RoleUpdate { + if s != nil { + ru.SetCode(*s) + } + return ru +} + +// ClearCode clears the value of the "code" field. +func (ru *RoleUpdate) ClearCode() *RoleUpdate { + ru.mutation.ClearCode() + return ru +} + +// SetParentID sets the "parent_id" field. +func (ru *RoleUpdate) SetParentID(u uint32) *RoleUpdate { + ru.mutation.SetParentID(u) + return ru +} + +// SetNillableParentID sets the "parent_id" field if the given value is not nil. +func (ru *RoleUpdate) SetNillableParentID(u *uint32) *RoleUpdate { + if u != nil { + ru.SetParentID(*u) + } + return ru +} + +// ClearParentID clears the value of the "parent_id" field. +func (ru *RoleUpdate) ClearParentID() *RoleUpdate { + ru.mutation.ClearParentID() + return ru +} + +// SetOrderNo sets the "order_no" field. +func (ru *RoleUpdate) SetOrderNo(i int32) *RoleUpdate { + ru.mutation.ResetOrderNo() + ru.mutation.SetOrderNo(i) + return ru +} + +// SetNillableOrderNo sets the "order_no" field if the given value is not nil. +func (ru *RoleUpdate) SetNillableOrderNo(i *int32) *RoleUpdate { + if i != nil { + ru.SetOrderNo(*i) + } + return ru +} + +// AddOrderNo adds i to the "order_no" field. +func (ru *RoleUpdate) AddOrderNo(i int32) *RoleUpdate { + ru.mutation.AddOrderNo(i) + return ru +} + +// ClearOrderNo clears the value of the "order_no" field. +func (ru *RoleUpdate) ClearOrderNo() *RoleUpdate { + ru.mutation.ClearOrderNo() + return ru +} + +// SetParent sets the "parent" edge to the Role entity. +func (ru *RoleUpdate) SetParent(r *Role) *RoleUpdate { + return ru.SetParentID(r.ID) +} + +// AddChildIDs adds the "children" edge to the Role entity by IDs. +func (ru *RoleUpdate) AddChildIDs(ids ...uint32) *RoleUpdate { + ru.mutation.AddChildIDs(ids...) + return ru +} + +// AddChildren adds the "children" edges to the Role entity. +func (ru *RoleUpdate) AddChildren(r ...*Role) *RoleUpdate { + ids := make([]uint32, len(r)) + for i := range r { + ids[i] = r[i].ID + } + return ru.AddChildIDs(ids...) +} + +// Mutation returns the RoleMutation object of the builder. +func (ru *RoleUpdate) Mutation() *RoleMutation { + return ru.mutation +} + +// ClearParent clears the "parent" edge to the Role entity. +func (ru *RoleUpdate) ClearParent() *RoleUpdate { + ru.mutation.ClearParent() + return ru +} + +// ClearChildren clears all "children" edges to the Role entity. +func (ru *RoleUpdate) ClearChildren() *RoleUpdate { + ru.mutation.ClearChildren() + return ru +} + +// RemoveChildIDs removes the "children" edge to Role entities by IDs. +func (ru *RoleUpdate) RemoveChildIDs(ids ...uint32) *RoleUpdate { + ru.mutation.RemoveChildIDs(ids...) + return ru +} + +// RemoveChildren removes "children" edges to Role entities. +func (ru *RoleUpdate) RemoveChildren(r ...*Role) *RoleUpdate { + ids := make([]uint32, len(r)) + for i := range r { + ids[i] = r[i].ID + } + return ru.RemoveChildIDs(ids...) +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (ru *RoleUpdate) Save(ctx context.Context) (int, error) { + return withHooks(ctx, ru.sqlSave, ru.mutation, ru.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ru *RoleUpdate) SaveX(ctx context.Context) int { + affected, err := ru.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (ru *RoleUpdate) Exec(ctx context.Context) error { + _, err := ru.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ru *RoleUpdate) ExecX(ctx context.Context) { + if err := ru.Exec(ctx); err != nil { + panic(err) + } +} + +// check runs all checks and user-defined validators on the builder. +func (ru *RoleUpdate) check() error { + if v, ok := ru.mutation.Status(); ok { + if err := role.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "Role.status": %w`, err)} + } + } + if v, ok := ru.mutation.Name(); ok { + if err := role.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "Role.name": %w`, err)} + } + } + if v, ok := ru.mutation.Code(); ok { + if err := role.CodeValidator(v); err != nil { + return &ValidationError{Name: "code", err: fmt.Errorf(`ent: validator failed for field "Role.code": %w`, err)} + } + } + return nil +} + +// Modify adds a statement modifier for attaching custom logic to the UPDATE statement. +func (ru *RoleUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *RoleUpdate { + ru.modifiers = append(ru.modifiers, modifiers...) + return ru +} + +func (ru *RoleUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := ru.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(role.Table, role.Columns, sqlgraph.NewFieldSpec(role.FieldID, field.TypeUint32)) + if ps := ru.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ru.mutation.CreateTimeCleared() { + _spec.ClearField(role.FieldCreateTime, field.TypeTime) + } + if value, ok := ru.mutation.UpdateTime(); ok { + _spec.SetField(role.FieldUpdateTime, field.TypeTime, value) + } + if ru.mutation.UpdateTimeCleared() { + _spec.ClearField(role.FieldUpdateTime, field.TypeTime) + } + if value, ok := ru.mutation.DeleteTime(); ok { + _spec.SetField(role.FieldDeleteTime, field.TypeTime, value) + } + if ru.mutation.DeleteTimeCleared() { + _spec.ClearField(role.FieldDeleteTime, field.TypeTime) + } + if value, ok := ru.mutation.Status(); ok { + _spec.SetField(role.FieldStatus, field.TypeEnum, value) + } + if ru.mutation.StatusCleared() { + _spec.ClearField(role.FieldStatus, field.TypeEnum) + } + if value, ok := ru.mutation.CreateBy(); ok { + _spec.SetField(role.FieldCreateBy, field.TypeUint32, value) + } + if value, ok := ru.mutation.AddedCreateBy(); ok { + _spec.AddField(role.FieldCreateBy, field.TypeUint32, value) + } + if ru.mutation.CreateByCleared() { + _spec.ClearField(role.FieldCreateBy, field.TypeUint32) + } + if value, ok := ru.mutation.Remark(); ok { + _spec.SetField(role.FieldRemark, field.TypeString, value) + } + if ru.mutation.RemarkCleared() { + _spec.ClearField(role.FieldRemark, field.TypeString) + } + if value, ok := ru.mutation.Name(); ok { + _spec.SetField(role.FieldName, field.TypeString, value) + } + if ru.mutation.NameCleared() { + _spec.ClearField(role.FieldName, field.TypeString) + } + if value, ok := ru.mutation.Code(); ok { + _spec.SetField(role.FieldCode, field.TypeString, value) + } + if ru.mutation.CodeCleared() { + _spec.ClearField(role.FieldCode, field.TypeString) + } + if value, ok := ru.mutation.OrderNo(); ok { + _spec.SetField(role.FieldOrderNo, field.TypeInt32, value) + } + if value, ok := ru.mutation.AddedOrderNo(); ok { + _spec.AddField(role.FieldOrderNo, field.TypeInt32, value) + } + if ru.mutation.OrderNoCleared() { + _spec.ClearField(role.FieldOrderNo, field.TypeInt32) + } + if ru.mutation.ParentCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: role.ParentTable, + Columns: []string{role.ParentColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(role.FieldID, field.TypeUint32), + }, + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ru.mutation.ParentIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: role.ParentTable, + Columns: []string{role.ParentColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(role.FieldID, field.TypeUint32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ru.mutation.ChildrenCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: role.ChildrenTable, + Columns: []string{role.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(role.FieldID, field.TypeUint32), + }, + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ru.mutation.RemovedChildrenIDs(); len(nodes) > 0 && !ru.mutation.ChildrenCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: role.ChildrenTable, + Columns: []string{role.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(role.FieldID, field.TypeUint32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ru.mutation.ChildrenIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: role.ChildrenTable, + Columns: []string{role.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(role.FieldID, field.TypeUint32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.AddModifiers(ru.modifiers...) + if n, err = sqlgraph.UpdateNodes(ctx, ru.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{role.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + ru.mutation.done = true + return n, nil +} + +// RoleUpdateOne is the builder for updating a single Role entity. +type RoleUpdateOne struct { + config + fields []string + hooks []Hook + mutation *RoleMutation + modifiers []func(*sql.UpdateBuilder) +} + +// SetUpdateTime sets the "update_time" field. +func (ruo *RoleUpdateOne) SetUpdateTime(t time.Time) *RoleUpdateOne { + ruo.mutation.SetUpdateTime(t) + return ruo +} + +// SetNillableUpdateTime sets the "update_time" field if the given value is not nil. +func (ruo *RoleUpdateOne) SetNillableUpdateTime(t *time.Time) *RoleUpdateOne { + if t != nil { + ruo.SetUpdateTime(*t) + } + return ruo +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (ruo *RoleUpdateOne) ClearUpdateTime() *RoleUpdateOne { + ruo.mutation.ClearUpdateTime() + return ruo +} + +// SetDeleteTime sets the "delete_time" field. +func (ruo *RoleUpdateOne) SetDeleteTime(t time.Time) *RoleUpdateOne { + ruo.mutation.SetDeleteTime(t) + return ruo +} + +// SetNillableDeleteTime sets the "delete_time" field if the given value is not nil. +func (ruo *RoleUpdateOne) SetNillableDeleteTime(t *time.Time) *RoleUpdateOne { + if t != nil { + ruo.SetDeleteTime(*t) + } + return ruo +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (ruo *RoleUpdateOne) ClearDeleteTime() *RoleUpdateOne { + ruo.mutation.ClearDeleteTime() + return ruo +} + +// SetStatus sets the "status" field. +func (ruo *RoleUpdateOne) SetStatus(r role.Status) *RoleUpdateOne { + ruo.mutation.SetStatus(r) + return ruo +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (ruo *RoleUpdateOne) SetNillableStatus(r *role.Status) *RoleUpdateOne { + if r != nil { + ruo.SetStatus(*r) + } + return ruo +} + +// ClearStatus clears the value of the "status" field. +func (ruo *RoleUpdateOne) ClearStatus() *RoleUpdateOne { + ruo.mutation.ClearStatus() + return ruo +} + +// SetCreateBy sets the "create_by" field. +func (ruo *RoleUpdateOne) SetCreateBy(u uint32) *RoleUpdateOne { + ruo.mutation.ResetCreateBy() + ruo.mutation.SetCreateBy(u) + return ruo +} + +// SetNillableCreateBy sets the "create_by" field if the given value is not nil. +func (ruo *RoleUpdateOne) SetNillableCreateBy(u *uint32) *RoleUpdateOne { + if u != nil { + ruo.SetCreateBy(*u) + } + return ruo +} + +// AddCreateBy adds u to the "create_by" field. +func (ruo *RoleUpdateOne) AddCreateBy(u int32) *RoleUpdateOne { + ruo.mutation.AddCreateBy(u) + return ruo +} + +// ClearCreateBy clears the value of the "create_by" field. +func (ruo *RoleUpdateOne) ClearCreateBy() *RoleUpdateOne { + ruo.mutation.ClearCreateBy() + return ruo +} + +// SetRemark sets the "remark" field. +func (ruo *RoleUpdateOne) SetRemark(s string) *RoleUpdateOne { + ruo.mutation.SetRemark(s) + return ruo +} + +// SetNillableRemark sets the "remark" field if the given value is not nil. +func (ruo *RoleUpdateOne) SetNillableRemark(s *string) *RoleUpdateOne { + if s != nil { + ruo.SetRemark(*s) + } + return ruo +} + +// ClearRemark clears the value of the "remark" field. +func (ruo *RoleUpdateOne) ClearRemark() *RoleUpdateOne { + ruo.mutation.ClearRemark() + return ruo +} + +// SetName sets the "name" field. +func (ruo *RoleUpdateOne) SetName(s string) *RoleUpdateOne { + ruo.mutation.SetName(s) + return ruo +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (ruo *RoleUpdateOne) SetNillableName(s *string) *RoleUpdateOne { + if s != nil { + ruo.SetName(*s) + } + return ruo +} + +// ClearName clears the value of the "name" field. +func (ruo *RoleUpdateOne) ClearName() *RoleUpdateOne { + ruo.mutation.ClearName() + return ruo +} + +// SetCode sets the "code" field. +func (ruo *RoleUpdateOne) SetCode(s string) *RoleUpdateOne { + ruo.mutation.SetCode(s) + return ruo +} + +// SetNillableCode sets the "code" field if the given value is not nil. +func (ruo *RoleUpdateOne) SetNillableCode(s *string) *RoleUpdateOne { + if s != nil { + ruo.SetCode(*s) + } + return ruo +} + +// ClearCode clears the value of the "code" field. +func (ruo *RoleUpdateOne) ClearCode() *RoleUpdateOne { + ruo.mutation.ClearCode() + return ruo +} + +// SetParentID sets the "parent_id" field. +func (ruo *RoleUpdateOne) SetParentID(u uint32) *RoleUpdateOne { + ruo.mutation.SetParentID(u) + return ruo +} + +// SetNillableParentID sets the "parent_id" field if the given value is not nil. +func (ruo *RoleUpdateOne) SetNillableParentID(u *uint32) *RoleUpdateOne { + if u != nil { + ruo.SetParentID(*u) + } + return ruo +} + +// ClearParentID clears the value of the "parent_id" field. +func (ruo *RoleUpdateOne) ClearParentID() *RoleUpdateOne { + ruo.mutation.ClearParentID() + return ruo +} + +// SetOrderNo sets the "order_no" field. +func (ruo *RoleUpdateOne) SetOrderNo(i int32) *RoleUpdateOne { + ruo.mutation.ResetOrderNo() + ruo.mutation.SetOrderNo(i) + return ruo +} + +// SetNillableOrderNo sets the "order_no" field if the given value is not nil. +func (ruo *RoleUpdateOne) SetNillableOrderNo(i *int32) *RoleUpdateOne { + if i != nil { + ruo.SetOrderNo(*i) + } + return ruo +} + +// AddOrderNo adds i to the "order_no" field. +func (ruo *RoleUpdateOne) AddOrderNo(i int32) *RoleUpdateOne { + ruo.mutation.AddOrderNo(i) + return ruo +} + +// ClearOrderNo clears the value of the "order_no" field. +func (ruo *RoleUpdateOne) ClearOrderNo() *RoleUpdateOne { + ruo.mutation.ClearOrderNo() + return ruo +} + +// SetParent sets the "parent" edge to the Role entity. +func (ruo *RoleUpdateOne) SetParent(r *Role) *RoleUpdateOne { + return ruo.SetParentID(r.ID) +} + +// AddChildIDs adds the "children" edge to the Role entity by IDs. +func (ruo *RoleUpdateOne) AddChildIDs(ids ...uint32) *RoleUpdateOne { + ruo.mutation.AddChildIDs(ids...) + return ruo +} + +// AddChildren adds the "children" edges to the Role entity. +func (ruo *RoleUpdateOne) AddChildren(r ...*Role) *RoleUpdateOne { + ids := make([]uint32, len(r)) + for i := range r { + ids[i] = r[i].ID + } + return ruo.AddChildIDs(ids...) +} + +// Mutation returns the RoleMutation object of the builder. +func (ruo *RoleUpdateOne) Mutation() *RoleMutation { + return ruo.mutation +} + +// ClearParent clears the "parent" edge to the Role entity. +func (ruo *RoleUpdateOne) ClearParent() *RoleUpdateOne { + ruo.mutation.ClearParent() + return ruo +} + +// ClearChildren clears all "children" edges to the Role entity. +func (ruo *RoleUpdateOne) ClearChildren() *RoleUpdateOne { + ruo.mutation.ClearChildren() + return ruo +} + +// RemoveChildIDs removes the "children" edge to Role entities by IDs. +func (ruo *RoleUpdateOne) RemoveChildIDs(ids ...uint32) *RoleUpdateOne { + ruo.mutation.RemoveChildIDs(ids...) + return ruo +} + +// RemoveChildren removes "children" edges to Role entities. +func (ruo *RoleUpdateOne) RemoveChildren(r ...*Role) *RoleUpdateOne { + ids := make([]uint32, len(r)) + for i := range r { + ids[i] = r[i].ID + } + return ruo.RemoveChildIDs(ids...) +} + +// Where appends a list predicates to the RoleUpdate builder. +func (ruo *RoleUpdateOne) Where(ps ...predicate.Role) *RoleUpdateOne { + ruo.mutation.Where(ps...) + return ruo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (ruo *RoleUpdateOne) Select(field string, fields ...string) *RoleUpdateOne { + ruo.fields = append([]string{field}, fields...) + return ruo +} + +// Save executes the query and returns the updated Role entity. +func (ruo *RoleUpdateOne) Save(ctx context.Context) (*Role, error) { + return withHooks(ctx, ruo.sqlSave, ruo.mutation, ruo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ruo *RoleUpdateOne) SaveX(ctx context.Context) *Role { + node, err := ruo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (ruo *RoleUpdateOne) Exec(ctx context.Context) error { + _, err := ruo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ruo *RoleUpdateOne) ExecX(ctx context.Context) { + if err := ruo.Exec(ctx); err != nil { + panic(err) + } +} + +// check runs all checks and user-defined validators on the builder. +func (ruo *RoleUpdateOne) check() error { + if v, ok := ruo.mutation.Status(); ok { + if err := role.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "Role.status": %w`, err)} + } + } + if v, ok := ruo.mutation.Name(); ok { + if err := role.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "Role.name": %w`, err)} + } + } + if v, ok := ruo.mutation.Code(); ok { + if err := role.CodeValidator(v); err != nil { + return &ValidationError{Name: "code", err: fmt.Errorf(`ent: validator failed for field "Role.code": %w`, err)} + } + } + return nil +} + +// Modify adds a statement modifier for attaching custom logic to the UPDATE statement. +func (ruo *RoleUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *RoleUpdateOne { + ruo.modifiers = append(ruo.modifiers, modifiers...) + return ruo +} + +func (ruo *RoleUpdateOne) sqlSave(ctx context.Context) (_node *Role, err error) { + if err := ruo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(role.Table, role.Columns, sqlgraph.NewFieldSpec(role.FieldID, field.TypeUint32)) + id, ok := ruo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`ent: missing "Role.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := ruo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, role.FieldID) + for _, f := range fields { + if !role.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)} + } + if f != role.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := ruo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ruo.mutation.CreateTimeCleared() { + _spec.ClearField(role.FieldCreateTime, field.TypeTime) + } + if value, ok := ruo.mutation.UpdateTime(); ok { + _spec.SetField(role.FieldUpdateTime, field.TypeTime, value) + } + if ruo.mutation.UpdateTimeCleared() { + _spec.ClearField(role.FieldUpdateTime, field.TypeTime) + } + if value, ok := ruo.mutation.DeleteTime(); ok { + _spec.SetField(role.FieldDeleteTime, field.TypeTime, value) + } + if ruo.mutation.DeleteTimeCleared() { + _spec.ClearField(role.FieldDeleteTime, field.TypeTime) + } + if value, ok := ruo.mutation.Status(); ok { + _spec.SetField(role.FieldStatus, field.TypeEnum, value) + } + if ruo.mutation.StatusCleared() { + _spec.ClearField(role.FieldStatus, field.TypeEnum) + } + if value, ok := ruo.mutation.CreateBy(); ok { + _spec.SetField(role.FieldCreateBy, field.TypeUint32, value) + } + if value, ok := ruo.mutation.AddedCreateBy(); ok { + _spec.AddField(role.FieldCreateBy, field.TypeUint32, value) + } + if ruo.mutation.CreateByCleared() { + _spec.ClearField(role.FieldCreateBy, field.TypeUint32) + } + if value, ok := ruo.mutation.Remark(); ok { + _spec.SetField(role.FieldRemark, field.TypeString, value) + } + if ruo.mutation.RemarkCleared() { + _spec.ClearField(role.FieldRemark, field.TypeString) + } + if value, ok := ruo.mutation.Name(); ok { + _spec.SetField(role.FieldName, field.TypeString, value) + } + if ruo.mutation.NameCleared() { + _spec.ClearField(role.FieldName, field.TypeString) + } + if value, ok := ruo.mutation.Code(); ok { + _spec.SetField(role.FieldCode, field.TypeString, value) + } + if ruo.mutation.CodeCleared() { + _spec.ClearField(role.FieldCode, field.TypeString) + } + if value, ok := ruo.mutation.OrderNo(); ok { + _spec.SetField(role.FieldOrderNo, field.TypeInt32, value) + } + if value, ok := ruo.mutation.AddedOrderNo(); ok { + _spec.AddField(role.FieldOrderNo, field.TypeInt32, value) + } + if ruo.mutation.OrderNoCleared() { + _spec.ClearField(role.FieldOrderNo, field.TypeInt32) + } + if ruo.mutation.ParentCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: role.ParentTable, + Columns: []string{role.ParentColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(role.FieldID, field.TypeUint32), + }, + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ruo.mutation.ParentIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: role.ParentTable, + Columns: []string{role.ParentColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(role.FieldID, field.TypeUint32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ruo.mutation.ChildrenCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: role.ChildrenTable, + Columns: []string{role.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(role.FieldID, field.TypeUint32), + }, + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ruo.mutation.RemovedChildrenIDs(); len(nodes) > 0 && !ruo.mutation.ChildrenCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: role.ChildrenTable, + Columns: []string{role.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(role.FieldID, field.TypeUint32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ruo.mutation.ChildrenIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: role.ChildrenTable, + Columns: []string{role.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(role.FieldID, field.TypeUint32), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.AddModifiers(ruo.modifiers...) + _node = &Role{config: ruo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, ruo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{role.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + ruo.mutation.done = true + return _node, nil +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/runtime.go b/monolithic/backend/app/admin/service/internal/data/ent/runtime.go new file mode 100644 index 0000000..7a41b61 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/runtime.go @@ -0,0 +1,308 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "kratos-monolithic-demo/app/admin/service/internal/data/ent/dict" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/dictdetail" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/menu" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/organization" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/position" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/role" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/schema" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/user" +) + +// The init function reads all schema descriptors with runtime code +// (default values, validators, hooks and policies) and stitches it +// to their package variables. +func init() { + dictMixin := schema.Dict{}.Mixin() + dictMixinFields0 := dictMixin[0].Fields() + _ = dictMixinFields0 + dictFields := schema.Dict{}.Fields() + _ = dictFields + // dictDescID is the schema descriptor for id field. + dictDescID := dictMixinFields0[0].Descriptor() + // dict.IDValidator is a validator for the "id" field. It is called by the builders before save. + dict.IDValidator = dictDescID.Validators[0].(func(uint32) error) + dictdetailMixin := schema.DictDetail{}.Mixin() + dictdetailMixinFields0 := dictdetailMixin[0].Fields() + _ = dictdetailMixinFields0 + dictdetailFields := schema.DictDetail{}.Fields() + _ = dictdetailFields + // dictdetailDescDictID is the schema descriptor for dict_id field. + dictdetailDescDictID := dictdetailFields[0].Descriptor() + // dictdetail.DefaultDictID holds the default value on creation for the dict_id field. + dictdetail.DefaultDictID = dictdetailDescDictID.Default.(uint32) + // dictdetailDescOrderNo is the schema descriptor for order_no field. + dictdetailDescOrderNo := dictdetailFields[1].Descriptor() + // dictdetail.DefaultOrderNo holds the default value on creation for the order_no field. + dictdetail.DefaultOrderNo = dictdetailDescOrderNo.Default.(int32) + // dictdetailDescID is the schema descriptor for id field. + dictdetailDescID := dictdetailMixinFields0[0].Descriptor() + // dictdetail.IDValidator is a validator for the "id" field. It is called by the builders before save. + dictdetail.IDValidator = dictdetailDescID.Validators[0].(func(uint32) error) + menuMixin := schema.Menu{}.Mixin() + menuMixinFields0 := menuMixin[0].Fields() + _ = menuMixinFields0 + menuFields := schema.Menu{}.Fields() + _ = menuFields + // menuDescOrderNo is the schema descriptor for order_no field. + menuDescOrderNo := menuFields[2].Descriptor() + // menu.DefaultOrderNo holds the default value on creation for the order_no field. + menu.DefaultOrderNo = menuDescOrderNo.Default.(int32) + // menuDescName is the schema descriptor for name field. + menuDescName := menuFields[3].Descriptor() + // menu.DefaultName holds the default value on creation for the name field. + menu.DefaultName = menuDescName.Default.(string) + // menu.NameValidator is a validator for the "name" field. It is called by the builders before save. + menu.NameValidator = func() func(string) error { + validators := menuDescName.Validators + fns := [...]func(string) error{ + validators[0].(func(string) error), + validators[1].(func(string) error), + } + return func(name string) error { + for _, fn := range fns { + if err := fn(name); err != nil { + return err + } + } + return nil + } + }() + // menuDescTitle is the schema descriptor for title field. + menuDescTitle := menuFields[4].Descriptor() + // menu.DefaultTitle holds the default value on creation for the title field. + menu.DefaultTitle = menuDescTitle.Default.(string) + // menu.TitleValidator is a validator for the "title" field. It is called by the builders before save. + menu.TitleValidator = menuDescTitle.Validators[0].(func(string) error) + // menuDescPath is the schema descriptor for path field. + menuDescPath := menuFields[6].Descriptor() + // menu.DefaultPath holds the default value on creation for the path field. + menu.DefaultPath = menuDescPath.Default.(string) + // menuDescComponent is the schema descriptor for component field. + menuDescComponent := menuFields[7].Descriptor() + // menu.DefaultComponent holds the default value on creation for the component field. + menu.DefaultComponent = menuDescComponent.Default.(string) + // menuDescIcon is the schema descriptor for icon field. + menuDescIcon := menuFields[8].Descriptor() + // menu.DefaultIcon holds the default value on creation for the icon field. + menu.DefaultIcon = menuDescIcon.Default.(string) + // menu.IconValidator is a validator for the "icon" field. It is called by the builders before save. + menu.IconValidator = menuDescIcon.Validators[0].(func(string) error) + // menuDescIsExt is the schema descriptor for is_ext field. + menuDescIsExt := menuFields[9].Descriptor() + // menu.DefaultIsExt holds the default value on creation for the is_ext field. + menu.DefaultIsExt = menuDescIsExt.Default.(bool) + // menuDescExtURL is the schema descriptor for ext_url field. + menuDescExtURL := menuFields[10].Descriptor() + // menu.ExtURLValidator is a validator for the "ext_url" field. It is called by the builders before save. + menu.ExtURLValidator = menuDescExtURL.Validators[0].(func(string) error) + // menuDescKeepAlive is the schema descriptor for keep_alive field. + menuDescKeepAlive := menuFields[14].Descriptor() + // menu.DefaultKeepAlive holds the default value on creation for the keep_alive field. + menu.DefaultKeepAlive = menuDescKeepAlive.Default.(bool) + // menuDescShow is the schema descriptor for show field. + menuDescShow := menuFields[15].Descriptor() + // menu.DefaultShow holds the default value on creation for the show field. + menu.DefaultShow = menuDescShow.Default.(bool) + // menuDescHideTab is the schema descriptor for hide_tab field. + menuDescHideTab := menuFields[16].Descriptor() + // menu.DefaultHideTab holds the default value on creation for the hide_tab field. + menu.DefaultHideTab = menuDescHideTab.Default.(bool) + // menuDescHideMenu is the schema descriptor for hide_menu field. + menuDescHideMenu := menuFields[17].Descriptor() + // menu.DefaultHideMenu holds the default value on creation for the hide_menu field. + menu.DefaultHideMenu = menuDescHideMenu.Default.(bool) + // menuDescHideBreadcrumb is the schema descriptor for hide_breadcrumb field. + menuDescHideBreadcrumb := menuFields[18].Descriptor() + // menu.DefaultHideBreadcrumb holds the default value on creation for the hide_breadcrumb field. + menu.DefaultHideBreadcrumb = menuDescHideBreadcrumb.Default.(bool) + // menuDescID is the schema descriptor for id field. + menuDescID := menuFields[0].Descriptor() + // menu.IDValidator is a validator for the "id" field. It is called by the builders before save. + menu.IDValidator = menuDescID.Validators[0].(func(int32) error) + organizationMixin := schema.Organization{}.Mixin() + organizationMixinFields0 := organizationMixin[0].Fields() + _ = organizationMixinFields0 + organizationMixinFields2 := organizationMixin[2].Fields() + _ = organizationMixinFields2 + organizationMixinFields4 := organizationMixin[4].Fields() + _ = organizationMixinFields4 + organizationFields := schema.Organization{}.Fields() + _ = organizationFields + // organizationDescRemark is the schema descriptor for remark field. + organizationDescRemark := organizationMixinFields4[0].Descriptor() + // organization.DefaultRemark holds the default value on creation for the remark field. + organization.DefaultRemark = organizationDescRemark.Default.(string) + // organizationDescName is the schema descriptor for name field. + organizationDescName := organizationFields[0].Descriptor() + // organization.DefaultName holds the default value on creation for the name field. + organization.DefaultName = organizationDescName.Default.(string) + // organization.NameValidator is a validator for the "name" field. It is called by the builders before save. + organization.NameValidator = organizationDescName.Validators[0].(func(string) error) + // organizationDescOrderNo is the schema descriptor for order_no field. + organizationDescOrderNo := organizationFields[2].Descriptor() + // organization.DefaultOrderNo holds the default value on creation for the order_no field. + organization.DefaultOrderNo = organizationDescOrderNo.Default.(int32) + // organizationDescID is the schema descriptor for id field. + organizationDescID := organizationMixinFields0[0].Descriptor() + // organization.IDValidator is a validator for the "id" field. It is called by the builders before save. + organization.IDValidator = organizationDescID.Validators[0].(func(uint32) error) + positionMixin := schema.Position{}.Mixin() + positionMixinFields0 := positionMixin[0].Fields() + _ = positionMixinFields0 + positionMixinFields2 := positionMixin[2].Fields() + _ = positionMixinFields2 + positionMixinFields4 := positionMixin[4].Fields() + _ = positionMixinFields4 + positionFields := schema.Position{}.Fields() + _ = positionFields + // positionDescRemark is the schema descriptor for remark field. + positionDescRemark := positionMixinFields4[0].Descriptor() + // position.DefaultRemark holds the default value on creation for the remark field. + position.DefaultRemark = positionDescRemark.Default.(string) + // positionDescName is the schema descriptor for name field. + positionDescName := positionFields[0].Descriptor() + // position.DefaultName holds the default value on creation for the name field. + position.DefaultName = positionDescName.Default.(string) + // position.NameValidator is a validator for the "name" field. It is called by the builders before save. + position.NameValidator = positionDescName.Validators[0].(func(string) error) + // positionDescCode is the schema descriptor for code field. + positionDescCode := positionFields[1].Descriptor() + // position.DefaultCode holds the default value on creation for the code field. + position.DefaultCode = positionDescCode.Default.(string) + // position.CodeValidator is a validator for the "code" field. It is called by the builders before save. + position.CodeValidator = positionDescCode.Validators[0].(func(string) error) + // positionDescParentID is the schema descriptor for parent_id field. + positionDescParentID := positionFields[2].Descriptor() + // position.DefaultParentID holds the default value on creation for the parent_id field. + position.DefaultParentID = positionDescParentID.Default.(uint32) + // positionDescOrderNo is the schema descriptor for order_no field. + positionDescOrderNo := positionFields[3].Descriptor() + // position.DefaultOrderNo holds the default value on creation for the order_no field. + position.DefaultOrderNo = positionDescOrderNo.Default.(int32) + // positionDescID is the schema descriptor for id field. + positionDescID := positionMixinFields0[0].Descriptor() + // position.IDValidator is a validator for the "id" field. It is called by the builders before save. + position.IDValidator = positionDescID.Validators[0].(func(uint32) error) + roleMixin := schema.Role{}.Mixin() + roleMixinFields0 := roleMixin[0].Fields() + _ = roleMixinFields0 + roleMixinFields2 := roleMixin[2].Fields() + _ = roleMixinFields2 + roleMixinFields4 := roleMixin[4].Fields() + _ = roleMixinFields4 + roleFields := schema.Role{}.Fields() + _ = roleFields + // roleDescRemark is the schema descriptor for remark field. + roleDescRemark := roleMixinFields4[0].Descriptor() + // role.DefaultRemark holds the default value on creation for the remark field. + role.DefaultRemark = roleDescRemark.Default.(string) + // roleDescName is the schema descriptor for name field. + roleDescName := roleFields[0].Descriptor() + // role.NameValidator is a validator for the "name" field. It is called by the builders before save. + role.NameValidator = roleDescName.Validators[0].(func(string) error) + // roleDescCode is the schema descriptor for code field. + roleDescCode := roleFields[1].Descriptor() + // role.DefaultCode holds the default value on creation for the code field. + role.DefaultCode = roleDescCode.Default.(string) + // role.CodeValidator is a validator for the "code" field. It is called by the builders before save. + role.CodeValidator = roleDescCode.Validators[0].(func(string) error) + // roleDescOrderNo is the schema descriptor for order_no field. + roleDescOrderNo := roleFields[3].Descriptor() + // role.DefaultOrderNo holds the default value on creation for the order_no field. + role.DefaultOrderNo = roleDescOrderNo.Default.(int32) + // roleDescID is the schema descriptor for id field. + roleDescID := roleMixinFields0[0].Descriptor() + // role.IDValidator is a validator for the "id" field. It is called by the builders before save. + role.IDValidator = roleDescID.Validators[0].(func(uint32) error) + userMixin := schema.User{}.Mixin() + userMixinFields0 := userMixin[0].Fields() + _ = userMixinFields0 + userMixinFields3 := userMixin[3].Fields() + _ = userMixinFields3 + userFields := schema.User{}.Fields() + _ = userFields + // userDescUsername is the schema descriptor for username field. + userDescUsername := userFields[0].Descriptor() + // user.UsernameValidator is a validator for the "username" field. It is called by the builders before save. + user.UsernameValidator = func() func(string) error { + validators := userDescUsername.Validators + fns := [...]func(string) error{ + validators[0].(func(string) error), + validators[1].(func(string) error), + validators[2].(func(string) error), + } + return func(username string) error { + for _, fn := range fns { + if err := fn(username); err != nil { + return err + } + } + return nil + } + }() + // userDescPassword is the schema descriptor for password field. + userDescPassword := userFields[1].Descriptor() + // user.PasswordValidator is a validator for the "password" field. It is called by the builders before save. + user.PasswordValidator = func() func(string) error { + validators := userDescPassword.Validators + fns := [...]func(string) error{ + validators[0].(func(string) error), + validators[1].(func(string) error), + } + return func(password string) error { + for _, fn := range fns { + if err := fn(password); err != nil { + return err + } + } + return nil + } + }() + // userDescNickName is the schema descriptor for nick_name field. + userDescNickName := userFields[6].Descriptor() + // user.NickNameValidator is a validator for the "nick_name" field. It is called by the builders before save. + user.NickNameValidator = userDescNickName.Validators[0].(func(string) error) + // userDescRealName is the schema descriptor for real_name field. + userDescRealName := userFields[7].Descriptor() + // user.RealNameValidator is a validator for the "real_name" field. It is called by the builders before save. + user.RealNameValidator = userDescRealName.Validators[0].(func(string) error) + // userDescEmail is the schema descriptor for email field. + userDescEmail := userFields[8].Descriptor() + // user.EmailValidator is a validator for the "email" field. It is called by the builders before save. + user.EmailValidator = userDescEmail.Validators[0].(func(string) error) + // userDescPhone is the schema descriptor for phone field. + userDescPhone := userFields[9].Descriptor() + // user.DefaultPhone holds the default value on creation for the phone field. + user.DefaultPhone = userDescPhone.Default.(string) + // user.PhoneValidator is a validator for the "phone" field. It is called by the builders before save. + user.PhoneValidator = userDescPhone.Validators[0].(func(string) error) + // userDescAvatar is the schema descriptor for avatar field. + userDescAvatar := userFields[10].Descriptor() + // user.AvatarValidator is a validator for the "avatar" field. It is called by the builders before save. + user.AvatarValidator = userDescAvatar.Validators[0].(func(string) error) + // userDescAddress is the schema descriptor for address field. + userDescAddress := userFields[12].Descriptor() + // user.DefaultAddress holds the default value on creation for the address field. + user.DefaultAddress = userDescAddress.Default.(string) + // user.AddressValidator is a validator for the "address" field. It is called by the builders before save. + user.AddressValidator = userDescAddress.Validators[0].(func(string) error) + // userDescDescription is the schema descriptor for description field. + userDescDescription := userFields[13].Descriptor() + // user.DescriptionValidator is a validator for the "description" field. It is called by the builders before save. + user.DescriptionValidator = userDescDescription.Validators[0].(func(string) error) + // userDescLastLoginIP is the schema descriptor for last_login_ip field. + userDescLastLoginIP := userFields[16].Descriptor() + // user.DefaultLastLoginIP holds the default value on creation for the last_login_ip field. + user.DefaultLastLoginIP = userDescLastLoginIP.Default.(string) + // user.LastLoginIPValidator is a validator for the "last_login_ip" field. It is called by the builders before save. + user.LastLoginIPValidator = userDescLastLoginIP.Validators[0].(func(string) error) + // userDescID is the schema descriptor for id field. + userDescID := userMixinFields0[0].Descriptor() + // user.IDValidator is a validator for the "id" field. It is called by the builders before save. + user.IDValidator = userDescID.Validators[0].(func(uint32) error) +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/runtime/runtime.go b/monolithic/backend/app/admin/service/internal/data/ent/runtime/runtime.go new file mode 100644 index 0000000..e1038ad --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/runtime/runtime.go @@ -0,0 +1,10 @@ +// Code generated by ent, DO NOT EDIT. + +package runtime + +// The schema-stitching logic is generated in kratos-monolithic-demo/app/admin/service/internal/data/ent/runtime.go + +const ( + Version = "v0.12.4" // Version of ent codegen. + Sum = "h1:LddPnAyxls/O7DTXZvUGDj0NZIdGSu317+aoNLJWbD8=" // Sum of ent codegen. +) diff --git a/monolithic/backend/app/admin/service/internal/data/ent/schema/dict.go b/monolithic/backend/app/admin/service/internal/data/ent/schema/dict.go new file mode 100644 index 0000000..966fe59 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/schema/dict.go @@ -0,0 +1,51 @@ +package schema + +import ( + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + + "github.com/tx7do/go-utils/entgo/mixin" +) + +// Dict holds the schema definition for the Dict entity. +type Dict struct { + ent.Schema +} + +func (Dict) Annotations() []schema.Annotation { + return []schema.Annotation{ + entsql.Annotation{ + Table: "dict", + Charset: "utf8mb4", + Collation: "utf8mb4_bin", + }, + entsql.WithComments(true), + } +} + +// Fields of the Dict. +func (Dict) Fields() []ent.Field { + return []ent.Field{ + field.String("name"). + Comment("字典名称"). + Optional(). + Nillable(). + Unique(), + + field.String("description"). + Comment("描述"). + Optional(). + Nillable(), + } +} + +// Mixin of the Dict. +func (Dict) Mixin() []ent.Mixin { + return []ent.Mixin{ + mixin.AutoIncrementId{}, + mixin.Time{}, + mixin.CreateBy{}, + } +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/schema/dict_detail.go b/monolithic/backend/app/admin/service/internal/data/ent/schema/dict_detail.go new file mode 100644 index 0000000..5a21273 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/schema/dict_detail.go @@ -0,0 +1,62 @@ +package schema + +import ( + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + + "github.com/tx7do/go-utils/entgo/mixin" +) + +// DictDetail holds the schema definition for the DictDetail entity. +type DictDetail struct { + ent.Schema +} + +func (DictDetail) Annotations() []schema.Annotation { + return []schema.Annotation{ + entsql.Annotation{ + Table: "dict_detail", + Charset: "utf8mb4", + Collation: "utf8mb4_bin", + }, + entsql.WithComments(true), + } +} + +// Fields of the DictDetail. +func (DictDetail) Fields() []ent.Field { + return []ent.Field{ + field.Uint32("dict_id"). + Comment("字典ID"). + Default(0). + Optional(). + Nillable(), + + field.Int32("order_no"). + Comment("排序ID"). + Default(0). + Optional(). + Nillable(), + + field.String("label"). + Comment("字典标签"). + Optional(). + Nillable(), + + field.String("value"). + Comment("字典值"). + Optional(). + Nillable(), + } +} + +// Mixin of the DictDetail. +func (DictDetail) Mixin() []ent.Mixin { + return []ent.Mixin{ + mixin.AutoIncrementId{}, + mixin.Time{}, + mixin.CreateBy{}, + } +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/schema/menu.go b/monolithic/backend/app/admin/service/internal/data/ent/schema/menu.go new file mode 100644 index 0000000..f4f431e --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/schema/menu.go @@ -0,0 +1,172 @@ +package schema + +import ( + "entgo.io/contrib/entproto" + "entgo.io/ent" + "entgo.io/ent/dialect" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + "github.com/tx7do/go-utils/entgo/mixin" +) + +// Menu holds the schema definition for the Menu entity. +type Menu struct { + ent.Schema +} + +func (Menu) Annotations() []schema.Annotation { + return []schema.Annotation{ + entsql.Annotation{ + Table: "menu", + Charset: "utf8mb4", + Collation: "utf8mb4_bin", + }, + entsql.WithComments(true), + } +} + +// Fields of the Menu. +func (Menu) Fields() []ent.Field { + return []ent.Field{ + field.Int32("id"). + Comment("id"). + StructTag(`json:"id,omitempty"`). + Positive(). + Immutable(). + Unique(), + + field.Int32("parent_id"). + Comment("上一层菜单ID"). + Optional(). + Nillable(), + + field.Int32("order_no"). + Comment("排序ID"). + Default(0). + Optional(). + Nillable(), + + field.String("name"). + Comment("菜单名称"). + Default(""). + MaxLen(32). + NotEmpty(). + Optional(). + Nillable(), + + field.String("title"). + Comment("菜单标题"). + Default(""). + NotEmpty(). + Optional(). + Nillable(), + + field.Enum("type"). + Comment("菜单类型 FOLDER: 目录 MENU: 菜单 BUTTON: 按钮"). + Values( + "FOLDER", + "MENU", + "BUTTON", + ). + Optional(). + Nillable(), + + field.String("path"). + Comment("路径,当其类型为'按钮'的时候对应的数据操作名,例如:/user.service.v1.UserService/Login"). + Default(""). + Optional(). + Nillable(), + + field.String("component"). + Comment("前端页面组件"). + Default(""). + Optional(). + Nillable(), + + field.String("icon"). + Comment("图标"). + Default(""). + MaxLen(128). + Optional(). + Nillable(), + + field.Bool("is_ext"). + Comment("是否外链"). + Default(false). + Optional(). + Nillable(), + + field.String("ext_url"). + Comment("外链地址"). + MaxLen(255). + Optional(). + Nillable(), + + field.Strings("permissions"). + Comment("权限代码 例如:sys:menu"). + SchemaType(map[string]string{ + dialect.MySQL: "json", + dialect.Postgres: "jsonb", + }). + Optional(), + + field.String("redirect"). + Comment("跳转路径"). + Optional(). + Nillable(), + + field.String("current_active_menu"). + Comment("当前激活路径"). + Optional(). + Nillable(), + + field.Bool("keep_alive"). + Comment("是否缓存"). + Default(false). + Optional(). + Nillable(), + + field.Bool("show"). + Comment("是否显示"). + Default(true). + Optional(). + Nillable(), + + field.Bool("hide_tab"). + Comment("是否显示在标签页导航"). + Default(true). + Optional(). + Nillable(), + + field.Bool("hide_menu"). + Comment("是否显示在菜单导航"). + Default(true). + Optional(). + Nillable(), + + field.Bool("hide_breadcrumb"). + Comment("是否显示在面包屑导航"). + Default(true). + Optional(). + Nillable(), + } +} + +func (Menu) Mixin() []ent.Mixin { + return []ent.Mixin{ + mixin.SwitchStatus{}, + mixin.Time{}, + mixin.CreateBy{}, + } +} + +// Edges of the Menu. +func (Menu) Edges() []ent.Edge { + return []ent.Edge{ + edge. + To("children", Menu.Type).Annotations(entproto.Field(10)). + From("parent").Unique().Field("parent_id").Annotations(entproto.Field(11)), + } +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/schema/organization.go b/monolithic/backend/app/admin/service/internal/data/ent/schema/organization.go new file mode 100644 index 0000000..0f4e19a --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/schema/organization.go @@ -0,0 +1,73 @@ +package schema + +import ( + "entgo.io/contrib/entproto" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + "github.com/tx7do/go-utils/entgo/mixin" +) + +// Organization holds the schema definition for the Organization entity. +type Organization struct { + ent.Schema +} + +func (Organization) Annotations() []schema.Annotation { + return []schema.Annotation{ + entsql.Annotation{ + Table: "organization", + Charset: "utf8mb4", + Collation: "utf8mb4_bin", + }, + entsql.WithComments(true), + } +} + +// Fields of the Organization. +func (Organization) Fields() []ent.Field { + return []ent.Field{ + field.String("name"). + Comment("名字"). + Default(""). + MaxLen(128). + Optional(). + Nillable(), + + field.Uint32("parent_id"). + Comment("上一层部门ID"). + Optional(). + Nillable(), + + field.Int32("order_no"). + Comment("排序ID"). + Default(0). + Annotations( + entproto.Field(6), + ). + Optional(). + Nillable(), + } +} + +// Mixin of the Organization. +func (Organization) Mixin() []ent.Mixin { + return []ent.Mixin{ + mixin.AutoIncrementId{}, + mixin.Time{}, + mixin.SwitchStatus{}, + mixin.CreateBy{}, + mixin.Remark{}, + } +} + +// Edges of the Organization. +func (Organization) Edges() []ent.Edge { + return []ent.Edge{ + edge. + To("children", Organization.Type). + From("parent").Unique().Field("parent_id"), + } +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/schema/position.go b/monolithic/backend/app/admin/service/internal/data/ent/schema/position.go new file mode 100644 index 0000000..8a28cc7 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/schema/position.go @@ -0,0 +1,72 @@ +package schema + +import ( + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + "github.com/tx7do/go-utils/entgo/mixin" +) + +// Position holds the schema definition for the Position entity. +type Position struct { + ent.Schema +} + +func (Position) Annotations() []schema.Annotation { + return []schema.Annotation{ + entsql.Annotation{ + Table: "position", + Charset: "utf8mb4", + Collation: "utf8mb4_bin", + }, + entsql.WithComments(true), + } +} + +// Fields of the Position. +func (Position) Fields() []ent.Field { + return []ent.Field{ + field.String("name"). + Comment("角色名称"). + Default(""). + MaxLen(128), + + field.String("code"). + Comment("角色标识"). + Default(""). + MaxLen(128), + + field.Uint32("parent_id"). + Comment("上一层角色ID"). + Default(0). + Optional(), + + field.Int32("order_no"). + Comment("排序ID"). + Default(0), + } +} + +// Mixin of the Position. +func (Position) Mixin() []ent.Mixin { + return []ent.Mixin{ + mixin.AutoIncrementId{}, + mixin.Time{}, + mixin.SwitchStatus{}, + mixin.CreateBy{}, + mixin.Remark{}, + } +} + +// Edges of the Position. +func (Position) Edges() []ent.Edge { + return []ent.Edge{ + edge. + To("children", Position.Type). + From("parent"). + Unique(). + Field("parent_id"), + } +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/schema/role.go b/monolithic/backend/app/admin/service/internal/data/ent/schema/role.go new file mode 100644 index 0000000..13e0e43 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/schema/role.go @@ -0,0 +1,76 @@ +package schema + +import ( + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + "github.com/tx7do/go-utils/entgo/mixin" +) + +// Role holds the schema definition for the Role entity. +type Role struct { + ent.Schema +} + +func (Role) Annotations() []schema.Annotation { + return []schema.Annotation{ + entsql.Annotation{ + Table: "role", + Charset: "utf8mb4", + Collation: "utf8mb4_bin", + }, + entsql.WithComments(true), + } +} + +// Fields of the Role. +func (Role) Fields() []ent.Field { + return []ent.Field{ + field.String("name"). + Comment("角色名称"). + Unique(). + Optional(). + Nillable(). + MaxLen(128), + + field.String("code"). + Comment("角色标识"). + Default(""). + Optional(). + Nillable(). + MaxLen(128), + + field.Uint32("parent_id"). + Comment("上一层角色ID"). + Nillable(). + Optional(), + + field.Int32("order_no"). + Comment("排序ID"). + Optional(). + Nillable(). + Default(0), + } +} + +// Mixin of the Role. +func (Role) Mixin() []ent.Mixin { + return []ent.Mixin{ + mixin.AutoIncrementId{}, + mixin.Time{}, + mixin.SwitchStatus{}, + mixin.CreateBy{}, + mixin.Remark{}, + } +} + +// Edges of the Role. +func (Role) Edges() []ent.Edge { + return []ent.Edge{ + edge. + To("children", Role.Type). + From("parent").Unique().Field("parent_id"), + } +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/schema/user.go b/monolithic/backend/app/admin/service/internal/data/ent/schema/user.go new file mode 100644 index 0000000..12555b2 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/schema/user.go @@ -0,0 +1,169 @@ +package schema + +import ( + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + "github.com/tx7do/go-utils/entgo/mixin" + "regexp" +) + +// User holds the schema definition for the User entity. +type User struct { + ent.Schema +} + +func (User) Annotations() []schema.Annotation { + return []schema.Annotation{ + entsql.Annotation{ + Table: "user", + Charset: "utf8mb4", + Collation: "utf8mb4_bin", + }, + entsql.WithComments(true), + } +} + +// Fields of the User. +func (User) Fields() []ent.Field { + return []ent.Field{ + field.String("username"). + Comment("用户名"). + Unique(). + MaxLen(50). + NotEmpty(). + Immutable(). + Optional(). + Nillable(). + Match(regexp.MustCompile("^[a-zA-Z0-9]{4,16}$")), + + field.String("password"). + Comment("登陆密码"). + MaxLen(255). + Optional(). + Nillable(). + NotEmpty(), + + field.Uint32("role_id"). + Comment("角色ID"). + Optional(). + Nillable(), + + field.Uint32("org_id"). + Comment("部门ID"). + Optional(). + Nillable(), + + field.Uint32("position_id"). + Comment("职位ID"). + Optional(). + Nillable(), + + field.Uint32("work_id"). + Comment("员工工号"). + Optional(). + Nillable(), + + field.String("nick_name"). + Comment("昵称"). + MaxLen(128). + Optional(). + Nillable(), + + field.String("real_name"). + Comment("真实名字"). + MaxLen(128). + Optional(). + Nillable(), + + field.String("email"). + Comment("电子邮箱"). + MaxLen(127). + Optional(). + Nillable(), + + field.String("phone"). + Comment("手机号码"). + Default(""). + MaxLen(11). + Optional(). + Nillable(), + + field.String("avatar"). + Comment("头像"). + MaxLen(1023). + Optional(). + Nillable(), + + field.Enum("gender"). + Comment("性别"). + Values( + "UNKNOWN", + "MALE", + "FEMALE", + ). + Optional(). + Nillable(), + + field.String("address"). + Comment("地址"). + Default(""). + MaxLen(2048). + Optional(). + Nillable(), + + field.String("description"). + Comment("个人说明"). + MaxLen(1023). + Optional(). + Nillable(), + + field.Enum("authority"). + Comment("授权"). + Optional(). + Nillable(). + Values( + "SYS_ADMIN", + "CUSTOMER_USER", + "GUEST_USER", + "REFRESH_TOKEN", + ). + Default("CUSTOMER_USER"), + + field.Int64("last_login_time"). + Comment("最后一次登陆的时间"). + Optional(). + Nillable(), + + field.String("last_login_ip"). + Comment("最后一次登陆的IP"). + Default(""). + MaxLen(64). + Optional(). + Nillable(), + } +} + +// Mixin of the User. +func (User) Mixin() []ent.Mixin { + return []ent.Mixin{ + mixin.AutoIncrementId{}, + mixin.CreateBy{}, + mixin.Time{}, + mixin.SwitchStatus{}, + } +} + +// Edges of the User. +func (User) Edges() []ent.Edge { + return nil +} + +// Indexes of the User. +func (User) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("id", "username").Unique(), + } +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/tx.go b/monolithic/backend/app/admin/service/internal/data/ent/tx.go new file mode 100644 index 0000000..8eec531 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/tx.go @@ -0,0 +1,228 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "sync" + + "entgo.io/ent/dialect" +) + +// Tx is a transactional client that is created by calling Client.Tx(). +type Tx struct { + config + // Dict is the client for interacting with the Dict builders. + Dict *DictClient + // DictDetail is the client for interacting with the DictDetail builders. + DictDetail *DictDetailClient + // Menu is the client for interacting with the Menu builders. + Menu *MenuClient + // Organization is the client for interacting with the Organization builders. + Organization *OrganizationClient + // Position is the client for interacting with the Position builders. + Position *PositionClient + // Role is the client for interacting with the Role builders. + Role *RoleClient + // User is the client for interacting with the User builders. + User *UserClient + + // lazily loaded. + client *Client + clientOnce sync.Once + // ctx lives for the life of the transaction. It is + // the same context used by the underlying connection. + ctx context.Context +} + +type ( + // Committer is the interface that wraps the Commit method. + Committer interface { + Commit(context.Context, *Tx) error + } + + // The CommitFunc type is an adapter to allow the use of ordinary + // function as a Committer. If f is a function with the appropriate + // signature, CommitFunc(f) is a Committer that calls f. + CommitFunc func(context.Context, *Tx) error + + // CommitHook defines the "commit middleware". A function that gets a Committer + // and returns a Committer. For example: + // + // hook := func(next ent.Committer) ent.Committer { + // return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error { + // // Do some stuff before. + // if err := next.Commit(ctx, tx); err != nil { + // return err + // } + // // Do some stuff after. + // return nil + // }) + // } + // + CommitHook func(Committer) Committer +) + +// Commit calls f(ctx, m). +func (f CommitFunc) Commit(ctx context.Context, tx *Tx) error { + return f(ctx, tx) +} + +// Commit commits the transaction. +func (tx *Tx) Commit() error { + txDriver := tx.config.driver.(*txDriver) + var fn Committer = CommitFunc(func(context.Context, *Tx) error { + return txDriver.tx.Commit() + }) + txDriver.mu.Lock() + hooks := append([]CommitHook(nil), txDriver.onCommit...) + txDriver.mu.Unlock() + for i := len(hooks) - 1; i >= 0; i-- { + fn = hooks[i](fn) + } + return fn.Commit(tx.ctx, tx) +} + +// OnCommit adds a hook to call on commit. +func (tx *Tx) OnCommit(f CommitHook) { + txDriver := tx.config.driver.(*txDriver) + txDriver.mu.Lock() + txDriver.onCommit = append(txDriver.onCommit, f) + txDriver.mu.Unlock() +} + +type ( + // Rollbacker is the interface that wraps the Rollback method. + Rollbacker interface { + Rollback(context.Context, *Tx) error + } + + // The RollbackFunc type is an adapter to allow the use of ordinary + // function as a Rollbacker. If f is a function with the appropriate + // signature, RollbackFunc(f) is a Rollbacker that calls f. + RollbackFunc func(context.Context, *Tx) error + + // RollbackHook defines the "rollback middleware". A function that gets a Rollbacker + // and returns a Rollbacker. For example: + // + // hook := func(next ent.Rollbacker) ent.Rollbacker { + // return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error { + // // Do some stuff before. + // if err := next.Rollback(ctx, tx); err != nil { + // return err + // } + // // Do some stuff after. + // return nil + // }) + // } + // + RollbackHook func(Rollbacker) Rollbacker +) + +// Rollback calls f(ctx, m). +func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error { + return f(ctx, tx) +} + +// Rollback rollbacks the transaction. +func (tx *Tx) Rollback() error { + txDriver := tx.config.driver.(*txDriver) + var fn Rollbacker = RollbackFunc(func(context.Context, *Tx) error { + return txDriver.tx.Rollback() + }) + txDriver.mu.Lock() + hooks := append([]RollbackHook(nil), txDriver.onRollback...) + txDriver.mu.Unlock() + for i := len(hooks) - 1; i >= 0; i-- { + fn = hooks[i](fn) + } + return fn.Rollback(tx.ctx, tx) +} + +// OnRollback adds a hook to call on rollback. +func (tx *Tx) OnRollback(f RollbackHook) { + txDriver := tx.config.driver.(*txDriver) + txDriver.mu.Lock() + txDriver.onRollback = append(txDriver.onRollback, f) + txDriver.mu.Unlock() +} + +// Client returns a Client that binds to current transaction. +func (tx *Tx) Client() *Client { + tx.clientOnce.Do(func() { + tx.client = &Client{config: tx.config} + tx.client.init() + }) + return tx.client +} + +func (tx *Tx) init() { + tx.Dict = NewDictClient(tx.config) + tx.DictDetail = NewDictDetailClient(tx.config) + tx.Menu = NewMenuClient(tx.config) + tx.Organization = NewOrganizationClient(tx.config) + tx.Position = NewPositionClient(tx.config) + tx.Role = NewRoleClient(tx.config) + tx.User = NewUserClient(tx.config) +} + +// txDriver wraps the given dialect.Tx with a nop dialect.Driver implementation. +// The idea is to support transactions without adding any extra code to the builders. +// When a builder calls to driver.Tx(), it gets the same dialect.Tx instance. +// Commit and Rollback are nop for the internal builders and the user must call one +// of them in order to commit or rollback the transaction. +// +// If a closed transaction is embedded in one of the generated entities, and the entity +// applies a query, for example: Dict.QueryXXX(), the query will be executed +// through the driver which created this transaction. +// +// Note that txDriver is not goroutine safe. +type txDriver struct { + // the driver we started the transaction from. + drv dialect.Driver + // tx is the underlying transaction. + tx dialect.Tx + // completion hooks. + mu sync.Mutex + onCommit []CommitHook + onRollback []RollbackHook +} + +// newTx creates a new transactional driver. +func newTx(ctx context.Context, drv dialect.Driver) (*txDriver, error) { + tx, err := drv.Tx(ctx) + if err != nil { + return nil, err + } + return &txDriver{tx: tx, drv: drv}, nil +} + +// Tx returns the transaction wrapper (txDriver) to avoid Commit or Rollback calls +// from the internal builders. Should be called only by the internal builders. +func (tx *txDriver) Tx(context.Context) (dialect.Tx, error) { return tx, nil } + +// Dialect returns the dialect of the driver we started the transaction from. +func (tx *txDriver) Dialect() string { return tx.drv.Dialect() } + +// Close is a nop close. +func (*txDriver) Close() error { return nil } + +// Commit is a nop commit for the internal builders. +// User must call `Tx.Commit` in order to commit the transaction. +func (*txDriver) Commit() error { return nil } + +// Rollback is a nop rollback for the internal builders. +// User must call `Tx.Rollback` in order to rollback the transaction. +func (*txDriver) Rollback() error { return nil } + +// Exec calls tx.Exec. +func (tx *txDriver) Exec(ctx context.Context, query string, args, v any) error { + return tx.tx.Exec(ctx, query, args, v) +} + +// Query calls tx.Query. +func (tx *txDriver) Query(ctx context.Context, query string, args, v any) error { + return tx.tx.Query(ctx, query, args, v) +} + +var _ dialect.Driver = (*txDriver)(nil) diff --git a/monolithic/backend/app/admin/service/internal/data/ent/user.go b/monolithic/backend/app/admin/service/internal/data/ent/user.go new file mode 100644 index 0000000..e0a06c4 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/user.go @@ -0,0 +1,404 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/user" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" +) + +// User is the model entity for the User schema. +type User struct { + config `json:"-"` + // ID of the ent. + // id + ID uint32 `json:"id,omitempty"` + // 创建者ID + CreateBy *uint32 `json:"create_by,omitempty"` + // 创建时间 + CreateTime *time.Time `json:"create_time,omitempty"` + // 更新时间 + UpdateTime *time.Time `json:"update_time,omitempty"` + // 删除时间 + DeleteTime *time.Time `json:"delete_time,omitempty"` + // 状态 + Status *user.Status `json:"status,omitempty"` + // 用户名 + Username *string `json:"username,omitempty"` + // 登陆密码 + Password *string `json:"password,omitempty"` + // 角色ID + RoleID *uint32 `json:"role_id,omitempty"` + // 部门ID + OrgID *uint32 `json:"org_id,omitempty"` + // 职位ID + PositionID *uint32 `json:"position_id,omitempty"` + // 员工工号 + WorkID *uint32 `json:"work_id,omitempty"` + // 昵称 + NickName *string `json:"nick_name,omitempty"` + // 真实名字 + RealName *string `json:"real_name,omitempty"` + // 电子邮箱 + Email *string `json:"email,omitempty"` + // 手机号码 + Phone *string `json:"phone,omitempty"` + // 头像 + Avatar *string `json:"avatar,omitempty"` + // 性别 + Gender *user.Gender `json:"gender,omitempty"` + // 地址 + Address *string `json:"address,omitempty"` + // 个人说明 + Description *string `json:"description,omitempty"` + // 授权 + Authority *user.Authority `json:"authority,omitempty"` + // 最后一次登陆的时间 + LastLoginTime *int64 `json:"last_login_time,omitempty"` + // 最后一次登陆的IP + LastLoginIP *string `json:"last_login_ip,omitempty"` + selectValues sql.SelectValues +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*User) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case user.FieldID, user.FieldCreateBy, user.FieldRoleID, user.FieldOrgID, user.FieldPositionID, user.FieldWorkID, user.FieldLastLoginTime: + values[i] = new(sql.NullInt64) + case user.FieldStatus, user.FieldUsername, user.FieldPassword, user.FieldNickName, user.FieldRealName, user.FieldEmail, user.FieldPhone, user.FieldAvatar, user.FieldGender, user.FieldAddress, user.FieldDescription, user.FieldAuthority, user.FieldLastLoginIP: + values[i] = new(sql.NullString) + case user.FieldCreateTime, user.FieldUpdateTime, user.FieldDeleteTime: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the User fields. +func (u *User) assignValues(columns []string, values []any) error { + if m, n := len(values), len(columns); m < n { + return fmt.Errorf("mismatch number of scan values: %d != %d", m, n) + } + for i := range columns { + switch columns[i] { + case user.FieldID: + value, ok := values[i].(*sql.NullInt64) + if !ok { + return fmt.Errorf("unexpected type %T for field id", value) + } + u.ID = uint32(value.Int64) + case user.FieldCreateBy: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field create_by", values[i]) + } else if value.Valid { + u.CreateBy = new(uint32) + *u.CreateBy = uint32(value.Int64) + } + case user.FieldCreateTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field create_time", values[i]) + } else if value.Valid { + u.CreateTime = new(time.Time) + *u.CreateTime = value.Time + } + case user.FieldUpdateTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field update_time", values[i]) + } else if value.Valid { + u.UpdateTime = new(time.Time) + *u.UpdateTime = value.Time + } + case user.FieldDeleteTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field delete_time", values[i]) + } else if value.Valid { + u.DeleteTime = new(time.Time) + *u.DeleteTime = value.Time + } + case user.FieldStatus: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field status", values[i]) + } else if value.Valid { + u.Status = new(user.Status) + *u.Status = user.Status(value.String) + } + case user.FieldUsername: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field username", values[i]) + } else if value.Valid { + u.Username = new(string) + *u.Username = value.String + } + case user.FieldPassword: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field password", values[i]) + } else if value.Valid { + u.Password = new(string) + *u.Password = value.String + } + case user.FieldRoleID: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field role_id", values[i]) + } else if value.Valid { + u.RoleID = new(uint32) + *u.RoleID = uint32(value.Int64) + } + case user.FieldOrgID: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field org_id", values[i]) + } else if value.Valid { + u.OrgID = new(uint32) + *u.OrgID = uint32(value.Int64) + } + case user.FieldPositionID: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field position_id", values[i]) + } else if value.Valid { + u.PositionID = new(uint32) + *u.PositionID = uint32(value.Int64) + } + case user.FieldWorkID: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field work_id", values[i]) + } else if value.Valid { + u.WorkID = new(uint32) + *u.WorkID = uint32(value.Int64) + } + case user.FieldNickName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field nick_name", values[i]) + } else if value.Valid { + u.NickName = new(string) + *u.NickName = value.String + } + case user.FieldRealName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field real_name", values[i]) + } else if value.Valid { + u.RealName = new(string) + *u.RealName = value.String + } + case user.FieldEmail: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field email", values[i]) + } else if value.Valid { + u.Email = new(string) + *u.Email = value.String + } + case user.FieldPhone: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field phone", values[i]) + } else if value.Valid { + u.Phone = new(string) + *u.Phone = value.String + } + case user.FieldAvatar: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field avatar", values[i]) + } else if value.Valid { + u.Avatar = new(string) + *u.Avatar = value.String + } + case user.FieldGender: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field gender", values[i]) + } else if value.Valid { + u.Gender = new(user.Gender) + *u.Gender = user.Gender(value.String) + } + case user.FieldAddress: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field address", values[i]) + } else if value.Valid { + u.Address = new(string) + *u.Address = value.String + } + case user.FieldDescription: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field description", values[i]) + } else if value.Valid { + u.Description = new(string) + *u.Description = value.String + } + case user.FieldAuthority: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field authority", values[i]) + } else if value.Valid { + u.Authority = new(user.Authority) + *u.Authority = user.Authority(value.String) + } + case user.FieldLastLoginTime: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field last_login_time", values[i]) + } else if value.Valid { + u.LastLoginTime = new(int64) + *u.LastLoginTime = value.Int64 + } + case user.FieldLastLoginIP: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field last_login_ip", values[i]) + } else if value.Valid { + u.LastLoginIP = new(string) + *u.LastLoginIP = value.String + } + default: + u.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the User. +// This includes values selected through modifiers, order, etc. +func (u *User) Value(name string) (ent.Value, error) { + return u.selectValues.Get(name) +} + +// Update returns a builder for updating this User. +// Note that you need to call User.Unwrap() before calling this method if this User +// was returned from a transaction, and the transaction was committed or rolled back. +func (u *User) Update() *UserUpdateOne { + return NewUserClient(u.config).UpdateOne(u) +} + +// Unwrap unwraps the User entity that was returned from a transaction after it was closed, +// so that all future queries will be executed through the driver which created the transaction. +func (u *User) Unwrap() *User { + _tx, ok := u.config.driver.(*txDriver) + if !ok { + panic("ent: User is not a transactional entity") + } + u.config.driver = _tx.drv + return u +} + +// String implements the fmt.Stringer. +func (u *User) String() string { + var builder strings.Builder + builder.WriteString("User(") + builder.WriteString(fmt.Sprintf("id=%v, ", u.ID)) + if v := u.CreateBy; v != nil { + builder.WriteString("create_by=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := u.CreateTime; v != nil { + builder.WriteString("create_time=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + if v := u.UpdateTime; v != nil { + builder.WriteString("update_time=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + if v := u.DeleteTime; v != nil { + builder.WriteString("delete_time=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + if v := u.Status; v != nil { + builder.WriteString("status=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := u.Username; v != nil { + builder.WriteString("username=") + builder.WriteString(*v) + } + builder.WriteString(", ") + if v := u.Password; v != nil { + builder.WriteString("password=") + builder.WriteString(*v) + } + builder.WriteString(", ") + if v := u.RoleID; v != nil { + builder.WriteString("role_id=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := u.OrgID; v != nil { + builder.WriteString("org_id=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := u.PositionID; v != nil { + builder.WriteString("position_id=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := u.WorkID; v != nil { + builder.WriteString("work_id=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := u.NickName; v != nil { + builder.WriteString("nick_name=") + builder.WriteString(*v) + } + builder.WriteString(", ") + if v := u.RealName; v != nil { + builder.WriteString("real_name=") + builder.WriteString(*v) + } + builder.WriteString(", ") + if v := u.Email; v != nil { + builder.WriteString("email=") + builder.WriteString(*v) + } + builder.WriteString(", ") + if v := u.Phone; v != nil { + builder.WriteString("phone=") + builder.WriteString(*v) + } + builder.WriteString(", ") + if v := u.Avatar; v != nil { + builder.WriteString("avatar=") + builder.WriteString(*v) + } + builder.WriteString(", ") + if v := u.Gender; v != nil { + builder.WriteString("gender=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := u.Address; v != nil { + builder.WriteString("address=") + builder.WriteString(*v) + } + builder.WriteString(", ") + if v := u.Description; v != nil { + builder.WriteString("description=") + builder.WriteString(*v) + } + builder.WriteString(", ") + if v := u.Authority; v != nil { + builder.WriteString("authority=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := u.LastLoginTime; v != nil { + builder.WriteString("last_login_time=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := u.LastLoginIP; v != nil { + builder.WriteString("last_login_ip=") + builder.WriteString(*v) + } + builder.WriteByte(')') + return builder.String() +} + +// Users is a parsable slice of User. +type Users []*User diff --git a/monolithic/backend/app/admin/service/internal/data/ent/user/user.go b/monolithic/backend/app/admin/service/internal/data/ent/user/user.go new file mode 100644 index 0000000..5802d8f --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/user/user.go @@ -0,0 +1,326 @@ +// Code generated by ent, DO NOT EDIT. + +package user + +import ( + "fmt" + + "entgo.io/ent/dialect/sql" +) + +const ( + // Label holds the string label denoting the user type in the database. + Label = "user" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreateBy holds the string denoting the create_by field in the database. + FieldCreateBy = "create_by" + // FieldCreateTime holds the string denoting the create_time field in the database. + FieldCreateTime = "create_time" + // FieldUpdateTime holds the string denoting the update_time field in the database. + FieldUpdateTime = "update_time" + // FieldDeleteTime holds the string denoting the delete_time field in the database. + FieldDeleteTime = "delete_time" + // FieldStatus holds the string denoting the status field in the database. + FieldStatus = "status" + // FieldUsername holds the string denoting the username field in the database. + FieldUsername = "username" + // FieldPassword holds the string denoting the password field in the database. + FieldPassword = "password" + // FieldRoleID holds the string denoting the role_id field in the database. + FieldRoleID = "role_id" + // FieldOrgID holds the string denoting the org_id field in the database. + FieldOrgID = "org_id" + // FieldPositionID holds the string denoting the position_id field in the database. + FieldPositionID = "position_id" + // FieldWorkID holds the string denoting the work_id field in the database. + FieldWorkID = "work_id" + // FieldNickName holds the string denoting the nick_name field in the database. + FieldNickName = "nick_name" + // FieldRealName holds the string denoting the real_name field in the database. + FieldRealName = "real_name" + // FieldEmail holds the string denoting the email field in the database. + FieldEmail = "email" + // FieldPhone holds the string denoting the phone field in the database. + FieldPhone = "phone" + // FieldAvatar holds the string denoting the avatar field in the database. + FieldAvatar = "avatar" + // FieldGender holds the string denoting the gender field in the database. + FieldGender = "gender" + // FieldAddress holds the string denoting the address field in the database. + FieldAddress = "address" + // FieldDescription holds the string denoting the description field in the database. + FieldDescription = "description" + // FieldAuthority holds the string denoting the authority field in the database. + FieldAuthority = "authority" + // FieldLastLoginTime holds the string denoting the last_login_time field in the database. + FieldLastLoginTime = "last_login_time" + // FieldLastLoginIP holds the string denoting the last_login_ip field in the database. + FieldLastLoginIP = "last_login_ip" + // Table holds the table name of the user in the database. + Table = "user" +) + +// Columns holds all SQL columns for user fields. +var Columns = []string{ + FieldID, + FieldCreateBy, + FieldCreateTime, + FieldUpdateTime, + FieldDeleteTime, + FieldStatus, + FieldUsername, + FieldPassword, + FieldRoleID, + FieldOrgID, + FieldPositionID, + FieldWorkID, + FieldNickName, + FieldRealName, + FieldEmail, + FieldPhone, + FieldAvatar, + FieldGender, + FieldAddress, + FieldDescription, + FieldAuthority, + FieldLastLoginTime, + FieldLastLoginIP, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +var ( + // UsernameValidator is a validator for the "username" field. It is called by the builders before save. + UsernameValidator func(string) error + // PasswordValidator is a validator for the "password" field. It is called by the builders before save. + PasswordValidator func(string) error + // NickNameValidator is a validator for the "nick_name" field. It is called by the builders before save. + NickNameValidator func(string) error + // RealNameValidator is a validator for the "real_name" field. It is called by the builders before save. + RealNameValidator func(string) error + // EmailValidator is a validator for the "email" field. It is called by the builders before save. + EmailValidator func(string) error + // DefaultPhone holds the default value on creation for the "phone" field. + DefaultPhone string + // PhoneValidator is a validator for the "phone" field. It is called by the builders before save. + PhoneValidator func(string) error + // AvatarValidator is a validator for the "avatar" field. It is called by the builders before save. + AvatarValidator func(string) error + // DefaultAddress holds the default value on creation for the "address" field. + DefaultAddress string + // AddressValidator is a validator for the "address" field. It is called by the builders before save. + AddressValidator func(string) error + // DescriptionValidator is a validator for the "description" field. It is called by the builders before save. + DescriptionValidator func(string) error + // DefaultLastLoginIP holds the default value on creation for the "last_login_ip" field. + DefaultLastLoginIP string + // LastLoginIPValidator is a validator for the "last_login_ip" field. It is called by the builders before save. + LastLoginIPValidator func(string) error + // IDValidator is a validator for the "id" field. It is called by the builders before save. + IDValidator func(uint32) error +) + +// Status defines the type for the "status" enum field. +type Status string + +// StatusON is the default value of the Status enum. +const DefaultStatus = StatusON + +// Status values. +const ( + StatusOFF Status = "OFF" + StatusON Status = "ON" +) + +func (s Status) String() string { + return string(s) +} + +// StatusValidator is a validator for the "status" field enum values. It is called by the builders before save. +func StatusValidator(s Status) error { + switch s { + case StatusOFF, StatusON: + return nil + default: + return fmt.Errorf("user: invalid enum value for status field: %q", s) + } +} + +// Gender defines the type for the "gender" enum field. +type Gender string + +// Gender values. +const ( + GenderUNKNOWN Gender = "UNKNOWN" + GenderMALE Gender = "MALE" + GenderFEMALE Gender = "FEMALE" +) + +func (ge Gender) String() string { + return string(ge) +} + +// GenderValidator is a validator for the "gender" field enum values. It is called by the builders before save. +func GenderValidator(ge Gender) error { + switch ge { + case GenderUNKNOWN, GenderMALE, GenderFEMALE: + return nil + default: + return fmt.Errorf("user: invalid enum value for gender field: %q", ge) + } +} + +// Authority defines the type for the "authority" enum field. +type Authority string + +// AuthorityCUSTOMER_USER is the default value of the Authority enum. +const DefaultAuthority = AuthorityCUSTOMER_USER + +// Authority values. +const ( + AuthoritySYS_ADMIN Authority = "SYS_ADMIN" + AuthorityCUSTOMER_USER Authority = "CUSTOMER_USER" + AuthorityGUEST_USER Authority = "GUEST_USER" + AuthorityREFRESH_TOKEN Authority = "REFRESH_TOKEN" +) + +func (a Authority) String() string { + return string(a) +} + +// AuthorityValidator is a validator for the "authority" field enum values. It is called by the builders before save. +func AuthorityValidator(a Authority) error { + switch a { + case AuthoritySYS_ADMIN, AuthorityCUSTOMER_USER, AuthorityGUEST_USER, AuthorityREFRESH_TOKEN: + return nil + default: + return fmt.Errorf("user: invalid enum value for authority field: %q", a) + } +} + +// OrderOption defines the ordering options for the User queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreateBy orders the results by the create_by field. +func ByCreateBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreateBy, opts...).ToFunc() +} + +// ByCreateTime orders the results by the create_time field. +func ByCreateTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreateTime, opts...).ToFunc() +} + +// ByUpdateTime orders the results by the update_time field. +func ByUpdateTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdateTime, opts...).ToFunc() +} + +// ByDeleteTime orders the results by the delete_time field. +func ByDeleteTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeleteTime, opts...).ToFunc() +} + +// ByStatus orders the results by the status field. +func ByStatus(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldStatus, opts...).ToFunc() +} + +// ByUsername orders the results by the username field. +func ByUsername(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUsername, opts...).ToFunc() +} + +// ByPassword orders the results by the password field. +func ByPassword(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldPassword, opts...).ToFunc() +} + +// ByRoleID orders the results by the role_id field. +func ByRoleID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRoleID, opts...).ToFunc() +} + +// ByOrgID orders the results by the org_id field. +func ByOrgID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOrgID, opts...).ToFunc() +} + +// ByPositionID orders the results by the position_id field. +func ByPositionID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldPositionID, opts...).ToFunc() +} + +// ByWorkID orders the results by the work_id field. +func ByWorkID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldWorkID, opts...).ToFunc() +} + +// ByNickName orders the results by the nick_name field. +func ByNickName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldNickName, opts...).ToFunc() +} + +// ByRealName orders the results by the real_name field. +func ByRealName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRealName, opts...).ToFunc() +} + +// ByEmail orders the results by the email field. +func ByEmail(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldEmail, opts...).ToFunc() +} + +// ByPhone orders the results by the phone field. +func ByPhone(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldPhone, opts...).ToFunc() +} + +// ByAvatar orders the results by the avatar field. +func ByAvatar(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldAvatar, opts...).ToFunc() +} + +// ByGender orders the results by the gender field. +func ByGender(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldGender, opts...).ToFunc() +} + +// ByAddress orders the results by the address field. +func ByAddress(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldAddress, opts...).ToFunc() +} + +// ByDescription orders the results by the description field. +func ByDescription(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDescription, opts...).ToFunc() +} + +// ByAuthority orders the results by the authority field. +func ByAuthority(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldAuthority, opts...).ToFunc() +} + +// ByLastLoginTime orders the results by the last_login_time field. +func ByLastLoginTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldLastLoginTime, opts...).ToFunc() +} + +// ByLastLoginIP orders the results by the last_login_ip field. +func ByLastLoginIP(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldLastLoginIP, opts...).ToFunc() +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/user/where.go b/monolithic/backend/app/admin/service/internal/data/ent/user/where.go new file mode 100644 index 0000000..cb9aa33 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/user/where.go @@ -0,0 +1,1455 @@ +// Code generated by ent, DO NOT EDIT. + +package user + +import ( + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + "time" + + "entgo.io/ent/dialect/sql" +) + +// ID filters vertices based on their ID field. +func ID(id uint32) predicate.User { + return predicate.User(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id uint32) predicate.User { + return predicate.User(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id uint32) predicate.User { + return predicate.User(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...uint32) predicate.User { + return predicate.User(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...uint32) predicate.User { + return predicate.User(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id uint32) predicate.User { + return predicate.User(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id uint32) predicate.User { + return predicate.User(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id uint32) predicate.User { + return predicate.User(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id uint32) predicate.User { + return predicate.User(sql.FieldLTE(FieldID, id)) +} + +// CreateBy applies equality check predicate on the "create_by" field. It's identical to CreateByEQ. +func CreateBy(v uint32) predicate.User { + return predicate.User(sql.FieldEQ(FieldCreateBy, v)) +} + +// CreateTime applies equality check predicate on the "create_time" field. It's identical to CreateTimeEQ. +func CreateTime(v time.Time) predicate.User { + return predicate.User(sql.FieldEQ(FieldCreateTime, v)) +} + +// UpdateTime applies equality check predicate on the "update_time" field. It's identical to UpdateTimeEQ. +func UpdateTime(v time.Time) predicate.User { + return predicate.User(sql.FieldEQ(FieldUpdateTime, v)) +} + +// DeleteTime applies equality check predicate on the "delete_time" field. It's identical to DeleteTimeEQ. +func DeleteTime(v time.Time) predicate.User { + return predicate.User(sql.FieldEQ(FieldDeleteTime, v)) +} + +// Username applies equality check predicate on the "username" field. It's identical to UsernameEQ. +func Username(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldUsername, v)) +} + +// Password applies equality check predicate on the "password" field. It's identical to PasswordEQ. +func Password(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldPassword, v)) +} + +// RoleID applies equality check predicate on the "role_id" field. It's identical to RoleIDEQ. +func RoleID(v uint32) predicate.User { + return predicate.User(sql.FieldEQ(FieldRoleID, v)) +} + +// OrgID applies equality check predicate on the "org_id" field. It's identical to OrgIDEQ. +func OrgID(v uint32) predicate.User { + return predicate.User(sql.FieldEQ(FieldOrgID, v)) +} + +// PositionID applies equality check predicate on the "position_id" field. It's identical to PositionIDEQ. +func PositionID(v uint32) predicate.User { + return predicate.User(sql.FieldEQ(FieldPositionID, v)) +} + +// WorkID applies equality check predicate on the "work_id" field. It's identical to WorkIDEQ. +func WorkID(v uint32) predicate.User { + return predicate.User(sql.FieldEQ(FieldWorkID, v)) +} + +// NickName applies equality check predicate on the "nick_name" field. It's identical to NickNameEQ. +func NickName(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldNickName, v)) +} + +// RealName applies equality check predicate on the "real_name" field. It's identical to RealNameEQ. +func RealName(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldRealName, v)) +} + +// Email applies equality check predicate on the "email" field. It's identical to EmailEQ. +func Email(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldEmail, v)) +} + +// Phone applies equality check predicate on the "phone" field. It's identical to PhoneEQ. +func Phone(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldPhone, v)) +} + +// Avatar applies equality check predicate on the "avatar" field. It's identical to AvatarEQ. +func Avatar(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldAvatar, v)) +} + +// Address applies equality check predicate on the "address" field. It's identical to AddressEQ. +func Address(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldAddress, v)) +} + +// Description applies equality check predicate on the "description" field. It's identical to DescriptionEQ. +func Description(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldDescription, v)) +} + +// LastLoginTime applies equality check predicate on the "last_login_time" field. It's identical to LastLoginTimeEQ. +func LastLoginTime(v int64) predicate.User { + return predicate.User(sql.FieldEQ(FieldLastLoginTime, v)) +} + +// LastLoginIP applies equality check predicate on the "last_login_ip" field. It's identical to LastLoginIPEQ. +func LastLoginIP(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldLastLoginIP, v)) +} + +// CreateByEQ applies the EQ predicate on the "create_by" field. +func CreateByEQ(v uint32) predicate.User { + return predicate.User(sql.FieldEQ(FieldCreateBy, v)) +} + +// CreateByNEQ applies the NEQ predicate on the "create_by" field. +func CreateByNEQ(v uint32) predicate.User { + return predicate.User(sql.FieldNEQ(FieldCreateBy, v)) +} + +// CreateByIn applies the In predicate on the "create_by" field. +func CreateByIn(vs ...uint32) predicate.User { + return predicate.User(sql.FieldIn(FieldCreateBy, vs...)) +} + +// CreateByNotIn applies the NotIn predicate on the "create_by" field. +func CreateByNotIn(vs ...uint32) predicate.User { + return predicate.User(sql.FieldNotIn(FieldCreateBy, vs...)) +} + +// CreateByGT applies the GT predicate on the "create_by" field. +func CreateByGT(v uint32) predicate.User { + return predicate.User(sql.FieldGT(FieldCreateBy, v)) +} + +// CreateByGTE applies the GTE predicate on the "create_by" field. +func CreateByGTE(v uint32) predicate.User { + return predicate.User(sql.FieldGTE(FieldCreateBy, v)) +} + +// CreateByLT applies the LT predicate on the "create_by" field. +func CreateByLT(v uint32) predicate.User { + return predicate.User(sql.FieldLT(FieldCreateBy, v)) +} + +// CreateByLTE applies the LTE predicate on the "create_by" field. +func CreateByLTE(v uint32) predicate.User { + return predicate.User(sql.FieldLTE(FieldCreateBy, v)) +} + +// CreateByIsNil applies the IsNil predicate on the "create_by" field. +func CreateByIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldCreateBy)) +} + +// CreateByNotNil applies the NotNil predicate on the "create_by" field. +func CreateByNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldCreateBy)) +} + +// CreateTimeEQ applies the EQ predicate on the "create_time" field. +func CreateTimeEQ(v time.Time) predicate.User { + return predicate.User(sql.FieldEQ(FieldCreateTime, v)) +} + +// CreateTimeNEQ applies the NEQ predicate on the "create_time" field. +func CreateTimeNEQ(v time.Time) predicate.User { + return predicate.User(sql.FieldNEQ(FieldCreateTime, v)) +} + +// CreateTimeIn applies the In predicate on the "create_time" field. +func CreateTimeIn(vs ...time.Time) predicate.User { + return predicate.User(sql.FieldIn(FieldCreateTime, vs...)) +} + +// CreateTimeNotIn applies the NotIn predicate on the "create_time" field. +func CreateTimeNotIn(vs ...time.Time) predicate.User { + return predicate.User(sql.FieldNotIn(FieldCreateTime, vs...)) +} + +// CreateTimeGT applies the GT predicate on the "create_time" field. +func CreateTimeGT(v time.Time) predicate.User { + return predicate.User(sql.FieldGT(FieldCreateTime, v)) +} + +// CreateTimeGTE applies the GTE predicate on the "create_time" field. +func CreateTimeGTE(v time.Time) predicate.User { + return predicate.User(sql.FieldGTE(FieldCreateTime, v)) +} + +// CreateTimeLT applies the LT predicate on the "create_time" field. +func CreateTimeLT(v time.Time) predicate.User { + return predicate.User(sql.FieldLT(FieldCreateTime, v)) +} + +// CreateTimeLTE applies the LTE predicate on the "create_time" field. +func CreateTimeLTE(v time.Time) predicate.User { + return predicate.User(sql.FieldLTE(FieldCreateTime, v)) +} + +// CreateTimeIsNil applies the IsNil predicate on the "create_time" field. +func CreateTimeIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldCreateTime)) +} + +// CreateTimeNotNil applies the NotNil predicate on the "create_time" field. +func CreateTimeNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldCreateTime)) +} + +// UpdateTimeEQ applies the EQ predicate on the "update_time" field. +func UpdateTimeEQ(v time.Time) predicate.User { + return predicate.User(sql.FieldEQ(FieldUpdateTime, v)) +} + +// UpdateTimeNEQ applies the NEQ predicate on the "update_time" field. +func UpdateTimeNEQ(v time.Time) predicate.User { + return predicate.User(sql.FieldNEQ(FieldUpdateTime, v)) +} + +// UpdateTimeIn applies the In predicate on the "update_time" field. +func UpdateTimeIn(vs ...time.Time) predicate.User { + return predicate.User(sql.FieldIn(FieldUpdateTime, vs...)) +} + +// UpdateTimeNotIn applies the NotIn predicate on the "update_time" field. +func UpdateTimeNotIn(vs ...time.Time) predicate.User { + return predicate.User(sql.FieldNotIn(FieldUpdateTime, vs...)) +} + +// UpdateTimeGT applies the GT predicate on the "update_time" field. +func UpdateTimeGT(v time.Time) predicate.User { + return predicate.User(sql.FieldGT(FieldUpdateTime, v)) +} + +// UpdateTimeGTE applies the GTE predicate on the "update_time" field. +func UpdateTimeGTE(v time.Time) predicate.User { + return predicate.User(sql.FieldGTE(FieldUpdateTime, v)) +} + +// UpdateTimeLT applies the LT predicate on the "update_time" field. +func UpdateTimeLT(v time.Time) predicate.User { + return predicate.User(sql.FieldLT(FieldUpdateTime, v)) +} + +// UpdateTimeLTE applies the LTE predicate on the "update_time" field. +func UpdateTimeLTE(v time.Time) predicate.User { + return predicate.User(sql.FieldLTE(FieldUpdateTime, v)) +} + +// UpdateTimeIsNil applies the IsNil predicate on the "update_time" field. +func UpdateTimeIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldUpdateTime)) +} + +// UpdateTimeNotNil applies the NotNil predicate on the "update_time" field. +func UpdateTimeNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldUpdateTime)) +} + +// DeleteTimeEQ applies the EQ predicate on the "delete_time" field. +func DeleteTimeEQ(v time.Time) predicate.User { + return predicate.User(sql.FieldEQ(FieldDeleteTime, v)) +} + +// DeleteTimeNEQ applies the NEQ predicate on the "delete_time" field. +func DeleteTimeNEQ(v time.Time) predicate.User { + return predicate.User(sql.FieldNEQ(FieldDeleteTime, v)) +} + +// DeleteTimeIn applies the In predicate on the "delete_time" field. +func DeleteTimeIn(vs ...time.Time) predicate.User { + return predicate.User(sql.FieldIn(FieldDeleteTime, vs...)) +} + +// DeleteTimeNotIn applies the NotIn predicate on the "delete_time" field. +func DeleteTimeNotIn(vs ...time.Time) predicate.User { + return predicate.User(sql.FieldNotIn(FieldDeleteTime, vs...)) +} + +// DeleteTimeGT applies the GT predicate on the "delete_time" field. +func DeleteTimeGT(v time.Time) predicate.User { + return predicate.User(sql.FieldGT(FieldDeleteTime, v)) +} + +// DeleteTimeGTE applies the GTE predicate on the "delete_time" field. +func DeleteTimeGTE(v time.Time) predicate.User { + return predicate.User(sql.FieldGTE(FieldDeleteTime, v)) +} + +// DeleteTimeLT applies the LT predicate on the "delete_time" field. +func DeleteTimeLT(v time.Time) predicate.User { + return predicate.User(sql.FieldLT(FieldDeleteTime, v)) +} + +// DeleteTimeLTE applies the LTE predicate on the "delete_time" field. +func DeleteTimeLTE(v time.Time) predicate.User { + return predicate.User(sql.FieldLTE(FieldDeleteTime, v)) +} + +// DeleteTimeIsNil applies the IsNil predicate on the "delete_time" field. +func DeleteTimeIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldDeleteTime)) +} + +// DeleteTimeNotNil applies the NotNil predicate on the "delete_time" field. +func DeleteTimeNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldDeleteTime)) +} + +// StatusEQ applies the EQ predicate on the "status" field. +func StatusEQ(v Status) predicate.User { + return predicate.User(sql.FieldEQ(FieldStatus, v)) +} + +// StatusNEQ applies the NEQ predicate on the "status" field. +func StatusNEQ(v Status) predicate.User { + return predicate.User(sql.FieldNEQ(FieldStatus, v)) +} + +// StatusIn applies the In predicate on the "status" field. +func StatusIn(vs ...Status) predicate.User { + return predicate.User(sql.FieldIn(FieldStatus, vs...)) +} + +// StatusNotIn applies the NotIn predicate on the "status" field. +func StatusNotIn(vs ...Status) predicate.User { + return predicate.User(sql.FieldNotIn(FieldStatus, vs...)) +} + +// StatusIsNil applies the IsNil predicate on the "status" field. +func StatusIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldStatus)) +} + +// StatusNotNil applies the NotNil predicate on the "status" field. +func StatusNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldStatus)) +} + +// UsernameEQ applies the EQ predicate on the "username" field. +func UsernameEQ(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldUsername, v)) +} + +// UsernameNEQ applies the NEQ predicate on the "username" field. +func UsernameNEQ(v string) predicate.User { + return predicate.User(sql.FieldNEQ(FieldUsername, v)) +} + +// UsernameIn applies the In predicate on the "username" field. +func UsernameIn(vs ...string) predicate.User { + return predicate.User(sql.FieldIn(FieldUsername, vs...)) +} + +// UsernameNotIn applies the NotIn predicate on the "username" field. +func UsernameNotIn(vs ...string) predicate.User { + return predicate.User(sql.FieldNotIn(FieldUsername, vs...)) +} + +// UsernameGT applies the GT predicate on the "username" field. +func UsernameGT(v string) predicate.User { + return predicate.User(sql.FieldGT(FieldUsername, v)) +} + +// UsernameGTE applies the GTE predicate on the "username" field. +func UsernameGTE(v string) predicate.User { + return predicate.User(sql.FieldGTE(FieldUsername, v)) +} + +// UsernameLT applies the LT predicate on the "username" field. +func UsernameLT(v string) predicate.User { + return predicate.User(sql.FieldLT(FieldUsername, v)) +} + +// UsernameLTE applies the LTE predicate on the "username" field. +func UsernameLTE(v string) predicate.User { + return predicate.User(sql.FieldLTE(FieldUsername, v)) +} + +// UsernameContains applies the Contains predicate on the "username" field. +func UsernameContains(v string) predicate.User { + return predicate.User(sql.FieldContains(FieldUsername, v)) +} + +// UsernameHasPrefix applies the HasPrefix predicate on the "username" field. +func UsernameHasPrefix(v string) predicate.User { + return predicate.User(sql.FieldHasPrefix(FieldUsername, v)) +} + +// UsernameHasSuffix applies the HasSuffix predicate on the "username" field. +func UsernameHasSuffix(v string) predicate.User { + return predicate.User(sql.FieldHasSuffix(FieldUsername, v)) +} + +// UsernameIsNil applies the IsNil predicate on the "username" field. +func UsernameIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldUsername)) +} + +// UsernameNotNil applies the NotNil predicate on the "username" field. +func UsernameNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldUsername)) +} + +// UsernameEqualFold applies the EqualFold predicate on the "username" field. +func UsernameEqualFold(v string) predicate.User { + return predicate.User(sql.FieldEqualFold(FieldUsername, v)) +} + +// UsernameContainsFold applies the ContainsFold predicate on the "username" field. +func UsernameContainsFold(v string) predicate.User { + return predicate.User(sql.FieldContainsFold(FieldUsername, v)) +} + +// PasswordEQ applies the EQ predicate on the "password" field. +func PasswordEQ(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldPassword, v)) +} + +// PasswordNEQ applies the NEQ predicate on the "password" field. +func PasswordNEQ(v string) predicate.User { + return predicate.User(sql.FieldNEQ(FieldPassword, v)) +} + +// PasswordIn applies the In predicate on the "password" field. +func PasswordIn(vs ...string) predicate.User { + return predicate.User(sql.FieldIn(FieldPassword, vs...)) +} + +// PasswordNotIn applies the NotIn predicate on the "password" field. +func PasswordNotIn(vs ...string) predicate.User { + return predicate.User(sql.FieldNotIn(FieldPassword, vs...)) +} + +// PasswordGT applies the GT predicate on the "password" field. +func PasswordGT(v string) predicate.User { + return predicate.User(sql.FieldGT(FieldPassword, v)) +} + +// PasswordGTE applies the GTE predicate on the "password" field. +func PasswordGTE(v string) predicate.User { + return predicate.User(sql.FieldGTE(FieldPassword, v)) +} + +// PasswordLT applies the LT predicate on the "password" field. +func PasswordLT(v string) predicate.User { + return predicate.User(sql.FieldLT(FieldPassword, v)) +} + +// PasswordLTE applies the LTE predicate on the "password" field. +func PasswordLTE(v string) predicate.User { + return predicate.User(sql.FieldLTE(FieldPassword, v)) +} + +// PasswordContains applies the Contains predicate on the "password" field. +func PasswordContains(v string) predicate.User { + return predicate.User(sql.FieldContains(FieldPassword, v)) +} + +// PasswordHasPrefix applies the HasPrefix predicate on the "password" field. +func PasswordHasPrefix(v string) predicate.User { + return predicate.User(sql.FieldHasPrefix(FieldPassword, v)) +} + +// PasswordHasSuffix applies the HasSuffix predicate on the "password" field. +func PasswordHasSuffix(v string) predicate.User { + return predicate.User(sql.FieldHasSuffix(FieldPassword, v)) +} + +// PasswordIsNil applies the IsNil predicate on the "password" field. +func PasswordIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldPassword)) +} + +// PasswordNotNil applies the NotNil predicate on the "password" field. +func PasswordNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldPassword)) +} + +// PasswordEqualFold applies the EqualFold predicate on the "password" field. +func PasswordEqualFold(v string) predicate.User { + return predicate.User(sql.FieldEqualFold(FieldPassword, v)) +} + +// PasswordContainsFold applies the ContainsFold predicate on the "password" field. +func PasswordContainsFold(v string) predicate.User { + return predicate.User(sql.FieldContainsFold(FieldPassword, v)) +} + +// RoleIDEQ applies the EQ predicate on the "role_id" field. +func RoleIDEQ(v uint32) predicate.User { + return predicate.User(sql.FieldEQ(FieldRoleID, v)) +} + +// RoleIDNEQ applies the NEQ predicate on the "role_id" field. +func RoleIDNEQ(v uint32) predicate.User { + return predicate.User(sql.FieldNEQ(FieldRoleID, v)) +} + +// RoleIDIn applies the In predicate on the "role_id" field. +func RoleIDIn(vs ...uint32) predicate.User { + return predicate.User(sql.FieldIn(FieldRoleID, vs...)) +} + +// RoleIDNotIn applies the NotIn predicate on the "role_id" field. +func RoleIDNotIn(vs ...uint32) predicate.User { + return predicate.User(sql.FieldNotIn(FieldRoleID, vs...)) +} + +// RoleIDGT applies the GT predicate on the "role_id" field. +func RoleIDGT(v uint32) predicate.User { + return predicate.User(sql.FieldGT(FieldRoleID, v)) +} + +// RoleIDGTE applies the GTE predicate on the "role_id" field. +func RoleIDGTE(v uint32) predicate.User { + return predicate.User(sql.FieldGTE(FieldRoleID, v)) +} + +// RoleIDLT applies the LT predicate on the "role_id" field. +func RoleIDLT(v uint32) predicate.User { + return predicate.User(sql.FieldLT(FieldRoleID, v)) +} + +// RoleIDLTE applies the LTE predicate on the "role_id" field. +func RoleIDLTE(v uint32) predicate.User { + return predicate.User(sql.FieldLTE(FieldRoleID, v)) +} + +// RoleIDIsNil applies the IsNil predicate on the "role_id" field. +func RoleIDIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldRoleID)) +} + +// RoleIDNotNil applies the NotNil predicate on the "role_id" field. +func RoleIDNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldRoleID)) +} + +// OrgIDEQ applies the EQ predicate on the "org_id" field. +func OrgIDEQ(v uint32) predicate.User { + return predicate.User(sql.FieldEQ(FieldOrgID, v)) +} + +// OrgIDNEQ applies the NEQ predicate on the "org_id" field. +func OrgIDNEQ(v uint32) predicate.User { + return predicate.User(sql.FieldNEQ(FieldOrgID, v)) +} + +// OrgIDIn applies the In predicate on the "org_id" field. +func OrgIDIn(vs ...uint32) predicate.User { + return predicate.User(sql.FieldIn(FieldOrgID, vs...)) +} + +// OrgIDNotIn applies the NotIn predicate on the "org_id" field. +func OrgIDNotIn(vs ...uint32) predicate.User { + return predicate.User(sql.FieldNotIn(FieldOrgID, vs...)) +} + +// OrgIDGT applies the GT predicate on the "org_id" field. +func OrgIDGT(v uint32) predicate.User { + return predicate.User(sql.FieldGT(FieldOrgID, v)) +} + +// OrgIDGTE applies the GTE predicate on the "org_id" field. +func OrgIDGTE(v uint32) predicate.User { + return predicate.User(sql.FieldGTE(FieldOrgID, v)) +} + +// OrgIDLT applies the LT predicate on the "org_id" field. +func OrgIDLT(v uint32) predicate.User { + return predicate.User(sql.FieldLT(FieldOrgID, v)) +} + +// OrgIDLTE applies the LTE predicate on the "org_id" field. +func OrgIDLTE(v uint32) predicate.User { + return predicate.User(sql.FieldLTE(FieldOrgID, v)) +} + +// OrgIDIsNil applies the IsNil predicate on the "org_id" field. +func OrgIDIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldOrgID)) +} + +// OrgIDNotNil applies the NotNil predicate on the "org_id" field. +func OrgIDNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldOrgID)) +} + +// PositionIDEQ applies the EQ predicate on the "position_id" field. +func PositionIDEQ(v uint32) predicate.User { + return predicate.User(sql.FieldEQ(FieldPositionID, v)) +} + +// PositionIDNEQ applies the NEQ predicate on the "position_id" field. +func PositionIDNEQ(v uint32) predicate.User { + return predicate.User(sql.FieldNEQ(FieldPositionID, v)) +} + +// PositionIDIn applies the In predicate on the "position_id" field. +func PositionIDIn(vs ...uint32) predicate.User { + return predicate.User(sql.FieldIn(FieldPositionID, vs...)) +} + +// PositionIDNotIn applies the NotIn predicate on the "position_id" field. +func PositionIDNotIn(vs ...uint32) predicate.User { + return predicate.User(sql.FieldNotIn(FieldPositionID, vs...)) +} + +// PositionIDGT applies the GT predicate on the "position_id" field. +func PositionIDGT(v uint32) predicate.User { + return predicate.User(sql.FieldGT(FieldPositionID, v)) +} + +// PositionIDGTE applies the GTE predicate on the "position_id" field. +func PositionIDGTE(v uint32) predicate.User { + return predicate.User(sql.FieldGTE(FieldPositionID, v)) +} + +// PositionIDLT applies the LT predicate on the "position_id" field. +func PositionIDLT(v uint32) predicate.User { + return predicate.User(sql.FieldLT(FieldPositionID, v)) +} + +// PositionIDLTE applies the LTE predicate on the "position_id" field. +func PositionIDLTE(v uint32) predicate.User { + return predicate.User(sql.FieldLTE(FieldPositionID, v)) +} + +// PositionIDIsNil applies the IsNil predicate on the "position_id" field. +func PositionIDIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldPositionID)) +} + +// PositionIDNotNil applies the NotNil predicate on the "position_id" field. +func PositionIDNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldPositionID)) +} + +// WorkIDEQ applies the EQ predicate on the "work_id" field. +func WorkIDEQ(v uint32) predicate.User { + return predicate.User(sql.FieldEQ(FieldWorkID, v)) +} + +// WorkIDNEQ applies the NEQ predicate on the "work_id" field. +func WorkIDNEQ(v uint32) predicate.User { + return predicate.User(sql.FieldNEQ(FieldWorkID, v)) +} + +// WorkIDIn applies the In predicate on the "work_id" field. +func WorkIDIn(vs ...uint32) predicate.User { + return predicate.User(sql.FieldIn(FieldWorkID, vs...)) +} + +// WorkIDNotIn applies the NotIn predicate on the "work_id" field. +func WorkIDNotIn(vs ...uint32) predicate.User { + return predicate.User(sql.FieldNotIn(FieldWorkID, vs...)) +} + +// WorkIDGT applies the GT predicate on the "work_id" field. +func WorkIDGT(v uint32) predicate.User { + return predicate.User(sql.FieldGT(FieldWorkID, v)) +} + +// WorkIDGTE applies the GTE predicate on the "work_id" field. +func WorkIDGTE(v uint32) predicate.User { + return predicate.User(sql.FieldGTE(FieldWorkID, v)) +} + +// WorkIDLT applies the LT predicate on the "work_id" field. +func WorkIDLT(v uint32) predicate.User { + return predicate.User(sql.FieldLT(FieldWorkID, v)) +} + +// WorkIDLTE applies the LTE predicate on the "work_id" field. +func WorkIDLTE(v uint32) predicate.User { + return predicate.User(sql.FieldLTE(FieldWorkID, v)) +} + +// WorkIDIsNil applies the IsNil predicate on the "work_id" field. +func WorkIDIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldWorkID)) +} + +// WorkIDNotNil applies the NotNil predicate on the "work_id" field. +func WorkIDNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldWorkID)) +} + +// NickNameEQ applies the EQ predicate on the "nick_name" field. +func NickNameEQ(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldNickName, v)) +} + +// NickNameNEQ applies the NEQ predicate on the "nick_name" field. +func NickNameNEQ(v string) predicate.User { + return predicate.User(sql.FieldNEQ(FieldNickName, v)) +} + +// NickNameIn applies the In predicate on the "nick_name" field. +func NickNameIn(vs ...string) predicate.User { + return predicate.User(sql.FieldIn(FieldNickName, vs...)) +} + +// NickNameNotIn applies the NotIn predicate on the "nick_name" field. +func NickNameNotIn(vs ...string) predicate.User { + return predicate.User(sql.FieldNotIn(FieldNickName, vs...)) +} + +// NickNameGT applies the GT predicate on the "nick_name" field. +func NickNameGT(v string) predicate.User { + return predicate.User(sql.FieldGT(FieldNickName, v)) +} + +// NickNameGTE applies the GTE predicate on the "nick_name" field. +func NickNameGTE(v string) predicate.User { + return predicate.User(sql.FieldGTE(FieldNickName, v)) +} + +// NickNameLT applies the LT predicate on the "nick_name" field. +func NickNameLT(v string) predicate.User { + return predicate.User(sql.FieldLT(FieldNickName, v)) +} + +// NickNameLTE applies the LTE predicate on the "nick_name" field. +func NickNameLTE(v string) predicate.User { + return predicate.User(sql.FieldLTE(FieldNickName, v)) +} + +// NickNameContains applies the Contains predicate on the "nick_name" field. +func NickNameContains(v string) predicate.User { + return predicate.User(sql.FieldContains(FieldNickName, v)) +} + +// NickNameHasPrefix applies the HasPrefix predicate on the "nick_name" field. +func NickNameHasPrefix(v string) predicate.User { + return predicate.User(sql.FieldHasPrefix(FieldNickName, v)) +} + +// NickNameHasSuffix applies the HasSuffix predicate on the "nick_name" field. +func NickNameHasSuffix(v string) predicate.User { + return predicate.User(sql.FieldHasSuffix(FieldNickName, v)) +} + +// NickNameIsNil applies the IsNil predicate on the "nick_name" field. +func NickNameIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldNickName)) +} + +// NickNameNotNil applies the NotNil predicate on the "nick_name" field. +func NickNameNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldNickName)) +} + +// NickNameEqualFold applies the EqualFold predicate on the "nick_name" field. +func NickNameEqualFold(v string) predicate.User { + return predicate.User(sql.FieldEqualFold(FieldNickName, v)) +} + +// NickNameContainsFold applies the ContainsFold predicate on the "nick_name" field. +func NickNameContainsFold(v string) predicate.User { + return predicate.User(sql.FieldContainsFold(FieldNickName, v)) +} + +// RealNameEQ applies the EQ predicate on the "real_name" field. +func RealNameEQ(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldRealName, v)) +} + +// RealNameNEQ applies the NEQ predicate on the "real_name" field. +func RealNameNEQ(v string) predicate.User { + return predicate.User(sql.FieldNEQ(FieldRealName, v)) +} + +// RealNameIn applies the In predicate on the "real_name" field. +func RealNameIn(vs ...string) predicate.User { + return predicate.User(sql.FieldIn(FieldRealName, vs...)) +} + +// RealNameNotIn applies the NotIn predicate on the "real_name" field. +func RealNameNotIn(vs ...string) predicate.User { + return predicate.User(sql.FieldNotIn(FieldRealName, vs...)) +} + +// RealNameGT applies the GT predicate on the "real_name" field. +func RealNameGT(v string) predicate.User { + return predicate.User(sql.FieldGT(FieldRealName, v)) +} + +// RealNameGTE applies the GTE predicate on the "real_name" field. +func RealNameGTE(v string) predicate.User { + return predicate.User(sql.FieldGTE(FieldRealName, v)) +} + +// RealNameLT applies the LT predicate on the "real_name" field. +func RealNameLT(v string) predicate.User { + return predicate.User(sql.FieldLT(FieldRealName, v)) +} + +// RealNameLTE applies the LTE predicate on the "real_name" field. +func RealNameLTE(v string) predicate.User { + return predicate.User(sql.FieldLTE(FieldRealName, v)) +} + +// RealNameContains applies the Contains predicate on the "real_name" field. +func RealNameContains(v string) predicate.User { + return predicate.User(sql.FieldContains(FieldRealName, v)) +} + +// RealNameHasPrefix applies the HasPrefix predicate on the "real_name" field. +func RealNameHasPrefix(v string) predicate.User { + return predicate.User(sql.FieldHasPrefix(FieldRealName, v)) +} + +// RealNameHasSuffix applies the HasSuffix predicate on the "real_name" field. +func RealNameHasSuffix(v string) predicate.User { + return predicate.User(sql.FieldHasSuffix(FieldRealName, v)) +} + +// RealNameIsNil applies the IsNil predicate on the "real_name" field. +func RealNameIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldRealName)) +} + +// RealNameNotNil applies the NotNil predicate on the "real_name" field. +func RealNameNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldRealName)) +} + +// RealNameEqualFold applies the EqualFold predicate on the "real_name" field. +func RealNameEqualFold(v string) predicate.User { + return predicate.User(sql.FieldEqualFold(FieldRealName, v)) +} + +// RealNameContainsFold applies the ContainsFold predicate on the "real_name" field. +func RealNameContainsFold(v string) predicate.User { + return predicate.User(sql.FieldContainsFold(FieldRealName, v)) +} + +// EmailEQ applies the EQ predicate on the "email" field. +func EmailEQ(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldEmail, v)) +} + +// EmailNEQ applies the NEQ predicate on the "email" field. +func EmailNEQ(v string) predicate.User { + return predicate.User(sql.FieldNEQ(FieldEmail, v)) +} + +// EmailIn applies the In predicate on the "email" field. +func EmailIn(vs ...string) predicate.User { + return predicate.User(sql.FieldIn(FieldEmail, vs...)) +} + +// EmailNotIn applies the NotIn predicate on the "email" field. +func EmailNotIn(vs ...string) predicate.User { + return predicate.User(sql.FieldNotIn(FieldEmail, vs...)) +} + +// EmailGT applies the GT predicate on the "email" field. +func EmailGT(v string) predicate.User { + return predicate.User(sql.FieldGT(FieldEmail, v)) +} + +// EmailGTE applies the GTE predicate on the "email" field. +func EmailGTE(v string) predicate.User { + return predicate.User(sql.FieldGTE(FieldEmail, v)) +} + +// EmailLT applies the LT predicate on the "email" field. +func EmailLT(v string) predicate.User { + return predicate.User(sql.FieldLT(FieldEmail, v)) +} + +// EmailLTE applies the LTE predicate on the "email" field. +func EmailLTE(v string) predicate.User { + return predicate.User(sql.FieldLTE(FieldEmail, v)) +} + +// EmailContains applies the Contains predicate on the "email" field. +func EmailContains(v string) predicate.User { + return predicate.User(sql.FieldContains(FieldEmail, v)) +} + +// EmailHasPrefix applies the HasPrefix predicate on the "email" field. +func EmailHasPrefix(v string) predicate.User { + return predicate.User(sql.FieldHasPrefix(FieldEmail, v)) +} + +// EmailHasSuffix applies the HasSuffix predicate on the "email" field. +func EmailHasSuffix(v string) predicate.User { + return predicate.User(sql.FieldHasSuffix(FieldEmail, v)) +} + +// EmailIsNil applies the IsNil predicate on the "email" field. +func EmailIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldEmail)) +} + +// EmailNotNil applies the NotNil predicate on the "email" field. +func EmailNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldEmail)) +} + +// EmailEqualFold applies the EqualFold predicate on the "email" field. +func EmailEqualFold(v string) predicate.User { + return predicate.User(sql.FieldEqualFold(FieldEmail, v)) +} + +// EmailContainsFold applies the ContainsFold predicate on the "email" field. +func EmailContainsFold(v string) predicate.User { + return predicate.User(sql.FieldContainsFold(FieldEmail, v)) +} + +// PhoneEQ applies the EQ predicate on the "phone" field. +func PhoneEQ(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldPhone, v)) +} + +// PhoneNEQ applies the NEQ predicate on the "phone" field. +func PhoneNEQ(v string) predicate.User { + return predicate.User(sql.FieldNEQ(FieldPhone, v)) +} + +// PhoneIn applies the In predicate on the "phone" field. +func PhoneIn(vs ...string) predicate.User { + return predicate.User(sql.FieldIn(FieldPhone, vs...)) +} + +// PhoneNotIn applies the NotIn predicate on the "phone" field. +func PhoneNotIn(vs ...string) predicate.User { + return predicate.User(sql.FieldNotIn(FieldPhone, vs...)) +} + +// PhoneGT applies the GT predicate on the "phone" field. +func PhoneGT(v string) predicate.User { + return predicate.User(sql.FieldGT(FieldPhone, v)) +} + +// PhoneGTE applies the GTE predicate on the "phone" field. +func PhoneGTE(v string) predicate.User { + return predicate.User(sql.FieldGTE(FieldPhone, v)) +} + +// PhoneLT applies the LT predicate on the "phone" field. +func PhoneLT(v string) predicate.User { + return predicate.User(sql.FieldLT(FieldPhone, v)) +} + +// PhoneLTE applies the LTE predicate on the "phone" field. +func PhoneLTE(v string) predicate.User { + return predicate.User(sql.FieldLTE(FieldPhone, v)) +} + +// PhoneContains applies the Contains predicate on the "phone" field. +func PhoneContains(v string) predicate.User { + return predicate.User(sql.FieldContains(FieldPhone, v)) +} + +// PhoneHasPrefix applies the HasPrefix predicate on the "phone" field. +func PhoneHasPrefix(v string) predicate.User { + return predicate.User(sql.FieldHasPrefix(FieldPhone, v)) +} + +// PhoneHasSuffix applies the HasSuffix predicate on the "phone" field. +func PhoneHasSuffix(v string) predicate.User { + return predicate.User(sql.FieldHasSuffix(FieldPhone, v)) +} + +// PhoneIsNil applies the IsNil predicate on the "phone" field. +func PhoneIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldPhone)) +} + +// PhoneNotNil applies the NotNil predicate on the "phone" field. +func PhoneNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldPhone)) +} + +// PhoneEqualFold applies the EqualFold predicate on the "phone" field. +func PhoneEqualFold(v string) predicate.User { + return predicate.User(sql.FieldEqualFold(FieldPhone, v)) +} + +// PhoneContainsFold applies the ContainsFold predicate on the "phone" field. +func PhoneContainsFold(v string) predicate.User { + return predicate.User(sql.FieldContainsFold(FieldPhone, v)) +} + +// AvatarEQ applies the EQ predicate on the "avatar" field. +func AvatarEQ(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldAvatar, v)) +} + +// AvatarNEQ applies the NEQ predicate on the "avatar" field. +func AvatarNEQ(v string) predicate.User { + return predicate.User(sql.FieldNEQ(FieldAvatar, v)) +} + +// AvatarIn applies the In predicate on the "avatar" field. +func AvatarIn(vs ...string) predicate.User { + return predicate.User(sql.FieldIn(FieldAvatar, vs...)) +} + +// AvatarNotIn applies the NotIn predicate on the "avatar" field. +func AvatarNotIn(vs ...string) predicate.User { + return predicate.User(sql.FieldNotIn(FieldAvatar, vs...)) +} + +// AvatarGT applies the GT predicate on the "avatar" field. +func AvatarGT(v string) predicate.User { + return predicate.User(sql.FieldGT(FieldAvatar, v)) +} + +// AvatarGTE applies the GTE predicate on the "avatar" field. +func AvatarGTE(v string) predicate.User { + return predicate.User(sql.FieldGTE(FieldAvatar, v)) +} + +// AvatarLT applies the LT predicate on the "avatar" field. +func AvatarLT(v string) predicate.User { + return predicate.User(sql.FieldLT(FieldAvatar, v)) +} + +// AvatarLTE applies the LTE predicate on the "avatar" field. +func AvatarLTE(v string) predicate.User { + return predicate.User(sql.FieldLTE(FieldAvatar, v)) +} + +// AvatarContains applies the Contains predicate on the "avatar" field. +func AvatarContains(v string) predicate.User { + return predicate.User(sql.FieldContains(FieldAvatar, v)) +} + +// AvatarHasPrefix applies the HasPrefix predicate on the "avatar" field. +func AvatarHasPrefix(v string) predicate.User { + return predicate.User(sql.FieldHasPrefix(FieldAvatar, v)) +} + +// AvatarHasSuffix applies the HasSuffix predicate on the "avatar" field. +func AvatarHasSuffix(v string) predicate.User { + return predicate.User(sql.FieldHasSuffix(FieldAvatar, v)) +} + +// AvatarIsNil applies the IsNil predicate on the "avatar" field. +func AvatarIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldAvatar)) +} + +// AvatarNotNil applies the NotNil predicate on the "avatar" field. +func AvatarNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldAvatar)) +} + +// AvatarEqualFold applies the EqualFold predicate on the "avatar" field. +func AvatarEqualFold(v string) predicate.User { + return predicate.User(sql.FieldEqualFold(FieldAvatar, v)) +} + +// AvatarContainsFold applies the ContainsFold predicate on the "avatar" field. +func AvatarContainsFold(v string) predicate.User { + return predicate.User(sql.FieldContainsFold(FieldAvatar, v)) +} + +// GenderEQ applies the EQ predicate on the "gender" field. +func GenderEQ(v Gender) predicate.User { + return predicate.User(sql.FieldEQ(FieldGender, v)) +} + +// GenderNEQ applies the NEQ predicate on the "gender" field. +func GenderNEQ(v Gender) predicate.User { + return predicate.User(sql.FieldNEQ(FieldGender, v)) +} + +// GenderIn applies the In predicate on the "gender" field. +func GenderIn(vs ...Gender) predicate.User { + return predicate.User(sql.FieldIn(FieldGender, vs...)) +} + +// GenderNotIn applies the NotIn predicate on the "gender" field. +func GenderNotIn(vs ...Gender) predicate.User { + return predicate.User(sql.FieldNotIn(FieldGender, vs...)) +} + +// GenderIsNil applies the IsNil predicate on the "gender" field. +func GenderIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldGender)) +} + +// GenderNotNil applies the NotNil predicate on the "gender" field. +func GenderNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldGender)) +} + +// AddressEQ applies the EQ predicate on the "address" field. +func AddressEQ(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldAddress, v)) +} + +// AddressNEQ applies the NEQ predicate on the "address" field. +func AddressNEQ(v string) predicate.User { + return predicate.User(sql.FieldNEQ(FieldAddress, v)) +} + +// AddressIn applies the In predicate on the "address" field. +func AddressIn(vs ...string) predicate.User { + return predicate.User(sql.FieldIn(FieldAddress, vs...)) +} + +// AddressNotIn applies the NotIn predicate on the "address" field. +func AddressNotIn(vs ...string) predicate.User { + return predicate.User(sql.FieldNotIn(FieldAddress, vs...)) +} + +// AddressGT applies the GT predicate on the "address" field. +func AddressGT(v string) predicate.User { + return predicate.User(sql.FieldGT(FieldAddress, v)) +} + +// AddressGTE applies the GTE predicate on the "address" field. +func AddressGTE(v string) predicate.User { + return predicate.User(sql.FieldGTE(FieldAddress, v)) +} + +// AddressLT applies the LT predicate on the "address" field. +func AddressLT(v string) predicate.User { + return predicate.User(sql.FieldLT(FieldAddress, v)) +} + +// AddressLTE applies the LTE predicate on the "address" field. +func AddressLTE(v string) predicate.User { + return predicate.User(sql.FieldLTE(FieldAddress, v)) +} + +// AddressContains applies the Contains predicate on the "address" field. +func AddressContains(v string) predicate.User { + return predicate.User(sql.FieldContains(FieldAddress, v)) +} + +// AddressHasPrefix applies the HasPrefix predicate on the "address" field. +func AddressHasPrefix(v string) predicate.User { + return predicate.User(sql.FieldHasPrefix(FieldAddress, v)) +} + +// AddressHasSuffix applies the HasSuffix predicate on the "address" field. +func AddressHasSuffix(v string) predicate.User { + return predicate.User(sql.FieldHasSuffix(FieldAddress, v)) +} + +// AddressIsNil applies the IsNil predicate on the "address" field. +func AddressIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldAddress)) +} + +// AddressNotNil applies the NotNil predicate on the "address" field. +func AddressNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldAddress)) +} + +// AddressEqualFold applies the EqualFold predicate on the "address" field. +func AddressEqualFold(v string) predicate.User { + return predicate.User(sql.FieldEqualFold(FieldAddress, v)) +} + +// AddressContainsFold applies the ContainsFold predicate on the "address" field. +func AddressContainsFold(v string) predicate.User { + return predicate.User(sql.FieldContainsFold(FieldAddress, v)) +} + +// DescriptionEQ applies the EQ predicate on the "description" field. +func DescriptionEQ(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldDescription, v)) +} + +// DescriptionNEQ applies the NEQ predicate on the "description" field. +func DescriptionNEQ(v string) predicate.User { + return predicate.User(sql.FieldNEQ(FieldDescription, v)) +} + +// DescriptionIn applies the In predicate on the "description" field. +func DescriptionIn(vs ...string) predicate.User { + return predicate.User(sql.FieldIn(FieldDescription, vs...)) +} + +// DescriptionNotIn applies the NotIn predicate on the "description" field. +func DescriptionNotIn(vs ...string) predicate.User { + return predicate.User(sql.FieldNotIn(FieldDescription, vs...)) +} + +// DescriptionGT applies the GT predicate on the "description" field. +func DescriptionGT(v string) predicate.User { + return predicate.User(sql.FieldGT(FieldDescription, v)) +} + +// DescriptionGTE applies the GTE predicate on the "description" field. +func DescriptionGTE(v string) predicate.User { + return predicate.User(sql.FieldGTE(FieldDescription, v)) +} + +// DescriptionLT applies the LT predicate on the "description" field. +func DescriptionLT(v string) predicate.User { + return predicate.User(sql.FieldLT(FieldDescription, v)) +} + +// DescriptionLTE applies the LTE predicate on the "description" field. +func DescriptionLTE(v string) predicate.User { + return predicate.User(sql.FieldLTE(FieldDescription, v)) +} + +// DescriptionContains applies the Contains predicate on the "description" field. +func DescriptionContains(v string) predicate.User { + return predicate.User(sql.FieldContains(FieldDescription, v)) +} + +// DescriptionHasPrefix applies the HasPrefix predicate on the "description" field. +func DescriptionHasPrefix(v string) predicate.User { + return predicate.User(sql.FieldHasPrefix(FieldDescription, v)) +} + +// DescriptionHasSuffix applies the HasSuffix predicate on the "description" field. +func DescriptionHasSuffix(v string) predicate.User { + return predicate.User(sql.FieldHasSuffix(FieldDescription, v)) +} + +// DescriptionIsNil applies the IsNil predicate on the "description" field. +func DescriptionIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldDescription)) +} + +// DescriptionNotNil applies the NotNil predicate on the "description" field. +func DescriptionNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldDescription)) +} + +// DescriptionEqualFold applies the EqualFold predicate on the "description" field. +func DescriptionEqualFold(v string) predicate.User { + return predicate.User(sql.FieldEqualFold(FieldDescription, v)) +} + +// DescriptionContainsFold applies the ContainsFold predicate on the "description" field. +func DescriptionContainsFold(v string) predicate.User { + return predicate.User(sql.FieldContainsFold(FieldDescription, v)) +} + +// AuthorityEQ applies the EQ predicate on the "authority" field. +func AuthorityEQ(v Authority) predicate.User { + return predicate.User(sql.FieldEQ(FieldAuthority, v)) +} + +// AuthorityNEQ applies the NEQ predicate on the "authority" field. +func AuthorityNEQ(v Authority) predicate.User { + return predicate.User(sql.FieldNEQ(FieldAuthority, v)) +} + +// AuthorityIn applies the In predicate on the "authority" field. +func AuthorityIn(vs ...Authority) predicate.User { + return predicate.User(sql.FieldIn(FieldAuthority, vs...)) +} + +// AuthorityNotIn applies the NotIn predicate on the "authority" field. +func AuthorityNotIn(vs ...Authority) predicate.User { + return predicate.User(sql.FieldNotIn(FieldAuthority, vs...)) +} + +// AuthorityIsNil applies the IsNil predicate on the "authority" field. +func AuthorityIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldAuthority)) +} + +// AuthorityNotNil applies the NotNil predicate on the "authority" field. +func AuthorityNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldAuthority)) +} + +// LastLoginTimeEQ applies the EQ predicate on the "last_login_time" field. +func LastLoginTimeEQ(v int64) predicate.User { + return predicate.User(sql.FieldEQ(FieldLastLoginTime, v)) +} + +// LastLoginTimeNEQ applies the NEQ predicate on the "last_login_time" field. +func LastLoginTimeNEQ(v int64) predicate.User { + return predicate.User(sql.FieldNEQ(FieldLastLoginTime, v)) +} + +// LastLoginTimeIn applies the In predicate on the "last_login_time" field. +func LastLoginTimeIn(vs ...int64) predicate.User { + return predicate.User(sql.FieldIn(FieldLastLoginTime, vs...)) +} + +// LastLoginTimeNotIn applies the NotIn predicate on the "last_login_time" field. +func LastLoginTimeNotIn(vs ...int64) predicate.User { + return predicate.User(sql.FieldNotIn(FieldLastLoginTime, vs...)) +} + +// LastLoginTimeGT applies the GT predicate on the "last_login_time" field. +func LastLoginTimeGT(v int64) predicate.User { + return predicate.User(sql.FieldGT(FieldLastLoginTime, v)) +} + +// LastLoginTimeGTE applies the GTE predicate on the "last_login_time" field. +func LastLoginTimeGTE(v int64) predicate.User { + return predicate.User(sql.FieldGTE(FieldLastLoginTime, v)) +} + +// LastLoginTimeLT applies the LT predicate on the "last_login_time" field. +func LastLoginTimeLT(v int64) predicate.User { + return predicate.User(sql.FieldLT(FieldLastLoginTime, v)) +} + +// LastLoginTimeLTE applies the LTE predicate on the "last_login_time" field. +func LastLoginTimeLTE(v int64) predicate.User { + return predicate.User(sql.FieldLTE(FieldLastLoginTime, v)) +} + +// LastLoginTimeIsNil applies the IsNil predicate on the "last_login_time" field. +func LastLoginTimeIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldLastLoginTime)) +} + +// LastLoginTimeNotNil applies the NotNil predicate on the "last_login_time" field. +func LastLoginTimeNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldLastLoginTime)) +} + +// LastLoginIPEQ applies the EQ predicate on the "last_login_ip" field. +func LastLoginIPEQ(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldLastLoginIP, v)) +} + +// LastLoginIPNEQ applies the NEQ predicate on the "last_login_ip" field. +func LastLoginIPNEQ(v string) predicate.User { + return predicate.User(sql.FieldNEQ(FieldLastLoginIP, v)) +} + +// LastLoginIPIn applies the In predicate on the "last_login_ip" field. +func LastLoginIPIn(vs ...string) predicate.User { + return predicate.User(sql.FieldIn(FieldLastLoginIP, vs...)) +} + +// LastLoginIPNotIn applies the NotIn predicate on the "last_login_ip" field. +func LastLoginIPNotIn(vs ...string) predicate.User { + return predicate.User(sql.FieldNotIn(FieldLastLoginIP, vs...)) +} + +// LastLoginIPGT applies the GT predicate on the "last_login_ip" field. +func LastLoginIPGT(v string) predicate.User { + return predicate.User(sql.FieldGT(FieldLastLoginIP, v)) +} + +// LastLoginIPGTE applies the GTE predicate on the "last_login_ip" field. +func LastLoginIPGTE(v string) predicate.User { + return predicate.User(sql.FieldGTE(FieldLastLoginIP, v)) +} + +// LastLoginIPLT applies the LT predicate on the "last_login_ip" field. +func LastLoginIPLT(v string) predicate.User { + return predicate.User(sql.FieldLT(FieldLastLoginIP, v)) +} + +// LastLoginIPLTE applies the LTE predicate on the "last_login_ip" field. +func LastLoginIPLTE(v string) predicate.User { + return predicate.User(sql.FieldLTE(FieldLastLoginIP, v)) +} + +// LastLoginIPContains applies the Contains predicate on the "last_login_ip" field. +func LastLoginIPContains(v string) predicate.User { + return predicate.User(sql.FieldContains(FieldLastLoginIP, v)) +} + +// LastLoginIPHasPrefix applies the HasPrefix predicate on the "last_login_ip" field. +func LastLoginIPHasPrefix(v string) predicate.User { + return predicate.User(sql.FieldHasPrefix(FieldLastLoginIP, v)) +} + +// LastLoginIPHasSuffix applies the HasSuffix predicate on the "last_login_ip" field. +func LastLoginIPHasSuffix(v string) predicate.User { + return predicate.User(sql.FieldHasSuffix(FieldLastLoginIP, v)) +} + +// LastLoginIPIsNil applies the IsNil predicate on the "last_login_ip" field. +func LastLoginIPIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldLastLoginIP)) +} + +// LastLoginIPNotNil applies the NotNil predicate on the "last_login_ip" field. +func LastLoginIPNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldLastLoginIP)) +} + +// LastLoginIPEqualFold applies the EqualFold predicate on the "last_login_ip" field. +func LastLoginIPEqualFold(v string) predicate.User { + return predicate.User(sql.FieldEqualFold(FieldLastLoginIP, v)) +} + +// LastLoginIPContainsFold applies the ContainsFold predicate on the "last_login_ip" field. +func LastLoginIPContainsFold(v string) predicate.User { + return predicate.User(sql.FieldContainsFold(FieldLastLoginIP, v)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.User) predicate.User { + return predicate.User(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.User) predicate.User { + return predicate.User(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.User) predicate.User { + return predicate.User(sql.NotPredicates(p)) +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/user_create.go b/monolithic/backend/app/admin/service/internal/data/ent/user_create.go new file mode 100644 index 0000000..ab09e68 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/user_create.go @@ -0,0 +1,2256 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "errors" + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/user" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// UserCreate is the builder for creating a User entity. +type UserCreate struct { + config + mutation *UserMutation + hooks []Hook + conflict []sql.ConflictOption +} + +// SetCreateBy sets the "create_by" field. +func (uc *UserCreate) SetCreateBy(u uint32) *UserCreate { + uc.mutation.SetCreateBy(u) + return uc +} + +// SetNillableCreateBy sets the "create_by" field if the given value is not nil. +func (uc *UserCreate) SetNillableCreateBy(u *uint32) *UserCreate { + if u != nil { + uc.SetCreateBy(*u) + } + return uc +} + +// SetCreateTime sets the "create_time" field. +func (uc *UserCreate) SetCreateTime(t time.Time) *UserCreate { + uc.mutation.SetCreateTime(t) + return uc +} + +// SetNillableCreateTime sets the "create_time" field if the given value is not nil. +func (uc *UserCreate) SetNillableCreateTime(t *time.Time) *UserCreate { + if t != nil { + uc.SetCreateTime(*t) + } + return uc +} + +// SetUpdateTime sets the "update_time" field. +func (uc *UserCreate) SetUpdateTime(t time.Time) *UserCreate { + uc.mutation.SetUpdateTime(t) + return uc +} + +// SetNillableUpdateTime sets the "update_time" field if the given value is not nil. +func (uc *UserCreate) SetNillableUpdateTime(t *time.Time) *UserCreate { + if t != nil { + uc.SetUpdateTime(*t) + } + return uc +} + +// SetDeleteTime sets the "delete_time" field. +func (uc *UserCreate) SetDeleteTime(t time.Time) *UserCreate { + uc.mutation.SetDeleteTime(t) + return uc +} + +// SetNillableDeleteTime sets the "delete_time" field if the given value is not nil. +func (uc *UserCreate) SetNillableDeleteTime(t *time.Time) *UserCreate { + if t != nil { + uc.SetDeleteTime(*t) + } + return uc +} + +// SetStatus sets the "status" field. +func (uc *UserCreate) SetStatus(u user.Status) *UserCreate { + uc.mutation.SetStatus(u) + return uc +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (uc *UserCreate) SetNillableStatus(u *user.Status) *UserCreate { + if u != nil { + uc.SetStatus(*u) + } + return uc +} + +// SetUsername sets the "username" field. +func (uc *UserCreate) SetUsername(s string) *UserCreate { + uc.mutation.SetUsername(s) + return uc +} + +// SetNillableUsername sets the "username" field if the given value is not nil. +func (uc *UserCreate) SetNillableUsername(s *string) *UserCreate { + if s != nil { + uc.SetUsername(*s) + } + return uc +} + +// SetPassword sets the "password" field. +func (uc *UserCreate) SetPassword(s string) *UserCreate { + uc.mutation.SetPassword(s) + return uc +} + +// SetNillablePassword sets the "password" field if the given value is not nil. +func (uc *UserCreate) SetNillablePassword(s *string) *UserCreate { + if s != nil { + uc.SetPassword(*s) + } + return uc +} + +// SetRoleID sets the "role_id" field. +func (uc *UserCreate) SetRoleID(u uint32) *UserCreate { + uc.mutation.SetRoleID(u) + return uc +} + +// SetNillableRoleID sets the "role_id" field if the given value is not nil. +func (uc *UserCreate) SetNillableRoleID(u *uint32) *UserCreate { + if u != nil { + uc.SetRoleID(*u) + } + return uc +} + +// SetOrgID sets the "org_id" field. +func (uc *UserCreate) SetOrgID(u uint32) *UserCreate { + uc.mutation.SetOrgID(u) + return uc +} + +// SetNillableOrgID sets the "org_id" field if the given value is not nil. +func (uc *UserCreate) SetNillableOrgID(u *uint32) *UserCreate { + if u != nil { + uc.SetOrgID(*u) + } + return uc +} + +// SetPositionID sets the "position_id" field. +func (uc *UserCreate) SetPositionID(u uint32) *UserCreate { + uc.mutation.SetPositionID(u) + return uc +} + +// SetNillablePositionID sets the "position_id" field if the given value is not nil. +func (uc *UserCreate) SetNillablePositionID(u *uint32) *UserCreate { + if u != nil { + uc.SetPositionID(*u) + } + return uc +} + +// SetWorkID sets the "work_id" field. +func (uc *UserCreate) SetWorkID(u uint32) *UserCreate { + uc.mutation.SetWorkID(u) + return uc +} + +// SetNillableWorkID sets the "work_id" field if the given value is not nil. +func (uc *UserCreate) SetNillableWorkID(u *uint32) *UserCreate { + if u != nil { + uc.SetWorkID(*u) + } + return uc +} + +// SetNickName sets the "nick_name" field. +func (uc *UserCreate) SetNickName(s string) *UserCreate { + uc.mutation.SetNickName(s) + return uc +} + +// SetNillableNickName sets the "nick_name" field if the given value is not nil. +func (uc *UserCreate) SetNillableNickName(s *string) *UserCreate { + if s != nil { + uc.SetNickName(*s) + } + return uc +} + +// SetRealName sets the "real_name" field. +func (uc *UserCreate) SetRealName(s string) *UserCreate { + uc.mutation.SetRealName(s) + return uc +} + +// SetNillableRealName sets the "real_name" field if the given value is not nil. +func (uc *UserCreate) SetNillableRealName(s *string) *UserCreate { + if s != nil { + uc.SetRealName(*s) + } + return uc +} + +// SetEmail sets the "email" field. +func (uc *UserCreate) SetEmail(s string) *UserCreate { + uc.mutation.SetEmail(s) + return uc +} + +// SetNillableEmail sets the "email" field if the given value is not nil. +func (uc *UserCreate) SetNillableEmail(s *string) *UserCreate { + if s != nil { + uc.SetEmail(*s) + } + return uc +} + +// SetPhone sets the "phone" field. +func (uc *UserCreate) SetPhone(s string) *UserCreate { + uc.mutation.SetPhone(s) + return uc +} + +// SetNillablePhone sets the "phone" field if the given value is not nil. +func (uc *UserCreate) SetNillablePhone(s *string) *UserCreate { + if s != nil { + uc.SetPhone(*s) + } + return uc +} + +// SetAvatar sets the "avatar" field. +func (uc *UserCreate) SetAvatar(s string) *UserCreate { + uc.mutation.SetAvatar(s) + return uc +} + +// SetNillableAvatar sets the "avatar" field if the given value is not nil. +func (uc *UserCreate) SetNillableAvatar(s *string) *UserCreate { + if s != nil { + uc.SetAvatar(*s) + } + return uc +} + +// SetGender sets the "gender" field. +func (uc *UserCreate) SetGender(u user.Gender) *UserCreate { + uc.mutation.SetGender(u) + return uc +} + +// SetNillableGender sets the "gender" field if the given value is not nil. +func (uc *UserCreate) SetNillableGender(u *user.Gender) *UserCreate { + if u != nil { + uc.SetGender(*u) + } + return uc +} + +// SetAddress sets the "address" field. +func (uc *UserCreate) SetAddress(s string) *UserCreate { + uc.mutation.SetAddress(s) + return uc +} + +// SetNillableAddress sets the "address" field if the given value is not nil. +func (uc *UserCreate) SetNillableAddress(s *string) *UserCreate { + if s != nil { + uc.SetAddress(*s) + } + return uc +} + +// SetDescription sets the "description" field. +func (uc *UserCreate) SetDescription(s string) *UserCreate { + uc.mutation.SetDescription(s) + return uc +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (uc *UserCreate) SetNillableDescription(s *string) *UserCreate { + if s != nil { + uc.SetDescription(*s) + } + return uc +} + +// SetAuthority sets the "authority" field. +func (uc *UserCreate) SetAuthority(u user.Authority) *UserCreate { + uc.mutation.SetAuthority(u) + return uc +} + +// SetNillableAuthority sets the "authority" field if the given value is not nil. +func (uc *UserCreate) SetNillableAuthority(u *user.Authority) *UserCreate { + if u != nil { + uc.SetAuthority(*u) + } + return uc +} + +// SetLastLoginTime sets the "last_login_time" field. +func (uc *UserCreate) SetLastLoginTime(i int64) *UserCreate { + uc.mutation.SetLastLoginTime(i) + return uc +} + +// SetNillableLastLoginTime sets the "last_login_time" field if the given value is not nil. +func (uc *UserCreate) SetNillableLastLoginTime(i *int64) *UserCreate { + if i != nil { + uc.SetLastLoginTime(*i) + } + return uc +} + +// SetLastLoginIP sets the "last_login_ip" field. +func (uc *UserCreate) SetLastLoginIP(s string) *UserCreate { + uc.mutation.SetLastLoginIP(s) + return uc +} + +// SetNillableLastLoginIP sets the "last_login_ip" field if the given value is not nil. +func (uc *UserCreate) SetNillableLastLoginIP(s *string) *UserCreate { + if s != nil { + uc.SetLastLoginIP(*s) + } + return uc +} + +// SetID sets the "id" field. +func (uc *UserCreate) SetID(u uint32) *UserCreate { + uc.mutation.SetID(u) + return uc +} + +// Mutation returns the UserMutation object of the builder. +func (uc *UserCreate) Mutation() *UserMutation { + return uc.mutation +} + +// Save creates the User in the database. +func (uc *UserCreate) Save(ctx context.Context) (*User, error) { + uc.defaults() + return withHooks(ctx, uc.sqlSave, uc.mutation, uc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (uc *UserCreate) SaveX(ctx context.Context) *User { + v, err := uc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (uc *UserCreate) Exec(ctx context.Context) error { + _, err := uc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (uc *UserCreate) ExecX(ctx context.Context) { + if err := uc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (uc *UserCreate) defaults() { + if _, ok := uc.mutation.Status(); !ok { + v := user.DefaultStatus + uc.mutation.SetStatus(v) + } + if _, ok := uc.mutation.Phone(); !ok { + v := user.DefaultPhone + uc.mutation.SetPhone(v) + } + if _, ok := uc.mutation.Address(); !ok { + v := user.DefaultAddress + uc.mutation.SetAddress(v) + } + if _, ok := uc.mutation.Authority(); !ok { + v := user.DefaultAuthority + uc.mutation.SetAuthority(v) + } + if _, ok := uc.mutation.LastLoginIP(); !ok { + v := user.DefaultLastLoginIP + uc.mutation.SetLastLoginIP(v) + } +} + +// check runs all checks and user-defined validators on the builder. +func (uc *UserCreate) check() error { + if v, ok := uc.mutation.Status(); ok { + if err := user.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "User.status": %w`, err)} + } + } + if v, ok := uc.mutation.Username(); ok { + if err := user.UsernameValidator(v); err != nil { + return &ValidationError{Name: "username", err: fmt.Errorf(`ent: validator failed for field "User.username": %w`, err)} + } + } + if v, ok := uc.mutation.Password(); ok { + if err := user.PasswordValidator(v); err != nil { + return &ValidationError{Name: "password", err: fmt.Errorf(`ent: validator failed for field "User.password": %w`, err)} + } + } + if v, ok := uc.mutation.NickName(); ok { + if err := user.NickNameValidator(v); err != nil { + return &ValidationError{Name: "nick_name", err: fmt.Errorf(`ent: validator failed for field "User.nick_name": %w`, err)} + } + } + if v, ok := uc.mutation.RealName(); ok { + if err := user.RealNameValidator(v); err != nil { + return &ValidationError{Name: "real_name", err: fmt.Errorf(`ent: validator failed for field "User.real_name": %w`, err)} + } + } + if v, ok := uc.mutation.Email(); ok { + if err := user.EmailValidator(v); err != nil { + return &ValidationError{Name: "email", err: fmt.Errorf(`ent: validator failed for field "User.email": %w`, err)} + } + } + if v, ok := uc.mutation.Phone(); ok { + if err := user.PhoneValidator(v); err != nil { + return &ValidationError{Name: "phone", err: fmt.Errorf(`ent: validator failed for field "User.phone": %w`, err)} + } + } + if v, ok := uc.mutation.Avatar(); ok { + if err := user.AvatarValidator(v); err != nil { + return &ValidationError{Name: "avatar", err: fmt.Errorf(`ent: validator failed for field "User.avatar": %w`, err)} + } + } + if v, ok := uc.mutation.Gender(); ok { + if err := user.GenderValidator(v); err != nil { + return &ValidationError{Name: "gender", err: fmt.Errorf(`ent: validator failed for field "User.gender": %w`, err)} + } + } + if v, ok := uc.mutation.Address(); ok { + if err := user.AddressValidator(v); err != nil { + return &ValidationError{Name: "address", err: fmt.Errorf(`ent: validator failed for field "User.address": %w`, err)} + } + } + if v, ok := uc.mutation.Description(); ok { + if err := user.DescriptionValidator(v); err != nil { + return &ValidationError{Name: "description", err: fmt.Errorf(`ent: validator failed for field "User.description": %w`, err)} + } + } + if v, ok := uc.mutation.Authority(); ok { + if err := user.AuthorityValidator(v); err != nil { + return &ValidationError{Name: "authority", err: fmt.Errorf(`ent: validator failed for field "User.authority": %w`, err)} + } + } + if v, ok := uc.mutation.LastLoginIP(); ok { + if err := user.LastLoginIPValidator(v); err != nil { + return &ValidationError{Name: "last_login_ip", err: fmt.Errorf(`ent: validator failed for field "User.last_login_ip": %w`, err)} + } + } + if v, ok := uc.mutation.ID(); ok { + if err := user.IDValidator(v); err != nil { + return &ValidationError{Name: "id", err: fmt.Errorf(`ent: validator failed for field "User.id": %w`, err)} + } + } + return nil +} + +func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { + if err := uc.check(); err != nil { + return nil, err + } + _node, _spec := uc.createSpec() + if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { + if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + if _spec.ID.Value != _node.ID { + id := _spec.ID.Value.(int64) + _node.ID = uint32(id) + } + uc.mutation.id = &_node.ID + uc.mutation.done = true + return _node, nil +} + +func (uc *UserCreate) createSpec() (*User, *sqlgraph.CreateSpec) { + var ( + _node = &User{config: uc.config} + _spec = sqlgraph.NewCreateSpec(user.Table, sqlgraph.NewFieldSpec(user.FieldID, field.TypeUint32)) + ) + _spec.OnConflict = uc.conflict + if id, ok := uc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := uc.mutation.CreateBy(); ok { + _spec.SetField(user.FieldCreateBy, field.TypeUint32, value) + _node.CreateBy = &value + } + if value, ok := uc.mutation.CreateTime(); ok { + _spec.SetField(user.FieldCreateTime, field.TypeTime, value) + _node.CreateTime = &value + } + if value, ok := uc.mutation.UpdateTime(); ok { + _spec.SetField(user.FieldUpdateTime, field.TypeTime, value) + _node.UpdateTime = &value + } + if value, ok := uc.mutation.DeleteTime(); ok { + _spec.SetField(user.FieldDeleteTime, field.TypeTime, value) + _node.DeleteTime = &value + } + if value, ok := uc.mutation.Status(); ok { + _spec.SetField(user.FieldStatus, field.TypeEnum, value) + _node.Status = &value + } + if value, ok := uc.mutation.Username(); ok { + _spec.SetField(user.FieldUsername, field.TypeString, value) + _node.Username = &value + } + if value, ok := uc.mutation.Password(); ok { + _spec.SetField(user.FieldPassword, field.TypeString, value) + _node.Password = &value + } + if value, ok := uc.mutation.RoleID(); ok { + _spec.SetField(user.FieldRoleID, field.TypeUint32, value) + _node.RoleID = &value + } + if value, ok := uc.mutation.OrgID(); ok { + _spec.SetField(user.FieldOrgID, field.TypeUint32, value) + _node.OrgID = &value + } + if value, ok := uc.mutation.PositionID(); ok { + _spec.SetField(user.FieldPositionID, field.TypeUint32, value) + _node.PositionID = &value + } + if value, ok := uc.mutation.WorkID(); ok { + _spec.SetField(user.FieldWorkID, field.TypeUint32, value) + _node.WorkID = &value + } + if value, ok := uc.mutation.NickName(); ok { + _spec.SetField(user.FieldNickName, field.TypeString, value) + _node.NickName = &value + } + if value, ok := uc.mutation.RealName(); ok { + _spec.SetField(user.FieldRealName, field.TypeString, value) + _node.RealName = &value + } + if value, ok := uc.mutation.Email(); ok { + _spec.SetField(user.FieldEmail, field.TypeString, value) + _node.Email = &value + } + if value, ok := uc.mutation.Phone(); ok { + _spec.SetField(user.FieldPhone, field.TypeString, value) + _node.Phone = &value + } + if value, ok := uc.mutation.Avatar(); ok { + _spec.SetField(user.FieldAvatar, field.TypeString, value) + _node.Avatar = &value + } + if value, ok := uc.mutation.Gender(); ok { + _spec.SetField(user.FieldGender, field.TypeEnum, value) + _node.Gender = &value + } + if value, ok := uc.mutation.Address(); ok { + _spec.SetField(user.FieldAddress, field.TypeString, value) + _node.Address = &value + } + if value, ok := uc.mutation.Description(); ok { + _spec.SetField(user.FieldDescription, field.TypeString, value) + _node.Description = &value + } + if value, ok := uc.mutation.Authority(); ok { + _spec.SetField(user.FieldAuthority, field.TypeEnum, value) + _node.Authority = &value + } + if value, ok := uc.mutation.LastLoginTime(); ok { + _spec.SetField(user.FieldLastLoginTime, field.TypeInt64, value) + _node.LastLoginTime = &value + } + if value, ok := uc.mutation.LastLoginIP(); ok { + _spec.SetField(user.FieldLastLoginIP, field.TypeString, value) + _node.LastLoginIP = &value + } + return _node, _spec +} + +// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause +// of the `INSERT` statement. For example: +// +// client.User.Create(). +// SetCreateBy(v). +// OnConflict( +// // Update the row with the new values +// // the was proposed for insertion. +// sql.ResolveWithNewValues(), +// ). +// // Override some of the fields with custom +// // update values. +// Update(func(u *ent.UserUpsert) { +// SetCreateBy(v+v). +// }). +// Exec(ctx) +func (uc *UserCreate) OnConflict(opts ...sql.ConflictOption) *UserUpsertOne { + uc.conflict = opts + return &UserUpsertOne{ + create: uc, + } +} + +// OnConflictColumns calls `OnConflict` and configures the columns +// as conflict target. Using this option is equivalent to using: +// +// client.User.Create(). +// OnConflict(sql.ConflictColumns(columns...)). +// Exec(ctx) +func (uc *UserCreate) OnConflictColumns(columns ...string) *UserUpsertOne { + uc.conflict = append(uc.conflict, sql.ConflictColumns(columns...)) + return &UserUpsertOne{ + create: uc, + } +} + +type ( + // UserUpsertOne is the builder for "upsert"-ing + // one User node. + UserUpsertOne struct { + create *UserCreate + } + + // UserUpsert is the "OnConflict" setter. + UserUpsert struct { + *sql.UpdateSet + } +) + +// SetCreateBy sets the "create_by" field. +func (u *UserUpsert) SetCreateBy(v uint32) *UserUpsert { + u.Set(user.FieldCreateBy, v) + return u +} + +// UpdateCreateBy sets the "create_by" field to the value that was provided on create. +func (u *UserUpsert) UpdateCreateBy() *UserUpsert { + u.SetExcluded(user.FieldCreateBy) + return u +} + +// AddCreateBy adds v to the "create_by" field. +func (u *UserUpsert) AddCreateBy(v uint32) *UserUpsert { + u.Add(user.FieldCreateBy, v) + return u +} + +// ClearCreateBy clears the value of the "create_by" field. +func (u *UserUpsert) ClearCreateBy() *UserUpsert { + u.SetNull(user.FieldCreateBy) + return u +} + +// SetUpdateTime sets the "update_time" field. +func (u *UserUpsert) SetUpdateTime(v time.Time) *UserUpsert { + u.Set(user.FieldUpdateTime, v) + return u +} + +// UpdateUpdateTime sets the "update_time" field to the value that was provided on create. +func (u *UserUpsert) UpdateUpdateTime() *UserUpsert { + u.SetExcluded(user.FieldUpdateTime) + return u +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (u *UserUpsert) ClearUpdateTime() *UserUpsert { + u.SetNull(user.FieldUpdateTime) + return u +} + +// SetDeleteTime sets the "delete_time" field. +func (u *UserUpsert) SetDeleteTime(v time.Time) *UserUpsert { + u.Set(user.FieldDeleteTime, v) + return u +} + +// UpdateDeleteTime sets the "delete_time" field to the value that was provided on create. +func (u *UserUpsert) UpdateDeleteTime() *UserUpsert { + u.SetExcluded(user.FieldDeleteTime) + return u +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (u *UserUpsert) ClearDeleteTime() *UserUpsert { + u.SetNull(user.FieldDeleteTime) + return u +} + +// SetStatus sets the "status" field. +func (u *UserUpsert) SetStatus(v user.Status) *UserUpsert { + u.Set(user.FieldStatus, v) + return u +} + +// UpdateStatus sets the "status" field to the value that was provided on create. +func (u *UserUpsert) UpdateStatus() *UserUpsert { + u.SetExcluded(user.FieldStatus) + return u +} + +// ClearStatus clears the value of the "status" field. +func (u *UserUpsert) ClearStatus() *UserUpsert { + u.SetNull(user.FieldStatus) + return u +} + +// SetPassword sets the "password" field. +func (u *UserUpsert) SetPassword(v string) *UserUpsert { + u.Set(user.FieldPassword, v) + return u +} + +// UpdatePassword sets the "password" field to the value that was provided on create. +func (u *UserUpsert) UpdatePassword() *UserUpsert { + u.SetExcluded(user.FieldPassword) + return u +} + +// ClearPassword clears the value of the "password" field. +func (u *UserUpsert) ClearPassword() *UserUpsert { + u.SetNull(user.FieldPassword) + return u +} + +// SetRoleID sets the "role_id" field. +func (u *UserUpsert) SetRoleID(v uint32) *UserUpsert { + u.Set(user.FieldRoleID, v) + return u +} + +// UpdateRoleID sets the "role_id" field to the value that was provided on create. +func (u *UserUpsert) UpdateRoleID() *UserUpsert { + u.SetExcluded(user.FieldRoleID) + return u +} + +// AddRoleID adds v to the "role_id" field. +func (u *UserUpsert) AddRoleID(v uint32) *UserUpsert { + u.Add(user.FieldRoleID, v) + return u +} + +// ClearRoleID clears the value of the "role_id" field. +func (u *UserUpsert) ClearRoleID() *UserUpsert { + u.SetNull(user.FieldRoleID) + return u +} + +// SetOrgID sets the "org_id" field. +func (u *UserUpsert) SetOrgID(v uint32) *UserUpsert { + u.Set(user.FieldOrgID, v) + return u +} + +// UpdateOrgID sets the "org_id" field to the value that was provided on create. +func (u *UserUpsert) UpdateOrgID() *UserUpsert { + u.SetExcluded(user.FieldOrgID) + return u +} + +// AddOrgID adds v to the "org_id" field. +func (u *UserUpsert) AddOrgID(v uint32) *UserUpsert { + u.Add(user.FieldOrgID, v) + return u +} + +// ClearOrgID clears the value of the "org_id" field. +func (u *UserUpsert) ClearOrgID() *UserUpsert { + u.SetNull(user.FieldOrgID) + return u +} + +// SetPositionID sets the "position_id" field. +func (u *UserUpsert) SetPositionID(v uint32) *UserUpsert { + u.Set(user.FieldPositionID, v) + return u +} + +// UpdatePositionID sets the "position_id" field to the value that was provided on create. +func (u *UserUpsert) UpdatePositionID() *UserUpsert { + u.SetExcluded(user.FieldPositionID) + return u +} + +// AddPositionID adds v to the "position_id" field. +func (u *UserUpsert) AddPositionID(v uint32) *UserUpsert { + u.Add(user.FieldPositionID, v) + return u +} + +// ClearPositionID clears the value of the "position_id" field. +func (u *UserUpsert) ClearPositionID() *UserUpsert { + u.SetNull(user.FieldPositionID) + return u +} + +// SetWorkID sets the "work_id" field. +func (u *UserUpsert) SetWorkID(v uint32) *UserUpsert { + u.Set(user.FieldWorkID, v) + return u +} + +// UpdateWorkID sets the "work_id" field to the value that was provided on create. +func (u *UserUpsert) UpdateWorkID() *UserUpsert { + u.SetExcluded(user.FieldWorkID) + return u +} + +// AddWorkID adds v to the "work_id" field. +func (u *UserUpsert) AddWorkID(v uint32) *UserUpsert { + u.Add(user.FieldWorkID, v) + return u +} + +// ClearWorkID clears the value of the "work_id" field. +func (u *UserUpsert) ClearWorkID() *UserUpsert { + u.SetNull(user.FieldWorkID) + return u +} + +// SetNickName sets the "nick_name" field. +func (u *UserUpsert) SetNickName(v string) *UserUpsert { + u.Set(user.FieldNickName, v) + return u +} + +// UpdateNickName sets the "nick_name" field to the value that was provided on create. +func (u *UserUpsert) UpdateNickName() *UserUpsert { + u.SetExcluded(user.FieldNickName) + return u +} + +// ClearNickName clears the value of the "nick_name" field. +func (u *UserUpsert) ClearNickName() *UserUpsert { + u.SetNull(user.FieldNickName) + return u +} + +// SetRealName sets the "real_name" field. +func (u *UserUpsert) SetRealName(v string) *UserUpsert { + u.Set(user.FieldRealName, v) + return u +} + +// UpdateRealName sets the "real_name" field to the value that was provided on create. +func (u *UserUpsert) UpdateRealName() *UserUpsert { + u.SetExcluded(user.FieldRealName) + return u +} + +// ClearRealName clears the value of the "real_name" field. +func (u *UserUpsert) ClearRealName() *UserUpsert { + u.SetNull(user.FieldRealName) + return u +} + +// SetEmail sets the "email" field. +func (u *UserUpsert) SetEmail(v string) *UserUpsert { + u.Set(user.FieldEmail, v) + return u +} + +// UpdateEmail sets the "email" field to the value that was provided on create. +func (u *UserUpsert) UpdateEmail() *UserUpsert { + u.SetExcluded(user.FieldEmail) + return u +} + +// ClearEmail clears the value of the "email" field. +func (u *UserUpsert) ClearEmail() *UserUpsert { + u.SetNull(user.FieldEmail) + return u +} + +// SetPhone sets the "phone" field. +func (u *UserUpsert) SetPhone(v string) *UserUpsert { + u.Set(user.FieldPhone, v) + return u +} + +// UpdatePhone sets the "phone" field to the value that was provided on create. +func (u *UserUpsert) UpdatePhone() *UserUpsert { + u.SetExcluded(user.FieldPhone) + return u +} + +// ClearPhone clears the value of the "phone" field. +func (u *UserUpsert) ClearPhone() *UserUpsert { + u.SetNull(user.FieldPhone) + return u +} + +// SetAvatar sets the "avatar" field. +func (u *UserUpsert) SetAvatar(v string) *UserUpsert { + u.Set(user.FieldAvatar, v) + return u +} + +// UpdateAvatar sets the "avatar" field to the value that was provided on create. +func (u *UserUpsert) UpdateAvatar() *UserUpsert { + u.SetExcluded(user.FieldAvatar) + return u +} + +// ClearAvatar clears the value of the "avatar" field. +func (u *UserUpsert) ClearAvatar() *UserUpsert { + u.SetNull(user.FieldAvatar) + return u +} + +// SetGender sets the "gender" field. +func (u *UserUpsert) SetGender(v user.Gender) *UserUpsert { + u.Set(user.FieldGender, v) + return u +} + +// UpdateGender sets the "gender" field to the value that was provided on create. +func (u *UserUpsert) UpdateGender() *UserUpsert { + u.SetExcluded(user.FieldGender) + return u +} + +// ClearGender clears the value of the "gender" field. +func (u *UserUpsert) ClearGender() *UserUpsert { + u.SetNull(user.FieldGender) + return u +} + +// SetAddress sets the "address" field. +func (u *UserUpsert) SetAddress(v string) *UserUpsert { + u.Set(user.FieldAddress, v) + return u +} + +// UpdateAddress sets the "address" field to the value that was provided on create. +func (u *UserUpsert) UpdateAddress() *UserUpsert { + u.SetExcluded(user.FieldAddress) + return u +} + +// ClearAddress clears the value of the "address" field. +func (u *UserUpsert) ClearAddress() *UserUpsert { + u.SetNull(user.FieldAddress) + return u +} + +// SetDescription sets the "description" field. +func (u *UserUpsert) SetDescription(v string) *UserUpsert { + u.Set(user.FieldDescription, v) + return u +} + +// UpdateDescription sets the "description" field to the value that was provided on create. +func (u *UserUpsert) UpdateDescription() *UserUpsert { + u.SetExcluded(user.FieldDescription) + return u +} + +// ClearDescription clears the value of the "description" field. +func (u *UserUpsert) ClearDescription() *UserUpsert { + u.SetNull(user.FieldDescription) + return u +} + +// SetAuthority sets the "authority" field. +func (u *UserUpsert) SetAuthority(v user.Authority) *UserUpsert { + u.Set(user.FieldAuthority, v) + return u +} + +// UpdateAuthority sets the "authority" field to the value that was provided on create. +func (u *UserUpsert) UpdateAuthority() *UserUpsert { + u.SetExcluded(user.FieldAuthority) + return u +} + +// ClearAuthority clears the value of the "authority" field. +func (u *UserUpsert) ClearAuthority() *UserUpsert { + u.SetNull(user.FieldAuthority) + return u +} + +// SetLastLoginTime sets the "last_login_time" field. +func (u *UserUpsert) SetLastLoginTime(v int64) *UserUpsert { + u.Set(user.FieldLastLoginTime, v) + return u +} + +// UpdateLastLoginTime sets the "last_login_time" field to the value that was provided on create. +func (u *UserUpsert) UpdateLastLoginTime() *UserUpsert { + u.SetExcluded(user.FieldLastLoginTime) + return u +} + +// AddLastLoginTime adds v to the "last_login_time" field. +func (u *UserUpsert) AddLastLoginTime(v int64) *UserUpsert { + u.Add(user.FieldLastLoginTime, v) + return u +} + +// ClearLastLoginTime clears the value of the "last_login_time" field. +func (u *UserUpsert) ClearLastLoginTime() *UserUpsert { + u.SetNull(user.FieldLastLoginTime) + return u +} + +// SetLastLoginIP sets the "last_login_ip" field. +func (u *UserUpsert) SetLastLoginIP(v string) *UserUpsert { + u.Set(user.FieldLastLoginIP, v) + return u +} + +// UpdateLastLoginIP sets the "last_login_ip" field to the value that was provided on create. +func (u *UserUpsert) UpdateLastLoginIP() *UserUpsert { + u.SetExcluded(user.FieldLastLoginIP) + return u +} + +// ClearLastLoginIP clears the value of the "last_login_ip" field. +func (u *UserUpsert) ClearLastLoginIP() *UserUpsert { + u.SetNull(user.FieldLastLoginIP) + return u +} + +// UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. +// Using this option is equivalent to using: +// +// client.User.Create(). +// OnConflict( +// sql.ResolveWithNewValues(), +// sql.ResolveWith(func(u *sql.UpdateSet) { +// u.SetIgnore(user.FieldID) +// }), +// ). +// Exec(ctx) +func (u *UserUpsertOne) UpdateNewValues() *UserUpsertOne { + u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues()) + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) { + if _, exists := u.create.mutation.ID(); exists { + s.SetIgnore(user.FieldID) + } + if _, exists := u.create.mutation.CreateTime(); exists { + s.SetIgnore(user.FieldCreateTime) + } + if _, exists := u.create.mutation.Username(); exists { + s.SetIgnore(user.FieldUsername) + } + })) + return u +} + +// Ignore sets each column to itself in case of conflict. +// Using this option is equivalent to using: +// +// client.User.Create(). +// OnConflict(sql.ResolveWithIgnore()). +// Exec(ctx) +func (u *UserUpsertOne) Ignore() *UserUpsertOne { + u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore()) + return u +} + +// DoNothing configures the conflict_action to `DO NOTHING`. +// Supported only by SQLite and PostgreSQL. +func (u *UserUpsertOne) DoNothing() *UserUpsertOne { + u.create.conflict = append(u.create.conflict, sql.DoNothing()) + return u +} + +// Update allows overriding fields `UPDATE` values. See the UserCreate.OnConflict +// documentation for more info. +func (u *UserUpsertOne) Update(set func(*UserUpsert)) *UserUpsertOne { + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) { + set(&UserUpsert{UpdateSet: update}) + })) + return u +} + +// SetCreateBy sets the "create_by" field. +func (u *UserUpsertOne) SetCreateBy(v uint32) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.SetCreateBy(v) + }) +} + +// AddCreateBy adds v to the "create_by" field. +func (u *UserUpsertOne) AddCreateBy(v uint32) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.AddCreateBy(v) + }) +} + +// UpdateCreateBy sets the "create_by" field to the value that was provided on create. +func (u *UserUpsertOne) UpdateCreateBy() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.UpdateCreateBy() + }) +} + +// ClearCreateBy clears the value of the "create_by" field. +func (u *UserUpsertOne) ClearCreateBy() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.ClearCreateBy() + }) +} + +// SetUpdateTime sets the "update_time" field. +func (u *UserUpsertOne) SetUpdateTime(v time.Time) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.SetUpdateTime(v) + }) +} + +// UpdateUpdateTime sets the "update_time" field to the value that was provided on create. +func (u *UserUpsertOne) UpdateUpdateTime() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.UpdateUpdateTime() + }) +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (u *UserUpsertOne) ClearUpdateTime() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.ClearUpdateTime() + }) +} + +// SetDeleteTime sets the "delete_time" field. +func (u *UserUpsertOne) SetDeleteTime(v time.Time) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.SetDeleteTime(v) + }) +} + +// UpdateDeleteTime sets the "delete_time" field to the value that was provided on create. +func (u *UserUpsertOne) UpdateDeleteTime() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.UpdateDeleteTime() + }) +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (u *UserUpsertOne) ClearDeleteTime() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.ClearDeleteTime() + }) +} + +// SetStatus sets the "status" field. +func (u *UserUpsertOne) SetStatus(v user.Status) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.SetStatus(v) + }) +} + +// UpdateStatus sets the "status" field to the value that was provided on create. +func (u *UserUpsertOne) UpdateStatus() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.UpdateStatus() + }) +} + +// ClearStatus clears the value of the "status" field. +func (u *UserUpsertOne) ClearStatus() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.ClearStatus() + }) +} + +// SetPassword sets the "password" field. +func (u *UserUpsertOne) SetPassword(v string) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.SetPassword(v) + }) +} + +// UpdatePassword sets the "password" field to the value that was provided on create. +func (u *UserUpsertOne) UpdatePassword() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.UpdatePassword() + }) +} + +// ClearPassword clears the value of the "password" field. +func (u *UserUpsertOne) ClearPassword() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.ClearPassword() + }) +} + +// SetRoleID sets the "role_id" field. +func (u *UserUpsertOne) SetRoleID(v uint32) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.SetRoleID(v) + }) +} + +// AddRoleID adds v to the "role_id" field. +func (u *UserUpsertOne) AddRoleID(v uint32) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.AddRoleID(v) + }) +} + +// UpdateRoleID sets the "role_id" field to the value that was provided on create. +func (u *UserUpsertOne) UpdateRoleID() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.UpdateRoleID() + }) +} + +// ClearRoleID clears the value of the "role_id" field. +func (u *UserUpsertOne) ClearRoleID() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.ClearRoleID() + }) +} + +// SetOrgID sets the "org_id" field. +func (u *UserUpsertOne) SetOrgID(v uint32) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.SetOrgID(v) + }) +} + +// AddOrgID adds v to the "org_id" field. +func (u *UserUpsertOne) AddOrgID(v uint32) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.AddOrgID(v) + }) +} + +// UpdateOrgID sets the "org_id" field to the value that was provided on create. +func (u *UserUpsertOne) UpdateOrgID() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.UpdateOrgID() + }) +} + +// ClearOrgID clears the value of the "org_id" field. +func (u *UserUpsertOne) ClearOrgID() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.ClearOrgID() + }) +} + +// SetPositionID sets the "position_id" field. +func (u *UserUpsertOne) SetPositionID(v uint32) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.SetPositionID(v) + }) +} + +// AddPositionID adds v to the "position_id" field. +func (u *UserUpsertOne) AddPositionID(v uint32) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.AddPositionID(v) + }) +} + +// UpdatePositionID sets the "position_id" field to the value that was provided on create. +func (u *UserUpsertOne) UpdatePositionID() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.UpdatePositionID() + }) +} + +// ClearPositionID clears the value of the "position_id" field. +func (u *UserUpsertOne) ClearPositionID() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.ClearPositionID() + }) +} + +// SetWorkID sets the "work_id" field. +func (u *UserUpsertOne) SetWorkID(v uint32) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.SetWorkID(v) + }) +} + +// AddWorkID adds v to the "work_id" field. +func (u *UserUpsertOne) AddWorkID(v uint32) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.AddWorkID(v) + }) +} + +// UpdateWorkID sets the "work_id" field to the value that was provided on create. +func (u *UserUpsertOne) UpdateWorkID() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.UpdateWorkID() + }) +} + +// ClearWorkID clears the value of the "work_id" field. +func (u *UserUpsertOne) ClearWorkID() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.ClearWorkID() + }) +} + +// SetNickName sets the "nick_name" field. +func (u *UserUpsertOne) SetNickName(v string) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.SetNickName(v) + }) +} + +// UpdateNickName sets the "nick_name" field to the value that was provided on create. +func (u *UserUpsertOne) UpdateNickName() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.UpdateNickName() + }) +} + +// ClearNickName clears the value of the "nick_name" field. +func (u *UserUpsertOne) ClearNickName() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.ClearNickName() + }) +} + +// SetRealName sets the "real_name" field. +func (u *UserUpsertOne) SetRealName(v string) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.SetRealName(v) + }) +} + +// UpdateRealName sets the "real_name" field to the value that was provided on create. +func (u *UserUpsertOne) UpdateRealName() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.UpdateRealName() + }) +} + +// ClearRealName clears the value of the "real_name" field. +func (u *UserUpsertOne) ClearRealName() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.ClearRealName() + }) +} + +// SetEmail sets the "email" field. +func (u *UserUpsertOne) SetEmail(v string) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.SetEmail(v) + }) +} + +// UpdateEmail sets the "email" field to the value that was provided on create. +func (u *UserUpsertOne) UpdateEmail() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.UpdateEmail() + }) +} + +// ClearEmail clears the value of the "email" field. +func (u *UserUpsertOne) ClearEmail() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.ClearEmail() + }) +} + +// SetPhone sets the "phone" field. +func (u *UserUpsertOne) SetPhone(v string) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.SetPhone(v) + }) +} + +// UpdatePhone sets the "phone" field to the value that was provided on create. +func (u *UserUpsertOne) UpdatePhone() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.UpdatePhone() + }) +} + +// ClearPhone clears the value of the "phone" field. +func (u *UserUpsertOne) ClearPhone() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.ClearPhone() + }) +} + +// SetAvatar sets the "avatar" field. +func (u *UserUpsertOne) SetAvatar(v string) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.SetAvatar(v) + }) +} + +// UpdateAvatar sets the "avatar" field to the value that was provided on create. +func (u *UserUpsertOne) UpdateAvatar() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.UpdateAvatar() + }) +} + +// ClearAvatar clears the value of the "avatar" field. +func (u *UserUpsertOne) ClearAvatar() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.ClearAvatar() + }) +} + +// SetGender sets the "gender" field. +func (u *UserUpsertOne) SetGender(v user.Gender) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.SetGender(v) + }) +} + +// UpdateGender sets the "gender" field to the value that was provided on create. +func (u *UserUpsertOne) UpdateGender() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.UpdateGender() + }) +} + +// ClearGender clears the value of the "gender" field. +func (u *UserUpsertOne) ClearGender() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.ClearGender() + }) +} + +// SetAddress sets the "address" field. +func (u *UserUpsertOne) SetAddress(v string) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.SetAddress(v) + }) +} + +// UpdateAddress sets the "address" field to the value that was provided on create. +func (u *UserUpsertOne) UpdateAddress() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.UpdateAddress() + }) +} + +// ClearAddress clears the value of the "address" field. +func (u *UserUpsertOne) ClearAddress() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.ClearAddress() + }) +} + +// SetDescription sets the "description" field. +func (u *UserUpsertOne) SetDescription(v string) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.SetDescription(v) + }) +} + +// UpdateDescription sets the "description" field to the value that was provided on create. +func (u *UserUpsertOne) UpdateDescription() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.UpdateDescription() + }) +} + +// ClearDescription clears the value of the "description" field. +func (u *UserUpsertOne) ClearDescription() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.ClearDescription() + }) +} + +// SetAuthority sets the "authority" field. +func (u *UserUpsertOne) SetAuthority(v user.Authority) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.SetAuthority(v) + }) +} + +// UpdateAuthority sets the "authority" field to the value that was provided on create. +func (u *UserUpsertOne) UpdateAuthority() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.UpdateAuthority() + }) +} + +// ClearAuthority clears the value of the "authority" field. +func (u *UserUpsertOne) ClearAuthority() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.ClearAuthority() + }) +} + +// SetLastLoginTime sets the "last_login_time" field. +func (u *UserUpsertOne) SetLastLoginTime(v int64) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.SetLastLoginTime(v) + }) +} + +// AddLastLoginTime adds v to the "last_login_time" field. +func (u *UserUpsertOne) AddLastLoginTime(v int64) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.AddLastLoginTime(v) + }) +} + +// UpdateLastLoginTime sets the "last_login_time" field to the value that was provided on create. +func (u *UserUpsertOne) UpdateLastLoginTime() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.UpdateLastLoginTime() + }) +} + +// ClearLastLoginTime clears the value of the "last_login_time" field. +func (u *UserUpsertOne) ClearLastLoginTime() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.ClearLastLoginTime() + }) +} + +// SetLastLoginIP sets the "last_login_ip" field. +func (u *UserUpsertOne) SetLastLoginIP(v string) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.SetLastLoginIP(v) + }) +} + +// UpdateLastLoginIP sets the "last_login_ip" field to the value that was provided on create. +func (u *UserUpsertOne) UpdateLastLoginIP() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.UpdateLastLoginIP() + }) +} + +// ClearLastLoginIP clears the value of the "last_login_ip" field. +func (u *UserUpsertOne) ClearLastLoginIP() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.ClearLastLoginIP() + }) +} + +// Exec executes the query. +func (u *UserUpsertOne) Exec(ctx context.Context) error { + if len(u.create.conflict) == 0 { + return errors.New("ent: missing options for UserCreate.OnConflict") + } + return u.create.Exec(ctx) +} + +// ExecX is like Exec, but panics if an error occurs. +func (u *UserUpsertOne) ExecX(ctx context.Context) { + if err := u.create.Exec(ctx); err != nil { + panic(err) + } +} + +// Exec executes the UPSERT query and returns the inserted/updated ID. +func (u *UserUpsertOne) ID(ctx context.Context) (id uint32, err error) { + node, err := u.create.Save(ctx) + if err != nil { + return id, err + } + return node.ID, nil +} + +// IDX is like ID, but panics if an error occurs. +func (u *UserUpsertOne) IDX(ctx context.Context) uint32 { + id, err := u.ID(ctx) + if err != nil { + panic(err) + } + return id +} + +// UserCreateBulk is the builder for creating many User entities in bulk. +type UserCreateBulk struct { + config + err error + builders []*UserCreate + conflict []sql.ConflictOption +} + +// Save creates the User entities in the database. +func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { + if ucb.err != nil { + return nil, ucb.err + } + specs := make([]*sqlgraph.CreateSpec, len(ucb.builders)) + nodes := make([]*User, len(ucb.builders)) + mutators := make([]Mutator, len(ucb.builders)) + for i := range ucb.builders { + func(i int, root context.Context) { + builder := ucb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*UserMutation) + if !ok { + return nil, fmt.Errorf("unexpected mutation type %T", m) + } + if err := builder.check(); err != nil { + return nil, err + } + builder.mutation = mutation + var err error + nodes[i], specs[i] = builder.createSpec() + if i < len(mutators)-1 { + _, err = mutators[i+1].Mutate(root, ucb.builders[i+1].mutation) + } else { + spec := &sqlgraph.BatchCreateSpec{Nodes: specs} + spec.OnConflict = ucb.conflict + // Invoke the actual operation on the latest mutation in the chain. + if err = sqlgraph.BatchCreate(ctx, ucb.driver, spec); err != nil { + if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + } + } + if err != nil { + return nil, err + } + mutation.id = &nodes[i].ID + if specs[i].ID.Value != nil && nodes[i].ID == 0 { + id := specs[i].ID.Value.(int64) + nodes[i].ID = uint32(id) + } + mutation.done = true + return nodes[i], nil + }) + for i := len(builder.hooks) - 1; i >= 0; i-- { + mut = builder.hooks[i](mut) + } + mutators[i] = mut + }(i, ctx) + } + if len(mutators) > 0 { + if _, err := mutators[0].Mutate(ctx, ucb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User { + v, err := ucb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ucb *UserCreateBulk) Exec(ctx context.Context) error { + _, err := ucb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ucb *UserCreateBulk) ExecX(ctx context.Context) { + if err := ucb.Exec(ctx); err != nil { + panic(err) + } +} + +// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause +// of the `INSERT` statement. For example: +// +// client.User.CreateBulk(builders...). +// OnConflict( +// // Update the row with the new values +// // the was proposed for insertion. +// sql.ResolveWithNewValues(), +// ). +// // Override some of the fields with custom +// // update values. +// Update(func(u *ent.UserUpsert) { +// SetCreateBy(v+v). +// }). +// Exec(ctx) +func (ucb *UserCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserUpsertBulk { + ucb.conflict = opts + return &UserUpsertBulk{ + create: ucb, + } +} + +// OnConflictColumns calls `OnConflict` and configures the columns +// as conflict target. Using this option is equivalent to using: +// +// client.User.Create(). +// OnConflict(sql.ConflictColumns(columns...)). +// Exec(ctx) +func (ucb *UserCreateBulk) OnConflictColumns(columns ...string) *UserUpsertBulk { + ucb.conflict = append(ucb.conflict, sql.ConflictColumns(columns...)) + return &UserUpsertBulk{ + create: ucb, + } +} + +// UserUpsertBulk is the builder for "upsert"-ing +// a bulk of User nodes. +type UserUpsertBulk struct { + create *UserCreateBulk +} + +// UpdateNewValues updates the mutable fields using the new values that +// were set on create. Using this option is equivalent to using: +// +// client.User.Create(). +// OnConflict( +// sql.ResolveWithNewValues(), +// sql.ResolveWith(func(u *sql.UpdateSet) { +// u.SetIgnore(user.FieldID) +// }), +// ). +// Exec(ctx) +func (u *UserUpsertBulk) UpdateNewValues() *UserUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues()) + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) { + for _, b := range u.create.builders { + if _, exists := b.mutation.ID(); exists { + s.SetIgnore(user.FieldID) + } + if _, exists := b.mutation.CreateTime(); exists { + s.SetIgnore(user.FieldCreateTime) + } + if _, exists := b.mutation.Username(); exists { + s.SetIgnore(user.FieldUsername) + } + } + })) + return u +} + +// Ignore sets each column to itself in case of conflict. +// Using this option is equivalent to using: +// +// client.User.Create(). +// OnConflict(sql.ResolveWithIgnore()). +// Exec(ctx) +func (u *UserUpsertBulk) Ignore() *UserUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore()) + return u +} + +// DoNothing configures the conflict_action to `DO NOTHING`. +// Supported only by SQLite and PostgreSQL. +func (u *UserUpsertBulk) DoNothing() *UserUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.DoNothing()) + return u +} + +// Update allows overriding fields `UPDATE` values. See the UserCreateBulk.OnConflict +// documentation for more info. +func (u *UserUpsertBulk) Update(set func(*UserUpsert)) *UserUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) { + set(&UserUpsert{UpdateSet: update}) + })) + return u +} + +// SetCreateBy sets the "create_by" field. +func (u *UserUpsertBulk) SetCreateBy(v uint32) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.SetCreateBy(v) + }) +} + +// AddCreateBy adds v to the "create_by" field. +func (u *UserUpsertBulk) AddCreateBy(v uint32) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.AddCreateBy(v) + }) +} + +// UpdateCreateBy sets the "create_by" field to the value that was provided on create. +func (u *UserUpsertBulk) UpdateCreateBy() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.UpdateCreateBy() + }) +} + +// ClearCreateBy clears the value of the "create_by" field. +func (u *UserUpsertBulk) ClearCreateBy() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.ClearCreateBy() + }) +} + +// SetUpdateTime sets the "update_time" field. +func (u *UserUpsertBulk) SetUpdateTime(v time.Time) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.SetUpdateTime(v) + }) +} + +// UpdateUpdateTime sets the "update_time" field to the value that was provided on create. +func (u *UserUpsertBulk) UpdateUpdateTime() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.UpdateUpdateTime() + }) +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (u *UserUpsertBulk) ClearUpdateTime() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.ClearUpdateTime() + }) +} + +// SetDeleteTime sets the "delete_time" field. +func (u *UserUpsertBulk) SetDeleteTime(v time.Time) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.SetDeleteTime(v) + }) +} + +// UpdateDeleteTime sets the "delete_time" field to the value that was provided on create. +func (u *UserUpsertBulk) UpdateDeleteTime() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.UpdateDeleteTime() + }) +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (u *UserUpsertBulk) ClearDeleteTime() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.ClearDeleteTime() + }) +} + +// SetStatus sets the "status" field. +func (u *UserUpsertBulk) SetStatus(v user.Status) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.SetStatus(v) + }) +} + +// UpdateStatus sets the "status" field to the value that was provided on create. +func (u *UserUpsertBulk) UpdateStatus() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.UpdateStatus() + }) +} + +// ClearStatus clears the value of the "status" field. +func (u *UserUpsertBulk) ClearStatus() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.ClearStatus() + }) +} + +// SetPassword sets the "password" field. +func (u *UserUpsertBulk) SetPassword(v string) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.SetPassword(v) + }) +} + +// UpdatePassword sets the "password" field to the value that was provided on create. +func (u *UserUpsertBulk) UpdatePassword() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.UpdatePassword() + }) +} + +// ClearPassword clears the value of the "password" field. +func (u *UserUpsertBulk) ClearPassword() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.ClearPassword() + }) +} + +// SetRoleID sets the "role_id" field. +func (u *UserUpsertBulk) SetRoleID(v uint32) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.SetRoleID(v) + }) +} + +// AddRoleID adds v to the "role_id" field. +func (u *UserUpsertBulk) AddRoleID(v uint32) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.AddRoleID(v) + }) +} + +// UpdateRoleID sets the "role_id" field to the value that was provided on create. +func (u *UserUpsertBulk) UpdateRoleID() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.UpdateRoleID() + }) +} + +// ClearRoleID clears the value of the "role_id" field. +func (u *UserUpsertBulk) ClearRoleID() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.ClearRoleID() + }) +} + +// SetOrgID sets the "org_id" field. +func (u *UserUpsertBulk) SetOrgID(v uint32) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.SetOrgID(v) + }) +} + +// AddOrgID adds v to the "org_id" field. +func (u *UserUpsertBulk) AddOrgID(v uint32) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.AddOrgID(v) + }) +} + +// UpdateOrgID sets the "org_id" field to the value that was provided on create. +func (u *UserUpsertBulk) UpdateOrgID() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.UpdateOrgID() + }) +} + +// ClearOrgID clears the value of the "org_id" field. +func (u *UserUpsertBulk) ClearOrgID() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.ClearOrgID() + }) +} + +// SetPositionID sets the "position_id" field. +func (u *UserUpsertBulk) SetPositionID(v uint32) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.SetPositionID(v) + }) +} + +// AddPositionID adds v to the "position_id" field. +func (u *UserUpsertBulk) AddPositionID(v uint32) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.AddPositionID(v) + }) +} + +// UpdatePositionID sets the "position_id" field to the value that was provided on create. +func (u *UserUpsertBulk) UpdatePositionID() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.UpdatePositionID() + }) +} + +// ClearPositionID clears the value of the "position_id" field. +func (u *UserUpsertBulk) ClearPositionID() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.ClearPositionID() + }) +} + +// SetWorkID sets the "work_id" field. +func (u *UserUpsertBulk) SetWorkID(v uint32) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.SetWorkID(v) + }) +} + +// AddWorkID adds v to the "work_id" field. +func (u *UserUpsertBulk) AddWorkID(v uint32) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.AddWorkID(v) + }) +} + +// UpdateWorkID sets the "work_id" field to the value that was provided on create. +func (u *UserUpsertBulk) UpdateWorkID() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.UpdateWorkID() + }) +} + +// ClearWorkID clears the value of the "work_id" field. +func (u *UserUpsertBulk) ClearWorkID() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.ClearWorkID() + }) +} + +// SetNickName sets the "nick_name" field. +func (u *UserUpsertBulk) SetNickName(v string) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.SetNickName(v) + }) +} + +// UpdateNickName sets the "nick_name" field to the value that was provided on create. +func (u *UserUpsertBulk) UpdateNickName() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.UpdateNickName() + }) +} + +// ClearNickName clears the value of the "nick_name" field. +func (u *UserUpsertBulk) ClearNickName() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.ClearNickName() + }) +} + +// SetRealName sets the "real_name" field. +func (u *UserUpsertBulk) SetRealName(v string) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.SetRealName(v) + }) +} + +// UpdateRealName sets the "real_name" field to the value that was provided on create. +func (u *UserUpsertBulk) UpdateRealName() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.UpdateRealName() + }) +} + +// ClearRealName clears the value of the "real_name" field. +func (u *UserUpsertBulk) ClearRealName() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.ClearRealName() + }) +} + +// SetEmail sets the "email" field. +func (u *UserUpsertBulk) SetEmail(v string) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.SetEmail(v) + }) +} + +// UpdateEmail sets the "email" field to the value that was provided on create. +func (u *UserUpsertBulk) UpdateEmail() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.UpdateEmail() + }) +} + +// ClearEmail clears the value of the "email" field. +func (u *UserUpsertBulk) ClearEmail() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.ClearEmail() + }) +} + +// SetPhone sets the "phone" field. +func (u *UserUpsertBulk) SetPhone(v string) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.SetPhone(v) + }) +} + +// UpdatePhone sets the "phone" field to the value that was provided on create. +func (u *UserUpsertBulk) UpdatePhone() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.UpdatePhone() + }) +} + +// ClearPhone clears the value of the "phone" field. +func (u *UserUpsertBulk) ClearPhone() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.ClearPhone() + }) +} + +// SetAvatar sets the "avatar" field. +func (u *UserUpsertBulk) SetAvatar(v string) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.SetAvatar(v) + }) +} + +// UpdateAvatar sets the "avatar" field to the value that was provided on create. +func (u *UserUpsertBulk) UpdateAvatar() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.UpdateAvatar() + }) +} + +// ClearAvatar clears the value of the "avatar" field. +func (u *UserUpsertBulk) ClearAvatar() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.ClearAvatar() + }) +} + +// SetGender sets the "gender" field. +func (u *UserUpsertBulk) SetGender(v user.Gender) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.SetGender(v) + }) +} + +// UpdateGender sets the "gender" field to the value that was provided on create. +func (u *UserUpsertBulk) UpdateGender() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.UpdateGender() + }) +} + +// ClearGender clears the value of the "gender" field. +func (u *UserUpsertBulk) ClearGender() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.ClearGender() + }) +} + +// SetAddress sets the "address" field. +func (u *UserUpsertBulk) SetAddress(v string) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.SetAddress(v) + }) +} + +// UpdateAddress sets the "address" field to the value that was provided on create. +func (u *UserUpsertBulk) UpdateAddress() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.UpdateAddress() + }) +} + +// ClearAddress clears the value of the "address" field. +func (u *UserUpsertBulk) ClearAddress() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.ClearAddress() + }) +} + +// SetDescription sets the "description" field. +func (u *UserUpsertBulk) SetDescription(v string) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.SetDescription(v) + }) +} + +// UpdateDescription sets the "description" field to the value that was provided on create. +func (u *UserUpsertBulk) UpdateDescription() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.UpdateDescription() + }) +} + +// ClearDescription clears the value of the "description" field. +func (u *UserUpsertBulk) ClearDescription() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.ClearDescription() + }) +} + +// SetAuthority sets the "authority" field. +func (u *UserUpsertBulk) SetAuthority(v user.Authority) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.SetAuthority(v) + }) +} + +// UpdateAuthority sets the "authority" field to the value that was provided on create. +func (u *UserUpsertBulk) UpdateAuthority() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.UpdateAuthority() + }) +} + +// ClearAuthority clears the value of the "authority" field. +func (u *UserUpsertBulk) ClearAuthority() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.ClearAuthority() + }) +} + +// SetLastLoginTime sets the "last_login_time" field. +func (u *UserUpsertBulk) SetLastLoginTime(v int64) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.SetLastLoginTime(v) + }) +} + +// AddLastLoginTime adds v to the "last_login_time" field. +func (u *UserUpsertBulk) AddLastLoginTime(v int64) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.AddLastLoginTime(v) + }) +} + +// UpdateLastLoginTime sets the "last_login_time" field to the value that was provided on create. +func (u *UserUpsertBulk) UpdateLastLoginTime() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.UpdateLastLoginTime() + }) +} + +// ClearLastLoginTime clears the value of the "last_login_time" field. +func (u *UserUpsertBulk) ClearLastLoginTime() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.ClearLastLoginTime() + }) +} + +// SetLastLoginIP sets the "last_login_ip" field. +func (u *UserUpsertBulk) SetLastLoginIP(v string) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.SetLastLoginIP(v) + }) +} + +// UpdateLastLoginIP sets the "last_login_ip" field to the value that was provided on create. +func (u *UserUpsertBulk) UpdateLastLoginIP() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.UpdateLastLoginIP() + }) +} + +// ClearLastLoginIP clears the value of the "last_login_ip" field. +func (u *UserUpsertBulk) ClearLastLoginIP() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.ClearLastLoginIP() + }) +} + +// Exec executes the query. +func (u *UserUpsertBulk) Exec(ctx context.Context) error { + if u.create.err != nil { + return u.create.err + } + for i, b := range u.create.builders { + if len(b.conflict) != 0 { + return fmt.Errorf("ent: OnConflict was set for builder %d. Set it on the UserCreateBulk instead", i) + } + } + if len(u.create.conflict) == 0 { + return errors.New("ent: missing options for UserCreateBulk.OnConflict") + } + return u.create.Exec(ctx) +} + +// ExecX is like Exec, but panics if an error occurs. +func (u *UserUpsertBulk) ExecX(ctx context.Context) { + if err := u.create.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/user_delete.go b/monolithic/backend/app/admin/service/internal/data/ent/user_delete.go new file mode 100644 index 0000000..b41a9ea --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/user_delete.go @@ -0,0 +1,88 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/user" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// UserDelete is the builder for deleting a User entity. +type UserDelete struct { + config + hooks []Hook + mutation *UserMutation +} + +// Where appends a list predicates to the UserDelete builder. +func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete { + ud.mutation.Where(ps...) + return ud +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (ud *UserDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, ud.sqlExec, ud.mutation, ud.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (ud *UserDelete) ExecX(ctx context.Context) int { + n, err := ud.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (ud *UserDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(user.Table, sqlgraph.NewFieldSpec(user.FieldID, field.TypeUint32)) + if ps := ud.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, ud.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + ud.mutation.done = true + return affected, err +} + +// UserDeleteOne is the builder for deleting a single User entity. +type UserDeleteOne struct { + ud *UserDelete +} + +// Where appends a list predicates to the UserDelete builder. +func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne { + udo.ud.mutation.Where(ps...) + return udo +} + +// Exec executes the deletion query. +func (udo *UserDeleteOne) Exec(ctx context.Context) error { + n, err := udo.ud.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{user.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (udo *UserDeleteOne) ExecX(ctx context.Context) { + if err := udo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/user_query.go b/monolithic/backend/app/admin/service/internal/data/ent/user_query.go new file mode 100644 index 0000000..ba271ea --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/user_query.go @@ -0,0 +1,548 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/user" + "math" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// UserQuery is the builder for querying User entities. +type UserQuery struct { + config + ctx *QueryContext + order []user.OrderOption + inters []Interceptor + predicates []predicate.User + modifiers []func(*sql.Selector) + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the UserQuery builder. +func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery { + uq.predicates = append(uq.predicates, ps...) + return uq +} + +// Limit the number of records to be returned by this query. +func (uq *UserQuery) Limit(limit int) *UserQuery { + uq.ctx.Limit = &limit + return uq +} + +// Offset to start from. +func (uq *UserQuery) Offset(offset int) *UserQuery { + uq.ctx.Offset = &offset + return uq +} + +// Unique configures the query builder to filter duplicate records on query. +// By default, unique is set to true, and can be disabled using this method. +func (uq *UserQuery) Unique(unique bool) *UserQuery { + uq.ctx.Unique = &unique + return uq +} + +// Order specifies how the records should be ordered. +func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery { + uq.order = append(uq.order, o...) + return uq +} + +// First returns the first User entity from the query. +// Returns a *NotFoundError when no User was found. +func (uq *UserQuery) First(ctx context.Context) (*User, error) { + nodes, err := uq.Limit(1).All(setContextOp(ctx, uq.ctx, "First")) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{user.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (uq *UserQuery) FirstX(ctx context.Context) *User { + node, err := uq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first User ID from the query. +// Returns a *NotFoundError when no User ID was found. +func (uq *UserQuery) FirstID(ctx context.Context) (id uint32, err error) { + var ids []uint32 + if ids, err = uq.Limit(1).IDs(setContextOp(ctx, uq.ctx, "FirstID")); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{user.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (uq *UserQuery) FirstIDX(ctx context.Context) uint32 { + id, err := uq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single User entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one User entity is found. +// Returns a *NotFoundError when no User entities are found. +func (uq *UserQuery) Only(ctx context.Context) (*User, error) { + nodes, err := uq.Limit(2).All(setContextOp(ctx, uq.ctx, "Only")) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{user.Label} + default: + return nil, &NotSingularError{user.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (uq *UserQuery) OnlyX(ctx context.Context) *User { + node, err := uq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only User ID in the query. +// Returns a *NotSingularError when more than one User ID is found. +// Returns a *NotFoundError when no entities are found. +func (uq *UserQuery) OnlyID(ctx context.Context) (id uint32, err error) { + var ids []uint32 + if ids, err = uq.Limit(2).IDs(setContextOp(ctx, uq.ctx, "OnlyID")); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{user.Label} + default: + err = &NotSingularError{user.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (uq *UserQuery) OnlyIDX(ctx context.Context) uint32 { + id, err := uq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of Users. +func (uq *UserQuery) All(ctx context.Context) ([]*User, error) { + ctx = setContextOp(ctx, uq.ctx, "All") + if err := uq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*User, *UserQuery]() + return withInterceptors[[]*User](ctx, uq, qr, uq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (uq *UserQuery) AllX(ctx context.Context) []*User { + nodes, err := uq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of User IDs. +func (uq *UserQuery) IDs(ctx context.Context) (ids []uint32, err error) { + if uq.ctx.Unique == nil && uq.path != nil { + uq.Unique(true) + } + ctx = setContextOp(ctx, uq.ctx, "IDs") + if err = uq.Select(user.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (uq *UserQuery) IDsX(ctx context.Context) []uint32 { + ids, err := uq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (uq *UserQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, uq.ctx, "Count") + if err := uq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, uq, querierCount[*UserQuery](), uq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (uq *UserQuery) CountX(ctx context.Context) int { + count, err := uq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (uq *UserQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, uq.ctx, "Exist") + switch _, err := uq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("ent: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (uq *UserQuery) ExistX(ctx context.Context) bool { + exist, err := uq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (uq *UserQuery) Clone() *UserQuery { + if uq == nil { + return nil + } + return &UserQuery{ + config: uq.config, + ctx: uq.ctx.Clone(), + order: append([]user.OrderOption{}, uq.order...), + inters: append([]Interceptor{}, uq.inters...), + predicates: append([]predicate.User{}, uq.predicates...), + // clone intermediate query. + sql: uq.sql.Clone(), + path: uq.path, + } +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreateBy uint32 `json:"create_by,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.User.Query(). +// GroupBy(user.FieldCreateBy). +// Aggregate(ent.Count()). +// Scan(ctx, &v) +func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy { + uq.ctx.Fields = append([]string{field}, fields...) + grbuild := &UserGroupBy{build: uq} + grbuild.flds = &uq.ctx.Fields + grbuild.label = user.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreateBy uint32 `json:"create_by,omitempty"` +// } +// +// client.User.Query(). +// Select(user.FieldCreateBy). +// Scan(ctx, &v) +func (uq *UserQuery) Select(fields ...string) *UserSelect { + uq.ctx.Fields = append(uq.ctx.Fields, fields...) + sbuild := &UserSelect{UserQuery: uq} + sbuild.label = user.Label + sbuild.flds, sbuild.scan = &uq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a UserSelect configured with the given aggregations. +func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect { + return uq.Select().Aggregate(fns...) +} + +func (uq *UserQuery) prepareQuery(ctx context.Context) error { + for _, inter := range uq.inters { + if inter == nil { + return fmt.Errorf("ent: uninitialized interceptor (forgotten import ent/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, uq); err != nil { + return err + } + } + } + for _, f := range uq.ctx.Fields { + if !user.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)} + } + } + if uq.path != nil { + prev, err := uq.path(ctx) + if err != nil { + return err + } + uq.sql = prev + } + return nil +} + +func (uq *UserQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*User, error) { + var ( + nodes = []*User{} + _spec = uq.querySpec() + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*User).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &User{config: uq.config} + nodes = append(nodes, node) + return node.assignValues(columns, values) + } + if len(uq.modifiers) > 0 { + _spec.Modifiers = uq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, uq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + return nodes, nil +} + +func (uq *UserQuery) sqlCount(ctx context.Context) (int, error) { + _spec := uq.querySpec() + if len(uq.modifiers) > 0 { + _spec.Modifiers = uq.modifiers + } + _spec.Node.Columns = uq.ctx.Fields + if len(uq.ctx.Fields) > 0 { + _spec.Unique = uq.ctx.Unique != nil && *uq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, uq.driver, _spec) +} + +func (uq *UserQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(user.Table, user.Columns, sqlgraph.NewFieldSpec(user.FieldID, field.TypeUint32)) + _spec.From = uq.sql + if unique := uq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if uq.path != nil { + _spec.Unique = true + } + if fields := uq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, user.FieldID) + for i := range fields { + if fields[i] != user.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := uq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := uq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := uq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := uq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (uq *UserQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(uq.driver.Dialect()) + t1 := builder.Table(user.Table) + columns := uq.ctx.Fields + if len(columns) == 0 { + columns = user.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if uq.sql != nil { + selector = uq.sql + selector.Select(selector.Columns(columns...)...) + } + if uq.ctx.Unique != nil && *uq.ctx.Unique { + selector.Distinct() + } + for _, m := range uq.modifiers { + m(selector) + } + for _, p := range uq.predicates { + p(selector) + } + for _, p := range uq.order { + p(selector) + } + if offset := uq.ctx.Offset; offset != nil { + // limit is mandatory for offset clause. We start + // with default value, and override it below if needed. + selector.Offset(*offset).Limit(math.MaxInt32) + } + if limit := uq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// Modify adds a query modifier for attaching custom logic to queries. +func (uq *UserQuery) Modify(modifiers ...func(s *sql.Selector)) *UserSelect { + uq.modifiers = append(uq.modifiers, modifiers...) + return uq.Select() +} + +// UserGroupBy is the group-by builder for User entities. +type UserGroupBy struct { + selector + build *UserQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy { + ugb.fns = append(ugb.fns, fns...) + return ugb +} + +// Scan applies the selector query and scans the result into the given value. +func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ugb.build.ctx, "GroupBy") + if err := ugb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*UserQuery, *UserGroupBy](ctx, ugb.build, ugb, ugb.build.inters, v) +} + +func (ugb *UserGroupBy) sqlScan(ctx context.Context, root *UserQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(ugb.fns)) + for _, fn := range ugb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*ugb.flds)+len(ugb.fns)) + for _, f := range *ugb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*ugb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := ugb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// UserSelect is the builder for selecting fields of User entities. +type UserSelect struct { + *UserQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect { + us.fns = append(us.fns, fns...) + return us +} + +// Scan applies the selector query and scans the result into the given value. +func (us *UserSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, us.ctx, "Select") + if err := us.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*UserQuery, *UserSelect](ctx, us.UserQuery, us, us.inters, v) +} + +func (us *UserSelect) sqlScan(ctx context.Context, root *UserQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(us.fns)) + for _, fn := range us.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*us.selector.flds); { + case n == 0 && len(aggregation) > 0: + selector.Select(aggregation...) + case n != 0 && len(aggregation) > 0: + selector.AppendSelect(aggregation...) + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := us.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// Modify adds a query modifier for attaching custom logic to queries. +func (us *UserSelect) Modify(modifiers ...func(s *sql.Selector)) *UserSelect { + us.modifiers = append(us.modifiers, modifiers...) + return us +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent/user_update.go b/monolithic/backend/app/admin/service/internal/data/ent/user_update.go new file mode 100644 index 0000000..e176c6c --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent/user_update.go @@ -0,0 +1,1500 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "errors" + "fmt" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/predicate" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/user" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// UserUpdate is the builder for updating User entities. +type UserUpdate struct { + config + hooks []Hook + mutation *UserMutation + modifiers []func(*sql.UpdateBuilder) +} + +// Where appends a list predicates to the UserUpdate builder. +func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate { + uu.mutation.Where(ps...) + return uu +} + +// SetCreateBy sets the "create_by" field. +func (uu *UserUpdate) SetCreateBy(u uint32) *UserUpdate { + uu.mutation.ResetCreateBy() + uu.mutation.SetCreateBy(u) + return uu +} + +// SetNillableCreateBy sets the "create_by" field if the given value is not nil. +func (uu *UserUpdate) SetNillableCreateBy(u *uint32) *UserUpdate { + if u != nil { + uu.SetCreateBy(*u) + } + return uu +} + +// AddCreateBy adds u to the "create_by" field. +func (uu *UserUpdate) AddCreateBy(u int32) *UserUpdate { + uu.mutation.AddCreateBy(u) + return uu +} + +// ClearCreateBy clears the value of the "create_by" field. +func (uu *UserUpdate) ClearCreateBy() *UserUpdate { + uu.mutation.ClearCreateBy() + return uu +} + +// SetUpdateTime sets the "update_time" field. +func (uu *UserUpdate) SetUpdateTime(t time.Time) *UserUpdate { + uu.mutation.SetUpdateTime(t) + return uu +} + +// SetNillableUpdateTime sets the "update_time" field if the given value is not nil. +func (uu *UserUpdate) SetNillableUpdateTime(t *time.Time) *UserUpdate { + if t != nil { + uu.SetUpdateTime(*t) + } + return uu +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (uu *UserUpdate) ClearUpdateTime() *UserUpdate { + uu.mutation.ClearUpdateTime() + return uu +} + +// SetDeleteTime sets the "delete_time" field. +func (uu *UserUpdate) SetDeleteTime(t time.Time) *UserUpdate { + uu.mutation.SetDeleteTime(t) + return uu +} + +// SetNillableDeleteTime sets the "delete_time" field if the given value is not nil. +func (uu *UserUpdate) SetNillableDeleteTime(t *time.Time) *UserUpdate { + if t != nil { + uu.SetDeleteTime(*t) + } + return uu +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (uu *UserUpdate) ClearDeleteTime() *UserUpdate { + uu.mutation.ClearDeleteTime() + return uu +} + +// SetStatus sets the "status" field. +func (uu *UserUpdate) SetStatus(u user.Status) *UserUpdate { + uu.mutation.SetStatus(u) + return uu +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (uu *UserUpdate) SetNillableStatus(u *user.Status) *UserUpdate { + if u != nil { + uu.SetStatus(*u) + } + return uu +} + +// ClearStatus clears the value of the "status" field. +func (uu *UserUpdate) ClearStatus() *UserUpdate { + uu.mutation.ClearStatus() + return uu +} + +// SetPassword sets the "password" field. +func (uu *UserUpdate) SetPassword(s string) *UserUpdate { + uu.mutation.SetPassword(s) + return uu +} + +// SetNillablePassword sets the "password" field if the given value is not nil. +func (uu *UserUpdate) SetNillablePassword(s *string) *UserUpdate { + if s != nil { + uu.SetPassword(*s) + } + return uu +} + +// ClearPassword clears the value of the "password" field. +func (uu *UserUpdate) ClearPassword() *UserUpdate { + uu.mutation.ClearPassword() + return uu +} + +// SetRoleID sets the "role_id" field. +func (uu *UserUpdate) SetRoleID(u uint32) *UserUpdate { + uu.mutation.ResetRoleID() + uu.mutation.SetRoleID(u) + return uu +} + +// SetNillableRoleID sets the "role_id" field if the given value is not nil. +func (uu *UserUpdate) SetNillableRoleID(u *uint32) *UserUpdate { + if u != nil { + uu.SetRoleID(*u) + } + return uu +} + +// AddRoleID adds u to the "role_id" field. +func (uu *UserUpdate) AddRoleID(u int32) *UserUpdate { + uu.mutation.AddRoleID(u) + return uu +} + +// ClearRoleID clears the value of the "role_id" field. +func (uu *UserUpdate) ClearRoleID() *UserUpdate { + uu.mutation.ClearRoleID() + return uu +} + +// SetOrgID sets the "org_id" field. +func (uu *UserUpdate) SetOrgID(u uint32) *UserUpdate { + uu.mutation.ResetOrgID() + uu.mutation.SetOrgID(u) + return uu +} + +// SetNillableOrgID sets the "org_id" field if the given value is not nil. +func (uu *UserUpdate) SetNillableOrgID(u *uint32) *UserUpdate { + if u != nil { + uu.SetOrgID(*u) + } + return uu +} + +// AddOrgID adds u to the "org_id" field. +func (uu *UserUpdate) AddOrgID(u int32) *UserUpdate { + uu.mutation.AddOrgID(u) + return uu +} + +// ClearOrgID clears the value of the "org_id" field. +func (uu *UserUpdate) ClearOrgID() *UserUpdate { + uu.mutation.ClearOrgID() + return uu +} + +// SetPositionID sets the "position_id" field. +func (uu *UserUpdate) SetPositionID(u uint32) *UserUpdate { + uu.mutation.ResetPositionID() + uu.mutation.SetPositionID(u) + return uu +} + +// SetNillablePositionID sets the "position_id" field if the given value is not nil. +func (uu *UserUpdate) SetNillablePositionID(u *uint32) *UserUpdate { + if u != nil { + uu.SetPositionID(*u) + } + return uu +} + +// AddPositionID adds u to the "position_id" field. +func (uu *UserUpdate) AddPositionID(u int32) *UserUpdate { + uu.mutation.AddPositionID(u) + return uu +} + +// ClearPositionID clears the value of the "position_id" field. +func (uu *UserUpdate) ClearPositionID() *UserUpdate { + uu.mutation.ClearPositionID() + return uu +} + +// SetWorkID sets the "work_id" field. +func (uu *UserUpdate) SetWorkID(u uint32) *UserUpdate { + uu.mutation.ResetWorkID() + uu.mutation.SetWorkID(u) + return uu +} + +// SetNillableWorkID sets the "work_id" field if the given value is not nil. +func (uu *UserUpdate) SetNillableWorkID(u *uint32) *UserUpdate { + if u != nil { + uu.SetWorkID(*u) + } + return uu +} + +// AddWorkID adds u to the "work_id" field. +func (uu *UserUpdate) AddWorkID(u int32) *UserUpdate { + uu.mutation.AddWorkID(u) + return uu +} + +// ClearWorkID clears the value of the "work_id" field. +func (uu *UserUpdate) ClearWorkID() *UserUpdate { + uu.mutation.ClearWorkID() + return uu +} + +// SetNickName sets the "nick_name" field. +func (uu *UserUpdate) SetNickName(s string) *UserUpdate { + uu.mutation.SetNickName(s) + return uu +} + +// SetNillableNickName sets the "nick_name" field if the given value is not nil. +func (uu *UserUpdate) SetNillableNickName(s *string) *UserUpdate { + if s != nil { + uu.SetNickName(*s) + } + return uu +} + +// ClearNickName clears the value of the "nick_name" field. +func (uu *UserUpdate) ClearNickName() *UserUpdate { + uu.mutation.ClearNickName() + return uu +} + +// SetRealName sets the "real_name" field. +func (uu *UserUpdate) SetRealName(s string) *UserUpdate { + uu.mutation.SetRealName(s) + return uu +} + +// SetNillableRealName sets the "real_name" field if the given value is not nil. +func (uu *UserUpdate) SetNillableRealName(s *string) *UserUpdate { + if s != nil { + uu.SetRealName(*s) + } + return uu +} + +// ClearRealName clears the value of the "real_name" field. +func (uu *UserUpdate) ClearRealName() *UserUpdate { + uu.mutation.ClearRealName() + return uu +} + +// SetEmail sets the "email" field. +func (uu *UserUpdate) SetEmail(s string) *UserUpdate { + uu.mutation.SetEmail(s) + return uu +} + +// SetNillableEmail sets the "email" field if the given value is not nil. +func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate { + if s != nil { + uu.SetEmail(*s) + } + return uu +} + +// ClearEmail clears the value of the "email" field. +func (uu *UserUpdate) ClearEmail() *UserUpdate { + uu.mutation.ClearEmail() + return uu +} + +// SetPhone sets the "phone" field. +func (uu *UserUpdate) SetPhone(s string) *UserUpdate { + uu.mutation.SetPhone(s) + return uu +} + +// SetNillablePhone sets the "phone" field if the given value is not nil. +func (uu *UserUpdate) SetNillablePhone(s *string) *UserUpdate { + if s != nil { + uu.SetPhone(*s) + } + return uu +} + +// ClearPhone clears the value of the "phone" field. +func (uu *UserUpdate) ClearPhone() *UserUpdate { + uu.mutation.ClearPhone() + return uu +} + +// SetAvatar sets the "avatar" field. +func (uu *UserUpdate) SetAvatar(s string) *UserUpdate { + uu.mutation.SetAvatar(s) + return uu +} + +// SetNillableAvatar sets the "avatar" field if the given value is not nil. +func (uu *UserUpdate) SetNillableAvatar(s *string) *UserUpdate { + if s != nil { + uu.SetAvatar(*s) + } + return uu +} + +// ClearAvatar clears the value of the "avatar" field. +func (uu *UserUpdate) ClearAvatar() *UserUpdate { + uu.mutation.ClearAvatar() + return uu +} + +// SetGender sets the "gender" field. +func (uu *UserUpdate) SetGender(u user.Gender) *UserUpdate { + uu.mutation.SetGender(u) + return uu +} + +// SetNillableGender sets the "gender" field if the given value is not nil. +func (uu *UserUpdate) SetNillableGender(u *user.Gender) *UserUpdate { + if u != nil { + uu.SetGender(*u) + } + return uu +} + +// ClearGender clears the value of the "gender" field. +func (uu *UserUpdate) ClearGender() *UserUpdate { + uu.mutation.ClearGender() + return uu +} + +// SetAddress sets the "address" field. +func (uu *UserUpdate) SetAddress(s string) *UserUpdate { + uu.mutation.SetAddress(s) + return uu +} + +// SetNillableAddress sets the "address" field if the given value is not nil. +func (uu *UserUpdate) SetNillableAddress(s *string) *UserUpdate { + if s != nil { + uu.SetAddress(*s) + } + return uu +} + +// ClearAddress clears the value of the "address" field. +func (uu *UserUpdate) ClearAddress() *UserUpdate { + uu.mutation.ClearAddress() + return uu +} + +// SetDescription sets the "description" field. +func (uu *UserUpdate) SetDescription(s string) *UserUpdate { + uu.mutation.SetDescription(s) + return uu +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (uu *UserUpdate) SetNillableDescription(s *string) *UserUpdate { + if s != nil { + uu.SetDescription(*s) + } + return uu +} + +// ClearDescription clears the value of the "description" field. +func (uu *UserUpdate) ClearDescription() *UserUpdate { + uu.mutation.ClearDescription() + return uu +} + +// SetAuthority sets the "authority" field. +func (uu *UserUpdate) SetAuthority(u user.Authority) *UserUpdate { + uu.mutation.SetAuthority(u) + return uu +} + +// SetNillableAuthority sets the "authority" field if the given value is not nil. +func (uu *UserUpdate) SetNillableAuthority(u *user.Authority) *UserUpdate { + if u != nil { + uu.SetAuthority(*u) + } + return uu +} + +// ClearAuthority clears the value of the "authority" field. +func (uu *UserUpdate) ClearAuthority() *UserUpdate { + uu.mutation.ClearAuthority() + return uu +} + +// SetLastLoginTime sets the "last_login_time" field. +func (uu *UserUpdate) SetLastLoginTime(i int64) *UserUpdate { + uu.mutation.ResetLastLoginTime() + uu.mutation.SetLastLoginTime(i) + return uu +} + +// SetNillableLastLoginTime sets the "last_login_time" field if the given value is not nil. +func (uu *UserUpdate) SetNillableLastLoginTime(i *int64) *UserUpdate { + if i != nil { + uu.SetLastLoginTime(*i) + } + return uu +} + +// AddLastLoginTime adds i to the "last_login_time" field. +func (uu *UserUpdate) AddLastLoginTime(i int64) *UserUpdate { + uu.mutation.AddLastLoginTime(i) + return uu +} + +// ClearLastLoginTime clears the value of the "last_login_time" field. +func (uu *UserUpdate) ClearLastLoginTime() *UserUpdate { + uu.mutation.ClearLastLoginTime() + return uu +} + +// SetLastLoginIP sets the "last_login_ip" field. +func (uu *UserUpdate) SetLastLoginIP(s string) *UserUpdate { + uu.mutation.SetLastLoginIP(s) + return uu +} + +// SetNillableLastLoginIP sets the "last_login_ip" field if the given value is not nil. +func (uu *UserUpdate) SetNillableLastLoginIP(s *string) *UserUpdate { + if s != nil { + uu.SetLastLoginIP(*s) + } + return uu +} + +// ClearLastLoginIP clears the value of the "last_login_ip" field. +func (uu *UserUpdate) ClearLastLoginIP() *UserUpdate { + uu.mutation.ClearLastLoginIP() + return uu +} + +// Mutation returns the UserMutation object of the builder. +func (uu *UserUpdate) Mutation() *UserMutation { + return uu.mutation +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (uu *UserUpdate) Save(ctx context.Context) (int, error) { + return withHooks(ctx, uu.sqlSave, uu.mutation, uu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (uu *UserUpdate) SaveX(ctx context.Context) int { + affected, err := uu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (uu *UserUpdate) Exec(ctx context.Context) error { + _, err := uu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (uu *UserUpdate) ExecX(ctx context.Context) { + if err := uu.Exec(ctx); err != nil { + panic(err) + } +} + +// check runs all checks and user-defined validators on the builder. +func (uu *UserUpdate) check() error { + if v, ok := uu.mutation.Status(); ok { + if err := user.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "User.status": %w`, err)} + } + } + if v, ok := uu.mutation.Password(); ok { + if err := user.PasswordValidator(v); err != nil { + return &ValidationError{Name: "password", err: fmt.Errorf(`ent: validator failed for field "User.password": %w`, err)} + } + } + if v, ok := uu.mutation.NickName(); ok { + if err := user.NickNameValidator(v); err != nil { + return &ValidationError{Name: "nick_name", err: fmt.Errorf(`ent: validator failed for field "User.nick_name": %w`, err)} + } + } + if v, ok := uu.mutation.RealName(); ok { + if err := user.RealNameValidator(v); err != nil { + return &ValidationError{Name: "real_name", err: fmt.Errorf(`ent: validator failed for field "User.real_name": %w`, err)} + } + } + if v, ok := uu.mutation.Email(); ok { + if err := user.EmailValidator(v); err != nil { + return &ValidationError{Name: "email", err: fmt.Errorf(`ent: validator failed for field "User.email": %w`, err)} + } + } + if v, ok := uu.mutation.Phone(); ok { + if err := user.PhoneValidator(v); err != nil { + return &ValidationError{Name: "phone", err: fmt.Errorf(`ent: validator failed for field "User.phone": %w`, err)} + } + } + if v, ok := uu.mutation.Avatar(); ok { + if err := user.AvatarValidator(v); err != nil { + return &ValidationError{Name: "avatar", err: fmt.Errorf(`ent: validator failed for field "User.avatar": %w`, err)} + } + } + if v, ok := uu.mutation.Gender(); ok { + if err := user.GenderValidator(v); err != nil { + return &ValidationError{Name: "gender", err: fmt.Errorf(`ent: validator failed for field "User.gender": %w`, err)} + } + } + if v, ok := uu.mutation.Address(); ok { + if err := user.AddressValidator(v); err != nil { + return &ValidationError{Name: "address", err: fmt.Errorf(`ent: validator failed for field "User.address": %w`, err)} + } + } + if v, ok := uu.mutation.Description(); ok { + if err := user.DescriptionValidator(v); err != nil { + return &ValidationError{Name: "description", err: fmt.Errorf(`ent: validator failed for field "User.description": %w`, err)} + } + } + if v, ok := uu.mutation.Authority(); ok { + if err := user.AuthorityValidator(v); err != nil { + return &ValidationError{Name: "authority", err: fmt.Errorf(`ent: validator failed for field "User.authority": %w`, err)} + } + } + if v, ok := uu.mutation.LastLoginIP(); ok { + if err := user.LastLoginIPValidator(v); err != nil { + return &ValidationError{Name: "last_login_ip", err: fmt.Errorf(`ent: validator failed for field "User.last_login_ip": %w`, err)} + } + } + return nil +} + +// Modify adds a statement modifier for attaching custom logic to the UPDATE statement. +func (uu *UserUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *UserUpdate { + uu.modifiers = append(uu.modifiers, modifiers...) + return uu +} + +func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := uu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(user.Table, user.Columns, sqlgraph.NewFieldSpec(user.FieldID, field.TypeUint32)) + if ps := uu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if value, ok := uu.mutation.CreateBy(); ok { + _spec.SetField(user.FieldCreateBy, field.TypeUint32, value) + } + if value, ok := uu.mutation.AddedCreateBy(); ok { + _spec.AddField(user.FieldCreateBy, field.TypeUint32, value) + } + if uu.mutation.CreateByCleared() { + _spec.ClearField(user.FieldCreateBy, field.TypeUint32) + } + if uu.mutation.CreateTimeCleared() { + _spec.ClearField(user.FieldCreateTime, field.TypeTime) + } + if value, ok := uu.mutation.UpdateTime(); ok { + _spec.SetField(user.FieldUpdateTime, field.TypeTime, value) + } + if uu.mutation.UpdateTimeCleared() { + _spec.ClearField(user.FieldUpdateTime, field.TypeTime) + } + if value, ok := uu.mutation.DeleteTime(); ok { + _spec.SetField(user.FieldDeleteTime, field.TypeTime, value) + } + if uu.mutation.DeleteTimeCleared() { + _spec.ClearField(user.FieldDeleteTime, field.TypeTime) + } + if value, ok := uu.mutation.Status(); ok { + _spec.SetField(user.FieldStatus, field.TypeEnum, value) + } + if uu.mutation.StatusCleared() { + _spec.ClearField(user.FieldStatus, field.TypeEnum) + } + if uu.mutation.UsernameCleared() { + _spec.ClearField(user.FieldUsername, field.TypeString) + } + if value, ok := uu.mutation.Password(); ok { + _spec.SetField(user.FieldPassword, field.TypeString, value) + } + if uu.mutation.PasswordCleared() { + _spec.ClearField(user.FieldPassword, field.TypeString) + } + if value, ok := uu.mutation.RoleID(); ok { + _spec.SetField(user.FieldRoleID, field.TypeUint32, value) + } + if value, ok := uu.mutation.AddedRoleID(); ok { + _spec.AddField(user.FieldRoleID, field.TypeUint32, value) + } + if uu.mutation.RoleIDCleared() { + _spec.ClearField(user.FieldRoleID, field.TypeUint32) + } + if value, ok := uu.mutation.OrgID(); ok { + _spec.SetField(user.FieldOrgID, field.TypeUint32, value) + } + if value, ok := uu.mutation.AddedOrgID(); ok { + _spec.AddField(user.FieldOrgID, field.TypeUint32, value) + } + if uu.mutation.OrgIDCleared() { + _spec.ClearField(user.FieldOrgID, field.TypeUint32) + } + if value, ok := uu.mutation.PositionID(); ok { + _spec.SetField(user.FieldPositionID, field.TypeUint32, value) + } + if value, ok := uu.mutation.AddedPositionID(); ok { + _spec.AddField(user.FieldPositionID, field.TypeUint32, value) + } + if uu.mutation.PositionIDCleared() { + _spec.ClearField(user.FieldPositionID, field.TypeUint32) + } + if value, ok := uu.mutation.WorkID(); ok { + _spec.SetField(user.FieldWorkID, field.TypeUint32, value) + } + if value, ok := uu.mutation.AddedWorkID(); ok { + _spec.AddField(user.FieldWorkID, field.TypeUint32, value) + } + if uu.mutation.WorkIDCleared() { + _spec.ClearField(user.FieldWorkID, field.TypeUint32) + } + if value, ok := uu.mutation.NickName(); ok { + _spec.SetField(user.FieldNickName, field.TypeString, value) + } + if uu.mutation.NickNameCleared() { + _spec.ClearField(user.FieldNickName, field.TypeString) + } + if value, ok := uu.mutation.RealName(); ok { + _spec.SetField(user.FieldRealName, field.TypeString, value) + } + if uu.mutation.RealNameCleared() { + _spec.ClearField(user.FieldRealName, field.TypeString) + } + if value, ok := uu.mutation.Email(); ok { + _spec.SetField(user.FieldEmail, field.TypeString, value) + } + if uu.mutation.EmailCleared() { + _spec.ClearField(user.FieldEmail, field.TypeString) + } + if value, ok := uu.mutation.Phone(); ok { + _spec.SetField(user.FieldPhone, field.TypeString, value) + } + if uu.mutation.PhoneCleared() { + _spec.ClearField(user.FieldPhone, field.TypeString) + } + if value, ok := uu.mutation.Avatar(); ok { + _spec.SetField(user.FieldAvatar, field.TypeString, value) + } + if uu.mutation.AvatarCleared() { + _spec.ClearField(user.FieldAvatar, field.TypeString) + } + if value, ok := uu.mutation.Gender(); ok { + _spec.SetField(user.FieldGender, field.TypeEnum, value) + } + if uu.mutation.GenderCleared() { + _spec.ClearField(user.FieldGender, field.TypeEnum) + } + if value, ok := uu.mutation.Address(); ok { + _spec.SetField(user.FieldAddress, field.TypeString, value) + } + if uu.mutation.AddressCleared() { + _spec.ClearField(user.FieldAddress, field.TypeString) + } + if value, ok := uu.mutation.Description(); ok { + _spec.SetField(user.FieldDescription, field.TypeString, value) + } + if uu.mutation.DescriptionCleared() { + _spec.ClearField(user.FieldDescription, field.TypeString) + } + if value, ok := uu.mutation.Authority(); ok { + _spec.SetField(user.FieldAuthority, field.TypeEnum, value) + } + if uu.mutation.AuthorityCleared() { + _spec.ClearField(user.FieldAuthority, field.TypeEnum) + } + if value, ok := uu.mutation.LastLoginTime(); ok { + _spec.SetField(user.FieldLastLoginTime, field.TypeInt64, value) + } + if value, ok := uu.mutation.AddedLastLoginTime(); ok { + _spec.AddField(user.FieldLastLoginTime, field.TypeInt64, value) + } + if uu.mutation.LastLoginTimeCleared() { + _spec.ClearField(user.FieldLastLoginTime, field.TypeInt64) + } + if value, ok := uu.mutation.LastLoginIP(); ok { + _spec.SetField(user.FieldLastLoginIP, field.TypeString, value) + } + if uu.mutation.LastLoginIPCleared() { + _spec.ClearField(user.FieldLastLoginIP, field.TypeString) + } + _spec.AddModifiers(uu.modifiers...) + if n, err = sqlgraph.UpdateNodes(ctx, uu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{user.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + uu.mutation.done = true + return n, nil +} + +// UserUpdateOne is the builder for updating a single User entity. +type UserUpdateOne struct { + config + fields []string + hooks []Hook + mutation *UserMutation + modifiers []func(*sql.UpdateBuilder) +} + +// SetCreateBy sets the "create_by" field. +func (uuo *UserUpdateOne) SetCreateBy(u uint32) *UserUpdateOne { + uuo.mutation.ResetCreateBy() + uuo.mutation.SetCreateBy(u) + return uuo +} + +// SetNillableCreateBy sets the "create_by" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableCreateBy(u *uint32) *UserUpdateOne { + if u != nil { + uuo.SetCreateBy(*u) + } + return uuo +} + +// AddCreateBy adds u to the "create_by" field. +func (uuo *UserUpdateOne) AddCreateBy(u int32) *UserUpdateOne { + uuo.mutation.AddCreateBy(u) + return uuo +} + +// ClearCreateBy clears the value of the "create_by" field. +func (uuo *UserUpdateOne) ClearCreateBy() *UserUpdateOne { + uuo.mutation.ClearCreateBy() + return uuo +} + +// SetUpdateTime sets the "update_time" field. +func (uuo *UserUpdateOne) SetUpdateTime(t time.Time) *UserUpdateOne { + uuo.mutation.SetUpdateTime(t) + return uuo +} + +// SetNillableUpdateTime sets the "update_time" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableUpdateTime(t *time.Time) *UserUpdateOne { + if t != nil { + uuo.SetUpdateTime(*t) + } + return uuo +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (uuo *UserUpdateOne) ClearUpdateTime() *UserUpdateOne { + uuo.mutation.ClearUpdateTime() + return uuo +} + +// SetDeleteTime sets the "delete_time" field. +func (uuo *UserUpdateOne) SetDeleteTime(t time.Time) *UserUpdateOne { + uuo.mutation.SetDeleteTime(t) + return uuo +} + +// SetNillableDeleteTime sets the "delete_time" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableDeleteTime(t *time.Time) *UserUpdateOne { + if t != nil { + uuo.SetDeleteTime(*t) + } + return uuo +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (uuo *UserUpdateOne) ClearDeleteTime() *UserUpdateOne { + uuo.mutation.ClearDeleteTime() + return uuo +} + +// SetStatus sets the "status" field. +func (uuo *UserUpdateOne) SetStatus(u user.Status) *UserUpdateOne { + uuo.mutation.SetStatus(u) + return uuo +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableStatus(u *user.Status) *UserUpdateOne { + if u != nil { + uuo.SetStatus(*u) + } + return uuo +} + +// ClearStatus clears the value of the "status" field. +func (uuo *UserUpdateOne) ClearStatus() *UserUpdateOne { + uuo.mutation.ClearStatus() + return uuo +} + +// SetPassword sets the "password" field. +func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne { + uuo.mutation.SetPassword(s) + return uuo +} + +// SetNillablePassword sets the "password" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillablePassword(s *string) *UserUpdateOne { + if s != nil { + uuo.SetPassword(*s) + } + return uuo +} + +// ClearPassword clears the value of the "password" field. +func (uuo *UserUpdateOne) ClearPassword() *UserUpdateOne { + uuo.mutation.ClearPassword() + return uuo +} + +// SetRoleID sets the "role_id" field. +func (uuo *UserUpdateOne) SetRoleID(u uint32) *UserUpdateOne { + uuo.mutation.ResetRoleID() + uuo.mutation.SetRoleID(u) + return uuo +} + +// SetNillableRoleID sets the "role_id" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableRoleID(u *uint32) *UserUpdateOne { + if u != nil { + uuo.SetRoleID(*u) + } + return uuo +} + +// AddRoleID adds u to the "role_id" field. +func (uuo *UserUpdateOne) AddRoleID(u int32) *UserUpdateOne { + uuo.mutation.AddRoleID(u) + return uuo +} + +// ClearRoleID clears the value of the "role_id" field. +func (uuo *UserUpdateOne) ClearRoleID() *UserUpdateOne { + uuo.mutation.ClearRoleID() + return uuo +} + +// SetOrgID sets the "org_id" field. +func (uuo *UserUpdateOne) SetOrgID(u uint32) *UserUpdateOne { + uuo.mutation.ResetOrgID() + uuo.mutation.SetOrgID(u) + return uuo +} + +// SetNillableOrgID sets the "org_id" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableOrgID(u *uint32) *UserUpdateOne { + if u != nil { + uuo.SetOrgID(*u) + } + return uuo +} + +// AddOrgID adds u to the "org_id" field. +func (uuo *UserUpdateOne) AddOrgID(u int32) *UserUpdateOne { + uuo.mutation.AddOrgID(u) + return uuo +} + +// ClearOrgID clears the value of the "org_id" field. +func (uuo *UserUpdateOne) ClearOrgID() *UserUpdateOne { + uuo.mutation.ClearOrgID() + return uuo +} + +// SetPositionID sets the "position_id" field. +func (uuo *UserUpdateOne) SetPositionID(u uint32) *UserUpdateOne { + uuo.mutation.ResetPositionID() + uuo.mutation.SetPositionID(u) + return uuo +} + +// SetNillablePositionID sets the "position_id" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillablePositionID(u *uint32) *UserUpdateOne { + if u != nil { + uuo.SetPositionID(*u) + } + return uuo +} + +// AddPositionID adds u to the "position_id" field. +func (uuo *UserUpdateOne) AddPositionID(u int32) *UserUpdateOne { + uuo.mutation.AddPositionID(u) + return uuo +} + +// ClearPositionID clears the value of the "position_id" field. +func (uuo *UserUpdateOne) ClearPositionID() *UserUpdateOne { + uuo.mutation.ClearPositionID() + return uuo +} + +// SetWorkID sets the "work_id" field. +func (uuo *UserUpdateOne) SetWorkID(u uint32) *UserUpdateOne { + uuo.mutation.ResetWorkID() + uuo.mutation.SetWorkID(u) + return uuo +} + +// SetNillableWorkID sets the "work_id" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableWorkID(u *uint32) *UserUpdateOne { + if u != nil { + uuo.SetWorkID(*u) + } + return uuo +} + +// AddWorkID adds u to the "work_id" field. +func (uuo *UserUpdateOne) AddWorkID(u int32) *UserUpdateOne { + uuo.mutation.AddWorkID(u) + return uuo +} + +// ClearWorkID clears the value of the "work_id" field. +func (uuo *UserUpdateOne) ClearWorkID() *UserUpdateOne { + uuo.mutation.ClearWorkID() + return uuo +} + +// SetNickName sets the "nick_name" field. +func (uuo *UserUpdateOne) SetNickName(s string) *UserUpdateOne { + uuo.mutation.SetNickName(s) + return uuo +} + +// SetNillableNickName sets the "nick_name" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableNickName(s *string) *UserUpdateOne { + if s != nil { + uuo.SetNickName(*s) + } + return uuo +} + +// ClearNickName clears the value of the "nick_name" field. +func (uuo *UserUpdateOne) ClearNickName() *UserUpdateOne { + uuo.mutation.ClearNickName() + return uuo +} + +// SetRealName sets the "real_name" field. +func (uuo *UserUpdateOne) SetRealName(s string) *UserUpdateOne { + uuo.mutation.SetRealName(s) + return uuo +} + +// SetNillableRealName sets the "real_name" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableRealName(s *string) *UserUpdateOne { + if s != nil { + uuo.SetRealName(*s) + } + return uuo +} + +// ClearRealName clears the value of the "real_name" field. +func (uuo *UserUpdateOne) ClearRealName() *UserUpdateOne { + uuo.mutation.ClearRealName() + return uuo +} + +// SetEmail sets the "email" field. +func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne { + uuo.mutation.SetEmail(s) + return uuo +} + +// SetNillableEmail sets the "email" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne { + if s != nil { + uuo.SetEmail(*s) + } + return uuo +} + +// ClearEmail clears the value of the "email" field. +func (uuo *UserUpdateOne) ClearEmail() *UserUpdateOne { + uuo.mutation.ClearEmail() + return uuo +} + +// SetPhone sets the "phone" field. +func (uuo *UserUpdateOne) SetPhone(s string) *UserUpdateOne { + uuo.mutation.SetPhone(s) + return uuo +} + +// SetNillablePhone sets the "phone" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillablePhone(s *string) *UserUpdateOne { + if s != nil { + uuo.SetPhone(*s) + } + return uuo +} + +// ClearPhone clears the value of the "phone" field. +func (uuo *UserUpdateOne) ClearPhone() *UserUpdateOne { + uuo.mutation.ClearPhone() + return uuo +} + +// SetAvatar sets the "avatar" field. +func (uuo *UserUpdateOne) SetAvatar(s string) *UserUpdateOne { + uuo.mutation.SetAvatar(s) + return uuo +} + +// SetNillableAvatar sets the "avatar" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableAvatar(s *string) *UserUpdateOne { + if s != nil { + uuo.SetAvatar(*s) + } + return uuo +} + +// ClearAvatar clears the value of the "avatar" field. +func (uuo *UserUpdateOne) ClearAvatar() *UserUpdateOne { + uuo.mutation.ClearAvatar() + return uuo +} + +// SetGender sets the "gender" field. +func (uuo *UserUpdateOne) SetGender(u user.Gender) *UserUpdateOne { + uuo.mutation.SetGender(u) + return uuo +} + +// SetNillableGender sets the "gender" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableGender(u *user.Gender) *UserUpdateOne { + if u != nil { + uuo.SetGender(*u) + } + return uuo +} + +// ClearGender clears the value of the "gender" field. +func (uuo *UserUpdateOne) ClearGender() *UserUpdateOne { + uuo.mutation.ClearGender() + return uuo +} + +// SetAddress sets the "address" field. +func (uuo *UserUpdateOne) SetAddress(s string) *UserUpdateOne { + uuo.mutation.SetAddress(s) + return uuo +} + +// SetNillableAddress sets the "address" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableAddress(s *string) *UserUpdateOne { + if s != nil { + uuo.SetAddress(*s) + } + return uuo +} + +// ClearAddress clears the value of the "address" field. +func (uuo *UserUpdateOne) ClearAddress() *UserUpdateOne { + uuo.mutation.ClearAddress() + return uuo +} + +// SetDescription sets the "description" field. +func (uuo *UserUpdateOne) SetDescription(s string) *UserUpdateOne { + uuo.mutation.SetDescription(s) + return uuo +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableDescription(s *string) *UserUpdateOne { + if s != nil { + uuo.SetDescription(*s) + } + return uuo +} + +// ClearDescription clears the value of the "description" field. +func (uuo *UserUpdateOne) ClearDescription() *UserUpdateOne { + uuo.mutation.ClearDescription() + return uuo +} + +// SetAuthority sets the "authority" field. +func (uuo *UserUpdateOne) SetAuthority(u user.Authority) *UserUpdateOne { + uuo.mutation.SetAuthority(u) + return uuo +} + +// SetNillableAuthority sets the "authority" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableAuthority(u *user.Authority) *UserUpdateOne { + if u != nil { + uuo.SetAuthority(*u) + } + return uuo +} + +// ClearAuthority clears the value of the "authority" field. +func (uuo *UserUpdateOne) ClearAuthority() *UserUpdateOne { + uuo.mutation.ClearAuthority() + return uuo +} + +// SetLastLoginTime sets the "last_login_time" field. +func (uuo *UserUpdateOne) SetLastLoginTime(i int64) *UserUpdateOne { + uuo.mutation.ResetLastLoginTime() + uuo.mutation.SetLastLoginTime(i) + return uuo +} + +// SetNillableLastLoginTime sets the "last_login_time" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableLastLoginTime(i *int64) *UserUpdateOne { + if i != nil { + uuo.SetLastLoginTime(*i) + } + return uuo +} + +// AddLastLoginTime adds i to the "last_login_time" field. +func (uuo *UserUpdateOne) AddLastLoginTime(i int64) *UserUpdateOne { + uuo.mutation.AddLastLoginTime(i) + return uuo +} + +// ClearLastLoginTime clears the value of the "last_login_time" field. +func (uuo *UserUpdateOne) ClearLastLoginTime() *UserUpdateOne { + uuo.mutation.ClearLastLoginTime() + return uuo +} + +// SetLastLoginIP sets the "last_login_ip" field. +func (uuo *UserUpdateOne) SetLastLoginIP(s string) *UserUpdateOne { + uuo.mutation.SetLastLoginIP(s) + return uuo +} + +// SetNillableLastLoginIP sets the "last_login_ip" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableLastLoginIP(s *string) *UserUpdateOne { + if s != nil { + uuo.SetLastLoginIP(*s) + } + return uuo +} + +// ClearLastLoginIP clears the value of the "last_login_ip" field. +func (uuo *UserUpdateOne) ClearLastLoginIP() *UserUpdateOne { + uuo.mutation.ClearLastLoginIP() + return uuo +} + +// Mutation returns the UserMutation object of the builder. +func (uuo *UserUpdateOne) Mutation() *UserMutation { + return uuo.mutation +} + +// Where appends a list predicates to the UserUpdate builder. +func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne { + uuo.mutation.Where(ps...) + return uuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne { + uuo.fields = append([]string{field}, fields...) + return uuo +} + +// Save executes the query and returns the updated User entity. +func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error) { + return withHooks(ctx, uuo.sqlSave, uuo.mutation, uuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User { + node, err := uuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (uuo *UserUpdateOne) Exec(ctx context.Context) error { + _, err := uuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (uuo *UserUpdateOne) ExecX(ctx context.Context) { + if err := uuo.Exec(ctx); err != nil { + panic(err) + } +} + +// check runs all checks and user-defined validators on the builder. +func (uuo *UserUpdateOne) check() error { + if v, ok := uuo.mutation.Status(); ok { + if err := user.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "User.status": %w`, err)} + } + } + if v, ok := uuo.mutation.Password(); ok { + if err := user.PasswordValidator(v); err != nil { + return &ValidationError{Name: "password", err: fmt.Errorf(`ent: validator failed for field "User.password": %w`, err)} + } + } + if v, ok := uuo.mutation.NickName(); ok { + if err := user.NickNameValidator(v); err != nil { + return &ValidationError{Name: "nick_name", err: fmt.Errorf(`ent: validator failed for field "User.nick_name": %w`, err)} + } + } + if v, ok := uuo.mutation.RealName(); ok { + if err := user.RealNameValidator(v); err != nil { + return &ValidationError{Name: "real_name", err: fmt.Errorf(`ent: validator failed for field "User.real_name": %w`, err)} + } + } + if v, ok := uuo.mutation.Email(); ok { + if err := user.EmailValidator(v); err != nil { + return &ValidationError{Name: "email", err: fmt.Errorf(`ent: validator failed for field "User.email": %w`, err)} + } + } + if v, ok := uuo.mutation.Phone(); ok { + if err := user.PhoneValidator(v); err != nil { + return &ValidationError{Name: "phone", err: fmt.Errorf(`ent: validator failed for field "User.phone": %w`, err)} + } + } + if v, ok := uuo.mutation.Avatar(); ok { + if err := user.AvatarValidator(v); err != nil { + return &ValidationError{Name: "avatar", err: fmt.Errorf(`ent: validator failed for field "User.avatar": %w`, err)} + } + } + if v, ok := uuo.mutation.Gender(); ok { + if err := user.GenderValidator(v); err != nil { + return &ValidationError{Name: "gender", err: fmt.Errorf(`ent: validator failed for field "User.gender": %w`, err)} + } + } + if v, ok := uuo.mutation.Address(); ok { + if err := user.AddressValidator(v); err != nil { + return &ValidationError{Name: "address", err: fmt.Errorf(`ent: validator failed for field "User.address": %w`, err)} + } + } + if v, ok := uuo.mutation.Description(); ok { + if err := user.DescriptionValidator(v); err != nil { + return &ValidationError{Name: "description", err: fmt.Errorf(`ent: validator failed for field "User.description": %w`, err)} + } + } + if v, ok := uuo.mutation.Authority(); ok { + if err := user.AuthorityValidator(v); err != nil { + return &ValidationError{Name: "authority", err: fmt.Errorf(`ent: validator failed for field "User.authority": %w`, err)} + } + } + if v, ok := uuo.mutation.LastLoginIP(); ok { + if err := user.LastLoginIPValidator(v); err != nil { + return &ValidationError{Name: "last_login_ip", err: fmt.Errorf(`ent: validator failed for field "User.last_login_ip": %w`, err)} + } + } + return nil +} + +// Modify adds a statement modifier for attaching custom logic to the UPDATE statement. +func (uuo *UserUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *UserUpdateOne { + uuo.modifiers = append(uuo.modifiers, modifiers...) + return uuo +} + +func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) { + if err := uuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(user.Table, user.Columns, sqlgraph.NewFieldSpec(user.FieldID, field.TypeUint32)) + id, ok := uuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`ent: missing "User.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := uuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, user.FieldID) + for _, f := range fields { + if !user.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)} + } + if f != user.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := uuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if value, ok := uuo.mutation.CreateBy(); ok { + _spec.SetField(user.FieldCreateBy, field.TypeUint32, value) + } + if value, ok := uuo.mutation.AddedCreateBy(); ok { + _spec.AddField(user.FieldCreateBy, field.TypeUint32, value) + } + if uuo.mutation.CreateByCleared() { + _spec.ClearField(user.FieldCreateBy, field.TypeUint32) + } + if uuo.mutation.CreateTimeCleared() { + _spec.ClearField(user.FieldCreateTime, field.TypeTime) + } + if value, ok := uuo.mutation.UpdateTime(); ok { + _spec.SetField(user.FieldUpdateTime, field.TypeTime, value) + } + if uuo.mutation.UpdateTimeCleared() { + _spec.ClearField(user.FieldUpdateTime, field.TypeTime) + } + if value, ok := uuo.mutation.DeleteTime(); ok { + _spec.SetField(user.FieldDeleteTime, field.TypeTime, value) + } + if uuo.mutation.DeleteTimeCleared() { + _spec.ClearField(user.FieldDeleteTime, field.TypeTime) + } + if value, ok := uuo.mutation.Status(); ok { + _spec.SetField(user.FieldStatus, field.TypeEnum, value) + } + if uuo.mutation.StatusCleared() { + _spec.ClearField(user.FieldStatus, field.TypeEnum) + } + if uuo.mutation.UsernameCleared() { + _spec.ClearField(user.FieldUsername, field.TypeString) + } + if value, ok := uuo.mutation.Password(); ok { + _spec.SetField(user.FieldPassword, field.TypeString, value) + } + if uuo.mutation.PasswordCleared() { + _spec.ClearField(user.FieldPassword, field.TypeString) + } + if value, ok := uuo.mutation.RoleID(); ok { + _spec.SetField(user.FieldRoleID, field.TypeUint32, value) + } + if value, ok := uuo.mutation.AddedRoleID(); ok { + _spec.AddField(user.FieldRoleID, field.TypeUint32, value) + } + if uuo.mutation.RoleIDCleared() { + _spec.ClearField(user.FieldRoleID, field.TypeUint32) + } + if value, ok := uuo.mutation.OrgID(); ok { + _spec.SetField(user.FieldOrgID, field.TypeUint32, value) + } + if value, ok := uuo.mutation.AddedOrgID(); ok { + _spec.AddField(user.FieldOrgID, field.TypeUint32, value) + } + if uuo.mutation.OrgIDCleared() { + _spec.ClearField(user.FieldOrgID, field.TypeUint32) + } + if value, ok := uuo.mutation.PositionID(); ok { + _spec.SetField(user.FieldPositionID, field.TypeUint32, value) + } + if value, ok := uuo.mutation.AddedPositionID(); ok { + _spec.AddField(user.FieldPositionID, field.TypeUint32, value) + } + if uuo.mutation.PositionIDCleared() { + _spec.ClearField(user.FieldPositionID, field.TypeUint32) + } + if value, ok := uuo.mutation.WorkID(); ok { + _spec.SetField(user.FieldWorkID, field.TypeUint32, value) + } + if value, ok := uuo.mutation.AddedWorkID(); ok { + _spec.AddField(user.FieldWorkID, field.TypeUint32, value) + } + if uuo.mutation.WorkIDCleared() { + _spec.ClearField(user.FieldWorkID, field.TypeUint32) + } + if value, ok := uuo.mutation.NickName(); ok { + _spec.SetField(user.FieldNickName, field.TypeString, value) + } + if uuo.mutation.NickNameCleared() { + _spec.ClearField(user.FieldNickName, field.TypeString) + } + if value, ok := uuo.mutation.RealName(); ok { + _spec.SetField(user.FieldRealName, field.TypeString, value) + } + if uuo.mutation.RealNameCleared() { + _spec.ClearField(user.FieldRealName, field.TypeString) + } + if value, ok := uuo.mutation.Email(); ok { + _spec.SetField(user.FieldEmail, field.TypeString, value) + } + if uuo.mutation.EmailCleared() { + _spec.ClearField(user.FieldEmail, field.TypeString) + } + if value, ok := uuo.mutation.Phone(); ok { + _spec.SetField(user.FieldPhone, field.TypeString, value) + } + if uuo.mutation.PhoneCleared() { + _spec.ClearField(user.FieldPhone, field.TypeString) + } + if value, ok := uuo.mutation.Avatar(); ok { + _spec.SetField(user.FieldAvatar, field.TypeString, value) + } + if uuo.mutation.AvatarCleared() { + _spec.ClearField(user.FieldAvatar, field.TypeString) + } + if value, ok := uuo.mutation.Gender(); ok { + _spec.SetField(user.FieldGender, field.TypeEnum, value) + } + if uuo.mutation.GenderCleared() { + _spec.ClearField(user.FieldGender, field.TypeEnum) + } + if value, ok := uuo.mutation.Address(); ok { + _spec.SetField(user.FieldAddress, field.TypeString, value) + } + if uuo.mutation.AddressCleared() { + _spec.ClearField(user.FieldAddress, field.TypeString) + } + if value, ok := uuo.mutation.Description(); ok { + _spec.SetField(user.FieldDescription, field.TypeString, value) + } + if uuo.mutation.DescriptionCleared() { + _spec.ClearField(user.FieldDescription, field.TypeString) + } + if value, ok := uuo.mutation.Authority(); ok { + _spec.SetField(user.FieldAuthority, field.TypeEnum, value) + } + if uuo.mutation.AuthorityCleared() { + _spec.ClearField(user.FieldAuthority, field.TypeEnum) + } + if value, ok := uuo.mutation.LastLoginTime(); ok { + _spec.SetField(user.FieldLastLoginTime, field.TypeInt64, value) + } + if value, ok := uuo.mutation.AddedLastLoginTime(); ok { + _spec.AddField(user.FieldLastLoginTime, field.TypeInt64, value) + } + if uuo.mutation.LastLoginTimeCleared() { + _spec.ClearField(user.FieldLastLoginTime, field.TypeInt64) + } + if value, ok := uuo.mutation.LastLoginIP(); ok { + _spec.SetField(user.FieldLastLoginIP, field.TypeString, value) + } + if uuo.mutation.LastLoginIPCleared() { + _spec.ClearField(user.FieldLastLoginIP, field.TypeString) + } + _spec.AddModifiers(uuo.modifiers...) + _node = &User{config: uuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, uuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{user.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + uuo.mutation.done = true + return _node, nil +} diff --git a/monolithic/backend/app/admin/service/internal/data/ent_client.go b/monolithic/backend/app/admin/service/internal/data/ent_client.go new file mode 100644 index 0000000..7c8c3b5 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/ent_client.go @@ -0,0 +1,48 @@ +package data + +import ( + "context" + + _ "github.com/go-sql-driver/mysql" + _ "github.com/jackc/pgx/v4/stdlib" + _ "github.com/lib/pq" + + "github.com/go-kratos/kratos/v2/log" + "github.com/tx7do/go-utils/entgo" + + "kratos-monolithic-demo/app/admin/service/internal/data/ent" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/migrate" + + conf "github.com/tx7do/kratos-bootstrap/gen/api/go/conf/v1" +) + +// NewEntClient 创建Ent ORM数据库客户端 +func NewEntClient(cfg *conf.Bootstrap, logger log.Logger) *entgo.EntClient[*ent.Client] { + l := log.NewHelper(log.With(logger, "module", "ent/data/admin-service")) + + drv, err := entgo.CreateDriver(cfg.Data.Database.Driver, cfg.Data.Database.Source, + int(cfg.Data.Database.MaxIdleConnections), + int(cfg.Data.Database.MaxOpenConnections), + cfg.Data.Database.ConnectionMaxLifetime.AsDuration(), + ) + if err != nil { + l.Fatalf("failed opening connection to db: %v", err) + return nil + } + + client := ent.NewClient( + ent.Driver(drv), + ent.Log(func(a ...any) { + l.Debug(a...) + }), + ) + + // 运行数据库迁移工具 + if cfg.Data.Database.Migrate { + if err = client.Schema.Create(context.Background(), migrate.WithForeignKeys(true)); err != nil { + l.Fatalf("failed creating schema resources: %v", err) + } + } + + return entgo.NewEntClient(client, drv) +} diff --git a/monolithic/backend/app/admin/service/internal/data/init.go b/monolithic/backend/app/admin/service/internal/data/init.go new file mode 100644 index 0000000..da365cd --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/init.go @@ -0,0 +1,26 @@ +//go:build wireinject +// +build wireinject + +package data + +import "github.com/google/wire" + +// ProviderSet is data providers. +var ProviderSet = wire.NewSet( + NewData, + + NewRedisClient, + NewEntClient, + + NewAuthenticator, + NewAuthorizer, + + NewDictRepo, + NewDictDetailRepo, + NewMenuRepo, + NewOrganizationRepo, + NewPositionRepo, + NewRoleRepo, + NewUserRepo, + NewUserTokenRepo, +) diff --git a/monolithic/backend/app/admin/service/internal/data/menu.go b/monolithic/backend/app/admin/service/internal/data/menu.go new file mode 100644 index 0000000..be791e1 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/menu.go @@ -0,0 +1,240 @@ +package data + +import ( + "context" + "time" + + "entgo.io/ent/dialect/sql" + "github.com/go-kratos/kratos/v2/log" + + "github.com/tx7do/go-utils/entgo/query" + util "github.com/tx7do/go-utils/timeutil" + "github.com/tx7do/go-utils/trans" + + "kratos-monolithic-demo/app/admin/service/internal/data/ent" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/menu" + + pagination "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + v1 "kratos-monolithic-demo/gen/api/go/system/service/v1" +) + +type MenuRepo struct { + data *Data + log *log.Helper +} + +func NewMenuRepo(data *Data, logger log.Logger) *MenuRepo { + l := log.NewHelper(log.With(logger, "module", "menu/repo/admin-service")) + return &MenuRepo{ + data: data, + log: l, + } +} + +func (r *MenuRepo) convertEntToProto(in *ent.Menu) *v1.Menu { + if in == nil { + return nil + } + + var menuType *v1.MenuType + if in.Type != nil { + menuType = (*v1.MenuType)(trans.Int32(v1.MenuType_value[string(*in.Type)])) + } + + return &v1.Menu{ + Id: in.ID, + ParentId: in.ParentID, + OrderNo: in.OrderNo, + Name: in.Name, + Title: in.Title, + Path: in.Path, + Component: in.Component, + Icon: in.Icon, + KeepAlive: in.KeepAlive, + Show: in.Show, + IsExt: in.IsExt, + ExtUrl: in.ExtURL, + Permissions: in.Permissions, + HideTab: in.HideTab, + HideMenu: in.HideMenu, + HideBreadcrumb: in.HideBreadcrumb, + CurrentActiveMenu: in.CurrentActiveMenu, + Redirect: in.Redirect, + Type: menuType, + Status: (*string)(in.Status), + CreateTime: util.TimeToTimeString(in.CreateTime), + UpdateTime: util.TimeToTimeString(in.UpdateTime), + DeleteTime: util.TimeToTimeString(in.DeleteTime), + } +} + +func (r *MenuRepo) travelChild(nodes []*v1.Menu, node *v1.Menu) bool { + if nodes == nil { + return false + } + + if node.ParentId == nil { + nodes = append(nodes, node) + return true + } + + for _, n := range nodes { + if node.ParentId == nil { + continue + } + + if n.Id == *node.ParentId { + n.Children = append(n.Children, node) + return true + } else { + if r.travelChild(n.Children, node) { + return true + } + } + } + return false +} + +func (r *MenuRepo) Count(ctx context.Context, whereCond []func(s *sql.Selector)) (int, error) { + builder := r.data.db.Client().Menu.Query() + if len(whereCond) != 0 { + builder.Modify(whereCond...) + } + + count, err := builder.Count(ctx) + if err != nil { + r.log.Errorf("query count failed: %s", err.Error()) + } + + return count, err +} + +func (r *MenuRepo) List(ctx context.Context, req *pagination.PagingRequest) (*v1.ListMenuResponse, error) { + builder := r.data.db.Client().Menu.Query() + + err, whereSelectors, querySelectors := entgo.BuildQuerySelector( + req.GetQuery(), req.GetOrQuery(), + req.GetPage(), req.GetPageSize(), req.GetNoPaging(), + req.GetOrderBy(), menu.FieldCreateTime, + req.GetFieldMask().GetPaths(), + ) + if err != nil { + r.log.Errorf("解析SELECT条件发生错误[%s]", err.Error()) + return nil, err + } + + if querySelectors != nil { + builder.Modify(querySelectors...) + } + + results, err := builder.All(ctx) + if err != nil { + r.log.Errorf("query list failed: %s", err.Error()) + return nil, err + } + + items := make([]*v1.Menu, 0, len(results)) + for _, m := range results { + if m.ParentID == nil { + item := r.convertEntToProto(m) + items = append(items, item) + } + } + for _, m := range results { + if m.ParentID != nil { + item := r.convertEntToProto(m) + r.travelChild(items, item) + } + } + + count, err := r.Count(ctx, whereSelectors) + if err != nil { + return nil, err + } + + return &v1.ListMenuResponse{ + Total: int32(count), + Items: items, + }, nil +} + +func (r *MenuRepo) Get(ctx context.Context, req *v1.GetMenuRequest) (*v1.Menu, error) { + ret, err := r.data.db.Client().Menu.Get(ctx, req.GetId()) + if err != nil && !ent.IsNotFound(err) { + r.log.Errorf("query one data failed: %s", err.Error()) + return nil, err + } + + return r.convertEntToProto(ret), err +} + +func (r *MenuRepo) Create(ctx context.Context, req *v1.CreateMenuRequest) error { + builder := r.data.db.Client().Menu.Create(). + SetNillableName(req.Menu.Name). + SetNillableStatus((*menu.Status)(req.Menu.Status)). + SetNillableParentID(req.Menu.ParentId). + SetNillablePath(req.Menu.Path). + SetNillableOrderNo(req.Menu.OrderNo). + SetNillableComponent(req.Menu.Component). + SetNillableIcon(req.Menu.Icon). + SetNillableKeepAlive(req.Menu.KeepAlive). + SetNillableShow(req.Menu.Show). + SetNillableIsExt(req.Menu.IsExt). + SetNillableExtURL(req.Menu.ExtUrl). + SetPermissions(req.Menu.Permissions). + SetCreateTime(time.Now()) + + if req.Menu.Type != nil { + builder.SetType((menu.Type)(req.Menu.Type.String())) + } + + err := builder.Exec(ctx) + if err != nil { + r.log.Errorf("insert one data failed: %s", err.Error()) + return err + } + + return nil +} + +func (r *MenuRepo) Update(ctx context.Context, req *v1.UpdateMenuRequest) error { + builder := r.data.db.Client().Menu.UpdateOneID(req.Menu.Id). + SetNillableName(req.Menu.Name). + SetNillableStatus((*menu.Status)(req.Menu.Status)). + SetNillableParentID(req.Menu.ParentId). + SetNillablePath(req.Menu.Path). + SetNillableOrderNo(req.Menu.OrderNo). + SetNillableComponent(req.Menu.Component). + SetNillableIcon(req.Menu.Icon). + SetNillableKeepAlive(req.Menu.KeepAlive). + SetNillableShow(req.Menu.Show). + SetNillableIsExt(req.Menu.IsExt). + SetNillableExtURL(req.Menu.ExtUrl). + SetUpdateTime(time.Now()) + + if req.Menu.Permissions != nil { + builder.SetPermissions(req.Menu.Permissions) + } + if req.Menu.Type != nil { + builder.SetType((menu.Type)(req.Menu.Type.String())) + } + + err := builder.Exec(ctx) + if err != nil { + r.log.Errorf("update one data failed: %s", err.Error()) + return err + } + + return nil +} + +func (r *MenuRepo) Delete(ctx context.Context, req *v1.DeleteMenuRequest) (bool, error) { + err := r.data.db.Client().Menu. + DeleteOneID(req.GetId()). + Exec(ctx) + if err != nil { + r.log.Errorf("delete one data failed: %s", err.Error()) + } + + return err == nil, err +} diff --git a/monolithic/backend/app/admin/service/internal/data/organization.go b/monolithic/backend/app/admin/service/internal/data/organization.go new file mode 100644 index 0000000..4f5d84e --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/organization.go @@ -0,0 +1,203 @@ +package data + +import ( + "context" + "sort" + "time" + + "entgo.io/ent/dialect/sql" + "github.com/go-kratos/kratos/v2/log" + entgo "github.com/tx7do/go-utils/entgo/query" + util "github.com/tx7do/go-utils/timeutil" + + "kratos-monolithic-demo/app/admin/service/internal/data/ent" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/organization" + + pagination "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + v1 "kratos-monolithic-demo/gen/api/go/user/service/v1" +) + +type OrganizationRepo struct { + data *Data + log *log.Helper +} + +func NewOrganizationRepo(data *Data, logger log.Logger) *OrganizationRepo { + l := log.NewHelper(log.With(logger, "module", "organization/repo/admin-service")) + return &OrganizationRepo{ + data: data, + log: l, + } +} + +func (r *OrganizationRepo) convertEntToProto(in *ent.Organization) *v1.Organization { + if in == nil { + return nil + } + return &v1.Organization{ + Id: in.ID, + Name: in.Name, + Remark: in.Remark, + OrderNo: in.OrderNo, + ParentId: in.ParentID, + Status: (*string)(in.Status), + CreateTime: util.TimeToTimeString(in.CreateTime), + UpdateTime: util.TimeToTimeString(in.UpdateTime), + DeleteTime: util.TimeToTimeString(in.DeleteTime), + } +} + +func (r *OrganizationRepo) travelChild(nodes []*v1.Organization, node *v1.Organization) bool { + if nodes == nil { + return false + } + + if node.ParentId == nil { + nodes = append(nodes, node) + return true + } + + for _, n := range nodes { + if node.ParentId == nil { + continue + } + + if n.Id == *node.ParentId { + n.Children = append(n.Children, node) + return true + } else { + if r.travelChild(n.Children, node) { + return true + } + } + } + return false +} + +func (r *OrganizationRepo) Count(ctx context.Context, whereCond []func(s *sql.Selector)) (int, error) { + builder := r.data.db.Client().Organization.Query() + if len(whereCond) != 0 { + builder.Modify(whereCond...) + } + + count, err := builder.Count(ctx) + if err != nil { + r.log.Errorf("query count failed: %s", err.Error()) + } + + return count, err +} + +func (r *OrganizationRepo) List(ctx context.Context, req *pagination.PagingRequest) (*v1.ListOrganizationResponse, error) { + builder := r.data.db.Client().Organization.Query() + + err, whereSelectors, querySelectors := entgo.BuildQuerySelector( + req.GetQuery(), req.GetOrQuery(), + req.GetPage(), req.GetPageSize(), req.GetNoPaging(), + req.GetOrderBy(), organization.FieldCreateTime, + req.GetFieldMask().GetPaths(), + ) + if err != nil { + r.log.Errorf("解析SELECT条件发生错误[%s]", err.Error()) + return nil, err + } + + if querySelectors != nil { + builder.Modify(querySelectors...) + } + + results, err := builder.All(ctx) + if err != nil { + return nil, err + } + + sort.SliceStable(results, func(i, j int) bool { + if results[j].ParentID == nil { + return true + } + if results[i].ParentID == nil { + return true + } + return *results[i].ParentID < *results[j].ParentID + }) + + items := make([]*v1.Organization, 0, len(results)) + for _, m := range results { + if m.ParentID == nil { + item := r.convertEntToProto(m) + items = append(items, item) + } + } + for _, m := range results { + if m.ParentID != nil { + item := r.convertEntToProto(m) + r.travelChild(items, item) + } + } + + count, err := r.Count(ctx, whereSelectors) + if err != nil { + return nil, err + } + + ret := v1.ListOrganizationResponse{ + Total: int32(count), + Items: items, + } + + return &ret, err +} + +func (r *OrganizationRepo) Get(ctx context.Context, req *v1.GetOrganizationRequest) (*v1.Organization, error) { + ret, err := r.data.db.Client().Organization.Get(ctx, req.GetId()) + if err != nil && !ent.IsNotFound(err) { + return nil, err + } + + return r.convertEntToProto(ret), err +} + +func (r *OrganizationRepo) Create(ctx context.Context, req *v1.CreateOrganizationRequest) error { + builder := r.data.db.Client().Organization.Create(). + SetNillableName(req.Org.Name). + SetNillableParentID(req.Org.ParentId). + SetNillableOrderNo(req.Org.OrderNo). + SetNillableRemark(req.Org.Remark). + SetNillableStatus((*organization.Status)(req.Org.Status)). + SetCreateTime(time.Now()). + SetCreateBy(req.GetOperatorId()) + + err := builder.Exec(ctx) + if err != nil { + r.log.Errorf("insert one data failed: %s", err.Error()) + return err + } + + return err +} + +func (r *OrganizationRepo) Update(ctx context.Context, req *v1.UpdateOrganizationRequest) error { + + builder := r.data.db.Client().Organization.UpdateOneID(req.Org.Id). + SetNillableName(req.Org.Name). + SetNillableParentID(req.Org.ParentId). + SetNillableOrderNo(req.Org.OrderNo). + SetNillableRemark(req.Org.Remark). + SetNillableStatus((*organization.Status)(req.Org.Status)). + SetUpdateTime(time.Now()) + + err := builder.Exec(ctx) + if err != nil { + r.log.Errorf("update one data failed: %s", err.Error()) + return err + } + + return err +} + +func (r *OrganizationRepo) Delete(ctx context.Context, req *v1.DeleteOrganizationRequest) (bool, error) { + err := r.data.db.Client().Organization. + DeleteOneID(req.GetId()). + Exec(ctx) + return err != nil, err +} diff --git a/monolithic/backend/app/admin/service/internal/data/position.go b/monolithic/backend/app/admin/service/internal/data/position.go new file mode 100644 index 0000000..70c2ce8 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/position.go @@ -0,0 +1,156 @@ +package data + +import ( + "context" + "time" + + "entgo.io/ent/dialect/sql" + "github.com/go-kratos/kratos/v2/log" + entgo "github.com/tx7do/go-utils/entgo/query" + util "github.com/tx7do/go-utils/timeutil" + + "kratos-monolithic-demo/app/admin/service/internal/data/ent" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/position" + + pagination "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + v1 "kratos-monolithic-demo/gen/api/go/user/service/v1" +) + +type PositionRepo struct { + data *Data + log *log.Helper +} + +func NewPositionRepo(data *Data, logger log.Logger) *PositionRepo { + l := log.NewHelper(log.With(logger, "module", "position/repo/admin-service")) + return &PositionRepo{ + data: data, + log: l, + } +} + +func (r *PositionRepo) convertEntToProto(in *ent.Position) *v1.Position { + if in == nil { + return nil + } + return &v1.Position{ + Id: in.ID, + Name: &in.Name, + Code: &in.Code, + Remark: in.Remark, + OrderNo: &in.OrderNo, + ParentId: &in.ParentID, + Status: (*string)(in.Status), + CreateTime: util.TimeToTimeString(in.CreateTime), + UpdateTime: util.TimeToTimeString(in.UpdateTime), + DeleteTime: util.TimeToTimeString(in.DeleteTime), + } +} + +func (r *PositionRepo) Count(ctx context.Context, whereCond []func(s *sql.Selector)) (int, error) { + builder := r.data.db.Client().Position.Query() + if len(whereCond) != 0 { + builder.Modify(whereCond...) + } + + count, err := builder.Count(ctx) + if err != nil { + r.log.Errorf("query count failed: %s", err.Error()) + } + + return count, err +} + +func (r *PositionRepo) List(ctx context.Context, req *pagination.PagingRequest) (*v1.ListPositionResponse, error) { + builder := r.data.db.Client().Position.Query() + + err, whereSelectors, querySelectors := entgo.BuildQuerySelector( + req.GetQuery(), req.GetOrQuery(), + req.GetPage(), req.GetPageSize(), req.GetNoPaging(), + req.GetOrderBy(), position.FieldCreateTime, + req.GetFieldMask().GetPaths(), + ) + if err != nil { + r.log.Errorf("解析条件发生错误[%s]", err.Error()) + return nil, err + } + + if querySelectors != nil { + builder.Modify(querySelectors...) + } + + results, err := builder.All(ctx) + if err != nil { + return nil, err + } + + items := make([]*v1.Position, 0, len(results)) + for _, res := range results { + item := r.convertEntToProto(res) + items = append(items, item) + } + + count, err := r.Count(ctx, whereSelectors) + if err != nil { + return nil, err + } + + return &v1.ListPositionResponse{ + Total: int32(count), + Items: items, + }, err +} + +func (r *PositionRepo) Get(ctx context.Context, req *v1.GetPositionRequest) (*v1.Position, error) { + ret, err := r.data.db.Client().Position.Get(ctx, req.GetId()) + if err != nil && !ent.IsNotFound(err) { + return nil, err + } + + return r.convertEntToProto(ret), err +} + +func (r *PositionRepo) Create(ctx context.Context, req *v1.CreatePositionRequest) error { + err := r.data.db.Client().Position.Create(). + SetNillableName(req.Position.Name). + SetNillableParentID(req.Position.ParentId). + SetNillableOrderNo(req.Position.OrderNo). + SetNillableCode(req.Position.Code). + SetNillableStatus((*position.Status)(req.Position.Status)). + SetNillableRemark(req.Position.Remark). + SetCreateBy(req.GetOperatorId()). + SetCreateTime(time.Now()). + Exec(ctx) + if err != nil { + r.log.Errorf("insert one data failed: %s", err.Error()) + return err + } + + return err +} + +func (r *PositionRepo) Update(ctx context.Context, req *v1.UpdatePositionRequest) error { + builder := r.data.db.Client().Position.UpdateOneID(req.Position.Id). + SetNillableName(req.Position.Name). + SetNillableParentID(req.Position.ParentId). + SetNillableOrderNo(req.Position.OrderNo). + SetNillableCode(req.Position.Code). + SetNillableRemark(req.Position.Remark). + SetNillableStatus((*position.Status)(req.Position.Status)). + SetUpdateTime(time.Now()) + + err := builder.Exec(ctx) + if err != nil { + r.log.Errorf("update one data failed: %s", err.Error()) + return err + } + + return err +} + +func (r *PositionRepo) Delete(ctx context.Context, req *v1.DeletePositionRequest) (bool, error) { + err := r.data.db.Client().Position. + DeleteOneID(req.GetId()). + Exec(ctx) + return err != nil, err +} diff --git a/monolithic/backend/app/admin/service/internal/data/role.go b/monolithic/backend/app/admin/service/internal/data/role.go new file mode 100644 index 0000000..cf95daa --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/role.go @@ -0,0 +1,156 @@ +package data + +import ( + "context" + "time" + + "entgo.io/ent/dialect/sql" + "github.com/go-kratos/kratos/v2/log" + entgo "github.com/tx7do/go-utils/entgo/query" + util "github.com/tx7do/go-utils/timeutil" + + "kratos-monolithic-demo/app/admin/service/internal/data/ent" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/role" + + pagination "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + v1 "kratos-monolithic-demo/gen/api/go/user/service/v1" +) + +type RoleRepo struct { + data *Data + log *log.Helper +} + +func NewRoleRepo(data *Data, logger log.Logger) *RoleRepo { + l := log.NewHelper(log.With(logger, "module", "role/repo/admin-service")) + return &RoleRepo{ + data: data, + log: l, + } +} + +func (r *RoleRepo) convertEntToProto(in *ent.Role) *v1.Role { + if in == nil { + return nil + } + return &v1.Role{ + Id: in.ID, + Name: in.Name, + Code: in.Code, + Remark: in.Remark, + OrderNo: in.OrderNo, + ParentId: in.ParentID, + Status: (*string)(in.Status), + CreateTime: util.TimeToTimeString(in.CreateTime), + UpdateTime: util.TimeToTimeString(in.UpdateTime), + DeleteTime: util.TimeToTimeString(in.DeleteTime), + } +} + +func (r *RoleRepo) Count(ctx context.Context, whereCond []func(s *sql.Selector)) (int, error) { + builder := r.data.db.Client().Role.Query() + if len(whereCond) != 0 { + builder.Modify(whereCond...) + } + + count, err := builder.Count(ctx) + if err != nil { + r.log.Errorf("query count failed: %s", err.Error()) + } + + return count, err +} + +func (r *RoleRepo) List(ctx context.Context, req *pagination.PagingRequest) (*v1.ListRoleResponse, error) { + builder := r.data.db.Client().Role.Query() + + err, whereSelectors, querySelectors := entgo.BuildQuerySelector( + req.GetQuery(), req.GetOrQuery(), + req.GetPage(), req.GetPageSize(), req.GetNoPaging(), + req.GetOrderBy(), role.FieldCreateTime, + req.GetFieldMask().GetPaths(), + ) + if err != nil { + r.log.Errorf("解析条件发生错误[%s]", err.Error()) + return nil, err + } + + if querySelectors != nil { + builder.Modify(querySelectors...) + } + + results, err := builder.All(ctx) + if err != nil { + return nil, err + } + + items := make([]*v1.Role, 0, len(results)) + for _, res := range results { + item := r.convertEntToProto(res) + items = append(items, item) + } + + count, err := r.Count(ctx, whereSelectors) + if err != nil { + return nil, err + } + + return &v1.ListRoleResponse{ + Total: int32(count), + Items: items, + }, err +} + +func (r *RoleRepo) Get(ctx context.Context, req *v1.GetRoleRequest) (*v1.Role, error) { + ret, err := r.data.db.Client().Role.Get(ctx, req.GetId()) + if err != nil && !ent.IsNotFound(err) { + return nil, err + } + + return r.convertEntToProto(ret), err +} + +func (r *RoleRepo) Create(ctx context.Context, req *v1.CreateRoleRequest) error { + err := r.data.db.Client().Role.Create(). + SetNillableName(req.Role.Name). + SetNillableParentID(req.Role.ParentId). + SetNillableOrderNo(req.Role.OrderNo). + SetNillableCode(req.Role.Code). + SetNillableStatus((*role.Status)(req.Role.Status)). + SetNillableRemark(req.Role.Remark). + SetCreateBy(req.GetOperatorId()). + SetCreateTime(time.Now()). + Exec(ctx) + if err != nil { + r.log.Errorf("insert one data failed: %s", err.Error()) + return err + } + + return err +} + +func (r *RoleRepo) Update(ctx context.Context, req *v1.UpdateRoleRequest) error { + builder := r.data.db.Client().Role.UpdateOneID(req.Role.Id). + SetNillableName(req.Role.Name). + SetNillableParentID(req.Role.ParentId). + SetNillableOrderNo(req.Role.OrderNo). + SetNillableCode(req.Role.Code). + SetNillableRemark(req.Role.Remark). + SetNillableStatus((*role.Status)(req.Role.Status)). + SetUpdateTime(time.Now()) + + err := builder.Exec(ctx) + if err != nil { + r.log.Errorf("update one data failed: %s", err.Error()) + return err + } + + return err +} + +func (r *RoleRepo) Delete(ctx context.Context, req *v1.DeleteRoleRequest) (bool, error) { + err := r.data.db.Client().Role. + DeleteOneID(req.GetId()). + Exec(ctx) + return err != nil, err +} diff --git a/monolithic/backend/app/admin/service/internal/data/user.go b/monolithic/backend/app/admin/service/internal/data/user.go new file mode 100644 index 0000000..285e2f5 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/user.go @@ -0,0 +1,279 @@ +package data + +import ( + "context" + "errors" + "time" + + "entgo.io/ent/dialect/sql" + "github.com/go-kratos/kratos/v2/log" + "github.com/tx7do/go-utils/crypto" + entgo "github.com/tx7do/go-utils/entgo/query" + entgoUpdate "github.com/tx7do/go-utils/entgo/update" + "github.com/tx7do/go-utils/fieldmaskutil" + timeUtil "github.com/tx7do/go-utils/timeutil" + "github.com/tx7do/go-utils/trans" + + "kratos-monolithic-demo/app/admin/service/internal/data/ent" + "kratos-monolithic-demo/app/admin/service/internal/data/ent/user" + + pagination "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + v1 "kratos-monolithic-demo/gen/api/go/user/service/v1" +) + +type UserRepo struct { + data *Data + log *log.Helper +} + +func NewUserRepo(data *Data, logger log.Logger) *UserRepo { + l := log.NewHelper(log.With(logger, "module", "user/repo/admin-service")) + return &UserRepo{ + data: data, + log: l, + } +} + +func (r *UserRepo) convertEntToProto(in *ent.User) *v1.User { + if in == nil { + return nil + } + + var authority *v1.UserAuthority + if in.Authority != nil { + authority = (*v1.UserAuthority)(trans.Int32(v1.UserAuthority_value[string(*in.Authority)])) + } + + return &v1.User{ + Id: in.ID, + RoleId: in.RoleID, + WorkId: in.WorkID, + OrgId: in.OrgID, + PositionId: in.PositionID, + CreatorId: in.CreateBy, + UserName: in.Username, + NickName: in.NickName, + RealName: in.RealName, + Email: in.Email, + Avatar: in.Avatar, + Phone: in.Phone, + Gender: (*string)(in.Gender), + Address: in.Address, + Description: in.Description, + Authority: authority, + LastLoginTime: in.LastLoginTime, + LastLoginIp: in.LastLoginIP, + Status: (*string)(in.Status), + CreateTime: timeUtil.TimeToTimeString(in.CreateTime), + UpdateTime: timeUtil.TimeToTimeString(in.UpdateTime), + DeleteTime: timeUtil.TimeToTimeString(in.DeleteTime), + } +} + +func (r *UserRepo) Count(ctx context.Context, whereCond []func(s *sql.Selector)) (int, error) { + builder := r.data.db.Client().User.Query() + if len(whereCond) != 0 { + builder.Modify(whereCond...) + } + + count, err := builder.Count(ctx) + if err != nil { + r.log.Errorf("query count failed: %s", err.Error()) + } + + return count, err +} + +func (r *UserRepo) List(ctx context.Context, req *pagination.PagingRequest) (*v1.ListUserResponse, error) { + builder := r.data.db.Client().User.Query() + + err, whereSelectors, querySelectors := entgo.BuildQuerySelector( + req.GetQuery(), req.GetOrQuery(), + req.GetPage(), req.GetPageSize(), req.GetNoPaging(), + req.GetOrderBy(), user.FieldCreateTime, + req.GetFieldMask().GetPaths(), + ) + if err != nil { + r.log.Errorf("解析条件发生错误[%s]", err.Error()) + return nil, err + } + + if querySelectors != nil { + builder.Modify(querySelectors...) + } + + results, err := builder.All(ctx) + if err != nil { + r.log.Errorf("query list failed: %s", err.Error()) + return nil, err + } + + items := make([]*v1.User, 0, len(results)) + for _, res := range results { + item := r.convertEntToProto(res) + items = append(items, item) + } + + count, err := r.Count(ctx, whereSelectors) + if err != nil { + return nil, err + } + + return &v1.ListUserResponse{ + Total: int32(count), + Items: items, + }, nil +} + +func (r *UserRepo) Get(ctx context.Context, req *v1.GetUserRequest) (*v1.User, error) { + ret, err := r.data.db.Client().User.Get(ctx, req.GetId()) + if err != nil && !ent.IsNotFound(err) { + r.log.Errorf("query one data failed: %s", err.Error()) + return nil, err + } + + u := r.convertEntToProto(ret) + + return u, err +} + +func (r *UserRepo) Create(ctx context.Context, req *v1.CreateUserRequest) error { + builder := r.data.db.Client().User.Create(). + SetNillableUsername(req.User.UserName). + SetNillableNickName(req.User.NickName). + SetNillableEmail(req.User.Email). + SetNillableRealName(req.User.RealName). + SetNillablePhone(req.User.Phone). + SetNillableOrgID(req.User.OrgId). + SetNillableRoleID(req.User.RoleId). + SetNillableWorkID(req.User.WorkId). + SetNillablePositionID(req.User.PositionId). + SetNillableAvatar(req.User.Avatar). + SetNillableStatus((*user.Status)(req.User.Status)). + SetNillableGender((*user.Gender)(req.User.Gender)). + SetCreateBy(req.GetOperatorId()). + SetCreateTime(time.Now()) + + if len(req.Password) > 0 { + cryptoPassword, err := crypto.HashPassword(req.GetPassword()) + if err == nil { + builder.SetPassword(cryptoPassword) + } + } + if req.User.Authority != nil { + builder.SetAuthority((user.Authority)(req.User.Authority.String())) + } + + err := builder.Exec(ctx) + if err != nil { + r.log.Errorf("insert one data failed: %s", err.Error()) + return err + } + + return nil +} + +func (r *UserRepo) Update(ctx context.Context, req *v1.UpdateUserRequest) error { + if req.UpdateMask != nil { + req.UpdateMask.Normalize() + if !req.UpdateMask.IsValid(req.User) { + return errors.New("invalid field mask") + } + fieldmaskutil.Filter(req.GetUser(), req.UpdateMask.GetPaths()) + } + + builder := r.data.db.Client().User.UpdateOneID(req.User.Id). + SetNillableNickName(req.User.NickName). + SetNillableEmail(req.User.Email). + SetNillableRealName(req.User.RealName). + SetNillablePhone(req.User.Phone). + SetNillableOrgID(req.User.OrgId). + SetNillableRoleID(req.User.RoleId). + SetNillableWorkID(req.User.WorkId). + SetNillablePositionID(req.User.PositionId). + SetNillableAvatar(req.User.Avatar). + SetNillableStatus((*user.Status)(req.User.Status)). + SetNillableGender((*user.Gender)(req.User.Gender)). + SetUpdateTime(time.Now()) + + if req.User.Authority != nil { + builder.SetAuthority((user.Authority)(req.User.Authority.String())) + } + if len(req.Password) > 0 { + cryptoPassword, err := crypto.HashPassword(req.GetPassword()) + if err == nil { + builder.SetPassword(cryptoPassword) + } + } + + if req.UpdateMask != nil { + nilPaths := fieldmaskutil.NilValuePaths(req.User, req.GetUpdateMask().GetPaths()) + _, nilUpdater := entgoUpdate.BuildSetNullUpdater(nilPaths) + if nilUpdater != nil { + builder.Modify(nilUpdater) + } + } + + err := builder.Exec(ctx) + if err != nil { + r.log.Errorf("update one data failed: %s", err.Error()) + return err + } + + return nil +} + +func (r *UserRepo) Delete(ctx context.Context, req *v1.DeleteUserRequest) (bool, error) { + err := r.data.db.Client().User. + DeleteOneID(req.GetId()). + Exec(ctx) + if err != nil { + r.log.Errorf("delete one data failed: %s", err.Error()) + } + + return err == nil, err +} + +func (r *UserRepo) GetUserByUserName(ctx context.Context, userName string) (*v1.User, error) { + ret, err := r.data.db.Client().User.Query(). + Where(user.UsernameEQ(userName)). + Only(ctx) + if err != nil { + r.log.Errorf("query user data failed: %s", err.Error()) + return nil, err + } + + u := r.convertEntToProto(ret) + return u, err +} + +func (r *UserRepo) VerifyPassword(ctx context.Context, req *v1.VerifyPasswordRequest) (*v1.User, error) { + ret, err := r.data.db.Client().User. + Query(). + Select(user.FieldID, user.FieldPassword). + Where(user.UsernameEQ(req.GetUserName())). + Only(ctx) + if err != nil { + r.log.Errorf("query user data failed: %s", err.Error()) + return nil, v1.ErrorUserNotExist("用户未找到") + } + + bMatched := crypto.CheckPasswordHash(req.GetPassword(), *ret.Password) + if !bMatched { + return nil, v1.ErrorInvalidPassword("密码错误") + } + + u := r.convertEntToProto(ret) + return u, err +} + +func (r *UserRepo) UserExists(ctx context.Context, req *v1.UserExistsRequest) (*v1.UserExistsResponse, error) { + count, _ := r.data.db.Client().User. + Query(). + Select(user.FieldID). + Where(user.UsernameEQ(req.GetUserName())). + Count(ctx) + return &v1.UserExistsResponse{ + Exist: count > 0, + }, nil +} diff --git a/monolithic/backend/app/admin/service/internal/data/user_test.go b/monolithic/backend/app/admin/service/internal/data/user_test.go new file mode 100644 index 0000000..e4fbbc8 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/user_test.go @@ -0,0 +1,101 @@ +package data + +import ( + "fmt" + "regexp" + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/tx7do/go-utils/fieldmaskutil" + "github.com/tx7do/go-utils/trans" + "google.golang.org/genproto/protobuf/field_mask" + "google.golang.org/protobuf/proto" + + userV1 "kratos-monolithic-demo/gen/api/go/user/service/v1" +) + +var reSpaces = regexp.MustCompile(`\s+`) + +func TestUserFieldMask(t *testing.T) { + u := &userV1.User{ + UserName: trans.String("UserName"), + RealName: trans.String("RealName"), + //Avatar: trans.String("Avatar"), + Address: trans.String("Address"), + } + + updateUserReq := &userV1.UpdateUserRequest{ + User: &userV1.User{ + UserName: trans.String("UserName1"), + RealName: trans.String("RealName1"), + //Avatar: trans.String("Avatar1"), + Address: trans.String("Address1"), + }, + UpdateMask: &field_mask.FieldMask{ + Paths: []string{"userName", "realName", "avatar", "roleId"}, + }, + } + updateUserReq.UpdateMask.Normalize() + if !updateUserReq.UpdateMask.IsValid(u) { + // Return an error. + panic("invalid field mask") + } + + fieldmaskutil.Filter(updateUserReq.GetUser(), updateUserReq.UpdateMask.GetPaths()) + proto.Merge(u, updateUserReq.GetUser()) + + fmt.Println(reSpaces.ReplaceAllString(u.String(), " ")) +} + +func TestFilterReuseMask(t *testing.T) { + users := []*userV1.User{ + { + Id: 1, + UserName: trans.String("name 1"), + }, + { + Id: 2, + UserName: trans.String("name 2"), + }, + } + // Create a mask only once and reuse it. + mask := fieldmaskutil.NestedMaskFromPaths([]string{"userName", "realName", "positionId"}) + for _, user := range users { + mask.Filter(user) + } + fmt.Println(users) + assert.Equal(t, len(users), 2) + // Output: [userName:"name 1" userName:"name 2"] +} + +func TestNilValuePaths(t *testing.T) { + u := &userV1.User{ + Id: 2, + UserName: trans.String("name 2"), + //RealName: trans.String(""), + } + paths := []string{"userName", "realName", "positionId"} + nilPaths := fieldmaskutil.NilValuePaths(u, paths) + fmt.Println(nilPaths) + fmt.Println(u.PositionId) +} + +func TestMessageNil(t *testing.T) { + u := &userV1.User{ + Id: 2, + UserName: trans.String("name 2"), + } + + pr := u.ProtoReflect() + md := pr.Descriptor() + fd := md.Fields().ByName("userName") + if fd == nil { + + } else { + fmt.Println(fd, fd.Name()) + } + + v := pr.Get(fd) + fmt.Println(v) +} diff --git a/monolithic/backend/app/admin/service/internal/data/user_token.go b/monolithic/backend/app/admin/service/internal/data/user_token.go new file mode 100644 index 0000000..a585beb --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/data/user_token.go @@ -0,0 +1,177 @@ +package data + +import ( + "context" + "errors" + "fmt" + "strconv" + "time" + + authn "github.com/tx7do/kratos-authn/engine" + authnEngine "github.com/tx7do/kratos-authn/engine" + + "github.com/go-kratos/kratos/v2/log" + "github.com/gofrs/uuid" + "github.com/redis/go-redis/v9" + + userV1 "kratos-monolithic-demo/gen/api/go/user/service/v1" +) + +type UserTokenRepo struct { + data *Data + log *log.Helper + authenticator authnEngine.Authenticator +} + +func NewUserTokenRepo(data *Data, authenticator authnEngine.Authenticator, logger log.Logger) *UserTokenRepo { + l := log.NewHelper(log.With(logger, "module", "user-token/repo/admin-service")) + return &UserTokenRepo{ + data: data, + log: l, + authenticator: authenticator, + } +} + +// createAccessJwtToken 生成JWT访问令牌 +func (r *UserTokenRepo) createAccessJwtToken(_ string, userId uint32) string { + principal := authn.AuthClaims{ + Subject: strconv.FormatUint(uint64(userId), 10), + Scopes: make(authn.ScopeSet), + } + + signedToken, err := r.authenticator.CreateIdentity(principal) + if err != nil { + return "" + } + + return signedToken +} + +// createRefreshToken 生成刷新令牌 +func (r *UserTokenRepo) createRefreshToken() string { + strUUID, _ := uuid.NewV4() + return strUUID.String() +} + +// GenerateToken 创建令牌 +func (r *UserTokenRepo) GenerateToken(ctx context.Context, user *userV1.User) (accessToken string, refreshToken string, err error) { + if accessToken = r.createAccessJwtToken(user.GetUserName(), user.GetId()); accessToken == "" { + err = errors.New("create access token failed") + return + } + + if err = r.setAccessTokenToRedis(ctx, user.GetId(), accessToken, 0); err != nil { + return + } + + if refreshToken = r.createRefreshToken(); refreshToken == "" { + err = errors.New("create refresh token failed") + return + } + + if err = r.setRefreshTokenToRedis(ctx, user.GetId(), refreshToken, 0); err != nil { + return + } + + return +} + +// GenerateAccessToken 创建访问令牌 +func (r *UserTokenRepo) GenerateAccessToken(ctx context.Context, userId uint32, userName string) (accessToken string, err error) { + if accessToken = r.createAccessJwtToken(userName, userId); accessToken == "" { + err = errors.New("create access token failed") + return + } + + if err = r.setAccessTokenToRedis(ctx, userId, accessToken, 0); err != nil { + return + } + + return +} + +// GenerateRefreshToken 创建刷新令牌 +func (r *UserTokenRepo) GenerateRefreshToken(ctx context.Context, user *userV1.User) (refreshToken string, err error) { + if refreshToken = r.createRefreshToken(); refreshToken == "" { + err = errors.New("create refresh token failed") + return + } + + if err = r.setRefreshTokenToRedis(ctx, user.GetId(), refreshToken, 0); err != nil { + return + } + + return +} + +// RemoveToken 移除所有令牌 +func (r *UserTokenRepo) RemoveToken(ctx context.Context, userId uint32) error { + var err error + if err = r.deleteAccessTokenFromRedis(ctx, userId); err != nil { + r.log.Errorf("remove user access token failed: [%v]", err) + } + + if err = r.deleteRefreshTokenFromRedis(ctx, userId); err != nil { + r.log.Errorf("remove user refresh token failed: [%v]", err) + } + + return err +} + +// GetAccessToken 获取访问令牌 +func (r *UserTokenRepo) GetAccessToken(ctx context.Context, userId uint32) string { + return r.getAccessTokenFromRedis(ctx, userId) +} + +// GetRefreshToken 获取刷新令牌 +func (r *UserTokenRepo) GetRefreshToken(ctx context.Context, userId uint32) string { + return r.getRefreshTokenFromRedis(ctx, userId) +} + +const userAccessTokenKeyPrefix = "a_uat_" + +func (r *UserTokenRepo) setAccessTokenToRedis(ctx context.Context, userId uint32, token string, expires int32) error { + key := fmt.Sprintf("%s%d", userAccessTokenKeyPrefix, userId) + return r.data.rdb.Set(ctx, key, token, time.Duration(expires)).Err() +} + +func (r *UserTokenRepo) getAccessTokenFromRedis(ctx context.Context, userId uint32) string { + key := fmt.Sprintf("%s%d", userAccessTokenKeyPrefix, userId) + result, err := r.data.rdb.Get(ctx, key).Result() + if err != nil { + if err != redis.Nil { + r.log.Errorf("get redis user access token failed: %s", err.Error()) + } + return "" + } + return result +} + +func (r *UserTokenRepo) deleteAccessTokenFromRedis(ctx context.Context, userId uint32) error { + key := fmt.Sprintf("%s%d", userAccessTokenKeyPrefix, userId) + return r.data.rdb.Del(ctx, key).Err() +} + +const userRefreshTokenKeyPrefix = "a_urt_" + +func (r *UserTokenRepo) setRefreshTokenToRedis(ctx context.Context, userId uint32, token string, expires int32) error { + key := fmt.Sprintf("%s%d", userRefreshTokenKeyPrefix, userId) + return r.data.rdb.Set(ctx, key, token, time.Duration(expires)).Err() +} + +func (r *UserTokenRepo) getRefreshTokenFromRedis(ctx context.Context, userId uint32) string { + key := fmt.Sprintf("%s%d", userRefreshTokenKeyPrefix, userId) + result, err := r.data.rdb.Get(ctx, key).Result() + if err != nil { + if err != redis.Nil { + r.log.Errorf("get redis user refresh token failed: %s", err.Error()) + } + return "" + } + return result +} + +func (r *UserTokenRepo) deleteRefreshTokenFromRedis(ctx context.Context, userId uint32) error { + key := fmt.Sprintf("%s%d", userRefreshTokenKeyPrefix, userId) + return r.data.rdb.Del(ctx, key).Err() +} diff --git a/monolithic/backend/app/admin/service/internal/server/asynq.go b/monolithic/backend/app/admin/service/internal/server/asynq.go new file mode 100644 index 0000000..8a03032 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/server/asynq.go @@ -0,0 +1,30 @@ +package server + +import ( + "time" + + "github.com/go-kratos/kratos/v2/log" + "github.com/tx7do/kratos-transport/transport/asynq" + + conf "github.com/tx7do/kratos-bootstrap/gen/api/go/conf/v1" + + "kratos-monolithic-demo/app/admin/service/internal/service" +) + +func NewAsynqServer(cfg *conf.Bootstrap, _ log.Logger, svc *service.TaskService) *asynq.Server { + loc, _ := time.LoadLocation("Asia/Shanghai") + + srv := asynq.NewServer( + asynq.WithAddress(cfg.Server.Asynq.GetEndpoint()), + asynq.WithRedisPassword(cfg.Server.Asynq.GetPassword()), + asynq.WithRedisDatabase(int(cfg.Server.Asynq.GetDb())), + asynq.WithLocation(loc), + ) + + svc.Server = srv + + svc.StartAllPeriodicTask() + svc.StartAllDelayTask() + + return srv +} diff --git a/monolithic/backend/app/admin/service/internal/server/init.go b/monolithic/backend/app/admin/service/internal/server/init.go new file mode 100644 index 0000000..90cf150 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/server/init.go @@ -0,0 +1,14 @@ +//go:build wireinject +// +build wireinject + +package server + +import ( + "github.com/google/wire" +) + +// ProviderSet is server providers. +var ProviderSet = wire.NewSet( + NewRESTServer, + NewAsynqServer, +) diff --git a/monolithic/backend/app/admin/service/internal/server/rest.go b/monolithic/backend/app/admin/service/internal/server/rest.go new file mode 100644 index 0000000..c837405 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/server/rest.go @@ -0,0 +1,89 @@ +package server + +import ( + "context" + + "github.com/go-kratos/kratos/v2/log" + "github.com/go-kratos/kratos/v2/middleware" + "github.com/go-kratos/kratos/v2/middleware/logging" + "github.com/go-kratos/kratos/v2/middleware/selector" + "github.com/go-kratos/kratos/v2/transport/http" + + authnEngine "github.com/tx7do/kratos-authn/engine" + authn "github.com/tx7do/kratos-authn/middleware" + + authzEngine "github.com/tx7do/kratos-authz/engine" + authz "github.com/tx7do/kratos-authz/middleware" + + swaggerUI "github.com/tx7do/kratos-swagger-ui" + + bootstrap "github.com/tx7do/kratos-bootstrap" + conf "github.com/tx7do/kratos-bootstrap/gen/api/go/conf/v1" + + "kratos-monolithic-demo/app/admin/service/cmd/server/assets" + "kratos-monolithic-demo/app/admin/service/internal/service" + + adminV1 "kratos-monolithic-demo/gen/api/go/admin/service/v1" + "kratos-monolithic-demo/pkg/middleware/auth" +) + +// NewWhiteListMatcher 创建jwt白名单 +func newRestWhiteListMatcher() selector.MatchFunc { + whiteList := make(map[string]bool) + whiteList[adminV1.OperationAuthenticationServiceLogin] = true + return func(ctx context.Context, operation string) bool { + if _, ok := whiteList[operation]; ok { + return false + } + return true + } +} + +// NewMiddleware 创建中间件 +func newRestMiddleware(authenticator authnEngine.Authenticator, authorizer authzEngine.Engine, logger log.Logger) []middleware.Middleware { + var ms []middleware.Middleware + ms = append(ms, logging.Server(logger)) + ms = append(ms, selector.Server( + authn.Server(authenticator), + auth.Server(), + authz.Server(authorizer), + ).Match(newRestWhiteListMatcher()).Build()) + return ms +} + +// NewRESTServer new an HTTP server. +func NewRESTServer( + cfg *conf.Bootstrap, logger log.Logger, + authenticator authnEngine.Authenticator, authorizer authzEngine.Engine, + authnSvc *service.AuthenticationService, + userSvc *service.UserService, + dictSvc *service.DictService, + dictDetailSvc *service.DictDetailService, + menuSvc *service.MenuService, + routerSvc *service.RouterService, + orgSvc *service.OrganizationService, + roleSvc *service.RoleService, + positionSvc *service.PositionService, +) *http.Server { + srv := bootstrap.CreateRestServer(cfg, newRestMiddleware(authenticator, authorizer, logger)...) + + adminV1.RegisterAuthenticationServiceHTTPServer(srv, authnSvc) + adminV1.RegisterUserServiceHTTPServer(srv, userSvc) + adminV1.RegisterDictServiceHTTPServer(srv, dictSvc) + adminV1.RegisterDictDetailServiceHTTPServer(srv, dictDetailSvc) + adminV1.RegisterMenuServiceHTTPServer(srv, menuSvc) + adminV1.RegisterRouterServiceHTTPServer(srv, routerSvc) + adminV1.RegisterOrganizationServiceHTTPServer(srv, orgSvc) + adminV1.RegisterRoleServiceHTTPServer(srv, roleSvc) + adminV1.RegisterPositionServiceHTTPServer(srv, positionSvc) + + if cfg.GetServer().GetRest().GetEnableSwagger() { + swaggerUI.RegisterSwaggerUIServerWithOption( + srv, + swaggerUI.WithTitle("Kratos巨石应用实践"), + swaggerUI.WithMemoryData(assets.OpenApiData, "yaml"), + ) + } + + return srv +} diff --git a/monolithic/backend/app/admin/service/internal/service/README.md b/monolithic/backend/app/admin/service/internal/service/README.md new file mode 100644 index 0000000..2cbd151 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/service/README.md @@ -0,0 +1 @@ +# Service diff --git a/monolithic/backend/app/admin/service/internal/service/authentication.go b/monolithic/backend/app/admin/service/internal/service/authentication.go new file mode 100644 index 0000000..cf64617 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/service/authentication.go @@ -0,0 +1,104 @@ +package service + +import ( + "context" + + "github.com/go-kratos/kratos/v2/log" + "google.golang.org/protobuf/types/known/emptypb" + + "kratos-monolithic-demo/app/admin/service/internal/data" + + adminV1 "kratos-monolithic-demo/gen/api/go/admin/service/v1" + userV1 "kratos-monolithic-demo/gen/api/go/user/service/v1" + + "kratos-monolithic-demo/pkg/middleware/auth" +) + +type AuthenticationService struct { + adminV1.AuthenticationServiceHTTPServer + + uc *data.UserRepo + utuc *data.UserTokenRepo + + log *log.Helper +} + +func NewAuthenticationService(logger log.Logger, uc *data.UserRepo, utuc *data.UserTokenRepo) *AuthenticationService { + l := log.NewHelper(log.With(logger, "module", "authn/service/admin-service")) + return &AuthenticationService{ + log: l, + uc: uc, + utuc: utuc, + } +} + +// Login 登陆 +func (s *AuthenticationService) Login(ctx context.Context, req *adminV1.LoginRequest) (*adminV1.LoginResponse, error) { + var user *userV1.User + var err error + if user, err = s.uc.VerifyPassword(ctx, &userV1.VerifyPasswordRequest{ + UserName: req.GetUsername(), + Password: req.GetPassword(), + }); err != nil { + return nil, err + } + + accessToken, refreshToken, err := s.utuc.GenerateToken(ctx, user) + if err != nil { + return nil, err + } + + return &adminV1.LoginResponse{ + TokenType: "bearer", + AccessToken: accessToken, + RefreshToken: refreshToken, + }, nil +} + +// Logout 登出 +func (s *AuthenticationService) Logout(ctx context.Context, req *adminV1.LogoutRequest) (*emptypb.Empty, error) { + err := s.utuc.RemoveToken(ctx, req.GetId()) + if err != nil { + return nil, err + } + return &emptypb.Empty{}, nil +} + +func (s *AuthenticationService) GetMe(ctx context.Context, req *adminV1.GetMeRequest) (*userV1.User, error) { + authInfo, err := auth.FromContext(ctx) + if err != nil { + s.log.Errorf("[%d] 用户认证失败[%s]", authInfo, err.Error()) + return nil, adminV1.ErrorAccessForbidden("用户认证失败") + } + + req.Id = authInfo.UserId + ret, err := s.uc.Get(ctx, &userV1.GetUserRequest{ + Id: req.GetId(), + }) + return ret, err +} + +// RefreshToken 刷新令牌 +func (s *AuthenticationService) RefreshToken(ctx context.Context, req *adminV1.RefreshTokenRequest) (*adminV1.LoginResponse, error) { + authInfo, err := auth.FromContext(ctx) + if err != nil { + s.log.Errorf("[%d] 用户认证失败[%s]", authInfo, err.Error()) + return nil, adminV1.ErrorAccessForbidden("用户认证失败") + } + + refreshToken := s.utuc.GetRefreshToken(ctx, authInfo.UserId) + if refreshToken != req.GetRefreshToken() { + return nil, adminV1.ErrorInvalidToken("非法的刷新令牌") + } + + accessToken, err := s.utuc.GenerateAccessToken(ctx, authInfo.UserId, authInfo.UserName) + if err != nil { + return nil, err + } + + return &adminV1.LoginResponse{ + TokenType: "bearer", + AccessToken: accessToken, + RefreshToken: refreshToken, + }, nil +} diff --git a/monolithic/backend/app/admin/service/internal/service/dict.go b/monolithic/backend/app/admin/service/internal/service/dict.go new file mode 100644 index 0000000..877a037 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/service/dict.go @@ -0,0 +1,77 @@ +package service + +import ( + "context" + + "github.com/go-kratos/kratos/v2/log" + "google.golang.org/protobuf/types/known/emptypb" + + "kratos-monolithic-demo/app/admin/service/internal/data" + + adminV1 "kratos-monolithic-demo/gen/api/go/admin/service/v1" + systemV1 "kratos-monolithic-demo/gen/api/go/system/service/v1" + + pagination "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" +) + +type DictService struct { + adminV1.DictDetailServiceHTTPServer + + uc *data.DictRepo + log *log.Helper +} + +func NewDictService(logger log.Logger, uc *data.DictRepo) *DictService { + l := log.NewHelper(log.With(logger, "module", "dict/service/admin-service")) + return &DictService{ + log: l, + uc: uc, + } +} + +func (s *DictService) ListDict(ctx context.Context, req *pagination.PagingRequest) (*systemV1.ListDictResponse, error) { + ret, err := s.uc.List(ctx, req) + if err != nil { + + return nil, err + } + + return ret, nil +} + +func (s *DictService) GetDict(ctx context.Context, req *systemV1.GetDictRequest) (*systemV1.Dict, error) { + ret, err := s.uc.Get(ctx, req) + if err != nil { + + return nil, err + } + + return ret, nil +} + +func (s *DictService) CreateDict(ctx context.Context, req *systemV1.CreateDictRequest) (*emptypb.Empty, error) { + err := s.uc.Create(ctx, req) + if err != nil { + return nil, err + } + + return &emptypb.Empty{}, nil +} + +func (s *DictService) UpdateDict(ctx context.Context, req *systemV1.UpdateDictRequest) (*emptypb.Empty, error) { + err := s.uc.Update(ctx, req) + if err != nil { + return nil, err + } + + return &emptypb.Empty{}, nil +} + +func (s *DictService) DeleteDict(ctx context.Context, req *systemV1.DeleteDictRequest) (*emptypb.Empty, error) { + _, err := s.uc.Delete(ctx, req) + if err != nil { + return nil, err + } + + return &emptypb.Empty{}, nil +} diff --git a/monolithic/backend/app/admin/service/internal/service/dict_detail.go b/monolithic/backend/app/admin/service/internal/service/dict_detail.go new file mode 100644 index 0000000..77d9018 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/service/dict_detail.go @@ -0,0 +1,90 @@ +package service + +import ( + "context" + + "github.com/go-kratos/kratos/v2/log" + "google.golang.org/protobuf/types/known/emptypb" + + "kratos-monolithic-demo/app/admin/service/internal/data" + + adminV1 "kratos-monolithic-demo/gen/api/go/admin/service/v1" + systemV1 "kratos-monolithic-demo/gen/api/go/system/service/v1" + + pagination "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" +) + +type DictDetailService struct { + adminV1.DictDetailServiceHTTPServer + + uc *data.DictDetailRepo + log *log.Helper +} + +func NewDictDetailService(logger log.Logger, uc *data.DictDetailRepo) *DictDetailService { + l := log.NewHelper(log.With(logger, "module", "dict-detail/service/admin-service")) + return &DictDetailService{ + log: l, + uc: uc, + } +} + +func (s *DictDetailService) ListDictDetail(ctx context.Context, req *pagination.PagingRequest) (*systemV1.ListDictDetailResponse, error) { + ret, err := s.uc.List(ctx, req) + if err != nil { + + return nil, err + } + + return ret, nil +} + +func (s *DictDetailService) GetDictDetail(ctx context.Context, req *systemV1.GetDictDetailRequest) (*systemV1.DictDetail, error) { + ret, err := s.uc.Get(ctx, req) + if err != nil { + + return nil, err + } + + return ret, nil +} + +func (s *DictDetailService) CreateDictDetail(ctx context.Context, req *systemV1.CreateDictDetailRequest) (*emptypb.Empty, error) { + err := s.uc.Create(ctx, req) + if err != nil { + // s.log.Info(err) + return nil, err + } + + return &emptypb.Empty{}, nil +} + +func (s *DictDetailService) UpdateDictDetail(ctx context.Context, req *systemV1.UpdateDictDetailRequest) (*emptypb.Empty, error) { + err := s.uc.Update(ctx, req) + if err != nil { + + return nil, err + } + + return &emptypb.Empty{}, nil +} + +func (s *DictDetailService) DeleteDictDetail(ctx context.Context, req *systemV1.DeleteDictDetailRequest) (*emptypb.Empty, error) { + _, err := s.uc.Delete(ctx, req) + if err != nil { + + return nil, err + } + + return &emptypb.Empty{}, nil +} + +func (s *DictDetailService) GetDictDetailByCode(ctx context.Context, req *systemV1.GetDictDetailRequest) (*systemV1.DictDetail, error) { + ret, err := s.uc.Get(ctx, req) + if err != nil { + + return nil, err + } + + return ret, nil +} diff --git a/monolithic/backend/app/admin/service/internal/service/init.go b/monolithic/backend/app/admin/service/internal/service/init.go new file mode 100644 index 0000000..13aff7e --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/service/init.go @@ -0,0 +1,22 @@ +//go:build wireinject +// +build wireinject + +package service + +import ( + "github.com/google/wire" +) + +// ProviderSet is service providers. +var ProviderSet = wire.NewSet( + NewAuthenticationService, + NewUserService, + NewDictService, + NewDictDetailService, + NewMenuService, + NewRouterService, + NewTaskService, + NewRoleService, + NewOrganizationService, + NewPositionService, +) diff --git a/monolithic/backend/app/admin/service/internal/service/menu.go b/monolithic/backend/app/admin/service/internal/service/menu.go new file mode 100644 index 0000000..8dc68cb --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/service/menu.go @@ -0,0 +1,81 @@ +package service + +import ( + "context" + + "github.com/go-kratos/kratos/v2/log" + "google.golang.org/protobuf/types/known/emptypb" + + "kratos-monolithic-demo/app/admin/service/internal/data" + + adminV1 "kratos-monolithic-demo/gen/api/go/admin/service/v1" + systemV1 "kratos-monolithic-demo/gen/api/go/system/service/v1" + + pagination "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" +) + +type MenuService struct { + adminV1.MenuServiceHTTPServer + + log *log.Helper + + uc *data.MenuRepo +} + +func NewMenuService(uc *data.MenuRepo, logger log.Logger) *MenuService { + l := log.NewHelper(log.With(logger, "module", "menu/service/admin-service")) + return &MenuService{ + log: l, + uc: uc, + } +} + +func (s *MenuService) ListMenu(ctx context.Context, req *pagination.PagingRequest) (*systemV1.ListMenuResponse, error) { + ret, err := s.uc.List(ctx, req) + if err != nil { + + return nil, err + } + + return ret, nil +} + +func (s *MenuService) GetMenu(ctx context.Context, req *systemV1.GetMenuRequest) (*systemV1.Menu, error) { + ret, err := s.uc.Get(ctx, req) + if err != nil { + + return nil, err + } + + return ret, nil +} + +func (s *MenuService) CreateMenu(ctx context.Context, req *systemV1.CreateMenuRequest) (*emptypb.Empty, error) { + err := s.uc.Create(ctx, req) + if err != nil { + + return nil, err + } + + return &emptypb.Empty{}, nil +} + +func (s *MenuService) UpdateMenu(ctx context.Context, req *systemV1.UpdateMenuRequest) (*emptypb.Empty, error) { + err := s.uc.Update(ctx, req) + if err != nil { + + return nil, err + } + + return &emptypb.Empty{}, nil +} + +func (s *MenuService) DeleteMenu(ctx context.Context, req *systemV1.DeleteMenuRequest) (*emptypb.Empty, error) { + _, err := s.uc.Delete(ctx, req) + if err != nil { + + return nil, err + } + + return &emptypb.Empty{}, nil +} diff --git a/monolithic/backend/app/admin/service/internal/service/organization.go b/monolithic/backend/app/admin/service/internal/service/organization.go new file mode 100644 index 0000000..85e1efa --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/service/organization.go @@ -0,0 +1,67 @@ +package service + +import ( + "context" + + "github.com/go-kratos/kratos/v2/log" + "google.golang.org/protobuf/types/known/emptypb" + + "kratos-monolithic-demo/app/admin/service/internal/data" + + pagination "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + + v1 "kratos-monolithic-demo/gen/api/go/user/service/v1" + v12 "kratos-monolithic-demo/gen/api/go/user/service/v1" +) + +type OrganizationService struct { + v12.UnimplementedOrganizationServiceServer + + log *log.Helper + + uc *data.OrganizationRepo +} + +func NewOrganizationService(uc *data.OrganizationRepo, logger log.Logger) *OrganizationService { + l := log.NewHelper(log.With(logger, "module", "organization/service/admin-service")) + return &OrganizationService{ + log: l, + uc: uc, + } +} + +func (s *OrganizationService) ListOrganization(ctx context.Context, req *pagination.PagingRequest) (*v1.ListOrganizationResponse, error) { + return s.uc.List(ctx, req) +} + +func (s *OrganizationService) GetOrganization(ctx context.Context, req *v1.GetOrganizationRequest) (*v1.Organization, error) { + return s.uc.Get(ctx, req) +} + +func (s *OrganizationService) CreateOrganization(ctx context.Context, req *v1.CreateOrganizationRequest) (*emptypb.Empty, error) { + err := s.uc.Create(ctx, req) + if err != nil { + + return nil, err + } + + return &emptypb.Empty{}, nil +} + +func (s *OrganizationService) UpdateOrganization(ctx context.Context, req *v1.UpdateOrganizationRequest) (*emptypb.Empty, error) { + err := s.uc.Update(ctx, req) + if err != nil { + + return nil, err + } + + return &emptypb.Empty{}, nil +} + +func (s *OrganizationService) DeleteOrganization(ctx context.Context, req *v1.DeleteOrganizationRequest) (*emptypb.Empty, error) { + _, err := s.uc.Delete(ctx, req) + if err != nil { + return nil, err + } + return &emptypb.Empty{}, nil +} diff --git a/monolithic/backend/app/admin/service/internal/service/position.go b/monolithic/backend/app/admin/service/internal/service/position.go new file mode 100644 index 0000000..413485a --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/service/position.go @@ -0,0 +1,66 @@ +package service + +import ( + "context" + + "github.com/go-kratos/kratos/v2/log" + "google.golang.org/protobuf/types/known/emptypb" + + "kratos-monolithic-demo/app/admin/service/internal/data" + + pagination "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + userV1 "kratos-monolithic-demo/gen/api/go/user/service/v1" +) + +type PositionService struct { + userV1.UnimplementedPositionServiceServer + + log *log.Helper + + uc *data.PositionRepo +} + +func NewPositionService(uc *data.PositionRepo, logger log.Logger) *PositionService { + l := log.NewHelper(log.With(logger, "module", "position/service/admin-service")) + return &PositionService{ + log: l, + uc: uc, + } +} + +func (s *PositionService) ListPosition(ctx context.Context, req *pagination.PagingRequest) (*userV1.ListPositionResponse, error) { + return s.uc.List(ctx, req) +} + +func (s *PositionService) GetPosition(ctx context.Context, req *userV1.GetPositionRequest) (*userV1.Position, error) { + return s.uc.Get(ctx, req) +} + +func (s *PositionService) CreatePosition(ctx context.Context, req *userV1.CreatePositionRequest) (*emptypb.Empty, error) { + err := s.uc.Create(ctx, req) + if err != nil { + + return nil, err + } + + return &emptypb.Empty{}, nil +} + +func (s *PositionService) UpdatePosition(ctx context.Context, req *userV1.UpdatePositionRequest) (*emptypb.Empty, error) { + err := s.uc.Update(ctx, req) + if err != nil { + + return nil, err + } + + return &emptypb.Empty{}, nil +} + +func (s *PositionService) DeletePosition(ctx context.Context, req *userV1.DeletePositionRequest) (*emptypb.Empty, error) { + _, err := s.uc.Delete(ctx, req) + if err != nil { + return nil, err + } + + return &emptypb.Empty{}, nil +} diff --git a/monolithic/backend/app/admin/service/internal/service/role.go b/monolithic/backend/app/admin/service/internal/service/role.go new file mode 100644 index 0000000..7c9df09 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/service/role.go @@ -0,0 +1,65 @@ +package service + +import ( + "context" + + "github.com/go-kratos/kratos/v2/log" + "google.golang.org/protobuf/types/known/emptypb" + + "kratos-monolithic-demo/app/admin/service/internal/data" + + pagination "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + userV1 "kratos-monolithic-demo/gen/api/go/user/service/v1" +) + +type RoleService struct { + userV1.UnimplementedRoleServiceServer + + log *log.Helper + + uc *data.RoleRepo +} + +func NewRoleService(uc *data.RoleRepo, logger log.Logger) *RoleService { + l := log.NewHelper(log.With(logger, "module", "role/service/admin-service")) + return &RoleService{ + log: l, + uc: uc, + } +} + +func (s *RoleService) ListRole(ctx context.Context, req *pagination.PagingRequest) (*userV1.ListRoleResponse, error) { + return s.uc.List(ctx, req) +} + +func (s *RoleService) GetRole(ctx context.Context, req *userV1.GetRoleRequest) (*userV1.Role, error) { + return s.uc.Get(ctx, req) +} + +func (s *RoleService) CreateRole(ctx context.Context, req *userV1.CreateRoleRequest) (*emptypb.Empty, error) { + err := s.uc.Create(ctx, req) + if err != nil { + + return nil, err + } + + return &emptypb.Empty{}, nil +} + +func (s *RoleService) UpdateRole(ctx context.Context, req *userV1.UpdateRoleRequest) (*emptypb.Empty, error) { + err := s.uc.Update(ctx, req) + if err != nil { + + return nil, err + } + + return &emptypb.Empty{}, nil +} + +func (s *RoleService) DeleteRole(ctx context.Context, req *userV1.DeleteRoleRequest) (*emptypb.Empty, error) { + _, err := s.uc.Delete(ctx, req) + if err != nil { + return nil, err + } + return &emptypb.Empty{}, nil +} diff --git a/monolithic/backend/app/admin/service/internal/service/router.go b/monolithic/backend/app/admin/service/internal/service/router.go new file mode 100644 index 0000000..5961434 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/service/router.go @@ -0,0 +1,91 @@ +package service + +import ( + "context" + "errors" + + "github.com/go-kratos/kratos/v2/log" + "github.com/tx7do/go-utils/trans" + "google.golang.org/protobuf/types/known/emptypb" + + "kratos-monolithic-demo/app/admin/service/internal/data" + + adminV1 "kratos-monolithic-demo/gen/api/go/admin/service/v1" + systemV1 "kratos-monolithic-demo/gen/api/go/system/service/v1" + + pagination "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" +) + +type RouterService struct { + adminV1.RouterServiceHTTPServer + + log *log.Helper + uc *data.MenuRepo +} + +func NewRouterService(logger log.Logger, uc *data.MenuRepo) *RouterService { + l := log.NewHelper(log.With(logger, "module", "router/service/admin-service")) + return &RouterService{ + log: l, + uc: uc, + } +} + +func (s *RouterService) ListPermissionCode(_ context.Context, _ *emptypb.Empty) (*adminV1.ListPermissionCodeResponse, error) { + return &adminV1.ListPermissionCodeResponse{}, nil +} + +func fillRouteItem(menus []*systemV1.Menu) []*adminV1.RouteItem { + if len(menus) == 0 { + return nil + } + + var routers []*adminV1.RouteItem + + for _, v := range menus { + if !v.GetShow() { + continue + } + if v.GetType() == systemV1.MenuType_BUTTON { + continue + } + + item := &adminV1.RouteItem{ + Path: v.Path, + Component: v.Component, + Name: v.Name, + Redirect: v.Redirect, + Meta: &adminV1.RouteMeta{ + OrderNo: v.OrderNo, + Title: v.Title, + Icon: v.Icon, + HideBreadcrumb: v.HideBreadcrumb, + HideTab: v.HideTab, + HideMenu: v.HideMenu, + CurrentActiveMenu: v.CurrentActiveMenu, + }, + } + + if len(v.Children) > 0 { + item.Children = fillRouteItem(v.Children) + } + + routers = append(routers, item) + } + + return routers +} + +func (s *RouterService) ListRoute(ctx context.Context, _ *emptypb.Empty) (*adminV1.ListRouteResponse, error) { + menuList, err := s.uc.List(ctx, &pagination.PagingRequest{ + NoPaging: trans.Bool(true), + }) + if err != nil { + s.log.Errorf("查询列表发生错误[%s]", err.Error()) + return nil, errors.New("读取列表发生错误") + } + + resp := &adminV1.ListRouteResponse{Items: fillRouteItem(menuList.Items)} + + return resp, nil +} diff --git a/monolithic/backend/app/admin/service/internal/service/task.go b/monolithic/backend/app/admin/service/internal/service/task.go new file mode 100644 index 0000000..dd2ce94 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/service/task.go @@ -0,0 +1,36 @@ +package service + +import ( + "github.com/go-kratos/kratos/v2/log" + "github.com/tx7do/kratos-transport/transport/asynq" + + "kratos-monolithic-demo/app/admin/service/internal/data" +) + +type TaskService struct { + log *log.Helper + + Server *asynq.Server + + userRepo *data.UserRepo +} + +func NewTaskService( + logger log.Logger, + userRepo *data.UserRepo, +) *TaskService { + l := log.NewHelper(log.With(logger, "module", "task/service/admin-service")) + return &TaskService{ + log: l, + userRepo: userRepo, + } +} + +// StartAllPeriodicTask 启动所有的定时任务 +func (s *TaskService) StartAllPeriodicTask() { +} + +// StartAllDelayTask 启动所有的延迟任务 +func (s *TaskService) StartAllDelayTask() { + +} diff --git a/monolithic/backend/app/admin/service/internal/service/user.go b/monolithic/backend/app/admin/service/internal/service/user.go new file mode 100644 index 0000000..0b68996 --- /dev/null +++ b/monolithic/backend/app/admin/service/internal/service/user.go @@ -0,0 +1,101 @@ +package service + +import ( + "context" + + "github.com/go-kratos/kratos/v2/log" + "github.com/tx7do/go-utils/trans" + "google.golang.org/protobuf/types/known/emptypb" + + "kratos-monolithic-demo/app/admin/service/internal/data" + + adminV1 "kratos-monolithic-demo/gen/api/go/admin/service/v1" + userV1 "kratos-monolithic-demo/gen/api/go/user/service/v1" + + pagination "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + + "kratos-monolithic-demo/pkg/middleware/auth" +) + +type UserService struct { + adminV1.UserServiceHTTPServer + + uc *data.UserRepo + log *log.Helper +} + +func NewUserService(logger log.Logger, uc *data.UserRepo) *UserService { + l := log.NewHelper(log.With(logger, "module", "user/service/admin-service")) + return &UserService{ + log: l, + uc: uc, + } +} + +func (s *UserService) ListUser(ctx context.Context, req *pagination.PagingRequest) (*userV1.ListUserResponse, error) { + return s.uc.List(ctx, req) +} + +func (s *UserService) GetUser(ctx context.Context, req *userV1.GetUserRequest) (*userV1.User, error) { + return s.uc.Get(ctx, req) +} + +func (s *UserService) GetUserByUserName(ctx context.Context, req *userV1.GetUserByUserNameRequest) (*userV1.User, error) { + return s.uc.GetUserByUserName(ctx, req.GetUserName()) +} + +func (s *UserService) CreateUser(ctx context.Context, req *userV1.CreateUserRequest) (*emptypb.Empty, error) { + authInfo, err := auth.FromContext(ctx) + if err != nil { + s.log.Errorf("[%d] 用户认证失败[%s]", authInfo, err.Error()) + return nil, adminV1.ErrorAccessForbidden("用户认证失败") + } + + if req.User == nil { + return nil, adminV1.ErrorBadRequest("错误的参数") + } + + req.OperatorId = authInfo.UserId + req.User.CreatorId = trans.Uint32(authInfo.UserId) + if req.User.Authority == nil { + req.User.Authority = userV1.UserAuthority_CUSTOMER_USER.Enum() + } + + err = s.uc.Create(ctx, req) + return &emptypb.Empty{}, nil +} + +func (s *UserService) UpdateUser(ctx context.Context, req *userV1.UpdateUserRequest) (*emptypb.Empty, error) { + authInfo, err := auth.FromContext(ctx) + if err != nil { + s.log.Errorf("[%d] 用户认证失败[%s]", authInfo, err.Error()) + return nil, adminV1.ErrorAccessForbidden("用户认证失败") + } + + if req.User == nil { + return nil, adminV1.ErrorBadRequest("错误的参数") + } + + req.OperatorId = authInfo.UserId + + err = s.uc.Update(ctx, req) + return &emptypb.Empty{}, nil +} + +func (s *UserService) DeleteUser(ctx context.Context, req *userV1.DeleteUserRequest) (*emptypb.Empty, error) { + authInfo, err := auth.FromContext(ctx) + if err != nil { + s.log.Errorf("[%d] 用户认证失败[%s]", authInfo, err.Error()) + return nil, adminV1.ErrorAccessForbidden("用户认证失败") + } + + req.OperatorId = authInfo.UserId + + _, err = s.uc.Delete(ctx, req) + + return &emptypb.Empty{}, err +} + +func (s *UserService) UserExists(ctx context.Context, req *userV1.UserExistsRequest) (*userV1.UserExistsResponse, error) { + return s.uc.UserExists(ctx, req) +} diff --git a/monolithic/backend/buf.gen.yaml b/monolithic/backend/buf.gen.yaml new file mode 100644 index 0000000..3e14387 --- /dev/null +++ b/monolithic/backend/buf.gen.yaml @@ -0,0 +1,50 @@ +# 配置protoc生成规则 +version: v1 + +managed: + enabled: true + optimize_for: SPEED + + go_package_prefix: + default: kratos-monolithic-demo/gen/api/go + except: + - 'buf.build/googleapis/googleapis' + - 'buf.build/envoyproxy/protoc-gen-validate' + - 'buf.build/kratos/apis' + - 'buf.build/gnostic/gnostic' + - 'buf.build/gogo/protobuf' + - 'buf.build/tx7do/pagination' + +plugins: + # 使用go插件生成go代码 + #- plugin: buf.build/protocolbuffers/go + - name: go + out: gen/api/go + opt: paths=source_relative # 使用相对路径 + + # 使用go-grpc插件生成gRPC服务代码 + #- plugin: buf.build/grpc/go + - name: go-grpc + out: gen/api/go + opt: + - paths=source_relative # 使用相对路径 + + # generate rest service code + - name: go-http + out: gen/api/go + opt: + - paths=source_relative # 使用相对路径 + + # generate kratos errors code + - name: go-errors + out: gen/api/go + opt: + - paths=source_relative # 使用相对路径 + + # generate message validator code + #- plugin: buf.build/bufbuild/validate-go + - name: validate + out: gen/api/go + opt: + - paths=source_relative # 使用相对路径 + - lang=go diff --git a/monolithic/backend/buf.lock b/monolithic/backend/buf.lock new file mode 100644 index 0000000..c91b581 --- /dev/null +++ b/monolithic/backend/buf.lock @@ -0,0 +1,2 @@ +# Generated by buf. DO NOT EDIT. +version: v1 diff --git a/monolithic/backend/buf.work.yaml b/monolithic/backend/buf.work.yaml new file mode 100644 index 0000000..f8a436c --- /dev/null +++ b/monolithic/backend/buf.work.yaml @@ -0,0 +1,4 @@ +version: v1 + +directories: + - api \ No newline at end of file diff --git a/monolithic/backend/buf.yaml b/monolithic/backend/buf.yaml new file mode 100644 index 0000000..e98a791 --- /dev/null +++ b/monolithic/backend/buf.yaml @@ -0,0 +1,9 @@ +version: v1 + +breaking: + use: + - FILE + +lint: + use: + - DEFAULT diff --git a/monolithic/backend/gen/api/go/admin/service/v1/admin_error.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/admin_error.pb.go new file mode 100644 index 0000000..4e2e4a0 --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/admin_error.pb.go @@ -0,0 +1,235 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: admin/service/v1/admin_error.proto + +package servicev1 + +import ( + _ "github.com/go-kratos/kratos/v2/errors" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type AdminErrorReason int32 + +const ( + AdminErrorReason_NOT_LOGGED_IN AdminErrorReason = 0 // 401 + AdminErrorReason_ACCESS_FORBIDDEN AdminErrorReason = 1 // 403 + AdminErrorReason_RESOURCE_NOT_FOUND AdminErrorReason = 2 // 404 + AdminErrorReason_METHOD_NOT_ALLOWED AdminErrorReason = 3 // 405 + AdminErrorReason_REQUEST_TIMEOUT AdminErrorReason = 4 // 408 + AdminErrorReason_INTERNAL_SERVER_ERROR AdminErrorReason = 5 // 500 + AdminErrorReason_NOT_IMPLEMENTED AdminErrorReason = 6 // 501 + AdminErrorReason_NETWORK_ERROR AdminErrorReason = 7 // 502 + AdminErrorReason_SERVICE_UNAVAILABLE AdminErrorReason = 8 // 503 + AdminErrorReason_NETWORK_TIMEOUT AdminErrorReason = 9 // 504 + AdminErrorReason_REQUEST_NOT_SUPPORT AdminErrorReason = 10 // 505 + AdminErrorReason_USER_NOT_FOUND AdminErrorReason = 11 + AdminErrorReason_INCORRECT_PASSWORD AdminErrorReason = 12 + AdminErrorReason_USER_FREEZE AdminErrorReason = 13 + AdminErrorReason_INVALID_USERID AdminErrorReason = 14 // 用户ID无效 + AdminErrorReason_INVALID_PASSWORD AdminErrorReason = 15 // 密码无效 + AdminErrorReason_TOKEN_EXPIRED AdminErrorReason = 16 // token过期 + AdminErrorReason_INVALID_TOKEN AdminErrorReason = 17 // token无效 + AdminErrorReason_TOKEN_NOT_EXIST AdminErrorReason = 18 // token不存在 + AdminErrorReason_USER_NOT_EXIST AdminErrorReason = 19 // 用户不存在 + AdminErrorReason_BAD_REQUEST AdminErrorReason = 20 // 400 +) + +// Enum value maps for AdminErrorReason. +var ( + AdminErrorReason_name = map[int32]string{ + 0: "NOT_LOGGED_IN", + 1: "ACCESS_FORBIDDEN", + 2: "RESOURCE_NOT_FOUND", + 3: "METHOD_NOT_ALLOWED", + 4: "REQUEST_TIMEOUT", + 5: "INTERNAL_SERVER_ERROR", + 6: "NOT_IMPLEMENTED", + 7: "NETWORK_ERROR", + 8: "SERVICE_UNAVAILABLE", + 9: "NETWORK_TIMEOUT", + 10: "REQUEST_NOT_SUPPORT", + 11: "USER_NOT_FOUND", + 12: "INCORRECT_PASSWORD", + 13: "USER_FREEZE", + 14: "INVALID_USERID", + 15: "INVALID_PASSWORD", + 16: "TOKEN_EXPIRED", + 17: "INVALID_TOKEN", + 18: "TOKEN_NOT_EXIST", + 19: "USER_NOT_EXIST", + 20: "BAD_REQUEST", + } + AdminErrorReason_value = map[string]int32{ + "NOT_LOGGED_IN": 0, + "ACCESS_FORBIDDEN": 1, + "RESOURCE_NOT_FOUND": 2, + "METHOD_NOT_ALLOWED": 3, + "REQUEST_TIMEOUT": 4, + "INTERNAL_SERVER_ERROR": 5, + "NOT_IMPLEMENTED": 6, + "NETWORK_ERROR": 7, + "SERVICE_UNAVAILABLE": 8, + "NETWORK_TIMEOUT": 9, + "REQUEST_NOT_SUPPORT": 10, + "USER_NOT_FOUND": 11, + "INCORRECT_PASSWORD": 12, + "USER_FREEZE": 13, + "INVALID_USERID": 14, + "INVALID_PASSWORD": 15, + "TOKEN_EXPIRED": 16, + "INVALID_TOKEN": 17, + "TOKEN_NOT_EXIST": 18, + "USER_NOT_EXIST": 19, + "BAD_REQUEST": 20, + } +) + +func (x AdminErrorReason) Enum() *AdminErrorReason { + p := new(AdminErrorReason) + *p = x + return p +} + +func (x AdminErrorReason) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AdminErrorReason) Descriptor() protoreflect.EnumDescriptor { + return file_admin_service_v1_admin_error_proto_enumTypes[0].Descriptor() +} + +func (AdminErrorReason) Type() protoreflect.EnumType { + return &file_admin_service_v1_admin_error_proto_enumTypes[0] +} + +func (x AdminErrorReason) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AdminErrorReason.Descriptor instead. +func (AdminErrorReason) EnumDescriptor() ([]byte, []int) { + return file_admin_service_v1_admin_error_proto_rawDescGZIP(), []int{0} +} + +var File_admin_service_v1_admin_error_proto protoreflect.FileDescriptor + +var file_admin_service_v1_admin_error_proto_rawDesc = []byte{ + 0x0a, 0x22, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, + 0x76, 0x31, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x13, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2f, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2a, 0xd5, 0x04, 0x0a, 0x10, + 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, + 0x12, 0x17, 0x0a, 0x0d, 0x4e, 0x4f, 0x54, 0x5f, 0x4c, 0x4f, 0x47, 0x47, 0x45, 0x44, 0x5f, 0x49, + 0x4e, 0x10, 0x00, 0x1a, 0x04, 0xa8, 0x45, 0x91, 0x03, 0x12, 0x1a, 0x0a, 0x10, 0x41, 0x43, 0x43, + 0x45, 0x53, 0x53, 0x5f, 0x46, 0x4f, 0x52, 0x42, 0x49, 0x44, 0x44, 0x45, 0x4e, 0x10, 0x01, 0x1a, + 0x04, 0xa8, 0x45, 0x93, 0x03, 0x12, 0x1c, 0x0a, 0x12, 0x52, 0x45, 0x53, 0x4f, 0x55, 0x52, 0x43, + 0x45, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x02, 0x1a, 0x04, 0xa8, + 0x45, 0x94, 0x03, 0x12, 0x1c, 0x0a, 0x12, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x5f, 0x4e, 0x4f, + 0x54, 0x5f, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x10, 0x03, 0x1a, 0x04, 0xa8, 0x45, 0x95, + 0x03, 0x12, 0x19, 0x0a, 0x0f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x54, 0x49, 0x4d, + 0x45, 0x4f, 0x55, 0x54, 0x10, 0x04, 0x1a, 0x04, 0xa8, 0x45, 0x98, 0x03, 0x12, 0x1f, 0x0a, 0x15, + 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x5f, + 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x05, 0x1a, 0x04, 0xa8, 0x45, 0xf4, 0x03, 0x12, 0x19, 0x0a, + 0x0f, 0x4e, 0x4f, 0x54, 0x5f, 0x49, 0x4d, 0x50, 0x4c, 0x45, 0x4d, 0x45, 0x4e, 0x54, 0x45, 0x44, + 0x10, 0x06, 0x1a, 0x04, 0xa8, 0x45, 0xf5, 0x03, 0x12, 0x17, 0x0a, 0x0d, 0x4e, 0x45, 0x54, 0x57, + 0x4f, 0x52, 0x4b, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x07, 0x1a, 0x04, 0xa8, 0x45, 0xf6, + 0x03, 0x12, 0x1d, 0x0a, 0x13, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x41, + 0x56, 0x41, 0x49, 0x4c, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x08, 0x1a, 0x04, 0xa8, 0x45, 0xf7, 0x03, + 0x12, 0x19, 0x0a, 0x0f, 0x4e, 0x45, 0x54, 0x57, 0x4f, 0x52, 0x4b, 0x5f, 0x54, 0x49, 0x4d, 0x45, + 0x4f, 0x55, 0x54, 0x10, 0x09, 0x1a, 0x04, 0xa8, 0x45, 0xf8, 0x03, 0x12, 0x1d, 0x0a, 0x13, 0x52, + 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x53, 0x55, 0x50, 0x50, 0x4f, + 0x52, 0x54, 0x10, 0x0a, 0x1a, 0x04, 0xa8, 0x45, 0xf9, 0x03, 0x12, 0x18, 0x0a, 0x0e, 0x55, 0x53, + 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x0b, 0x1a, 0x04, + 0xa8, 0x45, 0xd8, 0x04, 0x12, 0x1c, 0x0a, 0x12, 0x49, 0x4e, 0x43, 0x4f, 0x52, 0x52, 0x45, 0x43, + 0x54, 0x5f, 0x50, 0x41, 0x53, 0x53, 0x57, 0x4f, 0x52, 0x44, 0x10, 0x0c, 0x1a, 0x04, 0xa8, 0x45, + 0xd7, 0x04, 0x12, 0x15, 0x0a, 0x0b, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x46, 0x52, 0x45, 0x45, 0x5a, + 0x45, 0x10, 0x0d, 0x1a, 0x04, 0xa8, 0x45, 0xd6, 0x04, 0x12, 0x18, 0x0a, 0x0e, 0x49, 0x4e, 0x56, + 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x49, 0x44, 0x10, 0x0e, 0x1a, 0x04, 0xa8, + 0x45, 0x90, 0x03, 0x12, 0x1a, 0x0a, 0x10, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x50, + 0x41, 0x53, 0x53, 0x57, 0x4f, 0x52, 0x44, 0x10, 0x0f, 0x1a, 0x04, 0xa8, 0x45, 0x90, 0x03, 0x12, + 0x17, 0x0a, 0x0d, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x5f, 0x45, 0x58, 0x50, 0x49, 0x52, 0x45, 0x44, + 0x10, 0x10, 0x1a, 0x04, 0xa8, 0x45, 0x90, 0x03, 0x12, 0x17, 0x0a, 0x0d, 0x49, 0x4e, 0x56, 0x41, + 0x4c, 0x49, 0x44, 0x5f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x10, 0x11, 0x1a, 0x04, 0xa8, 0x45, 0x90, + 0x03, 0x12, 0x19, 0x0a, 0x0f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x45, + 0x58, 0x49, 0x53, 0x54, 0x10, 0x12, 0x1a, 0x04, 0xa8, 0x45, 0x94, 0x03, 0x12, 0x18, 0x0a, 0x0e, + 0x55, 0x53, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x58, 0x49, 0x53, 0x54, 0x10, 0x13, + 0x1a, 0x04, 0xa8, 0x45, 0x94, 0x03, 0x12, 0x15, 0x0a, 0x0b, 0x42, 0x41, 0x44, 0x5f, 0x52, 0x45, + 0x51, 0x55, 0x45, 0x53, 0x54, 0x10, 0x14, 0x1a, 0x04, 0xa8, 0x45, 0x90, 0x03, 0x1a, 0x04, 0xa0, + 0x45, 0xf4, 0x03, 0x42, 0xc7, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, + 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0f, 0x41, 0x64, + 0x6d, 0x69, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x3c, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x6d, 0x6f, 0x6e, 0x6f, 0x6c, 0x69, 0x74, 0x68, + 0x69, 0x63, 0x2d, 0x64, 0x65, 0x6d, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x67, 0x6f, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, + 0x41, 0x53, 0x58, 0xaa, 0x02, 0x10, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x5c, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x41, 0x64, 0x6d, 0x69, + 0x6e, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x41, 0x64, 0x6d, 0x69, 0x6e, + 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_admin_service_v1_admin_error_proto_rawDescOnce sync.Once + file_admin_service_v1_admin_error_proto_rawDescData = file_admin_service_v1_admin_error_proto_rawDesc +) + +func file_admin_service_v1_admin_error_proto_rawDescGZIP() []byte { + file_admin_service_v1_admin_error_proto_rawDescOnce.Do(func() { + file_admin_service_v1_admin_error_proto_rawDescData = protoimpl.X.CompressGZIP(file_admin_service_v1_admin_error_proto_rawDescData) + }) + return file_admin_service_v1_admin_error_proto_rawDescData +} + +var file_admin_service_v1_admin_error_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_admin_service_v1_admin_error_proto_goTypes = []interface{}{ + (AdminErrorReason)(0), // 0: admin.service.v1.AdminErrorReason +} +var file_admin_service_v1_admin_error_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_admin_service_v1_admin_error_proto_init() } +func file_admin_service_v1_admin_error_proto_init() { + if File_admin_service_v1_admin_error_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_admin_service_v1_admin_error_proto_rawDesc, + NumEnums: 1, + NumMessages: 0, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_admin_service_v1_admin_error_proto_goTypes, + DependencyIndexes: file_admin_service_v1_admin_error_proto_depIdxs, + EnumInfos: file_admin_service_v1_admin_error_proto_enumTypes, + }.Build() + File_admin_service_v1_admin_error_proto = out.File + file_admin_service_v1_admin_error_proto_rawDesc = nil + file_admin_service_v1_admin_error_proto_goTypes = nil + file_admin_service_v1_admin_error_proto_depIdxs = nil +} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/admin_error.pb.validate.go b/monolithic/backend/gen/api/go/admin/service/v1/admin_error.pb.validate.go new file mode 100644 index 0000000..6dd3ded --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/admin_error.pb.validate.go @@ -0,0 +1,36 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: admin/service/v1/admin_error.proto + +package servicev1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) diff --git a/monolithic/backend/gen/api/go/admin/service/v1/admin_error_errors.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/admin_error_errors.pb.go new file mode 100644 index 0000000..767f52a --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/admin_error_errors.pb.go @@ -0,0 +1,300 @@ +// Code generated by protoc-gen-go-errors. DO NOT EDIT. + +package servicev1 + +import ( + fmt "fmt" + errors "github.com/go-kratos/kratos/v2/errors" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the kratos package it is being compiled against. +const _ = errors.SupportPackageIsVersion1 + +// 401 +func IsNotLoggedIn(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == AdminErrorReason_NOT_LOGGED_IN.String() && e.Code == 401 +} + +// 401 +func ErrorNotLoggedIn(format string, args ...interface{}) *errors.Error { + return errors.New(401, AdminErrorReason_NOT_LOGGED_IN.String(), fmt.Sprintf(format, args...)) +} + +// 403 +func IsAccessForbidden(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == AdminErrorReason_ACCESS_FORBIDDEN.String() && e.Code == 403 +} + +// 403 +func ErrorAccessForbidden(format string, args ...interface{}) *errors.Error { + return errors.New(403, AdminErrorReason_ACCESS_FORBIDDEN.String(), fmt.Sprintf(format, args...)) +} + +// 404 +func IsResourceNotFound(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == AdminErrorReason_RESOURCE_NOT_FOUND.String() && e.Code == 404 +} + +// 404 +func ErrorResourceNotFound(format string, args ...interface{}) *errors.Error { + return errors.New(404, AdminErrorReason_RESOURCE_NOT_FOUND.String(), fmt.Sprintf(format, args...)) +} + +// 405 +func IsMethodNotAllowed(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == AdminErrorReason_METHOD_NOT_ALLOWED.String() && e.Code == 405 +} + +// 405 +func ErrorMethodNotAllowed(format string, args ...interface{}) *errors.Error { + return errors.New(405, AdminErrorReason_METHOD_NOT_ALLOWED.String(), fmt.Sprintf(format, args...)) +} + +// 408 +func IsRequestTimeout(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == AdminErrorReason_REQUEST_TIMEOUT.String() && e.Code == 408 +} + +// 408 +func ErrorRequestTimeout(format string, args ...interface{}) *errors.Error { + return errors.New(408, AdminErrorReason_REQUEST_TIMEOUT.String(), fmt.Sprintf(format, args...)) +} + +// 500 +func IsInternalServerError(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == AdminErrorReason_INTERNAL_SERVER_ERROR.String() && e.Code == 500 +} + +// 500 +func ErrorInternalServerError(format string, args ...interface{}) *errors.Error { + return errors.New(500, AdminErrorReason_INTERNAL_SERVER_ERROR.String(), fmt.Sprintf(format, args...)) +} + +// 501 +func IsNotImplemented(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == AdminErrorReason_NOT_IMPLEMENTED.String() && e.Code == 501 +} + +// 501 +func ErrorNotImplemented(format string, args ...interface{}) *errors.Error { + return errors.New(501, AdminErrorReason_NOT_IMPLEMENTED.String(), fmt.Sprintf(format, args...)) +} + +// 502 +func IsNetworkError(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == AdminErrorReason_NETWORK_ERROR.String() && e.Code == 502 +} + +// 502 +func ErrorNetworkError(format string, args ...interface{}) *errors.Error { + return errors.New(502, AdminErrorReason_NETWORK_ERROR.String(), fmt.Sprintf(format, args...)) +} + +// 503 +func IsServiceUnavailable(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == AdminErrorReason_SERVICE_UNAVAILABLE.String() && e.Code == 503 +} + +// 503 +func ErrorServiceUnavailable(format string, args ...interface{}) *errors.Error { + return errors.New(503, AdminErrorReason_SERVICE_UNAVAILABLE.String(), fmt.Sprintf(format, args...)) +} + +// 504 +func IsNetworkTimeout(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == AdminErrorReason_NETWORK_TIMEOUT.String() && e.Code == 504 +} + +// 504 +func ErrorNetworkTimeout(format string, args ...interface{}) *errors.Error { + return errors.New(504, AdminErrorReason_NETWORK_TIMEOUT.String(), fmt.Sprintf(format, args...)) +} + +// 505 +func IsRequestNotSupport(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == AdminErrorReason_REQUEST_NOT_SUPPORT.String() && e.Code == 505 +} + +// 505 +func ErrorRequestNotSupport(format string, args ...interface{}) *errors.Error { + return errors.New(505, AdminErrorReason_REQUEST_NOT_SUPPORT.String(), fmt.Sprintf(format, args...)) +} + +func IsUserNotFound(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == AdminErrorReason_USER_NOT_FOUND.String() && e.Code == 600 +} + +func ErrorUserNotFound(format string, args ...interface{}) *errors.Error { + return errors.New(600, AdminErrorReason_USER_NOT_FOUND.String(), fmt.Sprintf(format, args...)) +} + +func IsIncorrectPassword(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == AdminErrorReason_INCORRECT_PASSWORD.String() && e.Code == 599 +} + +func ErrorIncorrectPassword(format string, args ...interface{}) *errors.Error { + return errors.New(599, AdminErrorReason_INCORRECT_PASSWORD.String(), fmt.Sprintf(format, args...)) +} + +func IsUserFreeze(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == AdminErrorReason_USER_FREEZE.String() && e.Code == 598 +} + +func ErrorUserFreeze(format string, args ...interface{}) *errors.Error { + return errors.New(598, AdminErrorReason_USER_FREEZE.String(), fmt.Sprintf(format, args...)) +} + +// 用户ID无效 +func IsInvalidUserid(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == AdminErrorReason_INVALID_USERID.String() && e.Code == 400 +} + +// 用户ID无效 +func ErrorInvalidUserid(format string, args ...interface{}) *errors.Error { + return errors.New(400, AdminErrorReason_INVALID_USERID.String(), fmt.Sprintf(format, args...)) +} + +// 密码无效 +func IsInvalidPassword(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == AdminErrorReason_INVALID_PASSWORD.String() && e.Code == 400 +} + +// 密码无效 +func ErrorInvalidPassword(format string, args ...interface{}) *errors.Error { + return errors.New(400, AdminErrorReason_INVALID_PASSWORD.String(), fmt.Sprintf(format, args...)) +} + +// token过期 +func IsTokenExpired(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == AdminErrorReason_TOKEN_EXPIRED.String() && e.Code == 400 +} + +// token过期 +func ErrorTokenExpired(format string, args ...interface{}) *errors.Error { + return errors.New(400, AdminErrorReason_TOKEN_EXPIRED.String(), fmt.Sprintf(format, args...)) +} + +// token无效 +func IsInvalidToken(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == AdminErrorReason_INVALID_TOKEN.String() && e.Code == 400 +} + +// token无效 +func ErrorInvalidToken(format string, args ...interface{}) *errors.Error { + return errors.New(400, AdminErrorReason_INVALID_TOKEN.String(), fmt.Sprintf(format, args...)) +} + +// token不存在 +func IsTokenNotExist(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == AdminErrorReason_TOKEN_NOT_EXIST.String() && e.Code == 404 +} + +// token不存在 +func ErrorTokenNotExist(format string, args ...interface{}) *errors.Error { + return errors.New(404, AdminErrorReason_TOKEN_NOT_EXIST.String(), fmt.Sprintf(format, args...)) +} + +// 用户不存在 +func IsUserNotExist(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == AdminErrorReason_USER_NOT_EXIST.String() && e.Code == 404 +} + +// 用户不存在 +func ErrorUserNotExist(format string, args ...interface{}) *errors.Error { + return errors.New(404, AdminErrorReason_USER_NOT_EXIST.String(), fmt.Sprintf(format, args...)) +} + +// 400 +func IsBadRequest(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == AdminErrorReason_BAD_REQUEST.String() && e.Code == 400 +} + +// 400 +func ErrorBadRequest(format string, args ...interface{}) *errors.Error { + return errors.New(400, AdminErrorReason_BAD_REQUEST.String(), fmt.Sprintf(format, args...)) +} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_admin.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/i_admin.pb.go new file mode 100644 index 0000000..3eca0c1 --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_admin.pb.go @@ -0,0 +1,118 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: admin/service/v1/i_admin.proto + +package servicev1 + +import ( + _ "github.com/google/gnostic/openapiv3" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_admin_service_v1_i_admin_proto protoreflect.FileDescriptor + +var file_admin_service_v1_i_admin_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, + 0x76, 0x31, 0x2f, 0x69, 0x5f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x10, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x1a, 0x24, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2f, 0x6f, 0x70, 0x65, 0x6e, + 0x61, 0x70, 0x69, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0xc5, 0x06, 0xba, 0x47, 0xfe, 0x04, 0x12, + 0xe2, 0x01, 0x0a, 0x1b, 0x4b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0xe5, 0xb7, 0xa8, 0xe7, 0x9f, 0xb3, + 0xe5, 0xba, 0x94, 0xe7, 0x94, 0xa8, 0xe5, 0xae, 0x9e, 0xe8, 0xb7, 0xb5, 0x41, 0x50, 0x49, 0x12, + 0x1b, 0x4b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0xe5, 0xb7, 0xa8, 0xe7, 0x9f, 0xb3, 0xe5, 0xba, 0x94, + 0xe7, 0x94, 0xa8, 0xe5, 0xae, 0x9e, 0xe8, 0xb7, 0xb5, 0x41, 0x50, 0x49, 0x22, 0x4d, 0x0a, 0x05, + 0x74, 0x78, 0x37, 0x64, 0x6f, 0x12, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, + 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x6d, 0x6f, 0x6e, 0x6f, 0x6c, 0x69, 0x74, 0x68, 0x69, + 0x63, 0x2d, 0x64, 0x65, 0x6d, 0x6f, 0x1a, 0x13, 0x79, 0x61, 0x6e, 0x67, 0x6c, 0x69, 0x6e, 0x62, + 0x6f, 0x40, 0x67, 0x6d, 0x61, 0x69, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, 0x2a, 0x52, 0x0a, 0x0b, 0x4d, + 0x49, 0x54, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x68, 0x74, 0x74, 0x70, + 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, + 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x6d, 0x6f, 0x6e, 0x6f, + 0x6c, 0x69, 0x74, 0x68, 0x69, 0x63, 0x2d, 0x64, 0x65, 0x6d, 0x6f, 0x2f, 0x62, 0x6c, 0x6f, 0x62, + 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x2f, 0x4c, 0x49, 0x43, 0x45, 0x4e, 0x53, 0x45, 0x32, + 0x03, 0x31, 0x2e, 0x30, 0x2a, 0x96, 0x03, 0x0a, 0xd4, 0x01, 0x0a, 0xd1, 0x01, 0x0a, 0x0c, 0x4b, + 0x72, 0x61, 0x74, 0x6f, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0xc0, 0x01, 0x0a, 0xbd, + 0x01, 0xca, 0x01, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0xfa, 0x01, 0x9b, 0x01, 0x0a, 0x27, + 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1f, 0x0a, 0x1d, 0xca, 0x01, 0x06, 0x6e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x92, 0x02, 0x09, 0xe9, 0x94, 0x99, 0xe8, 0xaf, 0xaf, 0xe7, 0xa0, 0x81, 0x9a, + 0x02, 0x05, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x0a, 0x25, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x18, 0xca, 0x01, 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x92, + 0x02, 0x0c, 0xe9, 0x94, 0x99, 0xe8, 0xaf, 0xaf, 0xe6, 0xb6, 0x88, 0xe6, 0x81, 0xaf, 0x0a, 0x24, + 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x18, 0xca, 0x01, 0x06, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x92, 0x02, 0x0c, 0xe9, 0x94, 0x99, 0xe8, 0xaf, 0xaf, 0xe5, 0x8e, + 0x9f, 0xe5, 0x9b, 0xa0, 0x0a, 0x23, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x12, 0x17, 0x0a, 0x15, 0xca, 0x01, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x92, 0x02, 0x09, + 0xe5, 0x85, 0x83, 0xe6, 0x95, 0xb0, 0xe6, 0x8d, 0xae, 0x92, 0x02, 0x12, 0x4b, 0x72, 0x61, 0x74, + 0x6f, 0x73, 0xe9, 0x94, 0x99, 0xe8, 0xaf, 0xaf, 0xe8, 0xbf, 0x94, 0xe5, 0x9b, 0x9e, 0x12, 0x67, + 0x0a, 0x65, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x5a, 0x0a, 0x58, 0x0a, + 0x17, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x20, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x3d, 0x0a, 0x3b, 0x0a, 0x10, 0x61, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x12, 0x27, + 0x0a, 0x25, 0x12, 0x23, 0x0a, 0x21, 0x23, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, + 0x74, 0x73, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x2f, 0x4b, 0x72, 0x61, 0x74, 0x6f, + 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x3a, 0x54, 0x0a, 0x52, 0x0a, 0x14, 0x4f, 0x41, 0x75, + 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, 0x72, 0x65, + 0x72, 0x12, 0x3a, 0x0a, 0x38, 0x0a, 0x06, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x3a, 0x2e, 0x12, + 0x2c, 0x12, 0x0f, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x6f, 0x67, + 0x69, 0x6e, 0x1a, 0x17, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, + 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x00, 0x0a, 0x14, 0x63, + 0x6f, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x49, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x3c, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x6d, 0x6f, 0x6e, 0x6f, 0x6c, + 0x69, 0x74, 0x68, 0x69, 0x63, 0x2d, 0x64, 0x65, 0x6d, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x76, 0x31, + 0xa2, 0x02, 0x03, 0x41, 0x53, 0x58, 0xaa, 0x02, 0x10, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, 0x41, 0x64, 0x6d, 0x69, + 0x6e, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x41, + 0x64, 0x6d, 0x69, 0x6e, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x41, 0x64, + 0x6d, 0x69, 0x6e, 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_admin_service_v1_i_admin_proto_goTypes = []interface{}{} +var file_admin_service_v1_i_admin_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_admin_service_v1_i_admin_proto_init() } +func file_admin_service_v1_i_admin_proto_init() { + if File_admin_service_v1_i_admin_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_admin_service_v1_i_admin_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_admin_service_v1_i_admin_proto_goTypes, + DependencyIndexes: file_admin_service_v1_i_admin_proto_depIdxs, + }.Build() + File_admin_service_v1_i_admin_proto = out.File + file_admin_service_v1_i_admin_proto_rawDesc = nil + file_admin_service_v1_i_admin_proto_goTypes = nil + file_admin_service_v1_i_admin_proto_depIdxs = nil +} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_admin.pb.validate.go b/monolithic/backend/gen/api/go/admin/service/v1/i_admin.pb.validate.go new file mode 100644 index 0000000..001c7d8 --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_admin.pb.validate.go @@ -0,0 +1,36 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: admin/service/v1/i_admin.proto + +package servicev1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_authentication.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/i_authentication.pb.go new file mode 100644 index 0000000..db55c1d --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_authentication.pb.go @@ -0,0 +1,639 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: admin/service/v1/i_authentication.proto + +package servicev1 + +import ( + _ "github.com/google/gnostic/openapiv3" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + v1 "kratos-monolithic-demo/gen/api/go/user/service/v1" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 用户后台登陆 - 请求 +type LoginRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` // 用户名,必选项。 + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` // 用户的密码,必选项。 + GrandType string `protobuf:"bytes,3,opt,name=grand_type,proto3" json:"grand_type,omitempty"` // 授权类型,此处的值固定为"password",必选项。 + Scope *string `protobuf:"bytes,4,opt,name=scope,proto3,oneof" json:"scope,omitempty"` // 以空格分隔的范围列表。如果未提供,scope则授权任何范围,默认为空列表。 +} + +func (x *LoginRequest) Reset() { + *x = LoginRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_service_v1_i_authentication_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoginRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginRequest) ProtoMessage() {} + +func (x *LoginRequest) ProtoReflect() protoreflect.Message { + mi := &file_admin_service_v1_i_authentication_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead. +func (*LoginRequest) Descriptor() ([]byte, []int) { + return file_admin_service_v1_i_authentication_proto_rawDescGZIP(), []int{0} +} + +func (x *LoginRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *LoginRequest) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +func (x *LoginRequest) GetGrandType() string { + if x != nil { + return x.GrandType + } + return "" +} + +func (x *LoginRequest) GetScope() string { + if x != nil && x.Scope != nil { + return *x.Scope + } + return "" +} + +// 用户后台登陆 - 回应 +type LoginResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AccessToken string `protobuf:"bytes,1,opt,name=access_token,proto3" json:"access_token,omitempty"` // 访问令牌,必选项。 + RefreshToken string `protobuf:"bytes,2,opt,name=refresh_token,proto3" json:"refresh_token,omitempty"` // 更新令牌,用来获取下一次的访问令牌,可选项。 + TokenType string `protobuf:"bytes,3,opt,name=token_type,proto3" json:"token_type,omitempty"` // 令牌类型,该值大小写不敏感,必选项,可以是bearer类型或mac类型。 + ExpiresIn int64 `protobuf:"varint,4,opt,name=expires_in,proto3" json:"expires_in,omitempty"` // 过期时间,单位为秒。如果省略该参数,必须其他方式设置过期时间。 +} + +func (x *LoginResponse) Reset() { + *x = LoginResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_service_v1_i_authentication_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoginResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginResponse) ProtoMessage() {} + +func (x *LoginResponse) ProtoReflect() protoreflect.Message { + mi := &file_admin_service_v1_i_authentication_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoginResponse.ProtoReflect.Descriptor instead. +func (*LoginResponse) Descriptor() ([]byte, []int) { + return file_admin_service_v1_i_authentication_proto_rawDescGZIP(), []int{1} +} + +func (x *LoginResponse) GetAccessToken() string { + if x != nil { + return x.AccessToken + } + return "" +} + +func (x *LoginResponse) GetRefreshToken() string { + if x != nil { + return x.RefreshToken + } + return "" +} + +func (x *LoginResponse) GetTokenType() string { + if x != nil { + return x.TokenType + } + return "" +} + +func (x *LoginResponse) GetExpiresIn() int64 { + if x != nil { + return x.ExpiresIn + } + return 0 +} + +// 用户后台登出 - 请求 +type LogoutRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *LogoutRequest) Reset() { + *x = LogoutRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_service_v1_i_authentication_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LogoutRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LogoutRequest) ProtoMessage() {} + +func (x *LogoutRequest) ProtoReflect() protoreflect.Message { + mi := &file_admin_service_v1_i_authentication_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LogoutRequest.ProtoReflect.Descriptor instead. +func (*LogoutRequest) Descriptor() ([]byte, []int) { + return file_admin_service_v1_i_authentication_proto_rawDescGZIP(), []int{2} +} + +func (x *LogoutRequest) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +// 获取当前用户信息 - 请求 +type GetMeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GetMeRequest) Reset() { + *x = GetMeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_service_v1_i_authentication_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetMeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetMeRequest) ProtoMessage() {} + +func (x *GetMeRequest) ProtoReflect() protoreflect.Message { + mi := &file_admin_service_v1_i_authentication_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetMeRequest.ProtoReflect.Descriptor instead. +func (*GetMeRequest) Descriptor() ([]byte, []int) { + return file_admin_service_v1_i_authentication_proto_rawDescGZIP(), []int{3} +} + +func (x *GetMeRequest) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +// 用户刷新令牌 - 请求 +type RefreshTokenRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RefreshToken string `protobuf:"bytes,1,opt,name=refresh_token,proto3" json:"refresh_token,omitempty"` // 更新令牌,用来获取下一次的访问令牌,必选项。 + GrandType string `protobuf:"bytes,2,opt,name=grand_type,proto3" json:"grand_type,omitempty"` // 授权类型,此处的值固定为"password",必选项。 + Scope *string `protobuf:"bytes,3,opt,name=scope,proto3,oneof" json:"scope,omitempty"` // 以空格分隔的范围列表。如果未提供,scope则授权任何范围,默认为空列表。 +} + +func (x *RefreshTokenRequest) Reset() { + *x = RefreshTokenRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_service_v1_i_authentication_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RefreshTokenRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RefreshTokenRequest) ProtoMessage() {} + +func (x *RefreshTokenRequest) ProtoReflect() protoreflect.Message { + mi := &file_admin_service_v1_i_authentication_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RefreshTokenRequest.ProtoReflect.Descriptor instead. +func (*RefreshTokenRequest) Descriptor() ([]byte, []int) { + return file_admin_service_v1_i_authentication_proto_rawDescGZIP(), []int{4} +} + +func (x *RefreshTokenRequest) GetRefreshToken() string { + if x != nil { + return x.RefreshToken + } + return "" +} + +func (x *RefreshTokenRequest) GetGrandType() string { + if x != nil { + return x.GrandType + } + return "" +} + +func (x *RefreshTokenRequest) GetScope() string { + if x != nil && x.Scope != nil { + return *x.Scope + } + return "" +} + +// 用户刷新令牌 - 回应 +type RefreshTokenResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RefreshToken string `protobuf:"bytes,1,opt,name=refresh_token,proto3" json:"refresh_token,omitempty"` // 更新令牌,用来获取下一次的访问令牌,可选项。 + GrandType string `protobuf:"bytes,2,opt,name=grand_type,proto3" json:"grand_type,omitempty"` // 授权类型,此处的值固定为"password",必选项。 +} + +func (x *RefreshTokenResponse) Reset() { + *x = RefreshTokenResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_service_v1_i_authentication_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RefreshTokenResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RefreshTokenResponse) ProtoMessage() {} + +func (x *RefreshTokenResponse) ProtoReflect() protoreflect.Message { + mi := &file_admin_service_v1_i_authentication_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RefreshTokenResponse.ProtoReflect.Descriptor instead. +func (*RefreshTokenResponse) Descriptor() ([]byte, []int) { + return file_admin_service_v1_i_authentication_proto_rawDescGZIP(), []int{5} +} + +func (x *RefreshTokenResponse) GetRefreshToken() string { + if x != nil { + return x.RefreshToken + } + return "" +} + +func (x *RefreshTokenResponse) GetGrandType() string { + if x != nil { + return x.GrandType + } + return "" +} + +var File_admin_service_v1_i_authentication_proto protoreflect.FileDescriptor + +var file_admin_service_v1_i_authentication_proto_rawDesc = []byte{ + 0x0a, 0x27, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, + 0x76, 0x31, 0x2f, 0x69, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x24, 0x67, 0x6e, 0x6f, + 0x73, 0x74, 0x69, 0x63, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x33, 0x2f, + 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, + 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x75, + 0x73, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x75, + 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xef, 0x01, 0x0a, 0x0c, 0x4c, 0x6f, + 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x08, 0x75, 0x73, + 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, + 0x02, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x08, 0x70, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, + 0x41, 0x02, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x73, 0x0a, 0x0a, + 0x67, 0x72, 0x61, 0x6e, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x53, 0xe0, 0x41, 0x02, 0xba, 0x47, 0x4d, 0x8a, 0x02, 0x0a, 0x1a, 0x08, 0x70, 0x61, 0x73, + 0x73, 0x77, 0x6f, 0x72, 0x64, 0x92, 0x02, 0x3d, 0xe6, 0x8e, 0x88, 0xe6, 0x9d, 0x83, 0xe7, 0xb1, + 0xbb, 0xe5, 0x9e, 0x8b, 0xef, 0xbc, 0x8c, 0xe6, 0xad, 0xa4, 0xe5, 0xa4, 0x84, 0xe7, 0x9a, 0x84, + 0xe5, 0x80, 0xbc, 0xe5, 0x9b, 0xba, 0xe5, 0xae, 0x9a, 0xe4, 0xb8, 0xba, 0x22, 0x70, 0x61, 0x73, + 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0xef, 0xbc, 0x8c, 0xe5, 0xbf, 0x85, 0xe9, 0x80, 0x89, 0xe9, + 0xa1, 0xb9, 0xe3, 0x80, 0x82, 0x52, 0x0a, 0x67, 0x72, 0x61, 0x6e, 0x64, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x12, 0x1e, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x00, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x88, 0x01, + 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x22, 0x99, 0x01, 0x0a, 0x0d, + 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, + 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x12, 0x24, 0x0a, 0x0d, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, + 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, + 0x65, 0x73, 0x5f, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x65, 0x73, 0x5f, 0x69, 0x6e, 0x22, 0x1f, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x6f, 0x75, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, 0x1e, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x4d, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, 0xdf, 0x01, 0x0a, 0x13, 0x52, 0x65, 0x66, + 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x29, 0x0a, 0x0d, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0d, 0x72, 0x65, + 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x73, 0x0a, 0x0a, 0x67, + 0x72, 0x61, 0x6e, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x53, 0xe0, 0x41, 0x02, 0xba, 0x47, 0x4d, 0x8a, 0x02, 0x0a, 0x1a, 0x08, 0x70, 0x61, 0x73, 0x73, + 0x77, 0x6f, 0x72, 0x64, 0x92, 0x02, 0x3d, 0xe6, 0x8e, 0x88, 0xe6, 0x9d, 0x83, 0xe7, 0xb1, 0xbb, + 0xe5, 0x9e, 0x8b, 0xef, 0xbc, 0x8c, 0xe6, 0xad, 0xa4, 0xe5, 0xa4, 0x84, 0xe7, 0x9a, 0x84, 0xe5, + 0x80, 0xbc, 0xe5, 0x9b, 0xba, 0xe5, 0xae, 0x9a, 0xe4, 0xb8, 0xba, 0x22, 0x70, 0x61, 0x73, 0x73, + 0x77, 0x6f, 0x72, 0x64, 0x22, 0xef, 0xbc, 0x8c, 0xe5, 0xbf, 0x85, 0xe9, 0x80, 0x89, 0xe9, 0xa1, + 0xb9, 0xe3, 0x80, 0x82, 0x52, 0x0a, 0x67, 0x72, 0x61, 0x6e, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x1e, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x48, 0x00, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x88, 0x01, 0x01, + 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x22, 0x5c, 0x0a, 0x14, 0x52, 0x65, + 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x66, 0x72, 0x65, + 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x72, 0x61, 0x6e, + 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x67, 0x72, + 0x61, 0x6e, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x32, 0x8d, 0x04, 0x0a, 0x15, 0x41, 0x75, 0x74, + 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x64, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x1e, 0x2e, 0x61, 0x64, + 0x6d, 0x69, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, + 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x61, 0x64, + 0x6d, 0x69, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, + 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x14, 0x3a, 0x01, 0x2a, 0x22, 0x0f, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, + 0x76, 0x31, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x7d, 0x0a, 0x06, 0x4c, 0x6f, 0x67, 0x6f, + 0x75, 0x74, 0x12, 0x1f, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x3a, 0xba, 0x47, 0x1c, + 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, + 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x15, 0x3a, 0x01, 0x2a, 0x22, 0x10, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, + 0x2f, 0x6c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x12, 0x99, 0x01, 0x0a, 0x0c, 0x52, 0x65, 0x66, 0x72, + 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x25, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x66, 0x72, + 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1f, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x41, 0xba, 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, 0x41, 0x75, 0x74, 0x68, + 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, + 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x3a, 0x01, 0x2a, 0x22, 0x17, 0x2f, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x12, 0x73, 0x0a, 0x05, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x12, 0x1e, 0x2e, 0x61, + 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x4d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x22, 0x33, 0xba, 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, 0x41, + 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, 0x72, + 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x12, 0x0c, 0x2f, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, 0x42, 0xcc, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, + 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, + 0x31, 0x42, 0x14, 0x49, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x6b, 0x72, 0x61, 0x74, 0x6f, + 0x73, 0x2d, 0x6d, 0x6f, 0x6e, 0x6f, 0x6c, 0x69, 0x74, 0x68, 0x69, 0x63, 0x2d, 0x64, 0x65, 0x6d, + 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x53, 0x58, 0xaa, 0x02, 0x10, + 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x56, 0x31, + 0xca, 0x02, 0x10, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x5c, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x12, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_admin_service_v1_i_authentication_proto_rawDescOnce sync.Once + file_admin_service_v1_i_authentication_proto_rawDescData = file_admin_service_v1_i_authentication_proto_rawDesc +) + +func file_admin_service_v1_i_authentication_proto_rawDescGZIP() []byte { + file_admin_service_v1_i_authentication_proto_rawDescOnce.Do(func() { + file_admin_service_v1_i_authentication_proto_rawDescData = protoimpl.X.CompressGZIP(file_admin_service_v1_i_authentication_proto_rawDescData) + }) + return file_admin_service_v1_i_authentication_proto_rawDescData +} + +var file_admin_service_v1_i_authentication_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_admin_service_v1_i_authentication_proto_goTypes = []interface{}{ + (*LoginRequest)(nil), // 0: admin.service.v1.LoginRequest + (*LoginResponse)(nil), // 1: admin.service.v1.LoginResponse + (*LogoutRequest)(nil), // 2: admin.service.v1.LogoutRequest + (*GetMeRequest)(nil), // 3: admin.service.v1.GetMeRequest + (*RefreshTokenRequest)(nil), // 4: admin.service.v1.RefreshTokenRequest + (*RefreshTokenResponse)(nil), // 5: admin.service.v1.RefreshTokenResponse + (*emptypb.Empty)(nil), // 6: google.protobuf.Empty + (*v1.User)(nil), // 7: user.service.v1.User +} +var file_admin_service_v1_i_authentication_proto_depIdxs = []int32{ + 0, // 0: admin.service.v1.AuthenticationService.Login:input_type -> admin.service.v1.LoginRequest + 2, // 1: admin.service.v1.AuthenticationService.Logout:input_type -> admin.service.v1.LogoutRequest + 4, // 2: admin.service.v1.AuthenticationService.RefreshToken:input_type -> admin.service.v1.RefreshTokenRequest + 3, // 3: admin.service.v1.AuthenticationService.GetMe:input_type -> admin.service.v1.GetMeRequest + 1, // 4: admin.service.v1.AuthenticationService.Login:output_type -> admin.service.v1.LoginResponse + 6, // 5: admin.service.v1.AuthenticationService.Logout:output_type -> google.protobuf.Empty + 1, // 6: admin.service.v1.AuthenticationService.RefreshToken:output_type -> admin.service.v1.LoginResponse + 7, // 7: admin.service.v1.AuthenticationService.GetMe:output_type -> user.service.v1.User + 4, // [4:8] is the sub-list for method output_type + 0, // [0:4] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_admin_service_v1_i_authentication_proto_init() } +func file_admin_service_v1_i_authentication_proto_init() { + if File_admin_service_v1_i_authentication_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_admin_service_v1_i_authentication_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_service_v1_i_authentication_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_service_v1_i_authentication_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LogoutRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_service_v1_i_authentication_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetMeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_service_v1_i_authentication_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RefreshTokenRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_service_v1_i_authentication_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RefreshTokenResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_admin_service_v1_i_authentication_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_admin_service_v1_i_authentication_proto_msgTypes[4].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_admin_service_v1_i_authentication_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_admin_service_v1_i_authentication_proto_goTypes, + DependencyIndexes: file_admin_service_v1_i_authentication_proto_depIdxs, + MessageInfos: file_admin_service_v1_i_authentication_proto_msgTypes, + }.Build() + File_admin_service_v1_i_authentication_proto = out.File + file_admin_service_v1_i_authentication_proto_rawDesc = nil + file_admin_service_v1_i_authentication_proto_goTypes = nil + file_admin_service_v1_i_authentication_proto_depIdxs = nil +} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_authentication.pb.validate.go b/monolithic/backend/gen/api/go/admin/service/v1/i_authentication.pb.validate.go new file mode 100644 index 0000000..7e8fdbb --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_authentication.pb.validate.go @@ -0,0 +1,672 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: admin/service/v1/i_authentication.proto + +package servicev1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on LoginRequest with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *LoginRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on LoginRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in LoginRequestMultiError, or +// nil if none found. +func (m *LoginRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *LoginRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Username + + // no validation rules for Password + + // no validation rules for GrandType + + if m.Scope != nil { + // no validation rules for Scope + } + + if len(errors) > 0 { + return LoginRequestMultiError(errors) + } + + return nil +} + +// LoginRequestMultiError is an error wrapping multiple validation errors +// returned by LoginRequest.ValidateAll() if the designated constraints aren't met. +type LoginRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m LoginRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m LoginRequestMultiError) AllErrors() []error { return m } + +// LoginRequestValidationError is the validation error returned by +// LoginRequest.Validate if the designated constraints aren't met. +type LoginRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e LoginRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e LoginRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e LoginRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e LoginRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e LoginRequestValidationError) ErrorName() string { return "LoginRequestValidationError" } + +// Error satisfies the builtin error interface +func (e LoginRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sLoginRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = LoginRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = LoginRequestValidationError{} + +// Validate checks the field values on LoginResponse with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *LoginResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on LoginResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in LoginResponseMultiError, or +// nil if none found. +func (m *LoginResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *LoginResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for AccessToken + + // no validation rules for RefreshToken + + // no validation rules for TokenType + + // no validation rules for ExpiresIn + + if len(errors) > 0 { + return LoginResponseMultiError(errors) + } + + return nil +} + +// LoginResponseMultiError is an error wrapping multiple validation errors +// returned by LoginResponse.ValidateAll() if the designated constraints +// aren't met. +type LoginResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m LoginResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m LoginResponseMultiError) AllErrors() []error { return m } + +// LoginResponseValidationError is the validation error returned by +// LoginResponse.Validate if the designated constraints aren't met. +type LoginResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e LoginResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e LoginResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e LoginResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e LoginResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e LoginResponseValidationError) ErrorName() string { return "LoginResponseValidationError" } + +// Error satisfies the builtin error interface +func (e LoginResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sLoginResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = LoginResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = LoginResponseValidationError{} + +// Validate checks the field values on LogoutRequest with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *LogoutRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on LogoutRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in LogoutRequestMultiError, or +// nil if none found. +func (m *LogoutRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *LogoutRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if len(errors) > 0 { + return LogoutRequestMultiError(errors) + } + + return nil +} + +// LogoutRequestMultiError is an error wrapping multiple validation errors +// returned by LogoutRequest.ValidateAll() if the designated constraints +// aren't met. +type LogoutRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m LogoutRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m LogoutRequestMultiError) AllErrors() []error { return m } + +// LogoutRequestValidationError is the validation error returned by +// LogoutRequest.Validate if the designated constraints aren't met. +type LogoutRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e LogoutRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e LogoutRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e LogoutRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e LogoutRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e LogoutRequestValidationError) ErrorName() string { return "LogoutRequestValidationError" } + +// Error satisfies the builtin error interface +func (e LogoutRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sLogoutRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = LogoutRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = LogoutRequestValidationError{} + +// Validate checks the field values on GetMeRequest with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *GetMeRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetMeRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in GetMeRequestMultiError, or +// nil if none found. +func (m *GetMeRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *GetMeRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if len(errors) > 0 { + return GetMeRequestMultiError(errors) + } + + return nil +} + +// GetMeRequestMultiError is an error wrapping multiple validation errors +// returned by GetMeRequest.ValidateAll() if the designated constraints aren't met. +type GetMeRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetMeRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetMeRequestMultiError) AllErrors() []error { return m } + +// GetMeRequestValidationError is the validation error returned by +// GetMeRequest.Validate if the designated constraints aren't met. +type GetMeRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetMeRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetMeRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetMeRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetMeRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetMeRequestValidationError) ErrorName() string { return "GetMeRequestValidationError" } + +// Error satisfies the builtin error interface +func (e GetMeRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetMeRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetMeRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetMeRequestValidationError{} + +// Validate checks the field values on RefreshTokenRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *RefreshTokenRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on RefreshTokenRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// RefreshTokenRequestMultiError, or nil if none found. +func (m *RefreshTokenRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *RefreshTokenRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for RefreshToken + + // no validation rules for GrandType + + if m.Scope != nil { + // no validation rules for Scope + } + + if len(errors) > 0 { + return RefreshTokenRequestMultiError(errors) + } + + return nil +} + +// RefreshTokenRequestMultiError is an error wrapping multiple validation +// errors returned by RefreshTokenRequest.ValidateAll() if the designated +// constraints aren't met. +type RefreshTokenRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m RefreshTokenRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m RefreshTokenRequestMultiError) AllErrors() []error { return m } + +// RefreshTokenRequestValidationError is the validation error returned by +// RefreshTokenRequest.Validate if the designated constraints aren't met. +type RefreshTokenRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RefreshTokenRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RefreshTokenRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RefreshTokenRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RefreshTokenRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RefreshTokenRequestValidationError) ErrorName() string { + return "RefreshTokenRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e RefreshTokenRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRefreshTokenRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RefreshTokenRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RefreshTokenRequestValidationError{} + +// Validate checks the field values on RefreshTokenResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *RefreshTokenResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on RefreshTokenResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// RefreshTokenResponseMultiError, or nil if none found. +func (m *RefreshTokenResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *RefreshTokenResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for RefreshToken + + // no validation rules for GrandType + + if len(errors) > 0 { + return RefreshTokenResponseMultiError(errors) + } + + return nil +} + +// RefreshTokenResponseMultiError is an error wrapping multiple validation +// errors returned by RefreshTokenResponse.ValidateAll() if the designated +// constraints aren't met. +type RefreshTokenResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m RefreshTokenResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m RefreshTokenResponseMultiError) AllErrors() []error { return m } + +// RefreshTokenResponseValidationError is the validation error returned by +// RefreshTokenResponse.Validate if the designated constraints aren't met. +type RefreshTokenResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RefreshTokenResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RefreshTokenResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RefreshTokenResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RefreshTokenResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RefreshTokenResponseValidationError) ErrorName() string { + return "RefreshTokenResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e RefreshTokenResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRefreshTokenResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RefreshTokenResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RefreshTokenResponseValidationError{} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_authentication_grpc.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/i_authentication_grpc.pb.go new file mode 100644 index 0000000..9df84c4 --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_authentication_grpc.pb.go @@ -0,0 +1,230 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: admin/service/v1/i_authentication.proto + +package servicev1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" + v1 "kratos-monolithic-demo/gen/api/go/user/service/v1" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + AuthenticationService_Login_FullMethodName = "/admin.service.v1.AuthenticationService/Login" + AuthenticationService_Logout_FullMethodName = "/admin.service.v1.AuthenticationService/Logout" + AuthenticationService_RefreshToken_FullMethodName = "/admin.service.v1.AuthenticationService/RefreshToken" + AuthenticationService_GetMe_FullMethodName = "/admin.service.v1.AuthenticationService/GetMe" +) + +// AuthenticationServiceClient is the client API for AuthenticationService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type AuthenticationServiceClient interface { + // 登陆 + Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) + // 登出 + Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 刷新认证令牌 + RefreshToken(ctx context.Context, in *RefreshTokenRequest, opts ...grpc.CallOption) (*LoginResponse, error) + // 后台获取已经登陆的用户的数据 + GetMe(ctx context.Context, in *GetMeRequest, opts ...grpc.CallOption) (*v1.User, error) +} + +type authenticationServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewAuthenticationServiceClient(cc grpc.ClientConnInterface) AuthenticationServiceClient { + return &authenticationServiceClient{cc} +} + +func (c *authenticationServiceClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) { + out := new(LoginResponse) + err := c.cc.Invoke(ctx, AuthenticationService_Login_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *authenticationServiceClient) Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, AuthenticationService_Logout_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *authenticationServiceClient) RefreshToken(ctx context.Context, in *RefreshTokenRequest, opts ...grpc.CallOption) (*LoginResponse, error) { + out := new(LoginResponse) + err := c.cc.Invoke(ctx, AuthenticationService_RefreshToken_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *authenticationServiceClient) GetMe(ctx context.Context, in *GetMeRequest, opts ...grpc.CallOption) (*v1.User, error) { + out := new(v1.User) + err := c.cc.Invoke(ctx, AuthenticationService_GetMe_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AuthenticationServiceServer is the server API for AuthenticationService service. +// All implementations must embed UnimplementedAuthenticationServiceServer +// for forward compatibility +type AuthenticationServiceServer interface { + // 登陆 + Login(context.Context, *LoginRequest) (*LoginResponse, error) + // 登出 + Logout(context.Context, *LogoutRequest) (*emptypb.Empty, error) + // 刷新认证令牌 + RefreshToken(context.Context, *RefreshTokenRequest) (*LoginResponse, error) + // 后台获取已经登陆的用户的数据 + GetMe(context.Context, *GetMeRequest) (*v1.User, error) + mustEmbedUnimplementedAuthenticationServiceServer() +} + +// UnimplementedAuthenticationServiceServer must be embedded to have forward compatible implementations. +type UnimplementedAuthenticationServiceServer struct { +} + +func (UnimplementedAuthenticationServiceServer) Login(context.Context, *LoginRequest) (*LoginResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Login not implemented") +} +func (UnimplementedAuthenticationServiceServer) Logout(context.Context, *LogoutRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Logout not implemented") +} +func (UnimplementedAuthenticationServiceServer) RefreshToken(context.Context, *RefreshTokenRequest) (*LoginResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RefreshToken not implemented") +} +func (UnimplementedAuthenticationServiceServer) GetMe(context.Context, *GetMeRequest) (*v1.User, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMe not implemented") +} +func (UnimplementedAuthenticationServiceServer) mustEmbedUnimplementedAuthenticationServiceServer() {} + +// UnsafeAuthenticationServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AuthenticationServiceServer will +// result in compilation errors. +type UnsafeAuthenticationServiceServer interface { + mustEmbedUnimplementedAuthenticationServiceServer() +} + +func RegisterAuthenticationServiceServer(s grpc.ServiceRegistrar, srv AuthenticationServiceServer) { + s.RegisterService(&AuthenticationService_ServiceDesc, srv) +} + +func _AuthenticationService_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LoginRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthenticationServiceServer).Login(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AuthenticationService_Login_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthenticationServiceServer).Login(ctx, req.(*LoginRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AuthenticationService_Logout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LogoutRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthenticationServiceServer).Logout(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AuthenticationService_Logout_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthenticationServiceServer).Logout(ctx, req.(*LogoutRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AuthenticationService_RefreshToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RefreshTokenRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthenticationServiceServer).RefreshToken(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AuthenticationService_RefreshToken_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthenticationServiceServer).RefreshToken(ctx, req.(*RefreshTokenRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AuthenticationService_GetMe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetMeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthenticationServiceServer).GetMe(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AuthenticationService_GetMe_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthenticationServiceServer).GetMe(ctx, req.(*GetMeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// AuthenticationService_ServiceDesc is the grpc.ServiceDesc for AuthenticationService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var AuthenticationService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "admin.service.v1.AuthenticationService", + HandlerType: (*AuthenticationServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Login", + Handler: _AuthenticationService_Login_Handler, + }, + { + MethodName: "Logout", + Handler: _AuthenticationService_Logout_Handler, + }, + { + MethodName: "RefreshToken", + Handler: _AuthenticationService_RefreshToken_Handler, + }, + { + MethodName: "GetMe", + Handler: _AuthenticationService_GetMe_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "admin/service/v1/i_authentication.proto", +} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_authentication_http.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/i_authentication_http.pb.go new file mode 100644 index 0000000..7e48e69 --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_authentication_http.pb.go @@ -0,0 +1,198 @@ +// Code generated by protoc-gen-go-http. DO NOT EDIT. +// versions: +// - protoc-gen-go-http v2.7.1 +// - protoc (unknown) +// source: admin/service/v1/i_authentication.proto + +package servicev1 + +import ( + context "context" + http "github.com/go-kratos/kratos/v2/transport/http" + binding "github.com/go-kratos/kratos/v2/transport/http/binding" + emptypb "google.golang.org/protobuf/types/known/emptypb" + v1 "kratos-monolithic-demo/gen/api/go/user/service/v1" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the kratos package it is being compiled against. +var _ = new(context.Context) +var _ = binding.EncodeURL + +const _ = http.SupportPackageIsVersion1 + +const OperationAuthenticationServiceGetMe = "/admin.service.v1.AuthenticationService/GetMe" +const OperationAuthenticationServiceLogin = "/admin.service.v1.AuthenticationService/Login" +const OperationAuthenticationServiceLogout = "/admin.service.v1.AuthenticationService/Logout" +const OperationAuthenticationServiceRefreshToken = "/admin.service.v1.AuthenticationService/RefreshToken" + +type AuthenticationServiceHTTPServer interface { + // GetMe 后台获取已经登陆的用户的数据 + GetMe(context.Context, *GetMeRequest) (*v1.User, error) + // Login 登陆 + Login(context.Context, *LoginRequest) (*LoginResponse, error) + // Logout 登出 + Logout(context.Context, *LogoutRequest) (*emptypb.Empty, error) + // RefreshToken 刷新认证令牌 + RefreshToken(context.Context, *RefreshTokenRequest) (*LoginResponse, error) +} + +func RegisterAuthenticationServiceHTTPServer(s *http.Server, srv AuthenticationServiceHTTPServer) { + r := s.Route("/") + r.POST("/admin/v1/login", _AuthenticationService_Login0_HTTP_Handler(srv)) + r.POST("/admin/v1/logout", _AuthenticationService_Logout0_HTTP_Handler(srv)) + r.POST("/admin/v1/refresh_token", _AuthenticationService_RefreshToken0_HTTP_Handler(srv)) + r.GET("/admin/v1/me", _AuthenticationService_GetMe0_HTTP_Handler(srv)) +} + +func _AuthenticationService_Login0_HTTP_Handler(srv AuthenticationServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in LoginRequest + if err := ctx.Bind(&in); err != nil { + return err + } + if err := ctx.BindQuery(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationAuthenticationServiceLogin) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.Login(ctx, req.(*LoginRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*LoginResponse) + return ctx.Result(200, reply) + } +} + +func _AuthenticationService_Logout0_HTTP_Handler(srv AuthenticationServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in LogoutRequest + if err := ctx.Bind(&in); err != nil { + return err + } + if err := ctx.BindQuery(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationAuthenticationServiceLogout) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.Logout(ctx, req.(*LogoutRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*emptypb.Empty) + return ctx.Result(200, reply) + } +} + +func _AuthenticationService_RefreshToken0_HTTP_Handler(srv AuthenticationServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in RefreshTokenRequest + if err := ctx.Bind(&in); err != nil { + return err + } + if err := ctx.BindQuery(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationAuthenticationServiceRefreshToken) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.RefreshToken(ctx, req.(*RefreshTokenRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*LoginResponse) + return ctx.Result(200, reply) + } +} + +func _AuthenticationService_GetMe0_HTTP_Handler(srv AuthenticationServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in GetMeRequest + if err := ctx.BindQuery(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationAuthenticationServiceGetMe) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.GetMe(ctx, req.(*GetMeRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*v1.User) + return ctx.Result(200, reply) + } +} + +type AuthenticationServiceHTTPClient interface { + GetMe(ctx context.Context, req *GetMeRequest, opts ...http.CallOption) (rsp *v1.User, err error) + Login(ctx context.Context, req *LoginRequest, opts ...http.CallOption) (rsp *LoginResponse, err error) + Logout(ctx context.Context, req *LogoutRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error) + RefreshToken(ctx context.Context, req *RefreshTokenRequest, opts ...http.CallOption) (rsp *LoginResponse, err error) +} + +type AuthenticationServiceHTTPClientImpl struct { + cc *http.Client +} + +func NewAuthenticationServiceHTTPClient(client *http.Client) AuthenticationServiceHTTPClient { + return &AuthenticationServiceHTTPClientImpl{client} +} + +func (c *AuthenticationServiceHTTPClientImpl) GetMe(ctx context.Context, in *GetMeRequest, opts ...http.CallOption) (*v1.User, error) { + var out v1.User + pattern := "/admin/v1/me" + path := binding.EncodeURL(pattern, in, true) + opts = append(opts, http.Operation(OperationAuthenticationServiceGetMe)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *AuthenticationServiceHTTPClientImpl) Login(ctx context.Context, in *LoginRequest, opts ...http.CallOption) (*LoginResponse, error) { + var out LoginResponse + pattern := "/admin/v1/login" + path := binding.EncodeURL(pattern, in, false) + opts = append(opts, http.Operation(OperationAuthenticationServiceLogin)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *AuthenticationServiceHTTPClientImpl) Logout(ctx context.Context, in *LogoutRequest, opts ...http.CallOption) (*emptypb.Empty, error) { + var out emptypb.Empty + pattern := "/admin/v1/logout" + path := binding.EncodeURL(pattern, in, false) + opts = append(opts, http.Operation(OperationAuthenticationServiceLogout)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *AuthenticationServiceHTTPClientImpl) RefreshToken(ctx context.Context, in *RefreshTokenRequest, opts ...http.CallOption) (*LoginResponse, error) { + var out LoginResponse + pattern := "/admin/v1/refresh_token" + path := binding.EncodeURL(pattern, in, false) + opts = append(opts, http.Operation(OperationAuthenticationServiceRefreshToken)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_dict.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/i_dict.pb.go new file mode 100644 index 0000000..ede72c9 --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_dict.pb.go @@ -0,0 +1,152 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: admin/service/v1/i_dict.proto + +package servicev1 + +import ( + _ "github.com/google/gnostic/openapiv3" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + v11 "kratos-monolithic-demo/gen/api/go/system/service/v1" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_admin_service_v1_i_dict_proto protoreflect.FileDescriptor + +var file_admin_service_v1_i_dict_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, + 0x76, 0x31, 0x2f, 0x69, 0x5f, 0x64, 0x69, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x10, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, + 0x31, 0x1a, 0x24, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1e, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, + 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1c, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x32, 0xbe, 0x05, 0x0a, 0x0b, 0x44, 0x69, 0x63, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x82, 0x01, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x69, 0x63, 0x74, 0x12, 0x19, 0x2e, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, + 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x44, 0x69, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0xba, + 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x11, 0x12, 0x0f, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, + 0x64, 0x69, 0x63, 0x74, 0x73, 0x12, 0x82, 0x01, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x44, 0x69, 0x63, + 0x74, 0x12, 0x21, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x69, 0x63, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x63, 0x74, 0x22, 0x3b, 0xba, + 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, + 0x64, 0x69, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x85, 0x01, 0x0a, 0x0a, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x69, 0x63, 0x74, 0x12, 0x24, 0x2e, 0x73, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x44, 0x69, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x39, 0xba, 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, + 0x0a, 0x14, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, + 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x3a, 0x01, + 0x2a, 0x22, 0x0f, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x69, 0x63, + 0x74, 0x73, 0x12, 0x92, 0x01, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x69, 0x63, + 0x74, 0x12, 0x24, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x69, 0x63, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, + 0x46, 0xba, 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, + 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x04, 0x64, 0x69, 0x63, 0x74, 0x1a, 0x19, 0x2f, 0x61, + 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x64, + 0x69, 0x63, 0x74, 0x2e, 0x69, 0x64, 0x7d, 0x12, 0x87, 0x01, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x44, 0x69, 0x63, 0x74, 0x12, 0x24, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x44, 0x69, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x22, 0x3b, 0xba, 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, + 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, + 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x2a, 0x14, 0x2f, 0x61, 0x64, + 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, + 0x7d, 0x42, 0xc2, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x49, 0x44, 0x69, 0x63, + 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, + 0x2d, 0x6d, 0x6f, 0x6e, 0x6f, 0x6c, 0x69, 0x74, 0x68, 0x69, 0x63, 0x2d, 0x64, 0x65, 0x6d, 0x6f, + 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x61, 0x64, 0x6d, 0x69, + 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x53, 0x58, 0xaa, 0x02, 0x10, 0x41, + 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x56, 0x31, 0xca, + 0x02, 0x10, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x12, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_admin_service_v1_i_dict_proto_goTypes = []interface{}{ + (*v1.PagingRequest)(nil), // 0: pagination.PagingRequest + (*v11.GetDictRequest)(nil), // 1: system.service.v1.GetDictRequest + (*v11.CreateDictRequest)(nil), // 2: system.service.v1.CreateDictRequest + (*v11.UpdateDictRequest)(nil), // 3: system.service.v1.UpdateDictRequest + (*v11.DeleteDictRequest)(nil), // 4: system.service.v1.DeleteDictRequest + (*v11.ListDictResponse)(nil), // 5: system.service.v1.ListDictResponse + (*v11.Dict)(nil), // 6: system.service.v1.Dict + (*emptypb.Empty)(nil), // 7: google.protobuf.Empty +} +var file_admin_service_v1_i_dict_proto_depIdxs = []int32{ + 0, // 0: admin.service.v1.DictService.ListDict:input_type -> pagination.PagingRequest + 1, // 1: admin.service.v1.DictService.GetDict:input_type -> system.service.v1.GetDictRequest + 2, // 2: admin.service.v1.DictService.CreateDict:input_type -> system.service.v1.CreateDictRequest + 3, // 3: admin.service.v1.DictService.UpdateDict:input_type -> system.service.v1.UpdateDictRequest + 4, // 4: admin.service.v1.DictService.DeleteDict:input_type -> system.service.v1.DeleteDictRequest + 5, // 5: admin.service.v1.DictService.ListDict:output_type -> system.service.v1.ListDictResponse + 6, // 6: admin.service.v1.DictService.GetDict:output_type -> system.service.v1.Dict + 7, // 7: admin.service.v1.DictService.CreateDict:output_type -> google.protobuf.Empty + 7, // 8: admin.service.v1.DictService.UpdateDict:output_type -> google.protobuf.Empty + 7, // 9: admin.service.v1.DictService.DeleteDict:output_type -> google.protobuf.Empty + 5, // [5:10] is the sub-list for method output_type + 0, // [0:5] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_admin_service_v1_i_dict_proto_init() } +func file_admin_service_v1_i_dict_proto_init() { + if File_admin_service_v1_i_dict_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_admin_service_v1_i_dict_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_admin_service_v1_i_dict_proto_goTypes, + DependencyIndexes: file_admin_service_v1_i_dict_proto_depIdxs, + }.Build() + File_admin_service_v1_i_dict_proto = out.File + file_admin_service_v1_i_dict_proto_rawDesc = nil + file_admin_service_v1_i_dict_proto_goTypes = nil + file_admin_service_v1_i_dict_proto_depIdxs = nil +} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_dict.pb.validate.go b/monolithic/backend/gen/api/go/admin/service/v1/i_dict.pb.validate.go new file mode 100644 index 0000000..806cc89 --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_dict.pb.validate.go @@ -0,0 +1,36 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: admin/service/v1/i_dict.proto + +package servicev1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_dict_detail.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/i_dict_detail.pb.go new file mode 100644 index 0000000..30234c9 --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_dict_detail.pb.go @@ -0,0 +1,161 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: admin/service/v1/i_dict_detail.proto + +package servicev1 + +import ( + _ "github.com/google/gnostic/openapiv3" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + v11 "kratos-monolithic-demo/gen/api/go/system/service/v1" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_admin_service_v1_i_dict_detail_proto protoreflect.FileDescriptor + +var file_admin_service_v1_i_dict_detail_proto_rawDesc = []byte{ + 0x0a, 0x24, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, + 0x76, 0x31, 0x2f, 0x69, 0x5f, 0x64, 0x69, 0x63, 0x74, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x24, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, + 0x63, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, + 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x70, 0x61, 0x67, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x73, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x69, 0x63, + 0x74, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xad, + 0x06, 0x0a, 0x11, 0x44, 0x69, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x95, 0x01, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x69, 0x63, + 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x69, 0x63, 0x74, 0x44, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0xba, + 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, + 0x64, 0x69, 0x63, 0x74, 0x3a, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x9b, 0x01, 0x0a, + 0x0d, 0x47, 0x65, 0x74, 0x44, 0x69, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x27, + 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x69, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x63, 0x74, + 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x22, 0x42, 0xba, 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, + 0x14, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, + 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3a, 0x64, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x98, 0x01, 0x0a, 0x10, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x69, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, + 0x2a, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x69, 0x63, 0x74, 0x44, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x22, 0x40, 0xba, 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, 0x41, + 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, 0x72, + 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x3a, 0x01, 0x2a, 0x22, 0x16, 0x2f, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3a, 0x64, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0xa9, 0x01, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x44, 0x69, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x2a, 0x2e, 0x73, 0x79, 0x73, + 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x69, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x51, + 0xba, 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x3a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x1a, 0x22, 0x2f, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3a, 0x64, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2f, 0x7b, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x2e, 0x69, 0x64, + 0x7d, 0x12, 0x9a, 0x01, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x69, 0x63, 0x74, + 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x2a, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x44, 0x69, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x42, 0xba, 0x47, 0x1c, 0x5a, + 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, + 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x1d, 0x2a, 0x1b, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x69, 0x63, + 0x74, 0x3a, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x42, 0xc8, + 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x10, 0x49, 0x44, 0x69, 0x63, 0x74, 0x44, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x6b, 0x72, 0x61, + 0x74, 0x6f, 0x73, 0x2d, 0x6d, 0x6f, 0x6e, 0x6f, 0x6c, 0x69, 0x74, 0x68, 0x69, 0x63, 0x2d, 0x64, + 0x65, 0x6d, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x61, + 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x3b, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x53, 0x58, 0xaa, + 0x02, 0x10, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x56, 0x31, 0xca, 0x02, 0x10, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x5c, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x3a, 0x3a, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var file_admin_service_v1_i_dict_detail_proto_goTypes = []interface{}{ + (*v1.PagingRequest)(nil), // 0: pagination.PagingRequest + (*v11.GetDictDetailRequest)(nil), // 1: system.service.v1.GetDictDetailRequest + (*v11.CreateDictDetailRequest)(nil), // 2: system.service.v1.CreateDictDetailRequest + (*v11.UpdateDictDetailRequest)(nil), // 3: system.service.v1.UpdateDictDetailRequest + (*v11.DeleteDictDetailRequest)(nil), // 4: system.service.v1.DeleteDictDetailRequest + (*v11.ListDictDetailResponse)(nil), // 5: system.service.v1.ListDictDetailResponse + (*v11.DictDetail)(nil), // 6: system.service.v1.DictDetail + (*emptypb.Empty)(nil), // 7: google.protobuf.Empty +} +var file_admin_service_v1_i_dict_detail_proto_depIdxs = []int32{ + 0, // 0: admin.service.v1.DictDetailService.ListDictDetail:input_type -> pagination.PagingRequest + 1, // 1: admin.service.v1.DictDetailService.GetDictDetail:input_type -> system.service.v1.GetDictDetailRequest + 2, // 2: admin.service.v1.DictDetailService.CreateDictDetail:input_type -> system.service.v1.CreateDictDetailRequest + 3, // 3: admin.service.v1.DictDetailService.UpdateDictDetail:input_type -> system.service.v1.UpdateDictDetailRequest + 4, // 4: admin.service.v1.DictDetailService.DeleteDictDetail:input_type -> system.service.v1.DeleteDictDetailRequest + 5, // 5: admin.service.v1.DictDetailService.ListDictDetail:output_type -> system.service.v1.ListDictDetailResponse + 6, // 6: admin.service.v1.DictDetailService.GetDictDetail:output_type -> system.service.v1.DictDetail + 7, // 7: admin.service.v1.DictDetailService.CreateDictDetail:output_type -> google.protobuf.Empty + 7, // 8: admin.service.v1.DictDetailService.UpdateDictDetail:output_type -> google.protobuf.Empty + 7, // 9: admin.service.v1.DictDetailService.DeleteDictDetail:output_type -> google.protobuf.Empty + 5, // [5:10] is the sub-list for method output_type + 0, // [0:5] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_admin_service_v1_i_dict_detail_proto_init() } +func file_admin_service_v1_i_dict_detail_proto_init() { + if File_admin_service_v1_i_dict_detail_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_admin_service_v1_i_dict_detail_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_admin_service_v1_i_dict_detail_proto_goTypes, + DependencyIndexes: file_admin_service_v1_i_dict_detail_proto_depIdxs, + }.Build() + File_admin_service_v1_i_dict_detail_proto = out.File + file_admin_service_v1_i_dict_detail_proto_rawDesc = nil + file_admin_service_v1_i_dict_detail_proto_goTypes = nil + file_admin_service_v1_i_dict_detail_proto_depIdxs = nil +} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_dict_detail.pb.validate.go b/monolithic/backend/gen/api/go/admin/service/v1/i_dict_detail.pb.validate.go new file mode 100644 index 0000000..38f37f6 --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_dict_detail.pb.validate.go @@ -0,0 +1,36 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: admin/service/v1/i_dict_detail.proto + +package servicev1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_dict_detail_grpc.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/i_dict_detail_grpc.pb.go new file mode 100644 index 0000000..27275b1 --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_dict_detail_grpc.pb.go @@ -0,0 +1,270 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: admin/service/v1/i_dict_detail.proto + +package servicev1 + +import ( + context "context" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" + v11 "kratos-monolithic-demo/gen/api/go/system/service/v1" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + DictDetailService_ListDictDetail_FullMethodName = "/admin.service.v1.DictDetailService/ListDictDetail" + DictDetailService_GetDictDetail_FullMethodName = "/admin.service.v1.DictDetailService/GetDictDetail" + DictDetailService_CreateDictDetail_FullMethodName = "/admin.service.v1.DictDetailService/CreateDictDetail" + DictDetailService_UpdateDictDetail_FullMethodName = "/admin.service.v1.DictDetailService/UpdateDictDetail" + DictDetailService_DeleteDictDetail_FullMethodName = "/admin.service.v1.DictDetailService/DeleteDictDetail" +) + +// DictDetailServiceClient is the client API for DictDetailService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type DictDetailServiceClient interface { + // 查询字典详情列表 + ListDictDetail(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*v11.ListDictDetailResponse, error) + // 查询字典详情 + GetDictDetail(ctx context.Context, in *v11.GetDictDetailRequest, opts ...grpc.CallOption) (*v11.DictDetail, error) + // 创建字典详情 + CreateDictDetail(ctx context.Context, in *v11.CreateDictDetailRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 更新字典详情 + UpdateDictDetail(ctx context.Context, in *v11.UpdateDictDetailRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 删除字典详情 + DeleteDictDetail(ctx context.Context, in *v11.DeleteDictDetailRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type dictDetailServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewDictDetailServiceClient(cc grpc.ClientConnInterface) DictDetailServiceClient { + return &dictDetailServiceClient{cc} +} + +func (c *dictDetailServiceClient) ListDictDetail(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*v11.ListDictDetailResponse, error) { + out := new(v11.ListDictDetailResponse) + err := c.cc.Invoke(ctx, DictDetailService_ListDictDetail_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dictDetailServiceClient) GetDictDetail(ctx context.Context, in *v11.GetDictDetailRequest, opts ...grpc.CallOption) (*v11.DictDetail, error) { + out := new(v11.DictDetail) + err := c.cc.Invoke(ctx, DictDetailService_GetDictDetail_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dictDetailServiceClient) CreateDictDetail(ctx context.Context, in *v11.CreateDictDetailRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, DictDetailService_CreateDictDetail_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dictDetailServiceClient) UpdateDictDetail(ctx context.Context, in *v11.UpdateDictDetailRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, DictDetailService_UpdateDictDetail_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dictDetailServiceClient) DeleteDictDetail(ctx context.Context, in *v11.DeleteDictDetailRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, DictDetailService_DeleteDictDetail_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// DictDetailServiceServer is the server API for DictDetailService service. +// All implementations must embed UnimplementedDictDetailServiceServer +// for forward compatibility +type DictDetailServiceServer interface { + // 查询字典详情列表 + ListDictDetail(context.Context, *v1.PagingRequest) (*v11.ListDictDetailResponse, error) + // 查询字典详情 + GetDictDetail(context.Context, *v11.GetDictDetailRequest) (*v11.DictDetail, error) + // 创建字典详情 + CreateDictDetail(context.Context, *v11.CreateDictDetailRequest) (*emptypb.Empty, error) + // 更新字典详情 + UpdateDictDetail(context.Context, *v11.UpdateDictDetailRequest) (*emptypb.Empty, error) + // 删除字典详情 + DeleteDictDetail(context.Context, *v11.DeleteDictDetailRequest) (*emptypb.Empty, error) + mustEmbedUnimplementedDictDetailServiceServer() +} + +// UnimplementedDictDetailServiceServer must be embedded to have forward compatible implementations. +type UnimplementedDictDetailServiceServer struct { +} + +func (UnimplementedDictDetailServiceServer) ListDictDetail(context.Context, *v1.PagingRequest) (*v11.ListDictDetailResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListDictDetail not implemented") +} +func (UnimplementedDictDetailServiceServer) GetDictDetail(context.Context, *v11.GetDictDetailRequest) (*v11.DictDetail, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDictDetail not implemented") +} +func (UnimplementedDictDetailServiceServer) CreateDictDetail(context.Context, *v11.CreateDictDetailRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateDictDetail not implemented") +} +func (UnimplementedDictDetailServiceServer) UpdateDictDetail(context.Context, *v11.UpdateDictDetailRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateDictDetail not implemented") +} +func (UnimplementedDictDetailServiceServer) DeleteDictDetail(context.Context, *v11.DeleteDictDetailRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteDictDetail not implemented") +} +func (UnimplementedDictDetailServiceServer) mustEmbedUnimplementedDictDetailServiceServer() {} + +// UnsafeDictDetailServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to DictDetailServiceServer will +// result in compilation errors. +type UnsafeDictDetailServiceServer interface { + mustEmbedUnimplementedDictDetailServiceServer() +} + +func RegisterDictDetailServiceServer(s grpc.ServiceRegistrar, srv DictDetailServiceServer) { + s.RegisterService(&DictDetailService_ServiceDesc, srv) +} + +func _DictDetailService_ListDictDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v1.PagingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DictDetailServiceServer).ListDictDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DictDetailService_ListDictDetail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DictDetailServiceServer).ListDictDetail(ctx, req.(*v1.PagingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DictDetailService_GetDictDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v11.GetDictDetailRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DictDetailServiceServer).GetDictDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DictDetailService_GetDictDetail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DictDetailServiceServer).GetDictDetail(ctx, req.(*v11.GetDictDetailRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DictDetailService_CreateDictDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v11.CreateDictDetailRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DictDetailServiceServer).CreateDictDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DictDetailService_CreateDictDetail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DictDetailServiceServer).CreateDictDetail(ctx, req.(*v11.CreateDictDetailRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DictDetailService_UpdateDictDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v11.UpdateDictDetailRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DictDetailServiceServer).UpdateDictDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DictDetailService_UpdateDictDetail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DictDetailServiceServer).UpdateDictDetail(ctx, req.(*v11.UpdateDictDetailRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DictDetailService_DeleteDictDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v11.DeleteDictDetailRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DictDetailServiceServer).DeleteDictDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DictDetailService_DeleteDictDetail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DictDetailServiceServer).DeleteDictDetail(ctx, req.(*v11.DeleteDictDetailRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// DictDetailService_ServiceDesc is the grpc.ServiceDesc for DictDetailService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var DictDetailService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "admin.service.v1.DictDetailService", + HandlerType: (*DictDetailServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListDictDetail", + Handler: _DictDetailService_ListDictDetail_Handler, + }, + { + MethodName: "GetDictDetail", + Handler: _DictDetailService_GetDictDetail_Handler, + }, + { + MethodName: "CreateDictDetail", + Handler: _DictDetailService_CreateDictDetail_Handler, + }, + { + MethodName: "UpdateDictDetail", + Handler: _DictDetailService_UpdateDictDetail_Handler, + }, + { + MethodName: "DeleteDictDetail", + Handler: _DictDetailService_DeleteDictDetail_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "admin/service/v1/i_dict_detail.proto", +} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_dict_detail_http.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/i_dict_detail_http.pb.go new file mode 100644 index 0000000..11d486f --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_dict_detail_http.pb.go @@ -0,0 +1,242 @@ +// Code generated by protoc-gen-go-http. DO NOT EDIT. +// versions: +// - protoc-gen-go-http v2.7.1 +// - protoc (unknown) +// source: admin/service/v1/i_dict_detail.proto + +package servicev1 + +import ( + context "context" + http "github.com/go-kratos/kratos/v2/transport/http" + binding "github.com/go-kratos/kratos/v2/transport/http/binding" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + emptypb "google.golang.org/protobuf/types/known/emptypb" + v11 "kratos-monolithic-demo/gen/api/go/system/service/v1" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the kratos package it is being compiled against. +var _ = new(context.Context) +var _ = binding.EncodeURL + +const _ = http.SupportPackageIsVersion1 + +const OperationDictDetailServiceCreateDictDetail = "/admin.service.v1.DictDetailService/CreateDictDetail" +const OperationDictDetailServiceDeleteDictDetail = "/admin.service.v1.DictDetailService/DeleteDictDetail" +const OperationDictDetailServiceGetDictDetail = "/admin.service.v1.DictDetailService/GetDictDetail" +const OperationDictDetailServiceListDictDetail = "/admin.service.v1.DictDetailService/ListDictDetail" +const OperationDictDetailServiceUpdateDictDetail = "/admin.service.v1.DictDetailService/UpdateDictDetail" + +type DictDetailServiceHTTPServer interface { + // CreateDictDetail 创建字典详情 + CreateDictDetail(context.Context, *v11.CreateDictDetailRequest) (*emptypb.Empty, error) + // DeleteDictDetail 删除字典详情 + DeleteDictDetail(context.Context, *v11.DeleteDictDetailRequest) (*emptypb.Empty, error) + // GetDictDetail 查询字典详情 + GetDictDetail(context.Context, *v11.GetDictDetailRequest) (*v11.DictDetail, error) + // ListDictDetail 查询字典详情列表 + ListDictDetail(context.Context, *v1.PagingRequest) (*v11.ListDictDetailResponse, error) + // UpdateDictDetail 更新字典详情 + UpdateDictDetail(context.Context, *v11.UpdateDictDetailRequest) (*emptypb.Empty, error) +} + +func RegisterDictDetailServiceHTTPServer(s *http.Server, srv DictDetailServiceHTTPServer) { + r := s.Route("/") + r.GET("/admin/v1/dict:details", _DictDetailService_ListDictDetail0_HTTP_Handler(srv)) + r.GET("/admin/v1/dict:details/{id}", _DictDetailService_GetDictDetail0_HTTP_Handler(srv)) + r.POST("/admin/v1/dict:details", _DictDetailService_CreateDictDetail0_HTTP_Handler(srv)) + r.PUT("/admin/v1/dict:details/{detail.id}", _DictDetailService_UpdateDictDetail0_HTTP_Handler(srv)) + r.DELETE("/admin/v1/dict:details/{id}", _DictDetailService_DeleteDictDetail0_HTTP_Handler(srv)) +} + +func _DictDetailService_ListDictDetail0_HTTP_Handler(srv DictDetailServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v1.PagingRequest + if err := ctx.BindQuery(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationDictDetailServiceListDictDetail) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.ListDictDetail(ctx, req.(*v1.PagingRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*v11.ListDictDetailResponse) + return ctx.Result(200, reply) + } +} + +func _DictDetailService_GetDictDetail0_HTTP_Handler(srv DictDetailServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v11.GetDictDetailRequest + if err := ctx.BindQuery(&in); err != nil { + return err + } + if err := ctx.BindVars(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationDictDetailServiceGetDictDetail) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.GetDictDetail(ctx, req.(*v11.GetDictDetailRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*v11.DictDetail) + return ctx.Result(200, reply) + } +} + +func _DictDetailService_CreateDictDetail0_HTTP_Handler(srv DictDetailServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v11.CreateDictDetailRequest + if err := ctx.Bind(&in); err != nil { + return err + } + if err := ctx.BindQuery(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationDictDetailServiceCreateDictDetail) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.CreateDictDetail(ctx, req.(*v11.CreateDictDetailRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*emptypb.Empty) + return ctx.Result(200, reply) + } +} + +func _DictDetailService_UpdateDictDetail0_HTTP_Handler(srv DictDetailServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v11.UpdateDictDetailRequest + if err := ctx.Bind(&in.Detail); err != nil { + return err + } + if err := ctx.BindQuery(&in); err != nil { + return err + } + if err := ctx.BindVars(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationDictDetailServiceUpdateDictDetail) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.UpdateDictDetail(ctx, req.(*v11.UpdateDictDetailRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*emptypb.Empty) + return ctx.Result(200, reply) + } +} + +func _DictDetailService_DeleteDictDetail0_HTTP_Handler(srv DictDetailServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v11.DeleteDictDetailRequest + if err := ctx.BindQuery(&in); err != nil { + return err + } + if err := ctx.BindVars(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationDictDetailServiceDeleteDictDetail) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.DeleteDictDetail(ctx, req.(*v11.DeleteDictDetailRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*emptypb.Empty) + return ctx.Result(200, reply) + } +} + +type DictDetailServiceHTTPClient interface { + CreateDictDetail(ctx context.Context, req *v11.CreateDictDetailRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error) + DeleteDictDetail(ctx context.Context, req *v11.DeleteDictDetailRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error) + GetDictDetail(ctx context.Context, req *v11.GetDictDetailRequest, opts ...http.CallOption) (rsp *v11.DictDetail, err error) + ListDictDetail(ctx context.Context, req *v1.PagingRequest, opts ...http.CallOption) (rsp *v11.ListDictDetailResponse, err error) + UpdateDictDetail(ctx context.Context, req *v11.UpdateDictDetailRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error) +} + +type DictDetailServiceHTTPClientImpl struct { + cc *http.Client +} + +func NewDictDetailServiceHTTPClient(client *http.Client) DictDetailServiceHTTPClient { + return &DictDetailServiceHTTPClientImpl{client} +} + +func (c *DictDetailServiceHTTPClientImpl) CreateDictDetail(ctx context.Context, in *v11.CreateDictDetailRequest, opts ...http.CallOption) (*emptypb.Empty, error) { + var out emptypb.Empty + pattern := "/admin/v1/dict:details" + path := binding.EncodeURL(pattern, in, false) + opts = append(opts, http.Operation(OperationDictDetailServiceCreateDictDetail)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *DictDetailServiceHTTPClientImpl) DeleteDictDetail(ctx context.Context, in *v11.DeleteDictDetailRequest, opts ...http.CallOption) (*emptypb.Empty, error) { + var out emptypb.Empty + pattern := "/admin/v1/dict:details/{id}" + path := binding.EncodeURL(pattern, in, true) + opts = append(opts, http.Operation(OperationDictDetailServiceDeleteDictDetail)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "DELETE", path, nil, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *DictDetailServiceHTTPClientImpl) GetDictDetail(ctx context.Context, in *v11.GetDictDetailRequest, opts ...http.CallOption) (*v11.DictDetail, error) { + var out v11.DictDetail + pattern := "/admin/v1/dict:details/{id}" + path := binding.EncodeURL(pattern, in, true) + opts = append(opts, http.Operation(OperationDictDetailServiceGetDictDetail)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *DictDetailServiceHTTPClientImpl) ListDictDetail(ctx context.Context, in *v1.PagingRequest, opts ...http.CallOption) (*v11.ListDictDetailResponse, error) { + var out v11.ListDictDetailResponse + pattern := "/admin/v1/dict:details" + path := binding.EncodeURL(pattern, in, true) + opts = append(opts, http.Operation(OperationDictDetailServiceListDictDetail)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *DictDetailServiceHTTPClientImpl) UpdateDictDetail(ctx context.Context, in *v11.UpdateDictDetailRequest, opts ...http.CallOption) (*emptypb.Empty, error) { + var out emptypb.Empty + pattern := "/admin/v1/dict:details/{detail.id}" + path := binding.EncodeURL(pattern, in, false) + opts = append(opts, http.Operation(OperationDictDetailServiceUpdateDictDetail)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "PUT", path, in.Detail, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_dict_grpc.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/i_dict_grpc.pb.go new file mode 100644 index 0000000..d2c2dc7 --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_dict_grpc.pb.go @@ -0,0 +1,270 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: admin/service/v1/i_dict.proto + +package servicev1 + +import ( + context "context" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" + v11 "kratos-monolithic-demo/gen/api/go/system/service/v1" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + DictService_ListDict_FullMethodName = "/admin.service.v1.DictService/ListDict" + DictService_GetDict_FullMethodName = "/admin.service.v1.DictService/GetDict" + DictService_CreateDict_FullMethodName = "/admin.service.v1.DictService/CreateDict" + DictService_UpdateDict_FullMethodName = "/admin.service.v1.DictService/UpdateDict" + DictService_DeleteDict_FullMethodName = "/admin.service.v1.DictService/DeleteDict" +) + +// DictServiceClient is the client API for DictService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type DictServiceClient interface { + // 查询字典列表 + ListDict(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*v11.ListDictResponse, error) + // 查询字典 + GetDict(ctx context.Context, in *v11.GetDictRequest, opts ...grpc.CallOption) (*v11.Dict, error) + // 创建字典 + CreateDict(ctx context.Context, in *v11.CreateDictRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 更新字典 + UpdateDict(ctx context.Context, in *v11.UpdateDictRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 删除字典 + DeleteDict(ctx context.Context, in *v11.DeleteDictRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type dictServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewDictServiceClient(cc grpc.ClientConnInterface) DictServiceClient { + return &dictServiceClient{cc} +} + +func (c *dictServiceClient) ListDict(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*v11.ListDictResponse, error) { + out := new(v11.ListDictResponse) + err := c.cc.Invoke(ctx, DictService_ListDict_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dictServiceClient) GetDict(ctx context.Context, in *v11.GetDictRequest, opts ...grpc.CallOption) (*v11.Dict, error) { + out := new(v11.Dict) + err := c.cc.Invoke(ctx, DictService_GetDict_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dictServiceClient) CreateDict(ctx context.Context, in *v11.CreateDictRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, DictService_CreateDict_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dictServiceClient) UpdateDict(ctx context.Context, in *v11.UpdateDictRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, DictService_UpdateDict_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dictServiceClient) DeleteDict(ctx context.Context, in *v11.DeleteDictRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, DictService_DeleteDict_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// DictServiceServer is the server API for DictService service. +// All implementations must embed UnimplementedDictServiceServer +// for forward compatibility +type DictServiceServer interface { + // 查询字典列表 + ListDict(context.Context, *v1.PagingRequest) (*v11.ListDictResponse, error) + // 查询字典 + GetDict(context.Context, *v11.GetDictRequest) (*v11.Dict, error) + // 创建字典 + CreateDict(context.Context, *v11.CreateDictRequest) (*emptypb.Empty, error) + // 更新字典 + UpdateDict(context.Context, *v11.UpdateDictRequest) (*emptypb.Empty, error) + // 删除字典 + DeleteDict(context.Context, *v11.DeleteDictRequest) (*emptypb.Empty, error) + mustEmbedUnimplementedDictServiceServer() +} + +// UnimplementedDictServiceServer must be embedded to have forward compatible implementations. +type UnimplementedDictServiceServer struct { +} + +func (UnimplementedDictServiceServer) ListDict(context.Context, *v1.PagingRequest) (*v11.ListDictResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListDict not implemented") +} +func (UnimplementedDictServiceServer) GetDict(context.Context, *v11.GetDictRequest) (*v11.Dict, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDict not implemented") +} +func (UnimplementedDictServiceServer) CreateDict(context.Context, *v11.CreateDictRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateDict not implemented") +} +func (UnimplementedDictServiceServer) UpdateDict(context.Context, *v11.UpdateDictRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateDict not implemented") +} +func (UnimplementedDictServiceServer) DeleteDict(context.Context, *v11.DeleteDictRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteDict not implemented") +} +func (UnimplementedDictServiceServer) mustEmbedUnimplementedDictServiceServer() {} + +// UnsafeDictServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to DictServiceServer will +// result in compilation errors. +type UnsafeDictServiceServer interface { + mustEmbedUnimplementedDictServiceServer() +} + +func RegisterDictServiceServer(s grpc.ServiceRegistrar, srv DictServiceServer) { + s.RegisterService(&DictService_ServiceDesc, srv) +} + +func _DictService_ListDict_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v1.PagingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DictServiceServer).ListDict(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DictService_ListDict_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DictServiceServer).ListDict(ctx, req.(*v1.PagingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DictService_GetDict_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v11.GetDictRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DictServiceServer).GetDict(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DictService_GetDict_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DictServiceServer).GetDict(ctx, req.(*v11.GetDictRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DictService_CreateDict_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v11.CreateDictRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DictServiceServer).CreateDict(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DictService_CreateDict_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DictServiceServer).CreateDict(ctx, req.(*v11.CreateDictRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DictService_UpdateDict_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v11.UpdateDictRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DictServiceServer).UpdateDict(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DictService_UpdateDict_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DictServiceServer).UpdateDict(ctx, req.(*v11.UpdateDictRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DictService_DeleteDict_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v11.DeleteDictRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DictServiceServer).DeleteDict(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DictService_DeleteDict_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DictServiceServer).DeleteDict(ctx, req.(*v11.DeleteDictRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// DictService_ServiceDesc is the grpc.ServiceDesc for DictService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var DictService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "admin.service.v1.DictService", + HandlerType: (*DictServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListDict", + Handler: _DictService_ListDict_Handler, + }, + { + MethodName: "GetDict", + Handler: _DictService_GetDict_Handler, + }, + { + MethodName: "CreateDict", + Handler: _DictService_CreateDict_Handler, + }, + { + MethodName: "UpdateDict", + Handler: _DictService_UpdateDict_Handler, + }, + { + MethodName: "DeleteDict", + Handler: _DictService_DeleteDict_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "admin/service/v1/i_dict.proto", +} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_dict_http.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/i_dict_http.pb.go new file mode 100644 index 0000000..48ae1be --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_dict_http.pb.go @@ -0,0 +1,242 @@ +// Code generated by protoc-gen-go-http. DO NOT EDIT. +// versions: +// - protoc-gen-go-http v2.7.1 +// - protoc (unknown) +// source: admin/service/v1/i_dict.proto + +package servicev1 + +import ( + context "context" + http "github.com/go-kratos/kratos/v2/transport/http" + binding "github.com/go-kratos/kratos/v2/transport/http/binding" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + emptypb "google.golang.org/protobuf/types/known/emptypb" + v11 "kratos-monolithic-demo/gen/api/go/system/service/v1" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the kratos package it is being compiled against. +var _ = new(context.Context) +var _ = binding.EncodeURL + +const _ = http.SupportPackageIsVersion1 + +const OperationDictServiceCreateDict = "/admin.service.v1.DictService/CreateDict" +const OperationDictServiceDeleteDict = "/admin.service.v1.DictService/DeleteDict" +const OperationDictServiceGetDict = "/admin.service.v1.DictService/GetDict" +const OperationDictServiceListDict = "/admin.service.v1.DictService/ListDict" +const OperationDictServiceUpdateDict = "/admin.service.v1.DictService/UpdateDict" + +type DictServiceHTTPServer interface { + // CreateDict 创建字典 + CreateDict(context.Context, *v11.CreateDictRequest) (*emptypb.Empty, error) + // DeleteDict 删除字典 + DeleteDict(context.Context, *v11.DeleteDictRequest) (*emptypb.Empty, error) + // GetDict 查询字典 + GetDict(context.Context, *v11.GetDictRequest) (*v11.Dict, error) + // ListDict 查询字典列表 + ListDict(context.Context, *v1.PagingRequest) (*v11.ListDictResponse, error) + // UpdateDict 更新字典 + UpdateDict(context.Context, *v11.UpdateDictRequest) (*emptypb.Empty, error) +} + +func RegisterDictServiceHTTPServer(s *http.Server, srv DictServiceHTTPServer) { + r := s.Route("/") + r.GET("/admin/v1/dicts", _DictService_ListDict0_HTTP_Handler(srv)) + r.GET("/admin/v1/dicts/{id}", _DictService_GetDict0_HTTP_Handler(srv)) + r.POST("/admin/v1/dicts", _DictService_CreateDict0_HTTP_Handler(srv)) + r.PUT("/admin/v1/dicts/{dict.id}", _DictService_UpdateDict0_HTTP_Handler(srv)) + r.DELETE("/admin/v1/dicts/{id}", _DictService_DeleteDict0_HTTP_Handler(srv)) +} + +func _DictService_ListDict0_HTTP_Handler(srv DictServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v1.PagingRequest + if err := ctx.BindQuery(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationDictServiceListDict) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.ListDict(ctx, req.(*v1.PagingRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*v11.ListDictResponse) + return ctx.Result(200, reply) + } +} + +func _DictService_GetDict0_HTTP_Handler(srv DictServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v11.GetDictRequest + if err := ctx.BindQuery(&in); err != nil { + return err + } + if err := ctx.BindVars(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationDictServiceGetDict) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.GetDict(ctx, req.(*v11.GetDictRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*v11.Dict) + return ctx.Result(200, reply) + } +} + +func _DictService_CreateDict0_HTTP_Handler(srv DictServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v11.CreateDictRequest + if err := ctx.Bind(&in); err != nil { + return err + } + if err := ctx.BindQuery(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationDictServiceCreateDict) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.CreateDict(ctx, req.(*v11.CreateDictRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*emptypb.Empty) + return ctx.Result(200, reply) + } +} + +func _DictService_UpdateDict0_HTTP_Handler(srv DictServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v11.UpdateDictRequest + if err := ctx.Bind(&in.Dict); err != nil { + return err + } + if err := ctx.BindQuery(&in); err != nil { + return err + } + if err := ctx.BindVars(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationDictServiceUpdateDict) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.UpdateDict(ctx, req.(*v11.UpdateDictRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*emptypb.Empty) + return ctx.Result(200, reply) + } +} + +func _DictService_DeleteDict0_HTTP_Handler(srv DictServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v11.DeleteDictRequest + if err := ctx.BindQuery(&in); err != nil { + return err + } + if err := ctx.BindVars(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationDictServiceDeleteDict) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.DeleteDict(ctx, req.(*v11.DeleteDictRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*emptypb.Empty) + return ctx.Result(200, reply) + } +} + +type DictServiceHTTPClient interface { + CreateDict(ctx context.Context, req *v11.CreateDictRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error) + DeleteDict(ctx context.Context, req *v11.DeleteDictRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error) + GetDict(ctx context.Context, req *v11.GetDictRequest, opts ...http.CallOption) (rsp *v11.Dict, err error) + ListDict(ctx context.Context, req *v1.PagingRequest, opts ...http.CallOption) (rsp *v11.ListDictResponse, err error) + UpdateDict(ctx context.Context, req *v11.UpdateDictRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error) +} + +type DictServiceHTTPClientImpl struct { + cc *http.Client +} + +func NewDictServiceHTTPClient(client *http.Client) DictServiceHTTPClient { + return &DictServiceHTTPClientImpl{client} +} + +func (c *DictServiceHTTPClientImpl) CreateDict(ctx context.Context, in *v11.CreateDictRequest, opts ...http.CallOption) (*emptypb.Empty, error) { + var out emptypb.Empty + pattern := "/admin/v1/dicts" + path := binding.EncodeURL(pattern, in, false) + opts = append(opts, http.Operation(OperationDictServiceCreateDict)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *DictServiceHTTPClientImpl) DeleteDict(ctx context.Context, in *v11.DeleteDictRequest, opts ...http.CallOption) (*emptypb.Empty, error) { + var out emptypb.Empty + pattern := "/admin/v1/dicts/{id}" + path := binding.EncodeURL(pattern, in, true) + opts = append(opts, http.Operation(OperationDictServiceDeleteDict)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "DELETE", path, nil, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *DictServiceHTTPClientImpl) GetDict(ctx context.Context, in *v11.GetDictRequest, opts ...http.CallOption) (*v11.Dict, error) { + var out v11.Dict + pattern := "/admin/v1/dicts/{id}" + path := binding.EncodeURL(pattern, in, true) + opts = append(opts, http.Operation(OperationDictServiceGetDict)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *DictServiceHTTPClientImpl) ListDict(ctx context.Context, in *v1.PagingRequest, opts ...http.CallOption) (*v11.ListDictResponse, error) { + var out v11.ListDictResponse + pattern := "/admin/v1/dicts" + path := binding.EncodeURL(pattern, in, true) + opts = append(opts, http.Operation(OperationDictServiceListDict)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *DictServiceHTTPClientImpl) UpdateDict(ctx context.Context, in *v11.UpdateDictRequest, opts ...http.CallOption) (*emptypb.Empty, error) { + var out emptypb.Empty + pattern := "/admin/v1/dicts/{dict.id}" + path := binding.EncodeURL(pattern, in, false) + opts = append(opts, http.Operation(OperationDictServiceUpdateDict)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "PUT", path, in.Dict, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_menu.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/i_menu.pb.go new file mode 100644 index 0000000..c3b9038 --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_menu.pb.go @@ -0,0 +1,152 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: admin/service/v1/i_menu.proto + +package servicev1 + +import ( + _ "github.com/google/gnostic/openapiv3" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + v11 "kratos-monolithic-demo/gen/api/go/system/service/v1" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_admin_service_v1_i_menu_proto protoreflect.FileDescriptor + +var file_admin_service_v1_i_menu_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, + 0x76, 0x31, 0x2f, 0x69, 0x5f, 0x6d, 0x65, 0x6e, 0x75, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x10, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, + 0x31, 0x1a, 0x24, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1e, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, + 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1c, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, 0x6e, 0x75, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x32, 0xbe, 0x05, 0x0a, 0x0b, 0x4d, 0x65, 0x6e, 0x75, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x82, 0x01, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6e, 0x75, 0x12, 0x19, 0x2e, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, + 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x4d, 0x65, 0x6e, 0x75, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0xba, + 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x11, 0x12, 0x0f, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, + 0x6d, 0x65, 0x6e, 0x75, 0x73, 0x12, 0x82, 0x01, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6e, + 0x75, 0x12, 0x21, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6e, 0x75, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x6e, 0x75, 0x22, 0x3b, 0xba, + 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, + 0x6d, 0x65, 0x6e, 0x75, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x85, 0x01, 0x0a, 0x0a, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6e, 0x75, 0x12, 0x24, 0x2e, 0x73, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6e, 0x75, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x39, 0xba, 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, + 0x0a, 0x14, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, + 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x3a, 0x01, + 0x2a, 0x22, 0x0f, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, 0x6e, + 0x75, 0x73, 0x12, 0x92, 0x01, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6e, + 0x75, 0x12, 0x24, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6e, 0x75, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, + 0x46, 0xba, 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, + 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x04, 0x6d, 0x65, 0x6e, 0x75, 0x1a, 0x19, 0x2f, 0x61, + 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, 0x6e, 0x75, 0x73, 0x2f, 0x7b, 0x6d, + 0x65, 0x6e, 0x75, 0x2e, 0x69, 0x64, 0x7d, 0x12, 0x87, 0x01, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x4d, 0x65, 0x6e, 0x75, 0x12, 0x24, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x4d, 0x65, 0x6e, 0x75, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x22, 0x3b, 0xba, 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, + 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, + 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x2a, 0x14, 0x2f, 0x61, 0x64, + 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, 0x6e, 0x75, 0x73, 0x2f, 0x7b, 0x69, 0x64, + 0x7d, 0x42, 0xc2, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x49, 0x4d, 0x65, 0x6e, + 0x75, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, + 0x2d, 0x6d, 0x6f, 0x6e, 0x6f, 0x6c, 0x69, 0x74, 0x68, 0x69, 0x63, 0x2d, 0x64, 0x65, 0x6d, 0x6f, + 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x61, 0x64, 0x6d, 0x69, + 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x53, 0x58, 0xaa, 0x02, 0x10, 0x41, + 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x56, 0x31, 0xca, + 0x02, 0x10, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x12, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_admin_service_v1_i_menu_proto_goTypes = []interface{}{ + (*v1.PagingRequest)(nil), // 0: pagination.PagingRequest + (*v11.GetMenuRequest)(nil), // 1: system.service.v1.GetMenuRequest + (*v11.CreateMenuRequest)(nil), // 2: system.service.v1.CreateMenuRequest + (*v11.UpdateMenuRequest)(nil), // 3: system.service.v1.UpdateMenuRequest + (*v11.DeleteMenuRequest)(nil), // 4: system.service.v1.DeleteMenuRequest + (*v11.ListMenuResponse)(nil), // 5: system.service.v1.ListMenuResponse + (*v11.Menu)(nil), // 6: system.service.v1.Menu + (*emptypb.Empty)(nil), // 7: google.protobuf.Empty +} +var file_admin_service_v1_i_menu_proto_depIdxs = []int32{ + 0, // 0: admin.service.v1.MenuService.ListMenu:input_type -> pagination.PagingRequest + 1, // 1: admin.service.v1.MenuService.GetMenu:input_type -> system.service.v1.GetMenuRequest + 2, // 2: admin.service.v1.MenuService.CreateMenu:input_type -> system.service.v1.CreateMenuRequest + 3, // 3: admin.service.v1.MenuService.UpdateMenu:input_type -> system.service.v1.UpdateMenuRequest + 4, // 4: admin.service.v1.MenuService.DeleteMenu:input_type -> system.service.v1.DeleteMenuRequest + 5, // 5: admin.service.v1.MenuService.ListMenu:output_type -> system.service.v1.ListMenuResponse + 6, // 6: admin.service.v1.MenuService.GetMenu:output_type -> system.service.v1.Menu + 7, // 7: admin.service.v1.MenuService.CreateMenu:output_type -> google.protobuf.Empty + 7, // 8: admin.service.v1.MenuService.UpdateMenu:output_type -> google.protobuf.Empty + 7, // 9: admin.service.v1.MenuService.DeleteMenu:output_type -> google.protobuf.Empty + 5, // [5:10] is the sub-list for method output_type + 0, // [0:5] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_admin_service_v1_i_menu_proto_init() } +func file_admin_service_v1_i_menu_proto_init() { + if File_admin_service_v1_i_menu_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_admin_service_v1_i_menu_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_admin_service_v1_i_menu_proto_goTypes, + DependencyIndexes: file_admin_service_v1_i_menu_proto_depIdxs, + }.Build() + File_admin_service_v1_i_menu_proto = out.File + file_admin_service_v1_i_menu_proto_rawDesc = nil + file_admin_service_v1_i_menu_proto_goTypes = nil + file_admin_service_v1_i_menu_proto_depIdxs = nil +} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_menu.pb.validate.go b/monolithic/backend/gen/api/go/admin/service/v1/i_menu.pb.validate.go new file mode 100644 index 0000000..036e282 --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_menu.pb.validate.go @@ -0,0 +1,36 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: admin/service/v1/i_menu.proto + +package servicev1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_menu_grpc.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/i_menu_grpc.pb.go new file mode 100644 index 0000000..09d0fea --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_menu_grpc.pb.go @@ -0,0 +1,270 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: admin/service/v1/i_menu.proto + +package servicev1 + +import ( + context "context" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" + v11 "kratos-monolithic-demo/gen/api/go/system/service/v1" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + MenuService_ListMenu_FullMethodName = "/admin.service.v1.MenuService/ListMenu" + MenuService_GetMenu_FullMethodName = "/admin.service.v1.MenuService/GetMenu" + MenuService_CreateMenu_FullMethodName = "/admin.service.v1.MenuService/CreateMenu" + MenuService_UpdateMenu_FullMethodName = "/admin.service.v1.MenuService/UpdateMenu" + MenuService_DeleteMenu_FullMethodName = "/admin.service.v1.MenuService/DeleteMenu" +) + +// MenuServiceClient is the client API for MenuService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MenuServiceClient interface { + // 查询菜单列表 + ListMenu(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*v11.ListMenuResponse, error) + // 查询菜单详情 + GetMenu(ctx context.Context, in *v11.GetMenuRequest, opts ...grpc.CallOption) (*v11.Menu, error) + // 创建菜单 + CreateMenu(ctx context.Context, in *v11.CreateMenuRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 更新菜单 + UpdateMenu(ctx context.Context, in *v11.UpdateMenuRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 删除菜单 + DeleteMenu(ctx context.Context, in *v11.DeleteMenuRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type menuServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewMenuServiceClient(cc grpc.ClientConnInterface) MenuServiceClient { + return &menuServiceClient{cc} +} + +func (c *menuServiceClient) ListMenu(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*v11.ListMenuResponse, error) { + out := new(v11.ListMenuResponse) + err := c.cc.Invoke(ctx, MenuService_ListMenu_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *menuServiceClient) GetMenu(ctx context.Context, in *v11.GetMenuRequest, opts ...grpc.CallOption) (*v11.Menu, error) { + out := new(v11.Menu) + err := c.cc.Invoke(ctx, MenuService_GetMenu_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *menuServiceClient) CreateMenu(ctx context.Context, in *v11.CreateMenuRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, MenuService_CreateMenu_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *menuServiceClient) UpdateMenu(ctx context.Context, in *v11.UpdateMenuRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, MenuService_UpdateMenu_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *menuServiceClient) DeleteMenu(ctx context.Context, in *v11.DeleteMenuRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, MenuService_DeleteMenu_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MenuServiceServer is the server API for MenuService service. +// All implementations must embed UnimplementedMenuServiceServer +// for forward compatibility +type MenuServiceServer interface { + // 查询菜单列表 + ListMenu(context.Context, *v1.PagingRequest) (*v11.ListMenuResponse, error) + // 查询菜单详情 + GetMenu(context.Context, *v11.GetMenuRequest) (*v11.Menu, error) + // 创建菜单 + CreateMenu(context.Context, *v11.CreateMenuRequest) (*emptypb.Empty, error) + // 更新菜单 + UpdateMenu(context.Context, *v11.UpdateMenuRequest) (*emptypb.Empty, error) + // 删除菜单 + DeleteMenu(context.Context, *v11.DeleteMenuRequest) (*emptypb.Empty, error) + mustEmbedUnimplementedMenuServiceServer() +} + +// UnimplementedMenuServiceServer must be embedded to have forward compatible implementations. +type UnimplementedMenuServiceServer struct { +} + +func (UnimplementedMenuServiceServer) ListMenu(context.Context, *v1.PagingRequest) (*v11.ListMenuResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListMenu not implemented") +} +func (UnimplementedMenuServiceServer) GetMenu(context.Context, *v11.GetMenuRequest) (*v11.Menu, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMenu not implemented") +} +func (UnimplementedMenuServiceServer) CreateMenu(context.Context, *v11.CreateMenuRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateMenu not implemented") +} +func (UnimplementedMenuServiceServer) UpdateMenu(context.Context, *v11.UpdateMenuRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateMenu not implemented") +} +func (UnimplementedMenuServiceServer) DeleteMenu(context.Context, *v11.DeleteMenuRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteMenu not implemented") +} +func (UnimplementedMenuServiceServer) mustEmbedUnimplementedMenuServiceServer() {} + +// UnsafeMenuServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MenuServiceServer will +// result in compilation errors. +type UnsafeMenuServiceServer interface { + mustEmbedUnimplementedMenuServiceServer() +} + +func RegisterMenuServiceServer(s grpc.ServiceRegistrar, srv MenuServiceServer) { + s.RegisterService(&MenuService_ServiceDesc, srv) +} + +func _MenuService_ListMenu_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v1.PagingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MenuServiceServer).ListMenu(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MenuService_ListMenu_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MenuServiceServer).ListMenu(ctx, req.(*v1.PagingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MenuService_GetMenu_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v11.GetMenuRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MenuServiceServer).GetMenu(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MenuService_GetMenu_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MenuServiceServer).GetMenu(ctx, req.(*v11.GetMenuRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MenuService_CreateMenu_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v11.CreateMenuRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MenuServiceServer).CreateMenu(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MenuService_CreateMenu_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MenuServiceServer).CreateMenu(ctx, req.(*v11.CreateMenuRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MenuService_UpdateMenu_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v11.UpdateMenuRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MenuServiceServer).UpdateMenu(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MenuService_UpdateMenu_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MenuServiceServer).UpdateMenu(ctx, req.(*v11.UpdateMenuRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MenuService_DeleteMenu_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v11.DeleteMenuRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MenuServiceServer).DeleteMenu(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MenuService_DeleteMenu_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MenuServiceServer).DeleteMenu(ctx, req.(*v11.DeleteMenuRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// MenuService_ServiceDesc is the grpc.ServiceDesc for MenuService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var MenuService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "admin.service.v1.MenuService", + HandlerType: (*MenuServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListMenu", + Handler: _MenuService_ListMenu_Handler, + }, + { + MethodName: "GetMenu", + Handler: _MenuService_GetMenu_Handler, + }, + { + MethodName: "CreateMenu", + Handler: _MenuService_CreateMenu_Handler, + }, + { + MethodName: "UpdateMenu", + Handler: _MenuService_UpdateMenu_Handler, + }, + { + MethodName: "DeleteMenu", + Handler: _MenuService_DeleteMenu_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "admin/service/v1/i_menu.proto", +} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_menu_http.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/i_menu_http.pb.go new file mode 100644 index 0000000..ccba06a --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_menu_http.pb.go @@ -0,0 +1,242 @@ +// Code generated by protoc-gen-go-http. DO NOT EDIT. +// versions: +// - protoc-gen-go-http v2.7.1 +// - protoc (unknown) +// source: admin/service/v1/i_menu.proto + +package servicev1 + +import ( + context "context" + http "github.com/go-kratos/kratos/v2/transport/http" + binding "github.com/go-kratos/kratos/v2/transport/http/binding" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + emptypb "google.golang.org/protobuf/types/known/emptypb" + v11 "kratos-monolithic-demo/gen/api/go/system/service/v1" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the kratos package it is being compiled against. +var _ = new(context.Context) +var _ = binding.EncodeURL + +const _ = http.SupportPackageIsVersion1 + +const OperationMenuServiceCreateMenu = "/admin.service.v1.MenuService/CreateMenu" +const OperationMenuServiceDeleteMenu = "/admin.service.v1.MenuService/DeleteMenu" +const OperationMenuServiceGetMenu = "/admin.service.v1.MenuService/GetMenu" +const OperationMenuServiceListMenu = "/admin.service.v1.MenuService/ListMenu" +const OperationMenuServiceUpdateMenu = "/admin.service.v1.MenuService/UpdateMenu" + +type MenuServiceHTTPServer interface { + // CreateMenu 创建菜单 + CreateMenu(context.Context, *v11.CreateMenuRequest) (*emptypb.Empty, error) + // DeleteMenu 删除菜单 + DeleteMenu(context.Context, *v11.DeleteMenuRequest) (*emptypb.Empty, error) + // GetMenu 查询菜单详情 + GetMenu(context.Context, *v11.GetMenuRequest) (*v11.Menu, error) + // ListMenu 查询菜单列表 + ListMenu(context.Context, *v1.PagingRequest) (*v11.ListMenuResponse, error) + // UpdateMenu 更新菜单 + UpdateMenu(context.Context, *v11.UpdateMenuRequest) (*emptypb.Empty, error) +} + +func RegisterMenuServiceHTTPServer(s *http.Server, srv MenuServiceHTTPServer) { + r := s.Route("/") + r.GET("/admin/v1/menus", _MenuService_ListMenu0_HTTP_Handler(srv)) + r.GET("/admin/v1/menus/{id}", _MenuService_GetMenu0_HTTP_Handler(srv)) + r.POST("/admin/v1/menus", _MenuService_CreateMenu0_HTTP_Handler(srv)) + r.PUT("/admin/v1/menus/{menu.id}", _MenuService_UpdateMenu0_HTTP_Handler(srv)) + r.DELETE("/admin/v1/menus/{id}", _MenuService_DeleteMenu0_HTTP_Handler(srv)) +} + +func _MenuService_ListMenu0_HTTP_Handler(srv MenuServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v1.PagingRequest + if err := ctx.BindQuery(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationMenuServiceListMenu) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.ListMenu(ctx, req.(*v1.PagingRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*v11.ListMenuResponse) + return ctx.Result(200, reply) + } +} + +func _MenuService_GetMenu0_HTTP_Handler(srv MenuServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v11.GetMenuRequest + if err := ctx.BindQuery(&in); err != nil { + return err + } + if err := ctx.BindVars(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationMenuServiceGetMenu) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.GetMenu(ctx, req.(*v11.GetMenuRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*v11.Menu) + return ctx.Result(200, reply) + } +} + +func _MenuService_CreateMenu0_HTTP_Handler(srv MenuServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v11.CreateMenuRequest + if err := ctx.Bind(&in); err != nil { + return err + } + if err := ctx.BindQuery(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationMenuServiceCreateMenu) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.CreateMenu(ctx, req.(*v11.CreateMenuRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*emptypb.Empty) + return ctx.Result(200, reply) + } +} + +func _MenuService_UpdateMenu0_HTTP_Handler(srv MenuServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v11.UpdateMenuRequest + if err := ctx.Bind(&in.Menu); err != nil { + return err + } + if err := ctx.BindQuery(&in); err != nil { + return err + } + if err := ctx.BindVars(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationMenuServiceUpdateMenu) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.UpdateMenu(ctx, req.(*v11.UpdateMenuRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*emptypb.Empty) + return ctx.Result(200, reply) + } +} + +func _MenuService_DeleteMenu0_HTTP_Handler(srv MenuServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v11.DeleteMenuRequest + if err := ctx.BindQuery(&in); err != nil { + return err + } + if err := ctx.BindVars(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationMenuServiceDeleteMenu) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.DeleteMenu(ctx, req.(*v11.DeleteMenuRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*emptypb.Empty) + return ctx.Result(200, reply) + } +} + +type MenuServiceHTTPClient interface { + CreateMenu(ctx context.Context, req *v11.CreateMenuRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error) + DeleteMenu(ctx context.Context, req *v11.DeleteMenuRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error) + GetMenu(ctx context.Context, req *v11.GetMenuRequest, opts ...http.CallOption) (rsp *v11.Menu, err error) + ListMenu(ctx context.Context, req *v1.PagingRequest, opts ...http.CallOption) (rsp *v11.ListMenuResponse, err error) + UpdateMenu(ctx context.Context, req *v11.UpdateMenuRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error) +} + +type MenuServiceHTTPClientImpl struct { + cc *http.Client +} + +func NewMenuServiceHTTPClient(client *http.Client) MenuServiceHTTPClient { + return &MenuServiceHTTPClientImpl{client} +} + +func (c *MenuServiceHTTPClientImpl) CreateMenu(ctx context.Context, in *v11.CreateMenuRequest, opts ...http.CallOption) (*emptypb.Empty, error) { + var out emptypb.Empty + pattern := "/admin/v1/menus" + path := binding.EncodeURL(pattern, in, false) + opts = append(opts, http.Operation(OperationMenuServiceCreateMenu)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *MenuServiceHTTPClientImpl) DeleteMenu(ctx context.Context, in *v11.DeleteMenuRequest, opts ...http.CallOption) (*emptypb.Empty, error) { + var out emptypb.Empty + pattern := "/admin/v1/menus/{id}" + path := binding.EncodeURL(pattern, in, true) + opts = append(opts, http.Operation(OperationMenuServiceDeleteMenu)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "DELETE", path, nil, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *MenuServiceHTTPClientImpl) GetMenu(ctx context.Context, in *v11.GetMenuRequest, opts ...http.CallOption) (*v11.Menu, error) { + var out v11.Menu + pattern := "/admin/v1/menus/{id}" + path := binding.EncodeURL(pattern, in, true) + opts = append(opts, http.Operation(OperationMenuServiceGetMenu)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *MenuServiceHTTPClientImpl) ListMenu(ctx context.Context, in *v1.PagingRequest, opts ...http.CallOption) (*v11.ListMenuResponse, error) { + var out v11.ListMenuResponse + pattern := "/admin/v1/menus" + path := binding.EncodeURL(pattern, in, true) + opts = append(opts, http.Operation(OperationMenuServiceListMenu)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *MenuServiceHTTPClientImpl) UpdateMenu(ctx context.Context, in *v11.UpdateMenuRequest, opts ...http.CallOption) (*emptypb.Empty, error) { + var out emptypb.Empty + pattern := "/admin/v1/menus/{menu.id}" + path := binding.EncodeURL(pattern, in, false) + opts = append(opts, http.Operation(OperationMenuServiceUpdateMenu)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "PUT", path, in.Menu, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_organization.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/i_organization.pb.go new file mode 100644 index 0000000..23b000d --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_organization.pb.go @@ -0,0 +1,159 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: admin/service/v1/i_organization.proto + +package servicev1 + +import ( + _ "github.com/google/gnostic/openapiv3" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + v11 "kratos-monolithic-demo/gen/api/go/user/service/v1" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_admin_service_v1_i_organization_proto protoreflect.FileDescriptor + +var file_admin_service_v1_i_organization_proto_rawDesc = []byte{ + 0x0a, 0x25, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, + 0x76, 0x31, 0x2f, 0x69, 0x5f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x24, 0x67, 0x6e, 0x6f, 0x73, 0x74, + 0x69, 0x63, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, + 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x22, 0x75, 0x73, 0x65, 0x72, + 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x67, 0x61, + 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x8b, + 0x06, 0x0a, 0x13, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x8f, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x4f, + 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x2e, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x72, 0x67, + 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x35, 0xba, 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, 0x41, 0x75, 0x74, + 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, + 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x67, 0x73, 0x12, 0x95, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, + 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, + 0x65, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3a, 0xba, 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, + 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, + 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13, 0x2f, 0x61, 0x64, + 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x67, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, + 0x12, 0x92, 0x01, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, + 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x38, 0xba, 0x47, 0x1c, + 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, + 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x13, 0x3a, 0x01, 0x2a, 0x22, 0x0e, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, + 0x2f, 0x6f, 0x72, 0x67, 0x73, 0x12, 0x9d, 0x01, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x22, 0x43, 0xba, 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, 0x41, 0x75, 0x74, 0x68, + 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, + 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x03, 0x6f, 0x72, 0x67, 0x1a, 0x17, 0x2f, 0x61, + 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x67, 0x73, 0x2f, 0x7b, 0x6f, 0x72, + 0x67, 0x2e, 0x69, 0x64, 0x7d, 0x12, 0x94, 0x01, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x22, 0x3a, 0xba, 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, 0x41, 0x75, 0x74, 0x68, + 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, + 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x2a, 0x13, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, + 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x67, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x42, 0xca, 0x01, 0x0a, + 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x12, 0x49, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x6b, 0x72, 0x61, + 0x74, 0x6f, 0x73, 0x2d, 0x6d, 0x6f, 0x6e, 0x6f, 0x6c, 0x69, 0x74, 0x68, 0x69, 0x63, 0x2d, 0x64, + 0x65, 0x6d, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x61, + 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x3b, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x53, 0x58, 0xaa, + 0x02, 0x10, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x56, 0x31, 0xca, 0x02, 0x10, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x5c, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x3a, 0x3a, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var file_admin_service_v1_i_organization_proto_goTypes = []interface{}{ + (*v1.PagingRequest)(nil), // 0: pagination.PagingRequest + (*v11.GetOrganizationRequest)(nil), // 1: user.service.v1.GetOrganizationRequest + (*v11.CreateOrganizationRequest)(nil), // 2: user.service.v1.CreateOrganizationRequest + (*v11.UpdateOrganizationRequest)(nil), // 3: user.service.v1.UpdateOrganizationRequest + (*v11.DeleteOrganizationRequest)(nil), // 4: user.service.v1.DeleteOrganizationRequest + (*v11.ListOrganizationResponse)(nil), // 5: user.service.v1.ListOrganizationResponse + (*v11.Organization)(nil), // 6: user.service.v1.Organization + (*emptypb.Empty)(nil), // 7: google.protobuf.Empty +} +var file_admin_service_v1_i_organization_proto_depIdxs = []int32{ + 0, // 0: admin.service.v1.OrganizationService.ListOrganization:input_type -> pagination.PagingRequest + 1, // 1: admin.service.v1.OrganizationService.GetOrganization:input_type -> user.service.v1.GetOrganizationRequest + 2, // 2: admin.service.v1.OrganizationService.CreateOrganization:input_type -> user.service.v1.CreateOrganizationRequest + 3, // 3: admin.service.v1.OrganizationService.UpdateOrganization:input_type -> user.service.v1.UpdateOrganizationRequest + 4, // 4: admin.service.v1.OrganizationService.DeleteOrganization:input_type -> user.service.v1.DeleteOrganizationRequest + 5, // 5: admin.service.v1.OrganizationService.ListOrganization:output_type -> user.service.v1.ListOrganizationResponse + 6, // 6: admin.service.v1.OrganizationService.GetOrganization:output_type -> user.service.v1.Organization + 7, // 7: admin.service.v1.OrganizationService.CreateOrganization:output_type -> google.protobuf.Empty + 7, // 8: admin.service.v1.OrganizationService.UpdateOrganization:output_type -> google.protobuf.Empty + 7, // 9: admin.service.v1.OrganizationService.DeleteOrganization:output_type -> google.protobuf.Empty + 5, // [5:10] is the sub-list for method output_type + 0, // [0:5] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_admin_service_v1_i_organization_proto_init() } +func file_admin_service_v1_i_organization_proto_init() { + if File_admin_service_v1_i_organization_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_admin_service_v1_i_organization_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_admin_service_v1_i_organization_proto_goTypes, + DependencyIndexes: file_admin_service_v1_i_organization_proto_depIdxs, + }.Build() + File_admin_service_v1_i_organization_proto = out.File + file_admin_service_v1_i_organization_proto_rawDesc = nil + file_admin_service_v1_i_organization_proto_goTypes = nil + file_admin_service_v1_i_organization_proto_depIdxs = nil +} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_organization.pb.validate.go b/monolithic/backend/gen/api/go/admin/service/v1/i_organization.pb.validate.go new file mode 100644 index 0000000..aa946cc --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_organization.pb.validate.go @@ -0,0 +1,36 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: admin/service/v1/i_organization.proto + +package servicev1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_organization_grpc.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/i_organization_grpc.pb.go new file mode 100644 index 0000000..18b4ef4 --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_organization_grpc.pb.go @@ -0,0 +1,270 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: admin/service/v1/i_organization.proto + +package servicev1 + +import ( + context "context" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" + v11 "kratos-monolithic-demo/gen/api/go/user/service/v1" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + OrganizationService_ListOrganization_FullMethodName = "/admin.service.v1.OrganizationService/ListOrganization" + OrganizationService_GetOrganization_FullMethodName = "/admin.service.v1.OrganizationService/GetOrganization" + OrganizationService_CreateOrganization_FullMethodName = "/admin.service.v1.OrganizationService/CreateOrganization" + OrganizationService_UpdateOrganization_FullMethodName = "/admin.service.v1.OrganizationService/UpdateOrganization" + OrganizationService_DeleteOrganization_FullMethodName = "/admin.service.v1.OrganizationService/DeleteOrganization" +) + +// OrganizationServiceClient is the client API for OrganizationService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type OrganizationServiceClient interface { + // 查询部门列表 + ListOrganization(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*v11.ListOrganizationResponse, error) + // 查询部门详情 + GetOrganization(ctx context.Context, in *v11.GetOrganizationRequest, opts ...grpc.CallOption) (*v11.Organization, error) + // 创建部门 + CreateOrganization(ctx context.Context, in *v11.CreateOrganizationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 更新部门 + UpdateOrganization(ctx context.Context, in *v11.UpdateOrganizationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 删除部门 + DeleteOrganization(ctx context.Context, in *v11.DeleteOrganizationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type organizationServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewOrganizationServiceClient(cc grpc.ClientConnInterface) OrganizationServiceClient { + return &organizationServiceClient{cc} +} + +func (c *organizationServiceClient) ListOrganization(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*v11.ListOrganizationResponse, error) { + out := new(v11.ListOrganizationResponse) + err := c.cc.Invoke(ctx, OrganizationService_ListOrganization_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *organizationServiceClient) GetOrganization(ctx context.Context, in *v11.GetOrganizationRequest, opts ...grpc.CallOption) (*v11.Organization, error) { + out := new(v11.Organization) + err := c.cc.Invoke(ctx, OrganizationService_GetOrganization_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *organizationServiceClient) CreateOrganization(ctx context.Context, in *v11.CreateOrganizationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, OrganizationService_CreateOrganization_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *organizationServiceClient) UpdateOrganization(ctx context.Context, in *v11.UpdateOrganizationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, OrganizationService_UpdateOrganization_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *organizationServiceClient) DeleteOrganization(ctx context.Context, in *v11.DeleteOrganizationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, OrganizationService_DeleteOrganization_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// OrganizationServiceServer is the server API for OrganizationService service. +// All implementations must embed UnimplementedOrganizationServiceServer +// for forward compatibility +type OrganizationServiceServer interface { + // 查询部门列表 + ListOrganization(context.Context, *v1.PagingRequest) (*v11.ListOrganizationResponse, error) + // 查询部门详情 + GetOrganization(context.Context, *v11.GetOrganizationRequest) (*v11.Organization, error) + // 创建部门 + CreateOrganization(context.Context, *v11.CreateOrganizationRequest) (*emptypb.Empty, error) + // 更新部门 + UpdateOrganization(context.Context, *v11.UpdateOrganizationRequest) (*emptypb.Empty, error) + // 删除部门 + DeleteOrganization(context.Context, *v11.DeleteOrganizationRequest) (*emptypb.Empty, error) + mustEmbedUnimplementedOrganizationServiceServer() +} + +// UnimplementedOrganizationServiceServer must be embedded to have forward compatible implementations. +type UnimplementedOrganizationServiceServer struct { +} + +func (UnimplementedOrganizationServiceServer) ListOrganization(context.Context, *v1.PagingRequest) (*v11.ListOrganizationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListOrganization not implemented") +} +func (UnimplementedOrganizationServiceServer) GetOrganization(context.Context, *v11.GetOrganizationRequest) (*v11.Organization, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetOrganization not implemented") +} +func (UnimplementedOrganizationServiceServer) CreateOrganization(context.Context, *v11.CreateOrganizationRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateOrganization not implemented") +} +func (UnimplementedOrganizationServiceServer) UpdateOrganization(context.Context, *v11.UpdateOrganizationRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateOrganization not implemented") +} +func (UnimplementedOrganizationServiceServer) DeleteOrganization(context.Context, *v11.DeleteOrganizationRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteOrganization not implemented") +} +func (UnimplementedOrganizationServiceServer) mustEmbedUnimplementedOrganizationServiceServer() {} + +// UnsafeOrganizationServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to OrganizationServiceServer will +// result in compilation errors. +type UnsafeOrganizationServiceServer interface { + mustEmbedUnimplementedOrganizationServiceServer() +} + +func RegisterOrganizationServiceServer(s grpc.ServiceRegistrar, srv OrganizationServiceServer) { + s.RegisterService(&OrganizationService_ServiceDesc, srv) +} + +func _OrganizationService_ListOrganization_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v1.PagingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServiceServer).ListOrganization(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: OrganizationService_ListOrganization_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServiceServer).ListOrganization(ctx, req.(*v1.PagingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _OrganizationService_GetOrganization_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v11.GetOrganizationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServiceServer).GetOrganization(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: OrganizationService_GetOrganization_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServiceServer).GetOrganization(ctx, req.(*v11.GetOrganizationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _OrganizationService_CreateOrganization_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v11.CreateOrganizationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServiceServer).CreateOrganization(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: OrganizationService_CreateOrganization_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServiceServer).CreateOrganization(ctx, req.(*v11.CreateOrganizationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _OrganizationService_UpdateOrganization_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v11.UpdateOrganizationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServiceServer).UpdateOrganization(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: OrganizationService_UpdateOrganization_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServiceServer).UpdateOrganization(ctx, req.(*v11.UpdateOrganizationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _OrganizationService_DeleteOrganization_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v11.DeleteOrganizationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServiceServer).DeleteOrganization(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: OrganizationService_DeleteOrganization_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServiceServer).DeleteOrganization(ctx, req.(*v11.DeleteOrganizationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// OrganizationService_ServiceDesc is the grpc.ServiceDesc for OrganizationService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var OrganizationService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "admin.service.v1.OrganizationService", + HandlerType: (*OrganizationServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListOrganization", + Handler: _OrganizationService_ListOrganization_Handler, + }, + { + MethodName: "GetOrganization", + Handler: _OrganizationService_GetOrganization_Handler, + }, + { + MethodName: "CreateOrganization", + Handler: _OrganizationService_CreateOrganization_Handler, + }, + { + MethodName: "UpdateOrganization", + Handler: _OrganizationService_UpdateOrganization_Handler, + }, + { + MethodName: "DeleteOrganization", + Handler: _OrganizationService_DeleteOrganization_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "admin/service/v1/i_organization.proto", +} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_organization_http.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/i_organization_http.pb.go new file mode 100644 index 0000000..ab1bee8 --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_organization_http.pb.go @@ -0,0 +1,242 @@ +// Code generated by protoc-gen-go-http. DO NOT EDIT. +// versions: +// - protoc-gen-go-http v2.7.1 +// - protoc (unknown) +// source: admin/service/v1/i_organization.proto + +package servicev1 + +import ( + context "context" + http "github.com/go-kratos/kratos/v2/transport/http" + binding "github.com/go-kratos/kratos/v2/transport/http/binding" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + emptypb "google.golang.org/protobuf/types/known/emptypb" + v11 "kratos-monolithic-demo/gen/api/go/user/service/v1" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the kratos package it is being compiled against. +var _ = new(context.Context) +var _ = binding.EncodeURL + +const _ = http.SupportPackageIsVersion1 + +const OperationOrganizationServiceCreateOrganization = "/admin.service.v1.OrganizationService/CreateOrganization" +const OperationOrganizationServiceDeleteOrganization = "/admin.service.v1.OrganizationService/DeleteOrganization" +const OperationOrganizationServiceGetOrganization = "/admin.service.v1.OrganizationService/GetOrganization" +const OperationOrganizationServiceListOrganization = "/admin.service.v1.OrganizationService/ListOrganization" +const OperationOrganizationServiceUpdateOrganization = "/admin.service.v1.OrganizationService/UpdateOrganization" + +type OrganizationServiceHTTPServer interface { + // CreateOrganization 创建部门 + CreateOrganization(context.Context, *v11.CreateOrganizationRequest) (*emptypb.Empty, error) + // DeleteOrganization 删除部门 + DeleteOrganization(context.Context, *v11.DeleteOrganizationRequest) (*emptypb.Empty, error) + // GetOrganization 查询部门详情 + GetOrganization(context.Context, *v11.GetOrganizationRequest) (*v11.Organization, error) + // ListOrganization 查询部门列表 + ListOrganization(context.Context, *v1.PagingRequest) (*v11.ListOrganizationResponse, error) + // UpdateOrganization 更新部门 + UpdateOrganization(context.Context, *v11.UpdateOrganizationRequest) (*emptypb.Empty, error) +} + +func RegisterOrganizationServiceHTTPServer(s *http.Server, srv OrganizationServiceHTTPServer) { + r := s.Route("/") + r.GET("/admin/v1/orgs", _OrganizationService_ListOrganization0_HTTP_Handler(srv)) + r.GET("/admin/v1/orgs/{id}", _OrganizationService_GetOrganization0_HTTP_Handler(srv)) + r.POST("/admin/v1/orgs", _OrganizationService_CreateOrganization0_HTTP_Handler(srv)) + r.PUT("/admin/v1/orgs/{org.id}", _OrganizationService_UpdateOrganization0_HTTP_Handler(srv)) + r.DELETE("/admin/v1/orgs/{id}", _OrganizationService_DeleteOrganization0_HTTP_Handler(srv)) +} + +func _OrganizationService_ListOrganization0_HTTP_Handler(srv OrganizationServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v1.PagingRequest + if err := ctx.BindQuery(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationOrganizationServiceListOrganization) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.ListOrganization(ctx, req.(*v1.PagingRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*v11.ListOrganizationResponse) + return ctx.Result(200, reply) + } +} + +func _OrganizationService_GetOrganization0_HTTP_Handler(srv OrganizationServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v11.GetOrganizationRequest + if err := ctx.BindQuery(&in); err != nil { + return err + } + if err := ctx.BindVars(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationOrganizationServiceGetOrganization) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.GetOrganization(ctx, req.(*v11.GetOrganizationRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*v11.Organization) + return ctx.Result(200, reply) + } +} + +func _OrganizationService_CreateOrganization0_HTTP_Handler(srv OrganizationServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v11.CreateOrganizationRequest + if err := ctx.Bind(&in); err != nil { + return err + } + if err := ctx.BindQuery(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationOrganizationServiceCreateOrganization) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.CreateOrganization(ctx, req.(*v11.CreateOrganizationRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*emptypb.Empty) + return ctx.Result(200, reply) + } +} + +func _OrganizationService_UpdateOrganization0_HTTP_Handler(srv OrganizationServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v11.UpdateOrganizationRequest + if err := ctx.Bind(&in.Org); err != nil { + return err + } + if err := ctx.BindQuery(&in); err != nil { + return err + } + if err := ctx.BindVars(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationOrganizationServiceUpdateOrganization) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.UpdateOrganization(ctx, req.(*v11.UpdateOrganizationRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*emptypb.Empty) + return ctx.Result(200, reply) + } +} + +func _OrganizationService_DeleteOrganization0_HTTP_Handler(srv OrganizationServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v11.DeleteOrganizationRequest + if err := ctx.BindQuery(&in); err != nil { + return err + } + if err := ctx.BindVars(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationOrganizationServiceDeleteOrganization) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.DeleteOrganization(ctx, req.(*v11.DeleteOrganizationRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*emptypb.Empty) + return ctx.Result(200, reply) + } +} + +type OrganizationServiceHTTPClient interface { + CreateOrganization(ctx context.Context, req *v11.CreateOrganizationRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error) + DeleteOrganization(ctx context.Context, req *v11.DeleteOrganizationRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error) + GetOrganization(ctx context.Context, req *v11.GetOrganizationRequest, opts ...http.CallOption) (rsp *v11.Organization, err error) + ListOrganization(ctx context.Context, req *v1.PagingRequest, opts ...http.CallOption) (rsp *v11.ListOrganizationResponse, err error) + UpdateOrganization(ctx context.Context, req *v11.UpdateOrganizationRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error) +} + +type OrganizationServiceHTTPClientImpl struct { + cc *http.Client +} + +func NewOrganizationServiceHTTPClient(client *http.Client) OrganizationServiceHTTPClient { + return &OrganizationServiceHTTPClientImpl{client} +} + +func (c *OrganizationServiceHTTPClientImpl) CreateOrganization(ctx context.Context, in *v11.CreateOrganizationRequest, opts ...http.CallOption) (*emptypb.Empty, error) { + var out emptypb.Empty + pattern := "/admin/v1/orgs" + path := binding.EncodeURL(pattern, in, false) + opts = append(opts, http.Operation(OperationOrganizationServiceCreateOrganization)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *OrganizationServiceHTTPClientImpl) DeleteOrganization(ctx context.Context, in *v11.DeleteOrganizationRequest, opts ...http.CallOption) (*emptypb.Empty, error) { + var out emptypb.Empty + pattern := "/admin/v1/orgs/{id}" + path := binding.EncodeURL(pattern, in, true) + opts = append(opts, http.Operation(OperationOrganizationServiceDeleteOrganization)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "DELETE", path, nil, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *OrganizationServiceHTTPClientImpl) GetOrganization(ctx context.Context, in *v11.GetOrganizationRequest, opts ...http.CallOption) (*v11.Organization, error) { + var out v11.Organization + pattern := "/admin/v1/orgs/{id}" + path := binding.EncodeURL(pattern, in, true) + opts = append(opts, http.Operation(OperationOrganizationServiceGetOrganization)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *OrganizationServiceHTTPClientImpl) ListOrganization(ctx context.Context, in *v1.PagingRequest, opts ...http.CallOption) (*v11.ListOrganizationResponse, error) { + var out v11.ListOrganizationResponse + pattern := "/admin/v1/orgs" + path := binding.EncodeURL(pattern, in, true) + opts = append(opts, http.Operation(OperationOrganizationServiceListOrganization)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *OrganizationServiceHTTPClientImpl) UpdateOrganization(ctx context.Context, in *v11.UpdateOrganizationRequest, opts ...http.CallOption) (*emptypb.Empty, error) { + var out emptypb.Empty + pattern := "/admin/v1/orgs/{org.id}" + path := binding.EncodeURL(pattern, in, false) + opts = append(opts, http.Operation(OperationOrganizationServiceUpdateOrganization)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "PUT", path, in.Org, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_position.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/i_position.pb.go new file mode 100644 index 0000000..d8df139 --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_position.pb.go @@ -0,0 +1,157 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: admin/service/v1/i_position.proto + +package servicev1 + +import ( + _ "github.com/google/gnostic/openapiv3" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + v11 "kratos-monolithic-demo/gen/api/go/user/service/v1" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_admin_service_v1_i_position_proto protoreflect.FileDescriptor + +var file_admin_service_v1_i_position_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, + 0x76, 0x31, 0x2f, 0x69, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x24, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2f, 0x6f, + 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xfe, 0x05, 0x0a, 0x0f, 0x50, 0x6f, 0x73, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x8c, 0x01, 0x0a, 0x0c, 0x4c, + 0x69, 0x73, 0x74, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x2e, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x73, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0xba, + 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x8e, 0x01, 0x0a, 0x0b, 0x47, 0x65, + 0x74, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, + 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3f, 0xba, 0x47, 0x1c, 0x5a, 0x1a, + 0x0a, 0x18, 0x0a, 0x14, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, + 0x12, 0x18, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x8f, 0x01, 0x0a, 0x0e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x3d, 0xba, + 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x18, 0x3a, 0x01, 0x2a, 0x22, 0x13, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, + 0x76, 0x31, 0x2f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0xa4, 0x01, 0x0a, + 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x26, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, + 0x52, 0xba, 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, + 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x3a, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x1a, 0x21, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x69, 0x64, 0x7d, 0x12, 0x91, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x3f, 0xba, 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, + 0x14, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, + 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x2a, 0x18, 0x2f, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x42, 0xc6, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, + 0x42, 0x0e, 0x49, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x3c, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x6d, 0x6f, 0x6e, 0x6f, 0x6c, + 0x69, 0x74, 0x68, 0x69, 0x63, 0x2d, 0x64, 0x65, 0x6d, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x76, 0x31, + 0xa2, 0x02, 0x03, 0x41, 0x53, 0x58, 0xaa, 0x02, 0x10, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, 0x41, 0x64, 0x6d, 0x69, + 0x6e, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x41, + 0x64, 0x6d, 0x69, 0x6e, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x41, 0x64, + 0x6d, 0x69, 0x6e, 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_admin_service_v1_i_position_proto_goTypes = []interface{}{ + (*v1.PagingRequest)(nil), // 0: pagination.PagingRequest + (*v11.GetPositionRequest)(nil), // 1: user.service.v1.GetPositionRequest + (*v11.CreatePositionRequest)(nil), // 2: user.service.v1.CreatePositionRequest + (*v11.UpdatePositionRequest)(nil), // 3: user.service.v1.UpdatePositionRequest + (*v11.DeletePositionRequest)(nil), // 4: user.service.v1.DeletePositionRequest + (*v11.ListPositionResponse)(nil), // 5: user.service.v1.ListPositionResponse + (*v11.Position)(nil), // 6: user.service.v1.Position + (*emptypb.Empty)(nil), // 7: google.protobuf.Empty +} +var file_admin_service_v1_i_position_proto_depIdxs = []int32{ + 0, // 0: admin.service.v1.PositionService.ListPosition:input_type -> pagination.PagingRequest + 1, // 1: admin.service.v1.PositionService.GetPosition:input_type -> user.service.v1.GetPositionRequest + 2, // 2: admin.service.v1.PositionService.CreatePosition:input_type -> user.service.v1.CreatePositionRequest + 3, // 3: admin.service.v1.PositionService.UpdatePosition:input_type -> user.service.v1.UpdatePositionRequest + 4, // 4: admin.service.v1.PositionService.DeletePosition:input_type -> user.service.v1.DeletePositionRequest + 5, // 5: admin.service.v1.PositionService.ListPosition:output_type -> user.service.v1.ListPositionResponse + 6, // 6: admin.service.v1.PositionService.GetPosition:output_type -> user.service.v1.Position + 7, // 7: admin.service.v1.PositionService.CreatePosition:output_type -> google.protobuf.Empty + 7, // 8: admin.service.v1.PositionService.UpdatePosition:output_type -> google.protobuf.Empty + 7, // 9: admin.service.v1.PositionService.DeletePosition:output_type -> google.protobuf.Empty + 5, // [5:10] is the sub-list for method output_type + 0, // [0:5] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_admin_service_v1_i_position_proto_init() } +func file_admin_service_v1_i_position_proto_init() { + if File_admin_service_v1_i_position_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_admin_service_v1_i_position_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_admin_service_v1_i_position_proto_goTypes, + DependencyIndexes: file_admin_service_v1_i_position_proto_depIdxs, + }.Build() + File_admin_service_v1_i_position_proto = out.File + file_admin_service_v1_i_position_proto_rawDesc = nil + file_admin_service_v1_i_position_proto_goTypes = nil + file_admin_service_v1_i_position_proto_depIdxs = nil +} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_position.pb.validate.go b/monolithic/backend/gen/api/go/admin/service/v1/i_position.pb.validate.go new file mode 100644 index 0000000..ee54b8b --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_position.pb.validate.go @@ -0,0 +1,36 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: admin/service/v1/i_position.proto + +package servicev1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_position_grpc.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/i_position_grpc.pb.go new file mode 100644 index 0000000..fc9e24c --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_position_grpc.pb.go @@ -0,0 +1,270 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: admin/service/v1/i_position.proto + +package servicev1 + +import ( + context "context" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" + v11 "kratos-monolithic-demo/gen/api/go/user/service/v1" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + PositionService_ListPosition_FullMethodName = "/admin.service.v1.PositionService/ListPosition" + PositionService_GetPosition_FullMethodName = "/admin.service.v1.PositionService/GetPosition" + PositionService_CreatePosition_FullMethodName = "/admin.service.v1.PositionService/CreatePosition" + PositionService_UpdatePosition_FullMethodName = "/admin.service.v1.PositionService/UpdatePosition" + PositionService_DeletePosition_FullMethodName = "/admin.service.v1.PositionService/DeletePosition" +) + +// PositionServiceClient is the client API for PositionService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type PositionServiceClient interface { + // 查询职位列表 + ListPosition(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*v11.ListPositionResponse, error) + // 查询职位详情 + GetPosition(ctx context.Context, in *v11.GetPositionRequest, opts ...grpc.CallOption) (*v11.Position, error) + // 创建职位 + CreatePosition(ctx context.Context, in *v11.CreatePositionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 更新职位 + UpdatePosition(ctx context.Context, in *v11.UpdatePositionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 删除职位 + DeletePosition(ctx context.Context, in *v11.DeletePositionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type positionServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewPositionServiceClient(cc grpc.ClientConnInterface) PositionServiceClient { + return &positionServiceClient{cc} +} + +func (c *positionServiceClient) ListPosition(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*v11.ListPositionResponse, error) { + out := new(v11.ListPositionResponse) + err := c.cc.Invoke(ctx, PositionService_ListPosition_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *positionServiceClient) GetPosition(ctx context.Context, in *v11.GetPositionRequest, opts ...grpc.CallOption) (*v11.Position, error) { + out := new(v11.Position) + err := c.cc.Invoke(ctx, PositionService_GetPosition_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *positionServiceClient) CreatePosition(ctx context.Context, in *v11.CreatePositionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, PositionService_CreatePosition_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *positionServiceClient) UpdatePosition(ctx context.Context, in *v11.UpdatePositionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, PositionService_UpdatePosition_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *positionServiceClient) DeletePosition(ctx context.Context, in *v11.DeletePositionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, PositionService_DeletePosition_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// PositionServiceServer is the server API for PositionService service. +// All implementations must embed UnimplementedPositionServiceServer +// for forward compatibility +type PositionServiceServer interface { + // 查询职位列表 + ListPosition(context.Context, *v1.PagingRequest) (*v11.ListPositionResponse, error) + // 查询职位详情 + GetPosition(context.Context, *v11.GetPositionRequest) (*v11.Position, error) + // 创建职位 + CreatePosition(context.Context, *v11.CreatePositionRequest) (*emptypb.Empty, error) + // 更新职位 + UpdatePosition(context.Context, *v11.UpdatePositionRequest) (*emptypb.Empty, error) + // 删除职位 + DeletePosition(context.Context, *v11.DeletePositionRequest) (*emptypb.Empty, error) + mustEmbedUnimplementedPositionServiceServer() +} + +// UnimplementedPositionServiceServer must be embedded to have forward compatible implementations. +type UnimplementedPositionServiceServer struct { +} + +func (UnimplementedPositionServiceServer) ListPosition(context.Context, *v1.PagingRequest) (*v11.ListPositionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListPosition not implemented") +} +func (UnimplementedPositionServiceServer) GetPosition(context.Context, *v11.GetPositionRequest) (*v11.Position, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPosition not implemented") +} +func (UnimplementedPositionServiceServer) CreatePosition(context.Context, *v11.CreatePositionRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreatePosition not implemented") +} +func (UnimplementedPositionServiceServer) UpdatePosition(context.Context, *v11.UpdatePositionRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdatePosition not implemented") +} +func (UnimplementedPositionServiceServer) DeletePosition(context.Context, *v11.DeletePositionRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeletePosition not implemented") +} +func (UnimplementedPositionServiceServer) mustEmbedUnimplementedPositionServiceServer() {} + +// UnsafePositionServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to PositionServiceServer will +// result in compilation errors. +type UnsafePositionServiceServer interface { + mustEmbedUnimplementedPositionServiceServer() +} + +func RegisterPositionServiceServer(s grpc.ServiceRegistrar, srv PositionServiceServer) { + s.RegisterService(&PositionService_ServiceDesc, srv) +} + +func _PositionService_ListPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v1.PagingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PositionServiceServer).ListPosition(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PositionService_ListPosition_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PositionServiceServer).ListPosition(ctx, req.(*v1.PagingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PositionService_GetPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v11.GetPositionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PositionServiceServer).GetPosition(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PositionService_GetPosition_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PositionServiceServer).GetPosition(ctx, req.(*v11.GetPositionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PositionService_CreatePosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v11.CreatePositionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PositionServiceServer).CreatePosition(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PositionService_CreatePosition_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PositionServiceServer).CreatePosition(ctx, req.(*v11.CreatePositionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PositionService_UpdatePosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v11.UpdatePositionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PositionServiceServer).UpdatePosition(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PositionService_UpdatePosition_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PositionServiceServer).UpdatePosition(ctx, req.(*v11.UpdatePositionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PositionService_DeletePosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v11.DeletePositionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PositionServiceServer).DeletePosition(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PositionService_DeletePosition_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PositionServiceServer).DeletePosition(ctx, req.(*v11.DeletePositionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// PositionService_ServiceDesc is the grpc.ServiceDesc for PositionService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var PositionService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "admin.service.v1.PositionService", + HandlerType: (*PositionServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListPosition", + Handler: _PositionService_ListPosition_Handler, + }, + { + MethodName: "GetPosition", + Handler: _PositionService_GetPosition_Handler, + }, + { + MethodName: "CreatePosition", + Handler: _PositionService_CreatePosition_Handler, + }, + { + MethodName: "UpdatePosition", + Handler: _PositionService_UpdatePosition_Handler, + }, + { + MethodName: "DeletePosition", + Handler: _PositionService_DeletePosition_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "admin/service/v1/i_position.proto", +} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_position_http.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/i_position_http.pb.go new file mode 100644 index 0000000..2cf96fb --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_position_http.pb.go @@ -0,0 +1,242 @@ +// Code generated by protoc-gen-go-http. DO NOT EDIT. +// versions: +// - protoc-gen-go-http v2.7.1 +// - protoc (unknown) +// source: admin/service/v1/i_position.proto + +package servicev1 + +import ( + context "context" + http "github.com/go-kratos/kratos/v2/transport/http" + binding "github.com/go-kratos/kratos/v2/transport/http/binding" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + emptypb "google.golang.org/protobuf/types/known/emptypb" + v11 "kratos-monolithic-demo/gen/api/go/user/service/v1" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the kratos package it is being compiled against. +var _ = new(context.Context) +var _ = binding.EncodeURL + +const _ = http.SupportPackageIsVersion1 + +const OperationPositionServiceCreatePosition = "/admin.service.v1.PositionService/CreatePosition" +const OperationPositionServiceDeletePosition = "/admin.service.v1.PositionService/DeletePosition" +const OperationPositionServiceGetPosition = "/admin.service.v1.PositionService/GetPosition" +const OperationPositionServiceListPosition = "/admin.service.v1.PositionService/ListPosition" +const OperationPositionServiceUpdatePosition = "/admin.service.v1.PositionService/UpdatePosition" + +type PositionServiceHTTPServer interface { + // CreatePosition 创建职位 + CreatePosition(context.Context, *v11.CreatePositionRequest) (*emptypb.Empty, error) + // DeletePosition 删除职位 + DeletePosition(context.Context, *v11.DeletePositionRequest) (*emptypb.Empty, error) + // GetPosition 查询职位详情 + GetPosition(context.Context, *v11.GetPositionRequest) (*v11.Position, error) + // ListPosition 查询职位列表 + ListPosition(context.Context, *v1.PagingRequest) (*v11.ListPositionResponse, error) + // UpdatePosition 更新职位 + UpdatePosition(context.Context, *v11.UpdatePositionRequest) (*emptypb.Empty, error) +} + +func RegisterPositionServiceHTTPServer(s *http.Server, srv PositionServiceHTTPServer) { + r := s.Route("/") + r.GET("/admin/v1/positions", _PositionService_ListPosition0_HTTP_Handler(srv)) + r.GET("/admin/v1/positions/{id}", _PositionService_GetPosition0_HTTP_Handler(srv)) + r.POST("/admin/v1/positions", _PositionService_CreatePosition0_HTTP_Handler(srv)) + r.PUT("/admin/v1/positions/{position.id}", _PositionService_UpdatePosition0_HTTP_Handler(srv)) + r.DELETE("/admin/v1/positions/{id}", _PositionService_DeletePosition0_HTTP_Handler(srv)) +} + +func _PositionService_ListPosition0_HTTP_Handler(srv PositionServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v1.PagingRequest + if err := ctx.BindQuery(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationPositionServiceListPosition) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.ListPosition(ctx, req.(*v1.PagingRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*v11.ListPositionResponse) + return ctx.Result(200, reply) + } +} + +func _PositionService_GetPosition0_HTTP_Handler(srv PositionServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v11.GetPositionRequest + if err := ctx.BindQuery(&in); err != nil { + return err + } + if err := ctx.BindVars(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationPositionServiceGetPosition) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.GetPosition(ctx, req.(*v11.GetPositionRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*v11.Position) + return ctx.Result(200, reply) + } +} + +func _PositionService_CreatePosition0_HTTP_Handler(srv PositionServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v11.CreatePositionRequest + if err := ctx.Bind(&in); err != nil { + return err + } + if err := ctx.BindQuery(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationPositionServiceCreatePosition) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.CreatePosition(ctx, req.(*v11.CreatePositionRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*emptypb.Empty) + return ctx.Result(200, reply) + } +} + +func _PositionService_UpdatePosition0_HTTP_Handler(srv PositionServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v11.UpdatePositionRequest + if err := ctx.Bind(&in.Position); err != nil { + return err + } + if err := ctx.BindQuery(&in); err != nil { + return err + } + if err := ctx.BindVars(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationPositionServiceUpdatePosition) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.UpdatePosition(ctx, req.(*v11.UpdatePositionRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*emptypb.Empty) + return ctx.Result(200, reply) + } +} + +func _PositionService_DeletePosition0_HTTP_Handler(srv PositionServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v11.DeletePositionRequest + if err := ctx.BindQuery(&in); err != nil { + return err + } + if err := ctx.BindVars(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationPositionServiceDeletePosition) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.DeletePosition(ctx, req.(*v11.DeletePositionRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*emptypb.Empty) + return ctx.Result(200, reply) + } +} + +type PositionServiceHTTPClient interface { + CreatePosition(ctx context.Context, req *v11.CreatePositionRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error) + DeletePosition(ctx context.Context, req *v11.DeletePositionRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error) + GetPosition(ctx context.Context, req *v11.GetPositionRequest, opts ...http.CallOption) (rsp *v11.Position, err error) + ListPosition(ctx context.Context, req *v1.PagingRequest, opts ...http.CallOption) (rsp *v11.ListPositionResponse, err error) + UpdatePosition(ctx context.Context, req *v11.UpdatePositionRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error) +} + +type PositionServiceHTTPClientImpl struct { + cc *http.Client +} + +func NewPositionServiceHTTPClient(client *http.Client) PositionServiceHTTPClient { + return &PositionServiceHTTPClientImpl{client} +} + +func (c *PositionServiceHTTPClientImpl) CreatePosition(ctx context.Context, in *v11.CreatePositionRequest, opts ...http.CallOption) (*emptypb.Empty, error) { + var out emptypb.Empty + pattern := "/admin/v1/positions" + path := binding.EncodeURL(pattern, in, false) + opts = append(opts, http.Operation(OperationPositionServiceCreatePosition)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *PositionServiceHTTPClientImpl) DeletePosition(ctx context.Context, in *v11.DeletePositionRequest, opts ...http.CallOption) (*emptypb.Empty, error) { + var out emptypb.Empty + pattern := "/admin/v1/positions/{id}" + path := binding.EncodeURL(pattern, in, true) + opts = append(opts, http.Operation(OperationPositionServiceDeletePosition)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "DELETE", path, nil, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *PositionServiceHTTPClientImpl) GetPosition(ctx context.Context, in *v11.GetPositionRequest, opts ...http.CallOption) (*v11.Position, error) { + var out v11.Position + pattern := "/admin/v1/positions/{id}" + path := binding.EncodeURL(pattern, in, true) + opts = append(opts, http.Operation(OperationPositionServiceGetPosition)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *PositionServiceHTTPClientImpl) ListPosition(ctx context.Context, in *v1.PagingRequest, opts ...http.CallOption) (*v11.ListPositionResponse, error) { + var out v11.ListPositionResponse + pattern := "/admin/v1/positions" + path := binding.EncodeURL(pattern, in, true) + opts = append(opts, http.Operation(OperationPositionServiceListPosition)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *PositionServiceHTTPClientImpl) UpdatePosition(ctx context.Context, in *v11.UpdatePositionRequest, opts ...http.CallOption) (*emptypb.Empty, error) { + var out emptypb.Empty + pattern := "/admin/v1/positions/{position.id}" + path := binding.EncodeURL(pattern, in, false) + opts = append(opts, http.Operation(OperationPositionServiceUpdatePosition)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "PUT", path, in.Position, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_role.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/i_role.pb.go new file mode 100644 index 0000000..54bd870 --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_role.pb.go @@ -0,0 +1,151 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: admin/service/v1/i_role.proto + +package servicev1 + +import ( + _ "github.com/google/gnostic/openapiv3" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + v11 "kratos-monolithic-demo/gen/api/go/user/service/v1" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_admin_service_v1_i_role_proto protoreflect.FileDescriptor + +var file_admin_service_v1_i_role_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, + 0x76, 0x31, 0x2f, 0x69, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x10, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, + 0x31, 0x1a, 0x24, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1a, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xb1, + 0x05, 0x0a, 0x0b, 0x52, 0x6f, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x80, + 0x01, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x19, 0x2e, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f, 0x6c, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0xba, 0x47, 0x1c, 0x5a, 0x1a, + 0x0a, 0x18, 0x0a, 0x14, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, + 0x12, 0x0f, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, 0x6c, 0x65, + 0x73, 0x12, 0x7e, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x1f, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, + 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x52, 0x6f, 0x6c, 0x65, 0x22, 0x3b, 0xba, 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, + 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, + 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x61, 0x64, + 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, + 0x7d, 0x12, 0x83, 0x01, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, + 0x12, 0x22, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x39, 0xba, 0x47, + 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, + 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x14, 0x3a, 0x01, 0x2a, 0x22, 0x0f, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, + 0x31, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x90, 0x01, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x22, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, + 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x22, 0x46, 0xba, 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, 0x41, 0x75, + 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, 0x72, 0x65, + 0x72, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x1a, + 0x19, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x73, + 0x2f, 0x7b, 0x72, 0x6f, 0x6c, 0x65, 0x2e, 0x69, 0x64, 0x7d, 0x12, 0x85, 0x01, 0x0a, 0x0a, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x22, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x3b, 0xba, 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, + 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, + 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x2a, 0x14, 0x2f, 0x61, + 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2f, 0x7b, 0x69, + 0x64, 0x7d, 0x42, 0xc2, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x49, 0x52, 0x6f, + 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x6b, 0x72, 0x61, 0x74, 0x6f, + 0x73, 0x2d, 0x6d, 0x6f, 0x6e, 0x6f, 0x6c, 0x69, 0x74, 0x68, 0x69, 0x63, 0x2d, 0x64, 0x65, 0x6d, + 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x53, 0x58, 0xaa, 0x02, 0x10, + 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x56, 0x31, + 0xca, 0x02, 0x10, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x5c, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x12, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_admin_service_v1_i_role_proto_goTypes = []interface{}{ + (*v1.PagingRequest)(nil), // 0: pagination.PagingRequest + (*v11.GetRoleRequest)(nil), // 1: user.service.v1.GetRoleRequest + (*v11.CreateRoleRequest)(nil), // 2: user.service.v1.CreateRoleRequest + (*v11.UpdateRoleRequest)(nil), // 3: user.service.v1.UpdateRoleRequest + (*v11.DeleteRoleRequest)(nil), // 4: user.service.v1.DeleteRoleRequest + (*v11.ListRoleResponse)(nil), // 5: user.service.v1.ListRoleResponse + (*v11.Role)(nil), // 6: user.service.v1.Role + (*emptypb.Empty)(nil), // 7: google.protobuf.Empty +} +var file_admin_service_v1_i_role_proto_depIdxs = []int32{ + 0, // 0: admin.service.v1.RoleService.ListRole:input_type -> pagination.PagingRequest + 1, // 1: admin.service.v1.RoleService.GetRole:input_type -> user.service.v1.GetRoleRequest + 2, // 2: admin.service.v1.RoleService.CreateRole:input_type -> user.service.v1.CreateRoleRequest + 3, // 3: admin.service.v1.RoleService.UpdateRole:input_type -> user.service.v1.UpdateRoleRequest + 4, // 4: admin.service.v1.RoleService.DeleteRole:input_type -> user.service.v1.DeleteRoleRequest + 5, // 5: admin.service.v1.RoleService.ListRole:output_type -> user.service.v1.ListRoleResponse + 6, // 6: admin.service.v1.RoleService.GetRole:output_type -> user.service.v1.Role + 7, // 7: admin.service.v1.RoleService.CreateRole:output_type -> google.protobuf.Empty + 7, // 8: admin.service.v1.RoleService.UpdateRole:output_type -> google.protobuf.Empty + 7, // 9: admin.service.v1.RoleService.DeleteRole:output_type -> google.protobuf.Empty + 5, // [5:10] is the sub-list for method output_type + 0, // [0:5] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_admin_service_v1_i_role_proto_init() } +func file_admin_service_v1_i_role_proto_init() { + if File_admin_service_v1_i_role_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_admin_service_v1_i_role_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_admin_service_v1_i_role_proto_goTypes, + DependencyIndexes: file_admin_service_v1_i_role_proto_depIdxs, + }.Build() + File_admin_service_v1_i_role_proto = out.File + file_admin_service_v1_i_role_proto_rawDesc = nil + file_admin_service_v1_i_role_proto_goTypes = nil + file_admin_service_v1_i_role_proto_depIdxs = nil +} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_role.pb.validate.go b/monolithic/backend/gen/api/go/admin/service/v1/i_role.pb.validate.go new file mode 100644 index 0000000..5b94ed2 --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_role.pb.validate.go @@ -0,0 +1,36 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: admin/service/v1/i_role.proto + +package servicev1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_role_grpc.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/i_role_grpc.pb.go new file mode 100644 index 0000000..a953701 --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_role_grpc.pb.go @@ -0,0 +1,270 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: admin/service/v1/i_role.proto + +package servicev1 + +import ( + context "context" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" + v11 "kratos-monolithic-demo/gen/api/go/user/service/v1" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + RoleService_ListRole_FullMethodName = "/admin.service.v1.RoleService/ListRole" + RoleService_GetRole_FullMethodName = "/admin.service.v1.RoleService/GetRole" + RoleService_CreateRole_FullMethodName = "/admin.service.v1.RoleService/CreateRole" + RoleService_UpdateRole_FullMethodName = "/admin.service.v1.RoleService/UpdateRole" + RoleService_DeleteRole_FullMethodName = "/admin.service.v1.RoleService/DeleteRole" +) + +// RoleServiceClient is the client API for RoleService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type RoleServiceClient interface { + // 查询角色列表 + ListRole(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*v11.ListRoleResponse, error) + // 查询角色详情 + GetRole(ctx context.Context, in *v11.GetRoleRequest, opts ...grpc.CallOption) (*v11.Role, error) + // 创建角色 + CreateRole(ctx context.Context, in *v11.CreateRoleRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 更新角色 + UpdateRole(ctx context.Context, in *v11.UpdateRoleRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 删除角色 + DeleteRole(ctx context.Context, in *v11.DeleteRoleRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type roleServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewRoleServiceClient(cc grpc.ClientConnInterface) RoleServiceClient { + return &roleServiceClient{cc} +} + +func (c *roleServiceClient) ListRole(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*v11.ListRoleResponse, error) { + out := new(v11.ListRoleResponse) + err := c.cc.Invoke(ctx, RoleService_ListRole_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *roleServiceClient) GetRole(ctx context.Context, in *v11.GetRoleRequest, opts ...grpc.CallOption) (*v11.Role, error) { + out := new(v11.Role) + err := c.cc.Invoke(ctx, RoleService_GetRole_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *roleServiceClient) CreateRole(ctx context.Context, in *v11.CreateRoleRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, RoleService_CreateRole_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *roleServiceClient) UpdateRole(ctx context.Context, in *v11.UpdateRoleRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, RoleService_UpdateRole_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *roleServiceClient) DeleteRole(ctx context.Context, in *v11.DeleteRoleRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, RoleService_DeleteRole_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// RoleServiceServer is the server API for RoleService service. +// All implementations must embed UnimplementedRoleServiceServer +// for forward compatibility +type RoleServiceServer interface { + // 查询角色列表 + ListRole(context.Context, *v1.PagingRequest) (*v11.ListRoleResponse, error) + // 查询角色详情 + GetRole(context.Context, *v11.GetRoleRequest) (*v11.Role, error) + // 创建角色 + CreateRole(context.Context, *v11.CreateRoleRequest) (*emptypb.Empty, error) + // 更新角色 + UpdateRole(context.Context, *v11.UpdateRoleRequest) (*emptypb.Empty, error) + // 删除角色 + DeleteRole(context.Context, *v11.DeleteRoleRequest) (*emptypb.Empty, error) + mustEmbedUnimplementedRoleServiceServer() +} + +// UnimplementedRoleServiceServer must be embedded to have forward compatible implementations. +type UnimplementedRoleServiceServer struct { +} + +func (UnimplementedRoleServiceServer) ListRole(context.Context, *v1.PagingRequest) (*v11.ListRoleResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListRole not implemented") +} +func (UnimplementedRoleServiceServer) GetRole(context.Context, *v11.GetRoleRequest) (*v11.Role, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetRole not implemented") +} +func (UnimplementedRoleServiceServer) CreateRole(context.Context, *v11.CreateRoleRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateRole not implemented") +} +func (UnimplementedRoleServiceServer) UpdateRole(context.Context, *v11.UpdateRoleRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateRole not implemented") +} +func (UnimplementedRoleServiceServer) DeleteRole(context.Context, *v11.DeleteRoleRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteRole not implemented") +} +func (UnimplementedRoleServiceServer) mustEmbedUnimplementedRoleServiceServer() {} + +// UnsafeRoleServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to RoleServiceServer will +// result in compilation errors. +type UnsafeRoleServiceServer interface { + mustEmbedUnimplementedRoleServiceServer() +} + +func RegisterRoleServiceServer(s grpc.ServiceRegistrar, srv RoleServiceServer) { + s.RegisterService(&RoleService_ServiceDesc, srv) +} + +func _RoleService_ListRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v1.PagingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RoleServiceServer).ListRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RoleService_ListRole_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RoleServiceServer).ListRole(ctx, req.(*v1.PagingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RoleService_GetRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v11.GetRoleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RoleServiceServer).GetRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RoleService_GetRole_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RoleServiceServer).GetRole(ctx, req.(*v11.GetRoleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RoleService_CreateRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v11.CreateRoleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RoleServiceServer).CreateRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RoleService_CreateRole_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RoleServiceServer).CreateRole(ctx, req.(*v11.CreateRoleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RoleService_UpdateRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v11.UpdateRoleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RoleServiceServer).UpdateRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RoleService_UpdateRole_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RoleServiceServer).UpdateRole(ctx, req.(*v11.UpdateRoleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RoleService_DeleteRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v11.DeleteRoleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RoleServiceServer).DeleteRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RoleService_DeleteRole_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RoleServiceServer).DeleteRole(ctx, req.(*v11.DeleteRoleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// RoleService_ServiceDesc is the grpc.ServiceDesc for RoleService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var RoleService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "admin.service.v1.RoleService", + HandlerType: (*RoleServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListRole", + Handler: _RoleService_ListRole_Handler, + }, + { + MethodName: "GetRole", + Handler: _RoleService_GetRole_Handler, + }, + { + MethodName: "CreateRole", + Handler: _RoleService_CreateRole_Handler, + }, + { + MethodName: "UpdateRole", + Handler: _RoleService_UpdateRole_Handler, + }, + { + MethodName: "DeleteRole", + Handler: _RoleService_DeleteRole_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "admin/service/v1/i_role.proto", +} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_role_http.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/i_role_http.pb.go new file mode 100644 index 0000000..823fd7f --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_role_http.pb.go @@ -0,0 +1,242 @@ +// Code generated by protoc-gen-go-http. DO NOT EDIT. +// versions: +// - protoc-gen-go-http v2.7.1 +// - protoc (unknown) +// source: admin/service/v1/i_role.proto + +package servicev1 + +import ( + context "context" + http "github.com/go-kratos/kratos/v2/transport/http" + binding "github.com/go-kratos/kratos/v2/transport/http/binding" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + emptypb "google.golang.org/protobuf/types/known/emptypb" + v11 "kratos-monolithic-demo/gen/api/go/user/service/v1" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the kratos package it is being compiled against. +var _ = new(context.Context) +var _ = binding.EncodeURL + +const _ = http.SupportPackageIsVersion1 + +const OperationRoleServiceCreateRole = "/admin.service.v1.RoleService/CreateRole" +const OperationRoleServiceDeleteRole = "/admin.service.v1.RoleService/DeleteRole" +const OperationRoleServiceGetRole = "/admin.service.v1.RoleService/GetRole" +const OperationRoleServiceListRole = "/admin.service.v1.RoleService/ListRole" +const OperationRoleServiceUpdateRole = "/admin.service.v1.RoleService/UpdateRole" + +type RoleServiceHTTPServer interface { + // CreateRole 创建角色 + CreateRole(context.Context, *v11.CreateRoleRequest) (*emptypb.Empty, error) + // DeleteRole 删除角色 + DeleteRole(context.Context, *v11.DeleteRoleRequest) (*emptypb.Empty, error) + // GetRole 查询角色详情 + GetRole(context.Context, *v11.GetRoleRequest) (*v11.Role, error) + // ListRole 查询角色列表 + ListRole(context.Context, *v1.PagingRequest) (*v11.ListRoleResponse, error) + // UpdateRole 更新角色 + UpdateRole(context.Context, *v11.UpdateRoleRequest) (*emptypb.Empty, error) +} + +func RegisterRoleServiceHTTPServer(s *http.Server, srv RoleServiceHTTPServer) { + r := s.Route("/") + r.GET("/admin/v1/roles", _RoleService_ListRole0_HTTP_Handler(srv)) + r.GET("/admin/v1/roles/{id}", _RoleService_GetRole0_HTTP_Handler(srv)) + r.POST("/admin/v1/roles", _RoleService_CreateRole0_HTTP_Handler(srv)) + r.PUT("/admin/v1/roles/{role.id}", _RoleService_UpdateRole0_HTTP_Handler(srv)) + r.DELETE("/admin/v1/roles/{id}", _RoleService_DeleteRole0_HTTP_Handler(srv)) +} + +func _RoleService_ListRole0_HTTP_Handler(srv RoleServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v1.PagingRequest + if err := ctx.BindQuery(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationRoleServiceListRole) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.ListRole(ctx, req.(*v1.PagingRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*v11.ListRoleResponse) + return ctx.Result(200, reply) + } +} + +func _RoleService_GetRole0_HTTP_Handler(srv RoleServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v11.GetRoleRequest + if err := ctx.BindQuery(&in); err != nil { + return err + } + if err := ctx.BindVars(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationRoleServiceGetRole) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.GetRole(ctx, req.(*v11.GetRoleRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*v11.Role) + return ctx.Result(200, reply) + } +} + +func _RoleService_CreateRole0_HTTP_Handler(srv RoleServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v11.CreateRoleRequest + if err := ctx.Bind(&in); err != nil { + return err + } + if err := ctx.BindQuery(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationRoleServiceCreateRole) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.CreateRole(ctx, req.(*v11.CreateRoleRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*emptypb.Empty) + return ctx.Result(200, reply) + } +} + +func _RoleService_UpdateRole0_HTTP_Handler(srv RoleServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v11.UpdateRoleRequest + if err := ctx.Bind(&in.Role); err != nil { + return err + } + if err := ctx.BindQuery(&in); err != nil { + return err + } + if err := ctx.BindVars(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationRoleServiceUpdateRole) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.UpdateRole(ctx, req.(*v11.UpdateRoleRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*emptypb.Empty) + return ctx.Result(200, reply) + } +} + +func _RoleService_DeleteRole0_HTTP_Handler(srv RoleServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v11.DeleteRoleRequest + if err := ctx.BindQuery(&in); err != nil { + return err + } + if err := ctx.BindVars(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationRoleServiceDeleteRole) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.DeleteRole(ctx, req.(*v11.DeleteRoleRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*emptypb.Empty) + return ctx.Result(200, reply) + } +} + +type RoleServiceHTTPClient interface { + CreateRole(ctx context.Context, req *v11.CreateRoleRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error) + DeleteRole(ctx context.Context, req *v11.DeleteRoleRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error) + GetRole(ctx context.Context, req *v11.GetRoleRequest, opts ...http.CallOption) (rsp *v11.Role, err error) + ListRole(ctx context.Context, req *v1.PagingRequest, opts ...http.CallOption) (rsp *v11.ListRoleResponse, err error) + UpdateRole(ctx context.Context, req *v11.UpdateRoleRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error) +} + +type RoleServiceHTTPClientImpl struct { + cc *http.Client +} + +func NewRoleServiceHTTPClient(client *http.Client) RoleServiceHTTPClient { + return &RoleServiceHTTPClientImpl{client} +} + +func (c *RoleServiceHTTPClientImpl) CreateRole(ctx context.Context, in *v11.CreateRoleRequest, opts ...http.CallOption) (*emptypb.Empty, error) { + var out emptypb.Empty + pattern := "/admin/v1/roles" + path := binding.EncodeURL(pattern, in, false) + opts = append(opts, http.Operation(OperationRoleServiceCreateRole)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *RoleServiceHTTPClientImpl) DeleteRole(ctx context.Context, in *v11.DeleteRoleRequest, opts ...http.CallOption) (*emptypb.Empty, error) { + var out emptypb.Empty + pattern := "/admin/v1/roles/{id}" + path := binding.EncodeURL(pattern, in, true) + opts = append(opts, http.Operation(OperationRoleServiceDeleteRole)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "DELETE", path, nil, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *RoleServiceHTTPClientImpl) GetRole(ctx context.Context, in *v11.GetRoleRequest, opts ...http.CallOption) (*v11.Role, error) { + var out v11.Role + pattern := "/admin/v1/roles/{id}" + path := binding.EncodeURL(pattern, in, true) + opts = append(opts, http.Operation(OperationRoleServiceGetRole)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *RoleServiceHTTPClientImpl) ListRole(ctx context.Context, in *v1.PagingRequest, opts ...http.CallOption) (*v11.ListRoleResponse, error) { + var out v11.ListRoleResponse + pattern := "/admin/v1/roles" + path := binding.EncodeURL(pattern, in, true) + opts = append(opts, http.Operation(OperationRoleServiceListRole)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *RoleServiceHTTPClientImpl) UpdateRole(ctx context.Context, in *v11.UpdateRoleRequest, opts ...http.CallOption) (*emptypb.Empty, error) { + var out emptypb.Empty + pattern := "/admin/v1/roles/{role.id}" + path := binding.EncodeURL(pattern, in, false) + opts = append(opts, http.Operation(OperationRoleServiceUpdateRole)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "PUT", path, in.Role, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_router.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/i_router.pb.go new file mode 100644 index 0000000..c5bcb15 --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_router.pb.go @@ -0,0 +1,682 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: admin/service/v1/i_router.proto + +package servicev1 + +import ( + _ "github.com/google/gnostic/openapiv3" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 路由元数据 +type RouteMeta struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OrderNo *int32 `protobuf:"varint,1,opt,name=order_no,json=orderNo,proto3,oneof" json:"order_no,omitempty"` + Title *string `protobuf:"bytes,2,opt,name=title,proto3,oneof" json:"title,omitempty"` + DynamicLevel *int32 `protobuf:"varint,3,opt,name=dynamicLevel,proto3,oneof" json:"dynamicLevel,omitempty"` + RealPath *string `protobuf:"bytes,4,opt,name=realPath,proto3,oneof" json:"realPath,omitempty"` + Icon *string `protobuf:"bytes,5,opt,name=icon,proto3,oneof" json:"icon,omitempty"` + FrameSrc *string `protobuf:"bytes,6,opt,name=frameSrc,proto3,oneof" json:"frameSrc,omitempty"` + TransitionName *string `protobuf:"bytes,7,opt,name=transitionName,proto3,oneof" json:"transitionName,omitempty"` + Affix *bool `protobuf:"varint,8,opt,name=affix,proto3,oneof" json:"affix,omitempty"` + CarryParam *bool `protobuf:"varint,9,opt,name=carryParam,proto3,oneof" json:"carryParam,omitempty"` + Single *bool `protobuf:"varint,10,opt,name=single,proto3,oneof" json:"single,omitempty"` + IgnoreAuth *bool `protobuf:"varint,11,opt,name=ignoreAuth,proto3,oneof" json:"ignoreAuth,omitempty"` + IgnoreKeepAlive *bool `protobuf:"varint,12,opt,name=ignoreKeepAlive,proto3,oneof" json:"ignoreKeepAlive,omitempty"` + IgnoreRoute *bool `protobuf:"varint,13,opt,name=ignoreRoute,proto3,oneof" json:"ignoreRoute,omitempty"` + HideBreadcrumb *bool `protobuf:"varint,14,opt,name=hideBreadcrumb,proto3,oneof" json:"hideBreadcrumb,omitempty"` + HideChildrenInMenu *bool `protobuf:"varint,15,opt,name=hideChildrenInMenu,proto3,oneof" json:"hideChildrenInMenu,omitempty"` + HideTab *bool `protobuf:"varint,16,opt,name=hideTab,proto3,oneof" json:"hideTab,omitempty"` + HideMenu *bool `protobuf:"varint,17,opt,name=hideMenu,proto3,oneof" json:"hideMenu,omitempty"` + IsLink *bool `protobuf:"varint,18,opt,name=isLink,proto3,oneof" json:"isLink,omitempty"` + HidePathForChildren *bool `protobuf:"varint,19,opt,name=hidePathForChildren,proto3,oneof" json:"hidePathForChildren,omitempty"` + CurrentActiveMenu *string `protobuf:"bytes,20,opt,name=currentActiveMenu,proto3,oneof" json:"currentActiveMenu,omitempty"` +} + +func (x *RouteMeta) Reset() { + *x = RouteMeta{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_service_v1_i_router_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RouteMeta) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RouteMeta) ProtoMessage() {} + +func (x *RouteMeta) ProtoReflect() protoreflect.Message { + mi := &file_admin_service_v1_i_router_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RouteMeta.ProtoReflect.Descriptor instead. +func (*RouteMeta) Descriptor() ([]byte, []int) { + return file_admin_service_v1_i_router_proto_rawDescGZIP(), []int{0} +} + +func (x *RouteMeta) GetOrderNo() int32 { + if x != nil && x.OrderNo != nil { + return *x.OrderNo + } + return 0 +} + +func (x *RouteMeta) GetTitle() string { + if x != nil && x.Title != nil { + return *x.Title + } + return "" +} + +func (x *RouteMeta) GetDynamicLevel() int32 { + if x != nil && x.DynamicLevel != nil { + return *x.DynamicLevel + } + return 0 +} + +func (x *RouteMeta) GetRealPath() string { + if x != nil && x.RealPath != nil { + return *x.RealPath + } + return "" +} + +func (x *RouteMeta) GetIcon() string { + if x != nil && x.Icon != nil { + return *x.Icon + } + return "" +} + +func (x *RouteMeta) GetFrameSrc() string { + if x != nil && x.FrameSrc != nil { + return *x.FrameSrc + } + return "" +} + +func (x *RouteMeta) GetTransitionName() string { + if x != nil && x.TransitionName != nil { + return *x.TransitionName + } + return "" +} + +func (x *RouteMeta) GetAffix() bool { + if x != nil && x.Affix != nil { + return *x.Affix + } + return false +} + +func (x *RouteMeta) GetCarryParam() bool { + if x != nil && x.CarryParam != nil { + return *x.CarryParam + } + return false +} + +func (x *RouteMeta) GetSingle() bool { + if x != nil && x.Single != nil { + return *x.Single + } + return false +} + +func (x *RouteMeta) GetIgnoreAuth() bool { + if x != nil && x.IgnoreAuth != nil { + return *x.IgnoreAuth + } + return false +} + +func (x *RouteMeta) GetIgnoreKeepAlive() bool { + if x != nil && x.IgnoreKeepAlive != nil { + return *x.IgnoreKeepAlive + } + return false +} + +func (x *RouteMeta) GetIgnoreRoute() bool { + if x != nil && x.IgnoreRoute != nil { + return *x.IgnoreRoute + } + return false +} + +func (x *RouteMeta) GetHideBreadcrumb() bool { + if x != nil && x.HideBreadcrumb != nil { + return *x.HideBreadcrumb + } + return false +} + +func (x *RouteMeta) GetHideChildrenInMenu() bool { + if x != nil && x.HideChildrenInMenu != nil { + return *x.HideChildrenInMenu + } + return false +} + +func (x *RouteMeta) GetHideTab() bool { + if x != nil && x.HideTab != nil { + return *x.HideTab + } + return false +} + +func (x *RouteMeta) GetHideMenu() bool { + if x != nil && x.HideMenu != nil { + return *x.HideMenu + } + return false +} + +func (x *RouteMeta) GetIsLink() bool { + if x != nil && x.IsLink != nil { + return *x.IsLink + } + return false +} + +func (x *RouteMeta) GetHidePathForChildren() bool { + if x != nil && x.HidePathForChildren != nil { + return *x.HidePathForChildren + } + return false +} + +func (x *RouteMeta) GetCurrentActiveMenu() string { + if x != nil && x.CurrentActiveMenu != nil { + return *x.CurrentActiveMenu + } + return "" +} + +// 路由项 +type RouteItem struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name *string `protobuf:"bytes,1,opt,name=name,proto3,oneof" json:"name,omitempty"` + Alias *string `protobuf:"bytes,2,opt,name=alias,proto3,oneof" json:"alias,omitempty"` + Path *string `protobuf:"bytes,3,opt,name=path,proto3,oneof" json:"path,omitempty"` + Component *string `protobuf:"bytes,4,opt,name=component,proto3,oneof" json:"component,omitempty"` + Redirect *string `protobuf:"bytes,5,opt,name=redirect,proto3,oneof" json:"redirect,omitempty"` + CaseSensitive *bool `protobuf:"varint,6,opt,name=caseSensitive,proto3,oneof" json:"caseSensitive,omitempty"` + Meta *RouteMeta `protobuf:"bytes,7,opt,name=meta,proto3,oneof" json:"meta,omitempty"` + Children []*RouteItem `protobuf:"bytes,8,rep,name=children,proto3" json:"children,omitempty"` +} + +func (x *RouteItem) Reset() { + *x = RouteItem{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_service_v1_i_router_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RouteItem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RouteItem) ProtoMessage() {} + +func (x *RouteItem) ProtoReflect() protoreflect.Message { + mi := &file_admin_service_v1_i_router_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RouteItem.ProtoReflect.Descriptor instead. +func (*RouteItem) Descriptor() ([]byte, []int) { + return file_admin_service_v1_i_router_proto_rawDescGZIP(), []int{1} +} + +func (x *RouteItem) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +func (x *RouteItem) GetAlias() string { + if x != nil && x.Alias != nil { + return *x.Alias + } + return "" +} + +func (x *RouteItem) GetPath() string { + if x != nil && x.Path != nil { + return *x.Path + } + return "" +} + +func (x *RouteItem) GetComponent() string { + if x != nil && x.Component != nil { + return *x.Component + } + return "" +} + +func (x *RouteItem) GetRedirect() string { + if x != nil && x.Redirect != nil { + return *x.Redirect + } + return "" +} + +func (x *RouteItem) GetCaseSensitive() bool { + if x != nil && x.CaseSensitive != nil { + return *x.CaseSensitive + } + return false +} + +func (x *RouteItem) GetMeta() *RouteMeta { + if x != nil { + return x.Meta + } + return nil +} + +func (x *RouteItem) GetChildren() []*RouteItem { + if x != nil { + return x.Children + } + return nil +} + +// 查询路由列表 - 回应 +type ListRouteResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Items []*RouteItem `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` +} + +func (x *ListRouteResponse) Reset() { + *x = ListRouteResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_service_v1_i_router_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRouteResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRouteResponse) ProtoMessage() {} + +func (x *ListRouteResponse) ProtoReflect() protoreflect.Message { + mi := &file_admin_service_v1_i_router_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListRouteResponse.ProtoReflect.Descriptor instead. +func (*ListRouteResponse) Descriptor() ([]byte, []int) { + return file_admin_service_v1_i_router_proto_rawDescGZIP(), []int{2} +} + +func (x *ListRouteResponse) GetItems() []*RouteItem { + if x != nil { + return x.Items + } + return nil +} + +// 查询权限码列表 - 回应 +type ListPermissionCodeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Codes []string `protobuf:"bytes,1,rep,name=codes,proto3" json:"codes,omitempty"` +} + +func (x *ListPermissionCodeResponse) Reset() { + *x = ListPermissionCodeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_service_v1_i_router_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListPermissionCodeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListPermissionCodeResponse) ProtoMessage() {} + +func (x *ListPermissionCodeResponse) ProtoReflect() protoreflect.Message { + mi := &file_admin_service_v1_i_router_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListPermissionCodeResponse.ProtoReflect.Descriptor instead. +func (*ListPermissionCodeResponse) Descriptor() ([]byte, []int) { + return file_admin_service_v1_i_router_proto_rawDescGZIP(), []int{3} +} + +func (x *ListPermissionCodeResponse) GetCodes() []string { + if x != nil { + return x.Codes + } + return nil +} + +var File_admin_service_v1_i_router_proto protoreflect.FileDescriptor + +var file_admin_service_v1_i_router_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, + 0x76, 0x31, 0x2f, 0x69, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x10, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x76, 0x31, 0x1a, 0x24, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2f, 0x6f, 0x70, 0x65, + 0x6e, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa9, 0x08, 0x0a, 0x09, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x4d, 0x65, + 0x74, 0x61, 0x12, 0x1e, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x6e, 0x6f, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x4e, 0x6f, 0x88, + 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x01, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, 0x27, 0x0a, + 0x0c, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x48, 0x02, 0x52, 0x0c, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x4c, 0x65, + 0x76, 0x65, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, 0x72, 0x65, 0x61, 0x6c, 0x50, 0x61, + 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, 0x08, 0x72, 0x65, 0x61, 0x6c, + 0x50, 0x61, 0x74, 0x68, 0x88, 0x01, 0x01, 0x12, 0x17, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x04, 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x88, 0x01, 0x01, + 0x12, 0x1f, 0x0a, 0x08, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x53, 0x72, 0x63, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x48, 0x05, 0x52, 0x08, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x53, 0x72, 0x63, 0x88, 0x01, + 0x01, 0x12, 0x2b, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x4e, + 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x48, 0x06, 0x52, 0x0e, 0x74, 0x72, 0x61, + 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x19, + 0x0a, 0x05, 0x61, 0x66, 0x66, 0x69, 0x78, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x48, 0x07, 0x52, + 0x05, 0x61, 0x66, 0x66, 0x69, 0x78, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x63, 0x61, 0x72, + 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x48, 0x08, 0x52, + 0x0a, 0x63, 0x61, 0x72, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x88, 0x01, 0x01, 0x12, 0x1b, + 0x0a, 0x06, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x48, 0x09, + 0x52, 0x06, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x69, + 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x41, 0x75, 0x74, 0x68, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x48, + 0x0a, 0x52, 0x0a, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x41, 0x75, 0x74, 0x68, 0x88, 0x01, 0x01, + 0x12, 0x2d, 0x0a, 0x0f, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x4b, 0x65, 0x65, 0x70, 0x41, 0x6c, + 0x69, 0x76, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x48, 0x0b, 0x52, 0x0f, 0x69, 0x67, 0x6e, + 0x6f, 0x72, 0x65, 0x4b, 0x65, 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x88, 0x01, 0x01, 0x12, + 0x25, 0x0a, 0x0b, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x18, 0x0d, + 0x20, 0x01, 0x28, 0x08, 0x48, 0x0c, 0x52, 0x0b, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x52, 0x6f, + 0x75, 0x74, 0x65, 0x88, 0x01, 0x01, 0x12, 0x2b, 0x0a, 0x0e, 0x68, 0x69, 0x64, 0x65, 0x42, 0x72, + 0x65, 0x61, 0x64, 0x63, 0x72, 0x75, 0x6d, 0x62, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x48, 0x0d, + 0x52, 0x0e, 0x68, 0x69, 0x64, 0x65, 0x42, 0x72, 0x65, 0x61, 0x64, 0x63, 0x72, 0x75, 0x6d, 0x62, + 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x12, 0x68, 0x69, 0x64, 0x65, 0x43, 0x68, 0x69, 0x6c, 0x64, + 0x72, 0x65, 0x6e, 0x49, 0x6e, 0x4d, 0x65, 0x6e, 0x75, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x48, + 0x0e, 0x52, 0x12, 0x68, 0x69, 0x64, 0x65, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x49, + 0x6e, 0x4d, 0x65, 0x6e, 0x75, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x68, 0x69, 0x64, 0x65, + 0x54, 0x61, 0x62, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x48, 0x0f, 0x52, 0x07, 0x68, 0x69, 0x64, + 0x65, 0x54, 0x61, 0x62, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, 0x68, 0x69, 0x64, 0x65, 0x4d, + 0x65, 0x6e, 0x75, 0x18, 0x11, 0x20, 0x01, 0x28, 0x08, 0x48, 0x10, 0x52, 0x08, 0x68, 0x69, 0x64, + 0x65, 0x4d, 0x65, 0x6e, 0x75, 0x88, 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x06, 0x69, 0x73, 0x4c, 0x69, + 0x6e, 0x6b, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, 0x48, 0x11, 0x52, 0x06, 0x69, 0x73, 0x4c, 0x69, + 0x6e, 0x6b, 0x88, 0x01, 0x01, 0x12, 0x35, 0x0a, 0x13, 0x68, 0x69, 0x64, 0x65, 0x50, 0x61, 0x74, + 0x68, 0x46, 0x6f, 0x72, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x18, 0x13, 0x20, 0x01, + 0x28, 0x08, 0x48, 0x12, 0x52, 0x13, 0x68, 0x69, 0x64, 0x65, 0x50, 0x61, 0x74, 0x68, 0x46, 0x6f, + 0x72, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x31, 0x0a, 0x11, + 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4d, 0x65, 0x6e, + 0x75, 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x48, 0x13, 0x52, 0x11, 0x63, 0x75, 0x72, 0x72, 0x65, + 0x6e, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4d, 0x65, 0x6e, 0x75, 0x88, 0x01, 0x01, 0x42, + 0x0b, 0x0a, 0x09, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x6e, 0x6f, 0x42, 0x08, 0x0a, 0x06, + 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x64, 0x79, 0x6e, 0x61, 0x6d, + 0x69, 0x63, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x72, 0x65, 0x61, 0x6c, + 0x50, 0x61, 0x74, 0x68, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x69, 0x63, 0x6f, 0x6e, 0x42, 0x0b, 0x0a, + 0x09, 0x5f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x53, 0x72, 0x63, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x74, + 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x08, 0x0a, + 0x06, 0x5f, 0x61, 0x66, 0x66, 0x69, 0x78, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x63, 0x61, 0x72, 0x72, + 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x73, 0x69, 0x6e, 0x67, 0x6c, + 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x41, 0x75, 0x74, 0x68, + 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x4b, 0x65, 0x65, 0x70, 0x41, + 0x6c, 0x69, 0x76, 0x65, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x52, + 0x6f, 0x75, 0x74, 0x65, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x68, 0x69, 0x64, 0x65, 0x42, 0x72, 0x65, + 0x61, 0x64, 0x63, 0x72, 0x75, 0x6d, 0x62, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x68, 0x69, 0x64, 0x65, + 0x43, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x49, 0x6e, 0x4d, 0x65, 0x6e, 0x75, 0x42, 0x0a, + 0x0a, 0x08, 0x5f, 0x68, 0x69, 0x64, 0x65, 0x54, 0x61, 0x62, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x68, + 0x69, 0x64, 0x65, 0x4d, 0x65, 0x6e, 0x75, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x69, 0x73, 0x4c, 0x69, + 0x6e, 0x6b, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x68, 0x69, 0x64, 0x65, 0x50, 0x61, 0x74, 0x68, 0x46, + 0x6f, 0x72, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x63, + 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4d, 0x65, 0x6e, 0x75, + 0x22, 0x88, 0x03, 0x0a, 0x09, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x17, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x88, + 0x01, 0x01, 0x12, 0x17, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x02, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x09, 0x63, + 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x03, + 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x88, 0x01, 0x01, 0x12, 0x1f, + 0x0a, 0x08, 0x72, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x04, 0x52, 0x08, 0x72, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x88, 0x01, 0x01, 0x12, + 0x29, 0x0a, 0x0d, 0x63, 0x61, 0x73, 0x65, 0x53, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x48, 0x05, 0x52, 0x0d, 0x63, 0x61, 0x73, 0x65, 0x53, 0x65, + 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x88, 0x01, 0x01, 0x12, 0x34, 0x0a, 0x04, 0x6d, 0x65, + 0x74, 0x61, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x75, 0x74, + 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x06, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x88, 0x01, 0x01, + 0x12, 0x37, 0x0a, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x18, 0x08, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, + 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x42, 0x07, 0x0a, 0x05, + 0x5f, 0x70, 0x61, 0x74, 0x68, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, + 0x65, 0x6e, 0x74, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x72, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, + 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x63, 0x61, 0x73, 0x65, 0x53, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, + 0x76, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x46, 0x0a, 0x11, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x31, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1b, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, + 0x65, 0x6d, 0x73, 0x22, 0x32, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x6d, 0x69, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x32, 0xad, 0x02, 0x0a, 0x0d, 0x52, 0x6f, 0x75, 0x74, + 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x81, 0x01, 0x0a, 0x09, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, + 0x23, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, 0xba, 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, + 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, + 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x61, 0x64, + 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x73, 0x12, 0x97, 0x01, + 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x2c, 0x2e, 0x61, + 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, + 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0xba, 0x47, 0x1c, 0x5a, + 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, + 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x16, 0x12, 0x14, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, 0x72, + 0x6d, 0x2d, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x42, 0xc4, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, + 0x42, 0x0c, 0x49, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x3c, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x6d, 0x6f, 0x6e, 0x6f, 0x6c, 0x69, 0x74, + 0x68, 0x69, 0x63, 0x2d, 0x64, 0x65, 0x6d, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x67, 0x6f, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x76, 0x31, 0xa2, 0x02, + 0x03, 0x41, 0x53, 0x58, 0xaa, 0x02, 0x10, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x5c, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x41, 0x64, 0x6d, + 0x69, 0x6e, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x41, 0x64, 0x6d, 0x69, + 0x6e, 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_admin_service_v1_i_router_proto_rawDescOnce sync.Once + file_admin_service_v1_i_router_proto_rawDescData = file_admin_service_v1_i_router_proto_rawDesc +) + +func file_admin_service_v1_i_router_proto_rawDescGZIP() []byte { + file_admin_service_v1_i_router_proto_rawDescOnce.Do(func() { + file_admin_service_v1_i_router_proto_rawDescData = protoimpl.X.CompressGZIP(file_admin_service_v1_i_router_proto_rawDescData) + }) + return file_admin_service_v1_i_router_proto_rawDescData +} + +var file_admin_service_v1_i_router_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_admin_service_v1_i_router_proto_goTypes = []interface{}{ + (*RouteMeta)(nil), // 0: admin.service.v1.RouteMeta + (*RouteItem)(nil), // 1: admin.service.v1.RouteItem + (*ListRouteResponse)(nil), // 2: admin.service.v1.ListRouteResponse + (*ListPermissionCodeResponse)(nil), // 3: admin.service.v1.ListPermissionCodeResponse + (*emptypb.Empty)(nil), // 4: google.protobuf.Empty +} +var file_admin_service_v1_i_router_proto_depIdxs = []int32{ + 0, // 0: admin.service.v1.RouteItem.meta:type_name -> admin.service.v1.RouteMeta + 1, // 1: admin.service.v1.RouteItem.children:type_name -> admin.service.v1.RouteItem + 1, // 2: admin.service.v1.ListRouteResponse.items:type_name -> admin.service.v1.RouteItem + 4, // 3: admin.service.v1.RouterService.ListRoute:input_type -> google.protobuf.Empty + 4, // 4: admin.service.v1.RouterService.ListPermissionCode:input_type -> google.protobuf.Empty + 2, // 5: admin.service.v1.RouterService.ListRoute:output_type -> admin.service.v1.ListRouteResponse + 3, // 6: admin.service.v1.RouterService.ListPermissionCode:output_type -> admin.service.v1.ListPermissionCodeResponse + 5, // [5:7] is the sub-list for method output_type + 3, // [3:5] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_admin_service_v1_i_router_proto_init() } +func file_admin_service_v1_i_router_proto_init() { + if File_admin_service_v1_i_router_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_admin_service_v1_i_router_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RouteMeta); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_service_v1_i_router_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RouteItem); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_service_v1_i_router_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRouteResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_service_v1_i_router_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListPermissionCodeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_admin_service_v1_i_router_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_admin_service_v1_i_router_proto_msgTypes[1].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_admin_service_v1_i_router_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_admin_service_v1_i_router_proto_goTypes, + DependencyIndexes: file_admin_service_v1_i_router_proto_depIdxs, + MessageInfos: file_admin_service_v1_i_router_proto_msgTypes, + }.Build() + File_admin_service_v1_i_router_proto = out.File + file_admin_service_v1_i_router_proto_rawDesc = nil + file_admin_service_v1_i_router_proto_goTypes = nil + file_admin_service_v1_i_router_proto_depIdxs = nil +} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_router.pb.validate.go b/monolithic/backend/gen/api/go/admin/service/v1/i_router.pb.validate.go new file mode 100644 index 0000000..13bb840 --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_router.pb.validate.go @@ -0,0 +1,643 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: admin/service/v1/i_router.proto + +package servicev1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on RouteMeta with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *RouteMeta) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on RouteMeta with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in RouteMetaMultiError, or nil +// if none found. +func (m *RouteMeta) ValidateAll() error { + return m.validate(true) +} + +func (m *RouteMeta) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if m.OrderNo != nil { + // no validation rules for OrderNo + } + + if m.Title != nil { + // no validation rules for Title + } + + if m.DynamicLevel != nil { + // no validation rules for DynamicLevel + } + + if m.RealPath != nil { + // no validation rules for RealPath + } + + if m.Icon != nil { + // no validation rules for Icon + } + + if m.FrameSrc != nil { + // no validation rules for FrameSrc + } + + if m.TransitionName != nil { + // no validation rules for TransitionName + } + + if m.Affix != nil { + // no validation rules for Affix + } + + if m.CarryParam != nil { + // no validation rules for CarryParam + } + + if m.Single != nil { + // no validation rules for Single + } + + if m.IgnoreAuth != nil { + // no validation rules for IgnoreAuth + } + + if m.IgnoreKeepAlive != nil { + // no validation rules for IgnoreKeepAlive + } + + if m.IgnoreRoute != nil { + // no validation rules for IgnoreRoute + } + + if m.HideBreadcrumb != nil { + // no validation rules for HideBreadcrumb + } + + if m.HideChildrenInMenu != nil { + // no validation rules for HideChildrenInMenu + } + + if m.HideTab != nil { + // no validation rules for HideTab + } + + if m.HideMenu != nil { + // no validation rules for HideMenu + } + + if m.IsLink != nil { + // no validation rules for IsLink + } + + if m.HidePathForChildren != nil { + // no validation rules for HidePathForChildren + } + + if m.CurrentActiveMenu != nil { + // no validation rules for CurrentActiveMenu + } + + if len(errors) > 0 { + return RouteMetaMultiError(errors) + } + + return nil +} + +// RouteMetaMultiError is an error wrapping multiple validation errors returned +// by RouteMeta.ValidateAll() if the designated constraints aren't met. +type RouteMetaMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m RouteMetaMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m RouteMetaMultiError) AllErrors() []error { return m } + +// RouteMetaValidationError is the validation error returned by +// RouteMeta.Validate if the designated constraints aren't met. +type RouteMetaValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RouteMetaValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RouteMetaValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RouteMetaValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RouteMetaValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RouteMetaValidationError) ErrorName() string { return "RouteMetaValidationError" } + +// Error satisfies the builtin error interface +func (e RouteMetaValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRouteMeta.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RouteMetaValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RouteMetaValidationError{} + +// Validate checks the field values on RouteItem with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *RouteItem) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on RouteItem with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in RouteItemMultiError, or nil +// if none found. +func (m *RouteItem) ValidateAll() error { + return m.validate(true) +} + +func (m *RouteItem) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + for idx, item := range m.GetChildren() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RouteItemValidationError{ + field: fmt.Sprintf("Children[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RouteItemValidationError{ + field: fmt.Sprintf("Children[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteItemValidationError{ + field: fmt.Sprintf("Children[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if m.Name != nil { + // no validation rules for Name + } + + if m.Alias != nil { + // no validation rules for Alias + } + + if m.Path != nil { + // no validation rules for Path + } + + if m.Component != nil { + // no validation rules for Component + } + + if m.Redirect != nil { + // no validation rules for Redirect + } + + if m.CaseSensitive != nil { + // no validation rules for CaseSensitive + } + + if m.Meta != nil { + + if all { + switch v := interface{}(m.GetMeta()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RouteItemValidationError{ + field: "Meta", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RouteItemValidationError{ + field: "Meta", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMeta()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteItemValidationError{ + field: "Meta", + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return RouteItemMultiError(errors) + } + + return nil +} + +// RouteItemMultiError is an error wrapping multiple validation errors returned +// by RouteItem.ValidateAll() if the designated constraints aren't met. +type RouteItemMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m RouteItemMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m RouteItemMultiError) AllErrors() []error { return m } + +// RouteItemValidationError is the validation error returned by +// RouteItem.Validate if the designated constraints aren't met. +type RouteItemValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RouteItemValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RouteItemValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RouteItemValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RouteItemValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RouteItemValidationError) ErrorName() string { return "RouteItemValidationError" } + +// Error satisfies the builtin error interface +func (e RouteItemValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRouteItem.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RouteItemValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RouteItemValidationError{} + +// Validate checks the field values on ListRouteResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *ListRouteResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ListRouteResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ListRouteResponseMultiError, or nil if none found. +func (m *ListRouteResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *ListRouteResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + for idx, item := range m.GetItems() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ListRouteResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ListRouteResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ListRouteResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return ListRouteResponseMultiError(errors) + } + + return nil +} + +// ListRouteResponseMultiError is an error wrapping multiple validation errors +// returned by ListRouteResponse.ValidateAll() if the designated constraints +// aren't met. +type ListRouteResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ListRouteResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ListRouteResponseMultiError) AllErrors() []error { return m } + +// ListRouteResponseValidationError is the validation error returned by +// ListRouteResponse.Validate if the designated constraints aren't met. +type ListRouteResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ListRouteResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ListRouteResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ListRouteResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ListRouteResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ListRouteResponseValidationError) ErrorName() string { + return "ListRouteResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e ListRouteResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sListRouteResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ListRouteResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ListRouteResponseValidationError{} + +// Validate checks the field values on ListPermissionCodeResponse with the +// rules defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *ListPermissionCodeResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ListPermissionCodeResponse with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ListPermissionCodeResponseMultiError, or nil if none found. +func (m *ListPermissionCodeResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *ListPermissionCodeResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return ListPermissionCodeResponseMultiError(errors) + } + + return nil +} + +// ListPermissionCodeResponseMultiError is an error wrapping multiple +// validation errors returned by ListPermissionCodeResponse.ValidateAll() if +// the designated constraints aren't met. +type ListPermissionCodeResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ListPermissionCodeResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ListPermissionCodeResponseMultiError) AllErrors() []error { return m } + +// ListPermissionCodeResponseValidationError is the validation error returned +// by ListPermissionCodeResponse.Validate if the designated constraints aren't met. +type ListPermissionCodeResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ListPermissionCodeResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ListPermissionCodeResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ListPermissionCodeResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ListPermissionCodeResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ListPermissionCodeResponseValidationError) ErrorName() string { + return "ListPermissionCodeResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e ListPermissionCodeResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sListPermissionCodeResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ListPermissionCodeResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ListPermissionCodeResponseValidationError{} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_router_grpc.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/i_router_grpc.pb.go new file mode 100644 index 0000000..80a10ca --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_router_grpc.pb.go @@ -0,0 +1,151 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: admin/service/v1/i_router.proto + +package servicev1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + RouterService_ListRoute_FullMethodName = "/admin.service.v1.RouterService/ListRoute" + RouterService_ListPermissionCode_FullMethodName = "/admin.service.v1.RouterService/ListPermissionCode" +) + +// RouterServiceClient is the client API for RouterService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type RouterServiceClient interface { + // 查询路由列表 + ListRoute(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListRouteResponse, error) + // 查询权限码列表 + ListPermissionCode(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListPermissionCodeResponse, error) +} + +type routerServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewRouterServiceClient(cc grpc.ClientConnInterface) RouterServiceClient { + return &routerServiceClient{cc} +} + +func (c *routerServiceClient) ListRoute(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListRouteResponse, error) { + out := new(ListRouteResponse) + err := c.cc.Invoke(ctx, RouterService_ListRoute_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *routerServiceClient) ListPermissionCode(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListPermissionCodeResponse, error) { + out := new(ListPermissionCodeResponse) + err := c.cc.Invoke(ctx, RouterService_ListPermissionCode_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// RouterServiceServer is the server API for RouterService service. +// All implementations must embed UnimplementedRouterServiceServer +// for forward compatibility +type RouterServiceServer interface { + // 查询路由列表 + ListRoute(context.Context, *emptypb.Empty) (*ListRouteResponse, error) + // 查询权限码列表 + ListPermissionCode(context.Context, *emptypb.Empty) (*ListPermissionCodeResponse, error) + mustEmbedUnimplementedRouterServiceServer() +} + +// UnimplementedRouterServiceServer must be embedded to have forward compatible implementations. +type UnimplementedRouterServiceServer struct { +} + +func (UnimplementedRouterServiceServer) ListRoute(context.Context, *emptypb.Empty) (*ListRouteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListRoute not implemented") +} +func (UnimplementedRouterServiceServer) ListPermissionCode(context.Context, *emptypb.Empty) (*ListPermissionCodeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListPermissionCode not implemented") +} +func (UnimplementedRouterServiceServer) mustEmbedUnimplementedRouterServiceServer() {} + +// UnsafeRouterServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to RouterServiceServer will +// result in compilation errors. +type UnsafeRouterServiceServer interface { + mustEmbedUnimplementedRouterServiceServer() +} + +func RegisterRouterServiceServer(s grpc.ServiceRegistrar, srv RouterServiceServer) { + s.RegisterService(&RouterService_ServiceDesc, srv) +} + +func _RouterService_ListRoute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RouterServiceServer).ListRoute(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RouterService_ListRoute_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RouterServiceServer).ListRoute(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _RouterService_ListPermissionCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RouterServiceServer).ListPermissionCode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RouterService_ListPermissionCode_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RouterServiceServer).ListPermissionCode(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +// RouterService_ServiceDesc is the grpc.ServiceDesc for RouterService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var RouterService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "admin.service.v1.RouterService", + HandlerType: (*RouterServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListRoute", + Handler: _RouterService_ListRoute_Handler, + }, + { + MethodName: "ListPermissionCode", + Handler: _RouterService_ListPermissionCode_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "admin/service/v1/i_router.proto", +} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_router_http.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/i_router_http.pb.go new file mode 100644 index 0000000..16298e2 --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_router_http.pb.go @@ -0,0 +1,114 @@ +// Code generated by protoc-gen-go-http. DO NOT EDIT. +// versions: +// - protoc-gen-go-http v2.7.1 +// - protoc (unknown) +// source: admin/service/v1/i_router.proto + +package servicev1 + +import ( + context "context" + http "github.com/go-kratos/kratos/v2/transport/http" + binding "github.com/go-kratos/kratos/v2/transport/http/binding" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the kratos package it is being compiled against. +var _ = new(context.Context) +var _ = binding.EncodeURL + +const _ = http.SupportPackageIsVersion1 + +const OperationRouterServiceListPermissionCode = "/admin.service.v1.RouterService/ListPermissionCode" +const OperationRouterServiceListRoute = "/admin.service.v1.RouterService/ListRoute" + +type RouterServiceHTTPServer interface { + // ListPermissionCode 查询权限码列表 + ListPermissionCode(context.Context, *emptypb.Empty) (*ListPermissionCodeResponse, error) + // ListRoute 查询路由列表 + ListRoute(context.Context, *emptypb.Empty) (*ListRouteResponse, error) +} + +func RegisterRouterServiceHTTPServer(s *http.Server, srv RouterServiceHTTPServer) { + r := s.Route("/") + r.GET("/admin/v1/routes", _RouterService_ListRoute0_HTTP_Handler(srv)) + r.GET("/admin/v1/perm-codes", _RouterService_ListPermissionCode0_HTTP_Handler(srv)) +} + +func _RouterService_ListRoute0_HTTP_Handler(srv RouterServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in emptypb.Empty + if err := ctx.BindQuery(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationRouterServiceListRoute) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.ListRoute(ctx, req.(*emptypb.Empty)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*ListRouteResponse) + return ctx.Result(200, reply) + } +} + +func _RouterService_ListPermissionCode0_HTTP_Handler(srv RouterServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in emptypb.Empty + if err := ctx.BindQuery(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationRouterServiceListPermissionCode) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.ListPermissionCode(ctx, req.(*emptypb.Empty)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*ListPermissionCodeResponse) + return ctx.Result(200, reply) + } +} + +type RouterServiceHTTPClient interface { + ListPermissionCode(ctx context.Context, req *emptypb.Empty, opts ...http.CallOption) (rsp *ListPermissionCodeResponse, err error) + ListRoute(ctx context.Context, req *emptypb.Empty, opts ...http.CallOption) (rsp *ListRouteResponse, err error) +} + +type RouterServiceHTTPClientImpl struct { + cc *http.Client +} + +func NewRouterServiceHTTPClient(client *http.Client) RouterServiceHTTPClient { + return &RouterServiceHTTPClientImpl{client} +} + +func (c *RouterServiceHTTPClientImpl) ListPermissionCode(ctx context.Context, in *emptypb.Empty, opts ...http.CallOption) (*ListPermissionCodeResponse, error) { + var out ListPermissionCodeResponse + pattern := "/admin/v1/perm-codes" + path := binding.EncodeURL(pattern, in, true) + opts = append(opts, http.Operation(OperationRouterServiceListPermissionCode)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *RouterServiceHTTPClientImpl) ListRoute(ctx context.Context, in *emptypb.Empty, opts ...http.CallOption) (*ListRouteResponse, error) { + var out ListRouteResponse + pattern := "/admin/v1/routes" + path := binding.EncodeURL(pattern, in, true) + opts = append(opts, http.Operation(OperationRouterServiceListRoute)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_user.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/i_user.pb.go new file mode 100644 index 0000000..96e06b5 --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_user.pb.go @@ -0,0 +1,152 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: admin/service/v1/i_user.proto + +package servicev1 + +import ( + _ "github.com/google/gnostic/openapiv3" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + v11 "kratos-monolithic-demo/gen/api/go/user/service/v1" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_admin_service_v1_i_user_proto protoreflect.FileDescriptor + +var file_admin_service_v1_i_user_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, + 0x76, 0x31, 0x2f, 0x69, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x10, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, + 0x31, 0x1a, 0x24, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1a, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xb4, + 0x05, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x80, + 0x01, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x19, 0x2e, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0xba, 0x47, 0x1c, 0x5a, 0x1a, + 0x0a, 0x18, 0x0a, 0x14, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, + 0x12, 0x0f, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, + 0x73, 0x12, 0x7e, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, + 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x55, 0x73, 0x65, 0x72, 0x22, 0x3b, 0xba, 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, + 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, + 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x61, 0x64, + 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, + 0x7d, 0x12, 0x86, 0x01, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x12, 0x22, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x3c, 0xba, 0x47, + 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, + 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x17, 0x3a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x0f, 0x2f, 0x61, 0x64, 0x6d, 0x69, + 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x90, 0x01, 0x0a, 0x0a, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x22, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x46, 0xba, 0x47, 0x1c, 0x5a, 0x1a, 0x0a, 0x18, 0x0a, 0x14, + 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x65, + 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x04, 0x75, 0x73, + 0x65, 0x72, 0x1a, 0x19, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, + 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x69, 0x64, 0x7d, 0x12, 0x85, 0x01, + 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x22, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x3b, 0xba, 0x47, 0x1c, 0x5a, 0x1a, 0x0a, + 0x18, 0x0a, 0x14, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, + 0x64, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x2a, + 0x14, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, + 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x42, 0xc2, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x64, + 0x6d, 0x69, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0a, + 0x49, 0x55, 0x73, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x6b, 0x72, + 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x6d, 0x6f, 0x6e, 0x6f, 0x6c, 0x69, 0x74, 0x68, 0x69, 0x63, 0x2d, + 0x64, 0x65, 0x6d, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, + 0x3b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x53, 0x58, + 0xaa, 0x02, 0x10, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x5c, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x5c, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x3a, 0x3a, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var file_admin_service_v1_i_user_proto_goTypes = []interface{}{ + (*v1.PagingRequest)(nil), // 0: pagination.PagingRequest + (*v11.GetUserRequest)(nil), // 1: user.service.v1.GetUserRequest + (*v11.CreateUserRequest)(nil), // 2: user.service.v1.CreateUserRequest + (*v11.UpdateUserRequest)(nil), // 3: user.service.v1.UpdateUserRequest + (*v11.DeleteUserRequest)(nil), // 4: user.service.v1.DeleteUserRequest + (*v11.ListUserResponse)(nil), // 5: user.service.v1.ListUserResponse + (*v11.User)(nil), // 6: user.service.v1.User + (*emptypb.Empty)(nil), // 7: google.protobuf.Empty +} +var file_admin_service_v1_i_user_proto_depIdxs = []int32{ + 0, // 0: admin.service.v1.UserService.ListUser:input_type -> pagination.PagingRequest + 1, // 1: admin.service.v1.UserService.GetUser:input_type -> user.service.v1.GetUserRequest + 2, // 2: admin.service.v1.UserService.CreateUser:input_type -> user.service.v1.CreateUserRequest + 3, // 3: admin.service.v1.UserService.UpdateUser:input_type -> user.service.v1.UpdateUserRequest + 4, // 4: admin.service.v1.UserService.DeleteUser:input_type -> user.service.v1.DeleteUserRequest + 5, // 5: admin.service.v1.UserService.ListUser:output_type -> user.service.v1.ListUserResponse + 6, // 6: admin.service.v1.UserService.GetUser:output_type -> user.service.v1.User + 7, // 7: admin.service.v1.UserService.CreateUser:output_type -> google.protobuf.Empty + 7, // 8: admin.service.v1.UserService.UpdateUser:output_type -> google.protobuf.Empty + 7, // 9: admin.service.v1.UserService.DeleteUser:output_type -> google.protobuf.Empty + 5, // [5:10] is the sub-list for method output_type + 0, // [0:5] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_admin_service_v1_i_user_proto_init() } +func file_admin_service_v1_i_user_proto_init() { + if File_admin_service_v1_i_user_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_admin_service_v1_i_user_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_admin_service_v1_i_user_proto_goTypes, + DependencyIndexes: file_admin_service_v1_i_user_proto_depIdxs, + }.Build() + File_admin_service_v1_i_user_proto = out.File + file_admin_service_v1_i_user_proto_rawDesc = nil + file_admin_service_v1_i_user_proto_goTypes = nil + file_admin_service_v1_i_user_proto_depIdxs = nil +} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_user.pb.validate.go b/monolithic/backend/gen/api/go/admin/service/v1/i_user.pb.validate.go new file mode 100644 index 0000000..a821285 --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_user.pb.validate.go @@ -0,0 +1,36 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: admin/service/v1/i_user.proto + +package servicev1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_user_grpc.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/i_user_grpc.pb.go new file mode 100644 index 0000000..8e84f71 --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_user_grpc.pb.go @@ -0,0 +1,270 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: admin/service/v1/i_user.proto + +package servicev1 + +import ( + context "context" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" + v11 "kratos-monolithic-demo/gen/api/go/user/service/v1" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + UserService_ListUser_FullMethodName = "/admin.service.v1.UserService/ListUser" + UserService_GetUser_FullMethodName = "/admin.service.v1.UserService/GetUser" + UserService_CreateUser_FullMethodName = "/admin.service.v1.UserService/CreateUser" + UserService_UpdateUser_FullMethodName = "/admin.service.v1.UserService/UpdateUser" + UserService_DeleteUser_FullMethodName = "/admin.service.v1.UserService/DeleteUser" +) + +// UserServiceClient is the client API for UserService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type UserServiceClient interface { + // 获取用户列表 + ListUser(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*v11.ListUserResponse, error) + // 获取用户数据 + GetUser(ctx context.Context, in *v11.GetUserRequest, opts ...grpc.CallOption) (*v11.User, error) + // 创建用户 + CreateUser(ctx context.Context, in *v11.CreateUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 更新用户 + UpdateUser(ctx context.Context, in *v11.UpdateUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 删除用户 + DeleteUser(ctx context.Context, in *v11.DeleteUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type userServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient { + return &userServiceClient{cc} +} + +func (c *userServiceClient) ListUser(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*v11.ListUserResponse, error) { + out := new(v11.ListUserResponse) + err := c.cc.Invoke(ctx, UserService_ListUser_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) GetUser(ctx context.Context, in *v11.GetUserRequest, opts ...grpc.CallOption) (*v11.User, error) { + out := new(v11.User) + err := c.cc.Invoke(ctx, UserService_GetUser_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) CreateUser(ctx context.Context, in *v11.CreateUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, UserService_CreateUser_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) UpdateUser(ctx context.Context, in *v11.UpdateUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, UserService_UpdateUser_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) DeleteUser(ctx context.Context, in *v11.DeleteUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, UserService_DeleteUser_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// UserServiceServer is the server API for UserService service. +// All implementations must embed UnimplementedUserServiceServer +// for forward compatibility +type UserServiceServer interface { + // 获取用户列表 + ListUser(context.Context, *v1.PagingRequest) (*v11.ListUserResponse, error) + // 获取用户数据 + GetUser(context.Context, *v11.GetUserRequest) (*v11.User, error) + // 创建用户 + CreateUser(context.Context, *v11.CreateUserRequest) (*emptypb.Empty, error) + // 更新用户 + UpdateUser(context.Context, *v11.UpdateUserRequest) (*emptypb.Empty, error) + // 删除用户 + DeleteUser(context.Context, *v11.DeleteUserRequest) (*emptypb.Empty, error) + mustEmbedUnimplementedUserServiceServer() +} + +// UnimplementedUserServiceServer must be embedded to have forward compatible implementations. +type UnimplementedUserServiceServer struct { +} + +func (UnimplementedUserServiceServer) ListUser(context.Context, *v1.PagingRequest) (*v11.ListUserResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListUser not implemented") +} +func (UnimplementedUserServiceServer) GetUser(context.Context, *v11.GetUserRequest) (*v11.User, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented") +} +func (UnimplementedUserServiceServer) CreateUser(context.Context, *v11.CreateUserRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateUser not implemented") +} +func (UnimplementedUserServiceServer) UpdateUser(context.Context, *v11.UpdateUserRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateUser not implemented") +} +func (UnimplementedUserServiceServer) DeleteUser(context.Context, *v11.DeleteUserRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteUser not implemented") +} +func (UnimplementedUserServiceServer) mustEmbedUnimplementedUserServiceServer() {} + +// UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to UserServiceServer will +// result in compilation errors. +type UnsafeUserServiceServer interface { + mustEmbedUnimplementedUserServiceServer() +} + +func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer) { + s.RegisterService(&UserService_ServiceDesc, srv) +} + +func _UserService_ListUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v1.PagingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).ListUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_ListUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).ListUser(ctx, req.(*v1.PagingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v11.GetUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).GetUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_GetUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).GetUser(ctx, req.(*v11.GetUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v11.CreateUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).CreateUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_CreateUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).CreateUser(ctx, req.(*v11.CreateUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_UpdateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v11.UpdateUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).UpdateUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_UpdateUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).UpdateUser(ctx, req.(*v11.UpdateUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_DeleteUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v11.DeleteUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).DeleteUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_DeleteUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).DeleteUser(ctx, req.(*v11.DeleteUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// UserService_ServiceDesc is the grpc.ServiceDesc for UserService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var UserService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "admin.service.v1.UserService", + HandlerType: (*UserServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListUser", + Handler: _UserService_ListUser_Handler, + }, + { + MethodName: "GetUser", + Handler: _UserService_GetUser_Handler, + }, + { + MethodName: "CreateUser", + Handler: _UserService_CreateUser_Handler, + }, + { + MethodName: "UpdateUser", + Handler: _UserService_UpdateUser_Handler, + }, + { + MethodName: "DeleteUser", + Handler: _UserService_DeleteUser_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "admin/service/v1/i_user.proto", +} diff --git a/monolithic/backend/gen/api/go/admin/service/v1/i_user_http.pb.go b/monolithic/backend/gen/api/go/admin/service/v1/i_user_http.pb.go new file mode 100644 index 0000000..b5b7bc0 --- /dev/null +++ b/monolithic/backend/gen/api/go/admin/service/v1/i_user_http.pb.go @@ -0,0 +1,242 @@ +// Code generated by protoc-gen-go-http. DO NOT EDIT. +// versions: +// - protoc-gen-go-http v2.7.1 +// - protoc (unknown) +// source: admin/service/v1/i_user.proto + +package servicev1 + +import ( + context "context" + http "github.com/go-kratos/kratos/v2/transport/http" + binding "github.com/go-kratos/kratos/v2/transport/http/binding" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + emptypb "google.golang.org/protobuf/types/known/emptypb" + v11 "kratos-monolithic-demo/gen/api/go/user/service/v1" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the kratos package it is being compiled against. +var _ = new(context.Context) +var _ = binding.EncodeURL + +const _ = http.SupportPackageIsVersion1 + +const OperationUserServiceCreateUser = "/admin.service.v1.UserService/CreateUser" +const OperationUserServiceDeleteUser = "/admin.service.v1.UserService/DeleteUser" +const OperationUserServiceGetUser = "/admin.service.v1.UserService/GetUser" +const OperationUserServiceListUser = "/admin.service.v1.UserService/ListUser" +const OperationUserServiceUpdateUser = "/admin.service.v1.UserService/UpdateUser" + +type UserServiceHTTPServer interface { + // CreateUser 创建用户 + CreateUser(context.Context, *v11.CreateUserRequest) (*emptypb.Empty, error) + // DeleteUser 删除用户 + DeleteUser(context.Context, *v11.DeleteUserRequest) (*emptypb.Empty, error) + // GetUser 获取用户数据 + GetUser(context.Context, *v11.GetUserRequest) (*v11.User, error) + // ListUser 获取用户列表 + ListUser(context.Context, *v1.PagingRequest) (*v11.ListUserResponse, error) + // UpdateUser 更新用户 + UpdateUser(context.Context, *v11.UpdateUserRequest) (*emptypb.Empty, error) +} + +func RegisterUserServiceHTTPServer(s *http.Server, srv UserServiceHTTPServer) { + r := s.Route("/") + r.GET("/admin/v1/users", _UserService_ListUser0_HTTP_Handler(srv)) + r.GET("/admin/v1/users/{id}", _UserService_GetUser0_HTTP_Handler(srv)) + r.POST("/admin/v1/users", _UserService_CreateUser0_HTTP_Handler(srv)) + r.PUT("/admin/v1/users/{user.id}", _UserService_UpdateUser0_HTTP_Handler(srv)) + r.DELETE("/admin/v1/users/{id}", _UserService_DeleteUser0_HTTP_Handler(srv)) +} + +func _UserService_ListUser0_HTTP_Handler(srv UserServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v1.PagingRequest + if err := ctx.BindQuery(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationUserServiceListUser) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.ListUser(ctx, req.(*v1.PagingRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*v11.ListUserResponse) + return ctx.Result(200, reply) + } +} + +func _UserService_GetUser0_HTTP_Handler(srv UserServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v11.GetUserRequest + if err := ctx.BindQuery(&in); err != nil { + return err + } + if err := ctx.BindVars(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationUserServiceGetUser) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.GetUser(ctx, req.(*v11.GetUserRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*v11.User) + return ctx.Result(200, reply) + } +} + +func _UserService_CreateUser0_HTTP_Handler(srv UserServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v11.CreateUserRequest + if err := ctx.Bind(&in.User); err != nil { + return err + } + if err := ctx.BindQuery(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationUserServiceCreateUser) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.CreateUser(ctx, req.(*v11.CreateUserRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*emptypb.Empty) + return ctx.Result(200, reply) + } +} + +func _UserService_UpdateUser0_HTTP_Handler(srv UserServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v11.UpdateUserRequest + if err := ctx.Bind(&in.User); err != nil { + return err + } + if err := ctx.BindQuery(&in); err != nil { + return err + } + if err := ctx.BindVars(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationUserServiceUpdateUser) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.UpdateUser(ctx, req.(*v11.UpdateUserRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*emptypb.Empty) + return ctx.Result(200, reply) + } +} + +func _UserService_DeleteUser0_HTTP_Handler(srv UserServiceHTTPServer) func(ctx http.Context) error { + return func(ctx http.Context) error { + var in v11.DeleteUserRequest + if err := ctx.BindQuery(&in); err != nil { + return err + } + if err := ctx.BindVars(&in); err != nil { + return err + } + http.SetOperation(ctx, OperationUserServiceDeleteUser) + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.DeleteUser(ctx, req.(*v11.DeleteUserRequest)) + }) + out, err := h(ctx, &in) + if err != nil { + return err + } + reply := out.(*emptypb.Empty) + return ctx.Result(200, reply) + } +} + +type UserServiceHTTPClient interface { + CreateUser(ctx context.Context, req *v11.CreateUserRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error) + DeleteUser(ctx context.Context, req *v11.DeleteUserRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error) + GetUser(ctx context.Context, req *v11.GetUserRequest, opts ...http.CallOption) (rsp *v11.User, err error) + ListUser(ctx context.Context, req *v1.PagingRequest, opts ...http.CallOption) (rsp *v11.ListUserResponse, err error) + UpdateUser(ctx context.Context, req *v11.UpdateUserRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error) +} + +type UserServiceHTTPClientImpl struct { + cc *http.Client +} + +func NewUserServiceHTTPClient(client *http.Client) UserServiceHTTPClient { + return &UserServiceHTTPClientImpl{client} +} + +func (c *UserServiceHTTPClientImpl) CreateUser(ctx context.Context, in *v11.CreateUserRequest, opts ...http.CallOption) (*emptypb.Empty, error) { + var out emptypb.Empty + pattern := "/admin/v1/users" + path := binding.EncodeURL(pattern, in, false) + opts = append(opts, http.Operation(OperationUserServiceCreateUser)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "POST", path, in.User, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *UserServiceHTTPClientImpl) DeleteUser(ctx context.Context, in *v11.DeleteUserRequest, opts ...http.CallOption) (*emptypb.Empty, error) { + var out emptypb.Empty + pattern := "/admin/v1/users/{id}" + path := binding.EncodeURL(pattern, in, true) + opts = append(opts, http.Operation(OperationUserServiceDeleteUser)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "DELETE", path, nil, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *UserServiceHTTPClientImpl) GetUser(ctx context.Context, in *v11.GetUserRequest, opts ...http.CallOption) (*v11.User, error) { + var out v11.User + pattern := "/admin/v1/users/{id}" + path := binding.EncodeURL(pattern, in, true) + opts = append(opts, http.Operation(OperationUserServiceGetUser)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *UserServiceHTTPClientImpl) ListUser(ctx context.Context, in *v1.PagingRequest, opts ...http.CallOption) (*v11.ListUserResponse, error) { + var out v11.ListUserResponse + pattern := "/admin/v1/users" + path := binding.EncodeURL(pattern, in, true) + opts = append(opts, http.Operation(OperationUserServiceListUser)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} + +func (c *UserServiceHTTPClientImpl) UpdateUser(ctx context.Context, in *v11.UpdateUserRequest, opts ...http.CallOption) (*emptypb.Empty, error) { + var out emptypb.Empty + pattern := "/admin/v1/users/{user.id}" + path := binding.EncodeURL(pattern, in, false) + opts = append(opts, http.Operation(OperationUserServiceUpdateUser)) + opts = append(opts, http.PathTemplate(pattern)) + err := c.cc.Invoke(ctx, "PUT", path, in.User, &out, opts...) + if err != nil { + return nil, err + } + return &out, err +} diff --git a/monolithic/backend/gen/api/go/file/service/v1/attachment.pb.go b/monolithic/backend/gen/api/go/file/service/v1/attachment.pb.go new file mode 100644 index 0000000..602bc1e --- /dev/null +++ b/monolithic/backend/gen/api/go/file/service/v1/attachment.pb.go @@ -0,0 +1,726 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: file/service/v1/attachment.proto + +package servicev1 + +import ( + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 附件 +type Attachment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name *string `protobuf:"bytes,2,opt,name=name,proto3,oneof" json:"name,omitempty"` + Path *string `protobuf:"bytes,3,opt,name=path,proto3,oneof" json:"path,omitempty"` + FileKey *string `protobuf:"bytes,4,opt,name=fileKey,proto3,oneof" json:"fileKey,omitempty"` + ThumbPath *string `protobuf:"bytes,5,opt,name=thumbPath,proto3,oneof" json:"thumbPath,omitempty"` + MediaType *string `protobuf:"bytes,6,opt,name=mediaType,proto3,oneof" json:"mediaType,omitempty"` + Suffix *string `protobuf:"bytes,7,opt,name=suffix,proto3,oneof" json:"suffix,omitempty"` + Width *int32 `protobuf:"varint,8,opt,name=width,proto3,oneof" json:"width,omitempty"` + Height *int32 `protobuf:"varint,9,opt,name=height,proto3,oneof" json:"height,omitempty"` + Size *uint64 `protobuf:"varint,10,opt,name=size,proto3,oneof" json:"size,omitempty"` + Type *int32 `protobuf:"varint,11,opt,name=type,proto3,oneof" json:"type,omitempty"` + CreateTime *string `protobuf:"bytes,12,opt,name=createTime,proto3,oneof" json:"createTime,omitempty"` + UpdateTime *string `protobuf:"bytes,13,opt,name=updateTime,proto3,oneof" json:"updateTime,omitempty"` + DeleteTime *string `protobuf:"bytes,14,opt,name=deleteTime,proto3,oneof" json:"deleteTime,omitempty"` +} + +func (x *Attachment) Reset() { + *x = Attachment{} + if protoimpl.UnsafeEnabled { + mi := &file_file_service_v1_attachment_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Attachment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Attachment) ProtoMessage() {} + +func (x *Attachment) ProtoReflect() protoreflect.Message { + mi := &file_file_service_v1_attachment_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Attachment.ProtoReflect.Descriptor instead. +func (*Attachment) Descriptor() ([]byte, []int) { + return file_file_service_v1_attachment_proto_rawDescGZIP(), []int{0} +} + +func (x *Attachment) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Attachment) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +func (x *Attachment) GetPath() string { + if x != nil && x.Path != nil { + return *x.Path + } + return "" +} + +func (x *Attachment) GetFileKey() string { + if x != nil && x.FileKey != nil { + return *x.FileKey + } + return "" +} + +func (x *Attachment) GetThumbPath() string { + if x != nil && x.ThumbPath != nil { + return *x.ThumbPath + } + return "" +} + +func (x *Attachment) GetMediaType() string { + if x != nil && x.MediaType != nil { + return *x.MediaType + } + return "" +} + +func (x *Attachment) GetSuffix() string { + if x != nil && x.Suffix != nil { + return *x.Suffix + } + return "" +} + +func (x *Attachment) GetWidth() int32 { + if x != nil && x.Width != nil { + return *x.Width + } + return 0 +} + +func (x *Attachment) GetHeight() int32 { + if x != nil && x.Height != nil { + return *x.Height + } + return 0 +} + +func (x *Attachment) GetSize() uint64 { + if x != nil && x.Size != nil { + return *x.Size + } + return 0 +} + +func (x *Attachment) GetType() int32 { + if x != nil && x.Type != nil { + return *x.Type + } + return 0 +} + +func (x *Attachment) GetCreateTime() string { + if x != nil && x.CreateTime != nil { + return *x.CreateTime + } + return "" +} + +func (x *Attachment) GetUpdateTime() string { + if x != nil && x.UpdateTime != nil { + return *x.UpdateTime + } + return "" +} + +func (x *Attachment) GetDeleteTime() string { + if x != nil && x.DeleteTime != nil { + return *x.DeleteTime + } + return "" +} + +// 附件列表 - 回应 +type ListAttachmentResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Items []*Attachment `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` + Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` +} + +func (x *ListAttachmentResponse) Reset() { + *x = ListAttachmentResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_file_service_v1_attachment_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListAttachmentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAttachmentResponse) ProtoMessage() {} + +func (x *ListAttachmentResponse) ProtoReflect() protoreflect.Message { + mi := &file_file_service_v1_attachment_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAttachmentResponse.ProtoReflect.Descriptor instead. +func (*ListAttachmentResponse) Descriptor() ([]byte, []int) { + return file_file_service_v1_attachment_proto_rawDescGZIP(), []int{1} +} + +func (x *ListAttachmentResponse) GetItems() []*Attachment { + if x != nil { + return x.Items + } + return nil +} + +func (x *ListAttachmentResponse) GetTotal() int32 { + if x != nil { + return x.Total + } + return 0 +} + +// 附件数据 - 请求 +type GetAttachmentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GetAttachmentRequest) Reset() { + *x = GetAttachmentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_file_service_v1_attachment_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAttachmentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAttachmentRequest) ProtoMessage() {} + +func (x *GetAttachmentRequest) ProtoReflect() protoreflect.Message { + mi := &file_file_service_v1_attachment_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAttachmentRequest.ProtoReflect.Descriptor instead. +func (*GetAttachmentRequest) Descriptor() ([]byte, []int) { + return file_file_service_v1_attachment_proto_rawDescGZIP(), []int{2} +} + +func (x *GetAttachmentRequest) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +// 创建附件 - 请求 +type CreateAttachmentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Attachment *Attachment `protobuf:"bytes,1,opt,name=attachment,proto3" json:"attachment,omitempty"` + OperatorId *uint32 `protobuf:"varint,2,opt,name=operatorId,proto3,oneof" json:"operatorId,omitempty"` +} + +func (x *CreateAttachmentRequest) Reset() { + *x = CreateAttachmentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_file_service_v1_attachment_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateAttachmentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateAttachmentRequest) ProtoMessage() {} + +func (x *CreateAttachmentRequest) ProtoReflect() protoreflect.Message { + mi := &file_file_service_v1_attachment_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateAttachmentRequest.ProtoReflect.Descriptor instead. +func (*CreateAttachmentRequest) Descriptor() ([]byte, []int) { + return file_file_service_v1_attachment_proto_rawDescGZIP(), []int{3} +} + +func (x *CreateAttachmentRequest) GetAttachment() *Attachment { + if x != nil { + return x.Attachment + } + return nil +} + +func (x *CreateAttachmentRequest) GetOperatorId() uint32 { + if x != nil && x.OperatorId != nil { + return *x.OperatorId + } + return 0 +} + +// 更新附件 - 请求 +type UpdateAttachmentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Attachment *Attachment `protobuf:"bytes,2,opt,name=attachment,proto3" json:"attachment,omitempty"` + OperatorId *uint32 `protobuf:"varint,3,opt,name=operatorId,proto3,oneof" json:"operatorId,omitempty"` +} + +func (x *UpdateAttachmentRequest) Reset() { + *x = UpdateAttachmentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_file_service_v1_attachment_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateAttachmentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateAttachmentRequest) ProtoMessage() {} + +func (x *UpdateAttachmentRequest) ProtoReflect() protoreflect.Message { + mi := &file_file_service_v1_attachment_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateAttachmentRequest.ProtoReflect.Descriptor instead. +func (*UpdateAttachmentRequest) Descriptor() ([]byte, []int) { + return file_file_service_v1_attachment_proto_rawDescGZIP(), []int{4} +} + +func (x *UpdateAttachmentRequest) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateAttachmentRequest) GetAttachment() *Attachment { + if x != nil { + return x.Attachment + } + return nil +} + +func (x *UpdateAttachmentRequest) GetOperatorId() uint32 { + if x != nil && x.OperatorId != nil { + return *x.OperatorId + } + return 0 +} + +// 删除附件 - 请求 +type DeleteAttachmentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + OperatorId *uint32 `protobuf:"varint,2,opt,name=operatorId,proto3,oneof" json:"operatorId,omitempty"` +} + +func (x *DeleteAttachmentRequest) Reset() { + *x = DeleteAttachmentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_file_service_v1_attachment_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteAttachmentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteAttachmentRequest) ProtoMessage() {} + +func (x *DeleteAttachmentRequest) ProtoReflect() protoreflect.Message { + mi := &file_file_service_v1_attachment_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteAttachmentRequest.ProtoReflect.Descriptor instead. +func (*DeleteAttachmentRequest) Descriptor() ([]byte, []int) { + return file_file_service_v1_attachment_proto_rawDescGZIP(), []int{5} +} + +func (x *DeleteAttachmentRequest) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *DeleteAttachmentRequest) GetOperatorId() uint32 { + if x != nil && x.OperatorId != nil { + return *x.OperatorId + } + return 0 +} + +var File_file_service_v1_attachment_proto protoreflect.FileDescriptor + +var file_file_service_v1_attachment_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, + 0x31, 0x2f, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x0f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x1e, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0xc2, 0x04, 0x0a, 0x0a, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x17, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x88, 0x01, + 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x65, 0x4b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x48, 0x02, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x65, 0x4b, 0x65, 0x79, 0x88, 0x01, 0x01, + 0x12, 0x21, 0x0a, 0x09, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x50, 0x61, 0x74, 0x68, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, 0x09, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x50, 0x61, 0x74, 0x68, + 0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x09, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x04, 0x52, 0x09, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x54, + 0x79, 0x70, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x06, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x48, 0x05, 0x52, 0x06, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, + 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x05, 0x48, 0x06, 0x52, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x88, 0x01, 0x01, 0x12, 0x1b, + 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x48, 0x07, + 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x88, 0x01, 0x01, 0x12, 0x17, 0x0a, 0x04, 0x73, + 0x69, 0x7a, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x48, 0x08, 0x52, 0x04, 0x73, 0x69, 0x7a, + 0x65, 0x88, 0x01, 0x01, 0x12, 0x17, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x05, 0x48, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, + 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x0a, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, + 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, + 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x48, 0x0b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x48, 0x0c, 0x52, 0x0a, 0x64, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x42, 0x0a, + 0x0a, 0x08, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x4b, 0x65, 0x79, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x74, + 0x68, 0x75, 0x6d, 0x62, 0x50, 0x61, 0x74, 0x68, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x6d, 0x65, 0x64, + 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x73, 0x75, 0x66, 0x66, 0x69, + 0x78, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x77, 0x69, 0x64, 0x74, 0x68, 0x42, 0x09, 0x0a, 0x07, 0x5f, + 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x42, + 0x07, 0x0a, 0x05, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x61, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, + 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x31, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x05, 0x69, 0x74, 0x65, + 0x6d, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x26, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x41, + 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, + 0x22, 0x8a, 0x01, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, + 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3b, 0x0a, 0x0a, + 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, + 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0a, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, + 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0d, + 0x0a, 0x0b, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x9a, 0x01, + 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3b, 0x0a, 0x0a, 0x61, 0x74, 0x74, + 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, + 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, + 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x6f, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0a, 0x6f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, + 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x5d, 0x0a, 0x17, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x23, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, + 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0a, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x6f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x32, 0xca, 0x03, 0x0a, 0x11, 0x41, 0x74, + 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x56, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, + 0x74, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, + 0x61, 0x67, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x66, + 0x69, 0x6c, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x41, 0x74, + 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x74, + 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1b, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x00, 0x12, 0x56, + 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0x28, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, + 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x56, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x28, 0x2e, 0x66, 0x69, 0x6c, + 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x56, + 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0x28, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, + 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x42, 0xc1, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x66, + 0x69, 0x6c, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0f, + 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x3b, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x6d, 0x6f, 0x6e, 0x6f, 0x6c, 0x69, + 0x74, 0x68, 0x69, 0x63, 0x2d, 0x64, 0x65, 0x6d, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x76, 0x31, 0xa2, 0x02, + 0x03, 0x46, 0x53, 0x58, 0xaa, 0x02, 0x0f, 0x46, 0x69, 0x6c, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x46, 0x69, 0x6c, 0x65, 0x5c, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x46, 0x69, 0x6c, 0x65, 0x5c, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x46, 0x69, 0x6c, 0x65, 0x3a, 0x3a, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_file_service_v1_attachment_proto_rawDescOnce sync.Once + file_file_service_v1_attachment_proto_rawDescData = file_file_service_v1_attachment_proto_rawDesc +) + +func file_file_service_v1_attachment_proto_rawDescGZIP() []byte { + file_file_service_v1_attachment_proto_rawDescOnce.Do(func() { + file_file_service_v1_attachment_proto_rawDescData = protoimpl.X.CompressGZIP(file_file_service_v1_attachment_proto_rawDescData) + }) + return file_file_service_v1_attachment_proto_rawDescData +} + +var file_file_service_v1_attachment_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_file_service_v1_attachment_proto_goTypes = []interface{}{ + (*Attachment)(nil), // 0: file.service.v1.Attachment + (*ListAttachmentResponse)(nil), // 1: file.service.v1.ListAttachmentResponse + (*GetAttachmentRequest)(nil), // 2: file.service.v1.GetAttachmentRequest + (*CreateAttachmentRequest)(nil), // 3: file.service.v1.CreateAttachmentRequest + (*UpdateAttachmentRequest)(nil), // 4: file.service.v1.UpdateAttachmentRequest + (*DeleteAttachmentRequest)(nil), // 5: file.service.v1.DeleteAttachmentRequest + (*v1.PagingRequest)(nil), // 6: pagination.PagingRequest + (*emptypb.Empty)(nil), // 7: google.protobuf.Empty +} +var file_file_service_v1_attachment_proto_depIdxs = []int32{ + 0, // 0: file.service.v1.ListAttachmentResponse.items:type_name -> file.service.v1.Attachment + 0, // 1: file.service.v1.CreateAttachmentRequest.attachment:type_name -> file.service.v1.Attachment + 0, // 2: file.service.v1.UpdateAttachmentRequest.attachment:type_name -> file.service.v1.Attachment + 6, // 3: file.service.v1.AttachmentService.ListAttachment:input_type -> pagination.PagingRequest + 2, // 4: file.service.v1.AttachmentService.GetAttachment:input_type -> file.service.v1.GetAttachmentRequest + 3, // 5: file.service.v1.AttachmentService.CreateAttachment:input_type -> file.service.v1.CreateAttachmentRequest + 4, // 6: file.service.v1.AttachmentService.UpdateAttachment:input_type -> file.service.v1.UpdateAttachmentRequest + 5, // 7: file.service.v1.AttachmentService.DeleteAttachment:input_type -> file.service.v1.DeleteAttachmentRequest + 1, // 8: file.service.v1.AttachmentService.ListAttachment:output_type -> file.service.v1.ListAttachmentResponse + 0, // 9: file.service.v1.AttachmentService.GetAttachment:output_type -> file.service.v1.Attachment + 7, // 10: file.service.v1.AttachmentService.CreateAttachment:output_type -> google.protobuf.Empty + 7, // 11: file.service.v1.AttachmentService.UpdateAttachment:output_type -> google.protobuf.Empty + 7, // 12: file.service.v1.AttachmentService.DeleteAttachment:output_type -> google.protobuf.Empty + 8, // [8:13] is the sub-list for method output_type + 3, // [3:8] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_file_service_v1_attachment_proto_init() } +func file_file_service_v1_attachment_proto_init() { + if File_file_service_v1_attachment_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_file_service_v1_attachment_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Attachment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_file_service_v1_attachment_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListAttachmentResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_file_service_v1_attachment_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAttachmentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_file_service_v1_attachment_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateAttachmentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_file_service_v1_attachment_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateAttachmentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_file_service_v1_attachment_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteAttachmentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_file_service_v1_attachment_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_file_service_v1_attachment_proto_msgTypes[3].OneofWrappers = []interface{}{} + file_file_service_v1_attachment_proto_msgTypes[4].OneofWrappers = []interface{}{} + file_file_service_v1_attachment_proto_msgTypes[5].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_file_service_v1_attachment_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_file_service_v1_attachment_proto_goTypes, + DependencyIndexes: file_file_service_v1_attachment_proto_depIdxs, + MessageInfos: file_file_service_v1_attachment_proto_msgTypes, + }.Build() + File_file_service_v1_attachment_proto = out.File + file_file_service_v1_attachment_proto_rawDesc = nil + file_file_service_v1_attachment_proto_goTypes = nil + file_file_service_v1_attachment_proto_depIdxs = nil +} diff --git a/monolithic/backend/gen/api/go/file/service/v1/attachment.pb.validate.go b/monolithic/backend/gen/api/go/file/service/v1/attachment.pb.validate.go new file mode 100644 index 0000000..885c781 --- /dev/null +++ b/monolithic/backend/gen/api/go/file/service/v1/attachment.pb.validate.go @@ -0,0 +1,811 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: file/service/v1/attachment.proto + +package servicev1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on Attachment with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Attachment) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Attachment with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in AttachmentMultiError, or +// nil if none found. +func (m *Attachment) ValidateAll() error { + return m.validate(true) +} + +func (m *Attachment) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if m.Name != nil { + // no validation rules for Name + } + + if m.Path != nil { + // no validation rules for Path + } + + if m.FileKey != nil { + // no validation rules for FileKey + } + + if m.ThumbPath != nil { + // no validation rules for ThumbPath + } + + if m.MediaType != nil { + // no validation rules for MediaType + } + + if m.Suffix != nil { + // no validation rules for Suffix + } + + if m.Width != nil { + // no validation rules for Width + } + + if m.Height != nil { + // no validation rules for Height + } + + if m.Size != nil { + // no validation rules for Size + } + + if m.Type != nil { + // no validation rules for Type + } + + if m.CreateTime != nil { + // no validation rules for CreateTime + } + + if m.UpdateTime != nil { + // no validation rules for UpdateTime + } + + if m.DeleteTime != nil { + // no validation rules for DeleteTime + } + + if len(errors) > 0 { + return AttachmentMultiError(errors) + } + + return nil +} + +// AttachmentMultiError is an error wrapping multiple validation errors +// returned by Attachment.ValidateAll() if the designated constraints aren't met. +type AttachmentMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m AttachmentMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m AttachmentMultiError) AllErrors() []error { return m } + +// AttachmentValidationError is the validation error returned by +// Attachment.Validate if the designated constraints aren't met. +type AttachmentValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e AttachmentValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e AttachmentValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e AttachmentValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e AttachmentValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e AttachmentValidationError) ErrorName() string { return "AttachmentValidationError" } + +// Error satisfies the builtin error interface +func (e AttachmentValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sAttachment.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = AttachmentValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = AttachmentValidationError{} + +// Validate checks the field values on ListAttachmentResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *ListAttachmentResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ListAttachmentResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ListAttachmentResponseMultiError, or nil if none found. +func (m *ListAttachmentResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *ListAttachmentResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + for idx, item := range m.GetItems() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ListAttachmentResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ListAttachmentResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ListAttachmentResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + // no validation rules for Total + + if len(errors) > 0 { + return ListAttachmentResponseMultiError(errors) + } + + return nil +} + +// ListAttachmentResponseMultiError is an error wrapping multiple validation +// errors returned by ListAttachmentResponse.ValidateAll() if the designated +// constraints aren't met. +type ListAttachmentResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ListAttachmentResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ListAttachmentResponseMultiError) AllErrors() []error { return m } + +// ListAttachmentResponseValidationError is the validation error returned by +// ListAttachmentResponse.Validate if the designated constraints aren't met. +type ListAttachmentResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ListAttachmentResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ListAttachmentResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ListAttachmentResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ListAttachmentResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ListAttachmentResponseValidationError) ErrorName() string { + return "ListAttachmentResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e ListAttachmentResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sListAttachmentResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ListAttachmentResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ListAttachmentResponseValidationError{} + +// Validate checks the field values on GetAttachmentRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *GetAttachmentRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetAttachmentRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// GetAttachmentRequestMultiError, or nil if none found. +func (m *GetAttachmentRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *GetAttachmentRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if len(errors) > 0 { + return GetAttachmentRequestMultiError(errors) + } + + return nil +} + +// GetAttachmentRequestMultiError is an error wrapping multiple validation +// errors returned by GetAttachmentRequest.ValidateAll() if the designated +// constraints aren't met. +type GetAttachmentRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetAttachmentRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetAttachmentRequestMultiError) AllErrors() []error { return m } + +// GetAttachmentRequestValidationError is the validation error returned by +// GetAttachmentRequest.Validate if the designated constraints aren't met. +type GetAttachmentRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetAttachmentRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetAttachmentRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetAttachmentRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetAttachmentRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetAttachmentRequestValidationError) ErrorName() string { + return "GetAttachmentRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e GetAttachmentRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetAttachmentRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetAttachmentRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetAttachmentRequestValidationError{} + +// Validate checks the field values on CreateAttachmentRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *CreateAttachmentRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on CreateAttachmentRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// CreateAttachmentRequestMultiError, or nil if none found. +func (m *CreateAttachmentRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *CreateAttachmentRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetAttachment()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CreateAttachmentRequestValidationError{ + field: "Attachment", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CreateAttachmentRequestValidationError{ + field: "Attachment", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetAttachment()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateAttachmentRequestValidationError{ + field: "Attachment", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if m.OperatorId != nil { + // no validation rules for OperatorId + } + + if len(errors) > 0 { + return CreateAttachmentRequestMultiError(errors) + } + + return nil +} + +// CreateAttachmentRequestMultiError is an error wrapping multiple validation +// errors returned by CreateAttachmentRequest.ValidateAll() if the designated +// constraints aren't met. +type CreateAttachmentRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m CreateAttachmentRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m CreateAttachmentRequestMultiError) AllErrors() []error { return m } + +// CreateAttachmentRequestValidationError is the validation error returned by +// CreateAttachmentRequest.Validate if the designated constraints aren't met. +type CreateAttachmentRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CreateAttachmentRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CreateAttachmentRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CreateAttachmentRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CreateAttachmentRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CreateAttachmentRequestValidationError) ErrorName() string { + return "CreateAttachmentRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e CreateAttachmentRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCreateAttachmentRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CreateAttachmentRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CreateAttachmentRequestValidationError{} + +// Validate checks the field values on UpdateAttachmentRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *UpdateAttachmentRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on UpdateAttachmentRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// UpdateAttachmentRequestMultiError, or nil if none found. +func (m *UpdateAttachmentRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *UpdateAttachmentRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if all { + switch v := interface{}(m.GetAttachment()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UpdateAttachmentRequestValidationError{ + field: "Attachment", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UpdateAttachmentRequestValidationError{ + field: "Attachment", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetAttachment()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpdateAttachmentRequestValidationError{ + field: "Attachment", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if m.OperatorId != nil { + // no validation rules for OperatorId + } + + if len(errors) > 0 { + return UpdateAttachmentRequestMultiError(errors) + } + + return nil +} + +// UpdateAttachmentRequestMultiError is an error wrapping multiple validation +// errors returned by UpdateAttachmentRequest.ValidateAll() if the designated +// constraints aren't met. +type UpdateAttachmentRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UpdateAttachmentRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m UpdateAttachmentRequestMultiError) AllErrors() []error { return m } + +// UpdateAttachmentRequestValidationError is the validation error returned by +// UpdateAttachmentRequest.Validate if the designated constraints aren't met. +type UpdateAttachmentRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UpdateAttachmentRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UpdateAttachmentRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UpdateAttachmentRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UpdateAttachmentRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UpdateAttachmentRequestValidationError) ErrorName() string { + return "UpdateAttachmentRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e UpdateAttachmentRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUpdateAttachmentRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UpdateAttachmentRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UpdateAttachmentRequestValidationError{} + +// Validate checks the field values on DeleteAttachmentRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *DeleteAttachmentRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on DeleteAttachmentRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// DeleteAttachmentRequestMultiError, or nil if none found. +func (m *DeleteAttachmentRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *DeleteAttachmentRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if m.OperatorId != nil { + // no validation rules for OperatorId + } + + if len(errors) > 0 { + return DeleteAttachmentRequestMultiError(errors) + } + + return nil +} + +// DeleteAttachmentRequestMultiError is an error wrapping multiple validation +// errors returned by DeleteAttachmentRequest.ValidateAll() if the designated +// constraints aren't met. +type DeleteAttachmentRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m DeleteAttachmentRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m DeleteAttachmentRequestMultiError) AllErrors() []error { return m } + +// DeleteAttachmentRequestValidationError is the validation error returned by +// DeleteAttachmentRequest.Validate if the designated constraints aren't met. +type DeleteAttachmentRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DeleteAttachmentRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DeleteAttachmentRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DeleteAttachmentRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DeleteAttachmentRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DeleteAttachmentRequestValidationError) ErrorName() string { + return "DeleteAttachmentRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e DeleteAttachmentRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDeleteAttachmentRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DeleteAttachmentRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DeleteAttachmentRequestValidationError{} diff --git a/monolithic/backend/gen/api/go/file/service/v1/attachment_grpc.pb.go b/monolithic/backend/gen/api/go/file/service/v1/attachment_grpc.pb.go new file mode 100644 index 0000000..4a84311 --- /dev/null +++ b/monolithic/backend/gen/api/go/file/service/v1/attachment_grpc.pb.go @@ -0,0 +1,269 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: file/service/v1/attachment.proto + +package servicev1 + +import ( + context "context" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + AttachmentService_ListAttachment_FullMethodName = "/file.service.v1.AttachmentService/ListAttachment" + AttachmentService_GetAttachment_FullMethodName = "/file.service.v1.AttachmentService/GetAttachment" + AttachmentService_CreateAttachment_FullMethodName = "/file.service.v1.AttachmentService/CreateAttachment" + AttachmentService_UpdateAttachment_FullMethodName = "/file.service.v1.AttachmentService/UpdateAttachment" + AttachmentService_DeleteAttachment_FullMethodName = "/file.service.v1.AttachmentService/DeleteAttachment" +) + +// AttachmentServiceClient is the client API for AttachmentService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type AttachmentServiceClient interface { + // 获取附件列表 + ListAttachment(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*ListAttachmentResponse, error) + // 获取附件数据 + GetAttachment(ctx context.Context, in *GetAttachmentRequest, opts ...grpc.CallOption) (*Attachment, error) + // 创建附件 + CreateAttachment(ctx context.Context, in *CreateAttachmentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 更新附件 + UpdateAttachment(ctx context.Context, in *UpdateAttachmentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 删除附件 + DeleteAttachment(ctx context.Context, in *DeleteAttachmentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type attachmentServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewAttachmentServiceClient(cc grpc.ClientConnInterface) AttachmentServiceClient { + return &attachmentServiceClient{cc} +} + +func (c *attachmentServiceClient) ListAttachment(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*ListAttachmentResponse, error) { + out := new(ListAttachmentResponse) + err := c.cc.Invoke(ctx, AttachmentService_ListAttachment_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *attachmentServiceClient) GetAttachment(ctx context.Context, in *GetAttachmentRequest, opts ...grpc.CallOption) (*Attachment, error) { + out := new(Attachment) + err := c.cc.Invoke(ctx, AttachmentService_GetAttachment_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *attachmentServiceClient) CreateAttachment(ctx context.Context, in *CreateAttachmentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, AttachmentService_CreateAttachment_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *attachmentServiceClient) UpdateAttachment(ctx context.Context, in *UpdateAttachmentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, AttachmentService_UpdateAttachment_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *attachmentServiceClient) DeleteAttachment(ctx context.Context, in *DeleteAttachmentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, AttachmentService_DeleteAttachment_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AttachmentServiceServer is the server API for AttachmentService service. +// All implementations must embed UnimplementedAttachmentServiceServer +// for forward compatibility +type AttachmentServiceServer interface { + // 获取附件列表 + ListAttachment(context.Context, *v1.PagingRequest) (*ListAttachmentResponse, error) + // 获取附件数据 + GetAttachment(context.Context, *GetAttachmentRequest) (*Attachment, error) + // 创建附件 + CreateAttachment(context.Context, *CreateAttachmentRequest) (*emptypb.Empty, error) + // 更新附件 + UpdateAttachment(context.Context, *UpdateAttachmentRequest) (*emptypb.Empty, error) + // 删除附件 + DeleteAttachment(context.Context, *DeleteAttachmentRequest) (*emptypb.Empty, error) + mustEmbedUnimplementedAttachmentServiceServer() +} + +// UnimplementedAttachmentServiceServer must be embedded to have forward compatible implementations. +type UnimplementedAttachmentServiceServer struct { +} + +func (UnimplementedAttachmentServiceServer) ListAttachment(context.Context, *v1.PagingRequest) (*ListAttachmentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListAttachment not implemented") +} +func (UnimplementedAttachmentServiceServer) GetAttachment(context.Context, *GetAttachmentRequest) (*Attachment, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAttachment not implemented") +} +func (UnimplementedAttachmentServiceServer) CreateAttachment(context.Context, *CreateAttachmentRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateAttachment not implemented") +} +func (UnimplementedAttachmentServiceServer) UpdateAttachment(context.Context, *UpdateAttachmentRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateAttachment not implemented") +} +func (UnimplementedAttachmentServiceServer) DeleteAttachment(context.Context, *DeleteAttachmentRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteAttachment not implemented") +} +func (UnimplementedAttachmentServiceServer) mustEmbedUnimplementedAttachmentServiceServer() {} + +// UnsafeAttachmentServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AttachmentServiceServer will +// result in compilation errors. +type UnsafeAttachmentServiceServer interface { + mustEmbedUnimplementedAttachmentServiceServer() +} + +func RegisterAttachmentServiceServer(s grpc.ServiceRegistrar, srv AttachmentServiceServer) { + s.RegisterService(&AttachmentService_ServiceDesc, srv) +} + +func _AttachmentService_ListAttachment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v1.PagingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AttachmentServiceServer).ListAttachment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AttachmentService_ListAttachment_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AttachmentServiceServer).ListAttachment(ctx, req.(*v1.PagingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AttachmentService_GetAttachment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAttachmentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AttachmentServiceServer).GetAttachment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AttachmentService_GetAttachment_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AttachmentServiceServer).GetAttachment(ctx, req.(*GetAttachmentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AttachmentService_CreateAttachment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateAttachmentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AttachmentServiceServer).CreateAttachment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AttachmentService_CreateAttachment_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AttachmentServiceServer).CreateAttachment(ctx, req.(*CreateAttachmentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AttachmentService_UpdateAttachment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateAttachmentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AttachmentServiceServer).UpdateAttachment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AttachmentService_UpdateAttachment_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AttachmentServiceServer).UpdateAttachment(ctx, req.(*UpdateAttachmentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AttachmentService_DeleteAttachment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteAttachmentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AttachmentServiceServer).DeleteAttachment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AttachmentService_DeleteAttachment_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AttachmentServiceServer).DeleteAttachment(ctx, req.(*DeleteAttachmentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// AttachmentService_ServiceDesc is the grpc.ServiceDesc for AttachmentService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var AttachmentService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "file.service.v1.AttachmentService", + HandlerType: (*AttachmentServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListAttachment", + Handler: _AttachmentService_ListAttachment_Handler, + }, + { + MethodName: "GetAttachment", + Handler: _AttachmentService_GetAttachment_Handler, + }, + { + MethodName: "CreateAttachment", + Handler: _AttachmentService_CreateAttachment_Handler, + }, + { + MethodName: "UpdateAttachment", + Handler: _AttachmentService_UpdateAttachment_Handler, + }, + { + MethodName: "DeleteAttachment", + Handler: _AttachmentService_DeleteAttachment_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "file/service/v1/attachment.proto", +} diff --git a/monolithic/backend/gen/api/go/system/service/v1/dict.pb.go b/monolithic/backend/gen/api/go/system/service/v1/dict.pb.go new file mode 100644 index 0000000..c9cb2d4 --- /dev/null +++ b/monolithic/backend/gen/api/go/system/service/v1/dict.pb.go @@ -0,0 +1,668 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: system/service/v1/dict.proto + +package servicev1 + +import ( + _ "github.com/google/gnostic/openapiv3" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 数据字典 +type Dict struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // ID + Name *string `protobuf:"bytes,2,opt,name=name,proto3,oneof" json:"name,omitempty"` // 字典名称 + Description *string `protobuf:"bytes,3,opt,name=description,proto3,oneof" json:"description,omitempty"` // 描述 + CreatorId *uint32 `protobuf:"varint,10,opt,name=creatorId,proto3,oneof" json:"creatorId,omitempty"` // 创建者ID + CreatorName *uint32 `protobuf:"varint,11,opt,name=creatorName,proto3,oneof" json:"creatorName,omitempty"` // 创建者名字 + CreateTime *string `protobuf:"bytes,20,opt,name=createTime,proto3,oneof" json:"createTime,omitempty"` // 创建时间 + UpdateTime *string `protobuf:"bytes,21,opt,name=updateTime,proto3,oneof" json:"updateTime,omitempty"` // 更新时间 + DeleteTime *string `protobuf:"bytes,22,opt,name=deleteTime,proto3,oneof" json:"deleteTime,omitempty"` // 删除时间 +} + +func (x *Dict) Reset() { + *x = Dict{} + if protoimpl.UnsafeEnabled { + mi := &file_system_service_v1_dict_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Dict) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Dict) ProtoMessage() {} + +func (x *Dict) ProtoReflect() protoreflect.Message { + mi := &file_system_service_v1_dict_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Dict.ProtoReflect.Descriptor instead. +func (*Dict) Descriptor() ([]byte, []int) { + return file_system_service_v1_dict_proto_rawDescGZIP(), []int{0} +} + +func (x *Dict) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Dict) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +func (x *Dict) GetDescription() string { + if x != nil && x.Description != nil { + return *x.Description + } + return "" +} + +func (x *Dict) GetCreatorId() uint32 { + if x != nil && x.CreatorId != nil { + return *x.CreatorId + } + return 0 +} + +func (x *Dict) GetCreatorName() uint32 { + if x != nil && x.CreatorName != nil { + return *x.CreatorName + } + return 0 +} + +func (x *Dict) GetCreateTime() string { + if x != nil && x.CreateTime != nil { + return *x.CreateTime + } + return "" +} + +func (x *Dict) GetUpdateTime() string { + if x != nil && x.UpdateTime != nil { + return *x.UpdateTime + } + return "" +} + +func (x *Dict) GetDeleteTime() string { + if x != nil && x.DeleteTime != nil { + return *x.DeleteTime + } + return "" +} + +// 查询字典列表 - 答复 +type ListDictResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Items []*Dict `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` + Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` +} + +func (x *ListDictResponse) Reset() { + *x = ListDictResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_system_service_v1_dict_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListDictResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListDictResponse) ProtoMessage() {} + +func (x *ListDictResponse) ProtoReflect() protoreflect.Message { + mi := &file_system_service_v1_dict_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListDictResponse.ProtoReflect.Descriptor instead. +func (*ListDictResponse) Descriptor() ([]byte, []int) { + return file_system_service_v1_dict_proto_rawDescGZIP(), []int{1} +} + +func (x *ListDictResponse) GetItems() []*Dict { + if x != nil { + return x.Items + } + return nil +} + +func (x *ListDictResponse) GetTotal() int32 { + if x != nil { + return x.Total + } + return 0 +} + +// 查询字典 - 请求 +type GetDictRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name *string `protobuf:"bytes,2,opt,name=name,proto3,oneof" json:"name,omitempty"` +} + +func (x *GetDictRequest) Reset() { + *x = GetDictRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_system_service_v1_dict_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetDictRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDictRequest) ProtoMessage() {} + +func (x *GetDictRequest) ProtoReflect() protoreflect.Message { + mi := &file_system_service_v1_dict_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetDictRequest.ProtoReflect.Descriptor instead. +func (*GetDictRequest) Descriptor() ([]byte, []int) { + return file_system_service_v1_dict_proto_rawDescGZIP(), []int{2} +} + +func (x *GetDictRequest) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *GetDictRequest) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +// 创建字典 - 请求 +type CreateDictRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Dict *Dict `protobuf:"bytes,1,opt,name=dict,proto3" json:"dict,omitempty"` + OperatorId *uint32 `protobuf:"varint,2,opt,name=operatorId,proto3,oneof" json:"operatorId,omitempty"` +} + +func (x *CreateDictRequest) Reset() { + *x = CreateDictRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_system_service_v1_dict_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateDictRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateDictRequest) ProtoMessage() {} + +func (x *CreateDictRequest) ProtoReflect() protoreflect.Message { + mi := &file_system_service_v1_dict_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateDictRequest.ProtoReflect.Descriptor instead. +func (*CreateDictRequest) Descriptor() ([]byte, []int) { + return file_system_service_v1_dict_proto_rawDescGZIP(), []int{3} +} + +func (x *CreateDictRequest) GetDict() *Dict { + if x != nil { + return x.Dict + } + return nil +} + +func (x *CreateDictRequest) GetOperatorId() uint32 { + if x != nil && x.OperatorId != nil { + return *x.OperatorId + } + return 0 +} + +// 更新字典 - 请求 +type UpdateDictRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Dict *Dict `protobuf:"bytes,1,opt,name=dict,proto3" json:"dict,omitempty"` + OperatorId *uint32 `protobuf:"varint,2,opt,name=operatorId,proto3,oneof" json:"operatorId,omitempty"` +} + +func (x *UpdateDictRequest) Reset() { + *x = UpdateDictRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_system_service_v1_dict_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateDictRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateDictRequest) ProtoMessage() {} + +func (x *UpdateDictRequest) ProtoReflect() protoreflect.Message { + mi := &file_system_service_v1_dict_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateDictRequest.ProtoReflect.Descriptor instead. +func (*UpdateDictRequest) Descriptor() ([]byte, []int) { + return file_system_service_v1_dict_proto_rawDescGZIP(), []int{4} +} + +func (x *UpdateDictRequest) GetDict() *Dict { + if x != nil { + return x.Dict + } + return nil +} + +func (x *UpdateDictRequest) GetOperatorId() uint32 { + if x != nil && x.OperatorId != nil { + return *x.OperatorId + } + return 0 +} + +// 删除字典 - 请求 +type DeleteDictRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + OperatorId *uint32 `protobuf:"varint,2,opt,name=operatorId,proto3,oneof" json:"operatorId,omitempty"` +} + +func (x *DeleteDictRequest) Reset() { + *x = DeleteDictRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_system_service_v1_dict_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteDictRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteDictRequest) ProtoMessage() {} + +func (x *DeleteDictRequest) ProtoReflect() protoreflect.Message { + mi := &file_system_service_v1_dict_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteDictRequest.ProtoReflect.Descriptor instead. +func (*DeleteDictRequest) Descriptor() ([]byte, []int) { + return file_system_service_v1_dict_proto_rawDescGZIP(), []int{5} +} + +func (x *DeleteDictRequest) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *DeleteDictRequest) GetOperatorId() uint32 { + if x != nil && x.OperatorId != nil { + return *x.OperatorId + } + return 0 +} + +var File_system_service_v1_dict_proto protoreflect.FileDescriptor + +var file_system_service_v1_dict_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, + 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, + 0x31, 0x1a, 0x24, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc9, 0x03, 0x0a, 0x04, 0x44, 0x69, 0x63, 0x74, 0x12, 0x18, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x08, 0xba, 0x47, 0x05, 0x92, 0x02, + 0x02, 0x49, 0x44, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x12, 0xba, 0x47, 0x0f, 0x92, 0x02, 0x0c, 0xe5, 0xad, 0x97, + 0xe5, 0x85, 0xb8, 0xe5, 0x90, 0x8d, 0xe7, 0xa7, 0xb0, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0c, 0xba, 0x47, 0x09, 0x92, 0x02, + 0x06, 0xe6, 0x8f, 0x8f, 0xe8, 0xbf, 0xb0, 0x48, 0x01, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x34, 0x0a, 0x09, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x11, 0xba, 0x47, + 0x0e, 0x92, 0x02, 0x0b, 0xe5, 0x88, 0x9b, 0xe5, 0xbb, 0xba, 0xe8, 0x80, 0x85, 0x49, 0x44, 0x48, + 0x02, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, + 0x3c, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x0d, 0x42, 0x15, 0xba, 0x47, 0x12, 0x92, 0x02, 0x0f, 0xe5, 0x88, 0x9b, 0xe5, + 0xbb, 0xba, 0xe8, 0x80, 0x85, 0xe5, 0x90, 0x8d, 0xe5, 0xad, 0x97, 0x48, 0x03, 0x52, 0x0b, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, + 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x14, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x04, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, + 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, + 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x48, 0x05, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x48, 0x06, 0x52, 0x0a, 0x64, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, + 0x72, 0x49, 0x64, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x4e, + 0x61, 0x6d, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, + 0x6d, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, + 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, + 0x22, 0x57, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x69, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x63, 0x74, 0x52, 0x05, 0x69, 0x74, + 0x65, 0x6d, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x42, 0x0a, 0x0e, 0x47, 0x65, 0x74, + 0x44, 0x69, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x74, 0x0a, + 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x69, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x64, 0x69, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x63, 0x74, 0x52, 0x04, 0x64, 0x69, 0x63, 0x74, 0x12, + 0x23, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, + 0x64, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, + 0x72, 0x49, 0x64, 0x22, 0x74, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x69, 0x63, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x64, 0x69, 0x63, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x63, 0x74, 0x52, + 0x04, 0x64, 0x69, 0x63, 0x74, 0x12, 0x23, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, + 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0a, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x6f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x57, 0x0a, 0x11, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x44, 0x69, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x23, + 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, + 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, + 0x49, 0x64, 0x32, 0x8e, 0x03, 0x0a, 0x0b, 0x44, 0x69, 0x63, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x4c, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x69, 0x63, 0x74, 0x12, 0x19, + 0x2e, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x67, 0x69, + 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x44, 0x69, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x47, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x44, 0x69, 0x63, 0x74, 0x12, 0x21, 0x2e, 0x73, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x44, 0x69, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, + 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x44, 0x69, 0x63, 0x74, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x0a, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x44, 0x69, 0x63, 0x74, 0x12, 0x24, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x44, 0x69, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x44, 0x69, 0x63, 0x74, 0x12, 0x24, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x44, 0x69, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, + 0x69, 0x63, 0x74, 0x12, 0x24, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x69, + 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x22, 0x00, 0x42, 0xc7, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x09, 0x44, + 0x69, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3d, 0x6b, 0x72, 0x61, 0x74, + 0x6f, 0x73, 0x2d, 0x6d, 0x6f, 0x6e, 0x6f, 0x6c, 0x69, 0x74, 0x68, 0x69, 0x63, 0x2d, 0x64, 0x65, + 0x6d, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x73, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x3b, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x53, 0x58, 0xaa, + 0x02, 0x11, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x56, 0x31, 0xca, 0x02, 0x11, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5c, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1d, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_system_service_v1_dict_proto_rawDescOnce sync.Once + file_system_service_v1_dict_proto_rawDescData = file_system_service_v1_dict_proto_rawDesc +) + +func file_system_service_v1_dict_proto_rawDescGZIP() []byte { + file_system_service_v1_dict_proto_rawDescOnce.Do(func() { + file_system_service_v1_dict_proto_rawDescData = protoimpl.X.CompressGZIP(file_system_service_v1_dict_proto_rawDescData) + }) + return file_system_service_v1_dict_proto_rawDescData +} + +var file_system_service_v1_dict_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_system_service_v1_dict_proto_goTypes = []interface{}{ + (*Dict)(nil), // 0: system.service.v1.Dict + (*ListDictResponse)(nil), // 1: system.service.v1.ListDictResponse + (*GetDictRequest)(nil), // 2: system.service.v1.GetDictRequest + (*CreateDictRequest)(nil), // 3: system.service.v1.CreateDictRequest + (*UpdateDictRequest)(nil), // 4: system.service.v1.UpdateDictRequest + (*DeleteDictRequest)(nil), // 5: system.service.v1.DeleteDictRequest + (*v1.PagingRequest)(nil), // 6: pagination.PagingRequest + (*emptypb.Empty)(nil), // 7: google.protobuf.Empty +} +var file_system_service_v1_dict_proto_depIdxs = []int32{ + 0, // 0: system.service.v1.ListDictResponse.items:type_name -> system.service.v1.Dict + 0, // 1: system.service.v1.CreateDictRequest.dict:type_name -> system.service.v1.Dict + 0, // 2: system.service.v1.UpdateDictRequest.dict:type_name -> system.service.v1.Dict + 6, // 3: system.service.v1.DictService.ListDict:input_type -> pagination.PagingRequest + 2, // 4: system.service.v1.DictService.GetDict:input_type -> system.service.v1.GetDictRequest + 3, // 5: system.service.v1.DictService.CreateDict:input_type -> system.service.v1.CreateDictRequest + 4, // 6: system.service.v1.DictService.UpdateDict:input_type -> system.service.v1.UpdateDictRequest + 5, // 7: system.service.v1.DictService.DeleteDict:input_type -> system.service.v1.DeleteDictRequest + 1, // 8: system.service.v1.DictService.ListDict:output_type -> system.service.v1.ListDictResponse + 0, // 9: system.service.v1.DictService.GetDict:output_type -> system.service.v1.Dict + 7, // 10: system.service.v1.DictService.CreateDict:output_type -> google.protobuf.Empty + 7, // 11: system.service.v1.DictService.UpdateDict:output_type -> google.protobuf.Empty + 7, // 12: system.service.v1.DictService.DeleteDict:output_type -> google.protobuf.Empty + 8, // [8:13] is the sub-list for method output_type + 3, // [3:8] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_system_service_v1_dict_proto_init() } +func file_system_service_v1_dict_proto_init() { + if File_system_service_v1_dict_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_system_service_v1_dict_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Dict); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_service_v1_dict_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListDictResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_service_v1_dict_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetDictRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_service_v1_dict_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateDictRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_service_v1_dict_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateDictRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_service_v1_dict_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteDictRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_system_service_v1_dict_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_system_service_v1_dict_proto_msgTypes[2].OneofWrappers = []interface{}{} + file_system_service_v1_dict_proto_msgTypes[3].OneofWrappers = []interface{}{} + file_system_service_v1_dict_proto_msgTypes[4].OneofWrappers = []interface{}{} + file_system_service_v1_dict_proto_msgTypes[5].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_system_service_v1_dict_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_system_service_v1_dict_proto_goTypes, + DependencyIndexes: file_system_service_v1_dict_proto_depIdxs, + MessageInfos: file_system_service_v1_dict_proto_msgTypes, + }.Build() + File_system_service_v1_dict_proto = out.File + file_system_service_v1_dict_proto_rawDesc = nil + file_system_service_v1_dict_proto_goTypes = nil + file_system_service_v1_dict_proto_depIdxs = nil +} diff --git a/monolithic/backend/gen/api/go/system/service/v1/dict.pb.validate.go b/monolithic/backend/gen/api/go/system/service/v1/dict.pb.validate.go new file mode 100644 index 0000000..290dbe7 --- /dev/null +++ b/monolithic/backend/gen/api/go/system/service/v1/dict.pb.validate.go @@ -0,0 +1,784 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: system/service/v1/dict.proto + +package servicev1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on Dict with the rules defined in the proto +// definition for this message. If any rules are violated, the first error +// encountered is returned, or nil if there are no violations. +func (m *Dict) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Dict with the rules defined in the +// proto definition for this message. If any rules are violated, the result is +// a list of violation errors wrapped in DictMultiError, or nil if none found. +func (m *Dict) ValidateAll() error { + return m.validate(true) +} + +func (m *Dict) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if m.Name != nil { + // no validation rules for Name + } + + if m.Description != nil { + // no validation rules for Description + } + + if m.CreatorId != nil { + // no validation rules for CreatorId + } + + if m.CreatorName != nil { + // no validation rules for CreatorName + } + + if m.CreateTime != nil { + // no validation rules for CreateTime + } + + if m.UpdateTime != nil { + // no validation rules for UpdateTime + } + + if m.DeleteTime != nil { + // no validation rules for DeleteTime + } + + if len(errors) > 0 { + return DictMultiError(errors) + } + + return nil +} + +// DictMultiError is an error wrapping multiple validation errors returned by +// Dict.ValidateAll() if the designated constraints aren't met. +type DictMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m DictMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m DictMultiError) AllErrors() []error { return m } + +// DictValidationError is the validation error returned by Dict.Validate if the +// designated constraints aren't met. +type DictValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DictValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DictValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DictValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DictValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DictValidationError) ErrorName() string { return "DictValidationError" } + +// Error satisfies the builtin error interface +func (e DictValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDict.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DictValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DictValidationError{} + +// Validate checks the field values on ListDictResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *ListDictResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ListDictResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ListDictResponseMultiError, or nil if none found. +func (m *ListDictResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *ListDictResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + for idx, item := range m.GetItems() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ListDictResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ListDictResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ListDictResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + // no validation rules for Total + + if len(errors) > 0 { + return ListDictResponseMultiError(errors) + } + + return nil +} + +// ListDictResponseMultiError is an error wrapping multiple validation errors +// returned by ListDictResponse.ValidateAll() if the designated constraints +// aren't met. +type ListDictResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ListDictResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ListDictResponseMultiError) AllErrors() []error { return m } + +// ListDictResponseValidationError is the validation error returned by +// ListDictResponse.Validate if the designated constraints aren't met. +type ListDictResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ListDictResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ListDictResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ListDictResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ListDictResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ListDictResponseValidationError) ErrorName() string { return "ListDictResponseValidationError" } + +// Error satisfies the builtin error interface +func (e ListDictResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sListDictResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ListDictResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ListDictResponseValidationError{} + +// Validate checks the field values on GetDictRequest with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *GetDictRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetDictRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in GetDictRequestMultiError, +// or nil if none found. +func (m *GetDictRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *GetDictRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if m.Name != nil { + // no validation rules for Name + } + + if len(errors) > 0 { + return GetDictRequestMultiError(errors) + } + + return nil +} + +// GetDictRequestMultiError is an error wrapping multiple validation errors +// returned by GetDictRequest.ValidateAll() if the designated constraints +// aren't met. +type GetDictRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetDictRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetDictRequestMultiError) AllErrors() []error { return m } + +// GetDictRequestValidationError is the validation error returned by +// GetDictRequest.Validate if the designated constraints aren't met. +type GetDictRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetDictRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetDictRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetDictRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetDictRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetDictRequestValidationError) ErrorName() string { return "GetDictRequestValidationError" } + +// Error satisfies the builtin error interface +func (e GetDictRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetDictRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetDictRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetDictRequestValidationError{} + +// Validate checks the field values on CreateDictRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *CreateDictRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on CreateDictRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// CreateDictRequestMultiError, or nil if none found. +func (m *CreateDictRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *CreateDictRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetDict()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CreateDictRequestValidationError{ + field: "Dict", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CreateDictRequestValidationError{ + field: "Dict", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDict()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateDictRequestValidationError{ + field: "Dict", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if m.OperatorId != nil { + // no validation rules for OperatorId + } + + if len(errors) > 0 { + return CreateDictRequestMultiError(errors) + } + + return nil +} + +// CreateDictRequestMultiError is an error wrapping multiple validation errors +// returned by CreateDictRequest.ValidateAll() if the designated constraints +// aren't met. +type CreateDictRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m CreateDictRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m CreateDictRequestMultiError) AllErrors() []error { return m } + +// CreateDictRequestValidationError is the validation error returned by +// CreateDictRequest.Validate if the designated constraints aren't met. +type CreateDictRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CreateDictRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CreateDictRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CreateDictRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CreateDictRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CreateDictRequestValidationError) ErrorName() string { + return "CreateDictRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e CreateDictRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCreateDictRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CreateDictRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CreateDictRequestValidationError{} + +// Validate checks the field values on UpdateDictRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *UpdateDictRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on UpdateDictRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// UpdateDictRequestMultiError, or nil if none found. +func (m *UpdateDictRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *UpdateDictRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetDict()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UpdateDictRequestValidationError{ + field: "Dict", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UpdateDictRequestValidationError{ + field: "Dict", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDict()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpdateDictRequestValidationError{ + field: "Dict", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if m.OperatorId != nil { + // no validation rules for OperatorId + } + + if len(errors) > 0 { + return UpdateDictRequestMultiError(errors) + } + + return nil +} + +// UpdateDictRequestMultiError is an error wrapping multiple validation errors +// returned by UpdateDictRequest.ValidateAll() if the designated constraints +// aren't met. +type UpdateDictRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UpdateDictRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m UpdateDictRequestMultiError) AllErrors() []error { return m } + +// UpdateDictRequestValidationError is the validation error returned by +// UpdateDictRequest.Validate if the designated constraints aren't met. +type UpdateDictRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UpdateDictRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UpdateDictRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UpdateDictRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UpdateDictRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UpdateDictRequestValidationError) ErrorName() string { + return "UpdateDictRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e UpdateDictRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUpdateDictRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UpdateDictRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UpdateDictRequestValidationError{} + +// Validate checks the field values on DeleteDictRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *DeleteDictRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on DeleteDictRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// DeleteDictRequestMultiError, or nil if none found. +func (m *DeleteDictRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *DeleteDictRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if m.OperatorId != nil { + // no validation rules for OperatorId + } + + if len(errors) > 0 { + return DeleteDictRequestMultiError(errors) + } + + return nil +} + +// DeleteDictRequestMultiError is an error wrapping multiple validation errors +// returned by DeleteDictRequest.ValidateAll() if the designated constraints +// aren't met. +type DeleteDictRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m DeleteDictRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m DeleteDictRequestMultiError) AllErrors() []error { return m } + +// DeleteDictRequestValidationError is the validation error returned by +// DeleteDictRequest.Validate if the designated constraints aren't met. +type DeleteDictRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DeleteDictRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DeleteDictRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DeleteDictRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DeleteDictRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DeleteDictRequestValidationError) ErrorName() string { + return "DeleteDictRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e DeleteDictRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDeleteDictRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DeleteDictRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DeleteDictRequestValidationError{} diff --git a/monolithic/backend/gen/api/go/system/service/v1/dict_detail.pb.go b/monolithic/backend/gen/api/go/system/service/v1/dict_detail.pb.go new file mode 100644 index 0000000..377d263 --- /dev/null +++ b/monolithic/backend/gen/api/go/system/service/v1/dict_detail.pb.go @@ -0,0 +1,708 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: system/service/v1/dict_detail.proto + +package servicev1 + +import ( + _ "github.com/google/gnostic/openapiv3" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 数据字典详情 +type DictDetail struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // ID + DictId *uint32 `protobuf:"varint,2,opt,name=dictId,proto3,oneof" json:"dictId,omitempty"` // ID + OrderNo *int32 `protobuf:"varint,3,opt,name=orderNo,proto3,oneof" json:"orderNo,omitempty"` + Label *string `protobuf:"bytes,4,opt,name=label,proto3,oneof" json:"label,omitempty"` // 字典标签 + Value *string `protobuf:"bytes,5,opt,name=value,proto3,oneof" json:"value,omitempty"` // 字典值 + CreatorId *uint32 `protobuf:"varint,10,opt,name=creatorId,proto3,oneof" json:"creatorId,omitempty"` // 创建者ID + CreatorName *uint32 `protobuf:"varint,11,opt,name=creatorName,proto3,oneof" json:"creatorName,omitempty"` // 创建者名字 + CreateTime *string `protobuf:"bytes,20,opt,name=createTime,proto3,oneof" json:"createTime,omitempty"` // 创建时间 + UpdateTime *string `protobuf:"bytes,21,opt,name=updateTime,proto3,oneof" json:"updateTime,omitempty"` // 更新时间 + DeleteTime *string `protobuf:"bytes,22,opt,name=deleteTime,proto3,oneof" json:"deleteTime,omitempty"` // 删除时间 +} + +func (x *DictDetail) Reset() { + *x = DictDetail{} + if protoimpl.UnsafeEnabled { + mi := &file_system_service_v1_dict_detail_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DictDetail) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DictDetail) ProtoMessage() {} + +func (x *DictDetail) ProtoReflect() protoreflect.Message { + mi := &file_system_service_v1_dict_detail_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DictDetail.ProtoReflect.Descriptor instead. +func (*DictDetail) Descriptor() ([]byte, []int) { + return file_system_service_v1_dict_detail_proto_rawDescGZIP(), []int{0} +} + +func (x *DictDetail) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *DictDetail) GetDictId() uint32 { + if x != nil && x.DictId != nil { + return *x.DictId + } + return 0 +} + +func (x *DictDetail) GetOrderNo() int32 { + if x != nil && x.OrderNo != nil { + return *x.OrderNo + } + return 0 +} + +func (x *DictDetail) GetLabel() string { + if x != nil && x.Label != nil { + return *x.Label + } + return "" +} + +func (x *DictDetail) GetValue() string { + if x != nil && x.Value != nil { + return *x.Value + } + return "" +} + +func (x *DictDetail) GetCreatorId() uint32 { + if x != nil && x.CreatorId != nil { + return *x.CreatorId + } + return 0 +} + +func (x *DictDetail) GetCreatorName() uint32 { + if x != nil && x.CreatorName != nil { + return *x.CreatorName + } + return 0 +} + +func (x *DictDetail) GetCreateTime() string { + if x != nil && x.CreateTime != nil { + return *x.CreateTime + } + return "" +} + +func (x *DictDetail) GetUpdateTime() string { + if x != nil && x.UpdateTime != nil { + return *x.UpdateTime + } + return "" +} + +func (x *DictDetail) GetDeleteTime() string { + if x != nil && x.DeleteTime != nil { + return *x.DeleteTime + } + return "" +} + +// 查询字典详情列表 - 答复 +type ListDictDetailResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Items []*DictDetail `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` + Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` +} + +func (x *ListDictDetailResponse) Reset() { + *x = ListDictDetailResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_system_service_v1_dict_detail_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListDictDetailResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListDictDetailResponse) ProtoMessage() {} + +func (x *ListDictDetailResponse) ProtoReflect() protoreflect.Message { + mi := &file_system_service_v1_dict_detail_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListDictDetailResponse.ProtoReflect.Descriptor instead. +func (*ListDictDetailResponse) Descriptor() ([]byte, []int) { + return file_system_service_v1_dict_detail_proto_rawDescGZIP(), []int{1} +} + +func (x *ListDictDetailResponse) GetItems() []*DictDetail { + if x != nil { + return x.Items + } + return nil +} + +func (x *ListDictDetailResponse) GetTotal() int32 { + if x != nil { + return x.Total + } + return 0 +} + +// 查询字典详情 - 请求 +type GetDictDetailRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Code *string `protobuf:"bytes,3,opt,name=code,proto3,oneof" json:"code,omitempty"` +} + +func (x *GetDictDetailRequest) Reset() { + *x = GetDictDetailRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_system_service_v1_dict_detail_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetDictDetailRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDictDetailRequest) ProtoMessage() {} + +func (x *GetDictDetailRequest) ProtoReflect() protoreflect.Message { + mi := &file_system_service_v1_dict_detail_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetDictDetailRequest.ProtoReflect.Descriptor instead. +func (*GetDictDetailRequest) Descriptor() ([]byte, []int) { + return file_system_service_v1_dict_detail_proto_rawDescGZIP(), []int{2} +} + +func (x *GetDictDetailRequest) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *GetDictDetailRequest) GetCode() string { + if x != nil && x.Code != nil { + return *x.Code + } + return "" +} + +// 创建字典详情 - 请求 +type CreateDictDetailRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Detail *DictDetail `protobuf:"bytes,1,opt,name=detail,proto3" json:"detail,omitempty"` + OperatorId *uint32 `protobuf:"varint,2,opt,name=operatorId,proto3,oneof" json:"operatorId,omitempty"` +} + +func (x *CreateDictDetailRequest) Reset() { + *x = CreateDictDetailRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_system_service_v1_dict_detail_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateDictDetailRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateDictDetailRequest) ProtoMessage() {} + +func (x *CreateDictDetailRequest) ProtoReflect() protoreflect.Message { + mi := &file_system_service_v1_dict_detail_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateDictDetailRequest.ProtoReflect.Descriptor instead. +func (*CreateDictDetailRequest) Descriptor() ([]byte, []int) { + return file_system_service_v1_dict_detail_proto_rawDescGZIP(), []int{3} +} + +func (x *CreateDictDetailRequest) GetDetail() *DictDetail { + if x != nil { + return x.Detail + } + return nil +} + +func (x *CreateDictDetailRequest) GetOperatorId() uint32 { + if x != nil && x.OperatorId != nil { + return *x.OperatorId + } + return 0 +} + +// 更新字典详情 - 请求 +type UpdateDictDetailRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Detail *DictDetail `protobuf:"bytes,1,opt,name=detail,proto3" json:"detail,omitempty"` + OperatorId *uint32 `protobuf:"varint,2,opt,name=operatorId,proto3,oneof" json:"operatorId,omitempty"` +} + +func (x *UpdateDictDetailRequest) Reset() { + *x = UpdateDictDetailRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_system_service_v1_dict_detail_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateDictDetailRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateDictDetailRequest) ProtoMessage() {} + +func (x *UpdateDictDetailRequest) ProtoReflect() protoreflect.Message { + mi := &file_system_service_v1_dict_detail_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateDictDetailRequest.ProtoReflect.Descriptor instead. +func (*UpdateDictDetailRequest) Descriptor() ([]byte, []int) { + return file_system_service_v1_dict_detail_proto_rawDescGZIP(), []int{4} +} + +func (x *UpdateDictDetailRequest) GetDetail() *DictDetail { + if x != nil { + return x.Detail + } + return nil +} + +func (x *UpdateDictDetailRequest) GetOperatorId() uint32 { + if x != nil && x.OperatorId != nil { + return *x.OperatorId + } + return 0 +} + +// 删除字典详情 - 请求 +type DeleteDictDetailRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + OperatorId *uint32 `protobuf:"varint,2,opt,name=operatorId,proto3,oneof" json:"operatorId,omitempty"` +} + +func (x *DeleteDictDetailRequest) Reset() { + *x = DeleteDictDetailRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_system_service_v1_dict_detail_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteDictDetailRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteDictDetailRequest) ProtoMessage() {} + +func (x *DeleteDictDetailRequest) ProtoReflect() protoreflect.Message { + mi := &file_system_service_v1_dict_detail_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteDictDetailRequest.ProtoReflect.Descriptor instead. +func (*DeleteDictDetailRequest) Descriptor() ([]byte, []int) { + return file_system_service_v1_dict_detail_proto_rawDescGZIP(), []int{5} +} + +func (x *DeleteDictDetailRequest) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *DeleteDictDetailRequest) GetOperatorId() uint32 { + if x != nil && x.OperatorId != nil { + return *x.OperatorId + } + return 0 +} + +var File_system_service_v1_dict_detail_proto protoreflect.FileDescriptor + +var file_system_service_v1_dict_detail_proto_rawDesc = []byte{ + 0x0a, 0x23, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x24, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, + 0x63, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, + 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x70, 0x61, 0x67, + 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc3, 0x04, 0x0a, 0x0a, + 0x44, 0x69, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x24, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x14, 0xba, 0x47, 0x11, 0x92, 0x02, 0x0e, 0xe5, 0xad, + 0x97, 0xe5, 0x85, 0xb8, 0xe8, 0xaf, 0xa6, 0xe6, 0x83, 0x85, 0x49, 0x44, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x2b, 0x0a, 0x06, 0x64, 0x69, 0x63, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, + 0x42, 0x0e, 0xba, 0x47, 0x0b, 0x92, 0x02, 0x08, 0xe5, 0xad, 0x97, 0xe5, 0x85, 0xb8, 0x49, 0x44, + 0x48, 0x00, 0x52, 0x06, 0x64, 0x69, 0x63, 0x74, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x2e, 0x0a, + 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x4e, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0f, + 0xba, 0x47, 0x0c, 0x92, 0x02, 0x09, 0xe6, 0x8e, 0x92, 0xe5, 0xba, 0x8f, 0xe5, 0x8f, 0xb7, 0x48, + 0x01, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x4e, 0x6f, 0x88, 0x01, 0x01, 0x12, 0x2d, 0x0a, + 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x12, 0xba, 0x47, + 0x0f, 0x92, 0x02, 0x0c, 0xe5, 0xad, 0x97, 0xe5, 0x85, 0xb8, 0xe6, 0xa0, 0x87, 0xe7, 0xad, 0xbe, + 0x48, 0x02, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x2a, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0f, 0xba, 0x47, 0x0c, + 0x92, 0x02, 0x09, 0xe5, 0xad, 0x97, 0xe5, 0x85, 0xb8, 0xe5, 0x80, 0xbc, 0x48, 0x03, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x88, 0x01, 0x01, 0x12, 0x34, 0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x11, 0xba, 0x47, 0x0e, + 0x92, 0x02, 0x0b, 0xe5, 0x88, 0x9b, 0xe5, 0xbb, 0xba, 0xe8, 0x80, 0x85, 0x49, 0x44, 0x48, 0x04, + 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x3c, + 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x0d, 0x42, 0x15, 0xba, 0x47, 0x12, 0x92, 0x02, 0x0f, 0xe5, 0x88, 0x9b, 0xe5, 0xbb, + 0xba, 0xe8, 0x80, 0x85, 0xe5, 0x90, 0x8d, 0xe5, 0xad, 0x97, 0x48, 0x05, 0x52, 0x0b, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x6f, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x06, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, + 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, + 0x15, 0x20, 0x01, 0x28, 0x09, 0x48, 0x07, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, + 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x54, 0x69, 0x6d, 0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x48, 0x08, 0x52, 0x0a, 0x64, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, + 0x64, 0x69, 0x63, 0x74, 0x49, 0x64, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, + 0x4e, 0x6f, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x42, 0x08, 0x0a, 0x06, + 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x6f, 0x72, 0x49, 0x64, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, + 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, + 0x69, 0x6d, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, + 0x6d, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, + 0x65, 0x22, 0x63, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x69, 0x63, 0x74, 0x44, 0x65, 0x74, + 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x05, 0x69, + 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x79, 0x73, + 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x69, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, + 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x48, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x44, 0x69, 0x63, + 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, + 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, + 0x63, 0x6f, 0x64, 0x65, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x63, 0x6f, 0x64, 0x65, + 0x22, 0x84, 0x01, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x69, 0x63, 0x74, 0x44, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x06, + 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, + 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x44, 0x69, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x06, 0x64, 0x65, 0x74, + 0x61, 0x69, 0x6c, 0x12, 0x23, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x6f, 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x84, 0x01, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x44, 0x69, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x52, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x23, 0x0a, 0x0a, 0x6f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, + 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, + 0x0d, 0x0a, 0x0b, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x5d, + 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x69, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x23, 0x0a, 0x0a, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, + 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0d, + 0x0a, 0x0b, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x32, 0xb7, 0x04, + 0x0a, 0x11, 0x44, 0x69, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x58, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x69, 0x63, 0x74, 0x44, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x29, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x69, 0x63, 0x74, 0x44, 0x65, 0x74, + 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x59, 0x0a, + 0x0d, 0x47, 0x65, 0x74, 0x44, 0x69, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x27, + 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x69, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x63, 0x74, + 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x22, 0x00, 0x12, 0x58, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x44, 0x69, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x2a, 0x2e, 0x73, + 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x69, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, + 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x22, 0x00, 0x12, 0x58, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x69, 0x63, 0x74, + 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x2a, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x44, 0x69, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x58, 0x0a, 0x10, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x69, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x12, 0x2a, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x69, 0x63, 0x74, 0x44, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x5f, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x44, 0x69, 0x63, + 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x27, 0x2e, + 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x69, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x63, 0x74, 0x44, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x22, 0x00, 0x42, 0xcd, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, + 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, + 0x31, 0x42, 0x0f, 0x44, 0x69, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3d, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x6d, 0x6f, 0x6e, + 0x6f, 0x6c, 0x69, 0x74, 0x68, 0x69, 0x63, 0x2d, 0x64, 0x65, 0x6d, 0x6f, 0x2f, 0x67, 0x65, 0x6e, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x53, 0x58, 0xaa, 0x02, 0x11, 0x53, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x11, + 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x56, + 0x31, 0xe2, 0x02, 0x1d, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x13, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_system_service_v1_dict_detail_proto_rawDescOnce sync.Once + file_system_service_v1_dict_detail_proto_rawDescData = file_system_service_v1_dict_detail_proto_rawDesc +) + +func file_system_service_v1_dict_detail_proto_rawDescGZIP() []byte { + file_system_service_v1_dict_detail_proto_rawDescOnce.Do(func() { + file_system_service_v1_dict_detail_proto_rawDescData = protoimpl.X.CompressGZIP(file_system_service_v1_dict_detail_proto_rawDescData) + }) + return file_system_service_v1_dict_detail_proto_rawDescData +} + +var file_system_service_v1_dict_detail_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_system_service_v1_dict_detail_proto_goTypes = []interface{}{ + (*DictDetail)(nil), // 0: system.service.v1.DictDetail + (*ListDictDetailResponse)(nil), // 1: system.service.v1.ListDictDetailResponse + (*GetDictDetailRequest)(nil), // 2: system.service.v1.GetDictDetailRequest + (*CreateDictDetailRequest)(nil), // 3: system.service.v1.CreateDictDetailRequest + (*UpdateDictDetailRequest)(nil), // 4: system.service.v1.UpdateDictDetailRequest + (*DeleteDictDetailRequest)(nil), // 5: system.service.v1.DeleteDictDetailRequest + (*v1.PagingRequest)(nil), // 6: pagination.PagingRequest + (*emptypb.Empty)(nil), // 7: google.protobuf.Empty +} +var file_system_service_v1_dict_detail_proto_depIdxs = []int32{ + 0, // 0: system.service.v1.ListDictDetailResponse.items:type_name -> system.service.v1.DictDetail + 0, // 1: system.service.v1.CreateDictDetailRequest.detail:type_name -> system.service.v1.DictDetail + 0, // 2: system.service.v1.UpdateDictDetailRequest.detail:type_name -> system.service.v1.DictDetail + 6, // 3: system.service.v1.DictDetailService.ListDictDetail:input_type -> pagination.PagingRequest + 2, // 4: system.service.v1.DictDetailService.GetDictDetail:input_type -> system.service.v1.GetDictDetailRequest + 3, // 5: system.service.v1.DictDetailService.CreateDictDetail:input_type -> system.service.v1.CreateDictDetailRequest + 4, // 6: system.service.v1.DictDetailService.UpdateDictDetail:input_type -> system.service.v1.UpdateDictDetailRequest + 5, // 7: system.service.v1.DictDetailService.DeleteDictDetail:input_type -> system.service.v1.DeleteDictDetailRequest + 2, // 8: system.service.v1.DictDetailService.GetDictDetailByCode:input_type -> system.service.v1.GetDictDetailRequest + 1, // 9: system.service.v1.DictDetailService.ListDictDetail:output_type -> system.service.v1.ListDictDetailResponse + 0, // 10: system.service.v1.DictDetailService.GetDictDetail:output_type -> system.service.v1.DictDetail + 7, // 11: system.service.v1.DictDetailService.CreateDictDetail:output_type -> google.protobuf.Empty + 7, // 12: system.service.v1.DictDetailService.UpdateDictDetail:output_type -> google.protobuf.Empty + 7, // 13: system.service.v1.DictDetailService.DeleteDictDetail:output_type -> google.protobuf.Empty + 0, // 14: system.service.v1.DictDetailService.GetDictDetailByCode:output_type -> system.service.v1.DictDetail + 9, // [9:15] is the sub-list for method output_type + 3, // [3:9] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_system_service_v1_dict_detail_proto_init() } +func file_system_service_v1_dict_detail_proto_init() { + if File_system_service_v1_dict_detail_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_system_service_v1_dict_detail_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DictDetail); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_service_v1_dict_detail_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListDictDetailResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_service_v1_dict_detail_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetDictDetailRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_service_v1_dict_detail_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateDictDetailRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_service_v1_dict_detail_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateDictDetailRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_service_v1_dict_detail_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteDictDetailRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_system_service_v1_dict_detail_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_system_service_v1_dict_detail_proto_msgTypes[2].OneofWrappers = []interface{}{} + file_system_service_v1_dict_detail_proto_msgTypes[3].OneofWrappers = []interface{}{} + file_system_service_v1_dict_detail_proto_msgTypes[4].OneofWrappers = []interface{}{} + file_system_service_v1_dict_detail_proto_msgTypes[5].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_system_service_v1_dict_detail_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_system_service_v1_dict_detail_proto_goTypes, + DependencyIndexes: file_system_service_v1_dict_detail_proto_depIdxs, + MessageInfos: file_system_service_v1_dict_detail_proto_msgTypes, + }.Build() + File_system_service_v1_dict_detail_proto = out.File + file_system_service_v1_dict_detail_proto_rawDesc = nil + file_system_service_v1_dict_detail_proto_goTypes = nil + file_system_service_v1_dict_detail_proto_depIdxs = nil +} diff --git a/monolithic/backend/gen/api/go/system/service/v1/dict_detail.pb.validate.go b/monolithic/backend/gen/api/go/system/service/v1/dict_detail.pb.validate.go new file mode 100644 index 0000000..77e5d46 --- /dev/null +++ b/monolithic/backend/gen/api/go/system/service/v1/dict_detail.pb.validate.go @@ -0,0 +1,797 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: system/service/v1/dict_detail.proto + +package servicev1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on DictDetail with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *DictDetail) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on DictDetail with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in DictDetailMultiError, or +// nil if none found. +func (m *DictDetail) ValidateAll() error { + return m.validate(true) +} + +func (m *DictDetail) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if m.DictId != nil { + // no validation rules for DictId + } + + if m.OrderNo != nil { + // no validation rules for OrderNo + } + + if m.Label != nil { + // no validation rules for Label + } + + if m.Value != nil { + // no validation rules for Value + } + + if m.CreatorId != nil { + // no validation rules for CreatorId + } + + if m.CreatorName != nil { + // no validation rules for CreatorName + } + + if m.CreateTime != nil { + // no validation rules for CreateTime + } + + if m.UpdateTime != nil { + // no validation rules for UpdateTime + } + + if m.DeleteTime != nil { + // no validation rules for DeleteTime + } + + if len(errors) > 0 { + return DictDetailMultiError(errors) + } + + return nil +} + +// DictDetailMultiError is an error wrapping multiple validation errors +// returned by DictDetail.ValidateAll() if the designated constraints aren't met. +type DictDetailMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m DictDetailMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m DictDetailMultiError) AllErrors() []error { return m } + +// DictDetailValidationError is the validation error returned by +// DictDetail.Validate if the designated constraints aren't met. +type DictDetailValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DictDetailValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DictDetailValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DictDetailValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DictDetailValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DictDetailValidationError) ErrorName() string { return "DictDetailValidationError" } + +// Error satisfies the builtin error interface +func (e DictDetailValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDictDetail.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DictDetailValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DictDetailValidationError{} + +// Validate checks the field values on ListDictDetailResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *ListDictDetailResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ListDictDetailResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ListDictDetailResponseMultiError, or nil if none found. +func (m *ListDictDetailResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *ListDictDetailResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + for idx, item := range m.GetItems() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ListDictDetailResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ListDictDetailResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ListDictDetailResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + // no validation rules for Total + + if len(errors) > 0 { + return ListDictDetailResponseMultiError(errors) + } + + return nil +} + +// ListDictDetailResponseMultiError is an error wrapping multiple validation +// errors returned by ListDictDetailResponse.ValidateAll() if the designated +// constraints aren't met. +type ListDictDetailResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ListDictDetailResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ListDictDetailResponseMultiError) AllErrors() []error { return m } + +// ListDictDetailResponseValidationError is the validation error returned by +// ListDictDetailResponse.Validate if the designated constraints aren't met. +type ListDictDetailResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ListDictDetailResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ListDictDetailResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ListDictDetailResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ListDictDetailResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ListDictDetailResponseValidationError) ErrorName() string { + return "ListDictDetailResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e ListDictDetailResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sListDictDetailResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ListDictDetailResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ListDictDetailResponseValidationError{} + +// Validate checks the field values on GetDictDetailRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *GetDictDetailRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetDictDetailRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// GetDictDetailRequestMultiError, or nil if none found. +func (m *GetDictDetailRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *GetDictDetailRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if m.Code != nil { + // no validation rules for Code + } + + if len(errors) > 0 { + return GetDictDetailRequestMultiError(errors) + } + + return nil +} + +// GetDictDetailRequestMultiError is an error wrapping multiple validation +// errors returned by GetDictDetailRequest.ValidateAll() if the designated +// constraints aren't met. +type GetDictDetailRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetDictDetailRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetDictDetailRequestMultiError) AllErrors() []error { return m } + +// GetDictDetailRequestValidationError is the validation error returned by +// GetDictDetailRequest.Validate if the designated constraints aren't met. +type GetDictDetailRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetDictDetailRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetDictDetailRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetDictDetailRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetDictDetailRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetDictDetailRequestValidationError) ErrorName() string { + return "GetDictDetailRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e GetDictDetailRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetDictDetailRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetDictDetailRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetDictDetailRequestValidationError{} + +// Validate checks the field values on CreateDictDetailRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *CreateDictDetailRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on CreateDictDetailRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// CreateDictDetailRequestMultiError, or nil if none found. +func (m *CreateDictDetailRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *CreateDictDetailRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetDetail()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CreateDictDetailRequestValidationError{ + field: "Detail", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CreateDictDetailRequestValidationError{ + field: "Detail", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDetail()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateDictDetailRequestValidationError{ + field: "Detail", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if m.OperatorId != nil { + // no validation rules for OperatorId + } + + if len(errors) > 0 { + return CreateDictDetailRequestMultiError(errors) + } + + return nil +} + +// CreateDictDetailRequestMultiError is an error wrapping multiple validation +// errors returned by CreateDictDetailRequest.ValidateAll() if the designated +// constraints aren't met. +type CreateDictDetailRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m CreateDictDetailRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m CreateDictDetailRequestMultiError) AllErrors() []error { return m } + +// CreateDictDetailRequestValidationError is the validation error returned by +// CreateDictDetailRequest.Validate if the designated constraints aren't met. +type CreateDictDetailRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CreateDictDetailRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CreateDictDetailRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CreateDictDetailRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CreateDictDetailRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CreateDictDetailRequestValidationError) ErrorName() string { + return "CreateDictDetailRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e CreateDictDetailRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCreateDictDetailRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CreateDictDetailRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CreateDictDetailRequestValidationError{} + +// Validate checks the field values on UpdateDictDetailRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *UpdateDictDetailRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on UpdateDictDetailRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// UpdateDictDetailRequestMultiError, or nil if none found. +func (m *UpdateDictDetailRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *UpdateDictDetailRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetDetail()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UpdateDictDetailRequestValidationError{ + field: "Detail", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UpdateDictDetailRequestValidationError{ + field: "Detail", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDetail()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpdateDictDetailRequestValidationError{ + field: "Detail", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if m.OperatorId != nil { + // no validation rules for OperatorId + } + + if len(errors) > 0 { + return UpdateDictDetailRequestMultiError(errors) + } + + return nil +} + +// UpdateDictDetailRequestMultiError is an error wrapping multiple validation +// errors returned by UpdateDictDetailRequest.ValidateAll() if the designated +// constraints aren't met. +type UpdateDictDetailRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UpdateDictDetailRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m UpdateDictDetailRequestMultiError) AllErrors() []error { return m } + +// UpdateDictDetailRequestValidationError is the validation error returned by +// UpdateDictDetailRequest.Validate if the designated constraints aren't met. +type UpdateDictDetailRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UpdateDictDetailRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UpdateDictDetailRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UpdateDictDetailRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UpdateDictDetailRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UpdateDictDetailRequestValidationError) ErrorName() string { + return "UpdateDictDetailRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e UpdateDictDetailRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUpdateDictDetailRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UpdateDictDetailRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UpdateDictDetailRequestValidationError{} + +// Validate checks the field values on DeleteDictDetailRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *DeleteDictDetailRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on DeleteDictDetailRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// DeleteDictDetailRequestMultiError, or nil if none found. +func (m *DeleteDictDetailRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *DeleteDictDetailRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if m.OperatorId != nil { + // no validation rules for OperatorId + } + + if len(errors) > 0 { + return DeleteDictDetailRequestMultiError(errors) + } + + return nil +} + +// DeleteDictDetailRequestMultiError is an error wrapping multiple validation +// errors returned by DeleteDictDetailRequest.ValidateAll() if the designated +// constraints aren't met. +type DeleteDictDetailRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m DeleteDictDetailRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m DeleteDictDetailRequestMultiError) AllErrors() []error { return m } + +// DeleteDictDetailRequestValidationError is the validation error returned by +// DeleteDictDetailRequest.Validate if the designated constraints aren't met. +type DeleteDictDetailRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DeleteDictDetailRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DeleteDictDetailRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DeleteDictDetailRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DeleteDictDetailRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DeleteDictDetailRequestValidationError) ErrorName() string { + return "DeleteDictDetailRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e DeleteDictDetailRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDeleteDictDetailRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DeleteDictDetailRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DeleteDictDetailRequestValidationError{} diff --git a/monolithic/backend/gen/api/go/system/service/v1/dict_detail_grpc.pb.go b/monolithic/backend/gen/api/go/system/service/v1/dict_detail_grpc.pb.go new file mode 100644 index 0000000..b6b60cd --- /dev/null +++ b/monolithic/backend/gen/api/go/system/service/v1/dict_detail_grpc.pb.go @@ -0,0 +1,306 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: system/service/v1/dict_detail.proto + +package servicev1 + +import ( + context "context" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + DictDetailService_ListDictDetail_FullMethodName = "/system.service.v1.DictDetailService/ListDictDetail" + DictDetailService_GetDictDetail_FullMethodName = "/system.service.v1.DictDetailService/GetDictDetail" + DictDetailService_CreateDictDetail_FullMethodName = "/system.service.v1.DictDetailService/CreateDictDetail" + DictDetailService_UpdateDictDetail_FullMethodName = "/system.service.v1.DictDetailService/UpdateDictDetail" + DictDetailService_DeleteDictDetail_FullMethodName = "/system.service.v1.DictDetailService/DeleteDictDetail" + DictDetailService_GetDictDetailByCode_FullMethodName = "/system.service.v1.DictDetailService/GetDictDetailByCode" +) + +// DictDetailServiceClient is the client API for DictDetailService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type DictDetailServiceClient interface { + // 查询字典详情列表 + ListDictDetail(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*ListDictDetailResponse, error) + // 查询字典详情 + GetDictDetail(ctx context.Context, in *GetDictDetailRequest, opts ...grpc.CallOption) (*DictDetail, error) + // 创建字典详情 + CreateDictDetail(ctx context.Context, in *CreateDictDetailRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 更新字典详情 + UpdateDictDetail(ctx context.Context, in *UpdateDictDetailRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 删除字典详情 + DeleteDictDetail(ctx context.Context, in *DeleteDictDetailRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + GetDictDetailByCode(ctx context.Context, in *GetDictDetailRequest, opts ...grpc.CallOption) (*DictDetail, error) +} + +type dictDetailServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewDictDetailServiceClient(cc grpc.ClientConnInterface) DictDetailServiceClient { + return &dictDetailServiceClient{cc} +} + +func (c *dictDetailServiceClient) ListDictDetail(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*ListDictDetailResponse, error) { + out := new(ListDictDetailResponse) + err := c.cc.Invoke(ctx, DictDetailService_ListDictDetail_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dictDetailServiceClient) GetDictDetail(ctx context.Context, in *GetDictDetailRequest, opts ...grpc.CallOption) (*DictDetail, error) { + out := new(DictDetail) + err := c.cc.Invoke(ctx, DictDetailService_GetDictDetail_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dictDetailServiceClient) CreateDictDetail(ctx context.Context, in *CreateDictDetailRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, DictDetailService_CreateDictDetail_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dictDetailServiceClient) UpdateDictDetail(ctx context.Context, in *UpdateDictDetailRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, DictDetailService_UpdateDictDetail_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dictDetailServiceClient) DeleteDictDetail(ctx context.Context, in *DeleteDictDetailRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, DictDetailService_DeleteDictDetail_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dictDetailServiceClient) GetDictDetailByCode(ctx context.Context, in *GetDictDetailRequest, opts ...grpc.CallOption) (*DictDetail, error) { + out := new(DictDetail) + err := c.cc.Invoke(ctx, DictDetailService_GetDictDetailByCode_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// DictDetailServiceServer is the server API for DictDetailService service. +// All implementations must embed UnimplementedDictDetailServiceServer +// for forward compatibility +type DictDetailServiceServer interface { + // 查询字典详情列表 + ListDictDetail(context.Context, *v1.PagingRequest) (*ListDictDetailResponse, error) + // 查询字典详情 + GetDictDetail(context.Context, *GetDictDetailRequest) (*DictDetail, error) + // 创建字典详情 + CreateDictDetail(context.Context, *CreateDictDetailRequest) (*emptypb.Empty, error) + // 更新字典详情 + UpdateDictDetail(context.Context, *UpdateDictDetailRequest) (*emptypb.Empty, error) + // 删除字典详情 + DeleteDictDetail(context.Context, *DeleteDictDetailRequest) (*emptypb.Empty, error) + GetDictDetailByCode(context.Context, *GetDictDetailRequest) (*DictDetail, error) + mustEmbedUnimplementedDictDetailServiceServer() +} + +// UnimplementedDictDetailServiceServer must be embedded to have forward compatible implementations. +type UnimplementedDictDetailServiceServer struct { +} + +func (UnimplementedDictDetailServiceServer) ListDictDetail(context.Context, *v1.PagingRequest) (*ListDictDetailResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListDictDetail not implemented") +} +func (UnimplementedDictDetailServiceServer) GetDictDetail(context.Context, *GetDictDetailRequest) (*DictDetail, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDictDetail not implemented") +} +func (UnimplementedDictDetailServiceServer) CreateDictDetail(context.Context, *CreateDictDetailRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateDictDetail not implemented") +} +func (UnimplementedDictDetailServiceServer) UpdateDictDetail(context.Context, *UpdateDictDetailRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateDictDetail not implemented") +} +func (UnimplementedDictDetailServiceServer) DeleteDictDetail(context.Context, *DeleteDictDetailRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteDictDetail not implemented") +} +func (UnimplementedDictDetailServiceServer) GetDictDetailByCode(context.Context, *GetDictDetailRequest) (*DictDetail, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDictDetailByCode not implemented") +} +func (UnimplementedDictDetailServiceServer) mustEmbedUnimplementedDictDetailServiceServer() {} + +// UnsafeDictDetailServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to DictDetailServiceServer will +// result in compilation errors. +type UnsafeDictDetailServiceServer interface { + mustEmbedUnimplementedDictDetailServiceServer() +} + +func RegisterDictDetailServiceServer(s grpc.ServiceRegistrar, srv DictDetailServiceServer) { + s.RegisterService(&DictDetailService_ServiceDesc, srv) +} + +func _DictDetailService_ListDictDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v1.PagingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DictDetailServiceServer).ListDictDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DictDetailService_ListDictDetail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DictDetailServiceServer).ListDictDetail(ctx, req.(*v1.PagingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DictDetailService_GetDictDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetDictDetailRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DictDetailServiceServer).GetDictDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DictDetailService_GetDictDetail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DictDetailServiceServer).GetDictDetail(ctx, req.(*GetDictDetailRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DictDetailService_CreateDictDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateDictDetailRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DictDetailServiceServer).CreateDictDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DictDetailService_CreateDictDetail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DictDetailServiceServer).CreateDictDetail(ctx, req.(*CreateDictDetailRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DictDetailService_UpdateDictDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateDictDetailRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DictDetailServiceServer).UpdateDictDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DictDetailService_UpdateDictDetail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DictDetailServiceServer).UpdateDictDetail(ctx, req.(*UpdateDictDetailRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DictDetailService_DeleteDictDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteDictDetailRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DictDetailServiceServer).DeleteDictDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DictDetailService_DeleteDictDetail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DictDetailServiceServer).DeleteDictDetail(ctx, req.(*DeleteDictDetailRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DictDetailService_GetDictDetailByCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetDictDetailRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DictDetailServiceServer).GetDictDetailByCode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DictDetailService_GetDictDetailByCode_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DictDetailServiceServer).GetDictDetailByCode(ctx, req.(*GetDictDetailRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// DictDetailService_ServiceDesc is the grpc.ServiceDesc for DictDetailService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var DictDetailService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "system.service.v1.DictDetailService", + HandlerType: (*DictDetailServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListDictDetail", + Handler: _DictDetailService_ListDictDetail_Handler, + }, + { + MethodName: "GetDictDetail", + Handler: _DictDetailService_GetDictDetail_Handler, + }, + { + MethodName: "CreateDictDetail", + Handler: _DictDetailService_CreateDictDetail_Handler, + }, + { + MethodName: "UpdateDictDetail", + Handler: _DictDetailService_UpdateDictDetail_Handler, + }, + { + MethodName: "DeleteDictDetail", + Handler: _DictDetailService_DeleteDictDetail_Handler, + }, + { + MethodName: "GetDictDetailByCode", + Handler: _DictDetailService_GetDictDetailByCode_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "system/service/v1/dict_detail.proto", +} diff --git a/monolithic/backend/gen/api/go/system/service/v1/dict_grpc.pb.go b/monolithic/backend/gen/api/go/system/service/v1/dict_grpc.pb.go new file mode 100644 index 0000000..755990b --- /dev/null +++ b/monolithic/backend/gen/api/go/system/service/v1/dict_grpc.pb.go @@ -0,0 +1,269 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: system/service/v1/dict.proto + +package servicev1 + +import ( + context "context" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + DictService_ListDict_FullMethodName = "/system.service.v1.DictService/ListDict" + DictService_GetDict_FullMethodName = "/system.service.v1.DictService/GetDict" + DictService_CreateDict_FullMethodName = "/system.service.v1.DictService/CreateDict" + DictService_UpdateDict_FullMethodName = "/system.service.v1.DictService/UpdateDict" + DictService_DeleteDict_FullMethodName = "/system.service.v1.DictService/DeleteDict" +) + +// DictServiceClient is the client API for DictService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type DictServiceClient interface { + // 查询字典列表 + ListDict(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*ListDictResponse, error) + // 查询字典 + GetDict(ctx context.Context, in *GetDictRequest, opts ...grpc.CallOption) (*Dict, error) + // 创建字典 + CreateDict(ctx context.Context, in *CreateDictRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 更新字典 + UpdateDict(ctx context.Context, in *UpdateDictRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 删除字典 + DeleteDict(ctx context.Context, in *DeleteDictRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type dictServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewDictServiceClient(cc grpc.ClientConnInterface) DictServiceClient { + return &dictServiceClient{cc} +} + +func (c *dictServiceClient) ListDict(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*ListDictResponse, error) { + out := new(ListDictResponse) + err := c.cc.Invoke(ctx, DictService_ListDict_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dictServiceClient) GetDict(ctx context.Context, in *GetDictRequest, opts ...grpc.CallOption) (*Dict, error) { + out := new(Dict) + err := c.cc.Invoke(ctx, DictService_GetDict_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dictServiceClient) CreateDict(ctx context.Context, in *CreateDictRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, DictService_CreateDict_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dictServiceClient) UpdateDict(ctx context.Context, in *UpdateDictRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, DictService_UpdateDict_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dictServiceClient) DeleteDict(ctx context.Context, in *DeleteDictRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, DictService_DeleteDict_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// DictServiceServer is the server API for DictService service. +// All implementations must embed UnimplementedDictServiceServer +// for forward compatibility +type DictServiceServer interface { + // 查询字典列表 + ListDict(context.Context, *v1.PagingRequest) (*ListDictResponse, error) + // 查询字典 + GetDict(context.Context, *GetDictRequest) (*Dict, error) + // 创建字典 + CreateDict(context.Context, *CreateDictRequest) (*emptypb.Empty, error) + // 更新字典 + UpdateDict(context.Context, *UpdateDictRequest) (*emptypb.Empty, error) + // 删除字典 + DeleteDict(context.Context, *DeleteDictRequest) (*emptypb.Empty, error) + mustEmbedUnimplementedDictServiceServer() +} + +// UnimplementedDictServiceServer must be embedded to have forward compatible implementations. +type UnimplementedDictServiceServer struct { +} + +func (UnimplementedDictServiceServer) ListDict(context.Context, *v1.PagingRequest) (*ListDictResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListDict not implemented") +} +func (UnimplementedDictServiceServer) GetDict(context.Context, *GetDictRequest) (*Dict, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDict not implemented") +} +func (UnimplementedDictServiceServer) CreateDict(context.Context, *CreateDictRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateDict not implemented") +} +func (UnimplementedDictServiceServer) UpdateDict(context.Context, *UpdateDictRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateDict not implemented") +} +func (UnimplementedDictServiceServer) DeleteDict(context.Context, *DeleteDictRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteDict not implemented") +} +func (UnimplementedDictServiceServer) mustEmbedUnimplementedDictServiceServer() {} + +// UnsafeDictServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to DictServiceServer will +// result in compilation errors. +type UnsafeDictServiceServer interface { + mustEmbedUnimplementedDictServiceServer() +} + +func RegisterDictServiceServer(s grpc.ServiceRegistrar, srv DictServiceServer) { + s.RegisterService(&DictService_ServiceDesc, srv) +} + +func _DictService_ListDict_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v1.PagingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DictServiceServer).ListDict(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DictService_ListDict_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DictServiceServer).ListDict(ctx, req.(*v1.PagingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DictService_GetDict_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetDictRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DictServiceServer).GetDict(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DictService_GetDict_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DictServiceServer).GetDict(ctx, req.(*GetDictRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DictService_CreateDict_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateDictRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DictServiceServer).CreateDict(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DictService_CreateDict_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DictServiceServer).CreateDict(ctx, req.(*CreateDictRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DictService_UpdateDict_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateDictRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DictServiceServer).UpdateDict(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DictService_UpdateDict_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DictServiceServer).UpdateDict(ctx, req.(*UpdateDictRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DictService_DeleteDict_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteDictRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DictServiceServer).DeleteDict(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DictService_DeleteDict_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DictServiceServer).DeleteDict(ctx, req.(*DeleteDictRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// DictService_ServiceDesc is the grpc.ServiceDesc for DictService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var DictService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "system.service.v1.DictService", + HandlerType: (*DictServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListDict", + Handler: _DictService_ListDict_Handler, + }, + { + MethodName: "GetDict", + Handler: _DictService_GetDict_Handler, + }, + { + MethodName: "CreateDict", + Handler: _DictService_CreateDict_Handler, + }, + { + MethodName: "UpdateDict", + Handler: _DictService_UpdateDict_Handler, + }, + { + MethodName: "DeleteDict", + Handler: _DictService_DeleteDict_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "system/service/v1/dict.proto", +} diff --git a/monolithic/backend/gen/api/go/system/service/v1/menu.pb.go b/monolithic/backend/gen/api/go/system/service/v1/menu.pb.go new file mode 100644 index 0000000..6e83592 --- /dev/null +++ b/monolithic/backend/gen/api/go/system/service/v1/menu.pb.go @@ -0,0 +1,913 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: system/service/v1/menu.proto + +package servicev1 + +import ( + _ "github.com/google/gnostic/openapiv3" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type MenuType int32 + +const ( + MenuType_FOLDER MenuType = 0 // 菜单夹 + MenuType_MENU MenuType = 1 // 菜单项 + MenuType_BUTTON MenuType = 2 // 按钮 +) + +// Enum value maps for MenuType. +var ( + MenuType_name = map[int32]string{ + 0: "FOLDER", + 1: "MENU", + 2: "BUTTON", + } + MenuType_value = map[string]int32{ + "FOLDER": 0, + "MENU": 1, + "BUTTON": 2, + } +) + +func (x MenuType) Enum() *MenuType { + p := new(MenuType) + *p = x + return p +} + +func (x MenuType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MenuType) Descriptor() protoreflect.EnumDescriptor { + return file_system_service_v1_menu_proto_enumTypes[0].Descriptor() +} + +func (MenuType) Type() protoreflect.EnumType { + return &file_system_service_v1_menu_proto_enumTypes[0] +} + +func (x MenuType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MenuType.Descriptor instead. +func (MenuType) EnumDescriptor() ([]byte, []int) { + return file_system_service_v1_menu_proto_rawDescGZIP(), []int{0} +} + +// 菜单 +type Menu struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + ParentId *int32 `protobuf:"varint,2,opt,name=parentId,proto3,oneof" json:"parentId,omitempty"` + OrderNo *int32 `protobuf:"varint,3,opt,name=orderNo,proto3,oneof" json:"orderNo,omitempty"` + Name *string `protobuf:"bytes,4,opt,name=name,proto3,oneof" json:"name,omitempty"` + Type *MenuType `protobuf:"varint,5,opt,name=type,proto3,enum=system.service.v1.MenuType,oneof" json:"type,omitempty"` + Status *string `protobuf:"bytes,6,opt,name=status,proto3,oneof" json:"status,omitempty"` + Path *string `protobuf:"bytes,7,opt,name=path,proto3,oneof" json:"path,omitempty"` + Title *string `protobuf:"bytes,8,opt,name=title,proto3,oneof" json:"title,omitempty"` + Component *string `protobuf:"bytes,9,opt,name=component,proto3,oneof" json:"component,omitempty"` + Icon *string `protobuf:"bytes,10,opt,name=icon,proto3,oneof" json:"icon,omitempty"` + Permissions []string `protobuf:"bytes,11,rep,name=permissions,proto3" json:"permissions,omitempty"` + Children []*Menu `protobuf:"bytes,12,rep,name=children,proto3" json:"children,omitempty"` + KeepAlive *bool `protobuf:"varint,13,opt,name=keepAlive,proto3,oneof" json:"keepAlive,omitempty"` + Show *bool `protobuf:"varint,14,opt,name=show,proto3,oneof" json:"show,omitempty"` + IsExt *bool `protobuf:"varint,15,opt,name=isExt,proto3,oneof" json:"isExt,omitempty"` + ExtUrl *string `protobuf:"bytes,16,opt,name=extUrl,proto3,oneof" json:"extUrl,omitempty"` + HideBreadcrumb *bool `protobuf:"varint,17,opt,name=hideBreadcrumb,proto3,oneof" json:"hideBreadcrumb,omitempty"` + HideTab *bool `protobuf:"varint,18,opt,name=hideTab,proto3,oneof" json:"hideTab,omitempty"` + HideMenu *bool `protobuf:"varint,19,opt,name=hideMenu,proto3,oneof" json:"hideMenu,omitempty"` + HideChildrenInMenu *bool `protobuf:"varint,20,opt,name=hideChildrenInMenu,proto3,oneof" json:"hideChildrenInMenu,omitempty"` + HidePathForChildren *bool `protobuf:"varint,21,opt,name=hidePathForChildren,proto3,oneof" json:"hidePathForChildren,omitempty"` + CurrentActiveMenu *string `protobuf:"bytes,22,opt,name=currentActiveMenu,proto3,oneof" json:"currentActiveMenu,omitempty"` + Redirect *string `protobuf:"bytes,23,opt,name=redirect,proto3,oneof" json:"redirect,omitempty"` + CreateTime *string `protobuf:"bytes,30,opt,name=createTime,proto3,oneof" json:"createTime,omitempty"` + UpdateTime *string `protobuf:"bytes,31,opt,name=updateTime,proto3,oneof" json:"updateTime,omitempty"` + DeleteTime *string `protobuf:"bytes,32,opt,name=deleteTime,proto3,oneof" json:"deleteTime,omitempty"` +} + +func (x *Menu) Reset() { + *x = Menu{} + if protoimpl.UnsafeEnabled { + mi := &file_system_service_v1_menu_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Menu) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Menu) ProtoMessage() {} + +func (x *Menu) ProtoReflect() protoreflect.Message { + mi := &file_system_service_v1_menu_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Menu.ProtoReflect.Descriptor instead. +func (*Menu) Descriptor() ([]byte, []int) { + return file_system_service_v1_menu_proto_rawDescGZIP(), []int{0} +} + +func (x *Menu) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Menu) GetParentId() int32 { + if x != nil && x.ParentId != nil { + return *x.ParentId + } + return 0 +} + +func (x *Menu) GetOrderNo() int32 { + if x != nil && x.OrderNo != nil { + return *x.OrderNo + } + return 0 +} + +func (x *Menu) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +func (x *Menu) GetType() MenuType { + if x != nil && x.Type != nil { + return *x.Type + } + return MenuType_FOLDER +} + +func (x *Menu) GetStatus() string { + if x != nil && x.Status != nil { + return *x.Status + } + return "" +} + +func (x *Menu) GetPath() string { + if x != nil && x.Path != nil { + return *x.Path + } + return "" +} + +func (x *Menu) GetTitle() string { + if x != nil && x.Title != nil { + return *x.Title + } + return "" +} + +func (x *Menu) GetComponent() string { + if x != nil && x.Component != nil { + return *x.Component + } + return "" +} + +func (x *Menu) GetIcon() string { + if x != nil && x.Icon != nil { + return *x.Icon + } + return "" +} + +func (x *Menu) GetPermissions() []string { + if x != nil { + return x.Permissions + } + return nil +} + +func (x *Menu) GetChildren() []*Menu { + if x != nil { + return x.Children + } + return nil +} + +func (x *Menu) GetKeepAlive() bool { + if x != nil && x.KeepAlive != nil { + return *x.KeepAlive + } + return false +} + +func (x *Menu) GetShow() bool { + if x != nil && x.Show != nil { + return *x.Show + } + return false +} + +func (x *Menu) GetIsExt() bool { + if x != nil && x.IsExt != nil { + return *x.IsExt + } + return false +} + +func (x *Menu) GetExtUrl() string { + if x != nil && x.ExtUrl != nil { + return *x.ExtUrl + } + return "" +} + +func (x *Menu) GetHideBreadcrumb() bool { + if x != nil && x.HideBreadcrumb != nil { + return *x.HideBreadcrumb + } + return false +} + +func (x *Menu) GetHideTab() bool { + if x != nil && x.HideTab != nil { + return *x.HideTab + } + return false +} + +func (x *Menu) GetHideMenu() bool { + if x != nil && x.HideMenu != nil { + return *x.HideMenu + } + return false +} + +func (x *Menu) GetHideChildrenInMenu() bool { + if x != nil && x.HideChildrenInMenu != nil { + return *x.HideChildrenInMenu + } + return false +} + +func (x *Menu) GetHidePathForChildren() bool { + if x != nil && x.HidePathForChildren != nil { + return *x.HidePathForChildren + } + return false +} + +func (x *Menu) GetCurrentActiveMenu() string { + if x != nil && x.CurrentActiveMenu != nil { + return *x.CurrentActiveMenu + } + return "" +} + +func (x *Menu) GetRedirect() string { + if x != nil && x.Redirect != nil { + return *x.Redirect + } + return "" +} + +func (x *Menu) GetCreateTime() string { + if x != nil && x.CreateTime != nil { + return *x.CreateTime + } + return "" +} + +func (x *Menu) GetUpdateTime() string { + if x != nil && x.UpdateTime != nil { + return *x.UpdateTime + } + return "" +} + +func (x *Menu) GetDeleteTime() string { + if x != nil && x.DeleteTime != nil { + return *x.DeleteTime + } + return "" +} + +// 查询菜单列表 - 回应 +type ListMenuResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Items []*Menu `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` + Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` +} + +func (x *ListMenuResponse) Reset() { + *x = ListMenuResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_system_service_v1_menu_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListMenuResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListMenuResponse) ProtoMessage() {} + +func (x *ListMenuResponse) ProtoReflect() protoreflect.Message { + mi := &file_system_service_v1_menu_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListMenuResponse.ProtoReflect.Descriptor instead. +func (*ListMenuResponse) Descriptor() ([]byte, []int) { + return file_system_service_v1_menu_proto_rawDescGZIP(), []int{1} +} + +func (x *ListMenuResponse) GetItems() []*Menu { + if x != nil { + return x.Items + } + return nil +} + +func (x *ListMenuResponse) GetTotal() int32 { + if x != nil { + return x.Total + } + return 0 +} + +// 查询菜单详情 - 请求 +type GetMenuRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GetMenuRequest) Reset() { + *x = GetMenuRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_system_service_v1_menu_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetMenuRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetMenuRequest) ProtoMessage() {} + +func (x *GetMenuRequest) ProtoReflect() protoreflect.Message { + mi := &file_system_service_v1_menu_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetMenuRequest.ProtoReflect.Descriptor instead. +func (*GetMenuRequest) Descriptor() ([]byte, []int) { + return file_system_service_v1_menu_proto_rawDescGZIP(), []int{2} +} + +func (x *GetMenuRequest) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +// 创建菜单 - 请求 +type CreateMenuRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Menu *Menu `protobuf:"bytes,1,opt,name=menu,proto3" json:"menu,omitempty"` + OperatorId *uint32 `protobuf:"varint,2,opt,name=operatorId,proto3,oneof" json:"operatorId,omitempty"` +} + +func (x *CreateMenuRequest) Reset() { + *x = CreateMenuRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_system_service_v1_menu_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateMenuRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateMenuRequest) ProtoMessage() {} + +func (x *CreateMenuRequest) ProtoReflect() protoreflect.Message { + mi := &file_system_service_v1_menu_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateMenuRequest.ProtoReflect.Descriptor instead. +func (*CreateMenuRequest) Descriptor() ([]byte, []int) { + return file_system_service_v1_menu_proto_rawDescGZIP(), []int{3} +} + +func (x *CreateMenuRequest) GetMenu() *Menu { + if x != nil { + return x.Menu + } + return nil +} + +func (x *CreateMenuRequest) GetOperatorId() uint32 { + if x != nil && x.OperatorId != nil { + return *x.OperatorId + } + return 0 +} + +// 更新菜单 - 请求 +type UpdateMenuRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Menu *Menu `protobuf:"bytes,1,opt,name=menu,proto3" json:"menu,omitempty"` + OperatorId *uint32 `protobuf:"varint,3,opt,name=operatorId,proto3,oneof" json:"operatorId,omitempty"` +} + +func (x *UpdateMenuRequest) Reset() { + *x = UpdateMenuRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_system_service_v1_menu_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateMenuRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateMenuRequest) ProtoMessage() {} + +func (x *UpdateMenuRequest) ProtoReflect() protoreflect.Message { + mi := &file_system_service_v1_menu_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateMenuRequest.ProtoReflect.Descriptor instead. +func (*UpdateMenuRequest) Descriptor() ([]byte, []int) { + return file_system_service_v1_menu_proto_rawDescGZIP(), []int{4} +} + +func (x *UpdateMenuRequest) GetMenu() *Menu { + if x != nil { + return x.Menu + } + return nil +} + +func (x *UpdateMenuRequest) GetOperatorId() uint32 { + if x != nil && x.OperatorId != nil { + return *x.OperatorId + } + return 0 +} + +// 删除菜单 - 请求 +type DeleteMenuRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + OperatorId *uint32 `protobuf:"varint,2,opt,name=operatorId,proto3,oneof" json:"operatorId,omitempty"` +} + +func (x *DeleteMenuRequest) Reset() { + *x = DeleteMenuRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_system_service_v1_menu_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteMenuRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteMenuRequest) ProtoMessage() {} + +func (x *DeleteMenuRequest) ProtoReflect() protoreflect.Message { + mi := &file_system_service_v1_menu_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteMenuRequest.ProtoReflect.Descriptor instead. +func (*DeleteMenuRequest) Descriptor() ([]byte, []int) { + return file_system_service_v1_menu_proto_rawDescGZIP(), []int{5} +} + +func (x *DeleteMenuRequest) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *DeleteMenuRequest) GetOperatorId() uint32 { + if x != nil && x.OperatorId != nil { + return *x.OperatorId + } + return 0 +} + +var File_system_service_v1_menu_proto protoreflect.FileDescriptor + +var file_system_service_v1_menu_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, 0x6e, 0x75, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, + 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, + 0x31, 0x1a, 0x24, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1e, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, + 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x8d, 0x0a, 0x0a, 0x04, 0x4d, 0x65, 0x6e, 0x75, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x08, 0x70, + 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, + 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x07, + 0x6f, 0x72, 0x64, 0x65, 0x72, 0x4e, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x48, 0x01, 0x52, + 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x4e, 0x6f, 0x88, 0x01, 0x01, 0x12, 0x17, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x88, 0x01, 0x01, 0x12, 0x4d, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x6e, 0x75, 0x54, 0x79, 0x70, 0x65, 0x42, + 0x17, 0xba, 0x47, 0x14, 0x8a, 0x02, 0x08, 0x1a, 0x06, 0x46, 0x4f, 0x4c, 0x44, 0x45, 0x52, 0x92, + 0x02, 0x06, 0xe7, 0xb1, 0xbb, 0xe5, 0x9e, 0x8b, 0x48, 0x03, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x88, 0x01, 0x01, 0x12, 0x3f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x22, 0xba, 0x47, 0x1f, 0xc2, 0x01, 0x04, 0x12, 0x02, 0x4f, 0x4e, 0xc2, + 0x01, 0x05, 0x12, 0x03, 0x4f, 0x46, 0x46, 0x8a, 0x02, 0x04, 0x1a, 0x02, 0x4f, 0x4e, 0x92, 0x02, + 0x06, 0xe7, 0x8a, 0xb6, 0xe6, 0x80, 0x81, 0x48, 0x04, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x88, 0x01, 0x01, 0x12, 0x17, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x09, 0x48, 0x05, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x48, 0x06, 0x52, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x70, + 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x48, 0x07, 0x52, 0x09, 0x63, + 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x88, 0x01, 0x01, 0x12, 0x17, 0x0a, 0x04, 0x69, + 0x63, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x48, 0x08, 0x52, 0x04, 0x69, 0x63, 0x6f, + 0x6e, 0x88, 0x01, 0x01, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x33, 0x0a, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, + 0x65, 0x6e, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x6e, + 0x75, 0x52, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x12, 0x21, 0x0a, 0x09, 0x6b, + 0x65, 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x48, 0x09, + 0x52, 0x09, 0x6b, 0x65, 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x88, 0x01, 0x01, 0x12, 0x17, + 0x0a, 0x04, 0x73, 0x68, 0x6f, 0x77, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x48, 0x0a, 0x52, 0x04, + 0x73, 0x68, 0x6f, 0x77, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x69, 0x73, 0x45, 0x78, 0x74, + 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x48, 0x0b, 0x52, 0x05, 0x69, 0x73, 0x45, 0x78, 0x74, 0x88, + 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x06, 0x65, 0x78, 0x74, 0x55, 0x72, 0x6c, 0x18, 0x10, 0x20, 0x01, + 0x28, 0x09, 0x48, 0x0c, 0x52, 0x06, 0x65, 0x78, 0x74, 0x55, 0x72, 0x6c, 0x88, 0x01, 0x01, 0x12, + 0x2b, 0x0a, 0x0e, 0x68, 0x69, 0x64, 0x65, 0x42, 0x72, 0x65, 0x61, 0x64, 0x63, 0x72, 0x75, 0x6d, + 0x62, 0x18, 0x11, 0x20, 0x01, 0x28, 0x08, 0x48, 0x0d, 0x52, 0x0e, 0x68, 0x69, 0x64, 0x65, 0x42, + 0x72, 0x65, 0x61, 0x64, 0x63, 0x72, 0x75, 0x6d, 0x62, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x07, + 0x68, 0x69, 0x64, 0x65, 0x54, 0x61, 0x62, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, 0x48, 0x0e, 0x52, + 0x07, 0x68, 0x69, 0x64, 0x65, 0x54, 0x61, 0x62, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, 0x68, + 0x69, 0x64, 0x65, 0x4d, 0x65, 0x6e, 0x75, 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, 0x48, 0x0f, 0x52, + 0x08, 0x68, 0x69, 0x64, 0x65, 0x4d, 0x65, 0x6e, 0x75, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x12, + 0x68, 0x69, 0x64, 0x65, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x49, 0x6e, 0x4d, 0x65, + 0x6e, 0x75, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x48, 0x10, 0x52, 0x12, 0x68, 0x69, 0x64, 0x65, + 0x43, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x49, 0x6e, 0x4d, 0x65, 0x6e, 0x75, 0x88, 0x01, + 0x01, 0x12, 0x35, 0x0a, 0x13, 0x68, 0x69, 0x64, 0x65, 0x50, 0x61, 0x74, 0x68, 0x46, 0x6f, 0x72, + 0x43, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x18, 0x15, 0x20, 0x01, 0x28, 0x08, 0x48, 0x11, + 0x52, 0x13, 0x68, 0x69, 0x64, 0x65, 0x50, 0x61, 0x74, 0x68, 0x46, 0x6f, 0x72, 0x43, 0x68, 0x69, + 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x31, 0x0a, 0x11, 0x63, 0x75, 0x72, 0x72, + 0x65, 0x6e, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4d, 0x65, 0x6e, 0x75, 0x18, 0x16, 0x20, + 0x01, 0x28, 0x09, 0x48, 0x12, 0x52, 0x11, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x41, 0x63, + 0x74, 0x69, 0x76, 0x65, 0x4d, 0x65, 0x6e, 0x75, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, 0x72, + 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x18, 0x17, 0x20, 0x01, 0x28, 0x09, 0x48, 0x13, 0x52, + 0x08, 0x72, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x14, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, + 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, + 0x1f, 0x20, 0x01, 0x28, 0x09, 0x48, 0x15, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, + 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x54, 0x69, 0x6d, 0x65, 0x18, 0x20, 0x20, 0x01, 0x28, 0x09, 0x48, 0x16, 0x52, 0x0a, 0x64, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, + 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x6f, 0x72, 0x64, + 0x65, 0x72, 0x4e, 0x6f, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x07, 0x0a, + 0x05, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, + 0x6e, 0x74, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x69, 0x63, 0x6f, 0x6e, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, + 0x6b, 0x65, 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x73, 0x68, + 0x6f, 0x77, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x69, 0x73, 0x45, 0x78, 0x74, 0x42, 0x09, 0x0a, 0x07, + 0x5f, 0x65, 0x78, 0x74, 0x55, 0x72, 0x6c, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x68, 0x69, 0x64, 0x65, + 0x42, 0x72, 0x65, 0x61, 0x64, 0x63, 0x72, 0x75, 0x6d, 0x62, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x68, + 0x69, 0x64, 0x65, 0x54, 0x61, 0x62, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x68, 0x69, 0x64, 0x65, 0x4d, + 0x65, 0x6e, 0x75, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x68, 0x69, 0x64, 0x65, 0x43, 0x68, 0x69, 0x6c, + 0x64, 0x72, 0x65, 0x6e, 0x49, 0x6e, 0x4d, 0x65, 0x6e, 0x75, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x68, + 0x69, 0x64, 0x65, 0x50, 0x61, 0x74, 0x68, 0x46, 0x6f, 0x72, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x72, + 0x65, 0x6e, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x41, 0x63, + 0x74, 0x69, 0x76, 0x65, 0x4d, 0x65, 0x6e, 0x75, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x72, 0x65, 0x64, + 0x69, 0x72, 0x65, 0x63, 0x74, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x54, 0x69, 0x6d, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, + 0x69, 0x6d, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, + 0x6d, 0x65, 0x22, 0x57, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6e, 0x75, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x6e, 0x75, 0x52, 0x05, + 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x20, 0x0a, 0x0e, 0x47, + 0x65, 0x74, 0x4d, 0x65, 0x6e, 0x75, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x74, 0x0a, + 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6e, 0x75, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x6d, 0x65, 0x6e, 0x75, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x6e, 0x75, 0x52, 0x04, 0x6d, 0x65, 0x6e, 0x75, 0x12, + 0x23, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, + 0x64, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, + 0x72, 0x49, 0x64, 0x22, 0x74, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6e, + 0x75, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x6d, 0x65, 0x6e, 0x75, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x6e, 0x75, 0x52, + 0x04, 0x6d, 0x65, 0x6e, 0x75, 0x12, 0x23, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, + 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0a, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x6f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x57, 0x0a, 0x11, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6e, 0x75, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x23, + 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, + 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, + 0x49, 0x64, 0x2a, 0x2c, 0x0a, 0x08, 0x4d, 0x65, 0x6e, 0x75, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, + 0x0a, 0x06, 0x46, 0x4f, 0x4c, 0x44, 0x45, 0x52, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4d, 0x45, + 0x4e, 0x55, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x42, 0x55, 0x54, 0x54, 0x4f, 0x4e, 0x10, 0x02, + 0x32, 0x8e, 0x03, 0x0a, 0x0b, 0x4d, 0x65, 0x6e, 0x75, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x4c, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6e, 0x75, 0x12, 0x19, 0x2e, 0x70, + 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x4d, 0x65, 0x6e, 0x75, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x47, + 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6e, 0x75, 0x12, 0x21, 0x2e, 0x73, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, + 0x74, 0x4d, 0x65, 0x6e, 0x75, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x73, + 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x65, 0x6e, 0x75, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x4d, 0x65, 0x6e, 0x75, 0x12, 0x24, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x4d, 0x65, 0x6e, 0x75, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, + 0x65, 0x6e, 0x75, 0x12, 0x24, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, + 0x6e, 0x75, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6e, + 0x75, 0x12, 0x24, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6e, 0x75, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, + 0x00, 0x42, 0xc7, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x09, 0x4d, 0x65, 0x6e, + 0x75, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3d, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, + 0x2d, 0x6d, 0x6f, 0x6e, 0x6f, 0x6c, 0x69, 0x74, 0x68, 0x69, 0x63, 0x2d, 0x64, 0x65, 0x6d, 0x6f, + 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x73, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x53, 0x58, 0xaa, 0x02, 0x11, + 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x56, + 0x31, 0xca, 0x02, 0x11, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1d, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5c, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x3a, 0x3a, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_system_service_v1_menu_proto_rawDescOnce sync.Once + file_system_service_v1_menu_proto_rawDescData = file_system_service_v1_menu_proto_rawDesc +) + +func file_system_service_v1_menu_proto_rawDescGZIP() []byte { + file_system_service_v1_menu_proto_rawDescOnce.Do(func() { + file_system_service_v1_menu_proto_rawDescData = protoimpl.X.CompressGZIP(file_system_service_v1_menu_proto_rawDescData) + }) + return file_system_service_v1_menu_proto_rawDescData +} + +var file_system_service_v1_menu_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_system_service_v1_menu_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_system_service_v1_menu_proto_goTypes = []interface{}{ + (MenuType)(0), // 0: system.service.v1.MenuType + (*Menu)(nil), // 1: system.service.v1.Menu + (*ListMenuResponse)(nil), // 2: system.service.v1.ListMenuResponse + (*GetMenuRequest)(nil), // 3: system.service.v1.GetMenuRequest + (*CreateMenuRequest)(nil), // 4: system.service.v1.CreateMenuRequest + (*UpdateMenuRequest)(nil), // 5: system.service.v1.UpdateMenuRequest + (*DeleteMenuRequest)(nil), // 6: system.service.v1.DeleteMenuRequest + (*v1.PagingRequest)(nil), // 7: pagination.PagingRequest + (*emptypb.Empty)(nil), // 8: google.protobuf.Empty +} +var file_system_service_v1_menu_proto_depIdxs = []int32{ + 0, // 0: system.service.v1.Menu.type:type_name -> system.service.v1.MenuType + 1, // 1: system.service.v1.Menu.children:type_name -> system.service.v1.Menu + 1, // 2: system.service.v1.ListMenuResponse.items:type_name -> system.service.v1.Menu + 1, // 3: system.service.v1.CreateMenuRequest.menu:type_name -> system.service.v1.Menu + 1, // 4: system.service.v1.UpdateMenuRequest.menu:type_name -> system.service.v1.Menu + 7, // 5: system.service.v1.MenuService.ListMenu:input_type -> pagination.PagingRequest + 3, // 6: system.service.v1.MenuService.GetMenu:input_type -> system.service.v1.GetMenuRequest + 4, // 7: system.service.v1.MenuService.CreateMenu:input_type -> system.service.v1.CreateMenuRequest + 5, // 8: system.service.v1.MenuService.UpdateMenu:input_type -> system.service.v1.UpdateMenuRequest + 6, // 9: system.service.v1.MenuService.DeleteMenu:input_type -> system.service.v1.DeleteMenuRequest + 2, // 10: system.service.v1.MenuService.ListMenu:output_type -> system.service.v1.ListMenuResponse + 1, // 11: system.service.v1.MenuService.GetMenu:output_type -> system.service.v1.Menu + 8, // 12: system.service.v1.MenuService.CreateMenu:output_type -> google.protobuf.Empty + 8, // 13: system.service.v1.MenuService.UpdateMenu:output_type -> google.protobuf.Empty + 8, // 14: system.service.v1.MenuService.DeleteMenu:output_type -> google.protobuf.Empty + 10, // [10:15] is the sub-list for method output_type + 5, // [5:10] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_system_service_v1_menu_proto_init() } +func file_system_service_v1_menu_proto_init() { + if File_system_service_v1_menu_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_system_service_v1_menu_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Menu); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_service_v1_menu_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListMenuResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_service_v1_menu_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetMenuRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_service_v1_menu_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateMenuRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_service_v1_menu_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateMenuRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_service_v1_menu_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteMenuRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_system_service_v1_menu_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_system_service_v1_menu_proto_msgTypes[3].OneofWrappers = []interface{}{} + file_system_service_v1_menu_proto_msgTypes[4].OneofWrappers = []interface{}{} + file_system_service_v1_menu_proto_msgTypes[5].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_system_service_v1_menu_proto_rawDesc, + NumEnums: 1, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_system_service_v1_menu_proto_goTypes, + DependencyIndexes: file_system_service_v1_menu_proto_depIdxs, + EnumInfos: file_system_service_v1_menu_proto_enumTypes, + MessageInfos: file_system_service_v1_menu_proto_msgTypes, + }.Build() + File_system_service_v1_menu_proto = out.File + file_system_service_v1_menu_proto_rawDesc = nil + file_system_service_v1_menu_proto_goTypes = nil + file_system_service_v1_menu_proto_depIdxs = nil +} diff --git a/monolithic/backend/gen/api/go/system/service/v1/menu.pb.validate.go b/monolithic/backend/gen/api/go/system/service/v1/menu.pb.validate.go new file mode 100644 index 0000000..80c6330 --- /dev/null +++ b/monolithic/backend/gen/api/go/system/service/v1/menu.pb.validate.go @@ -0,0 +1,878 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: system/service/v1/menu.proto + +package servicev1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on Menu with the rules defined in the proto +// definition for this message. If any rules are violated, the first error +// encountered is returned, or nil if there are no violations. +func (m *Menu) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Menu with the rules defined in the +// proto definition for this message. If any rules are violated, the result is +// a list of violation errors wrapped in MenuMultiError, or nil if none found. +func (m *Menu) ValidateAll() error { + return m.validate(true) +} + +func (m *Menu) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + for idx, item := range m.GetChildren() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, MenuValidationError{ + field: fmt.Sprintf("Children[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, MenuValidationError{ + field: fmt.Sprintf("Children[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return MenuValidationError{ + field: fmt.Sprintf("Children[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if m.ParentId != nil { + // no validation rules for ParentId + } + + if m.OrderNo != nil { + // no validation rules for OrderNo + } + + if m.Name != nil { + // no validation rules for Name + } + + if m.Type != nil { + // no validation rules for Type + } + + if m.Status != nil { + // no validation rules for Status + } + + if m.Path != nil { + // no validation rules for Path + } + + if m.Title != nil { + // no validation rules for Title + } + + if m.Component != nil { + // no validation rules for Component + } + + if m.Icon != nil { + // no validation rules for Icon + } + + if m.KeepAlive != nil { + // no validation rules for KeepAlive + } + + if m.Show != nil { + // no validation rules for Show + } + + if m.IsExt != nil { + // no validation rules for IsExt + } + + if m.ExtUrl != nil { + // no validation rules for ExtUrl + } + + if m.HideBreadcrumb != nil { + // no validation rules for HideBreadcrumb + } + + if m.HideTab != nil { + // no validation rules for HideTab + } + + if m.HideMenu != nil { + // no validation rules for HideMenu + } + + if m.HideChildrenInMenu != nil { + // no validation rules for HideChildrenInMenu + } + + if m.HidePathForChildren != nil { + // no validation rules for HidePathForChildren + } + + if m.CurrentActiveMenu != nil { + // no validation rules for CurrentActiveMenu + } + + if m.Redirect != nil { + // no validation rules for Redirect + } + + if m.CreateTime != nil { + // no validation rules for CreateTime + } + + if m.UpdateTime != nil { + // no validation rules for UpdateTime + } + + if m.DeleteTime != nil { + // no validation rules for DeleteTime + } + + if len(errors) > 0 { + return MenuMultiError(errors) + } + + return nil +} + +// MenuMultiError is an error wrapping multiple validation errors returned by +// Menu.ValidateAll() if the designated constraints aren't met. +type MenuMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m MenuMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m MenuMultiError) AllErrors() []error { return m } + +// MenuValidationError is the validation error returned by Menu.Validate if the +// designated constraints aren't met. +type MenuValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e MenuValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e MenuValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e MenuValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e MenuValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e MenuValidationError) ErrorName() string { return "MenuValidationError" } + +// Error satisfies the builtin error interface +func (e MenuValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sMenu.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = MenuValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = MenuValidationError{} + +// Validate checks the field values on ListMenuResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *ListMenuResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ListMenuResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ListMenuResponseMultiError, or nil if none found. +func (m *ListMenuResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *ListMenuResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + for idx, item := range m.GetItems() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ListMenuResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ListMenuResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ListMenuResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + // no validation rules for Total + + if len(errors) > 0 { + return ListMenuResponseMultiError(errors) + } + + return nil +} + +// ListMenuResponseMultiError is an error wrapping multiple validation errors +// returned by ListMenuResponse.ValidateAll() if the designated constraints +// aren't met. +type ListMenuResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ListMenuResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ListMenuResponseMultiError) AllErrors() []error { return m } + +// ListMenuResponseValidationError is the validation error returned by +// ListMenuResponse.Validate if the designated constraints aren't met. +type ListMenuResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ListMenuResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ListMenuResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ListMenuResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ListMenuResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ListMenuResponseValidationError) ErrorName() string { return "ListMenuResponseValidationError" } + +// Error satisfies the builtin error interface +func (e ListMenuResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sListMenuResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ListMenuResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ListMenuResponseValidationError{} + +// Validate checks the field values on GetMenuRequest with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *GetMenuRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetMenuRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in GetMenuRequestMultiError, +// or nil if none found. +func (m *GetMenuRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *GetMenuRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if len(errors) > 0 { + return GetMenuRequestMultiError(errors) + } + + return nil +} + +// GetMenuRequestMultiError is an error wrapping multiple validation errors +// returned by GetMenuRequest.ValidateAll() if the designated constraints +// aren't met. +type GetMenuRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetMenuRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetMenuRequestMultiError) AllErrors() []error { return m } + +// GetMenuRequestValidationError is the validation error returned by +// GetMenuRequest.Validate if the designated constraints aren't met. +type GetMenuRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetMenuRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetMenuRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetMenuRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetMenuRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetMenuRequestValidationError) ErrorName() string { return "GetMenuRequestValidationError" } + +// Error satisfies the builtin error interface +func (e GetMenuRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetMenuRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetMenuRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetMenuRequestValidationError{} + +// Validate checks the field values on CreateMenuRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *CreateMenuRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on CreateMenuRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// CreateMenuRequestMultiError, or nil if none found. +func (m *CreateMenuRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *CreateMenuRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetMenu()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CreateMenuRequestValidationError{ + field: "Menu", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CreateMenuRequestValidationError{ + field: "Menu", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMenu()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateMenuRequestValidationError{ + field: "Menu", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if m.OperatorId != nil { + // no validation rules for OperatorId + } + + if len(errors) > 0 { + return CreateMenuRequestMultiError(errors) + } + + return nil +} + +// CreateMenuRequestMultiError is an error wrapping multiple validation errors +// returned by CreateMenuRequest.ValidateAll() if the designated constraints +// aren't met. +type CreateMenuRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m CreateMenuRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m CreateMenuRequestMultiError) AllErrors() []error { return m } + +// CreateMenuRequestValidationError is the validation error returned by +// CreateMenuRequest.Validate if the designated constraints aren't met. +type CreateMenuRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CreateMenuRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CreateMenuRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CreateMenuRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CreateMenuRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CreateMenuRequestValidationError) ErrorName() string { + return "CreateMenuRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e CreateMenuRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCreateMenuRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CreateMenuRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CreateMenuRequestValidationError{} + +// Validate checks the field values on UpdateMenuRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *UpdateMenuRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on UpdateMenuRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// UpdateMenuRequestMultiError, or nil if none found. +func (m *UpdateMenuRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *UpdateMenuRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetMenu()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UpdateMenuRequestValidationError{ + field: "Menu", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UpdateMenuRequestValidationError{ + field: "Menu", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMenu()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpdateMenuRequestValidationError{ + field: "Menu", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if m.OperatorId != nil { + // no validation rules for OperatorId + } + + if len(errors) > 0 { + return UpdateMenuRequestMultiError(errors) + } + + return nil +} + +// UpdateMenuRequestMultiError is an error wrapping multiple validation errors +// returned by UpdateMenuRequest.ValidateAll() if the designated constraints +// aren't met. +type UpdateMenuRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UpdateMenuRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m UpdateMenuRequestMultiError) AllErrors() []error { return m } + +// UpdateMenuRequestValidationError is the validation error returned by +// UpdateMenuRequest.Validate if the designated constraints aren't met. +type UpdateMenuRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UpdateMenuRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UpdateMenuRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UpdateMenuRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UpdateMenuRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UpdateMenuRequestValidationError) ErrorName() string { + return "UpdateMenuRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e UpdateMenuRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUpdateMenuRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UpdateMenuRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UpdateMenuRequestValidationError{} + +// Validate checks the field values on DeleteMenuRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *DeleteMenuRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on DeleteMenuRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// DeleteMenuRequestMultiError, or nil if none found. +func (m *DeleteMenuRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *DeleteMenuRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if m.OperatorId != nil { + // no validation rules for OperatorId + } + + if len(errors) > 0 { + return DeleteMenuRequestMultiError(errors) + } + + return nil +} + +// DeleteMenuRequestMultiError is an error wrapping multiple validation errors +// returned by DeleteMenuRequest.ValidateAll() if the designated constraints +// aren't met. +type DeleteMenuRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m DeleteMenuRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m DeleteMenuRequestMultiError) AllErrors() []error { return m } + +// DeleteMenuRequestValidationError is the validation error returned by +// DeleteMenuRequest.Validate if the designated constraints aren't met. +type DeleteMenuRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DeleteMenuRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DeleteMenuRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DeleteMenuRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DeleteMenuRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DeleteMenuRequestValidationError) ErrorName() string { + return "DeleteMenuRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e DeleteMenuRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDeleteMenuRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DeleteMenuRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DeleteMenuRequestValidationError{} diff --git a/monolithic/backend/gen/api/go/system/service/v1/menu_grpc.pb.go b/monolithic/backend/gen/api/go/system/service/v1/menu_grpc.pb.go new file mode 100644 index 0000000..2e95995 --- /dev/null +++ b/monolithic/backend/gen/api/go/system/service/v1/menu_grpc.pb.go @@ -0,0 +1,269 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: system/service/v1/menu.proto + +package servicev1 + +import ( + context "context" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + MenuService_ListMenu_FullMethodName = "/system.service.v1.MenuService/ListMenu" + MenuService_GetMenu_FullMethodName = "/system.service.v1.MenuService/GetMenu" + MenuService_CreateMenu_FullMethodName = "/system.service.v1.MenuService/CreateMenu" + MenuService_UpdateMenu_FullMethodName = "/system.service.v1.MenuService/UpdateMenu" + MenuService_DeleteMenu_FullMethodName = "/system.service.v1.MenuService/DeleteMenu" +) + +// MenuServiceClient is the client API for MenuService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MenuServiceClient interface { + // 查询菜单列表 + ListMenu(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*ListMenuResponse, error) + // 查询菜单详情 + GetMenu(ctx context.Context, in *GetMenuRequest, opts ...grpc.CallOption) (*Menu, error) + // 创建菜单 + CreateMenu(ctx context.Context, in *CreateMenuRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 更新菜单 + UpdateMenu(ctx context.Context, in *UpdateMenuRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 删除菜单 + DeleteMenu(ctx context.Context, in *DeleteMenuRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type menuServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewMenuServiceClient(cc grpc.ClientConnInterface) MenuServiceClient { + return &menuServiceClient{cc} +} + +func (c *menuServiceClient) ListMenu(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*ListMenuResponse, error) { + out := new(ListMenuResponse) + err := c.cc.Invoke(ctx, MenuService_ListMenu_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *menuServiceClient) GetMenu(ctx context.Context, in *GetMenuRequest, opts ...grpc.CallOption) (*Menu, error) { + out := new(Menu) + err := c.cc.Invoke(ctx, MenuService_GetMenu_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *menuServiceClient) CreateMenu(ctx context.Context, in *CreateMenuRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, MenuService_CreateMenu_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *menuServiceClient) UpdateMenu(ctx context.Context, in *UpdateMenuRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, MenuService_UpdateMenu_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *menuServiceClient) DeleteMenu(ctx context.Context, in *DeleteMenuRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, MenuService_DeleteMenu_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MenuServiceServer is the server API for MenuService service. +// All implementations must embed UnimplementedMenuServiceServer +// for forward compatibility +type MenuServiceServer interface { + // 查询菜单列表 + ListMenu(context.Context, *v1.PagingRequest) (*ListMenuResponse, error) + // 查询菜单详情 + GetMenu(context.Context, *GetMenuRequest) (*Menu, error) + // 创建菜单 + CreateMenu(context.Context, *CreateMenuRequest) (*emptypb.Empty, error) + // 更新菜单 + UpdateMenu(context.Context, *UpdateMenuRequest) (*emptypb.Empty, error) + // 删除菜单 + DeleteMenu(context.Context, *DeleteMenuRequest) (*emptypb.Empty, error) + mustEmbedUnimplementedMenuServiceServer() +} + +// UnimplementedMenuServiceServer must be embedded to have forward compatible implementations. +type UnimplementedMenuServiceServer struct { +} + +func (UnimplementedMenuServiceServer) ListMenu(context.Context, *v1.PagingRequest) (*ListMenuResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListMenu not implemented") +} +func (UnimplementedMenuServiceServer) GetMenu(context.Context, *GetMenuRequest) (*Menu, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMenu not implemented") +} +func (UnimplementedMenuServiceServer) CreateMenu(context.Context, *CreateMenuRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateMenu not implemented") +} +func (UnimplementedMenuServiceServer) UpdateMenu(context.Context, *UpdateMenuRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateMenu not implemented") +} +func (UnimplementedMenuServiceServer) DeleteMenu(context.Context, *DeleteMenuRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteMenu not implemented") +} +func (UnimplementedMenuServiceServer) mustEmbedUnimplementedMenuServiceServer() {} + +// UnsafeMenuServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MenuServiceServer will +// result in compilation errors. +type UnsafeMenuServiceServer interface { + mustEmbedUnimplementedMenuServiceServer() +} + +func RegisterMenuServiceServer(s grpc.ServiceRegistrar, srv MenuServiceServer) { + s.RegisterService(&MenuService_ServiceDesc, srv) +} + +func _MenuService_ListMenu_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v1.PagingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MenuServiceServer).ListMenu(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MenuService_ListMenu_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MenuServiceServer).ListMenu(ctx, req.(*v1.PagingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MenuService_GetMenu_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetMenuRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MenuServiceServer).GetMenu(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MenuService_GetMenu_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MenuServiceServer).GetMenu(ctx, req.(*GetMenuRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MenuService_CreateMenu_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateMenuRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MenuServiceServer).CreateMenu(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MenuService_CreateMenu_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MenuServiceServer).CreateMenu(ctx, req.(*CreateMenuRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MenuService_UpdateMenu_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateMenuRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MenuServiceServer).UpdateMenu(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MenuService_UpdateMenu_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MenuServiceServer).UpdateMenu(ctx, req.(*UpdateMenuRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MenuService_DeleteMenu_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteMenuRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MenuServiceServer).DeleteMenu(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MenuService_DeleteMenu_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MenuServiceServer).DeleteMenu(ctx, req.(*DeleteMenuRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// MenuService_ServiceDesc is the grpc.ServiceDesc for MenuService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var MenuService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "system.service.v1.MenuService", + HandlerType: (*MenuServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListMenu", + Handler: _MenuService_ListMenu_Handler, + }, + { + MethodName: "GetMenu", + Handler: _MenuService_GetMenu_Handler, + }, + { + MethodName: "CreateMenu", + Handler: _MenuService_CreateMenu_Handler, + }, + { + MethodName: "UpdateMenu", + Handler: _MenuService_UpdateMenu_Handler, + }, + { + MethodName: "DeleteMenu", + Handler: _MenuService_DeleteMenu_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "system/service/v1/menu.proto", +} diff --git a/monolithic/backend/gen/api/go/user/service/v1/organization.pb.go b/monolithic/backend/gen/api/go/user/service/v1/organization.pb.go new file mode 100644 index 0000000..79eef71 --- /dev/null +++ b/monolithic/backend/gen/api/go/user/service/v1/organization.pb.go @@ -0,0 +1,684 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: user/service/v1/organization.proto + +package servicev1 + +import ( + _ "github.com/google/gnostic/openapiv3" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 部门 +type Organization struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name *string `protobuf:"bytes,2,opt,name=name,proto3,oneof" json:"name,omitempty"` + ParentId *uint32 `protobuf:"varint,3,opt,name=parentId,proto3,oneof" json:"parentId,omitempty"` + OrderNo *int32 `protobuf:"varint,4,opt,name=orderNo,proto3,oneof" json:"orderNo,omitempty"` + Status *string `protobuf:"bytes,5,opt,name=status,proto3,oneof" json:"status,omitempty"` + Remark *string `protobuf:"bytes,6,opt,name=remark,proto3,oneof" json:"remark,omitempty"` + Children []*Organization `protobuf:"bytes,7,rep,name=children,proto3" json:"children,omitempty"` + CreateTime *string `protobuf:"bytes,20,opt,name=createTime,proto3,oneof" json:"createTime,omitempty"` // 创建时间 + UpdateTime *string `protobuf:"bytes,21,opt,name=updateTime,proto3,oneof" json:"updateTime,omitempty"` // 更新时间 + DeleteTime *string `protobuf:"bytes,22,opt,name=deleteTime,proto3,oneof" json:"deleteTime,omitempty"` // 删除时间 +} + +func (x *Organization) Reset() { + *x = Organization{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_organization_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Organization) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Organization) ProtoMessage() {} + +func (x *Organization) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_organization_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Organization.ProtoReflect.Descriptor instead. +func (*Organization) Descriptor() ([]byte, []int) { + return file_user_service_v1_organization_proto_rawDescGZIP(), []int{0} +} + +func (x *Organization) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Organization) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +func (x *Organization) GetParentId() uint32 { + if x != nil && x.ParentId != nil { + return *x.ParentId + } + return 0 +} + +func (x *Organization) GetOrderNo() int32 { + if x != nil && x.OrderNo != nil { + return *x.OrderNo + } + return 0 +} + +func (x *Organization) GetStatus() string { + if x != nil && x.Status != nil { + return *x.Status + } + return "" +} + +func (x *Organization) GetRemark() string { + if x != nil && x.Remark != nil { + return *x.Remark + } + return "" +} + +func (x *Organization) GetChildren() []*Organization { + if x != nil { + return x.Children + } + return nil +} + +func (x *Organization) GetCreateTime() string { + if x != nil && x.CreateTime != nil { + return *x.CreateTime + } + return "" +} + +func (x *Organization) GetUpdateTime() string { + if x != nil && x.UpdateTime != nil { + return *x.UpdateTime + } + return "" +} + +func (x *Organization) GetDeleteTime() string { + if x != nil && x.DeleteTime != nil { + return *x.DeleteTime + } + return "" +} + +// 部门列表 - 答复 +type ListOrganizationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Items []*Organization `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` + Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` +} + +func (x *ListOrganizationResponse) Reset() { + *x = ListOrganizationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_organization_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListOrganizationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListOrganizationResponse) ProtoMessage() {} + +func (x *ListOrganizationResponse) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_organization_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListOrganizationResponse.ProtoReflect.Descriptor instead. +func (*ListOrganizationResponse) Descriptor() ([]byte, []int) { + return file_user_service_v1_organization_proto_rawDescGZIP(), []int{1} +} + +func (x *ListOrganizationResponse) GetItems() []*Organization { + if x != nil { + return x.Items + } + return nil +} + +func (x *ListOrganizationResponse) GetTotal() int32 { + if x != nil { + return x.Total + } + return 0 +} + +// 部门数据 - 请求 +type GetOrganizationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GetOrganizationRequest) Reset() { + *x = GetOrganizationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_organization_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetOrganizationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetOrganizationRequest) ProtoMessage() {} + +func (x *GetOrganizationRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_organization_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetOrganizationRequest.ProtoReflect.Descriptor instead. +func (*GetOrganizationRequest) Descriptor() ([]byte, []int) { + return file_user_service_v1_organization_proto_rawDescGZIP(), []int{2} +} + +func (x *GetOrganizationRequest) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +// 创建部门 - 请求 +type CreateOrganizationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OperatorId *uint32 `protobuf:"varint,1,opt,name=operatorId,proto3,oneof" json:"operatorId,omitempty"` + Org *Organization `protobuf:"bytes,2,opt,name=org,proto3" json:"org,omitempty"` +} + +func (x *CreateOrganizationRequest) Reset() { + *x = CreateOrganizationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_organization_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateOrganizationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateOrganizationRequest) ProtoMessage() {} + +func (x *CreateOrganizationRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_organization_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateOrganizationRequest.ProtoReflect.Descriptor instead. +func (*CreateOrganizationRequest) Descriptor() ([]byte, []int) { + return file_user_service_v1_organization_proto_rawDescGZIP(), []int{3} +} + +func (x *CreateOrganizationRequest) GetOperatorId() uint32 { + if x != nil && x.OperatorId != nil { + return *x.OperatorId + } + return 0 +} + +func (x *CreateOrganizationRequest) GetOrg() *Organization { + if x != nil { + return x.Org + } + return nil +} + +// 更新部门 - 请求 +type UpdateOrganizationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OperatorId *uint32 `protobuf:"varint,1,opt,name=operatorId,proto3,oneof" json:"operatorId,omitempty"` + Org *Organization `protobuf:"bytes,2,opt,name=org,proto3" json:"org,omitempty"` +} + +func (x *UpdateOrganizationRequest) Reset() { + *x = UpdateOrganizationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_organization_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateOrganizationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateOrganizationRequest) ProtoMessage() {} + +func (x *UpdateOrganizationRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_organization_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateOrganizationRequest.ProtoReflect.Descriptor instead. +func (*UpdateOrganizationRequest) Descriptor() ([]byte, []int) { + return file_user_service_v1_organization_proto_rawDescGZIP(), []int{4} +} + +func (x *UpdateOrganizationRequest) GetOperatorId() uint32 { + if x != nil && x.OperatorId != nil { + return *x.OperatorId + } + return 0 +} + +func (x *UpdateOrganizationRequest) GetOrg() *Organization { + if x != nil { + return x.Org + } + return nil +} + +// 删除部门 - 请求 +type DeleteOrganizationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + OperatorId *uint32 `protobuf:"varint,2,opt,name=operatorId,proto3,oneof" json:"operatorId,omitempty"` +} + +func (x *DeleteOrganizationRequest) Reset() { + *x = DeleteOrganizationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_organization_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteOrganizationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteOrganizationRequest) ProtoMessage() {} + +func (x *DeleteOrganizationRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_organization_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteOrganizationRequest.ProtoReflect.Descriptor instead. +func (*DeleteOrganizationRequest) Descriptor() ([]byte, []int) { + return file_user_service_v1_organization_proto_rawDescGZIP(), []int{5} +} + +func (x *DeleteOrganizationRequest) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *DeleteOrganizationRequest) GetOperatorId() uint32 { + if x != nil && x.OperatorId != nil { + return *x.OperatorId + } + return 0 +} + +var File_user_service_v1_organization_proto protoreflect.FileDescriptor + +var file_user_service_v1_organization_proto_rawDesc = []byte{ + 0x0a, 0x22, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, + 0x31, 0x2f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x24, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2f, 0x6f, + 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, + 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe4, 0x03, 0x0a, 0x0c, 0x4f, 0x72, 0x67, + 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x88, + 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0d, 0x48, 0x01, 0x52, 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, + 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x4e, 0x6f, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x48, 0x02, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x4e, 0x6f, 0x88, + 0x01, 0x01, 0x12, 0x3f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x22, 0xba, 0x47, 0x1f, 0xc2, 0x01, 0x04, 0x12, 0x02, 0x4f, 0x4e, 0xc2, 0x01, + 0x05, 0x12, 0x03, 0x4f, 0x46, 0x46, 0x8a, 0x02, 0x04, 0x1a, 0x02, 0x4f, 0x4e, 0x92, 0x02, 0x06, + 0xe7, 0x8a, 0xb6, 0xe6, 0x80, 0x81, 0x48, 0x03, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x88, 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x48, 0x04, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x88, 0x01, 0x01, + 0x12, 0x39, 0x0a, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x18, 0x07, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x12, 0x23, 0x0a, 0x0a, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x05, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, + 0x12, 0x23, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x15, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x06, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, + 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, + 0x69, 0x6d, 0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x48, 0x07, 0x52, 0x0a, 0x64, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, + 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x4e, 0x6f, 0x42, 0x09, 0x0a, 0x07, + 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x72, 0x65, 0x6d, 0x61, + 0x72, 0x6b, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, + 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, + 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, + 0x65, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x05, 0x69, + 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x75, 0x73, 0x65, + 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x67, + 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, + 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x28, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x4f, 0x72, 0x67, + 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, + 0x22, 0x80, 0x01, 0x0a, 0x19, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, + 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, + 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, + 0x88, 0x01, 0x01, 0x12, 0x2f, 0x0a, 0x03, 0x6f, 0x72, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x03, 0x6f, 0x72, 0x67, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, + 0x72, 0x49, 0x64, 0x22, 0x80, 0x01, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x72, + 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x23, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, + 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x2f, 0x0a, 0x03, 0x6f, 0x72, 0x67, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x03, 0x6f, 0x72, 0x67, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x6f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x5f, 0x0a, 0x19, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x23, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x6f, 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x32, 0xe2, 0x03, 0x0a, 0x13, 0x4f, 0x72, 0x67, 0x61, + 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x5a, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, + 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5b, 0x0a, 0x0f, 0x47, + 0x65, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, + 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, + 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x00, 0x12, 0x5a, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, + 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x22, 0x00, 0x12, 0x5a, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x72, + 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x2e, 0x75, 0x73, 0x65, + 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, + 0x12, 0x5a, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, + 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, + 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x42, 0xc3, 0x01, 0x0a, + 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x76, 0x31, 0x42, 0x11, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3b, 0x6b, 0x72, 0x61, 0x74, 0x6f, + 0x73, 0x2d, 0x6d, 0x6f, 0x6e, 0x6f, 0x6c, 0x69, 0x74, 0x68, 0x69, 0x63, 0x2d, 0x64, 0x65, 0x6d, + 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x75, 0x73, 0x65, + 0x72, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x55, 0x53, 0x58, 0xaa, 0x02, 0x0f, 0x55, + 0x73, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, + 0x0f, 0x55, 0x73, 0x65, 0x72, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x56, 0x31, + 0xe2, 0x02, 0x1b, 0x55, 0x73, 0x65, 0x72, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, + 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x11, 0x55, 0x73, 0x65, 0x72, 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_user_service_v1_organization_proto_rawDescOnce sync.Once + file_user_service_v1_organization_proto_rawDescData = file_user_service_v1_organization_proto_rawDesc +) + +func file_user_service_v1_organization_proto_rawDescGZIP() []byte { + file_user_service_v1_organization_proto_rawDescOnce.Do(func() { + file_user_service_v1_organization_proto_rawDescData = protoimpl.X.CompressGZIP(file_user_service_v1_organization_proto_rawDescData) + }) + return file_user_service_v1_organization_proto_rawDescData +} + +var file_user_service_v1_organization_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_user_service_v1_organization_proto_goTypes = []interface{}{ + (*Organization)(nil), // 0: user.service.v1.Organization + (*ListOrganizationResponse)(nil), // 1: user.service.v1.ListOrganizationResponse + (*GetOrganizationRequest)(nil), // 2: user.service.v1.GetOrganizationRequest + (*CreateOrganizationRequest)(nil), // 3: user.service.v1.CreateOrganizationRequest + (*UpdateOrganizationRequest)(nil), // 4: user.service.v1.UpdateOrganizationRequest + (*DeleteOrganizationRequest)(nil), // 5: user.service.v1.DeleteOrganizationRequest + (*v1.PagingRequest)(nil), // 6: pagination.PagingRequest + (*emptypb.Empty)(nil), // 7: google.protobuf.Empty +} +var file_user_service_v1_organization_proto_depIdxs = []int32{ + 0, // 0: user.service.v1.Organization.children:type_name -> user.service.v1.Organization + 0, // 1: user.service.v1.ListOrganizationResponse.items:type_name -> user.service.v1.Organization + 0, // 2: user.service.v1.CreateOrganizationRequest.org:type_name -> user.service.v1.Organization + 0, // 3: user.service.v1.UpdateOrganizationRequest.org:type_name -> user.service.v1.Organization + 6, // 4: user.service.v1.OrganizationService.ListOrganization:input_type -> pagination.PagingRequest + 2, // 5: user.service.v1.OrganizationService.GetOrganization:input_type -> user.service.v1.GetOrganizationRequest + 3, // 6: user.service.v1.OrganizationService.CreateOrganization:input_type -> user.service.v1.CreateOrganizationRequest + 4, // 7: user.service.v1.OrganizationService.UpdateOrganization:input_type -> user.service.v1.UpdateOrganizationRequest + 5, // 8: user.service.v1.OrganizationService.DeleteOrganization:input_type -> user.service.v1.DeleteOrganizationRequest + 1, // 9: user.service.v1.OrganizationService.ListOrganization:output_type -> user.service.v1.ListOrganizationResponse + 0, // 10: user.service.v1.OrganizationService.GetOrganization:output_type -> user.service.v1.Organization + 7, // 11: user.service.v1.OrganizationService.CreateOrganization:output_type -> google.protobuf.Empty + 7, // 12: user.service.v1.OrganizationService.UpdateOrganization:output_type -> google.protobuf.Empty + 7, // 13: user.service.v1.OrganizationService.DeleteOrganization:output_type -> google.protobuf.Empty + 9, // [9:14] is the sub-list for method output_type + 4, // [4:9] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_user_service_v1_organization_proto_init() } +func file_user_service_v1_organization_proto_init() { + if File_user_service_v1_organization_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_user_service_v1_organization_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Organization); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_organization_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListOrganizationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_organization_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetOrganizationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_organization_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateOrganizationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_organization_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateOrganizationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_organization_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteOrganizationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_user_service_v1_organization_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_user_service_v1_organization_proto_msgTypes[3].OneofWrappers = []interface{}{} + file_user_service_v1_organization_proto_msgTypes[4].OneofWrappers = []interface{}{} + file_user_service_v1_organization_proto_msgTypes[5].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_user_service_v1_organization_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_user_service_v1_organization_proto_goTypes, + DependencyIndexes: file_user_service_v1_organization_proto_depIdxs, + MessageInfos: file_user_service_v1_organization_proto_msgTypes, + }.Build() + File_user_service_v1_organization_proto = out.File + file_user_service_v1_organization_proto_rawDesc = nil + file_user_service_v1_organization_proto_goTypes = nil + file_user_service_v1_organization_proto_depIdxs = nil +} diff --git a/monolithic/backend/gen/api/go/user/service/v1/organization.pb.validate.go b/monolithic/backend/gen/api/go/user/service/v1/organization.pb.validate.go new file mode 100644 index 0000000..82b491f --- /dev/null +++ b/monolithic/backend/gen/api/go/user/service/v1/organization.pb.validate.go @@ -0,0 +1,823 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: user/service/v1/organization.proto + +package servicev1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on Organization with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Organization) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Organization with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in OrganizationMultiError, or +// nil if none found. +func (m *Organization) ValidateAll() error { + return m.validate(true) +} + +func (m *Organization) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + for idx, item := range m.GetChildren() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, OrganizationValidationError{ + field: fmt.Sprintf("Children[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, OrganizationValidationError{ + field: fmt.Sprintf("Children[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return OrganizationValidationError{ + field: fmt.Sprintf("Children[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if m.Name != nil { + // no validation rules for Name + } + + if m.ParentId != nil { + // no validation rules for ParentId + } + + if m.OrderNo != nil { + // no validation rules for OrderNo + } + + if m.Status != nil { + // no validation rules for Status + } + + if m.Remark != nil { + // no validation rules for Remark + } + + if m.CreateTime != nil { + // no validation rules for CreateTime + } + + if m.UpdateTime != nil { + // no validation rules for UpdateTime + } + + if m.DeleteTime != nil { + // no validation rules for DeleteTime + } + + if len(errors) > 0 { + return OrganizationMultiError(errors) + } + + return nil +} + +// OrganizationMultiError is an error wrapping multiple validation errors +// returned by Organization.ValidateAll() if the designated constraints aren't met. +type OrganizationMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m OrganizationMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m OrganizationMultiError) AllErrors() []error { return m } + +// OrganizationValidationError is the validation error returned by +// Organization.Validate if the designated constraints aren't met. +type OrganizationValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e OrganizationValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e OrganizationValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e OrganizationValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e OrganizationValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e OrganizationValidationError) ErrorName() string { return "OrganizationValidationError" } + +// Error satisfies the builtin error interface +func (e OrganizationValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sOrganization.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = OrganizationValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = OrganizationValidationError{} + +// Validate checks the field values on ListOrganizationResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *ListOrganizationResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ListOrganizationResponse with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ListOrganizationResponseMultiError, or nil if none found. +func (m *ListOrganizationResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *ListOrganizationResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + for idx, item := range m.GetItems() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ListOrganizationResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ListOrganizationResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ListOrganizationResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + // no validation rules for Total + + if len(errors) > 0 { + return ListOrganizationResponseMultiError(errors) + } + + return nil +} + +// ListOrganizationResponseMultiError is an error wrapping multiple validation +// errors returned by ListOrganizationResponse.ValidateAll() if the designated +// constraints aren't met. +type ListOrganizationResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ListOrganizationResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ListOrganizationResponseMultiError) AllErrors() []error { return m } + +// ListOrganizationResponseValidationError is the validation error returned by +// ListOrganizationResponse.Validate if the designated constraints aren't met. +type ListOrganizationResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ListOrganizationResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ListOrganizationResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ListOrganizationResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ListOrganizationResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ListOrganizationResponseValidationError) ErrorName() string { + return "ListOrganizationResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e ListOrganizationResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sListOrganizationResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ListOrganizationResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ListOrganizationResponseValidationError{} + +// Validate checks the field values on GetOrganizationRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *GetOrganizationRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetOrganizationRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// GetOrganizationRequestMultiError, or nil if none found. +func (m *GetOrganizationRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *GetOrganizationRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if len(errors) > 0 { + return GetOrganizationRequestMultiError(errors) + } + + return nil +} + +// GetOrganizationRequestMultiError is an error wrapping multiple validation +// errors returned by GetOrganizationRequest.ValidateAll() if the designated +// constraints aren't met. +type GetOrganizationRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetOrganizationRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetOrganizationRequestMultiError) AllErrors() []error { return m } + +// GetOrganizationRequestValidationError is the validation error returned by +// GetOrganizationRequest.Validate if the designated constraints aren't met. +type GetOrganizationRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetOrganizationRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetOrganizationRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetOrganizationRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetOrganizationRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetOrganizationRequestValidationError) ErrorName() string { + return "GetOrganizationRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e GetOrganizationRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetOrganizationRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetOrganizationRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetOrganizationRequestValidationError{} + +// Validate checks the field values on CreateOrganizationRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *CreateOrganizationRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on CreateOrganizationRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// CreateOrganizationRequestMultiError, or nil if none found. +func (m *CreateOrganizationRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *CreateOrganizationRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetOrg()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CreateOrganizationRequestValidationError{ + field: "Org", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CreateOrganizationRequestValidationError{ + field: "Org", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetOrg()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateOrganizationRequestValidationError{ + field: "Org", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if m.OperatorId != nil { + // no validation rules for OperatorId + } + + if len(errors) > 0 { + return CreateOrganizationRequestMultiError(errors) + } + + return nil +} + +// CreateOrganizationRequestMultiError is an error wrapping multiple validation +// errors returned by CreateOrganizationRequest.ValidateAll() if the +// designated constraints aren't met. +type CreateOrganizationRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m CreateOrganizationRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m CreateOrganizationRequestMultiError) AllErrors() []error { return m } + +// CreateOrganizationRequestValidationError is the validation error returned by +// CreateOrganizationRequest.Validate if the designated constraints aren't met. +type CreateOrganizationRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CreateOrganizationRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CreateOrganizationRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CreateOrganizationRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CreateOrganizationRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CreateOrganizationRequestValidationError) ErrorName() string { + return "CreateOrganizationRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e CreateOrganizationRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCreateOrganizationRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CreateOrganizationRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CreateOrganizationRequestValidationError{} + +// Validate checks the field values on UpdateOrganizationRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *UpdateOrganizationRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on UpdateOrganizationRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// UpdateOrganizationRequestMultiError, or nil if none found. +func (m *UpdateOrganizationRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *UpdateOrganizationRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetOrg()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UpdateOrganizationRequestValidationError{ + field: "Org", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UpdateOrganizationRequestValidationError{ + field: "Org", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetOrg()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpdateOrganizationRequestValidationError{ + field: "Org", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if m.OperatorId != nil { + // no validation rules for OperatorId + } + + if len(errors) > 0 { + return UpdateOrganizationRequestMultiError(errors) + } + + return nil +} + +// UpdateOrganizationRequestMultiError is an error wrapping multiple validation +// errors returned by UpdateOrganizationRequest.ValidateAll() if the +// designated constraints aren't met. +type UpdateOrganizationRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UpdateOrganizationRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m UpdateOrganizationRequestMultiError) AllErrors() []error { return m } + +// UpdateOrganizationRequestValidationError is the validation error returned by +// UpdateOrganizationRequest.Validate if the designated constraints aren't met. +type UpdateOrganizationRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UpdateOrganizationRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UpdateOrganizationRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UpdateOrganizationRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UpdateOrganizationRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UpdateOrganizationRequestValidationError) ErrorName() string { + return "UpdateOrganizationRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e UpdateOrganizationRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUpdateOrganizationRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UpdateOrganizationRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UpdateOrganizationRequestValidationError{} + +// Validate checks the field values on DeleteOrganizationRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *DeleteOrganizationRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on DeleteOrganizationRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// DeleteOrganizationRequestMultiError, or nil if none found. +func (m *DeleteOrganizationRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *DeleteOrganizationRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if m.OperatorId != nil { + // no validation rules for OperatorId + } + + if len(errors) > 0 { + return DeleteOrganizationRequestMultiError(errors) + } + + return nil +} + +// DeleteOrganizationRequestMultiError is an error wrapping multiple validation +// errors returned by DeleteOrganizationRequest.ValidateAll() if the +// designated constraints aren't met. +type DeleteOrganizationRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m DeleteOrganizationRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m DeleteOrganizationRequestMultiError) AllErrors() []error { return m } + +// DeleteOrganizationRequestValidationError is the validation error returned by +// DeleteOrganizationRequest.Validate if the designated constraints aren't met. +type DeleteOrganizationRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DeleteOrganizationRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DeleteOrganizationRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DeleteOrganizationRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DeleteOrganizationRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DeleteOrganizationRequestValidationError) ErrorName() string { + return "DeleteOrganizationRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e DeleteOrganizationRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDeleteOrganizationRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DeleteOrganizationRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DeleteOrganizationRequestValidationError{} diff --git a/monolithic/backend/gen/api/go/user/service/v1/organization_grpc.pb.go b/monolithic/backend/gen/api/go/user/service/v1/organization_grpc.pb.go new file mode 100644 index 0000000..2d77529 --- /dev/null +++ b/monolithic/backend/gen/api/go/user/service/v1/organization_grpc.pb.go @@ -0,0 +1,269 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: user/service/v1/organization.proto + +package servicev1 + +import ( + context "context" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + OrganizationService_ListOrganization_FullMethodName = "/user.service.v1.OrganizationService/ListOrganization" + OrganizationService_GetOrganization_FullMethodName = "/user.service.v1.OrganizationService/GetOrganization" + OrganizationService_CreateOrganization_FullMethodName = "/user.service.v1.OrganizationService/CreateOrganization" + OrganizationService_UpdateOrganization_FullMethodName = "/user.service.v1.OrganizationService/UpdateOrganization" + OrganizationService_DeleteOrganization_FullMethodName = "/user.service.v1.OrganizationService/DeleteOrganization" +) + +// OrganizationServiceClient is the client API for OrganizationService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type OrganizationServiceClient interface { + // 查询部门列表 + ListOrganization(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*ListOrganizationResponse, error) + // 查询部门详情 + GetOrganization(ctx context.Context, in *GetOrganizationRequest, opts ...grpc.CallOption) (*Organization, error) + // 创建部门 + CreateOrganization(ctx context.Context, in *CreateOrganizationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 更新部门 + UpdateOrganization(ctx context.Context, in *UpdateOrganizationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 删除部门 + DeleteOrganization(ctx context.Context, in *DeleteOrganizationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type organizationServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewOrganizationServiceClient(cc grpc.ClientConnInterface) OrganizationServiceClient { + return &organizationServiceClient{cc} +} + +func (c *organizationServiceClient) ListOrganization(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*ListOrganizationResponse, error) { + out := new(ListOrganizationResponse) + err := c.cc.Invoke(ctx, OrganizationService_ListOrganization_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *organizationServiceClient) GetOrganization(ctx context.Context, in *GetOrganizationRequest, opts ...grpc.CallOption) (*Organization, error) { + out := new(Organization) + err := c.cc.Invoke(ctx, OrganizationService_GetOrganization_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *organizationServiceClient) CreateOrganization(ctx context.Context, in *CreateOrganizationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, OrganizationService_CreateOrganization_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *organizationServiceClient) UpdateOrganization(ctx context.Context, in *UpdateOrganizationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, OrganizationService_UpdateOrganization_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *organizationServiceClient) DeleteOrganization(ctx context.Context, in *DeleteOrganizationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, OrganizationService_DeleteOrganization_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// OrganizationServiceServer is the server API for OrganizationService service. +// All implementations must embed UnimplementedOrganizationServiceServer +// for forward compatibility +type OrganizationServiceServer interface { + // 查询部门列表 + ListOrganization(context.Context, *v1.PagingRequest) (*ListOrganizationResponse, error) + // 查询部门详情 + GetOrganization(context.Context, *GetOrganizationRequest) (*Organization, error) + // 创建部门 + CreateOrganization(context.Context, *CreateOrganizationRequest) (*emptypb.Empty, error) + // 更新部门 + UpdateOrganization(context.Context, *UpdateOrganizationRequest) (*emptypb.Empty, error) + // 删除部门 + DeleteOrganization(context.Context, *DeleteOrganizationRequest) (*emptypb.Empty, error) + mustEmbedUnimplementedOrganizationServiceServer() +} + +// UnimplementedOrganizationServiceServer must be embedded to have forward compatible implementations. +type UnimplementedOrganizationServiceServer struct { +} + +func (UnimplementedOrganizationServiceServer) ListOrganization(context.Context, *v1.PagingRequest) (*ListOrganizationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListOrganization not implemented") +} +func (UnimplementedOrganizationServiceServer) GetOrganization(context.Context, *GetOrganizationRequest) (*Organization, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetOrganization not implemented") +} +func (UnimplementedOrganizationServiceServer) CreateOrganization(context.Context, *CreateOrganizationRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateOrganization not implemented") +} +func (UnimplementedOrganizationServiceServer) UpdateOrganization(context.Context, *UpdateOrganizationRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateOrganization not implemented") +} +func (UnimplementedOrganizationServiceServer) DeleteOrganization(context.Context, *DeleteOrganizationRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteOrganization not implemented") +} +func (UnimplementedOrganizationServiceServer) mustEmbedUnimplementedOrganizationServiceServer() {} + +// UnsafeOrganizationServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to OrganizationServiceServer will +// result in compilation errors. +type UnsafeOrganizationServiceServer interface { + mustEmbedUnimplementedOrganizationServiceServer() +} + +func RegisterOrganizationServiceServer(s grpc.ServiceRegistrar, srv OrganizationServiceServer) { + s.RegisterService(&OrganizationService_ServiceDesc, srv) +} + +func _OrganizationService_ListOrganization_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v1.PagingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServiceServer).ListOrganization(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: OrganizationService_ListOrganization_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServiceServer).ListOrganization(ctx, req.(*v1.PagingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _OrganizationService_GetOrganization_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetOrganizationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServiceServer).GetOrganization(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: OrganizationService_GetOrganization_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServiceServer).GetOrganization(ctx, req.(*GetOrganizationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _OrganizationService_CreateOrganization_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateOrganizationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServiceServer).CreateOrganization(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: OrganizationService_CreateOrganization_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServiceServer).CreateOrganization(ctx, req.(*CreateOrganizationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _OrganizationService_UpdateOrganization_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateOrganizationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServiceServer).UpdateOrganization(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: OrganizationService_UpdateOrganization_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServiceServer).UpdateOrganization(ctx, req.(*UpdateOrganizationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _OrganizationService_DeleteOrganization_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteOrganizationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServiceServer).DeleteOrganization(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: OrganizationService_DeleteOrganization_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServiceServer).DeleteOrganization(ctx, req.(*DeleteOrganizationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// OrganizationService_ServiceDesc is the grpc.ServiceDesc for OrganizationService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var OrganizationService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "user.service.v1.OrganizationService", + HandlerType: (*OrganizationServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListOrganization", + Handler: _OrganizationService_ListOrganization_Handler, + }, + { + MethodName: "GetOrganization", + Handler: _OrganizationService_GetOrganization_Handler, + }, + { + MethodName: "CreateOrganization", + Handler: _OrganizationService_CreateOrganization_Handler, + }, + { + MethodName: "UpdateOrganization", + Handler: _OrganizationService_UpdateOrganization_Handler, + }, + { + MethodName: "DeleteOrganization", + Handler: _OrganizationService_DeleteOrganization_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "user/service/v1/organization.proto", +} diff --git a/monolithic/backend/gen/api/go/user/service/v1/position.pb.go b/monolithic/backend/gen/api/go/user/service/v1/position.pb.go new file mode 100644 index 0000000..0492c20 --- /dev/null +++ b/monolithic/backend/gen/api/go/user/service/v1/position.pb.go @@ -0,0 +1,677 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: user/service/v1/position.proto + +package servicev1 + +import ( + _ "github.com/google/gnostic/openapiv3" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 职位 +type Position struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name *string `protobuf:"bytes,2,opt,name=name,proto3,oneof" json:"name,omitempty"` + ParentId *uint32 `protobuf:"varint,3,opt,name=parentId,proto3,oneof" json:"parentId,omitempty"` + OrderNo *int32 `protobuf:"varint,4,opt,name=orderNo,proto3,oneof" json:"orderNo,omitempty"` + Code *string `protobuf:"bytes,5,opt,name=code,proto3,oneof" json:"code,omitempty"` + Status *string `protobuf:"bytes,6,opt,name=status,proto3,oneof" json:"status,omitempty"` + Remark *string `protobuf:"bytes,7,opt,name=remark,proto3,oneof" json:"remark,omitempty"` + CreateTime *string `protobuf:"bytes,20,opt,name=createTime,proto3,oneof" json:"createTime,omitempty"` // 创建时间 + UpdateTime *string `protobuf:"bytes,21,opt,name=updateTime,proto3,oneof" json:"updateTime,omitempty"` // 更新时间 + DeleteTime *string `protobuf:"bytes,22,opt,name=deleteTime,proto3,oneof" json:"deleteTime,omitempty"` // 删除时间 +} + +func (x *Position) Reset() { + *x = Position{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_position_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Position) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Position) ProtoMessage() {} + +func (x *Position) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_position_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Position.ProtoReflect.Descriptor instead. +func (*Position) Descriptor() ([]byte, []int) { + return file_user_service_v1_position_proto_rawDescGZIP(), []int{0} +} + +func (x *Position) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Position) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +func (x *Position) GetParentId() uint32 { + if x != nil && x.ParentId != nil { + return *x.ParentId + } + return 0 +} + +func (x *Position) GetOrderNo() int32 { + if x != nil && x.OrderNo != nil { + return *x.OrderNo + } + return 0 +} + +func (x *Position) GetCode() string { + if x != nil && x.Code != nil { + return *x.Code + } + return "" +} + +func (x *Position) GetStatus() string { + if x != nil && x.Status != nil { + return *x.Status + } + return "" +} + +func (x *Position) GetRemark() string { + if x != nil && x.Remark != nil { + return *x.Remark + } + return "" +} + +func (x *Position) GetCreateTime() string { + if x != nil && x.CreateTime != nil { + return *x.CreateTime + } + return "" +} + +func (x *Position) GetUpdateTime() string { + if x != nil && x.UpdateTime != nil { + return *x.UpdateTime + } + return "" +} + +func (x *Position) GetDeleteTime() string { + if x != nil && x.DeleteTime != nil { + return *x.DeleteTime + } + return "" +} + +// 获取职位列表 - 答复 +type ListPositionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Items []*Position `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` + Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` +} + +func (x *ListPositionResponse) Reset() { + *x = ListPositionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_position_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListPositionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListPositionResponse) ProtoMessage() {} + +func (x *ListPositionResponse) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_position_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListPositionResponse.ProtoReflect.Descriptor instead. +func (*ListPositionResponse) Descriptor() ([]byte, []int) { + return file_user_service_v1_position_proto_rawDescGZIP(), []int{1} +} + +func (x *ListPositionResponse) GetItems() []*Position { + if x != nil { + return x.Items + } + return nil +} + +func (x *ListPositionResponse) GetTotal() int32 { + if x != nil { + return x.Total + } + return 0 +} + +// 获取职位数据 - 请求 +type GetPositionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GetPositionRequest) Reset() { + *x = GetPositionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_position_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPositionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPositionRequest) ProtoMessage() {} + +func (x *GetPositionRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_position_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPositionRequest.ProtoReflect.Descriptor instead. +func (*GetPositionRequest) Descriptor() ([]byte, []int) { + return file_user_service_v1_position_proto_rawDescGZIP(), []int{2} +} + +func (x *GetPositionRequest) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +// 创建职位 - 请求 +type CreatePositionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Position *Position `protobuf:"bytes,1,opt,name=position,proto3" json:"position,omitempty"` + OperatorId *uint32 `protobuf:"varint,2,opt,name=operatorId,proto3,oneof" json:"operatorId,omitempty"` +} + +func (x *CreatePositionRequest) Reset() { + *x = CreatePositionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_position_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreatePositionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreatePositionRequest) ProtoMessage() {} + +func (x *CreatePositionRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_position_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreatePositionRequest.ProtoReflect.Descriptor instead. +func (*CreatePositionRequest) Descriptor() ([]byte, []int) { + return file_user_service_v1_position_proto_rawDescGZIP(), []int{3} +} + +func (x *CreatePositionRequest) GetPosition() *Position { + if x != nil { + return x.Position + } + return nil +} + +func (x *CreatePositionRequest) GetOperatorId() uint32 { + if x != nil && x.OperatorId != nil { + return *x.OperatorId + } + return 0 +} + +// 更新职位 - 请求 +type UpdatePositionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Position *Position `protobuf:"bytes,1,opt,name=position,proto3" json:"position,omitempty"` + OperatorId *uint32 `protobuf:"varint,2,opt,name=operatorId,proto3,oneof" json:"operatorId,omitempty"` +} + +func (x *UpdatePositionRequest) Reset() { + *x = UpdatePositionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_position_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdatePositionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdatePositionRequest) ProtoMessage() {} + +func (x *UpdatePositionRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_position_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdatePositionRequest.ProtoReflect.Descriptor instead. +func (*UpdatePositionRequest) Descriptor() ([]byte, []int) { + return file_user_service_v1_position_proto_rawDescGZIP(), []int{4} +} + +func (x *UpdatePositionRequest) GetPosition() *Position { + if x != nil { + return x.Position + } + return nil +} + +func (x *UpdatePositionRequest) GetOperatorId() uint32 { + if x != nil && x.OperatorId != nil { + return *x.OperatorId + } + return 0 +} + +// 删除职位 - 请求 +type DeletePositionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + OperatorId *uint32 `protobuf:"varint,2,opt,name=operatorId,proto3,oneof" json:"operatorId,omitempty"` +} + +func (x *DeletePositionRequest) Reset() { + *x = DeletePositionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_position_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeletePositionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeletePositionRequest) ProtoMessage() {} + +func (x *DeletePositionRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_position_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeletePositionRequest.ProtoReflect.Descriptor instead. +func (*DeletePositionRequest) Descriptor() ([]byte, []int) { + return file_user_service_v1_position_proto_rawDescGZIP(), []int{5} +} + +func (x *DeletePositionRequest) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *DeletePositionRequest) GetOperatorId() uint32 { + if x != nil && x.OperatorId != nil { + return *x.OperatorId + } + return 0 +} + +var File_user_service_v1_position_proto protoreflect.FileDescriptor + +var file_user_service_v1_position_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, + 0x31, 0x2f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x0f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, + 0x31, 0x1a, 0x24, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc7, 0x03, 0x0a, 0x08, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x00, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x01, 0x52, 0x08, + 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x6f, + 0x72, 0x64, 0x65, 0x72, 0x4e, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x48, 0x02, 0x52, 0x07, + 0x6f, 0x72, 0x64, 0x65, 0x72, 0x4e, 0x6f, 0x88, 0x01, 0x01, 0x12, 0x17, 0x0a, 0x04, 0x63, 0x6f, + 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, + 0x88, 0x01, 0x01, 0x12, 0x3f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x22, 0xba, 0x47, 0x1f, 0xc2, 0x01, 0x04, 0x12, 0x02, 0x4f, 0x4e, 0xc2, + 0x01, 0x05, 0x12, 0x03, 0x4f, 0x46, 0x46, 0x8a, 0x02, 0x04, 0x1a, 0x02, 0x4f, 0x4e, 0x92, 0x02, + 0x06, 0xe7, 0x8a, 0xb6, 0xe6, 0x80, 0x81, 0x48, 0x04, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x88, 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x05, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x88, 0x01, + 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, + 0x14, 0x20, 0x01, 0x28, 0x09, 0x48, 0x06, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, + 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x54, 0x69, 0x6d, 0x65, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x48, 0x07, 0x52, 0x0a, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x64, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x08, 0x52, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, + 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, + 0x4e, 0x6f, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x5f, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x72, 0x65, 0x6d, 0x61, 0x72, + 0x6b, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, + 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x42, + 0x0d, 0x0a, 0x0b, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x5d, + 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x24, 0x0a, + 0x12, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x02, 0x69, 0x64, 0x22, 0x82, 0x01, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, + 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, + 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x6f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x82, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x35, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0a, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, + 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0d, + 0x0a, 0x0b, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x5b, 0x0a, + 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x23, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x6f, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0a, 0x6f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, + 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x32, 0xb2, 0x03, 0x0a, 0x0f, 0x50, + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x52, + 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, + 0x2e, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x67, 0x69, + 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x23, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x73, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x0e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x42, + 0xbf, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0d, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3b, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, + 0x2d, 0x6d, 0x6f, 0x6e, 0x6f, 0x6c, 0x69, 0x74, 0x68, 0x69, 0x63, 0x2d, 0x64, 0x65, 0x6d, 0x6f, + 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x75, 0x73, 0x65, 0x72, + 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x55, 0x53, 0x58, 0xaa, 0x02, 0x0f, 0x55, 0x73, + 0x65, 0x72, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, + 0x55, 0x73, 0x65, 0x72, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x1b, 0x55, 0x73, 0x65, 0x72, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x56, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, + 0x55, 0x73, 0x65, 0x72, 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_user_service_v1_position_proto_rawDescOnce sync.Once + file_user_service_v1_position_proto_rawDescData = file_user_service_v1_position_proto_rawDesc +) + +func file_user_service_v1_position_proto_rawDescGZIP() []byte { + file_user_service_v1_position_proto_rawDescOnce.Do(func() { + file_user_service_v1_position_proto_rawDescData = protoimpl.X.CompressGZIP(file_user_service_v1_position_proto_rawDescData) + }) + return file_user_service_v1_position_proto_rawDescData +} + +var file_user_service_v1_position_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_user_service_v1_position_proto_goTypes = []interface{}{ + (*Position)(nil), // 0: user.service.v1.Position + (*ListPositionResponse)(nil), // 1: user.service.v1.ListPositionResponse + (*GetPositionRequest)(nil), // 2: user.service.v1.GetPositionRequest + (*CreatePositionRequest)(nil), // 3: user.service.v1.CreatePositionRequest + (*UpdatePositionRequest)(nil), // 4: user.service.v1.UpdatePositionRequest + (*DeletePositionRequest)(nil), // 5: user.service.v1.DeletePositionRequest + (*v1.PagingRequest)(nil), // 6: pagination.PagingRequest + (*emptypb.Empty)(nil), // 7: google.protobuf.Empty +} +var file_user_service_v1_position_proto_depIdxs = []int32{ + 0, // 0: user.service.v1.ListPositionResponse.items:type_name -> user.service.v1.Position + 0, // 1: user.service.v1.CreatePositionRequest.position:type_name -> user.service.v1.Position + 0, // 2: user.service.v1.UpdatePositionRequest.position:type_name -> user.service.v1.Position + 6, // 3: user.service.v1.PositionService.ListPosition:input_type -> pagination.PagingRequest + 2, // 4: user.service.v1.PositionService.GetPosition:input_type -> user.service.v1.GetPositionRequest + 3, // 5: user.service.v1.PositionService.CreatePosition:input_type -> user.service.v1.CreatePositionRequest + 4, // 6: user.service.v1.PositionService.UpdatePosition:input_type -> user.service.v1.UpdatePositionRequest + 5, // 7: user.service.v1.PositionService.DeletePosition:input_type -> user.service.v1.DeletePositionRequest + 1, // 8: user.service.v1.PositionService.ListPosition:output_type -> user.service.v1.ListPositionResponse + 0, // 9: user.service.v1.PositionService.GetPosition:output_type -> user.service.v1.Position + 7, // 10: user.service.v1.PositionService.CreatePosition:output_type -> google.protobuf.Empty + 7, // 11: user.service.v1.PositionService.UpdatePosition:output_type -> google.protobuf.Empty + 7, // 12: user.service.v1.PositionService.DeletePosition:output_type -> google.protobuf.Empty + 8, // [8:13] is the sub-list for method output_type + 3, // [3:8] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_user_service_v1_position_proto_init() } +func file_user_service_v1_position_proto_init() { + if File_user_service_v1_position_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_user_service_v1_position_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Position); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_position_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListPositionResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_position_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPositionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_position_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreatePositionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_position_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdatePositionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_position_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeletePositionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_user_service_v1_position_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_user_service_v1_position_proto_msgTypes[3].OneofWrappers = []interface{}{} + file_user_service_v1_position_proto_msgTypes[4].OneofWrappers = []interface{}{} + file_user_service_v1_position_proto_msgTypes[5].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_user_service_v1_position_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_user_service_v1_position_proto_goTypes, + DependencyIndexes: file_user_service_v1_position_proto_depIdxs, + MessageInfos: file_user_service_v1_position_proto_msgTypes, + }.Build() + File_user_service_v1_position_proto = out.File + file_user_service_v1_position_proto_rawDesc = nil + file_user_service_v1_position_proto_goTypes = nil + file_user_service_v1_position_proto_depIdxs = nil +} diff --git a/monolithic/backend/gen/api/go/user/service/v1/position.pb.validate.go b/monolithic/backend/gen/api/go/user/service/v1/position.pb.validate.go new file mode 100644 index 0000000..dc52935 --- /dev/null +++ b/monolithic/backend/gen/api/go/user/service/v1/position.pb.validate.go @@ -0,0 +1,793 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: user/service/v1/position.proto + +package servicev1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on Position with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Position) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Position with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in PositionMultiError, or nil +// if none found. +func (m *Position) ValidateAll() error { + return m.validate(true) +} + +func (m *Position) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if m.Name != nil { + // no validation rules for Name + } + + if m.ParentId != nil { + // no validation rules for ParentId + } + + if m.OrderNo != nil { + // no validation rules for OrderNo + } + + if m.Code != nil { + // no validation rules for Code + } + + if m.Status != nil { + // no validation rules for Status + } + + if m.Remark != nil { + // no validation rules for Remark + } + + if m.CreateTime != nil { + // no validation rules for CreateTime + } + + if m.UpdateTime != nil { + // no validation rules for UpdateTime + } + + if m.DeleteTime != nil { + // no validation rules for DeleteTime + } + + if len(errors) > 0 { + return PositionMultiError(errors) + } + + return nil +} + +// PositionMultiError is an error wrapping multiple validation errors returned +// by Position.ValidateAll() if the designated constraints aren't met. +type PositionMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m PositionMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m PositionMultiError) AllErrors() []error { return m } + +// PositionValidationError is the validation error returned by +// Position.Validate if the designated constraints aren't met. +type PositionValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e PositionValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e PositionValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e PositionValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e PositionValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e PositionValidationError) ErrorName() string { return "PositionValidationError" } + +// Error satisfies the builtin error interface +func (e PositionValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sPosition.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = PositionValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = PositionValidationError{} + +// Validate checks the field values on ListPositionResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *ListPositionResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ListPositionResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ListPositionResponseMultiError, or nil if none found. +func (m *ListPositionResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *ListPositionResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + for idx, item := range m.GetItems() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ListPositionResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ListPositionResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ListPositionResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + // no validation rules for Total + + if len(errors) > 0 { + return ListPositionResponseMultiError(errors) + } + + return nil +} + +// ListPositionResponseMultiError is an error wrapping multiple validation +// errors returned by ListPositionResponse.ValidateAll() if the designated +// constraints aren't met. +type ListPositionResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ListPositionResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ListPositionResponseMultiError) AllErrors() []error { return m } + +// ListPositionResponseValidationError is the validation error returned by +// ListPositionResponse.Validate if the designated constraints aren't met. +type ListPositionResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ListPositionResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ListPositionResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ListPositionResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ListPositionResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ListPositionResponseValidationError) ErrorName() string { + return "ListPositionResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e ListPositionResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sListPositionResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ListPositionResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ListPositionResponseValidationError{} + +// Validate checks the field values on GetPositionRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *GetPositionRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetPositionRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// GetPositionRequestMultiError, or nil if none found. +func (m *GetPositionRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *GetPositionRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if len(errors) > 0 { + return GetPositionRequestMultiError(errors) + } + + return nil +} + +// GetPositionRequestMultiError is an error wrapping multiple validation errors +// returned by GetPositionRequest.ValidateAll() if the designated constraints +// aren't met. +type GetPositionRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetPositionRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetPositionRequestMultiError) AllErrors() []error { return m } + +// GetPositionRequestValidationError is the validation error returned by +// GetPositionRequest.Validate if the designated constraints aren't met. +type GetPositionRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetPositionRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetPositionRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetPositionRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetPositionRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetPositionRequestValidationError) ErrorName() string { + return "GetPositionRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e GetPositionRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetPositionRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetPositionRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetPositionRequestValidationError{} + +// Validate checks the field values on CreatePositionRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *CreatePositionRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on CreatePositionRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// CreatePositionRequestMultiError, or nil if none found. +func (m *CreatePositionRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *CreatePositionRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetPosition()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CreatePositionRequestValidationError{ + field: "Position", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CreatePositionRequestValidationError{ + field: "Position", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetPosition()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreatePositionRequestValidationError{ + field: "Position", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if m.OperatorId != nil { + // no validation rules for OperatorId + } + + if len(errors) > 0 { + return CreatePositionRequestMultiError(errors) + } + + return nil +} + +// CreatePositionRequestMultiError is an error wrapping multiple validation +// errors returned by CreatePositionRequest.ValidateAll() if the designated +// constraints aren't met. +type CreatePositionRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m CreatePositionRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m CreatePositionRequestMultiError) AllErrors() []error { return m } + +// CreatePositionRequestValidationError is the validation error returned by +// CreatePositionRequest.Validate if the designated constraints aren't met. +type CreatePositionRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CreatePositionRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CreatePositionRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CreatePositionRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CreatePositionRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CreatePositionRequestValidationError) ErrorName() string { + return "CreatePositionRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e CreatePositionRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCreatePositionRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CreatePositionRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CreatePositionRequestValidationError{} + +// Validate checks the field values on UpdatePositionRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *UpdatePositionRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on UpdatePositionRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// UpdatePositionRequestMultiError, or nil if none found. +func (m *UpdatePositionRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *UpdatePositionRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetPosition()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UpdatePositionRequestValidationError{ + field: "Position", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UpdatePositionRequestValidationError{ + field: "Position", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetPosition()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpdatePositionRequestValidationError{ + field: "Position", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if m.OperatorId != nil { + // no validation rules for OperatorId + } + + if len(errors) > 0 { + return UpdatePositionRequestMultiError(errors) + } + + return nil +} + +// UpdatePositionRequestMultiError is an error wrapping multiple validation +// errors returned by UpdatePositionRequest.ValidateAll() if the designated +// constraints aren't met. +type UpdatePositionRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UpdatePositionRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m UpdatePositionRequestMultiError) AllErrors() []error { return m } + +// UpdatePositionRequestValidationError is the validation error returned by +// UpdatePositionRequest.Validate if the designated constraints aren't met. +type UpdatePositionRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UpdatePositionRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UpdatePositionRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UpdatePositionRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UpdatePositionRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UpdatePositionRequestValidationError) ErrorName() string { + return "UpdatePositionRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e UpdatePositionRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUpdatePositionRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UpdatePositionRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UpdatePositionRequestValidationError{} + +// Validate checks the field values on DeletePositionRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *DeletePositionRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on DeletePositionRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// DeletePositionRequestMultiError, or nil if none found. +func (m *DeletePositionRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *DeletePositionRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if m.OperatorId != nil { + // no validation rules for OperatorId + } + + if len(errors) > 0 { + return DeletePositionRequestMultiError(errors) + } + + return nil +} + +// DeletePositionRequestMultiError is an error wrapping multiple validation +// errors returned by DeletePositionRequest.ValidateAll() if the designated +// constraints aren't met. +type DeletePositionRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m DeletePositionRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m DeletePositionRequestMultiError) AllErrors() []error { return m } + +// DeletePositionRequestValidationError is the validation error returned by +// DeletePositionRequest.Validate if the designated constraints aren't met. +type DeletePositionRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DeletePositionRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DeletePositionRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DeletePositionRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DeletePositionRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DeletePositionRequestValidationError) ErrorName() string { + return "DeletePositionRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e DeletePositionRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDeletePositionRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DeletePositionRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DeletePositionRequestValidationError{} diff --git a/monolithic/backend/gen/api/go/user/service/v1/position_grpc.pb.go b/monolithic/backend/gen/api/go/user/service/v1/position_grpc.pb.go new file mode 100644 index 0000000..80494f5 --- /dev/null +++ b/monolithic/backend/gen/api/go/user/service/v1/position_grpc.pb.go @@ -0,0 +1,269 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: user/service/v1/position.proto + +package servicev1 + +import ( + context "context" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + PositionService_ListPosition_FullMethodName = "/user.service.v1.PositionService/ListPosition" + PositionService_GetPosition_FullMethodName = "/user.service.v1.PositionService/GetPosition" + PositionService_CreatePosition_FullMethodName = "/user.service.v1.PositionService/CreatePosition" + PositionService_UpdatePosition_FullMethodName = "/user.service.v1.PositionService/UpdatePosition" + PositionService_DeletePosition_FullMethodName = "/user.service.v1.PositionService/DeletePosition" +) + +// PositionServiceClient is the client API for PositionService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type PositionServiceClient interface { + // 查询职位列表 + ListPosition(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*ListPositionResponse, error) + // 查询职位详情 + GetPosition(ctx context.Context, in *GetPositionRequest, opts ...grpc.CallOption) (*Position, error) + // 创建职位 + CreatePosition(ctx context.Context, in *CreatePositionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 更新职位 + UpdatePosition(ctx context.Context, in *UpdatePositionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 删除职位 + DeletePosition(ctx context.Context, in *DeletePositionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type positionServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewPositionServiceClient(cc grpc.ClientConnInterface) PositionServiceClient { + return &positionServiceClient{cc} +} + +func (c *positionServiceClient) ListPosition(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*ListPositionResponse, error) { + out := new(ListPositionResponse) + err := c.cc.Invoke(ctx, PositionService_ListPosition_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *positionServiceClient) GetPosition(ctx context.Context, in *GetPositionRequest, opts ...grpc.CallOption) (*Position, error) { + out := new(Position) + err := c.cc.Invoke(ctx, PositionService_GetPosition_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *positionServiceClient) CreatePosition(ctx context.Context, in *CreatePositionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, PositionService_CreatePosition_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *positionServiceClient) UpdatePosition(ctx context.Context, in *UpdatePositionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, PositionService_UpdatePosition_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *positionServiceClient) DeletePosition(ctx context.Context, in *DeletePositionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, PositionService_DeletePosition_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// PositionServiceServer is the server API for PositionService service. +// All implementations must embed UnimplementedPositionServiceServer +// for forward compatibility +type PositionServiceServer interface { + // 查询职位列表 + ListPosition(context.Context, *v1.PagingRequest) (*ListPositionResponse, error) + // 查询职位详情 + GetPosition(context.Context, *GetPositionRequest) (*Position, error) + // 创建职位 + CreatePosition(context.Context, *CreatePositionRequest) (*emptypb.Empty, error) + // 更新职位 + UpdatePosition(context.Context, *UpdatePositionRequest) (*emptypb.Empty, error) + // 删除职位 + DeletePosition(context.Context, *DeletePositionRequest) (*emptypb.Empty, error) + mustEmbedUnimplementedPositionServiceServer() +} + +// UnimplementedPositionServiceServer must be embedded to have forward compatible implementations. +type UnimplementedPositionServiceServer struct { +} + +func (UnimplementedPositionServiceServer) ListPosition(context.Context, *v1.PagingRequest) (*ListPositionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListPosition not implemented") +} +func (UnimplementedPositionServiceServer) GetPosition(context.Context, *GetPositionRequest) (*Position, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPosition not implemented") +} +func (UnimplementedPositionServiceServer) CreatePosition(context.Context, *CreatePositionRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreatePosition not implemented") +} +func (UnimplementedPositionServiceServer) UpdatePosition(context.Context, *UpdatePositionRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdatePosition not implemented") +} +func (UnimplementedPositionServiceServer) DeletePosition(context.Context, *DeletePositionRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeletePosition not implemented") +} +func (UnimplementedPositionServiceServer) mustEmbedUnimplementedPositionServiceServer() {} + +// UnsafePositionServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to PositionServiceServer will +// result in compilation errors. +type UnsafePositionServiceServer interface { + mustEmbedUnimplementedPositionServiceServer() +} + +func RegisterPositionServiceServer(s grpc.ServiceRegistrar, srv PositionServiceServer) { + s.RegisterService(&PositionService_ServiceDesc, srv) +} + +func _PositionService_ListPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v1.PagingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PositionServiceServer).ListPosition(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PositionService_ListPosition_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PositionServiceServer).ListPosition(ctx, req.(*v1.PagingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PositionService_GetPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPositionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PositionServiceServer).GetPosition(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PositionService_GetPosition_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PositionServiceServer).GetPosition(ctx, req.(*GetPositionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PositionService_CreatePosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreatePositionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PositionServiceServer).CreatePosition(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PositionService_CreatePosition_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PositionServiceServer).CreatePosition(ctx, req.(*CreatePositionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PositionService_UpdatePosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdatePositionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PositionServiceServer).UpdatePosition(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PositionService_UpdatePosition_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PositionServiceServer).UpdatePosition(ctx, req.(*UpdatePositionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PositionService_DeletePosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeletePositionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PositionServiceServer).DeletePosition(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PositionService_DeletePosition_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PositionServiceServer).DeletePosition(ctx, req.(*DeletePositionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// PositionService_ServiceDesc is the grpc.ServiceDesc for PositionService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var PositionService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "user.service.v1.PositionService", + HandlerType: (*PositionServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListPosition", + Handler: _PositionService_ListPosition_Handler, + }, + { + MethodName: "GetPosition", + Handler: _PositionService_GetPosition_Handler, + }, + { + MethodName: "CreatePosition", + Handler: _PositionService_CreatePosition_Handler, + }, + { + MethodName: "UpdatePosition", + Handler: _PositionService_UpdatePosition_Handler, + }, + { + MethodName: "DeletePosition", + Handler: _PositionService_DeletePosition_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "user/service/v1/position.proto", +} diff --git a/monolithic/backend/gen/api/go/user/service/v1/role.pb.go b/monolithic/backend/gen/api/go/user/service/v1/role.pb.go new file mode 100644 index 0000000..c9f3c0b --- /dev/null +++ b/monolithic/backend/gen/api/go/user/service/v1/role.pb.go @@ -0,0 +1,670 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: user/service/v1/role.proto + +package servicev1 + +import ( + _ "github.com/google/gnostic/openapiv3" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 角色 +type Role struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name *string `protobuf:"bytes,2,opt,name=name,proto3,oneof" json:"name,omitempty"` + ParentId *uint32 `protobuf:"varint,3,opt,name=parentId,proto3,oneof" json:"parentId,omitempty"` + OrderNo *int32 `protobuf:"varint,4,opt,name=orderNo,proto3,oneof" json:"orderNo,omitempty"` + Code *string `protobuf:"bytes,5,opt,name=code,proto3,oneof" json:"code,omitempty"` + Status *string `protobuf:"bytes,6,opt,name=status,proto3,oneof" json:"status,omitempty"` + Remark *string `protobuf:"bytes,7,opt,name=remark,proto3,oneof" json:"remark,omitempty"` + CreateTime *string `protobuf:"bytes,20,opt,name=createTime,proto3,oneof" json:"createTime,omitempty"` // 创建时间 + UpdateTime *string `protobuf:"bytes,21,opt,name=updateTime,proto3,oneof" json:"updateTime,omitempty"` // 更新时间 + DeleteTime *string `protobuf:"bytes,22,opt,name=deleteTime,proto3,oneof" json:"deleteTime,omitempty"` // 删除时间 +} + +func (x *Role) Reset() { + *x = Role{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_role_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Role) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Role) ProtoMessage() {} + +func (x *Role) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_role_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Role.ProtoReflect.Descriptor instead. +func (*Role) Descriptor() ([]byte, []int) { + return file_user_service_v1_role_proto_rawDescGZIP(), []int{0} +} + +func (x *Role) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Role) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +func (x *Role) GetParentId() uint32 { + if x != nil && x.ParentId != nil { + return *x.ParentId + } + return 0 +} + +func (x *Role) GetOrderNo() int32 { + if x != nil && x.OrderNo != nil { + return *x.OrderNo + } + return 0 +} + +func (x *Role) GetCode() string { + if x != nil && x.Code != nil { + return *x.Code + } + return "" +} + +func (x *Role) GetStatus() string { + if x != nil && x.Status != nil { + return *x.Status + } + return "" +} + +func (x *Role) GetRemark() string { + if x != nil && x.Remark != nil { + return *x.Remark + } + return "" +} + +func (x *Role) GetCreateTime() string { + if x != nil && x.CreateTime != nil { + return *x.CreateTime + } + return "" +} + +func (x *Role) GetUpdateTime() string { + if x != nil && x.UpdateTime != nil { + return *x.UpdateTime + } + return "" +} + +func (x *Role) GetDeleteTime() string { + if x != nil && x.DeleteTime != nil { + return *x.DeleteTime + } + return "" +} + +// 角色列表 - 答复 +type ListRoleResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Items []*Role `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` + Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` +} + +func (x *ListRoleResponse) Reset() { + *x = ListRoleResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_role_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRoleResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRoleResponse) ProtoMessage() {} + +func (x *ListRoleResponse) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_role_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListRoleResponse.ProtoReflect.Descriptor instead. +func (*ListRoleResponse) Descriptor() ([]byte, []int) { + return file_user_service_v1_role_proto_rawDescGZIP(), []int{1} +} + +func (x *ListRoleResponse) GetItems() []*Role { + if x != nil { + return x.Items + } + return nil +} + +func (x *ListRoleResponse) GetTotal() int32 { + if x != nil { + return x.Total + } + return 0 +} + +// 角色数据 - 请求 +type GetRoleRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GetRoleRequest) Reset() { + *x = GetRoleRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_role_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRoleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRoleRequest) ProtoMessage() {} + +func (x *GetRoleRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_role_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRoleRequest.ProtoReflect.Descriptor instead. +func (*GetRoleRequest) Descriptor() ([]byte, []int) { + return file_user_service_v1_role_proto_rawDescGZIP(), []int{2} +} + +func (x *GetRoleRequest) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +// 创建角色 - 请求 +type CreateRoleRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Role *Role `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` + OperatorId *uint32 `protobuf:"varint,2,opt,name=operatorId,proto3,oneof" json:"operatorId,omitempty"` +} + +func (x *CreateRoleRequest) Reset() { + *x = CreateRoleRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_role_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateRoleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateRoleRequest) ProtoMessage() {} + +func (x *CreateRoleRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_role_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateRoleRequest.ProtoReflect.Descriptor instead. +func (*CreateRoleRequest) Descriptor() ([]byte, []int) { + return file_user_service_v1_role_proto_rawDescGZIP(), []int{3} +} + +func (x *CreateRoleRequest) GetRole() *Role { + if x != nil { + return x.Role + } + return nil +} + +func (x *CreateRoleRequest) GetOperatorId() uint32 { + if x != nil && x.OperatorId != nil { + return *x.OperatorId + } + return 0 +} + +// 更新角色 - 请求 +type UpdateRoleRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Role *Role `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` + OperatorId *uint32 `protobuf:"varint,2,opt,name=operatorId,proto3,oneof" json:"operatorId,omitempty"` +} + +func (x *UpdateRoleRequest) Reset() { + *x = UpdateRoleRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_role_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateRoleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateRoleRequest) ProtoMessage() {} + +func (x *UpdateRoleRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_role_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateRoleRequest.ProtoReflect.Descriptor instead. +func (*UpdateRoleRequest) Descriptor() ([]byte, []int) { + return file_user_service_v1_role_proto_rawDescGZIP(), []int{4} +} + +func (x *UpdateRoleRequest) GetRole() *Role { + if x != nil { + return x.Role + } + return nil +} + +func (x *UpdateRoleRequest) GetOperatorId() uint32 { + if x != nil && x.OperatorId != nil { + return *x.OperatorId + } + return 0 +} + +// 删除角色 - 请求 +type DeleteRoleRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + OperatorId *uint32 `protobuf:"varint,2,opt,name=operatorId,proto3,oneof" json:"operatorId,omitempty"` +} + +func (x *DeleteRoleRequest) Reset() { + *x = DeleteRoleRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_role_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteRoleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteRoleRequest) ProtoMessage() {} + +func (x *DeleteRoleRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_role_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteRoleRequest.ProtoReflect.Descriptor instead. +func (*DeleteRoleRequest) Descriptor() ([]byte, []int) { + return file_user_service_v1_role_proto_rawDescGZIP(), []int{5} +} + +func (x *DeleteRoleRequest) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *DeleteRoleRequest) GetOperatorId() uint32 { + if x != nil && x.OperatorId != nil { + return *x.OperatorId + } + return 0 +} + +var File_user_service_v1_role_proto protoreflect.FileDescriptor + +var file_user_service_v1_role_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, + 0x31, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x75, 0x73, + 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x24, 0x67, + 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x33, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x1e, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0xc3, 0x03, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x88, + 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0d, 0x48, 0x01, 0x52, 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, + 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x4e, 0x6f, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x48, 0x02, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x4e, 0x6f, 0x88, + 0x01, 0x01, 0x12, 0x17, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x88, 0x01, 0x01, 0x12, 0x3f, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x22, 0xba, 0x47, 0x1f, + 0xc2, 0x01, 0x04, 0x12, 0x02, 0x4f, 0x4e, 0xc2, 0x01, 0x05, 0x12, 0x03, 0x4f, 0x46, 0x46, 0x8a, + 0x02, 0x04, 0x1a, 0x02, 0x4f, 0x4e, 0x92, 0x02, 0x06, 0xe7, 0x8a, 0xb6, 0xe6, 0x80, 0x81, 0x48, + 0x04, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x88, 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x06, + 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x48, 0x05, 0x52, 0x06, + 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x48, 0x06, 0x52, + 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x23, + 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x15, 0x20, 0x01, + 0x28, 0x09, 0x48, 0x07, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, + 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, + 0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x48, 0x08, 0x52, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x42, 0x0a, + 0x0a, 0x08, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x4e, 0x6f, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x63, + 0x6f, 0x64, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x09, + 0x0a, 0x07, 0x5f, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x64, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x55, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f, + 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x69, 0x74, + 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, + 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x20, 0x0a, + 0x0e, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, + 0x72, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, + 0x23, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, + 0x64, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, + 0x72, 0x49, 0x64, 0x22, 0x72, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, + 0x6f, 0x6c, 0x65, 0x12, 0x23, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x6f, 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x57, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x23, 0x0a, 0x0a, + 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, + 0x48, 0x00, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x88, 0x01, + 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, + 0x32, 0x82, 0x03, 0x0a, 0x0b, 0x52, 0x6f, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x4a, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x19, 0x2e, 0x70, + 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f, + 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x07, + 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x1f, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x22, + 0x00, 0x12, 0x4a, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x12, + 0x22, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x4a, 0x0a, + 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x22, 0x2e, 0x75, 0x73, + 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x0a, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x22, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x22, 0x00, 0x42, 0xbb, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x75, 0x73, + 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x09, 0x52, + 0x6f, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3b, 0x6b, 0x72, 0x61, 0x74, + 0x6f, 0x73, 0x2d, 0x6d, 0x6f, 0x6e, 0x6f, 0x6c, 0x69, 0x74, 0x68, 0x69, 0x63, 0x2d, 0x64, 0x65, + 0x6d, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x75, 0x73, + 0x65, 0x72, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x55, 0x53, 0x58, 0xaa, 0x02, 0x0f, + 0x55, 0x73, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x56, 0x31, 0xca, + 0x02, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x56, + 0x31, 0xe2, 0x02, 0x1b, 0x55, 0x73, 0x65, 0x72, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x11, 0x55, 0x73, 0x65, 0x72, 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_user_service_v1_role_proto_rawDescOnce sync.Once + file_user_service_v1_role_proto_rawDescData = file_user_service_v1_role_proto_rawDesc +) + +func file_user_service_v1_role_proto_rawDescGZIP() []byte { + file_user_service_v1_role_proto_rawDescOnce.Do(func() { + file_user_service_v1_role_proto_rawDescData = protoimpl.X.CompressGZIP(file_user_service_v1_role_proto_rawDescData) + }) + return file_user_service_v1_role_proto_rawDescData +} + +var file_user_service_v1_role_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_user_service_v1_role_proto_goTypes = []interface{}{ + (*Role)(nil), // 0: user.service.v1.Role + (*ListRoleResponse)(nil), // 1: user.service.v1.ListRoleResponse + (*GetRoleRequest)(nil), // 2: user.service.v1.GetRoleRequest + (*CreateRoleRequest)(nil), // 3: user.service.v1.CreateRoleRequest + (*UpdateRoleRequest)(nil), // 4: user.service.v1.UpdateRoleRequest + (*DeleteRoleRequest)(nil), // 5: user.service.v1.DeleteRoleRequest + (*v1.PagingRequest)(nil), // 6: pagination.PagingRequest + (*emptypb.Empty)(nil), // 7: google.protobuf.Empty +} +var file_user_service_v1_role_proto_depIdxs = []int32{ + 0, // 0: user.service.v1.ListRoleResponse.items:type_name -> user.service.v1.Role + 0, // 1: user.service.v1.CreateRoleRequest.role:type_name -> user.service.v1.Role + 0, // 2: user.service.v1.UpdateRoleRequest.role:type_name -> user.service.v1.Role + 6, // 3: user.service.v1.RoleService.ListRole:input_type -> pagination.PagingRequest + 2, // 4: user.service.v1.RoleService.GetRole:input_type -> user.service.v1.GetRoleRequest + 3, // 5: user.service.v1.RoleService.CreateRole:input_type -> user.service.v1.CreateRoleRequest + 4, // 6: user.service.v1.RoleService.UpdateRole:input_type -> user.service.v1.UpdateRoleRequest + 5, // 7: user.service.v1.RoleService.DeleteRole:input_type -> user.service.v1.DeleteRoleRequest + 1, // 8: user.service.v1.RoleService.ListRole:output_type -> user.service.v1.ListRoleResponse + 0, // 9: user.service.v1.RoleService.GetRole:output_type -> user.service.v1.Role + 7, // 10: user.service.v1.RoleService.CreateRole:output_type -> google.protobuf.Empty + 7, // 11: user.service.v1.RoleService.UpdateRole:output_type -> google.protobuf.Empty + 7, // 12: user.service.v1.RoleService.DeleteRole:output_type -> google.protobuf.Empty + 8, // [8:13] is the sub-list for method output_type + 3, // [3:8] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_user_service_v1_role_proto_init() } +func file_user_service_v1_role_proto_init() { + if File_user_service_v1_role_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_user_service_v1_role_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Role); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_role_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRoleResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_role_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRoleRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_role_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateRoleRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_role_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateRoleRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_role_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteRoleRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_user_service_v1_role_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_user_service_v1_role_proto_msgTypes[3].OneofWrappers = []interface{}{} + file_user_service_v1_role_proto_msgTypes[4].OneofWrappers = []interface{}{} + file_user_service_v1_role_proto_msgTypes[5].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_user_service_v1_role_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_user_service_v1_role_proto_goTypes, + DependencyIndexes: file_user_service_v1_role_proto_depIdxs, + MessageInfos: file_user_service_v1_role_proto_msgTypes, + }.Build() + File_user_service_v1_role_proto = out.File + file_user_service_v1_role_proto_rawDesc = nil + file_user_service_v1_role_proto_goTypes = nil + file_user_service_v1_role_proto_depIdxs = nil +} diff --git a/monolithic/backend/gen/api/go/user/service/v1/role.pb.validate.go b/monolithic/backend/gen/api/go/user/service/v1/role.pb.validate.go new file mode 100644 index 0000000..11de910 --- /dev/null +++ b/monolithic/backend/gen/api/go/user/service/v1/role.pb.validate.go @@ -0,0 +1,788 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: user/service/v1/role.proto + +package servicev1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on Role with the rules defined in the proto +// definition for this message. If any rules are violated, the first error +// encountered is returned, or nil if there are no violations. +func (m *Role) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Role with the rules defined in the +// proto definition for this message. If any rules are violated, the result is +// a list of violation errors wrapped in RoleMultiError, or nil if none found. +func (m *Role) ValidateAll() error { + return m.validate(true) +} + +func (m *Role) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if m.Name != nil { + // no validation rules for Name + } + + if m.ParentId != nil { + // no validation rules for ParentId + } + + if m.OrderNo != nil { + // no validation rules for OrderNo + } + + if m.Code != nil { + // no validation rules for Code + } + + if m.Status != nil { + // no validation rules for Status + } + + if m.Remark != nil { + // no validation rules for Remark + } + + if m.CreateTime != nil { + // no validation rules for CreateTime + } + + if m.UpdateTime != nil { + // no validation rules for UpdateTime + } + + if m.DeleteTime != nil { + // no validation rules for DeleteTime + } + + if len(errors) > 0 { + return RoleMultiError(errors) + } + + return nil +} + +// RoleMultiError is an error wrapping multiple validation errors returned by +// Role.ValidateAll() if the designated constraints aren't met. +type RoleMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m RoleMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m RoleMultiError) AllErrors() []error { return m } + +// RoleValidationError is the validation error returned by Role.Validate if the +// designated constraints aren't met. +type RoleValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RoleValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RoleValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RoleValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RoleValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RoleValidationError) ErrorName() string { return "RoleValidationError" } + +// Error satisfies the builtin error interface +func (e RoleValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRole.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RoleValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RoleValidationError{} + +// Validate checks the field values on ListRoleResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *ListRoleResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ListRoleResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ListRoleResponseMultiError, or nil if none found. +func (m *ListRoleResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *ListRoleResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + for idx, item := range m.GetItems() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ListRoleResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ListRoleResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ListRoleResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + // no validation rules for Total + + if len(errors) > 0 { + return ListRoleResponseMultiError(errors) + } + + return nil +} + +// ListRoleResponseMultiError is an error wrapping multiple validation errors +// returned by ListRoleResponse.ValidateAll() if the designated constraints +// aren't met. +type ListRoleResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ListRoleResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ListRoleResponseMultiError) AllErrors() []error { return m } + +// ListRoleResponseValidationError is the validation error returned by +// ListRoleResponse.Validate if the designated constraints aren't met. +type ListRoleResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ListRoleResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ListRoleResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ListRoleResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ListRoleResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ListRoleResponseValidationError) ErrorName() string { return "ListRoleResponseValidationError" } + +// Error satisfies the builtin error interface +func (e ListRoleResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sListRoleResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ListRoleResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ListRoleResponseValidationError{} + +// Validate checks the field values on GetRoleRequest with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *GetRoleRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetRoleRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in GetRoleRequestMultiError, +// or nil if none found. +func (m *GetRoleRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *GetRoleRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if len(errors) > 0 { + return GetRoleRequestMultiError(errors) + } + + return nil +} + +// GetRoleRequestMultiError is an error wrapping multiple validation errors +// returned by GetRoleRequest.ValidateAll() if the designated constraints +// aren't met. +type GetRoleRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetRoleRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetRoleRequestMultiError) AllErrors() []error { return m } + +// GetRoleRequestValidationError is the validation error returned by +// GetRoleRequest.Validate if the designated constraints aren't met. +type GetRoleRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetRoleRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetRoleRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetRoleRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetRoleRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetRoleRequestValidationError) ErrorName() string { return "GetRoleRequestValidationError" } + +// Error satisfies the builtin error interface +func (e GetRoleRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetRoleRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetRoleRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetRoleRequestValidationError{} + +// Validate checks the field values on CreateRoleRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *CreateRoleRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on CreateRoleRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// CreateRoleRequestMultiError, or nil if none found. +func (m *CreateRoleRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *CreateRoleRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetRole()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CreateRoleRequestValidationError{ + field: "Role", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CreateRoleRequestValidationError{ + field: "Role", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRole()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateRoleRequestValidationError{ + field: "Role", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if m.OperatorId != nil { + // no validation rules for OperatorId + } + + if len(errors) > 0 { + return CreateRoleRequestMultiError(errors) + } + + return nil +} + +// CreateRoleRequestMultiError is an error wrapping multiple validation errors +// returned by CreateRoleRequest.ValidateAll() if the designated constraints +// aren't met. +type CreateRoleRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m CreateRoleRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m CreateRoleRequestMultiError) AllErrors() []error { return m } + +// CreateRoleRequestValidationError is the validation error returned by +// CreateRoleRequest.Validate if the designated constraints aren't met. +type CreateRoleRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CreateRoleRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CreateRoleRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CreateRoleRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CreateRoleRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CreateRoleRequestValidationError) ErrorName() string { + return "CreateRoleRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e CreateRoleRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCreateRoleRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CreateRoleRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CreateRoleRequestValidationError{} + +// Validate checks the field values on UpdateRoleRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *UpdateRoleRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on UpdateRoleRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// UpdateRoleRequestMultiError, or nil if none found. +func (m *UpdateRoleRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *UpdateRoleRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetRole()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UpdateRoleRequestValidationError{ + field: "Role", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UpdateRoleRequestValidationError{ + field: "Role", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRole()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpdateRoleRequestValidationError{ + field: "Role", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if m.OperatorId != nil { + // no validation rules for OperatorId + } + + if len(errors) > 0 { + return UpdateRoleRequestMultiError(errors) + } + + return nil +} + +// UpdateRoleRequestMultiError is an error wrapping multiple validation errors +// returned by UpdateRoleRequest.ValidateAll() if the designated constraints +// aren't met. +type UpdateRoleRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UpdateRoleRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m UpdateRoleRequestMultiError) AllErrors() []error { return m } + +// UpdateRoleRequestValidationError is the validation error returned by +// UpdateRoleRequest.Validate if the designated constraints aren't met. +type UpdateRoleRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UpdateRoleRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UpdateRoleRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UpdateRoleRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UpdateRoleRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UpdateRoleRequestValidationError) ErrorName() string { + return "UpdateRoleRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e UpdateRoleRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUpdateRoleRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UpdateRoleRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UpdateRoleRequestValidationError{} + +// Validate checks the field values on DeleteRoleRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *DeleteRoleRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on DeleteRoleRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// DeleteRoleRequestMultiError, or nil if none found. +func (m *DeleteRoleRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *DeleteRoleRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if m.OperatorId != nil { + // no validation rules for OperatorId + } + + if len(errors) > 0 { + return DeleteRoleRequestMultiError(errors) + } + + return nil +} + +// DeleteRoleRequestMultiError is an error wrapping multiple validation errors +// returned by DeleteRoleRequest.ValidateAll() if the designated constraints +// aren't met. +type DeleteRoleRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m DeleteRoleRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m DeleteRoleRequestMultiError) AllErrors() []error { return m } + +// DeleteRoleRequestValidationError is the validation error returned by +// DeleteRoleRequest.Validate if the designated constraints aren't met. +type DeleteRoleRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DeleteRoleRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DeleteRoleRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DeleteRoleRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DeleteRoleRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DeleteRoleRequestValidationError) ErrorName() string { + return "DeleteRoleRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e DeleteRoleRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDeleteRoleRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DeleteRoleRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DeleteRoleRequestValidationError{} diff --git a/monolithic/backend/gen/api/go/user/service/v1/role_grpc.pb.go b/monolithic/backend/gen/api/go/user/service/v1/role_grpc.pb.go new file mode 100644 index 0000000..e082ae5 --- /dev/null +++ b/monolithic/backend/gen/api/go/user/service/v1/role_grpc.pb.go @@ -0,0 +1,269 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: user/service/v1/role.proto + +package servicev1 + +import ( + context "context" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + RoleService_ListRole_FullMethodName = "/user.service.v1.RoleService/ListRole" + RoleService_GetRole_FullMethodName = "/user.service.v1.RoleService/GetRole" + RoleService_CreateRole_FullMethodName = "/user.service.v1.RoleService/CreateRole" + RoleService_UpdateRole_FullMethodName = "/user.service.v1.RoleService/UpdateRole" + RoleService_DeleteRole_FullMethodName = "/user.service.v1.RoleService/DeleteRole" +) + +// RoleServiceClient is the client API for RoleService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type RoleServiceClient interface { + // 查询角色列表 + ListRole(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*ListRoleResponse, error) + // 查询角色详情 + GetRole(ctx context.Context, in *GetRoleRequest, opts ...grpc.CallOption) (*Role, error) + // 创建角色 + CreateRole(ctx context.Context, in *CreateRoleRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 更新角色 + UpdateRole(ctx context.Context, in *UpdateRoleRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 删除角色 + DeleteRole(ctx context.Context, in *DeleteRoleRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type roleServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewRoleServiceClient(cc grpc.ClientConnInterface) RoleServiceClient { + return &roleServiceClient{cc} +} + +func (c *roleServiceClient) ListRole(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*ListRoleResponse, error) { + out := new(ListRoleResponse) + err := c.cc.Invoke(ctx, RoleService_ListRole_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *roleServiceClient) GetRole(ctx context.Context, in *GetRoleRequest, opts ...grpc.CallOption) (*Role, error) { + out := new(Role) + err := c.cc.Invoke(ctx, RoleService_GetRole_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *roleServiceClient) CreateRole(ctx context.Context, in *CreateRoleRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, RoleService_CreateRole_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *roleServiceClient) UpdateRole(ctx context.Context, in *UpdateRoleRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, RoleService_UpdateRole_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *roleServiceClient) DeleteRole(ctx context.Context, in *DeleteRoleRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, RoleService_DeleteRole_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// RoleServiceServer is the server API for RoleService service. +// All implementations must embed UnimplementedRoleServiceServer +// for forward compatibility +type RoleServiceServer interface { + // 查询角色列表 + ListRole(context.Context, *v1.PagingRequest) (*ListRoleResponse, error) + // 查询角色详情 + GetRole(context.Context, *GetRoleRequest) (*Role, error) + // 创建角色 + CreateRole(context.Context, *CreateRoleRequest) (*emptypb.Empty, error) + // 更新角色 + UpdateRole(context.Context, *UpdateRoleRequest) (*emptypb.Empty, error) + // 删除角色 + DeleteRole(context.Context, *DeleteRoleRequest) (*emptypb.Empty, error) + mustEmbedUnimplementedRoleServiceServer() +} + +// UnimplementedRoleServiceServer must be embedded to have forward compatible implementations. +type UnimplementedRoleServiceServer struct { +} + +func (UnimplementedRoleServiceServer) ListRole(context.Context, *v1.PagingRequest) (*ListRoleResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListRole not implemented") +} +func (UnimplementedRoleServiceServer) GetRole(context.Context, *GetRoleRequest) (*Role, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetRole not implemented") +} +func (UnimplementedRoleServiceServer) CreateRole(context.Context, *CreateRoleRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateRole not implemented") +} +func (UnimplementedRoleServiceServer) UpdateRole(context.Context, *UpdateRoleRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateRole not implemented") +} +func (UnimplementedRoleServiceServer) DeleteRole(context.Context, *DeleteRoleRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteRole not implemented") +} +func (UnimplementedRoleServiceServer) mustEmbedUnimplementedRoleServiceServer() {} + +// UnsafeRoleServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to RoleServiceServer will +// result in compilation errors. +type UnsafeRoleServiceServer interface { + mustEmbedUnimplementedRoleServiceServer() +} + +func RegisterRoleServiceServer(s grpc.ServiceRegistrar, srv RoleServiceServer) { + s.RegisterService(&RoleService_ServiceDesc, srv) +} + +func _RoleService_ListRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v1.PagingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RoleServiceServer).ListRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RoleService_ListRole_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RoleServiceServer).ListRole(ctx, req.(*v1.PagingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RoleService_GetRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetRoleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RoleServiceServer).GetRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RoleService_GetRole_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RoleServiceServer).GetRole(ctx, req.(*GetRoleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RoleService_CreateRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateRoleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RoleServiceServer).CreateRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RoleService_CreateRole_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RoleServiceServer).CreateRole(ctx, req.(*CreateRoleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RoleService_UpdateRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateRoleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RoleServiceServer).UpdateRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RoleService_UpdateRole_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RoleServiceServer).UpdateRole(ctx, req.(*UpdateRoleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RoleService_DeleteRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteRoleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RoleServiceServer).DeleteRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RoleService_DeleteRole_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RoleServiceServer).DeleteRole(ctx, req.(*DeleteRoleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// RoleService_ServiceDesc is the grpc.ServiceDesc for RoleService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var RoleService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "user.service.v1.RoleService", + HandlerType: (*RoleServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListRole", + Handler: _RoleService_ListRole_Handler, + }, + { + MethodName: "GetRole", + Handler: _RoleService_GetRole_Handler, + }, + { + MethodName: "CreateRole", + Handler: _RoleService_CreateRole_Handler, + }, + { + MethodName: "UpdateRole", + Handler: _RoleService_UpdateRole_Handler, + }, + { + MethodName: "DeleteRole", + Handler: _RoleService_DeleteRole_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "user/service/v1/role.proto", +} diff --git a/monolithic/backend/gen/api/go/user/service/v1/user.pb.go b/monolithic/backend/gen/api/go/user/service/v1/user.pb.go new file mode 100644 index 0000000..80cbcda --- /dev/null +++ b/monolithic/backend/gen/api/go/user/service/v1/user.pb.go @@ -0,0 +1,1364 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: user/service/v1/user.proto + +package servicev1 + +import ( + _ "github.com/google/gnostic/openapiv3" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 验证密码结果码 +type VerifyPasswordResult int32 + +const ( + VerifyPasswordResult_SUCCESS VerifyPasswordResult = 0 // 验证成功 + VerifyPasswordResult_ACCOUNT_NOT_EXISTS VerifyPasswordResult = 1 // 账号不存在 + VerifyPasswordResult_WRONG_PASSWORD VerifyPasswordResult = 2 // 密码错误 + VerifyPasswordResult_FREEZE VerifyPasswordResult = 3 // 已冻结 + VerifyPasswordResult_DELETED VerifyPasswordResult = 4 // 已删除 +) + +// Enum value maps for VerifyPasswordResult. +var ( + VerifyPasswordResult_name = map[int32]string{ + 0: "SUCCESS", + 1: "ACCOUNT_NOT_EXISTS", + 2: "WRONG_PASSWORD", + 3: "FREEZE", + 4: "DELETED", + } + VerifyPasswordResult_value = map[string]int32{ + "SUCCESS": 0, + "ACCOUNT_NOT_EXISTS": 1, + "WRONG_PASSWORD": 2, + "FREEZE": 3, + "DELETED": 4, + } +) + +func (x VerifyPasswordResult) Enum() *VerifyPasswordResult { + p := new(VerifyPasswordResult) + *p = x + return p +} + +func (x VerifyPasswordResult) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (VerifyPasswordResult) Descriptor() protoreflect.EnumDescriptor { + return file_user_service_v1_user_proto_enumTypes[0].Descriptor() +} + +func (VerifyPasswordResult) Type() protoreflect.EnumType { + return &file_user_service_v1_user_proto_enumTypes[0] +} + +func (x VerifyPasswordResult) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use VerifyPasswordResult.Descriptor instead. +func (VerifyPasswordResult) EnumDescriptor() ([]byte, []int) { + return file_user_service_v1_user_proto_rawDescGZIP(), []int{0} +} + +// 用户权限 +type UserAuthority int32 + +const ( + UserAuthority_SYS_ADMIN UserAuthority = 0 // 系统超级用户 + UserAuthority_CUSTOMER_USER UserAuthority = 1 // 普通用户 + UserAuthority_GUEST_USER UserAuthority = 2 // 游客 + UserAuthority_REFRESH_TOKEN UserAuthority = 3 // 刷新令牌 +) + +// Enum value maps for UserAuthority. +var ( + UserAuthority_name = map[int32]string{ + 0: "SYS_ADMIN", + 1: "CUSTOMER_USER", + 2: "GUEST_USER", + 3: "REFRESH_TOKEN", + } + UserAuthority_value = map[string]int32{ + "SYS_ADMIN": 0, + "CUSTOMER_USER": 1, + "GUEST_USER": 2, + "REFRESH_TOKEN": 3, + } +) + +func (x UserAuthority) Enum() *UserAuthority { + p := new(UserAuthority) + *p = x + return p +} + +func (x UserAuthority) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (UserAuthority) Descriptor() protoreflect.EnumDescriptor { + return file_user_service_v1_user_proto_enumTypes[1].Descriptor() +} + +func (UserAuthority) Type() protoreflect.EnumType { + return &file_user_service_v1_user_proto_enumTypes[1] +} + +func (x UserAuthority) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use UserAuthority.Descriptor instead. +func (UserAuthority) EnumDescriptor() ([]byte, []int) { + return file_user_service_v1_user_proto_rawDescGZIP(), []int{1} +} + +// 用户 +type User struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // 用户ID + RoleId *uint32 `protobuf:"varint,2,opt,name=roleId,proto3,oneof" json:"roleId,omitempty"` // 角色ID + WorkId *uint32 `protobuf:"varint,3,opt,name=workId,proto3,oneof" json:"workId,omitempty"` // 工号 + OrgId *uint32 `protobuf:"varint,4,opt,name=orgId,proto3,oneof" json:"orgId,omitempty"` // 部门ID + PositionId *uint32 `protobuf:"varint,5,opt,name=positionId,proto3,oneof" json:"positionId,omitempty"` // 岗位ID + CreatorId *uint32 `protobuf:"varint,6,opt,name=creatorId,proto3,oneof" json:"creatorId,omitempty"` // 创建者ID + UserName *string `protobuf:"bytes,10,opt,name=userName,proto3,oneof" json:"userName,omitempty"` // 登录名 + NickName *string `protobuf:"bytes,11,opt,name=nickName,proto3,oneof" json:"nickName,omitempty"` // 昵称 + RealName *string `protobuf:"bytes,12,opt,name=realName,proto3,oneof" json:"realName,omitempty"` // 真实姓名 + Avatar *string `protobuf:"bytes,13,opt,name=avatar,proto3,oneof" json:"avatar,omitempty"` // 头像 + Email *string `protobuf:"bytes,14,opt,name=email,proto3,oneof" json:"email,omitempty"` // 邮箱 + Phone *string `protobuf:"bytes,15,opt,name=phone,proto3,oneof" json:"phone,omitempty"` // 手机号 + Gender *string `protobuf:"bytes,16,opt,name=gender,proto3,oneof" json:"gender,omitempty"` // 性别 + Address *string `protobuf:"bytes,17,opt,name=address,proto3,oneof" json:"address,omitempty"` // 住址 + Description *string `protobuf:"bytes,18,opt,name=description,proto3,oneof" json:"description,omitempty"` // 个人描述 + LastLoginTime *int64 `protobuf:"varint,20,opt,name=lastLoginTime,proto3,oneof" json:"lastLoginTime,omitempty"` // 最后登录时间 + LastLoginIp *string `protobuf:"bytes,21,opt,name=lastLoginIp,proto3,oneof" json:"lastLoginIp,omitempty"` // 最后登录IP + Status *string `protobuf:"bytes,22,opt,name=status,proto3,oneof" json:"status,omitempty"` // 用户状态 + Authority *UserAuthority `protobuf:"varint,23,opt,name=authority,proto3,enum=user.service.v1.UserAuthority,oneof" json:"authority,omitempty"` // 权限 + CreateTime *string `protobuf:"bytes,30,opt,name=createTime,proto3,oneof" json:"createTime,omitempty"` // 创建时间 + UpdateTime *string `protobuf:"bytes,31,opt,name=updateTime,proto3,oneof" json:"updateTime,omitempty"` // 更新时间 + DeleteTime *string `protobuf:"bytes,32,opt,name=deleteTime,proto3,oneof" json:"deleteTime,omitempty"` // 删除时间 +} + +func (x *User) Reset() { + *x = User{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_user_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *User) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*User) ProtoMessage() {} + +func (x *User) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_user_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use User.ProtoReflect.Descriptor instead. +func (*User) Descriptor() ([]byte, []int) { + return file_user_service_v1_user_proto_rawDescGZIP(), []int{0} +} + +func (x *User) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *User) GetRoleId() uint32 { + if x != nil && x.RoleId != nil { + return *x.RoleId + } + return 0 +} + +func (x *User) GetWorkId() uint32 { + if x != nil && x.WorkId != nil { + return *x.WorkId + } + return 0 +} + +func (x *User) GetOrgId() uint32 { + if x != nil && x.OrgId != nil { + return *x.OrgId + } + return 0 +} + +func (x *User) GetPositionId() uint32 { + if x != nil && x.PositionId != nil { + return *x.PositionId + } + return 0 +} + +func (x *User) GetCreatorId() uint32 { + if x != nil && x.CreatorId != nil { + return *x.CreatorId + } + return 0 +} + +func (x *User) GetUserName() string { + if x != nil && x.UserName != nil { + return *x.UserName + } + return "" +} + +func (x *User) GetNickName() string { + if x != nil && x.NickName != nil { + return *x.NickName + } + return "" +} + +func (x *User) GetRealName() string { + if x != nil && x.RealName != nil { + return *x.RealName + } + return "" +} + +func (x *User) GetAvatar() string { + if x != nil && x.Avatar != nil { + return *x.Avatar + } + return "" +} + +func (x *User) GetEmail() string { + if x != nil && x.Email != nil { + return *x.Email + } + return "" +} + +func (x *User) GetPhone() string { + if x != nil && x.Phone != nil { + return *x.Phone + } + return "" +} + +func (x *User) GetGender() string { + if x != nil && x.Gender != nil { + return *x.Gender + } + return "" +} + +func (x *User) GetAddress() string { + if x != nil && x.Address != nil { + return *x.Address + } + return "" +} + +func (x *User) GetDescription() string { + if x != nil && x.Description != nil { + return *x.Description + } + return "" +} + +func (x *User) GetLastLoginTime() int64 { + if x != nil && x.LastLoginTime != nil { + return *x.LastLoginTime + } + return 0 +} + +func (x *User) GetLastLoginIp() string { + if x != nil && x.LastLoginIp != nil { + return *x.LastLoginIp + } + return "" +} + +func (x *User) GetStatus() string { + if x != nil && x.Status != nil { + return *x.Status + } + return "" +} + +func (x *User) GetAuthority() UserAuthority { + if x != nil && x.Authority != nil { + return *x.Authority + } + return UserAuthority_SYS_ADMIN +} + +func (x *User) GetCreateTime() string { + if x != nil && x.CreateTime != nil { + return *x.CreateTime + } + return "" +} + +func (x *User) GetUpdateTime() string { + if x != nil && x.UpdateTime != nil { + return *x.UpdateTime + } + return "" +} + +func (x *User) GetDeleteTime() string { + if x != nil && x.DeleteTime != nil { + return *x.DeleteTime + } + return "" +} + +// 获取用户列表 - 答复 +type ListUserResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Items []*User `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` + Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` +} + +func (x *ListUserResponse) Reset() { + *x = ListUserResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_user_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListUserResponse) ProtoMessage() {} + +func (x *ListUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_user_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListUserResponse.ProtoReflect.Descriptor instead. +func (*ListUserResponse) Descriptor() ([]byte, []int) { + return file_user_service_v1_user_proto_rawDescGZIP(), []int{1} +} + +func (x *ListUserResponse) GetItems() []*User { + if x != nil { + return x.Items + } + return nil +} + +func (x *ListUserResponse) GetTotal() int32 { + if x != nil { + return x.Total + } + return 0 +} + +// 获取用户数据 - 请求 +type GetUserRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GetUserRequest) Reset() { + *x = GetUserRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_user_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserRequest) ProtoMessage() {} + +func (x *GetUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_user_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserRequest.ProtoReflect.Descriptor instead. +func (*GetUserRequest) Descriptor() ([]byte, []int) { + return file_user_service_v1_user_proto_rawDescGZIP(), []int{2} +} + +func (x *GetUserRequest) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +type GetUserByUserNameRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserName string `protobuf:"bytes,1,opt,name=userName,proto3" json:"userName,omitempty"` +} + +func (x *GetUserByUserNameRequest) Reset() { + *x = GetUserByUserNameRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_user_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUserByUserNameRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserByUserNameRequest) ProtoMessage() {} + +func (x *GetUserByUserNameRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_user_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserByUserNameRequest.ProtoReflect.Descriptor instead. +func (*GetUserByUserNameRequest) Descriptor() ([]byte, []int) { + return file_user_service_v1_user_proto_rawDescGZIP(), []int{3} +} + +func (x *GetUserByUserNameRequest) GetUserName() string { + if x != nil { + return x.UserName + } + return "" +} + +// 创建用户 - 请求 +type CreateUserRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OperatorId uint32 `protobuf:"varint,1,opt,name=operatorId,proto3" json:"operatorId,omitempty"` + User *User `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` + Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` +} + +func (x *CreateUserRequest) Reset() { + *x = CreateUserRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_user_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateUserRequest) ProtoMessage() {} + +func (x *CreateUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_user_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead. +func (*CreateUserRequest) Descriptor() ([]byte, []int) { + return file_user_service_v1_user_proto_rawDescGZIP(), []int{4} +} + +func (x *CreateUserRequest) GetOperatorId() uint32 { + if x != nil { + return x.OperatorId + } + return 0 +} + +func (x *CreateUserRequest) GetUser() *User { + if x != nil { + return x.User + } + return nil +} + +func (x *CreateUserRequest) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +// 更新用户 - 请求 +type UpdateUserRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OperatorId uint32 `protobuf:"varint,1,opt,name=operator_id,json=operatorId,proto3" json:"operator_id,omitempty"` + User *User `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` + Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` + UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,4,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` + AllowMissing bool `protobuf:"varint,5,opt,name=allow_missing,json=allowMissing,proto3" json:"allow_missing,omitempty"` +} + +func (x *UpdateUserRequest) Reset() { + *x = UpdateUserRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_user_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUserRequest) ProtoMessage() {} + +func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_user_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateUserRequest.ProtoReflect.Descriptor instead. +func (*UpdateUserRequest) Descriptor() ([]byte, []int) { + return file_user_service_v1_user_proto_rawDescGZIP(), []int{5} +} + +func (x *UpdateUserRequest) GetOperatorId() uint32 { + if x != nil { + return x.OperatorId + } + return 0 +} + +func (x *UpdateUserRequest) GetUser() *User { + if x != nil { + return x.User + } + return nil +} + +func (x *UpdateUserRequest) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +func (x *UpdateUserRequest) GetUpdateMask() *fieldmaskpb.FieldMask { + if x != nil { + return x.UpdateMask + } + return nil +} + +func (x *UpdateUserRequest) GetAllowMissing() bool { + if x != nil { + return x.AllowMissing + } + return false +} + +// 删除用户 - 请求 +type DeleteUserRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + OperatorId uint32 `protobuf:"varint,2,opt,name=operatorId,proto3" json:"operatorId,omitempty"` +} + +func (x *DeleteUserRequest) Reset() { + *x = DeleteUserRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_user_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteUserRequest) ProtoMessage() {} + +func (x *DeleteUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_user_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteUserRequest.ProtoReflect.Descriptor instead. +func (*DeleteUserRequest) Descriptor() ([]byte, []int) { + return file_user_service_v1_user_proto_rawDescGZIP(), []int{6} +} + +func (x *DeleteUserRequest) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *DeleteUserRequest) GetOperatorId() uint32 { + if x != nil { + return x.OperatorId + } + return 0 +} + +// 验证密码 - 请求 +type VerifyPasswordRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserName string `protobuf:"bytes,1,opt,name=userName,proto3" json:"userName,omitempty"` // 用户名 + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` // 密码 +} + +func (x *VerifyPasswordRequest) Reset() { + *x = VerifyPasswordRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_user_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VerifyPasswordRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VerifyPasswordRequest) ProtoMessage() {} + +func (x *VerifyPasswordRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_user_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VerifyPasswordRequest.ProtoReflect.Descriptor instead. +func (*VerifyPasswordRequest) Descriptor() ([]byte, []int) { + return file_user_service_v1_user_proto_rawDescGZIP(), []int{7} +} + +func (x *VerifyPasswordRequest) GetUserName() string { + if x != nil { + return x.UserName + } + return "" +} + +func (x *VerifyPasswordRequest) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +// 验证密码 - 答复 +type VerifyPasswordResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Result VerifyPasswordResult `protobuf:"varint,1,opt,name=result,proto3,enum=user.service.v1.VerifyPasswordResult" json:"result,omitempty"` +} + +func (x *VerifyPasswordResponse) Reset() { + *x = VerifyPasswordResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_user_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VerifyPasswordResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VerifyPasswordResponse) ProtoMessage() {} + +func (x *VerifyPasswordResponse) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_user_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VerifyPasswordResponse.ProtoReflect.Descriptor instead. +func (*VerifyPasswordResponse) Descriptor() ([]byte, []int) { + return file_user_service_v1_user_proto_rawDescGZIP(), []int{8} +} + +func (x *VerifyPasswordResponse) GetResult() VerifyPasswordResult { + if x != nil { + return x.Result + } + return VerifyPasswordResult_SUCCESS +} + +// 用户是否存在 - 请求 +type UserExistsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserName string `protobuf:"bytes,1,opt,name=userName,proto3" json:"userName,omitempty"` +} + +func (x *UserExistsRequest) Reset() { + *x = UserExistsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_user_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserExistsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserExistsRequest) ProtoMessage() {} + +func (x *UserExistsRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_user_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserExistsRequest.ProtoReflect.Descriptor instead. +func (*UserExistsRequest) Descriptor() ([]byte, []int) { + return file_user_service_v1_user_proto_rawDescGZIP(), []int{9} +} + +func (x *UserExistsRequest) GetUserName() string { + if x != nil { + return x.UserName + } + return "" +} + +// 用户是否存在 - 答复 +type UserExistsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Exist bool `protobuf:"varint,1,opt,name=exist,proto3" json:"exist,omitempty"` +} + +func (x *UserExistsResponse) Reset() { + *x = UserExistsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_user_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserExistsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserExistsResponse) ProtoMessage() {} + +func (x *UserExistsResponse) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_user_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserExistsResponse.ProtoReflect.Descriptor instead. +func (*UserExistsResponse) Descriptor() ([]byte, []int) { + return file_user_service_v1_user_proto_rawDescGZIP(), []int{10} +} + +func (x *UserExistsResponse) GetExist() bool { + if x != nil { + return x.Exist + } + return false +} + +var File_user_service_v1_user_proto protoreflect.FileDescriptor + +var file_user_service_v1_user_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, + 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x75, 0x73, + 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x24, 0x67, + 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x33, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, + 0x76, 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0xda, 0x0a, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2b, 0x0a, 0x06, + 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x0e, 0xba, 0x47, + 0x0b, 0x92, 0x02, 0x08, 0xe8, 0xa7, 0x92, 0xe8, 0x89, 0xb2, 0x49, 0x44, 0x48, 0x00, 0x52, 0x06, + 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x29, 0x0a, 0x06, 0x77, 0x6f, 0x72, + 0x6b, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x0c, 0xba, 0x47, 0x09, 0x92, 0x02, + 0x06, 0xe5, 0xb7, 0xa5, 0xe5, 0x8f, 0xb7, 0x48, 0x01, 0x52, 0x06, 0x77, 0x6f, 0x72, 0x6b, 0x49, + 0x64, 0x88, 0x01, 0x01, 0x12, 0x29, 0x0a, 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0d, 0x42, 0x0e, 0xba, 0x47, 0x0b, 0x92, 0x02, 0x08, 0xe9, 0x83, 0xa8, 0xe9, 0x97, + 0xa8, 0x49, 0x44, 0x48, 0x02, 0x52, 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, + 0x33, 0x0a, 0x0a, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0d, 0x42, 0x0e, 0xba, 0x47, 0x0b, 0x92, 0x02, 0x08, 0xe5, 0xb2, 0x97, 0xe4, 0xbd, + 0x8d, 0x49, 0x44, 0x48, 0x03, 0x52, 0x0a, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, + 0x64, 0x88, 0x01, 0x01, 0x12, 0x34, 0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x49, + 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x11, 0xba, 0x47, 0x0e, 0x92, 0x02, 0x0b, 0xe5, + 0x88, 0x9b, 0xe5, 0xbb, 0xba, 0xe8, 0x80, 0x85, 0x49, 0x44, 0x48, 0x04, 0x52, 0x09, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x30, 0x0a, 0x08, 0x75, 0x73, + 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0f, 0xba, 0x47, + 0x0c, 0x92, 0x02, 0x09, 0xe7, 0x99, 0xbb, 0xe5, 0xbd, 0x95, 0xe5, 0x90, 0x8d, 0x48, 0x05, 0x52, + 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x2d, 0x0a, 0x08, + 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0c, + 0xba, 0x47, 0x09, 0x92, 0x02, 0x06, 0xe6, 0x98, 0xb5, 0xe7, 0xa7, 0xb0, 0x48, 0x06, 0x52, 0x08, + 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x08, 0x72, + 0x65, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x42, 0x12, 0xba, + 0x47, 0x0f, 0x92, 0x02, 0x0c, 0xe7, 0x9c, 0x9f, 0xe5, 0xae, 0x9e, 0xe5, 0xa7, 0x93, 0xe5, 0x90, + 0x8d, 0x48, 0x07, 0x52, 0x08, 0x72, 0x65, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, + 0x12, 0x29, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x0c, 0xba, 0x47, 0x09, 0x92, 0x02, 0x06, 0xe5, 0xa4, 0xb4, 0xe5, 0x83, 0x8f, 0x48, 0x08, + 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x88, 0x01, 0x01, 0x12, 0x27, 0x0a, 0x05, 0x65, + 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0c, 0xba, 0x47, 0x09, 0x92, + 0x02, 0x06, 0xe9, 0x82, 0xae, 0xe7, 0xae, 0xb1, 0x48, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, + 0x6c, 0x88, 0x01, 0x01, 0x12, 0x2a, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x0f, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x0f, 0xba, 0x47, 0x0c, 0x92, 0x02, 0x09, 0xe6, 0x89, 0x8b, 0xe6, 0x9c, + 0xba, 0xe5, 0x8f, 0xb7, 0x48, 0x0a, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x88, 0x01, 0x01, + 0x12, 0x29, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x0c, 0xba, 0x47, 0x09, 0x92, 0x02, 0x06, 0xe6, 0x80, 0xa7, 0xe5, 0x88, 0xab, 0x48, 0x0b, + 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x2b, 0x0a, 0x07, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0c, 0xba, 0x47, + 0x09, 0x92, 0x02, 0x06, 0xe4, 0xbd, 0x8f, 0xe5, 0x9d, 0x80, 0x48, 0x0c, 0x52, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x88, 0x01, 0x01, 0x12, 0x39, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x42, 0x12, 0xba, + 0x47, 0x0f, 0x92, 0x02, 0x0c, 0xe4, 0xb8, 0xaa, 0xe4, 0xba, 0xba, 0xe6, 0x8f, 0x8f, 0xe8, 0xbf, + 0xb0, 0x48, 0x0d, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x88, 0x01, 0x01, 0x12, 0x43, 0x0a, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, + 0x54, 0x69, 0x6d, 0x65, 0x18, 0x14, 0x20, 0x01, 0x28, 0x03, 0x42, 0x18, 0xba, 0x47, 0x15, 0x92, + 0x02, 0x12, 0xe6, 0x9c, 0x80, 0xe5, 0x90, 0x8e, 0xe7, 0x99, 0xbb, 0xe5, 0xbd, 0x95, 0xe6, 0x97, + 0xb6, 0xe9, 0x97, 0xb4, 0x48, 0x0e, 0x52, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x4c, 0x6f, 0x67, 0x69, + 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, + 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x49, 0x70, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x42, 0x14, 0xba, + 0x47, 0x11, 0x92, 0x02, 0x0e, 0xe6, 0x9c, 0x80, 0xe5, 0x90, 0x8e, 0xe7, 0x99, 0xbb, 0xe5, 0xbd, + 0x95, 0x49, 0x50, 0x48, 0x0f, 0x52, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, + 0x49, 0x70, 0x88, 0x01, 0x01, 0x12, 0x45, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x16, 0x20, 0x01, 0x28, 0x09, 0x42, 0x28, 0xba, 0x47, 0x25, 0xc2, 0x01, 0x04, 0x12, 0x02, 0x4f, + 0x4e, 0xc2, 0x01, 0x05, 0x12, 0x03, 0x4f, 0x46, 0x46, 0x8a, 0x02, 0x04, 0x1a, 0x02, 0x4f, 0x4e, + 0x92, 0x02, 0x0c, 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0xe7, 0x8a, 0xb6, 0xe6, 0x80, 0x81, 0x48, + 0x10, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x88, 0x01, 0x01, 0x12, 0x61, 0x0a, 0x09, + 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x1e, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x42, + 0x1e, 0xba, 0x47, 0x1b, 0x8a, 0x02, 0x0f, 0x1a, 0x0d, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x45, + 0x52, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x92, 0x02, 0x06, 0xe6, 0x9d, 0x83, 0xe9, 0x99, 0x90, 0x48, + 0x11, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x88, 0x01, 0x01, 0x12, + 0x23, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x1e, 0x20, + 0x01, 0x28, 0x09, 0x48, 0x12, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, + 0x65, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, + 0x6d, 0x65, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x09, 0x48, 0x13, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x64, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x20, 0x20, 0x01, 0x28, 0x09, 0x48, 0x14, 0x52, + 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x09, + 0x0a, 0x07, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x77, 0x6f, + 0x72, 0x6b, 0x49, 0x64, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x6f, 0x72, 0x67, 0x49, 0x64, 0x42, 0x0d, + 0x0a, 0x0b, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x42, 0x0c, 0x0a, + 0x0a, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x42, 0x0b, 0x0a, 0x09, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6e, 0x69, 0x63, + 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x72, 0x65, 0x61, 0x6c, 0x4e, 0x61, + 0x6d, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x42, 0x08, 0x0a, + 0x06, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x70, 0x68, 0x6f, 0x6e, + 0x65, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x42, 0x0a, 0x0a, 0x08, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x6c, 0x61, 0x73, + 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x6c, + 0x61, 0x73, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x49, 0x70, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, + 0x6d, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, + 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, + 0x22, 0x55, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, + 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x20, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, 0x36, 0x0a, 0x18, 0x47, 0x65, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, + 0x65, 0x22, 0x7a, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x6f, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x29, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, + 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0xc9, 0x03, + 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x16, 0xba, 0x47, 0x13, 0x18, 0x01, 0x92, + 0x02, 0x0e, 0xe6, 0x93, 0x8d, 0xe4, 0xbd, 0x9c, 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0x49, 0x44, + 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x43, 0x0a, 0x04, + 0x75, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x75, 0x73, 0x65, + 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, + 0x72, 0x42, 0x18, 0xe0, 0x41, 0x02, 0xba, 0x47, 0x12, 0x92, 0x02, 0x0f, 0xe7, 0x94, 0xa8, 0xe6, + 0x88, 0xb7, 0xe7, 0x9a, 0x84, 0xe6, 0x95, 0xb0, 0xe6, 0x8d, 0xae, 0x52, 0x04, 0x75, 0x73, 0x65, + 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x73, 0x0a, + 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x36, + 0xba, 0x47, 0x33, 0x3a, 0x16, 0x12, 0x14, 0x69, 0x64, 0x2c, 0x72, 0x65, 0x61, 0x6c, 0x4e, 0x61, + 0x6d, 0x65, 0x2c, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x92, 0x02, 0x18, 0xe8, 0xa6, + 0x81, 0xe6, 0x9b, 0xb4, 0xe6, 0x96, 0xb0, 0xe7, 0x9a, 0x84, 0xe5, 0xad, 0x97, 0xe6, 0xae, 0xb5, + 0xe5, 0x88, 0x97, 0xe8, 0xa1, 0xa8, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, + 0x73, 0x6b, 0x12, 0xa4, 0x01, 0x0a, 0x0d, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x6d, 0x69, 0x73, + 0x73, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x42, 0x7f, 0xba, 0x47, 0x7c, 0x92, + 0x02, 0x79, 0xe5, 0xa6, 0x82, 0xe6, 0x9e, 0x9c, 0xe8, 0xae, 0xbe, 0xe7, 0xbd, 0xae, 0xe4, 0xb8, + 0xba, 0x74, 0x72, 0x75, 0x65, 0xe7, 0x9a, 0x84, 0xe6, 0x97, 0xb6, 0xe5, 0x80, 0x99, 0xef, 0xbc, + 0x8c, 0xe8, 0xb5, 0x84, 0xe6, 0xba, 0x90, 0xe4, 0xb8, 0x8d, 0xe5, 0xad, 0x98, 0xe5, 0x9c, 0xa8, + 0xe5, 0x88, 0x99, 0xe4, 0xbc, 0x9a, 0xe6, 0x96, 0xb0, 0xe5, 0xa2, 0x9e, 0xef, 0xbc, 0x8c, 0xe5, + 0xb9, 0xb6, 0xe4, 0xb8, 0x94, 0xe5, 0x9c, 0xa8, 0xe8, 0xbf, 0x99, 0xe7, 0xa7, 0x8d, 0xe6, 0x83, + 0x85, 0xe5, 0x86, 0xb5, 0xe4, 0xb8, 0x8b, 0x60, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, + 0x73, 0x6b, 0x60, 0xe5, 0xad, 0x97, 0xe6, 0xae, 0xb5, 0xe5, 0xb0, 0x86, 0xe4, 0xbc, 0x9a, 0xe8, + 0xa2, 0xab, 0xe5, 0xbf, 0xbd, 0xe7, 0x95, 0xa5, 0xe3, 0x80, 0x82, 0x52, 0x0c, 0x61, 0x6c, 0x6c, + 0x6f, 0x77, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x22, 0x43, 0x0a, 0x11, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, + 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x4f, + 0x0a, 0x15, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, + 0x57, 0x0a, 0x16, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, + 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x69, + 0x66, 0x79, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x2f, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, + 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, + 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x2a, 0x0a, 0x12, 0x55, 0x73, 0x65, + 0x72, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x65, 0x78, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, + 0x65, 0x78, 0x69, 0x73, 0x74, 0x2a, 0x68, 0x0a, 0x14, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x50, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x0b, 0x0a, + 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x43, + 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x58, 0x49, 0x53, 0x54, 0x53, + 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x57, 0x52, 0x4f, 0x4e, 0x47, 0x5f, 0x50, 0x41, 0x53, 0x53, + 0x57, 0x4f, 0x52, 0x44, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x52, 0x45, 0x45, 0x5a, 0x45, + 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x04, 0x2a, + 0x54, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x59, 0x53, 0x5f, 0x41, 0x44, 0x4d, 0x49, 0x4e, 0x10, 0x00, 0x12, + 0x11, 0x0a, 0x0d, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x45, 0x52, 0x5f, 0x55, 0x53, 0x45, 0x52, + 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x47, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x55, 0x53, 0x45, 0x52, + 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x45, 0x46, 0x52, 0x45, 0x53, 0x48, 0x5f, 0x54, 0x4f, + 0x4b, 0x45, 0x4e, 0x10, 0x03, 0x32, 0x99, 0x05, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4a, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, + 0x72, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, + 0x61, 0x67, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x43, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, + 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x55, 0x73, 0x65, 0x72, 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x55, 0x73, 0x65, 0x72, 0x12, 0x22, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x12, 0x22, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x4a, + 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x22, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x11, 0x47, 0x65, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x29, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x55, 0x73, 0x65, 0x72, 0x4e, + 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x75, 0x73, 0x65, + 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, + 0x72, 0x22, 0x00, 0x12, 0x63, 0x0a, 0x0e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x50, 0x61, 0x73, + 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x26, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x50, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x0a, 0x55, 0x73, 0x65, 0x72, + 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x22, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x69, + 0x73, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x75, 0x73, 0x65, + 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, + 0x72, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x42, 0xbb, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x09, 0x55, 0x73, 0x65, 0x72, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3b, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x6d, + 0x6f, 0x6e, 0x6f, 0x6c, 0x69, 0x74, 0x68, 0x69, 0x63, 0x2d, 0x64, 0x65, 0x6d, 0x6f, 0x2f, 0x67, + 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x55, 0x53, 0x58, 0xaa, 0x02, 0x0f, 0x55, 0x73, 0x65, 0x72, + 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x55, 0x73, + 0x65, 0x72, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, + 0x55, 0x73, 0x65, 0x72, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x55, 0x73, + 0x65, 0x72, 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_user_service_v1_user_proto_rawDescOnce sync.Once + file_user_service_v1_user_proto_rawDescData = file_user_service_v1_user_proto_rawDesc +) + +func file_user_service_v1_user_proto_rawDescGZIP() []byte { + file_user_service_v1_user_proto_rawDescOnce.Do(func() { + file_user_service_v1_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_user_service_v1_user_proto_rawDescData) + }) + return file_user_service_v1_user_proto_rawDescData +} + +var file_user_service_v1_user_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_user_service_v1_user_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_user_service_v1_user_proto_goTypes = []interface{}{ + (VerifyPasswordResult)(0), // 0: user.service.v1.VerifyPasswordResult + (UserAuthority)(0), // 1: user.service.v1.UserAuthority + (*User)(nil), // 2: user.service.v1.User + (*ListUserResponse)(nil), // 3: user.service.v1.ListUserResponse + (*GetUserRequest)(nil), // 4: user.service.v1.GetUserRequest + (*GetUserByUserNameRequest)(nil), // 5: user.service.v1.GetUserByUserNameRequest + (*CreateUserRequest)(nil), // 6: user.service.v1.CreateUserRequest + (*UpdateUserRequest)(nil), // 7: user.service.v1.UpdateUserRequest + (*DeleteUserRequest)(nil), // 8: user.service.v1.DeleteUserRequest + (*VerifyPasswordRequest)(nil), // 9: user.service.v1.VerifyPasswordRequest + (*VerifyPasswordResponse)(nil), // 10: user.service.v1.VerifyPasswordResponse + (*UserExistsRequest)(nil), // 11: user.service.v1.UserExistsRequest + (*UserExistsResponse)(nil), // 12: user.service.v1.UserExistsResponse + (*fieldmaskpb.FieldMask)(nil), // 13: google.protobuf.FieldMask + (*v1.PagingRequest)(nil), // 14: pagination.PagingRequest + (*emptypb.Empty)(nil), // 15: google.protobuf.Empty +} +var file_user_service_v1_user_proto_depIdxs = []int32{ + 1, // 0: user.service.v1.User.authority:type_name -> user.service.v1.UserAuthority + 2, // 1: user.service.v1.ListUserResponse.items:type_name -> user.service.v1.User + 2, // 2: user.service.v1.CreateUserRequest.user:type_name -> user.service.v1.User + 2, // 3: user.service.v1.UpdateUserRequest.user:type_name -> user.service.v1.User + 13, // 4: user.service.v1.UpdateUserRequest.update_mask:type_name -> google.protobuf.FieldMask + 0, // 5: user.service.v1.VerifyPasswordResponse.result:type_name -> user.service.v1.VerifyPasswordResult + 14, // 6: user.service.v1.UserService.ListUser:input_type -> pagination.PagingRequest + 4, // 7: user.service.v1.UserService.GetUser:input_type -> user.service.v1.GetUserRequest + 6, // 8: user.service.v1.UserService.CreateUser:input_type -> user.service.v1.CreateUserRequest + 7, // 9: user.service.v1.UserService.UpdateUser:input_type -> user.service.v1.UpdateUserRequest + 8, // 10: user.service.v1.UserService.DeleteUser:input_type -> user.service.v1.DeleteUserRequest + 5, // 11: user.service.v1.UserService.GetUserByUserName:input_type -> user.service.v1.GetUserByUserNameRequest + 9, // 12: user.service.v1.UserService.VerifyPassword:input_type -> user.service.v1.VerifyPasswordRequest + 11, // 13: user.service.v1.UserService.UserExists:input_type -> user.service.v1.UserExistsRequest + 3, // 14: user.service.v1.UserService.ListUser:output_type -> user.service.v1.ListUserResponse + 2, // 15: user.service.v1.UserService.GetUser:output_type -> user.service.v1.User + 15, // 16: user.service.v1.UserService.CreateUser:output_type -> google.protobuf.Empty + 15, // 17: user.service.v1.UserService.UpdateUser:output_type -> google.protobuf.Empty + 15, // 18: user.service.v1.UserService.DeleteUser:output_type -> google.protobuf.Empty + 2, // 19: user.service.v1.UserService.GetUserByUserName:output_type -> user.service.v1.User + 10, // 20: user.service.v1.UserService.VerifyPassword:output_type -> user.service.v1.VerifyPasswordResponse + 12, // 21: user.service.v1.UserService.UserExists:output_type -> user.service.v1.UserExistsResponse + 14, // [14:22] is the sub-list for method output_type + 6, // [6:14] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_user_service_v1_user_proto_init() } +func file_user_service_v1_user_proto_init() { + if File_user_service_v1_user_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_user_service_v1_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*User); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_user_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListUserResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_user_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUserRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_user_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUserByUserNameRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_user_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateUserRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_user_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateUserRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_user_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteUserRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_user_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VerifyPasswordRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_user_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VerifyPasswordResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_user_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserExistsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_user_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserExistsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_user_service_v1_user_proto_msgTypes[0].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_user_service_v1_user_proto_rawDesc, + NumEnums: 2, + NumMessages: 11, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_user_service_v1_user_proto_goTypes, + DependencyIndexes: file_user_service_v1_user_proto_depIdxs, + EnumInfos: file_user_service_v1_user_proto_enumTypes, + MessageInfos: file_user_service_v1_user_proto_msgTypes, + }.Build() + File_user_service_v1_user_proto = out.File + file_user_service_v1_user_proto_rawDesc = nil + file_user_service_v1_user_proto_goTypes = nil + file_user_service_v1_user_proto_depIdxs = nil +} diff --git a/monolithic/backend/gen/api/go/user/service/v1/user.pb.validate.go b/monolithic/backend/gen/api/go/user/service/v1/user.pb.validate.go new file mode 100644 index 0000000..56d4c1f --- /dev/null +++ b/monolithic/backend/gen/api/go/user/service/v1/user.pb.validate.go @@ -0,0 +1,1387 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: user/service/v1/user.proto + +package servicev1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on User with the rules defined in the proto +// definition for this message. If any rules are violated, the first error +// encountered is returned, or nil if there are no violations. +func (m *User) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on User with the rules defined in the +// proto definition for this message. If any rules are violated, the result is +// a list of violation errors wrapped in UserMultiError, or nil if none found. +func (m *User) ValidateAll() error { + return m.validate(true) +} + +func (m *User) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if m.RoleId != nil { + // no validation rules for RoleId + } + + if m.WorkId != nil { + // no validation rules for WorkId + } + + if m.OrgId != nil { + // no validation rules for OrgId + } + + if m.PositionId != nil { + // no validation rules for PositionId + } + + if m.CreatorId != nil { + // no validation rules for CreatorId + } + + if m.UserName != nil { + // no validation rules for UserName + } + + if m.NickName != nil { + // no validation rules for NickName + } + + if m.RealName != nil { + // no validation rules for RealName + } + + if m.Avatar != nil { + // no validation rules for Avatar + } + + if m.Email != nil { + // no validation rules for Email + } + + if m.Phone != nil { + // no validation rules for Phone + } + + if m.Gender != nil { + // no validation rules for Gender + } + + if m.Address != nil { + // no validation rules for Address + } + + if m.Description != nil { + // no validation rules for Description + } + + if m.LastLoginTime != nil { + // no validation rules for LastLoginTime + } + + if m.LastLoginIp != nil { + // no validation rules for LastLoginIp + } + + if m.Status != nil { + // no validation rules for Status + } + + if m.Authority != nil { + // no validation rules for Authority + } + + if m.CreateTime != nil { + // no validation rules for CreateTime + } + + if m.UpdateTime != nil { + // no validation rules for UpdateTime + } + + if m.DeleteTime != nil { + // no validation rules for DeleteTime + } + + if len(errors) > 0 { + return UserMultiError(errors) + } + + return nil +} + +// UserMultiError is an error wrapping multiple validation errors returned by +// User.ValidateAll() if the designated constraints aren't met. +type UserMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UserMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m UserMultiError) AllErrors() []error { return m } + +// UserValidationError is the validation error returned by User.Validate if the +// designated constraints aren't met. +type UserValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UserValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UserValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UserValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UserValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UserValidationError) ErrorName() string { return "UserValidationError" } + +// Error satisfies the builtin error interface +func (e UserValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUser.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UserValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UserValidationError{} + +// Validate checks the field values on ListUserResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *ListUserResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ListUserResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ListUserResponseMultiError, or nil if none found. +func (m *ListUserResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *ListUserResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + for idx, item := range m.GetItems() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ListUserResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ListUserResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ListUserResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + // no validation rules for Total + + if len(errors) > 0 { + return ListUserResponseMultiError(errors) + } + + return nil +} + +// ListUserResponseMultiError is an error wrapping multiple validation errors +// returned by ListUserResponse.ValidateAll() if the designated constraints +// aren't met. +type ListUserResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ListUserResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ListUserResponseMultiError) AllErrors() []error { return m } + +// ListUserResponseValidationError is the validation error returned by +// ListUserResponse.Validate if the designated constraints aren't met. +type ListUserResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ListUserResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ListUserResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ListUserResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ListUserResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ListUserResponseValidationError) ErrorName() string { return "ListUserResponseValidationError" } + +// Error satisfies the builtin error interface +func (e ListUserResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sListUserResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ListUserResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ListUserResponseValidationError{} + +// Validate checks the field values on GetUserRequest with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *GetUserRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetUserRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in GetUserRequestMultiError, +// or nil if none found. +func (m *GetUserRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *GetUserRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if len(errors) > 0 { + return GetUserRequestMultiError(errors) + } + + return nil +} + +// GetUserRequestMultiError is an error wrapping multiple validation errors +// returned by GetUserRequest.ValidateAll() if the designated constraints +// aren't met. +type GetUserRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetUserRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetUserRequestMultiError) AllErrors() []error { return m } + +// GetUserRequestValidationError is the validation error returned by +// GetUserRequest.Validate if the designated constraints aren't met. +type GetUserRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetUserRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetUserRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetUserRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetUserRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetUserRequestValidationError) ErrorName() string { return "GetUserRequestValidationError" } + +// Error satisfies the builtin error interface +func (e GetUserRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetUserRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetUserRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetUserRequestValidationError{} + +// Validate checks the field values on GetUserByUserNameRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *GetUserByUserNameRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetUserByUserNameRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// GetUserByUserNameRequestMultiError, or nil if none found. +func (m *GetUserByUserNameRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *GetUserByUserNameRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for UserName + + if len(errors) > 0 { + return GetUserByUserNameRequestMultiError(errors) + } + + return nil +} + +// GetUserByUserNameRequestMultiError is an error wrapping multiple validation +// errors returned by GetUserByUserNameRequest.ValidateAll() if the designated +// constraints aren't met. +type GetUserByUserNameRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetUserByUserNameRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetUserByUserNameRequestMultiError) AllErrors() []error { return m } + +// GetUserByUserNameRequestValidationError is the validation error returned by +// GetUserByUserNameRequest.Validate if the designated constraints aren't met. +type GetUserByUserNameRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetUserByUserNameRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetUserByUserNameRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetUserByUserNameRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetUserByUserNameRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetUserByUserNameRequestValidationError) ErrorName() string { + return "GetUserByUserNameRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e GetUserByUserNameRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetUserByUserNameRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetUserByUserNameRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetUserByUserNameRequestValidationError{} + +// Validate checks the field values on CreateUserRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *CreateUserRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on CreateUserRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// CreateUserRequestMultiError, or nil if none found. +func (m *CreateUserRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *CreateUserRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for OperatorId + + if all { + switch v := interface{}(m.GetUser()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CreateUserRequestValidationError{ + field: "User", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CreateUserRequestValidationError{ + field: "User", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetUser()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateUserRequestValidationError{ + field: "User", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for Password + + if len(errors) > 0 { + return CreateUserRequestMultiError(errors) + } + + return nil +} + +// CreateUserRequestMultiError is an error wrapping multiple validation errors +// returned by CreateUserRequest.ValidateAll() if the designated constraints +// aren't met. +type CreateUserRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m CreateUserRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m CreateUserRequestMultiError) AllErrors() []error { return m } + +// CreateUserRequestValidationError is the validation error returned by +// CreateUserRequest.Validate if the designated constraints aren't met. +type CreateUserRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CreateUserRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CreateUserRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CreateUserRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CreateUserRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CreateUserRequestValidationError) ErrorName() string { + return "CreateUserRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e CreateUserRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCreateUserRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CreateUserRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CreateUserRequestValidationError{} + +// Validate checks the field values on UpdateUserRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *UpdateUserRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on UpdateUserRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// UpdateUserRequestMultiError, or nil if none found. +func (m *UpdateUserRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *UpdateUserRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for OperatorId + + if all { + switch v := interface{}(m.GetUser()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UpdateUserRequestValidationError{ + field: "User", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UpdateUserRequestValidationError{ + field: "User", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetUser()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpdateUserRequestValidationError{ + field: "User", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for Password + + if all { + switch v := interface{}(m.GetUpdateMask()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UpdateUserRequestValidationError{ + field: "UpdateMask", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UpdateUserRequestValidationError{ + field: "UpdateMask", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetUpdateMask()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpdateUserRequestValidationError{ + field: "UpdateMask", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for AllowMissing + + if len(errors) > 0 { + return UpdateUserRequestMultiError(errors) + } + + return nil +} + +// UpdateUserRequestMultiError is an error wrapping multiple validation errors +// returned by UpdateUserRequest.ValidateAll() if the designated constraints +// aren't met. +type UpdateUserRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UpdateUserRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m UpdateUserRequestMultiError) AllErrors() []error { return m } + +// UpdateUserRequestValidationError is the validation error returned by +// UpdateUserRequest.Validate if the designated constraints aren't met. +type UpdateUserRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UpdateUserRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UpdateUserRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UpdateUserRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UpdateUserRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UpdateUserRequestValidationError) ErrorName() string { + return "UpdateUserRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e UpdateUserRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUpdateUserRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UpdateUserRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UpdateUserRequestValidationError{} + +// Validate checks the field values on DeleteUserRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *DeleteUserRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on DeleteUserRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// DeleteUserRequestMultiError, or nil if none found. +func (m *DeleteUserRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *DeleteUserRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + // no validation rules for OperatorId + + if len(errors) > 0 { + return DeleteUserRequestMultiError(errors) + } + + return nil +} + +// DeleteUserRequestMultiError is an error wrapping multiple validation errors +// returned by DeleteUserRequest.ValidateAll() if the designated constraints +// aren't met. +type DeleteUserRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m DeleteUserRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m DeleteUserRequestMultiError) AllErrors() []error { return m } + +// DeleteUserRequestValidationError is the validation error returned by +// DeleteUserRequest.Validate if the designated constraints aren't met. +type DeleteUserRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DeleteUserRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DeleteUserRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DeleteUserRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DeleteUserRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DeleteUserRequestValidationError) ErrorName() string { + return "DeleteUserRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e DeleteUserRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDeleteUserRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DeleteUserRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DeleteUserRequestValidationError{} + +// Validate checks the field values on VerifyPasswordRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *VerifyPasswordRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on VerifyPasswordRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// VerifyPasswordRequestMultiError, or nil if none found. +func (m *VerifyPasswordRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *VerifyPasswordRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for UserName + + // no validation rules for Password + + if len(errors) > 0 { + return VerifyPasswordRequestMultiError(errors) + } + + return nil +} + +// VerifyPasswordRequestMultiError is an error wrapping multiple validation +// errors returned by VerifyPasswordRequest.ValidateAll() if the designated +// constraints aren't met. +type VerifyPasswordRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m VerifyPasswordRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m VerifyPasswordRequestMultiError) AllErrors() []error { return m } + +// VerifyPasswordRequestValidationError is the validation error returned by +// VerifyPasswordRequest.Validate if the designated constraints aren't met. +type VerifyPasswordRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e VerifyPasswordRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e VerifyPasswordRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e VerifyPasswordRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e VerifyPasswordRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e VerifyPasswordRequestValidationError) ErrorName() string { + return "VerifyPasswordRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e VerifyPasswordRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sVerifyPasswordRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = VerifyPasswordRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = VerifyPasswordRequestValidationError{} + +// Validate checks the field values on VerifyPasswordResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *VerifyPasswordResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on VerifyPasswordResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// VerifyPasswordResponseMultiError, or nil if none found. +func (m *VerifyPasswordResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *VerifyPasswordResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Result + + if len(errors) > 0 { + return VerifyPasswordResponseMultiError(errors) + } + + return nil +} + +// VerifyPasswordResponseMultiError is an error wrapping multiple validation +// errors returned by VerifyPasswordResponse.ValidateAll() if the designated +// constraints aren't met. +type VerifyPasswordResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m VerifyPasswordResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m VerifyPasswordResponseMultiError) AllErrors() []error { return m } + +// VerifyPasswordResponseValidationError is the validation error returned by +// VerifyPasswordResponse.Validate if the designated constraints aren't met. +type VerifyPasswordResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e VerifyPasswordResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e VerifyPasswordResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e VerifyPasswordResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e VerifyPasswordResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e VerifyPasswordResponseValidationError) ErrorName() string { + return "VerifyPasswordResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e VerifyPasswordResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sVerifyPasswordResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = VerifyPasswordResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = VerifyPasswordResponseValidationError{} + +// Validate checks the field values on UserExistsRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *UserExistsRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on UserExistsRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// UserExistsRequestMultiError, or nil if none found. +func (m *UserExistsRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *UserExistsRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for UserName + + if len(errors) > 0 { + return UserExistsRequestMultiError(errors) + } + + return nil +} + +// UserExistsRequestMultiError is an error wrapping multiple validation errors +// returned by UserExistsRequest.ValidateAll() if the designated constraints +// aren't met. +type UserExistsRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UserExistsRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m UserExistsRequestMultiError) AllErrors() []error { return m } + +// UserExistsRequestValidationError is the validation error returned by +// UserExistsRequest.Validate if the designated constraints aren't met. +type UserExistsRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UserExistsRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UserExistsRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UserExistsRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UserExistsRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UserExistsRequestValidationError) ErrorName() string { + return "UserExistsRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e UserExistsRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUserExistsRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UserExistsRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UserExistsRequestValidationError{} + +// Validate checks the field values on UserExistsResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *UserExistsResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on UserExistsResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// UserExistsResponseMultiError, or nil if none found. +func (m *UserExistsResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *UserExistsResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Exist + + if len(errors) > 0 { + return UserExistsResponseMultiError(errors) + } + + return nil +} + +// UserExistsResponseMultiError is an error wrapping multiple validation errors +// returned by UserExistsResponse.ValidateAll() if the designated constraints +// aren't met. +type UserExistsResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UserExistsResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m UserExistsResponseMultiError) AllErrors() []error { return m } + +// UserExistsResponseValidationError is the validation error returned by +// UserExistsResponse.Validate if the designated constraints aren't met. +type UserExistsResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UserExistsResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UserExistsResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UserExistsResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UserExistsResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UserExistsResponseValidationError) ErrorName() string { + return "UserExistsResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e UserExistsResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUserExistsResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UserExistsResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UserExistsResponseValidationError{} diff --git a/monolithic/backend/gen/api/go/user/service/v1/user_error.pb.go b/monolithic/backend/gen/api/go/user/service/v1/user_error.pb.go new file mode 100644 index 0000000..b9d051c --- /dev/null +++ b/monolithic/backend/gen/api/go/user/service/v1/user_error.pb.go @@ -0,0 +1,168 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: user/service/v1/user_error.proto + +package servicev1 + +import ( + _ "github.com/go-kratos/kratos/v2/errors" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type UserErrorReason int32 + +const ( + UserErrorReason_NOT_LOGGED_IN UserErrorReason = 0 // 401 + UserErrorReason_INVALID_USERID UserErrorReason = 14 // 用户ID无效 + UserErrorReason_INVALID_PASSWORD UserErrorReason = 15 // 密码无效 + UserErrorReason_TOKEN_EXPIRED UserErrorReason = 16 // token过期 + UserErrorReason_INVALID_TOKEN UserErrorReason = 17 // token无效 + UserErrorReason_TOKEN_NOT_EXIST UserErrorReason = 18 // token不存在 + UserErrorReason_USER_NOT_EXIST UserErrorReason = 19 // 用户不存在 +) + +// Enum value maps for UserErrorReason. +var ( + UserErrorReason_name = map[int32]string{ + 0: "NOT_LOGGED_IN", + 14: "INVALID_USERID", + 15: "INVALID_PASSWORD", + 16: "TOKEN_EXPIRED", + 17: "INVALID_TOKEN", + 18: "TOKEN_NOT_EXIST", + 19: "USER_NOT_EXIST", + } + UserErrorReason_value = map[string]int32{ + "NOT_LOGGED_IN": 0, + "INVALID_USERID": 14, + "INVALID_PASSWORD": 15, + "TOKEN_EXPIRED": 16, + "INVALID_TOKEN": 17, + "TOKEN_NOT_EXIST": 18, + "USER_NOT_EXIST": 19, + } +) + +func (x UserErrorReason) Enum() *UserErrorReason { + p := new(UserErrorReason) + *p = x + return p +} + +func (x UserErrorReason) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (UserErrorReason) Descriptor() protoreflect.EnumDescriptor { + return file_user_service_v1_user_error_proto_enumTypes[0].Descriptor() +} + +func (UserErrorReason) Type() protoreflect.EnumType { + return &file_user_service_v1_user_error_proto_enumTypes[0] +} + +func (x UserErrorReason) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use UserErrorReason.Descriptor instead. +func (UserErrorReason) EnumDescriptor() ([]byte, []int) { + return file_user_service_v1_user_error_proto_rawDescGZIP(), []int{0} +} + +var File_user_service_v1_user_error_proto protoreflect.FileDescriptor + +var file_user_service_v1_user_error_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, + 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x0f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x76, 0x31, 0x1a, 0x13, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2f, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2a, 0xcd, 0x01, 0x0a, 0x0f, 0x55, 0x73, 0x65, + 0x72, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x0d, + 0x4e, 0x4f, 0x54, 0x5f, 0x4c, 0x4f, 0x47, 0x47, 0x45, 0x44, 0x5f, 0x49, 0x4e, 0x10, 0x00, 0x1a, + 0x04, 0xa8, 0x45, 0x91, 0x03, 0x12, 0x18, 0x0a, 0x0e, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, + 0x5f, 0x55, 0x53, 0x45, 0x52, 0x49, 0x44, 0x10, 0x0e, 0x1a, 0x04, 0xa8, 0x45, 0x90, 0x03, 0x12, + 0x1a, 0x0a, 0x10, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x50, 0x41, 0x53, 0x53, 0x57, + 0x4f, 0x52, 0x44, 0x10, 0x0f, 0x1a, 0x04, 0xa8, 0x45, 0x90, 0x03, 0x12, 0x17, 0x0a, 0x0d, 0x54, + 0x4f, 0x4b, 0x45, 0x4e, 0x5f, 0x45, 0x58, 0x50, 0x49, 0x52, 0x45, 0x44, 0x10, 0x10, 0x1a, 0x04, + 0xa8, 0x45, 0x90, 0x03, 0x12, 0x17, 0x0a, 0x0d, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, + 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x10, 0x11, 0x1a, 0x04, 0xa8, 0x45, 0x90, 0x03, 0x12, 0x19, 0x0a, + 0x0f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x58, 0x49, 0x53, 0x54, + 0x10, 0x12, 0x1a, 0x04, 0xa8, 0x45, 0x94, 0x03, 0x12, 0x18, 0x0a, 0x0e, 0x55, 0x53, 0x45, 0x52, + 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x58, 0x49, 0x53, 0x54, 0x10, 0x13, 0x1a, 0x04, 0xa8, 0x45, + 0x94, 0x03, 0x1a, 0x04, 0xa0, 0x45, 0xf4, 0x03, 0x42, 0xc0, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, + 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, + 0x42, 0x0e, 0x55, 0x73, 0x65, 0x72, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x3b, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x6d, 0x6f, 0x6e, 0x6f, 0x6c, + 0x69, 0x74, 0x68, 0x69, 0x63, 0x2d, 0x64, 0x65, 0x6d, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x55, 0x53, 0x58, 0xaa, 0x02, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x5c, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x55, 0x73, 0x65, 0x72, + 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x55, 0x73, 0x65, 0x72, 0x3a, 0x3a, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_user_service_v1_user_error_proto_rawDescOnce sync.Once + file_user_service_v1_user_error_proto_rawDescData = file_user_service_v1_user_error_proto_rawDesc +) + +func file_user_service_v1_user_error_proto_rawDescGZIP() []byte { + file_user_service_v1_user_error_proto_rawDescOnce.Do(func() { + file_user_service_v1_user_error_proto_rawDescData = protoimpl.X.CompressGZIP(file_user_service_v1_user_error_proto_rawDescData) + }) + return file_user_service_v1_user_error_proto_rawDescData +} + +var file_user_service_v1_user_error_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_user_service_v1_user_error_proto_goTypes = []interface{}{ + (UserErrorReason)(0), // 0: user.service.v1.UserErrorReason +} +var file_user_service_v1_user_error_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_user_service_v1_user_error_proto_init() } +func file_user_service_v1_user_error_proto_init() { + if File_user_service_v1_user_error_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_user_service_v1_user_error_proto_rawDesc, + NumEnums: 1, + NumMessages: 0, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_user_service_v1_user_error_proto_goTypes, + DependencyIndexes: file_user_service_v1_user_error_proto_depIdxs, + EnumInfos: file_user_service_v1_user_error_proto_enumTypes, + }.Build() + File_user_service_v1_user_error_proto = out.File + file_user_service_v1_user_error_proto_rawDesc = nil + file_user_service_v1_user_error_proto_goTypes = nil + file_user_service_v1_user_error_proto_depIdxs = nil +} diff --git a/monolithic/backend/gen/api/go/user/service/v1/user_error.pb.validate.go b/monolithic/backend/gen/api/go/user/service/v1/user_error.pb.validate.go new file mode 100644 index 0000000..11d8acd --- /dev/null +++ b/monolithic/backend/gen/api/go/user/service/v1/user_error.pb.validate.go @@ -0,0 +1,36 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: user/service/v1/user_error.proto + +package servicev1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) diff --git a/monolithic/backend/gen/api/go/user/service/v1/user_error_errors.pb.go b/monolithic/backend/gen/api/go/user/service/v1/user_error_errors.pb.go new file mode 100644 index 0000000..561a4f6 --- /dev/null +++ b/monolithic/backend/gen/api/go/user/service/v1/user_error_errors.pb.go @@ -0,0 +1,110 @@ +// Code generated by protoc-gen-go-errors. DO NOT EDIT. + +package servicev1 + +import ( + fmt "fmt" + errors "github.com/go-kratos/kratos/v2/errors" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the kratos package it is being compiled against. +const _ = errors.SupportPackageIsVersion1 + +// 401 +func IsNotLoggedIn(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_NOT_LOGGED_IN.String() && e.Code == 401 +} + +// 401 +func ErrorNotLoggedIn(format string, args ...interface{}) *errors.Error { + return errors.New(401, UserErrorReason_NOT_LOGGED_IN.String(), fmt.Sprintf(format, args...)) +} + +// 用户ID无效 +func IsInvalidUserid(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_INVALID_USERID.String() && e.Code == 400 +} + +// 用户ID无效 +func ErrorInvalidUserid(format string, args ...interface{}) *errors.Error { + return errors.New(400, UserErrorReason_INVALID_USERID.String(), fmt.Sprintf(format, args...)) +} + +// 密码无效 +func IsInvalidPassword(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_INVALID_PASSWORD.String() && e.Code == 400 +} + +// 密码无效 +func ErrorInvalidPassword(format string, args ...interface{}) *errors.Error { + return errors.New(400, UserErrorReason_INVALID_PASSWORD.String(), fmt.Sprintf(format, args...)) +} + +// token过期 +func IsTokenExpired(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_TOKEN_EXPIRED.String() && e.Code == 400 +} + +// token过期 +func ErrorTokenExpired(format string, args ...interface{}) *errors.Error { + return errors.New(400, UserErrorReason_TOKEN_EXPIRED.String(), fmt.Sprintf(format, args...)) +} + +// token无效 +func IsInvalidToken(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_INVALID_TOKEN.String() && e.Code == 400 +} + +// token无效 +func ErrorInvalidToken(format string, args ...interface{}) *errors.Error { + return errors.New(400, UserErrorReason_INVALID_TOKEN.String(), fmt.Sprintf(format, args...)) +} + +// token不存在 +func IsTokenNotExist(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_TOKEN_NOT_EXIST.String() && e.Code == 404 +} + +// token不存在 +func ErrorTokenNotExist(format string, args ...interface{}) *errors.Error { + return errors.New(404, UserErrorReason_TOKEN_NOT_EXIST.String(), fmt.Sprintf(format, args...)) +} + +// 用户不存在 +func IsUserNotExist(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_USER_NOT_EXIST.String() && e.Code == 404 +} + +// 用户不存在 +func ErrorUserNotExist(format string, args ...interface{}) *errors.Error { + return errors.New(404, UserErrorReason_USER_NOT_EXIST.String(), fmt.Sprintf(format, args...)) +} diff --git a/monolithic/backend/gen/api/go/user/service/v1/user_grpc.pb.go b/monolithic/backend/gen/api/go/user/service/v1/user_grpc.pb.go new file mode 100644 index 0000000..d1d0fba --- /dev/null +++ b/monolithic/backend/gen/api/go/user/service/v1/user_grpc.pb.go @@ -0,0 +1,386 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: user/service/v1/user.proto + +package servicev1 + +import ( + context "context" + v1 "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + UserService_ListUser_FullMethodName = "/user.service.v1.UserService/ListUser" + UserService_GetUser_FullMethodName = "/user.service.v1.UserService/GetUser" + UserService_CreateUser_FullMethodName = "/user.service.v1.UserService/CreateUser" + UserService_UpdateUser_FullMethodName = "/user.service.v1.UserService/UpdateUser" + UserService_DeleteUser_FullMethodName = "/user.service.v1.UserService/DeleteUser" + UserService_GetUserByUserName_FullMethodName = "/user.service.v1.UserService/GetUserByUserName" + UserService_VerifyPassword_FullMethodName = "/user.service.v1.UserService/VerifyPassword" + UserService_UserExists_FullMethodName = "/user.service.v1.UserService/UserExists" +) + +// UserServiceClient is the client API for UserService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type UserServiceClient interface { + // 查询用户列表 + ListUser(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*ListUserResponse, error) + // 查询用户详情 + GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*User, error) + // 创建用户 + CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 更新用户 + UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 删除用户 + DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 查询用户详情 + GetUserByUserName(ctx context.Context, in *GetUserByUserNameRequest, opts ...grpc.CallOption) (*User, error) + // 验证密码 + VerifyPassword(ctx context.Context, in *VerifyPasswordRequest, opts ...grpc.CallOption) (*VerifyPasswordResponse, error) + // 用户是否存在 + UserExists(ctx context.Context, in *UserExistsRequest, opts ...grpc.CallOption) (*UserExistsResponse, error) +} + +type userServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient { + return &userServiceClient{cc} +} + +func (c *userServiceClient) ListUser(ctx context.Context, in *v1.PagingRequest, opts ...grpc.CallOption) (*ListUserResponse, error) { + out := new(ListUserResponse) + err := c.cc.Invoke(ctx, UserService_ListUser_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*User, error) { + out := new(User) + err := c.cc.Invoke(ctx, UserService_GetUser_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, UserService_CreateUser_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, UserService_UpdateUser_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, UserService_DeleteUser_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) GetUserByUserName(ctx context.Context, in *GetUserByUserNameRequest, opts ...grpc.CallOption) (*User, error) { + out := new(User) + err := c.cc.Invoke(ctx, UserService_GetUserByUserName_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) VerifyPassword(ctx context.Context, in *VerifyPasswordRequest, opts ...grpc.CallOption) (*VerifyPasswordResponse, error) { + out := new(VerifyPasswordResponse) + err := c.cc.Invoke(ctx, UserService_VerifyPassword_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) UserExists(ctx context.Context, in *UserExistsRequest, opts ...grpc.CallOption) (*UserExistsResponse, error) { + out := new(UserExistsResponse) + err := c.cc.Invoke(ctx, UserService_UserExists_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// UserServiceServer is the server API for UserService service. +// All implementations must embed UnimplementedUserServiceServer +// for forward compatibility +type UserServiceServer interface { + // 查询用户列表 + ListUser(context.Context, *v1.PagingRequest) (*ListUserResponse, error) + // 查询用户详情 + GetUser(context.Context, *GetUserRequest) (*User, error) + // 创建用户 + CreateUser(context.Context, *CreateUserRequest) (*emptypb.Empty, error) + // 更新用户 + UpdateUser(context.Context, *UpdateUserRequest) (*emptypb.Empty, error) + // 删除用户 + DeleteUser(context.Context, *DeleteUserRequest) (*emptypb.Empty, error) + // 查询用户详情 + GetUserByUserName(context.Context, *GetUserByUserNameRequest) (*User, error) + // 验证密码 + VerifyPassword(context.Context, *VerifyPasswordRequest) (*VerifyPasswordResponse, error) + // 用户是否存在 + UserExists(context.Context, *UserExistsRequest) (*UserExistsResponse, error) + mustEmbedUnimplementedUserServiceServer() +} + +// UnimplementedUserServiceServer must be embedded to have forward compatible implementations. +type UnimplementedUserServiceServer struct { +} + +func (UnimplementedUserServiceServer) ListUser(context.Context, *v1.PagingRequest) (*ListUserResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListUser not implemented") +} +func (UnimplementedUserServiceServer) GetUser(context.Context, *GetUserRequest) (*User, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented") +} +func (UnimplementedUserServiceServer) CreateUser(context.Context, *CreateUserRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateUser not implemented") +} +func (UnimplementedUserServiceServer) UpdateUser(context.Context, *UpdateUserRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateUser not implemented") +} +func (UnimplementedUserServiceServer) DeleteUser(context.Context, *DeleteUserRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteUser not implemented") +} +func (UnimplementedUserServiceServer) GetUserByUserName(context.Context, *GetUserByUserNameRequest) (*User, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUserByUserName not implemented") +} +func (UnimplementedUserServiceServer) VerifyPassword(context.Context, *VerifyPasswordRequest) (*VerifyPasswordResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method VerifyPassword not implemented") +} +func (UnimplementedUserServiceServer) UserExists(context.Context, *UserExistsRequest) (*UserExistsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UserExists not implemented") +} +func (UnimplementedUserServiceServer) mustEmbedUnimplementedUserServiceServer() {} + +// UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to UserServiceServer will +// result in compilation errors. +type UnsafeUserServiceServer interface { + mustEmbedUnimplementedUserServiceServer() +} + +func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer) { + s.RegisterService(&UserService_ServiceDesc, srv) +} + +func _UserService_ListUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v1.PagingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).ListUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_ListUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).ListUser(ctx, req.(*v1.PagingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).GetUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_GetUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).GetUser(ctx, req.(*GetUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).CreateUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_CreateUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).CreateUser(ctx, req.(*CreateUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_UpdateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).UpdateUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_UpdateUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).UpdateUser(ctx, req.(*UpdateUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_DeleteUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).DeleteUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_DeleteUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).DeleteUser(ctx, req.(*DeleteUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_GetUserByUserName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserByUserNameRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).GetUserByUserName(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_GetUserByUserName_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).GetUserByUserName(ctx, req.(*GetUserByUserNameRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_VerifyPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(VerifyPasswordRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).VerifyPassword(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_VerifyPassword_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).VerifyPassword(ctx, req.(*VerifyPasswordRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_UserExists_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UserExistsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).UserExists(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_UserExists_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).UserExists(ctx, req.(*UserExistsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// UserService_ServiceDesc is the grpc.ServiceDesc for UserService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var UserService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "user.service.v1.UserService", + HandlerType: (*UserServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListUser", + Handler: _UserService_ListUser_Handler, + }, + { + MethodName: "GetUser", + Handler: _UserService_GetUser_Handler, + }, + { + MethodName: "CreateUser", + Handler: _UserService_CreateUser_Handler, + }, + { + MethodName: "UpdateUser", + Handler: _UserService_UpdateUser_Handler, + }, + { + MethodName: "DeleteUser", + Handler: _UserService_DeleteUser_Handler, + }, + { + MethodName: "GetUserByUserName", + Handler: _UserService_GetUserByUserName_Handler, + }, + { + MethodName: "VerifyPassword", + Handler: _UserService_VerifyPassword_Handler, + }, + { + MethodName: "UserExists", + Handler: _UserService_UserExists_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "user/service/v1/user.proto", +} diff --git a/monolithic/backend/go.mod b/monolithic/backend/go.mod new file mode 100644 index 0000000..4af0535 --- /dev/null +++ b/monolithic/backend/go.mod @@ -0,0 +1,229 @@ +module kratos-monolithic-demo + +go 1.20 + +require ( + entgo.io/contrib v0.4.5 + entgo.io/ent v0.12.5 + github.com/go-kratos/kratos/v2 v2.7.1 + github.com/go-sql-driver/mysql v1.7.1 + github.com/gofrs/uuid v4.4.0+incompatible + github.com/google/gnostic v0.7.0 + github.com/google/wire v0.5.0 + github.com/jackc/pgx/v4 v4.18.1 + github.com/lib/pq v1.10.9 + github.com/redis/go-redis/v9 v9.3.0 + github.com/stretchr/testify v1.8.4 + github.com/tx7do/go-utils v1.1.8 + github.com/tx7do/go-utils/entgo v1.1.11 + github.com/tx7do/kratos-authn v1.0.0 + github.com/tx7do/kratos-authn/engine/jwt v1.0.0 + github.com/tx7do/kratos-authn/middleware v1.0.0 + github.com/tx7do/kratos-authz v1.0.0 + github.com/tx7do/kratos-authz/middleware v1.0.0 + github.com/tx7do/kratos-bootstrap v0.2.21 + github.com/tx7do/kratos-swagger-ui v0.0.0-20231027101037-78256951ad49 + github.com/tx7do/kratos-transport/transport/asynq v1.2.2 + google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 + google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 + google.golang.org/grpc v1.59.0 + google.golang.org/protobuf v1.31.0 +) + +require ( + ariga.io/atlas v0.15.0 // indirect + github.com/agext/levenshtein v1.2.3 // indirect + github.com/aliyun/alibaba-cloud-sdk-go v1.62.606 // indirect + github.com/aliyun/aliyun-log-go-sdk v0.1.65 // indirect + github.com/apolloconfig/agollo/v4 v4.3.1 // indirect + github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect + github.com/armon/go-metrics v0.4.1 // indirect + github.com/bufbuild/protocompile v0.6.0 // indirect + github.com/buger/jsonparser v1.1.1 // indirect + github.com/cenkalti/backoff v2.2.1+incompatible // indirect + github.com/cenkalti/backoff/v4 v4.2.1 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/coreos/go-semver v0.3.1 // indirect + github.com/coreos/go-systemd/v22 v22.5.0 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/deckarep/golang-set v1.8.0 // indirect + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect + github.com/dustin/go-humanize v1.0.1 // indirect + github.com/emicklei/go-restful/v3 v3.11.0 // indirect + github.com/fatih/color v1.16.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fluent/fluent-logger-golang v1.9.0 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/go-chassis/cari v0.9.0 // indirect + github.com/go-chassis/foundation v0.4.0 // indirect + github.com/go-chassis/openlog v1.1.3 // indirect + github.com/go-chassis/sc-client v0.7.0 // indirect + github.com/go-errors/errors v1.5.1 // indirect + github.com/go-kit/kit v0.13.0 // indirect + github.com/go-kit/log v0.2.1 // indirect + github.com/go-kratos/aegis v0.2.0 // indirect + github.com/go-kratos/kratos/contrib/config/apollo/v2 v2.0.0-20231113102135-421dbc7dae0f // indirect + github.com/go-kratos/kratos/contrib/config/consul/v2 v2.0.0-20231113102135-421dbc7dae0f // indirect + github.com/go-kratos/kratos/contrib/config/etcd/v2 v2.0.0-20231113102135-421dbc7dae0f // indirect + github.com/go-kratos/kratos/contrib/config/kubernetes/v2 v2.0.0-20231113102135-421dbc7dae0f // indirect + github.com/go-kratos/kratos/contrib/config/nacos/v2 v2.0.0-20231113102135-421dbc7dae0f // indirect + github.com/go-kratos/kratos/contrib/log/aliyun/v2 v2.0.0-20231113102135-421dbc7dae0f // indirect + github.com/go-kratos/kratos/contrib/log/fluent/v2 v2.0.0-20231113102135-421dbc7dae0f // indirect + github.com/go-kratos/kratos/contrib/log/logrus/v2 v2.0.0-20231113102135-421dbc7dae0f // indirect + github.com/go-kratos/kratos/contrib/log/tencent/v2 v2.0.0-20231113102135-421dbc7dae0f // indirect + github.com/go-kratos/kratos/contrib/log/zap/v2 v2.0.0-20231113102135-421dbc7dae0f // indirect + github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20231113102135-421dbc7dae0f // indirect + github.com/go-kratos/kratos/contrib/registry/etcd/v2 v2.0.0-20231113102135-421dbc7dae0f // indirect + github.com/go-kratos/kratos/contrib/registry/eureka/v2 v2.0.0-20231113102135-421dbc7dae0f // indirect + github.com/go-kratos/kratos/contrib/registry/kubernetes/v2 v2.0.0-20231113102135-421dbc7dae0f // indirect + github.com/go-kratos/kratos/contrib/registry/nacos/v2 v2.0.0-20231113102135-421dbc7dae0f // indirect + github.com/go-kratos/kratos/contrib/registry/servicecomb/v2 v2.0.0-20231113102135-421dbc7dae0f // indirect + github.com/go-kratos/kratos/contrib/registry/zookeeper/v2 v2.0.0-20231113102135-421dbc7dae0f // indirect + github.com/go-logfmt/logfmt v0.6.0 // indirect + github.com/go-logr/logr v1.3.0 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-ole/go-ole v1.3.0 // indirect + github.com/go-openapi/inflect v0.19.0 // indirect + github.com/go-openapi/jsonpointer v0.20.0 // indirect + github.com/go-openapi/jsonreference v0.20.2 // indirect + github.com/go-openapi/swag v0.22.4 // indirect + github.com/go-playground/form/v4 v4.2.1 // indirect + github.com/go-zookeeper/zk v1.0.3 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang-jwt/jwt/v4 v4.5.0 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect + github.com/google/go-cmp v0.6.0 // indirect + github.com/google/gofuzz v1.2.0 // indirect + github.com/google/subcommands v1.2.0 // indirect + github.com/google/uuid v1.4.0 // indirect + github.com/gorilla/handlers v1.5.2 // indirect + github.com/gorilla/mux v1.8.1 // indirect + github.com/gorilla/websocket v1.5.1 // indirect + github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 // indirect + github.com/hashicorp/consul/api v1.26.1 // indirect + github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect + github.com/hashicorp/go-hclog v1.5.0 // indirect + github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/hashicorp/go-rootcerts v1.0.2 // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/hcl/v2 v2.19.1 // indirect + github.com/hashicorp/serf v0.10.1 // indirect + github.com/hibiken/asynq v0.24.1 // indirect + github.com/imdario/mergo v0.3.16 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/jackc/chunkreader/v2 v2.0.1 // indirect + github.com/jackc/pgconn v1.14.1 // indirect + github.com/jackc/pgio v1.0.0 // indirect + github.com/jackc/pgpassfile v1.0.0 // indirect + github.com/jackc/pgproto3/v2 v2.3.2 // indirect + github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect + github.com/jackc/pgtype v1.14.0 // indirect + github.com/jhump/protoreflect v1.15.3 // indirect + github.com/jmespath/go-jmespath v0.4.0 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/karlseguin/ccache/v2 v2.0.8 // indirect + github.com/klauspost/compress v1.17.2 // indirect + github.com/klauspost/cpuid/v2 v2.2.6 // indirect + github.com/lufia/plan9stats v0.0.0-20231016141302-07b5767bb0ed // indirect + github.com/magiconair/properties v1.8.7 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/minio/md5-simd v1.1.2 // indirect + github.com/minio/minio-go/v7 v7.0.63 // indirect + github.com/minio/sha256-simd v1.0.1 // indirect + github.com/mitchellh/go-homedir v1.1.0 // indirect + github.com/mitchellh/go-wordwrap v1.0.1 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/nacos-group/nacos-sdk-go v1.1.4 // indirect + github.com/olekukonko/tablewriter v0.0.5 // indirect + github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b // indirect + github.com/openzipkin/zipkin-go v0.4.2 // indirect + github.com/patrickmn/go-cache v2.1.0+incompatible // indirect + github.com/pelletier/go-toml/v2 v2.1.0 // indirect + github.com/philhofer/fwd v1.1.2 // indirect + github.com/pierrec/lz4 v2.6.1+incompatible // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b // indirect + github.com/redis/go-redis/extra/rediscmd/v9 v9.0.5 // indirect + github.com/redis/go-redis/extra/redisotel/v9 v9.0.5 // indirect + github.com/rivo/uniseg v0.4.4 // indirect + github.com/robfig/cron/v3 v3.0.1 // indirect + github.com/rs/xid v1.5.0 // indirect + github.com/sagikazarmark/locafero v0.3.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect + github.com/shirou/gopsutil/v3 v3.23.10 // indirect + github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/sirupsen/logrus v1.9.3 // indirect + github.com/sony/sonyflake v1.2.0 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.10.0 // indirect + github.com/spf13/cast v1.5.1 // indirect + github.com/spf13/cobra v1.8.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/spf13/viper v1.17.0 // indirect + github.com/subosito/gotenv v1.6.0 // indirect + github.com/swaggest/swgui v1.7.4 // indirect + github.com/tencentcloud/tencentcloud-cls-sdk-go v1.0.6 // indirect + github.com/tinylib/msgp v1.1.9 // indirect + github.com/tklauser/go-sysconf v0.3.12 // indirect + github.com/tklauser/numcpus v0.6.1 // indirect + github.com/tx7do/kratos-transport v1.1.1 // indirect + github.com/vearutop/statigz v1.4.0 // indirect + github.com/yusufpapurcu/wmi v1.2.3 // indirect + github.com/zclconf/go-cty v1.14.1 // indirect + go.etcd.io/etcd/api/v3 v3.5.10 // indirect + go.etcd.io/etcd/client/pkg/v3 v3.5.10 // indirect + go.etcd.io/etcd/client/v3 v3.5.10 // indirect + go.opentelemetry.io/otel v1.20.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.20.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.20.0 // indirect + go.opentelemetry.io/otel/exporters/zipkin v1.20.0 // indirect + go.opentelemetry.io/otel/metric v1.20.0 // indirect + go.opentelemetry.io/otel/sdk v1.20.0 // indirect + go.opentelemetry.io/otel/trace v1.20.0 // indirect + go.opentelemetry.io/proto/otlp v1.0.0 // indirect + go.uber.org/atomic v1.11.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + go.uber.org/zap v1.26.0 // indirect + golang.org/x/crypto v0.15.0 // indirect + golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect + golang.org/x/mod v0.14.0 // indirect + golang.org/x/net v0.18.0 // indirect + golang.org/x/oauth2 v0.14.0 // indirect + golang.org/x/sync v0.5.0 // indirect + golang.org/x/sys v0.14.0 // indirect + golang.org/x/term v0.14.0 // indirect + golang.org/x/text v0.14.0 // indirect + golang.org/x/time v0.4.0 // indirect + golang.org/x/tools v0.15.0 // indirect + google.golang.org/appengine v1.6.8 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + k8s.io/api v0.28.3 // indirect + k8s.io/apimachinery v0.28.3 // indirect + k8s.io/client-go v0.28.3 // indirect + k8s.io/klog/v2 v2.110.1 // indirect + k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect + k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect + sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect +) diff --git a/monolithic/backend/go.sum b/monolithic/backend/go.sum new file mode 100644 index 0000000..d6fb222 --- /dev/null +++ b/monolithic/backend/go.sum @@ -0,0 +1,2533 @@ +ariga.io/atlas v0.15.0 h1:9lwSVcO/D3WgaCzstSGqR1hEDtsGibu6JqUofEI/0sY= +ariga.io/atlas v0.15.0/go.mod h1:isZrlzJ5cpoCoKFoY9knZug7Lq4pP1cm8g3XciLZ0Pw= +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= +cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= +cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= +cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= +cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= +cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= +cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= +cloud.google.com/go v0.100.1/go.mod h1:fs4QogzfH5n2pBXBP9vRiU+eCny7lD2vmFZy79Iuw1U= +cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= +cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= +cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= +cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= +cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= +cloud.google.com/go v0.107.0/go.mod h1:wpc2eNrD7hXUTy8EKS10jkxpZBjASrORK7goS+3YX2I= +cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= +cloud.google.com/go/accessapproval v1.4.0/go.mod h1:zybIuC3KpDOvotz59lFe5qxRZx6C75OtwbisN56xYB4= +cloud.google.com/go/accessapproval v1.5.0/go.mod h1:HFy3tuiGvMdcd/u+Cu5b9NkO1pEICJ46IR82PoUdplw= +cloud.google.com/go/accessapproval v1.6.0/go.mod h1:R0EiYnwV5fsRFiKZkPHr6mwyk2wxUJ30nL4j2pcFY2E= +cloud.google.com/go/accesscontextmanager v1.3.0/go.mod h1:TgCBehyr5gNMz7ZaH9xubp+CE8dkrszb4oK9CWyvD4o= +cloud.google.com/go/accesscontextmanager v1.4.0/go.mod h1:/Kjh7BBu/Gh83sv+K60vN9QE5NJcd80sU33vIe2IFPE= +cloud.google.com/go/accesscontextmanager v1.6.0/go.mod h1:8XCvZWfYw3K/ji0iVnp+6pu7huxoQTLmxAbVjbloTtM= +cloud.google.com/go/accesscontextmanager v1.7.0/go.mod h1:CEGLewx8dwa33aDAZQujl7Dx+uYhS0eay198wB/VumQ= +cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= +cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= +cloud.google.com/go/aiplatform v1.27.0/go.mod h1:Bvxqtl40l0WImSb04d0hXFU7gDOiq9jQmorivIiWcKg= +cloud.google.com/go/aiplatform v1.35.0/go.mod h1:7MFT/vCaOyZT/4IIFfxH4ErVg/4ku6lKv3w0+tFTgXQ= +cloud.google.com/go/aiplatform v1.36.1/go.mod h1:WTm12vJRPARNvJ+v6P52RDHCNe4AhvjcIZ/9/RRHy/k= +cloud.google.com/go/aiplatform v1.37.0/go.mod h1:IU2Cv29Lv9oCn/9LkFiiuKfwrRTq+QQMbW+hPCxJGZw= +cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= +cloud.google.com/go/analytics v0.12.0/go.mod h1:gkfj9h6XRf9+TS4bmuhPEShsh3hH8PAZzm/41OOhQd4= +cloud.google.com/go/analytics v0.17.0/go.mod h1:WXFa3WSym4IZ+JiKmavYdJwGG/CvpqiqczmL59bTD9M= +cloud.google.com/go/analytics v0.18.0/go.mod h1:ZkeHGQlcIPkw0R/GW+boWHhCOR43xz9RN/jn7WcqfIE= +cloud.google.com/go/analytics v0.19.0/go.mod h1:k8liqf5/HCnOUkbawNtrWWc+UAzyDlW89doe8TtoDsE= +cloud.google.com/go/apigateway v1.3.0/go.mod h1:89Z8Bhpmxu6AmUxuVRg/ECRGReEdiP3vQtk4Z1J9rJk= +cloud.google.com/go/apigateway v1.4.0/go.mod h1:pHVY9MKGaH9PQ3pJ4YLzoj6U5FUDeDFBllIz7WmzJoc= +cloud.google.com/go/apigateway v1.5.0/go.mod h1:GpnZR3Q4rR7LVu5951qfXPJCHquZt02jf7xQx7kpqN8= +cloud.google.com/go/apigeeconnect v1.3.0/go.mod h1:G/AwXFAKo0gIXkPTVfZDd2qA1TxBXJ3MgMRBQkIi9jc= +cloud.google.com/go/apigeeconnect v1.4.0/go.mod h1:kV4NwOKqjvt2JYR0AoIWo2QGfoRtn/pkS3QlHp0Ni04= +cloud.google.com/go/apigeeconnect v1.5.0/go.mod h1:KFaCqvBRU6idyhSNyn3vlHXc8VMDJdRmwDF6JyFRqZ8= +cloud.google.com/go/apigeeregistry v0.4.0/go.mod h1:EUG4PGcsZvxOXAdyEghIdXwAEi/4MEaoqLMLDMIwKXY= +cloud.google.com/go/apigeeregistry v0.5.0/go.mod h1:YR5+s0BVNZfVOUkMa5pAR2xGd0A473vA5M7j247o1wM= +cloud.google.com/go/apigeeregistry v0.6.0/go.mod h1:BFNzW7yQVLZ3yj0TKcwzb8n25CFBri51GVGOEUcgQsc= +cloud.google.com/go/apikeys v0.4.0/go.mod h1:XATS/yqZbaBK0HOssf+ALHp8jAlNHUgyfprvNcBIszU= +cloud.google.com/go/apikeys v0.5.0/go.mod h1:5aQfwY4D+ewMMWScd3hm2en3hCj+BROlyrt3ytS7KLI= +cloud.google.com/go/apikeys v0.6.0/go.mod h1:kbpXu5upyiAlGkKrJgQl8A0rKNNJ7dQ377pdroRSSi8= +cloud.google.com/go/appengine v1.4.0/go.mod h1:CS2NhuBuDXM9f+qscZ6V86m1MIIqPj3WC/UoEuR1Sno= +cloud.google.com/go/appengine v1.5.0/go.mod h1:TfasSozdkFI0zeoxW3PTBLiNqRmzraodCWatWI9Dmak= +cloud.google.com/go/appengine v1.6.0/go.mod h1:hg6i0J/BD2cKmDJbaFSYHFyZkgBEfQrDg/X0V5fJn84= +cloud.google.com/go/appengine v1.7.0/go.mod h1:eZqpbHFCqRGa2aCdope7eC0SWLV1j0neb/QnMJVWx6A= +cloud.google.com/go/appengine v1.7.1/go.mod h1:IHLToyb/3fKutRysUlFO0BPt5j7RiQ45nrzEJmKTo6E= +cloud.google.com/go/area120 v0.5.0/go.mod h1:DE/n4mp+iqVyvxHN41Vf1CR602GiHQjFPusMFW6bGR4= +cloud.google.com/go/area120 v0.6.0/go.mod h1:39yFJqWVgm0UZqWTOdqkLhjoC7uFfgXRC8g/ZegeAh0= +cloud.google.com/go/area120 v0.7.0/go.mod h1:a3+8EUD1SX5RUcCs3MY5YasiO1z6yLiNLRiFrykbynY= +cloud.google.com/go/area120 v0.7.1/go.mod h1:j84i4E1RboTWjKtZVWXPqvK5VHQFJRF2c1Nm69pWm9k= +cloud.google.com/go/artifactregistry v1.6.0/go.mod h1:IYt0oBPSAGYj/kprzsBjZ/4LnG/zOcHyFHjWPCi6SAQ= +cloud.google.com/go/artifactregistry v1.7.0/go.mod h1:mqTOFOnGZx8EtSqK/ZWcsm/4U8B77rbcLP6ruDU2Ixk= +cloud.google.com/go/artifactregistry v1.8.0/go.mod h1:w3GQXkJX8hiKN0v+at4b0qotwijQbYUqF2GWkZzAhC0= +cloud.google.com/go/artifactregistry v1.9.0/go.mod h1:2K2RqvA2CYvAeARHRkLDhMDJ3OXy26h3XW+3/Jh2uYc= +cloud.google.com/go/artifactregistry v1.11.1/go.mod h1:lLYghw+Itq9SONbCa1YWBoWs1nOucMH0pwXN1rOBZFI= +cloud.google.com/go/artifactregistry v1.11.2/go.mod h1:nLZns771ZGAwVLzTX/7Al6R9ehma4WUEhZGWV6CeQNQ= +cloud.google.com/go/artifactregistry v1.12.0/go.mod h1:o6P3MIvtzTOnmvGagO9v/rOjjA0HmhJ+/6KAXrmYDCI= +cloud.google.com/go/artifactregistry v1.13.0/go.mod h1:uy/LNfoOIivepGhooAUpL1i30Hgee3Cu0l4VTWHUC08= +cloud.google.com/go/asset v1.5.0/go.mod h1:5mfs8UvcM5wHhqtSv8J1CtxxaQq3AdBxxQi2jGW/K4o= +cloud.google.com/go/asset v1.7.0/go.mod h1:YbENsRK4+xTiL+Ofoj5Ckf+O17kJtgp3Y3nn4uzZz5s= +cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjbytpUaW0= +cloud.google.com/go/asset v1.9.0/go.mod h1:83MOE6jEJBMqFKadM9NLRcs80Gdw76qGuHn8m3h8oHQ= +cloud.google.com/go/asset v1.10.0/go.mod h1:pLz7uokL80qKhzKr4xXGvBQXnzHn5evJAEAtZiIb0wY= +cloud.google.com/go/asset v1.11.1/go.mod h1:fSwLhbRvC9p9CXQHJ3BgFeQNM4c9x10lqlrdEUYXlJo= +cloud.google.com/go/asset v1.12.0/go.mod h1:h9/sFOa4eDIyKmH6QMpm4eUK3pDojWnUhTgJlk762Hg= +cloud.google.com/go/asset v1.13.0/go.mod h1:WQAMyYek/b7NBpYq/K4KJWcRqzoalEsxz/t/dTk4THw= +cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= +cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= +cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= +cloud.google.com/go/assuredworkloads v1.8.0/go.mod h1:AsX2cqyNCOvEQC8RMPnoc0yEarXQk6WEKkxYfL6kGIo= +cloud.google.com/go/assuredworkloads v1.9.0/go.mod h1:kFuI1P78bplYtT77Tb1hi0FMxM0vVpRC7VVoJC3ZoT0= +cloud.google.com/go/assuredworkloads v1.10.0/go.mod h1:kwdUQuXcedVdsIaKgKTp9t0UJkE5+PAVNhdQm4ZVq2E= +cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= +cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= +cloud.google.com/go/automl v1.7.0/go.mod h1:RL9MYCCsJEOmt0Wf3z9uzG0a7adTT1fe+aObgSpkCt8= +cloud.google.com/go/automl v1.8.0/go.mod h1:xWx7G/aPEe/NP+qzYXktoBSDfjO+vnKMGgsApGJJquM= +cloud.google.com/go/automl v1.12.0/go.mod h1:tWDcHDp86aMIuHmyvjuKeeHEGq76lD7ZqfGLN6B0NuU= +cloud.google.com/go/baremetalsolution v0.3.0/go.mod h1:XOrocE+pvK1xFfleEnShBlNAXf+j5blPPxrhjKgnIFc= +cloud.google.com/go/baremetalsolution v0.4.0/go.mod h1:BymplhAadOO/eBa7KewQ0Ppg4A4Wplbn+PsFKRLo0uI= +cloud.google.com/go/baremetalsolution v0.5.0/go.mod h1:dXGxEkmR9BMwxhzBhV0AioD0ULBmuLZI8CdwalUxuss= +cloud.google.com/go/batch v0.3.0/go.mod h1:TR18ZoAekj1GuirsUsR1ZTKN3FC/4UDnScjT8NXImFE= +cloud.google.com/go/batch v0.4.0/go.mod h1:WZkHnP43R/QCGQsZ+0JyG4i79ranE2u8xvjq/9+STPE= +cloud.google.com/go/batch v0.7.0/go.mod h1:vLZN95s6teRUqRQ4s3RLDsH8PvboqBK+rn1oevL159g= +cloud.google.com/go/beyondcorp v0.2.0/go.mod h1:TB7Bd+EEtcw9PCPQhCJtJGjk/7TC6ckmnSFS+xwTfm4= +cloud.google.com/go/beyondcorp v0.3.0/go.mod h1:E5U5lcrcXMsCuoDNyGrpyTm/hn7ne941Jz2vmksAxW8= +cloud.google.com/go/beyondcorp v0.4.0/go.mod h1:3ApA0mbhHx6YImmuubf5pyW8srKnCEPON32/5hj+RmM= +cloud.google.com/go/beyondcorp v0.5.0/go.mod h1:uFqj9X+dSfrheVp7ssLTaRHd2EHqSL4QZmH4e8WXGGU= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA= +cloud.google.com/go/bigquery v1.43.0/go.mod h1:ZMQcXHsl+xmU1z36G2jNGZmKp9zNY5BUua5wDgmNCfw= +cloud.google.com/go/bigquery v1.44.0/go.mod h1:0Y33VqXTEsbamHJvJHdFmtqHvMIY28aK1+dFsvaChGc= +cloud.google.com/go/bigquery v1.47.0/go.mod h1:sA9XOgy0A8vQK9+MWhEQTY6Tix87M/ZurWFIxmF9I/E= +cloud.google.com/go/bigquery v1.48.0/go.mod h1:QAwSz+ipNgfL5jxiaK7weyOhzdoAy1zFm0Nf1fysJac= +cloud.google.com/go/bigquery v1.49.0/go.mod h1:Sv8hMmTFFYBlt/ftw2uN6dFdQPzBlREY9yBh7Oy7/4Q= +cloud.google.com/go/bigquery v1.50.0/go.mod h1:YrleYEh2pSEbgTBZYMJ5SuSr0ML3ypjRB1zgf7pvQLU= +cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY= +cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s= +cloud.google.com/go/billing v1.6.0/go.mod h1:WoXzguj+BeHXPbKfNWkqVtDdzORazmCjraY+vrxcyvI= +cloud.google.com/go/billing v1.7.0/go.mod h1:q457N3Hbj9lYwwRbnlD7vUpyjq6u5U1RAOArInEiD5Y= +cloud.google.com/go/billing v1.12.0/go.mod h1:yKrZio/eu+okO/2McZEbch17O5CB5NpZhhXG6Z766ss= +cloud.google.com/go/billing v1.13.0/go.mod h1:7kB2W9Xf98hP9Sr12KfECgfGclsH3CQR0R08tnRlRbc= +cloud.google.com/go/binaryauthorization v1.1.0/go.mod h1:xwnoWu3Y84jbuHa0zd526MJYmtnVXn0syOjaJgy4+dM= +cloud.google.com/go/binaryauthorization v1.2.0/go.mod h1:86WKkJHtRcv5ViNABtYMhhNWRrD1Vpi//uKEy7aYEfI= +cloud.google.com/go/binaryauthorization v1.3.0/go.mod h1:lRZbKgjDIIQvzYQS1p99A7/U1JqvqeZg0wiI5tp6tg0= +cloud.google.com/go/binaryauthorization v1.4.0/go.mod h1:tsSPQrBd77VLplV70GUhBf/Zm3FsKmgSqgm4UmiDItk= +cloud.google.com/go/binaryauthorization v1.5.0/go.mod h1:OSe4OU1nN/VswXKRBmciKpo9LulY41gch5c68htf3/Q= +cloud.google.com/go/certificatemanager v1.3.0/go.mod h1:n6twGDvcUBFu9uBgt4eYvvf3sQ6My8jADcOVwHmzadg= +cloud.google.com/go/certificatemanager v1.4.0/go.mod h1:vowpercVFyqs8ABSmrdV+GiFf2H/ch3KyudYQEMM590= +cloud.google.com/go/certificatemanager v1.6.0/go.mod h1:3Hh64rCKjRAX8dXgRAyOcY5vQ/fE1sh8o+Mdd6KPgY8= +cloud.google.com/go/channel v1.8.0/go.mod h1:W5SwCXDJsq/rg3tn3oG0LOxpAo6IMxNa09ngphpSlnk= +cloud.google.com/go/channel v1.9.0/go.mod h1:jcu05W0my9Vx4mt3/rEHpfxc9eKi9XwsdDL8yBMbKUk= +cloud.google.com/go/channel v1.11.0/go.mod h1:IdtI0uWGqhEeatSB62VOoJ8FSUhJ9/+iGkJVqp74CGE= +cloud.google.com/go/channel v1.12.0/go.mod h1:VkxCGKASi4Cq7TbXxlaBezonAYpp1GCnKMY6tnMQnLU= +cloud.google.com/go/cloudbuild v1.3.0/go.mod h1:WequR4ULxlqvMsjDEEEFnOG5ZSRSgWOywXYDb1vPE6U= +cloud.google.com/go/cloudbuild v1.4.0/go.mod h1:5Qwa40LHiOXmz3386FrjrYM93rM/hdRr7b53sySrTqA= +cloud.google.com/go/cloudbuild v1.6.0/go.mod h1:UIbc/w9QCbH12xX+ezUsgblrWv+Cv4Tw83GiSMHOn9M= +cloud.google.com/go/cloudbuild v1.7.0/go.mod h1:zb5tWh2XI6lR9zQmsm1VRA+7OCuve5d8S+zJUul8KTg= +cloud.google.com/go/cloudbuild v1.9.0/go.mod h1:qK1d7s4QlO0VwfYn5YuClDGg2hfmLZEb4wQGAbIgL1s= +cloud.google.com/go/clouddms v1.3.0/go.mod h1:oK6XsCDdW4Ib3jCCBugx+gVjevp2TMXFtgxvPSee3OM= +cloud.google.com/go/clouddms v1.4.0/go.mod h1:Eh7sUGCC+aKry14O1NRljhjyrr0NFC0G2cjwX0cByRk= +cloud.google.com/go/clouddms v1.5.0/go.mod h1:QSxQnhikCLUw13iAbffF2CZxAER3xDGNHjsTAkQJcQA= +cloud.google.com/go/cloudtasks v1.5.0/go.mod h1:fD92REy1x5woxkKEkLdvavGnPJGEn8Uic9nWuLzqCpY= +cloud.google.com/go/cloudtasks v1.6.0/go.mod h1:C6Io+sxuke9/KNRkbQpihnW93SWDU3uXt92nu85HkYI= +cloud.google.com/go/cloudtasks v1.7.0/go.mod h1:ImsfdYWwlWNJbdgPIIGJWC+gemEGTBK/SunNQQNCAb4= +cloud.google.com/go/cloudtasks v1.8.0/go.mod h1:gQXUIwCSOI4yPVK7DgTVFiiP0ZW/eQkydWzwVMdHxrI= +cloud.google.com/go/cloudtasks v1.9.0/go.mod h1:w+EyLsVkLWHcOaqNEyvcKAsWp9p29dL6uL9Nst1cI7Y= +cloud.google.com/go/cloudtasks v1.10.0/go.mod h1:NDSoTLkZ3+vExFEWu2UJV1arUyzVDAiZtdWcsUyNwBs= +cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= +cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= +cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= +cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= +cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= +cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= +cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= +cloud.google.com/go/compute v1.12.0/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= +cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= +cloud.google.com/go/compute v1.13.0/go.mod h1:5aPTS0cUNMIc1CE546K+Th6weJUNQErARyZtRXDJ8GE= +cloud.google.com/go/compute v1.14.0/go.mod h1:YfLtxrj9sU4Yxv+sXzZkyPjEyPBZfXHUvjxega5vAdo= +cloud.google.com/go/compute v1.15.1/go.mod h1:bjjoF/NtFUrkD/urWfdHaKuOPDR5nWIs63rR+SXhcpA= +cloud.google.com/go/compute v1.18.0/go.mod h1:1X7yHxec2Ga+Ss6jPyjxRxpu2uu7PLgsOVXvgU0yacs= +cloud.google.com/go/compute v1.19.0/go.mod h1:rikpw2y+UMidAe9tISo04EHNOIf42RLYF/q8Bs93scU= +cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU= +cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +cloud.google.com/go/contactcenterinsights v1.3.0/go.mod h1:Eu2oemoePuEFc/xKFPjbTuPSj0fYJcPls9TFlPNnHHY= +cloud.google.com/go/contactcenterinsights v1.4.0/go.mod h1:L2YzkGbPsv+vMQMCADxJoT9YiTTnSEd6fEvCeHTYVck= +cloud.google.com/go/contactcenterinsights v1.6.0/go.mod h1:IIDlT6CLcDoyv79kDv8iWxMSTZhLxSCofVV5W6YFM/w= +cloud.google.com/go/container v1.6.0/go.mod h1:Xazp7GjJSeUYo688S+6J5V+n/t+G5sKBTFkKNudGRxg= +cloud.google.com/go/container v1.7.0/go.mod h1:Dp5AHtmothHGX3DwwIHPgq45Y8KmNsgN3amoYfxVkLo= +cloud.google.com/go/container v1.13.1/go.mod h1:6wgbMPeQRw9rSnKBCAJXnds3Pzj03C4JHamr8asWKy4= +cloud.google.com/go/container v1.14.0/go.mod h1:3AoJMPhHfLDxLvrlVWaK57IXzaPnLaZq63WX59aQBfM= +cloud.google.com/go/container v1.15.0/go.mod h1:ft+9S0WGjAyjDggg5S06DXj+fHJICWg8L7isCQe9pQA= +cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= +cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= +cloud.google.com/go/containeranalysis v0.7.0/go.mod h1:9aUL+/vZ55P2CXfuZjS4UjQ9AgXoSw8Ts6lemfmxBxI= +cloud.google.com/go/containeranalysis v0.9.0/go.mod h1:orbOANbwk5Ejoom+s+DUCTTJ7IBdBQJDcSylAx/on9s= +cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= +cloud.google.com/go/datacatalog v1.5.0/go.mod h1:M7GPLNQeLfWqeIm3iuiruhPzkt65+Bx8dAKvScX8jvs= +cloud.google.com/go/datacatalog v1.6.0/go.mod h1:+aEyF8JKg+uXcIdAmmaMUmZ3q1b/lKLtXCmXdnc0lbc= +cloud.google.com/go/datacatalog v1.7.0/go.mod h1:9mEl4AuDYWw81UGc41HonIHH7/sn52H0/tc8f8ZbZIE= +cloud.google.com/go/datacatalog v1.8.0/go.mod h1:KYuoVOv9BM8EYz/4eMFxrr4DUKhGIOXxZoKYF5wdISM= +cloud.google.com/go/datacatalog v1.8.1/go.mod h1:RJ58z4rMp3gvETA465Vg+ag8BGgBdnRPEMMSTr5Uv+M= +cloud.google.com/go/datacatalog v1.12.0/go.mod h1:CWae8rFkfp6LzLumKOnmVh4+Zle4A3NXLzVJ1d1mRm0= +cloud.google.com/go/datacatalog v1.13.0/go.mod h1:E4Rj9a5ZtAxcQJlEBTLgMTphfP11/lNaAshpoBgemX8= +cloud.google.com/go/dataflow v0.6.0/go.mod h1:9QwV89cGoxjjSR9/r7eFDqqjtvbKxAK2BaYU6PVk9UM= +cloud.google.com/go/dataflow v0.7.0/go.mod h1:PX526vb4ijFMesO1o202EaUmouZKBpjHsTlCtB4parQ= +cloud.google.com/go/dataflow v0.8.0/go.mod h1:Rcf5YgTKPtQyYz8bLYhFoIV/vP39eL7fWNcSOyFfLJE= +cloud.google.com/go/dataform v0.3.0/go.mod h1:cj8uNliRlHpa6L3yVhDOBrUXH+BPAO1+KFMQQNSThKo= +cloud.google.com/go/dataform v0.4.0/go.mod h1:fwV6Y4Ty2yIFL89huYlEkwUPtS7YZinZbzzj5S9FzCE= +cloud.google.com/go/dataform v0.5.0/go.mod h1:GFUYRe8IBa2hcomWplodVmUx/iTL0FrsauObOM3Ipr0= +cloud.google.com/go/dataform v0.6.0/go.mod h1:QPflImQy33e29VuapFdf19oPbE4aYTJxr31OAPV+ulA= +cloud.google.com/go/dataform v0.7.0/go.mod h1:7NulqnVozfHvWUBpMDfKMUESr+85aJsC/2O0o3jWPDE= +cloud.google.com/go/datafusion v1.4.0/go.mod h1:1Zb6VN+W6ALo85cXnM1IKiPw+yQMKMhB9TsTSRDo/38= +cloud.google.com/go/datafusion v1.5.0/go.mod h1:Kz+l1FGHB0J+4XF2fud96WMmRiq/wj8N9u007vyXZ2w= +cloud.google.com/go/datafusion v1.6.0/go.mod h1:WBsMF8F1RhSXvVM8rCV3AeyWVxcC2xY6vith3iw3S+8= +cloud.google.com/go/datalabeling v0.5.0/go.mod h1:TGcJ0G2NzcsXSE/97yWjIZO0bXj0KbVlINXMG9ud42I= +cloud.google.com/go/datalabeling v0.6.0/go.mod h1:WqdISuk/+WIGeMkpw/1q7bK/tFEZxsrFJOJdY2bXvTQ= +cloud.google.com/go/datalabeling v0.7.0/go.mod h1:WPQb1y08RJbmpM3ww0CSUAGweL0SxByuW2E+FU+wXcM= +cloud.google.com/go/dataplex v1.3.0/go.mod h1:hQuRtDg+fCiFgC8j0zV222HvzFQdRd+SVX8gdmFcZzA= +cloud.google.com/go/dataplex v1.4.0/go.mod h1:X51GfLXEMVJ6UN47ESVqvlsRplbLhcsAt0kZCCKsU0A= +cloud.google.com/go/dataplex v1.5.2/go.mod h1:cVMgQHsmfRoI5KFYq4JtIBEUbYwc3c7tXmIDhRmNNVQ= +cloud.google.com/go/dataplex v1.6.0/go.mod h1:bMsomC/aEJOSpHXdFKFGQ1b0TDPIeL28nJObeO1ppRs= +cloud.google.com/go/dataproc v1.7.0/go.mod h1:CKAlMjII9H90RXaMpSxQ8EU6dQx6iAYNPcYPOkSbi8s= +cloud.google.com/go/dataproc v1.8.0/go.mod h1:5OW+zNAH0pMpw14JVrPONsxMQYMBqJuzORhIBfBn9uI= +cloud.google.com/go/dataproc v1.12.0/go.mod h1:zrF3aX0uV3ikkMz6z4uBbIKyhRITnxvr4i3IjKsKrw4= +cloud.google.com/go/dataqna v0.5.0/go.mod h1:90Hyk596ft3zUQ8NkFfvICSIfHFh1Bc7C4cK3vbhkeo= +cloud.google.com/go/dataqna v0.6.0/go.mod h1:1lqNpM7rqNLVgWBJyk5NF6Uen2PHym0jtVJonplVsDA= +cloud.google.com/go/dataqna v0.7.0/go.mod h1:Lx9OcIIeqCrw1a6KdO3/5KMP1wAmTc0slZWwP12Qq3c= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/datastore v1.10.0/go.mod h1:PC5UzAmDEkAmkfaknstTYbNpgE49HAgW2J1gcgUfmdM= +cloud.google.com/go/datastore v1.11.0/go.mod h1:TvGxBIHCS50u8jzG+AW/ppf87v1of8nwzFNgEZU1D3c= +cloud.google.com/go/datastream v1.2.0/go.mod h1:i/uTP8/fZwgATHS/XFu0TcNUhuA0twZxxQ3EyCUQMwo= +cloud.google.com/go/datastream v1.3.0/go.mod h1:cqlOX8xlyYF/uxhiKn6Hbv6WjwPPuI9W2M9SAXwaLLQ= +cloud.google.com/go/datastream v1.4.0/go.mod h1:h9dpzScPhDTs5noEMQVWP8Wx8AFBRyS0s8KWPx/9r0g= +cloud.google.com/go/datastream v1.5.0/go.mod h1:6TZMMNPwjUqZHBKPQ1wwXpb0d5VDVPl2/XoS5yi88q4= +cloud.google.com/go/datastream v1.6.0/go.mod h1:6LQSuswqLa7S4rPAOZFVjHIG3wJIjZcZrw8JDEDJuIs= +cloud.google.com/go/datastream v1.7.0/go.mod h1:uxVRMm2elUSPuh65IbZpzJNMbuzkcvu5CjMqVIUHrww= +cloud.google.com/go/deploy v1.4.0/go.mod h1:5Xghikd4VrmMLNaF6FiRFDlHb59VM59YoDQnOUdsH/c= +cloud.google.com/go/deploy v1.5.0/go.mod h1:ffgdD0B89tToyW/U/D2eL0jN2+IEV/3EMuXHA0l4r+s= +cloud.google.com/go/deploy v1.6.0/go.mod h1:f9PTHehG/DjCom3QH0cntOVRm93uGBDt2vKzAPwpXQI= +cloud.google.com/go/deploy v1.8.0/go.mod h1:z3myEJnA/2wnB4sgjqdMfgxCA0EqC3RBTNcVPs93mtQ= +cloud.google.com/go/dialogflow v1.15.0/go.mod h1:HbHDWs33WOGJgn6rfzBW1Kv807BE3O1+xGbn59zZWI4= +cloud.google.com/go/dialogflow v1.16.1/go.mod h1:po6LlzGfK+smoSmTBnbkIZY2w8ffjz/RcGSS+sh1el0= +cloud.google.com/go/dialogflow v1.17.0/go.mod h1:YNP09C/kXA1aZdBgC/VtXX74G/TKn7XVCcVumTflA+8= +cloud.google.com/go/dialogflow v1.18.0/go.mod h1:trO7Zu5YdyEuR+BhSNOqJezyFQ3aUzz0njv7sMx/iek= +cloud.google.com/go/dialogflow v1.19.0/go.mod h1:JVmlG1TwykZDtxtTXujec4tQ+D8SBFMoosgy+6Gn0s0= +cloud.google.com/go/dialogflow v1.29.0/go.mod h1:b+2bzMe+k1s9V+F2jbJwpHPzrnIyHihAdRFMtn2WXuM= +cloud.google.com/go/dialogflow v1.31.0/go.mod h1:cuoUccuL1Z+HADhyIA7dci3N5zUssgpBJmCzI6fNRB4= +cloud.google.com/go/dialogflow v1.32.0/go.mod h1:jG9TRJl8CKrDhMEcvfcfFkkpp8ZhgPz3sBGmAUYJ2qE= +cloud.google.com/go/dlp v1.6.0/go.mod h1:9eyB2xIhpU0sVwUixfBubDoRwP+GjeUoxxeueZmqvmM= +cloud.google.com/go/dlp v1.7.0/go.mod h1:68ak9vCiMBjbasxeVD17hVPxDEck+ExiHavX8kiHG+Q= +cloud.google.com/go/dlp v1.9.0/go.mod h1:qdgmqgTyReTz5/YNSSuueR8pl7hO0o9bQ39ZhtgkWp4= +cloud.google.com/go/documentai v1.7.0/go.mod h1:lJvftZB5NRiFSX4moiye1SMxHx0Bc3x1+p9e/RfXYiU= +cloud.google.com/go/documentai v1.8.0/go.mod h1:xGHNEB7CtsnySCNrCFdCyyMz44RhFEEX2Q7UD0c5IhU= +cloud.google.com/go/documentai v1.9.0/go.mod h1:FS5485S8R00U10GhgBC0aNGrJxBP8ZVpEeJ7PQDZd6k= +cloud.google.com/go/documentai v1.10.0/go.mod h1:vod47hKQIPeCfN2QS/jULIvQTugbmdc0ZvxxfQY1bg4= +cloud.google.com/go/documentai v1.16.0/go.mod h1:o0o0DLTEZ+YnJZ+J4wNfTxmDVyrkzFvttBXXtYRMHkM= +cloud.google.com/go/documentai v1.18.0/go.mod h1:F6CK6iUH8J81FehpskRmhLq/3VlwQvb7TvwOceQ2tbs= +cloud.google.com/go/domains v0.6.0/go.mod h1:T9Rz3GasrpYk6mEGHh4rymIhjlnIuB4ofT1wTxDeT4Y= +cloud.google.com/go/domains v0.7.0/go.mod h1:PtZeqS1xjnXuRPKE/88Iru/LdfoRyEHYA9nFQf4UKpg= +cloud.google.com/go/domains v0.8.0/go.mod h1:M9i3MMDzGFXsydri9/vW+EWz9sWb4I6WyHqdlAk0idE= +cloud.google.com/go/edgecontainer v0.1.0/go.mod h1:WgkZ9tp10bFxqO8BLPqv2LlfmQF1X8lZqwW4r1BTajk= +cloud.google.com/go/edgecontainer v0.2.0/go.mod h1:RTmLijy+lGpQ7BXuTDa4C4ssxyXT34NIuHIgKuP4s5w= +cloud.google.com/go/edgecontainer v0.3.0/go.mod h1:FLDpP4nykgwwIfcLt6zInhprzw0lEi2P1fjO6Ie0qbc= +cloud.google.com/go/edgecontainer v1.0.0/go.mod h1:cttArqZpBB2q58W/upSG++ooo6EsblxDIolxa3jSjbY= +cloud.google.com/go/errorreporting v0.3.0/go.mod h1:xsP2yaAp+OAW4OIm60An2bbLpqIhKXdWR/tawvl7QzU= +cloud.google.com/go/essentialcontacts v1.3.0/go.mod h1:r+OnHa5jfj90qIfZDO/VztSFqbQan7HV75p8sA+mdGI= +cloud.google.com/go/essentialcontacts v1.4.0/go.mod h1:8tRldvHYsmnBCHdFpvU+GL75oWiBKl80BiqlFh9tp+8= +cloud.google.com/go/essentialcontacts v1.5.0/go.mod h1:ay29Z4zODTuwliK7SnX8E86aUF2CTzdNtvv42niCX0M= +cloud.google.com/go/eventarc v1.7.0/go.mod h1:6ctpF3zTnaQCxUjHUdcfgcA1A2T309+omHZth7gDfmc= +cloud.google.com/go/eventarc v1.8.0/go.mod h1:imbzxkyAU4ubfsaKYdQg04WS1NvncblHEup4kvF+4gw= +cloud.google.com/go/eventarc v1.10.0/go.mod h1:u3R35tmZ9HvswGRBnF48IlYgYeBcPUCjkr4BTdem2Kw= +cloud.google.com/go/eventarc v1.11.0/go.mod h1:PyUjsUKPWoRBCHeOxZd/lbOOjahV41icXyUY5kSTvVY= +cloud.google.com/go/filestore v1.3.0/go.mod h1:+qbvHGvXU1HaKX2nD0WEPo92TP/8AQuCVEBXNY9z0+w= +cloud.google.com/go/filestore v1.4.0/go.mod h1:PaG5oDfo9r224f8OYXURtAsY+Fbyq/bLYoINEK8XQAI= +cloud.google.com/go/filestore v1.5.0/go.mod h1:FqBXDWBp4YLHqRnVGveOkHDf8svj9r5+mUDLupOWEDs= +cloud.google.com/go/filestore v1.6.0/go.mod h1:di5unNuss/qfZTw2U9nhFqo8/ZDSc466dre85Kydllg= +cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= +cloud.google.com/go/firestore v1.9.0/go.mod h1:HMkjKHNTtRyZNiMzu7YAsLr9K3X2udY2AMwDaMEQiiE= +cloud.google.com/go/functions v1.6.0/go.mod h1:3H1UA3qiIPRWD7PeZKLvHZ9SaQhR26XIJcC0A5GbvAk= +cloud.google.com/go/functions v1.7.0/go.mod h1:+d+QBcWM+RsrgZfV9xo6KfA1GlzJfxcfZcRPEhDDfzg= +cloud.google.com/go/functions v1.8.0/go.mod h1:RTZ4/HsQjIqIYP9a9YPbU+QFoQsAlYgrwOXJWHn1POY= +cloud.google.com/go/functions v1.9.0/go.mod h1:Y+Dz8yGguzO3PpIjhLTbnqV1CWmgQ5UwtlpzoyquQ08= +cloud.google.com/go/functions v1.10.0/go.mod h1:0D3hEOe3DbEvCXtYOZHQZmD+SzYsi1YbI7dGvHfldXw= +cloud.google.com/go/functions v1.12.0/go.mod h1:AXWGrF3e2C/5ehvwYo/GH6O5s09tOPksiKhz+hH8WkA= +cloud.google.com/go/functions v1.13.0/go.mod h1:EU4O007sQm6Ef/PwRsI8N2umygGqPBS/IZQKBQBcJ3c= +cloud.google.com/go/gaming v1.5.0/go.mod h1:ol7rGcxP/qHTRQE/RO4bxkXq+Fix0j6D4LFPzYTIrDM= +cloud.google.com/go/gaming v1.6.0/go.mod h1:YMU1GEvA39Qt3zWGyAVA9bpYz/yAhTvaQ1t2sK4KPUA= +cloud.google.com/go/gaming v1.7.0/go.mod h1:LrB8U7MHdGgFG851iHAfqUdLcKBdQ55hzXy9xBJz0+w= +cloud.google.com/go/gaming v1.8.0/go.mod h1:xAqjS8b7jAVW0KFYeRUxngo9My3f33kFmua++Pi+ggM= +cloud.google.com/go/gaming v1.9.0/go.mod h1:Fc7kEmCObylSWLO334NcO+O9QMDyz+TKC4v1D7X+Bc0= +cloud.google.com/go/gkebackup v0.2.0/go.mod h1:XKvv/4LfG829/B8B7xRkk8zRrOEbKtEam6yNfuQNH60= +cloud.google.com/go/gkebackup v0.3.0/go.mod h1:n/E671i1aOQvUxT541aTkCwExO/bTer2HDlj4TsBRAo= +cloud.google.com/go/gkebackup v0.4.0/go.mod h1:byAyBGUwYGEEww7xsbnUTBHIYcOPy/PgUWUtOeRm9Vg= +cloud.google.com/go/gkeconnect v0.5.0/go.mod h1:c5lsNAg5EwAy7fkqX/+goqFsU1Da/jQFqArp+wGNr/o= +cloud.google.com/go/gkeconnect v0.6.0/go.mod h1:Mln67KyU/sHJEBY8kFZ0xTeyPtzbq9StAVvEULYK16A= +cloud.google.com/go/gkeconnect v0.7.0/go.mod h1:SNfmVqPkaEi3bF/B3CNZOAYPYdg7sU+obZ+QTky2Myw= +cloud.google.com/go/gkehub v0.9.0/go.mod h1:WYHN6WG8w9bXU0hqNxt8rm5uxnk8IH+lPY9J2TV7BK0= +cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y977wO+hBH0= +cloud.google.com/go/gkehub v0.11.0/go.mod h1:JOWHlmN+GHyIbuWQPl47/C2RFhnFKH38jH9Ascu3n0E= +cloud.google.com/go/gkehub v0.12.0/go.mod h1:djiIwwzTTBrF5NaXCGv3mf7klpEMcST17VBTVVDcuaw= +cloud.google.com/go/gkemulticloud v0.3.0/go.mod h1:7orzy7O0S+5kq95e4Hpn7RysVA7dPs8W/GgfUtsPbrA= +cloud.google.com/go/gkemulticloud v0.4.0/go.mod h1:E9gxVBnseLWCk24ch+P9+B2CoDFJZTyIgLKSalC7tuI= +cloud.google.com/go/gkemulticloud v0.5.0/go.mod h1:W0JDkiyi3Tqh0TJr//y19wyb1yf8llHVto2Htf2Ja3Y= +cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= +cloud.google.com/go/gsuiteaddons v1.3.0/go.mod h1:EUNK/J1lZEZO8yPtykKxLXI6JSVN2rg9bN8SXOa0bgM= +cloud.google.com/go/gsuiteaddons v1.4.0/go.mod h1:rZK5I8hht7u7HxFQcFei0+AtfS9uSushomRlg+3ua1o= +cloud.google.com/go/gsuiteaddons v1.5.0/go.mod h1:TFCClYLd64Eaa12sFVmUyG62tk4mdIsI7pAnSXRkcFo= +cloud.google.com/go/iam v0.1.0/go.mod h1:vcUNEa0pEm0qRVpmWepWaFMIAI8/hjB9mO8rNCJtF6c= +cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= +cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= +cloud.google.com/go/iam v0.6.0/go.mod h1:+1AH33ueBne5MzYccyMHtEKqLE4/kJOibtffMHDMFMc= +cloud.google.com/go/iam v0.7.0/go.mod h1:H5Br8wRaDGNc8XP3keLc4unfUUZeyH3Sfl9XpQEYOeg= +cloud.google.com/go/iam v0.8.0/go.mod h1:lga0/y3iH6CX7sYqypWJ33hf7kkfXJag67naqGESjkE= +cloud.google.com/go/iam v0.11.0/go.mod h1:9PiLDanza5D+oWFZiH1uG+RnRCfEGKoyl6yo4cgWZGY= +cloud.google.com/go/iam v0.12.0/go.mod h1:knyHGviacl11zrtZUoDuYpDgLjvr28sLQaG0YB2GYAY= +cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0= +cloud.google.com/go/iap v1.4.0/go.mod h1:RGFwRJdihTINIe4wZ2iCP0zF/qu18ZwyKxrhMhygBEc= +cloud.google.com/go/iap v1.5.0/go.mod h1:UH/CGgKd4KyohZL5Pt0jSKE4m3FR51qg6FKQ/z/Ix9A= +cloud.google.com/go/iap v1.6.0/go.mod h1:NSuvI9C/j7UdjGjIde7t7HBz+QTwBcapPE07+sSRcLk= +cloud.google.com/go/iap v1.7.0/go.mod h1:beqQx56T9O1G1yNPph+spKpNibDlYIiIixiqsQXxLIo= +cloud.google.com/go/iap v1.7.1/go.mod h1:WapEwPc7ZxGt2jFGB/C/bm+hP0Y6NXzOYGjpPnmMS74= +cloud.google.com/go/ids v1.1.0/go.mod h1:WIuwCaYVOzHIj2OhN9HAwvW+DBdmUAdcWlFxRl+KubM= +cloud.google.com/go/ids v1.2.0/go.mod h1:5WXvp4n25S0rA/mQWAg1YEEBBq6/s+7ml1RDCW1IrcY= +cloud.google.com/go/ids v1.3.0/go.mod h1:JBdTYwANikFKaDP6LtW5JAi4gubs57SVNQjemdt6xV4= +cloud.google.com/go/iot v1.3.0/go.mod h1:r7RGh2B61+B8oz0AGE+J72AhA0G7tdXItODWsaA2oLs= +cloud.google.com/go/iot v1.4.0/go.mod h1:dIDxPOn0UvNDUMD8Ger7FIaTuvMkj+aGk94RPP0iV+g= +cloud.google.com/go/iot v1.5.0/go.mod h1:mpz5259PDl3XJthEmh9+ap0affn/MqNSP4My77Qql9o= +cloud.google.com/go/iot v1.6.0/go.mod h1:IqdAsmE2cTYYNO1Fvjfzo9po179rAtJeVGUvkLN3rLE= +cloud.google.com/go/kms v1.4.0/go.mod h1:fajBHndQ+6ubNw6Ss2sSd+SWvjL26RNo/dr7uxsnnOA= +cloud.google.com/go/kms v1.5.0/go.mod h1:QJS2YY0eJGBg3mnDfuaCyLauWwBJiHRboYxJ++1xJNg= +cloud.google.com/go/kms v1.6.0/go.mod h1:Jjy850yySiasBUDi6KFUwUv2n1+o7QZFyuUJg6OgjA0= +cloud.google.com/go/kms v1.8.0/go.mod h1:4xFEhYFqvW+4VMELtZyxomGSYtSQKzM178ylFW4jMAg= +cloud.google.com/go/kms v1.9.0/go.mod h1:qb1tPTgfF9RQP8e1wq4cLFErVuTJv7UsSC915J8dh3w= +cloud.google.com/go/kms v1.10.0/go.mod h1:ng3KTUtQQU9bPX3+QGLsflZIHlkbn8amFAMY63m8d24= +cloud.google.com/go/kms v1.10.1/go.mod h1:rIWk/TryCkR59GMC3YtHtXeLzd634lBbKenvyySAyYI= +cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= +cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= +cloud.google.com/go/language v1.7.0/go.mod h1:DJ6dYN/W+SQOjF8e1hLQXMF21AkH2w9wiPzPCJa2MIE= +cloud.google.com/go/language v1.8.0/go.mod h1:qYPVHf7SPoNNiCL2Dr0FfEFNil1qi3pQEyygwpgVKB8= +cloud.google.com/go/language v1.9.0/go.mod h1:Ns15WooPM5Ad/5no/0n81yUetis74g3zrbeJBE+ptUY= +cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= +cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= +cloud.google.com/go/lifesciences v0.8.0/go.mod h1:lFxiEOMqII6XggGbOnKiyZ7IBwoIqA84ClvoezaA/bo= +cloud.google.com/go/logging v1.6.1/go.mod h1:5ZO0mHHbvm8gEmeEUHrmDlTDSu5imF6MUP9OfilNXBw= +cloud.google.com/go/logging v1.7.0/go.mod h1:3xjP2CjkM3ZkO73aj4ASA5wRPGGCRrPIAeNqVNkzY8M= +cloud.google.com/go/longrunning v0.1.1/go.mod h1:UUFxuDWkv22EuY93jjmDMFT5GPQKeFVJBIF6QlTqdsE= +cloud.google.com/go/longrunning v0.3.0/go.mod h1:qth9Y41RRSUE69rDcOn6DdK3HfQfsUI0YSmW3iIlLJc= +cloud.google.com/go/longrunning v0.4.1/go.mod h1:4iWDqhBZ70CvZ6BfETbvam3T8FMvLK+eFj0E6AaRQTo= +cloud.google.com/go/managedidentities v1.3.0/go.mod h1:UzlW3cBOiPrzucO5qWkNkh0w33KFtBJU281hacNvsdE= +cloud.google.com/go/managedidentities v1.4.0/go.mod h1:NWSBYbEMgqmbZsLIyKvxrYbtqOsxY1ZrGM+9RgDqInM= +cloud.google.com/go/managedidentities v1.5.0/go.mod h1:+dWcZ0JlUmpuxpIDfyP5pP5y0bLdRwOS4Lp7gMni/LA= +cloud.google.com/go/maps v0.1.0/go.mod h1:BQM97WGyfw9FWEmQMpZ5T6cpovXXSd1cGmFma94eubI= +cloud.google.com/go/maps v0.6.0/go.mod h1:o6DAMMfb+aINHz/p/jbcY+mYeXBoZoxTfdSQ8VAJaCw= +cloud.google.com/go/maps v0.7.0/go.mod h1:3GnvVl3cqeSvgMcpRlQidXsPYuDGQ8naBis7MVzpXsY= +cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= +cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= +cloud.google.com/go/mediatranslation v0.7.0/go.mod h1:LCnB/gZr90ONOIQLgSXagp8XUW1ODs2UmUMvcgMfI2I= +cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= +cloud.google.com/go/memcache v1.5.0/go.mod h1:dk3fCK7dVo0cUU2c36jKb4VqKPS22BTkf81Xq617aWM= +cloud.google.com/go/memcache v1.6.0/go.mod h1:XS5xB0eQZdHtTuTF9Hf8eJkKtR3pVRCcvJwtm68T3rA= +cloud.google.com/go/memcache v1.7.0/go.mod h1:ywMKfjWhNtkQTxrWxCkCFkoPjLHPW6A7WOTVI8xy3LY= +cloud.google.com/go/memcache v1.9.0/go.mod h1:8oEyzXCu+zo9RzlEaEjHl4KkgjlNDaXbCQeQWlzNFJM= +cloud.google.com/go/metastore v1.5.0/go.mod h1:2ZNrDcQwghfdtCwJ33nM0+GrBGlVuh8rakL3vdPY3XY= +cloud.google.com/go/metastore v1.6.0/go.mod h1:6cyQTls8CWXzk45G55x57DVQ9gWg7RiH65+YgPsNh9s= +cloud.google.com/go/metastore v1.7.0/go.mod h1:s45D0B4IlsINu87/AsWiEVYbLaIMeUSoxlKKDqBGFS8= +cloud.google.com/go/metastore v1.8.0/go.mod h1:zHiMc4ZUpBiM7twCIFQmJ9JMEkDSyZS9U12uf7wHqSI= +cloud.google.com/go/metastore v1.10.0/go.mod h1:fPEnH3g4JJAk+gMRnrAnoqyv2lpUCqJPWOodSaf45Eo= +cloud.google.com/go/monitoring v1.7.0/go.mod h1:HpYse6kkGo//7p6sT0wsIC6IBDET0RhIsnmlA53dvEk= +cloud.google.com/go/monitoring v1.8.0/go.mod h1:E7PtoMJ1kQXWxPjB6mv2fhC5/15jInuulFdYYtlcvT4= +cloud.google.com/go/monitoring v1.12.0/go.mod h1:yx8Jj2fZNEkL/GYZyTLS4ZtZEZN8WtDEiEqG4kLK50w= +cloud.google.com/go/monitoring v1.13.0/go.mod h1:k2yMBAB1H9JT/QETjNkgdCGD9bPF712XiLTVr+cBrpw= +cloud.google.com/go/networkconnectivity v1.4.0/go.mod h1:nOl7YL8odKyAOtzNX73/M5/mGZgqqMeryi6UPZTk/rA= +cloud.google.com/go/networkconnectivity v1.5.0/go.mod h1:3GzqJx7uhtlM3kln0+x5wyFvuVH1pIBJjhCpjzSt75o= +cloud.google.com/go/networkconnectivity v1.6.0/go.mod h1:OJOoEXW+0LAxHh89nXd64uGG+FbQoeH8DtxCHVOMlaM= +cloud.google.com/go/networkconnectivity v1.7.0/go.mod h1:RMuSbkdbPwNMQjB5HBWD5MpTBnNm39iAVpC3TmsExt8= +cloud.google.com/go/networkconnectivity v1.10.0/go.mod h1:UP4O4sWXJG13AqrTdQCD9TnLGEbtNRqjuaaA7bNjF5E= +cloud.google.com/go/networkconnectivity v1.11.0/go.mod h1:iWmDD4QF16VCDLXUqvyspJjIEtBR/4zq5hwnY2X3scM= +cloud.google.com/go/networkmanagement v1.4.0/go.mod h1:Q9mdLLRn60AsOrPc8rs8iNV6OHXaGcDdsIQe1ohekq8= +cloud.google.com/go/networkmanagement v1.5.0/go.mod h1:ZnOeZ/evzUdUsnvRt792H0uYEnHQEMaz+REhhzJRcf4= +cloud.google.com/go/networkmanagement v1.6.0/go.mod h1:5pKPqyXjB/sgtvB5xqOemumoQNB7y95Q7S+4rjSOPYY= +cloud.google.com/go/networksecurity v0.5.0/go.mod h1:xS6fOCoqpVC5zx15Z/MqkfDwH4+m/61A3ODiDV1xmiQ= +cloud.google.com/go/networksecurity v0.6.0/go.mod h1:Q5fjhTr9WMI5mbpRYEbiexTzROf7ZbDzvzCrNl14nyU= +cloud.google.com/go/networksecurity v0.7.0/go.mod h1:mAnzoxx/8TBSyXEeESMy9OOYwo1v+gZ5eMRnsT5bC8k= +cloud.google.com/go/networksecurity v0.8.0/go.mod h1:B78DkqsxFG5zRSVuwYFRZ9Xz8IcQ5iECsNrPn74hKHU= +cloud.google.com/go/notebooks v1.2.0/go.mod h1:9+wtppMfVPUeJ8fIWPOq1UnATHISkGXGqTkxeieQ6UY= +cloud.google.com/go/notebooks v1.3.0/go.mod h1:bFR5lj07DtCPC7YAAJ//vHskFBxA5JzYlH68kXVdk34= +cloud.google.com/go/notebooks v1.4.0/go.mod h1:4QPMngcwmgb6uw7Po99B2xv5ufVoIQ7nOGDyL4P8AgA= +cloud.google.com/go/notebooks v1.5.0/go.mod h1:q8mwhnP9aR8Hpfnrc5iN5IBhrXUy8S2vuYs+kBJ/gu0= +cloud.google.com/go/notebooks v1.7.0/go.mod h1:PVlaDGfJgj1fl1S3dUwhFMXFgfYGhYQt2164xOMONmE= +cloud.google.com/go/notebooks v1.8.0/go.mod h1:Lq6dYKOYOWUCTvw5t2q1gp1lAp0zxAxRycayS0iJcqQ= +cloud.google.com/go/optimization v1.1.0/go.mod h1:5po+wfvX5AQlPznyVEZjGJTMr4+CAkJf2XSTQOOl9l4= +cloud.google.com/go/optimization v1.2.0/go.mod h1:Lr7SOHdRDENsh+WXVmQhQTrzdu9ybg0NecjHidBq6xs= +cloud.google.com/go/optimization v1.3.1/go.mod h1:IvUSefKiwd1a5p0RgHDbWCIbDFgKuEdB+fPPuP0IDLI= +cloud.google.com/go/orchestration v1.3.0/go.mod h1:Sj5tq/JpWiB//X/q3Ngwdl5K7B7Y0KZ7bfv0wL6fqVA= +cloud.google.com/go/orchestration v1.4.0/go.mod h1:6W5NLFWs2TlniBphAViZEVhrXRSMgUGDfW7vrWKvsBk= +cloud.google.com/go/orchestration v1.6.0/go.mod h1:M62Bevp7pkxStDfFfTuCOaXgaaqRAga1yKyoMtEoWPQ= +cloud.google.com/go/orgpolicy v1.4.0/go.mod h1:xrSLIV4RePWmP9P3tBl8S93lTmlAxjm06NSm2UTmKvE= +cloud.google.com/go/orgpolicy v1.5.0/go.mod h1:hZEc5q3wzwXJaKrsx5+Ewg0u1LxJ51nNFlext7Tanwc= +cloud.google.com/go/orgpolicy v1.10.0/go.mod h1:w1fo8b7rRqlXlIJbVhOMPrwVljyuW5mqssvBtU18ONc= +cloud.google.com/go/osconfig v1.7.0/go.mod h1:oVHeCeZELfJP7XLxcBGTMBvRO+1nQ5tFG9VQTmYS2Fs= +cloud.google.com/go/osconfig v1.8.0/go.mod h1:EQqZLu5w5XA7eKizepumcvWx+m8mJUhEwiPqWiZeEdg= +cloud.google.com/go/osconfig v1.9.0/go.mod h1:Yx+IeIZJ3bdWmzbQU4fxNl8xsZ4amB+dygAwFPlvnNo= +cloud.google.com/go/osconfig v1.10.0/go.mod h1:uMhCzqC5I8zfD9zDEAfvgVhDS8oIjySWh+l4WK6GnWw= +cloud.google.com/go/osconfig v1.11.0/go.mod h1:aDICxrur2ogRd9zY5ytBLV89KEgT2MKB2L/n6x1ooPw= +cloud.google.com/go/oslogin v1.4.0/go.mod h1:YdgMXWRaElXz/lDk1Na6Fh5orF7gvmJ0FGLIs9LId4E= +cloud.google.com/go/oslogin v1.5.0/go.mod h1:D260Qj11W2qx/HVF29zBg+0fd6YCSjSqLUkY/qEenQU= +cloud.google.com/go/oslogin v1.6.0/go.mod h1:zOJ1O3+dTU8WPlGEkFSh7qeHPPSoxrcMbbK1Nm2iX70= +cloud.google.com/go/oslogin v1.7.0/go.mod h1:e04SN0xO1UNJ1M5GP0vzVBFicIe4O53FOfcixIqTyXo= +cloud.google.com/go/oslogin v1.9.0/go.mod h1:HNavntnH8nzrn8JCTT5fj18FuJLFJc4NaZJtBnQtKFs= +cloud.google.com/go/phishingprotection v0.5.0/go.mod h1:Y3HZknsK9bc9dMi+oE8Bim0lczMU6hrX0UpADuMefr0= +cloud.google.com/go/phishingprotection v0.6.0/go.mod h1:9Y3LBLgy0kDTcYET8ZH3bq/7qni15yVUoAxiFxnlSUA= +cloud.google.com/go/phishingprotection v0.7.0/go.mod h1:8qJI4QKHoda/sb/7/YmMQ2omRLSLYSu9bU0EKCNI+Lk= +cloud.google.com/go/policytroubleshooter v1.3.0/go.mod h1:qy0+VwANja+kKrjlQuOzmlvscn4RNsAc0e15GGqfMxg= +cloud.google.com/go/policytroubleshooter v1.4.0/go.mod h1:DZT4BcRw3QoO8ota9xw/LKtPa8lKeCByYeKTIf/vxdE= +cloud.google.com/go/policytroubleshooter v1.5.0/go.mod h1:Rz1WfV+1oIpPdN2VvvuboLVRsB1Hclg3CKQ53j9l8vw= +cloud.google.com/go/policytroubleshooter v1.6.0/go.mod h1:zYqaPTsmfvpjm5ULxAyD/lINQxJ0DDsnWOP/GZ7xzBc= +cloud.google.com/go/privatecatalog v0.5.0/go.mod h1:XgosMUvvPyxDjAVNDYxJ7wBW8//hLDDYmnsNcMGq1K0= +cloud.google.com/go/privatecatalog v0.6.0/go.mod h1:i/fbkZR0hLN29eEWiiwue8Pb+GforiEIBnV9yrRUOKI= +cloud.google.com/go/privatecatalog v0.7.0/go.mod h1:2s5ssIFO69F5csTXcwBP7NPFTZvps26xGzvQ2PQaBYg= +cloud.google.com/go/privatecatalog v0.8.0/go.mod h1:nQ6pfaegeDAq/Q5lrfCQzQLhubPiZhSaNhIgfJlnIXs= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/pubsub v1.26.0/go.mod h1:QgBH3U/jdJy/ftjPhTkyXNj543Tin1pRYcdcPRnFIRI= +cloud.google.com/go/pubsub v1.27.1/go.mod h1:hQN39ymbV9geqBnfQq6Xf63yNhUAhv9CZhzp5O6qsW0= +cloud.google.com/go/pubsub v1.28.0/go.mod h1:vuXFpwaVoIPQMGXqRyUQigu/AX1S3IWugR9xznmcXX8= +cloud.google.com/go/pubsub v1.30.0/go.mod h1:qWi1OPS0B+b5L+Sg6Gmc9zD1Y+HaM0MdUr7LsupY1P4= +cloud.google.com/go/pubsublite v1.5.0/go.mod h1:xapqNQ1CuLfGi23Yda/9l4bBCKz/wC3KIJ5gKcxveZg= +cloud.google.com/go/pubsublite v1.6.0/go.mod h1:1eFCS0U11xlOuMFV/0iBqw3zP12kddMeCbj/F3FSj9k= +cloud.google.com/go/pubsublite v1.7.0/go.mod h1:8hVMwRXfDfvGm3fahVbtDbiLePT3gpoiJYJY+vxWxVM= +cloud.google.com/go/recaptchaenterprise v1.3.1/go.mod h1:OdD+q+y4XGeAlxRaMn1Y7/GveP6zmq76byL6tjPE7d4= +cloud.google.com/go/recaptchaenterprise/v2 v2.1.0/go.mod h1:w9yVqajwroDNTfGuhmOjPDN//rZGySaf6PtFVcSCa7o= +cloud.google.com/go/recaptchaenterprise/v2 v2.2.0/go.mod h1:/Zu5jisWGeERrd5HnlS3EUGb/D335f9k51B/FVil0jk= +cloud.google.com/go/recaptchaenterprise/v2 v2.3.0/go.mod h1:O9LwGCjrhGHBQET5CA7dd5NwwNQUErSgEDit1DLNTdo= +cloud.google.com/go/recaptchaenterprise/v2 v2.4.0/go.mod h1:Am3LHfOuBstrLrNCBrlI5sbwx9LBg3te2N6hGvHn2mE= +cloud.google.com/go/recaptchaenterprise/v2 v2.5.0/go.mod h1:O8LzcHXN3rz0j+LBC91jrwI3R+1ZSZEWrfL7XHgNo9U= +cloud.google.com/go/recaptchaenterprise/v2 v2.6.0/go.mod h1:RPauz9jeLtB3JVzg6nCbe12qNoaa8pXc4d/YukAmcnA= +cloud.google.com/go/recaptchaenterprise/v2 v2.7.0/go.mod h1:19wVj/fs5RtYtynAPJdDTb69oW0vNHYDBTbB4NvMD9c= +cloud.google.com/go/recommendationengine v0.5.0/go.mod h1:E5756pJcVFeVgaQv3WNpImkFP8a+RptV6dDLGPILjvg= +cloud.google.com/go/recommendationengine v0.6.0/go.mod h1:08mq2umu9oIqc7tDy8sx+MNJdLG0fUi3vaSVbztHgJ4= +cloud.google.com/go/recommendationengine v0.7.0/go.mod h1:1reUcE3GIu6MeBz/h5xZJqNLuuVjNg1lmWMPyjatzac= +cloud.google.com/go/recommender v1.5.0/go.mod h1:jdoeiBIVrJe9gQjwd759ecLJbxCDED4A6p+mqoqDvTg= +cloud.google.com/go/recommender v1.6.0/go.mod h1:+yETpm25mcoiECKh9DEScGzIRyDKpZ0cEhWGo+8bo+c= +cloud.google.com/go/recommender v1.7.0/go.mod h1:XLHs/W+T8olwlGOgfQenXBTbIseGclClff6lhFVe9Bs= +cloud.google.com/go/recommender v1.8.0/go.mod h1:PkjXrTT05BFKwxaUxQmtIlrtj0kph108r02ZZQ5FE70= +cloud.google.com/go/recommender v1.9.0/go.mod h1:PnSsnZY7q+VL1uax2JWkt/UegHssxjUVVCrX52CuEmQ= +cloud.google.com/go/redis v1.7.0/go.mod h1:V3x5Jq1jzUcg+UNsRvdmsfuFnit1cfe3Z/PGyq/lm4Y= +cloud.google.com/go/redis v1.8.0/go.mod h1:Fm2szCDavWzBk2cDKxrkmWBqoCiL1+Ctwq7EyqBCA/A= +cloud.google.com/go/redis v1.9.0/go.mod h1:HMYQuajvb2D0LvMgZmLDZW8V5aOC/WxstZHiy4g8OiA= +cloud.google.com/go/redis v1.10.0/go.mod h1:ThJf3mMBQtW18JzGgh41/Wld6vnDDc/F/F35UolRZPM= +cloud.google.com/go/redis v1.11.0/go.mod h1:/X6eicana+BWcUda5PpwZC48o37SiFVTFSs0fWAJ7uQ= +cloud.google.com/go/resourcemanager v1.3.0/go.mod h1:bAtrTjZQFJkiWTPDb1WBjzvc6/kifjj4QBYuKCCoqKA= +cloud.google.com/go/resourcemanager v1.4.0/go.mod h1:MwxuzkumyTX7/a3n37gmsT3py7LIXwrShilPh3P1tR0= +cloud.google.com/go/resourcemanager v1.5.0/go.mod h1:eQoXNAiAvCf5PXxWxXjhKQoTMaUSNrEfg+6qdf/wots= +cloud.google.com/go/resourcemanager v1.6.0/go.mod h1:YcpXGRs8fDzcUl1Xw8uOVmI8JEadvhRIkoXXUNVYcVo= +cloud.google.com/go/resourcemanager v1.7.0/go.mod h1:HlD3m6+bwhzj9XCouqmeiGuni95NTrExfhoSrkC/3EI= +cloud.google.com/go/resourcesettings v1.3.0/go.mod h1:lzew8VfESA5DQ8gdlHwMrqZs1S9V87v3oCnKCWoOuQU= +cloud.google.com/go/resourcesettings v1.4.0/go.mod h1:ldiH9IJpcrlC3VSuCGvjR5of/ezRrOxFtpJoJo5SmXg= +cloud.google.com/go/resourcesettings v1.5.0/go.mod h1:+xJF7QSG6undsQDfsCJyqWXyBwUoJLhetkRMDRnIoXA= +cloud.google.com/go/retail v1.8.0/go.mod h1:QblKS8waDmNUhghY2TI9O3JLlFk8jybHeV4BF19FrE4= +cloud.google.com/go/retail v1.9.0/go.mod h1:g6jb6mKuCS1QKnH/dpu7isX253absFl6iE92nHwlBUY= +cloud.google.com/go/retail v1.10.0/go.mod h1:2gDk9HsL4HMS4oZwz6daui2/jmKvqShXKQuB2RZ+cCc= +cloud.google.com/go/retail v1.11.0/go.mod h1:MBLk1NaWPmh6iVFSz9MeKG/Psyd7TAgm6y/9L2B4x9Y= +cloud.google.com/go/retail v1.12.0/go.mod h1:UMkelN/0Z8XvKymXFbD4EhFJlYKRx1FGhQkVPU5kF14= +cloud.google.com/go/run v0.2.0/go.mod h1:CNtKsTA1sDcnqqIFR3Pb5Tq0usWxJJvsWOCPldRU3Do= +cloud.google.com/go/run v0.3.0/go.mod h1:TuyY1+taHxTjrD0ZFk2iAR+xyOXEA0ztb7U3UNA0zBo= +cloud.google.com/go/run v0.8.0/go.mod h1:VniEnuBwqjigv0A7ONfQUaEItaiCRVujlMqerPPiktM= +cloud.google.com/go/run v0.9.0/go.mod h1:Wwu+/vvg8Y+JUApMwEDfVfhetv30hCG4ZwDR/IXl2Qg= +cloud.google.com/go/scheduler v1.4.0/go.mod h1:drcJBmxF3aqZJRhmkHQ9b3uSSpQoltBPGPxGAWROx6s= +cloud.google.com/go/scheduler v1.5.0/go.mod h1:ri073ym49NW3AfT6DZi21vLZrG07GXr5p3H1KxN5QlI= +cloud.google.com/go/scheduler v1.6.0/go.mod h1:SgeKVM7MIwPn3BqtcBntpLyrIJftQISRrYB5ZtT+KOk= +cloud.google.com/go/scheduler v1.7.0/go.mod h1:jyCiBqWW956uBjjPMMuX09n3x37mtyPJegEWKxRsn44= +cloud.google.com/go/scheduler v1.8.0/go.mod h1:TCET+Y5Gp1YgHT8py4nlg2Sew8nUHMqcpousDgXJVQc= +cloud.google.com/go/scheduler v1.9.0/go.mod h1:yexg5t+KSmqu+njTIh3b7oYPheFtBWGcbVUYF1GGMIc= +cloud.google.com/go/secretmanager v1.6.0/go.mod h1:awVa/OXF6IiyaU1wQ34inzQNc4ISIDIrId8qE5QGgKA= +cloud.google.com/go/secretmanager v1.8.0/go.mod h1:hnVgi/bN5MYHd3Gt0SPuTPPp5ENina1/LxM+2W9U9J4= +cloud.google.com/go/secretmanager v1.9.0/go.mod h1:b71qH2l1yHmWQHt9LC80akm86mX8AL6X1MA01dW8ht4= +cloud.google.com/go/secretmanager v1.10.0/go.mod h1:MfnrdvKMPNra9aZtQFvBcvRU54hbPD8/HayQdlUgJpU= +cloud.google.com/go/security v1.5.0/go.mod h1:lgxGdyOKKjHL4YG3/YwIL2zLqMFCKs0UbQwgyZmfJl4= +cloud.google.com/go/security v1.7.0/go.mod h1:mZklORHl6Bg7CNnnjLH//0UlAlaXqiG7Lb9PsPXLfD0= +cloud.google.com/go/security v1.8.0/go.mod h1:hAQOwgmaHhztFhiQ41CjDODdWP0+AE1B3sX4OFlq+GU= +cloud.google.com/go/security v1.9.0/go.mod h1:6Ta1bO8LXI89nZnmnsZGp9lVoVWXqsVbIq/t9dzI+2Q= +cloud.google.com/go/security v1.10.0/go.mod h1:QtOMZByJVlibUT2h9afNDWRZ1G96gVywH8T5GUSb9IA= +cloud.google.com/go/security v1.12.0/go.mod h1:rV6EhrpbNHrrxqlvW0BWAIawFWq3X90SduMJdFwtLB8= +cloud.google.com/go/security v1.13.0/go.mod h1:Q1Nvxl1PAgmeW0y3HTt54JYIvUdtcpYKVfIB8AOMZ+0= +cloud.google.com/go/securitycenter v1.13.0/go.mod h1:cv5qNAqjY84FCN6Y9z28WlkKXyWsgLO832YiWwkCWcU= +cloud.google.com/go/securitycenter v1.14.0/go.mod h1:gZLAhtyKv85n52XYWt6RmeBdydyxfPeTrpToDPw4Auc= +cloud.google.com/go/securitycenter v1.15.0/go.mod h1:PeKJ0t8MoFmmXLXWm41JidyzI3PJjd8sXWaVqg43WWk= +cloud.google.com/go/securitycenter v1.16.0/go.mod h1:Q9GMaLQFUD+5ZTabrbujNWLtSLZIZF7SAR0wWECrjdk= +cloud.google.com/go/securitycenter v1.18.1/go.mod h1:0/25gAzCM/9OL9vVx4ChPeM/+DlfGQJDwBy/UC8AKK0= +cloud.google.com/go/securitycenter v1.19.0/go.mod h1:LVLmSg8ZkkyaNy4u7HCIshAngSQ8EcIRREP3xBnyfag= +cloud.google.com/go/servicecontrol v1.4.0/go.mod h1:o0hUSJ1TXJAmi/7fLJAedOovnujSEvjKCAFNXPQ1RaU= +cloud.google.com/go/servicecontrol v1.5.0/go.mod h1:qM0CnXHhyqKVuiZnGKrIurvVImCs8gmqWsDoqe9sU1s= +cloud.google.com/go/servicecontrol v1.10.0/go.mod h1:pQvyvSRh7YzUF2efw7H87V92mxU8FnFDawMClGCNuAA= +cloud.google.com/go/servicecontrol v1.11.0/go.mod h1:kFmTzYzTUIuZs0ycVqRHNaNhgR+UMUpw9n02l/pY+mc= +cloud.google.com/go/servicecontrol v1.11.1/go.mod h1:aSnNNlwEFBY+PWGQ2DoM0JJ/QUXqV5/ZD9DOLB7SnUk= +cloud.google.com/go/servicedirectory v1.4.0/go.mod h1:gH1MUaZCgtP7qQiI+F+A+OpeKF/HQWgtAddhTbhL2bs= +cloud.google.com/go/servicedirectory v1.5.0/go.mod h1:QMKFL0NUySbpZJ1UZs3oFAmdvVxhhxB6eJ/Vlp73dfg= +cloud.google.com/go/servicedirectory v1.6.0/go.mod h1:pUlbnWsLH9c13yGkxCmfumWEPjsRs1RlmJ4pqiNjVL4= +cloud.google.com/go/servicedirectory v1.7.0/go.mod h1:5p/U5oyvgYGYejufvxhgwjL8UVXjkuw7q5XcG10wx1U= +cloud.google.com/go/servicedirectory v1.8.0/go.mod h1:srXodfhY1GFIPvltunswqXpVxFPpZjf8nkKQT7XcXaY= +cloud.google.com/go/servicedirectory v1.9.0/go.mod h1:29je5JjiygNYlmsGz8k6o+OZ8vd4f//bQLtvzkPPT/s= +cloud.google.com/go/servicemanagement v1.4.0/go.mod h1:d8t8MDbezI7Z2R1O/wu8oTggo3BI2GKYbdG4y/SJTco= +cloud.google.com/go/servicemanagement v1.5.0/go.mod h1:XGaCRe57kfqu4+lRxaFEAuqmjzF0r+gWHjWqKqBvKFo= +cloud.google.com/go/servicemanagement v1.6.0/go.mod h1:aWns7EeeCOtGEX4OvZUWCCJONRZeFKiptqKf1D0l/Jc= +cloud.google.com/go/servicemanagement v1.8.0/go.mod h1:MSS2TDlIEQD/fzsSGfCdJItQveu9NXnUniTrq/L8LK4= +cloud.google.com/go/serviceusage v1.3.0/go.mod h1:Hya1cozXM4SeSKTAgGXgj97GlqUvF5JaoXacR1JTP/E= +cloud.google.com/go/serviceusage v1.4.0/go.mod h1:SB4yxXSaYVuUBYUml6qklyONXNLt83U0Rb+CXyhjEeU= +cloud.google.com/go/serviceusage v1.5.0/go.mod h1:w8U1JvqUqwJNPEOTQjrMHkw3IaIFLoLsPLvsE3xueec= +cloud.google.com/go/serviceusage v1.6.0/go.mod h1:R5wwQcbOWsyuOfbP9tGdAnCAc6B9DRwPG1xtWMDeuPA= +cloud.google.com/go/shell v1.3.0/go.mod h1:VZ9HmRjZBsjLGXusm7K5Q5lzzByZmJHf1d0IWHEN5X4= +cloud.google.com/go/shell v1.4.0/go.mod h1:HDxPzZf3GkDdhExzD/gs8Grqk+dmYcEjGShZgYa9URw= +cloud.google.com/go/shell v1.6.0/go.mod h1:oHO8QACS90luWgxP3N9iZVuEiSF84zNyLytb+qE2f9A= +cloud.google.com/go/spanner v1.41.0/go.mod h1:MLYDBJR/dY4Wt7ZaMIQ7rXOTLjYrmxLE/5ve9vFfWos= +cloud.google.com/go/spanner v1.44.0/go.mod h1:G8XIgYdOK+Fbcpbs7p2fiprDw4CaZX63whnSMLVBxjk= +cloud.google.com/go/spanner v1.45.0/go.mod h1:FIws5LowYz8YAE1J8fOS7DJup8ff7xJeetWEo5REA2M= +cloud.google.com/go/speech v1.6.0/go.mod h1:79tcr4FHCimOp56lwC01xnt/WPJZc4v3gzyT7FoBkCM= +cloud.google.com/go/speech v1.7.0/go.mod h1:KptqL+BAQIhMsj1kOP2la5DSEEerPDuOP/2mmkhHhZQ= +cloud.google.com/go/speech v1.8.0/go.mod h1:9bYIl1/tjsAnMgKGHKmBZzXKEkGgtU+MpdDPTE9f7y0= +cloud.google.com/go/speech v1.9.0/go.mod h1:xQ0jTcmnRFFM2RfX/U+rk6FQNUF6DQlydUSyoooSpco= +cloud.google.com/go/speech v1.14.1/go.mod h1:gEosVRPJ9waG7zqqnsHpYTOoAS4KouMRLDFMekpJ0J0= +cloud.google.com/go/speech v1.15.0/go.mod h1:y6oH7GhqCaZANH7+Oe0BhgIogsNInLlz542tg3VqeYI= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= +cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= +cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= +cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= +cloud.google.com/go/storage v1.28.1/go.mod h1:Qnisd4CqDdo6BGs2AD5LLnEsmSQ80wQ5ogcBBKhU86Y= +cloud.google.com/go/storage v1.29.0/go.mod h1:4puEjyTKnku6gfKoTfNOU/W+a9JyuVNxjpS5GBrB8h4= +cloud.google.com/go/storagetransfer v1.5.0/go.mod h1:dxNzUopWy7RQevYFHewchb29POFv3/AaBgnhqzqiK0w= +cloud.google.com/go/storagetransfer v1.6.0/go.mod h1:y77xm4CQV/ZhFZH75PLEXY0ROiS7Gh6pSKrM8dJyg6I= +cloud.google.com/go/storagetransfer v1.7.0/go.mod h1:8Giuj1QNb1kfLAiWM1bN6dHzfdlDAVC9rv9abHot2W4= +cloud.google.com/go/storagetransfer v1.8.0/go.mod h1:JpegsHHU1eXg7lMHkvf+KE5XDJ7EQu0GwNJbbVGanEw= +cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= +cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= +cloud.google.com/go/talent v1.3.0/go.mod h1:CmcxwJ/PKfRgd1pBjQgU6W3YBwiewmUzQYH5HHmSCmM= +cloud.google.com/go/talent v1.4.0/go.mod h1:ezFtAgVuRf8jRsvyE6EwmbTK5LKciD4KVnHuDEFmOOA= +cloud.google.com/go/talent v1.5.0/go.mod h1:G+ODMj9bsasAEJkQSzO2uHQWXHHXUomArjWQQYkqK6c= +cloud.google.com/go/texttospeech v1.4.0/go.mod h1:FX8HQHA6sEpJ7rCMSfXuzBcysDAuWusNNNvN9FELDd8= +cloud.google.com/go/texttospeech v1.5.0/go.mod h1:oKPLhR4n4ZdQqWKURdwxMy0uiTS1xU161C8W57Wkea4= +cloud.google.com/go/texttospeech v1.6.0/go.mod h1:YmwmFT8pj1aBblQOI3TfKmwibnsfvhIBzPXcW4EBovc= +cloud.google.com/go/tpu v1.3.0/go.mod h1:aJIManG0o20tfDQlRIej44FcwGGl/cD0oiRyMKG19IQ= +cloud.google.com/go/tpu v1.4.0/go.mod h1:mjZaX8p0VBgllCzF6wcU2ovUXN9TONFLd7iz227X2Xg= +cloud.google.com/go/tpu v1.5.0/go.mod h1:8zVo1rYDFuW2l4yZVY0R0fb/v44xLh3llq7RuV61fPM= +cloud.google.com/go/trace v1.3.0/go.mod h1:FFUE83d9Ca57C+K8rDl/Ih8LwOzWIV1krKgxg6N0G28= +cloud.google.com/go/trace v1.4.0/go.mod h1:UG0v8UBqzusp+z63o7FK74SdFE+AXpCLdFb1rshXG+Y= +cloud.google.com/go/trace v1.8.0/go.mod h1:zH7vcsbAhklH8hWFig58HvxcxyQbaIqMarMg9hn5ECA= +cloud.google.com/go/trace v1.9.0/go.mod h1:lOQqpE5IaWY0Ixg7/r2SjixMuc6lfTFeO4QGM4dQWOk= +cloud.google.com/go/translate v1.3.0/go.mod h1:gzMUwRjvOqj5i69y/LYLd8RrNQk+hOmIXTi9+nb3Djs= +cloud.google.com/go/translate v1.4.0/go.mod h1:06Dn/ppvLD6WvA5Rhdp029IX2Mi3Mn7fpMRLPvXT5Wg= +cloud.google.com/go/translate v1.5.0/go.mod h1:29YDSYveqqpA1CQFD7NQuP49xymq17RXNaUDdc0mNu0= +cloud.google.com/go/translate v1.6.0/go.mod h1:lMGRudH1pu7I3n3PETiOB2507gf3HnfLV8qlkHZEyos= +cloud.google.com/go/translate v1.7.0/go.mod h1:lMGRudH1pu7I3n3PETiOB2507gf3HnfLV8qlkHZEyos= +cloud.google.com/go/video v1.8.0/go.mod h1:sTzKFc0bUSByE8Yoh8X0mn8bMymItVGPfTuUBUyRgxk= +cloud.google.com/go/video v1.9.0/go.mod h1:0RhNKFRF5v92f8dQt0yhaHrEuH95m068JYOvLZYnJSw= +cloud.google.com/go/video v1.12.0/go.mod h1:MLQew95eTuaNDEGriQdcYn0dTwf9oWiA4uYebxM5kdg= +cloud.google.com/go/video v1.13.0/go.mod h1:ulzkYlYgCp15N2AokzKjy7MQ9ejuynOJdf1tR5lGthk= +cloud.google.com/go/video v1.14.0/go.mod h1:SkgaXwT+lIIAKqWAJfktHT/RbgjSuY6DobxEp0C5yTQ= +cloud.google.com/go/video v1.15.0/go.mod h1:SkgaXwT+lIIAKqWAJfktHT/RbgjSuY6DobxEp0C5yTQ= +cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= +cloud.google.com/go/videointelligence v1.7.0/go.mod h1:k8pI/1wAhjznARtVT9U1llUaFNPh7muw8QyOUpavru4= +cloud.google.com/go/videointelligence v1.8.0/go.mod h1:dIcCn4gVDdS7yte/w+koiXn5dWVplOZkE+xwG9FgK+M= +cloud.google.com/go/videointelligence v1.9.0/go.mod h1:29lVRMPDYHikk3v8EdPSaL8Ku+eMzDljjuvRs105XoU= +cloud.google.com/go/videointelligence v1.10.0/go.mod h1:LHZngX1liVtUhZvi2uNS0VQuOzNi2TkY1OakiuoUOjU= +cloud.google.com/go/vision v1.2.0/go.mod h1:SmNwgObm5DpFBme2xpyOyasvBc1aPdjvMk2bBk0tKD0= +cloud.google.com/go/vision/v2 v2.2.0/go.mod h1:uCdV4PpN1S0jyCyq8sIM42v2Y6zOLkZs+4R9LrGYwFo= +cloud.google.com/go/vision/v2 v2.3.0/go.mod h1:UO61abBx9QRMFkNBbf1D8B1LXdS2cGiiCRx0vSpZoUo= +cloud.google.com/go/vision/v2 v2.4.0/go.mod h1:VtI579ll9RpVTrdKdkMzckdnwMyX2JILb+MhPqRbPsY= +cloud.google.com/go/vision/v2 v2.5.0/go.mod h1:MmaezXOOE+IWa+cS7OhRRLK2cNv1ZL98zhqFFZaaH2E= +cloud.google.com/go/vision/v2 v2.6.0/go.mod h1:158Hes0MvOS9Z/bDMSFpjwsUrZ5fPrdwuyyvKSGAGMY= +cloud.google.com/go/vision/v2 v2.7.0/go.mod h1:H89VysHy21avemp6xcf9b9JvZHVehWbET0uT/bcuY/0= +cloud.google.com/go/vmmigration v1.2.0/go.mod h1:IRf0o7myyWFSmVR1ItrBSFLFD/rJkfDCUTO4vLlJvsE= +cloud.google.com/go/vmmigration v1.3.0/go.mod h1:oGJ6ZgGPQOFdjHuocGcLqX4lc98YQ7Ygq8YQwHh9A7g= +cloud.google.com/go/vmmigration v1.5.0/go.mod h1:E4YQ8q7/4W9gobHjQg4JJSgXXSgY21nA5r8swQV+Xxc= +cloud.google.com/go/vmmigration v1.6.0/go.mod h1:bopQ/g4z+8qXzichC7GW1w2MjbErL54rk3/C843CjfY= +cloud.google.com/go/vmwareengine v0.1.0/go.mod h1:RsdNEf/8UDvKllXhMz5J40XxDrNJNN4sagiox+OI208= +cloud.google.com/go/vmwareengine v0.2.2/go.mod h1:sKdctNJxb3KLZkE/6Oui94iw/xs9PRNC2wnNLXsHvH8= +cloud.google.com/go/vmwareengine v0.3.0/go.mod h1:wvoyMvNWdIzxMYSpH/R7y2h5h3WFkx6d+1TIsP39WGY= +cloud.google.com/go/vpcaccess v1.4.0/go.mod h1:aQHVbTWDYUR1EbTApSVvMq1EnT57ppDmQzZ3imqIk4w= +cloud.google.com/go/vpcaccess v1.5.0/go.mod h1:drmg4HLk9NkZpGfCmZ3Tz0Bwnm2+DKqViEpeEpOq0m8= +cloud.google.com/go/vpcaccess v1.6.0/go.mod h1:wX2ILaNhe7TlVa4vC5xce1bCnqE3AeH27RV31lnmZes= +cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xXZmFiHmGE= +cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= +cloud.google.com/go/webrisk v1.6.0/go.mod h1:65sW9V9rOosnc9ZY7A7jsy1zoHS5W9IAXv6dGqhMQMc= +cloud.google.com/go/webrisk v1.7.0/go.mod h1:mVMHgEYH0r337nmt1JyLthzMr6YxwN1aAIEc2fTcq7A= +cloud.google.com/go/webrisk v1.8.0/go.mod h1:oJPDuamzHXgUc+b8SiHRcVInZQuybnvEW72PqTc7sSg= +cloud.google.com/go/websecurityscanner v1.3.0/go.mod h1:uImdKm2wyeXQevQJXeh8Uun/Ym1VqworNDlBXQevGMo= +cloud.google.com/go/websecurityscanner v1.4.0/go.mod h1:ebit/Fp0a+FWu5j4JOmJEV8S8CzdTkAS77oDsiSqYWQ= +cloud.google.com/go/websecurityscanner v1.5.0/go.mod h1:Y6xdCPy81yi0SQnDY1xdNTNpfY1oAgXUlcfN3B3eSng= +cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= +cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= +cloud.google.com/go/workflows v1.8.0/go.mod h1:ysGhmEajwZxGn1OhGOGKsTXc5PyxOc0vfKf5Af+to4M= +cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT3ujaO/WwSA= +cloud.google.com/go/workflows v1.10.0/go.mod h1:fZ8LmRmZQWacon9UCX1r/g/DfAXx5VcPALq2CxzdePw= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +entgo.io/contrib v0.4.5 h1:BFaOHwFLE8WZjVJadP0XHCIaxgcC1BAtUvAyw7M/GHk= +entgo.io/contrib v0.4.5/go.mod h1:wpZyq2DJgthugFvDBlaqMXj9mV4/9ebyGEn7xlTVQqE= +entgo.io/ent v0.12.4 h1:LddPnAyxls/O7DTXZvUGDj0NZIdGSu317+aoNLJWbD8= +entgo.io/ent v0.12.4/go.mod h1:Y3JVAjtlIk8xVZYSn3t3mf8xlZIn5SAOXZQxD6kKI+Q= +entgo.io/ent v0.12.5 h1:KREM5E4CSoej4zeGa88Ou/gfturAnpUv0mzAjch1sj4= +entgo.io/ent v0.12.5/go.mod h1:Y3JVAjtlIk8xVZYSn3t3mf8xlZIn5SAOXZQxD6kKI+Q= +gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= +git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= +github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= +github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible h1:1G1pk05UrOh0NlF1oeaaix1x8XzrfjIDK47TY0Zehcw= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= +github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/Netflix/go-env v0.0.0-20220526054621-78278af1949d h1:wvStE9wLpws31NiWUx+38wny1msZ/tm+eL5xmm4Y7So= +github.com/Netflix/go-env v0.0.0-20220526054621-78278af1949d/go.mod h1:9XMFaCeRyW7fC9XJOWQ+NdAv8VLG7ys7l3x4ozEGLUQ= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/OneOfOne/xxhash v1.2.8 h1:31czK/TI9sNkxIKfaUfGlU47BAxQ0ztGgd9vPyqimf8= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= +github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= +github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= +github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8= +github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm/4RlzPXRlREEwqTHAN3T56Bv2ITsFT3gY= +github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= +github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4 h1:iC9YFYKDGEy3n/FtqJnOkZsene9olVspKmkX5A2YBEo= +github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4/go.mod h1:sCavSAvdzOjul4cEqeVtvlSaSScfNsTQ+46HwlTL1hc= +github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.2/go.mod h1:5JHVmnHvGzR2wNdgaW1zDLQG8kOC4Uec8ubkMogW7OQ= +github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.4 h1:7Q2FEyqxeZeIkwYMwRC3uphxV4i7O2eV4ETe21d6lS4= +github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.4/go.mod h1:5JHVmnHvGzR2wNdgaW1zDLQG8kOC4Uec8ubkMogW7OQ= +github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68 h1:NqugFkGxx1TXSh/pBcU00Y6bljgDPaFdh5MUSeJ7e50= +github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68/go.mod h1:6pb/Qy8c+lqua8cFpEy7g39NRRqOWc3rOwAy8m5Y2BY= +github.com/alibabacloud-go/endpoint-util v1.1.0 h1:r/4D3VSw888XGaeNpP994zDUaxdgTSHBbVfZlzf6b5Q= +github.com/alibabacloud-go/endpoint-util v1.1.0/go.mod h1:O5FuCALmCKs2Ff7JFJMudHs0I5EBgecXXxZRyswlEjE= +github.com/alibabacloud-go/openapi-util v0.0.11/go.mod h1:sQuElr4ywwFRlCCberQwKRFhRzIyG4QTP/P4y1CJ6Ws= +github.com/alibabacloud-go/openapi-util v0.1.0 h1:0z75cIULkDrdEhkLWgi9tnLe+KhAFE/r5Pb3312/eAY= +github.com/alibabacloud-go/openapi-util v0.1.0/go.mod h1:sQuElr4ywwFRlCCberQwKRFhRzIyG4QTP/P4y1CJ6Ws= +github.com/alibabacloud-go/sts-20150401/v2 v2.0.1 h1:CevZp0VdG7Q+1J3qwNj+JL7ztKxsL27+tknbdTK9Y6M= +github.com/alibabacloud-go/sts-20150401/v2 v2.0.1/go.mod h1:8wJW1xC4mVcdRXzOvWJYfCCxmvFzZ0VB9iilVjBeWBc= +github.com/alibabacloud-go/tea v1.1.0/go.mod h1:IkGyUSX4Ba1V+k4pCtJUc6jDpZLFph9QMy2VUPTwukg= +github.com/alibabacloud-go/tea v1.1.7/go.mod h1:/tmnEaQMyb4Ky1/5D+SE1BAsa5zj/KeGOFfwYm3N/p4= +github.com/alibabacloud-go/tea v1.1.8/go.mod h1:/tmnEaQMyb4Ky1/5D+SE1BAsa5zj/KeGOFfwYm3N/p4= +github.com/alibabacloud-go/tea v1.1.17/go.mod h1:nXxjm6CIFkBhwW4FQkNrolwbfon8Svy6cujmKFUq98A= +github.com/alibabacloud-go/tea v1.1.19 h1:Xroq0M+pr0mC834Djj3Fl4ZA8+GGoA0i7aWse1vmgf4= +github.com/alibabacloud-go/tea v1.1.19/go.mod h1:nXxjm6CIFkBhwW4FQkNrolwbfon8Svy6cujmKFUq98A= +github.com/alibabacloud-go/tea-utils v1.3.1 h1:iWQeRzRheqCMuiF3+XkfybB3kTgUXkXX+JMrqfLeB2I= +github.com/alibabacloud-go/tea-utils v1.3.1/go.mod h1:EI/o33aBfj3hETm4RLiAxF/ThQdSngxrpF8rKUDJjPE= +github.com/alibabacloud-go/tea-utils/v2 v2.0.0/go.mod h1:U5MTY10WwlquGPS34DOeomUGBB0gXbLueiq5Trwu0C4= +github.com/alibabacloud-go/tea-utils/v2 v2.0.1 h1:K6kwgo+UiYx+/kr6CO0PN5ACZDzE3nnn9d77215AkTs= +github.com/alibabacloud-go/tea-utils/v2 v2.0.1/go.mod h1:U5MTY10WwlquGPS34DOeomUGBB0gXbLueiq5Trwu0C4= +github.com/alibabacloud-go/tea-xml v1.1.2 h1:oLxa7JUXm2EDFzMg+7oRsYc+kutgCVwm+bZlhhmvW5M= +github.com/alibabacloud-go/tea-xml v1.1.2/go.mod h1:Rq08vgCcCAjHyRi/M7xlHKUykZCEtyBy9+DPF6GgEu8= +github.com/aliyun/alibaba-cloud-sdk-go v1.61.18/go.mod h1:v8ESoHo4SyHmuB4b1tJqDHxfTGEciD+yhvOU/5s1Rfk= +github.com/aliyun/alibaba-cloud-sdk-go v1.62.606 h1:+f4pPB4Qa7cc2nVs4VM4XO5KFU5Qijf1MZm0bzsaqgs= +github.com/aliyun/alibaba-cloud-sdk-go v1.62.606/go.mod h1:CJJYa1ZMxjlN/NbXEwmejEnBkhi0DV+Yb3B2lxf+74o= +github.com/aliyun/aliyun-log-go-sdk v0.1.65 h1:F5HsYYTFwkkoEa1h2U0ekELC3+0IXd+zwPBC/2QUOc8= +github.com/aliyun/aliyun-log-go-sdk v0.1.65/go.mod h1:FSKcIjukUy+LeUKhRk13PCO+9gPMTfGsYhFBHQbDqmM= +github.com/aliyun/credentials-go v1.1.2 h1:qU1vwGIBb3UJ8BwunHDRFtAhS6jnQLnde/yk0+Ih2GY= +github.com/aliyun/credentials-go v1.1.2/go.mod h1:ozcZaMR5kLM7pwtCMEpVmQ242suV6qTJya2bDq4X1Tw= +github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= +github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apache/arrow/go/v10 v10.0.1/go.mod h1:YvhnlEePVnBS4+0z3fhPfUy7W1Ikj0Ih0vcRo/gZ1M0= +github.com/apache/arrow/go/v11 v11.0.0/go.mod h1:Eg5OsL5H+e299f7u5ssuXsuHQVEGC4xei5aX110hRiI= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU= +github.com/apolloconfig/agollo/v4 v4.3.1 h1:NHjd7KqOPmTvYwJidISc9MPBRO8m9UNrH3tijcEVNAY= +github.com/apolloconfig/agollo/v4 v4.3.1/go.mod h1:n/7qxpKOTbegygLmO5OKmFWCdy3T+S/zioBGlo457Dk= +github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY= +github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= +github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= +github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= +github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= +github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= +github.com/bool64/dev v0.2.31 h1:OS57EqYaYe2M/2bw9uhDCIFiZZwywKFS/4qMLN6JUmQ= +github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= +github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= +github.com/bsm/ginkgo/v2 v2.7.0/go.mod h1:AiKlXPm7ItEHNc/2+OkrNG4E0ITzojb9/xWzvQ9XZ9w= +github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= +github.com/bsm/gomega v1.26.0/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= +github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= +github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= +github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= +github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= +github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= +github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= +github.com/casbin/casbin/v2 v2.77.2 h1:yQinn/w9x8AswiwqwtrXz93VU48R1aYTXdHEx4RI3jM= +github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= +github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= +github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= +github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g= +github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= +github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= +github.com/clbanning/mxj v1.8.4 h1:HuhwZtbyvyOw+3Z1AowPkU87JkJUSv751ELWaiTpj8I= +github.com/clbanning/mxj/v2 v2.5.5 h1:oT81vUeEiQQ/DcHbzSytRngP6Ky9O+L+0Bw0zSJag9E= +github.com/clbanning/mxj/v2 v2.5.5/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s= +github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58 h1:F1EaeKL/ta07PY/k9Os/UFtwERei2/XzGemhpGnBKNg= +github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k= +github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= +github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= +github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= +github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deckarep/golang-set v1.7.1/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= +github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4= +github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= +github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= +github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= +github.com/envoyproxy/go-control-plane v0.10.3/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34= +github.com/envoyproxy/go-control-plane v0.11.2-0.20230627204322-7d0032219fcb h1:kxNVXsNro/lpR5WD+P1FI/yUHn2G03Glber3k8cQL2Y= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= +github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w= +github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0= +github.com/fluent/fluent-logger-golang v1.9.0 h1:zUdY44CHX2oIUc7VTNZc+4m+ORuO/mldQDA7czhWXEg= +github.com/fluent/fluent-logger-golang v1.9.0/go.mod h1:2/HCT/jTy78yGyeNGQLGQsjF3zzzAuy6Xlk6FCMV5eU= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= +github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= +github.com/frankban/quicktest v1.10.2/go.mod h1:K+q6oSqb0W0Ininfk863uOk1lMy69l/P6txr3mVT54s= +github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-chassis/cari v0.5.1-0.20210823023004-74041d1363c4/go.mod h1:av/19fqwEP4eOC8unL/z67AAbFDwXUCko6SKa4Avrd8= +github.com/go-chassis/cari v0.9.0 h1:skvo2PX8nLyu26CCg7qUMv7yP2DY73GrBW9M5tWj63c= +github.com/go-chassis/cari v0.9.0/go.mod h1:vM13BN0TT505ZKqeJ+hUfzZvfn4nN0vgE6IpBOTWcTc= +github.com/go-chassis/foundation v0.3.0/go.mod h1:2PjwqpVwYEVaAldl5A58a08viH8p27pNeYaiE3ZxOBA= +github.com/go-chassis/foundation v0.4.0 h1:z0xETnSxF+vRXWjoIhOdzt6rywjZ4sB++utEl4YgWEY= +github.com/go-chassis/foundation v0.4.0/go.mod h1:6NsIUaHghTFRGfCBcZN011zl196F6OR5QvD9N+P4oWU= +github.com/go-chassis/openlog v1.1.2/go.mod h1:+eYCADVxWyJkwsFMUBrMxyQlNqW+UUsCxvR2LrYZUaA= +github.com/go-chassis/openlog v1.1.3 h1:XqIOvZ8YPJ9o9lLtLBskQNNWolK5kC6a4Sv7r4s9sZ4= +github.com/go-chassis/openlog v1.1.3/go.mod h1:+eYCADVxWyJkwsFMUBrMxyQlNqW+UUsCxvR2LrYZUaA= +github.com/go-chassis/sc-client v0.7.0 h1:c2LSdbFMuZ3RcbDu7So//kFCzjDCkzdQ0CNKhm8Dy7I= +github.com/go-chassis/sc-client v0.7.0/go.mod h1:DmclCLMhyNpYN42ae0f5AgiF4lTrpG6NyJJgmyAgC+E= +github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/go-errors/errors v1.5.1 h1:ZwEMSLRCapFLflTpT7NKaAc7ukJ8ZPEjzlxt8rPN8bk= +github.com/go-errors/errors v1.5.1/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= +github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= +github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks= +github.com/go-fonts/liberation v0.1.1/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= +github.com/go-fonts/liberation v0.2.0/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= +github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmnUIzUY= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= +github.com/go-kit/kit v0.13.0 h1:OoneCcHKHQ03LfBpoQCUfCluwd2Vt3ohz+kvbJneZAU= +github.com/go-kit/kit v0.13.0/go.mod h1:phqEHMMUbyrCFCTgH48JueqrM3md2HcAZ8N3XE4FKDg= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= +github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +github.com/go-kratos/aegis v0.2.0 h1:dObzCDWn3XVjUkgxyBp6ZeWtx/do0DPZ7LY3yNSJLUQ= +github.com/go-kratos/aegis v0.2.0/go.mod h1:v0R2m73WgEEYB3XYu6aE2WcMwsZkJ/Rzuf5eVccm7bI= +github.com/go-kratos/kratos/contrib/config/apollo/v2 v2.0.0-20231113102135-421dbc7dae0f h1:DUB0mKyaE4P3VVv9xl87xgF6N8FNG983O4X3K+iQhg8= +github.com/go-kratos/kratos/contrib/config/apollo/v2 v2.0.0-20231113102135-421dbc7dae0f/go.mod h1:n0KY0xUCm4jpSGJkB5L3RaDUrerrXkreP9pRBmneCJ8= +github.com/go-kratos/kratos/contrib/config/consul/v2 v2.0.0-20231113102135-421dbc7dae0f h1:T7lkMJWgfDxq/ksCxv7C7RRWs3dfcQ6cUedLzIE0gx8= +github.com/go-kratos/kratos/contrib/config/consul/v2 v2.0.0-20231113102135-421dbc7dae0f/go.mod h1:Cvbnv5LtFSvsqL3RMcEVCL1C+jEH3z190HKLcGU++Bw= +github.com/go-kratos/kratos/contrib/config/etcd/v2 v2.0.0-20231113102135-421dbc7dae0f h1:h7kuNqx7dMLydu9a292sJYxpyhXdnbusZXUfFWb89Uc= +github.com/go-kratos/kratos/contrib/config/etcd/v2 v2.0.0-20231113102135-421dbc7dae0f/go.mod h1:hsHsHQlRG7TZOL2TQSTbtQyAXjO9vomXhWKbh0JxhBI= +github.com/go-kratos/kratos/contrib/config/kubernetes/v2 v2.0.0-20231113102135-421dbc7dae0f h1:xvsOsjSQ1sL1z7Sj/2K38x5BRdXLUSOyzrlzrLX+WnY= +github.com/go-kratos/kratos/contrib/config/kubernetes/v2 v2.0.0-20231113102135-421dbc7dae0f/go.mod h1:Z/0dQAd03JyBzGxffMWXZLK7bEwr3HW5XTRWZLQjX/k= +github.com/go-kratos/kratos/contrib/config/nacos/v2 v2.0.0-20231113102135-421dbc7dae0f h1:UH3aToHZDY8bxiBhTHWWKpmmJ+yWiUFESThu1pLvC7k= +github.com/go-kratos/kratos/contrib/config/nacos/v2 v2.0.0-20231113102135-421dbc7dae0f/go.mod h1:Kp4/yv3839UV+x9BSz4S6GTysWTW1a48iZ9dCAdtY0Q= +github.com/go-kratos/kratos/contrib/log/aliyun/v2 v2.0.0-20231113102135-421dbc7dae0f h1:OCnFCKX5YPnQnGq4SyQVEFpSO9ORJzssNYm+13mIA94= +github.com/go-kratos/kratos/contrib/log/aliyun/v2 v2.0.0-20231113102135-421dbc7dae0f/go.mod h1:aMG0SDGKVIft9KmZ/4GDphUQ7JhmcKcJKX41lqwlKeQ= +github.com/go-kratos/kratos/contrib/log/fluent/v2 v2.0.0-20231113102135-421dbc7dae0f h1:1bXbpYLK5Wi4D33+wSkRmMqYMrOyPOFOvAsszcmp8zM= +github.com/go-kratos/kratos/contrib/log/fluent/v2 v2.0.0-20231113102135-421dbc7dae0f/go.mod h1:AWb3rcduKAKq52cZNDqpsuiqgU1jnfaPbYaARq6d64I= +github.com/go-kratos/kratos/contrib/log/logrus/v2 v2.0.0-20231113102135-421dbc7dae0f h1:oM3tGNalC8PNz6PPdq0fmseNOXm1PTE+/ZifuDKkbKQ= +github.com/go-kratos/kratos/contrib/log/logrus/v2 v2.0.0-20231113102135-421dbc7dae0f/go.mod h1:R9j2EumP07dGeJ60eeUEwUYWPjqCCBbmO4qQLBvSbHI= +github.com/go-kratos/kratos/contrib/log/tencent/v2 v2.0.0-20231113102135-421dbc7dae0f h1:IrWxolztf0kMufYsx4+L94VgNlVWh5MA1GxZNYfXBKw= +github.com/go-kratos/kratos/contrib/log/tencent/v2 v2.0.0-20231113102135-421dbc7dae0f/go.mod h1:aRZ/ZO1WQrgvze/YnAvLGmJFzCeZno800UgnT1iVn2w= +github.com/go-kratos/kratos/contrib/log/zap/v2 v2.0.0-20231113102135-421dbc7dae0f h1:6OW2UMwI8Fyj5Ic+G/rJCzYYqo+mcrjogpYDBEYuL78= +github.com/go-kratos/kratos/contrib/log/zap/v2 v2.0.0-20231113102135-421dbc7dae0f/go.mod h1:5ttYEjvz6+3i40gFjUAybh2oiQ/J/gSPKD2AQPtdOfU= +github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20231113102135-421dbc7dae0f h1:qQyKoNtVBmIpJZjFeLURawQxAYzqL3V+mB0Z2cgTF9s= +github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20231113102135-421dbc7dae0f/go.mod h1:Z0S93CabLk3OdvQUoV1eTnwjHLAY8bZa+oOOU9sLQc8= +github.com/go-kratos/kratos/contrib/registry/etcd/v2 v2.0.0-20231113102135-421dbc7dae0f h1:oGxejFXucth1/SxKFzSsqdYaeOvsHrAxS1oPixXYlUY= +github.com/go-kratos/kratos/contrib/registry/etcd/v2 v2.0.0-20231113102135-421dbc7dae0f/go.mod h1:GA9kKG8JpKHWHSKoW4r4R41J4vKYkGAUuItIOns2Dpk= +github.com/go-kratos/kratos/contrib/registry/eureka/v2 v2.0.0-20231113102135-421dbc7dae0f h1:vncgfaKMUbiCu5dO+x/VP2RiawPAuIrbxmgdI50eZsk= +github.com/go-kratos/kratos/contrib/registry/eureka/v2 v2.0.0-20231113102135-421dbc7dae0f/go.mod h1:463XPS7eqMyTOlXQ0EWEtUTb+qEz1/o/uJGQvZRkIU8= +github.com/go-kratos/kratos/contrib/registry/kubernetes/v2 v2.0.0-20231113102135-421dbc7dae0f h1:Ye1ytj9VmhSoaTTqIcseXa005GPWqsQ+5Qesgy6imGY= +github.com/go-kratos/kratos/contrib/registry/kubernetes/v2 v2.0.0-20231113102135-421dbc7dae0f/go.mod h1:od7Z9zRL0niJCZvfnV/O7aDP7GH78mzhhI9HiJDZtbc= +github.com/go-kratos/kratos/contrib/registry/nacos/v2 v2.0.0-20231113102135-421dbc7dae0f h1:Zpt0hyaCRDFwG+sj42oA1JYuAfBkPYUt7gXeIUvAuUQ= +github.com/go-kratos/kratos/contrib/registry/nacos/v2 v2.0.0-20231113102135-421dbc7dae0f/go.mod h1:Kf3zWQMJaS/9CMVXUh2HRzd7TJYdyRKCHQliigy6kcg= +github.com/go-kratos/kratos/contrib/registry/servicecomb/v2 v2.0.0-20231113102135-421dbc7dae0f h1:1x/1h2W/t4H4TK0mr5Ro38dt7d3m3bUSSC3Vd9G77Mw= +github.com/go-kratos/kratos/contrib/registry/servicecomb/v2 v2.0.0-20231113102135-421dbc7dae0f/go.mod h1:gcy1LisxmjdryM2c/m/JV0jAVo6lmjWB7dkBFneWFVk= +github.com/go-kratos/kratos/contrib/registry/zookeeper/v2 v2.0.0-20231113102135-421dbc7dae0f h1:gdWoCVkgv+T6aK5J7lzvk3BmNJwkZ/SwgomVvha74N0= +github.com/go-kratos/kratos/contrib/registry/zookeeper/v2 v2.0.0-20231113102135-421dbc7dae0f/go.mod h1:oBzToBJr0XA1hJtUYziIgcvsH2bJ9M4vd3TK9Dv8JSA= +github.com/go-kratos/kratos/v2 v2.7.1 h1:PNMUaWxS5ZGDp1EyID5ZosJb1OA/YiHnBxB0yUmocnc= +github.com/go-kratos/kratos/v2 v2.7.1/go.mod h1:CPn82O93OLHjtnbuyOKhAG5TkSvw+mFnL32c4lZFDwU= +github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U= +github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= +github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= +github.com/go-openapi/inflect v0.19.0 h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNPXu/4= +github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonpointer v0.20.0 h1:ESKJdU9ASRfaPNOPRx12IUyA1vn3R9GiE3KYD14BXdQ= +github.com/go-openapi/jsonpointer v0.20.0/go.mod h1:6PGzBjjIIumbLYysB73Klnms1mwnU4G3YHOECG3CedA= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= +github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= +github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= +github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= +github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/form/v4 v4.2.1 h1:HjdRDKO0fftVMU5epjPW2SOREcZ6/wLUzEobqUGJuPw= +github.com/go-playground/form/v4 v4.2.1/go.mod h1:q1a2BY+AQUUzhl6xA/6hBetay6dEIhMHjgvJiGo6K7U= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/validator v9.31.0+incompatible/go.mod h1:yrEkQXlcI+PugkyDjY2bRrL/UBU4f3rvrgkN3V8JEig= +github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= +github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= +github.com/go-zookeeper/zk v1.0.3 h1:7M2kwOsc//9VeeFiPtf+uSJlVpU66x9Ba5+8XK7/TDg= +github.com/go-zookeeper/zk v1.0.3/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= +github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= +github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= +github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= +github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= +github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= +github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= +github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/google/gnostic v0.7.0 h1:d7EpuFp8vVdML+y0JJJYiKeOLjKTdH/GvVkLOBWqJpw= +github.com/google/gnostic v0.7.0/go.mod h1:IAcUyMl6vtC95f60EZ8oXyqTsOersP6HbwjeG7EyDPM= +github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 h1:0VpGH+cDhbDtdcweoyCVsF3fhN8kejK6rFe/2FFX2nU= +github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49/go.mod h1:BkkQ4L1KS1xMt2aWSPStnn55ChGC0DPOn2FQYj+f25M= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= +github.com/google/subcommands v1.2.0 h1:vWQspBTo2nEqTUFita5/KeEWlUL8kQObDFbub/EN9oE= +github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= +github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/wire v0.5.0 h1:I7ELFeVBr3yfPIcc8+MWvrjk+3VjbcSzoXm3JVa+jD8= +github.com/google/wire v0.5.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU= +github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= +github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= +github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= +github.com/googleapis/enterprise-certificate-proxy v0.2.1/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= +github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= +github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= +github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= +github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= +github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= +github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= +github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= +github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= +github.com/googleapis/gax-go/v2 v2.7.1/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= +github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= +github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= +github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w= +github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= +github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= +github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 h1:6UKoz5ujsI55KNpsJH3UwCq3T8kKbZwNZBNPuTTje8U= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1/go.mod h1:YvJ2f6MplWDhfxiUC3KpyTy76kYUZA4W3pTv/wdKQ9Y= +github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= +github.com/hashicorp/consul/api v1.26.1 h1:5oSXOO5fboPZeW5SN+TdGFP/BILDgBm19OrPZ/pICIM= +github.com/hashicorp/consul/api v1.26.1/go.mod h1:B4sQTeaSO16NtynqrAdwOlahJ7IUDZM9cj2420xYL8A= +github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/consul/sdk v0.15.0 h1:2qK9nDrr4tiJKRoxPGhm6B7xJjLVIQqkjiab2M4aKjU= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= +github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= +github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.2.1 h1:zEfKbn2+PDgroKdiOzqiE8rsmLqU2uwi5PB5pBJ3TkI= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/hcl/v2 v2.19.1 h1://i05Jqznmb2EXqa39Nsvyan2o5XyMowW5fnCKW5RPI= +github.com/hashicorp/hcl/v2 v2.19.1/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/memberlist v0.5.0 h1:EtYPN8DpAURiapus508I4n9CzHs2W+8NZGbmmR/prTM= +github.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4mHgHUZ8lrOI0= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY= +github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= +github.com/hibiken/asynq v0.24.1 h1:+5iIEAyA9K/lcSPvx3qoPtsKJeKI5u9aOIvUmSsazEw= +github.com/hibiken/asynq v0.24.1/go.mod h1:u5qVeSbrnfT+vtG5Mq8ZPzQu/BmCKMHvTGb91uy9Tts= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= +github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= +github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= +github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= +github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= +github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= +github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= +github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= +github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= +github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= +github.com/jackc/pgconn v1.14.0/go.mod h1:9mBNlny0UvkgJdCDvdVHYSjI+8tD2rnKK69Wz8ti++E= +github.com/jackc/pgconn v1.14.1 h1:smbxIaZA08n6YuxEX1sDyjV/qkbtUtkH20qLkR9MUR4= +github.com/jackc/pgconn v1.14.1/go.mod h1:9mBNlny0UvkgJdCDvdVHYSjI+8tD2rnKK69Wz8ti++E= +github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= +github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= +github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= +github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= +github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 h1:DadwsjnMwFjfWc9y5Wi/+Zz7xoE5ALHsRQlOctkOiHc= +github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= +github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= +github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.3.2 h1:7eY55bdBeCz1F2fTzSz69QC+pG46jYq9/jtSPiJ5nn0= +github.com/jackc/pgproto3/v2 v2.3.2/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= +github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= +github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= +github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= +github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= +github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= +github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= +github.com/jackc/pgtype v1.14.0 h1:y+xUdabmyMkJLyApYuPj38mW+aAIqCe5uuBB51rH3Vw= +github.com/jackc/pgtype v1.14.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= +github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= +github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= +github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= +github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= +github.com/jackc/pgx/v4 v4.18.1 h1:YP7G1KABtKpB5IHrO9vYwSrCOhs7p3uqhvhhQBptya0= +github.com/jackc/pgx/v4 v4.18.1/go.mod h1:FydWkUyadDmdNH/mHnGob881GawxeEm7TcMCzkb+qQE= +github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.3.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= +github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= +github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= +github.com/karlseguin/ccache/v2 v2.0.8 h1:lT38cE//uyf6KcFok0rlgXtGFBWxkI6h/qg4tbFyDnA= +github.com/karlseguin/ccache/v2 v2.0.8/go.mod h1:2BDThcfQMf/c0jnZowt16eW405XIqZPavt+HoYEtcxQ= +github.com/karlseguin/expect v1.0.2-0.20190806010014-778a5f0c6003 h1:vJ0Snvo+SLMY72r5J4sEfkuE7AFbixEP2qRbEcum/wA= +github.com/karlseguin/expect v1.0.2-0.20190806010014-778a5f0c6003/go.mod h1:zNBxMY8P21owkeogJELCLeHIt+voOSduHYTFUbwRAV8= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= +github.com/klauspost/compress v1.15.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4= +github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc= +github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= +github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= +github.com/lufia/plan9stats v0.0.0-20231016141302-07b5767bb0ed h1:036IscGBfJsFIgJQzlui7nK1Ncm0tp2ktmPj8xO4N/0= +github.com/lufia/plan9stats v0.0.0-20231016141302-07b5767bb0ed/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= +github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= +github.com/lyft/protoc-gen-star v0.6.1/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= +github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= +github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= +github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= +github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= +github.com/miekg/dns v1.1.43 h1:JKfpVSCB84vrAmHzyrsxB5NAr5kLoMXZArPSw7Qlgyg= +github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= +github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE= +github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= +github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= +github.com/minio/minio-go/v7 v7.0.63 h1:GbZ2oCvaUdgT5640WJOpyDhhDxvknAJU2/T3yurwcbQ= +github.com/minio/minio-go/v7 v7.0.63/go.mod h1:Q6X7Qjb7WMhvG65qKf4gUgA5XaiSox74kR1uAEjxRS4= +github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= +github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= +github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/nacos-group/nacos-sdk-go v1.1.4 h1:qyrZ7HTWM4aeymFfqnbgNRERh7TWuER10pCB7ddRcTY= +github.com/nacos-group/nacos-sdk-go v1.1.4/go.mod h1:cBv9wy5iObs7khOqov1ERFQrCuTR4ILpgaiaVMxEmGI= +github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= +github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= +github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= +github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= +github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= +github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +github.com/open-policy-agent/opa v0.57.1 h1:LAa4Z0UkpjV94nRLy6XCvgOacQ6N1jf8TJLMUIzFRqc= +github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= +github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= +github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b h1:FfH+VrHHk6Lxt9HdVS0PXzSXFyS2NbZKXv33FYPol0A= +github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b/go.mod h1:AC62GU6hc0BrNm+9RK9VSiwa/EUe1bkIeFORAMcHvJU= +github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= +github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= +github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/openzipkin/zipkin-go v0.4.2 h1:zjqfqHjUpPmB3c1GlCvvgsM1G4LkvqQbBDueDOCg/jA= +github.com/openzipkin/zipkin-go v0.4.2/go.mod h1:ZeVkFjuuBiSy13y8vpSDCjMi9GoI3hPpCJSBx/EYFhY= +github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= +github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= +github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= +github.com/philhofer/fwd v1.1.2 h1:bnDivRJ1EWPjUIRXV5KfORO897HTbpFAQddBdE8t7Gw= +github.com/philhofer/fwd v1.1.2/go.mod h1:qkPdfjR2SIEbspLqpe1tO4n5yICnr2DY7mqEx2tUTP0= +github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY= +github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= +github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= +github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4 v2.6.0+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM= +github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b h1:0LFwY6Q3gMACTjAbMZBjXAqTOzOwFaj2Ld6cjeQ7Rig= +github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= +github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= +github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= +github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= +github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= +github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= +github.com/redis/go-redis/extra/rediscmd/v9 v9.0.5 h1:EaDatTxkdHG+U3Bk4EUr+DZ7fOGwTfezUiUJMaIcaho= +github.com/redis/go-redis/extra/rediscmd/v9 v9.0.5/go.mod h1:fyalQWdtzDBECAQFBJuQe5bzQ02jGd5Qcbgb97Flm7U= +github.com/redis/go-redis/extra/redisotel/v9 v9.0.5 h1:EfpWLLCyXw8PSM2/XNJLjI3Pb27yVE+gIAfeqp8LUCc= +github.com/redis/go-redis/extra/redisotel/v9 v9.0.5/go.mod h1:WZjPDy7VNzn77AAfnAfVjZNvfJTYfPetfZk5yoSTLaQ= +github.com/redis/go-redis/v9 v9.0.3/go.mod h1:WqMKv5vnQbRuZstUwxQI195wHy+t4PuXDOjzMvcuQHk= +github.com/redis/go-redis/v9 v9.0.5/go.mod h1:WqMKv5vnQbRuZstUwxQI195wHy+t4PuXDOjzMvcuQHk= +github.com/redis/go-redis/v9 v9.3.0 h1:RiVDjmig62jIWp7Kk4XVLs0hzV6pI3PyTnnL0cnn0u0= +github.com/redis/go-redis/v9 v9.3.0/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= +github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= +github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= +github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= +github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= +github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/locafero v0.3.0 h1:zT7VEGWC2DTflmccN/5T1etyKvxSxpHsjb9cJvm4SvQ= +github.com/sagikazarmark/locafero v0.3.0/go.mod h1:w+v7UsPNFwzF1cHuOajOOzoq4U7v/ig1mpRjqV+Bu1U= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= +github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= +github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= +github.com/shirou/gopsutil/v3 v3.23.10 h1:/N42opWlYzegYaVkWejXWJpbzKv2JDy3mrgGzKsh9hM= +github.com/shirou/gopsutil/v3 v3.23.10/go.mod h1:JIE26kpucQi+innVlAUnIEOSBhBUkirr5b44yr55+WE= +github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= +github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= +github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= +github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= +github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= +github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/assertions v1.1.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= +github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/sony/sonyflake v1.2.0 h1:Pfr3A+ejSg+0SPqpoAmQgEtNDAhc2G1SUYk205qVMLQ= +github.com/sony/sonyflake v1.2.0/go.mod h1:LORtCywH/cq10ZbyfhKrHYgAUGH7mOBa76enV9txy/Y= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= +github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= +github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY= +github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= +github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= +github.com/spf13/viper v1.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI= +github.com/spf13/viper v1.17.0/go.mod h1:BmMMMLQXSbcHK6KAOiFLz0l5JHrU89OdIRHvsk0+yVI= +github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= +github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.1 h1:4VhoImhV/Bm0ToFkXFi8hXNXwpDRZ/ynw3amt82mzq0= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/swaggest/swgui v1.7.4 h1:o9FpINbPiiob2WYzBaGO7KXCcM12H7tHlaWTiFiC5NM= +github.com/swaggest/swgui v1.7.4/go.mod h1:FP9uIPTB/QqVs2ZbOD6zc5yTw8SDTJfftak5f4ZRqOQ= +github.com/tchap/go-patricia/v2 v2.3.1 h1:6rQp39lgIYZ+MHmdEq4xzuk1t7OdC35z/xm0BGhTkes= +github.com/tencentcloud/tencentcloud-cls-sdk-go v1.0.6 h1:Gd/0hciMwJ+d/PGyYMk237o0+1TJbNSyld6Dla25OCQ= +github.com/tencentcloud/tencentcloud-cls-sdk-go v1.0.6/go.mod h1:WU+0TXfVbSctEsUUf4KmIKnfr+tknbjcsnx/TrEIPH4= +github.com/tevid/gohamcrest v1.1.1 h1:ou+xSqlIw1xfGTg1uq1nif/htZ2S3EzRqLm2BP+tYU0= +github.com/tevid/gohamcrest v1.1.1/go.mod h1:3UvtWlqm8j5JbwYZh80D/PVBt0mJ1eJiYgZMibh0H/k= +github.com/tidwall/gjson v1.17.0 h1:/Jocvlh98kcTfpN2+JzGQWQcqrPQwDrVEMApx/M5ZwM= +github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= +github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= +github.com/tinylib/msgp v1.1.9 h1:SHf3yoO2sGA0veCJeCBYLHuttAVFHGm2RHgNodW7wQU= +github.com/tinylib/msgp v1.1.9/go.mod h1:BCXGB54lDD8qUEPmiG0cQQUANC4IUQyB2ItS2UDlO/k= +github.com/tjfoc/gmsm v1.3.2 h1:7JVkAn5bvUJ7HtU08iW6UiD+UTmJTIToHCfeFzkcCxM= +github.com/tjfoc/gmsm v1.3.2/go.mod h1:HaUcFuY0auTiaHB9MHFGCPx5IaLhTUd2atbCFBQXn9w= +github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= +github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= +github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= +github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= +github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/tx7do/go-utils v1.1.8 h1:uwNnhXYZWrqrWpQWuWcWBQXvYtDAsotrZYWO+Nv26uE= +github.com/tx7do/go-utils v1.1.8/go.mod h1:8bsPp6A1zeRbjBElfzA6yTMeSLR0Z2U9XZgO/oF9NME= +github.com/tx7do/go-utils/entgo v1.1.10 h1:0dbqMykcY1sGGxXIaKpZEy04CrZJEq7nRhagF1aFUSU= +github.com/tx7do/go-utils/entgo v1.1.10/go.mod h1:BiAq4JuJ8RClEEzbuXxMCcqqQVp+9kPxT08MCQGpoDQ= +github.com/tx7do/go-utils/entgo v1.1.11 h1:WE/RZnUIkdgVtEV2pyhW6YaPjoh30BHNxhFORIi4CMQ= +github.com/tx7do/go-utils/entgo v1.1.11/go.mod h1:BiAq4JuJ8RClEEzbuXxMCcqqQVp+9kPxT08MCQGpoDQ= +github.com/tx7do/kratos-authn v1.0.0 h1:+dLtYDPfk7yT9nLO4qTjsrLO9cHqYVlCXfHf8fVQmBY= +github.com/tx7do/kratos-authn v1.0.0/go.mod h1:iDys5Pfomo9onMENYJRyhGx+TLf3C8EhFViQhXWbowA= +github.com/tx7do/kratos-authn/engine/jwt v1.0.0 h1:GcAkb5/vteUcetcYd/6+BR8iAHOcyMgt1HttCXrqvg8= +github.com/tx7do/kratos-authn/engine/jwt v1.0.0/go.mod h1:vlsEEEGMHlgdtkFep50TwWPrxMIoWWJs4mJFvYrE6Y4= +github.com/tx7do/kratos-authn/middleware v1.0.0 h1:Hcl2t/i4z7H0JLv0MiM1FpGRlqUq7AJLWGAm/qdKQ5c= +github.com/tx7do/kratos-authn/middleware v1.0.0/go.mod h1:Cmvkhq2xTElzGol1ZWPctdQ5hDVJw52Dz3VUjaErgss= +github.com/tx7do/kratos-authz v1.0.0 h1:3lyNInrlhaJ4zhKBPGrK3MpujcqSqXuSRuf6LSwYudA= +github.com/tx7do/kratos-authz v1.0.0/go.mod h1:fVFmqnPHnhqRn6FWImbvSwmZ8F2kdbLGL9SEpetIXOc= +github.com/tx7do/kratos-authz/engine/casbin v1.0.0 h1:40nXTq8DB4HtKy86JHoyZxrCf3E+R0+LV3J90qtnQeE= +github.com/tx7do/kratos-authz/engine/opa v1.0.0 h1:CWG6zU1FuVZOs8ywEAeADwrJXvg6aV20HFx4fYXGXSE= +github.com/tx7do/kratos-authz/middleware v1.0.0 h1:anMwRQkMFalgSaav09bLBaydr+U42vW8HuG+ragYEZ4= +github.com/tx7do/kratos-authz/middleware v1.0.0/go.mod h1:TuQUExwkTXuVOfPTlR5FPKrzGMyvPf5vQjPjt9k6qzo= +github.com/tx7do/kratos-bootstrap v0.2.21 h1:bfU+rqJfWjksZ6aBxUQn9VGqwH4emwFq5xAqpthHaNM= +github.com/tx7do/kratos-bootstrap v0.2.21/go.mod h1:RycM3d+WiW2rFCFX1LmV2kViE4HnfDv7K0qetAqTTwA= +github.com/tx7do/kratos-swagger-ui v0.0.0-20231027101037-78256951ad49 h1:nLkwxRN9+NgWrdPK3U/c+JEVd/BwZN9khy5s/OQlS1c= +github.com/tx7do/kratos-swagger-ui v0.0.0-20231027101037-78256951ad49/go.mod h1:tj6nv6I/pLGNcqUyZhIG6X/Lxjhiv3K9xyHXXO1rTvc= +github.com/tx7do/kratos-transport v1.1.1 h1:qoLu7PkArqBKa1NfM0rSMva45XeMl1kv+Xn6st8xt+Y= +github.com/tx7do/kratos-transport v1.1.1/go.mod h1:iYzVWI3MKIEj9o1SRrEankN9plu6vFIOd2/LtPhsdrs= +github.com/tx7do/kratos-transport/transport/asynq v1.2.2 h1:FunPxuv71xfvQhuWpDL6TKjJVILeW9ohTWQW/po18dk= +github.com/tx7do/kratos-transport/transport/asynq v1.2.2/go.mod h1:wRy8ffRjTC237s9UH5GtCz+VXVFa+qWIpAeTBmoKyHE= +github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o= +github.com/uber/jaeger-client-go v2.30.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= +github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg= +github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/vearutop/statigz v1.4.0 h1:RQL0KG3j/uyA/PFpHeZ/L6l2ta920/MxlOAIGEOuwmU= +github.com/vearutop/statigz v1.4.0/go.mod h1:LYTolBLiz9oJISwiVKnOQoIwhO1LWX1A7OECawGS8XE= +github.com/wsxiaoys/terminal v0.0.0-20160513160801-0940f3fc43a0 h1:3UeQBvD0TFrlVjOeLOBz+CPAI8dnbqNSVwUwRrkp7vQ= +github.com/wsxiaoys/terminal v0.0.0-20160513160801-0940f3fc43a0/go.mod h1:IXCdmsXIht47RaVFLEdVnh1t+pgYtTAhQGj73kz+2DM= +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= +github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= +github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/yashtewari/glob-intersection v0.2.0 h1:8iuHdN88yYuCzCdjt0gDe+6bAhUwBeEWqThExu54RFg= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.30/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= +github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +github.com/zclconf/go-cty v1.14.1 h1:t9fyA35fwjjUMcmL5hLER+e/rEPqrbCK1/OSE4SI9KA= +github.com/zclconf/go-cty v1.14.1/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= +github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= +github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= +go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/api/v3 v3.5.10 h1:szRajuUUbLyppkhs9K6BRtjY37l66XQQmw7oZRANE4k= +go.etcd.io/etcd/api/v3 v3.5.10/go.mod h1:TidfmT4Uycad3NM/o25fG3J07odo4GBB9hoxaodFCtI= +go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/pkg/v3 v3.5.10 h1:kfYIdQftBnbAq8pUWFXfpuuxFSKzlmM5cSn76JByiT0= +go.etcd.io/etcd/client/pkg/v3 v3.5.10/go.mod h1:DYivfIviIuQ8+/lCq4vcxuseg2P2XbHygkKwFo9fc8U= +go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= +go.etcd.io/etcd/client/v3 v3.5.10 h1:W9TXNZ+oB3MCd/8UjxHTWK5J9Nquw9fQBLJd5ne5/Ao= +go.etcd.io/etcd/client/v3 v3.5.10/go.mod h1:RVeBnDz2PUEZqTpgqwAtUd8nAPf5kjyFyND7P1VkOKc= +go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/otel v1.20.0 h1:vsb/ggIY+hUjD/zCAQHpzTmndPqv/ml2ArbsbfBYTAc= +go.opentelemetry.io/otel v1.20.0/go.mod h1:oUIGj3D77RwJdM6PPZImDpSZGDvkD9fhesHny69JFrs= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0 h1:DeFD0VgTZ+Cj6hxravYYZE2W4GlneVH81iAOPjZkzk8= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0/go.mod h1:GijYcYmNpX1KazD5JmWGsi4P7dDTTTnfv1UbGn84MnU= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0 h1:gvmNvqrPYovvyRmCSygkUDyL8lC5Tl845MLEwqpxhEU= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0/go.mod h1:vNUq47TGFioo+ffTSnKNdob241vePmtNZnAODKapKd0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.20.0 h1:CsBiKCiQPdSjS+MlRiqeTI9JDDpSuk0Hb6QTRfwer8k= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.20.0/go.mod h1:CMJYNAfooOwSZSAmAeMUV1M+TXld3BiK++z9fqIm2xk= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.20.0 h1:4s9HxB4azeeQkhY0GE5wZlMj4/pz8tE5gx2OQpGUw58= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.20.0/go.mod h1:djVA3TUJ2fSdMX0JE5XxFBOaZzprElJoP7fD4vnV2SU= +go.opentelemetry.io/otel/exporters/zipkin v1.20.0 h1:fD/wt+mqtpl048RxUyUkdXRfFqOjsJYG7K7KUC+GNuc= +go.opentelemetry.io/otel/exporters/zipkin v1.20.0/go.mod h1:KktoRB60WLnDCAasFr9X62W+B06RJykJvo0E5gLLt+Q= +go.opentelemetry.io/otel/metric v1.20.0 h1:ZlrO8Hu9+GAhnepmRGhSU7/VkpjrNowxRN9GyKR4wzA= +go.opentelemetry.io/otel/metric v1.20.0/go.mod h1:90DRw3nfK4D7Sm/75yQ00gTJxtkBxX+wu6YaNymbpVM= +go.opentelemetry.io/otel/sdk v1.20.0 h1:5Jf6imeFZlZtKv9Qbo6qt2ZkmWtdWx/wzcCbNUlAWGM= +go.opentelemetry.io/otel/sdk v1.20.0/go.mod h1:rmkSx1cZCm/tn16iWDn1GQbLtsW/LvsdEEFzCSRM6V0= +go.opentelemetry.io/otel/trace v1.20.0 h1:+yxVAPZPbQhbC3OfAkeIVTky6iTFpcr4SiY9om7mXSQ= +go.opentelemetry.io/otel/trace v1.20.0/go.mod h1:HJSK7F/hA5RlzpZ0zKDCHCDHm556LCDtKaAo6JmBFUU= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= +go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= +go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= +go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= +go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= +go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191219195013-becbf705a915/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= +golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= +golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= +golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= +golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ= +golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE= +golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/image v0.0.0-20220302094943-723b81ca9867/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= +golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= +golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= +golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= +golang.org/x/oauth2 v0.14.0 h1:P0Vrf/2538nmC0H+pEQ3MNFRRnVR7RlqyVw+bvm26z0= +golang.org/x/oauth2 v0.14.0/go.mod h1:lAtNWgaWfL4cm7j2OV8TxGi9Qb7ECORx8DktCY74OwM= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200509044756-6aff5f38e54f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= +golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.14.0 h1:LGK9IlZ8T9jvdy6cTdfKUCltatMFOehAQo9SRC46UQ8= +golang.org/x/term v0.14.0/go.mod h1:TySc+nGkYR6qt8km8wUhuFRTVSMIX3XPR58y2lC8vww= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20220922220347-f3bd1da661af/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.4.0 h1:Z81tqI5ddIoXDPvVQ7/7CC9TnLM7ubaFG2qXYd5BbYY= +golang.org/x/time v0.4.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.15.0 h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8= +golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk= +golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= +gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= +gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0= +gonum.org/v1/gonum v0.11.0/go.mod h1:fSG4YDCxxUZQJ7rKsQrj0gMOg00Il0Z96/qMA4bVQhA= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= +gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY= +gonum.org/v1/plot v0.10.1/go.mod h1:VZW5OlhkL1mysU9vaqNHnsy86inf6Ot+jB3r+BczCEo= +google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= +google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= +google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= +google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= +google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= +google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= +google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= +google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= +google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= +google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= +google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= +google.golang.org/api v0.77.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= +google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= +google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= +google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= +google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= +google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI= +google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.99.0/go.mod h1:1YOf74vkVndF7pG6hIHuINsM7eWwpVTAfNMNiL91A08= +google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= +google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo= +google.golang.org/api v0.103.0/go.mod h1:hGtW6nK1AC+d9si/UBhw8Xli+QMOf6xyNAyJw4qU9w0= +google.golang.org/api v0.106.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= +google.golang.org/api v0.107.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= +google.golang.org/api v0.108.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= +google.golang.org/api v0.110.0/go.mod h1:7FC4Vvx1Mooxh8C5HWjzZHcavuS2f6pmJpZx60ca7iI= +google.golang.org/api v0.111.0/go.mod h1:qtFHvU9mhgTJegR31csQ+rwxyUTHOKFqCKWp1J0fdw0= +google.golang.org/api v0.114.0/go.mod h1:ifYI2ZsFK6/uGddGfAD5BMxlnkBqCmqHSDUVi45N5Yg= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= +google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= +google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220722212130-b98a9ff5e252/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= +google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220817144833-d7fd3f11b9b1/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220829144015-23454907ede3/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220829175752-36a9c930ecbf/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220913154956-18f8339a66a5/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220914142337-ca0e39ece12f/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220916172020-2692e8806bfa/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220919141832-68c03719ef51/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006/go.mod h1:ht8XFiar2npT/g4vkk7O0WYS1sHOHbdujxbEp7CJWbw= +google.golang.org/genproto v0.0.0-20220926165614-551eb538f295/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= +google.golang.org/genproto v0.0.0-20220926220553-6981cbe3cfce/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= +google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqwhZAwq4wsRUaVG555sVgsNmIjRtO7t/JH29U= +google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= +google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= +google.golang.org/genproto v0.0.0-20221024153911-1573dae28c9c/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= +google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= +google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo= +google.golang.org/genproto v0.0.0-20221109142239-94d6d90a7d66/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221117204609-8f9c96812029/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221201204527-e3fa12d562f3/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd/go.mod h1:cTsE614GARnxrLsqKREzmNYJACSWWpAWdNMwnD7c2BE= +google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230112194545-e10362b5ecf9/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230113154510-dbe35b8444a5/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230123190316-2c411cf9d197/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230124163310-31e0e69b6fc2/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230125152338-dcaf20b6aeaa/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230127162408-596548ed4efa/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230209215440-0dfe4f8abfcc/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230216225411-c8e22ba71e44/go.mod h1:8B0gmkoRebU8ukX6HP+4wrVQUY1+6PkQ44BSyIlflHA= +google.golang.org/genproto v0.0.0-20230222225845-10f96fb3dbec/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw= +google.golang.org/genproto v0.0.0-20230223222841-637eb2293923/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw= +google.golang.org/genproto v0.0.0-20230303212802-e74f57abe488/go.mod h1:TvhZT5f700eVlTNwND1xoEZQeWTB2RY/65kplwl/bFA= +google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= +google.golang.org/genproto v0.0.0-20230320184635-7606e756e683/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= +google.golang.org/genproto v0.0.0-20230323212658-478b75c54725/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= +google.golang.org/genproto v0.0.0-20230330154414-c0448cd141ea/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= +google.golang.org/genproto v0.0.0-20230331144136-dcfb400f0633/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= +google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY= +google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54/go.mod h1:zqTuNwFlFRsw5zIts5VnzLQxSRqh+CGOTVMlYbY0Eyk= +google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 h1:wpZ8pe2x1Q3f2KyT5f8oP/fa9rHAKgFPr/HZdNuS+PQ= +google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:J7XzRzVy1+IPwWHZUzoD0IccYZIrXILAQpc+Qy9CMhY= +google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= +google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= +google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1:JpwMPBpFN3uKhdaekDpiNlImDdkUAyiJ6ez/uxGaUSo= +google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234015-3fc162c6f38a/go.mod h1:xURIpW9ES5+/GZhnV6beoEtxQrnkRGIfP5VQG2tCBLc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= +google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= +google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= +google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= +google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= +gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.56.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= +gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= +gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= +k8s.io/api v0.28.3 h1:Gj1HtbSdB4P08C8rs9AR94MfSGpRhJgsS+GF9V26xMM= +k8s.io/api v0.28.3/go.mod h1:MRCV/jr1dW87/qJnZ57U5Pak65LGmQVkKTzf3AtKFHc= +k8s.io/apimachinery v0.28.3 h1:B1wYx8txOaCQG0HmYF6nbpU8dg6HvA06x5tEffvOe7A= +k8s.io/apimachinery v0.28.3/go.mod h1:uQTKmIqs+rAYaq+DFaoD2X7pcjLOqbQX2AOiO0nIpb8= +k8s.io/client-go v0.28.3 h1:2OqNb72ZuTZPKCl+4gTKvqao0AMOl9f3o2ijbAj3LI4= +k8s.io/client-go v0.28.3/go.mod h1:LTykbBp9gsA7SwqirlCXBWtK0guzfhpoW4qSm7i9dxo= +k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= +k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= +k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= +k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +modernc.org/cc/v3 v3.36.0/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/cc/v3 v3.36.2/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/cc/v3 v3.36.3/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/ccgo/v3 v3.0.0-20220428102840-41399a37e894/go.mod h1:eI31LL8EwEBKPpNpA4bU1/i+sKOwOrQy8D87zWUcRZc= +modernc.org/ccgo/v3 v3.0.0-20220430103911-bc99d88307be/go.mod h1:bwdAnOoaIt8Ax9YdWGjxWsdkPcZyRPHqrOvJxaKAKGw= +modernc.org/ccgo/v3 v3.16.4/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= +modernc.org/ccgo/v3 v3.16.6/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= +modernc.org/ccgo/v3 v3.16.8/go.mod h1:zNjwkizS+fIFDrDjIAgBSCLkWbJuHF+ar3QRn+Z9aws= +modernc.org/ccgo/v3 v3.16.9/go.mod h1:zNMzC9A9xeNUepy6KuZBbugn3c0Mc9TeiJO4lgvkJDo= +modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= +modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= +modernc.org/libc v0.0.0-20220428101251-2d5f3daf273b/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= +modernc.org/libc v1.16.0/go.mod h1:N4LD6DBE9cf+Dzf9buBlzVJndKr/iJHG97vGLHYnb5A= +modernc.org/libc v1.16.1/go.mod h1:JjJE0eu4yeK7tab2n4S1w8tlWd9MxXLRzheaRnAKymU= +modernc.org/libc v1.16.17/go.mod h1:hYIV5VZczAmGZAnG15Vdngn5HSF5cSkbvfz2B7GRuVU= +modernc.org/libc v1.16.19/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= +modernc.org/libc v1.17.0/go.mod h1:XsgLldpP4aWlPlsjqKRdHPqCxCjISdHfM/yeWC5GyW0= +modernc.org/libc v1.17.1/go.mod h1:FZ23b+8LjxZs7XtFMbSzL/EhPxNbfZbErxEHc7cbD9s= +modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/memory v1.1.1/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= +modernc.org/memory v1.2.0/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= +modernc.org/memory v1.2.1/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= +modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/sqlite v1.18.1/go.mod h1:6ho+Gow7oX5V+OiOQ6Tr4xeqbx13UZ6t+Fw9IRUG4d4= +modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw= +modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= +modernc.org/tcl v1.13.1/go.mod h1:XOLfOwzhkljL4itZkK6T72ckMgvj0BDsnKNdZVUOecw= +modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +modernc.org/z v1.5.1/go.mod h1:eWFB510QWW5Th9YGZT81s+LwvaAs3Q2yr4sP0rmLkv8= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= +sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/monolithic/backend/pkg/README.md b/monolithic/backend/pkg/README.md new file mode 100644 index 0000000..d28623c --- /dev/null +++ b/monolithic/backend/pkg/README.md @@ -0,0 +1 @@ +# common used packages \ No newline at end of file diff --git a/monolithic/backend/pkg/middleware/auth/auth.go b/monolithic/backend/pkg/middleware/auth/auth.go new file mode 100644 index 0000000..d6491b9 --- /dev/null +++ b/monolithic/backend/pkg/middleware/auth/auth.go @@ -0,0 +1,68 @@ +package auth + +import ( + "context" + "strconv" + + "github.com/go-kratos/kratos/v2/middleware" + "github.com/go-kratos/kratos/v2/transport" + + authnEngine "github.com/tx7do/kratos-authn/engine" + authn "github.com/tx7do/kratos-authn/middleware" + + authzEngine "github.com/tx7do/kratos-authz/engine" + authz "github.com/tx7do/kratos-authz/middleware" +) + +var action = authzEngine.Action("ANY") + +// Server 衔接认证和权鉴 +func Server() middleware.Middleware { + return func(handler middleware.Handler) middleware.Handler { + return func(ctx context.Context, req interface{}) (interface{}, error) { + tr, ok := transport.FromServerContext(ctx) + if !ok { + return nil, ErrWrongContext + } + + authnClaims, ok := authn.FromContext(ctx) + if !ok { + return nil, ErrWrongContext + } + + sub := authzEngine.Subject(authnClaims.Subject) + path := authzEngine.Resource(tr.Operation()) + authzClaims := authzEngine.AuthClaims{ + Subject: &sub, + Action: &action, + Resource: &path, + } + + ctx = authz.NewContext(ctx, &authzClaims) + + return handler(ctx, req) + } + } +} + +type Result struct { + UserId uint32 + UserName string +} + +func FromContext(ctx context.Context) (*Result, error) { + claims, ok := authnEngine.AuthClaimsFromContext(ctx) + if !ok { + return nil, ErrMissingJwtToken + } + + userId, err := strconv.ParseUint(claims.Subject, 10, 32) + if err != nil { + return nil, ErrExtractSubjectFailed + } + + return &Result{ + UserId: uint32(userId), + UserName: "", + }, nil +} diff --git a/monolithic/backend/pkg/middleware/auth/errors.go b/monolithic/backend/pkg/middleware/auth/errors.go new file mode 100644 index 0000000..d4ba6c0 --- /dev/null +++ b/monolithic/backend/pkg/middleware/auth/errors.go @@ -0,0 +1,13 @@ +package auth + +import "github.com/go-kratos/kratos/v2/errors" + +const ( + reason string = "UNAUTHORIZED" +) + +var ( + ErrWrongContext = errors.Unauthorized(reason, "wrong context for middleware") + ErrMissingJwtToken = errors.Unauthorized(reason, "no jwt token in context") + ErrExtractSubjectFailed = errors.Unauthorized(reason, "extract subject failed") +) diff --git a/monolithic/backend/pkg/service/name.go b/monolithic/backend/pkg/service/name.go new file mode 100644 index 0000000..f5e6948 --- /dev/null +++ b/monolithic/backend/pkg/service/name.go @@ -0,0 +1,5 @@ +package service + +const ( + AdminService = "kratos-monolithic-demo.admin.gateway" // 后台BFF +) diff --git a/monolithic/backend/script/prepare_centos.sh b/monolithic/backend/script/prepare_centos.sh new file mode 100644 index 0000000..e053234 --- /dev/null +++ b/monolithic/backend/script/prepare_centos.sh @@ -0,0 +1,73 @@ +#!/usr/bin/env bash + +#################################### +## 更新软件源和软件 +#################################### + +sudo yum update; sudo yum upgrade + +#################################### +## 安装工具软件 +#################################### + +sudo yum install epel-release htop wget unzip -y + +#################################### +## 安装PM2 +#################################### + +# 安装nodejs和npm +sudo yum install node npm -y + +node -v +npm -v + +# 安装pm2 +npm install -g pm2 +# 查看pm2的版本 +pm2 --version +# tab补全 +pm2 completion install +# 创建pm2开机启动脚本 +pm2 startup +# 设置pm2的开机启动 +sudo systemctl enable pm2-${USER} + +#################################### +## 安装Golang +#################################### + +latest_version=1.20.1 + +wget https://dl.google.com/go/go$latest_version.linux-amd64.tar.gz + +rm -rf /usr/local/go && tar -C /usr/local -xzf go$latest_version.linux-amd64.tar.gz +rm -fr go$latest_version.linux-amd64.tar.gz + +echo "export GOROOT=/usr/local/go" >> ~/.bashrc +echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc +echo "export GOPATH=~/go" >> ~/.bashrc +source ~/.bashrc + +go version + +#################################### +## 安装Docker +#################################### + +sudo yum remove docker \ + docker-client \ + docker-client-latest \ + docker-common \ + docker-latest \ + docker-latest-logrotate \ + docker-logrotate \ + docker-engine + +sudo yum install -y yum-utils +sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo + +sudo yum install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin +sudo yum install -y docker-compose + +sudo systemctl start docker diff --git a/monolithic/backend/script/prepare_ubuntu.sh b/monolithic/backend/script/prepare_ubuntu.sh new file mode 100644 index 0000000..84dc560 --- /dev/null +++ b/monolithic/backend/script/prepare_ubuntu.sh @@ -0,0 +1,72 @@ +#!/usr/bin/env bash + +#################################### +## 更新软件源和软件 +#################################### + +sudo apt update && sudo apt upgrade + +#################################### +## 安装工具软件 +#################################### + +sudo apt install htop wget unzip -y + +#################################### +## 安装PM2 +#################################### + +# 安装nodejs和npm +sudo apt install nodejs npm -y + +node -v +npm -v + +# 安装pm2 +npm install -g pm2 +# 查看pm2的版本 +pm2 --version +# tab补全 +pm2 completion install +# 创建pm2开机启动脚本 +pm2 startup +# 设置pm2的开机启动 +sudo systemctl enable pm2-${USER} + +#################################### +## 安装Docker +#################################### + +for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done + +sudo apt install -y ca-certificates curl gnupg +sudo install -m 0755 -d /etc/apt/keyrings +curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg +sudo chmod a+r /etc/apt/keyrings/docker.gpg + +echo \ +"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ +"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ +sudo tee /etc/apt/sources.list.d/docker.list > /dev/null + +sudo apt update +sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin +sudo apt install -y docker-compose + +#################################### +## 安装Golang +#################################### + +latest_version=1.20.1 + +wget https://dl.google.com/go/go$latest_version.linux-amd64.tar.gz + +rm -rf /usr/local/go && tar -C /usr/local -xzf go$latest_version.linux-amd64.tar.gz +rm -fr go$latest_version.linux-amd64.tar.gz + +echo "export GOROOT=/usr/local/go" >> ~/.bashrc +echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc +echo "export GOPATH=~/go" >> ~/.bashrc +source ~/.bashrc + +go version diff --git a/monolithic/backend/sql/default-data.sql b/monolithic/backend/sql/default-data.sql new file mode 100644 index 0000000..8906cb4 --- /dev/null +++ b/monolithic/backend/sql/default-data.sql @@ -0,0 +1,4 @@ +-- 默认的超级管理员,默认账号:admin,密码:admin +TRUNCATE TABLE kratos_monolithic.public.user; +INSERT INTO kratos_monolithic.public.user (id, username, nick_name, email, password, authority) +VALUES (1, 'admin', 'admin', 'admin@gmail.com', '$2a$10$yajZDX20Y40FkG0Bu4N19eXNqRizez/S9fK63.JxGkfLq.RoNKR/a', 'SYS_ADMIN'); diff --git a/monolithic/backend/sql/demo-data.sql b/monolithic/backend/sql/demo-data.sql new file mode 100644 index 0000000..d964e8c --- /dev/null +++ b/monolithic/backend/sql/demo-data.sql @@ -0,0 +1,23 @@ +-- 默认的角色 +TRUNCATE TABLE kratos_monolithic.public.role; +INSERT INTO kratos_monolithic.public.role(id, parent_id, create_by, order_no, name, code, status, remark, create_time) +VALUES (1, null, 0, 1, '系统管理员', 'SYS_ADMIN', 'ON', '系统管理员拥有对整个系统的管理权限', now()), + (3, null, 0, 3, '普通用户', 'CUSTOMER_USER', 'ON', '普通用户没有管理权限,只有设备和APP的使用权限', now()), + (4, null, 0, 4, '游客', 'GUEST_USER', 'ON', '游客只有非常有限的数据读取权限', now()); + +-- 后台目录 +TRUNCATE TABLE public.menu; +INSERT INTO public.menu(id, parent_id, order_no, type, name, title, path, redirect, component, icon, status, current_active_menu, keep_alive, is_ext, show, hide_tab, hide_menu, hide_breadcrumb, create_time) +VALUES (1, null, 1, 'FOLDER', 'Dashboard', 'routes.menu.dashboard.index', '/dashboard', '/dashboard/location', 'LAYOUT', 'ant-design:dashboard-outlined', 'ON', null, 'f', 'f', 't', 'f', 'f', 'f', now()), + (2, 1, 2, 'MENU', 'AnalysisViewer', 'routes.menu.dashboard.analysis', 'analysis', null, 'app/dashboard/analysis/index', 'ant-design:bar-chart-outlined', 'ON', null, 'f', 'f', 't', 'f', 'f', 'f', now()), + + (4, null, 4, 'FOLDER', 'AccountManage', 'routes.menu.account.account', '/account', null, 'LAYOUT', 'mdi:account-box', 'ON', null, 'f', 'f', 't', 'f', 't', 'f', now()), + (5, 4, 5, 'MENU', 'AccountSettings', 'routes.menu.dashboard.analysis', 'settings', null, 'app/account/settings/index', 'ant-design:bar-chart-outlined', 'ON', null, 'f', 'f', 't', 'f', 'f', 'f', now()), + + (6, null, 6, 'FOLDER', 'System', 'routes.menu.system.system', '/system', null, 'LAYOUT', 'ion:settings-outline', 'ON', null, 'f', 'f', 't', 'f', 'f', 'f', now()), + (7, 6, 7, 'MENU', 'MenuManagement', 'routes.menu.system.menu', 'menu', null, 'app/system/menu/index', 'ion:menu-outline', 'ON', null, 'f', 'f', 't', 'f', 'f', 'f', now()), + (8, 6, 8, 'MENU', 'RoleManagement', 'routes.menu.system.role', 'role', null, 'app/system/role/index', 'ant-design:team-outlined', 'ON', null, 'f', 'f', 't', 'f', 'f', 'f', now()), + (11, 6, 11, 'MENU', 'OrganizationManagement', 'routes.menu.system.org', 'org', null, 'app/system/org/index', 'ant-design:apartment-outlined', 'ON', null, 'f', 'f', 't', 'f', 'f', 'f', now()), + (12, 6, 12, 'MENU', 'PositionManagement', 'routes.menu.system.position', 'position', null, 'app/system/position/index', 'ion:person-circle-outline', 'ON', null, 'f', 'f', 't', 'f', 'f', 'f', now()), + (13, 6, 13, 'MENU', 'UserManagement', 'routes.menu.system.user', 'users', null, 'app/system/users/index', 'ion:person-outline', 'ON', null, 'f', 'f', 't', 'f', 'f', 'f', now()), + (14, 6, 14, 'MENU', 'UserDetail', 'routes.menu.system.user-detail', 'users/detail/:id', null, 'app/system/users/detail/index', null, 'ON', '/system/user', 't', 'f', 't', 'f', 't', 'f', now()); diff --git a/monolithic/frontend/.editorconfig b/monolithic/frontend/.editorconfig new file mode 100644 index 0000000..dccf841 --- /dev/null +++ b/monolithic/frontend/.editorconfig @@ -0,0 +1,19 @@ +root = true + +[*] +charset=utf-8 +end_of_line=lf +insert_final_newline=true +indent_style=space +indent_size=2 +max_line_length = 100 + +[*.{yml,yaml,json}] +indent_style = space +indent_size = 2 + +[*.md] +trim_trailing_whitespace = false + +[Makefile] +indent_style = tab diff --git a/monolithic/frontend/.env b/monolithic/frontend/.env new file mode 100644 index 0000000..4ae3d07 --- /dev/null +++ b/monolithic/frontend/.env @@ -0,0 +1,8 @@ +# port +VITE_PORT=3100 + +# spa-title +VITE_GLOB_APP_TITLE='Kratos Monolithic Demo' + +# spa shortname +VITE_GLOB_APP_SHORT_NAME=kratos_monolithic_demo diff --git a/monolithic/frontend/.env.development b/monolithic/frontend/.env.development new file mode 100644 index 0000000..e9103b9 --- /dev/null +++ b/monolithic/frontend/.env.development @@ -0,0 +1,18 @@ +# public path +VITE_PUBLIC_PATH=/ + +# Cross-domain proxy, you can configure multiple +# Please note that no line breaks +VITE_PROXY=[["http://localhost:8800"]] + +# Delete console +VITE_DROP_CONSOLE=false + +# Basic interface address SPA +VITE_GLOB_API_URL=http://localhost:7788 + +# File upload address, optional +VITE_GLOB_UPLOAD_URL=/upload + +# Interface prefix +VITE_GLOB_API_URL_PREFIX= diff --git a/monolithic/frontend/.env.production b/monolithic/frontend/.env.production new file mode 100644 index 0000000..63505c6 --- /dev/null +++ b/monolithic/frontend/.env.production @@ -0,0 +1,32 @@ +# public path +VITE_PUBLIC_PATH=/ + +# Delete console +VITE_DROP_CONSOLE=true + +# Whether to enable gzip or brotli compression +# Optional: gzip | brotli | none +# If you need multiple forms, you can use `,` to separate +VITE_BUILD_COMPRESS='none' + +# Whether to delete origin files when using compress, default false +VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE=false + +# Basic interface address SPA +VITE_GLOB_API_URL=http://localhost:8800/admin/v1 + +# File upload address, optional +# It can be forwarded by nginx or write the actual address directly +VITE_GLOB_UPLOAD_URL=/upload + +# Interface prefix +VITE_GLOB_API_URL_PREFIX= + +# Whether to enable image compression +VITE_USE_IMAGEMIN=true + +# use pwa +VITE_USE_PWA=false + +# Is it compatible with older browsers +VITE_LEGACY=false diff --git a/monolithic/frontend/.eslintignore b/monolithic/frontend/.eslintignore new file mode 100644 index 0000000..348631b --- /dev/null +++ b/monolithic/frontend/.eslintignore @@ -0,0 +1,15 @@ + +*.sh +node_modules +*.md +*.woff +*.ttf +.vscode +.idea +dist +/public +/docs +.husky +.local +/bin +Dockerfile diff --git a/monolithic/frontend/.eslintrc.yml b/monolithic/frontend/.eslintrc.yml new file mode 100644 index 0000000..27e5499 --- /dev/null +++ b/monolithic/frontend/.eslintrc.yml @@ -0,0 +1,69 @@ +# @see: http://eslint.cn + +root: true + +env: + browser: true + es6: true + node: true + +# 继承某些已有的规则 +extends: + - plugin:vue/vue3-recommended + - plugin:@typescript-eslint/recommended + - prettier + - plugin:prettier/recommended + +# 通过配置文件 overrides 配置项,可以对一组文件禁用规则 +overrides: [] + +# 指定如何解析语法 +parser: 'vue-eslint-parser' +# 优先级低于 parse 的语法解析配置 +parserOptions: + parser: '@typescript-eslint/parser' + ecmaVersion: 2020 + sourceType: module + jsxPragma: React + ecmaFeatures: + jsx: true + +rules: + # eslint (http://eslint.cn/docs/rules) + no-use-before-define: off # 禁止在 函数/类/变量 定义之前使用它们 + space-before-function-paren: off # 强制在 function的左括号之前使用一致的空格 + "no-var": error # 要求使用 let 或 const 而不是 var + "no-multiple-empty-lines": ["error", { max: 1 }] # 不允许多个空行 + "prefer-const": off # 此规则旨在标记使用 let 关键字声明但在初始分配后从未重新分配的变量,要求使用 const + "no-irregular-whitespace": off # 禁止不规则的空白 + + # typeScript (https://typescript-eslint.io/rules) + "@typescript-eslint/ban-ts-ignore": off # 禁止使用 @ts-ignore + "@typescript-eslint/explicit-function-return-type": off # 不允许对初始化为数字、字符串或布尔值的变量或参数进行显式类型声明 + "@typescript-eslint/no-explicit-any": off # 禁止使用 any 类型 + "@typescript-eslint/no-var-requires": off # 不允许在 import 语句中使用 require 语句 + "@typescript-eslint/no-empty-function": off # 禁止空函数 + "@typescript-eslint/no-use-before-define": off # 禁止在变量定义之前使用它们 + "@typescript-eslint/ban-ts-comment": off # 禁止 @ts- 使用注释或要求在指令后进行描述 + "@typescript-eslint/ban-types": off # 禁止使用特定类型 + "@typescript-eslint/no-non-null-assertion": off # 不允许使用后缀运算符的非空断言(!) + "@typescript-eslint/explicit-module-boundary-types": off # 要求导出函数和类的公共类方法的显式返回和参数类型 + "@typescript-eslint/no-unused-vars": error # 禁止定义未使用的变量 + "@typescript-eslint/no-inferrable-types": off # 可以轻松推断的显式类型可能会增加不必要的冗长 + "@typescript-eslint/no-namespace": off # 禁止使用自定义 TypeScript 模块和命名空间。 + + # vue (https://eslint.vuejs.org/rules) + vue/attributes-order: off # vue api使用顺序,强制执行属性顺序 + vue/one-component-per-file: off # 强制每个组件都应该在自己的文件中 + vue/html-closing-bracket-newline: off # 在标签的右括号之前要求或禁止换行 + vue/max-attributes-per-line: off # 强制每行的最大属性数 + vue/multiline-html-element-content-newline: off # 在多行元素的内容之前和之后需要换行符 + vue/singleline-html-element-content-newline: off # 在单行元素的内容之前和之后需要换行符 + vue/attribute-hyphenation: off # 对模板中的自定义组件强制执行属性命名样式 + vue/require-default-prop: off # 此规则要求为每个 prop 为必填时,必须提供默认值 + vue/require-explicit-emits: off # emits 属性必须包含 $emit() 中的值 + vue/multi-word-component-names: off # 要求组件名称始终为 “-” 连接的单词 + vue/script-setup-uses-vars: error # 防止 +
+ +
+
+ +
+ +
+
<%= title %>
+
+
+
+ + + diff --git a/monolithic/frontend/package.json b/monolithic/frontend/package.json new file mode 100644 index 0000000..1ffca1a --- /dev/null +++ b/monolithic/frontend/package.json @@ -0,0 +1,188 @@ +{ + "name": "kratos-monolithic-demo", + "version": "2.8.0", + "scripts": { + "commit": "czg", + "bootstrap": "pnpm install", + "start": "pnpm run dev", + "serve": "pnpm run dev", + "dev": "vite", + "build": "cross-env NODE_ENV=production vite build && esno ./build/script/postBuild.ts", + "build:test": "cross-env vite build --mode test && esno ./build/script/postBuild.ts", + "build:no-cache": "pnpm clean:cache && pnpm run build", + "report": "cross-env REPORT=true pnpm run build", + "type:check": "vue-tsc --noEmit --skipLibCheck", + "preview": "pnpm run build && vite preview", + "preview:dist": "vite preview", + "log": "conventional-changelog -p angular -i CHANGELOG.md -s", + "clean:cache": "rimraf node_modules/.cache/ && rimraf node_modules/.vite", + "clean:lib": "rimraf node_modules", + "lint:eslint": "eslint --cache --max-warnings 0 \"{src,mock}/**/*.{vue,ts,tsx}\" --fix", + "lint:prettier": "prettier --write \"src/**/*.{js,json,tsx,css,less,scss,vue,html,md}\"", + "lint:stylelint": "stylelint --cache --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/", + "lint:lint-staged": "lint-staged", + "test:unit": "jest", + "test:gzip": "npx http-server dist --cors --gzip -c-1", + "test:br": "npx http-server dist --cors --brotli -c-1", + "reinstall": "rimraf pnpm-lock.yaml && rimraf package.lock.json && rimraf node_modules && npm run bootstrap", + "prepare": "", + "gen:icon": "esno ./build/generate/icon/index.ts", + "openapi": "npx openapi-typescript http://localhost:7788/docs/openapi.yaml --output ./types/openapi.d.ts" + }, + "dependencies": { + "@ant-design/colors": "^6.0.0", + "@ant-design/icons-vue": "^6.1.0", + "@iconify/iconify": "^3.0.0", + "@logicflow/core": "^1.1.26", + "@logicflow/extension": "^1.1.26", + "@vue/runtime-core": "^3.2.39", + "@vue/shared": "^3.2.39", + "@vueuse/core": "^9.2.0", + "@vueuse/shared": "^9.2.0", + "@zxcvbn-ts/core": "^2.0.4", + "ant-design-vue": "^3.2.12", + "axios": "^0.27.2", + "codemirror": "^5.65.2", + "cropperjs": "^1.5.12", + "crypto-js": "^4.1.1", + "dayjs": "^1.11.5", + "echarts": "^5.3.3", + "intro.js": "^6.0.0", + "lodash-es": "^4.17.21", + "mockjs": "^1.1.0", + "nprogress": "^0.2.0", + "openapi-fetch": "^0.8.1", + "path-to-regexp": "^6.2.1", + "pinia": "2.0.22", + "print-js": "^1.6.0", + "qrcode": "^1.5.1", + "qs": "^6.11.0", + "resize-observer-polyfill": "^1.5.1", + "showdown": "^2.1.0", + "sortablejs": "^1.15.0", + "tinymce": "^6.2.0", + "vditor": "^3.8.17", + "vue": "^3.2.39", + "vue-i18n": "^9.2.2", + "vue-json-pretty": "^2.2.2", + "vue-router": "^4.1.5", + "vue-types": "^4.2.1", + "xlsx": "^0.18.5" + }, + "devDependencies": { + "@commitlint/cli": "^17.1.2", + "@commitlint/config-conventional": "^17.1.0", + "@iconify/json": "^2.1.105", + "@purge-icons/generated": "^0.9.0", + "@types/codemirror": "^5.60.5", + "@types/crypto-js": "^4.1.1", + "@types/fs-extra": "^9.0.13", + "@types/inquirer": "^9.0.1", + "@types/intro.js": "^5.1.0", + "@types/lodash-es": "^4.17.6", + "@types/mockjs": "^1.0.6", + "@types/node": "^18.7.16", + "@types/nprogress": "^0.2.0", + "@types/qrcode": "^1.5.0", + "@types/qs": "^6.9.7", + "@types/showdown": "^2.0.0", + "@types/sortablejs": "^1.13.0", + "@typescript-eslint/eslint-plugin": "^5.36.2", + "@typescript-eslint/parser": "^5.36.2", + "@vitejs/plugin-legacy": "^1.8.2", + "@vitejs/plugin-vue": "^2.3.4", + "@vitejs/plugin-vue-jsx": "^1.3.10", + "@vue/compiler-sfc": "^3.2.39", + "@vue/test-utils": "^2.0.2", + "autoprefixer": "^10.4.8", + "conventional-changelog-cli": "^2.2.2", + "cross-env": "^7.0.3", + "cz-git": "^1.3.11", + "czg": "^1.3.11", + "dotenv": "^16.0.2", + "eslint": "8.22.0", + "eslint-config-prettier": "^8.5.0", + "eslint-define-config": "^1.2.5", + "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-vue": "^9.4.0", + "esno": "^0.16.3", + "fs-extra": "^10.1.0", + "husky": "^8.0.1", + "inquirer": "^9.1.1", + "less": "^4.1.3", + "lint-staged": "13.0.3", + "npm-run-all": "^4.1.5", + "openapi-typescript": "^6.7.0", + "openapi-typescript-helpers": "^0.0.4", + "picocolors": "^1.0.0", + "postcss": "^8.4.16", + "postcss-html": "^1.5.0", + "postcss-less": "^6.0.0", + "prettier": "^2.7.1", + "rimraf": "^3.0.2", + "rollup": "^2.79.0", + "rollup-plugin-visualizer": "^5.8.1", + "stylelint": "^14.11.0", + "stylelint-config-prettier": "^9.0.3", + "stylelint-config-recommended": "^9.0.0", + "stylelint-config-recommended-vue": "^1.4.0", + "stylelint-config-standard": "^28.0.0", + "stylelint-order": "^5.0.0", + "terser": "^5.15.0", + "ts-node": "^10.9.1", + "typescript": "^4.8.3", + "vite": "^2.9.15", + "vite-plugin-compression": "^0.5.1", + "vite-plugin-html": "^3.2.0", + "vite-plugin-imagemin": "^0.6.1", + "vite-plugin-mkcert": "^1.9.0", + "vite-plugin-mock": "^2.9.6", + "vite-plugin-purge-icons": "^0.9.0", + "vite-plugin-pwa": "^0.12.7", + "vite-plugin-style-import": "^2.0.0", + "vite-plugin-svg-icons": "^2.0.1", + "vite-plugin-theme": "^0.8.6", + "vite-plugin-vue-setup-extend": "^0.4.0", + "vite-plugin-windicss": "^1.8.8", + "vue-eslint-parser": "^9.1.0", + "vue-tsc": "^0.40.13" + }, + "resolutions": { + "bin-wrapper": "npm:bin-wrapper-china", + "rollup": "^2.56.3", + "gifsicle": "5.2.0" + }, + "license": "MIT", + "engines": { + "node": "^12 || >=14" + }, + "lint-staged": { + "*.{js,jsx,ts,tsx}": [ + "eslint --fix", + "prettier --write" + ], + "{!(package)*.json,*.code-snippets,.!(browserslist)*rc}": [ + "prettier --write--parser json" + ], + "package.json": [ + "prettier --write" + ], + "*.vue": [ + "eslint --fix", + "prettier --write", + "stylelint --fix" + ], + "*.{scss,less,styl,html}": [ + "stylelint --fix", + "prettier --write" + ], + "*.md": [ + "prettier --write" + ] + }, + "config": { + "commitizen": { + "path": "node_modules/cz-git" + } + } +} diff --git a/monolithic/frontend/postcss.config.js b/monolithic/frontend/postcss.config.js new file mode 100644 index 0000000..a47ef4f --- /dev/null +++ b/monolithic/frontend/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + autoprefixer: {}, + }, +}; diff --git a/monolithic/frontend/prettier.config.js b/monolithic/frontend/prettier.config.js new file mode 100644 index 0000000..51f8d01 --- /dev/null +++ b/monolithic/frontend/prettier.config.js @@ -0,0 +1,10 @@ +module.exports = { + printWidth: 100, + semi: true, + vueIndentScriptAndStyle: true, + singleQuote: true, + trailingComma: 'all', + proseWrap: 'never', + htmlWhitespaceSensitivity: 'strict', + endOfLine: 'auto', +}; diff --git a/monolithic/frontend/public/favicon.ico b/monolithic/frontend/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..5d6bf04292ad9f0ee8cb53d2d610536daa09ed21 GIT binary patch literal 4286 zcmbtX4Uko38UD5fY!*q}z32a)-}}G2>?JqcZIK0b5i!|;7}F_1B#|`0bTX4E(#aZi z&_pnD)F{Mq8Oj0;Q3jTgRZyw$2MrC|%p9@+3znZ$-k$e6_wJru_O8nW^X)n3JKueu z=ly?=5M}u9d4m6n_R&J9LWnFDw!|bX-k1OIE>Rb*aO2GX*3>qNme#g%!%A1g)SyDq zf{GxOKWoMPtHt7PEID(5pYRJ+Pl#BRBVwvQ+OSg1x{jmE!e84eh2V7@VpV{ z?$gcGJj>4HU9YBs#S+mcNH6_5Ruu@%3Pd{dSln;thaw`WEyM z;64hrTnb$dLuXQfYv1t@1<&oLVBZl6{(PK*{aCyIPDbl2QmSmyr_3UM;|t_I@N3d8 zollBaL;PFF`-h?j3v2U@!yUiobil}trYD7_r$zyP1#J1DVkF6&b3OT6_fqiIF$&)7 z4)G<2V`M+HffO@EN<2f(gTJBR?Gxa3jQrOQlDql|GA7SppD>4`u3!6|rlzSQ>hj|w zh`qOll@YM_NZ4{Y&P!}-;dd$6^FFX6xQxvUd*+QlAf?hKZCoq)&;JGdju!ag$~<+@tC-ws4uDZ5C#;R#$ZUFX4wwpQsTjakC>>il~+#>$oLuAgF zOUk(xnKS27@YM#upyJCSU93vsVPN#}juBPn;Wt*p^r8w)+RS0pdgd;yhU!G(EA~@v1Ai&gf=(j;bXN zu`FZ3x57Ewv)@m?X0k!+TnO! zE9F=j8B5;weW9#@`~X`z8+MU82Jr-3UaD71&YDelfQY7#N-$l z5@r-1wcFqF3h7h76y}VPT2|lCGK~8YYQQz%66WB;83J9e}b$PkIB46%)M*b**y0g^tvYC|A+gg z`OP2p>IOa8zV73lWZ!r@X^m5ncj!0Zs^>2t{fb30raZ)Bz_9{<$UepWQQD|rC+=Ik zpqEw5UGyZ#nP$7y$bsq@`23!0iQe26#$7b#3i^4wy2$?dCW@oyYt7TqV{0WBj(?+J z3R#z4EpyEJ(Ie#iVhaUNyeRGD!B*UhykG4g{i4f?effQ0Heg}C^10{VE`5Oc!Cu)u za4sE;W%a<{u&E+C6`a zoYR2I_|>@nRoY;}CFFMw(tp^e%!Td3eE1pt$U{%C+dIfw{wNu@ETi~UH-s|)`;2E1 z%xA#p2G&!ke_1o0mVMB2vSRt_Rh$P)@cv`Y1?y|5g)jdz#EHgGse8!>K4v}z|0l3# z-MTWIQD76`u7mvXisn}$4|{qr-vEaXTY0JLhnAcaejI`ODk#>fp7lh|Rdr-~ZzQve6^dOue)_eBmAPFb8Uw zU*udE>fHsMXLNUeST?z3dLO(}59k5t2?-Um%AJ^jk0{BpR)(cVR`}(^Sc5&arJZhSmv(cM7*%xuH zOPFgp*1gA{Bkh7OVD7~?2<8UFQ`nCc?-ckRL_K>7xUn=} ztdsGBZykN+Rb*Uwz07HuPg?LNaO(i(R$x8|tgmB+t`Cx7UUznG8%Xq!_o`x^!1qrJ zFy8IaF@~OB@GJ7R5jisg{o~UuQ!XxRo^;`mWe??`VW!2f@)-J4x&?ONZ_IZPmj`g& zff_f>8Gbh6jPx#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91X`llD1ONa40RR91S^xk503#H8v;Y7PG)Y83RCodHU3+j;)fqqM+eRNjTJZ@8SP-oeu(du$YGwKW?M$nVcGODS znU1Y9bx=VBiz0}M6+#HFKoYWf?e5*Z_w>8b&1{l=+}F3{kM2MB-gCa!`F{8Do$q`n zA>{wR3GV?qkuALQ`uJ>Dj9!UtqfjmVn3qI z$nORnAxu4XWHUR=n7pg5i9do3kZyl+Z&HbN_;5vb$KN zlAXcj<2@TB{g>AhzfRX7()jPoSjkH(X*3^Sq5CJ~lT;(b|AGxrl2SgamU>eTuS;_G zfUts_Cmcw(wq!hsZu^H(HJ zP+!A?5=qV}CxNj5cr{MHG^A}E+kUREClp94T9lib<6=FwQ@kM>7b(wpBU~Kk;SE3M z%dl-QBY(nx#5t#pG5Q22nVn~5P`PNky*xU*i2HKUTr#9Rvh+#r&P7wmz6k@;+C}j# zRSGS_96X0$p)t(z&JDv!E;sb>=P_+DBYQ%CbbAZ0oDma$Y{qaav}a36UyX|!3hS?k z@~hWu;4`i0ahhjBfK-)CY%NmBs7TA{fyOA|bE^2bU?H0xAH05NDcaw%^%t`JoP)IN zd(kVWMTPn3gRZ50KEYhnIA7rn53c98pxc&5!8r%1zMnlWz+IciPFvl*Zl0J|GCt%s zB6Pl@ZES7jdB0;uWLc#-ry#9b9A90p2$fciH_A6T%#u7y$em9{eS&*SsrFnxI?Voa z1`^zzu4z%W9&>QI>~23FX!3B69X$)8q^0#C-egCH9o};WlDbcMeo~Ukc8t%*t3t>< zGsJA`DAG73S4h(@Ht-*%WEb*y zPC%NZ(7(zWLDfAV5_MiV2|DIX2yW)awN0&@quQOx-hwM!b#3w*n7Gc!WQ>z--a0bm zV$Md5Qxd$WWWDxBC+##MtKcBj4{1*mD!o)64+UY2%QeyRa5FldkLACDT_|7O)ngARsMk zQRd7XVppX*6yrQuLn8r(8-1M-sB*HLUWZ|SHkkzhsWwht5|Nk0dnKNnSL$HMoyBAC zy4j-6+lIAgx*yThbV3=+V%mFpD#b`8lJWJt)!cyISe}M(LfRLj{SqLOLbR zHacZ&HaT5>J~-W%dr3SSuhDjR5%5nXcB4^xC+Sc@y6*$!smcV)Sx;bhFnWHjImBFc z<>cevtR({; z!P)%WSe>T?8mld5KOEa$$ZHgkYUA2-3_CyP=J7c}YfIv09Q?kUt^39@8aKn^G_B(x ztzH~oTZkp`nlR-~J7cW8gD!eVW$Um9(N#kG8a%}Iifb-A zHHaFIxY_q}(G;rBQINWhD=(BLDQbDH0`JiaY6xmruRDK_#NSHl1Pa#ddrFva?@q>GphFZ@t610b>=#E45UDeZk1uJC6_Y0eG!qv zk~np4Nj!@|d)(wtOV`j7S-K0}?1)o;x;Wm_922KwTkj9EAqhEZJTB6~n`g2m*kdsx z-w}|)ak>S2N&K{rN6#1PYze`oKe3^+;v=|G zW1m2i2@hRt%B}(uTYd@z9{)p^h*vtL`yein=!|k9a0J;Q`~Au@&s=`E@`CLL&~|ue zZYjEdUX!Ivx~2NG`X!P1s>*j_M|9eG{@q-n7h_^1`QvW~r+<1eBmynputw}V6L!7X zUFTVzpi}l5p--nV{kqe4i332t#s-K4U3;(rB7`RW&4)NPK$=MRch$KrCq(^??!R;Z zjGUVWDSUI^4*($C?URfq)oKrFSg$)ruI&0JW$I-{9A%k?Qmtc#3{NR+VM;hj&m@Dd;pkg%cTY9RW|Ext9-AeP`7;B2@*q(k zG$Y6`NTJ($^#QFgBistDTIW3gcN=OFmAR9jxJvr2vSObZp6*(4Us5EK#`3`UZj*SM z;TzE~NL(S0!$%Kwt%!TYgG3eK}o zbW1PXb$p@I&KfIE3whxW0^&|wU8Viom`nNkSlv!vAD<@2U@QPe=AW4$A}>fSFLHq= z`4gE{IoHZd<(;rW)9@?6ie^e_yr|)539%3co6)EEgdP1Q?1FqeMuUjFAnpEF-)*35 zRz8Kc`WcC874AA)G7K<#LY=QcM4Z=o21Ml`p#w)}$PGCN(z=WV5jjDcc~hiRqkMgu zRFqS#+P4cr?phS#UkGI)Kjo=7jhemCRrOX%|4F!s;q;P`AR;G7eN@{3uZB`g=Mfh> z$%7)g^ZZRm_P{ry0(C5uww-DaFEytle-M!sq=sAjXTc=-R&xr?Q)^*w8{7z9^PI*x zBwu{5=pRH67EUy~yWwx@nO^tG7er(QDUnbiSjZlo73GXN#8nP=M9*kQvWg^Cbqzpw?0`XM43Ul#Of%a*W+|zQ=IMG)$<@g&A zayL35E2|7fkDq9g9SVFh2N9z{3NIO~f`t0LSq*Zi1M+k4!S}A*A#oYSFqhgcmvtk* z<_PJWDs^z?T;P)_h!_PD*OZ3|C#X3s;t|@2Pt20j%II%Pjlt%&Pa$KEny6JJ_Fhk= z^kqv1=3p8dM2vu>FNs681Qzsge~_Q+fm3G(`PH|eD5HCnAr4=tmEIlL zQ6m&0pY_&uj#&wHcpxC|OvrUm6VMAblklgKhF2ekK|1n8NiU;xo%6%_LZVAJLyAS@ zJCBf}#`fKCBUGb}0|axCeh8I6=z$L<^mht9?|?p*VUYBbDYb#ku-@{qe(v;7t@C^W z&O?o~1W)3>Qn3FDr)?i44<=o(3?TqirpvNM$;p4w?IqI4Lo))>wpI!?>vUCqesdJm zCw)xZ0{Wd7n0B}moQJxPc5LO3IZqg;ri48Zq2aSBjuDXbhW4j|ufk*YTB_5DW3twh z0OyU;6d} zO_cMk@*ClUr(Y?WdaTR{tsR=48rKJzDu3+A%)|@t(&aC~G$Ork97so>@*jXQ{4ME3 zmd*t-#LMM+OS~qSy!9uy5vnztU@=V!bGw6`QzYakRX2-njnT$&JKo2Eq?1Y>VI8F; zqMuv+!JKF}e<;h)^*KmxEEnnr2Q8{_&;v$jm&P0-QI!Z99jp-zre6Oigzib;n`fAIYH7HnLt+% zm}%z{lInwKZaV}EsF4EGdUCUPh3q>=dJW41=`uS2PL}u6sta12o01-4F<4M_MX; zi_oLS&Z(}WPFDVm^;PN`Lhe7gPM*@~2Kt;YK{{14=C>Kfz7B+~1x zJdGMP!s`dI@+aLZRAq$TmEL0H+!RQ}*G7+)KK7#Qz9(5NZi1%>%4_M6QDtW7L|Hi@6%97Rc9KrB wye8-)$EM3QFb+%|;3_^K6VC&%0&4pAKS2^|fB`U?S^xk507*qoM6N<$g6lSzX#fBK literal 0 HcmV?d00001 diff --git a/monolithic/frontend/public/resource/img/pwa-192x192.png b/monolithic/frontend/public/resource/img/pwa-192x192.png new file mode 100644 index 0000000000000000000000000000000000000000..00fb815215e1fcb171d1c62fca6c54018663cb72 GIT binary patch literal 12205 zcmcI~Q*b5D6Yj~zHg{tuo1EDG#dfl>?PO!ywl}tQV%xTD8#n)_`*a^~SM_`|JvHCd zbWQbC*L0Y?tQaC39vlDwK$H*{R{X~9|0xXAcdNK=1^o>Wrh+np06=XF{JTEn_n62~ zTu}x9aHjwOd;WF#zzF0RTAF0|2;E0RU{f%vJ@S?+GXaDKTNd*LM%VOzC;| z4X}3Ne;fe-Eb{*;n1mwP^|uk)NkT>hdLIt|2NRhGD**S~gkq>K>->$Q-`f4H|JxY= zQR;>S0MPqN2n#B^u3mJwtXr%6E%}J#T+(PuY3?ev;}A!c4>zOAbAmYc4V}qQM{iRw zlmU6aq@|XOL27CZZBA&z4?R?9Pa-7HR68t3f^_oD z78ar@on8IU;&G3nV`6;C9g|{G7#h9{(xk{4*}v*PZ9=TMW!lZo!N3q17LA@2{O145 zhkWbE6S}f_er5m9(sGI{gNeX@sdJbSudqRq;nfH2P-nB5hRgb`j#07{Je+|g2vg)n zSUpqu!lX2{?E@TMssr2tqejFy?@M;_je93)IRQPC;-eZ8mY?W(0MOLPir=8t=4|3(oGily#QP zlQeop@#-M0Kn^JkK1>c*D%2c02y4z>9kiBXWWzmO%bX&nSWMi%nm@8Qrn~zzd9s(K z&vG&<#-}!|mUF>Yb@#~%{kTtOC@Y%Wh20O}X@Q8Bz#$BH$y;|a-t@cWXFt=083WAw>f6f+lUTKvSjqDgkW2YpB!==~N$>!#KRW|jk zpxM*~@9|F%LgMGRz!b<5YPC^!svjt56-T3?uH_uvveWSf$fu6ypS;-*3vdGu#j3bZ z!&(qNx5Nk5gk!4yx?&~(fm#?_5E03V`%CN7sp4r8-xQ(DguXE)l|E7jL(BCo7TwZ6 zMZC_Me+)?dfQ0DX#J&AK&CJ_$H$pEbG#N+}^y5PzOP9Y1xPaJ8-!7j7LkFnNCr+`( zF@-&A9TnwACF0>lXej>GX4i?m;!(0aSlCgZmVj$_9@ol}A@b=dZ4~=krvbC{ee7Rt z;|hF@w(^XQO+e@ERkSx|=R;N^|EK79F<+9V=6|x8=V{>KI(Gjcl)3}u&hDx{_^Mm%Y0;_!jAK3@Ez_lZzP?< zQ*hHCiDMTS4zQK7EAq`LGq^*I=X>9%-}hxKp0iZ)I#JI7|Jo+uFi@!N_T)@-R^#`m z1Z&^%9J=b5W_GN$TN(O={o$9Mwn)2p;@4T3Z)5jAvyl!d<=ATVc9VJ+4O7WEN;KWY;{}W?Jd|Jh=z= z-d}WSb1Zfqu0JCY4|GRl{_ODAm~qF)EiY~KKei3!aUf!3*lBF2ngE5kU4B&igRbBH zx`zNse7u}$9N)`Ks#$&6lK(FCp7Tw24Ap~x32%=FZcs>}B=eBz?@>ZS+wN}eXOhb^ zf$B+Hu2_GN5@a#h?m6m8Gu>sPZL3ady(*B!bdgOz)AG8Z`D245e%Gtn_-($fS(9K+ za+4igb=t5}pFOAhXV(&&B9)7fjBx^q?ZBI(F)ZZisYa$3UP3=Fucz!6%qsVm|3)*P zl?})#tH?b~CwANiec?SydY!xY2w5r0t`Oh$)N4j^JXJ7W>8dDZG2snfP$STHxcjg2 zw04$(+=b5H^`!2_Z@>d)P^&{OQ%)@@+j$NkdG+&^aBoIe^=v8^Ms$n;KKFb>+@G2; ziX-wU`$1ieCH$4le7hVbb-)k`+5Vtad<5GyPrvL+spiChXU0Hn+SnhYItLQ6IT|kR z4)n&Sf4R9<8G9+grl2sP%U~KbV|cV1E4ofjz3KxwJBG}`9VwK<@CPQ9GdS-x zjX^ad0GE~L>zWDOn&W~t+91bkNQtxg+?Wu(W_qMTMl;0q=^l*Px*UhPpuB~>Pkt|T;A>gYqzS@Mkz=UFm z8+2kXcDUJ)xukXvyK*W%bbh^)Dpjr!Z*e8`%MP8w7FmiESC(d&ywWhd52#?OEUVI8 zI%G|ti{^f_{@?WvHf~)Ox%aJyLNu=c6r)V z+5Tp9J4%&7z+c)+Pd|P2R>qT?fGQ#^?&-Ry`>~v zeN*+PtN^3Bo}iS=E4#hfa_{qpG0s)Kn`adXS3D_=@1IgQ ziZOd3Oz^V`f(E)nHX z-Er&1^=(GY$)btBlRxor559HX%G7ajFe(7w@+kRc>P%X)QB-D6Mqug?5~eKvQ5(`2 zjX0N0>1B!9mn4t0j{!4+J_^|M)Jc)k!gI89AtiMGSEf>V(9Un!KVpwbd2>5q29pWR zDh>)RO<{EFNfnUA?$aYNgO|cruNV+8-cH_FbM3|H9mmgRs!0-m-UtL zw-wr3(-$sVks<(e`F1v^A~Q*rkPa*RZx%cu zBJfpk6H+%l(?5J4`K+GJ_7O+cK5x`maDprtiQi=RA}{?|J14;9e~n&-6dITP8Z<|0 zne##upJNYRtGNmUi;JO>GgUE9ZUs0*KmK5tuM>{A9HD`{ox(2V;Dgu3rbm%_JP4XQ zrX1JWcqZuA`HLMU#};pk2p=gdd9%4^k6giP;aT3srcbqyQmVU!^FaQ3KZ*`4pi>*y zn-)foT9Yq)oy5$V{CF(pb2P?t#Xo(WlOy@E-%MApEehN?mz{Ds zNNtszl;CJCc4t7{KNBhpr1RJ2L$6?gYM`yzm`-PR7y(CJBA5weHuam#O-t<+immcKpimLR`9Qe>>A@ zjvkcwM=4kRFwTqyl#p*O76OWGsWoWID8nJp@IajW9?7lUia(fK$$X#Fiu?JQ<6~K0 zsyDx=X9Wbt)rqBla_h_*I#Qc>t&M=!9tTGsw%?eZ&oN(VEFG-G5ef%XvGi_lXV6%P z+3zXs7Tuh89@k5-xH&`t1srn*!_1yGv zyH{Mfq8(8eL>JwVlJZVgJw9-tAN#{X*~md&V2Mi^r%onB$fWjkNfVk4IyjO}rC7vG zvX;k2%q&fKd>#UOM;bMj_YeTv;8#?B?w_X{YxC|B;WR_hg^!^cG^n|JdU+AeW{UZ` z6|t+v5imp%keR)ian4;ty1HGeov*K7D>ek*kJBuUXQ_?rl1}@Ru1O5DZ?>yRRe<8! z$j>kL$TCOhMUU6hyrqB;%2&M`KKyB&3Y$7%o;XS<|CbNapw8(HgM%{sIM25^_8A^U zM`3b>jF6{J{-5tPA-LTkTgRbU*U0Q_u7_qqf61znlx1<`I6Jo+x1kU({Pmz7ygU{A zmf)820`F=@rY|^6jm;Nt3(5Ora#oJ_1FT32#f(oUA-tn!PP!b(3uY> znk-v;C&oZv87K7-i9m3Hj-HbyA{Q zLv#pT=GI>V+}aCbzFd56IL3MKwzTOO--okEi^1@IF)UCAPh74%k=Fpy_2~s4>Br}} zeT`^CkgFje&DiT7lyD+y6|d*kf0{$|jTt#oQ0y3n;|~5z6ob;eeO0t79`c zG^FTmB*d9(a}44xnPCU7m0{kMBuw1cf^$8Yelb2;&#pK#s&wVvkgh{++S&fGmOnpt zXEQB?wdA8Sk28u@vPRw*G_CbeuJ%aVOJ`^?7LJ6CIbXaA8FOXzRgLWFA0ohw>p6i<1}m%D~uV0^q~3vx3h+sa6tTf`npvawPhpKM1SD`WL-&be@1TH%GGibL1w zBrl>>EW1Bg$=Bv&wBHvRcpIKR^&~L0EXa4;&Fg_`zg}p9&KX`DVSG6UGhBb2{G!KL z!sRV1!{EMtWd@~L5BJ1V3>0g9XG=#rq+?klb)^!!2zqZJ`GN7rqvr2 z85&br=Hho6$;2>-Pmo7Qz#{(`46OUSJT4SN+tK=T6K#7r= zveku5F#Ke>=QUZyCEHZ8^0B}|h{t^WYQ{X{{V%j)#2oFXbVbj{u$ufb@aq+IlwivHXi2U}jz@3ItISYfuDGy$#ltQ^& zT(IWfkLz)UOY_Ch9A<|Ft^UG-&Zl60Rp+LiO~T%yF4%$+-ar*|Ks`aag0w=^`=NdjP+6CpIvE8YUflvX@uVKT1|Zk=Lcc*F^MWJFrO0h2P5f*O-NBT{pP%1 z=i#qv$~<#%*s}uW(Ph(0!w0o{r2R<{=w%&|3^ncKe%8Tj+;$6m5#wFf5(k!IHcOVW zo1+o#jAB|ZdmF$Af4niTgy0qMK|ijW*^T@1w-ANNd?OXyZYiLd-99U4I?)A|yJOn> zr?o7BV`iojtm>LG&Y~Ppu3AHo@-`g^YQ;9pQ(ykFGL*So(`JynoLVwT-KT?)%9a#}~!kq1-+T52q&4UT>&oees z*Q;v~gf=l<7!4byB(wh+%o*kHLJm1@NygSBDI+f5U;_N|L4bSdZNmp*%EeqFDOag1 zH?v#3oX#Su$9V-LFx=GGbnSp1Pj;X!_0vp+j4r{-PcWtsaEk+3z3V*qIr;PZOj_^r zm5t7m2gqHgsXq$%G)gmWcFK++&68xfxXll}H6pMJ8nYxdjHp+bSEsA-z+DHyP`^Bl zQ*1p;;cE>~Dvb7`I$hSIhv!A0rMyGID9fIQ??1%f1>BTrf_Mxk`Iik$3X!@4wiF}N zqr)~PFPGbW^ghOMCkh-BUF~-Vkl+<762p~yI0U&w+WwaI8s}GDHlIe0b1z}Ehyj z!fWz*91;DU8IeHi(ux(%EDQ~~#!VsuPk?Ts{We`gnMswV@s=0rM`=!HAlyZler5ty zP0VJWR~=*Or1u_kAQoWzI3Tdx+W>U1=W;qG_wEC7Y2#kaJql$q#;7P$S5ZChyOu*{ zYr0bmKa@72sAMw0O~h@em=^Q7lp7#_v1#L}WsZ)xfM5;Pz2s@i`~9UuIgv3j;f|re zQcQc<3}nBEsy2rH8ukbL8au555ja6|97o~H_vF8CQetn97mr?bUB`OSw|08eIld+; z{zgOm!Ke0kUXJYDfU;vL5g5lKI|1}GExZQ!@4sp~EDS~qRWVyDi?y={e4zmL{;9ES zfJ$9!wHrD8MxEE~eR|Jf(S?!U6A|yGOyJLIFz)GBZwpWiK1KcUx?eelWTACCSEX19 z<^mSuv|Lq=Sjc!gP^9>xf3VgQSY2lwj?2=CX-}jvb_cIUl){xf7tGsG8r~7?oo!}l zq39<+f?0}tt?dED8%*lz)@M2v`)C-)}Iayngln& zkkw_iX&Aub&{0%@)D>%A|3_BawN9*`QDh{_e@vk~d=gp)S~l15FxSvSt6n3cvlP`qC>1L)#xQ10K)%=l%VDVFSh9w{BVsxA#Ihg;n5BfD@s?D1Z1A$&xq zaDUoR=8bTv@Io&1scB^E>Va&{$t^5-FAawg*MY=Fr~q5EW=@*s6sv#rz(qB}tFOme z5-ul?WN9CJrc0*?ik&4EHQe*WezqIAH&ZM*&XnRRzwGR8EC@M;E4T-$uHJB@ma(lj zYlefY7XGN%Hu*l<9#xSV0Vwp3g!`(K2A8dkr50wgMH6C;1S z_Q&jz!xm-q%(yfuu}uspXx=3sv%5m}6FE(fMmc4>5KB?^`Z=R#`xH|jEZBd+Rpf&G zx^0E@e%hTo;XdeGTYZ1aVPA2!eI?5|jqnQyQL@ersP<3dOEL;Mv<_UdXVJ3P6v>iU z*W#(e5j!}9p*rnDNY^*Yy26~8G}&-|gGDD8;m_-WUnCJ582)3dzLobMu0A*Zq&m6H z4Cb806byfB%ScS;T4J1m&R*b1o9#*FqV*Z-qU7)kR=4Hv(#1R`P9>o}iF_S~TFpqY z@?X}w&{i8DZ^%!E}HvLH;BkdiO4}uKyJJRP$s*Dv(09%_=*#+FG7ph+c$EiWMpc`a!iyb z*wtzTln)2ltT72;@=6K|^u)lqPdd9(dIl@x^GI|FCzwJ;V{KHzZGKHq z^I6ZH72S8lxAH9xH#|8MsYS=eHgg38RL^Pfq7iWgzj6vgj7q zPEyu0tv8t~j4L@ryybunPZdNCc~)(u^zkb^64J7R$tfbn+Og|J2-z?JymgU7e!xyX zNX#Y54(+HQKTdW*JiO7-QVc735HVTP4Kb(J|4o!2+b923DluDVG@X)&KZ*~x~Bp5?3w zB31hYogkYONowbpzSDo;PPzu5c-H@sPXMeG0f{M{9?Cw~)!4bCGiA31LB>;}xztE< z2F>Qw>2sO51J|MSf1TlJwjni-3rG5S*iKRwGK>b8x4nz-yoJHY`&Fc&e6?e4Zmb_I;1OJ`%Zn@J4MJ zm)C;R_JWx^lC1(H=ZEA)SoK2v$|Tk&OIEE0k`5b$t5EFD@&|X^-PSaI#khB5?i<%A zULpA*91BA6o+X|0ps-z|+F<)8ygY{UJ$>(G(={c$urZnK)?3VuYVM@Cn zi&<@R%Pf42HikA(k_*WVix#y0N)$i%FbEEs34&y-s-hvr2M^cp)Mox2E%sJWOMO*z z(NmKic_=t#mB6RQ*_8XMGRH(Aky-Wrp9`p1|1GmvOFq+O){K1t?@#_ScKNA3gp88{ z3zK!(&4)&KnLt*oje3%Dq^4xqgpjgLG#KZP2X}l~iB*~mP@#ep9y9N--MSY)r{}C! zb-v?i#IpMX+bg@46!!;kHSxg)fLFJ*_Z%iRNbfbAaV5KhL>$&`^(w8?#%rPTApz3` z>G!UMJWI)DT{#$cC=FH}i~{?FVB!;|#a;@uj;4vq#OVr_|F`{P_k?_``8LggsjNA>c6Cif4;P;;>2y^0EZbpt1Z{&1i8+C1=ajOcK>Uu2M2_I zh98&>W@}vO4Pj*JZV3m^;^;3~_8@Lc_^byUcE07Xpp{RY>U;RXsmiDX=K(TWZ7+{w ztc~NHbIlW;LIIuCf(BLbNbS~Huh%+)`Y+X`Iiv`K>et_bQ;G|(*Zd)?w#EG>ZCH8P zQ!DnYXwb|e{KI!qw3RmAo=ueY8u%@|;QzKooSh=-^8YkH%uAXF$=I*ZX*e9?B6&Fz z;<6{&(~@=5b3^DpZ}0)RiFY=?%+?~hatKu;!0?Co zH#I+oqTysKG$YHU%$2o&iOdH|JE6v$DHniPupVAf$$K%#)SEzvxyA6G-i01B46;_u zaw^~c;d?Kv(z;&gboSu;9DSNC9%ujf_mbKUgICbH1|VpA9 zPi7NYFp-^k5Ndhl+g&J)3o4wUYG%NSa+NaZy-*D4kh=#kg!s3a6*`Z9v)gPWTNG1b zkYs9XXha(^q6+>;y+GUV>?heE0`Dvwovq63CKuNJ%J<@;V zMnTXIc}>gOk`yM%WJ?hXkdaRc*U75IR)-mlX6=My!rd#nxKw%O3@JF{N&b@s`-~px z*vA1+s&1poK@Uf?E}v&vC$(~PU%6W0K=i&v%)i`7>5uMoYkw+5A}pwK{bqlKU}8ot z{LwruP$=yXtSAqnw^}P*{*JK8I)b}3jWFJ9AGXo4K(&#tl9(q{A^o6PV&^olcE=6b zbl$?$dg&~Xf=z4T!W8+Vg&@5`9Jy*)eyq4|MOrb=pNTa_GClpZ9)XmWCYF?+8MYBJ zVmE$Bo#2_h;1}_Ktme;4*y97MSdV6Kp;O#jYDIuip*OA;v={|#W7%ElQ}y{PaukhX-}2AhXG`vNM|IDYp5h=skG#2gDRE zR4q?Tl*P@rC>KSFnCz6v3wP%Tk{iAAej^R}P+DnlXP<_adOeeOI9z2*&~RlqxMRaw@T$&k#< zH!IKGG4ZiQ$v0QjT>Z6#?QXChi1wYP)9|udnJ-vX|6w(xS)L9W!8GxuML2x(e{7ad zE*-Tz6;^VVl0`+mZfIQ$p}S4-gOjhPU`F7op1h?cfSFh8^>0A{(Gn3uJmpB^q9 zJbH^ax)(ZY!o-#$nq*QDj+lISEEx5y%Bo?uSn(G%AEjn~SH1$~t|Rby3@fc%o`PbQ ziIZ&xk!0G2)whlRPmq5hi}rpo_Fr;bY8Lo}LRxF9YL&u|7U=Rai%lmdG8=P}ZJ~o_ zq|prV{S1XdX2XaLiCXWC?lbiBMRplO^C=mTMw5m4mp^BDL?vQ3#|XkHQB2N%6Shw1 zW{vn4Xa30mS_N_=w33@6iE+~ zl-Gfyc_nZPwR2N)6Ajk22_-2*8WJz|q;T}fFR}wRHfqxJtjf;zUO7V~ifeuBO8en- z>uY{pXrXRkLTZnQ6wBdOus<~wwbmTROijgUI0UQFS|HSMyboqNGW}Ly3R?=3N@9`} zdMP$M!rrx%ZRiG*L}l_=VE=3lakX}|J7G~+#~+f}5=e8w`V~>-r%p^2zaOwGyw&b$ zX7+u)QlNeMS^M?l)sR5horM_elJ$x*x_BFlzH)oice|ieiHW;40L89_XXho!67xrM z{Txe#Qv|bZm2ECU&m!nh`NL9TD^V6i#+xh$*)2@|v!D)f@vw08Kj!wCJZ23MI0I$U zVKepMpw=^ewD|1b)ELNug&00o;R`3hQ2VQcBqBX^gqz+o>%5uE^a}F}k9FwOt9v=X zG-3Yb88oKM{{$7ZD*wlVlyqp;p11vzw5gGU;7JRE<=Q3`a0pF(=qMJuc28lEDWm|_ zSdo!e3K{-DVfAd|w#ce{1|MM~;-&(<9w8Sm_{SAS8m z96g_*we6atQ;s#!Oj~pu8Hwg#yl>iBTTbV2Lt^8djf8}e-6H|!`H4Ibj@Mn}gD0qR z(^NL;mUglRHK>!<>$1b12?-UKRW@KID7MQPMJ@`i%|xB+FT5HWexa&tQ<=blkNn46 zA+aGN#mQMl**Zl=&|fE%!OY%w66RLd?RM!C>*+KQMTJJWtY+k)M;@G~S!oC~s`~0@R_z zrm1PH^jC=5t|kM37(@$E<$S-&UZeW!TDr)8k>c6de?0fJO?fv|r%jM+Enka9d%@*I z&7Gcix-@zic!cmBvvPk;nUgc&q``3Yz{>Ws?>f|DFX3S_ZbFq`?J4BnYy4f)ObsQ) zmf*Wy)Wu8+J&7-RBrOR+(_(L;y2LCkimmpM} z{_MV`FsJM*NxNaUX7;gh*_^YkFQb?N?+yxrP;HfaS8^`2r)B9T3aL2+HU^dG9Q+S5lh+Jbvnc1V~*cK+hR@X%v1 zXxMWG?{Xmrh``M8%+`owJ(EdIERDj{q9aIh6h8x*cdA%{0-5=7qxu@9z`a$m*2%u# zC+0!(V+(yh0(1Gs!5}=51=6`n-sC)=c-hEaz9ZaysBJ1tIYHzPyMf8q_4)b|k_P(5 z@eRIbB2G%=1nCq?Y|V=uJ?V)>|sXkE;rv>8jKq=aEP^ zGD5!15DGiY;{~G1P+J>jY+<%X@`tE+X3z@=z+3kCyQhMd~X|Jgm!_O~?J%QALcbIK4hgM)E z#Lqitx?ymRV_n3)sQ(QKd(V(j8_dNUC}Q9`x36#TP(={srMt(emRoRFS|ln7P6QOy zDjFxHVE=;L6%3GYv=(xx6sQ-|9ZmcjC-PeN1s8g^{09>XV0VYFT{iG*$jdqI=O%l+ ztaRIz9|$(|M!dz$8B!Qpa0*7}$LNnf0J{oqXfMMvmDv|Hpde+JJE6if*}661f=CXQ zVu93n0Y{+Jh$`jx76|3E5lW#d{?Q=8V86#H8pYP_MO7Aq5zd6OpEouyc;M0#f`IsX zC*=T}R3Hwn-fCcvN>S(EZg5PDiXk8_%*5$c|2}1pV{aHmp4uC`*0R-55E>Jr>2St5n0D$7vzYR@Ei}e)sC60^IdwHBqd^+_1 z#1b_JP-g=Wn|)GqLk)%Y{|*U2i24q|#+c}Xx*9-9PFlxf{&2}N%VI%)>~Wi&$wF7IKUdLud$iJD1$qWiH^$(M-TMR3&af%JiiN!48%AM zWYqS56Rdi@z1*%ns{MQ?tL@rg^uAxBc;Cf}v7zj^l0MsBf(^XXVDtB0=f`D5UG^pD zV>DmiOSAv~?f)Y-fcq*C-qF0-&h?qwiEVcGLq`ZOd01n~p%E9a@+(ppVHf+W`J&$+ z&9#(zm!W&)5*N5=;E~8vA$_TVk5o+dGRB8Kkta9w-ptW+F%DxZ{(SC?p1jLphCOJt zVkdjq`%{nx?{9F4T0rMwgA3@l(W7uWM&3ep{QgvjCKYnQojSmFy-94c=k5q1ba~CM zPnTXnZ2ofVxM|=vm$y5;B?k+z-ToF2;55zsC_ujnc3-CKjK~9?kO5Sm-u36F{=qnz z7kj^9aW5{_ED39g#P36LowR=I!{{gqY6qGf`%wVW?^79wnAvncInY@rFnZ+5m1b#0 zXep&maA=b8HjC@*xz+o7>h^I^EFn1qnImy!ut~GoE;=s;(GjeDaRwF zvghT+a?L-B)!=6ep$kB`^9?&~NrC|gEDAY&iVtoM15CAq%FQ5GtQrHrX+>Mq+8mlm zi*GWfD5fPbGq7w7z>++i6+ipP;xRnSv~qR_ZC_6zM=qIkMbEvxzvR3AVep9sD-YOa z^0`eT_FI>RqlC7oMHi=njOB1SEusFlZ^J8%JmF@+fat%>2s>3Av@&6^(MUX91ebWT z6zBTX1{V5zH{0gk-Ik6B1RdnXw9YS$o*gTXZ@-4@d(-c;{!Q9NUiSI!$57_qT6y!V zpDcGvqv}t0p}ASHu=~E=pb#fv%R5axwFv%{(V}{SHk$=DPO?ENrAW(xGS+zN{$`K1 zihv&Kh{~i-G0}cIuZPo~_~D}QBvc*{J5h6a{42+$qd1jKp8dBjET zXt=#`GNSA!m0ep`UA5%n4Dg>nKR7mzum zj|~@js_mDk_b|1Cr`B`HoJJ^K;4o!16AAxiV%d~tQD3~C7pRwo%U=o>FwXBQLPDC4 zw2>R`uPsu*&1U2yLD&v2KKt*I@0d$;!6<0I1)HsV0KM&u2m;hw)qL9+hcwuc&jp`y ztH;t?;{Ht^DdrQL2qM8C8bs-2Ixb5%19JMWGeb*67wBBL9%Xl`(B}$y9rSo)KkR*_ zcKv1FM3jgrFqv4T1fLxv+*kl^BumdkS4woZAKfITkD4}p z$bojVGg5z50m*X8v9u!8X+_`EWky4Qo{XzPsOGs9ked|_gUS?!1LrvSkBO3}`|f?A z8(@D&=G-zId|dKmas+>nB)iq1h$fZqrUA~h-x7UeVTI?MhE#xunDByL$X zl^tVNH(*A@mZAV!F5`cBQPCLmgdOc!Wm^|pIrB@z#iy(I6=nf(q04De{S*_UhWv-J zJ_SRTR%f?4{@3ky@{}+S;pFeqb1I%i2_Ad9-FmJC&etXYcBfZP>=mVD|85 ziog3ws<%MhrlkJWXrQI~>pUhITt%w*36_wcRsUyY!RSAZ${TMhYBHKc20*nLTfbbl z)`^Th9t2sf9dzI+hdjrT^uzbNZ)mRm(iG6w>Wzw=-ZNH@b#|Ln^*^V|_ey^jGG93B zOYVk7RlZ?JPEpoBve5N{eJ(}hugeX(!R;CLT-c;Kq0}0b0}{+kt9i0{j7ich2R+ep zr)}`ViufG?1t9?&AsxLom_Uw4r&s%hBw$n%c?DMEDMHil0ZIi-XH(PfEGK${iYuZZnc@%aD%UDZ_*x zaO4L@`2eyPpBqkA9>tb!8_-I~W=9b_H9W&s;u2}Xbz@HJ*26F*Zp&CgJb4OzwNp-o z)mH~gs1SZUhwtCC<8x-^w$pvi9wbE)U)|c9Cf>f!szNSD5#*F7#lVviro1Hwbt=)| z2#k$-j3anlSnY71v>=ssAdHayL*A$nd4*s2Ofj7hup0=_?ByiOLnOb+)K7n3^WTn# z!}zabu=5eF+SWet94JAneaypa1F%lMGUK~;@(5h`$+zwH&*puUkh@Bp?zR((AK)={ z@ebu9;3po#TpbgmE&}`yQEv`ju({0n;eXD2xGyFsYIY?*BhFLgim#C?lW7KY zmM)rDQS}WazKX%x7KLEW4M~+nyjAVI(VgjO!jLZ>pF)X%d=>gJ#`%*@A=KQ4pj z{#+%>?uWdXr)aQn1Udp;%cEDN;V@5I$fWtduJByx1QJ+AMc6he8%@Cr3u4;Yuvkvn z{%MdzgZ|d>X5UyolOcaD-$^7YfMr9Iw#;V5VT)VYZ|C0=9r&LJ&GV)dX4lM&(w=ZC zD5qoqstoTMx*(&k^^qGpEGlVZIpPuicU7C!aveV|Pu9%~taci=%<*%IC5+Lksu7g@ zoch19oAA%&C@g0}9Ap{y-Iy4c5KB1ott;v7mP-EH*=M{aq_>pS5znk>dAi(@2=I2M z9pI*1s3uC^+r;9Rj{csN{*U3BiP4%59P%1-`hMA2dIBx{Kg30pCcC(*}8G#deks>ZNcM3zaH|})}9fg_uzT>9!XNizEoAMnlDb5g^kjrSF87r??P7|p&zAHA?X-i^i{w@PXhz*V`q>_m+5fC`w|o+PVXV6xA~LA&A{=8r0SoFql+E3Se=Uk_1LgXhtHF97-j4KSk5UA68Fj69ETsLxOTB4t z5;-^y#^oa4Fc)LGAiVyW@?+S*z2<_w&e6mDV-3M8DM)hgJ*D{&-jE6wI4mkOr%*d{pSxo<3Z;B>5ItJ40G^O@cui zlNU5(GC!9Umh;$O`E;X#zfI%Oap2(iYlz5kFZU#o4`&n|;H>Ap7UpWdvcm#GZuOHK z6~PRj-WH7qku2-qy;wOKYx1U2<>LahvEeKx|# z_Izi%2okZ{_;ITC=JBYVJ8HQB&hE}j8-oo%)AP3hY|Gz0&v5XVfcv$hyQ+$`5!}T? zsbOVsj1Z?@PG4#9zllgcZ4L4P!r_frh=fa!-^#{)wuXognOqS*QnjOP$;F@Vi{K_% zgfiH|ID0rNTLmPT>6x3hl^%4fi)*jG)KO{h;bo`oq;FLw)cd8g#7xEl)<>paV;?}v%cCQBc2l?H*OCati znSeqWTv>AHGw&oXIbO61=I0=!-yHn|+uj{oic{7t!{A7e`;t?u?25$|(%VVJ@Kb#p z*2ECZsObA>vv8(}Rw=zJ?8V2uqJhKW#~h7l{6+g#fXS_w!`IO!zKBu+Cq+E2P;sXNact-{O4FB zIAF&GaX-7tn`^F)#Z5ExRdOR;&4RD;Y1qJiAsuzBluK+u*58E9mjj@zTkc;w3+a3W z0J!niFy!x#`_ay4Z@x0J5jREeYXatc42GJ=W$9yag!gJ`xs#h@UdfT8=k9W=3|iV3 zS?+xA-+A&qq?bqI%Uh0%db{uD+F=ag{wwmF(VzXh&ZCA!y-qBd1Cafoj-R!iK#WO4an>D^9)Ig$*t zBG~fK$%q4Xl|PQ12w{;}ms?|eZ-zmr-S!_<$Q{O4ybkSK)H-V)3?>P1l9sTEwAkBW za70S}BRr$ssYoaGokhLl4e~~5SEZd)h9rx*yeFvLxsR6XU#Lu>Y&R8BAq_z8NOs*z z27?e1OX(V>kAU5I_$VcFKXAIX?mXU7Ex00T;O%kH?kFqsRNI8A)zyisALK z-SL;Xl)b~4C9TS9#6mo`)%U*01MeB1k-j6T7PhMHQiz5p@P_!rPFH$Q-0igP)1nG3Eb; zv44KkhSqW2;XQSLAHIQ?oP?OEcD8m2%C~g{#eOK~AJWfw?vLxqZ&-H*VK}tyI}pAw zeH%_f&Jg0*AgPC6wafox(Gh2)riP&k6A87W=^Vuk+pj2hO(iwdkF$Rzg6yWLkWBu7 ztYq1|?nvHBdzbQ*gv!|;k8H08+c$IVOZY~4|9Rxvg=9Mozu&b`bHjVXv%Ej*@t%`Lm>!6nnwYFfK72 ziB#6H;B|)Gbqmo-H@65{c9p({R^;p2H*l}tX`4E8`-KuUp7ak1Hnz%%md?1Q2wy9X zev1Ip%a|pryQ=DjI)F3eCn_|7ml57eQHT=PheP{RkYMj0o2HXCdcr(5qhVRElv=Nh zxAp09KQrc zC2jtV-Z)GhcnAAV%@jFso4jSoQLrfW$rlao3q$1w1@Bucx9X7?%jMr|9^+=Yk-uNv zwN-~z`;y0I>JaMstgDXi%5G5 zaKE)=$(TGgAGbWjLaaH_wwEo@{F^w#gH9%2NP6+0J5&bF`Y3a&kC5@0dr9l_2o!rq z;8+=|h4w=EwLOk3p)SUIy?swhEtT{gmKvCUpv$uEhw25C&`3oD(C*>WBwDBQBW-jX zmKHlSEj=@&j(UFcFG>H~RUZPq?YuXttIpTrcDTtnzDY5j^#Ayyb){SJl>(KY)A%n} zIwooDE(X1jBAbE0iE@4wHGR$$Qgj75^BKHlC3jsP?<;#Z`9|)0lQB#YZ+?1mB0Ha% z4us-fJUhx!Ue_Xa)L1>dIV;>l36?fSB~RVzDM--RY2#Oc8bAxUQwhxJcaBA6&gO@dO$RvQ zN2KKL2{M~Mr7KN3iLD_ZnVEx<6|dl>4nZ}U+AG}k;=Y|75P(L3BdK~r8u)6&a(hRB z^CBa^He*^@KNj|IFRb?@9jw2q8b~jrv4z9aNn|9voB0jyJgN(T)9tB9x&t~xTuabF z=dl(BF%`e_XbKybV-h5cQvUq>44th3C4I;kqRk%W7s@wCVfLWnl{B+zy;f#hdNTLM z0=VX)(FxtZU>I9vbeX$Z_uM)59o@SgsKm=A43{!J6PdIL2}!7_AuKofK#xzupzD03 zseT_ruxn$-jFp%38ymTY@AD`Gl*IH|ySZpvR>Mj6jz(q7*m@(^oqoGJEQ&82F2-$I zxjXulakv$?aI1s}kGjc|^1?E}Lai0`C-KpfwvI=e_jj27Bw(XbxGroQc=6HnC2$@$ z8nYC6yU=vYuswdg5^R!2R)Tk9`1hBl^T|KqE`ekfd^$mg0Y}fd;o#lu)i6$Qeck;_ z<`SzA7BvL#;d5p--!^_79&1&`Sbx>w-B6LctM;aFB4r{5jU&I=i57rB=Mi0Gy?~Is z0j<3Fi}=+!i1eINNXY;m>_?Bq@<-;M{Y(gsDW(ky(86i{hT*@>Xy48^ih&B2bcH1? zBAEm*cBvG8wHF|RVAaG`TG5RZmXLF)6weYJHAWfZ zNR`+X8(8k{1(2vvw!3i|d9^y)Rn@6#K!mHP5%a1>IA1wGQPYmusr@(>%fx%Bu>RIw zK-y|gmvDwWQOehUrGszul^7Ok3g$TGIDp1)-pu04hsLkD?+EN`lZ|J{xHiEmF8TYt zGg6oZXvie#fA_*3k1^Wn_TogH=&c?}m3Um}kTAz#Te^_^OOaBGj}2yUx}kqT@|FOiaZ34=`>{M{ z(8RNU?fZsM(8zQ2oZH`=GBf(sv_Sr$l$r_c)N;5?X>e}M#k!=g!xG3lsRB8eg9TQf zQOt`^)k@?XSja$5w51QU+z8_M;4KtO1>lmqdpr zcn$c6Z<6Egp6CnRxsXkY0r_)ZZ>rQ)sw5HOgIxVwY_i)rI5E@ z)QZdL5_LhU<2PxuV`&tC2omxuG!en>xX}yUZ9b1(DZf2t;JpklZ=}@@uY}+0&P1|W zMR8e~rEc&EFeJapxSh0kT!^}qNay;|u%Y0#3L-<>lQ)uN2215-;Rm<=;7S=v~Vxs6eWo`ZJXHS2ct$0P0T)Mz+{Y01?+P+?oAaQL@cW59rR%*Of7 zGxNuH%qpR)x#YMuuk3HCQd5W;(%w7U|I9IWUbXc5XjJv8XZS*>gu)W7u*#5Pel>Al zb)ZIzRSgWZ;!K&8PbII`$=fIY6)1Uc?!_R9F$mosC+@^4c&0eo6CKvgWLLB96h?dR z?LI4b+deU6>dg)m94S#G$fU~tGB!=&`L$?!-=0U{K|n9pR)?Z?Ki8r4#*CI9GNxw^ zfBK0+)~ofg=BSs%uEJUZQeR_4SOlTRdE1yIE);~27oipChruIE*5!By$N2?zQiOds z57cr3md{>iAVrT$H#9B-u{Aj~OkMs!fN|xt#)OQ*O$4#VYW0GziLhGNmB}UZ;lpKB z@DloyuF?`OTfSNZ*63Kr_$n6b*C9x&Ps~$K?9;EHc51V$FjS)GjH!i-ASKs2_GsJW zd4u|$d=}n`1?@6P$M$k53~?!V=~I-ef;V~cGwm*KW9fa4f!di{BLPt*C)kkZ@(m=! zMze?gG1pV}_hVu+F2sNh3A8c<*@~W}H!MNxvLH-AT9^;FnHJ-5v)7adU&8f?_@)YP zV%9J7yl%y<*z_0QNya}H5u%rWN3*mbd_w!JY`!84qXKKoMMp%_GBz2e3SDPja^#Vk zxq|J}@$U)jP8C89TRYJ4r%UAY|mM%%{fV%pAZ-so|5+=Imu0 z!`Bl6y(gGIV17U7eo{zNJB$vvXwA&J*9*85`Pg=U|3^Jw7Q&EBo+nf&xAjw7d~Hof zBUau*qAVC!gk9~YrR4p)V*cAgu`7j!>uRWfP4LUExZuNMMhxu8|JUXpe;$`Nv}|l)#hiZh8^2v_O>1b|aAE9GrXl+%)y&w{8{& zY~F|GUQByy@xr?1YP$NddN3zAg4W;VD1iISJ`R!U{+57MK~1fepd`3z!*mY}>`LLE zK03+mxPEMW*lPwvCNITGnF@&D4e1MO5pc2y3+6Oljb^ttovG{X=-aMZatp5tK#K2g zAZ}xnW^f)D@qNLnBXvyz1TG-1KHsHMA&XwUrtjI)&O+Osr$JImEjDGRmEb)1R5T8?0+|9bGRgd zyM))Lgk%o9@o$vD#Ugt}fzVdnOUwqB%*Ac? zU5nw$e~4O#zvbDCgFSY=ve0dh1Q({VU`Fl!C&D}Q;}@vRZD%Oo{0v#Lj&D>kRwe}t zmkV1=ba#vcp*5Jkn;rQO5sq5NDI)VjpsApG@cX*Nth77sWO@?fcf;(i zs+kp+C*406y~pkhmYO|^V-D|?DddVT+x?EbaV%OjA6hkmwWa^Yw*>w?vxb?+RyZ9ko^>1C8Uu1LY(xk1UsikD zq+RA{Gb%~Xpd0mu` zmdw1LPS$2@JAP#0p3Y;TvsZz=WL-)%M7BdX>)zOgMR(&5)6VZJ;AXOaYArf#I?+(8 zt?fP?Ci;N*dJL+^`k3vkXWm(CBsvl!OIWSw?VEHd^N{ugKYZ4mfG$FwF!@5CGohzY znU~p4RJ4r&8@kg|5NwaFLwrWeOol~v0UFI29Fx zKA5Wohsv{&sr&a5Ni9qFvGp2~_&2Hi#rL0cuYNiD(2%D63NWx3y5En4*iY3m+%sj_ zeDCHAE3`pe1OkZUw>&f`n$caB2u@w@XG){LUD&GPUq>?}0V5S>7undHB|mtoy(cMq{o~&6CP^~bEa*_2pGGHEert{SqFp|f5_`*Bg93ypbh~1MdB178Yh@OJ;a^-VS$YH6)3N7Zi{Gg_|qfiQ)Q3h%`V@oJ?A|&-`eV% zG!(w(@T>Kescqr8YeBltP)dH`(A^$EO~9Oc?fW#WS7qiW?1te$r$Mphnp|?=1tB3N zOqusUnb)}_ErX+_{V*xdnSZHr_^^9wzHQ)UO*4WW6|;~3=3w$-qOnEpR|>4%I}&=U zv21W%c)<>bvj90)7iZ zD{=0Vi>3cF$3%sK{ApP-#~N|q*KvFT6a7orFB$!#QrdkhFK}O6%djhh_ZX#PoaU~< zEs9FlByVc?^LBd5^}RyhsxRoc_iLoyfj073p<`;Plr((U#p^Hsey|1p_Kt9;^}nVB z%Xq38d+Ic7za7J`a5_}ttmS=r8tSvk!4I=Fg6`3+%kKm$%o^P8_RFn!Es7{qk)^i6 z&T_M&Q5=uo6!=R6*SJzj$BiF3yc~U!AA3?hfd!z(|IH4?EjhU|*4gvoUMyCEoMc4X zVBk^r0bb+eARRLN$M##bc-n%TPx5=>cyH(hx~2P?DF-elqOje zuDD7eh?j|&gd3`N$MKZ5(-Kc%S^USYkiS32JT%8#OOet9_ylS~U;eT%e>ldXgq%Ew>0AHx=F=$NIU)*N1yJR`Bf%feJ84u!5Y!X&UEH2TG0 z4OvAEfKXJ`Q{ba{rdWhUX}a$(QNQT_Y-*BkDoAS1IrLH}W0)g!{uG2oRTRVEJ>Z$J zDEMH!YZr%fy-+#Po$|3$^O7JQ*8AK_sRNx_y_8%O#ltd^TrKyHBiykoC;w>2B4%i) z1|8`28+tJ6Nx1!9Hy3Kw7P>X|ruL`&Uzd1(F2PgR(Tb${k`!Gfa<(mb9E6OPaOJMf5Fvb5)&0%Xqv~YE&ved!II(SzQO86Nm0(U`g`??t76{p0kz!`(R5UTfJ+%qhjYfs9dNIp~HnGxv4cQ7Xvlwy|_TYJ% z=KiMkEn!rClVBA7r8?k3>WjDGHsNQ~VxUxb%>gi^{4ykqNm*i?O!T)~ob-T7(>M}l zkb)Y7hzXEWzDUyKZZ!3*gQ#foitRaswv6zVVk)jg_s!oNGD6BiF}E+?sLq|izefcJ zFEm`5fEEWXRc;lwUa|I`Y9n4vp3=SI6K0Pd`Fk+Wb9=vaikzF!c5a6ZF;vCd(zM`= z(@?ylZ~M;hLz&5H&87p#SM?BC_WsryU31+b_~(q$Jeb>oj@Wfa-0RF~f9F*UWi+Ui znVgLODlyS|k(&ws^~tY}>rLaz$Z!{>@(|p@d_9p=&i+!ZMw6~LcvWnmBm#X1Qc~qU zu;Gfswr6_r)4!GXnctc<#OXGq;Q3|V{AhQLcC6S|SG)*mN`4`~VOeA2q?qy4yC1&4 zk~(J#E4@)gnX2Ht!2eO1gGYON%Jl2qdH^^pHV6Rb(DAa^R#X=j!}vxr{MMS7D#C1v zJ--`Th@oj$?Q8)LK%uikn4aIe2FCBS6-&Vc8?(Q$*&C7j>X(^DFtb; z+x!zQcIz_bV{nj1vtVyupR1x+b+-(pv2xD32E*9PaUed}e}ZNF3nd`h5JO#Jrqycl zTBNpZC{T|bJS4%z)&;HETWckypn)nHGcj@h%CUF0`gfa=?n^3j=g&aXtU%1!*GD2@ zk=EE}%96mL5T`sXwN#)&9{&b7%d8avdb__6wNWc1a*nfM2MK)5WTik6C%WK_b(sB!+lFEjKrAV31Q+?%E@3)IV3wGIR=>EC- z%*vPy4&y9^viMywagW~`@cwIgv&7*5YQ!iZNz|%WejAMb=RG=L)NLe+&mD6}I0gO{N(2yy`zqN2o|>a-APbpt35Bw(Zn!b z^N?ri8qUBRY~h+$cVO@22ncI~&6QM;!(^brxeadjwbIrnMJm^2{?6f1!lrrh9P_+j zm_GqZd=+Ex7+bkDw)1(W5wQ6D;aP~~(66Rf6-1x%UxWgGcex_}i#YPg5Q{>Qqqg%x zUYe!zohdrTB;7H#)(u5n95`-;$ktl=)*sDFXfEw@SOt!x{_A14W5^1MHaltE&3X!A z7I5`~u@HG0SVvcn7Om%>y^-GeVz1Ju+^cBuhKsCxmmEEpoE>)?`AKHvt(D`vaAIl; zdH?5(AWkaz{z47;7E!=p4|^16&4|m=lSi%wJ&>O*sAd!Dvcw@>2Oeu{+4`F!MIk7r zW0ZEu(98p=l03fBYdp54ZjJImtL03Zq@=ROq7wk*f7)?5Tp5b^vEGZF{m2Ivmj2kX z47n;GQ=(Sli8tGgeIh5sQ~NW>&0u%+(Ti9wmt5=U1A|BQ+%r%OmB#_2likb4B8{|f z*Y-3-b#3e4#ljzjzhA?6eO##+mhtT|LSky66i*lYmqwdIg;smS|lUZnz2 z!$k&UI#j*eN)0;L)?YC3T2_)Cr5-SduZx#s8YEBj)re7h6|S5sc1=VPe1wBFEQL-T zY+x>Y?&L}4(a(6!W*G9IMCai{)|eggx`^j}{*?w!%jNdSCquyYlGlAXsRHNP$-{Cu zDbgYeaX&jwWC}&QZ5_2kFg)2pAsfzy4OHecoMAyVMrEjyKS7&n2fVj2>BedZ`9Hl_ zif(m~IvC_)8$+A+PI{y+LE(E~e;Jn^c7UeZ z_XW&v#I2IM9DmVv6-T1Z@$sFvxo#e;w8W`wfR+XD0|pdp@b{*T;r+*mnXmABV*-xI|P;C-`=CLN3(f=XI1t@sK)2(_m*k2lcDBzmI0Rd^&>9K>XTGSMERhD~j(aPuuy(NZ zUTm%ik-XHM{B;RB4{W3cQeS}-Z$Ujv@eN8B@$A2lgG@D^Z+MjNnA6Crs?(mCx^bL_ z;?U*gh37kF9FQ;W(jih_*8Y=3?8Ki0eO6mH%wjzVaX!6^FBVEs>7P~lc4RO;7k`;P zdZ&@#>6qa83F^dL!X+A>_utJ4PKFn|HTwI!?{WgD)eP1VBAp(^^jX=!4|6td3OzDF zqre1tFO*VfbL#7ly)$ooWwb=>`E}{+CN+r-CpK#E*I8|j)K&Zab)8Fqfh3mh%%`nw zY10HgF;s>4^ld7Vie2?zx(?Q zEt$|1j|YDwPQ83@s`$-G+a8$m@9}R%PHXN>gT4qzw;9V?!aI*L@)>X;x0LBsex!=b z=i;pzK6h$VX=$1J#a4If`CU#kHg3n=AC=>U_QUvx^T|@mczI1-pP6a?+6iq6&Rz12 zDyxrpko(U*7#3yoIl@y|{8)2o#LPS%tiq>(jY?>DrRtx&-?Rvo)@KD!o3kf|b-&}z zvJdVj1%*18gt(?DKE7Xry1RgR*?yfInAnZ_H(j7IiD$#>x)E?(UNcOEqSgDec6q@5 z8g4&&Ryfe65T;c)QC`!yAb=c}NC)Pz28zbrp~o1vA!!K)C35W&^ZaONyxgq3uo&^8 zF|nDS1$Rkpo-1w+Qh0*8NC|n00x#38?=UmjNb}Q z=V&|iy0mFH-$_6vYCUpB4*aRU71oJkJh`~e?G{OC*V9$m3eXavNifs2;9>TwIRWu# z+Fay_H(FfH(TNSk#3!*RNy(B`;ulaRlo>vy4SG3e?-N^R{}^-|{MP?8!2FHHmQbF@ z4o{shnC)GjI$L96a3ylf_$vc;sU}rd90U*4gk_(L>H%XzRZ?xeyYvWnZ@#Y8LgYP| zalcW-W?}oGwO?ASU@3DY|Irdz9&)OOWpVS{plxT76yZO8_vKfUm_(_^lUZ4otzVxh zlgImYf=!HF!jpagyL4}??Csv8Cue>95M@Lao<$?wKX9f>VTVYz>mTAO2Bsv1 z)U2np=lV_j80q`bHYedM;d%`66vT2OED1iFgH%`TOo6M09&#S|7amu{z&hmoG9$8uT1ID^;(VS4_5eUd6Ee*TPqn~=V52?1oyI!P!SYH@%};(m3lYZf@v!-0EI+8k*i+j1jUKP%3{DU)VgpA*A4yXNM?J;Yw95 zbdi*^n*hF~@wu`U+k&({JL<#WrWw?FF9bE>3-@~W%Ku4GLZRwFfE} z5T!Vhn5IQmkub_7yadBYO7U6m>`qrCn1#UyE1|hdR4YQ@c-8^MG44;!laAlC8wDM_ zO39mEcfU)ZlF;=KUt&ySCLtdN+RhIPxxXL)Ji~n$Q1TdVvZFBd{*ByYV5j_gDI&0u zNQ|NxY^PRD@YZ%Pv_9PN4ssK+~OIoFM0f-??wjtN*PMo$g-M0xFM=brB?@X2#y+mfcs)nuhW4NB7xmvqj$$ULlt4DWW@cJ`E4Oq9A zvV%5BbpGHHK|v{StU|WY4wthyIR)p3;~v;E+HB2?qta9?#?M<%*F)dry~$?j?vuhv z21$q+;u)8CD;VtCN(^R@Chu1oj?5r|gdxKT4yBG+Hd&xV+BlK5^#ML%-`ZhHuK;~U z$_@1i7kiV7=U1xfEn!$y*L+I=Y(@cbFA;4|MH!IyXSWe6aoq&D!l zHrF*aOAS1nh8)*YIv#t6YxTbHQqn&k6TS)5>$!it4{9edbL-ay9J828WZxq3PCxr+ zwNQ5Iewd%%ygLjW`p%ii6SYqj2ck{E$%h%>5nu%?UI%6rOH{{5d#CkJdK4Ni5E%nj zBhmNBt;rp_VrbxdmDh{gSuFzMH*toK`xJsSKYuY9Ed&m+G-ibyVEpx(R>(514E@Tk zsQ6p@MnQ6B7}~yZaissoodM;BvL^}+Q%c9%nfr2(#{qOATZ06irO7%-E6CIM*FvP_VP0UpvC?E zP%_}Zv1h@VnXyrZ-2xbEGAu^gFO9NTc%Msux7&ui=$B!s0J)CoeTE;;QFQvUZmJGs zP!u{EpM21HRX$-u@_Y^|dXSROcOjMFSu&9IOrJ<>+6i?2H@#NDYk>iUX1+HE*Qojv z$2-b-Q=wA8X z|Du}?=I}dx!g5OyL*MOJM-0QS;SuJ#Ok5iX(q2>n^SXc zZJxC%8<|4BF6zd!rwYs&;Wy!Oah!BoqP^pEK;z)b0C1 zmcTf;=cdE|T37a7rIx{Mp^dpU&bmvnk4J;%G#2L)gnyuNBv=`No6I7Z)2m%k>s!Wl zbm>czN(ajnP{-)RG#kv3+W|w_eEjQ)JJ) zSf(vdNM%HNL7br4Gew+c`xy1u)OA8#Pd1E`S7eKW&bAQVVW^Ah_`ph)ok`LZ(Pu9& zgc(6e%qTz&;Ibae9B)1~ zFsYY>bhBUCcAQruh&M|!=qV*Hfd@OhJ4Gi0VFz%-Y~rVG5}#8P28-dl??Ly!4<2AR zpAvXGtmwI+&24(6o$2-LFM>L78!PA11D+L=fx}E21+&%2+DI+?^54-MPLl5q_U{*h zVpE>%%o9{} z=J+opLe3p@V!fxaisklnpZdushV9-nhy@-0)hC!21z$!I0l}Tam=CIq2vGZJIHfuN zz24Bn3i%H&D<@=aykWwcMq~5d=HTPE{p+cl=n?Gc>5?p|=DJ2ey? zl4ul<;1!wP9N5=9fg%)FHoOT9WQ7#9G^=*rHZ1<^Tk-7_6f^nn^aIh0 zNPo_jdwKU?9DDXt{m#}m`%x&REv;KmU)|OywyS6tQD2*SdHadO!T(pXWJnW>;J=qbT=BOPz@czlxu;M z|7pE8UUJzrJ9S24y+qzX`c~?#Iu{LXu~sF{2IN;?Cx={!eBmwS!4Y0tbI}mdFR4fd zK5B(%b*bmvOYYh~*$EA<=9H~(h*J}=t0dHrMQY);a|#OFzBF`0JyD(y`HuND0E&yz z@4)C}!3vs=%(4k#qcu9j`fp#(`xAli5|+)CV7hk-$^p~uk%_$x5T$j)4#Be*l4;G9 zyu}Y&dY#A{2IGji3N4PB!(?p}5xV635PrRq8(ix6qkJt(h^<~023Y!sf|-Aff0q?9yWumes;i#@&q%+tO%R~~TjsB~McR%&a9==X z?M?)8{^|SrwEGw$a_lTRFE~(`$k>swVg~7#VWKgJqCtYP3FR35q!?>P+;=+fc&z?D z5J}IE>IV%M8UDO&?ZBm+X~BNqw-|-8HhpdD;Rh49R>UJ6PK&}~arNEWxU=5M&M3TAbC7_iZr{DrR#yIKN{^7I zx}g0@?(Yq!Y_IaZUpw&*kwh|G7|ZBm82%rQt}-Bswu>%}ARtI6AV^7rbf+}Z-6$*} z-MveQbeAaI4bmMV-QBQs!_v9C-@f0U`8&_d^W1ySy>rePzCkRxQtEta?vX@6j))|# zkqhp+ofOS}&dgMgPJ-)Hff8g>xX+XxPJ}@{N3z}1Mf|UB#(ew)?G%)w^BuiKs*!wC zn*DNc@M6!h)jfKSRpfn!ry$Wn&P! zac&~*vl4<)}-vEQZ8Y_MePjw;*07l8_TthDx!!wvbZUeV0#!%8*w1zJcBN+>h|pCaRa6 z4Sn1*wMOX{+oJa0dlg7QVUn%6_I=|?WcVV(K7|NZ&-eQC$6SXlAB0rRHN<;}m)++`A9yPFsb-(X4T*z_l#AT)nNg=%U0_5D ztS&&Ac6m#drRg)+`fBP8XG3?Y&APL_gK!7eD~`E?PaKWmstr|-TlCW7|P))Ym6k%Ya~AAI)2EsgUDm9fIz29? zFLfy5%ThHxk%YBQk~}e6c%4))=)jJ@!FW_f>wb4}_DAU_Vw7U65%CLTny$IKxoNh7N89okMij>BoXw5A@GdSr{a=j)` zh>vq81Hpk}>79rduI$`zgj?DVy}ypQIPQ42l2nPjN#MgeEkol+HNvl2V$ExbL*Cq^ z%5I_ecCVv=BZMvLvQOe3;4v=#L14RGTj(BIR02r2AvQYJ+lHwqJ?^%Rz%)f3*rK5(L&b7vvz_d%gD%7 z8{YWWYP)$7IS3)%QSpcuVC0Nz%CZZcu9tL;&x{}Nj_N}~*yae;kp0-`AkzYmDv+yN>4kF2@K?3;(qvlH*irxhISSZHwE(-L z0J7K;PH<|Y!U@9NOybNo=RYAlPtKQ;R@VPEZxZ~)zEoc%$04&D*se@!Vw}jAy51Tb z%CT3V7c?Pg;nnh>UX?cKX6>5KdVy5nkOa0FH}K~?WRcYg;&{vEIW?d4)oDyb){-MR zFG4ycl;!5R+RV7@gGvJ9k61T~1Zz-P^6vqTLM!xEpR&!b2F@0ERhi-ktXz8!NNnhp zuBU1R-SZ&eHTr5OG6>13=Xn7jw!!$u;FLRtSqpky<jEEqq_oA(boRx_DVKq;()G(o>yW9sx{m0H<~25(s6?3*0N4AD@ZT}t)0sNS z{>jF@PG5y*mVvFjK1e(P-nwqT!OL7-bTwYQ6cuyLaH7f zzat@iF|Yr6q^k+kz_!n+XSwbnUDSFPBlyM%3LIGG-bf_#g;OqR)di9uG@ z{n(xlD;OXIQ>NmSpcjkCJEU0hj9ceuJ(5L8 zupm2uZJKxx&y^qrqqtVvGFCex#WeMkPLY}AKb75#QU|ZIG4EyOq>%lp@_WVvHijc* zC{my~8x<+LM zxI1#fgNWKKh^4x!oMnT0I(v#b5`UuUG#VUq4v9GFV35QiO*EwI*;)&&Hh@bd-a zk%ZfG740iTji#q>8I_g@uD~&F{!y#$`~~|Gh}wmm4Ooo!)FD?;!wq^OnN=XlV8Y*w zqOyBDdUm*+^{~QIBhW_l^HnLK93dkc;aome7;U`2l&uDA`QK~T**j4 zAw(%25bREZdRo79)?V%yk>onUw`2Hb_HSVV^e1*4|6i@6<|RvqmQvn7Pm^qmJ!BS+ z7AV~&?_k!?C1x}LAJprRb#n^?ATOFWciiH%gQeDW9C8|(UF2!Xrkp1~QtrS}c z{Q`duU?_P)Mb!TU&vF?u>$vH4c(t546o4e>I|b&(ht=rx7V3H{eP@(y))(SGrjHnS z_xxAozU^v-WMZd446XmOK0|k#0y9*oE4ThASl*i01$91awds|;9Q|mnAaL+9Fe@avk7io_Cj7m% zsP6}N1H_d^gocL1xL#f1K8%M%ff?U}%0ntVR7ppYB;mkGthf^vw0Ht;Dr!REHUWHe ze%TaH@oCfbbSLjGgGLp5iQ_mpgjeFJ$rCJxgxh@nZxwQ z5^4bzOPR>YXY>RNx72g?Q^Lrn&4`4-7J5;J;oZsFi%g1X{|W0Ji(`{k2w4~Q`t$Fa zNs0do?YM;zz$+)gGY)a{Veyg#b#>HP|BDcVN-)8oeQt#|3*+$FA0q8Xkg+Ss@49vq ztX7notrNN`?7FS!@ZR=)OCV_{#j|o)^l#Yb+S$s@2@Z#aiq4x{mT1F-@=r(yCeFC} zEcv=^W`YI$n0h#6cB$sVop05_FH4$N^?q+GJdtM_>k+B)zY4LY+J7xBsfaDLDfbdBsO&T1f06 z>qVq~lJk=z4m;)B0}+Kd)3lwXV@*y$en*#AW-)XgLLSou@H;anMG%|S|vG_YZ~Rh#(= zScIcry#aGqp6eVktjCJ5WFF+8UEdB4nVd@}{8NYs;L^D=<53{Bk)p6C3fz|;PcVvB@)IEwsr{iviE&{69B1@C$~8J%x}yc?juk_dscl6L)(942B$nmiF13mm5@#sG|b zmKqKjzz1gmxY2>R3L?_{hAAVzd~kM$<_|-^mM%01qVAMWg*=tJN0eI!;v`(nrBTK9wX1qVu+&UOE? zMO8vJ)#Vds^}QJZQ2YA=4B)?T*ZUf*77zBD)B}!YA`7laHyKC{*L@9$j=jyj%W~jz zE>z)-<%X{+a~)cE6g7~JkPn`|3wKLe>WZDn`E7lATY)%~5zp9aSC=u?k*w~%p}lTz z{-{dylj`0H;lJ0xlL?jA>(C<~{FD$AG?{Dt0_T&SwiR3Iy&O0^vNsk+>|mpoA_ z05`1aKZ1hWKC<56*B+*z<|@#>EqoP@uML#~j(aG>t(CoNf?pT9GO>i7|C(i5t`uMC zt`liO2W)GI;{M7kX+AYXT%$P_A=O0g;WHOuvGRz+w-r8~MR70>p*M-OAMF!H_(Zvg z$MHJE>kJNVV#?mZ({H2^<}F3TC?1hoD|5Vi9YB=scRA!;HW-8%lA|Vs4|oJ|*zM}! zq1;AHtc6H#oeG`wUFk!gzBTbheL#)K3|~@H99)RkFHuID_Io%nieBt**!=~TiWOqU zZ{b!{)X#OL4X3iCE$C94Xx-E=;3;QNZM9TUp7_NS4GF{5BYoRc;PWwuFg`-zSUHU#% zw7et6hY&D_f~LDNH_@C(oUg|IAr8mx$}s!N30SSQ5FGS9K0)IL>(Yh(vCmb`pi}3% z-FRj;waLb>xBPLH>&bC`D>R_9fNV=oVkFS{vq$#y_iQVm8#NH^`t3#=O84I`6syfK zo`@`AAHjBY#EpfinHLfDzp=<#;*?z_U}?6&f%PNsgUs3zYXj2JiMt_4!t_=z#?nmb z7GokJ!LMv&foLUV>le8BPt1Y_dn%1z=+Y?T+zoZpYy>P`$ z(GkCV0#TR58&h91{0y)}ZaqZDE*`D@JVjX)bb#$s&<+=bw}0y@M)LJ8ej@d9x~wS= z(hUc#FlP4%&FwpUB;VI@W$bH_=2Qok8Fp@9*?}t{m|{Wy*XZ+x${5g3c)jCL(w3-0 zb=~s2?%*d&i-YUS)cw+9Am~J?OYH7o8uIrJ)DxkyxI+hjAh|oHc0v2gw=Sx`+jE7> zR{pVC`jiLlG?qa166fp=APLBRmmmM8|6j?z0XDhB?^u0P{B$fo7XZ4w3mYcS?2WjqX%@_GH@lRs=*Rbnq?pBenEupr@+_((+7 zFtT}>k+tHp+Vk&MJLg-eMNp}*jMunPr?`xmZM=iAeoebE`;PRxXq`cscW^;OhcMgb zRwndxy8zdYA8u$R0$LVK+vlCCz!P1@tIwH9V5Bg6u14*qd00KRu73U1Z;FcYkD4^r zg&2v3?=kHW(YW!i=>uOn)(q+5dc2^)F8gaW;bNhy?|oH)AB)+DA0R<((3SW>D%zw< za`FoBOd#Ytsb_Wj-^t=l7ZT@DxbGZp;6EN{KiT(&EWkOz>rHh)cKMFhx_}h2vSuuv z+WEij;XlydN2*o>ewq-r)()}QjF;d*G^nTEOsPW(UNO)zL+pBhvh-fEV0-9B$4V63 za*%J@jj>(K7& zdZo?G-t9H4?s&bSyx#p8V2;v_;=L_`EFw-FKkv7TUoTL9j>fE+vucJ<882!!ooIG( z)@qhzWxV#X!e-1%>V3ho(NR(AKGZgU>BU)8d&?b9S*A*qMTt|-@+u}=?nWrGTx_d* z&2^?&{^Qkp`pePnO5Z6*E(V&?AYay&zg3df1F99%CWq#S|Q{H}GYQT}R9 z-4w^T^jMrY30ml#25rJ4)U9S4THf>f09KZZ|cFS|Zl@#*^S8MFonmzeOTNYyC}XBpC}l*ssr`FG`&DEVUx z?za-k4GeH`qnlXtB0zr{lMYnCvpnl!4SwlV7;#_sE- z#?&)y>4SsG}yIIyXqgG7YGs6wGwU z;D}87wC={_lgZvN^7PtKmd%$CF~t_F%4sm-)XP%6ShOqeLB zTf`dv`_8`BA7iaTD@V4l=McNtBi43N8?P5$(}p}9U3GW#DgP&bl5&Hz=NhAP z;EdPs-+Jp!F?H>x72Rlr(yStDY%AWXJ*wWy`+cKo*;jKw`hb(bO|@&y$Man-jC-Z3 zT3JW|9*q~D-z|POu9`nRAR87Sp{Bdzf$%61eF(2YJf&SWNbntS${P5~x!cmS0jr~g zcG9ILY2DvVZ5+;x9gUv{omFI(q!mof84fAvCqMy%NS)yGFa?FS*|3wue19d4n^*!cJ|$tNaGvLPaQ_!#%5%|UbicI~KH1`N zC_|ndQ{hzB{Bm&$5q9D~MN)0X-BgeL?J*9fq<2qeaa#&o9y^ikhr?Do(bZT1SK$&+U7@3fB$atvlXo42}_fTCA zh_2B)edo;HZW;edn>dH9WO%LVaYpM*J*XG^|THKe7(Ay?AIrNmI} zKqoO4crI_Bfk*k=Y8U(-K+B`0DQDH(F83uan_{{S10LXYa2^l$S&c_v5;_|sKaY>4 z-mJAdtv8$we|alOLSUf4+}z4sXwN#Vz4ZcnTaHX>Q0z^>@@D?w?z6jF>E4DY_gV=bqe5P_Tr4iFavb^eLX(h3=xS@NcKO{a@@msI6Ht{Jo14o8~t_)13 zEGy;G)1`{Yt;*zh>(@nYBDdNWl^bzCE{!2SpPGOGMYEQQ>0WHa}YI;Y7?t@i1A?NIiup;HSpJ6A_ib03DVZ2imVcrnPCgQ z&zsxB%Bp_a5+-sEXAA5j4%11@R{&=@a~<<>n%oi3uYQ2mO5a~gp=Yx{>yLm;Qkdwr zyy3lyxwI+LrLSZ!a8&KfTKq&#%i4JBU0xl_)LjXMF4~m*AS%nf1D*!hWFC)WT1mB+ z9pmHvb>9Jg>8_(+>(?WbkD$-MA9zAclaBKhx|PNo1j~qawjH)OOjTlbEaMz|HwL37lD>0Ha5ARL1V`RpzW9r04yAbMgGL9Z3G>0i z%l@2gX9?QN;hb$>U;}t(v5mVsO_-?|w=h3nJMllyd%>|cE_lqy#UBF>C49xHeV;YO zT|GX<;ZvB90GV-kwxCkoGnqcW3Qm`yUARq6C$9-f2-{0Ai)GUIgnNYIUTFmHogHMS zJgs1vtf9;DqBID;6VApIug`z;n^KyhLv3BL?7MMES6D_sqHxM~6MP~n}-1^PvjjN6|ppx^wO^p{mB4MGQ~ zkFvC(mn@GnFp0j=)W7WCZdSOiWKc~9jya6u&e0D_rXE+sWT+>-<~AEJRpeeTC9~$K zf{Qg8H#m}J8`p^;)QLj2A?@cTIj`q@xp&U}d4KZy<**u0n8k4p=Zq*W@)_h!uNlVJ z!JsXo*-F&xZUPWz#yynH$?pSMh%hI;N_p>xN(cO_KQXx+cy^g2Ou=D_dr2M7r}>Vu zKE{^|%o>zavN3t+WEags(fCD2b$&Ev@`TA-mlpK{R_*sF zDOKh%c`(RJ(01NDAC~4Xe6}be)etP>Z0>($psO`*I9C{1zo=&lLxd?=xRX_#+2PAiLj*(7rm?t zE*z4n6aQ}k8VjA|bDj3VQI)ULaD$X|ln$-nGdHNC>r6^TtPInZjQRWuGpW)hE&6&} zD@-&`Rh{R^uXmVb9+$az*UfYr?lp(;x$^U9vphDza)|I>Do?sx)VoiEvuxb)=l z1{sam0|W2s`0*c?$J&tnuiFmcI!bqLee~m5U$vf<9DDm|wqC~L?`v%j#gx}&89GyS z20~dW7z7wvW1x!b3DeJW;jg(>$wkp(9Fq>@$TMf&GsFfeV90dS9GzsHmsed!Pj0!n zaz#`h{ncw|u8rlWFI2!6RvlMwd+=*Cp-MQlO5=--IkAjKb)fjyq%lm)R98Gqivo4m zscve+43;y;7gSo{vBTXFb|!50jHrJb?-FD$<-#;fhZTS}nmvq6mV-A}1OO-`T_r#I@gA~8pO=)HE3uZ95Jr>Vq?)6rIaZmmB$ zf5`L)^RO-jeKC{H?fnVU!H0L-Db+^j0coA3h25wM$oV%|3X<_D>yWT|Bj;_hu-^;OGO>9p_&kc61S{HFufKn^Y7IylD6q^}0-oj>Lh7vlPrW=N)03357fv7-j)TnJ# zpdFQgn=?(mz<$KSyJdTi0PYLyt8Mnc-&g^hqyL=@aghgx1;F5rW4i(IkKbstQjOy+}FBTV;Ih<}Ec z%YRZZJHIs_e}6UJsF8+$^_x*vGie^KvacB$11?%*>gDeYEw%b#^;%cbgj19<%bNa3 z>DH{*w04z(RG#qLiDxg`U0c`Vr^4>wZWd?b&96~a`&Hr(V+tBw$=ootDpZmj|BNgw z$bR29^i^AA0gA2XT}jHJknqn8?P@w8u2fG|S4ANxIU4$Gsx#M8#Slg!>VwZjTWa(> zIrV+|`>X?&V99vYg&Ww)y4@e0G_mO_Z?&f6>hb*@Y4VoZbyuB^O+UID;96Qd`q0{C z-PS;6z^OGDd~l2S&M%@#A^U5%ul2m(Ok^Qhv+%vFC$c!S?^A;cS!HPh%o%zVAwTkZ zIR+$aX$4pmK1R{SEC5C`k>@zT^)jkDZsT}<-O!;eSAOaNEEr;{qcJ9y3`|aXZ>@dv zJughV;h*XK?S}Wm>)bv?mG~bJLp)WeW?A;|vtGXr+332*KHO_qF9EyMQ&#Kg+ibJz z_o$diHAnv)Zl>)~t~!YiPjKm|d|ghJNDjV2T$SCgT1qzg#770Jjl4@$KGot4r0;Qa z>~Ma+Z6sbpHE|lEKoezvf{0xsMwLt5-wqsmV0ULH9p#+IzD4#&EfC2Sj$0iJehglp z*6CmJfm$V^fQr&1)a?pH>4Z7jl;fKC_i(0I%yUecw@7`H2Cb>mch{%I?9an!@2)Xc zS?OnFd)f11nlp^;`$$xrf!hp?h0Vr+m^!PsLp*j@O`O_DCz$VFZeMB@IMVTk{wvB+ z(1<(<52SX2b}=?}@%zYHOX-rxMOLvIV{l*_!^~b{#rvSK12}Wd=S`>26i5LlX-EJP zkGR0IX*(<^quqKVCY1cOlr2bhGXH(Cq}tTG^7LX6U#r`Zo%`>A*aFjU%$7NY6zbmL z_`%wOFL3^_`dWQLh#y(OCa33~s~Ifm>qDbr-2UJZO-F~PmU&ZLXTL5}HM|kF$6d0) zwOy8Oy&{$JC&hVZ4Lhej%DjG|KUGyTDZG}@UCgpGEwAAS6QFW3CtaMTrXoNfQot^g zcmG!VQ3J(%hxELF9Q<83ETuz}$CtLxUvfK8g@BR0Kq;?S&lfvP&e0qZdmkrzk6@>C zYeEV%i47vR3pShIlq9DA3I($|=WQGACslyk5Kl5qxEx%>*SbgJ#D9c`x0y=zasaRFEsi{^H-6K7QJUFWh^I=@;c3gGkSrl(FtU{+30#3m?qltL~R&eYZonbpmS>HA-@Y<&O(iYQOUeid4Z<*X$_88`A z;_$FmSmo5mIv*aFz4Ot0gHm~=Z?Z`^vg+A9b=^3_E*~i=v9zOll69>=CG&&D!0U zQ!lx^XixYhkyj+`{hBX3M-2_?R_i%=ch(7v z0l|I&;|;>;e4>|aWWG)udIz$r?3joc{IfSq?zra1{^Eu5d;1_l^A7|sQ&mH1Y~gaWs2Q_->0sZ4R}XvRWifJ!8AP7m^F9|vQGwg5q^zPWV?R3F z?bg&T05-7BNLzb0H&;2DM3RzztT!fCeT7R%_= zGI0u(JklazwlMUWjLhlD|M>({`yw1tA2pk6aR>Her9v4C-C4edw|!-vuMTTAuG}8~ z_Ad34u7GgvqNUslDZ*h}OBfWd-=e=zk|9#(lDpenGhEk*8jG{j-%_EQ65EHijbMb)-HgjTyCdEp?g8sIMs#M5 zm>8M^rM0Srn&HRhoxZQ*^KlGp^L%W&j<5sLI^~-KA+5>DBeTYC(FnnKlL}Fr3XLq0 z&{YG04>v-FdeKY+R4&~DY8&D9H{Cwa18R_{N3X0otXm{`f-@0?PnamuXWO=AB-lw zy{%d{EaquU(F*DDTIy~VjmA3+RF9NqYv168@mhB_^56gBPb>~h!-4k)4FA?+CWDi1 zU-`{uf|HCk1LQyiO%L)yeGV*Lfmvn~%pkF1RbS$4TjURW;w#Rp3^q)z(%@lYS$=#M zb)bv4j%E}sAlseaAozp1hBD;kc$8rE7Muktde5P9>HcI-X^H;xed*+if_1uON{*uY zUXWksDZJ@B9nyxd;%w+>UHieTK%bO!#MVG8bdJhL@Dc}L`093&5`UHQwl$YrXF%1b z?6E0P#7FV_H(@HMquprS0wH}*IwAN1|0X3Wy88KJFD?S_$=Yk`5^PoPGLP|0BM0I~ z5OikqZA?5Cgk7W;y+aYDUpvGPG<$SNK%B*GY&yXvsW>|`?%O~&LQmP?d-H|Q6DZYz zU6}1SzAv6BwJxaZBb@vws|({-^CKBquXO{yyu#b+-(6j4?ZTs4?P%LU+w+SAZfL$` z+b#P!CT;N5BWMmIuQ$Riw_DMyM=Nk5wJRy4cEU&FrEO5i_WPaorM7c{#uj z;r$h3wsDn2p0ss?rwIhZelw_rzB(h-TjM|nn)c506^Pv3__8T8z%gvQ&cGwVx=G@I zJ~6`P3jIL-mWdi>L*W8? z)ndO4_noQXrSPlcZfG9|{*vd=Gol1#UpJzg({(m~5^D?AtJ<#SoXiZLe|Mrc2xjaO zK}b0spIaR24W7`dK9J#qmjVLz3I?vz^DqDe5l_jspu2(1H3>h8PUp~l(AosvLUpu= zcp+>9u>Q{{MiFWqmih=5RlsOBAO2MaAFy3;vSk6#kNvvJYt#YT+2cGoTgGZ~l5Ts`1MhKH2aut-q%a~S>$O0U$w84XsPd@UzjoFPg)G_v1_$9?T|-F-Ls%+sASl= zO;B@O_EK>>>P?lo*+Dl%RR(L~HRj@7m*CCOu!|ZyxhNO%Y!lwYCHRDl5EW)VzjohR zj2`@*=yvjlYr)$c%@cSHfRE+fM$O>m;&p`E6+ZUiM~k(y$J38*vj%n1E5#NMdT=x@ zOD`p8tlG>Zrk|Yh5jOV;!4)sRkSM3u=)Welt1uhU#INOEF!?M1Ke=DKb|p5H&iQQaUyI)BeY;CP5WA_7Wn}@Q7>b)4L|IJ#JJ7 zop`%vUcRns9(zQBTvuc^Y7q2W%6Dh#v?0*H_vo zYkNP#_N6j0_I%pDTFO$h?e?@19{;dhdz0c?te#KV(o~O_U$itS;+#`yk^3=io9Rc# z*hdsGcVIGeW)?Q#{Y)KLN)?DL%-7ZbB&~;M%ID6UOR>>?Ic~PwDZiS%P3#x_?6JO$ z=vMZ>Q;a+3k;6r<+YF)Xg`ywx(Q+T@R9%foHGy@qY!f`g)evrm_hB=OV*X2}nWB%)5x+FV>r zYQfcK4g4e9El|;XfG!7w>`EBW^_LS3DshmKM0I8zObYNvcQnh|VKr-SoM>~(lIrug zaH`U*TJC7cHXCf|Y!xo4-figG>dPKzVD*t%_I7NHa9**wG^RCxj?)h9OwmfAT-jbY z(RGnf(rjqM{8Aq}HCwFLnyDXi^#wlk)h0h^USh=K*Kx*F*0?-h9dO%uS|*bJ!J~!a zTl?e@$DMeSr5$mNK5gl7=J2qAsx=_=OV;05w@%t1)Un+OR^tQ<*W@?AgNS|9gE!@; zvDdyGie%y|NoMK~ExeiLWn+)dBxQIN$AVx~-9v+%O$LqYc+YL7B1JcE_4VF#g=zKr zI09;T(mlLUJ16u2{!yd^hzS9Z;eV-PvCF7?Q+jb1mz?CbW(%0G`LG3-3vDX9Y89Cf zx;{wYYoef_(wEUru>OoTC6@@49m*HZi_ZB@SehY&d2K7J?GOp4^qHc+6ZzifTLTJD zt+nJs=@3~zvKQ2M z$9jU+^nD|wtEFoosylnj2hIhe!5y!E-4++~-@E<0TJ5#nQkT&c5a+U6MuI3m7E6Y@ zLcZi=u|PEmowU72`pU!Whz>v5BKTj3v%zz-W%}!Bj{-}AY|f_malv5;KVO2Ee>&kx z=vJ}MwOpDhmgtdpTa822Op^hh?1pdYM7yR^6&+PA9f;oo9`0@o(H^AQQ zlyt0??wFR+hYFo;sOTWzirnNpA0Dput)~8pL4={E!FJiwcN|yqo%dq+UGWmVZ{;8! zo~n-?60hrxNAw_1@P7o*0Pq&phjitztrT%Gd}nU-w{6^6X%~^vxH#>>-l|`@C?))CwE3Y%VmcfL3%o`X#b=>DE)~hWvrv_^H<`^o-cUX z;3rx6M}UiL;g0y794uk|dN>K}K0CDsX^UVzR{i&vNhfiKen*a2SW0kQk3*;X%8IM7Aj zh3FP$c|OZRbQHY4e29GX&M-8X;w?;ke4(D<=+Cs=-3W9E zd`kuJ$e4#-jZD@C7WtYzFQ$Pv{`BxLUBHOLi3b zZQ&EHUD*|D6GHEdt#KgjDoe*uimwwZoKr#Gvy&JsOGcw3L}Oj`-=&-Z)~ zj`;TmZbUa&23O@UG(e{^nd+lv77H>fkT5N~i}hsIPCR(eM=mg&O|(7Zc_BWBsNSJS=C7C45<&T0E`h)9WINH? zvEj^{tOI&CRA>%}#bmMfZ?rfv}zWN1uI1742&bo?=>yy^sj)-x4f^0iZ1`VJo zTk6!~m-;^8u)aW#d{*Lkik!xKr*~c&UtAx{6aLUA_!X{}k0=JjDskk+#&(F8QUkJQ zlp<{Fu7}(2H%zpusnx4dyeQ2Gv_Vw3h@{nhcFzZ2qO=d3e4WPy)mzN@7yz?apLy1S z?@cD^V-}SeuKNsOYC`S1pLGzQQ}zdDva=^AHede@>9dYah-mz<6ltki%WDg-0|-N% z@0%!Ax`Sf$l>7ZF^=k{GJuK=SYZT8n=*-7EU@rQ8n~u>8-!esFd~)Oc3NvOM zJmJ4F)76BN_!DsT1GB5|edAn@adt1&xc#A`p4%ThV0X23@P_t@yUVnP7JmwnHwfZl zl>70d&hX-BQUImJ+cdyS@h$Cs;~I0w_z^@h_3z(JO6X<%)xz-^JaO+Dq1Xj4{(&@m z`NjPaJ;uH9avcBQ^ZJtZEw6{sztr0e;c<5y{$c;*2g6*_J|gzLcgV}Ei8dL?rtuoR zLRt-Vz%_iXgs*HzwYR3m<$!%x)ii&UZ|PZ_W>k+JOJK4Tbz-Bi^O);g^TmW*g{agsdG+TYK#__;l;kj``%3(UF3$`M4j zXuTyZ`eMs}TT8_Ef?Zty?D4z3q`SAO;e|W3YBdw*+P@8joi>z8+7pV3wC|hX9m$RU zSOhlO3&CA8Z%EVHg0<>naF$Kh0{~Ko@b4Gf=6h{YF;t?;PuhpHH)^@B>W#v$-fqWl zAD*3PRksuIqZCxPs>>#v`IRI6kxpOY?%8W{8QwVj2NUOoJiriIwd|sZ^H8 z!XF^EFGA5@T3EjPsZz?foTF^AXae~WP^A)_uM`IRGg$2Qx1uYlemzNcE#_eKn44AM zA5klq-Q867#E#`mpGA>32b={}kv-3g4V%2NOP`_r<%QlvfK_!-QV%ef3(p{kN3H#L z*o6O{Zoq5R2W1}*sur?tDU7q29%&F;G@8`;gYg$9*RuwVjmqS3J}?hMz#}}Xbe9_i z#nOR$5&vu;mF}uczsw^)3{+WTY&Q=0>=>w;*$?t%IfaA0W3A$coO*b@&ATuw?T8u5 zvPVJnS`O1s@^w7@uSYA4CWSK6ukq`@a^pNoIxkJ$_$9l%J`hYvg|2Wo@S?P9jzqeV zWfjjyw{5pdv%3oxyMUM0Hr)4Byt*LwLIV=3w+r6-&p}~yL8V0Y@0Wh5=F1C75&l6> z6?`}O2yY6btN#4uT<#pKPF{ZVsm4(grd1*p*6~f)mzOGa+qJ7%+fIFasDE`u@K)E2 zv0Ni_h4}gL3-oDc<4M}8MBt<)&@|$p0iWagpb$gYi|WQX3V)&Ls);ZVoW*%bn?klC z)lD~p3do2jYN%@Qf{DLcY;z;*7s%_KzNo9)L$E@s0TT}eR&%4E#slABoYC%Ya#fV4;sa|9IyVrgVvBKf zd5Hr=4sOcCyyJ+A0TpYHE9Ob+rGM?Z2UN*ZNf$)+jtl=T8nG$%2sq7U5P`|%5I@(5 za~Pn(y~h|;Asf|K*l%0!&M!bM|9r>`|iqq5IBkf_3Bu;%kXKz_QEF|80 zoLpvhZW+}J9v=H_dGDbHaz=^xv=4+6nwQ0Y;c}Gjhp+8ecZq#j(w30pd?GN$sz!d4HMo@j}Y4vSz->e4>et-#i z+;}@Qe+XKP86(6T*YUSmom`}k=)ic9arVU8kB-X=1G@uqzh5l*4FLG;r6?n%{hLIW zYl|w< zNj2H|_9LjUGs?41?pm5+sdHHDARqoc;(`U7z$e!4h>J!QY0ZHK&3>No0$@jFwuDr? z53&~YyY;}!KW~1Tz1{bppE80}x4K~}I1FtNh3(({@{}q{$O(vRRIBYtO2=aVP%J?z ziRuKpTCpnoS~?gd?NMkyPr%GJUkf^6OI0oF*-xw_1&Ij@4;u?Q;RCYPA) z8_Cj&ijjN|iv|vPTn6S@{QTY*Akq78wt@0JeAI2&N+gAtqF!J1f8r_IA~zxDfcB_l z?LM8{U5Y3p9T#=uV>1=xEIe*w?AyJceua6Q#1IOC+d8gdg@QW5`UBv8*6RdCePmWL zZ*j91#ozq6Q)34+e;#Le|s@unfUd&@Go*JtkFbh4NyiQ@6#3Vgn5X&40{b>*I4eV> zORnI_;#d9Q|F<;8ZV5yay0aoC)oRm-d)#h{;5L+7`y=F(aaf`o7ukr7z@xmgCAy?2#sKDQ@2p1vB<6oKon=^5U$n-DE(JwGY3VNMZbZ6UTBJK9h7u4F zknZm81_wkyx>I84?iyg2x#xeMdq12{^JPEt?7h!g@A|#(S@%VTQScZ-&bck+P7}qT0QvossmXw0Sv7-{}nN(;-@E@q)1XV@S;X{Le7;7W-4$ zeX?Q`SU_yr^CkyDnaLag=oW+VXgW!nFDJt9M1|Zw(dpz&AN-{f1z+_nEp{lf&;N>Q&N!Fpa0I( zD$|iH4_DzWxA2pfK<3lm7nq2=`2gc@R5?qHwy(fSImCy<)4ne{>J0>!XV1(?6Yk2q z+hi*JR`K0U8vVnwv|{ox2Uf~s@qkK0%^gDCn2R;dIRW#}>wCb8bPYbMDd$?r|Mg}v zQ1&qbpZ55Ud!@%K`A~BByoz8&e@vSkIJ_bxRs)oJm47TZ;1_2dvgL0{Y+Lm{;#SnA zxAin#Nsj1z>BwJI{AZO2uKD&-6Fam_j+f3T<7qr@{HavFvKxzFY+%pjs*tX-zoQHH zsm}JP!$|P@Lwl+{)^*A+YeS{TTaz!R?xrz0rG0C9HAqlIyqJCra&VgCA!0gM#IpjoBot-2GaF8$hhjV){G zrLbtwgy0?g??3)oqty084B^}a_&eSpbGy-F=AS;?xcaX(^jy*Uzx#ZI4XDDgl*lf$ICJJhyJ z?#D$D*XFBXZBh{YoRmp*pZZIw>xJJ=rleDqg6A0s64>hMv#x6@S`5QWfKdHt4ZU}W z&FMSXGxMnW)OzvWQ4LW#SaKOeQ$|Q1O5%L@B3r{ zS3ugarq2yW6;S`YH(~tyrI-7Im2N>qg0=7xEfa_RWI=|&Nll5suG#NTtlZf6qB0X` zbgr`dXubWxHCes4XBrOZy#4RY230vPNF0XYUkAd(yij@~AdlpmkpB_zuX=j@Q^Kw>~Bv;?Ss;bLafaPU09QLt1l? zC!3=c9vRn&g_Oh3rUMUejRZeSAPFKxgCtEtmu;bM@6Yd}GP}r%=>dty?YMd*TPEsI zz$wU8=Y9dEwQKBt`gYo`m)W-;+8oS@?s+2cB`{~_DZY8#_5^S3lRT8F4&BuMhw?qAE&Sovg`*3+W^75CJXrl*I_#SHoas8q zh8>#S{`2`N|91_x$oU%9j)xsfpKVeQtf4=-~hIewjagj07KTz4X8M_jiQSCQAk z-GO61kIwFCm*opc{>hQHaUP7QF&#f+M-rr}+LCK1@fo|nOTRxG{gv>+!Kp;G{;3o7 zHFF!j{;Ry<0G)HR;tt#LV`Emsa=CE#54*PUxj82(OcUW_XP?DTX9C6e8%G>|?x|I! z0=*PTBxUrMe2uLDgRv6HmQ|P;W$f0_hGV!sURUx)BgR_Qd4RO?pbVysv*yw@WLhOm z@{jf_(6#2Zrl&|C zTm<3_9Jh)77@!IJL`FzH)oG*_$~0pIf|s|ibhlLcx;)|cxGp;I8R9kO^Ddx6)_MC) z``NYjU#ZNG5~JE4=y?myXs%aG6Rrm-TZp@SAm>E=X<5_+@>G4{A5?IR%B9qW(seLi z8M^11avnVA_(oM9ugFtSZ>LVi;cy-r=VY8zsZ!9{NYwl zRZSgMOkv&Zv0w7yhbnB&SEuB2%ka?aF!CcZ{#`YOJCcEqEKJ3g+TEJ}yaMQBect2l zQ%GW&xHh4lqUd9^VuTeozxrNZ(;Rb|x>Jq=f1tkRwvVFM& ziZUwl|7_E)@WZmt_|f6$uy>0|-L>hLkH*hr9&By7o&xQaSVrlnkGHBh9&84bzoSb-2UGa(YxvNVDSI4qLEMfQoI4{#(ZEKo!A0mPN&dB16z)L%Rnf%7bvVZwFLiuv9bQe&-$*5&hhw zH0G%}^2q1udWReVkMT$R?sq^8pNI!}{Y8BLbN|{PgS#AnafTJXDPzC-9>L^sHmXFZ zeKgZ_br+-Yqy*V7#g1p7CO-7zL>L&(rK?zu|lnPp^@>|#R194TM@-D{N0|pGN(x6$_L-?qet^QTSSVbmptRv%K1-B7XmYUb+dt zZ+8Haf>^;!Tv$t%zu9`g^3g^!E-mfliZXD<(2e?(M%%bS z@B+Zs$o_4Vh0fW;_7_aXe0qAZ`y29g4jp&U`Bs3(8D{}NzQX2(?IfA5R#| z#|dJ<%Z^uRuI7_T2ngPah1Qc3CCDrU*vm8&_i1C@s&oCn`kbQ1cYI7c;$D9>@x2lY z(h=zNwOa;fV8$(%HU^52zyE~J!7U$2weQ+04El^WdFv|I|Mz>b(J;wFJ;Bq9YI4#3 zE>JG(#J_9^aV$Z;ax>;YfAb1!HDTzF||sbInuDa zoCVOYs1Md6l@8Q@oa&;!$OG|IhvxO4l;u<0U048^C3)>F)Z5c~GBh|+0bG_vpQl$i zo0lcJli$jFTi{tiwawYgvU^eg#t3V^#|esi>re00&kLw5?uK|F}+zC%Tu zCU?KF5}((3?;7uo=2Q7?z5O|{$Kj8D~N0Puy!=8cd^5cew0%7i43(zL`I2D?(s z8-C^oIL;C~!U;y5uF7b$bu5a#iph!7jfTjX^cp0pVGE-xL-6sf4khB(Y~o>_C2?J$*ipTm&s~w7#7|#xg>_!^qo4x=j)=d z_CxA~0xYjZlN(66go`5v<Z3m2RBpxc?N-+#`9(DF)|aki_Ov-25N zkC~8e0~PvBN;RN~RCg!FJ4*kYr0@B&dkh&1{wFO2B!ayuOpn7QR&HEP9j8fdS^H1mT3Q?eK0b7&caTDQ|{E7-yG5NY}y$<7?Ov*N@~J$eM$s!b;HFr zKq;mTN*|W69K%R45jjYGirOj{CWQ|<=)?Yd^ue52;@!|q_0yNKJ51n-pdT7fzk(`_ zBl9{t1KZYoyoDJ$DMD*3I?yO!E26&B3l~EJaj6&WnZyM#o&uwB@nxYKSM-Z=6I97u z&vQ&@*{h^iz#KUj!ZmLFodi`?>Chnp(Jusnv0c1>WESraYbY7GsVvU{2 zZcPEUyX*35`1aiD)lYS&pw_RPcx&&jb1d|KxRSnp=O8$`0Q&aMWH)%it!Gc|fmcFP zjQ>q=(AHTHWpL1TD%>gS!7Pxg7V?EG{ptp?BiOi4yZ%s1`U~mfb!2w$;#S+S&fL!x zSNxHr>)G+B)s)+8>6%2RS?mG&ay)NHeA%&5^7u-k^v|)S7JweW%Z(KmT#Mr6`tIdq zx<+7HlQLk=!$ovR_+`TS2cc0ba{k;ZZqt%odTX%~A1~a(!s0l2xal#n0^(?<5qNAGw~N~2fIBOQb5CALnMb^r%=GbSJ7f3LPU#N2_?(?4W0_3l+J zgn)4UV#FWu_s-f?D2VYq@)rR+4^1aqawX=OvKRq-pb>n6w;7{l;w*LWn}i zhKuNaa?F|W{d^6bitc><^3l0NKkPK6EG$dMgEqO$<~cjtVSsynCK&5Pwoaa+N%OH2 zy^F&a>sn%;@w0B(KKBJPE8W=D3EO|Qp5#TR`qeAQBVQ-a#U9dVcg)4e-Jfe~F24iG z6~qHy4mxN7ui2J0&nAlsu6`ldbLy36y!a;0=oW=Zp&Hz{UDd;5GdhnhO7ocpTSa`D z<&T~DP*Nz^{0;DmXTS>y?FbMHWOOAv8NK6_Y*v6|dAT0|cBvTbym zmS18RayQG<&PG{@&}Xo}F5(|jC=ixbvP5Awx4Qqw*vnC`X+*(bHgssj6PMCpEctcv z`4CXH^3!ZnjF2?lLE|S)fKQAICX?y9*NU-M{pgNQlzIN)Jq~^#Cjj0(&qbpB#Bxlo zBgfn9H=QO`pD`6v?r@86Zl;+Hef03mV!VITkqEv}M^{&U4yY=Z*#{xHkegN;sYN_I zdbl7mapI~w$lFx?WMHoMd!`CTaB3Pas1<{Y_r!cg@u@Y}NI;nXZRq*ue$kQZ2qxvU z(8{4P2}X+ecmiB6AO)~r#DKLy!!Mk$xIrrC+$vPk>5U(~XV>wBD?u6kQd=GOu>o1? zeDb&!e?heCBI}|8*nuMZw~&l*-cydNl{7q$>Em&oGG;3!^(il`R5&hC_?`MH^*$;V zQ{c;7*PIRzw9j#~r}oPhg$x`Ea%cJxe4k`?U!&Z&fDFw2wKwhsy>z5?!|?q0fb(5KwwtHnr{kY` z_ggfLAvJeQ)XU#-8bO>|rpwAOJh=9|uBqQ|@UYHmb+Nvzq%U+~{87!LwC=+x>Mj!kSNqtHHyR^9WqLtl%-Fm0Ym{JYUrR)bH9%$j6$Q!K=9iHDy9l zaIeGc@BNu}q$=a9sFBdU5RA_}cUqEtGY4paNMdb9EpeQ)(f0|8OB9SwsNR%_Szlkc zhS)sLN1~BsEr~j33XT}fe9yn6_@eHFe~s>zNYWw$NibMA6$A%{P8S>v3?w;itZH@8 zvSpu;fG#5n~qK2mclwBj2Fu@spGO*4$81O2Kt~Xa1#Z+a{A8&K6vB)2S6%j=4 z8)Y`kmPKp1V&2b*!~pqsc}=HYM(w2wH&RA>oN)emVZcd?wS@E0l?T;lYCuEA1&x}< z8Lf|p&Bb?@(Li`WY7#}$pQ`yx6K!f+8t)Hbz0{wQf;NUvm5{A=Qp4n8cH?Kb(akcF zX`3x66J>?_nk^3&{v&^}+rYsvRP(aBIYIr{Axgi?Zknn4CoBD`yH*J+7P?N`8g| z^2<+>9{hbinDVzqAyFFtPxA<@2Sj%Re{dAaQ0CR0CTsmZUdwL{RL5zr^4>%n!8HhhXM zbu}=kSPHcu}io>o+E=5+>@0 zj0ovVk@igRoH*wq>O~v_FX`UAdxh(+zDpnWIf7-}4!IaB+1gv;H6d8MO?=fH-k>+^ zplsFRT=iX;@B{rU{v3TSD>{DA*t>)xKlV|MJ$F_$Z=RGgk=q7~az0KX4=sI_DPf6y zj#EFCs&r4o8Wiea2!Y9S*E@NVEo3H_YX(={;66V656Q|MCCDyQY-y0@;|tMa(9iN< z*#(?Yt7081f;J2j3s&3!452ZiliW*Nr7dvdAWzii5bLP%tRguY+VB#=P8$I&h@K*b zWF6-^!Bblc*wagxC8b!#bTqtN)yJX}R&|qWQ32;t`hf>bM^_iwc8YBHy*OLFwJo)MEGD;}49GU{YtUA`b6&wY}OEWgu~b%>iYZ0E{UBJCSz?Vm9$iTLPwxUk%%xKFF$99CjaV#0y6 z@L&q`R!URCTh7@#e&E9m3a=;Ja^|}B&hEuDSdOPq8zQ&TGykkV725jV#pMW-f%?X1 zu9F{ICzN&#H*5abyz8c$>Ex{ers0&oFD8(QK?{K}+>&hM_q<2BRi>rk!b8u~TB<4a zJ>=N2ql078-tN24Z=CZ1qDKbc=m&}n5~>ukT$%6x4IuM{Dcb1L9V#}2%K_OhU!ThV zD$AOmS?^^WtJU(z=JRR>sE-@|C+i_p)N|MJ*JZbMP9GZTJ3lcV)lty1dt=q zEBmZg2NZYGpM%z(=m2(h)TNyuIGgI8C^Wew5$Rv6Z5@Ju#sS$?Ui{$9Bnv?7jB7L+;@oj zEooPa)m;oMO_3^+ z70J7bk4IbEh}@;WmGAbRu6>HyP8UUmag!n|9jexZ^Jv$;bkhC32s0sldm5RSNvL0H zNd(z+UCs7~Iw%wB9nm(%m0D2o+0zNo<0fNIAK2+o&25_j{mWVdoobWuc{T z9p{;`U`-Wyg_atwjiR2DCigHAhLTC3Ckwk9FY*_|RCM`zB#f9VUi z!k>J5QC!K}a05UOpyLV)ptXs^xRd)6e^>QV&^NthUy^mg5!1Zyz(q)&v*6R-Z*px` z7SGVNDRYPOf3ap>ZC|OIF;JCrB3h(!11Elb|C^TeS)oZzhrY~1JMx>y&V3@dpK0O~ zoiH9k=@b`Gqs6cR?@V;Fv7qPo_P)cCLrFeJxDzcFwKSUL$$&=T2er$rv5oP649}b8hYtP=QO~Rms?_%143n)n0QNQ|c7@V& z4++FU{YPEG(Y-x~!8;xM;g|8LQU|Rs>Ai5?ot=y?l~8|Tw!E80HY;){4Koy1I{veA zXjC5l4B`98KqSXK@-KxFbK8i0eNyCPEy3^c2O3WO1~7O351r>spk1dG>KLrBh3|YF zLd+#kWc(@g$wiz@H^S4YQhUty0&qLWY}GlWX^A()=PT#9BB)iWlA*LKVGqV;@tV$` z-Ip?W4sdh68c*!#tZ6&0F(U@4Sbn zCs9z=ar~+OeI2o;Lntu;AW5!z;@XiKsMsQ%t{NFAa>r7#zkksjU3%b&?C)5#EIVvq zQ+dl0+to6ERb9u@nq^t16*kXcmz+2+Y{;U-8ZzELoqxyJ*5m}2T_@@F4xX(atXI*EHlBAhyr;rENm0JSCMuDZ%;fA_TYCtNRLmHXI| zCgAOhwV1C*A+F|sa49$u5t=OOqdJfD=cDT@X0WGHCZ*;>1Ky-(@)xT}H`?0oR;=^k zk14;CCkLZbe#=LD%a@4Cps9~f2mR3m(KzCRN-B`V+0{y{=yuKtSra)=N?p_Hti*o- zB)FF7(5POgKY{2fw!gt4|MdM@{{6edYK*7&w6j&&KI$m4;uV%>c+p3c(S5(Q)IRVt zQ%PRAgdrB0W$w_tf$tPC{{9zo{*h({cabJbye9FRT&T}rM(w;`bn}|X!2{;ulIMElyrTxWn$(AMu7~%3*GanZe|ZfV+d&0MbwVL(aG$seiUm? z(t%S^qm+&XZ-#iql#>|Qpa>JC&ky#iU;G*!tGan6FGFcqlO^SVn(}{ZV(dHz4 zO8s3_OL&WZAbS%C1Y0@Fb#5@bu`S8Ga)IxW3SaFi)1PT3QEwlc-Ueo?wXQy8*g}pC z^$Jvl!}Cwh2FJSBD+5=9l9lw|uYxGvK32o4#m)40tbn`)Kd{ zSn0}NsGK+QqUJ2&)N~WP#_&02@ohb$N6OH_S;rA5tTbaPs z%`l-cL6?M2?UeKzb5Y`+;+~y9jygNo+>|z*&fh_^8QKQ!J}x0<@b%Mf>tLjRTV3V!56;BQJ|K|O{; z@B!bp8f*3g;hetq-cO2FS>uv{mW%Q|GoRA%TpuZyFbUVTjjuNe#8~vV!sZztvQ;)x zuWmr__QYSI|La28B1haPVgC)~q55HfuJlU`E9m47Qd)ceXy(KEs1iy{icxAC4Q*73 zMqVz~K3Y>?1e7nu(Zx6$y=B#zNoE6G^eHY_dsy&zHN0fJ-xHS@sgR?-bQ;l@|eCpQ!tqr)VT!*99qw z*q!0wi4SAvhZQcA&Ym|=d8jbeH4e-g9W+=IrgZ9~4NFxL_&FMdi%w|SYh8UaG-fFl zui}wj)V{aA@WH0Znf@Ap=YNoRWXJ{aQ4%+8kLdkW4;|4ZB5g;%T&#SCcfS~&#Z7?j z*#>*pZx`dVK|Z8hhC_M1|A2qH7JBZj*!CJnFy*Um0)>|0k}98H_sDdp3|UoW&2)RjvyljC=SE*-77QS;Nq*YK7RX zt!iuNZ{`^5a|Jfz&?MR6%FJhZ-Fx-qwLc|%qhM>C8y|X4LkFmBq11|SUa0M;@{HMx zGE*RmIzI;phU;jgw+6R$wj6>@N!|)fbl+Gm1zOzEQ2!82_a2!*p$3ueo}taS_2kd9 zF;P8p%*bQX)GnZTbIs`YYKSrWIptY^z4k^S)ME|;+UC6fHW#S;Wxd0q&RLE{(eOaE zS#gbLRo&u>oGfmj3l`V&?X`X0wwi^>XC8K&K5JN`C*7EZo7ISl(H4H<+}W!3;tk#( zWy!?Tr`(~DW>R}V&2j(FNVixOxq5(cI&Nv( z`*i1W|1chSHj!n-bMoNAEo@*a-PNP>qD@#4xy|jw%BH|rk)T4a>>1e^M42PmO0utL z`{BXE7u}xUnBC!M01apj0EB*<{%Xxau_k7DlZng!ntrqK6T3C(kx2T}?DWup+UjEY zNK{RP(gi^*=C9RT;|m znl!gc{_xcYkvY2Fhtm&MUU8!0-Y&^kw8vr29|AyK+phRi?}*V(#~C@9V(4`9REUve z-^dPBa@b!I)!nbGd#x0gT+}(b=fqN|j=}Xzc~T9}B#i|z`w2BvrS@u=(-P)mA}z@v zg%~U0`h~MSKLIx=*F<;63R`lKP1Iq4+S5@Vq_mzR>)`Ws$|M$^=LN+^_d=9DB>t2t zkrb5b3KpF>K+Q%z$3*ZQB?2i7=)lfkO`C3`6-Nw}*k|1@uy9el2FnPh z{|Tmmn(a9K%FUI|LGUgZU91nv;DLVOMs)Lkq^wn=#N$`z48=3X55qrgYePTARuv8M z#jig~jC&kh*Y(^duVevXlZk(hvwox>nMsF`ykBLvPI47o{@NyAQX;8Z5u{t+;U)YP zykA9K;3aFz!_>s{_;L*nrjCzs+~mue(@`$?fj83k`_d2adFd%@;dxP0Un%Ul2J82z zLJJBfLL|7Z5uvVlum7y0BVLa~`qs^_Ti+No$)?4{2y6slfZ;w0|2>BW=UPLlTw6!P z^?1DRZV#!nOy5GnVIa4czPaUW<^;@4Ex8`M{Mfr5NC03iT4DDsXDr9Pji^^Kq(pH11S2 zE@p60ze~1D4YDG6{36)r|E8wa+zft+n(ne|Hcg;){}J=HTrNwpniMwUw^3w<)K&*_ z3~;%+Wc1=Fs2Auu=N7r@$y%5^Dck-eJ#WKZ`D9ND_w_KOZh6f1M-p$-w=+rqSs?-@ z`T+@8A_p6R1xweb69w-Gb$7!oml~7Kj3ucI1of1yw3w9*O=;Dkfa5>?RzM6jHgTsa z1dSA!H4csg236Hhl126n?F(j^S4e?F<1JYHo(Xfcg9qqbI=r%UYSqPxMZU)ySzOenmZUlE`DzerzRcuJcS%2 zbYPlba+0=r2d_W)f5X~zd5Z}Bl^#oqjZk;Zfh3xZb4?|f73>tkA7kRADp6qACY=I- ztDmDIz6{=-fd`#beqB~{#@4hSp+V)dv{A3@QWyFLXNb8|6LiygdldwQHRFql6{E_i z>}udHdrtp)1Z{IUO->s!k}sDZHfY!vuq^5Yjt25H(5WtBj!d@lh4l`3gS-S|z6Hin z%;sqk=F{IW*c*nD%n^mqSXXbH)kAx*SFDD={*sie(P{Gv_d926*DUGYJA&(RUU6jY zN?P^asXs@FiHiq<3u$F&_8hzQT&|{ZJ@H_mg)isYjz*|VPQh_#xva?KrL-sd5ji~c z=rmd_8Tu}p;FbY2MXrj*RTumx?udR7V@bJa!v_0r(7z=~ArvmdjRa#nF>GHub;P)L z`C6a6J_)lX_xxrmKT?-*IGq_b(a%R|J2?-T>=dbpUWTZTaZS2q6T3`ayzz!bF6{(a zk2Uo7QHuh16n58@;yBuQ`B|GdGMB}lYP7wQbXy*6U*H_Yl5~$RQFHRkBtC5G&Dnom zzuqRs!{DM2dLXTUu`yTmU+(e}lH?-husqNFBgZH9m`|%etH=|Jvr0UWF>{x*=6=&$ zaHUT(4wy4N3m}G}tKY9lEst#&Uak_Eem!t$ejB9X=$V8sC5V28;zHhq)xlzL@}f-* z1(lS=#M+wl0%?fH(!)BR3SdV=@*)+9FsO-!hb^gy z8(C7q``wN7)JG2SFK1iwj6ZcC8>3AUUi*jNXsrTcmB~srO^evpE@FiEM+&odH&14S zCVa=@vii?Exss5qY!Z2>qV%+Nd6U0`6aPyJQeF;e>boR3+eGp6V6DKqr}5DRa38&5 zW&G5Y_E3+J(j0?DZyHyfL9>@{;(;D(v>VU2A!ess6}23(q1QXm$K8s!r(Zv65MkZX z-5*3d8f*q!JU~Fj@$eyMU0Pho@m>UR#2QMmB4$G*qYtTLY$NbRm{t&*vyM296D|zMm!7&T{1RHA64qpWYT&#PH zBga&30>2W;p81=a1)7}UttLDYpO3_vfz&1px14a#98)fT13iEx;GHkq){Hlgl8T%m z$*tybVIgozVf)_vm9w_bQV2Ub-$;-%sli%;vU4;6asst+5VG_%(A~9aqg18eRyG=Y;x4R+z*X5# zxvzn=27`~Va8MU~i|w=&W3^5=-jm(7!BK<5CwSyN>5kZ*Z>e3p#EA79xNAV$6OJy8 z)iZR3xM4ZKeul$KaQG>)AZFX;-;+y-thk{t?#JX0z;XY&^B=)(ASu@$y8XKpjBJ5P zk`Wj%;P~*(_ejSc@2JV1Vl&iN#cRmx@A;(yzX}NGBJU`WQu|I&%1Nvq4vQmGgbgm5 z00hIQZR`tY{GQVO8X&d2Q^5mKk>sjXqqC2o2pqLzUn~pybloiwfU3EjH@nVU$FnKV z`>P;9T?_|PxTwwX*>f4@XwnktPi1!iX)602x^ZsiAV#Pdhz!;)He%nkeA4)BS(Z<2 zy}FOvKb7?MX6dB#;`9FBi`sc9PU)kBrs3>?tfUXK1sS9AI*Dyyih#vKpBEhr*Ey4- z5#3D39h1K-yy9|!H;{5p?l}cl-Nd8>PA&*2OTP)3&qWDffp}}4g#Nr>%UK8o3`K!H zDW_ho9l6yoVIRrvFA`#Zp6v|gIH794U4~{?cjLWqlCGn-I+z)UsD}P41?gV0Us+5) zQrA0wn~y0mNYFv!RE>~ivckSk+E9tt@hWdCPXd&d(a3PVTM~C2*G!Ti$qEnqqp_65 zS&9i8V%^VXi(Y+e{Kt4#3zBqZtfFmBYzwyig?YIGu(kj9#4AjYc|h<}Pzky7L2h zR$DTwbygDWvwM7`2-SQy438&0s-LOn79N;v1m2=5{hYO_RR^&Y2u1BHk2)@Im(S^&t_t zqgf}kDRkC{Pr4T#wtZBFf{J&Q#j|Yfu7T_;HRD>Brimp^4_!*|1H69tqI*q)-6I{& znF{^8(67DuLjlIH)-d(y3GCc$@X<05vcgHKY^B58t>cqsFJ|dsv?4;x(@|doq-%UR zB^vk`c$y@TjLbMR%^0|}GH3Nq=bH@v7h#I`hmCSI8Dk{#WhbO0HohW$I5f6%WrJJ@ ztEa!^3i)ReHJIZo2f)PtPG@702MF=8PGt66i@T-8tI@pRPO)#43|%>Eh-%xzP2gjxhtw%y2q zmU!iSbJGD5v=#%a=w9|uvOv)ABhgUv#yZuUE5UI4jGw`x-!U-|C{{39>Va%;EQxv8 z>WdqCy1a$Mr1tfKZ(3a=UbYQ<&jAYzxk8!LAHoGCYy56^orhLXEoS(Zc|00P zxbGH6kulEK67p!_7&%&L>2{doc)Eu#ftK zJy|4BX7gMe=;!IcsUMcktrj359<~=veSUvCyttPiE2n()=}IF^%wFT|DepM0ettNR zjZ7WCs0dPYFZ$3FZ|#sEtQ3+bgoE&nI|^Z`zjz_`BH}*ans%^@dA3(;XkOJR=!4;R zhM~jbzvyGm5p*DmgmxK!L<6V_*sROh$H4?dIz zF&gR~DM7iC!{qQSrY9qE$>$uPMZ$IDnWRwC`a>jReje9aFyx5*mied=F|R!QY2#xJ zc*op&Z&y606C5Y#e0E>y&qh5clXV;}Sp7uJiY;ajA(nnIb})MIEa58)cXz2wLW6F7)$DI+~@a@i}8u=u4p=trS1iKS}0O8Km9;-m+>S0yWXn zkQo-LbR{WMDd}$=>wb^%nnF+aSw9~z%=SKXuT4wrAe)=`kP0j+KQVnq{@EulX+$`U>b6sa~yL9~>MJfH&A{#R(>|JI){{)Oh%_(F;yzr@z*D z@8>!n!8-%uofVxs_a@yQ??2TP5(jw12Kb_D*bGx`%V7Xu`YTN!D1g;dh+5hp?_y_4 z^B=Xl;TXvX>-83Rf5G8s@G}dOp(>QJCT3^`zC9r8(c}#T&;(VIHPystBw8vRdRS|s znP$@msjAxFyS=4B^Uovi(S-fJ)H`6%=m^l zb>aJU$`7N2oF;ulc*BQtzY2bw1YNA{7@Ht}?>zJtY>B_iuB@r);Ig;bAaGuz)ZxLE zM$<$aQb>p@%P9*!_-o-x_xNx3x8l|$ui^XV@$jIf4!0&S^E`ocecC7;MF&R2a3=X|Pir&qMk1xJQ)yeS{(&y4QP3%MX%*W5|;_P0{A`^z60{GQq=`KoXar(W(Sz0#VK2vyk}r(vlDR^HhDB&X|@r#b3?feap;ks z{09ZfS)wZMr5ocFbcu;j7wbrjH%#xcu8&;ceE9z6NhVEtSo6q|=p%}k>I&P|cw&_C7=~72*N*|9 zl6Ekb3dI0#w?#6L3VtnwzUS=ynhz^$l*-$qn}PFM^J(asDaX8eaKBuBDngK z+{PNp%GyL)uLs1UIup5M7pc2s-2bH2t_c;7d`CDT+QlkFaO`SA+VfYA{JnrLX#@55 zY(iH;Uw^LF{`xE19|cl+RfU!uDeiS?q$JTqAATRsx*v%6Ipd*Hq2yk1oF@LGZUMFN@&byZd)a%iQS|WYx%=!4QFOhTvaEs zuQB+*WXDrM@>`W}|HwQWuZ8XQ)ZUx=_k@~VKX()BgyOr-O+9|Qd#N8HDs}63RN4IFC?-=7=i)JaQgg|+u3HPv?QJ=*X zre`7MIq~f$D^z|V%HE^n1yH^7Zo)BotY1{1gOEGoEW_^d#QP zP-itRb)$btft!eKe_j?_bSN!eg8$3u(Z%gP>>1Z8bNe+SH#x~l*CK}~vK*?8+ zpNAL`uIF7ZZ$cb!GA&J9Y5#*kM(Iz&Y;yS_@_2wx-?5URIorqD#w+93{7bneGvee2# zK8E)n(y;4097Plue6`4fDmrLvy^Ws`hL@k$>dhFSVeub;)s{z;WYr2V6Qb8NvAz#R zbNnN()6KHGfD|fi-q9v5uiH#ILCvkpB3>w1q=nTz3jky}|1G*nUJ&)G%;tLsv*&;_ zn(|)Q>=i5oB6fKrDR{A!>Hw~>GMj$>jx+rt>jwiSFtk@Lpp~X%bh}4(-Uowpk8&$O>_8fDlaZSREO*NxO7&S3ugySfo#<6OL z9l1o5YgyJwudv)^JKOl3-@oUN^UwLazrKHc{&~LN=XpM_=leYGXXa2b+Xt%2X5HAF zX2h22yfmvB?p>arJ1kGwK4JJ%-K!cLFJ^5&od7mE1Othil0uBa0-Bg4*{^p@D@ES( z^mlqBG>?@jJr?#oHpfgo^WOZYMO2^%R>Q>3b$Xb?UqUP#>Fd(7J>>?H0WWW7Qi(Qx z19T3A9eJkxSyeBTh|MR6?ejpIB{|$vN+J#x@$v;Y-6=zEGkFC#5Tq*Pgi+R>h?4wc zn&6Ut=L$1$9y_eGVm!1Yu`=m~tRE=-(*=m>IVf`?wN{J8^2)y#y0t%ccn#A>W(?x1 zk$nx;P;_vS#;t%No?zp2k*Jl1*98CMa+c_^I0;0PhCJ|oIL3zAM!3(+HE2CVR5Jxl z-nmZv;B=Mq7REymY@6DSqt4WR1`k~uAB?xWd%y)3AkEjtPFxh^eHmYpk~FNkW$yY> zoH*fm(LXm`nqiljxLctdle@HSYLGOQ@RA@)V=3do*&ShH(E)OkGbhqqHf>J(C+#<~Iv)m053Emt5B^;)~1bTQ~{rh?3N{La(&v%)uXEA`de>WzV<)B`Pb5W+^)fO$98AIFrIA#pB0%3s_ zzujhY-Pp8ou;#$7q3pf4300TjqQ0of9PoL$f>7DxEC#b~$P#Jd!?{`4Iq^q=m?YLC zT3mMa`4drotobyV)VUi;y3~|cqqw@0yR%CxMfb648vYPy_^!FnggqngQnQ4033TqR zOHgny)#Z>U{%da%m7G@PIPja3-pm3r`V{q#jPk{}beO6<9Apqh=MLSFZgy~4OAmd0 z6e*T1Zj=hc0~k00)t-e}-jfgxq2e~igHUnAq>)SVU#ZIOZ~W~U3U()(&Q_G53w9g4 zP@0!*(F=K6W&SEg0dRYW>$dOGbQr*D0Ja5^ISvqCPP))}Fu`0c)0SlZ)-#m)W5%rD zbPUQ}BMRG}{3JFXW-SOLnyH+P2>UQ=wU(~R#=D;H1FY}7Atb1jlgj6nbIM0`v^wsZ z)2t{o$D)?l;4U7RW)JeG{bdd!N>>2mhta82nEGn6?uFQ1!QjZc=&7ZmRoIa*w)!gR z6?q>+pM7=bw}1;j-A=g7pQXqu>sh^=$AC#JjCSLOs;%9{_V{TfH3;32`z zyE5*eLnV;_K@{II5=mRer538GY*gvDD6Wd`kzz!;pjooMC3@aX86l&Ltg+YIjPj4y zjGRY(4PS@g|5bq~8^9cM#1D+<9hrqdAO~qaA+(5aS|s`$H4+REBm#-BcR<)9-G~Sz s+6jerali:not(.tox-checklist--hidden){margin: .25em 0;list-style: none;} + +.tox-checklist>li:not(.tox-checklist--hidden)::before{position: absolute;width: 1em;height: 1em;margin-top: .125em;margin-left: -1.5em;cursor: pointer;background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%234C4C4C%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A");background-size: 100%;content: '';} + +.tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked::before{background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A");} + +[dir=rtl] .tox-checklist>li:not(.tox-checklist--hidden)::before{margin-right: -1.5em;margin-left: 0;} + +code[class*=language-],pre[class*=language-]{font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size: .875rem;-webkit-hyphens: none;-ms-hyphens: none;hyphens: none;line-height: 1.5;word-spacing: normal;color: #000;text-shadow: 0 1px #fff;word-break: normal;word-wrap: normal;white-space: pre;-moz-tab-size: 4;tab-size: 4;} + +code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow: none;background: #b3d4fc;} + +code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow: none;background: #b3d4fc;}@media print{code[class*=language-],pre[class*=language-]{text-shadow: none;}} + +pre[class*=language-]{padding: 1em;margin: .5em 0;overflow: auto;} + +:not(pre)>code[class*=language-],pre[class*=language-]{background: 0 0 !important;border: 1px solid #ccc;} + +:not(pre)>code[class*=language-]{padding: .1em;border-radius: .3em;} + +.token.cdata,.token.comment,.token.doctype,.token.prolog{color: #708090;} + +.token.punctuation{color: #999;} + +.namespace{opacity: .7;} + +.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color: #905;} + +.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color: #690;} + +.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color: #a67f59;background: hsla(0,0%,100%,.5);} + +.token.atrule,.token.attr-value,.token.keyword{color: #07a;} + +.token.function{color: #dd4a68;} + +.token.important,.token.regex,.token.variable{color: #e90;} + +.token.bold,.token.important{font-weight: 700;} + +.token.italic{font-style: italic;} + +.token.entity{cursor: help;} + +:not([dir=rtl]) code[class*=language-],:not([dir=rtl]) pre[class*=language-]{text-align: left;direction: ltr;} + +[dir=rtl] code[class*=language-],[dir=rtl] pre[class*=language-]{text-align: right;direction: rtl;} + +.mce-content-body{overflow-wrap: break-word;word-wrap: break-word;} + +.mce-content-body .mce-visual-caret{position: absolute;background-color: #000;background-color: currentColor;} + +.mce-content-body .mce-visual-caret-hidden{display: none;} + +.mce-content-body [data-mce-caret]{position: absolute;top: 0;right: auto;left: -1000px;padding: 0;margin: 0;} + +.mce-content-body .mce-offscreen-selection{position: absolute;left: -9999999999px;max-width: 1000000px;} + +.mce-content-body [contentEditable=false]{cursor: default;} + +.mce-content-body [contentEditable=true]{cursor: text;} + +.tox-cursor-format-painter{cursor: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"),default;} + +.mce-content-body figure.align-left{float: left;} + +.mce-content-body figure.align-right{float: right;} + +.mce-content-body figure.image.align-center{display: table;margin-right: auto;margin-left: auto;} + +.mce-preview-object{position: relative;display: inline-block;margin: 0 2px 0 2px;line-height: 0;border: 1px solid gray;} + +.mce-preview-object .mce-shim{position: absolute;top: 0;left: 0;width: 100%;height: 100%;background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);} + +.mce-preview-object[data-mce-selected="2"] .mce-shim{display: none;} + +.mce-object{background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center;border: 1px dashed #aaa;} + +.mce-pagebreak{display: block;width: 100%;height: 5px;margin-top: 15px;cursor: default;border: 1px dashed #aaa;page-break-before: always;}@media print{.mce-pagebreak{border: 0;}} + +.tiny-pageembed .mce-shim{position: absolute;top: 0;left: 0;width: 100%;height: 100%;background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);} + +.tiny-pageembed[data-mce-selected="2"] .mce-shim{display: none;} + +.tiny-pageembed{position: relative;display: inline-block;} + +.tiny-pageembed--16by9,.tiny-pageembed--1by1,.tiny-pageembed--21by9,.tiny-pageembed--4by3{position: relative;display: block;width: 100%;padding: 0;overflow: hidden;} + +.tiny-pageembed--16by9::before,.tiny-pageembed--1by1::before,.tiny-pageembed--21by9::before,.tiny-pageembed--4by3::before{display: block;content: "";} + +.tiny-pageembed--21by9::before{padding-top: 42.857143%;} + +.tiny-pageembed--16by9::before{padding-top: 56.25%;} + +.tiny-pageembed--4by3::before{padding-top: 75%;} + +.tiny-pageembed--1by1::before{padding-top: 100%;} + +.tiny-pageembed--16by9 iframe,.tiny-pageembed--1by1 iframe,.tiny-pageembed--21by9 iframe,.tiny-pageembed--4by3 iframe{position: absolute;top: 0;left: 0;width: 100%;height: 100%;border: 0;} + +.mce-content-body div.mce-resizehandle{position: absolute;z-index: 10000;width: 10px;height: 10px;background-color: #4099ff;border-color: #4099ff;border-style: solid;border-width: 1px;box-sizing: border-box;} + +.mce-content-body div.mce-resizehandle:hover{background-color: #4099ff;} + +.mce-content-body div.mce-resizehandle:nth-of-type(1){cursor: nwse-resize;} + +.mce-content-body div.mce-resizehandle:nth-of-type(2){cursor: nesw-resize;} + +.mce-content-body div.mce-resizehandle:nth-of-type(3){cursor: nwse-resize;} + +.mce-content-body div.mce-resizehandle:nth-of-type(4){cursor: nesw-resize;} + +.mce-content-body .mce-clonedresizable{position: absolute;z-index: 10000;outline: 1px dashed #000;opacity: .5;} + +.mce-content-body .mce-resize-helper{position: absolute;z-index: 10001;display: none;padding: 5px;margin: 5px 10px;font-family: sans-serif;font-size: 12px;line-height: 14px;color: #fff;white-space: nowrap;background: #555;background: rgba(0,0,0,.75);border: 1px;border-radius: 3px;} + +.mce-match-marker{color: #fff;background: #aaa;} + +.mce-match-marker-selected{color: #fff;background: #39f;} + +.mce-content-body img[data-mce-selected],.mce-content-body table[data-mce-selected]{outline: 3px solid #b4d7ff;} + +.mce-content-body hr[data-mce-selected]{outline: 3px solid #b4d7ff;outline-offset: 1px;} + +.mce-content-body [contentEditable=false] [contentEditable=true]:focus{outline: 3px solid #b4d7ff;} + +.mce-content-body [contentEditable=false] [contentEditable=true]:hover{outline: 3px solid #b4d7ff;} + +.mce-content-body [contentEditable=false][data-mce-selected]{cursor: not-allowed;outline: 3px solid #b4d7ff;} + +.mce-content-body.mce-content-readonly [contentEditable=true]:focus,.mce-content-body.mce-content-readonly [contentEditable=true]:hover{outline: 0;} + +.mce-content-body [data-mce-selected=inline-boundary]{background-color: #b4d7ff;} + +.mce-content-body .mce-edit-focus{outline: 3px solid #b4d7ff;} + +.mce-content-body td[data-mce-selected],.mce-content-body th[data-mce-selected]{background-color: #b4d7ff !important;} + +.mce-content-body td[data-mce-selected]::-moz-selection,.mce-content-body th[data-mce-selected]::-moz-selection{background: 0 0;} + +.mce-content-body td[data-mce-selected]::selection,.mce-content-body th[data-mce-selected]::selection{background: 0 0;} + +.mce-content-body td[data-mce-selected] *,.mce-content-body th[data-mce-selected] *{-webkit-touch-callout: none;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;} + +.mce-content-body img::-moz-selection{background: 0 0;} + +.mce-content-body img::selection{background: 0 0;} + +.ephox-snooker-resizer-bar{background-color: #b4d7ff;opacity: 0;} + +.ephox-snooker-resizer-cols{cursor: col-resize;} + +.ephox-snooker-resizer-rows{cursor: row-resize;} + +.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging{opacity: 1;} + +.mce-spellchecker-word{height: 2rem;cursor: default;background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.5'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position: 0 calc(100% + 1px);background-repeat: repeat-x;background-size: auto 6px;} + +.mce-spellchecker-grammar{cursor: default;background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23008800'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position: 0 calc(100% + 1px);background-repeat: repeat-x;background-size: auto 6px;} + +.mce-toc{border: 1px solid gray;} + +.mce-toc h2{margin: 4px;} + +.mce-toc li{list-style-type: none;} + +.mce-item-table,.mce-item-table caption,.mce-item-table td,.mce-item-table th{border: 1px dashed #bbb;} + +.mce-visualblocks address,.mce-visualblocks article,.mce-visualblocks aside,.mce-visualblocks blockquote,.mce-visualblocks div:not([data-mce-bogus]),.mce-visualblocks dl,.mce-visualblocks figcaption,.mce-visualblocks figure,.mce-visualblocks h1,.mce-visualblocks h2,.mce-visualblocks h3,.mce-visualblocks h4,.mce-visualblocks h5,.mce-visualblocks h6,.mce-visualblocks hgroup,.mce-visualblocks ol,.mce-visualblocks p,.mce-visualblocks pre,.mce-visualblocks section,.mce-visualblocks ul{padding-top: 10px;margin-left: 3px;background-repeat: no-repeat;border: 1px dashed #bbb;} + +.mce-visualblocks p{background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7);} + +.mce-visualblocks h1{background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==);} + +.mce-visualblocks h2{background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==);} + +.mce-visualblocks h3{background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7);} + +.mce-visualblocks h4{background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==);} + +.mce-visualblocks h5{background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==);} + +.mce-visualblocks h6{background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==);} + +.mce-visualblocks div:not([data-mce-bogus]){background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7);} + +.mce-visualblocks section{background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=);} + +.mce-visualblocks article{background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7);} + +.mce-visualblocks blockquote{background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7);} + +.mce-visualblocks address{background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=);} + +.mce-visualblocks pre{background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==);} + +.mce-visualblocks figure{background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7);} + +.mce-visualblocks figcaption{border: 1px dashed #bbb;} + +.mce-visualblocks hgroup{background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7);} + +.mce-visualblocks aside{background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=);} + +.mce-visualblocks ul{background-image: url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==);} + +.mce-visualblocks ol{background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==);} + +.mce-visualblocks dl{background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==);} + +.mce-visualblocks:not([dir=rtl]) address,.mce-visualblocks:not([dir=rtl]) article,.mce-visualblocks:not([dir=rtl]) aside,.mce-visualblocks:not([dir=rtl]) blockquote,.mce-visualblocks:not([dir=rtl]) div:not([data-mce-bogus]),.mce-visualblocks:not([dir=rtl]) dl,.mce-visualblocks:not([dir=rtl]) figcaption,.mce-visualblocks:not([dir=rtl]) figure,.mce-visualblocks:not([dir=rtl]) h1,.mce-visualblocks:not([dir=rtl]) h2,.mce-visualblocks:not([dir=rtl]) h3,.mce-visualblocks:not([dir=rtl]) h4,.mce-visualblocks:not([dir=rtl]) h5,.mce-visualblocks:not([dir=rtl]) h6,.mce-visualblocks:not([dir=rtl]) hgroup,.mce-visualblocks:not([dir=rtl]) ol,.mce-visualblocks:not([dir=rtl]) p,.mce-visualblocks:not([dir=rtl]) pre,.mce-visualblocks:not([dir=rtl]) section,.mce-visualblocks:not([dir=rtl]) ul{margin-left: 3px;} + +.mce-visualblocks[dir=rtl] address,.mce-visualblocks[dir=rtl] article,.mce-visualblocks[dir=rtl] aside,.mce-visualblocks[dir=rtl] blockquote,.mce-visualblocks[dir=rtl] div:not([data-mce-bogus]),.mce-visualblocks[dir=rtl] dl,.mce-visualblocks[dir=rtl] figcaption,.mce-visualblocks[dir=rtl] figure,.mce-visualblocks[dir=rtl] h1,.mce-visualblocks[dir=rtl] h2,.mce-visualblocks[dir=rtl] h3,.mce-visualblocks[dir=rtl] h4,.mce-visualblocks[dir=rtl] h5,.mce-visualblocks[dir=rtl] h6,.mce-visualblocks[dir=rtl] hgroup,.mce-visualblocks[dir=rtl] ol,.mce-visualblocks[dir=rtl] p,.mce-visualblocks[dir=rtl] pre,.mce-visualblocks[dir=rtl] section,.mce-visualblocks[dir=rtl] ul{background-position-x: right;margin-right: 3px;} + +.mce-nbsp,.mce-shy{background: #aaa;} + +.mce-shy::after{content: '-';} + +.tox-toolbar-dock-fadeout{opacity: 0;visibility: hidden;} + +.tox-toolbar-dock-fadein{opacity: 1;visibility: visible;} + +.tox-toolbar-dock-transition{transition: visibility 0s linear .3s,opacity .3s ease;} + +.tox-toolbar-dock-transition.tox-toolbar-dock-fadein{transition-delay: 0s;} diff --git a/monolithic/frontend/public/resource/tinymce/skins/ui/oxide-dark/content.min.css b/monolithic/frontend/public/resource/tinymce/skins/ui/oxide-dark/content.min.css new file mode 100644 index 0000000..6e7165f --- /dev/null +++ b/monolithic/frontend/public/resource/tinymce/skins/ui/oxide-dark/content.min.css @@ -0,0 +1,235 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +.mce-content-body .mce-item-anchor{display: inline-block;width: 8px !important;height: 12px !important;padding: 0 2px;cursor: default;background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%2F%3E%3C%2Fsvg%3E%0A") no-repeat center;-webkit-user-select: all;-moz-user-select: all;-ms-user-select: all;user-select: all;-webkit-user-modify: read-only;-moz-user-modify: read-only;} + +.mce-content-body .mce-item-anchor[data-mce-selected]{outline-offset: 1px;} + +.tox-comments-visible .tox-comment{background-color: #fff0b7;} + +.tox-comments-visible .tox-comment--active{background-color: #ffe168;} + +.tox-checklist>li:not(.tox-checklist--hidden){margin: .25em 0;list-style: none;} + +.tox-checklist>li:not(.tox-checklist--hidden)::before{position: absolute;width: 1em;height: 1em;margin-top: .125em;margin-left: -1.5em;cursor: pointer;background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%234C4C4C%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A");background-size: 100%;content: '';} + +.tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked::before{background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A");} + +[dir=rtl] .tox-checklist>li:not(.tox-checklist--hidden)::before{margin-right: -1.5em;margin-left: 0;} + +code[class*=language-],pre[class*=language-]{font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size: .875rem;-webkit-hyphens: none;-ms-hyphens: none;hyphens: none;line-height: 1.5;word-spacing: normal;color: #000;text-shadow: 0 1px #fff;word-break: normal;word-wrap: normal;white-space: pre;-moz-tab-size: 4;tab-size: 4;} + +code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow: none;background: #b3d4fc;} + +code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow: none;background: #b3d4fc;}@media print{code[class*=language-],pre[class*=language-]{text-shadow: none;}} + +pre[class*=language-]{padding: 1em;margin: .5em 0;overflow: auto;} + +:not(pre)>code[class*=language-],pre[class*=language-]{background: 0 0 !important;border: 1px solid #ccc;} + +:not(pre)>code[class*=language-]{padding: .1em;border-radius: .3em;} + +.token.cdata,.token.comment,.token.doctype,.token.prolog{color: #708090;} + +.token.punctuation{color: #999;} + +.namespace{opacity: .7;} + +.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color: #905;} + +.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color: #690;} + +.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color: #a67f59;background: hsla(0,0%,100%,.5);} + +.token.atrule,.token.attr-value,.token.keyword{color: #07a;} + +.token.function{color: #dd4a68;} + +.token.important,.token.regex,.token.variable{color: #e90;} + +.token.bold,.token.important{font-weight: 700;} + +.token.italic{font-style: italic;} + +.token.entity{cursor: help;} + +:not([dir=rtl]) code[class*=language-],:not([dir=rtl]) pre[class*=language-]{text-align: left;direction: ltr;} + +[dir=rtl] code[class*=language-],[dir=rtl] pre[class*=language-]{text-align: right;direction: rtl;} + +.mce-content-body{overflow-wrap: break-word;word-wrap: break-word;} + +.mce-content-body .mce-visual-caret{position: absolute;background-color: #000;background-color: currentColor;} + +.mce-content-body .mce-visual-caret-hidden{display: none;} + +.mce-content-body [data-mce-caret]{position: absolute;top: 0;right: auto;left: -1000px;padding: 0;margin: 0;} + +.mce-content-body .mce-offscreen-selection{position: absolute;left: -9999999999px;max-width: 1000000px;} + +.mce-content-body [contentEditable=false]{cursor: default;} + +.mce-content-body [contentEditable=true]{cursor: text;} + +.tox-cursor-format-painter{cursor: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"),default;} + +.mce-content-body figure.align-left{float: left;} + +.mce-content-body figure.align-right{float: right;} + +.mce-content-body figure.image.align-center{display: table;margin-right: auto;margin-left: auto;} + +.mce-preview-object{position: relative;display: inline-block;margin: 0 2px 0 2px;line-height: 0;border: 1px solid gray;} + +.mce-preview-object .mce-shim{position: absolute;top: 0;left: 0;width: 100%;height: 100%;background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);} + +.mce-preview-object[data-mce-selected="2"] .mce-shim{display: none;} + +.mce-object{background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center;border: 1px dashed #aaa;} + +.mce-pagebreak{display: block;width: 100%;height: 5px;margin-top: 15px;cursor: default;border: 1px dashed #aaa;page-break-before: always;}@media print{.mce-pagebreak{border: 0;}} + +.tiny-pageembed .mce-shim{position: absolute;top: 0;left: 0;width: 100%;height: 100%;background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);} + +.tiny-pageembed[data-mce-selected="2"] .mce-shim{display: none;} + +.tiny-pageembed{position: relative;display: inline-block;} + +.tiny-pageembed--16by9,.tiny-pageembed--1by1,.tiny-pageembed--21by9,.tiny-pageembed--4by3{position: relative;display: block;width: 100%;padding: 0;overflow: hidden;} + +.tiny-pageembed--16by9::before,.tiny-pageembed--1by1::before,.tiny-pageembed--21by9::before,.tiny-pageembed--4by3::before{display: block;content: "";} + +.tiny-pageembed--21by9::before{padding-top: 42.857143%;} + +.tiny-pageembed--16by9::before{padding-top: 56.25%;} + +.tiny-pageembed--4by3::before{padding-top: 75%;} + +.tiny-pageembed--1by1::before{padding-top: 100%;} + +.tiny-pageembed--16by9 iframe,.tiny-pageembed--1by1 iframe,.tiny-pageembed--21by9 iframe,.tiny-pageembed--4by3 iframe{position: absolute;top: 0;left: 0;width: 100%;height: 100%;border: 0;} + +.mce-content-body div.mce-resizehandle{position: absolute;z-index: 10000;width: 10px;height: 10px;background-color: #4099ff;border-color: #4099ff;border-style: solid;border-width: 1px;box-sizing: border-box;} + +.mce-content-body div.mce-resizehandle:hover{background-color: #4099ff;} + +.mce-content-body div.mce-resizehandle:nth-of-type(1){cursor: nwse-resize;} + +.mce-content-body div.mce-resizehandle:nth-of-type(2){cursor: nesw-resize;} + +.mce-content-body div.mce-resizehandle:nth-of-type(3){cursor: nwse-resize;} + +.mce-content-body div.mce-resizehandle:nth-of-type(4){cursor: nesw-resize;} + +.mce-content-body .mce-clonedresizable{position: absolute;z-index: 10000;outline: 1px dashed #000;opacity: .5;} + +.mce-content-body .mce-resize-helper{position: absolute;z-index: 10001;display: none;padding: 5px;margin: 5px 10px;font-family: sans-serif;font-size: 12px;line-height: 14px;color: #fff;white-space: nowrap;background: #555;background: rgba(0,0,0,.75);border: 1px;border-radius: 3px;} + +.mce-match-marker{color: #fff;background: #aaa;} + +.mce-match-marker-selected{color: #fff;background: #39f;} + +.mce-content-body img[data-mce-selected],.mce-content-body table[data-mce-selected]{outline: 3px solid #b4d7ff;} + +.mce-content-body hr[data-mce-selected]{outline: 3px solid #b4d7ff;outline-offset: 1px;} + +.mce-content-body [contentEditable=false] [contentEditable=true]:focus{outline: 3px solid #b4d7ff;} + +.mce-content-body [contentEditable=false] [contentEditable=true]:hover{outline: 3px solid #b4d7ff;} + +.mce-content-body [contentEditable=false][data-mce-selected]{cursor: not-allowed;outline: 3px solid #b4d7ff;} + +.mce-content-body.mce-content-readonly [contentEditable=true]:focus,.mce-content-body.mce-content-readonly [contentEditable=true]:hover{outline: 0;} + +.mce-content-body [data-mce-selected=inline-boundary]{background-color: #b4d7ff;} + +.mce-content-body .mce-edit-focus{outline: 3px solid #b4d7ff;} + +.mce-content-body td[data-mce-selected],.mce-content-body th[data-mce-selected]{background-color: #b4d7ff !important;} + +.mce-content-body td[data-mce-selected]::-moz-selection,.mce-content-body th[data-mce-selected]::-moz-selection{background: 0 0;} + +.mce-content-body td[data-mce-selected]::selection,.mce-content-body th[data-mce-selected]::selection{background: 0 0;} + +.mce-content-body td[data-mce-selected] *,.mce-content-body th[data-mce-selected] *{-webkit-touch-callout: none;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;} + +.mce-content-body img::-moz-selection{background: 0 0;} + +.mce-content-body img::selection{background: 0 0;} + +.ephox-snooker-resizer-bar{background-color: #b4d7ff;opacity: 0;} + +.ephox-snooker-resizer-cols{cursor: col-resize;} + +.ephox-snooker-resizer-rows{cursor: row-resize;} + +.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging{opacity: 1;} + +.mce-spellchecker-word{height: 2rem;cursor: default;background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.5'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position: 0 calc(100% + 1px);background-repeat: repeat-x;background-size: auto 6px;} + +.mce-spellchecker-grammar{cursor: default;background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23008800'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position: 0 calc(100% + 1px);background-repeat: repeat-x;background-size: auto 6px;} + +.mce-toc{border: 1px solid gray;} + +.mce-toc h2{margin: 4px;} + +.mce-toc li{list-style-type: none;} + +.mce-item-table,.mce-item-table caption,.mce-item-table td,.mce-item-table th{border: 1px dashed #bbb;} + +.mce-visualblocks address,.mce-visualblocks article,.mce-visualblocks aside,.mce-visualblocks blockquote,.mce-visualblocks div:not([data-mce-bogus]),.mce-visualblocks dl,.mce-visualblocks figcaption,.mce-visualblocks figure,.mce-visualblocks h1,.mce-visualblocks h2,.mce-visualblocks h3,.mce-visualblocks h4,.mce-visualblocks h5,.mce-visualblocks h6,.mce-visualblocks hgroup,.mce-visualblocks ol,.mce-visualblocks p,.mce-visualblocks pre,.mce-visualblocks section,.mce-visualblocks ul{padding-top: 10px;margin-left: 3px;background-repeat: no-repeat;border: 1px dashed #bbb;} + +.mce-visualblocks p{background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7);} + +.mce-visualblocks h1{background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==);} + +.mce-visualblocks h2{background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==);} + +.mce-visualblocks h3{background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7);} + +.mce-visualblocks h4{background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==);} + +.mce-visualblocks h5{background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==);} + +.mce-visualblocks h6{background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==);} + +.mce-visualblocks div:not([data-mce-bogus]){background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7);} + +.mce-visualblocks section{background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=);} + +.mce-visualblocks article{background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7);} + +.mce-visualblocks blockquote{background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7);} + +.mce-visualblocks address{background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=);} + +.mce-visualblocks pre{background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==);} + +.mce-visualblocks figure{background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7);} + +.mce-visualblocks figcaption{border: 1px dashed #bbb;} + +.mce-visualblocks hgroup{background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7);} + +.mce-visualblocks aside{background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=);} + +.mce-visualblocks ul{background-image: url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==);} + +.mce-visualblocks ol{background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==);} + +.mce-visualblocks dl{background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==);} + +.mce-visualblocks:not([dir=rtl]) address,.mce-visualblocks:not([dir=rtl]) article,.mce-visualblocks:not([dir=rtl]) aside,.mce-visualblocks:not([dir=rtl]) blockquote,.mce-visualblocks:not([dir=rtl]) div:not([data-mce-bogus]),.mce-visualblocks:not([dir=rtl]) dl,.mce-visualblocks:not([dir=rtl]) figcaption,.mce-visualblocks:not([dir=rtl]) figure,.mce-visualblocks:not([dir=rtl]) h1,.mce-visualblocks:not([dir=rtl]) h2,.mce-visualblocks:not([dir=rtl]) h3,.mce-visualblocks:not([dir=rtl]) h4,.mce-visualblocks:not([dir=rtl]) h5,.mce-visualblocks:not([dir=rtl]) h6,.mce-visualblocks:not([dir=rtl]) hgroup,.mce-visualblocks:not([dir=rtl]) ol,.mce-visualblocks:not([dir=rtl]) p,.mce-visualblocks:not([dir=rtl]) pre,.mce-visualblocks:not([dir=rtl]) section,.mce-visualblocks:not([dir=rtl]) ul{margin-left: 3px;} + +.mce-visualblocks[dir=rtl] address,.mce-visualblocks[dir=rtl] article,.mce-visualblocks[dir=rtl] aside,.mce-visualblocks[dir=rtl] blockquote,.mce-visualblocks[dir=rtl] div:not([data-mce-bogus]),.mce-visualblocks[dir=rtl] dl,.mce-visualblocks[dir=rtl] figcaption,.mce-visualblocks[dir=rtl] figure,.mce-visualblocks[dir=rtl] h1,.mce-visualblocks[dir=rtl] h2,.mce-visualblocks[dir=rtl] h3,.mce-visualblocks[dir=rtl] h4,.mce-visualblocks[dir=rtl] h5,.mce-visualblocks[dir=rtl] h6,.mce-visualblocks[dir=rtl] hgroup,.mce-visualblocks[dir=rtl] ol,.mce-visualblocks[dir=rtl] p,.mce-visualblocks[dir=rtl] pre,.mce-visualblocks[dir=rtl] section,.mce-visualblocks[dir=rtl] ul{background-position-x: right;margin-right: 3px;} + +.mce-nbsp,.mce-shy{background: #aaa;} + +.mce-shy::after{content: '-';} + +body{font-family: sans-serif;} + +table{border-collapse: collapse;} diff --git a/monolithic/frontend/public/resource/tinymce/skins/ui/oxide-dark/content.mobile.min.css b/monolithic/frontend/public/resource/tinymce/skins/ui/oxide-dark/content.mobile.min.css new file mode 100644 index 0000000..c052252 --- /dev/null +++ b/monolithic/frontend/public/resource/tinymce/skins/ui/oxide-dark/content.mobile.min.css @@ -0,0 +1,17 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +.tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection{position: absolute;display: inline-block;background-color: green;opacity: .5;} + +body{-webkit-text-size-adjust: none;} + +body img{max-width: 96vw;} + +body table img{max-width: 95%;} + +body{font-family: sans-serif;} + +table{border-collapse: collapse;} diff --git a/monolithic/frontend/public/resource/tinymce/skins/ui/oxide-dark/skin.min.css b/monolithic/frontend/public/resource/tinymce/skins/ui/oxide-dark/skin.min.css new file mode 100644 index 0000000..d8dc9b2 --- /dev/null +++ b/monolithic/frontend/public/resource/tinymce/skins/ui/oxide-dark/skin.min.css @@ -0,0 +1,875 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +.tox{font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size: 16px;font-style: normal;font-weight: 400;line-height: normal;color: #222f3e;text-decoration: none;text-shadow: none;text-transform: none;white-space: normal;vertical-align: initial;cursor: auto;box-sizing: content-box;-webkit-tap-highlight-color: transparent;} + +.tox :not(svg){font-family: inherit;font-size: inherit;font-style: inherit;font-weight: inherit;line-height: inherit;color: inherit;text-align: inherit;text-decoration: inherit;text-shadow: inherit;text-transform: inherit;white-space: inherit;vertical-align: inherit;cursor: inherit;box-sizing: inherit;direction: inherit;-webkit-tap-highlight-color: inherit;} + +.tox :not(svg){position: static;float: none;width: auto;height: auto;max-width: none;padding: 0;margin: 0;background: 0 0;border: 0;outline: 0;} + +.tox:not([dir=rtl]){text-align: left;direction: ltr;} + +.tox[dir=rtl]{text-align: right;direction: rtl;} + +.tox-tinymce{position: relative;display: flex;overflow: hidden;font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;border: 1px solid #000;border-radius: 0;visibility: inherit !important;box-shadow: none;box-sizing: border-box;flex-direction: column;} + +.tox-editor-container{display: flex;flex: 1 1 auto;flex-direction: column;overflow: hidden;} + +.tox-editor-container>:first-child{border-top: none !important;} + +.tox-tinymce-aux{font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;} + +.tox-tinymce :focus,.tox-tinymce-aux :focus{outline: 0;} + +button::-moz-focus-inner{border: 0;} + +.tox-silver-sink{z-index: 1300;} + +.tox .tox-anchorbar{display: flex;flex: 0 0 auto;} + +.tox .tox-bar{display: flex;flex: 0 0 auto;} + +.tox .tox-button{display: inline-block;padding: 4px 16px;margin: 0;font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size: 14px;font-weight: 700;line-height: 24px;letter-spacing: 1;color: #fff;text-align: center;text-decoration: none;text-transform: capitalize;white-space: nowrap;cursor: pointer;background-color: #207ab7;background-image: none;background-position: none;background-repeat: none;border-color: #207ab7;border-style: solid;border-width: 1px;border-radius: 3px;outline: 0;box-shadow: none;box-sizing: border-box;} + +.tox .tox-button[disabled]{color: rgba(255,255,255,.5);cursor: not-allowed;background-color: #207ab7;background-image: none;border-color: #207ab7;box-shadow: none;} + +.tox .tox-button:focus:not(:disabled){color: #fff;background-color: #1c6ca1;background-image: none;border-color: #1c6ca1;box-shadow: none;} + +.tox .tox-button:hover:not(:disabled){color: #fff;background-color: #1c6ca1;background-image: none;border-color: #1c6ca1;box-shadow: none;} + +.tox .tox-button:active:not(:disabled){color: #fff;background-color: #185d8c;background-image: none;border-color: #185d8c;box-shadow: none;} + +.tox .tox-button--secondary{padding: 4px 16px;color: #fff;text-decoration: none;text-transform: capitalize;background-color: #3d546f;background-image: none;background-position: none;background-repeat: none;border-color: #3d546f;border-style: solid;border-width: 1px;border-radius: 3px;outline: 0;box-shadow: none;} + +.tox .tox-button--secondary[disabled]{color: rgba(255,255,255,.5);background-color: #3d546f;background-image: none;border-color: #3d546f;box-shadow: none;} + +.tox .tox-button--secondary:focus:not(:disabled){color: #fff;background-color: #34485f;background-image: none;border-color: #34485f;box-shadow: none;} + +.tox .tox-button--secondary:hover:not(:disabled){color: #fff;background-color: #34485f;background-image: none;border-color: #34485f;box-shadow: none;} + +.tox .tox-button--secondary:active:not(:disabled){color: #fff;background-color: #2b3b4e;background-image: none;border-color: #2b3b4e;box-shadow: none;} + +.tox .tox-button--icon,.tox .tox-button.tox-button--icon,.tox .tox-button.tox-button--secondary.tox-button--icon{padding: 4px;} + +.tox .tox-button--icon .tox-icon svg,.tox .tox-button.tox-button--icon .tox-icon svg,.tox .tox-button.tox-button--secondary.tox-button--icon .tox-icon svg{display: block;fill: currentColor;} + +.tox .tox-button-link{display: inline-block;padding: 0;margin: 0;font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size: 16px;font-weight: 400;line-height: 1.3;white-space: nowrap;cursor: pointer;background: 0;border: none;box-sizing: border-box;} + +.tox .tox-button-link--sm{font-size: 14px;} + +.tox .tox-button--naked{color: #fff;background-color: transparent;border-color: transparent;box-shadow: unset;} + +.tox .tox-button--naked:hover:not(:disabled){color: #fff;background-color: #34485f;border-color: #34485f;box-shadow: none;} + +.tox .tox-button--naked:focus:not(:disabled){color: #fff;background-color: #34485f;border-color: #34485f;box-shadow: none;} + +.tox .tox-button--naked:active:not(:disabled){color: #fff;background-color: #2b3b4e;border-color: #2b3b4e;box-shadow: none;} + +.tox .tox-button--naked .tox-icon svg{fill: currentColor;} + +.tox .tox-button--naked.tox-button--icon{color: currentColor;} + +.tox .tox-button--naked.tox-button--icon:hover:not(:disabled){color: #fff;} + +.tox .tox-checkbox{display: flex;height: 36px;min-width: 36px;cursor: pointer;border-radius: 3px;align-items: center;} + +.tox .tox-checkbox__input{position: absolute;top: auto;left: -10000px;width: 1px;height: 1px;overflow: hidden;} + +.tox .tox-checkbox__icons{width: 24px;height: 24px;padding: calc(4px - 1px);border-radius: 3px;box-shadow: 0 0 0 2px transparent;box-sizing: content-box;} + +.tox .tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display: block;fill: rgba(255,255,255,.2);} + +.tox .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg{display: none;fill: #207ab7;} + +.tox .tox-checkbox__icons .tox-checkbox-icon__checked svg{display: none;fill: #207ab7;} + +.tox input.tox-checkbox__input:checked+.tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display: none;} + +.tox input.tox-checkbox__input:checked+.tox-checkbox__icons .tox-checkbox-icon__checked svg{display: block;} + +.tox input.tox-checkbox__input:indeterminate+.tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display: none;} + +.tox input.tox-checkbox__input:indeterminate+.tox-checkbox__icons .tox-checkbox-icon__indeterminate svg{display: block;} + +.tox input.tox-checkbox__input:focus+.tox-checkbox__icons{padding: calc(4px - 1px);border-radius: 3px;box-shadow: inset 0 0 0 1px #207ab7;} + +.tox:not([dir=rtl]) .tox-checkbox__label{margin-left: 4px;} + +.tox:not([dir=rtl]) .tox-bar .tox-checkbox{margin-left: 4px;} + +.tox[dir=rtl] .tox-checkbox__label{margin-right: 4px;} + +.tox[dir=rtl] .tox-bar .tox-checkbox{margin-right: 4px;} + +.tox .tox-collection--toolbar .tox-collection__group{display: flex;padding: 0;} + +.tox .tox-collection--grid .tox-collection__group{display: flex;max-height: 208px;padding: 0;overflow-x: hidden;overflow-y: auto;flex-wrap: wrap;} + +.tox .tox-collection--list .tox-collection__group{padding: 4px 0;border-color: #1a1a1a;border-style: solid;border-top-width: 1px;border-right-width: 0;border-bottom-width: 0;border-left-width: 0;} + +.tox .tox-collection--list .tox-collection__group:first-child{border-top-width: 0;} + +.tox .tox-collection__group-heading{padding: 4px 8px;margin-top: -4px;margin-bottom: 4px;font-size: 12px;font-style: normal;font-weight: 400;color: #fff;text-transform: none;cursor: default;background-color: #333;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;-webkit-touch-callout: none;} + +.tox .tox-collection__item{display: flex;color: #fff;cursor: pointer;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;align-items: center;-webkit-touch-callout: none;} + +.tox .tox-collection--list .tox-collection__item{padding: 4px 8px;} + +.tox .tox-collection--toolbar .tox-collection__item{padding: 4px;border-radius: 3px;} + +.tox .tox-collection--grid .tox-collection__item{padding: 4px;border-radius: 3px;} + +.tox .tox-collection--list .tox-collection__item--enabled{color: contrast(inherit,#222f3e,#fff);background-color: inherit;} + +.tox .tox-collection--list .tox-collection__item--active:not(.tox-collection__item--state-disabled){color: #fff;background-color: #434e5b;} + +.tox .tox-collection--toolbar .tox-collection__item--enabled{color: #fff;background-color: #6f7882;} + +.tox .tox-collection--toolbar .tox-collection__item--active:not(.tox-collection__item--state-disabled){color: #fff;background-color: #434e5b;} + +.tox .tox-collection--grid .tox-collection__item--enabled{color: #fff;background-color: #6f7882;} + +.tox .tox-collection--grid .tox-collection__item--active:not(.tox-collection__item--state-disabled){color: #fff;background-color: #434e5b;} + +.tox .tox-collection__item--state-disabled{color: rgba(255,255,255,.5);cursor: default;background-color: transparent;} + +.tox .tox-collection__item-icon{display: flex;width: 24px;height: 24px;align-items: center;justify-content: center;} + +.tox .tox-collection__item-icon svg{fill: currentColor;} + +.tox .tox-collection--toolbar-lg .tox-collection__item-icon{width: 48px;height: 48px;} + +.tox .tox-collection__item[role=menuitemcheckbox]:not(.tox-collection__item--enabled) .tox-collection__item-checkmark svg{display: none;} + +.tox .tox-collection__item-label{display: inline-block;font-size: 14px;font-style: normal;font-weight: 400;line-height: 24px;color: currentColor;text-transform: none;word-break: break-all;flex: 1;-ms-flex-preferred-size: auto;} + +.tox .tox-collection__item-accessory{display: inline-block;height: 24px;font-size: 14px;line-height: 24px;color: rgba(255,255,255,.5);text-transform: normal;} + +.tox .tox-collection__item-caret{align-items: center;display: flex;min-height: 24px;} + +.tox .tox-collection__item-caret::after{min-height: inherit;font-size: 0;content: '';} + +.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item>:not(:first-child){margin-left: 8px;} + +.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item-label:first-child{margin-left: 4px;} + +.tox:not([dir=rtl]) .tox-collection__item-accessory{margin-left: 16px;text-align: right;} + +.tox:not([dir=rtl]) .tox-collection__item-caret{margin-left: 16px;} + +.tox[dir=rtl] .tox-collection--list .tox-collection__item>:not(:first-child){margin-right: 8px;} + +.tox[dir=rtl] .tox-collection--list .tox-collection__item-label:first-child{margin-right: 4px;} + +.tox[dir=rtl] .tox-collection__item-icon-rtl .tox-collection__item-icon svg{transform: rotateY(180deg);} + +.tox[dir=rtl] .tox-collection__item-accessory{margin-right: 16px;text-align: left;} + +.tox[dir=rtl] .tox-collection__item-caret{margin-right: 16px;transform: rotateY(180deg);} + +.tox .tox-color-picker-container{display: flex;flex-direction: row;height: 225px;margin: 0;} + +.tox .tox-sv-palette{display: flex;height: 100%;box-sizing: border-box;} + +.tox .tox-sv-palette-spectrum{height: 100%;} + +.tox .tox-sv-palette,.tox .tox-sv-palette-spectrum{width: 225px;} + +.tox .tox-sv-palette-thumb{position: absolute;width: 12px;height: 12px;background: 0 0;border: 1px solid #000;border-radius: 50%;box-sizing: content-box;} + +.tox .tox-sv-palette-inner-thumb{position: absolute;width: 10px;height: 10px;border: 1px solid #fff;border-radius: 50%;} + +.tox .tox-hue-slider{width: 25px;height: 100%;box-sizing: border-box;} + +.tox .tox-hue-slider-spectrum{width: 100%;height: 100%;background: linear-gradient(to bottom,red,#ff0080,#f0f,#8000ff,#00f,#0080ff,#0ff,#00ff80,#0f0,#80ff00,#ff0,#ff8000,red);} + +.tox .tox-hue-slider,.tox .tox-hue-slider-spectrum{width: 20px;} + +.tox .tox-hue-slider-thumb{width: 100%;height: 4px;background: #fff;border: 1px solid #000;box-sizing: content-box;} + +.tox .tox-rgb-form{display: flex;flex-direction: column;justify-content: space-between;} + +.tox .tox-rgb-form div{display: flex;width: inherit;margin-bottom: 5px;align-items: center;justify-content: space-between;} + +.tox .tox-rgb-form input{width: 6em;} + +.tox .tox-rgb-form input.tox-invalid{border: 1px solid red !important;} + +.tox .tox-rgb-form .tox-rgba-preview{margin-bottom: 0;border: 1px solid #000;flex-grow: 2;} + +.tox:not([dir=rtl]) .tox-sv-palette{margin-right: 15px;} + +.tox:not([dir=rtl]) .tox-hue-slider{margin-right: 15px;} + +.tox:not([dir=rtl]) .tox-hue-slider-thumb{margin-left: -1px;} + +.tox:not([dir=rtl]) .tox-rgb-form label{margin-right: .5em;} + +.tox[dir=rtl] .tox-sv-palette{margin-left: 15px;} + +.tox[dir=rtl] .tox-hue-slider{margin-left: 15px;} + +.tox[dir=rtl] .tox-hue-slider-thumb{margin-right: -1px;} + +.tox[dir=rtl] .tox-rgb-form label{margin-left: .5em;} + +.tox .tox-toolbar .tox-swatches,.tox .tox-toolbar__overflow .tox-swatches,.tox .tox-toolbar__primary .tox-swatches{margin: 2px 0 3px 4px;} + +.tox .tox-collection--list .tox-collection__group .tox-swatches-menu{margin: -4px 0;border: 0;} + +.tox .tox-swatches__row{display: flex;} + +.tox .tox-swatch{width: 30px;height: 30px;transition: transform .15s,box-shadow .15s;} + +.tox .tox-swatch:focus,.tox .tox-swatch:hover{transform: scale(.8);box-shadow: 0 0 0 1px rgba(127,127,127,.3) inset;} + +.tox .tox-swatch--remove{align-items: center;display: flex;justify-content: center;} + +.tox .tox-swatch--remove svg path{stroke: #e74c3c;} + +.tox .tox-swatches__picker-btn{display: flex;width: 30px;height: 30px;padding: 0;cursor: pointer;background-color: transparent;border: 0;outline: 0;align-items: center;justify-content: center;} + +.tox .tox-swatches__picker-btn svg{width: 24px;height: 24px;} + +.tox .tox-swatches__picker-btn:hover{background: #434e5b;} + +.tox:not([dir=rtl]) .tox-swatches__picker-btn{margin-left: auto;} + +.tox[dir=rtl] .tox-swatches__picker-btn{margin-right: auto;} + +.tox .tox-comment-thread{position: relative;background: #2b3b4e;} + +.tox .tox-comment-thread>:not(:first-child){margin-top: 8px;} + +.tox .tox-comment{position: relative;padding: 8px 8px 16px 8px;background: #2b3b4e;border: 1px solid #000;border-radius: 3px;box-shadow: 0 4px 8px 0 rgba(34,47,62,.1);} + +.tox .tox-comment__header{display: flex;color: #fff;align-items: center;justify-content: space-between;} + +.tox .tox-comment__date{font-size: 12px;color: rgba(255,255,255,.5);} + +.tox .tox-comment__body{position: relative;margin-top: 8px;font-size: 14px;font-style: normal;font-weight: 400;line-height: 1.3;color: #fff;text-transform: initial;} + +.tox .tox-comment__body textarea{width: 100%;white-space: normal;resize: none;} + +.tox .tox-comment__expander{padding-top: 8px;} + +.tox .tox-comment__expander p{font-size: 14px;font-style: normal;color: rgba(255,255,255,.5);} + +.tox .tox-comment__body p{margin: 0;} + +.tox .tox-comment__buttonspacing{padding-top: 16px;text-align: center;} + +.tox .tox-comment-thread__overlay::after{position: absolute;top: 0;right: 0;bottom: 0;left: 0;z-index: 5;display: flex;background: #2b3b4e;content: "";opacity: .9;} + +.tox .tox-comment__reply{display: flex;flex-shrink: 0;flex-wrap: wrap;justify-content: flex-end;margin-top: 8px;} + +.tox .tox-comment__reply>:first-child{width: 100%;margin-bottom: 8px;} + +.tox .tox-comment__edit{display: flex;flex-wrap: wrap;justify-content: flex-end;margin-top: 16px;} + +.tox .tox-comment__gradient::after{position: absolute;bottom: 0;display: block;width: 100%;height: 5em;margin-top: -40px;background: linear-gradient(rgba(43,59,78,0),#2b3b4e);content: "";} + +.tox .tox-comment__overlay{position: absolute;top: 0;right: 0;bottom: 0;left: 0;z-index: 5;display: flex;text-align: center;background: #2b3b4e;opacity: .9;flex-direction: column;flex-grow: 1;} + +.tox .tox-comment__loading-text{position: relative;display: flex;color: #fff;align-items: center;flex-direction: column;} + +.tox .tox-comment__loading-text>div{padding-bottom: 16px;} + +.tox .tox-comment__overlaytext{position: absolute;top: 0;right: 0;bottom: 0;left: 0;z-index: 10;padding: 1em;font-size: 14px;flex-direction: column;} + +.tox .tox-comment__overlaytext p{color: #fff;text-align: center;background-color: #2b3b4e;box-shadow: 0 0 8px 8px #2b3b4e;} + +.tox .tox-comment__overlaytext div:nth-of-type(2){font-size: .8em;} + +.tox .tox-comment__busy-spinner{position: absolute;top: 0;right: 0;bottom: 0;left: 0;z-index: 1103;display: flex;background-color: #2b3b4e;align-items: center;justify-content: center;} + +.tox .tox-comment__scroll{display: flex;flex-direction: column;flex-shrink: 1;overflow: auto;} + +.tox .tox-conversations{margin: 8px;} + +.tox:not([dir=rtl]) .tox-comment__edit{margin-left: 8px;} + +.tox:not([dir=rtl]) .tox-comment__buttonspacing>:last-child,.tox:not([dir=rtl]) .tox-comment__edit>:last-child,.tox:not([dir=rtl]) .tox-comment__reply>:last-child{margin-left: 8px;} + +.tox[dir=rtl] .tox-comment__edit{margin-right: 8px;} + +.tox[dir=rtl] .tox-comment__buttonspacing>:last-child,.tox[dir=rtl] .tox-comment__edit>:last-child,.tox[dir=rtl] .tox-comment__reply>:last-child{margin-right: 8px;} + +.tox .tox-user{align-items: center;display: flex;} + +.tox .tox-user__avatar svg{fill: rgba(255,255,255,.5);} + +.tox .tox-user__name{font-size: 12px;font-style: normal;font-weight: 700;color: rgba(255,255,255,.5);text-transform: uppercase;} + +.tox:not([dir=rtl]) .tox-user__avatar svg{margin-right: 8px;} + +.tox:not([dir=rtl]) .tox-user__avatar+.tox-user__name{margin-left: 8px;} + +.tox[dir=rtl] .tox-user__avatar svg{margin-left: 8px;} + +.tox[dir=rtl] .tox-user__avatar+.tox-user__name{margin-right: 8px;} + +.tox .tox-dialog-wrap{position: fixed;top: 0;right: 0;bottom: 0;left: 0;z-index: 1100;display: flex;align-items: center;justify-content: center;} + +.tox .tox-dialog-wrap__backdrop{position: absolute;top: 0;right: 0;bottom: 0;left: 0;z-index: 1101;background-color: rgba(34,47,62,.75);} + +.tox .tox-dialog{position: relative;z-index: 1102;display: flex;width: 95vw;max-width: 480px;max-height: 100%;overflow: hidden;background-color: #2b3b4e;border-color: #000;border-style: solid;border-width: 1px;border-radius: 3px;box-shadow: 0 16px 16px -10px rgba(34,47,62,.15),0 0 40px 1px rgba(34,47,62,.15);flex-direction: column;} + +.tox .tox-dialog__header{position: relative;display: flex;padding: 8px 16px 0 16px;margin-bottom: 16px;font-size: 16px;color: #fff;background-color: #2b3b4e;border-bottom: none;align-items: center;justify-content: space-between;} + +.tox .tox-dialog__header .tox-button{z-index: 1;} + +.tox .tox-dialog__draghandle{position: absolute;top: 0;left: 0;width: 100%;height: 100%;cursor: grab;} + +.tox .tox-dialog__draghandle:active{cursor: grabbing;} + +.tox .tox-dialog__dismiss{margin-left: auto;} + +.tox .tox-dialog__title{margin: 0;font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size: 20px;font-style: normal;font-weight: 400;line-height: 1.3;text-transform: normal;} + +.tox .tox-dialog__body{display: flex;min-width: 0;padding: 0 16px;font-size: 16px;font-style: normal;font-weight: 400;line-height: 1.3;color: #fff;text-align: left;text-transform: normal;flex: 1;-ms-flex-preferred-size: auto;} + +.tox .tox-dialog__body-nav{align-items: flex-start;display: flex;flex-direction: column;} + +.tox .tox-dialog__body-nav-item{display: inline-block;margin-bottom: 8px;font-size: 14px;line-height: 1.3;color: rgba(255,255,255,.5);text-decoration: none;border-bottom: 2px solid transparent;} + +.tox .tox-dialog__body-nav-item--active{color: #207ab7;border-bottom: 2px solid #207ab7;} + +.tox .tox-dialog__body-content{display: flex;flex: 1;flex-direction: column;-ms-flex-preferred-size: auto;max-height: 650px;overflow: auto;} + +.tox .tox-dialog__body-content>*{margin-top: 16px;margin-bottom: 0;} + +.tox .tox-dialog__body-content>:first-child{margin-top: 0;} + +.tox .tox-dialog__body-content>:last-child{margin-bottom: 0;} + +.tox .tox-dialog__body-content>:only-child{margin-top: 0;margin-bottom: 0;} + +.tox .tox-dialog--width-lg{height: 650px;max-width: 1200px;} + +.tox .tox-dialog--width-md{max-width: 800px;} + +.tox .tox-dialog--width-md .tox-dialog__body-content{overflow: auto;} + +.tox .tox-dialog__body-content--centered{text-align: center;} + +.tox .tox-dialog__body-content--spacious{margin-bottom: 16px;} + +.tox .tox-dialog__footer{display: flex;padding: 8px 16px;margin-top: 16px;background-color: #2b3b4e;border-top: 1px solid #000;align-items: center;justify-content: space-between;} + +.tox .tox-dialog__busy-spinner{position: absolute;top: 0;right: 0;bottom: 0;left: 0;z-index: 1103;display: flex;background-color: rgba(34,47,62,.75);align-items: center;justify-content: center;} + +.tox .tox-dialog__table{width: 100%;border-collapse: collapse;} + +.tox .tox-dialog__table thead th{padding-bottom: 8px;font-weight: 700;} + +.tox .tox-dialog__table tbody tr{border-bottom: 1px solid #000;} + +.tox .tox-dialog__table tbody tr:last-child{border-bottom: none;} + +.tox .tox-dialog__table td{padding-top: 8px;padding-bottom: 8px;} + +.tox .tox-dialog__popups{position: absolute;z-index: 1100;width: 100%;} + +.tox .tox-dialog__body-iframe{display: flex;flex: 1;flex-direction: column;-ms-flex-preferred-size: auto;} + +.tox .tox-dialog__body-iframe .tox-navobj{display: flex;flex: 1;-ms-flex-preferred-size: auto;} + +.tox .tox-dialog__body-iframe .tox-navobj :nth-child(2){flex: 1;-ms-flex-preferred-size: auto;height: 100%;} + +body.tox-dialog__disable-scroll{overflow: hidden;} + +.tox.tox-platform-ie .tox-dialog-wrap{position: -ms-device-fixed;} + +.tox:not([dir=rtl]) .tox-dialog__body-nav{margin-right: 32px;} + +.tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-end>*,.tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-start>*{margin-left: 8px;} + +.tox[dir=rtl] .tox-dialog__body{text-align: right;} + +.tox[dir=rtl] .tox-dialog__body-nav{margin-left: 32px;} + +.tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-end>*,.tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-start>*{margin-right: 8px;} + +.tox .tox-dropzone-container{display: flex;flex: 1;-ms-flex-preferred-size: auto;} + +.tox .tox-dropzone{display: flex;min-height: 100px;padding: 10px;background: #fff;border: 2px dashed #000;box-sizing: border-box;align-items: center;flex-direction: column;flex-grow: 1;justify-content: center;} + +.tox .tox-dropzone p{margin: 0 0 16px 0;color: rgba(255,255,255,.5);} + +.tox .tox-edit-area{position: relative;display: flex;overflow: hidden;border-top: 1px solid #000;flex: 1;-ms-flex-preferred-size: auto;} + +.tox .tox-edit-area__iframe{position: absolute;width: 100%;height: 100%;background-color: #fff;border: 0;box-sizing: border-box;flex: 1;-ms-flex-preferred-size: auto;} + +.tox.tox-inline-edit-area{border: 1px dotted #000;} + +.tox .tox-control-wrap{flex: 1;position: relative;} + +.tox .tox-control-wrap:not(.tox-control-wrap--status-invalid) .tox-control-wrap__status-icon-invalid,.tox .tox-control-wrap:not(.tox-control-wrap--status-unknown) .tox-control-wrap__status-icon-unknown,.tox .tox-control-wrap:not(.tox-control-wrap--status-valid) .tox-control-wrap__status-icon-valid{display: none;} + +.tox .tox-control-wrap svg{display: block;} + +.tox .tox-control-wrap__status-icon-wrap{position: absolute;top: 50%;transform: translateY(-50%);} + +.tox .tox-control-wrap__status-icon-invalid svg{fill: #c00;} + +.tox .tox-control-wrap__status-icon-unknown svg{fill: orange;} + +.tox .tox-control-wrap__status-icon-valid svg{fill: green;} + +.tox:not([dir=rtl]) .tox-control-wrap--status-invalid .tox-textfield,.tox:not([dir=rtl]) .tox-control-wrap--status-unknown .tox-textfield,.tox:not([dir=rtl]) .tox-control-wrap--status-valid .tox-textfield{padding-right: 32px;} + +.tox:not([dir=rtl]) .tox-control-wrap__status-icon-wrap{right: 4px;} + +.tox[dir=rtl] .tox-control-wrap--status-invalid .tox-textfield,.tox[dir=rtl] .tox-control-wrap--status-unknown .tox-textfield,.tox[dir=rtl] .tox-control-wrap--status-valid .tox-textfield{padding-left: 32px;} + +.tox[dir=rtl] .tox-control-wrap__status-icon-wrap{left: 4px;} + +.tox .tox-autocompleter{max-width: 25em;} + +.tox .tox-autocompleter .tox-menu{max-width: 25em;} + +.tox .tox-color-input{display: flex;} + +.tox .tox-color-input .tox-textfield{display: flex;border-radius: 3px 0 0 3px;} + +.tox .tox-color-input span{display: flex;width: 35px;cursor: pointer;border-color: rgba(34,47,62,.2);border-style: solid;border-width: 1px 1px 1px 0;border-radius: 0 3px 3px 0;box-shadow: none;box-sizing: border-box;} + +.tox .tox-color-input span:focus{border-color: #207ab7;} + +.tox[dir=rtl] .tox-color-input .tox-textfield{border-radius: 0 3px 3px 0;} + +.tox[dir=rtl] .tox-color-input span{border-width: 1px 0 1px 1px;border-radius: 3px 0 0 3px;} + +.tox .tox-label,.tox .tox-toolbar-label{display: block;padding: 0 8px 0 0;font-size: 14px;font-style: normal;font-weight: 400;line-height: 1.3;color: rgba(255,255,255,.5);text-transform: normal;white-space: nowrap;} + +.tox .tox-toolbar-label{padding: 0 8px;} + +.tox[dir=rtl] .tox-label{padding: 0 0 0 8px;} + +.tox .tox-form{display: flex;flex: 1;flex-direction: column;-ms-flex-preferred-size: auto;} + +.tox .tox-form__group{margin-bottom: 4px;box-sizing: border-box;} + +.tox .tox-form__group--error{color: #c00;} + +.tox .tox-form__group--collection{display: flex;} + +.tox .tox-form__grid{display: flex;flex-direction: row;flex-wrap: wrap;justify-content: space-between;} + +.tox .tox-form__grid--2col>.tox-form__group{width: calc(50% - (8px / 2));} + +.tox .tox-form__grid--3col>.tox-form__group{width: calc(100% / 3 - (8px / 2));} + +.tox .tox-form__grid--4col>.tox-form__group{width: calc(25% - (8px / 2));} + +.tox .tox-form__controls-h-stack{align-items: center;display: flex;} + +.tox .tox-form__group--inline{align-items: center;display: flex;} + +.tox .tox-form__group--stretched{display: flex;flex: 1;flex-direction: column;-ms-flex-preferred-size: auto;} + +.tox .tox-form__group--stretched .tox-textarea{flex: 1;-ms-flex-preferred-size: auto;} + +.tox .tox-form__group--stretched .tox-navobj{display: flex;flex: 1;-ms-flex-preferred-size: auto;} + +.tox .tox-form__group--stretched .tox-navobj :nth-child(2){flex: 1;-ms-flex-preferred-size: auto;height: 100%;} + +.tox:not([dir=rtl]) .tox-form__controls-h-stack>:not(:first-child){margin-left: 4px;} + +.tox[dir=rtl] .tox-form__controls-h-stack>:not(:first-child){margin-right: 4px;} + +.tox .tox-lock.tox-locked .tox-lock-icon__unlock,.tox .tox-lock:not(.tox-locked) .tox-lock-icon__lock{display: none;} + +.tox .tox-textarea,.tox .tox-textfield,.tox .tox-toolbar-textfield,.tox:not([dir=rtl]) .tox-selectfield select,.tox[dir=rtl] .tox-selectfield select{width: 100%;padding: 5px 4.75px;margin: 0;font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size: 16px;line-height: 24px;color: #fff;background-color: #2b3b4e;border-color: #000;border-style: solid;border-width: 1px;border-radius: 3px;outline: 0;box-shadow: none;box-sizing: border-box;resize: none;-webkit-appearance: none;-moz-appearance: none;appearance: none;} + +.tox .tox-selectfield select:focus,.tox .tox-textarea:focus,.tox .tox-textfield:focus{border-color: #207ab7;outline: 0;box-shadow: none;} + +.tox .tox-toolbar-textfield{max-width: 250px;margin-top: 2px;margin-bottom: 3px;border-width: 0;} + +.tox .tox-naked-btn{display: block;padding: 0;margin: 0;color: #207ab7;cursor: pointer;background-color: transparent;border: 0;border-color: transparent;box-shadow: unset;} + +.tox .tox-naked-btn svg{display: block;fill: #fff;} + +.tox:not([dir=rtl]) .tox-toolbar-textfield+*{margin-left: 4px;} + +.tox[dir=rtl] .tox-toolbar-textfield+*{margin-right: 4px;} + +.tox .tox-selectfield{position: relative;cursor: pointer;} + +.tox .tox-selectfield select::-ms-expand{display: none;} + +.tox .tox-selectfield svg{position: absolute;top: 50%;pointer-events: none;transform: translateY(-50%);} + +.tox:not([dir=rtl]) .tox-selectfield select{padding-right: 24px;} + +.tox:not([dir=rtl]) .tox-selectfield svg{right: 8px;} + +.tox[dir=rtl] .tox-selectfield select{padding-left: 24px;} + +.tox[dir=rtl] .tox-selectfield svg{left: 8px;} + +.tox .tox-textarea{white-space: pre-wrap;-webkit-appearance: textarea;-moz-appearance: textarea;appearance: textarea;} + +.tox-fullscreen{position: fixed;top: 0;left: 0;width: 100%;height: 100%;padding: 0;margin: 0;overflow: hidden;border: 0;} + +.tox-fullscreen .tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle{display: none;} + +.tox-fullscreen .tox.tox-tinymce.tox-fullscreen{z-index: 1200;} + +.tox-fullscreen .tox.tox-tinymce-aux{z-index: 1201;} + +.tox .tox-image-tools{width: 100%;} + +.tox .tox-image-tools__toolbar{align-items: center;display: flex;justify-content: center;} + +.tox .tox-image-tools__image{position: relative;width: 100%;height: 380px;overflow: auto;background-color: #666;} + +.tox .tox-image-tools__image,.tox .tox-image-tools__image+.tox-image-tools__toolbar{margin-top: 8px;} + +.tox .tox-image-tools__image-bg{background: url(data:image/gif;base64,R0lGODdhDAAMAIABAMzMzP///ywAAAAADAAMAAACFoQfqYeabNyDMkBQb81Uat85nxguUAEAOw==);} + +.tox .tox-image-tools__toolbar>.tox-spacer{flex: 1;-ms-flex-preferred-size: auto;} + +.tox .tox-croprect-block{position: absolute;background: #000;opacity: .5;zoom: 1;} + +.tox .tox-croprect-handle{position: absolute;top: 0;left: 0;width: 20px;height: 20px;border: 2px solid #fff;} + +.tox .tox-croprect-handle-move{position: absolute;cursor: move;border: 0;} + +.tox .tox-croprect-handle-nw{top: 100px;left: 100px;margin: -2px 0 0 -2px;cursor: nw-resize;border-width: 2px 0 0 2px;} + +.tox .tox-croprect-handle-ne{top: 100px;left: 200px;margin: -2px 0 0 -20px;cursor: ne-resize;border-width: 2px 2px 0 0;} + +.tox .tox-croprect-handle-sw{top: 200px;left: 100px;margin: -20px 2px 0 -2px;cursor: sw-resize;border-width: 0 0 2px 2px;} + +.tox .tox-croprect-handle-se{top: 200px;left: 200px;margin: -20px 0 0 -20px;cursor: se-resize;border-width: 0 2px 2px 0;} + +.tox:not([dir=rtl]) .tox-image-tools__toolbar>.tox-slider:not(:first-of-type){margin-left: 8px;} + +.tox:not([dir=rtl]) .tox-image-tools__toolbar>.tox-button+.tox-slider{margin-left: 32px;} + +.tox:not([dir=rtl]) .tox-image-tools__toolbar>.tox-slider+.tox-button{margin-left: 32px;} + +.tox[dir=rtl] .tox-image-tools__toolbar>.tox-slider:not(:first-of-type){margin-right: 8px;} + +.tox[dir=rtl] .tox-image-tools__toolbar>.tox-button+.tox-slider{margin-right: 32px;} + +.tox[dir=rtl] .tox-image-tools__toolbar>.tox-slider+.tox-button{margin-right: 32px;} + +.tox .tox-insert-table-picker{display: flex;flex-wrap: wrap;width: 169px;} + +.tox .tox-insert-table-picker>div{width: 16px;height: 16px;border-color: #070a0d;border-style: solid;border-width: 0 1px 1px 0;box-sizing: content-box;} + +.tox .tox-collection--list .tox-collection__group .tox-insert-table-picker{margin: -4px 0;} + +.tox .tox-insert-table-picker .tox-insert-table-picker__selected{background-color: rgba(32,122,183,.5);border-color: rgba(32,122,183,.5);} + +.tox .tox-insert-table-picker__label{display: block;width: 100%;padding: 4px;font-size: 14px;color: #fff;text-align: center;} + +.tox:not([dir=rtl]) .tox-insert-table-picker>div:nth-child(10n){border-right: 0;} + +.tox[dir=rtl] .tox-insert-table-picker>div:nth-child(10n+1){border-right: 0;} + +.tox .tox-menu{z-index: 1;display: inline-block;overflow: hidden;vertical-align: top;background-color: #2b3b4e;border: 1px solid #000;border-radius: 3px;box-shadow: 0 4px 8px 0 rgba(34,47,62,.1);} + +.tox .tox-menu.tox-collection.tox-collection--list{padding: 0;} + +.tox .tox-menu.tox-collection.tox-collection--toolbar{padding: 4px;} + +.tox .tox-menu.tox-collection.tox-collection--grid{padding: 4px;} + +.tox .tox-menu__label blockquote,.tox .tox-menu__label code,.tox .tox-menu__label h1,.tox .tox-menu__label h2,.tox .tox-menu__label h3,.tox .tox-menu__label h4,.tox .tox-menu__label h5,.tox .tox-menu__label h6,.tox .tox-menu__label p{margin: 0;} + +.tox .tox-menubar{display: flex;padding: 0 4px;margin-bottom: -1px;background: url("data:image/svg+xml;charset=utf8,%3Csvg height='43px' viewBox='0 0 40 43px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='42px' width='100' height='1' fill='%23000000'/%3E%3C/svg%3E") left 0 top 0 #222f3e;background-color: #222f3e;flex: 0 0 auto;flex-shrink: 0;flex-wrap: wrap;} + +.tox .tox-mbtn{display: flex;width: auto;height: 34px;padding: 0 4px;margin: 2px 0 3px 0;overflow: hidden;font-size: 14px;font-style: normal;font-weight: 400;color: #fff;text-transform: normal;background: 0 0;border: 0;border-radius: 3px;outline: 0;box-shadow: none;align-items: center;flex: 0 0 auto;justify-content: center;} + +.tox .tox-mbtn[disabled]{color: rgba(255,255,255,.5);cursor: not-allowed;background-color: none;border-color: none;box-shadow: none;} + +.tox .tox-mbtn:hover:not(:disabled){color: #fff;background: #434e5b;box-shadow: none;} + +.tox .tox-mbtn:focus:not(:disabled){color: #fff;background: #434e5b;box-shadow: none;} + +.tox .tox-mbtn--active{color: #fff;background: #6f7882;box-shadow: none;} + +.tox .tox-mbtn__select-label{margin: 0 4px;font-weight: 400;cursor: default;} + +.tox .tox-mbtn[disabled] .tox-mbtn__select-label{cursor: not-allowed;} + +.tox .tox-mbtn__select-chevron{display: flex;display: none;width: 16px;align-items: center;justify-content: center;} + +.tox .tox-notification{display: grid;padding: 5px;margin-top: 5px;background-color: #fffaea;border-color: #ffe89d;border-style: solid;border-width: 1px;opacity: 0;box-sizing: border-box;transition: transform .1s ease-in,opacity 150ms ease-in;grid-template-columns: minmax(40px,1fr) auto minmax(40px,1fr);} + +.tox .tox-notification--in{opacity: 1;} + +.tox .tox-notification--success{background-color: #dff0d8;border-color: #d6e9c6;} + +.tox .tox-notification--error{background-color: #f2dede;border-color: #ebccd1;} + +.tox .tox-notification--warn{background-color: #fcf8e3;border-color: #faebcc;} + +.tox .tox-notification--info{background-color: #d9edf7;border-color: #779ecb;} + +.tox .tox-notification__body{font-size: 14px;color: #fff;text-align: center;word-break: break-all;word-break: break-word;white-space: normal;align-self: center;grid-column-end: 3;-ms-grid-column-span: 1;grid-column-start: 2;grid-row-end: 2;grid-row-start: 1;} + +.tox .tox-notification__body>*{margin: 0;} + +.tox .tox-notification__body>*+*{margin-top: 1rem;} + +.tox .tox-notification__icon{align-self: center;-ms-grid-column-align: end;grid-column-end: 2;-ms-grid-column-span: 1;grid-column-start: 1;grid-row-end: 2;grid-row-start: 1;justify-self: end;} + +.tox .tox-notification__icon svg{display: block;} + +.tox .tox-notification__dismiss{align-self: start;-ms-grid-column-align: end;grid-column-end: 4;-ms-grid-column-span: 1;grid-column-start: 3;grid-row-end: 2;grid-row-start: 1;justify-self: end;} + +.tox .tox-notification .tox-progress-bar{-ms-grid-column-align: center;grid-column-end: 4;-ms-grid-column-span: 3;grid-column-start: 1;grid-row-end: 3;-ms-grid-row-span: 1;grid-row-start: 2;justify-self: center;} + +.tox .tox-pop{position: relative;display: inline-block;} + +.tox .tox-pop--resizing{transition: width .1s ease;} + +.tox .tox-pop--resizing .tox-toolbar{flex-wrap: nowrap;} + +.tox .tox-pop__dialog{min-width: 0;overflow: hidden;background-color: #222f3e;border: 1px solid #000;border-radius: 3px;box-shadow: 0 1px 3px rgba(0,0,0,.15);} + +.tox .tox-pop__dialog>:not(.tox-toolbar){margin: 4px 4px 4px 8px;} + +.tox .tox-pop__dialog .tox-toolbar{background-color: transparent;} + +.tox .tox-pop::after,.tox .tox-pop::before{position: absolute;display: block;width: 0;height: 0;border-style: solid;content: '';} + +.tox .tox-pop.tox-pop--bottom::after,.tox .tox-pop.tox-pop--bottom::before{top: 100%;left: 50%;} + +.tox .tox-pop.tox-pop--bottom::after{margin-top: -1px;margin-left: -8px;border-color: #222f3e transparent transparent transparent;border-width: 8px;} + +.tox .tox-pop.tox-pop--bottom::before{margin-left: -9px;border-color: #000 transparent transparent transparent;border-width: 9px;} + +.tox .tox-pop.tox-pop--top::after,.tox .tox-pop.tox-pop--top::before{top: 0;left: 50%;transform: translateY(-100%);} + +.tox .tox-pop.tox-pop--top::after{margin-top: 1px;margin-left: -8px;border-color: transparent transparent #222f3e transparent;border-width: 8px;} + +.tox .tox-pop.tox-pop--top::before{margin-left: -9px;border-color: transparent transparent #000 transparent;border-width: 9px;} + +.tox .tox-pop.tox-pop--left::after,.tox .tox-pop.tox-pop--left::before{top: calc(50% - 1px);left: 0;transform: translateY(-50%);} + +.tox .tox-pop.tox-pop--left::after{margin-left: -15px;border-color: transparent #222f3e transparent transparent;border-width: 8px;} + +.tox .tox-pop.tox-pop--left::before{margin-left: -19px;border-color: transparent #000 transparent transparent;border-width: 10px;} + +.tox .tox-pop.tox-pop--right::after,.tox .tox-pop.tox-pop--right::before{top: calc(50% + 1px);left: 100%;transform: translateY(-50%);} + +.tox .tox-pop.tox-pop--right::after{margin-left: -1px;border-color: transparent transparent transparent #222f3e;border-width: 8px;} + +.tox .tox-pop.tox-pop--right::before{margin-left: -1px;border-color: transparent transparent transparent #000;border-width: 10px;} + +.tox .tox-pop.tox-pop--align-left::after,.tox .tox-pop.tox-pop--align-left::before{left: 20px;} + +.tox .tox-pop.tox-pop--align-right::after,.tox .tox-pop.tox-pop--align-right::before{left: calc(100% - 20px);} + +.tox .tox-sidebar-wrap{display: flex;flex-direction: row;flex-grow: 1;min-height: 0;} + +.tox .tox-sidebar{display: flex;flex-direction: row;justify-content: flex-end;} + +.tox .tox-sidebar__slider{display: flex;overflow: hidden;} + +.tox .tox-sidebar__pane-container{display: flex;} + +.tox .tox-sidebar__pane{display: flex;} + +.tox .tox-sidebar--sliding-closed{opacity: 0;} + +.tox .tox-sidebar--sliding-open{opacity: 1;} + +.tox .tox-sidebar--sliding-growing,.tox .tox-sidebar--sliding-shrinking{transition: width .5s ease,opacity .5s ease;} + +.tox .tox-slider{position: relative;display: flex;height: 24px;align-items: center;flex: 1;-ms-flex-preferred-size: auto;justify-content: center;} + +.tox .tox-slider__rail{width: 100%;height: 10px;min-width: 120px;background-color: transparent;border: 1px solid #000;border-radius: 3px;} + +.tox .tox-slider__handle{position: absolute;top: 50%;left: 50%;width: 14px;height: 24px;background-color: #207ab7;border: 2px solid #185d8c;border-radius: 3px;transform: translateX(-50%) translateY(-50%);box-shadow: none;} + +.tox .tox-source-code{overflow: auto;} + +.tox .tox-spinner{display: flex;} + +.tox .tox-spinner>div{width: 8px;height: 8px;background-color: rgba(255,255,255,.5);border-radius: 100%;animation: tam-bouncing-dots 1.5s ease-in-out 0s infinite both;} + +.tox .tox-spinner>div:nth-child(1){animation-delay: -.32s;} + +.tox .tox-spinner>div:nth-child(2){animation-delay: -.16s;}@keyframes tam-bouncing-dots{0%,100%,80%{transform: scale(0);} + +40%{transform: scale(1);}} + +.tox:not([dir=rtl]) .tox-spinner>div:not(:first-child){margin-left: 4px;} + +.tox[dir=rtl] .tox-spinner>div:not(:first-child){margin-right: 4px;} + +.tox .tox-statusbar{position: relative;display: flex;height: 18px;padding: 0 8px;overflow: hidden;font-size: 12px;color: rgba(255,255,255,.5);text-transform: uppercase;background-color: #222f3e;border-top: 1px solid #000;align-items: center;flex: 0 0 auto;} + +.tox .tox-statusbar a{color: rgba(255,255,255,.5);text-decoration: none;} + +.tox .tox-statusbar a:hover{text-decoration: underline;} + +.tox .tox-statusbar__text-container{display: flex;flex: 1 1 auto;justify-content: flex-end;overflow: hidden;} + +.tox .tox-statusbar__path{display: flex;flex: 1 1 auto;margin-right: auto;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;} + +.tox .tox-statusbar__path>*{display: inline;white-space: nowrap;} + +.tox .tox-statusbar__wordcount{flex: 0 0 auto;margin-left: 1ch;} + +.tox .tox-statusbar__resize-handle{display: flex;padding-left: 1ch;margin-right: -8px;margin-left: auto;cursor: nwse-resize;align-items: flex-end;align-self: stretch;flex: 0 0 auto;justify-content: flex-end;} + +.tox .tox-statusbar__resize-handle svg{display: block;fill: rgba(255,255,255,.5);} + +.tox:not([dir=rtl]) .tox-statusbar__path>*{margin-right: 4px;} + +.tox:not([dir=rtl]) .tox-statusbar__branding{margin-left: 1ch;} + +.tox[dir=rtl] .tox-statusbar{flex-direction: row-reverse;} + +.tox[dir=rtl] .tox-statusbar__path>*{margin-left: 4px;} + +.tox .tox-throbber{z-index: 1400;} + +.tox .tox-throbber__busy-spinner{position: absolute;top: 0;right: 0;bottom: 0;left: 0;display: flex;background-color: rgba(34,47,62,.6);align-items: center;justify-content: center;} + +.tox .tox-tbtn{display: flex;width: 34px;height: 34px;padding: 0;margin: 2px 0 3px 0;overflow: hidden;font-size: 14px;font-style: normal;font-weight: 400;color: #fff;text-transform: normal;background: 0 0;border: 0;border-radius: 3px;outline: 0;box-shadow: none;align-items: center;flex: 0 0 auto;justify-content: center;} + +.tox .tox-tbtn svg{display: block;fill: #fff;} + +.tox .tox-tbtn.tox-tbtn-more{width: inherit;padding-right: 5px;padding-left: 5px;} + +.tox .tox-tbtn--enabled{color: #fff;background: #6f7882;box-shadow: none;} + +.tox .tox-tbtn--enabled>*{transform: none;} + +.tox .tox-tbtn--enabled svg{fill: #fff;} + +.tox .tox-tbtn:hover{color: #fff;background: #434e5b;box-shadow: none;} + +.tox .tox-tbtn:hover svg{fill: #fff;} + +.tox .tox-tbtn:focus{color: #fff;background: #434e5b;box-shadow: none;} + +.tox .tox-tbtn:focus svg{fill: #fff;} + +.tox .tox-tbtn:active{color: #fff;background: #6f7882;box-shadow: none;} + +.tox .tox-tbtn:active svg{fill: #fff;} + +.tox .tox-tbtn--disabled,.tox .tox-tbtn--disabled:hover,.tox .tox-tbtn:disabled,.tox .tox-tbtn:disabled:hover{color: rgba(255,255,255,.5);cursor: not-allowed;background: 0 0;box-shadow: none;} + +.tox .tox-tbtn--disabled svg,.tox .tox-tbtn--disabled:hover svg,.tox .tox-tbtn:disabled svg,.tox .tox-tbtn:disabled:hover svg{fill: rgba(255,255,255,.5);} + +.tox .tox-tbtn:active>*{transform: none;} + +.tox .tox-tbtn--md{width: 51px;height: 51px;} + +.tox .tox-tbtn--lg{width: 68px;height: 68px;flex-direction: column;} + +.tox .tox-tbtn--return{width: 16px;height: unset;align-self: stretch;} + +.tox .tox-tbtn--labeled{width: unset;padding: 0 4px;} + +.tox .tox-tbtn__vlabel{display: block;margin-bottom: 4px;font-size: 10px;font-weight: 400;letter-spacing: -.025em;white-space: nowrap;} + +.tox .tox-tbtn--select{width: auto;padding: 0 4px;margin: 2px 0 3px 0;} + +.tox .tox-tbtn__select-label{margin: 0 4px;font-weight: 400;cursor: default;} + +.tox .tox-tbtn__select-chevron{align-items: center;display: flex;justify-content: center;width: 16px;} + +.tox .tox-tbtn__select-chevron svg{fill: rgba(255,255,255,.5);} + +.tox .tox-tbtn--bespoke .tox-tbtn__select-label{width: 7em;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;} + +.tox .tox-split-button{display: flex;margin: 2px 0 3px 0;overflow: hidden;border: 0;border-radius: 3px;box-sizing: border-box;} + +.tox .tox-split-button:hover{box-shadow: 0 0 0 1px #434e5b inset;} + +.tox .tox-split-button:focus{color: #fff;background: #434e5b;box-shadow: none;} + +.tox .tox-split-button>*{border-radius: 0;} + +.tox .tox-split-button__chevron{width: 16px;} + +.tox .tox-split-button__chevron svg{fill: rgba(255,255,255,.5);} + +.tox .tox-pop .tox-split-button__chevron svg{transform: rotate(-90deg);} + +.tox .tox-split-button .tox-tbtn{margin: 0;} + +.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:focus,.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:hover,.tox .tox-split-button.tox-tbtn--disabled:focus,.tox .tox-split-button.tox-tbtn--disabled:hover{color: rgba(255,255,255,.5);background: 0 0;box-shadow: none;} + +.tox .tox-toolbar,.tox .tox-toolbar__overflow,.tox .tox-toolbar__primary{display: flex;padding: 0 0;margin-bottom: -1px;background: url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23000000'/%3E%3C/svg%3E") left 0 top 0 #222f3e;background-color: #222f3e;border-top: 1px solid #000;flex: 0 0 auto;flex-shrink: 0;flex-wrap: wrap;} + +.tox .tox-toolbar__overflow.tox-toolbar__overflow--closed{height: 0;opacity: 0;visibility: hidden;} + +.tox .tox-toolbar__overflow--growing{transition: height .3s ease,opacity .2s linear .1s;} + +.tox .tox-toolbar__overflow--shrinking{transition: opacity .3s ease,height .2s linear .1s,visibility 0s linear .3s;} + +.tox .tox-pop .tox-toolbar{border-width: 0;} + +.tox .tox-toolbar--no-divider{background-image: none;} + +.tox.tox-tinymce-aux .tox-toolbar__overflow{background-color: #222f3e;border: 1px solid #000;border-radius: 3px;box-shadow: 0 1px 3px rgba(0,0,0,.15);} + +.tox.tox-tinymce-aux:not([dir=rtl]) .tox-toolbar__overflow{margin-left: 4px;} + +.tox[dir=rtl] .tox-tbtn__icon-rtl svg{transform: rotateY(180deg);} + +.tox[dir=rtl].tox-tinymce-aux .tox-toolbar__overflow{margin-right: 4px;} + +.tox .tox-toolbar__group{display: flex;padding: 0 4px;margin: 0 0;align-items: center;flex-wrap: wrap;} + +.tox .tox-toolbar__group--pull-right{margin-left: auto;} + +.tox:not([dir=rtl]) .tox-toolbar__group:not(:last-of-type){border-right: 1px solid #000;} + +.tox[dir=rtl] .tox-toolbar__group:not(:last-of-type){border-left: 1px solid #000;} + +.tox .tox-tooltip{position: relative;display: inline-block;padding: 8px;} + +.tox .tox-tooltip__body{padding: 4px 8px;font-size: 14px;font-style: normal;font-weight: 400;color: rgba(255,255,255,.75);text-transform: normal;background-color: #3d546f;border-radius: 3px;box-shadow: 0 2px 4px rgba(34,47,62,.3);} + +.tox .tox-tooltip__arrow{position: absolute;} + +.tox .tox-tooltip--down .tox-tooltip__arrow{position: absolute;bottom: 0;left: 50%;border-top: 8px solid #3d546f;border-right: 8px solid transparent;border-left: 8px solid transparent;transform: translateX(-50%);} + +.tox .tox-tooltip--up .tox-tooltip__arrow{position: absolute;top: 0;left: 50%;border-right: 8px solid transparent;border-bottom: 8px solid #3d546f;border-left: 8px solid transparent;transform: translateX(-50%);} + +.tox .tox-tooltip--right .tox-tooltip__arrow{position: absolute;top: 50%;right: 0;border-top: 8px solid transparent;border-bottom: 8px solid transparent;border-left: 8px solid #3d546f;transform: translateY(-50%);} + +.tox .tox-tooltip--left .tox-tooltip__arrow{position: absolute;top: 50%;left: 0;border-top: 8px solid transparent;border-right: 8px solid #3d546f;border-bottom: 8px solid transparent;transform: translateY(-50%);} + +.tox .tox-well{width: 100%;padding: 8px;border: 1px solid #000;border-radius: 3px;} + +.tox .tox-well>:first-child{margin-top: 0;} + +.tox .tox-well>:last-child{margin-bottom: 0;} + +.tox .tox-well>:only-child{margin: 0;} + +.tox .tox-custom-editor{display: flex;height: 525px;border: 1px solid #000;border-radius: 3px;} + +.tox .tox-dialog-loading::before{position: absolute;z-index: 1000;width: 100%;height: 100%;background-color: rgba(0,0,0,.5);content: "";} + +.tox .tox-tab{cursor: pointer;} + +.tox .tox-dialog__content-js{display: flex;flex: 1;-ms-flex-preferred-size: auto;} + +.tox .tox-dialog__body-content .tox-collection{display: flex;flex: 1;-ms-flex-preferred-size: auto;} + +.tox ul{display: block;list-style-type: disc;-webkit-margin-before: 1em;margin-block-start: 1em;-webkit-margin-after: 1em;margin-block-end: 1em;-webkit-margin-start: 0;margin-inline-start: 0;-webkit-margin-end: 0;margin-inline-end: 0;-webkit-padding-start: 40px;padding-inline-start: 40px;} + +.tox a{color: #2276d2;cursor: pointer;} + +.tox .tox-image-tools-edit-panel{height: 60px;} + +.tox .tox-image-tools__sidebar{height: 60px;} diff --git a/monolithic/frontend/public/resource/tinymce/skins/ui/oxide-dark/skin.mobile.min.css b/monolithic/frontend/public/resource/tinymce/skins/ui/oxide-dark/skin.mobile.min.css new file mode 100644 index 0000000..14847d0 --- /dev/null +++ b/monolithic/frontend/public/resource/tinymce/skins/ui/oxide-dark/skin.mobile.min.css @@ -0,0 +1,239 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +.tinymce-mobile-outer-container{all: initial;display: block;} + +.tinymce-mobile-outer-container *{float: none;padding: 0;margin: 0;line-height: 1;text-shadow: none;white-space: nowrap;cursor: inherit;border: 0;outline: 0;box-sizing: initial;-webkit-tap-highlight-color: transparent;} + +.tinymce-mobile-icon-arrow-back::before{content: "\e5cd";} + +.tinymce-mobile-icon-image::before{content: "\e412";} + +.tinymce-mobile-icon-cancel-circle::before{content: "\e5c9";} + +.tinymce-mobile-icon-full-dot::before{content: "\e061";} + +.tinymce-mobile-icon-align-center::before{content: "\e234";} + +.tinymce-mobile-icon-align-left::before{content: "\e236";} + +.tinymce-mobile-icon-align-right::before{content: "\e237";} + +.tinymce-mobile-icon-bold::before{content: "\e238";} + +.tinymce-mobile-icon-italic::before{content: "\e23f";} + +.tinymce-mobile-icon-unordered-list::before{content: "\e241";} + +.tinymce-mobile-icon-ordered-list::before{content: "\e242";} + +.tinymce-mobile-icon-font-size::before{content: "\e245";} + +.tinymce-mobile-icon-underline::before{content: "\e249";} + +.tinymce-mobile-icon-link::before{content: "\e157";} + +.tinymce-mobile-icon-unlink::before{content: "\eca2";} + +.tinymce-mobile-icon-color::before{content: "\e891";} + +.tinymce-mobile-icon-previous::before{content: "\e314";} + +.tinymce-mobile-icon-next::before{content: "\e315";} + +.tinymce-mobile-icon-large-font::before,.tinymce-mobile-icon-style-formats::before{content: "\e264";} + +.tinymce-mobile-icon-undo::before{content: "\e166";} + +.tinymce-mobile-icon-redo::before{content: "\e15a";} + +.tinymce-mobile-icon-removeformat::before{content: "\e239";} + +.tinymce-mobile-icon-small-font::before{content: "\e906";} + +.tinymce-mobile-format-matches::after,.tinymce-mobile-icon-readonly-back::before{content: "\e5ca";} + +.tinymce-mobile-icon-small-heading::before{content: "small";} + +.tinymce-mobile-icon-large-heading::before{content: "large";} + +.tinymce-mobile-icon-large-heading::before,.tinymce-mobile-icon-small-heading::before{font-family: sans-serif;font-size: 80%;} + +.tinymce-mobile-mask-edit-icon::before{content: "\e254";} + +.tinymce-mobile-icon-back::before{content: "\e5c4";} + +.tinymce-mobile-icon-heading::before{font-family: sans-serif;font-size: 80%;font-weight: 700;content: "Headings";} + +.tinymce-mobile-icon-h1::before{font-weight: 700;content: "H1";} + +.tinymce-mobile-icon-h2::before{font-weight: 700;content: "H2";} + +.tinymce-mobile-icon-h3::before{font-weight: 700;content: "H3";} + +.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask{position: absolute;top: 0;display: flex;width: 100%;height: 100%;background: rgba(51,51,51,.5);align-items: center;justify-content: center;} + +.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container{display: flex;font-family: sans-serif;font-size: 1em;border-radius: 50%;align-items: center;flex-direction: column;justify-content: space-between;} + +.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .mixin-menu-item{display: flex;width: 2.1em;height: 2.1em;border-radius: 50%;align-items: center;justify-content: center;} + +.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section{align-items: center;display: flex;justify-content: center;flex-direction: column;font-size: 1em;}@media only screen and (min-device-width: 700px){.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section{font-size: 1.2em;}} + +.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon{display: flex;width: 2.1em;height: 2.1em;color: #207ab7;background-color: #fff;border-radius: 50%;align-items: center;justify-content: center;} + +.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon::before{font-family: tinymce-mobile,sans-serif;content: "\e900";} + +.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section:not(.tinymce-mobile-mask-tap-icon-selected) .tinymce-mobile-mask-tap-icon{z-index: 2;} + +.tinymce-mobile-android-container.tinymce-mobile-android-maximized{position: fixed;top: 0;right: 0;bottom: 0;left: 0;display: flex;background: #fff;border: none;flex-direction: column;} + +.tinymce-mobile-android-container:not(.tinymce-mobile-android-maximized){position: relative;} + +.tinymce-mobile-android-container .tinymce-mobile-editor-socket{display: flex;flex-grow: 1;} + +.tinymce-mobile-android-container .tinymce-mobile-editor-socket iframe{display: flex !important;flex-grow: 1;height: auto !important;} + +.tinymce-mobile-android-scroll-reload{overflow: hidden;} + +:not(.tinymce-mobile-readonly-mode)>.tinymce-mobile-android-selection-context-toolbar{margin-top: 23px;} + +.tinymce-mobile-toolstrip{z-index: 1;display: flex;background: #fff;flex: 0 0 auto;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar{display: flex;width: 100%;height: 2.5em;background-color: #fff;border-bottom: 1px solid #ccc;align-items: center;flex: 1;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group{align-items: center;display: flex;height: 100%;flex-shrink: 1;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group>div{align-items: center;display: flex;height: 100%;flex: 1;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-exit-container{background: #f44336;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-toolbar-scrollable-group{flex-grow: 1;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item{padding-right: .5em;padding-left: .5em;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button{display: flex;height: 80%;margin-right: 2px;margin-left: 2px;align-items: center;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button.tinymce-mobile-toolbar-button-selected{color: #ccc;background: #c8cbcf;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:first-of-type,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:last-of-type{color: #eceff1;background: #207ab7;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group{display: flex;height: 100%;padding-top: .4em;padding-bottom: .4em;align-items: center;flex: 1;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog{position: relative;display: flex;width: 100%;min-height: 1.5em;padding-right: 0;padding-left: 0;overflow: hidden;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain{display: flex;width: 100%;height: 100%;transition: left cubic-bezier(.4,0,1,1) .15s;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen{display: flex;flex: 0 0 auto;justify-content: space-between;width: 100%;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen input{font-family: sans-serif;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container{position: relative;display: flex;flex-grow: 1;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container .tinymce-mobile-input-container-x{position: absolute;right: 0;height: 100%;padding-right: 2px;font-size: .6em;font-weight: 700;color: #888;background: inherit;border: none;border-radius: 50%;align-self: center;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container.tinymce-mobile-input-container-empty .tinymce-mobile-input-container-x{display: none;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous{align-items: center;display: flex;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next::before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous::before{display: flex;height: 100%;padding-right: .5em;padding-left: .5em;font-weight: 700;align-items: center;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next.tinymce-mobile-toolbar-navigation-disabled::before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous.tinymce-mobile-toolbar-navigation-disabled::before{visibility: hidden;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item{padding-top: 3px;margin: 0 2px;font-size: 10px;line-height: 10px;color: #ccc;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item.tinymce-mobile-dot-active{color: #c8cbcf;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-font::before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-heading::before{margin-right: .9em;margin-left: .5em;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-font::before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-heading::before{margin-right: .5em;margin-left: .9em;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider{position: relative;display: flex;padding: .28em 0;margin-right: 0;margin-left: 0;flex: 1;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container{align-items: center;display: flex;flex-grow: 1;height: 100%;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container .tinymce-mobile-slider-size-line{display: flex;height: .2em;margin-top: .3em;margin-bottom: .3em;background: #ccc;flex: 1;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container{padding-right: 2em;padding-left: 2em;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container{align-items: center;display: flex;flex-grow: 1;height: 100%;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container .tinymce-mobile-slider-gradient{display: flex;height: .2em;margin-top: .3em;margin-bottom: .3em;background: linear-gradient(to right,red 0,#feff00 17%,#0f0 33%,#00feff 50%,#00f 67%,#ff00fe 83%,red 100%);flex: 1;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-black{width: 1.2em;height: .2em;margin-top: .3em;margin-bottom: .3em;background: #000;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-white{width: 1.2em;height: .2em;margin-top: .3em;margin-bottom: .3em;background: #fff;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb{position: absolute;top: 0;bottom: 0;left: -10px;display: flex;width: .5em;height: .5em;margin: auto;color: #fff;background-color: #455a64;border: .5em solid rgba(136,136,136,0);border-radius: 3em;transition: border 120ms cubic-bezier(.39,.58,.57,1);background-clip: padding-box;align-items: center;justify-content: center;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb.tinymce-mobile-thumb-active{border: .5em solid rgba(136,136,136,.39);} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group>div{align-items: center;display: flex;height: 100%;flex: 1;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper{flex-direction: column;justify-content: center;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item{align-items: center;display: flex;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item:not(.tinymce-mobile-serialised-dialog){height: 100%;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-container{display: flex;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input{padding-top: .1em;padding-bottom: .1em;padding-left: 5px;font-size: .85em;color: #455a64;background: #fff;border: none;border-radius: 0;flex-grow: 1;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::-webkit-input-placeholder{color: #888;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::placeholder{color: #888;} + +.tinymce-mobile-dropup{display: flex;width: 100%;overflow: hidden;background: #fff;} + +.tinymce-mobile-dropup.tinymce-mobile-dropup-shrinking{transition: height .3s ease-out;} + +.tinymce-mobile-dropup.tinymce-mobile-dropup-growing{transition: height .3s ease-in;} + +.tinymce-mobile-dropup.tinymce-mobile-dropup-closed{flex-grow: 0;} + +.tinymce-mobile-dropup.tinymce-mobile-dropup-open:not(.tinymce-mobile-dropup-growing){flex-grow: 1;} + +.tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height: 200px;}@media only screen and (orientation: landscape){.tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height: 200px;}}@media only screen and (min-device-width: 320px) and (max-device-width: 568px) and (orientation: landscape){.tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height: 150px;}} + +.tinymce-mobile-styles-menu{position: relative;width: 100%;overflow: hidden;font-family: sans-serif;outline: 4px solid #000;} + +.tinymce-mobile-styles-menu [role=menu]{position: absolute;display: flex;width: 100%;height: 100%;flex-direction: column;} + +.tinymce-mobile-styles-menu [role=menu].transitioning{transition: transform .5s ease-in-out;} + +.tinymce-mobile-styles-menu .tinymce-mobile-styles-item{position: relative;display: flex;padding: 1em 1em;color: #455a64;cursor: pointer;border-bottom: 1px solid #ddd;} + +.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser .tinymce-mobile-styles-collapse-icon::before{font-family: tinymce-mobile,sans-serif;color: #455a64;content: "\e314";} + +.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-styles-item-is-menu::after{position: absolute;right: 0;padding-right: 1em;padding-left: 1em;font-family: tinymce-mobile,sans-serif;color: #455a64;content: "\e315";} + +.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-format-matches::after{position: absolute;right: 0;padding-right: 1em;padding-left: 1em;font-family: tinymce-mobile,sans-serif;} + +.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser,.tinymce-mobile-styles-menu .tinymce-mobile-styles-separator{display: flex;min-height: 2.5em;padding-right: 1em;padding-left: 1em;color: #455a64;background: #fff;border-top: #455a64;align-items: center;} + +.tinymce-mobile-styles-menu [data-transitioning-destination=before][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state=before]{transform: translate(-100%);} + +.tinymce-mobile-styles-menu [data-transitioning-destination=current][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state=current]{transform: translate(0);} + +.tinymce-mobile-styles-menu [data-transitioning-destination=after][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state=after]{transform: translate(100%);}@font-face{font-family: tinymce-mobile;font-style: normal;font-weight: 400;src: url(fonts/tinymce-mobile.woff?8x92w3) format('woff');}@media (min-device-width: 700px){.tinymce-mobile-outer-container,.tinymce-mobile-outer-container input{font-size: 25px;}}@media (max-device-width: 700px){.tinymce-mobile-outer-container,.tinymce-mobile-outer-container input{font-size: 18px;}} + +.tinymce-mobile-icon{font-family: tinymce-mobile,sans-serif;} + +.mixin-flex-and-centre{align-items: center;display: flex;justify-content: center;} + +.mixin-flex-bar{align-items: center;display: flex;height: 100%;} + +.tinymce-mobile-outer-container .tinymce-mobile-editor-socket iframe{width: 100%;background-color: #fff;} + +.tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{position: fixed;right: 2em;bottom: 1em;display: flex;width: 2.1em;height: 2.1em;font-size: 1em;color: #fff;background-color: #207ab7;border-radius: 50%;align-items: center;justify-content: center;}@media only screen and (min-device-width: 700px){.tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{font-size: 1.2em;}} + +.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket{height: 300px;overflow: hidden;} + +.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket iframe{height: 100%;} + +.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-toolstrip{display: none;} + +input[type=file]::-webkit-file-upload-button{display: none;}@media only screen and (min-device-width: 320px) and (max-device-width: 568px) and (orientation: landscape){.tinymce-mobile-ios-container .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{bottom: 50%;}} diff --git a/monolithic/frontend/public/resource/tinymce/skins/ui/oxide/content.inline.min.css b/monolithic/frontend/public/resource/tinymce/skins/ui/oxide/content.inline.min.css new file mode 100644 index 0000000..748f313 --- /dev/null +++ b/monolithic/frontend/public/resource/tinymce/skins/ui/oxide/content.inline.min.css @@ -0,0 +1,239 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +.mce-content-body .mce-item-anchor{display: inline-block;width: 8px !important;height: 12px !important;padding: 0 2px;cursor: default;background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%2F%3E%3C%2Fsvg%3E%0A") no-repeat center;-webkit-user-select: all;-moz-user-select: all;-ms-user-select: all;user-select: all;-webkit-user-modify: read-only;-moz-user-modify: read-only;} + +.mce-content-body .mce-item-anchor[data-mce-selected]{outline-offset: 1px;} + +.tox-comments-visible .tox-comment{background-color: #fff0b7;} + +.tox-comments-visible .tox-comment--active{background-color: #ffe168;} + +.tox-checklist>li:not(.tox-checklist--hidden){margin: .25em 0;list-style: none;} + +.tox-checklist>li:not(.tox-checklist--hidden)::before{position: absolute;width: 1em;height: 1em;margin-top: .125em;margin-left: -1.5em;cursor: pointer;background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%234C4C4C%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A");background-size: 100%;content: '';} + +.tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked::before{background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A");} + +[dir=rtl] .tox-checklist>li:not(.tox-checklist--hidden)::before{margin-right: -1.5em;margin-left: 0;} + +code[class*=language-],pre[class*=language-]{font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size: .875rem;-webkit-hyphens: none;-ms-hyphens: none;hyphens: none;line-height: 1.5;word-spacing: normal;color: #000;text-shadow: 0 1px #fff;word-break: normal;word-wrap: normal;white-space: pre;-moz-tab-size: 4;tab-size: 4;} + +code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow: none;background: #b3d4fc;} + +code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow: none;background: #b3d4fc;}@media print{code[class*=language-],pre[class*=language-]{text-shadow: none;}} + +pre[class*=language-]{padding: 1em;margin: .5em 0;overflow: auto;} + +:not(pre)>code[class*=language-],pre[class*=language-]{background: 0 0 !important;border: 1px solid #ccc;} + +:not(pre)>code[class*=language-]{padding: .1em;border-radius: .3em;} + +.token.cdata,.token.comment,.token.doctype,.token.prolog{color: #708090;} + +.token.punctuation{color: #999;} + +.namespace{opacity: .7;} + +.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color: #905;} + +.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color: #690;} + +.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color: #a67f59;background: hsla(0,0%,100%,.5);} + +.token.atrule,.token.attr-value,.token.keyword{color: #07a;} + +.token.function{color: #dd4a68;} + +.token.important,.token.regex,.token.variable{color: #e90;} + +.token.bold,.token.important{font-weight: 700;} + +.token.italic{font-style: italic;} + +.token.entity{cursor: help;} + +:not([dir=rtl]) code[class*=language-],:not([dir=rtl]) pre[class*=language-]{text-align: left;direction: ltr;} + +[dir=rtl] code[class*=language-],[dir=rtl] pre[class*=language-]{text-align: right;direction: rtl;} + +.mce-content-body{overflow-wrap: break-word;word-wrap: break-word;} + +.mce-content-body .mce-visual-caret{position: absolute;background-color: #000;background-color: currentColor;} + +.mce-content-body .mce-visual-caret-hidden{display: none;} + +.mce-content-body [data-mce-caret]{position: absolute;top: 0;right: auto;left: -1000px;padding: 0;margin: 0;} + +.mce-content-body .mce-offscreen-selection{position: absolute;left: -9999999999px;max-width: 1000000px;} + +.mce-content-body [contentEditable=false]{cursor: default;} + +.mce-content-body [contentEditable=true]{cursor: text;} + +.tox-cursor-format-painter{cursor: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"),default;} + +.mce-content-body figure.align-left{float: left;} + +.mce-content-body figure.align-right{float: right;} + +.mce-content-body figure.image.align-center{display: table;margin-right: auto;margin-left: auto;} + +.mce-preview-object{position: relative;display: inline-block;margin: 0 2px 0 2px;line-height: 0;border: 1px solid gray;} + +.mce-preview-object .mce-shim{position: absolute;top: 0;left: 0;width: 100%;height: 100%;background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);} + +.mce-preview-object[data-mce-selected="2"] .mce-shim{display: none;} + +.mce-object{background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center;border: 1px dashed #aaa;} + +.mce-pagebreak{display: block;width: 100%;height: 5px;margin-top: 15px;cursor: default;border: 1px dashed #aaa;page-break-before: always;}@media print{.mce-pagebreak{border: 0;}} + +.tiny-pageembed .mce-shim{position: absolute;top: 0;left: 0;width: 100%;height: 100%;background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);} + +.tiny-pageembed[data-mce-selected="2"] .mce-shim{display: none;} + +.tiny-pageembed{position: relative;display: inline-block;} + +.tiny-pageembed--16by9,.tiny-pageembed--1by1,.tiny-pageembed--21by9,.tiny-pageembed--4by3{position: relative;display: block;width: 100%;padding: 0;overflow: hidden;} + +.tiny-pageembed--16by9::before,.tiny-pageembed--1by1::before,.tiny-pageembed--21by9::before,.tiny-pageembed--4by3::before{display: block;content: "";} + +.tiny-pageembed--21by9::before{padding-top: 42.857143%;} + +.tiny-pageembed--16by9::before{padding-top: 56.25%;} + +.tiny-pageembed--4by3::before{padding-top: 75%;} + +.tiny-pageembed--1by1::before{padding-top: 100%;} + +.tiny-pageembed--16by9 iframe,.tiny-pageembed--1by1 iframe,.tiny-pageembed--21by9 iframe,.tiny-pageembed--4by3 iframe{position: absolute;top: 0;left: 0;width: 100%;height: 100%;border: 0;} + +.mce-content-body div.mce-resizehandle{position: absolute;z-index: 10000;width: 10px;height: 10px;background-color: #4099ff;border-color: #4099ff;border-style: solid;border-width: 1px;box-sizing: border-box;} + +.mce-content-body div.mce-resizehandle:hover{background-color: #4099ff;} + +.mce-content-body div.mce-resizehandle:nth-of-type(1){cursor: nwse-resize;} + +.mce-content-body div.mce-resizehandle:nth-of-type(2){cursor: nesw-resize;} + +.mce-content-body div.mce-resizehandle:nth-of-type(3){cursor: nwse-resize;} + +.mce-content-body div.mce-resizehandle:nth-of-type(4){cursor: nesw-resize;} + +.mce-content-body .mce-clonedresizable{position: absolute;z-index: 10000;outline: 1px dashed #000;opacity: .5;} + +.mce-content-body .mce-resize-helper{position: absolute;z-index: 10001;display: none;padding: 5px;margin: 5px 10px;font-family: sans-serif;font-size: 12px;line-height: 14px;color: #fff;white-space: nowrap;background: #555;background: rgba(0,0,0,.75);border: 1px;border-radius: 3px;} + +.mce-match-marker{color: #fff;background: #aaa;} + +.mce-match-marker-selected{color: #fff;background: #39f;} + +.mce-content-body img[data-mce-selected],.mce-content-body table[data-mce-selected]{outline: 3px solid #b4d7ff;} + +.mce-content-body hr[data-mce-selected]{outline: 3px solid #b4d7ff;outline-offset: 1px;} + +.mce-content-body [contentEditable=false] [contentEditable=true]:focus{outline: 3px solid #b4d7ff;} + +.mce-content-body [contentEditable=false] [contentEditable=true]:hover{outline: 3px solid #b4d7ff;} + +.mce-content-body [contentEditable=false][data-mce-selected]{cursor: not-allowed;outline: 3px solid #b4d7ff;} + +.mce-content-body.mce-content-readonly [contentEditable=true]:focus,.mce-content-body.mce-content-readonly [contentEditable=true]:hover{outline: 0;} + +.mce-content-body [data-mce-selected=inline-boundary]{background-color: #b4d7ff;} + +.mce-content-body .mce-edit-focus{outline: 3px solid #b4d7ff;} + +.mce-content-body td[data-mce-selected],.mce-content-body th[data-mce-selected]{background-color: #b4d7ff !important;} + +.mce-content-body td[data-mce-selected]::-moz-selection,.mce-content-body th[data-mce-selected]::-moz-selection{background: 0 0;} + +.mce-content-body td[data-mce-selected]::selection,.mce-content-body th[data-mce-selected]::selection{background: 0 0;} + +.mce-content-body td[data-mce-selected] *,.mce-content-body th[data-mce-selected] *{-webkit-touch-callout: none;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;} + +.mce-content-body img::-moz-selection{background: 0 0;} + +.mce-content-body img::selection{background: 0 0;} + +.ephox-snooker-resizer-bar{background-color: #b4d7ff;opacity: 0;} + +.ephox-snooker-resizer-cols{cursor: col-resize;} + +.ephox-snooker-resizer-rows{cursor: row-resize;} + +.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging{opacity: 1;} + +.mce-spellchecker-word{height: 2rem;cursor: default;background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.5'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position: 0 calc(100% + 1px);background-repeat: repeat-x;background-size: auto 6px;} + +.mce-spellchecker-grammar{cursor: default;background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23008800'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position: 0 calc(100% + 1px);background-repeat: repeat-x;background-size: auto 6px;} + +.mce-toc{border: 1px solid gray;} + +.mce-toc h2{margin: 4px;} + +.mce-toc li{list-style-type: none;} + +.mce-item-table,.mce-item-table caption,.mce-item-table td,.mce-item-table th{border: 1px dashed #bbb;} + +.mce-visualblocks address,.mce-visualblocks article,.mce-visualblocks aside,.mce-visualblocks blockquote,.mce-visualblocks div:not([data-mce-bogus]),.mce-visualblocks dl,.mce-visualblocks figcaption,.mce-visualblocks figure,.mce-visualblocks h1,.mce-visualblocks h2,.mce-visualblocks h3,.mce-visualblocks h4,.mce-visualblocks h5,.mce-visualblocks h6,.mce-visualblocks hgroup,.mce-visualblocks ol,.mce-visualblocks p,.mce-visualblocks pre,.mce-visualblocks section,.mce-visualblocks ul{padding-top: 10px;margin-left: 3px;background-repeat: no-repeat;border: 1px dashed #bbb;} + +.mce-visualblocks p{background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7);} + +.mce-visualblocks h1{background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==);} + +.mce-visualblocks h2{background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==);} + +.mce-visualblocks h3{background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7);} + +.mce-visualblocks h4{background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==);} + +.mce-visualblocks h5{background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==);} + +.mce-visualblocks h6{background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==);} + +.mce-visualblocks div:not([data-mce-bogus]){background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7);} + +.mce-visualblocks section{background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=);} + +.mce-visualblocks article{background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7);} + +.mce-visualblocks blockquote{background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7);} + +.mce-visualblocks address{background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=);} + +.mce-visualblocks pre{background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==);} + +.mce-visualblocks figure{background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7);} + +.mce-visualblocks figcaption{border: 1px dashed #bbb;} + +.mce-visualblocks hgroup{background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7);} + +.mce-visualblocks aside{background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=);} + +.mce-visualblocks ul{background-image: url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==);} + +.mce-visualblocks ol{background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==);} + +.mce-visualblocks dl{background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==);} + +.mce-visualblocks:not([dir=rtl]) address,.mce-visualblocks:not([dir=rtl]) article,.mce-visualblocks:not([dir=rtl]) aside,.mce-visualblocks:not([dir=rtl]) blockquote,.mce-visualblocks:not([dir=rtl]) div:not([data-mce-bogus]),.mce-visualblocks:not([dir=rtl]) dl,.mce-visualblocks:not([dir=rtl]) figcaption,.mce-visualblocks:not([dir=rtl]) figure,.mce-visualblocks:not([dir=rtl]) h1,.mce-visualblocks:not([dir=rtl]) h2,.mce-visualblocks:not([dir=rtl]) h3,.mce-visualblocks:not([dir=rtl]) h4,.mce-visualblocks:not([dir=rtl]) h5,.mce-visualblocks:not([dir=rtl]) h6,.mce-visualblocks:not([dir=rtl]) hgroup,.mce-visualblocks:not([dir=rtl]) ol,.mce-visualblocks:not([dir=rtl]) p,.mce-visualblocks:not([dir=rtl]) pre,.mce-visualblocks:not([dir=rtl]) section,.mce-visualblocks:not([dir=rtl]) ul{margin-left: 3px;} + +.mce-visualblocks[dir=rtl] address,.mce-visualblocks[dir=rtl] article,.mce-visualblocks[dir=rtl] aside,.mce-visualblocks[dir=rtl] blockquote,.mce-visualblocks[dir=rtl] div:not([data-mce-bogus]),.mce-visualblocks[dir=rtl] dl,.mce-visualblocks[dir=rtl] figcaption,.mce-visualblocks[dir=rtl] figure,.mce-visualblocks[dir=rtl] h1,.mce-visualblocks[dir=rtl] h2,.mce-visualblocks[dir=rtl] h3,.mce-visualblocks[dir=rtl] h4,.mce-visualblocks[dir=rtl] h5,.mce-visualblocks[dir=rtl] h6,.mce-visualblocks[dir=rtl] hgroup,.mce-visualblocks[dir=rtl] ol,.mce-visualblocks[dir=rtl] p,.mce-visualblocks[dir=rtl] pre,.mce-visualblocks[dir=rtl] section,.mce-visualblocks[dir=rtl] ul{background-position-x: right;margin-right: 3px;} + +.mce-nbsp,.mce-shy{background: #aaa;} + +.mce-shy::after{content: '-';} + +.tox-toolbar-dock-fadeout{opacity: 0;visibility: hidden;} + +.tox-toolbar-dock-fadein{opacity: 1;visibility: visible;} + +.tox-toolbar-dock-transition{transition: visibility 0s linear .3s,opacity .3s ease;} + +.tox-toolbar-dock-transition.tox-toolbar-dock-fadein{transition-delay: 0s;} diff --git a/monolithic/frontend/public/resource/tinymce/skins/ui/oxide/content.min.css b/monolithic/frontend/public/resource/tinymce/skins/ui/oxide/content.min.css new file mode 100644 index 0000000..6e7165f --- /dev/null +++ b/monolithic/frontend/public/resource/tinymce/skins/ui/oxide/content.min.css @@ -0,0 +1,235 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +.mce-content-body .mce-item-anchor{display: inline-block;width: 8px !important;height: 12px !important;padding: 0 2px;cursor: default;background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%2F%3E%3C%2Fsvg%3E%0A") no-repeat center;-webkit-user-select: all;-moz-user-select: all;-ms-user-select: all;user-select: all;-webkit-user-modify: read-only;-moz-user-modify: read-only;} + +.mce-content-body .mce-item-anchor[data-mce-selected]{outline-offset: 1px;} + +.tox-comments-visible .tox-comment{background-color: #fff0b7;} + +.tox-comments-visible .tox-comment--active{background-color: #ffe168;} + +.tox-checklist>li:not(.tox-checklist--hidden){margin: .25em 0;list-style: none;} + +.tox-checklist>li:not(.tox-checklist--hidden)::before{position: absolute;width: 1em;height: 1em;margin-top: .125em;margin-left: -1.5em;cursor: pointer;background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%234C4C4C%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A");background-size: 100%;content: '';} + +.tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked::before{background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A");} + +[dir=rtl] .tox-checklist>li:not(.tox-checklist--hidden)::before{margin-right: -1.5em;margin-left: 0;} + +code[class*=language-],pre[class*=language-]{font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size: .875rem;-webkit-hyphens: none;-ms-hyphens: none;hyphens: none;line-height: 1.5;word-spacing: normal;color: #000;text-shadow: 0 1px #fff;word-break: normal;word-wrap: normal;white-space: pre;-moz-tab-size: 4;tab-size: 4;} + +code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow: none;background: #b3d4fc;} + +code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow: none;background: #b3d4fc;}@media print{code[class*=language-],pre[class*=language-]{text-shadow: none;}} + +pre[class*=language-]{padding: 1em;margin: .5em 0;overflow: auto;} + +:not(pre)>code[class*=language-],pre[class*=language-]{background: 0 0 !important;border: 1px solid #ccc;} + +:not(pre)>code[class*=language-]{padding: .1em;border-radius: .3em;} + +.token.cdata,.token.comment,.token.doctype,.token.prolog{color: #708090;} + +.token.punctuation{color: #999;} + +.namespace{opacity: .7;} + +.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color: #905;} + +.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color: #690;} + +.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color: #a67f59;background: hsla(0,0%,100%,.5);} + +.token.atrule,.token.attr-value,.token.keyword{color: #07a;} + +.token.function{color: #dd4a68;} + +.token.important,.token.regex,.token.variable{color: #e90;} + +.token.bold,.token.important{font-weight: 700;} + +.token.italic{font-style: italic;} + +.token.entity{cursor: help;} + +:not([dir=rtl]) code[class*=language-],:not([dir=rtl]) pre[class*=language-]{text-align: left;direction: ltr;} + +[dir=rtl] code[class*=language-],[dir=rtl] pre[class*=language-]{text-align: right;direction: rtl;} + +.mce-content-body{overflow-wrap: break-word;word-wrap: break-word;} + +.mce-content-body .mce-visual-caret{position: absolute;background-color: #000;background-color: currentColor;} + +.mce-content-body .mce-visual-caret-hidden{display: none;} + +.mce-content-body [data-mce-caret]{position: absolute;top: 0;right: auto;left: -1000px;padding: 0;margin: 0;} + +.mce-content-body .mce-offscreen-selection{position: absolute;left: -9999999999px;max-width: 1000000px;} + +.mce-content-body [contentEditable=false]{cursor: default;} + +.mce-content-body [contentEditable=true]{cursor: text;} + +.tox-cursor-format-painter{cursor: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"),default;} + +.mce-content-body figure.align-left{float: left;} + +.mce-content-body figure.align-right{float: right;} + +.mce-content-body figure.image.align-center{display: table;margin-right: auto;margin-left: auto;} + +.mce-preview-object{position: relative;display: inline-block;margin: 0 2px 0 2px;line-height: 0;border: 1px solid gray;} + +.mce-preview-object .mce-shim{position: absolute;top: 0;left: 0;width: 100%;height: 100%;background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);} + +.mce-preview-object[data-mce-selected="2"] .mce-shim{display: none;} + +.mce-object{background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center;border: 1px dashed #aaa;} + +.mce-pagebreak{display: block;width: 100%;height: 5px;margin-top: 15px;cursor: default;border: 1px dashed #aaa;page-break-before: always;}@media print{.mce-pagebreak{border: 0;}} + +.tiny-pageembed .mce-shim{position: absolute;top: 0;left: 0;width: 100%;height: 100%;background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);} + +.tiny-pageembed[data-mce-selected="2"] .mce-shim{display: none;} + +.tiny-pageembed{position: relative;display: inline-block;} + +.tiny-pageembed--16by9,.tiny-pageembed--1by1,.tiny-pageembed--21by9,.tiny-pageembed--4by3{position: relative;display: block;width: 100%;padding: 0;overflow: hidden;} + +.tiny-pageembed--16by9::before,.tiny-pageembed--1by1::before,.tiny-pageembed--21by9::before,.tiny-pageembed--4by3::before{display: block;content: "";} + +.tiny-pageembed--21by9::before{padding-top: 42.857143%;} + +.tiny-pageembed--16by9::before{padding-top: 56.25%;} + +.tiny-pageembed--4by3::before{padding-top: 75%;} + +.tiny-pageembed--1by1::before{padding-top: 100%;} + +.tiny-pageembed--16by9 iframe,.tiny-pageembed--1by1 iframe,.tiny-pageembed--21by9 iframe,.tiny-pageembed--4by3 iframe{position: absolute;top: 0;left: 0;width: 100%;height: 100%;border: 0;} + +.mce-content-body div.mce-resizehandle{position: absolute;z-index: 10000;width: 10px;height: 10px;background-color: #4099ff;border-color: #4099ff;border-style: solid;border-width: 1px;box-sizing: border-box;} + +.mce-content-body div.mce-resizehandle:hover{background-color: #4099ff;} + +.mce-content-body div.mce-resizehandle:nth-of-type(1){cursor: nwse-resize;} + +.mce-content-body div.mce-resizehandle:nth-of-type(2){cursor: nesw-resize;} + +.mce-content-body div.mce-resizehandle:nth-of-type(3){cursor: nwse-resize;} + +.mce-content-body div.mce-resizehandle:nth-of-type(4){cursor: nesw-resize;} + +.mce-content-body .mce-clonedresizable{position: absolute;z-index: 10000;outline: 1px dashed #000;opacity: .5;} + +.mce-content-body .mce-resize-helper{position: absolute;z-index: 10001;display: none;padding: 5px;margin: 5px 10px;font-family: sans-serif;font-size: 12px;line-height: 14px;color: #fff;white-space: nowrap;background: #555;background: rgba(0,0,0,.75);border: 1px;border-radius: 3px;} + +.mce-match-marker{color: #fff;background: #aaa;} + +.mce-match-marker-selected{color: #fff;background: #39f;} + +.mce-content-body img[data-mce-selected],.mce-content-body table[data-mce-selected]{outline: 3px solid #b4d7ff;} + +.mce-content-body hr[data-mce-selected]{outline: 3px solid #b4d7ff;outline-offset: 1px;} + +.mce-content-body [contentEditable=false] [contentEditable=true]:focus{outline: 3px solid #b4d7ff;} + +.mce-content-body [contentEditable=false] [contentEditable=true]:hover{outline: 3px solid #b4d7ff;} + +.mce-content-body [contentEditable=false][data-mce-selected]{cursor: not-allowed;outline: 3px solid #b4d7ff;} + +.mce-content-body.mce-content-readonly [contentEditable=true]:focus,.mce-content-body.mce-content-readonly [contentEditable=true]:hover{outline: 0;} + +.mce-content-body [data-mce-selected=inline-boundary]{background-color: #b4d7ff;} + +.mce-content-body .mce-edit-focus{outline: 3px solid #b4d7ff;} + +.mce-content-body td[data-mce-selected],.mce-content-body th[data-mce-selected]{background-color: #b4d7ff !important;} + +.mce-content-body td[data-mce-selected]::-moz-selection,.mce-content-body th[data-mce-selected]::-moz-selection{background: 0 0;} + +.mce-content-body td[data-mce-selected]::selection,.mce-content-body th[data-mce-selected]::selection{background: 0 0;} + +.mce-content-body td[data-mce-selected] *,.mce-content-body th[data-mce-selected] *{-webkit-touch-callout: none;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;} + +.mce-content-body img::-moz-selection{background: 0 0;} + +.mce-content-body img::selection{background: 0 0;} + +.ephox-snooker-resizer-bar{background-color: #b4d7ff;opacity: 0;} + +.ephox-snooker-resizer-cols{cursor: col-resize;} + +.ephox-snooker-resizer-rows{cursor: row-resize;} + +.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging{opacity: 1;} + +.mce-spellchecker-word{height: 2rem;cursor: default;background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.5'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position: 0 calc(100% + 1px);background-repeat: repeat-x;background-size: auto 6px;} + +.mce-spellchecker-grammar{cursor: default;background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23008800'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position: 0 calc(100% + 1px);background-repeat: repeat-x;background-size: auto 6px;} + +.mce-toc{border: 1px solid gray;} + +.mce-toc h2{margin: 4px;} + +.mce-toc li{list-style-type: none;} + +.mce-item-table,.mce-item-table caption,.mce-item-table td,.mce-item-table th{border: 1px dashed #bbb;} + +.mce-visualblocks address,.mce-visualblocks article,.mce-visualblocks aside,.mce-visualblocks blockquote,.mce-visualblocks div:not([data-mce-bogus]),.mce-visualblocks dl,.mce-visualblocks figcaption,.mce-visualblocks figure,.mce-visualblocks h1,.mce-visualblocks h2,.mce-visualblocks h3,.mce-visualblocks h4,.mce-visualblocks h5,.mce-visualblocks h6,.mce-visualblocks hgroup,.mce-visualblocks ol,.mce-visualblocks p,.mce-visualblocks pre,.mce-visualblocks section,.mce-visualblocks ul{padding-top: 10px;margin-left: 3px;background-repeat: no-repeat;border: 1px dashed #bbb;} + +.mce-visualblocks p{background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7);} + +.mce-visualblocks h1{background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==);} + +.mce-visualblocks h2{background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==);} + +.mce-visualblocks h3{background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7);} + +.mce-visualblocks h4{background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==);} + +.mce-visualblocks h5{background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==);} + +.mce-visualblocks h6{background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==);} + +.mce-visualblocks div:not([data-mce-bogus]){background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7);} + +.mce-visualblocks section{background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=);} + +.mce-visualblocks article{background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7);} + +.mce-visualblocks blockquote{background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7);} + +.mce-visualblocks address{background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=);} + +.mce-visualblocks pre{background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==);} + +.mce-visualblocks figure{background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7);} + +.mce-visualblocks figcaption{border: 1px dashed #bbb;} + +.mce-visualblocks hgroup{background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7);} + +.mce-visualblocks aside{background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=);} + +.mce-visualblocks ul{background-image: url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==);} + +.mce-visualblocks ol{background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==);} + +.mce-visualblocks dl{background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==);} + +.mce-visualblocks:not([dir=rtl]) address,.mce-visualblocks:not([dir=rtl]) article,.mce-visualblocks:not([dir=rtl]) aside,.mce-visualblocks:not([dir=rtl]) blockquote,.mce-visualblocks:not([dir=rtl]) div:not([data-mce-bogus]),.mce-visualblocks:not([dir=rtl]) dl,.mce-visualblocks:not([dir=rtl]) figcaption,.mce-visualblocks:not([dir=rtl]) figure,.mce-visualblocks:not([dir=rtl]) h1,.mce-visualblocks:not([dir=rtl]) h2,.mce-visualblocks:not([dir=rtl]) h3,.mce-visualblocks:not([dir=rtl]) h4,.mce-visualblocks:not([dir=rtl]) h5,.mce-visualblocks:not([dir=rtl]) h6,.mce-visualblocks:not([dir=rtl]) hgroup,.mce-visualblocks:not([dir=rtl]) ol,.mce-visualblocks:not([dir=rtl]) p,.mce-visualblocks:not([dir=rtl]) pre,.mce-visualblocks:not([dir=rtl]) section,.mce-visualblocks:not([dir=rtl]) ul{margin-left: 3px;} + +.mce-visualblocks[dir=rtl] address,.mce-visualblocks[dir=rtl] article,.mce-visualblocks[dir=rtl] aside,.mce-visualblocks[dir=rtl] blockquote,.mce-visualblocks[dir=rtl] div:not([data-mce-bogus]),.mce-visualblocks[dir=rtl] dl,.mce-visualblocks[dir=rtl] figcaption,.mce-visualblocks[dir=rtl] figure,.mce-visualblocks[dir=rtl] h1,.mce-visualblocks[dir=rtl] h2,.mce-visualblocks[dir=rtl] h3,.mce-visualblocks[dir=rtl] h4,.mce-visualblocks[dir=rtl] h5,.mce-visualblocks[dir=rtl] h6,.mce-visualblocks[dir=rtl] hgroup,.mce-visualblocks[dir=rtl] ol,.mce-visualblocks[dir=rtl] p,.mce-visualblocks[dir=rtl] pre,.mce-visualblocks[dir=rtl] section,.mce-visualblocks[dir=rtl] ul{background-position-x: right;margin-right: 3px;} + +.mce-nbsp,.mce-shy{background: #aaa;} + +.mce-shy::after{content: '-';} + +body{font-family: sans-serif;} + +table{border-collapse: collapse;} diff --git a/monolithic/frontend/public/resource/tinymce/skins/ui/oxide/content.mobile.min.css b/monolithic/frontend/public/resource/tinymce/skins/ui/oxide/content.mobile.min.css new file mode 100644 index 0000000..c052252 --- /dev/null +++ b/monolithic/frontend/public/resource/tinymce/skins/ui/oxide/content.mobile.min.css @@ -0,0 +1,17 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +.tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection{position: absolute;display: inline-block;background-color: green;opacity: .5;} + +body{-webkit-text-size-adjust: none;} + +body img{max-width: 96vw;} + +body table img{max-width: 95%;} + +body{font-family: sans-serif;} + +table{border-collapse: collapse;} diff --git a/monolithic/frontend/public/resource/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff b/monolithic/frontend/public/resource/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff new file mode 100644 index 0000000000000000000000000000000000000000..1e3be038a607cb7c2544ed8ae3d6621f77bf4c38 GIT binary patch literal 4624 zcmb7IeQaFC5#QN&AGUL{efE7g{=BM1W-|RaVdWQe^e?BC`eGz4^i8S3PQw?Hhd_eQHxTkckXZB zdzU((wCVGko!Qyh+1c6InRotvZ%+>+hNrBQtrFOI4t*}DZ$7=>Sr=uD3c$ZlKuKBQ z8~ervCczs9SOk2!>AAqrz+v$CC}f1JfYPDSqx->|V$6{ekbe8M#Bh3Gkg?)-Fdi3B zeB$}UFqn*$pv&q7*net~hsUOlfG7Ho2zaowY%JPRytMvu{&xRPm(h_~w##F>vqE&a5-ssH##mlfAk}44^ zXRJKd!Ifw&ce{$Y9BAg5c>e>p_Z;t!=P{izddGWie?aHLdKL3Cn9rG=d2vt;esWqH zoD}uAoi3Z~4+LABvADt+so4~t%VlyIJ{O3tm$NC+(!yenQD%NVr*btG$T3+_WX=LH z#1M2ZNEtrO+-x;l2i>M^5o%GQ@s?N+gw*19H@G~vl3Q5Zf*t6jjW0GOTmAmlWYgSS zJeiEo%~LA-FW|YAd_Em$OE#@dw)y*#@p!UtnWa);V1HY3ZBw!>(3gY{iFFa_c6iW9 zIQ@xck^{xu9_o;UyQH#ba@y?L$xW?8J35?$p1z46ZjIctZ8QCKCa29bMC1-t@pT>S zTUT1WMjQz-75d)5zJxv~@Yd)bY)ejQBx_XQiaMJ z>$5`NO3?L*ND{UQeF8%xl)$_>w9tmQpfEebzedazFeh#~d}suN+vzsqLiW~@TLhoe zk1%xEcxP2ZL)FuoXeYzb-J5goljDxPL2@@#RW)d&X#&6QO5U=04_628@ONSvtgpha zDqqmoVep`A4<+PK$V>K+T}}{8Rj+Q|UAzCtl!Fh)uXJg{x$}HMJH7LcBLzj-r{h;< zzote8Id%pcAyE;87D<8glyaFeq#k)OEDB%yA ze%CeZ!?4TEs#pj+%14DBZHn8jxaF2as6}p3+!6p-&@I>5lbP3&N$svcIF-`0R5(o2 zh7la++|;-euckH44a4BAwB++#-cZ z)kFyC=eUS-4D0t}H8LdZY!JD^sW@F85io)%=8HU)ouhEeo-K_dJ3BV+8fo0JXIjlP zZt0H`0=Yv~I|PpRZ)r5_iAYmY9V=wT@BsoN9<3vftB|}TOH;|yNk_e7(2-?y{&cSK zG=E5Nz^Ko4>KxcbY!Q13!=HBS$lM96_+0y3M1yWTAt2u5C;6MWMXbRN?RI{$eHnAx z&t=-PSjZ>Qe2V2-YGs1YWemAq zVHdG{9V$QvsY~Cgq-L*PZqMPGv|px$)K~3<%+fBtG{oIRPL_7ye$-(`C=tS)^xC}% zue73qiF&{nXJ*>-@668G!`IrAeB;ad09shzt{O?7omLE_X@H|#ozGt&64 zb-&_lLkZI8TzigPZvUr=4g2-8M6M8b9EQLgoPswYg)d)j&%gZHJO!2>(?;I*8d>aG z#oS295Kcq{uD4R2@VEG($}WWiF-6YK)kjqks%o_U{CIAVX2;tX7o|unkew5?Gn3(| zOePS^{$(;Xi4ph;`KO#;k+vaLt8n5@doi+OEvH&?*+3(WgqkT9-$b0fTHm;)r=NmR zJnJ9o>UvNR(JMoIdRBf{%kd}jmZ)b)#4>dnDfq0G(?~S%d zv50QeMR$Kzd*S$AEXdp5Fhqe0Pz zZ!oS2e!i-tWEJ2^YoVo}V7S0tV7CujimbVJtVNb#yB&<-f&xpSb@m2=wBZ|qU-_^; z?C{lk+;tlxk&Sh3Pwh(D7~kNh`O=~TMWuRUu^0=9)`CYEVwhvGWUt4Wd3`6*H)Zs>LLYQcC#*~B78EfTt7RQ*l)b{v zqntLNsC`h&zZCY{x*}gfPU4at;nfileU3>zeyLdO7;;lFIft~ zsm6#wb5Jjtv;_VxleU0<%cQON-O*ywHt`@C4fn-Y83}=|hJPOpN>1H%C#7)9etg_yG)$:first-child{border-top: none !important;} + +.tox-tinymce-aux{font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;} + +.tox-tinymce :focus,.tox-tinymce-aux :focus{outline: 0;} + +button::-moz-focus-inner{border: 0;} + +.tox-silver-sink{z-index: 1300;} + +.tox .tox-anchorbar{display: flex;flex: 0 0 auto;} + +.tox .tox-bar{display: flex;flex: 0 0 auto;} + +.tox .tox-button{display: inline-block;padding: 4px 16px;margin: 0;font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size: 14px;font-weight: 700;line-height: 24px;letter-spacing: 1;color: #fff;text-align: center;text-decoration: none;text-transform: capitalize;white-space: nowrap;cursor: pointer;background-color: #207ab7;background-image: none;background-position: none;background-repeat: none;border-color: #207ab7;border-style: solid;border-width: 1px;border-radius: 3px;outline: 0;box-shadow: none;box-sizing: border-box;} + +.tox .tox-button[disabled]{color: rgba(255,255,255,.5);cursor: not-allowed;background-color: #207ab7;background-image: none;border-color: #207ab7;box-shadow: none;} + +.tox .tox-button:focus:not(:disabled){color: #fff;background-color: #1c6ca1;background-image: none;border-color: #1c6ca1;box-shadow: none;} + +.tox .tox-button:hover:not(:disabled){color: #fff;background-color: #1c6ca1;background-image: none;border-color: #1c6ca1;box-shadow: none;} + +.tox .tox-button:active:not(:disabled){color: #fff;background-color: #185d8c;background-image: none;border-color: #185d8c;box-shadow: none;} + +.tox .tox-button--secondary{padding: 4px 16px;color: #222f3e;text-decoration: none;text-transform: capitalize;background-color: #f0f0f0;background-image: none;background-position: none;background-repeat: none;border-color: #f0f0f0;border-style: solid;border-width: 1px;border-radius: 3px;outline: 0;box-shadow: none;} + +.tox .tox-button--secondary[disabled]{color: rgba(34,47,62,.5);background-color: #f0f0f0;background-image: none;border-color: #f0f0f0;box-shadow: none;} + +.tox .tox-button--secondary:focus:not(:disabled){color: #222f3e;background-color: #e3e3e3;background-image: none;border-color: #e3e3e3;box-shadow: none;} + +.tox .tox-button--secondary:hover:not(:disabled){color: #222f3e;background-color: #e3e3e3;background-image: none;border-color: #e3e3e3;box-shadow: none;} + +.tox .tox-button--secondary:active:not(:disabled){color: #222f3e;background-color: #d6d6d6;background-image: none;border-color: #d6d6d6;box-shadow: none;} + +.tox .tox-button--icon,.tox .tox-button.tox-button--icon,.tox .tox-button.tox-button--secondary.tox-button--icon{padding: 4px;} + +.tox .tox-button--icon .tox-icon svg,.tox .tox-button.tox-button--icon .tox-icon svg,.tox .tox-button.tox-button--secondary.tox-button--icon .tox-icon svg{display: block;fill: currentColor;} + +.tox .tox-button-link{display: inline-block;padding: 0;margin: 0;font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size: 16px;font-weight: 400;line-height: 1.3;white-space: nowrap;cursor: pointer;background: 0;border: none;box-sizing: border-box;} + +.tox .tox-button-link--sm{font-size: 14px;} + +.tox .tox-button--naked{color: #222f3e;background-color: transparent;border-color: transparent;box-shadow: unset;} + +.tox .tox-button--naked:hover:not(:disabled){color: #222f3e;background-color: #e3e3e3;border-color: #e3e3e3;box-shadow: none;} + +.tox .tox-button--naked:focus:not(:disabled){color: #222f3e;background-color: #e3e3e3;border-color: #e3e3e3;box-shadow: none;} + +.tox .tox-button--naked:active:not(:disabled){color: #222f3e;background-color: #d6d6d6;border-color: #d6d6d6;box-shadow: none;} + +.tox .tox-button--naked .tox-icon svg{fill: currentColor;} + +.tox .tox-button--naked.tox-button--icon{color: currentColor;} + +.tox .tox-button--naked.tox-button--icon:hover:not(:disabled){color: #222f3e;} + +.tox .tox-checkbox{display: flex;height: 36px;min-width: 36px;cursor: pointer;border-radius: 3px;align-items: center;} + +.tox .tox-checkbox__input{position: absolute;top: auto;left: -10000px;width: 1px;height: 1px;overflow: hidden;} + +.tox .tox-checkbox__icons{width: 24px;height: 24px;padding: calc(4px - 1px);border-radius: 3px;box-shadow: 0 0 0 2px transparent;box-sizing: content-box;} + +.tox .tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display: block;fill: rgba(34,47,62,.3);} + +.tox .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg{display: none;fill: #207ab7;} + +.tox .tox-checkbox__icons .tox-checkbox-icon__checked svg{display: none;fill: #207ab7;} + +.tox input.tox-checkbox__input:checked+.tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display: none;} + +.tox input.tox-checkbox__input:checked+.tox-checkbox__icons .tox-checkbox-icon__checked svg{display: block;} + +.tox input.tox-checkbox__input:indeterminate+.tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display: none;} + +.tox input.tox-checkbox__input:indeterminate+.tox-checkbox__icons .tox-checkbox-icon__indeterminate svg{display: block;} + +.tox input.tox-checkbox__input:focus+.tox-checkbox__icons{padding: calc(4px - 1px);border-radius: 3px;box-shadow: inset 0 0 0 1px #207ab7;} + +.tox:not([dir=rtl]) .tox-checkbox__label{margin-left: 4px;} + +.tox:not([dir=rtl]) .tox-bar .tox-checkbox{margin-left: 4px;} + +.tox[dir=rtl] .tox-checkbox__label{margin-right: 4px;} + +.tox[dir=rtl] .tox-bar .tox-checkbox{margin-right: 4px;} + +.tox .tox-collection--toolbar .tox-collection__group{display: flex;padding: 0;} + +.tox .tox-collection--grid .tox-collection__group{display: flex;max-height: 208px;padding: 0;overflow-x: hidden;overflow-y: auto;flex-wrap: wrap;} + +.tox .tox-collection--list .tox-collection__group{padding: 4px 0;border-color: #ccc;border-style: solid;border-top-width: 1px;border-right-width: 0;border-bottom-width: 0;border-left-width: 0;} + +.tox .tox-collection--list .tox-collection__group:first-child{border-top-width: 0;} + +.tox .tox-collection__group-heading{padding: 4px 8px;margin-top: -4px;margin-bottom: 4px;font-size: 12px;font-style: normal;font-weight: 400;color: rgba(34,47,62,.7);text-transform: none;cursor: default;background-color: #e6e6e6;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;-webkit-touch-callout: none;} + +.tox .tox-collection__item{display: flex;color: #222f3e;cursor: pointer;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;align-items: center;-webkit-touch-callout: none;} + +.tox .tox-collection--list .tox-collection__item{padding: 4px 8px;} + +.tox .tox-collection--toolbar .tox-collection__item{padding: 4px;border-radius: 3px;} + +.tox .tox-collection--grid .tox-collection__item{padding: 4px;border-radius: 3px;} + +.tox .tox-collection--list .tox-collection__item--enabled{color: contrast(inherit,#222f3e,#fff);background-color: inherit;} + +.tox .tox-collection--list .tox-collection__item--active:not(.tox-collection__item--state-disabled){color: #222f3e;background-color: #dee0e2;} + +.tox .tox-collection--toolbar .tox-collection__item--enabled{color: #222f3e;background-color: #c8cbcf;} + +.tox .tox-collection--toolbar .tox-collection__item--active:not(.tox-collection__item--state-disabled){color: #222f3e;background-color: #dee0e2;} + +.tox .tox-collection--grid .tox-collection__item--enabled{color: #222f3e;background-color: #c8cbcf;} + +.tox .tox-collection--grid .tox-collection__item--active:not(.tox-collection__item--state-disabled){color: #222f3e;background-color: #dee0e2;} + +.tox .tox-collection__item--state-disabled{color: rgba(34,47,62,.5);cursor: default;background-color: transparent;} + +.tox .tox-collection__item-icon{display: flex;width: 24px;height: 24px;align-items: center;justify-content: center;} + +.tox .tox-collection__item-icon svg{fill: currentColor;} + +.tox .tox-collection--toolbar-lg .tox-collection__item-icon{width: 48px;height: 48px;} + +.tox .tox-collection__item[role=menuitemcheckbox]:not(.tox-collection__item--enabled) .tox-collection__item-checkmark svg{display: none;} + +.tox .tox-collection__item-label{display: inline-block;font-size: 14px;font-style: normal;font-weight: 400;line-height: 24px;color: currentColor;text-transform: none;word-break: break-all;flex: 1;-ms-flex-preferred-size: auto;} + +.tox .tox-collection__item-accessory{display: inline-block;height: 24px;font-size: 14px;line-height: 24px;color: rgba(34,47,62,.7);text-transform: normal;} + +.tox .tox-collection__item-caret{align-items: center;display: flex;min-height: 24px;} + +.tox .tox-collection__item-caret::after{min-height: inherit;font-size: 0;content: '';} + +.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item>:not(:first-child){margin-left: 8px;} + +.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item-label:first-child{margin-left: 4px;} + +.tox:not([dir=rtl]) .tox-collection__item-accessory{margin-left: 16px;text-align: right;} + +.tox:not([dir=rtl]) .tox-collection__item-caret{margin-left: 16px;} + +.tox[dir=rtl] .tox-collection--list .tox-collection__item>:not(:first-child){margin-right: 8px;} + +.tox[dir=rtl] .tox-collection--list .tox-collection__item-label:first-child{margin-right: 4px;} + +.tox[dir=rtl] .tox-collection__item-icon-rtl .tox-collection__item-icon svg{transform: rotateY(180deg);} + +.tox[dir=rtl] .tox-collection__item-accessory{margin-right: 16px;text-align: left;} + +.tox[dir=rtl] .tox-collection__item-caret{margin-right: 16px;transform: rotateY(180deg);} + +.tox .tox-color-picker-container{display: flex;flex-direction: row;height: 225px;margin: 0;} + +.tox .tox-sv-palette{display: flex;height: 100%;box-sizing: border-box;} + +.tox .tox-sv-palette-spectrum{height: 100%;} + +.tox .tox-sv-palette,.tox .tox-sv-palette-spectrum{width: 225px;} + +.tox .tox-sv-palette-thumb{position: absolute;width: 12px;height: 12px;background: 0 0;border: 1px solid #000;border-radius: 50%;box-sizing: content-box;} + +.tox .tox-sv-palette-inner-thumb{position: absolute;width: 10px;height: 10px;border: 1px solid #fff;border-radius: 50%;} + +.tox .tox-hue-slider{width: 25px;height: 100%;box-sizing: border-box;} + +.tox .tox-hue-slider-spectrum{width: 100%;height: 100%;background: linear-gradient(to bottom,red,#ff0080,#f0f,#8000ff,#00f,#0080ff,#0ff,#00ff80,#0f0,#80ff00,#ff0,#ff8000,red);} + +.tox .tox-hue-slider,.tox .tox-hue-slider-spectrum{width: 20px;} + +.tox .tox-hue-slider-thumb{width: 100%;height: 4px;background: #fff;border: 1px solid #000;box-sizing: content-box;} + +.tox .tox-rgb-form{display: flex;flex-direction: column;justify-content: space-between;} + +.tox .tox-rgb-form div{display: flex;width: inherit;margin-bottom: 5px;align-items: center;justify-content: space-between;} + +.tox .tox-rgb-form input{width: 6em;} + +.tox .tox-rgb-form input.tox-invalid{border: 1px solid red !important;} + +.tox .tox-rgb-form .tox-rgba-preview{margin-bottom: 0;border: 1px solid #000;flex-grow: 2;} + +.tox:not([dir=rtl]) .tox-sv-palette{margin-right: 15px;} + +.tox:not([dir=rtl]) .tox-hue-slider{margin-right: 15px;} + +.tox:not([dir=rtl]) .tox-hue-slider-thumb{margin-left: -1px;} + +.tox:not([dir=rtl]) .tox-rgb-form label{margin-right: .5em;} + +.tox[dir=rtl] .tox-sv-palette{margin-left: 15px;} + +.tox[dir=rtl] .tox-hue-slider{margin-left: 15px;} + +.tox[dir=rtl] .tox-hue-slider-thumb{margin-right: -1px;} + +.tox[dir=rtl] .tox-rgb-form label{margin-left: .5em;} + +.tox .tox-toolbar .tox-swatches,.tox .tox-toolbar__overflow .tox-swatches,.tox .tox-toolbar__primary .tox-swatches{margin: 2px 0 3px 4px;} + +.tox .tox-collection--list .tox-collection__group .tox-swatches-menu{margin: -4px 0;border: 0;} + +.tox .tox-swatches__row{display: flex;} + +.tox .tox-swatch{width: 30px;height: 30px;transition: transform .15s,box-shadow .15s;} + +.tox .tox-swatch:focus,.tox .tox-swatch:hover{transform: scale(.8);box-shadow: 0 0 0 1px rgba(127,127,127,.3) inset;} + +.tox .tox-swatch--remove{align-items: center;display: flex;justify-content: center;} + +.tox .tox-swatch--remove svg path{stroke: #e74c3c;} + +.tox .tox-swatches__picker-btn{display: flex;width: 30px;height: 30px;padding: 0;cursor: pointer;background-color: transparent;border: 0;outline: 0;align-items: center;justify-content: center;} + +.tox .tox-swatches__picker-btn svg{width: 24px;height: 24px;} + +.tox .tox-swatches__picker-btn:hover{background: #dee0e2;} + +.tox:not([dir=rtl]) .tox-swatches__picker-btn{margin-left: auto;} + +.tox[dir=rtl] .tox-swatches__picker-btn{margin-right: auto;} + +.tox .tox-comment-thread{position: relative;background: #fff;} + +.tox .tox-comment-thread>:not(:first-child){margin-top: 8px;} + +.tox .tox-comment{position: relative;padding: 8px 8px 16px 8px;background: #fff;border: 1px solid #ccc;border-radius: 3px;box-shadow: 0 4px 8px 0 rgba(34,47,62,.1);} + +.tox .tox-comment__header{display: flex;color: #222f3e;align-items: center;justify-content: space-between;} + +.tox .tox-comment__date{font-size: 12px;color: rgba(34,47,62,.7);} + +.tox .tox-comment__body{position: relative;margin-top: 8px;font-size: 14px;font-style: normal;font-weight: 400;line-height: 1.3;color: #222f3e;text-transform: initial;} + +.tox .tox-comment__body textarea{width: 100%;white-space: normal;resize: none;} + +.tox .tox-comment__expander{padding-top: 8px;} + +.tox .tox-comment__expander p{font-size: 14px;font-style: normal;color: rgba(34,47,62,.7);} + +.tox .tox-comment__body p{margin: 0;} + +.tox .tox-comment__buttonspacing{padding-top: 16px;text-align: center;} + +.tox .tox-comment-thread__overlay::after{position: absolute;top: 0;right: 0;bottom: 0;left: 0;z-index: 5;display: flex;background: #fff;content: "";opacity: .9;} + +.tox .tox-comment__reply{display: flex;flex-shrink: 0;flex-wrap: wrap;justify-content: flex-end;margin-top: 8px;} + +.tox .tox-comment__reply>:first-child{width: 100%;margin-bottom: 8px;} + +.tox .tox-comment__edit{display: flex;flex-wrap: wrap;justify-content: flex-end;margin-top: 16px;} + +.tox .tox-comment__gradient::after{position: absolute;bottom: 0;display: block;width: 100%;height: 5em;margin-top: -40px;background: linear-gradient(rgba(255,255,255,0),#fff);content: "";} + +.tox .tox-comment__overlay{position: absolute;top: 0;right: 0;bottom: 0;left: 0;z-index: 5;display: flex;text-align: center;background: #fff;opacity: .9;flex-direction: column;flex-grow: 1;} + +.tox .tox-comment__loading-text{position: relative;display: flex;color: #222f3e;align-items: center;flex-direction: column;} + +.tox .tox-comment__loading-text>div{padding-bottom: 16px;} + +.tox .tox-comment__overlaytext{position: absolute;top: 0;right: 0;bottom: 0;left: 0;z-index: 10;padding: 1em;font-size: 14px;flex-direction: column;} + +.tox .tox-comment__overlaytext p{color: #222f3e;text-align: center;background-color: #fff;box-shadow: 0 0 8px 8px #fff;} + +.tox .tox-comment__overlaytext div:nth-of-type(2){font-size: .8em;} + +.tox .tox-comment__busy-spinner{position: absolute;top: 0;right: 0;bottom: 0;left: 0;z-index: 1103;display: flex;background-color: #fff;align-items: center;justify-content: center;} + +.tox .tox-comment__scroll{display: flex;flex-direction: column;flex-shrink: 1;overflow: auto;} + +.tox .tox-conversations{margin: 8px;} + +.tox:not([dir=rtl]) .tox-comment__edit{margin-left: 8px;} + +.tox:not([dir=rtl]) .tox-comment__buttonspacing>:last-child,.tox:not([dir=rtl]) .tox-comment__edit>:last-child,.tox:not([dir=rtl]) .tox-comment__reply>:last-child{margin-left: 8px;} + +.tox[dir=rtl] .tox-comment__edit{margin-right: 8px;} + +.tox[dir=rtl] .tox-comment__buttonspacing>:last-child,.tox[dir=rtl] .tox-comment__edit>:last-child,.tox[dir=rtl] .tox-comment__reply>:last-child{margin-right: 8px;} + +.tox .tox-user{align-items: center;display: flex;} + +.tox .tox-user__avatar svg{fill: rgba(34,47,62,.7);} + +.tox .tox-user__name{font-size: 12px;font-style: normal;font-weight: 700;color: rgba(34,47,62,.7);text-transform: uppercase;} + +.tox:not([dir=rtl]) .tox-user__avatar svg{margin-right: 8px;} + +.tox:not([dir=rtl]) .tox-user__avatar+.tox-user__name{margin-left: 8px;} + +.tox[dir=rtl] .tox-user__avatar svg{margin-left: 8px;} + +.tox[dir=rtl] .tox-user__avatar+.tox-user__name{margin-right: 8px;} + +.tox .tox-dialog-wrap{position: fixed;top: 0;right: 0;bottom: 0;left: 0;z-index: 1100;display: flex;align-items: center;justify-content: center;} + +.tox .tox-dialog-wrap__backdrop{position: absolute;top: 0;right: 0;bottom: 0;left: 0;z-index: 1101;background-color: rgba(255,255,255,.75);} + +.tox .tox-dialog{position: relative;z-index: 1102;display: flex;width: 95vw;max-width: 480px;max-height: 100%;overflow: hidden;background-color: #fff;border-color: #ccc;border-style: solid;border-width: 1px;border-radius: 3px;box-shadow: 0 16px 16px -10px rgba(34,47,62,.15),0 0 40px 1px rgba(34,47,62,.15);flex-direction: column;} + +.tox .tox-dialog__header{position: relative;display: flex;padding: 8px 16px 0 16px;margin-bottom: 16px;font-size: 16px;color: #222f3e;background-color: #fff;border-bottom: none;align-items: center;justify-content: space-between;} + +.tox .tox-dialog__header .tox-button{z-index: 1;} + +.tox .tox-dialog__draghandle{position: absolute;top: 0;left: 0;width: 100%;height: 100%;cursor: grab;} + +.tox .tox-dialog__draghandle:active{cursor: grabbing;} + +.tox .tox-dialog__dismiss{margin-left: auto;} + +.tox .tox-dialog__title{margin: 0;font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size: 20px;font-style: normal;font-weight: 400;line-height: 1.3;text-transform: normal;} + +.tox .tox-dialog__body{display: flex;min-width: 0;padding: 0 16px;font-size: 16px;font-style: normal;font-weight: 400;line-height: 1.3;color: #222f3e;text-align: left;text-transform: normal;flex: 1;-ms-flex-preferred-size: auto;} + +.tox .tox-dialog__body-nav{align-items: flex-start;display: flex;flex-direction: column;} + +.tox .tox-dialog__body-nav-item{display: inline-block;margin-bottom: 8px;font-size: 14px;line-height: 1.3;color: rgba(34,47,62,.7);text-decoration: none;border-bottom: 2px solid transparent;} + +.tox .tox-dialog__body-nav-item--active{color: #207ab7;border-bottom: 2px solid #207ab7;} + +.tox .tox-dialog__body-content{display: flex;flex: 1;flex-direction: column;-ms-flex-preferred-size: auto;max-height: 650px;overflow: auto;} + +.tox .tox-dialog__body-content>*{margin-top: 16px;margin-bottom: 0;} + +.tox .tox-dialog__body-content>:first-child{margin-top: 0;} + +.tox .tox-dialog__body-content>:last-child{margin-bottom: 0;} + +.tox .tox-dialog__body-content>:only-child{margin-top: 0;margin-bottom: 0;} + +.tox .tox-dialog--width-lg{height: 650px;max-width: 1200px;} + +.tox .tox-dialog--width-md{max-width: 800px;} + +.tox .tox-dialog--width-md .tox-dialog__body-content{overflow: auto;} + +.tox .tox-dialog__body-content--centered{text-align: center;} + +.tox .tox-dialog__body-content--spacious{margin-bottom: 16px;} + +.tox .tox-dialog__footer{display: flex;padding: 8px 16px;margin-top: 16px;background-color: #fff;border-top: 1px solid #ccc;align-items: center;justify-content: space-between;} + +.tox .tox-dialog__busy-spinner{position: absolute;top: 0;right: 0;bottom: 0;left: 0;z-index: 1103;display: flex;background-color: rgba(255,255,255,.75);align-items: center;justify-content: center;} + +.tox .tox-dialog__table{width: 100%;border-collapse: collapse;} + +.tox .tox-dialog__table thead th{padding-bottom: 8px;font-weight: 700;} + +.tox .tox-dialog__table tbody tr{border-bottom: 1px solid #ccc;} + +.tox .tox-dialog__table tbody tr:last-child{border-bottom: none;} + +.tox .tox-dialog__table td{padding-top: 8px;padding-bottom: 8px;} + +.tox .tox-dialog__popups{position: absolute;z-index: 1100;width: 100%;} + +.tox .tox-dialog__body-iframe{display: flex;flex: 1;flex-direction: column;-ms-flex-preferred-size: auto;} + +.tox .tox-dialog__body-iframe .tox-navobj{display: flex;flex: 1;-ms-flex-preferred-size: auto;} + +.tox .tox-dialog__body-iframe .tox-navobj :nth-child(2){flex: 1;-ms-flex-preferred-size: auto;height: 100%;} + +body.tox-dialog__disable-scroll{overflow: hidden;} + +.tox.tox-platform-ie .tox-dialog-wrap{position: -ms-device-fixed;} + +.tox:not([dir=rtl]) .tox-dialog__body-nav{margin-right: 32px;} + +.tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-end>*,.tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-start>*{margin-left: 8px;} + +.tox[dir=rtl] .tox-dialog__body{text-align: right;} + +.tox[dir=rtl] .tox-dialog__body-nav{margin-left: 32px;} + +.tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-end>*,.tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-start>*{margin-right: 8px;} + +.tox .tox-dropzone-container{display: flex;flex: 1;-ms-flex-preferred-size: auto;} + +.tox .tox-dropzone{display: flex;min-height: 100px;padding: 10px;background: #fff;border: 2px dashed #ccc;box-sizing: border-box;align-items: center;flex-direction: column;flex-grow: 1;justify-content: center;} + +.tox .tox-dropzone p{margin: 0 0 16px 0;color: rgba(34,47,62,.7);} + +.tox .tox-edit-area{position: relative;display: flex;overflow: hidden;border-top: 1px solid #ccc;flex: 1;-ms-flex-preferred-size: auto;} + +.tox .tox-edit-area__iframe{position: absolute;width: 100%;height: 100%;background-color: #fff;border: 0;box-sizing: border-box;flex: 1;-ms-flex-preferred-size: auto;} + +.tox.tox-inline-edit-area{border: 1px dotted #ccc;} + +.tox .tox-control-wrap{flex: 1;position: relative;} + +.tox .tox-control-wrap:not(.tox-control-wrap--status-invalid) .tox-control-wrap__status-icon-invalid,.tox .tox-control-wrap:not(.tox-control-wrap--status-unknown) .tox-control-wrap__status-icon-unknown,.tox .tox-control-wrap:not(.tox-control-wrap--status-valid) .tox-control-wrap__status-icon-valid{display: none;} + +.tox .tox-control-wrap svg{display: block;} + +.tox .tox-control-wrap__status-icon-wrap{position: absolute;top: 50%;transform: translateY(-50%);} + +.tox .tox-control-wrap__status-icon-invalid svg{fill: #c00;} + +.tox .tox-control-wrap__status-icon-unknown svg{fill: orange;} + +.tox .tox-control-wrap__status-icon-valid svg{fill: green;} + +.tox:not([dir=rtl]) .tox-control-wrap--status-invalid .tox-textfield,.tox:not([dir=rtl]) .tox-control-wrap--status-unknown .tox-textfield,.tox:not([dir=rtl]) .tox-control-wrap--status-valid .tox-textfield{padding-right: 32px;} + +.tox:not([dir=rtl]) .tox-control-wrap__status-icon-wrap{right: 4px;} + +.tox[dir=rtl] .tox-control-wrap--status-invalid .tox-textfield,.tox[dir=rtl] .tox-control-wrap--status-unknown .tox-textfield,.tox[dir=rtl] .tox-control-wrap--status-valid .tox-textfield{padding-left: 32px;} + +.tox[dir=rtl] .tox-control-wrap__status-icon-wrap{left: 4px;} + +.tox .tox-autocompleter{max-width: 25em;} + +.tox .tox-autocompleter .tox-menu{max-width: 25em;} + +.tox .tox-color-input{display: flex;} + +.tox .tox-color-input .tox-textfield{display: flex;border-radius: 3px 0 0 3px;} + +.tox .tox-color-input span{display: flex;width: 35px;cursor: pointer;border-color: rgba(34,47,62,.2);border-style: solid;border-width: 1px 1px 1px 0;border-radius: 0 3px 3px 0;box-shadow: none;box-sizing: border-box;} + +.tox .tox-color-input span:focus{border-color: #207ab7;} + +.tox[dir=rtl] .tox-color-input .tox-textfield{border-radius: 0 3px 3px 0;} + +.tox[dir=rtl] .tox-color-input span{border-width: 1px 0 1px 1px;border-radius: 3px 0 0 3px;} + +.tox .tox-label,.tox .tox-toolbar-label{display: block;padding: 0 8px 0 0;font-size: 14px;font-style: normal;font-weight: 400;line-height: 1.3;color: rgba(34,47,62,.7);text-transform: normal;white-space: nowrap;} + +.tox .tox-toolbar-label{padding: 0 8px;} + +.tox[dir=rtl] .tox-label{padding: 0 0 0 8px;} + +.tox .tox-form{display: flex;flex: 1;flex-direction: column;-ms-flex-preferred-size: auto;} + +.tox .tox-form__group{margin-bottom: 4px;box-sizing: border-box;} + +.tox .tox-form__group--error{color: #c00;} + +.tox .tox-form__group--collection{display: flex;} + +.tox .tox-form__grid{display: flex;flex-direction: row;flex-wrap: wrap;justify-content: space-between;} + +.tox .tox-form__grid--2col>.tox-form__group{width: calc(50% - (8px / 2));} + +.tox .tox-form__grid--3col>.tox-form__group{width: calc(100% / 3 - (8px / 2));} + +.tox .tox-form__grid--4col>.tox-form__group{width: calc(25% - (8px / 2));} + +.tox .tox-form__controls-h-stack{align-items: center;display: flex;} + +.tox .tox-form__group--inline{align-items: center;display: flex;} + +.tox .tox-form__group--stretched{display: flex;flex: 1;flex-direction: column;-ms-flex-preferred-size: auto;} + +.tox .tox-form__group--stretched .tox-textarea{flex: 1;-ms-flex-preferred-size: auto;} + +.tox .tox-form__group--stretched .tox-navobj{display: flex;flex: 1;-ms-flex-preferred-size: auto;} + +.tox .tox-form__group--stretched .tox-navobj :nth-child(2){flex: 1;-ms-flex-preferred-size: auto;height: 100%;} + +.tox:not([dir=rtl]) .tox-form__controls-h-stack>:not(:first-child){margin-left: 4px;} + +.tox[dir=rtl] .tox-form__controls-h-stack>:not(:first-child){margin-right: 4px;} + +.tox .tox-lock.tox-locked .tox-lock-icon__unlock,.tox .tox-lock:not(.tox-locked) .tox-lock-icon__lock{display: none;} + +.tox .tox-textarea,.tox .tox-textfield,.tox .tox-toolbar-textfield,.tox:not([dir=rtl]) .tox-selectfield select,.tox[dir=rtl] .tox-selectfield select{width: 100%;padding: 5px 4.75px;margin: 0;font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size: 16px;line-height: 24px;color: #222f3e;background-color: #fff;border-color: #ccc;border-style: solid;border-width: 1px;border-radius: 3px;outline: 0;box-shadow: none;box-sizing: border-box;resize: none;-webkit-appearance: none;-moz-appearance: none;appearance: none;} + +.tox .tox-selectfield select:focus,.tox .tox-textarea:focus,.tox .tox-textfield:focus{border-color: #207ab7;outline: 0;box-shadow: none;} + +.tox .tox-toolbar-textfield{max-width: 250px;margin-top: 2px;margin-bottom: 3px;border-width: 0;} + +.tox .tox-naked-btn{display: block;padding: 0;margin: 0;color: #207ab7;cursor: pointer;background-color: transparent;border: 0;border-color: transparent;box-shadow: unset;} + +.tox .tox-naked-btn svg{display: block;fill: #222f3e;} + +.tox:not([dir=rtl]) .tox-toolbar-textfield+*{margin-left: 4px;} + +.tox[dir=rtl] .tox-toolbar-textfield+*{margin-right: 4px;} + +.tox .tox-selectfield{position: relative;cursor: pointer;} + +.tox .tox-selectfield select::-ms-expand{display: none;} + +.tox .tox-selectfield svg{position: absolute;top: 50%;pointer-events: none;transform: translateY(-50%);} + +.tox:not([dir=rtl]) .tox-selectfield select{padding-right: 24px;} + +.tox:not([dir=rtl]) .tox-selectfield svg{right: 8px;} + +.tox[dir=rtl] .tox-selectfield select{padding-left: 24px;} + +.tox[dir=rtl] .tox-selectfield svg{left: 8px;} + +.tox .tox-textarea{white-space: pre-wrap;-webkit-appearance: textarea;-moz-appearance: textarea;appearance: textarea;} + +.tox-fullscreen{position: fixed;top: 0;left: 0;width: 100%;height: 100%;padding: 0;margin: 0;overflow: hidden;border: 0;} + +.tox-fullscreen .tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle{display: none;} + +.tox-fullscreen .tox.tox-tinymce.tox-fullscreen{z-index: 1200;} + +.tox-fullscreen .tox.tox-tinymce-aux{z-index: 1201;} + +.tox .tox-image-tools{width: 100%;} + +.tox .tox-image-tools__toolbar{align-items: center;display: flex;justify-content: center;} + +.tox .tox-image-tools__image{position: relative;width: 100%;height: 380px;overflow: auto;background-color: #666;} + +.tox .tox-image-tools__image,.tox .tox-image-tools__image+.tox-image-tools__toolbar{margin-top: 8px;} + +.tox .tox-image-tools__image-bg{background: url(data:image/gif;base64,R0lGODdhDAAMAIABAMzMzP///ywAAAAADAAMAAACFoQfqYeabNyDMkBQb81Uat85nxguUAEAOw==);} + +.tox .tox-image-tools__toolbar>.tox-spacer{flex: 1;-ms-flex-preferred-size: auto;} + +.tox .tox-croprect-block{position: absolute;background: #000;opacity: .5;zoom: 1;} + +.tox .tox-croprect-handle{position: absolute;top: 0;left: 0;width: 20px;height: 20px;border: 2px solid #fff;} + +.tox .tox-croprect-handle-move{position: absolute;cursor: move;border: 0;} + +.tox .tox-croprect-handle-nw{top: 100px;left: 100px;margin: -2px 0 0 -2px;cursor: nw-resize;border-width: 2px 0 0 2px;} + +.tox .tox-croprect-handle-ne{top: 100px;left: 200px;margin: -2px 0 0 -20px;cursor: ne-resize;border-width: 2px 2px 0 0;} + +.tox .tox-croprect-handle-sw{top: 200px;left: 100px;margin: -20px 2px 0 -2px;cursor: sw-resize;border-width: 0 0 2px 2px;} + +.tox .tox-croprect-handle-se{top: 200px;left: 200px;margin: -20px 0 0 -20px;cursor: se-resize;border-width: 0 2px 2px 0;} + +.tox:not([dir=rtl]) .tox-image-tools__toolbar>.tox-slider:not(:first-of-type){margin-left: 8px;} + +.tox:not([dir=rtl]) .tox-image-tools__toolbar>.tox-button+.tox-slider{margin-left: 32px;} + +.tox:not([dir=rtl]) .tox-image-tools__toolbar>.tox-slider+.tox-button{margin-left: 32px;} + +.tox[dir=rtl] .tox-image-tools__toolbar>.tox-slider:not(:first-of-type){margin-right: 8px;} + +.tox[dir=rtl] .tox-image-tools__toolbar>.tox-button+.tox-slider{margin-right: 32px;} + +.tox[dir=rtl] .tox-image-tools__toolbar>.tox-slider+.tox-button{margin-right: 32px;} + +.tox .tox-insert-table-picker{display: flex;flex-wrap: wrap;width: 169px;} + +.tox .tox-insert-table-picker>div{width: 16px;height: 16px;border-color: #ccc;border-style: solid;border-width: 0 1px 1px 0;box-sizing: content-box;} + +.tox .tox-collection--list .tox-collection__group .tox-insert-table-picker{margin: -4px 0;} + +.tox .tox-insert-table-picker .tox-insert-table-picker__selected{background-color: rgba(32,122,183,.5);border-color: rgba(32,122,183,.5);} + +.tox .tox-insert-table-picker__label{display: block;width: 100%;padding: 4px;font-size: 14px;color: rgba(34,47,62,.7);text-align: center;} + +.tox:not([dir=rtl]) .tox-insert-table-picker>div:nth-child(10n){border-right: 0;} + +.tox[dir=rtl] .tox-insert-table-picker>div:nth-child(10n+1){border-right: 0;} + +.tox .tox-menu{z-index: 1;display: inline-block;overflow: hidden;vertical-align: top;background-color: #fff;border: 1px solid #ccc;border-radius: 3px;box-shadow: 0 4px 8px 0 rgba(34,47,62,.1);} + +.tox .tox-menu.tox-collection.tox-collection--list{padding: 0;} + +.tox .tox-menu.tox-collection.tox-collection--toolbar{padding: 4px;} + +.tox .tox-menu.tox-collection.tox-collection--grid{padding: 4px;} + +.tox .tox-menu__label blockquote,.tox .tox-menu__label code,.tox .tox-menu__label h1,.tox .tox-menu__label h2,.tox .tox-menu__label h3,.tox .tox-menu__label h4,.tox .tox-menu__label h5,.tox .tox-menu__label h6,.tox .tox-menu__label p{margin: 0;} + +.tox .tox-menubar{display: flex;padding: 0 4px;margin-bottom: -1px;background: url("data:image/svg+xml;charset=utf8,%3Csvg height='43px' viewBox='0 0 40 43px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='42px' width='100' height='1' fill='%23cccccc'/%3E%3C/svg%3E") left 0 top 0 #fff;background-color: #fff;flex: 0 0 auto;flex-shrink: 0;flex-wrap: wrap;} + +.tox .tox-mbtn{display: flex;width: auto;height: 34px;padding: 0 4px;margin: 2px 0 3px 0;overflow: hidden;font-size: 14px;font-style: normal;font-weight: 400;color: #222f3e;text-transform: normal;background: 0 0;border: 0;border-radius: 3px;outline: 0;box-shadow: none;align-items: center;flex: 0 0 auto;justify-content: center;} + +.tox .tox-mbtn[disabled]{color: rgba(34,47,62,.5);cursor: not-allowed;background-color: none;border-color: none;box-shadow: none;} + +.tox .tox-mbtn:hover:not(:disabled){color: #222f3e;background: #dee0e2;box-shadow: none;} + +.tox .tox-mbtn:focus:not(:disabled){color: #222f3e;background: #dee0e2;box-shadow: none;} + +.tox .tox-mbtn--active{color: #222f3e;background: #c8cbcf;box-shadow: none;} + +.tox .tox-mbtn__select-label{margin: 0 4px;font-weight: 400;cursor: default;} + +.tox .tox-mbtn[disabled] .tox-mbtn__select-label{cursor: not-allowed;} + +.tox .tox-mbtn__select-chevron{display: flex;display: none;width: 16px;align-items: center;justify-content: center;} + +.tox .tox-notification{display: grid;padding: 5px;margin-top: 5px;background-color: #fffaea;border-color: #ffe89d;border-style: solid;border-width: 1px;opacity: 0;box-sizing: border-box;transition: transform .1s ease-in,opacity 150ms ease-in;grid-template-columns: minmax(40px,1fr) auto minmax(40px,1fr);} + +.tox .tox-notification--in{opacity: 1;} + +.tox .tox-notification--success{background-color: #dff0d8;border-color: #d6e9c6;} + +.tox .tox-notification--error{background-color: #f2dede;border-color: #ebccd1;} + +.tox .tox-notification--warn{background-color: #fcf8e3;border-color: #faebcc;} + +.tox .tox-notification--info{background-color: #d9edf7;border-color: #779ecb;} + +.tox .tox-notification__body{font-size: 14px;color: #222f3e;text-align: center;word-break: break-all;word-break: break-word;white-space: normal;align-self: center;grid-column-end: 3;-ms-grid-column-span: 1;grid-column-start: 2;grid-row-end: 2;grid-row-start: 1;} + +.tox .tox-notification__body>*{margin: 0;} + +.tox .tox-notification__body>*+*{margin-top: 1rem;} + +.tox .tox-notification__icon{align-self: center;-ms-grid-column-align: end;grid-column-end: 2;-ms-grid-column-span: 1;grid-column-start: 1;grid-row-end: 2;grid-row-start: 1;justify-self: end;} + +.tox .tox-notification__icon svg{display: block;} + +.tox .tox-notification__dismiss{align-self: start;-ms-grid-column-align: end;grid-column-end: 4;-ms-grid-column-span: 1;grid-column-start: 3;grid-row-end: 2;grid-row-start: 1;justify-self: end;} + +.tox .tox-notification .tox-progress-bar{-ms-grid-column-align: center;grid-column-end: 4;-ms-grid-column-span: 3;grid-column-start: 1;grid-row-end: 3;-ms-grid-row-span: 1;grid-row-start: 2;justify-self: center;} + +.tox .tox-pop{position: relative;display: inline-block;} + +.tox .tox-pop--resizing{transition: width .1s ease;} + +.tox .tox-pop--resizing .tox-toolbar{flex-wrap: nowrap;} + +.tox .tox-pop__dialog{min-width: 0;overflow: hidden;background-color: #fff;border: 1px solid #ccc;border-radius: 3px;box-shadow: 0 1px 3px rgba(0,0,0,.15);} + +.tox .tox-pop__dialog>:not(.tox-toolbar){margin: 4px 4px 4px 8px;} + +.tox .tox-pop__dialog .tox-toolbar{background-color: transparent;} + +.tox .tox-pop::after,.tox .tox-pop::before{position: absolute;display: block;width: 0;height: 0;border-style: solid;content: '';} + +.tox .tox-pop.tox-pop--bottom::after,.tox .tox-pop.tox-pop--bottom::before{top: 100%;left: 50%;} + +.tox .tox-pop.tox-pop--bottom::after{margin-top: -1px;margin-left: -8px;border-color: #fff transparent transparent transparent;border-width: 8px;} + +.tox .tox-pop.tox-pop--bottom::before{margin-left: -9px;border-color: #ccc transparent transparent transparent;border-width: 9px;} + +.tox .tox-pop.tox-pop--top::after,.tox .tox-pop.tox-pop--top::before{top: 0;left: 50%;transform: translateY(-100%);} + +.tox .tox-pop.tox-pop--top::after{margin-top: 1px;margin-left: -8px;border-color: transparent transparent #fff transparent;border-width: 8px;} + +.tox .tox-pop.tox-pop--top::before{margin-left: -9px;border-color: transparent transparent #ccc transparent;border-width: 9px;} + +.tox .tox-pop.tox-pop--left::after,.tox .tox-pop.tox-pop--left::before{top: calc(50% - 1px);left: 0;transform: translateY(-50%);} + +.tox .tox-pop.tox-pop--left::after{margin-left: -15px;border-color: transparent #fff transparent transparent;border-width: 8px;} + +.tox .tox-pop.tox-pop--left::before{margin-left: -19px;border-color: transparent #ccc transparent transparent;border-width: 10px;} + +.tox .tox-pop.tox-pop--right::after,.tox .tox-pop.tox-pop--right::before{top: calc(50% + 1px);left: 100%;transform: translateY(-50%);} + +.tox .tox-pop.tox-pop--right::after{margin-left: -1px;border-color: transparent transparent transparent #fff;border-width: 8px;} + +.tox .tox-pop.tox-pop--right::before{margin-left: -1px;border-color: transparent transparent transparent #ccc;border-width: 10px;} + +.tox .tox-pop.tox-pop--align-left::after,.tox .tox-pop.tox-pop--align-left::before{left: 20px;} + +.tox .tox-pop.tox-pop--align-right::after,.tox .tox-pop.tox-pop--align-right::before{left: calc(100% - 20px);} + +.tox .tox-sidebar-wrap{display: flex;flex-direction: row;flex-grow: 1;min-height: 0;} + +.tox .tox-sidebar{display: flex;flex-direction: row;justify-content: flex-end;} + +.tox .tox-sidebar__slider{display: flex;overflow: hidden;} + +.tox .tox-sidebar__pane-container{display: flex;} + +.tox .tox-sidebar__pane{display: flex;} + +.tox .tox-sidebar--sliding-closed{opacity: 0;} + +.tox .tox-sidebar--sliding-open{opacity: 1;} + +.tox .tox-sidebar--sliding-growing,.tox .tox-sidebar--sliding-shrinking{transition: width .5s ease,opacity .5s ease;} + +.tox .tox-slider{position: relative;display: flex;height: 24px;align-items: center;flex: 1;-ms-flex-preferred-size: auto;justify-content: center;} + +.tox .tox-slider__rail{width: 100%;height: 10px;min-width: 120px;background-color: transparent;border: 1px solid #ccc;border-radius: 3px;} + +.tox .tox-slider__handle{position: absolute;top: 50%;left: 50%;width: 14px;height: 24px;background-color: #207ab7;border: 2px solid #185d8c;border-radius: 3px;transform: translateX(-50%) translateY(-50%);box-shadow: none;} + +.tox .tox-source-code{overflow: auto;} + +.tox .tox-spinner{display: flex;} + +.tox .tox-spinner>div{width: 8px;height: 8px;background-color: rgba(34,47,62,.7);border-radius: 100%;animation: tam-bouncing-dots 1.5s ease-in-out 0s infinite both;} + +.tox .tox-spinner>div:nth-child(1){animation-delay: -.32s;} + +.tox .tox-spinner>div:nth-child(2){animation-delay: -.16s;}@keyframes tam-bouncing-dots{0%,100%,80%{transform: scale(0);} + +40%{transform: scale(1);}} + +.tox:not([dir=rtl]) .tox-spinner>div:not(:first-child){margin-left: 4px;} + +.tox[dir=rtl] .tox-spinner>div:not(:first-child){margin-right: 4px;} + +.tox .tox-statusbar{position: relative;display: flex;height: 18px;padding: 0 8px;overflow: hidden;font-size: 12px;color: rgba(34,47,62,.7);text-transform: uppercase;background-color: #fff;border-top: 1px solid #ccc;align-items: center;flex: 0 0 auto;} + +.tox .tox-statusbar a{color: rgba(34,47,62,.7);text-decoration: none;} + +.tox .tox-statusbar a:hover{text-decoration: underline;} + +.tox .tox-statusbar__text-container{display: flex;flex: 1 1 auto;justify-content: flex-end;overflow: hidden;} + +.tox .tox-statusbar__path{display: flex;flex: 1 1 auto;margin-right: auto;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;} + +.tox .tox-statusbar__path>*{display: inline;white-space: nowrap;} + +.tox .tox-statusbar__wordcount{flex: 0 0 auto;margin-left: 1ch;} + +.tox .tox-statusbar__resize-handle{display: flex;padding-left: 1ch;margin-right: -8px;margin-left: auto;cursor: nwse-resize;align-items: flex-end;align-self: stretch;flex: 0 0 auto;justify-content: flex-end;} + +.tox .tox-statusbar__resize-handle svg{display: block;fill: rgba(34,47,62,.7);} + +.tox:not([dir=rtl]) .tox-statusbar__path>*{margin-right: 4px;} + +.tox:not([dir=rtl]) .tox-statusbar__branding{margin-left: 1ch;} + +.tox[dir=rtl] .tox-statusbar{flex-direction: row-reverse;} + +.tox[dir=rtl] .tox-statusbar__path>*{margin-left: 4px;} + +.tox .tox-throbber{z-index: 1400;} + +.tox .tox-throbber__busy-spinner{position: absolute;top: 0;right: 0;bottom: 0;left: 0;display: flex;background-color: rgba(255,255,255,.6);align-items: center;justify-content: center;} + +.tox .tox-tbtn{display: flex;width: 34px;height: 34px;padding: 0;margin: 2px 0 3px 0;overflow: hidden;font-size: 14px;font-style: normal;font-weight: 400;color: #222f3e;text-transform: normal;background: 0 0;border: 0;border-radius: 3px;outline: 0;box-shadow: none;align-items: center;flex: 0 0 auto;justify-content: center;} + +.tox .tox-tbtn svg{display: block;fill: #222f3e;} + +.tox .tox-tbtn.tox-tbtn-more{width: inherit;padding-right: 5px;padding-left: 5px;} + +.tox .tox-tbtn--enabled{color: #222f3e;background: #c8cbcf;box-shadow: none;} + +.tox .tox-tbtn--enabled>*{transform: none;} + +.tox .tox-tbtn--enabled svg{fill: #222f3e;} + +.tox .tox-tbtn:hover{color: #222f3e;background: #dee0e2;box-shadow: none;} + +.tox .tox-tbtn:hover svg{fill: #222f3e;} + +.tox .tox-tbtn:focus{color: #222f3e;background: #dee0e2;box-shadow: none;} + +.tox .tox-tbtn:focus svg{fill: #222f3e;} + +.tox .tox-tbtn:active{color: #222f3e;background: #c8cbcf;box-shadow: none;} + +.tox .tox-tbtn:active svg{fill: #222f3e;} + +.tox .tox-tbtn--disabled,.tox .tox-tbtn--disabled:hover,.tox .tox-tbtn:disabled,.tox .tox-tbtn:disabled:hover{color: rgba(34,47,62,.5);cursor: not-allowed;background: 0 0;box-shadow: none;} + +.tox .tox-tbtn--disabled svg,.tox .tox-tbtn--disabled:hover svg,.tox .tox-tbtn:disabled svg,.tox .tox-tbtn:disabled:hover svg{fill: rgba(34,47,62,.5);} + +.tox .tox-tbtn:active>*{transform: none;} + +.tox .tox-tbtn--md{width: 51px;height: 51px;} + +.tox .tox-tbtn--lg{width: 68px;height: 68px;flex-direction: column;} + +.tox .tox-tbtn--return{width: 16px;height: unset;align-self: stretch;} + +.tox .tox-tbtn--labeled{width: unset;padding: 0 4px;} + +.tox .tox-tbtn__vlabel{display: block;margin-bottom: 4px;font-size: 10px;font-weight: 400;letter-spacing: -.025em;white-space: nowrap;} + +.tox .tox-tbtn--select{width: auto;padding: 0 4px;margin: 2px 0 3px 0;} + +.tox .tox-tbtn__select-label{margin: 0 4px;font-weight: 400;cursor: default;} + +.tox .tox-tbtn__select-chevron{align-items: center;display: flex;justify-content: center;width: 16px;} + +.tox .tox-tbtn__select-chevron svg{fill: rgba(34,47,62,.7);} + +.tox .tox-tbtn--bespoke .tox-tbtn__select-label{width: 7em;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;} + +.tox .tox-split-button{display: flex;margin: 2px 0 3px 0;overflow: hidden;border: 0;border-radius: 3px;box-sizing: border-box;} + +.tox .tox-split-button:hover{box-shadow: 0 0 0 1px #dee0e2 inset;} + +.tox .tox-split-button:focus{color: #222f3e;background: #dee0e2;box-shadow: none;} + +.tox .tox-split-button>*{border-radius: 0;} + +.tox .tox-split-button__chevron{width: 16px;} + +.tox .tox-split-button__chevron svg{fill: rgba(34,47,62,.7);} + +.tox .tox-pop .tox-split-button__chevron svg{transform: rotate(-90deg);} + +.tox .tox-split-button .tox-tbtn{margin: 0;} + +.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:focus,.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:hover,.tox .tox-split-button.tox-tbtn--disabled:focus,.tox .tox-split-button.tox-tbtn--disabled:hover{color: rgba(34,47,62,.5);background: 0 0;box-shadow: none;} + +.tox .tox-toolbar,.tox .tox-toolbar__overflow,.tox .tox-toolbar__primary{display: flex;padding: 0 0;margin-bottom: -1px;background: url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23cccccc'/%3E%3C/svg%3E") left 0 top 0 #fff;background-color: #fff;border-top: 1px solid #ccc;flex: 0 0 auto;flex-shrink: 0;flex-wrap: wrap;} + +.tox .tox-toolbar__overflow.tox-toolbar__overflow--closed{height: 0;opacity: 0;visibility: hidden;} + +.tox .tox-toolbar__overflow--growing{transition: height .3s ease,opacity .2s linear .1s;} + +.tox .tox-toolbar__overflow--shrinking{transition: opacity .3s ease,height .2s linear .1s,visibility 0s linear .3s;} + +.tox .tox-pop .tox-toolbar{border-width: 0;} + +.tox .tox-toolbar--no-divider{background-image: none;} + +.tox.tox-tinymce-aux .tox-toolbar__overflow{background-color: #fff;border: 1px solid #ccc;border-radius: 3px;box-shadow: 0 1px 3px rgba(0,0,0,.15);} + +.tox.tox-tinymce-aux:not([dir=rtl]) .tox-toolbar__overflow{margin-left: 4px;} + +.tox[dir=rtl] .tox-tbtn__icon-rtl svg{transform: rotateY(180deg);} + +.tox[dir=rtl].tox-tinymce-aux .tox-toolbar__overflow{margin-right: 4px;} + +.tox .tox-toolbar__group{display: flex;padding: 0 4px;margin: 0 0;align-items: center;flex-wrap: wrap;} + +.tox .tox-toolbar__group--pull-right{margin-left: auto;} + +.tox:not([dir=rtl]) .tox-toolbar__group:not(:last-of-type){border-right: 1px solid #ccc;} + +.tox[dir=rtl] .tox-toolbar__group:not(:last-of-type){border-left: 1px solid #ccc;} + +.tox .tox-tooltip{position: relative;display: inline-block;padding: 8px;} + +.tox .tox-tooltip__body{padding: 4px 8px;font-size: 14px;font-style: normal;font-weight: 400;color: rgba(255,255,255,.75);text-transform: normal;background-color: #222f3e;border-radius: 3px;box-shadow: 0 2px 4px rgba(34,47,62,.3);} + +.tox .tox-tooltip__arrow{position: absolute;} + +.tox .tox-tooltip--down .tox-tooltip__arrow{position: absolute;bottom: 0;left: 50%;border-top: 8px solid #222f3e;border-right: 8px solid transparent;border-left: 8px solid transparent;transform: translateX(-50%);} + +.tox .tox-tooltip--up .tox-tooltip__arrow{position: absolute;top: 0;left: 50%;border-right: 8px solid transparent;border-bottom: 8px solid #222f3e;border-left: 8px solid transparent;transform: translateX(-50%);} + +.tox .tox-tooltip--right .tox-tooltip__arrow{position: absolute;top: 50%;right: 0;border-top: 8px solid transparent;border-bottom: 8px solid transparent;border-left: 8px solid #222f3e;transform: translateY(-50%);} + +.tox .tox-tooltip--left .tox-tooltip__arrow{position: absolute;top: 50%;left: 0;border-top: 8px solid transparent;border-right: 8px solid #222f3e;border-bottom: 8px solid transparent;transform: translateY(-50%);} + +.tox .tox-well{width: 100%;padding: 8px;border: 1px solid #ccc;border-radius: 3px;} + +.tox .tox-well>:first-child{margin-top: 0;} + +.tox .tox-well>:last-child{margin-bottom: 0;} + +.tox .tox-well>:only-child{margin: 0;} + +.tox .tox-custom-editor{display: flex;height: 525px;border: 1px solid #ccc;border-radius: 3px;} + +.tox .tox-dialog-loading::before{position: absolute;z-index: 1000;width: 100%;height: 100%;background-color: rgba(0,0,0,.5);content: "";} + +.tox .tox-tab{cursor: pointer;} + +.tox .tox-dialog__content-js{display: flex;flex: 1;-ms-flex-preferred-size: auto;} + +.tox .tox-dialog__body-content .tox-collection{display: flex;flex: 1;-ms-flex-preferred-size: auto;} + +.tox ul{display: block;list-style-type: disc;-webkit-margin-before: 1em;margin-block-start: 1em;-webkit-margin-after: 1em;margin-block-end: 1em;-webkit-margin-start: 0;margin-inline-start: 0;-webkit-margin-end: 0;margin-inline-end: 0;-webkit-padding-start: 40px;padding-inline-start: 40px;} + +.tox a{color: #2276d2;cursor: pointer;} + +.tox .tox-image-tools-edit-panel{height: 60px;} + +.tox .tox-image-tools__sidebar{height: 60px;} diff --git a/monolithic/frontend/public/resource/tinymce/skins/ui/oxide/skin.mobile.min.css b/monolithic/frontend/public/resource/tinymce/skins/ui/oxide/skin.mobile.min.css new file mode 100644 index 0000000..14847d0 --- /dev/null +++ b/monolithic/frontend/public/resource/tinymce/skins/ui/oxide/skin.mobile.min.css @@ -0,0 +1,239 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +.tinymce-mobile-outer-container{all: initial;display: block;} + +.tinymce-mobile-outer-container *{float: none;padding: 0;margin: 0;line-height: 1;text-shadow: none;white-space: nowrap;cursor: inherit;border: 0;outline: 0;box-sizing: initial;-webkit-tap-highlight-color: transparent;} + +.tinymce-mobile-icon-arrow-back::before{content: "\e5cd";} + +.tinymce-mobile-icon-image::before{content: "\e412";} + +.tinymce-mobile-icon-cancel-circle::before{content: "\e5c9";} + +.tinymce-mobile-icon-full-dot::before{content: "\e061";} + +.tinymce-mobile-icon-align-center::before{content: "\e234";} + +.tinymce-mobile-icon-align-left::before{content: "\e236";} + +.tinymce-mobile-icon-align-right::before{content: "\e237";} + +.tinymce-mobile-icon-bold::before{content: "\e238";} + +.tinymce-mobile-icon-italic::before{content: "\e23f";} + +.tinymce-mobile-icon-unordered-list::before{content: "\e241";} + +.tinymce-mobile-icon-ordered-list::before{content: "\e242";} + +.tinymce-mobile-icon-font-size::before{content: "\e245";} + +.tinymce-mobile-icon-underline::before{content: "\e249";} + +.tinymce-mobile-icon-link::before{content: "\e157";} + +.tinymce-mobile-icon-unlink::before{content: "\eca2";} + +.tinymce-mobile-icon-color::before{content: "\e891";} + +.tinymce-mobile-icon-previous::before{content: "\e314";} + +.tinymce-mobile-icon-next::before{content: "\e315";} + +.tinymce-mobile-icon-large-font::before,.tinymce-mobile-icon-style-formats::before{content: "\e264";} + +.tinymce-mobile-icon-undo::before{content: "\e166";} + +.tinymce-mobile-icon-redo::before{content: "\e15a";} + +.tinymce-mobile-icon-removeformat::before{content: "\e239";} + +.tinymce-mobile-icon-small-font::before{content: "\e906";} + +.tinymce-mobile-format-matches::after,.tinymce-mobile-icon-readonly-back::before{content: "\e5ca";} + +.tinymce-mobile-icon-small-heading::before{content: "small";} + +.tinymce-mobile-icon-large-heading::before{content: "large";} + +.tinymce-mobile-icon-large-heading::before,.tinymce-mobile-icon-small-heading::before{font-family: sans-serif;font-size: 80%;} + +.tinymce-mobile-mask-edit-icon::before{content: "\e254";} + +.tinymce-mobile-icon-back::before{content: "\e5c4";} + +.tinymce-mobile-icon-heading::before{font-family: sans-serif;font-size: 80%;font-weight: 700;content: "Headings";} + +.tinymce-mobile-icon-h1::before{font-weight: 700;content: "H1";} + +.tinymce-mobile-icon-h2::before{font-weight: 700;content: "H2";} + +.tinymce-mobile-icon-h3::before{font-weight: 700;content: "H3";} + +.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask{position: absolute;top: 0;display: flex;width: 100%;height: 100%;background: rgba(51,51,51,.5);align-items: center;justify-content: center;} + +.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container{display: flex;font-family: sans-serif;font-size: 1em;border-radius: 50%;align-items: center;flex-direction: column;justify-content: space-between;} + +.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .mixin-menu-item{display: flex;width: 2.1em;height: 2.1em;border-radius: 50%;align-items: center;justify-content: center;} + +.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section{align-items: center;display: flex;justify-content: center;flex-direction: column;font-size: 1em;}@media only screen and (min-device-width: 700px){.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section{font-size: 1.2em;}} + +.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon{display: flex;width: 2.1em;height: 2.1em;color: #207ab7;background-color: #fff;border-radius: 50%;align-items: center;justify-content: center;} + +.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon::before{font-family: tinymce-mobile,sans-serif;content: "\e900";} + +.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section:not(.tinymce-mobile-mask-tap-icon-selected) .tinymce-mobile-mask-tap-icon{z-index: 2;} + +.tinymce-mobile-android-container.tinymce-mobile-android-maximized{position: fixed;top: 0;right: 0;bottom: 0;left: 0;display: flex;background: #fff;border: none;flex-direction: column;} + +.tinymce-mobile-android-container:not(.tinymce-mobile-android-maximized){position: relative;} + +.tinymce-mobile-android-container .tinymce-mobile-editor-socket{display: flex;flex-grow: 1;} + +.tinymce-mobile-android-container .tinymce-mobile-editor-socket iframe{display: flex !important;flex-grow: 1;height: auto !important;} + +.tinymce-mobile-android-scroll-reload{overflow: hidden;} + +:not(.tinymce-mobile-readonly-mode)>.tinymce-mobile-android-selection-context-toolbar{margin-top: 23px;} + +.tinymce-mobile-toolstrip{z-index: 1;display: flex;background: #fff;flex: 0 0 auto;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar{display: flex;width: 100%;height: 2.5em;background-color: #fff;border-bottom: 1px solid #ccc;align-items: center;flex: 1;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group{align-items: center;display: flex;height: 100%;flex-shrink: 1;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group>div{align-items: center;display: flex;height: 100%;flex: 1;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-exit-container{background: #f44336;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-toolbar-scrollable-group{flex-grow: 1;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item{padding-right: .5em;padding-left: .5em;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button{display: flex;height: 80%;margin-right: 2px;margin-left: 2px;align-items: center;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button.tinymce-mobile-toolbar-button-selected{color: #ccc;background: #c8cbcf;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:first-of-type,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:last-of-type{color: #eceff1;background: #207ab7;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group{display: flex;height: 100%;padding-top: .4em;padding-bottom: .4em;align-items: center;flex: 1;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog{position: relative;display: flex;width: 100%;min-height: 1.5em;padding-right: 0;padding-left: 0;overflow: hidden;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain{display: flex;width: 100%;height: 100%;transition: left cubic-bezier(.4,0,1,1) .15s;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen{display: flex;flex: 0 0 auto;justify-content: space-between;width: 100%;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen input{font-family: sans-serif;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container{position: relative;display: flex;flex-grow: 1;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container .tinymce-mobile-input-container-x{position: absolute;right: 0;height: 100%;padding-right: 2px;font-size: .6em;font-weight: 700;color: #888;background: inherit;border: none;border-radius: 50%;align-self: center;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container.tinymce-mobile-input-container-empty .tinymce-mobile-input-container-x{display: none;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous{align-items: center;display: flex;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next::before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous::before{display: flex;height: 100%;padding-right: .5em;padding-left: .5em;font-weight: 700;align-items: center;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next.tinymce-mobile-toolbar-navigation-disabled::before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous.tinymce-mobile-toolbar-navigation-disabled::before{visibility: hidden;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item{padding-top: 3px;margin: 0 2px;font-size: 10px;line-height: 10px;color: #ccc;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item.tinymce-mobile-dot-active{color: #c8cbcf;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-font::before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-heading::before{margin-right: .9em;margin-left: .5em;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-font::before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-heading::before{margin-right: .5em;margin-left: .9em;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider{position: relative;display: flex;padding: .28em 0;margin-right: 0;margin-left: 0;flex: 1;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container{align-items: center;display: flex;flex-grow: 1;height: 100%;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container .tinymce-mobile-slider-size-line{display: flex;height: .2em;margin-top: .3em;margin-bottom: .3em;background: #ccc;flex: 1;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container{padding-right: 2em;padding-left: 2em;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container{align-items: center;display: flex;flex-grow: 1;height: 100%;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container .tinymce-mobile-slider-gradient{display: flex;height: .2em;margin-top: .3em;margin-bottom: .3em;background: linear-gradient(to right,red 0,#feff00 17%,#0f0 33%,#00feff 50%,#00f 67%,#ff00fe 83%,red 100%);flex: 1;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-black{width: 1.2em;height: .2em;margin-top: .3em;margin-bottom: .3em;background: #000;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-white{width: 1.2em;height: .2em;margin-top: .3em;margin-bottom: .3em;background: #fff;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb{position: absolute;top: 0;bottom: 0;left: -10px;display: flex;width: .5em;height: .5em;margin: auto;color: #fff;background-color: #455a64;border: .5em solid rgba(136,136,136,0);border-radius: 3em;transition: border 120ms cubic-bezier(.39,.58,.57,1);background-clip: padding-box;align-items: center;justify-content: center;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb.tinymce-mobile-thumb-active{border: .5em solid rgba(136,136,136,.39);} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group>div{align-items: center;display: flex;height: 100%;flex: 1;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper{flex-direction: column;justify-content: center;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item{align-items: center;display: flex;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item:not(.tinymce-mobile-serialised-dialog){height: 100%;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-container{display: flex;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input{padding-top: .1em;padding-bottom: .1em;padding-left: 5px;font-size: .85em;color: #455a64;background: #fff;border: none;border-radius: 0;flex-grow: 1;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::-webkit-input-placeholder{color: #888;} + +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::placeholder{color: #888;} + +.tinymce-mobile-dropup{display: flex;width: 100%;overflow: hidden;background: #fff;} + +.tinymce-mobile-dropup.tinymce-mobile-dropup-shrinking{transition: height .3s ease-out;} + +.tinymce-mobile-dropup.tinymce-mobile-dropup-growing{transition: height .3s ease-in;} + +.tinymce-mobile-dropup.tinymce-mobile-dropup-closed{flex-grow: 0;} + +.tinymce-mobile-dropup.tinymce-mobile-dropup-open:not(.tinymce-mobile-dropup-growing){flex-grow: 1;} + +.tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height: 200px;}@media only screen and (orientation: landscape){.tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height: 200px;}}@media only screen and (min-device-width: 320px) and (max-device-width: 568px) and (orientation: landscape){.tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height: 150px;}} + +.tinymce-mobile-styles-menu{position: relative;width: 100%;overflow: hidden;font-family: sans-serif;outline: 4px solid #000;} + +.tinymce-mobile-styles-menu [role=menu]{position: absolute;display: flex;width: 100%;height: 100%;flex-direction: column;} + +.tinymce-mobile-styles-menu [role=menu].transitioning{transition: transform .5s ease-in-out;} + +.tinymce-mobile-styles-menu .tinymce-mobile-styles-item{position: relative;display: flex;padding: 1em 1em;color: #455a64;cursor: pointer;border-bottom: 1px solid #ddd;} + +.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser .tinymce-mobile-styles-collapse-icon::before{font-family: tinymce-mobile,sans-serif;color: #455a64;content: "\e314";} + +.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-styles-item-is-menu::after{position: absolute;right: 0;padding-right: 1em;padding-left: 1em;font-family: tinymce-mobile,sans-serif;color: #455a64;content: "\e315";} + +.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-format-matches::after{position: absolute;right: 0;padding-right: 1em;padding-left: 1em;font-family: tinymce-mobile,sans-serif;} + +.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser,.tinymce-mobile-styles-menu .tinymce-mobile-styles-separator{display: flex;min-height: 2.5em;padding-right: 1em;padding-left: 1em;color: #455a64;background: #fff;border-top: #455a64;align-items: center;} + +.tinymce-mobile-styles-menu [data-transitioning-destination=before][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state=before]{transform: translate(-100%);} + +.tinymce-mobile-styles-menu [data-transitioning-destination=current][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state=current]{transform: translate(0);} + +.tinymce-mobile-styles-menu [data-transitioning-destination=after][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state=after]{transform: translate(100%);}@font-face{font-family: tinymce-mobile;font-style: normal;font-weight: 400;src: url(fonts/tinymce-mobile.woff?8x92w3) format('woff');}@media (min-device-width: 700px){.tinymce-mobile-outer-container,.tinymce-mobile-outer-container input{font-size: 25px;}}@media (max-device-width: 700px){.tinymce-mobile-outer-container,.tinymce-mobile-outer-container input{font-size: 18px;}} + +.tinymce-mobile-icon{font-family: tinymce-mobile,sans-serif;} + +.mixin-flex-and-centre{align-items: center;display: flex;justify-content: center;} + +.mixin-flex-bar{align-items: center;display: flex;height: 100%;} + +.tinymce-mobile-outer-container .tinymce-mobile-editor-socket iframe{width: 100%;background-color: #fff;} + +.tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{position: fixed;right: 2em;bottom: 1em;display: flex;width: 2.1em;height: 2.1em;font-size: 1em;color: #fff;background-color: #207ab7;border-radius: 50%;align-items: center;justify-content: center;}@media only screen and (min-device-width: 700px){.tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{font-size: 1.2em;}} + +.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket{height: 300px;overflow: hidden;} + +.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket iframe{height: 100%;} + +.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-toolstrip{display: none;} + +input[type=file]::-webkit-file-upload-button{display: none;}@media only screen and (min-device-width: 320px) and (max-device-width: 568px) and (orientation: landscape){.tinymce-mobile-ios-container .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{bottom: 50%;}} diff --git a/monolithic/frontend/src/App.vue b/monolithic/frontend/src/App.vue new file mode 100644 index 0000000..f4fab18 --- /dev/null +++ b/monolithic/frontend/src/App.vue @@ -0,0 +1,21 @@ + + + diff --git a/monolithic/frontend/src/api/app/authentication.ts b/monolithic/frontend/src/api/app/authentication.ts new file mode 100644 index 0000000..01729ac --- /dev/null +++ b/monolithic/frontend/src/api/app/authentication.ts @@ -0,0 +1,30 @@ +import client from "/@/api/app/index"; +import {ErrorMessageMode} from "/#/axios"; + + +// 用户登陆 +export const Logon = (params: any, mode?: ErrorMessageMode) => { + return client.POST("/admin/v1/login", + {errorMessageMode: mode}, + {data: params} + ) +}; + +// 用户登出 +export const Logout = (params: any) => { + return client.POST("/admin/v1/logout", + { + errorMessageMode: 'none', + }, + {data: params} + ) +}; + +// 获取用户信息 +export const GetMe = () => { + return client.GET("/admin/v1/me", + { + errorMessageMode: 'none', + } + ) +}; diff --git a/monolithic/frontend/src/api/app/index.ts b/monolithic/frontend/src/api/app/index.ts new file mode 100644 index 0000000..8f4d04f --- /dev/null +++ b/monolithic/frontend/src/api/app/index.ts @@ -0,0 +1,14 @@ +import createClient from "/@/utils/openapi-axios"; +import type {components, paths} from "/#/openapi"; + +const client = createClient(); +export default client; + +export type User = components['schemas']['User']; +export type Menu = components['schemas']['Menu']; +export type Role = components['schemas']['Role']; +export type Position = components['schemas']['Position']; +export type Organization = components['schemas']['Organization']; +export type Dict = components['schemas']['Dict']; +export type DictDetail = components['schemas']['DictDetail']; +export type KratosStatus = components['schemas']['KratosStatus']; diff --git a/monolithic/frontend/src/api/app/menu.ts b/monolithic/frontend/src/api/app/menu.ts new file mode 100644 index 0000000..efe760f --- /dev/null +++ b/monolithic/frontend/src/api/app/menu.ts @@ -0,0 +1,65 @@ +import client from "/@/api/app/index"; +import {components} from "/#/openapi"; + +// 获取列表 +export const ListMenu = async (params: any) => { + return client.GET("/admin/v1/menus", + { + errorMessageMode: 'none', + }, + {params: params} + ); +}; + +// 获取 +export const GetMenu = (params: any) => { + return client.GET("/admin/v1/menus/{id}", + { + errorMessageMode: 'none', + }, + {params: params} + ) +}; + +// 创建 +export const CreateMenu = (params: components["schemas"]["CreateMenuRequest"]) => { + return client.POST("/admin/v1/menus", + { + errorMessageMode: 'none', + }, + {data: params} + ) +}; + +// 更新 +export const UpdateMenu = (params: components["schemas"]["Menu"]) => { + return client.PUT("/admin/v1/menus/{id}", + { + errorMessageMode: 'none', + }, + { + params: { + path: { + id: params.id!, + } + }, + data: params + } + ) +}; + +// 删除 +export const DeleteMenu = (params: any) => { + return client.DELETE("/admin/v1/menus/{id}", + { + errorMessageMode: 'none', + }, + { + params: { + path: { + id: params.id, + } + }, + } + ) +}; diff --git a/monolithic/frontend/src/api/app/organization.ts b/monolithic/frontend/src/api/app/organization.ts new file mode 100644 index 0000000..3f24a42 --- /dev/null +++ b/monolithic/frontend/src/api/app/organization.ts @@ -0,0 +1,65 @@ +import client from "/@/api/app/index"; +import {components} from "/#/openapi"; + +// 获取列表 +export const ListOrganization = async (params: any) => { + return client.GET("/admin/v1/orgs", + { + errorMessageMode: 'none', + }, + {params: params} + ); +}; + +// 获取 +export const GetOrganization = (params: any) => { + return client.GET("/admin/v1/orgs/{id}", + { + errorMessageMode: 'none', + }, + {params: params} + ) +}; + +// 创建 +export const CreateOrganization = (params: components["schemas"]["CreateOrganizationRequest"]) => { + return client.POST("/admin/v1/orgs", + { + errorMessageMode: 'none', + }, + {data: params} + ) +}; + +// 更新 +export const UpdateOrganization = (params: components["schemas"]["Organization"]) => { + return client.PUT("/admin/v1/orgs/{id}", + { + errorMessageMode: 'none', + }, + { + params: { + path: { + id: params.id!, + } + }, + data: params + } + ) +}; + +// 删除 +export const DeleteOrganization = (params: any) => { + return client.DELETE("/admin/v1/orgs/{id}", + { + errorMessageMode: 'none', + }, + { + params: { + path: { + id: params.id, + } + }, + } + ) +}; diff --git a/monolithic/frontend/src/api/app/position.ts b/monolithic/frontend/src/api/app/position.ts new file mode 100644 index 0000000..faf305f --- /dev/null +++ b/monolithic/frontend/src/api/app/position.ts @@ -0,0 +1,65 @@ +import client from "/@/api/app/index"; +import {components} from "/#/openapi"; + +// 获取列表 +export const ListPosition = async (params: any) => { + return client.GET("/admin/v1/positions", + { + errorMessageMode: 'none', + }, + {params: params} + ); +}; + +// 获取 +export const GetPosition = (params: any) => { + return client.GET("/admin/v1/positions/{id}", + { + errorMessageMode: 'none', + }, + {params: params} + ) +}; + +// 创建 +export const CreatePosition = (params: components["schemas"]["CreatePositionRequest"]) => { + return client.POST("/admin/v1/positions", + { + errorMessageMode: 'none', + }, + {data: params} + ) +}; + +// 更新 +export const UpdatePosition = (params: components["schemas"]["Position"]) => { + return client.PUT("/admin/v1/positions/{id}", + { + errorMessageMode: 'none', + }, + { + params: { + path: { + id: params.id!, + } + }, + data: params + } + ) +}; + +// 删除 +export const DeletePosition = (params: any) => { + return client.DELETE("/admin/v1/positions/{id}", + { + errorMessageMode: 'none', + }, + { + params: { + path: { + id: params.id, + } + }, + } + ) +}; diff --git a/monolithic/frontend/src/api/app/role.ts b/monolithic/frontend/src/api/app/role.ts new file mode 100644 index 0000000..1150cc9 --- /dev/null +++ b/monolithic/frontend/src/api/app/role.ts @@ -0,0 +1,65 @@ +import client from "/@/api/app/index"; +import {components} from "/#/openapi"; + +// 获取列表 +export const ListRole = async (params: any) => { + return client.GET("/admin/v1/roles", + { + errorMessageMode: 'none', + }, + {params: params} + ); +}; + +// 获取 +export const GetRole = (params: any) => { + return client.GET("/admin/v1/roles/{id}", + { + errorMessageMode: 'none', + }, + {params: params} + ) +}; + +// 创建 +export const CreateRole = (params: components["schemas"]["CreateRoleRequest"]) => { + return client.POST("/admin/v1/roles", + { + errorMessageMode: 'none', + }, + {data: params} + ) +}; + +// 更新 +export const UpdateRole = (params: components["schemas"]["Role"]) => { + return client.PUT("/admin/v1/roles/{id}", + { + errorMessageMode: 'none', + }, + { + params: { + path: { + id: params.id!, + } + }, + data: params + } + ) +}; + +// 删除 +export const DeleteRole = (params: any) => { + return client.DELETE("/admin/v1/roles/{id}", + { + errorMessageMode: 'none', + }, + { + params: { + path: { + id: params.id, + } + }, + } + ) +}; diff --git a/monolithic/frontend/src/api/app/user.ts b/monolithic/frontend/src/api/app/user.ts new file mode 100644 index 0000000..40c9678 --- /dev/null +++ b/monolithic/frontend/src/api/app/user.ts @@ -0,0 +1,65 @@ +import client from "/@/api/app/index"; +import {components} from "/#/openapi"; + +// 获取列表 +export const ListUser = async (params: any) => { + return client.GET("/admin/v1/users", + { + errorMessageMode: 'none', + }, + {params: params} + ); +}; + +// 获取 +export const GetUser = (params: any) => { + return client.GET("/admin/v1/users/{id}", + { + errorMessageMode: 'none', + }, + {params: params} + ) +}; + +// 创建 +export const CreateUser = (params: components["schemas"]["User"]) => { + return client.POST("/admin/v1/users", + { + errorMessageMode: 'none', + }, + {data: params} + ) +}; + +// 更新 +export const UpdateUser = (params: components["schemas"]["User"]) => { + return client.PUT("/admin/v1/users/{id}", + { + errorMessageMode: 'none', + }, + { + params: { + path: { + id: params.id!, + } + }, + data: params + } + ) +}; + +// 删除 +export const DeleteUser = (params: any) => { + return client.DELETE("/admin/v1/users/{id}", + { + errorMessageMode: 'none', + }, + { + params: { + path: { + id: params.id, + } + }, + } + ) +}; diff --git a/monolithic/frontend/src/api/sys/routes.ts b/monolithic/frontend/src/api/sys/routes.ts new file mode 100644 index 0000000..e69de29 diff --git a/monolithic/frontend/src/api/sys/upload.ts b/monolithic/frontend/src/api/sys/upload.ts new file mode 100644 index 0000000..ae0e617 --- /dev/null +++ b/monolithic/frontend/src/api/sys/upload.ts @@ -0,0 +1,27 @@ +import { defHttp } from '/@/utils/http/axios'; +import { UploadFileParams } from '/#/axios'; +import { useGlobSetting } from '/@/hooks/setting'; + +const { uploadUrl = '' } = useGlobSetting(); + +export interface UploadApiResult { + message: string; + code: number; + url: string; +} + +/** + * @description: Upload interfaces + */ +export function uploadApi( + params: UploadFileParams, + onUploadProgress: (progressEvent: ProgressEvent) => void, +) { + return defHttp.uploadFile( + { + url: uploadUrl, + onUploadProgress, + }, + params, + ); +} diff --git a/monolithic/frontend/src/assets/icons/comment-count.svg b/monolithic/frontend/src/assets/icons/comment-count.svg new file mode 100644 index 0000000..2dc58be --- /dev/null +++ b/monolithic/frontend/src/assets/icons/comment-count.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/monolithic/frontend/src/assets/icons/download-count.svg b/monolithic/frontend/src/assets/icons/download-count.svg new file mode 100644 index 0000000..1c95195 --- /dev/null +++ b/monolithic/frontend/src/assets/icons/download-count.svg @@ -0,0 +1 @@ +Asset 91 \ No newline at end of file diff --git a/monolithic/frontend/src/assets/icons/dynamic-avatar-1.svg b/monolithic/frontend/src/assets/icons/dynamic-avatar-1.svg new file mode 100644 index 0000000..e1553e5 --- /dev/null +++ b/monolithic/frontend/src/assets/icons/dynamic-avatar-1.svg @@ -0,0 +1 @@ +Asset 15 \ No newline at end of file diff --git a/monolithic/frontend/src/assets/icons/dynamic-avatar-2.svg b/monolithic/frontend/src/assets/icons/dynamic-avatar-2.svg new file mode 100644 index 0000000..c4c1722 --- /dev/null +++ b/monolithic/frontend/src/assets/icons/dynamic-avatar-2.svg @@ -0,0 +1 @@ +Asset 16 \ No newline at end of file diff --git a/monolithic/frontend/src/assets/icons/dynamic-avatar-3.svg b/monolithic/frontend/src/assets/icons/dynamic-avatar-3.svg new file mode 100644 index 0000000..81145f9 --- /dev/null +++ b/monolithic/frontend/src/assets/icons/dynamic-avatar-3.svg @@ -0,0 +1 @@ +Asset 17 \ No newline at end of file diff --git a/monolithic/frontend/src/assets/icons/dynamic-avatar-4.svg b/monolithic/frontend/src/assets/icons/dynamic-avatar-4.svg new file mode 100644 index 0000000..e586ed4 --- /dev/null +++ b/monolithic/frontend/src/assets/icons/dynamic-avatar-4.svg @@ -0,0 +1 @@ +Asset 120 \ No newline at end of file diff --git a/monolithic/frontend/src/assets/icons/dynamic-avatar-5.svg b/monolithic/frontend/src/assets/icons/dynamic-avatar-5.svg new file mode 100644 index 0000000..746e4b8 --- /dev/null +++ b/monolithic/frontend/src/assets/icons/dynamic-avatar-5.svg @@ -0,0 +1 @@ +Asset 110 \ No newline at end of file diff --git a/monolithic/frontend/src/assets/icons/dynamic-avatar-6.svg b/monolithic/frontend/src/assets/icons/dynamic-avatar-6.svg new file mode 100644 index 0000000..b2432f2 --- /dev/null +++ b/monolithic/frontend/src/assets/icons/dynamic-avatar-6.svg @@ -0,0 +1 @@ +Asset 100 \ No newline at end of file diff --git a/monolithic/frontend/src/assets/icons/moon.svg b/monolithic/frontend/src/assets/icons/moon.svg new file mode 100644 index 0000000..e6667f0 --- /dev/null +++ b/monolithic/frontend/src/assets/icons/moon.svg @@ -0,0 +1,16 @@ + + + + + + + + + diff --git a/monolithic/frontend/src/assets/icons/post-count.svg b/monolithic/frontend/src/assets/icons/post-count.svg new file mode 100644 index 0000000..93c49bd --- /dev/null +++ b/monolithic/frontend/src/assets/icons/post-count.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/monolithic/frontend/src/assets/icons/posts.svg b/monolithic/frontend/src/assets/icons/posts.svg new file mode 100644 index 0000000..93c49bd --- /dev/null +++ b/monolithic/frontend/src/assets/icons/posts.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/monolithic/frontend/src/assets/icons/reading-count.svg b/monolithic/frontend/src/assets/icons/reading-count.svg new file mode 100644 index 0000000..dc32a5a --- /dev/null +++ b/monolithic/frontend/src/assets/icons/reading-count.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/monolithic/frontend/src/assets/icons/sun.svg b/monolithic/frontend/src/assets/icons/sun.svg new file mode 100644 index 0000000..a3997cb --- /dev/null +++ b/monolithic/frontend/src/assets/icons/sun.svg @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/monolithic/frontend/src/assets/icons/test.svg b/monolithic/frontend/src/assets/icons/test.svg new file mode 100644 index 0000000..244252d --- /dev/null +++ b/monolithic/frontend/src/assets/icons/test.svg @@ -0,0 +1,21 @@ + + + + Icon1@3x + Created with Sketch. + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/monolithic/frontend/src/assets/icons/visit-count.svg b/monolithic/frontend/src/assets/icons/visit-count.svg new file mode 100644 index 0000000..ba2a306 --- /dev/null +++ b/monolithic/frontend/src/assets/icons/visit-count.svg @@ -0,0 +1 @@ +Asset 510 \ No newline at end of file diff --git a/monolithic/frontend/src/assets/images/demo.png b/monolithic/frontend/src/assets/images/demo.png new file mode 100644 index 0000000000000000000000000000000000000000..1a45c9835b7b2c708c114b04fb445e6ef00d8827 GIT binary patch literal 33342 zcmV)0K+eC3P)E5{{R30UbFgLy!>9I_gk&^U$6RJtodK5_*RqthH1UyJNogyiSz@ME_7W4ruX zlJQ}e@no&|S%T|Tc;m6b?Pk0CS)KN1viVo0_hrrfSG4+s!1-CW{O@p-zTf?0mhrCC z{DYkA=`{EnUSXQS+yuIHGw_ocPw`@Ya_f5h6`vg+D!+1bO_+23xA z?_!+kVuRY-+@OG~^4i&u;m>GkmE+6M;%AKAgNVBH=Y76bmdNh^+S}5vyX2FRtzVYr zxx(aHkmA9}cPie~3(3_ss{dAw;(ax#Ec&5+EwXtEL*w=!Dj`f+K+^M6|pPr|G zt>2Wi%FW2XwXxBpy|BE*ow&rk$j6Ar&eEoRx3;X2xvaPEywdph!|kWR>xrrR@SE1X z+QiQY=>Px#1awkPQ~jnK0Q?=)ZvX&)+(|@1RCwCFUAeC8L=?P$Eo-=LIiv|30@kEV zhCnPoz$cIq5V8CO5`qAc6Cn_YZ{+ONi|v`qR^9Gy4~sm0HFfHow&CfuS6_LWUXEo4 z!yTminA6;1d@;6dyE4`{?qj_gHpckxV(vlT@IHn+SavY|OL%(a)z_Y0eHkSdqJtjV zhG|%KT7lGaVwWCc8u^}e7^&Nk#_?J-!rC?Zd>d)JUdJ~c!AN{?PHf});>MT{8e{g( zUyTm_p7%MCq}5pV+7ylYze5e8#4FR|Sh&eNL}S|8im@vfNrrQbI>?P1lQ+4Yw=~}9 zrqaPo;16wFM;mZlX@pQbfR#zH8Sw9W_*jX9)B(F{;RF~>JGo+xGNNk9mBNO z7HZu8IbL~sTqqVD20elkHZI2HPAG!%`1V6f2<_BNVjW3-V%*b>hE0~+m}o)Ms!CDJ zgv7kKLMZNHl;GjOzw6PN;MXXNz^p?OLa1`2s|ezKt&rA;#iG4xH7kS|{~S**4j#q} z#E!|St2EAyNG#L_YKPHd^l4P3aP7sfO_87xjy0%J{%YxfP~68_kwX7H>slzmo!Oco z1wTNFS-;Fx$uOrYeg-v$&Q+ujhYC5Ag4G#Kf21Mf{}?YLgsCPnaV^M5xT2j_?yf;BZ#A<9*EVzIt3C$gj-%1u)U9%!-wAV%y71;$DxOkJr9 zFJRSdN^30@Yp6w|6dQ!%rBWdTGe82?P^JD{hApi|40N}dGT4_Q#zQ5Jr2@aBCFPP5 zU_@mmln$9s{#T_iY0B<5jh`CVf*hIk!Bv7NF)=4TJWV}DOd~a8g-j(ObP>eBp9chd zQ^%nu;UPXiDr&D8pmpUT`g71EjlkSq{mf0Z(BkA_=z#HBv<-oYkDvv0r$rLwp3b7j zzfTIdOw+5R$tirr64y=8Z|C6TxCE`r4B8gHA z;Wo3)gMW=Bxy{7a#R@Me)ud=?(I^8m5#6Yn)Xv~4 zmDV7%PvArkaKhS@(h|)?IJ-LQ?NFpE5+0)h0efO zGvYd;NMSMo$%xNPCR$&yrfpSHKqy`=70wA@bVY(v1Ti+muO>w@D`6+Wc2z`Y#du5$ zQ3}3;Sw)uzIC&Qe?kFVwk4mvjCHpcmQ@0ezl!k0N0ZOEyG!;A_)+uIcej`DKE*(YY zfy84qmnlH%@gO=<)U+rJrE5kNLky{1B+r|~HJgK$FDb3Z0HI(jrds=9_Fx5kZ`x zSTIsdsp56AW%3wu<}C(l{=3R%H^sQ=fV?kJtK-LVz>9x9e3(vHPAom>YT2kFEx~Q; zgLfMai`>ou;zw1sQWxi1L8wh$aaKBt^(}61&_UdIgT}YtSRb>R5DEYZX)G{e>WZO{S^SfOW24pt!j zFis4|;X@sT=Wg6*?+Dc^_s#wo@MDGZtAv91z)BG#VS7j_fL&hHrFAd@SQB>w>Mcrk z9lTgUM-Ol!N)-}8zzft0WoAAY8x|n`fD2xj97BULT}kpyiHy^!AV!6!2nA{9Z4 z9L8dz)~16fY3|9zzaBn{eXzv?7~-0NO@&=PD8bP0Y9jzj%<|iT#5Oi_jr+WgRmW0* z=)u|`Q=McyE*0at1E@rO5zr9qeH8geS+U?V!bt*xo5lGDyrwG!n+g+VEgKS|aOB%# zCH`enfO9-r#1d8t8cVT2D)bvz^f)bAY1bASi`$uyci6C^H(BBap>R*ZW`YjxMncDT&=$3B?4OTa<^iQpRzNA_kf31=O5tVAj9Melz<&@vyojoN%%T-2 zQ^ay9ltPEW8dB4tqy)V9=%rv!>fzaZg725!ct4Or0>@iyGCMbU_OMN0J>f+kx{442 zK<%X0oxDk}2t_eqH z{vS&5pYMI3s;x>9o+8DDxmzD71$IcGgR(eEJwzfr1Y1cs@=)w|Fc8GCEQG>SkGFPe z*{lW+k>XS>f`rg0IL@m0iaZ3hZW`}}58SSSdrs~$-BM)FKWvnrs^%XVsRxMhUwH~E zqAmm_hB_Pu@({b~W{0#AieX?ofG(JR2qT1Mu1Y-1_+A$N`Rm@%}B*8efn&)+jar6-m6V$+^ zh^s)sUgC$*f)2M8uvChnl8Pn)fz?D!b6BKL8a)WvDizYufqyq8)kKHKqHe_(Br1V@ z8Yc2&!4JQDe0y`LFS}+{;S0o)mhN zG-%R}P1qY}s&)EpG^-M;IlHT9;s>~Z*FPj8gA&<)fhHBxA{FmsL^!Qk{o7^k*djHT zIb;i@Z2c#{sPEuYoh5)HWZwb#_noPbbJ(*+;?C(hU&i65(C zJJ1R_z=m#9M39URH(3fLypPO&iyVhJsUCwO<&cU99~L|YIj|`uN#cKByaEunxD6A6 zn(;z`t7kax4{F^rH9UYKWROD;5*$ubs8N;=8<)8%7kscYyz?W(Smo2RtaRlD>}iEP z){QI(SmT2ItAzrFZ?gD-yc8;mtq%h%X3`t2v{0q68lq){mL~4wxm{!Ra#CFUkzL^< zp6=%}4QdLfMK)Rt6-vEO_%@hSDRklwoEREE>`fpA#JPDI&bPwe1`%w4P(&9mdTKSt zeW^gs+4>rvQ8h_+-8WYXLy`lz=nPJvH7{JU@M?jA2IhicFuCUAAw27Vd7l#GW z4U{;Nies-yeBllfv?c=E=QrOJ^Nl>lWQx#XuPjb0Is5h$5(s#R#gH@fi$0h)eTOwuoTxidaN{XqrO@6 zKq352R(evQP#{0H!;uP8ag**`u+b`4{+$`Bs|jk_BC+}|UfQp35t(XZ;2`Gh#@Px2l)&_?5rd#7)Oh)9BUGeTiW5#;GAk1wdC_8bc4kaotbn?yQVb37oe@6CV1 z4w8L%_CN6?sVJV1JR!sf_>7wq1f;OVfv0$W#8SxHX~-gS3@avY+EDn{id zW><+FQdrdrrh*tjgX%<22k=3e5cuF3m@rN8nG)oQK55BwYA-HyOc%K*Is|mWM_e$_ zX+``N-i?%$5T;z%fI0@D;{#R>cy@(69 zi%}xdQj2gwW-Lk+b_!4%4snGobIDN6&|1)HYK{LGL6SeAa1;ToVJPm$4<`j!(Q~4H z$F#g8j~70J2{z99U12fj)=un_Vo9EN$fzz~=fn6@By{aiP zBPJig7n(aVAcQaf&Y;Mz&r6XD-xJ~#8J-C;-Jl?m%kI!6Zy%Dl;7RZi5QqbT6PGB=% zC>6%L8WKB@3KzswM&N3l8M@;E*tbRmNppmc11#KehZWO0L(CLEcu25YvrUawKrP~RD;5rOce48sLh-h#1M7ss__1B#9v^WP z`=kK+!uEIzHvvsklj+78h%zp`1>X)h%p+Q$x~)ILs2k-5)0>&wl;4zIVagY3JklRy zCR_+KRP=bl8Mt%N1{UZ5Fe|v#O0hI<^E5Aw`{HU*lVToCfM>N6CKR6Y(K@iD`ah6p zjG&Ix0{|(G(2(LV0omGIRHaM?JX;FMb0mh1vn`1fe4HtT4k#e|vo!oi`!08aPVeUm zZ&vLH6KEjW2g9cmrMNUok*WKZ7@wN`xuX+l@Sg?EDXLe!Qg}+5YD3Qll8}`sp-Qou zHuzNSnQx_eeAHEpkc#tn2oX8xz@;*c@p2fD6d=Xj@Ucj@yNkjVHG)uq+WS1d&nJ3b zVM2fNpt;4ENGZyg6O+mX*no+ZM_92;%nW3uAOz zx>AfT5k5mG2yHw7DNeFdnA#RKBW|TwG`R*I~-Ly|A56aH?LQAU;Tcu3UstLdn5rSuL<2%Qf<43oq_E3O?q9v@DnraNAx` zp{#Y!{%4^=akV{j4I2&!MV(@9#tPdbA?Vaw&0|um^&?<6K9Y1d6h>puO7~fTy>z`P z_oO0rAZw*Cd0?#|_y9~yg*R;mN2*?tBJxw{#Kn5;EwMJCusyoG2wd0jp8Q$(n1cez z(8|P&*NY((NyBweVuet=)xjJBp-VA0W(9UiFgH@M*=A@@imrCmD~07BH{aabVMUZS zACU@V9|J6fDur^uVh9b8ivp8742>do(5cem`GXHCqluDMsT5VYiZNwwwv$f5BU5*^ z$djj|)1yj}(jhBo=OBK15DN2}a|retNe>PuT*U)Yp|E@d_Q%o> zyYA9ev`WF0(5QN@6wHfk+hM3tAaF3057Ge@3Tcy^8YQw*Vxk68Kq)RN5;C+xL44qr z^^6i2i5)B$c&F4t2Z|JTlwvU9JW>iHLgDIz84B!GrcMNWng~yNigcV^av|5P$NtFr}3SO94^iV=D8<4v4C%sY#1rR`#9x}jU z(k#pnp-`Wh!%qwvK_<5p_p=W=kg4yILOcUY!i-eZA6c;o4#nO^2t|onC{_URLpTx5 zI;2ARa6pRP=yAhC6qbHKFwRJEKY+kfNQB0A7?M%Ue7Io1RLCHwdS;*Nls_O8O5rjw z*&0f5F+KmKH-jqim)<{1JU*SWc6r(sKAwBhu6*AqaUWKQK$92O~ghF5j zBfte%OC2+8CiPY+Bn_p}r;D|ETNGN6>BO-BrW7Uj_R_-#Hr68OaxfwKq6PlFy z>Bm=Ez5ChcAAR}tx8MEz>kqcAL@jw&tf3U+TL-|Nc}od*7WJD$D1{bPO+)`m5FXz3 zOM)R*HzeIs>rub3d5gL-<4SP=ygf?j!^gXI*{V-IKnG=k6GP-8_)>-sSP2A>S}HDX zBxIpJ(}g0770#+^)U4Khf_SIeekWe*b$rfb`18*{e45aZ&g&W|_nH&%5(Va{aKlL8|4~7}LuU16PfCxFB9eY9Qz(=LNIS%6z9~~* z>GsG0J26r3!$;sE2jCm89xj*=SgNm(rfQM>wRkrdhlr=xai2mq-eop?qaaRv^2JY2 zq6ZKPmJJOk8x2<$ihZ96p+NNLTm?c#q^6OTUX>M{RKR@}d@!GBbl{ctYU88GHwp~Y z&od7p1@;{?FC6d_dmCa19oED~pvDQ);iN!HIw5LYyqV3oC>NynSRy%{^kPFSmP1C! zQNJ+dg7NWJ-voaDgz&`|zhvWpbl(qAT^G*)p=dBdD8}`G6d(c)fjz*t$B6(QEWZ^s zdF{cBR6dFaD^YIs=v_HN9XT?BN2?U?Q@0cFp^*ys3ilS~K&KDh0V!Z3dQ40gj~TU2 zSaX%&0aR8D=a^e0#`jK%-$*8e6kq(n?j0qI+YF%?MJNvNhH&Cq7r5^fu#6wDn){vt zz|*4YCeX1-Iy>6>1UNy*3GkW+Fgc6@ou7C=Xn~R@_emxjuv>NkC(6AKSPC@bhM|`V zd*2w9O)t@(lEQ<>P`1QE@p&0Kj1@oq0Hvslnp-*(iuEc$fxAUtzyeUf0%}emHI`{+ zH&GR<++g(eZ3GT!j5Ddg&&(9L^%TfHbmIe30XGS)5L!f$+hWM;<}+b5@qmSUi*5(~ z(!$aYEmwH#;B^rC%u@&@dY$uoSGs zM#VxzP;5W2@i#i>mM4?R#VEd$%(#l8@yUD6oJ?k4RZO^5NU}*zF|ctbTj6TmC@4bB zQ$cy6(n?lw0U_}*u=RA)SEIL1;r9V(9J)0oc-H8XJh|ebC~J>nhs+aW)+nQ{1Ca3ZSrwhc>F3kw9ujH1W=rxalP&G`>Os8 zqhRha4+Z%w9STH<%C=bFP${@NO zO%Ca6kopg z3Pb0HVM&EDapB}toEoEmiN)|C+W2Z1sNmZv5nu!fOg&;I>KiYQ3s(dV7WU_b#~lL| zX+EdWXkkZGD$>Ix-PSG+enw-*?b~%uVcq;J1iNSyWH9&e11J`k`s>>tU2PQ~2pts^ zU%tiS3X+OD21UW)G;b8^DFu(k)}R0h?4rhj5(NoG&=Jch>gpxM+<>B6UW>L5R?Ar(`1Hh^(cYdUa5K z{u3sELaF#+7GaUvpDzv3<0NW~!h}=IY8DDo%_$ZOHW8%yVX>t1Rd@(2kbGJR8`h%~ z15n%p2A_poifAB;@pjcTeuy_%D?ic!D4YvaKP|;38WBUPzyaAnftZyG6BwzbnWPg; zKZ?%Zcx97aDJ^=46pJOJaI09zDWGC0euyang`bGHCRp%(N_HOb3hk(CZzL2%4%EwO zDI9MA+5D4SQ{+rYlHfFm7X%pgBk5ECq38q@DAin8M}eXtB7Ttg>$W;9sy2#yzep!) zr|P`;TXk-nt#0gYSgt zIwPVJqd=8W0L2OwyezhE6?b7GJu6CwPW^(psK+%eY7ehE^7w1IH2FYV*423>UG-Ku z1yc_h%_$s-+r~vGf(2w$V)l{b;GA)aq6I8)ir&9ya&Rz{I>$?1aLW#nw=;g2MX9Dfo{!6aohj zn6zW%6u1Rkgi#bNLUFZ9DtcXCv5SgvRqp}mL<_}tWkNznYZNUMCkJAM3fotA%PN}q z@o~`m1M!13{bj@{mg^H3mAV{F?ODdAM@ukV^gM}0!q6Z?o zJO&})QMzCXA9ecf_1C7@vQLR zdd)75_q)*+-?LoYMH^X^<5EI0L9q_HZc~pM$weHU2LAXTWsk)R4QH@529o~5wE%uMP#s)g8j}G zbBdgIK;f@y_L9H>gv^##NA6HJn>pxXav8jrP zT~6WJ%qdE+({X2+g3_K{p||hAVg$u!OY^1K-ik5xK(nj4`SE_8Y%nOi+MR=mmoHyt zgQ9W@W+9y<6%jvhihr(C^o|8kRF6GeK(SZbiDp>EW?GRb%0o2A;ql?no=OE$FwRO^ z5nKSpdF+y>hOEYXH=k-XNW=jY|85n%G4ZnKj3;5dB*;+BKj!Nc`wJCG4Y{8Brm=S7a}&9H>K62 z!pZpbwMfVSi!W!s#~ek9JVXyPlT+*sA28C+N+p2Y6ex^|9wcyzYVDQ3-2@f{%c5|} zjqMRpvgqM=AW$&z2>maoAjfnj)`}I3)gD;v$s7Mt?g^l#Pz$T$}or1T`afP)NEM zNMIEI3yL`K|4W&Oo8tnSAtgo@h^-0CP`!!4n=)G;1dqTAuiXa^S5sc4dvSR5mdrFfaMecLnIY2ob?RYt7jh(JpXXoanVEZ5Uw2wfuh;^jEd$G2uE#l z?1W-}vKc>0`U%Jf0mDQYrzq+LhrUB`mD!GUmI*m@WRpDUTahu4U{1t)Ag7_$Em(B2 z*~8iOvmPWOZbWq=6yM<<`6bd>$GtgO%}V;5*5;|x&&0f140hr2_+Oj?MXITcAlR_mL5`_# zicuz(a|?y){%Mg4X)+C24I$Syg_D#&cZeU-D%n!2NGe!Hk%vWB9Y%p5qS@i4DNR_4 zrq{FQ<})ZnJz9a{wly1$@q=JPyZuf973)dGFeVbsdJ>ZL@GF6E3I;T(3$8N3tW?gw zM&cGwm{s5v$Vp<}a`O=``r%W7aBAuYFE>=FwVy4<7Cla&UghvlMO2sQ4-P6gat<|zoK!q`3Tb9=FJ30_+HNlc3~|1^sxB{KBJ}+}QGh}K!E#aO@d+M-Xf#Zp zQP57^GnU!}LJ0OQ83jfljDr>~PNCwa4q1!|+LWEDwNqh0w4QR};o+??;e(FA1ID4L zPn2b=Dlk!bUsW9)H%Td|#Z=%{K12>U1w)}+Y)?c(q1Y%6m=_IW;sjYGJ)DA>020th z1nCuvxzdrJq=jKf)n-_vZi-_#9zE7) zfMO!4xI)tm6k-XvO_Vi_n~~NBMS=ndo*piR34cnW|3H&WniU98ZehcxQkC1O9V$6` z?6?TdF%+uN@FBO0BAYlxn<%H)I0^uyP*s}86cezydf`f}KFccnD5m%7r$#aF6w+bG zgop!avPAX)B48C7KS+#)sr9olOoVq<*k&?7c3!b+cq-K<$Eo8^NB0F29zF`Eco1_z zx_C*oy)-A|27Upja9tL@HXH1L#IUk)YDLVJRG{s6&TAH{IW_Z6u_B{5fr_OH7Gsg_ z1QLnv2oz1g!s3TbSshd6Rpu04vg*q;6W?pEZehZqJjE%Xz3WnFSFbV%)Y~SZvuAqd zoPs1j*-QqIN+zH|TQk*7^$J0u<4#o_5IZ2)s$-E{;c85fQHZ9PD0a+<;TaeHA;gcI z3e>FzT8L1bX!?R|u+V2jh>%W%v!ewQ%Q*#rpav*RwxVEA!`2p5m{SlFGT#y;v`0jl z79O%#FoDKpuJ~PP^?`jLZ2>wv;lRQjzUG#Bv!!-yC}?>4Mf}Q zB)P1C{4t3`2nje}S^#n!cC6mSaT;vQpgRr~^=Y%hZfbqWwsXnCBfaU^_y&s~P5#3Z4QMd!Bg{PGPc~V$>tFZI-zZr!bA?6?jydxA~j`)|;gikx>*-9N`nXI1LI| z1!704=1`75cxvq?B{vG4Sa}=_IYoVrYbeH;fU0o&#cWF9NWdzt?v)F;gzVT}4peM5 zHu`{3lwvT5j@jWzNkuvaSqTuSS9C=Hv5%5RV48BHXwPPiB1Pff!iW{VO06@iU?LDc z%qd8{7Ol`$#s+kk zHK{dhjW(PTO};h}c9G{4%T_V(6hwt; zGNpjbC)gWc5^5CEs;m0|1<^oI2o>j&)zeERxam@rIt3w*V!rytSWe+}ZmVLY#*2&s zP$Us#K$aftf^mT)OuB$`lPv6C=&g&Qy|9jaz1`+T?oPs9HEfoyp6o7)oP#6>Y zT-~%lYOE5A;1#Id+IpU9))qo!hT%FBc5#jy1+3yMHwvVJ83958Ry~B6X~^1A{8-Dc zXcY#UJboafXjhsGp~3X#PJGyyJ&CdZ>l9#uCX79>U?4oXh@qgfq@*b(w9|f^jnpa> zi!rZ2jT<+OmFhhm^UqdvzvY29&tjz`1CqG}$-poO&Rfn3R#6ImWLDvm_(a(3m1796 zMrmJ4DR7i>B1%m{fp;!1Q`!%ks&Cec(X;%&w?a;s1#GOvh6A5}1l zdY9KUi&F#U6HEn+qDU)-z(fNjBs69S+&9#Te4qbdG1YAJ*SIyT9SSXG_Cg2jA-m4qD3XDEB(@=zeyIatu#4eZ#YDN5j zJL0L`3I*1hIyrj!jSoV^!HohECZuH190C>Xv4QMXEpM&Bp`92AknuY}=dEI}-(vMk z+ ztMFe#&3;9As%}=C7irKy)adgUo!v|TJ4+5{A& z3(CahiSQ8?fZ{_!fPv&0g}$wSJ(7GhqZi#y@&qvLuC3bu+Bm>?m$ zz?C4$oo~HcMa?Y>9!^ELF7qN!ITIt=294)mby$B%)AqtN7RIOZ|R@=DA8lVC}_ai9^K5@BJ%H-vPolw0@4lv ziS?cLKY#vwGg#S6tO6|PLZn$mFbO!*>H{B%?_v+S{?hHvjiRHbSbzyS4ko)5?3_%@ zgpWNz;Y?8DH#}~GxYCp`_Dk9qU$SOC%2_Jx1`L7k#b zpnz3$LWm?3yVvx`-!L6)6zUbWgj$CJ(ZdRj)EN-*qwBH@A-8M&7@Tfu9d{I z))g{|m)A)Og|C;VI`Cp^g920}#R;s8Y6~nz5(O}Kra=HEWI4`+ zE5^a0@b{eMeDEy2Z}LLuVcW1jfbc=vi%_7RWmfS(z_|G7x?oUS^pLHO@fBI6QveF* zLJyP*Q6zz)7aFKT52M&Q6LxoRD^$=s%$?mE-Z%n7t1GQ;YW@+RSQ`}002ERYgfNSy zfI@`z1{Yd|rM+Guf+ncGcuuF-Mv90CbxfxKRM>11F2b5avZ2YKpjAL|E-@4|2^jAL zgEtRqL=TE4Th~MKii&2gUH}RinN}>LV&_#o9K9F{+TXLz2Jwo)EQ0caK{JZ@O=^#f z1a+z-iQoOfzG2FT8?=wR#_k0?2o&oh{{{NzS{eW|6KnPfg2p6;DzOSev1KhmA+O6` z+m6LNR3v`Uarn6CX9wza2?^wr2;IQ_aj(> zwj#7$P^rrdJg~2KgP&USyMaj+IVW^Z?JGzz=jK);}8m?)_nnrjygq|3Jn_?Nz@>e3o#0Sg7kK$2xtLFpicz* z5krw86!zwG)~4wZ6VZGy0u5GCAIB(`ZC#wg$_Jp;*ajxNSpxMw9~}m9iK)*a&NE1b|`*>2$fC z9%wZ~&qkk!@PjNmGilS4vns+za2m@>cgaRKWmyeKoxRXTqHd@#hD){A6F?0|L ztTUC0qxi1LHW8GdP@}kgqu!}gIG>1hv=oTfgiv%m!lE_94?B|aM~L5=zB&5Fr;V3Upe(<5>rFQJSEMIQ@G1=BPbNQno*yis1(jDw1tQp zWl9i?QrkeG^$@L8(J)ZNd7e@$oq!4{T5Q(5 zWnpjK9cb@4pC|O>`~hPIRzfB+d~yLX<;?rtIiIWqigtF6v1|gp41uD@>zbd>Yg*T; zdx0W3?}oIo2;dtz2$~6^q|38}$8?hC(g+I0D4yjrdis!A2!#|rap3^_6(Jc}KRPZq zb0WYoP#pT3C#n}S6trooPJv_0xB3JF@y@{;L-DqG3Jo9gk;$xP zL>qev-smk?B`CIIdQ8F8ZD4*rZa~(f{UZMu3SXdzPu=c`S|>A5q&Nvc_?;Rz{)$}v z^zhKlpc*0Y{Q}EQ00pv>bODouYIUL3DHSLlKFu+MBN~CCP3t z;Gid2aUx8Vo#MSYl%YoPuB2OC6rQ1zh>K2f_r~}Uu+S-Z@bR=i(D;MK9vk)oFp55X zA%_$lis2)oMqUFGP1jzcy>G^>H3D)u;nqOW5GW3r??1E`WX-V5D1aTAyb>sSw64hmDVtK@5h!w?!}1UKw8e*Iu0t`Q zMsR5wKROhlNIlnX!VWX1ok*aNo-nav=*}J~}!K#k_?b`4nI4)rAkx4J+K%sQz5=oCRGgwSD}A~=o+2mI`*^F&`SBs8F>NfF!;%@qpiW5uD3P*^#Y zh^Dv-iXTl^q3{KYm5<6s1t{iL&u#R!3`Orun8^IZgtoF|rrqyz3On#PXX{{{OHgzb z3a%xSm=jv@r<5LWB+_%Kn#)Ki6f5mh5ERr1rpBrWMds4P6~nNUj^wOAk$a09g>Y^1$2qxeD5 zqv<6`JV1fz@KGi#h6)8M32lY~4MjyQqgQJvLy@+9zw0lHP^>MS6!J$51@&;uq!o=d zPUr>)+P!%V0!h*qWz52-RVa8}X3lCsAq$`&zM$mBT@e)3@Uig6Ab)526pW5e&oUHj z4m4|LkI7~&f?_IDnhx!3OK1OiRsBbXBBEB^C=}Jv$9s+*C}iSgt5CCW5Q~aayx!4d zBtSIyU>dyR0U;)f;QnO{eTu08nweH8Mij@FmQ7bmgT}9Dc@2tn8<_A<3I!TCRyI(e zozBZp;1p$y+n2|qWhfqAfFdnG(cTrHNU+535fqjD?%}}1d3r13g4y~ZaX|+ zvk4StCUehFKx*9pja23g2s9YSmkB24~rU81g?j|@4f_uZf+AL#t6j@yDbTA zx(pN?OAHjKhCrbz&u9u16j%)uX#tAS7^6oM4-u+U3_@}Wi78tv9HBW33yMC5B4nfJ z6y)%su3Pm8;X%$3bwH5gL?sVOPI1S7oWZ4eBkh5Z=>PsGd;}{F752=G!kc_h>=1f( zif!LvD!gfFo?=D=ld*-@+T5_&cs|H$LgMlNsr?V9Xt2x6vFy1Lf*+FyBg_G4hgo!y zDijX_g*XdSF=rSGP_*9!g&Wi7XZ!G{#Xd!DQTVWi)P1m+gN^*)&YHG1H`|jk z-(O5a?Sc9jtJ6&zQ8-+23R%~Qj}Cv7CNNkkyC-9Rd9-+3I#cZ7=;kQsg~ef4MLORJjGpb2SOSo zAvQR3`yO;_{y_&sY=C9(-~$LI%MdG*;Rg>_N9i#LkL!a#!Cj}N<8cFpI4DbL)@Tb} zu}lZ6*%qLHzbjCTUvi4}&6;3aoW|Muz=I7Ck46zaI9$pz-=Njv)Low8iFzp7007rI z?RZ_8Z=mo23xUFYC4BhY2-$d?r6Yv`mE?PWpHJB}%;eQ-6NdX46-ExwLBr1|^n!4f zOw*|2)P)a;9=gFyM^ihHghM%y2rQgeR*It!3>Jt(KtvcQXn{~5IQYl9m4pW$0rfZ~ zdVmr>`r$qC^z~{rg^V}_Lt*n&%qaDMitUuD&10%}Sff?A^-w^nQ246~6p$H1H5$b6 zTjp&Yo(du|g(0;F)-n`rfx@h7nha=NXCQ&0AfvcAMeoIqrn}%q;7_Db@CR5W2ewSx zK%s@PXM_4wwu2hGFVvEUK*3*$^Id%QRWP!VJ4x(QT7)8g@jj1H#5Uo8~cr!ZYT z4Ig+qS(X&ubB)_rBSzXb+6}Z)dGbo3Xg6S8s&&^lQ24$=;ktEBp-?ouNu?3oroEI0 zqGV||1q#(_4~@jlr0TayPI1prkWB^15Mg^R?rJq52K6uyDtrnD}a#u6yNDn5q7t#yh<)4w!A zN|RTXj6R0uNZFj4!y(r-g`@arv-bT9z|&didJFi7G}_!Ot{6MT;_ zjpLMef@O;J#x_u~&10xHP2zkjNEj$~P-o)%4SxukO#?N?RctNGn!!3Z3l3yL7BM8;H~_&Dx0jPSm~7EhroGH$Z(YjWOfZYuX()Cb>UNu9e&G3+lL4E?mNrX z__2*a%VOT8|IPKO5vKEnpF?3TPBGdp`^glF^SuprDNyXAHPw9zZKE*iucr7R`cdFG z+Jp$jF;3GyP7f5BASfh!T${~QRg1Jw0al<+p;9QQ3hSNDi8db?RMEo&f+6s;R$_1)jegq49Xr(+7uR(oXS@5`3_h0c ziW>CZB+QjA%ENP+g}et$pc+1WIrwfieafalvA4r56(bV{iqH;^P#Ai4LE%1%q9e9q zt7XGI1mPJz@c1WeR#X8BkUE7#kn3&%RVp?iP+$aV-CY&*DUdvoyts7TO`yU|Yt>&p z+z}OjM5bv{6eJbNNf4IEm4q^`WLfpsan|#||A&Z)hKSy%XZ3JVl)QVb2!>|81Pc1< zxS+&hC>*;WygV{z5CB9%PWqxmE~)JV<=}y0rx3{;Q;7z7aH|2N;uNf}Uxb3Vk@r!j zxTje$M57Z3uXR*7kM-Ag$M#VmDn#I&FV+jU3lHvN?-7=8@6~J+Uv5Pr{2~^yYqNM@C*n?$Nw@Uc}`4tLY zN5NMbI3p_(Ebz}QsVBGpjD$jgS+a^+C`24FaA{Ylko}+f`PZG|-SdYJzoGsD{qVy# zmt$lm)oc}t_X0(|v`;}kp-y3DMlpb>YU0P0U%eHVsAa>pnF{&AMYy>(Fj4)9twuq< z@roiBrR%C`>esSTyxx9WkpLM8Oj^9;ejN}mKw;64l%NnK>Y;E53ABmMKFZjpT(pE#`PbkGF8PazSn>H5ft^^@s8z+!zFW7 z_I3pdd6&2lu!ORC*(v1I@s0zDgbx)qJwibytxS}i;)@R-0E)kU2OR$X`*=J?pueBL zt|D<;A3i?&`ei7HoT^h0swD1f2CR-3RH4vbg>wyv4*jXfTC1noVoLibW_nf$3b~*K zrJUD`nwmQ&f`iuAwNo=zbQFy`wG1Jx4q?%$hk}9!$^>mjLZSHK1L)U3|NJxkXGlcIA_6Fk zS=@e&Xw-#|&)(n^@2f_kZo$dD*cdL!CkP6WgH$LMRVfZ-EZ~{ii~N|YTkz1ev>}^- zgZ`XM+r$(J3{_M#r6)_bqIy*-cy_HRR%M`ggEUmyP4$WTQ-~1=@{4*Imo_F51a}I> z`_KMjn*hcC{IlK&66h2^{`kv}fQ1@Gy;Hmuin_@T#~hO_LSYQ!0>!-`f%iJ8Q&hVZ zZrvYBpeTDqyV=&>h4Mi;l<*;L!ihX5#rpgO8rN&Etb#khLY6|st0YwX(7q<|3A=+p zbXxV|=>UhJkR~rc@g0VapMeO5;-7S*P614Sz%0xeAF!-KfmU%9if^wtg-Uq6mG~iO zNTN{G4nS1@l6EFNPs2bMz62 z*ij+^m~qaiCW$C!QingV)&3 zQzJ}M@RP27LndBFCJ2hCS{9_pMAX~IBbSNoLNPxge2i0Zmb~IZgo2_68wO{ZI~tE4 zhgQL$P^z9&?wJO`sg0%*#d+lBM@|#iGKds9;S@p6@c}wW@Q@aN{(9p`B$#nVV#+Dv zG}zb~#bVMaHj`!U9j2MLzL8Ck>H!K)ES@C2{rK&|fsTOUc3jyhrsGF~;^dNjA}ZlQ zP~7+%6x@Q+Zp<_|peOP5>B%sF`CupD8`SX&WCrXG2Y-vx&1o<;|AV9R2^4?C$>4Ej z8$31x6yu^fR0KuDVsq9uHnGLx$41H)QN+ZXkKg8_*OVR~J{YC(@WD`QdEl&K#^HlL z>$p{n!oZ%(VkjnilAKR43LGrh8=|Pj5#`V;W|LMyRn}s53?Zi{p-7b>c*J5#^qa>M zvLvJ6(DCK%a>#Uaft6r5DBc$@;Emwn>B`zL+kOJySDd6c8wF2QK5&ruVq;y zh^?$u-@&mga2P!Ohl~O%6gpy;bXqBD6BIN`aqAOin6D8E)a!RI^|cKX3`XUg{T`VZ zp!hbQQ=q^`&-!Dci3>x)ARTJNDLB=PMnO=pR}d2iI&4pWmlt6rg{{F!7uwM2vhADB z+a_y`d1jr+VXdTlrZZc6VMJw%S~ykKJ@iVLx-<5K+0#v$^cUJt?GL?eq`d0!`p-ec0LEgSW@hm5>LF{(?&gm7imZA>pO6a0>-YrCeqH`jHwKEY4)k-DS$`?YoI;dXvvQ@Py01%3%D)UBFCIqpy z3Qz`#k{!rewm~6IqF%XLgaw3WQm%UF8W1bc*|AQsGip16MAWcLb0{c+OpB*g(s<_8 zXcNc;uHRqk`{~jDh{T9qy!iTdFp5vNZjw%(oL^utrlGhUm%ru|j0Hi#83ig4GC*;X ziAbM)3<|>GSS{+(8D(n->)N(fQa>v3R8NL zkEg$lSM7k1##A!P%a8^in%;(?L*oo$Aeu&2zS64(d}q4O1PI0`hi{Y5Nc$Kc`d#{P z`!Mi6p@7>FKCz2L?0sB%{O!$?FHgR|idTUw&?g=+6r)aY;>A`c_n|-%2#Ps}kK42m zAiGX6pN4{F@#2N+y8{&L7X$@~kf5w$ERM{Gh$Su40`DIz8jbsS)sUY(Sm-FwfGsLVLf^%>tvvZ{E)5wTU2#<9n!0 zVh&1j&|%d}S1iPM5j^+<^iaHd7ojR_O+eF=g%)f)2>t;c^iUzSUIhO~-^_fcUuW{h zZ5qsXlbz|ZZDIG5?|W}{XVZSxw#FcTMmEZSvf93T)>1UJ2nC5wBNc;S6y&1XAKOvu zmu2Z6Sa|o*10)qUGpXj4QzmXy5fqjRKw+`)P5~4=6|@T3oz{|zAbs&M4@F#($_n8F zP7%g%8AdfKM6vtYW??0_(ypCL`n(>7Ih6)74dc^%0&W?ufHeaVkf8ea#3t(6&Cl_V z(1%k1iYxzw!j&J;!x#$b!YN{-D1b@70Se4EDy=*e@;c>1Ufq5uKR`tUMpBD#GK5l| znuW1gPVI$cw7`K(f>6*Pc_2)44eGf_nb;b?uIs9_f>VeM2CKL(A`}#m=)WCRIVhwT zI|Upfw2e?8x|L3J3MQKC?ja}e3LFW7;SbK7StRyrn{#r}UIh{+gNDJRAAMjVMne~9 zV3JAQ-V!1zduE5FoWa4xmXrUQ3;E89&CSj03KT8)#Aq}~pb$k+4Cxd~P9gi}pun6& zcnt#wtJ7Q7DVSykD(DnebI}763yuCsJhRpu7AYCrpazz<5;e~06sPr6l2HJHjt8RC z5I0nxsBVwTD#gKLWbhh6eeP@GOA5d3Wy zHl=W1Lv~Jg@-uGPH^&frbnd z_QN==Ut5jq-O6GCBoIAl6><5oHOfOFP9b7W0S@9$3`K8_3b#37!Wi55@Bxy1Nt(`H zD2`^c+41r5$>HJQ*H2cze?94fiL^3B8`UJ-x&rAS;2mv)$8{)BAd7E+NP~!jCgk_E zyA@Z+sCNf(PNAooEn&iHOAQ}AKoL6yJB4&2C_EPPP^?E#p!M;?MGtQk3KX;BuhZ$C zlK|nNxGzvpAwm-jqtzsCKg=80SycqbP6D{$Y7PO(n;LnDOB$kWJ0xyo7E@} zg@{nh83bYooPtzT@&*l>QBWAR@H+sCi>XegBG1HLfZ}JDmdooQ>YaM%u8Itk!a+>a ziX$1h1QfcfOsYP7MP&=8WbGGBpF!st_3Or5){}db22h=m3NAcha!ZJ zJwWm6Q8zyYAnz1r1ynRT1$}~I6oFF!kmX|sQ~cpTPT{Z?D#(R^u`OUYt9bW(=Ys&@ z_1ZCUJD7xsOsGylGO$AUh_ebxXM*VkjKWHZ9;Jt3>X{%E2*a|l3_%qVSO{FAbe;m1VN8TjY{&#MisJZj!_UM7 zxDYb_((n;ad{^ca0A%;sMf~$>oFZmI`Bs~t)s`w{T5bXb#I_+=JkJZD2)KCRv9w(6 zBBww@SAxRF4`?+E$vX8$ktFwctBBP4fr$vg`0GQv4X1bvLRG=&gA`^QXzU`NM90@U z#rj<|mQ_pGs8?pOqZt#RB9wDy&phw-j4}Z(%9)6r!m>;l1vTLm1yE3#bt;wU*CG)P zrZp(Of9F?2;_F|3{pA;$-u&T*C9xxh8*!mX6u)!hTr+}YQ{gp&eU(m8db74S2RKEw zkYv`YfC}WC&mew4G%C5QWFm5k*eIwCrw|1$l_Z@yCh{o-qp_Y;{QR?$@I7mfbbCjU zptZm&s3;kI#QUJeVBB7a1uykZVa{c4+N$4+6ZUGwmp4257}Vjz+XNK_gH zM~~nyVD6Xec6&$pm3D*!eo%o}5`a-1G2kav7c!z=x241>JezB`V6Mmr<}vG)B~5|A zC;rkZyXZT@;+c9PzyzSM=z#|InPoi9=Qk6Be04}FyIs-j{}77B}GTa zWLSkogc_Y5;}G?IWlmwgiXIq2GN%A(C~?b0*@P!iJ#>E`R}+U}t=e)L=sYZly7iljKqLg70z> zeg#k@>!Y}jckC264?opQo1WW!Uf^_4vsrDan@eCYBH92zx0;~J)UYv7J=tkF62Z%pA7tRxg0=7vroUg7UbfLFx& zx10hwL=hB9EAk+9ielaS5bNe!(`}J}Qtizw<=#~`oae-GQwysA4YoWH89$j;uET2| zArDcy0HcV9uD}P%vV?~prB>l%X=A6rwl#~fz(huCSMnc9Di0dED5|wi(SG{rr@#F2 zp_gC2b8(ewlPv{~sBJ_NsMz zW(94c`!ml7RiGi$XNfOp%MKe>2p@<5MYnY4-Gim=#pSb5E1*eEH>@Uw-iAmyeQvz=Ttu$h4ai zwG3|^wBqeAm6XO1BV%@vnce7lVWO!55uiky*ulav9I|0-G&GI>d}Ztv*%nSASdgrW zbv&95`EUO2M)UcAUhkyx8`f-65uFaRD9tN2AR=@M%`6Z`BAtv+2Pdlx;P!u1 zh;BR?j89L>W+qrjG4b108O3ueDBgUtpKO~^q>g(McHv_}kWZ*xNS)a!x(ClyPF9IX zK~4c4uoa9gL;%RUN^p8~t+d1{5IweViqfp&cs!m*Nuhjg_GU$#qO4P4Awx_2X1tW^ zrcYoLZxRtKGK=jK3hrfu1ib65w~<&VCbF%bV(!7Uw-3d}A*b+>f{Sq6X@`8v6plw@ zdnqxCqS=aOXyly&ghWo5hc=1Jg zu-sNw5u_B-lr8OY<3t~Z1?(V!dl(_Mz$tpYUWT~94eNbd5jCVXDI(w@3;ZRf;+_(( zU@$gGI^h%;nQCcFEFT}V;2H&406H9(F>*)Cgx3Y7K7NHb)EmY7Ld1*D(yDUVM!5v9 z?KDg&5Eyh7RLm|sC$>X2%^&1sJK$3hhN4Hxd{8J6LPw?G93dMCB1pi+Ht{6(3l`!@ z>-@ZhZ!1MZSDtieNz*a{z|ay|FUL=1+J>j}WJEHq{6=FXZ$JI?>rX$YBs@zJH1Ibe z>jfGtle7fEH%VN!t>Rs_lO&}-!HmI<=`(cqo-)zRe6NaS0E3Jc-G4}nG&4OnR_2|= z#~TbwbZly>Lc&v_{!t4?@HVwxI(hs_?)BpPolce_YCPH6ADqyh7L|iJ9~!XeQ211+ zHGh2GvVE{CL$O-shNQQM2{Hy`C_!f+FKi zCjw;ErnWn_P*cv~!y@AZn?_ZXTqO7==f(mTjnx`FCEaN$9~!*0mZR~E9{c+jqy3ZN zlI|Km9$w5&hm+-_gW<*L~oFBK2Pp7lVY%tt!T@06_>3B4MbT%GLCl{wDaq0rKhQmjL9UFf> zc>k@}Nl(A83?%N7m|#&Qa-hJA+t_e6Xr#KVi{08ofoUQ@p;Y+ZcZ@?&7$3$A$@wJ@ zh5AaEmcS?^{xB8z(v#-G2lJaiF-FhbzP1czQ+~|%hZCBcrsi*IvWnA zvjIba)6o_vCZ~X+$;X4&p?IH-;&mS`h>EjNmu?j!oUJ5kB=W#j&9?7u@Ibrj1y+24 zJ=nJ=J|Rw#Y41CQLm6QNsE|FjHauQ8)tJNGG`5-xTpLmO-&9a(~J53 z`Q&0Unv70PCXnYu?-39n+p;^gsVYn_FLK)@(0d%*oqj;Sy%u4p+cG6LWbrIhGb^zqROlL{tQ z2i6boiBUXq;H3Y#P&3FILbpmiLBm_cp;Up42~pAo71dK&+grzUQf~5diVmH*texdz zvFz+G=F9o962mXg;$$SQw8IYUGg!X4)+s37C=QM z@(&zL{05E|JvEs;wM?MxjN$_}3YK|7Q=<2%vNROrcEix2<2Kp3` z__I)j2h;L2(;f_kO5flvuR~8pmywXdaDae^VPRC|6>brOy%nZNv$;%mq~&zD*sTS% z7sKgb>nDp+M&bi93YJR~A)$lldg#uG3dX{8b=mF3NMrviG zJ&O!Jxjf7*Ufkuzg`VxL0eZy1==Gfm(J1tdRE95kw{SYOuS$IC`A-;G4yUsP{|PG+ z6;fg29uk+fS1Ob^h^zgJ*>t?EPx$*3-u>VM!a@fa*UZCVC^n0Tit9AOLWN-_Iu*TL zrEZghfZ`zM5B)=12n=DPcmDyatE(j!TtL|ByI4q2U==wo@WG^%i&)7vT3n1zX&QSs zn$S(av&Hrv;iP>11ES)Km#$b&h=|1@VQ-uB@19W5nb^t+}QiashT+H4pQJ_g60VSw0MSB#ujmhWI`o5OSW8Uct)9}^Wi`*5u|fD5jHMe>yzg+OuDceb#O zg8ynGq=t=y%DweYp@L&@J9dg#KIg=?oJ6M{DG_+tqNKtU8bv=xM>`FLw_@-O9ctY0 zZx{*0CSWq#Fmwb6sRb8*1U%TwDS*y4l+Ez>(A9y7o-pBF`GA@DR+zW~4ywp0%qV^% zB;Nb{vQJ_njEn**XhBD#-eNB{Ln!QLQ!TkBH+ajSK=cU59zi-mF@#SutKgyl3uMNC zBEFUf<;ZZ>32rq9iqAgbYkH&~5&E6AObJR7hQ0cd!UO_>^}R(2u!5h6VCG;FxW3I7 zkI5)VW)x}+EJxzDRHn8W#e1yR`himz759f!1loQ0@V^2Y$^}6oRD?{xyCS#f%4ud5 z#+ZdhK%q|z0*GG3gL?g*I7TddL7=Ru)Og=obfGo)f=PsZq#QV!C=d1mso;TC_oDML zPf3sPvsX}$q)fOE2njU`ns>leM>xc~Q3w>*X zR@hS}2ny~zmDXq~6qZ&5Gn;~fRH1l|OP&n(vqIF*N41<+fC^mkY4qt8>PH>P#=U5U z4r-{@2l`o`h;xzBuAbri4y3g@Mv?{uBEWPq+sh zoLgF<=Wx*1U}FUZAP58~M4+M~-Bgs1@`QsBaSlTXW+6Bz21l!Ffz$#O&4h0Q^h(2R zvlnckvbM4jKUGUaGc>B1AgNIZ6Cb%i&5R}Fz3SP`)q7XvGQO|n@2no69$i?lp^-TIpLp z-r;-K>1Npd!5+ttZPbGt>kBmso{XZ)TUF}!)hK>^gLPHdB}bkL-x0gU0!~p6MRoXq z{0tYJ+K=RrGa)qr6cHMXh4#K~M19rJEgbsUlG1f_d{ms3(?8Z?~U)6Q%>UO*9>%VGx z>}w(M-7jVoUyqFV3CDP|wKY+8{}qz9^w(oSu_Q1RfI|0bF|!YF>p zM)9?z7nCC=Jg}O4&yC{7p!ha!*JhQae@^a_37{APikZY^fTlqK7j_MULdmIETojE@ z7sx9$D4Z_rq7q!R@UVhY;He8_%v-GB(HsX9z@nmpQ(6+kUbQ=Y5Rp~h5jX&+-~A%} z_H~w=;zO7)K|~mZbou1T<>iyF?B2DsEJG4hFeYnZ;raHR)n1^OZ4glO)ispdlR!e7 zQ;|=(E=Qt3;aEV$HY{>U7ScpS;%R0vqC`a=>s*s&(XIwwk1(v!3}?~B#6cV7L@3Ty zMxno=dh@mG3%mlSD0=U^Fp5j*2lLjpmZQfs#-dh=#%d>x99m5uJD~`LQ;fg>M$gUG zr0PWY&oZFED%w=c-k%AIk!B4vO2!0Yc9AzmoX6hSh*l2e9F6lfgi9#Iy4(cz$kEvSuu*omsu|{ipB)8?i5K|6&RniVQ(t?DyJA+%Pmk0W2eBbU<^za zl6P&N&_Lhj6lkd_T4A$h7Ey6@vji-oD0cFuOd%#0CIcvF9NOl>F4y1s7e{z$Oc)lv ze*EH;)ur(;i#ONrKQks?853`|8^ux*6|UxDlh&lXt$JsB`aqe91!hrsj|I30Du7}c z0lhy+Tb%;UViOs~KNJrVZ_e9$=~7iFw!{MSNcxz+M?8J`n~1o%x%u_Y6W0%4t$mdd z3&!u=D1N=XlvjK{L)^rXm_PcApW%x}ZT z+uA5d*7sEYLBm139HbVHLL@ikbYB&WBagbB&2Su;o;vzO0MQ2wE6am80wp_Htp};FzV5qDF8ejttvEiu1 zh$Cj9g9L7?bGLqK`L@`NLYprdUjBCD5*4OzKbx6JI1LI?7{$%wtj~2jK>?2#Yi&pl zTvHIb>d-x*ka~XpQlknBEHTGdIYvBO!ZM)P@kXwIVNr>5p?p92ldYf#B8LLe5SW5Q zXjZ-%_VC%QtRn02<&(>-pS}_jg2AK7jp9#Z;?0@ea42?v^9mbF1+Z{T_G7~w!ea^h$vf|(@H4Kr08w=M z^7YNla|K~xdh@w|{<3>e8O3e6fm@Y^vG4^&!hWse>fY1GqIZ)J5~tT^3(l4|i~`|% zP*GxZ+3PDddjg@r3YijwpCfjX+d%I*RqV?{T$2P8njA0+E6OY~6q2YgefwGPFg6O) zXTxqPlHYBFFRW6kL+u~*st?_F`mimXot<8oz>|wZ)_aN2Op)o(&2y(uM24V4iI?`V zj5aXrJ5(S66ruoO7SByG3tvpW^v`IkHR(*s5J~BCFAZU*1Ci8FTwTEJwDKi#C6SbS<+mJ+4lsms&N!Y;l&9Tv)YZN85Z z*5P@2KUpnoBcisu6zEY?*sR53+4y47&Em?iFuk_nUtkoEvR-o^p`t<}-{RqZ1Qco3 zRyY41Afzv)c>@Rw#VC?u+GKuw#*OJ?KP*5ZNbqO@9PSng&RD>!d7x>bID>@BES^hO zSI-|g6~Er5!B-TfN2ZrU$b2AeT1@nP?C*wq(K{MMhhjP7ZBr>Ko}5900U>?bf}&IG z?4na~3aFqI<~R71%7V42RF%O(4N-_CsE-?n5D)xsD%{7JYkLGpX#23G*-U03B(5Bb zJX!p9ty>UA@yd-N4I`xri9DMtQRupbKZNLxpy;~%Q_`|h<|BO{JOIR}pMLppKJPXm zVH$erNC*^p(V&Q;qb}K6lTR;OsYnr`rsyR)MDEjjK|-ZA721gzu#>%U>{6+=@(Ls5biY8@8otm2ZYd0EiuEGqJ+W#P`$UJkDr0K0=>5%mNg19bd;XSEF_tQ z>E`yrjp7dx@$~6U3dfD4AA$;y=oBm;LDAhY6g^NN5djcRgquW%V8P^9+bO24IttW5 ze4|tBLq>v+9B5@E8MyZwPddc3JJe1^vI1g}w;41P9*}0v?&9_;%)<5BUtC>1&AP>N zrP0kCI!7YFP((YJ=o-~F6g^Nt#E(t_JY+rmpzlykM5tS&t?Gaxm}odff($Rvv3h(% z5K*@`#6j(SJH($2#8*D>P^t>bk}V#ey}G(OS9mIOkUd=ek&VKbcz)sQvf6f!hGG&! zBv14Nz03nxH{6O;Ni`gH+?WDt;eLwrKJ{yjr+E-Z|Sr+;7+BP0~V zDjW$!50`^bip4wNByU!dB5fS11DQSw5f6g`^ofXgIO(~ZVT7n(I&4`$*vlGo8y+5hnKYMj}85CU0+hg`)ZESMYw)UjhoJJd!0fY_Dd zU8}MH1P-E_R&k+_GuE5Kc%W%xpfMI~fiQB700~BF4^b8=hxliy@Q4!+j>F8#C$pph z^~Y+O&Ek*q7X^#+9M69*<_;5C;ld$CK;cdW6fu1y5g`H`3EKjXhx5s#N1)MppgQ0a z+ti1!3WUZ^p^C*yX~YYwPR!m4j3_-29iRwA*t38^I$5h)x?xfNVxUmqKop-iITI98 z4CTdbHj5XAMULl6uQLwFSM950@ThQaIN%hWLGj>|pMU=Olb^vNXAkC6jUrGC3OGY8 zIbAAJk$^hjG8q=r9FsW)LQVyLaau~HVUrP1!Bl9&3M}9{Y~H#uCAh-GQXzGaRhYU0 zMGnS-9HLZC{3B&ZW+A6|VOUr^f8DKV%_Iiy^F0cum?j}1D3F;%k_3f*(mS|5s^(I zpqLmIid)si;46AYfD9lqTQtQdrWy$r93wa!2?m7HkyF7c!^a*sp_2CzqR|N&*hwfT zDx`?8Sdb7Df*?oBESP|z<6+2V@d7MfO}knkfx7z=PT|wX@_``{R6O`#o{CPOVH+4j zF$WOXW)vWiH5C>h(b5V5CK1K8QdE+n4W|2o1uI%}R1rI(RKJLbgdYZwssKey71~Bx z;uMM@nZ+Lkix;;#L9LZHcW%u?ZkykyRp1n9?na@AN#GR6Hkf7eOfl*j)u~Z1vWVQ4 ztR9=n9aNc#B8;Mqgej@yv1E#@M!g+>_h&qw{?UsvvLW}8JYi$~;^&RC2bTOeSLaa7 zFbd%zMuG{0LSak=X7TExtK|LE9g{E|6z@?$k$nF6=mA6kh15&OC4mf)%jl1t0wFu3 zZG(fN6q%AWO;=f}iD7)0Yk0&NW9mu45*582Cx}DiEKN)kHUA9^0g+JoL^@e^I0cWy z#k1SnXVP_tP@f~ytsQpnYl^Nwk*z}0#tI4KJ>$vlqv&tTrjk>jf^Aj{B2pDIUtuna z4Gk29g~gppjV6dm!3@Tt4Qm)B9K2&LbAiMP3Y2L`ip#Y%1)7?=jhg#Sm*UuaHwv8M zIFIDRFo{|?fe$+nl)*w4mIfpNp1_UGrD8)vle)?-$+E-xQ59=^kmQ>3cz3$md z(R+Mge~(xI#UzFu0w_$WBzBdNr&PrnmdUYwkO7K=#Or*r;c!idyHi{X>bu}Uq2vfC z_WAw8mdDBsv5yRGukP6wrx*`81#fk8fDx7O0t@3fwu=b;#8lQK-N71SQz}_`AMcnp z8_?lhR+lvX4ofVUHAKh}5h*Zv&Vs8L;@koc8>8~%IO4AsOWpAfJ7;pu08a-pJAUbs{V6Ts3K@+>?3a; z8cuO6C`^D5G%#6sLLQZ7s5H09qoU&OG;9z^blcF_YB-%8M|F$xl3frWDp`48=sY4gm!SD5*^#t#H^=b6Ze26vySBfcjm-fp@GP z>FId7@q(JWs7%#E)%wtBI8nD#@kz7bV4+gaqN*vz@ZV9MKC;~E0f0q>SBPWV*lHB> z65J;O3T_IpJ0Wks>}CH}`3JE75CKxxf?}i*9HTf_3J^Q(f#T%dV`;(!GTC@(Z#5ac zDYfJ_+__y&`W!s|*8~(}43KJwj}uB;D3D_n@`(`?iU?NUW-fZ(1Fi`JP4NOR?!tVM zW5HwI|3~!B#1$M&t8Xu=*@AL|29Ti5e1hqN?@-YH0Si-CAu*x@DtsnYlIi%*5HW%x zW(^jbwpC033IMDd16V|xd;%!23T^W?7jGRKeP|;Qd{11cKyfoHujv@IvX?fr`%r{8 zwV*hTp-yBtMP(8&Q5c{^rC?!9yeq4K341tp`=xR5);LFBG=BM8NC+P`bz>xgi@9Pf zGbl{#KE?1lHqk11g&6txP|1oV_%4HmL%r2|0)-DcL{Mr7ORzwRnjbZj5}iTAN~wvvZ`L5lhaY5lnt4G~^Lq@lyX?J5)@ow|`P17AjEf8!qls zJmEBkyuB9P!hr}tHaa$#>fI^i?tA{fPo$Or3Q)$dXs z)xX;}m+a_iAPV;id=BT}iAH$XBexkjtbm0uWhv~LTMy;KRus289SD#sSt>pJtj{H< z`S~G(tZDzI5iI=2yuR$uLXJuW3AeNkj^uK4obe%)ma0vlpyIRRj0}&*|Cr%t)>FSd#@+GI5NtG9 zbhV2VfPsgb_`!7Gpbxb6v)Gm8<5AtVfMg}xe*+wWO6Jkq9Wb^<(|W z?PLuPM3Ts9-kO;5scJ3&ATm_60*QEJW*8PcAP*b=yadH6Du&xVNFaE?M1h2diI$3E z!GntAynaG!bCVDfrlhiF6^|=^7TDz`#aVB80r>}1)w)7O@3~=Xzcs@tXxPKLdQ$$I zb+I_nfdZOQd@LME^pE3^T2b-4d{6|96ssWXX@&^gc-uOaMYR|H`TKp7RcQNbFs^6a z>S|upjot_ew>xybmRGIl8ZQ!LplcMLq00&s4b@o$4BqP8q~Cnx{FZ=;;r0HcE%}Fc z*39ir%>Z$uqk8M=1NKg52vK3=_~wa5Omm-KIZ~dT3JZw_FC@WVM8zpxZ$DkjIF>zlq;>Sf#2A6+Y9rf0_~k`sr}7AuhPOOm4I zhN5Cy?}6gSMBtSJOUmew3_Yr~jKf&QG7s}B5_wnfF6E_Xk-n8lFi5*5%k0nX;!d7{ z8(}hp8#$V)+QSL3@)BNII8?C|nx@IAxRNkCDHf4woTRZ#N(~#111Cdz%-SFZS@S2` zq5&R9Pz*|}6)G&>sjCHComS2tO>+=24iPO%K^ZDUDVM&ghswt5>y{2e#S>z%>3US9 zb0*wSYMQFOq+xYgmStLu2&D;kFEvVNlI2aZf!eEb>S*z!-leN;QK-y^TU5B>m((m( zcc5@8e!RV-?cnQsWIisU!8Odqi0~lc9iORc)zwku3I6 z;Zr3%;b5#S85a$jhsN{KF0IZ&{X zdCEQXSnS1mO~ngIwYjf8Vm!%IuS#x8wQ|!ZBbqrfl_lJ9s5rl0Lm2l;`@T%`bdQ## zp*GE^$n=6sP~rLu5M>)FiUZ-!3=hkUG{~0kt;>7Wl99=sKTJN2wEBJ?KnjYuax;4XAg0FXlrt*_>R@{89A>cMMy6AGi9*%#h`@pr`9MiU+)7wV zlHZ*&QY@}itefv|ppYy^*p?2inMN8j6F>okRy&G#@NX>@XIvju3%C2oiZrYa_qkDh zUwu8jx|laQr^sM5uz(}$aZ|k?(+g?&7#5k8Fixr@<7MX!ekj`@kx-ODGh*S0coA&m z=OPZz+Ir~(oUt+!*P$F-nCazxP@pNqs3Y+jd;E_oYfsWK3CnvuG}C>= ziif2G5GSZlqk%^@V60X3)6-6nsZX2JffG=E%4ean z7a^9DSO7+Y#FP~oA>vo^upy%lL}_sFx@LW&8*0%8OKV~o~31_u^l zGKLiAVw&T`f+JRpp?pjbk~q`~I9g1UN%S+)NpE&GDrX|a`6UD(sCJNbkl=bTO&MM@ z!^8#(0*2d{AVRq>81du5h>{Ut{f3F`R|m@8YxVRc)Mp}>9TiJ$+f6aygaBj7-zQXC z5v5Yr)rZNbYf%=q(>5(}4<0jlnTmQB-g)J9Afcf8{E6 zR{DFjU_QjuIu#WSUE3f&PqS;e-mPRLaw?88O{#Us(Tq3?4=rQDf%3gpjf@K4fPx?) zW864?&W{JaJ9mV5ps0S`dOFXJqHn03O%RDOD>y_mbJ*1D>cyR|zS@@7=gZKLALCbl zX=+@5LdCEsb1dAW7ls9apw&RVvBI^=xE(mEabY-iVRE={_QPd=k$9StqgLo+|P|>SFb{=%+(tdT^-FBcJ6T=lxkhxe?%M z>shsr`)E1Xl{S0U^23g12hov=dD77Ih zr)188$m&)H_}xQp9)3Xz4<(OH)d|3;N}9if2m%iwqE_;t%^*bQ-qE)4&n{N>UWJeR3^cC}Ti{lU6)lJYC;Ve1eKA!bHY-Ljo#ZUS1R~ihiOh zDK(V%;Zd7+?mAX0e0S5RRL19H@eRe3rO+@G6?6U*B;Q<<@qnC*Wihu;!a-R@Cd-o> zsxv9q6o+vvaupe#tc2q5xJ;r+b?034gk8UmM(RmZ}F-gNp!mfE#cfub9eYB&0^U55d< z0Z0DcuC?flw!2oyh&M5>Ht=hm*!E-AibBFhyQf#6!HF>2TzC%_Eh4{>y$Kb3Z{GR% z(Sg$iMPD5B-=+pX6}HjW8O&yizB7+tMnc2L0Ev#w*V>L0)0FFeQ1J`_#eY=Co*X{s zJ(%aA@}MjrY2cx z6O*NvIikg+1P^W?)`+xRY12`Z=Wi(fH8Lc$Wwn*BBmnTvRN>(eW?fqpe$|`mX$oxFdT{PXYWaW1M+Q*>8=!sn!W8pou>+xCV<6Xzc z&#HXSS@HU@-l2m3xy1}jHRzd>3ApIojbFXe-JZMr@~v;}bou!U>DMSQDSp-F$+Ozg z@~Ul1(R#Nn9kov#ue~0wH%jgYQw8_`HT0#Rh^NBC+O{#?Xv54=``5OubkIIJ{_*wo e@8|2lQ1vG(gBQr1xX^F_0000fEJhFZUu_FdkPdvgB6$JZh_)bw79#wI}|67 zgq!}(Ip2M6d}F+K?;G#WyT@4BN!DCz&bii{Yfszvv-b;tF96(!4{;u1_>b{PpFAPud`&H0nu5w zG!hl<#HwR|Xt_+B10Ug$yd)(fr=w?JWMby#;pO8O5PbhZQc7AzR!&V_LsLszN7vNs zlevYZm9>kjo4bdnmv_*Y;E=DO-=HzEaq$U>Ny#bMIk|cH1%*Y$l~vU>wRQCkjlVlO zySjUN`})TxCa0!nX6NSD);Bh{ws&^-_D|2wFD|dHZ{W8W0L*`}gZ}&%L;n|ko}u}9 zfQ5yLh4Ysmj0Ya*hWQK&`!&bI=i(|jADv#j;S9hfl8DZ#Xn#b*rTT~1#CZ&lgqC}a z?({E9|8Vrb#!%q@CyxG$q5tCNejb32iGkiQ%x3@)V9zoex+nU9F&hf_Kkfgl!GDv1 zJdL-GnX$XrMnN*^`Y+#b?0WHVrkeiZ&G}lQGoNa2F{XEF`Lldwac3n!Q%j-F5R2&s zx|6{C*mOKZ-q7fU%+_vM$>Gy`zz8ky4|zoCYY`Lh-FD*ijHy;MICt0_y5z@;nXwdb zv0fyfPYj|#VQKWdz-buKV(5IYQIsJmOUo(cIB+xR)@ZdK#p@VHm0$WB%9t;sB1r`J zS9`r{`P9sUj4bDs+bchtmWqmr<7(V-(i|pQPu55e)7Z-)GfyQUS=N);?500T#wG_7 z0BVrn(4_qP@kkw2O{=}BD}fYdo8KX~F66-mI{+u;shp8i0osjO^jeq&6RC({|L-*Y zs)^0U*DZ(sEv<4fzuN{s#00+hc?rA8!OO%qX<#uC@S9CvHj2NKJYun%Eqz@xVV9dC zCG#;tUO3X}vrw#|-8y@C!qu_yDC>t!$iPtBYw(yS!)ecW<2``XQ|h2=$jW*?x_ZK7 zpg+3IP-}y_4I{&_nduhXVf5Ha1(0Iq!Re8(`$!w*OW3AG;W3o~mgC;*?xWT-J&o#= zg}l(ugLTriStd~BhF@S&*PJ*#d&~3+>mgt@Qc@+Tqmid+;H{uWjLcW&1N+RNLnqy& z+}~=dbJ|fBR7|DuJls$T{)|vVhK4`+UlKJF4&F}4z0vyqJo=B4l4z<{f*!(nM%B@t zrm{XtxFA7&V>YPgz(~wsZedyMkA4T`XnhAQloZ%DBLWKam+P5{``Wy&c_G%0UG1Ry!eQq~w@S~Bwj5`?AwqABE#d5O8u`8-@0QZ$eAg(@ zNacq7fYr2750~U3$Kb6soh53|)>%^BeEo#PdEN1%qH5CLts#2IEAp9KJ`Q5Soe!#q+_3%1hEjW5>%`u}D4kS5b~O zc)v|Crp*$T`JNd)4E_{${B9R6o^!#PSK|Arl z@?3M=9qAT$$w5Vvd&%6US@Fx4cbN9894W0u(pO2f<*W#h?(z%aCU$PGYlKtUaLvpK&mTr%us6da(8Pzbmj-SYF>8s7u9gwXlQqD#Ohad z_Up0|T8Dt8er*5vMU%cyfop2ztPn{9_?P z#cq%4S@b;s*Bs@!9}vj`Q6{NV+A#v!J@kjqgg8)E?L1SABmyRS?sYLs_a40lG#uP9HA06qz#3 z^L4E+M+}xqh30Owz^a8l=5RN7ybRJtUiOqaww$Im**i9_-L+jy+534Z1~6VeOzK;{ zVM}x1?{U47B2C6Os>6q#$}F7oBBr`-$u4<&ou70@c?NT4Y@Sp^T?YY`s|Wa{noC74 zDjg;c={OcXh#tnWKcVqH640Q6#_mOa+j*tY&BRhkN52&Pefh=srqFR2kHE@Q&7<#- z6^_dCJ!u3@iZ4feO;hvN3BL~T2(o$+@`m}YAFNw?=CWMW=S~xSEpX6VW=o}dBh`CU zD->EUEfRpW1+JqRP03;CU7ng$Flh*0OXrDUApK-7PCO9jnVT}Ms+0MOB?E5x#TSNX zzgAQ85w-l1SuFY6dNnV+B4pYxg`2 zOMy_vVt(|KE%U+uQ>%vAnbd_E7?@IN5MCD7MwbjU-$XoAvPnDzLCLl(UkUVJrpNb% zmN>XGw8nnwuRFobPSXYo%0uht^0 z!>aX{41aRI>*i{s`g}zcR-(JeJKMW4I^HmY&jNX7KXz1VH@)27&*G`>7|o~*V(yRtFesyFgs7D)-L_ZStxu53oq@sO<2Rr?NwMT^hX*LpuZ(+tOfeq+(e1Q-Rr$WR`8Qhcj|Lk^9hS5p zpesZHDe}(naHr(Ul})m(huUz(<(|r>C@E!-kpM#|LaoS}g~Hn7OyTHrphN>mJizcC zkSlseM?`vWr8)kPaaf3J*J zS8j!4oez}BGo2x9UnlAZsnoc7K6iwAe_SR`UuEbNI|Nb=(I)+>id)*z6#4b66drjI zX1=i;Y=TISH)I@0O$Q*Ydr3)&YZ&WFgqu1@Gt(IDS&38(a01b~m-$hWNEzc_ZBvcr z2#bJAO@L9dU++!PM7(UFq(Mcs`ih0X-3AJN4>%aRazUQLA(scSckiDdda{sF5h(Bg zqSvy>Hwbxp5AeMQT<)F`Uf%;w=Rwu)?g4}BhrSMH{zlu9lFC!AVF!C}c;~;@O6qgM zKO74jbP!BQu|L^A)ql@8qlLSc>>C3A>NGHp8tb?Ra5Oo;Rg0LfICubEuK{ZCACekUt17f{ zk=jy+CD_+jQaQA0ePI-Rd>?jlIn#^5#y!y)>$DyZ>V!AaYr;5tgxT?n%PER9HOcS^ zm94`~)h2jhKVVzg;a+@fAE2PQ*iY z#oF{01^PN%cAQyaVABKr$cR-DsS&k6n@;r*GR*3L_9u1Gkw_!y^l;L^SD zq>JR3oo>lNMyf{zE?Uf^Wo@USzoF~gLPclTj=-cHCBFwWb zd22~52EYdhY4O;Vx8oh!*c>grs~ub^#PYAWxpv%?QfUnUQ6r}k^e?6_JXUqCpPSER1R8LCG9H*q3kZEzl*p2(vcVVnl zQx=1x+-(_?H2>=-H_-DX5#NUBuj9X{m^bWGGXrH9$Zn@5%JH;Zys6oo0*gXbu9%N^ z#EY#n=ASd8ZTPvzNM!$|gAwQmWJuoa?S0z>#%RaE@4{O$qFqN6SMfOt^3GRpMt z;exnBv<@af!;T)Gz}2D77_cG}rl}jMVOuGJ7V_azJ15I*=tr} z(>4vmQ~aG|nMt76C6=5mIyER5V^e-gDyvKcE&P>U>0u1 zoAcZSql9hZ>qd{u9&UwM-vhkCi5CY3?y-+5Ya$nangkV6U#b+5941H7-4(p2Kvd5G zQ@#PW@_%Vm;W?;y+>HXKbB2f_Tii@09flOf*Sx3b=yNUBQv{0TwyDc)_g>f6om|JR zOjl5-eCqFOmN~R3P7NgR)})>Oz9_^fypyN={sm(R8G9kabHMiKmuNtqad04 zj9sMV);)chd0HG5#$530_jNl*Zp=75plG!g>C- zU3##2Sj48hWwbg?PKEV2&B5tS+2}Z%40XJ+r+i0dAh+H-@m?Wjk^C2Mqh)sq(wfIg za;T6Z2<8MI6Al;5{X=IIE2zFT-l(P>LUT6^GDXuk(u-XAgUct2Y=@6E8vTWw z%~&+*kNAe{LKI#l0XHF@&5<_u01(YJq>XWLKCI?}WqW(?>(Fc#nbmga@;g88jN!5) z@NrasIKws07IswuHRn*2-2*((IGJaq9~@j`~^0E z&s2%$PqfDu-A@vcri0C;>l?fJP(vJ^*S^rckkzR8O5AwF7({zxYkeVq=+An)%TIawWq-MLHR)@I4u{agHz$Wzqf z$EZDM*d5D|vAqL*9O0_+Gw=*0swP*On~^O4C2l5^^mh+=ab$oL)7Bp*vijn2QAR+5 z_>fwRxMG5XcLDA41ysScQiI7XTgUsdSask;@s$e|?UccLMb6Hkx1AU&RnM(2gR2WA zXVpF{O+;R7(P6t=3@};N@n}ict3TfUAVzwk=tpk#kn(rOBDv_2Q`F_xGom#g5aI&# zz0AlaxEZ~15;-Xl^mcU0uU(yEa!6ndFZB@n9C}b!pv*I0#!^=Td)21Tl)Y@DGP5-t zW0u)ZfE7caolXCBql!iE9{AXmP{2Jv_#VI|$6&&hF{%n5_KE6M_fY_zaWo2)BM?!G ze20m^i;;7luys}|UmoJ7MBbx!Y0&bxjzAF?y%rnqs9p^rr09V9v#>kuGAyroTKx^~ zGzFkc<(}$bT%w3f&8}0=y5x7Xb!@%_S&>Ka%+12!ASITrjq?Hd--hS{MT@R8Afi}JF0f+vs zCp^uquccGwj^KFZHbE#U7az(Ql)v;bxgEo0)OpE1Zy|MHkykmoyD>F8Lz!i?O)hNv zO0Fk3?fpw?aA}{&(Z@+u6~nXGb*@;Cc^`+wQstJn;W&XoR{1 zPrZ0CL~oUQE~DEbhJ593#ijW7Cka(!tnh@3Yzh{LJ2^k$L5ksb!XdJJhpQY&4GG3Y zM#Q_;@mMcz?MFl;#(+MN&#)uV2h8XCw&pY}Pn||?rqT%IpNiFSR>BYYA95~8U-0BH z)AM14uWlyY05Q15<2$CIkuy$JWiAg=iSTuz>mpH1grUKs^ z#>Yn!9L=ir2yom5Eo!}9k6{1!(y5y$_HHPrwH$s~wnN3u0X9&`s~_=(WL%cI&}8l8 ziP-xoiswaqWRO|5L_5Awl%nw!IliMjKi-V!}bnQDS#b*g8N*xt%V>TxR`U=l*=u5&z1l1^M zUVB;`iUe~L(ABzz7t)%gBTHc8p-;XUNt7MDV& z#Tc}eMRgCDBi5v?@XPOEgTu_C+_|=j4i2DQw2=hj*JZ=Ajrp6}Yfq*&1xzo|4#YHd ztC^{jdyMoe)337}BV{aKpNZ?GGiZ>nd`h-lRL`nkFMfDkglST*D>xv_HW4{x>Ml(z z?I$YW{s&CVieHz)rLfdR(OiV@Z{?xxQ{|^0Aw#u=X!|jx;*0+0oj=s9k`<}Ku;8{HIRr(QQ7Ld2PiU6 zTQ%eyprtay5>#mo8G%!R!|a7MYzoC1DYe+`O$I~w-$%?{m-+64o=GEq8Ew#@3|=Bw zrmAG?Z&SX8N8AHKBKtjMrSRBtJ~=&JwHO+i{{DMuFe6QyK34P+V)PYpCr#1+cjBjB zifDWwLE)SOh8?x-@UhDq$VfGCjt8`ZXgO<*^D{&2Pi4%p(&-IJm`6_2lZ_0TIjl*l z^wC}s4Ne?#kNLpfdx1u%vi-LR#cA9e$^e-AHoE-vQ;F4Sig+^7sQOtxO_3!J^gj#$S!7%M2Km z$K5$4EsD`gwXmz&$)Cf6yt4tBL}=0*sBD9{?E>+lXT#O^oG#1XCl5TJn@H>NwSye! zoatJg5iZZdX{NHwP#SDu$41jy>ds;OJ!(pPm_YBwm!lWoTBnqrMTu2LZF&_~-e|po zYnefsl8an(L3R&KxR=*6V;ote4mvy>%hrSy9`!hBNCnXV(^p-PQ}l^d-rIky^$ zot3&9*$?$dL(lCW3Ds^mk}=dx2RY=l>2rI{77sP+eO4Ovx*plIj%RvtwCY@TbJs)E zR`(oISex=5)laEqPCdT7`r+;L+uAW2Mh(+n4ptgn6ZX=)N`8{j%YmI)R%-scgx8Q{*bmU7C0g;vJ>-!asXo)2=Z1aQn@(Mf9+EyD zD&ZCpxwqjKr$yw8u$`oHmRAyh_}dDBU1!f?^>MC*Hwq-&)^L^;q$s+;cXos~sp@5bhE`j}V4pR*tgXeyNFB`_# zsHfMYB!c1~CW7Q0X}k`!hm1eRdrk@O?(P9Ic_e}k=D_Q#pT;eMUzps-aMM*1!y%7d zY0e*(=4c6@s)X4@lS#i#jYl@MoEshLLeRixQ9oyWAS?ZYPgEZ;i~a(_ub`;DBDATq zb)E8NdeD*L9`HtsX9IW?CRv4QlU@Ajz&D^mFKAjWH#wvY)eonx;p~QPfJBJ$Q1wZVu={pK{a8wTIP?y8y!L^c zM!XKY1f+5S;&~5ParKK?xEn(2$|PA1kCB1V`4Rf5I7f_D+iyd8WdaPqlc|b{$oM31 zzkhswGy37Dso@19Y9@Rv_*q`&dh)e= zP1{6ccVH|{nAHUx35rP0J#Pq z_bP^jt6sSrcFa$pK3&J!=dNgcYN-hb9P+?23;%qE&2U~ASyZrrk|1flhFfkXn#5&K z9UHRC7-pZV-L1zCflr|R{eH=!;~D4dO^IGPPCSGut;2Yjpu);DmnZ zL{E@ri-Muq1?7zH(Tt3CEk4W)T5kLq9g|+zT_eN4J2pNTuyH$uJsvkq=Y?x#-0o-H z$$8?p`A5(^thbELb2}gi3&eQ~z0ll#^6NL`ZQ{CJw;R{cmp}rMG5z!MIL(%0R*MZ74zwCg`)OU9zh{Q zGLLpc!8a;rk)3z3Dnh0=TBo^h`en>Mexu{R0zjB`vN;EngfV)FHF*b|T@G>NnyC=( zwa=eqwm3g3Ek-a%0XNv^JD=i3sq%jgzbZ~3pI=m}5DZ=F%&0q>($ z9qu+Kx;Liu&UiAa5>3H2V0hxP5|DfKrci2a7Ny>2|1roRgWHMZuEi94WJmV5K}d1? z;aC=B`;CazT?xaTT(8U3g2UZy>xR}woJ>GKFU_mSkb=2^pU7O2!wfgJ{V0zbiYPdd zkAVBjn!oZ&J#?0l1#{ce4(}{Fm>92Z?=3fC36s+@h)P(O?KT{VUxAD=S!Or8`nJUt z|5~tj>b7DUb7BG=W^A*NpE(sUv5xco{>{Vk`}tfodmI-!R4NB%gg`C|w!>%8`fq6h zO1gs_D!e@NXGe5$}*(CN&gwDWCM!VIzUOfZaJEQ3j z&opB2_Zs$|e&I_WS_E9cya!-N-^^qkQ&&3>6H*!cT097O7)~=loEa$02#CbVV;k{S zoD6P>hs={kZ3{pu9F6*JD%>G8;-o;Ii+p?P>fl1uSSRFN>pwlM=fInBocZ>EP4!Pj zc}2p09yy;n7=Nq9#L<{H&5h66Hr80yt%a^mF|n6l1b#TJl1`_R^1LRN>MOwNvu|sJ zV4#>sjh?ohR;w{`65zdSC*Bn=l9VNoPuPpg&`7veH7Kd&QQ)8f#7OTf*NlaV2L+^h zYqFM}F77`k{fP0B>YeZg%27V-MMzasNbBQKlo;f4zZ4d!WhJ^1)elSi zjQCZx*FGfqHqZaUCiVzA+8ep7@J(tI7n7epjk1&Yd7-2&*ZA{Qz!4PiRTUkcazb62fDxbwJ8PrU zW6*M`)elm*`0XebrT`GeC^akw(pNU~|9o+ge@we0AW|hp@Tm=+EOyPEB^G+tld-0& zAb^P{J!+DOZ6Xv&;F2Q7Hz05a%TNnYU~GP5lyBt};~uC;f!j+>C4s zP`4EsY(KqbZ|~mgMb9-X!f6ewO%yG09l$CM1SQpSjaUy&tb3x4bBfAEKbbVbVc;hx+J4ThE}%pG7k9ug9#HKsQd|)F zfVwQ&&>qo_LSE`9U=n&8n-Dw!>X#$hkzs)-Fxuftu0ocAcF+mvmXg#{&Bzu;-rPmM zjKj6B94EsvqB-MbAq62DFoy85+e9$aZ?!~j)AADji9g$%ga}0`T(r6Dfa-64*uSf* zy|7^XGlVCcPhr)RzgTRdPF1^qz}!lYtwVF%iRU>|@5a%O=^kKv4=_WyeWyf+T=w4C zQvk*;_t7Z`(|?hZIJAl>q^L{$ePLc8)+`;cdXS1lwnBC0P z{ya6q_a4v)$>R-=juF8vWs&SpjX87(PW@>3JfSaZp*}x>dn98F!X@K7B8fQIZml{6 z_4}<{b>pD?**l%+BPM@W-UBM&DT*=Z+wB-K;~Po^O`I`gXJ-fXzK}W2rmgAV|5_uWA^1^OPR#34Acrj&dh}U?>pukb@)sw8 zYBQ!mgVXsx>_;qj_bEeq&xXmookeU)2ql_D=&QLBgdXe6$DObzX?L#U3Xf(XDt=+M z`eR!cF=svy8-C}B#MWfHx)V28QIV^IIwiGT8)AEhZp1cN2uTYVl>;;LH|u)!+IVPsG8CS;|-)SuQlxzDQ3Wll;a#` z-S}rpXOHJ*B5+#_xLVx{G7y_fw?N?;SWFOoy07vjIOjF&O1`3DTaf9yRcCv2iLmao zz`W5~&U99Cd4*sEgy^MlcH2z4ExcZ+@s9GH;d3e*5imA0ezZ9aTXX^AbyFd78So@s zu2qugEm0pZemcyi%khgn`;O2>CQ`c15s(;* zjHMP$=^vC-{lVJ4k_U8joGg+&aI;8=OPJh|2XaTSf%55qlN%k%N5M}BH*J7L(A< ze9WE{0{ePd=F^!H=4mc(mH@2w+8@NXi>T*6xy)K)fiNi#y^E(Cc(jBVGMM}o;Z)G0 z@)>+(+e8T8WofLNC}U&IN)@)I6R4rX8*+;9A@$n!TS!$EOz}jqH~k=z{Fja z{Z9>^#t-=b{2#iU`%3}FlZCp|~V(Y{DI|gTC;*6#fMHTFlEhdgbd3(uYLeuTebWQ1BqdTE$)Ajs49cXjar+qo;^y=+uHDIp7cqJ|n{Znye&P zD-_Vh=JL|NRab0jdfr@gm2lgdB5cCCA=)_D?^6=t`1iv;UJjrKQ1@eK!e)TB7By@2 z=cf*t=IDS6N0omw3-w8NSJh_nVmeo+=|!fdkQz0Ps^5@{$IsZper0-jQ%5qMetpjv zl*@Izv@N33-wpCR+R!@vRfv_rR>tP@-shthS}39e!jE7;OcVBwRa``AaE#{Qi4 z;Mb@HrDhr(@fcBzs9}wc#*fs-Fj+~W!7j8+eHPS8_mvmB_O|!=a1XeBTK=AAXXRP9 z13JKHnQ;%0AWl<^Tx`8L*miv0nau~6es6eG5N?$agi0zv1+sMH0~;aN;IndT8>Cd35}p}kO%wDxRAr{Q0t(^bZFL~0vR9)le$3(FNSU2fwY8ed*=&lG5y z$ZS7zPa^PIdP_zXgpRp4og8@^^^Z6p^~wx|$t z>yDzL2G`U4M=#J~e!S6@+k*^3l+2g8E>P5J)z``DNMU>&)zJEL70t{kTkyNT1M8WN zJa_)m;fP^~mTDT^!|C88CF3Y$JEB<5BLVs#plz2!M#Ts725;uhF!8La&sV_U*LiuT z93w~6RV%Y_1!`qW`l^|I%j6!Qd4TqN5E4*cAi75)y#Y~(n#n_yLiV>HJ4T_^sUaw;1m4W;42+=U$?JA};KUUh!hIWdt?|r=$Ez$?J>J`Nn&H!v`T1qeCQNeS zaJ_~V;5WcI!`H*vJJ3DARJFY81?g|g!kkfkO2{tHj)d)Hfjtc0D|z>YuZovC(^$?c zm%*KTz_;S4Q~K4Qtv!;GOJ_)C8GVW(h6^lqow~T=+5BwJF%84*)T1Vc@_z8Gb+-u3 zH|dKq$5!sGZ$Hu}@eW7pPf5xhIoR@C+pctQfqBXfqMD1nhkkl6YpYvGGWC}JPk#F9 zjWL6kYvLibXZ=T}<5>Y$-&Gx4Vq*uR5+tyt=orFh^t`gO=NlZ9Sd!8gKim-Kk*DtO z@G^g`NQ<_S`*&_3_Qre+ zh&m2J@r)x|HtzuxlfriVvL%$B;U&+$L7ie`b}h>wN7tA)n}}e>Nj6Y3!zLqYykIW1 z^{-S&A&CR7?xId)Z&i^kkdr<*9;mwL>LaR53+3vdq7AgqxI6QYYyIaY5p~4xj+Qbl zmcLS_xWDTE27h@L1DyuZ`>Tzk$XX-#0Xy=H8MerKJq&YAcVYaUXc(BSlg0}(cU^O4 zp0s9apc&Xv+iV5?hQ#~$MInNYAO}#$YyG~li&}l2Tr=vNPgZ#y-OwW103rZ@62SDH zBXEh!*Bq?bC@afC;i?H*paq>xgL_qxuv1hmxEFm6TdN%oV|T>g1JeBIn~B4&8mc-g z{rO??Ho@s49pz4YdTXa~2cjA|{7!R)2zUA>S@teI^6GOz43BVwi9kq*e6{@0+-f#S94LO z=o*}{tG;GJLwbX&uKyi{+QZ))9S-cHd6B->sbiw|*;3%S;?pr2w`p0@<)ot}2 z5DflVG?(I|?I9?EbElpJJksE9jrpJ@-az_LmB^XU+o%>iM~GhimU8sOiPMD;!Micb z^1Df6f+LNV8PGMFNZG4~^J|K;oc&8kJo5ML6yc7MH>zin!m}+ob0gAZVXa;|bk+ z*s!Ww%p(CLv!_n7q`9t9pA+BQ4m|3$9>Qi4!IINKkcho98#cTebIi54L9{>V7%|@P zh3FHDoUC`MbUYK#sg?OXe#ZGwEAwTW1@P>6<+?X_352+-LvMbDZpl4BbZ+7hecGL0 z`s2h%0@wo!1oog)wUrhEjAGZsi~E9Bldo{64UfRC_w{*hdIb_2-5{7SH&$ znG5h-ZX&ES%O!OQe(xu8D*TWdZAmWs_|XO?#Yh=CE&aIZXImevyK1sLI%R%Xhluhy z$IN*N`OAAET^|cPO`jxM{J{sPM0PNxw|cs& z4@yIH?;fzTgcb@Z3$!ikj^1}kPy2YSau$(zXh)vC+jVwpT*i^VdW$Ng2CfeOf%02G z!E?AEBflUkZxSoengP*6SDB$D66YT{FIm*gmL?wC4=FBn8G?B6BN;Xsr!mTBL^}G*`sN)lE4_P+fuX7 z_y;|)#I;`4#3$`?^T?%Hd%TSp5z8wLP<%Y42AL33!MS8}&fO4PCF<(OS!vb!5G8(^ z#0u~|ifH6U!4-UqyMU5LF!?a2CHs$44LOz|H{hzl0OU5J_%W3ntJ314c6@y(hr}*F zPMN?hw5kOHUx%Ee_;;7gza3h)l$;y#+f^Vu;oDM@I$L~aerpPQZG~RJZ+{n#{vZmz zisqz%+$|d(q z5m|V|TX^;dnbmRC@xP?00uy55lmpvS&Q5^uw>?uU7*HY;w=;z^8EB)ayg(+0;C*06 z5v7wFPu5DJkk%!?M;+dm%|FZyzlZ1O2XPpA-gMEE7<+aa<1b|MLa}=W>D7HP zqdin@Ag}kPI8+hNx0Er8>*}Jq-I)TjIi#dLq6Gy!LwJUlQ7+Fyw{kb@DrOdRyR05` z;2lXK{q}8DBt7U%H*y!#{<=GTKhYo9f0y~e-`3QzE->7Rdr@b!Z8LE&;QyM}S0-nC z3G_o9Y&trib%K&+4r>UUXc-3e=5Gd@2tuP=AYQG4o!28OH_idBk6Ul=K(`OHKBnw6 zJugmw_LDjDrKb5SH=!u{M!aPqAjh{v9xD)si>xHE)aw;)70Cx^zpfa7-f2MDi**Sc za`d4Fxz+N}m+oY1gdhlS(P*pK(a8hpbT1sDLEogSk}jzyszCRKxeJRr%O1gpNq%;( zK{u-sTT=N(0PTue=9n?WAIKF$PtzyV#Q&Zn_algsx4vu%Sdu_x-8GyqMD=F zz7HNE7^PGb|IwMX;O!D_mvwCkKuH@jGP#u5-tVEFgK1WPpZ$RY5q`Kq>aTcJv3r2P z(Vq4di7ZK#a7lRSN6%{kP=BqPoe5QeW#3gPjO>wY8Am6qrv-#`Eh_hH@@=pLaj8NX z%VM`j(YufTABXzyou$9YAF^Hmv7|xO?AL5jiwK;4$Qh>v=6$#l!LPbmp-Bt&!0A0? z!q=ay&3OaPEW(?XZt~6u;{OwwD)OxLf<|vDc=ZHMbO>5IAkL`(^yk{U-9(!1v8APY)@Kj1Rc5sP=T- z=@8Vp2NY=cpafauDw{Z6*6iNi111`$VQ3tx<)?J}UD+|vlH@Q+IwE~+^jEeAW3rMj zF|77Hcv=^+6Gz<&cZ*_FHO;GS7MATg{NDt13*bo+;}*2($@<`>#|%U=-lnEC7!c?zK< z<$>3KZDO8Z+J;XA{-k}qLtAuNIZ(Oa6*c5=!=`&iP4 zX`UUbx;IpT5?fdEX*0C_!{o$ZF)t;MA~yE?>`uIPdt zIs%pOvoJILgFUi#0p-IAw5vrI=nrVCD^rI4Hzy$~l@wL)zd$JqXa)8vns&|8Hz6j(^9& z{uy`hm)>B>mw%!D?=-3Y_rL!CC$pUKG`2LIsri#o++q7Y;4>pCeo4IuODQXb)^uN; zTvbc(-IU*#RG3RY%v<(Gy=Ka@g*$>(?oFA;j%ClaO?;_t#qn6lk#WAaQP8m|`0*T# z*;9(TJE^*^PKKMF4gK=q)=h(&dq4nWSE|;=t>V09FxKp=L#{wApa%E^X9F=~k^cbu9VqR=y!ak` K^riIu-2VXLS6svZ literal 0 HcmV?d00001 diff --git a/monolithic/frontend/src/assets/images/logo.png b/monolithic/frontend/src/assets/images/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..16f2e7ab7c74552c5653652547ebce7adc4901dc GIT binary patch literal 28304 zcmeIbbyQr*7VwKhu#f}`5(p${pn=BS2^yT>+R(U5As064mFfbV6uZ88IpZ(DH z016Ux+aR>73;lRt^;*>y1_t-#uQ#l?{EK}U7>*NT#kY2ErKLFaEzRk54J`FQ^iJkh z(AqFC+lZ<#gg9`^_&W^!u-302%3TRqRZ8$OL``Bz-F_ODbe( z10rRiXQk6;U}Ym^J3A{*0Kn1Fk=_wVZ)sx$VC3N705C8Cn3(9GHRx<17IwN$bQZSc zzdQMtA7PNKzKyY!ow20_=`X*!dY1NfJY;0Q0{!{=o2Ks;6SlQc{{kCfc`T&p_$Q)#0XA8As{6{-0u%(@)E!gtEg#1(eUjswiL|XdK z*#Ee{=H~wx+SX3Q0gB)cr2lAXs|c|I0pvlpmi9LKAQ1=Xp^*R6(c2jt{?$1D=INK_ zzwSH8$@ssR{nGqy_FGr@y@j};$I2;W1Jbp#v{AIQG~@lfm&yJMA*qniZ@r3?N?KRn z*y0ygYHq-7qrY1GFMl9mT{{pj69W?i9V7IQQIV06lYxzsk%^Xpos)s#Z%%%%dCP~i zrGc>_G@kfoWW4Rp6ayg+WiKNbJY>bJheDQ;nFr)!}P5*Ox$7SJ0T z8*m!38L~03>2lC9v$HeOF*E41)3F%Tj(wKTMI)U^Q#7(si;|Cal|`~7#r+X1)%zs?6{#{VBQg{`i`|GS3x-}37J zX+!+O81?^WL;Tf~^})IpMj!)Tz`r{2zY6}hw)?$B|2@0@m9hVsjoiOZQJm0BhW0Am z-!h1i8}J`xe?|Vi{@Y&}X=eX>eP(6`=nKI3Yx{@o-}Sd`RsU~n|E|An`zeyvakSIxB<6|Z(GP3JAusJ3L8U5W7}V&3KIkCA4az| z|7fZDcT2XvTmDV+hvo0h^|uMyZ<+XeDRlY=op}QOoO=F8lKwfG{h$2u*CG9%^m@zJ zeUMu~?iTNH-OcBg_8!+QAa{%RxbEh2OM8#&7LdEedt7((xuw0wbqmPd;ytdr`P|ap zux@`wD-7f0l8be$8|TKTiSbEw}9L&-s8HP&n@je zu3JFv7VmN0&F7Z(9@i}(cZ>J9?&fn#dynfDkh{fuTzB)irM<^>3&`E#J+8a?+|u6T zx&`EJ@gCRRd~Rv)aoqxPw|I~1Za%lP_qc8Wxm&!)bvK_|+Iw8LfZQ$K?{VGD=a%*!*DWA-i}$$h=5tGXkLwnYyTyB4ck{WWy~lM6$lc=|HSHg#ZNI6uO`;8{j! zcZkBkFk_1g3n)5GZ8vlmYp5izot`HxVp>}Y*Ne#$3CpEr5M?UH$V-^y6%{;>4)LBf z$Jctg&esf1ZP@bhs$^rWWd%(T0?=KSL{3`?;mzAT3A>6+RBC`M*)|{KzeX`d$BXlZ z?seGh@vNz%B3Ipz-u`%hgx((($-%}wigfm>oFl@*0v zW&dSkj*(bV_>UX&as31BpOGCG)EadwRHsv2?^WdWD=ShBpy89K7RX=#7$s@yVcC)f6U>l+6HYz47&K<5KQV zria+_jF>KLpV$&yhFXSrb5}G)ifvI=6%;|>#7^)wg5pqL;1*0 z@XQV)vB6S*aL<5d03E(_i^@Qfjr@h8t}0xobB-@VUTWzkML2Rl4J8%_j?cJf&=&O# z(Sool-}`)CQXEg+Pc~_R7Y4aZ4%Y-3lFO5YjfVN)a^Zw0VmQH)uApWIvrr#OA>;j-fj zN#OYBR6_EkAZA!AxdKscH7EAv^q)W5rNSz5f2Pq@B%5<*;;tjG+J4Nv)YTZ$6=_69 zG7xp@m1NOJ^>&S2MGXi)ZEZKv4P0s-so8WFiOfsuW)j{)NaDg+Cg`l0k}jra!@pLP zTL1>3_Aow7vmn|&YX2mYLQwD&(RASo_OSU=*xabt3`ZkRDA8ARUI{&c>(XsXTq)}K zSiu!W_!ccy_n+KoJZJlX(9GQPKs z%rMJ}O>Yql_l5|a8&XvoF5YA!|D0S?j}MIzUofVn1p6tTe;Lgp(o7b-sMpYkn634LZA&J*##{(a&WJF+T=7 zolaH7)mY7?m;zB)cNwPOpkBx%d-+anW(&#PhD-AQDN!(!Gzuv7l+JgNoeXt-gMTKd6ro-H>D%hUt7S-)^w$VK4j;S`t?wuY>3yr|C#xH z$ONVhHlD+->Nu~+02|#|wB_gLgQH3tn<x3Y3-#ustt>-+2$_v3`r1{@D6t6%x-^ZH2wrb;dvX z1Q($xs4v78cG`8fP7(c+c=PjgN4-dL{ELf%kuo0EF*9K!#empgc zI&(vmS9?{<#tN(Xlgq#KrYLowm#b37{$TT!l_7Cnrcs>GE+Nw4GF2CO9Mfy*0NW0P zzy@BmH3_?@B~i@1Oe5}XpC7L{Yz@-fQ#KdtDvyU+TrQ}r-cKv0FF0U)z@bq!&?~p}J;$`8szQ4>Q*)8`W1vG=GtMb$&9^?{wV?^FVIHi6Dd`$vA3HbiMeMe(s)+b3Fr$zD>a#6j&FoAOS!W0RZ}7| zuS3-&Xlt5Y5h&0t$j!NZ#ezlG2R_-%GRkO+7X>NFSMNyh!IdNEk zj~IR>+XnAP@a$Rnj3bw?=`JhLfN$8ve$En?{Re$|xyO_+xY2@o%7W3y&=%W5a2c5{ z7G#Cj7h<%(XpUJ62#5@WzY3gwEjT`F*qNg5)#A_na`hbuHdT5IGJIIx*G?m!8!L6#HHWAEfwID(q3^gkF}V}Pa!CbFfIYi| zHI+r40>1flW0CznbxK8%v}U4TSxY_As$y}cci<9<*uN{05F(wc5#w_X>!Yko&^AAx zT(EImM;CrfIDq3<^_(gwXGYmf5AV1Vf8cqxD__`w+0z<;_GWsfvhl+n*IuL7NOCzeYE0lvvO4jwmmTvyHIXXTOBkg`D#5BIZH18U z^@=3JyPGIC*UWOu#NykMZmB3nQ-?i_%0`kqS&CmZ( z*!4XzJgonz`!GrqLceu_nhl3cx(>ORpFr|6LfIf2%9C&GM?xfI$3u9Xp4&_ zK{{LLd7XH3oYDZ1#1o=vrj`hJ80_-|IUJcS)vh$+y)>1uIumTWATK}COSOqcuJRYS z&7^e6^FKb4tBxA=kPfWM?H(UR z=YB}#RbyCSGGNAPQccSo(ITPyM6838)|WcTbhR72cwDnjUsdvXwCQ4QOWPteQrI8& z7(Dx9lwlu?TS3Nnav1m=3uDUgeZhO(P-3p&=(#7E%hoXoFd-}7$s%I~zu5XL^%f4- zU#Hxh9RsePZrd-QSh1^|PgO@EcY3)&G?FJ@#|QQwZyPQ3uDqL8ChCs4AANE-Sq4=Hc}@0aMgNPCVRP;HYv|8LiQ`& z#^fRJbj+dn;;zMrusWCo)cD8_k*>drQXg!!Duyu}a7h$+Zdc~?X7b0HQWRg0;=>2V zka$}4hpfs%aV>`Q7TUhluOg;a)KzV^49W1S3a$)HmOG~QKdr11KiFnzhVK5`REMu@ zzFwVv0!^FP0lCx%8bieK-s_S%Kn)Osiz>-Z8LKDl#K2l5#sJ`bY!FVsAw_k66X%bM zWH$;I9QNqchc3}i?3d3N0-d6TkB6EeqvL`~?@oR$F!BnV9MYg!g!B%mLr%RH zS7e+YGt~c7fG=qI;;TZ#u@AN|3VlEfb zAKLh7O=NLd(W&u?d)}}gm}FNl^`z-qRV@|Pii^u7uiUm-^rziK*Qr~Nn-8k*(R;+U zVWA83r%DqcsMJ>n67GT9MqYIJMpdsY2hf|~IBE#V#UC-mdIBv^`b*2h;fsK8&SUm2 z-q#6<38=qOS#IE+n$TDHCZ=ARLb*mumXGDCXHqPC+VT5DX+s)dEY>dBsQx9Kujm&vksz=CkG}u$)c^*T?sogxTc*yN{0_ z+H$+>%A8uq>FlQw8a~ZQ;##8AV`wLfL^vLT!EIIrIXs43dWYk!wG#eB6YZ};)1imW zzKj4`!Y0~`(hlGzaVLoJ#OOJK*LwyEsZ=SpX@4YSzBc}5@J?_-*qf={8}GevJ|qY0f8?Ij0KecRkM!cx13_z7KhQO+kNmC7wkD zBmIU%I+bO;)tJimJA3EO;YTTkc(rrLgQJ?R8e3(p^@3lm)O+UI9nXcxpv`J^u{-#+ z%2%LK0eM%vf~%a$A6`MCmnMhX@Iwx-T1L}lJ$Ygre)6HON^3+rgk|yQ=FE!=joB^d zWaVm>albn3KnkbE@`IHl7^lUhJV!|sI?te$eHlA_w7qtc*u`Z_&IjwB`E}c*=`!qD z{ULuDLVsZctjQ$~3%#NYx?+lky`KzYfQ8S5s$fido4kR3W?0Ny|4KF35MB4Vuf>kR z^#)Pe@LZP7f;OkI#NWF4+_S(1G?WGm&*KI}I`SZRnS4rc$jT3Mz*Nf)i zU9!r?YkAW>L?3O?V#W&h*$=#SLj426#$=jmR;ZMT`VI1oC57!o1$+A(7$d4VGUz4i zVe)Mg6i>i%8=fL-tsRGL=ieP2%}JcMigx%o)L9+|q^cUZ@@+TFwyRtSy$%pWkr}88 zb^NxUz*n3Hyom@&Kuh%akuo#Ww^IDG`244NdZ$OEkN%;cn6if@4+Tu(&jb^THS6tx z>F}XfvAwFOO5<)Lp%2C7{i7jnkwi)6&mwI(23w3gtjKS*6IXaum`QNgx2?!OH+Z z&VITtS+vxVCL&!YKIEFRd0UvkNFpUtQutS7ga8%M-@G%-4Y7VLD z`jwSC?|eP}VaSe)CT~*@sX>zNig5%AhyKHq1u3@tnyNzleE4xc6F#5(5g!W__M5h* z8jg{l+E*_P=$}3CGQxJ_Y+d{?nBm%5(Ay2&;gOtJPJ&IU?qyh&?Ljy=dQ+~a+KQ9a zRPk)ACyVONnMQ~eQd2Vw`F&ZKy-WD^5*l{v-G~>{H_3)Nsy28d$L~wHjdBD? z5R*;9{1>l)a<*(EtzInAqQ0@i!x>|7ta^5oJ$Ta{I%;QTawtQ_CB{DSJ!{XBw#zfm z!CLAg=-UF;+whGIBBwtNdp%C5&O6z9wq{-}VBd_~%+7f@4D(*hDWBC=ZC6or9AtT; zY+@*mZ8Sff3CxbiG_l)|Ztoygr{^vCR>0WEL;Co1WF$2LJ`~l?r#%USHWEWJA?VdZ zyVIM{6T+MLq`fP3LrS`O5pDBn%?0k8)!nhm)eso;wNEb0Ca3R#&g}$`B-N0Ut|cOI z0Z(kWMp|*5x?v?vX5v@kg1ZH`wl+q`6&Q>1nd3RTM+h=SK32qS_xg?vm_&;8WEMh# zoKB5b-*_e3by4eRZQEp&Z9U8GiV9NT7(;SX6G>rcb*~B>lvg#Y6%LKejX8;mVa?oh49 zpH0Xo5qluzy=br&Gh})~@ALd}AHP%q%g1ux&oq24aRam*T=^mif_W$+#TWZ=tg>eW zR*#(!ok*%nXx;TH04}{=eTNqVBFA-BPRDDhw+=h( z3Lvya-)rDmyHa*hLFYCO=7x7>ZV}`s!6!5xjW_R;N}n^+$rPkgpyk_=Z*Ex*qL{8` z|3Nryav&<3m<3@e6qwkx8R_+P&{v+$D`R39XQoD7mmBm*U03!?PEOyOp-R_btM~ra z#X|srTX_`oov<4gddEaqqE6Zvk3HA((ZUm=H?*RFsrsbq#nGCUg2#A?c`q^p$s}hv zS=zIhxeljTgS>LpDD|UFQ}Ddx2Q4jzlAJ=%-|?S=*4UBQ(YfDmk~i}h)0e-zoJ>fq z*eQ4Lj{WH?t@oV3bAp`_;`lWt=!?OQ??g!eIBu%kpC)h+=W&+)wDgx4dOX{PR{Jcz zKHhzliYxr?U}xNV8OQq%>Mz-RBoi+IXU-m*bZ z8k2X=oCB*Z{F!7VJ+@E>sC(h0up9aLwn&%`bzsT@s5 zjTDcKqlAo|31De$`?ihgG_w1Hu|!i<1KS=6NRNr~O<7x1>jzsVWr-FwNI~KeDYK_r z?SkY*rN6KT8myxE!q#Rj~IpJHBmI^7F18?MMS;0&Xo^E8rxEp z8XLh&`h8MOG-N{J;Vs`RVFeme;nhuy(PgeEqu3&vrHkJfX-rsuyAo1)qaIn|Cu~O& zKj%vkn1?krQ&P5w#6>t(5x0D8w}BzWvJC~flUT#M%D+C(Ycbf#xhVerU4%}o7sz5{ zVTH^`^FzX8z{`aQuBreyL2Nt%l{a`r$poK2jZ%RkVmaPZsMSnh8!{5c+wgv%31lym zj4UM#_TD;K91{q3wp4Uu%Hu6s7j*`v=MQ%&B3nq(I%+jA@*~ER5oZd0oT?A9V3@XA z*`~Li)v?Elm-nYY9qKNi?i)*E!kf~N!j>4EHK>7JC<`08A=2JM)&N)$Ss@Ixed%fY z()}o$=i9+GCo3_Wj2aTXtlGPmLf^uNA1vaa!>ZF)YOqXy?nuKOC&m&lu6`a4CX+6C zWhnH-hNByKK0!ZuA0Z77aLmPY~>i{ zF_Y+%x^FeF_<~BXNcyMilP2pYja<2e^$Hm)4s7{S>0>Q8D-XLThE~}~&e&S1s+AWE z2##r~uH&QwRgmZ@hv?>dsS7eoFyBcR3%t>eVxhMyichIJX8u^f6S)5Kh0hjQAxaQ^ z>!0^DZQ+cE}=1@bbJXcE=O-2yNa0nT| z!q1se^S#E?#ddvW#clO)oty{EE){_{8uOy4SJ;G7(v3N?fHyuwL7kbT&Svam!6g58 z3UK(dpO^9c320mil@pUCS$!Z?^lJOV18UKhkw-ij2Sh5m*wq6w)|Y#lUfkXX!VgJ@ zUyS*ev&V%e1mLn#MxwW9m^eksTcqoh4c0ib+8<*t)uKl0M%081=IGY-^|^8~chob1 z7^(rLMp{g$&-NCu_owq2QG1nm5eC!qxYN5L^Jb!x(^cWxx)sq}nEpEba11O zvA9KW945O<*_ZHv$Eg58Vp>+ML&D3%i(;8a1#dK%m13{b`Q*@5r__POQ2dd^){N-O zVMNLuS8$shSbFVcq?vue4gUWSs9qNKX1 z1(EW>GCthVEP~XS^o-TTXA&9jzIbvnPI>9DgBOy}OQW$2lO;}Rgtuj4k6FATlI8YWY~9A+MY`r~wUA5|7Nm6wq{uo& zX_b&Q%w+8`F{IlV<(Mg2N<>Ax*uxqL917^0UO+mOR_~V#XMY{~yaeG*tT-28e7Bv! zy3OQzkcNT9pUoHHAfn)3pFu&s@5ck&u3N#gCT2Xr9WhqAyhVI$)Snqlemao*rjq79NC7 zY0MYQUq2fh4+*OkY=4LgoeBP72&0%AouaaBq`(|xroWa(Vwv9^f1P7syld2(zNnE9 zXQ(x~m=>iLf?X;`xiS*${rqH<n9e8LNowYf6sYB zQ&X1nDnfKhFGJ4KQ0=XlMLmJIJc;z9f`=_CBj(y~lw2M0O2Q5LbIb85%;`rayH?Al zmRmkZq2Y_L!Es~SNGv$=FL~BuI6IJHP0|3P}bfB$O>zDp9hK2|cb)t&DI1 zLekyK>D=vx{4LE)F2MPiCPQ7!1~z%r8K$TlSm@-L0Mr*u@vuDU3mL7nq%GI8fL5Np z#9(c{y23a3ZR1JO%);>dtn#&Sn6KEWsSGUxiZN}-MY5&UEuvoH-D zJJjc!l@wB7oV5JF!ccI4>MW2n>>ci|$9YvBd}NLL&Nc9dfaQec%b{l`v2{X5N83hK z+%|7eZrq-aRx{YYI~Oa8ub|jE(f`i-ID|=kn`*(m(g;kvUHy$y2$}Vod*F9e*OAen;SFV6dsL76G-P>fX(-9 z+!+~W3s|8;tJ)-wTRFh;TW)QCdsuMEJekqU+_6E8F)S;?GezLla|@<%9A$$MA#lkl0Bx zuz|AnW@=1HtZv$VOfxO2CHo_KvIAbS0dgV)2m$jWy=;WwS6#so36J8s8FDw%z51qe zNu*^iha8wy)nTLaGA16E%C-5>vjt5KhOWUYAd-VxpHCqyOM9vC&*PpAM$c6}UMUEy zpQ&)pF>QM%aNJCTIyF)glKHJQIlFu|b9c~qGhIZOv%A)(FxwO)~=K z0w4ewsm z%&8{_MIyG{%-J&YWm$Tw6K~C3U)>yfBMj_~4vUl3 z(%nrFTSRT3y*4S^o{dT*(ErqFQZJe9qa%E5@pP@5DkRf+RQSC%jF^|$`bz3dGF&JP zJ7LARSP(mqqNB&*y0={K`^@srsFK3k*El>vvozvSX6KF73S&bd)7qb}3SV2R+0_WG zO(?wlc@Dda6Qognz>|U`BD+Gqz~ZHiY7>?wHc6{y(j#NM`O*aRP8ri)@9{1sPZ`8^ zDkf+Qx)^=(g?cmnQ2>g$IzB~$1^Z;V`-8+6wh0p+dpoeZh5Dn#+v#V~J{#XW;RneM zlA9$-#k?>E8?4#Hz?Y&`hIyIC@#4NMFLJL7blmVXc#`PrgeddFvIL(rBw9*97eiSl z61mtvBEaXWL!uw5Y_@4HspjAuc(0$G{>YkgSyF$BHr(+|x7tk+MOG4?~7gHns%$pE@-wSLs9?UrKHzifSj z;7*qk(OI+NQvQ4aBg%o_*tEa^deX6f@NB6rfUuv}p{-jrvg+B8HFTu`#-g{YVg5Cf z{kA%o_f9RX*;rr>-W~Hma$%Wi<($X%iE{#fJ0e6cM z0O|p+%9gUul~VS0Voqa0c$?hHBRL)$$?;9l$)OaoL(o^zdLl)9PYOyH0G68 z4QpiwHy$Ap!LUTSNG#cy&-;xDhse*FJt`ro@`ijp$lg~Iy2($LkEqpTtPdVGo*sVf zO+q0F+^wRiM{3b|G4xJ`ltu%_9q~Y+rGCWEJjHx9{#j(#p71i_BX@7BMciFjI%Nu{ zC*3HX#p=32R-gt#A_)P0(zuctv>u;fj1R+)UJRtLc^$sJEG_>byWVOYQo9#%Hs6;>Dk)|$0D%6|<1#IgxIx>ZPvnP$%( zySAo6!p8tnw+7Qz-6ShA=GlfoTsHGDfTN#9Md=e7G#OT<)0i*&EIwc=d`)~3`iV5v zkM)xbjros=!LLKF3uxZ6vTd7HxAgnkn^QoV&g2dFX!(sk?-^9%5&cwJ_+D|fTjBfQ zQ8gHNY07v2Tu6HPVS?|H3xSP;lDDViSN|bRilX^qvc%9QNVO5L}efd!_cz+o~Y28ZP=m2wi12HtqZh>Z7inz7v{X{^?Aao6T!Km>Wj&{m@5 zKKSa`l(e(H?`VVFGe<`!cyH%jGh#^4Y_Qm~_7^Z9@1x%ylyWg=qOnhAGx)wZ9#VV{ zF2&S-gItuXwp1(it$>Cj046&n_OJEigAukGgwrs7_ZJ^YIC{k}&n%08glB2z;^bsa zqGu1Ty@rl_Z4+o~g-mr73zu_NyY2nPlpNPj3i4OEDia?DTe1P5_hpR3Ld(;(?c$`e z$+rxJ6p*GBOdtCWpf9tL0^lvREd3qGKTUn@4>&MYf+$6iqiUb0RpB9ihn~!Rh)s04 zMFSOC5X|PJXTdg8VGiEi@j@9{VU?UStV}9B$_bKn_#bs6d#C~p9&DxedCkKW!&!>5 zA8Omi08oeyJ4onV(GOZnS-L)L$++@O5?{c%Ij*CU<3x~Nss@nCxsG2rKfb`CGsufj ztgfNqL#F)n^y7KG5em9u&M@Y%0pYSzQ2n5vskW;RhlSMPZb5U91ox}`lDs+l*&6A2 zkdDkszsWqYbMpa`t_@fDU_b~kfu$un2qO}J%4q!|?aWuu%vRTE1Q)tMod+~#Adbuf zKdzx4kafj*c)+8A**Me9h3CS^nqH{#%8-Dibt`ws4P#}2 zCOxec|GA*EcdO#Z@ez$ZDrX9s0NR zrzduPLO#|`8fh`=fj24iav>N-!@@Bg4C?>%qXTPck=|Ed&i*iOc|&sclXPnNv|6n{ zn`3w$FM%D|)I>p2jfu&u&TczGK4amvDz?Z2O^QDkqEGg7nGg_KbSjB{Li}8YbozI` z7}d#D(vmSwqc(wSce^sabqbBo<}a+2y&$AF4&21k^@rDs4r$0qp7h*5t8m(4Z4Sl}CMQD%<_Zf~;MVZa zPV>8^+V)Y)*dLXbU9g#ugQ{d<~$W>N*nb&UUsXchX779 zp~puAw0bC!#~SHI6Orj+kxsWC+VPV)`wZurZa`CRak`?~z7b~cj1=u4k<2f6oqw^5 zk|4mXl4d0Rx7@RXfS?yC7X(ejE75*Z{HsR5mh!v^(t+p#hmPC3e!1;i%9@AK|^lk$yAnk3eh z^*gxuuH78*9qe5hy}3*w=F*urgEzuWa@R9@f>1Aj%sTExXZ@WX2Q8vSdcd8PUdoM! zXJfPb{3ZAcwX=-QGYq3?sjS1V!MK?-I3d^%6imswy0r+U-HX;;O6u?cmS4u$J+=i- zr`?1gFUc$&ygDeq4#aUt>N--Hd9jiA9w_ou><-eHXsm0nm}>ASEeRIMp+4SBbI85g ze!&_Y*Y8(p`fC|0BwfODg~N)dg}2-RI){wA@YHx*gjswIyq|*}pU^I}D9-BZ~{?S_C^~~z;E7*c^p9$V4uUVwFENR|d zp`0;xbw9N=bS=sESTRIg0(!AMfbK32pzqE+RLmkew`qT&FB%IV!PLTVG?zNKY;914*LDr={lhNF2r~Ba0lMo7ZpFDKeXTTfE@C2 zAFh_$)>G9u6-s4ATRT~!G?HY$7sibjkbQ)!XAiw@X>p(&485mG&-{vo_Qd^KIi^NB zo6I~Rq1&Ks)1WQBzXx47rUfj8M0<^}(sQ(+f_tgoQva%}CIOYm)^<}Gk literal 0 HcmV?d00001 diff --git a/monolithic/frontend/src/assets/svg/illustration.svg b/monolithic/frontend/src/assets/svg/illustration.svg new file mode 100644 index 0000000..b45215b --- /dev/null +++ b/monolithic/frontend/src/assets/svg/illustration.svg @@ -0,0 +1 @@ +Asset 336 \ No newline at end of file diff --git a/monolithic/frontend/src/assets/svg/login-bg-dark.svg b/monolithic/frontend/src/assets/svg/login-bg-dark.svg new file mode 100644 index 0000000..888da7a --- /dev/null +++ b/monolithic/frontend/src/assets/svg/login-bg-dark.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/monolithic/frontend/src/assets/svg/login-bg.svg b/monolithic/frontend/src/assets/svg/login-bg.svg new file mode 100644 index 0000000..7b66baf --- /dev/null +++ b/monolithic/frontend/src/assets/svg/login-bg.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/monolithic/frontend/src/assets/svg/login-box-bg.svg b/monolithic/frontend/src/assets/svg/login-box-bg.svg new file mode 100644 index 0000000..ee7dbdc --- /dev/null +++ b/monolithic/frontend/src/assets/svg/login-box-bg.svg @@ -0,0 +1 @@ +responsive \ No newline at end of file diff --git a/monolithic/frontend/src/assets/svg/net-error.svg b/monolithic/frontend/src/assets/svg/net-error.svg new file mode 100644 index 0000000..81f2004 --- /dev/null +++ b/monolithic/frontend/src/assets/svg/net-error.svg @@ -0,0 +1 @@ +personal settings \ No newline at end of file diff --git a/monolithic/frontend/src/assets/svg/no-data.svg b/monolithic/frontend/src/assets/svg/no-data.svg new file mode 100644 index 0000000..2b9f257 --- /dev/null +++ b/monolithic/frontend/src/assets/svg/no-data.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/monolithic/frontend/src/assets/svg/preview/p-rotate.svg b/monolithic/frontend/src/assets/svg/preview/p-rotate.svg new file mode 100644 index 0000000..5153a81 --- /dev/null +++ b/monolithic/frontend/src/assets/svg/preview/p-rotate.svg @@ -0,0 +1 @@ + diff --git a/monolithic/frontend/src/assets/svg/preview/resume.svg b/monolithic/frontend/src/assets/svg/preview/resume.svg new file mode 100644 index 0000000..0e86c5f --- /dev/null +++ b/monolithic/frontend/src/assets/svg/preview/resume.svg @@ -0,0 +1 @@ + diff --git a/monolithic/frontend/src/assets/svg/preview/scale.svg b/monolithic/frontend/src/assets/svg/preview/scale.svg new file mode 100644 index 0000000..1f7adae --- /dev/null +++ b/monolithic/frontend/src/assets/svg/preview/scale.svg @@ -0,0 +1 @@ + diff --git a/monolithic/frontend/src/assets/svg/preview/unrotate.svg b/monolithic/frontend/src/assets/svg/preview/unrotate.svg new file mode 100644 index 0000000..e4708be --- /dev/null +++ b/monolithic/frontend/src/assets/svg/preview/unrotate.svg @@ -0,0 +1 @@ + diff --git a/monolithic/frontend/src/assets/svg/preview/unscale.svg b/monolithic/frontend/src/assets/svg/preview/unscale.svg new file mode 100644 index 0000000..1359b34 --- /dev/null +++ b/monolithic/frontend/src/assets/svg/preview/unscale.svg @@ -0,0 +1 @@ + diff --git a/monolithic/frontend/src/components/Application/index.ts b/monolithic/frontend/src/components/Application/index.ts new file mode 100644 index 0000000..d7c5133 --- /dev/null +++ b/monolithic/frontend/src/components/Application/index.ts @@ -0,0 +1,15 @@ +import { withInstall } from '/@/utils'; + +import appLogo from './src/AppLogo.vue'; +import appProvider from './src/AppProvider.vue'; +import appSearch from './src/search/AppSearch.vue'; +import appLocalePicker from './src/AppLocalePicker.vue'; +import appDarkModeToggle from './src/AppDarkModeToggle.vue'; + +export { useAppProviderContext } from './src/useAppContext'; + +export const AppLogo = withInstall(appLogo); +export const AppProvider = withInstall(appProvider); +export const AppSearch = withInstall(appSearch); +export const AppLocalePicker = withInstall(appLocalePicker); +export const AppDarkModeToggle = withInstall(appDarkModeToggle); diff --git a/monolithic/frontend/src/components/Application/src/AppDarkModeToggle.vue b/monolithic/frontend/src/components/Application/src/AppDarkModeToggle.vue new file mode 100644 index 0000000..19ba3b1 --- /dev/null +++ b/monolithic/frontend/src/components/Application/src/AppDarkModeToggle.vue @@ -0,0 +1,76 @@ + + + diff --git a/monolithic/frontend/src/components/Application/src/AppLocalePicker.vue b/monolithic/frontend/src/components/Application/src/AppLocalePicker.vue new file mode 100644 index 0000000..8f1af73 --- /dev/null +++ b/monolithic/frontend/src/components/Application/src/AppLocalePicker.vue @@ -0,0 +1,76 @@ + + + + + diff --git a/monolithic/frontend/src/components/Application/src/AppLogo.vue b/monolithic/frontend/src/components/Application/src/AppLogo.vue new file mode 100644 index 0000000..a0cd0f0 --- /dev/null +++ b/monolithic/frontend/src/components/Application/src/AppLogo.vue @@ -0,0 +1,94 @@ + + + + + diff --git a/monolithic/frontend/src/components/Application/src/AppProvider.vue b/monolithic/frontend/src/components/Application/src/AppProvider.vue new file mode 100644 index 0000000..fe19a80 --- /dev/null +++ b/monolithic/frontend/src/components/Application/src/AppProvider.vue @@ -0,0 +1,82 @@ + diff --git a/monolithic/frontend/src/components/Application/src/search/AppSearch.vue b/monolithic/frontend/src/components/Application/src/search/AppSearch.vue new file mode 100644 index 0000000..63d346e --- /dev/null +++ b/monolithic/frontend/src/components/Application/src/search/AppSearch.vue @@ -0,0 +1,33 @@ + diff --git a/monolithic/frontend/src/components/Application/src/search/AppSearchFooter.vue b/monolithic/frontend/src/components/Application/src/search/AppSearchFooter.vue new file mode 100644 index 0000000..97bd93a --- /dev/null +++ b/monolithic/frontend/src/components/Application/src/search/AppSearchFooter.vue @@ -0,0 +1,56 @@ + + + + diff --git a/monolithic/frontend/src/components/Application/src/search/AppSearchKeyItem.vue b/monolithic/frontend/src/components/Application/src/search/AppSearchKeyItem.vue new file mode 100644 index 0000000..aba36a5 --- /dev/null +++ b/monolithic/frontend/src/components/Application/src/search/AppSearchKeyItem.vue @@ -0,0 +1,11 @@ + + diff --git a/monolithic/frontend/src/components/Application/src/search/AppSearchModal.vue b/monolithic/frontend/src/components/Application/src/search/AppSearchModal.vue new file mode 100644 index 0000000..76b7882 --- /dev/null +++ b/monolithic/frontend/src/components/Application/src/search/AppSearchModal.vue @@ -0,0 +1,267 @@ + + + + diff --git a/monolithic/frontend/src/components/Application/src/search/useMenuSearch.ts b/monolithic/frontend/src/components/Application/src/search/useMenuSearch.ts new file mode 100644 index 0000000..9101b4a --- /dev/null +++ b/monolithic/frontend/src/components/Application/src/search/useMenuSearch.ts @@ -0,0 +1,166 @@ +import type { Menu } from '/@/router/types'; +import { ref, onBeforeMount, unref, Ref, nextTick } from 'vue'; +import { getMenus } from '/@/router/menus'; +import { cloneDeep } from 'lodash-es'; +import { filter, forEach } from '/@/utils/helper/treeHelper'; +import { useGo } from '/@/hooks/web/usePage'; +import { useScrollTo } from '/@/hooks/event/useScrollTo'; +import { onKeyStroke, useDebounceFn } from '@vueuse/core'; +import { useI18n } from '/@/hooks/web/useI18n'; + +export interface SearchResult { + name: string; + path: string; + icon?: string; +} + +// Translate special characters +function transform(c: string) { + const code: string[] = ['$', '(', ')', '*', '+', '.', '[', ']', '?', '\\', '^', '{', '}', '|']; + return code.includes(c) ? `\\${c}` : c; +} + +function createSearchReg(key: string) { + const keys = [...key].map((item) => transform(item)); + const str = ['', ...keys, ''].join('.*'); + return new RegExp(str); +} + +export function useMenuSearch(refs: Ref, scrollWrap: Ref, emit: EmitType) { + const searchResult = ref([]); + const keyword = ref(''); + const activeIndex = ref(-1); + + let menuList: Menu[] = []; + + const { t } = useI18n(); + const go = useGo(); + const handleSearch = useDebounceFn(search, 200); + + onBeforeMount(async () => { + const list = await getMenus(); + menuList = cloneDeep(list); + forEach(menuList, (item) => { + item.name = t(item.name); + }); + }); + + function search(e: ChangeEvent) { + e?.stopPropagation(); + const key = e.target.value; + keyword.value = key.trim(); + if (!key) { + searchResult.value = []; + return; + } + const reg = createSearchReg(unref(keyword)); + const filterMenu = filter(menuList, (item) => { + return reg.test(item.name) && !item.hideMenu; + }); + searchResult.value = handlerSearchResult(filterMenu, reg); + activeIndex.value = 0; + } + + function handlerSearchResult(filterMenu: Menu[], reg: RegExp, parent?: Menu) { + const ret: SearchResult[] = []; + filterMenu.forEach((item) => { + const { name, path, icon, children, hideMenu, meta } = item; + if (!hideMenu && reg.test(name) && (!children?.length || meta?.hideChildrenInMenu)) { + ret.push({ + name: parent?.name ? `${parent.name} > ${name}` : name, + path, + icon, + }); + } + if (!meta?.hideChildrenInMenu && Array.isArray(children) && children.length) { + ret.push(...handlerSearchResult(children, reg, item)); + } + }); + return ret; + } + + // Activate when the mouse moves to a certain line + function handleMouseenter(e: any) { + const index = e.target.dataset.index; + activeIndex.value = Number(index); + } + + // Arrow key up + function handleUp() { + if (!searchResult.value.length) return; + activeIndex.value--; + if (activeIndex.value < 0) { + activeIndex.value = searchResult.value.length - 1; + } + handleScroll(); + } + + // Arrow key down + function handleDown() { + if (!searchResult.value.length) return; + activeIndex.value++; + if (activeIndex.value > searchResult.value.length - 1) { + activeIndex.value = 0; + } + handleScroll(); + } + + // When the keyboard up and down keys move to an invisible place + // the scroll bar needs to scroll automatically + function handleScroll() { + const refList = unref(refs); + if (!refList || !Array.isArray(refList) || refList.length === 0 || !unref(scrollWrap)) { + return; + } + + const index = unref(activeIndex); + const currentRef = refList[index]; + if (!currentRef) { + return; + } + const wrapEl = unref(scrollWrap); + if (!wrapEl) { + return; + } + const scrollHeight = currentRef.offsetTop + currentRef.offsetHeight; + const wrapHeight = wrapEl.offsetHeight; + const { start } = useScrollTo({ + el: wrapEl, + duration: 100, + to: scrollHeight - wrapHeight, + }); + start(); + } + + // enter keyboard event + async function handleEnter() { + if (!searchResult.value.length) { + return; + } + const result = unref(searchResult); + const index = unref(activeIndex); + if (result.length === 0 || index < 0) { + return; + } + const to = result[index]; + handleClose(); + await nextTick(); + go(to.path); + } + + // close search modal + function handleClose() { + searchResult.value = []; + emit('close'); + } + + // enter search + onKeyStroke('Enter', handleEnter); + // Monitor keyboard arrow keys + onKeyStroke('ArrowUp', handleUp); + onKeyStroke('ArrowDown', handleDown); + // esc close + onKeyStroke('Escape', handleClose); + + return { handleSearch, searchResult, keyword, activeIndex, handleMouseenter, handleEnter }; +} diff --git a/monolithic/frontend/src/components/Application/src/useAppContext.ts b/monolithic/frontend/src/components/Application/src/useAppContext.ts new file mode 100644 index 0000000..8bdfb4f --- /dev/null +++ b/monolithic/frontend/src/components/Application/src/useAppContext.ts @@ -0,0 +1,17 @@ +import { InjectionKey, Ref } from 'vue'; +import { createContext, useContext } from '/@/hooks/core/useContext'; + +export interface AppProviderContextProps { + prefixCls: Ref; + isMobile: Ref; +} + +const key: InjectionKey = Symbol(); + +export function createAppProviderContext(context: AppProviderContextProps) { + return createContext(context, key); +} + +export function useAppProviderContext() { + return useContext(key); +} diff --git a/monolithic/frontend/src/components/Authority/index.ts b/monolithic/frontend/src/components/Authority/index.ts new file mode 100644 index 0000000..2f0eab7 --- /dev/null +++ b/monolithic/frontend/src/components/Authority/index.ts @@ -0,0 +1,4 @@ +import { withInstall } from '/@/utils'; +import authority from './src/Authority.vue'; + +export const Authority = withInstall(authority); diff --git a/monolithic/frontend/src/components/Authority/src/Authority.vue b/monolithic/frontend/src/components/Authority/src/Authority.vue new file mode 100644 index 0000000..0d35938 --- /dev/null +++ b/monolithic/frontend/src/components/Authority/src/Authority.vue @@ -0,0 +1,45 @@ + + diff --git a/monolithic/frontend/src/components/Basic/index.ts b/monolithic/frontend/src/components/Basic/index.ts new file mode 100644 index 0000000..97a53a1 --- /dev/null +++ b/monolithic/frontend/src/components/Basic/index.ts @@ -0,0 +1,8 @@ +import { withInstall } from '/@/utils'; +import basicArrow from './src/BasicArrow.vue'; +import basicTitle from './src/BasicTitle.vue'; +import basicHelp from './src/BasicHelp.vue'; + +export const BasicArrow = withInstall(basicArrow); +export const BasicTitle = withInstall(basicTitle); +export const BasicHelp = withInstall(basicHelp); diff --git a/monolithic/frontend/src/components/Basic/src/BasicArrow.vue b/monolithic/frontend/src/components/Basic/src/BasicArrow.vue new file mode 100644 index 0000000..6a4cd01 --- /dev/null +++ b/monolithic/frontend/src/components/Basic/src/BasicArrow.vue @@ -0,0 +1,84 @@ + + + + diff --git a/monolithic/frontend/src/components/Basic/src/BasicHelp.vue b/monolithic/frontend/src/components/Basic/src/BasicHelp.vue new file mode 100644 index 0000000..1a1debb --- /dev/null +++ b/monolithic/frontend/src/components/Basic/src/BasicHelp.vue @@ -0,0 +1,114 @@ + + diff --git a/monolithic/frontend/src/components/Basic/src/BasicTitle.vue b/monolithic/frontend/src/components/Basic/src/BasicTitle.vue new file mode 100644 index 0000000..3b96328 --- /dev/null +++ b/monolithic/frontend/src/components/Basic/src/BasicTitle.vue @@ -0,0 +1,76 @@ + + + diff --git a/monolithic/frontend/src/components/Button/index.ts b/monolithic/frontend/src/components/Button/index.ts new file mode 100644 index 0000000..98add5c --- /dev/null +++ b/monolithic/frontend/src/components/Button/index.ts @@ -0,0 +1,9 @@ +import { withInstall } from '/@/utils'; +import type { ExtractPropTypes } from 'vue'; +import button from './src/BasicButton.vue'; +import popConfirmButton from './src/PopConfirmButton.vue'; +import { buttonProps } from './src/props'; + +export const Button = withInstall(button); +export const PopConfirmButton = withInstall(popConfirmButton); +export declare type ButtonProps = Partial>; diff --git a/monolithic/frontend/src/components/Button/src/BasicButton.vue b/monolithic/frontend/src/components/Button/src/BasicButton.vue new file mode 100644 index 0000000..73f0c44 --- /dev/null +++ b/monolithic/frontend/src/components/Button/src/BasicButton.vue @@ -0,0 +1,40 @@ + + + + diff --git a/monolithic/frontend/src/components/Button/src/PopConfirmButton.vue b/monolithic/frontend/src/components/Button/src/PopConfirmButton.vue new file mode 100644 index 0000000..b24225f --- /dev/null +++ b/monolithic/frontend/src/components/Button/src/PopConfirmButton.vue @@ -0,0 +1,54 @@ + diff --git a/monolithic/frontend/src/components/Button/src/props.ts b/monolithic/frontend/src/components/Button/src/props.ts new file mode 100644 index 0000000..d79d378 --- /dev/null +++ b/monolithic/frontend/src/components/Button/src/props.ts @@ -0,0 +1,19 @@ +export const buttonProps = { + color: { type: String, validator: (v) => ['error', 'warning', 'success', ''].includes(v) }, + loading: { type: Boolean }, + disabled: { type: Boolean }, + /** + * Text before icon. + */ + preIcon: { type: String }, + /** + * Text after icon. + */ + postIcon: { type: String }, + /** + * preIcon and postIcon icon size. + * @default: 14 + */ + iconSize: { type: Number, default: 14 }, + onClick: { type: Function as PropType<(...args) => any>, default: null }, +}; diff --git a/monolithic/frontend/src/components/CardList/index.ts b/monolithic/frontend/src/components/CardList/index.ts new file mode 100644 index 0000000..b977c1b --- /dev/null +++ b/monolithic/frontend/src/components/CardList/index.ts @@ -0,0 +1,4 @@ +import { withInstall } from '/@/utils'; +import cardList from './src/CardList.vue'; + +export const CardList = withInstall(cardList); diff --git a/monolithic/frontend/src/components/CardList/src/CardList.vue b/monolithic/frontend/src/components/CardList/src/CardList.vue new file mode 100644 index 0000000..d14f7c6 --- /dev/null +++ b/monolithic/frontend/src/components/CardList/src/CardList.vue @@ -0,0 +1,177 @@ + + diff --git a/monolithic/frontend/src/components/CardList/src/data.ts b/monolithic/frontend/src/components/CardList/src/data.ts new file mode 100644 index 0000000..b7c4be7 --- /dev/null +++ b/monolithic/frontend/src/components/CardList/src/data.ts @@ -0,0 +1,25 @@ +import { ref } from 'vue'; +// 每行个数 +export const grid = ref(12); +// slider属性 +export const useSlider = (min = 6, max = 12) => { + // 每行显示个数滑动条 + const getMarks = () => { + const l = {}; + for (let i = min; i < max + 1; i++) { + l[i] = { + style: { + color: '#fff', + }, + label: i, + }; + } + return l; + }; + return { + min, + max, + marks: getMarks(), + step: 1, + }; +}; diff --git a/monolithic/frontend/src/components/ClickOutSide/index.ts b/monolithic/frontend/src/components/ClickOutSide/index.ts new file mode 100644 index 0000000..5e7dd2d --- /dev/null +++ b/monolithic/frontend/src/components/ClickOutSide/index.ts @@ -0,0 +1,4 @@ +import { withInstall } from '/@/utils'; +import clickOutSide from './src/ClickOutSide.vue'; + +export const ClickOutSide = withInstall(clickOutSide); diff --git a/monolithic/frontend/src/components/ClickOutSide/src/ClickOutSide.vue b/monolithic/frontend/src/components/ClickOutSide/src/ClickOutSide.vue new file mode 100644 index 0000000..c043cc1 --- /dev/null +++ b/monolithic/frontend/src/components/ClickOutSide/src/ClickOutSide.vue @@ -0,0 +1,19 @@ + + diff --git a/monolithic/frontend/src/components/CodeEditor/index.ts b/monolithic/frontend/src/components/CodeEditor/index.ts new file mode 100644 index 0000000..872bfed --- /dev/null +++ b/monolithic/frontend/src/components/CodeEditor/index.ts @@ -0,0 +1,8 @@ +import { withInstall } from '/@/utils'; +import codeEditor from './src/CodeEditor.vue'; +import jsonPreview from './src/json-preview/JsonPreview.vue'; + +export const CodeEditor = withInstall(codeEditor); +export const JsonPreview = withInstall(jsonPreview); + +export * from './src/typing'; diff --git a/monolithic/frontend/src/components/CodeEditor/src/CodeEditor.vue b/monolithic/frontend/src/components/CodeEditor/src/CodeEditor.vue new file mode 100644 index 0000000..618087c --- /dev/null +++ b/monolithic/frontend/src/components/CodeEditor/src/CodeEditor.vue @@ -0,0 +1,54 @@ + + diff --git a/monolithic/frontend/src/components/CodeEditor/src/codemirror/CodeMirror.vue b/monolithic/frontend/src/components/CodeEditor/src/codemirror/CodeMirror.vue new file mode 100644 index 0000000..426ac36 --- /dev/null +++ b/monolithic/frontend/src/components/CodeEditor/src/codemirror/CodeMirror.vue @@ -0,0 +1,113 @@ + + + diff --git a/monolithic/frontend/src/components/CodeEditor/src/codemirror/codeMirror.ts b/monolithic/frontend/src/components/CodeEditor/src/codemirror/codeMirror.ts new file mode 100644 index 0000000..e04f51b --- /dev/null +++ b/monolithic/frontend/src/components/CodeEditor/src/codemirror/codeMirror.ts @@ -0,0 +1,21 @@ +import CodeMirror from 'codemirror'; +import './codemirror.css'; +import 'codemirror/theme/idea.css'; +import 'codemirror/theme/material-palenight.css'; +// import 'codemirror/addon/lint/lint.css'; + +// modes +import 'codemirror/mode/javascript/javascript'; +import 'codemirror/mode/css/css'; +import 'codemirror/mode/htmlmixed/htmlmixed'; +// addons +// import 'codemirror/addon/edit/closebrackets'; +// import 'codemirror/addon/edit/closetag'; +// import 'codemirror/addon/comment/comment'; +// import 'codemirror/addon/fold/foldcode'; +// import 'codemirror/addon/fold/foldgutter'; +// import 'codemirror/addon/fold/brace-fold'; +// import 'codemirror/addon/fold/indent-fold'; +// import 'codemirror/addon/lint/json-lint'; +// import 'codemirror/addon/fold/comment-fold'; +export { CodeMirror }; diff --git a/monolithic/frontend/src/components/CodeEditor/src/codemirror/codemirror.css b/monolithic/frontend/src/components/CodeEditor/src/codemirror/codemirror.css new file mode 100644 index 0000000..c87ff66 --- /dev/null +++ b/monolithic/frontend/src/components/CodeEditor/src/codemirror/codemirror.css @@ -0,0 +1,525 @@ +/* BASICS */ + +.CodeMirror { + --base: #545281; + --comment: hsl(210deg 25% 60%); + --keyword: #af4ab1; + --variable: #0055d1; + --function: #c25205; + --string: #2ba46d; + --number: #c25205; + --tags: #d00; + --qualifier: #ff6032; + --important: var(--string); + + position: relative; + height: auto; + height: 100%; + overflow: hidden; + font-family: var(--font-code); + background: white; + direction: ltr; +} + +/* PADDING */ + +.CodeMirror-lines { + min-height: 1px; /* prevents collapsing before first draw */ + padding: 4px 0; /* Vertical padding around content */ + cursor: text; +} + +.CodeMirror-scrollbar-filler, +.CodeMirror-gutter-filler { + background-color: white; /* The little square between H and V scrollbars */ +} + +/* GUTTER */ + +.CodeMirror-gutters { + position: absolute; + top: 0; + left: 0; + z-index: 3; + min-height: 100%; + white-space: nowrap; + background-color: transparent; + border-right: 1px solid #ddd; +} + +.CodeMirror-linenumber { + min-width: 20px; + padding: 0 3px 0 5px; + color: var(--comment); + text-align: right; + white-space: nowrap; + opacity: 0.6; +} + +.CodeMirror-guttermarker { + color: black; +} + +.CodeMirror-guttermarker-subtle { + color: #999; +} + +/* FOLD GUTTER */ + +.CodeMirror-foldmarker { + font-family: arial; + line-height: 0.3; + color: #414141; + text-shadow: #f96 1px 1px 2px, #f96 -1px -1px 2px, #f96 1px -1px 2px, #f96 -1px 1px 2px; + cursor: pointer; +} + +.CodeMirror-foldgutter { + width: 0.7em; +} + +.CodeMirror-foldgutter-open, +.CodeMirror-foldgutter-folded { + cursor: pointer; +} + +.CodeMirror-foldgutter-open::after, +.CodeMirror-foldgutter-folded::after { + position: relative; + top: -0.1em; + display: inline-block; + font-size: 0.8em; + content: '>'; + opacity: 0.8; + transform: rotate(90deg); + transition: transform 0.2s; +} + +.CodeMirror-foldgutter-folded::after { + transform: none; +} + +/* CURSOR */ + +.CodeMirror-cursor { + position: absolute; + width: 0; + pointer-events: none; + border-right: none; + border-left: 1px solid black; +} + +/* Shown when moving in bi-directional text */ +.CodeMirror div.CodeMirror-secondarycursor { + border-left: 1px solid silver; +} + +.cm-fat-cursor .CodeMirror-cursor { + width: auto; + background: #7e7; + border: 0 !important; +} + +.cm-fat-cursor div.CodeMirror-cursors { + z-index: 1; +} + +.cm-fat-cursor-mark { + background-color: rgb(20 255 20 / 50%); + animation: blink 1.06s steps(1) infinite; +} + +.cm-animate-fat-cursor { + width: auto; + background-color: #7e7; + border: 0; + animation: blink 1.06s steps(1) infinite; +} +@keyframes blink { + 50% { + background-color: transparent; + } +} +@keyframes blink { + 50% { + background-color: transparent; + } +} +@keyframes blink { + 50% { + background-color: transparent; + } +} + +.cm-tab { + display: inline-block; + text-decoration: inherit; +} + +.CodeMirror-rulers { + position: absolute; + top: -50px; + right: 0; + bottom: -20px; + left: 0; + overflow: hidden; +} + +.CodeMirror-ruler { + position: absolute; + top: 0; + bottom: 0; + border-left: 1px solid #ccc; +} + +/* DEFAULT THEME */ +.cm-s-default.CodeMirror { + background-color: transparent; +} + +.cm-s-default .cm-header { + color: blue; +} + +.cm-s-default .cm-quote { + color: #090; +} + +.cm-negative { + color: #d44; +} + +.cm-positive { + color: #292; +} + +.cm-header, +.cm-strong { + font-weight: bold; +} + +.cm-em { + font-style: italic; +} + +.cm-link { + text-decoration: underline; +} + +.cm-strikethrough { + text-decoration: line-through; +} + +.cm-s-default .cm-atom, +.cm-s-default .cm-def, +.cm-s-default .cm-property, +.cm-s-default .cm-variable-2, +.cm-s-default .cm-variable-3, +.cm-s-default .cm-punctuation { + color: var(--base); +} + +.cm-s-default .cm-hr, +.cm-s-default .cm-comment { + color: var(--comment); +} + +.cm-s-default .cm-attribute, +.cm-s-default .cm-keyword { + color: var(--keyword); +} + +.cm-s-default .cm-variable { + color: var(--variable); +} + +.cm-s-default .cm-bracket, +.cm-s-default .cm-tag { + color: var(--tags); +} + +.cm-s-default .cm-number { + color: var(--number); +} + +.cm-s-default .cm-string, +.cm-s-default .cm-string-2 { + color: var(--string); +} + +.cm-s-default .cm-type { + color: #085; +} + +.cm-s-default .cm-meta { + color: #555; +} + +.cm-s-default .cm-qualifier { + color: var(--qualifier); +} + +.cm-s-default .cm-builtin { + color: #7539ff; +} + +.cm-s-default .cm-link { + color: var(--flash); +} + +.cm-s-default .cm-error { + color: #ff008c; +} + +.cm-invalidchar { + color: #ff008c; +} + +.CodeMirror-composing { + border-bottom: 2px solid; +} + +/* Default styles for common addons */ + +div.CodeMirror span.CodeMirror-matchingbracket { + color: #0b0; +} + +div.CodeMirror span.CodeMirror-nonmatchingbracket { + color: #a22; +} + +.CodeMirror-matchingtag { + background: rgb(255 150 0 / 30%); +} + +.CodeMirror-activeline-background { + background: #e8f2ff; +} + +/* STOP */ + +/* The rest of this file contains styles related to the mechanics of + the editor. You probably shouldn't touch them. */ + +.CodeMirror-scroll { + position: relative; + height: 100%; + padding-bottom: 30px; + margin-right: -30px; + + /* 30px is the magic margin used to hide the element's real scrollbars */ + + /* See overflow: hidden in .CodeMirror */ + margin-bottom: -30px; + overflow: scroll !important; /* Things will break if this is overridden */ + outline: none; /* Prevent dragging from highlighting the element */ +} + +.CodeMirror-sizer { + position: relative; + margin-bottom: 20px !important; + border-right: 30px solid transparent; +} + +/* The fake, visible scrollbars. Used to force redraw during scrolling + before actual scrolling happens, thus preventing shaking and + flickering artifacts. */ +.CodeMirror-vscrollbar, +.CodeMirror-hscrollbar, +.CodeMirror-scrollbar-filler, +.CodeMirror-gutter-filler { + position: absolute; + z-index: 6; + display: none; +} + +.CodeMirror-vscrollbar { + top: 0; + right: 0; + overflow-x: hidden; + overflow-y: scroll; +} + +.CodeMirror-hscrollbar { + bottom: 0; + left: 0; + overflow-x: scroll; + overflow-y: hidden; +} + +.CodeMirror-scrollbar-filler { + right: 0; + bottom: 0; +} + +.CodeMirror-gutter-filler { + bottom: 0; + left: 0; +} + +.CodeMirror-gutter { + display: inline-block; + height: 100%; + margin-bottom: -30px; + white-space: normal; + vertical-align: top; +} + +.CodeMirror-gutter-wrapper { + position: absolute; + z-index: 4; + background: none !important; + border: none !important; +} + +.CodeMirror-gutter-background { + position: absolute; + top: 0; + bottom: 0; + z-index: 4; +} + +.CodeMirror-gutter-elt { + position: absolute; + z-index: 4; + cursor: default; +} + +.CodeMirror-gutter-wrapper ::selection { + background-color: transparent; +} + +.CodeMirrorwrapper ::selection { + background-color: transparent; +} + +.CodeMirror pre { + position: relative; + z-index: 2; + padding: 0 4px; /* Horizontal padding of content */ + margin: 0; + overflow: visible; + font-family: inherit; + font-size: inherit; + line-height: inherit; + color: inherit; + word-wrap: normal; + white-space: pre; + background: transparent; + border-width: 0; + + /* Reset some styles that the rest of the page might have set */ + border-radius: 0; + -webkit-tap-highlight-color: transparent; + font-variant-ligatures: contextual; +} + +.CodeMirror-wrap pre { + word-break: normal; + word-wrap: break-word; + white-space: pre-wrap; +} + +.CodeMirror-linebackground { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 0; +} + +.CodeMirror-linewidget { + position: relative; + z-index: 2; + padding: 0.1px; /* Force widget margins to stay inside of the container */ +} + +.CodeMirror-rtl pre { + direction: rtl; +} + +.CodeMirror-code { + outline: none; +} + +/* Force content-box sizing for the elements where we expect it */ +.CodeMirror-scroll, +.CodeMirror-sizer, +.CodeMirror-gutter, +.CodeMirror-gutters, +.CodeMirror-linenumber { + box-sizing: content-box; +} + +.CodeMirror-measure { + position: absolute; + width: 100%; + height: 0; + overflow: hidden; + visibility: hidden; +} + +.CodeMirror-measure pre { + position: static; +} + +div.CodeMirror-cursors { + position: relative; + z-index: 3; + visibility: hidden; +} + +div.CodeMirror-dragcursors { + visibility: visible; +} + +.CodeMirror-focused div.CodeMirror-cursors { + visibility: visible; +} + +.CodeMirror-selected { + background: #d9d9d9; +} + +.CodeMirror-focused .CodeMirror-selected { + background: #d7d4f0; +} + +.CodeMirror-crosshair { + cursor: crosshair; +} + +.CodeMirror-line::selection, +.CodeMirror-line > span::selection, +.CodeMirror-line > span > span::selection { + background: #d7d4f0; +} + +.cm-searching { + background-color: #ffa; + background-color: rgb(255 255 0 / 40%); +} + +/* Used to force a border model for a node */ +.cm-force-border { + padding-right: 0.1px; +} + +@media print { + /* Hide the cursor when printing */ + .CodeMirror div.CodeMirror-cursors { + visibility: hidden; + } +} + +/* See issue #2901 */ +.cm-tab-wrap-hack::after { + content: ''; +} + +/* Help users use markselection to safely style text background */ +span.CodeMirror-selectedtext { + background: none; +} diff --git a/monolithic/frontend/src/components/CodeEditor/src/json-preview/JsonPreview.vue b/monolithic/frontend/src/components/CodeEditor/src/json-preview/JsonPreview.vue new file mode 100644 index 0000000..75890c3 --- /dev/null +++ b/monolithic/frontend/src/components/CodeEditor/src/json-preview/JsonPreview.vue @@ -0,0 +1,12 @@ + + + diff --git a/monolithic/frontend/src/components/CodeEditor/src/typing.ts b/monolithic/frontend/src/components/CodeEditor/src/typing.ts new file mode 100644 index 0000000..34b5ed1 --- /dev/null +++ b/monolithic/frontend/src/components/CodeEditor/src/typing.ts @@ -0,0 +1,5 @@ +export enum MODE { + JSON = 'application/json', + HTML = 'htmlmixed', + JS = 'javascript', +} diff --git a/monolithic/frontend/src/components/Container/index.ts b/monolithic/frontend/src/components/Container/index.ts new file mode 100644 index 0000000..e1230a0 --- /dev/null +++ b/monolithic/frontend/src/components/Container/index.ts @@ -0,0 +1,10 @@ +import { withInstall } from '/@/utils'; +import collapseContainer from './src/collapse/CollapseContainer.vue'; +import scrollContainer from './src/ScrollContainer.vue'; +import lazyContainer from './src/LazyContainer.vue'; + +export const CollapseContainer = withInstall(collapseContainer); +export const ScrollContainer = withInstall(scrollContainer); +export const LazyContainer = withInstall(lazyContainer); + +export * from './src/typing'; diff --git a/monolithic/frontend/src/components/Container/src/LazyContainer.vue b/monolithic/frontend/src/components/Container/src/LazyContainer.vue new file mode 100644 index 0000000..7b35fa2 --- /dev/null +++ b/monolithic/frontend/src/components/Container/src/LazyContainer.vue @@ -0,0 +1,145 @@ + + diff --git a/monolithic/frontend/src/components/Container/src/ScrollContainer.vue b/monolithic/frontend/src/components/Container/src/ScrollContainer.vue new file mode 100644 index 0000000..65c71ed --- /dev/null +++ b/monolithic/frontend/src/components/Container/src/ScrollContainer.vue @@ -0,0 +1,93 @@ + + + + diff --git a/monolithic/frontend/src/components/Container/src/collapse/CollapseContainer.vue b/monolithic/frontend/src/components/Container/src/collapse/CollapseContainer.vue new file mode 100644 index 0000000..d60d519 --- /dev/null +++ b/monolithic/frontend/src/components/Container/src/collapse/CollapseContainer.vue @@ -0,0 +1,110 @@ + + + diff --git a/monolithic/frontend/src/components/Container/src/collapse/CollapseHeader.vue b/monolithic/frontend/src/components/Container/src/collapse/CollapseHeader.vue new file mode 100644 index 0000000..4196c0a --- /dev/null +++ b/monolithic/frontend/src/components/Container/src/collapse/CollapseHeader.vue @@ -0,0 +1,38 @@ + + diff --git a/monolithic/frontend/src/components/Container/src/typing.ts b/monolithic/frontend/src/components/Container/src/typing.ts new file mode 100644 index 0000000..86c03be --- /dev/null +++ b/monolithic/frontend/src/components/Container/src/typing.ts @@ -0,0 +1,17 @@ +export type ScrollType = 'default' | 'main'; + +export interface CollapseContainerOptions { + canExpand?: boolean; + title?: string; + helpMessage?: Array | string; +} +export interface ScrollContainerOptions { + enableScroll?: boolean; + type?: ScrollType; +} + +export type ScrollActionType = RefType<{ + scrollBottom: () => void; + getScrollWrap: () => Nullable; + scrollTo: (top: number) => void; +}>; diff --git a/monolithic/frontend/src/components/ContextMenu/index.ts b/monolithic/frontend/src/components/ContextMenu/index.ts new file mode 100644 index 0000000..ed294d7 --- /dev/null +++ b/monolithic/frontend/src/components/ContextMenu/index.ts @@ -0,0 +1,3 @@ +export { createContextMenu, destroyContextMenu } from './src/createContextMenu'; + +export * from './src/typing'; diff --git a/monolithic/frontend/src/components/ContextMenu/src/ContextMenu.vue b/monolithic/frontend/src/components/ContextMenu/src/ContextMenu.vue new file mode 100644 index 0000000..f2c9fc5 --- /dev/null +++ b/monolithic/frontend/src/components/ContextMenu/src/ContextMenu.vue @@ -0,0 +1,209 @@ + + diff --git a/monolithic/frontend/src/components/ContextMenu/src/createContextMenu.ts b/monolithic/frontend/src/components/ContextMenu/src/createContextMenu.ts new file mode 100644 index 0000000..36c620c --- /dev/null +++ b/monolithic/frontend/src/components/ContextMenu/src/createContextMenu.ts @@ -0,0 +1,75 @@ +import contextMenuVue from './ContextMenu.vue'; +import { isClient } from '/@/utils/is'; +import { CreateContextOptions, ContextMenuProps } from './typing'; +import { createVNode, render } from 'vue'; + +const menuManager: { + domList: Element[]; + resolve: Fn; +} = { + domList: [], + resolve: () => {}, +}; + +export const createContextMenu = function (options: CreateContextOptions) { + const { event } = options || {}; + + event && event?.preventDefault(); + + if (!isClient) { + return; + } + return new Promise((resolve) => { + const body = document.body; + + const container = document.createElement('div'); + const propsData: Partial = {}; + if (options.styles) { + propsData.styles = options.styles; + } + + if (options.items) { + propsData.items = options.items; + } + + if (options.event) { + propsData.customEvent = event; + propsData.axis = { x: event.clientX, y: event.clientY }; + } + + const vm = createVNode(contextMenuVue, propsData); + render(vm, container); + + const handleClick = function () { + menuManager.resolve(''); + }; + + menuManager.domList.push(container); + + const remove = function () { + menuManager.domList.forEach((dom: Element) => { + try { + dom && body.removeChild(dom); + } catch (e: any) {} + }); + body.removeEventListener('click', handleClick); + body.removeEventListener('scroll', handleClick); + }; + + menuManager.resolve = function (arg) { + remove(); + resolve(arg); + }; + remove(); + body.appendChild(container); + body.addEventListener('click', handleClick); + body.addEventListener('scroll', handleClick); + }); +}; + +export const destroyContextMenu = function () { + if (menuManager) { + menuManager.resolve(''); + menuManager.domList = []; + } +}; diff --git a/monolithic/frontend/src/components/ContextMenu/src/typing.ts b/monolithic/frontend/src/components/ContextMenu/src/typing.ts new file mode 100644 index 0000000..63d3d37 --- /dev/null +++ b/monolithic/frontend/src/components/ContextMenu/src/typing.ts @@ -0,0 +1,36 @@ +export interface Axis { + x: number; + y: number; +} + +export interface ContextMenuItem { + label: string; + icon?: string; + hidden?: boolean; + disabled?: boolean; + handler?: Fn; + divider?: boolean; + children?: ContextMenuItem[]; +} +export interface CreateContextOptions { + event: MouseEvent; + icon?: string; + styles?: any; + items?: ContextMenuItem[]; +} + +export interface ContextMenuProps { + event?: MouseEvent; + styles?: any; + items: ContextMenuItem[]; + customEvent?: MouseEvent; + axis?: Axis; + width?: number; + showIcon?: boolean; +} + +export interface ItemContentProps { + showIcon: boolean | undefined; + item: ContextMenuItem; + handler: Fn; +} diff --git a/monolithic/frontend/src/components/CountDown/index.ts b/monolithic/frontend/src/components/CountDown/index.ts new file mode 100644 index 0000000..9809416 --- /dev/null +++ b/monolithic/frontend/src/components/CountDown/index.ts @@ -0,0 +1,6 @@ +import { withInstall } from '/@/utils'; +import countButton from './src/CountButton.vue'; +import countdownInput from './src/CountdownInput.vue'; + +export const CountdownInput = withInstall(countdownInput); +export const CountButton = withInstall(countButton); diff --git a/monolithic/frontend/src/components/CountDown/src/CountButton.vue b/monolithic/frontend/src/components/CountDown/src/CountButton.vue new file mode 100644 index 0000000..1ef520e --- /dev/null +++ b/monolithic/frontend/src/components/CountDown/src/CountButton.vue @@ -0,0 +1,62 @@ + + diff --git a/monolithic/frontend/src/components/CountDown/src/CountdownInput.vue b/monolithic/frontend/src/components/CountDown/src/CountdownInput.vue new file mode 100644 index 0000000..8da89cd --- /dev/null +++ b/monolithic/frontend/src/components/CountDown/src/CountdownInput.vue @@ -0,0 +1,54 @@ + + + diff --git a/monolithic/frontend/src/components/CountDown/src/useCountdown.ts b/monolithic/frontend/src/components/CountDown/src/useCountdown.ts new file mode 100644 index 0000000..316d69a --- /dev/null +++ b/monolithic/frontend/src/components/CountDown/src/useCountdown.ts @@ -0,0 +1,51 @@ +import { ref, unref } from 'vue'; +import { tryOnUnmounted } from '@vueuse/core'; + +export function useCountdown(count: number) { + const currentCount = ref(count); + + const isStart = ref(false); + + let timerId: ReturnType | null; + + function clear() { + timerId && window.clearInterval(timerId); + } + + function stop() { + isStart.value = false; + clear(); + timerId = null; + } + + function start() { + if (unref(isStart) || !!timerId) { + return; + } + isStart.value = true; + timerId = setInterval(() => { + if (unref(currentCount) === 1) { + stop(); + currentCount.value = count; + } else { + currentCount.value -= 1; + } + }, 1000); + } + + function reset() { + currentCount.value = count; + stop(); + } + + function restart() { + reset(); + start(); + } + + tryOnUnmounted(() => { + reset(); + }); + + return { start, reset, restart, clear, stop, currentCount, isStart }; +} diff --git a/monolithic/frontend/src/components/CountTo/index.ts b/monolithic/frontend/src/components/CountTo/index.ts new file mode 100644 index 0000000..36a4e65 --- /dev/null +++ b/monolithic/frontend/src/components/CountTo/index.ts @@ -0,0 +1,4 @@ +import { withInstall } from '/@/utils'; +import countTo from './src/CountTo.vue'; + +export const CountTo = withInstall(countTo); diff --git a/monolithic/frontend/src/components/CountTo/src/CountTo.vue b/monolithic/frontend/src/components/CountTo/src/CountTo.vue new file mode 100644 index 0000000..7de3361 --- /dev/null +++ b/monolithic/frontend/src/components/CountTo/src/CountTo.vue @@ -0,0 +1,110 @@ + + diff --git a/monolithic/frontend/src/components/Cropper/index.ts b/monolithic/frontend/src/components/Cropper/index.ts new file mode 100644 index 0000000..88d6d1d --- /dev/null +++ b/monolithic/frontend/src/components/Cropper/index.ts @@ -0,0 +1,7 @@ +import { withInstall } from '/@/utils'; +import cropperImage from './src/Cropper.vue'; +import avatarCropper from './src/CropperAvatar.vue'; + +export * from './src/typing'; +export const CropperImage = withInstall(cropperImage); +export const CropperAvatar = withInstall(avatarCropper); diff --git a/monolithic/frontend/src/components/Cropper/src/CopperModal.vue b/monolithic/frontend/src/components/Cropper/src/CopperModal.vue new file mode 100644 index 0000000..2ec7f4f --- /dev/null +++ b/monolithic/frontend/src/components/Cropper/src/CopperModal.vue @@ -0,0 +1,283 @@ + + + + diff --git a/monolithic/frontend/src/components/Cropper/src/Cropper.vue b/monolithic/frontend/src/components/Cropper/src/Cropper.vue new file mode 100644 index 0000000..4523ad4 --- /dev/null +++ b/monolithic/frontend/src/components/Cropper/src/Cropper.vue @@ -0,0 +1,188 @@ + + + diff --git a/monolithic/frontend/src/components/Cropper/src/CropperAvatar.vue b/monolithic/frontend/src/components/Cropper/src/CropperAvatar.vue new file mode 100644 index 0000000..7ddce00 --- /dev/null +++ b/monolithic/frontend/src/components/Cropper/src/CropperAvatar.vue @@ -0,0 +1,161 @@ + + + + diff --git a/monolithic/frontend/src/components/Cropper/src/typing.ts b/monolithic/frontend/src/components/Cropper/src/typing.ts new file mode 100644 index 0000000..e76cc6f --- /dev/null +++ b/monolithic/frontend/src/components/Cropper/src/typing.ts @@ -0,0 +1,8 @@ +import type Cropper from 'cropperjs'; + +export interface CropendResult { + imgBase64: string; + imgInfo: Cropper.Data; +} + +export type { Cropper }; diff --git a/monolithic/frontend/src/components/Description/index.ts b/monolithic/frontend/src/components/Description/index.ts new file mode 100644 index 0000000..58277d0 --- /dev/null +++ b/monolithic/frontend/src/components/Description/index.ts @@ -0,0 +1,6 @@ +import { withInstall } from '/@/utils'; +import description from './src/Description.vue'; + +export * from './src/typing'; +export { useDescription } from './src/useDescription'; +export const Description = withInstall(description); diff --git a/monolithic/frontend/src/components/Description/src/Description.vue b/monolithic/frontend/src/components/Description/src/Description.vue new file mode 100644 index 0000000..1238acc --- /dev/null +++ b/monolithic/frontend/src/components/Description/src/Description.vue @@ -0,0 +1,184 @@ + diff --git a/monolithic/frontend/src/components/Description/src/typing.ts b/monolithic/frontend/src/components/Description/src/typing.ts new file mode 100644 index 0000000..ee96084 --- /dev/null +++ b/monolithic/frontend/src/components/Description/src/typing.ts @@ -0,0 +1,50 @@ +import type { VNode, CSSProperties } from 'vue'; +import type { CollapseContainerOptions } from '/@/components/Container/index'; +import type { DescriptionsProps } from 'ant-design-vue/es/descriptions/index'; + +export interface DescItem { + labelMinWidth?: number; + contentMinWidth?: number; + labelStyle?: CSSProperties; + field: string; + label: string | VNode | JSX.Element; + // Merge column + span?: number; + show?: (...arg: any) => boolean; + // render + render?: ( + val: any, + data: Recordable, + ) => VNode | undefined | JSX.Element | Element | string | number; +} + +export interface DescriptionProps extends DescriptionsProps { + // Whether to include the collapse component + useCollapse?: boolean; + /** + * item configuration + * @type DescItem + */ + schema: DescItem[]; + /** + * 数据 + * @type object + */ + data: Recordable; + /** + * Built-in CollapseContainer component configuration + * @type CollapseContainerOptions + */ + collapseOptions?: CollapseContainerOptions; +} + +export interface DescInstance { + setDescProps(descProps: Partial): void; +} + +export type Register = (descInstance: DescInstance) => void; + +/** + * @description: + */ +export type UseDescReturnType = [Register, DescInstance]; diff --git a/monolithic/frontend/src/components/Description/src/useDescription.ts b/monolithic/frontend/src/components/Description/src/useDescription.ts new file mode 100644 index 0000000..d1037d0 --- /dev/null +++ b/monolithic/frontend/src/components/Description/src/useDescription.ts @@ -0,0 +1,28 @@ +import type { DescriptionProps, DescInstance, UseDescReturnType } from './typing'; +import { ref, getCurrentInstance, unref } from 'vue'; +import { isProdMode } from '/@/utils/env'; + +export function useDescription(props?: Partial): UseDescReturnType { + if (!getCurrentInstance()) { + throw new Error('useDescription() can only be used inside setup() or functional components!'); + } + const desc = ref>(null); + const loaded = ref(false); + + function register(instance: DescInstance) { + if (unref(loaded) && isProdMode()) { + return; + } + desc.value = instance; + props && instance.setDescProps(props); + loaded.value = true; + } + + const methods: DescInstance = { + setDescProps: (descProps: Partial): void => { + unref(desc)?.setDescProps(descProps); + }, + }; + + return [register, methods]; +} diff --git a/monolithic/frontend/src/components/Drawer/index.ts b/monolithic/frontend/src/components/Drawer/index.ts new file mode 100644 index 0000000..820ade5 --- /dev/null +++ b/monolithic/frontend/src/components/Drawer/index.ts @@ -0,0 +1,6 @@ +import { withInstall } from '/@/utils'; +import basicDrawer from './src/BasicDrawer.vue'; + +export const BasicDrawer = withInstall(basicDrawer); +export * from './src/typing'; +export { useDrawer, useDrawerInner } from './src/useDrawer'; diff --git a/monolithic/frontend/src/components/Drawer/src/BasicDrawer.vue b/monolithic/frontend/src/components/Drawer/src/BasicDrawer.vue new file mode 100644 index 0000000..857b69b --- /dev/null +++ b/monolithic/frontend/src/components/Drawer/src/BasicDrawer.vue @@ -0,0 +1,256 @@ + + + diff --git a/monolithic/frontend/src/components/Drawer/src/components/DrawerFooter.vue b/monolithic/frontend/src/components/Drawer/src/components/DrawerFooter.vue new file mode 100644 index 0000000..7a3992f --- /dev/null +++ b/monolithic/frontend/src/components/Drawer/src/components/DrawerFooter.vue @@ -0,0 +1,82 @@ + + + + diff --git a/monolithic/frontend/src/components/Drawer/src/components/DrawerHeader.vue b/monolithic/frontend/src/components/Drawer/src/components/DrawerHeader.vue new file mode 100644 index 0000000..8232128 --- /dev/null +++ b/monolithic/frontend/src/components/Drawer/src/components/DrawerHeader.vue @@ -0,0 +1,74 @@ + + + + diff --git a/monolithic/frontend/src/components/Drawer/src/props.ts b/monolithic/frontend/src/components/Drawer/src/props.ts new file mode 100644 index 0000000..0a7ca8c --- /dev/null +++ b/monolithic/frontend/src/components/Drawer/src/props.ts @@ -0,0 +1,44 @@ +import type { PropType } from 'vue'; + +import { useI18n } from '/@/hooks/web/useI18n'; +const { t } = useI18n(); + +export const footerProps = { + confirmLoading: { type: Boolean }, + /** + * @description: Show close button + */ + showCancelBtn: { type: Boolean, default: true }, + cancelButtonProps: Object as PropType, + cancelText: { type: String, default: t('common.cancelText') }, + /** + * @description: Show confirmation button + */ + showOkBtn: { type: Boolean, default: true }, + okButtonProps: Object as PropType, + okText: { type: String, default: t('common.okText') }, + okType: { type: String, default: 'primary' }, + showFooter: { type: Boolean }, + footerHeight: { + type: [String, Number] as PropType, + default: 60, + }, +}; +export const basicProps = { + isDetail: { type: Boolean }, + title: { type: String, default: '' }, + loadingText: { type: String }, + showDetailBack: { type: Boolean, default: true }, + visible: { type: Boolean }, + loading: { type: Boolean }, + maskClosable: { type: Boolean, default: true }, + getContainer: { + type: [Object, String] as PropType, + }, + closeFunc: { + type: [Function, Object] as PropType, + default: null, + }, + destroyOnClose: { type: Boolean }, + ...footerProps, +}; diff --git a/monolithic/frontend/src/components/Drawer/src/typing.ts b/monolithic/frontend/src/components/Drawer/src/typing.ts new file mode 100644 index 0000000..51724a1 --- /dev/null +++ b/monolithic/frontend/src/components/Drawer/src/typing.ts @@ -0,0 +1,193 @@ +import type { ButtonProps } from 'ant-design-vue/lib/button/buttonTypes'; +import type { CSSProperties, VNodeChild, ComputedRef } from 'vue'; +import type { ScrollContainerOptions } from '/@/components/Container/index'; + +export interface DrawerInstance { + setDrawerProps: (props: Partial | boolean) => void; + emitVisible?: (visible: boolean, uid: number) => void; +} + +export interface ReturnMethods extends DrawerInstance { + openDrawer: (visible?: boolean, data?: T, openOnSet?: boolean) => void; + closeDrawer: () => void; + getVisible?: ComputedRef; +} + +export type RegisterFn = (drawerInstance: DrawerInstance, uuid?: string) => void; + +export interface ReturnInnerMethods extends DrawerInstance { + closeDrawer: () => void; + changeLoading: (loading: boolean) => void; + changeOkLoading: (loading: boolean) => void; + getVisible?: ComputedRef; +} + +export type UseDrawerReturnType = [RegisterFn, ReturnMethods]; + +export type UseDrawerInnerReturnType = [RegisterFn, ReturnInnerMethods]; + +export interface DrawerFooterProps { + showOkBtn: boolean; + showCancelBtn: boolean; + /** + * Text of the Cancel button + * @default 'cancel' + * @type string + */ + cancelText: string; + /** + * Text of the OK button + * @default 'OK' + * @type string + */ + okText: string; + + /** + * Button type of the OK button + * @default 'primary' + * @type string + */ + okType: 'primary' | 'danger' | 'dashed' | 'ghost' | 'default'; + /** + * The ok button props, follow jsx rules + * @type object + */ + okButtonProps: { props: ButtonProps; on: {} }; + + /** + * The cancel button props, follow jsx rules + * @type object + */ + cancelButtonProps: { props: ButtonProps; on: {} }; + /** + * Whether to apply loading visual effect for OK button or not + * @default false + * @type boolean + */ + confirmLoading: boolean; + + showFooter: boolean; + footerHeight: string | number; +} +export interface DrawerProps extends DrawerFooterProps { + isDetail?: boolean; + loading?: boolean; + showDetailBack?: boolean; + visible?: boolean; + /** + * Built-in ScrollContainer component configuration + * @type ScrollContainerOptions + */ + scrollOptions?: ScrollContainerOptions; + closeFunc?: () => Promise; + triggerWindowResize?: boolean; + /** + * Whether a close (x) button is visible on top right of the Drawer dialog or not. + * @default true + * @type boolean + */ + closable?: boolean; + + /** + * Whether to unmount child components on closing drawer or not. + * @default false + * @type boolean + */ + destroyOnClose?: boolean; + + /** + * Return the mounted node for Drawer. + * @default 'body' + * @type any ( HTMLElement| () => HTMLElement | string) + */ + getContainer?: () => HTMLElement | string; + + /** + * Whether to show mask or not. + * @default true + * @type boolean + */ + mask?: boolean; + + /** + * Clicking on the mask (area outside the Drawer) to close the Drawer or not. + * @default true + * @type boolean + */ + maskClosable?: boolean; + + /** + * Style for Drawer's mask element. + * @default {} + * @type object + */ + maskStyle?: CSSProperties; + + /** + * The title for Drawer. + * @type any (string | slot) + */ + title?: VNodeChild | JSX.Element; + /** + * The class name of the container of the Drawer dialog. + * @type string + */ + wrapClassName?: string; + class?: string; + /** + * Style of wrapper element which **contains mask** compare to `drawerStyle` + * @type object + */ + wrapStyle?: CSSProperties; + + /** + * Style of the popup layer element + * @type object + */ + drawerStyle?: CSSProperties; + + /** + * Style of floating layer, typically used for adjusting its position. + * @type object + */ + bodyStyle?: CSSProperties; + headerStyle?: CSSProperties; + + /** + * Width of the Drawer dialog. + * @default 256 + * @type string | number + */ + width?: string | number; + + /** + * placement is top or bottom, height of the Drawer dialog. + * @type string | number + */ + height?: string | number; + + /** + * The z-index of the Drawer. + * @default 1000 + * @type number + */ + zIndex?: number; + + /** + * The placement of the Drawer. + * @default 'right' + * @type string + */ + placement?: 'top' | 'right' | 'bottom' | 'left'; + afterVisibleChange?: (visible?: boolean) => void; + keyboard?: boolean; + /** + * Specify a callback that will be called when a user clicks mask, close button or Cancel button. + */ + onClose?: (e?: Event) => void; +} +export interface DrawerActionType { + scrollBottom: () => void; + scrollTo: (to: number) => void; + getScrollWrap: () => Element | null; +} diff --git a/monolithic/frontend/src/components/Drawer/src/useDrawer.ts b/monolithic/frontend/src/components/Drawer/src/useDrawer.ts new file mode 100644 index 0000000..bcb9e76 --- /dev/null +++ b/monolithic/frontend/src/components/Drawer/src/useDrawer.ts @@ -0,0 +1,161 @@ +import type { + UseDrawerReturnType, + DrawerInstance, + ReturnMethods, + DrawerProps, + UseDrawerInnerReturnType, +} from './typing'; +import { + ref, + getCurrentInstance, + unref, + reactive, + watchEffect, + nextTick, + toRaw, + computed, +} from 'vue'; +import { isProdMode } from '/@/utils/env'; +import { isFunction } from '/@/utils/is'; +import { tryOnUnmounted } from '@vueuse/core'; +import { isEqual } from 'lodash-es'; +import { error } from '/@/utils/log'; + +const dataTransferRef = reactive({}); + +const visibleData = reactive<{ [key: number]: boolean }>({}); + +/** + * @description: Applicable to separate drawer and call outside + */ +export function useDrawer(): UseDrawerReturnType { + if (!getCurrentInstance()) { + throw new Error('useDrawer() can only be used inside setup() or functional components!'); + } + const drawer = ref(null); + const loaded = ref>(false); + const uid = ref(''); + + function register(drawerInstance: DrawerInstance, uuid: string) { + isProdMode() && + tryOnUnmounted(() => { + drawer.value = null; + loaded.value = null; + dataTransferRef[unref(uid)] = null; + }); + + if (unref(loaded) && isProdMode() && drawerInstance === unref(drawer)) { + return; + } + uid.value = uuid; + drawer.value = drawerInstance; + loaded.value = true; + + drawerInstance.emitVisible = (visible: boolean, uid: number) => { + visibleData[uid] = visible; + }; + } + + const getInstance = () => { + const instance = unref(drawer); + if (!instance) { + error('useDrawer instance is undefined!'); + } + return instance; + }; + + const methods: ReturnMethods = { + setDrawerProps: (props: Partial): void => { + getInstance()?.setDrawerProps(props); + }, + + getVisible: computed((): boolean => { + return visibleData[~~unref(uid)]; + }), + + openDrawer: (visible = true, data?: T, openOnSet = true): void => { + getInstance()?.setDrawerProps({ + visible: visible, + }); + if (!data) return; + + if (openOnSet) { + dataTransferRef[unref(uid)] = null; + dataTransferRef[unref(uid)] = toRaw(data); + return; + } + const equal = isEqual(toRaw(dataTransferRef[unref(uid)]), toRaw(data)); + if (!equal) { + dataTransferRef[unref(uid)] = toRaw(data); + } + }, + closeDrawer: () => { + getInstance()?.setDrawerProps({ visible: false }); + }, + }; + + return [register, methods]; +} + +export const useDrawerInner = (callbackFn?: Fn): UseDrawerInnerReturnType => { + const drawerInstanceRef = ref>(null); + const currentInstance = getCurrentInstance(); + const uidRef = ref(''); + + if (!getCurrentInstance()) { + throw new Error('useDrawerInner() can only be used inside setup() or functional components!'); + } + + const getInstance = () => { + const instance = unref(drawerInstanceRef); + if (!instance) { + error('useDrawerInner instance is undefined!'); + return; + } + return instance; + }; + + const register = (modalInstance: DrawerInstance, uuid: string) => { + isProdMode() && + tryOnUnmounted(() => { + drawerInstanceRef.value = null; + }); + + uidRef.value = uuid; + drawerInstanceRef.value = modalInstance; + currentInstance?.emit('register', modalInstance, uuid); + }; + + watchEffect(() => { + const data = dataTransferRef[unref(uidRef)]; + if (!data) return; + if (!callbackFn || !isFunction(callbackFn)) return; + nextTick(() => { + callbackFn(data); + }); + }); + + return [ + register, + { + changeLoading: (loading = true) => { + getInstance()?.setDrawerProps({ loading }); + }, + + changeOkLoading: (loading = true) => { + getInstance()?.setDrawerProps({ confirmLoading: loading }); + }, + getVisible: computed((): boolean => { + return visibleData[~~unref(uidRef)]; + }), + + closeDrawer: () => { + getInstance()?.setDrawerProps({ visible: false }); + }, + + setDrawerProps: (props: Partial) => { + getInstance()?.setDrawerProps(props); + }, + }, + ]; +}; diff --git a/monolithic/frontend/src/components/Dropdown/index.ts b/monolithic/frontend/src/components/Dropdown/index.ts new file mode 100644 index 0000000..80439e5 --- /dev/null +++ b/monolithic/frontend/src/components/Dropdown/index.ts @@ -0,0 +1,5 @@ +import { withInstall } from '/@/utils'; +import dropdown from './src/Dropdown.vue'; + +export * from './src/typing'; +export const Dropdown = withInstall(dropdown); diff --git a/monolithic/frontend/src/components/Dropdown/src/Dropdown.vue b/monolithic/frontend/src/components/Dropdown/src/Dropdown.vue new file mode 100644 index 0000000..c70a99e --- /dev/null +++ b/monolithic/frontend/src/components/Dropdown/src/Dropdown.vue @@ -0,0 +1,96 @@ + + + diff --git a/monolithic/frontend/src/components/Dropdown/src/typing.ts b/monolithic/frontend/src/components/Dropdown/src/typing.ts new file mode 100644 index 0000000..29de8cb --- /dev/null +++ b/monolithic/frontend/src/components/Dropdown/src/typing.ts @@ -0,0 +1,9 @@ +export interface DropMenu { + onClick?: Fn; + to?: string; + icon?: string; + event: string | number; + text: string; + disabled?: boolean; + divider?: boolean; +} diff --git a/monolithic/frontend/src/components/Excel/index.ts b/monolithic/frontend/src/components/Excel/index.ts new file mode 100644 index 0000000..cece07c --- /dev/null +++ b/monolithic/frontend/src/components/Excel/index.ts @@ -0,0 +1,8 @@ +import { withInstall } from '/@/utils'; +import impExcel from './src/ImportExcel.vue'; +import expExcelModal from './src/ExportExcelModal.vue'; + +export const ImpExcel = withInstall(impExcel); +export const ExpExcelModal = withInstall(expExcelModal); +export * from './src/typing'; +export { jsonToSheetXlsx, aoaToSheetXlsx } from './src/Export2Excel'; diff --git a/monolithic/frontend/src/components/Excel/src/Export2Excel.ts b/monolithic/frontend/src/components/Excel/src/Export2Excel.ts new file mode 100644 index 0000000..952ac45 --- /dev/null +++ b/monolithic/frontend/src/components/Excel/src/Export2Excel.ts @@ -0,0 +1,59 @@ +import * as xlsx from 'xlsx'; +import type { WorkBook } from 'xlsx'; +import type { JsonToSheet, AoAToSheet } from './typing'; + +const { utils, writeFile } = xlsx; + +const DEF_FILE_NAME = 'excel-list.xlsx'; + +export function jsonToSheetXlsx({ + data, + header, + filename = DEF_FILE_NAME, + json2sheetOpts = {}, + write2excelOpts = { bookType: 'xlsx' }, +}: JsonToSheet) { + const arrData = [...data]; + if (header) { + arrData.unshift(header); + json2sheetOpts.skipHeader = true; + } + + const worksheet = utils.json_to_sheet(arrData, json2sheetOpts); + + /* add worksheet to workbook */ + const workbook: WorkBook = { + SheetNames: [filename], + Sheets: { + [filename]: worksheet, + }, + }; + /* output format determined by filename */ + writeFile(workbook, filename, write2excelOpts); + /* at this point, out.xlsb will have been downloaded */ +} + +export function aoaToSheetXlsx({ + data, + header, + filename = DEF_FILE_NAME, + write2excelOpts = { bookType: 'xlsx' }, +}: AoAToSheet) { + const arrData = [...data]; + if (header) { + arrData.unshift(header); + } + + const worksheet = utils.aoa_to_sheet(arrData); + + /* add worksheet to workbook */ + const workbook: WorkBook = { + SheetNames: [filename], + Sheets: { + [filename]: worksheet, + }, + }; + /* output format determined by filename */ + writeFile(workbook, filename, write2excelOpts); + /* at this point, out.xlsb will have been downloaded */ +} diff --git a/monolithic/frontend/src/components/Excel/src/ExportExcelModal.vue b/monolithic/frontend/src/components/Excel/src/ExportExcelModal.vue new file mode 100644 index 0000000..efa3292 --- /dev/null +++ b/monolithic/frontend/src/components/Excel/src/ExportExcelModal.vue @@ -0,0 +1,91 @@ + + diff --git a/monolithic/frontend/src/components/Excel/src/ImportExcel.vue b/monolithic/frontend/src/components/Excel/src/ImportExcel.vue new file mode 100644 index 0000000..ac41385 --- /dev/null +++ b/monolithic/frontend/src/components/Excel/src/ImportExcel.vue @@ -0,0 +1,166 @@ + + diff --git a/monolithic/frontend/src/components/Excel/src/typing.ts b/monolithic/frontend/src/components/Excel/src/typing.ts new file mode 100644 index 0000000..e55e549 --- /dev/null +++ b/monolithic/frontend/src/components/Excel/src/typing.ts @@ -0,0 +1,27 @@ +import type { JSON2SheetOpts, WritingOptions, BookType } from 'xlsx'; + +export interface ExcelData { + header: string[]; + results: T[]; + meta: { sheetName: string }; +} + +export interface JsonToSheet { + data: T[]; + header?: T; + filename?: string; + json2sheetOpts?: JSON2SheetOpts; + write2excelOpts?: WritingOptions; +} + +export interface AoAToSheet { + data: T[][]; + header?: T[]; + filename?: string; + write2excelOpts?: WritingOptions; +} + +export interface ExportModalResult { + filename: string; + bookType: BookType; +} diff --git a/monolithic/frontend/src/components/FlowChart/index.ts b/monolithic/frontend/src/components/FlowChart/index.ts new file mode 100644 index 0000000..edbeb55 --- /dev/null +++ b/monolithic/frontend/src/components/FlowChart/index.ts @@ -0,0 +1,4 @@ +import { withInstall } from '/@/utils'; +import flowChart from './src/FlowChart.vue'; + +export const FlowChart = withInstall(flowChart); diff --git a/monolithic/frontend/src/components/FlowChart/src/FlowChart.vue b/monolithic/frontend/src/components/FlowChart/src/FlowChart.vue new file mode 100644 index 0000000..419b0fe --- /dev/null +++ b/monolithic/frontend/src/components/FlowChart/src/FlowChart.vue @@ -0,0 +1,158 @@ + + diff --git a/monolithic/frontend/src/components/FlowChart/src/FlowChartToolbar.vue b/monolithic/frontend/src/components/FlowChart/src/FlowChartToolbar.vue new file mode 100644 index 0000000..c88af5c --- /dev/null +++ b/monolithic/frontend/src/components/FlowChart/src/FlowChartToolbar.vue @@ -0,0 +1,162 @@ + + + diff --git a/monolithic/frontend/src/components/FlowChart/src/adpterForTurbo.ts b/monolithic/frontend/src/components/FlowChart/src/adpterForTurbo.ts new file mode 100644 index 0000000..b68b276 --- /dev/null +++ b/monolithic/frontend/src/components/FlowChart/src/adpterForTurbo.ts @@ -0,0 +1,75 @@ +const TurboType = { + SEQUENCE_FLOW: 1, + START_EVENT: 2, + END_EVENT: 3, + USER_TASK: 4, + SERVICE_TASK: 5, + EXCLUSIVE_GATEWAY: 6, +}; + +function convertFlowElementToEdge(element) { + const { incoming, outgoing, properties, key } = element; + const { text, startPoint, endPoint, pointsList, logicFlowType } = properties; + const edge = { + id: key, + type: logicFlowType, + sourceNodeId: incoming[0], + targetNodeId: outgoing[0], + text, + startPoint, + endPoint, + pointsList, + properties: {}, + }; + const excludeProperties = ['startPoint', 'endPoint', 'pointsList', 'text', 'logicFlowType']; + Object.keys(element.properties).forEach((property) => { + if (excludeProperties.indexOf(property) === -1) { + edge.properties[property] = element.properties[property]; + } + }); + return edge; +} + +function convertFlowElementToNode(element) { + const { properties, key } = element; + const { x, y, text, logicFlowType } = properties; + const node = { + id: key, + type: logicFlowType, + x, + y, + text, + properties: {}, + }; + const excludeProperties = ['x', 'y', 'text', 'logicFlowType']; + Object.keys(element.properties).forEach((property) => { + if (excludeProperties.indexOf(property) === -1) { + node.properties[property] = element.properties[property]; + } + }); + return node; +} + +export function toLogicFlowData(data) { + const lfData: { + // TODO type + nodes: any[]; + edges: any[]; + } = { + nodes: [], + edges: [], + }; + const list = data.flowElementList; + list && + list.length > 0 && + list.forEach((element) => { + if (element.type === TurboType.SEQUENCE_FLOW) { + const edge = convertFlowElementToEdge(element); + lfData.edges.push(edge); + } else { + const node = convertFlowElementToNode(element); + lfData.nodes.push(node); + } + }); + return lfData; +} diff --git a/monolithic/frontend/src/components/FlowChart/src/config.ts b/monolithic/frontend/src/components/FlowChart/src/config.ts new file mode 100644 index 0000000..4f10d2c --- /dev/null +++ b/monolithic/frontend/src/components/FlowChart/src/config.ts @@ -0,0 +1,96 @@ +export const nodeList = [ + { + text: '开始', + type: 'start', + class: 'node-start', + }, + { + text: '矩形', + type: 'rect', + class: 'node-rect', + }, + { + type: 'user', + text: '用户', + class: 'node-user', + }, + { + type: 'push', + text: '推送', + class: 'node-push', + }, + { + type: 'download', + text: '位置', + class: 'node-download', + }, + { + type: 'end', + text: '结束', + class: 'node-end', + }, +]; + +export const BpmnNode = [ + { + type: 'bpmn:startEvent', + text: '开始', + class: 'bpmn-start', + }, + { + type: 'bpmn:endEvent', + text: '结束', + class: 'bpmn-end', + }, + { + type: 'bpmn:exclusiveGateway', + text: '网关', + class: 'bpmn-exclusiveGateway', + }, + { + type: 'bpmn:userTask', + text: '用户', + class: 'bpmn-user', + }, +]; + +export function configDefaultDndPanel(lf) { + return [ + { + text: '选区', + icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAAH6ji2bAAAABGdBTUEAALGPC/xhBQAAAOVJREFUOBGtVMENwzAIjKP++2026ETdpv10iy7WFbqFyyW6GBywLCv5gI+Dw2Bluj1znuSjhb99Gkn6QILDY2imo60p8nsnc9bEo3+QJ+AKHfMdZHnl78wyTnyHZD53Zzx73MRSgYvnqgCUHj6gwdck7Zsp1VOrz0Uz8NbKunzAW+Gu4fYW28bUYutYlzSa7B84Fh7d1kjLwhcSdYAYrdkMQVpsBr5XgDGuXwQfQr0y9zwLda+DUYXLaGKdd2ZTtvbolaO87pdo24hP7ov16N0zArH1ur3iwJpXxm+v7oAJNR4JEP8DoAuSFEkYH7cAAAAASUVORK5CYII=', + callback: () => { + lf.updateEditConfig({ + stopMoveGraph: true, + }); + }, + }, + { + type: 'circle', + text: '开始', + icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAAH6ji2bAAAABGdBTUEAALGPC/xhBQAAAnBJREFUOBGdVL1rU1EcPfdGBddmaZLiEhdx1MHZQXApraCzQ7GKLgoRBxMfcRELuihWKcXFRcEWF8HBf0DdDCKYRZpnl7p0svLe9Zzbd29eQhTbC8nv+9zf130AT63jvooOGS8Vf9Nt5zxba7sXQwODfkWpkbjTQfCGUd9gIp3uuPP8bZ946g56dYQvnBg+b1HB8VIQmMFrazKcKSvFW2dQTxJnJdQ77urmXWOMBCmXM2Rke4S7UAW+/8ywwFoewmBps2tu7mbTdp8VMOkIRAkKfrVawalJTtIliclFbaOBqa0M2xImHeVIfd/nKAfVq/LGnPss5Kh00VEdSzfwnBXPUpmykNss4lUI9C1ga+8PNrBD5YeqRY2Zz8PhjooIbfJXjowvQJBqkmEkVnktWhwu2SM7SMx7Cj0N9IC0oQXRo8xwAGzQms+xrB/nNSUWVveI48ayrFGyC2+E2C+aWrZHXvOuz+CiV6iycWe1Rd1Q6+QUG07nb5SbPrL4426d+9E1axKjY3AoRrlEeSQo2Eu0T6BWAAr6COhTcWjRaYfKG5csnvytvUr/WY4rrPMB53Uo7jZRjXaG6/CFfNMaXEu75nG47X+oepU7PKJvvzGDY1YLSKHJrK7vFUwXKkaxwhCW3u+sDFMVrIju54RYYbFKpALZAo7sB6wcKyyrd+aBMryMT2gPyD6GsQoRFkGHr14TthZni9ck0z+Pnmee460mHXbRAypKNy3nuMdrWgVKj8YVV8E7PSzp1BZ9SJnJAsXdryw/h5ctboUVi4AFiCd+lQaYMw5z3LGTBKjLQOeUF35k89f58Vv/tGh+l+PE/wG0rgfIUbZK5AAAAABJRU5ErkJggg==', + }, + { + type: 'rect', + text: '用户任务', + icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAEFVwZaAAAABGdBTUEAALGPC/xhBQAAAqlJREFUOBF9VM9rE0EUfrMJNUKLihGbpLGtaCOIR8VjQMGDePCgCCIiCNqzCAp2MyYUCXhUtF5E0D+g1t48qAd7CCLqQUQKEWkStcEfVGlLdp/fm3aW2QQdyLzf33zz5m2IsAZ9XhDpyaaIZkTS4ASzK41TFao88GuJ3hsr2pAbipHxuSYyKRugagICGANkfFnNh3HeE2N0b3nN2cgnpcictw5veJIzxmDamSlxxQZicq/mflxhbaH8BLRbuRwNtZp0JAhoplVRUdzmCe/vO27wFuuA3S5qXruGdboy5/PRGFsbFGKo/haRtQHIrM83bVeTrOgNhZReWaYGnE4aUQgTJNvijJFF4jQ8BxJE5xfKatZWmZcTQ+BVgh7s8SgPlCkcec4mGTmieTP4xd7PcpIEg1TX6gdeLW8rTVMVLVvb7ctXoH0Cydl2QOPJBG21STE5OsnbweVYzAnD3A7PVILuY0yiiyDwSm2g441r6rMSgp6iK42yqroI2QoXeJVeA+YeZSa47gZdXaZWQKTrG93rukk/l2Al6Kzh5AZEl7dDQy+JjgFahQjRopSxPbrbvK7GRe9ePWBo1wcU7sYrFZtavXALwGw/7Dnc50urrHJuTPSoO2IMV3gUQGNg87IbSOIY9BpiT9HV7FCZ94nPXb3MSnwHn/FFFE1vG6DTby+r31KAkUktB3Qf6ikUPWxW1BkXSPQeMHHiW0+HAd2GelJsZz1OJegCxqzl+CLVHa/IibuHeJ1HAKzhuDR+ymNaRFM+4jU6UWKXorRmbyqkq/D76FffevwdCp+jN3UAN/C9JRVTDuOxC/oh+EdMnqIOrlYteKSfadVRGLJFJPSB/ti/6K8f0CNymg/iH2gO/f0DwE0yjAFO6l8JaR5j0VPwPwfaYHqOqrCI319WzwhwzNW/aQAAAABJRU5ErkJggg==', + cls: 'important-node', + }, + { + type: 'rect', + text: '系统任务', + icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAEFVwZaAAAABGdBTUEAALGPC/xhBQAAAqlJREFUOBF9VM9rE0EUfrMJNUKLihGbpLGtaCOIR8VjQMGDePCgCCIiCNqzCAp2MyYUCXhUtF5E0D+g1t48qAd7CCLqQUQKEWkStcEfVGlLdp/fm3aW2QQdyLzf33zz5m2IsAZ9XhDpyaaIZkTS4ASzK41TFao88GuJ3hsr2pAbipHxuSYyKRugagICGANkfFnNh3HeE2N0b3nN2cgnpcictw5veJIzxmDamSlxxQZicq/mflxhbaH8BLRbuRwNtZp0JAhoplVRUdzmCe/vO27wFuuA3S5qXruGdboy5/PRGFsbFGKo/haRtQHIrM83bVeTrOgNhZReWaYGnE4aUQgTJNvijJFF4jQ8BxJE5xfKatZWmZcTQ+BVgh7s8SgPlCkcec4mGTmieTP4xd7PcpIEg1TX6gdeLW8rTVMVLVvb7ctXoH0Cydl2QOPJBG21STE5OsnbweVYzAnD3A7PVILuY0yiiyDwSm2g441r6rMSgp6iK42yqroI2QoXeJVeA+YeZSa47gZdXaZWQKTrG93rukk/l2Al6Kzh5AZEl7dDQy+JjgFahQjRopSxPbrbvK7GRe9ePWBo1wcU7sYrFZtavXALwGw/7Dnc50urrHJuTPSoO2IMV3gUQGNg87IbSOIY9BpiT9HV7FCZ94nPXb3MSnwHn/FFFE1vG6DTby+r31KAkUktB3Qf6ikUPWxW1BkXSPQeMHHiW0+HAd2GelJsZz1OJegCxqzl+CLVHa/IibuHeJ1HAKzhuDR+ymNaRFM+4jU6UWKXorRmbyqkq/D76FffevwdCp+jN3UAN/C9JRVTDuOxC/oh+EdMnqIOrlYteKSfadVRGLJFJPSB/ti/6K8f0CNymg/iH2gO/f0DwE0yjAFO6l8JaR5j0VPwPwfaYHqOqrCI319WzwhwzNW/aQAAAABJRU5ErkJggg==', + cls: 'import_icon', + }, + { + type: 'diamond', + text: '条件判断', + icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAAHeEJUAAAAABGdBTUEAALGPC/xhBQAAAvVJREFUOBGNVEFrE0EU/mY3bQoiFlOkaUJrQUQoWMGePLX24EH0IIoHKQiCV0G8iE1covgLiqA/QTzVm1JPogc9tIJYFaQtlhQxqYjSpunu+L7JvmUTU3AgmTfvffPNN++9WSA1DO182f6xwILzD5btfAoQmwL5KJEwiQyVbSVZ0IgRyV6PTpIJ81E5ZvqfHQR0HUOBHW4L5Et2kQ6Zf7iAOhTFAA8s0pEP7AXO1uAA52SbqGk6h/6J45LaLhO64ByfcUzM39V7ZiAdS2yCePPEIQYvTUHqM/n7dgQNfBKWPjpF4ISk8q3J4nB11qw6X8l+FsF3EhlkEMfrjIer3wJTLwS2aCNcj4DbGxXTw00JmAuO+Ni6bBxVUCvS5d9aa04+so4pHW5jLTywuXAL7jJ+D06sl82Sgl2JuVBQn498zkc2bGKxULHjCnSMadBKYDYYHAtsby1EQ5lNGrQd4Y3v4Zo0XdGEmDno46yCM9Tk+RiJmUYHS/aXHPNTcjxcbTFna000PFJHIVZ5lFRqRpJWk9/+QtlOUYJj9HG5pVFEU7zqIYDVsw2s+AJaD8wTd2umgSCCyUxgGsS1Y6TBwXQQTFuZaHcd8gAGioE90hlsY+wMcs30RduYtxanjMGal8H5dMW67dmT1JFtYUEe8LiQLRsPZ6IIc7A4J5tqco3T0pnv/4u0kyzrYUq7gASuEyI8VXKvB9Odytv6jS/PNaZBln0nioJG/AVQRZvApOdhjj3Jt8QC8Im09SafwdBdvIpztpxWxpeKCC+EsFdS8DCyuCn2munFpL7ctHKp+Xc5cMybeIyMAN33SPL3ZR9QV1XVwLyzHm6Iv0/yeUuUb7PPlZC4D4HZkeu6dpF4v9j9MreGtMbxMMRLIcjJic9yHi7WQ3yVKzZVWUr5UrViJvn1FfUlwe/KYVfYyWRLSGNu16hR01U9IacajXPei0wx/5BqgInvJN+MMNtNme7ReU9SBbgntovn0kKHpFg7UogZvaZiOue/q1SBo9ktHzQAAAAASUVORK5CYII=', + }, + { + type: 'circle', + text: '结束', + icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAAH6ji2bAAAABGdBTUEAALGPC/xhBQAAA1BJREFUOBFtVE1IVUEYPXOf+tq40Y3vPcmFIdSjIorWoRG0ERWUgnb5FwVhYQSl72oUoZAboxKNFtWiwKRN0M+jpfSzqJAQclHo001tKkjl3emc8V69igP3znzfnO/M9zcDcKT67azmjYWTwl9Vn7Vumeqzj1DVb6cleQY4oAVnIOPb+mKAGxQmKI5CWNJ2aLPatxWa3aB9K7/fB+/Z0jUF6TmMlFLQqrkECWQzOZxYGjTlOl8eeKaIY5yHnFn486xBustDjWT6dG7pmjHOJd+33t0iitTPkK6tEvjxq4h2MozQ6WFSX/LkDUGfFwfhEZj1Auz/U4pyAi5Sznd7uKzznXeVHlI/Aywmk6j7fsUsEuCGADrWARXXwjxWQsUbIupDHJI7kF5dRktg0eN81IbiZXiTESic50iwS+t1oJgL83jAiBupLDCQqwziaWSoAFSeIR3P5Xv5az00wyIn35QRYTwdSYbz8pH8fxUUAtxnFvYmEmgI0wYXUXcCCSpeEVpXlsRhBnCEATxWylL9+EKCAYhe1NGstUa6356kS9NVvt3DU2fd+Wtbm/+lSbylJqsqkSm9CRhvoJVlvKPvF1RKY/FcPn5j4UfIMLn8D4UYb54BNsilTDXKnF4CfTobA0FpoW/LSp306wkXM+XaOJhZaFkcNM82ASNAWMrhrUbRfmyeI1FvRBTpN06WKxa9BK0o2E4Pd3zfBBEwPsv9sQBnmLVbLEIZ/Xe9LYwJu/Er17W6HYVBc7vmuk0xUQ+pqxdom5Fnp55SiytXLPYoMXNM4u4SNSCFWnrVIzKG3EGyMXo6n/BQOe+bX3FClY4PwydVhthOZ9NnS+ntiLh0fxtlUJHAuGaFoVmttpVMeum0p3WEXbcll94l1wM/gZ0Ccczop77VvN2I7TlsZCsuXf1WHvWEhjO8DPtyOVg2/mvK9QqboEth+7pD6NUQC1HN/TwvydGBARi9MZSzLE4b8Ru3XhX2PBxf8E1er2A6516o0w4sIA+lwURhAON82Kwe2iDAC1Watq4XHaGQ7skLcFOtI5lDxuM2gZe6WFIotPAhbaeYlU4to5cuarF1QrcZ/lwrLaCJl66JBocYZnrNlvm2+MBCTmUymPrYZVbjdlr/BxlMjmNmNI3SAAAAAElFTkSuQmCC', + }, + ]; +} diff --git a/monolithic/frontend/src/components/FlowChart/src/enum.ts b/monolithic/frontend/src/components/FlowChart/src/enum.ts new file mode 100644 index 0000000..8ea134c --- /dev/null +++ b/monolithic/frontend/src/components/FlowChart/src/enum.ts @@ -0,0 +1,11 @@ +export enum ToolbarTypeEnum { + ZOOM_IN = 'zoomIn', + ZOOM_OUT = 'zoomOut', + RESET_ZOOM = 'resetZoom', + + UNDO = 'undo', + REDO = 'redo', + + SNAPSHOT = 'snapshot', + VIEW_DATA = 'viewData', +} diff --git a/monolithic/frontend/src/components/FlowChart/src/types.ts b/monolithic/frontend/src/components/FlowChart/src/types.ts new file mode 100644 index 0000000..94992ba --- /dev/null +++ b/monolithic/frontend/src/components/FlowChart/src/types.ts @@ -0,0 +1,14 @@ +import { NodeConfig } from '@logicflow/core'; +import { ToolbarTypeEnum } from './enum'; + +export interface NodeItem extends NodeConfig { + icon: string; +} + +export interface ToolbarConfig { + type?: string | ToolbarTypeEnum; + tooltip?: string | boolean; + icon?: string; + disabled?: boolean; + separate?: boolean; +} diff --git a/monolithic/frontend/src/components/FlowChart/src/useFlowContext.ts b/monolithic/frontend/src/components/FlowChart/src/useFlowContext.ts new file mode 100644 index 0000000..7d15f3b --- /dev/null +++ b/monolithic/frontend/src/components/FlowChart/src/useFlowContext.ts @@ -0,0 +1,17 @@ +import type LogicFlow from '@logicflow/core'; + +import { provide, inject } from 'vue'; + +const key = Symbol('flow-chart'); + +type Instance = { + logicFlow: LogicFlow; +}; + +export function createFlowChartContext(instance: Instance) { + provide(key, instance); +} + +export function useFlowChartContext(): Instance { + return inject(key) as Instance; +} diff --git a/monolithic/frontend/src/components/Form/index.ts b/monolithic/frontend/src/components/Form/index.ts new file mode 100644 index 0000000..d85b3c5 --- /dev/null +++ b/monolithic/frontend/src/components/Form/index.ts @@ -0,0 +1,17 @@ +import BasicForm from './src/BasicForm.vue'; + +export * from './src/types/form'; +export * from './src/types/formItem'; + +export { useComponentRegister } from './src/hooks/useComponentRegister'; +export { useForm } from './src/hooks/useForm'; + +export { default as ApiSelect } from './src/components/ApiSelect.vue'; +export { default as RadioButtonGroup } from './src/components/RadioButtonGroup.vue'; +export { default as ApiTreeSelect } from './src/components/ApiTreeSelect.vue'; +export { default as ApiTree } from './src/components/ApiTree.vue'; +export { default as ApiRadioGroup } from './src/components/ApiRadioGroup.vue'; +export { default as ApiCascader } from './src/components/ApiCascader.vue'; +export { default as ApiTransfer } from './src/components/ApiTransfer.vue'; + +export { BasicForm }; diff --git a/monolithic/frontend/src/components/Form/src/BasicForm.vue b/monolithic/frontend/src/components/Form/src/BasicForm.vue new file mode 100644 index 0000000..d6416ee --- /dev/null +++ b/monolithic/frontend/src/components/Form/src/BasicForm.vue @@ -0,0 +1,353 @@ + + + diff --git a/monolithic/frontend/src/components/Form/src/componentMap.ts b/monolithic/frontend/src/components/Form/src/componentMap.ts new file mode 100644 index 0000000..53e65c9 --- /dev/null +++ b/monolithic/frontend/src/components/Form/src/componentMap.ts @@ -0,0 +1,83 @@ +import type { Component } from 'vue'; +import type { ComponentType } from './types/index'; + +/** + * Component list, register here to setting it in the form + */ +import { + Input, + Select, + Radio, + Checkbox, + AutoComplete, + Cascader, + DatePicker, + InputNumber, + Switch, + TimePicker, + TreeSelect, + Slider, + Rate, + Divider, +} from 'ant-design-vue'; + +import ApiRadioGroup from './components/ApiRadioGroup.vue'; +import RadioButtonGroup from './components/RadioButtonGroup.vue'; +import ApiSelect from './components/ApiSelect.vue'; +import ApiTree from './components/ApiTree.vue'; +import ApiTreeSelect from './components/ApiTreeSelect.vue'; +import ApiCascader from './components/ApiCascader.vue'; +import ApiTransfer from './components/ApiTransfer.vue'; +import { BasicUpload } from '/@/components/Upload'; +import { StrengthMeter } from '/@/components/StrengthMeter'; +import { IconPicker } from '/@/components/Icon'; +import { CountdownInput } from '/@/components/CountDown'; + +const componentMap = new Map(); + +componentMap.set('Input', Input); +componentMap.set('InputGroup', Input.Group); +componentMap.set('InputPassword', Input.Password); +componentMap.set('InputSearch', Input.Search); +componentMap.set('InputTextArea', Input.TextArea); +componentMap.set('InputNumber', InputNumber); +componentMap.set('AutoComplete', AutoComplete); + +componentMap.set('Select', Select); +componentMap.set('ApiSelect', ApiSelect); +componentMap.set('ApiTree', ApiTree); +componentMap.set('TreeSelect', TreeSelect); +componentMap.set('ApiTreeSelect', ApiTreeSelect); +componentMap.set('ApiRadioGroup', ApiRadioGroup); +componentMap.set('Switch', Switch); +componentMap.set('RadioButtonGroup', RadioButtonGroup); +componentMap.set('RadioGroup', Radio.Group); +componentMap.set('Checkbox', Checkbox); +componentMap.set('CheckboxGroup', Checkbox.Group); +componentMap.set('ApiCascader', ApiCascader); +componentMap.set('Cascader', Cascader); +componentMap.set('Slider', Slider); +componentMap.set('Rate', Rate); +componentMap.set('ApiTransfer', ApiTransfer); + +componentMap.set('DatePicker', DatePicker); +componentMap.set('MonthPicker', DatePicker.MonthPicker); +componentMap.set('RangePicker', DatePicker.RangePicker); +componentMap.set('WeekPicker', DatePicker.WeekPicker); +componentMap.set('TimePicker', TimePicker); +componentMap.set('StrengthMeter', StrengthMeter); +componentMap.set('IconPicker', IconPicker); +componentMap.set('InputCountDown', CountdownInput); + +componentMap.set('Upload', BasicUpload); +componentMap.set('Divider', Divider); + +export function add(compName: ComponentType, component: Component) { + componentMap.set(compName, component); +} + +export function del(compName: ComponentType) { + componentMap.delete(compName); +} + +export { componentMap }; diff --git a/monolithic/frontend/src/components/Form/src/components/ApiCascader.vue b/monolithic/frontend/src/components/Form/src/components/ApiCascader.vue new file mode 100644 index 0000000..dd29d8e --- /dev/null +++ b/monolithic/frontend/src/components/Form/src/components/ApiCascader.vue @@ -0,0 +1,198 @@ + + diff --git a/monolithic/frontend/src/components/Form/src/components/ApiRadioGroup.vue b/monolithic/frontend/src/components/Form/src/components/ApiRadioGroup.vue new file mode 100644 index 0000000..b75fdca --- /dev/null +++ b/monolithic/frontend/src/components/Form/src/components/ApiRadioGroup.vue @@ -0,0 +1,130 @@ + + + diff --git a/monolithic/frontend/src/components/Form/src/components/ApiSelect.vue b/monolithic/frontend/src/components/Form/src/components/ApiSelect.vue new file mode 100644 index 0000000..bbc5881 --- /dev/null +++ b/monolithic/frontend/src/components/Form/src/components/ApiSelect.vue @@ -0,0 +1,147 @@ + + diff --git a/monolithic/frontend/src/components/Form/src/components/ApiTransfer.vue b/monolithic/frontend/src/components/Form/src/components/ApiTransfer.vue new file mode 100644 index 0000000..661efc9 --- /dev/null +++ b/monolithic/frontend/src/components/Form/src/components/ApiTransfer.vue @@ -0,0 +1,135 @@ + + + diff --git a/monolithic/frontend/src/components/Form/src/components/ApiTree.vue b/monolithic/frontend/src/components/Form/src/components/ApiTree.vue new file mode 100644 index 0000000..1a9d40a --- /dev/null +++ b/monolithic/frontend/src/components/Form/src/components/ApiTree.vue @@ -0,0 +1,90 @@ + + + diff --git a/monolithic/frontend/src/components/Form/src/components/ApiTreeSelect.vue b/monolithic/frontend/src/components/Form/src/components/ApiTreeSelect.vue new file mode 100644 index 0000000..68f8a52 --- /dev/null +++ b/monolithic/frontend/src/components/Form/src/components/ApiTreeSelect.vue @@ -0,0 +1,86 @@ + + + diff --git a/monolithic/frontend/src/components/Form/src/components/FormAction.vue b/monolithic/frontend/src/components/Form/src/components/FormAction.vue new file mode 100644 index 0000000..8dec49f --- /dev/null +++ b/monolithic/frontend/src/components/Form/src/components/FormAction.vue @@ -0,0 +1,135 @@ + + diff --git a/monolithic/frontend/src/components/Form/src/components/FormItem.vue b/monolithic/frontend/src/components/Form/src/components/FormItem.vue new file mode 100644 index 0000000..157e0db --- /dev/null +++ b/monolithic/frontend/src/components/Form/src/components/FormItem.vue @@ -0,0 +1,392 @@ + diff --git a/monolithic/frontend/src/components/Form/src/components/RadioButtonGroup.vue b/monolithic/frontend/src/components/Form/src/components/RadioButtonGroup.vue new file mode 100644 index 0000000..c2c7b22 --- /dev/null +++ b/monolithic/frontend/src/components/Form/src/components/RadioButtonGroup.vue @@ -0,0 +1,57 @@ + + + diff --git a/monolithic/frontend/src/components/Form/src/helper.ts b/monolithic/frontend/src/components/Form/src/helper.ts new file mode 100644 index 0000000..d0727f3 --- /dev/null +++ b/monolithic/frontend/src/components/Form/src/helper.ts @@ -0,0 +1,74 @@ +import type { ValidationRule } from 'ant-design-vue/lib/form/Form'; +import type { ComponentType } from './types/index'; +import { useI18n } from '/@/hooks/web/useI18n'; +import { dateUtil } from '/@/utils/dateUtil'; +import { isNumber, isObject } from '/@/utils/is'; + +const { t } = useI18n(); + +/** + * @description: 生成placeholder + */ +export function createPlaceholderMessage(component: ComponentType) { + if (component.includes('Input') || component.includes('Complete')) { + return t('common.inputText'); + } + if (component.includes('Picker')) { + return t('common.chooseText'); + } + if ( + component.includes('Select') || + component.includes('Cascader') || + component.includes('Checkbox') || + component.includes('Radio') || + component.includes('Switch') + ) { + // return `请选择${label}`; + return t('common.chooseText'); + } + return ''; +} + +const DATE_TYPE = ['DatePicker', 'MonthPicker', 'WeekPicker', 'TimePicker']; + +function genType() { + return [...DATE_TYPE, 'RangePicker']; +} + +export function setComponentRuleType( + rule: ValidationRule, + component: ComponentType, + valueFormat: string, +) { + if (['DatePicker', 'MonthPicker', 'WeekPicker', 'TimePicker'].includes(component)) { + rule.type = valueFormat ? 'string' : 'object'; + } else if (['RangePicker', 'Upload', 'CheckboxGroup', 'TimePicker'].includes(component)) { + rule.type = 'array'; + } else if (['InputNumber'].includes(component)) { + rule.type = 'number'; + } +} + +export function processDateValue(attr: Recordable, component: string) { + const { valueFormat, value } = attr; + if (valueFormat) { + attr.value = isObject(value) ? dateUtil(value).format(valueFormat) : value; + } else if (DATE_TYPE.includes(component) && value) { + attr.value = dateUtil(attr.value); + } +} + +export function handleInputNumberValue(component?: ComponentType, val?: any) { + if (!component) return val; + if (['Input', 'InputPassword', 'InputSearch', 'InputTextArea'].includes(component)) { + return val && isNumber(val) ? `${val}` : val; + } + return val; +} + +/** + * 时间字段 + */ +export const dateItemType = genType(); + +export const defaultValueComponents = ['Input', 'InputPassword', 'InputSearch', 'InputTextArea']; diff --git a/monolithic/frontend/src/components/Form/src/hooks/useAdvanced.ts b/monolithic/frontend/src/components/Form/src/hooks/useAdvanced.ts new file mode 100644 index 0000000..0df0be0 --- /dev/null +++ b/monolithic/frontend/src/components/Form/src/hooks/useAdvanced.ts @@ -0,0 +1,170 @@ +import type { ColEx } from '../types'; +import type { AdvanceState } from '../types/hooks'; +import { ComputedRef, getCurrentInstance, Ref } from 'vue'; +import type { FormProps, FormSchema } from '../types/form'; +import { computed, unref, watch } from 'vue'; +import { isBoolean, isFunction, isNumber, isObject } from '/@/utils/is'; +import { useBreakpoint } from '/@/hooks/event/useBreakpoint'; +import { useDebounceFn } from '@vueuse/core'; + +const BASIC_COL_LEN = 24; + +interface UseAdvancedContext { + advanceState: AdvanceState; + emit: EmitType; + getProps: ComputedRef; + getSchema: ComputedRef; + formModel: Recordable; + defaultValueRef: Ref; +} + +export default function ({ + advanceState, + emit, + getProps, + getSchema, + formModel, + defaultValueRef, +}: UseAdvancedContext) { + const vm = getCurrentInstance(); + + const { realWidthRef, screenEnum, screenRef } = useBreakpoint(); + + const getEmptySpan = computed((): number => { + if (!advanceState.isAdvanced) { + return 0; + } + // For some special cases, you need to manually specify additional blank lines + const emptySpan = unref(getProps).emptySpan || 0; + + if (isNumber(emptySpan)) { + return emptySpan; + } + if (isObject(emptySpan)) { + const { span = 0 } = emptySpan; + const screen = unref(screenRef) as string; + + const screenSpan = (emptySpan as any)[screen.toLowerCase()]; + return screenSpan || span || 0; + } + return 0; + }); + + const debounceUpdateAdvanced = useDebounceFn(updateAdvanced, 30); + + watch( + [() => unref(getSchema), () => advanceState.isAdvanced, () => unref(realWidthRef)], + () => { + const { showAdvancedButton } = unref(getProps); + if (showAdvancedButton) { + debounceUpdateAdvanced(); + } + }, + { immediate: true }, + ); + + function getAdvanced(itemCol: Partial, itemColSum = 0, isLastAction = false) { + const width = unref(realWidthRef); + + const mdWidth = + parseInt(itemCol.md as string) || + parseInt(itemCol.xs as string) || + parseInt(itemCol.sm as string) || + (itemCol.span as number) || + BASIC_COL_LEN; + + const lgWidth = parseInt(itemCol.lg as string) || mdWidth; + const xlWidth = parseInt(itemCol.xl as string) || lgWidth; + const xxlWidth = parseInt(itemCol.xxl as string) || xlWidth; + if (width <= screenEnum.LG) { + itemColSum += mdWidth; + } else if (width < screenEnum.XL) { + itemColSum += lgWidth; + } else if (width < screenEnum.XXL) { + itemColSum += xlWidth; + } else { + itemColSum += xxlWidth; + } + + if (isLastAction) { + advanceState.hideAdvanceBtn = false; + if (itemColSum <= BASIC_COL_LEN * 2) { + // When less than or equal to 2 lines, the collapse and expand buttons are not displayed + advanceState.hideAdvanceBtn = true; + advanceState.isAdvanced = true; + } else if ( + itemColSum > BASIC_COL_LEN * 2 && + itemColSum <= BASIC_COL_LEN * (unref(getProps).autoAdvancedLine || 3) + ) { + advanceState.hideAdvanceBtn = false; + + // More than 3 lines collapsed by default + } else if (!advanceState.isLoad) { + advanceState.isLoad = true; + advanceState.isAdvanced = !advanceState.isAdvanced; + } + return { isAdvanced: advanceState.isAdvanced, itemColSum }; + } + if (itemColSum > BASIC_COL_LEN * (unref(getProps).alwaysShowLines || 1)) { + return { isAdvanced: advanceState.isAdvanced, itemColSum }; + } else { + // The first line is always displayed + return { isAdvanced: true, itemColSum }; + } + } + + function updateAdvanced() { + let itemColSum = 0; + let realItemColSum = 0; + const { baseColProps = {} } = unref(getProps); + + for (const schema of unref(getSchema)) { + const { show, colProps } = schema; + let isShow = true; + + if (isBoolean(show)) { + isShow = show; + } + + if (isFunction(show)) { + isShow = show({ + schema: schema, + model: formModel, + field: schema.field, + values: { + ...unref(defaultValueRef), + ...formModel, + }, + }); + } + + if (isShow && (colProps || baseColProps)) { + const { itemColSum: sum, isAdvanced } = getAdvanced( + { ...baseColProps, ...colProps }, + itemColSum, + ); + + itemColSum = sum || 0; + if (isAdvanced) { + realItemColSum = itemColSum; + } + schema.isAdvanced = isAdvanced; + } + } + + // 确保页面发送更新 + vm?.proxy?.$forceUpdate(); + + advanceState.actionSpan = (realItemColSum % BASIC_COL_LEN) + unref(getEmptySpan); + + getAdvanced(unref(getProps).actionColOptions || { span: BASIC_COL_LEN }, itemColSum, true); + + emit('advanced-change'); + } + + function handleToggleAdvanced() { + advanceState.isAdvanced = !advanceState.isAdvanced; + } + + return { handleToggleAdvanced }; +} diff --git a/monolithic/frontend/src/components/Form/src/hooks/useAutoFocus.ts b/monolithic/frontend/src/components/Form/src/hooks/useAutoFocus.ts new file mode 100644 index 0000000..e24dd6b --- /dev/null +++ b/monolithic/frontend/src/components/Form/src/hooks/useAutoFocus.ts @@ -0,0 +1,40 @@ +import type { ComputedRef, Ref } from 'vue'; +import type { FormSchema, FormActionType, FormProps } from '../types/form'; + +import { unref, nextTick, watchEffect } from 'vue'; + +interface UseAutoFocusContext { + getSchema: ComputedRef; + getProps: ComputedRef; + isInitedDefault: Ref; + formElRef: Ref; +} +export async function useAutoFocus({ + getSchema, + getProps, + formElRef, + isInitedDefault, +}: UseAutoFocusContext) { + watchEffect(async () => { + if (unref(isInitedDefault) || !unref(getProps).autoFocusFirstItem) { + return; + } + await nextTick(); + const schemas = unref(getSchema); + const formEl = unref(formElRef); + const el = (formEl as any)?.$el as HTMLElement; + if (!formEl || !el || !schemas || schemas.length === 0) { + return; + } + + const firstItem = schemas[0]; + // Only open when the first form item is input type + if (!firstItem.component.includes('Input')) { + return; + } + + const inputEl = el.querySelector('.ant-row:first-child input') as Nullable; + if (!inputEl) return; + inputEl?.focus(); + }); +} diff --git a/monolithic/frontend/src/components/Form/src/hooks/useComponentRegister.ts b/monolithic/frontend/src/components/Form/src/hooks/useComponentRegister.ts new file mode 100644 index 0000000..218aaa9 --- /dev/null +++ b/monolithic/frontend/src/components/Form/src/hooks/useComponentRegister.ts @@ -0,0 +1,11 @@ +import type { ComponentType } from '../types/index'; +import { tryOnUnmounted } from '@vueuse/core'; +import { add, del } from '../componentMap'; +import type { Component } from 'vue'; + +export function useComponentRegister(compName: ComponentType, comp: Component) { + add(compName, comp); + tryOnUnmounted(() => { + del(compName); + }); +} diff --git a/monolithic/frontend/src/components/Form/src/hooks/useForm.ts b/monolithic/frontend/src/components/Form/src/hooks/useForm.ts new file mode 100644 index 0000000..d026d69 --- /dev/null +++ b/monolithic/frontend/src/components/Form/src/hooks/useForm.ts @@ -0,0 +1,122 @@ +import type { FormProps, FormActionType, UseFormReturnType, FormSchema } from '../types/form'; +import type { NamePath } from 'ant-design-vue/lib/form/interface'; +import type { DynamicProps } from '/#/utils'; +import { ref, onUnmounted, unref, nextTick, watch } from 'vue'; +import { isProdMode } from '/@/utils/env'; +import { error } from '/@/utils/log'; +import { getDynamicProps } from '/@/utils'; + +export declare type ValidateFields = (nameList?: NamePath[]) => Promise; + +type Props = Partial>; + +export function useForm(props?: Props): UseFormReturnType { + const formRef = ref>(null); + const loadedRef = ref>(false); + + async function getForm() { + const form = unref(formRef); + if (!form) { + error( + 'The form instance has not been obtained, please make sure that the form has been rendered when performing the form operation!', + ); + } + await nextTick(); + return form as FormActionType; + } + + function register(instance: FormActionType) { + isProdMode() && + onUnmounted(() => { + formRef.value = null; + loadedRef.value = null; + }); + if (unref(loadedRef) && isProdMode() && instance === unref(formRef)) return; + + formRef.value = instance; + loadedRef.value = true; + + watch( + () => props, + () => { + props && instance.setProps(getDynamicProps(props)); + }, + { + immediate: true, + deep: true, + }, + ); + } + + const methods: FormActionType = { + scrollToField: async (name: NamePath, options?: ScrollOptions | undefined) => { + const form = await getForm(); + form.scrollToField(name, options); + }, + setProps: async (formProps: Partial) => { + const form = await getForm(); + form.setProps(formProps); + }, + + updateSchema: async (data: Partial | Partial[]) => { + const form = await getForm(); + form.updateSchema(data); + }, + + resetSchema: async (data: Partial | Partial[]) => { + const form = await getForm(); + form.resetSchema(data); + }, + + clearValidate: async (name?: string | string[]) => { + const form = await getForm(); + form.clearValidate(name); + }, + + resetFields: async () => { + getForm().then(async (form) => { + await form.resetFields(); + }); + }, + + removeSchemaByFiled: async (field: string | string[]) => { + unref(formRef)?.removeSchemaByFiled(field); + }, + + // TODO promisify + getFieldsValue: () => { + return unref(formRef)?.getFieldsValue() as T; + }, + + setFieldsValue: async (values: T) => { + const form = await getForm(); + form.setFieldsValue(values); + }, + + appendSchemaByField: async ( + schema: FormSchema, + prefixField: string | undefined, + first: boolean, + ) => { + const form = await getForm(); + form.appendSchemaByField(schema, prefixField, first); + }, + + submit: async (): Promise => { + const form = await getForm(); + return form.submit(); + }, + + validate: async (nameList?: NamePath[]): Promise => { + const form = await getForm(); + return form.validate(nameList); + }, + + validateFields: async (nameList?: NamePath[]): Promise => { + const form = await getForm(); + return form.validateFields(nameList); + }, + }; + + return [register, methods]; +} diff --git a/monolithic/frontend/src/components/Form/src/hooks/useFormContext.ts b/monolithic/frontend/src/components/Form/src/hooks/useFormContext.ts new file mode 100644 index 0000000..01dfadd --- /dev/null +++ b/monolithic/frontend/src/components/Form/src/hooks/useFormContext.ts @@ -0,0 +1,17 @@ +import type { InjectionKey } from 'vue'; +import { createContext, useContext } from '/@/hooks/core/useContext'; + +export interface FormContextProps { + resetAction: () => Promise; + submitAction: () => Promise; +} + +const key: InjectionKey = Symbol(); + +export function createFormContext(context: FormContextProps) { + return createContext(context, key); +} + +export function useFormContext() { + return useContext(key); +} diff --git a/monolithic/frontend/src/components/Form/src/hooks/useFormEvents.ts b/monolithic/frontend/src/components/Form/src/hooks/useFormEvents.ts new file mode 100644 index 0000000..4fa96bc --- /dev/null +++ b/monolithic/frontend/src/components/Form/src/hooks/useFormEvents.ts @@ -0,0 +1,314 @@ +import type { ComputedRef, Ref } from 'vue'; +import type { FormProps, FormSchema, FormActionType } from '../types/form'; +import type { NamePath } from 'ant-design-vue/lib/form/interface'; +import { unref, toRaw, nextTick } from 'vue'; +import { isArray, isFunction, isObject, isString, isDef, isNullOrUnDef } from '/@/utils/is'; +import { deepMerge } from '/@/utils'; +import { dateItemType, handleInputNumberValue, defaultValueComponents } from '../helper'; +import { dateUtil } from '/@/utils/dateUtil'; +import { cloneDeep, uniqBy } from 'lodash-es'; +import { error } from '/@/utils/log'; + +interface UseFormActionContext { + emit: EmitType; + getProps: ComputedRef; + getSchema: ComputedRef; + formModel: Recordable; + defaultValueRef: Ref; + formElRef: Ref; + schemaRef: Ref; + handleFormValues: Fn; +} +export function useFormEvents({ + emit, + getProps, + formModel, + getSchema, + defaultValueRef, + formElRef, + schemaRef, + handleFormValues, +}: UseFormActionContext) { + async function resetFields(): Promise { + const { resetFunc, submitOnReset } = unref(getProps); + resetFunc && isFunction(resetFunc) && (await resetFunc()); + + const formEl = unref(formElRef); + if (!formEl) return; + + Object.keys(formModel).forEach((key) => { + const schema = unref(getSchema).find((item) => item.field === key); + const isInput = schema?.component && defaultValueComponents.includes(schema.component); + const defaultValue = cloneDeep(defaultValueRef.value[key]); + formModel[key] = isInput ? defaultValue || '' : defaultValue; + }); + nextTick(() => clearValidate()); + + emit('reset', toRaw(formModel)); + submitOnReset && handleSubmit(); + } + + /** + * @description: Set form value + */ + async function setFieldsValue(values: Recordable): Promise { + const fields = unref(getSchema) + .map((item) => item.field) + .filter(Boolean); + + // key 支持 a.b.c 的嵌套写法 + const delimiter = '.'; + const nestKeyArray = fields.filter((item) => item.indexOf(delimiter) >= 0); + + const validKeys: string[] = []; + Object.keys(values).forEach((key) => { + const schema = unref(getSchema).find((item) => item.field === key); + let value = values[key]; + + const hasKey = Reflect.has(values, key); + + value = handleInputNumberValue(schema?.component, value); + // 0| '' is allow + if (hasKey && fields.includes(key)) { + // time type + if (itemIsDateType(key)) { + if (Array.isArray(value)) { + const arr: any[] = []; + for (const ele of value) { + arr.push(ele ? dateUtil(ele) : null); + } + formModel[key] = arr; + } else { + const { componentProps } = schema || {}; + let _props = componentProps as any; + if (typeof componentProps === 'function') { + _props = _props({ formModel }); + } + formModel[key] = value ? (_props?.valueFormat ? value : dateUtil(value)) : null; + } + } else { + formModel[key] = value; + } + validKeys.push(key); + } else { + nestKeyArray.forEach((nestKey: string) => { + try { + const value = eval('values' + delimiter + nestKey); + if (isDef(value)) { + formModel[nestKey] = value; + validKeys.push(nestKey); + } + } catch (e) { + // key not exist + if (isDef(defaultValueRef.value[nestKey])) { + formModel[nestKey] = cloneDeep(defaultValueRef.value[nestKey]); + } + } + }); + } + }); + validateFields(validKeys).catch((_) => {}); + } + /** + * @description: Delete based on field name + */ + async function removeSchemaByFiled(fields: string | string[]): Promise { + const schemaList: FormSchema[] = cloneDeep(unref(getSchema)); + if (!fields) { + return; + } + + let fieldList: string[] = isString(fields) ? [fields] : fields; + if (isString(fields)) { + fieldList = [fields]; + } + for (const field of fieldList) { + _removeSchemaByFiled(field, schemaList); + } + schemaRef.value = schemaList; + } + + /** + * @description: Delete based on field name + */ + function _removeSchemaByFiled(field: string, schemaList: FormSchema[]): void { + if (isString(field)) { + const index = schemaList.findIndex((schema) => schema.field === field); + if (index !== -1) { + delete formModel[field]; + schemaList.splice(index, 1); + } + } + } + + /** + * @description: Insert after a certain field, if not insert the last + */ + async function appendSchemaByField(schema: FormSchema, prefixField?: string, first = false) { + const schemaList: FormSchema[] = cloneDeep(unref(getSchema)); + + const index = schemaList.findIndex((schema) => schema.field === prefixField); + + if (!prefixField || index === -1 || first) { + first ? schemaList.unshift(schema) : schemaList.push(schema); + schemaRef.value = schemaList; + _setDefaultValue(schema); + return; + } + if (index !== -1) { + schemaList.splice(index + 1, 0, schema); + } + _setDefaultValue(schema); + + schemaRef.value = schemaList; + } + + async function resetSchema(data: Partial | Partial[]) { + let updateData: Partial[] = []; + if (isObject(data)) { + updateData.push(data as FormSchema); + } + if (isArray(data)) { + updateData = [...data]; + } + + const hasField = updateData.every( + (item) => item.component === 'Divider' || (Reflect.has(item, 'field') && item.field), + ); + + if (!hasField) { + error( + 'All children of the form Schema array that need to be updated must contain the `field` field', + ); + return; + } + schemaRef.value = updateData as FormSchema[]; + } + + async function updateSchema(data: Partial | Partial[]) { + let updateData: Partial[] = []; + if (isObject(data)) { + updateData.push(data as FormSchema); + } + if (isArray(data)) { + updateData = [...data]; + } + + const hasField = updateData.every( + (item) => item.component === 'Divider' || (Reflect.has(item, 'field') && item.field), + ); + + if (!hasField) { + error( + 'All children of the form Schema array that need to be updated must contain the `field` field', + ); + return; + } + const schema: FormSchema[] = []; + updateData.forEach((item) => { + unref(getSchema).forEach((val) => { + if (val.field === item.field) { + const newSchema = deepMerge(val, item); + schema.push(newSchema as FormSchema); + } else { + schema.push(val); + } + }); + }); + _setDefaultValue(schema); + + schemaRef.value = uniqBy(schema, 'field'); + } + + function _setDefaultValue(data: FormSchema | FormSchema[]) { + let schemas: FormSchema[] = []; + if (isObject(data)) { + schemas.push(data as FormSchema); + } + if (isArray(data)) { + schemas = [...data]; + } + + const obj: Recordable = {}; + const currentFieldsValue = getFieldsValue(); + schemas.forEach((item) => { + if ( + item.component != 'Divider' && + Reflect.has(item, 'field') && + item.field && + !isNullOrUnDef(item.defaultValue) && + !(item.field in currentFieldsValue) + ) { + obj[item.field] = item.defaultValue; + } + }); + setFieldsValue(obj); + } + + function getFieldsValue(): Recordable { + const formEl = unref(formElRef); + if (!formEl) return {}; + return handleFormValues(toRaw(unref(formModel))); + } + + /** + * @description: Is it time + */ + function itemIsDateType(key: string) { + return unref(getSchema).some((item) => { + return item.field === key ? dateItemType.includes(item.component) : false; + }); + } + + async function validateFields(nameList?: NamePath[] | undefined) { + return unref(formElRef)?.validateFields(nameList); + } + + async function validate(nameList?: NamePath[] | undefined) { + return await unref(formElRef)?.validate(nameList); + } + + async function clearValidate(name?: string | string[]) { + await unref(formElRef)?.clearValidate(name); + } + + async function scrollToField(name: NamePath, options?: ScrollOptions | undefined) { + await unref(formElRef)?.scrollToField(name, options); + } + + /** + * @description: Form submission + */ + async function handleSubmit(e?: Event): Promise { + e && e.preventDefault(); + const { submitFunc } = unref(getProps); + if (submitFunc && isFunction(submitFunc)) { + await submitFunc(); + return; + } + const formEl = unref(formElRef); + if (!formEl) return; + try { + const values = await validate(); + const res = handleFormValues(values); + emit('submit', res); + } catch (error: any) { + throw new Error(error); + } + } + + return { + handleSubmit, + clearValidate, + validate, + validateFields, + getFieldsValue, + updateSchema, + resetSchema, + appendSchemaByField, + removeSchemaByFiled, + resetFields, + setFieldsValue, + scrollToField, + }; +} diff --git a/monolithic/frontend/src/components/Form/src/hooks/useFormValues.ts b/monolithic/frontend/src/components/Form/src/hooks/useFormValues.ts new file mode 100644 index 0000000..34dd9dd --- /dev/null +++ b/monolithic/frontend/src/components/Form/src/hooks/useFormValues.ts @@ -0,0 +1,131 @@ +import { isArray, isFunction, isObject, isString, isNullOrUnDef } from '/@/utils/is'; +import { dateUtil } from '/@/utils/dateUtil'; +import { unref } from 'vue'; +import type { Ref, ComputedRef } from 'vue'; +import type { FormProps, FormSchema } from '../types/form'; +import { cloneDeep, set } from 'lodash-es'; + +interface UseFormValuesContext { + defaultValueRef: Ref; + getSchema: ComputedRef; + getProps: ComputedRef; + formModel: Recordable; +} + +/** + * @desription deconstruct array-link key. This method will mutate the target. + */ +function tryDeconstructArray(key: string, value: any, target: Recordable) { + const pattern = /^\[(.+)\]$/; + if (pattern.test(key)) { + const match = key.match(pattern); + if (match && match[1]) { + const keys = match[1].split(','); + value = Array.isArray(value) ? value : [value]; + keys.forEach((k, index) => { + set(target, k.trim(), value[index]); + }); + return true; + } + } +} + +/** + * @desription deconstruct object-link key. This method will mutate the target. + */ +function tryDeconstructObject(key: string, value: any, target: Recordable) { + const pattern = /^\{(.+)\}$/; + if (pattern.test(key)) { + const match = key.match(pattern); + if (match && match[1]) { + const keys = match[1].split(','); + value = isObject(value) ? value : {}; + keys.forEach((k) => { + set(target, k.trim(), value[k.trim()]); + }); + return true; + } + } +} + +export function useFormValues({ + defaultValueRef, + getSchema, + formModel, + getProps, +}: UseFormValuesContext) { + // Processing form values + function handleFormValues(values: Recordable) { + if (!isObject(values)) { + return {}; + } + const res: Recordable = {}; + for (const item of Object.entries(values)) { + let [, value] = item; + const [key] = item; + if (!key || (isArray(value) && value.length === 0) || isFunction(value)) { + continue; + } + const transformDateFunc = unref(getProps).transformDateFunc; + if (isObject(value)) { + value = transformDateFunc?.(value); + } + + if (isArray(value) && value[0]?.format && value[1]?.format) { + value = value.map((item) => transformDateFunc?.(item)); + } + // Remove spaces + if (isString(value)) { + value = value.trim(); + } + if (!tryDeconstructArray(key, value, res) && !tryDeconstructObject(key, value, res)) { + // 没有解构成功的,按原样赋值 + set(res, key, value); + } + } + return handleRangeTimeValue(res); + } + + /** + * @description: Processing time interval parameters + */ + function handleRangeTimeValue(values: Recordable) { + const fieldMapToTime = unref(getProps).fieldMapToTime; + + if (!fieldMapToTime || !Array.isArray(fieldMapToTime)) { + return values; + } + + for (const [field, [startTimeKey, endTimeKey], format = 'YYYY-MM-DD'] of fieldMapToTime) { + if (!field || !startTimeKey || !endTimeKey || !values[field]) { + continue; + } + + const [startTime, endTime]: string[] = values[field]; + + values[startTimeKey] = dateUtil(startTime).format(format); + values[endTimeKey] = dateUtil(endTime).format(format); + Reflect.deleteProperty(values, field); + } + + return values; + } + + function initDefault() { + const schemas = unref(getSchema); + const obj: Recordable = {}; + schemas.forEach((item) => { + const { defaultValue } = item; + if (!isNullOrUnDef(defaultValue)) { + obj[item.field] = defaultValue; + + if (formModel[item.field] === undefined) { + formModel[item.field] = defaultValue; + } + } + }); + defaultValueRef.value = cloneDeep(obj); + } + + return { handleFormValues, initDefault }; +} diff --git a/monolithic/frontend/src/components/Form/src/hooks/useLabelWidth.ts b/monolithic/frontend/src/components/Form/src/hooks/useLabelWidth.ts new file mode 100644 index 0000000..3befa1c --- /dev/null +++ b/monolithic/frontend/src/components/Form/src/hooks/useLabelWidth.ts @@ -0,0 +1,42 @@ +import type { Ref } from 'vue'; +import { computed, unref } from 'vue'; +import type { FormProps, FormSchema } from '../types/form'; +import { isNumber } from '/@/utils/is'; + +export function useItemLabelWidth(schemaItemRef: Ref, propsRef: Ref) { + return computed(() => { + const schemaItem = unref(schemaItemRef); + const { labelCol = {}, wrapperCol = {} } = schemaItem.itemProps || {}; + const { labelWidth, disabledLabelWidth } = schemaItem; + + const { + labelWidth: globalLabelWidth, + labelCol: globalLabelCol, + wrapperCol: globWrapperCol, + layout, + } = unref(propsRef); + + // If labelWidth is set globally, all items setting + if ((!globalLabelWidth && !labelWidth && !globalLabelCol) || disabledLabelWidth) { + labelCol.style = { + textAlign: 'left', + }; + return { labelCol, wrapperCol }; + } + let width = labelWidth || globalLabelWidth; + const col = { ...globalLabelCol, ...labelCol }; + const wrapCol = { ...globWrapperCol, ...wrapperCol }; + + if (width) { + width = isNumber(width) ? `${width}px` : width; + } + + return { + labelCol: { style: { width }, ...col }, + wrapperCol: { + style: { width: layout === 'vertical' ? '100%' : `calc(100% - ${width})` }, + ...wrapCol, + }, + }; + }); +} diff --git a/monolithic/frontend/src/components/Form/src/props.ts b/monolithic/frontend/src/components/Form/src/props.ts new file mode 100644 index 0000000..bfdaee7 --- /dev/null +++ b/monolithic/frontend/src/components/Form/src/props.ts @@ -0,0 +1,103 @@ +import type { FieldMapToTime, FormSchema } from './types/form'; +import type { CSSProperties, PropType } from 'vue'; +import type { ColEx } from './types'; +import type { TableActionType } from '/@/components/Table'; +import type { ButtonProps } from 'ant-design-vue/es/button/buttonTypes'; +import type { RowProps } from 'ant-design-vue/lib/grid/Row'; +import { propTypes } from '/@/utils/propTypes'; + +export const basicProps = { + model: { + type: Object as PropType, + default: {}, + }, + // 标签宽度 固定宽度 + labelWidth: { + type: [Number, String] as PropType, + default: 0, + }, + fieldMapToTime: { + type: Array as PropType, + default: () => [], + }, + compact: propTypes.bool, + // 表单配置规则 + schemas: { + type: [Array] as PropType, + default: () => [], + }, + mergeDynamicData: { + type: Object as PropType, + default: null, + }, + baseRowStyle: { + type: Object as PropType, + }, + baseColProps: { + type: Object as PropType>, + }, + autoSetPlaceHolder: propTypes.bool.def(true), + // 在INPUT组件上单击回车时,是否自动提交 + autoSubmitOnEnter: propTypes.bool.def(false), + submitOnReset: propTypes.bool, + submitOnChange: propTypes.bool, + size: propTypes.oneOf(['default', 'small', 'large']).def('default'), + // 禁用表单 + disabled: propTypes.bool, + emptySpan: { + type: [Number, Object] as PropType, + default: 0, + }, + // 是否显示收起展开按钮 + showAdvancedButton: propTypes.bool, + // 转化时间 + transformDateFunc: { + type: Function as PropType, + default: (date: any) => { + return date?.format?.('YYYY-MM-DD HH:mm:ss') ?? date; + }, + }, + rulesMessageJoinLabel: propTypes.bool.def(true), + // 超过3行自动折叠 + autoAdvancedLine: propTypes.number.def(3), + // 不受折叠影响的行数 + alwaysShowLines: propTypes.number.def(1), + + // 是否显示操作按钮 + showActionButtonGroup: propTypes.bool.def(true), + // 操作列Col配置 + actionColOptions: Object as PropType>, + // 显示重置按钮 + showResetButton: propTypes.bool.def(true), + // 是否聚焦第一个输入框,只在第一个表单项为input的时候作用 + autoFocusFirstItem: propTypes.bool, + // 重置按钮配置 + resetButtonOptions: Object as PropType>, + + // 显示确认按钮 + showSubmitButton: propTypes.bool.def(true), + // 确认按钮配置 + submitButtonOptions: Object as PropType>, + + // 自定义重置函数 + resetFunc: Function as PropType<() => Promise>, + submitFunc: Function as PropType<() => Promise>, + + // 以下为默认props + hideRequiredMark: propTypes.bool, + + labelCol: Object as PropType>, + + layout: propTypes.oneOf(['horizontal', 'vertical', 'inline']).def('horizontal'), + tableAction: { + type: Object as PropType, + }, + + wrapperCol: Object as PropType>, + + colon: propTypes.bool, + + labelAlign: propTypes.string, + + rowProps: Object as PropType, +}; diff --git a/monolithic/frontend/src/components/Form/src/types/form.ts b/monolithic/frontend/src/components/Form/src/types/form.ts new file mode 100644 index 0000000..2c77228 --- /dev/null +++ b/monolithic/frontend/src/components/Form/src/types/form.ts @@ -0,0 +1,223 @@ +import type { NamePath, RuleObject } from 'ant-design-vue/lib/form/interface'; +import type { VNode } from 'vue'; +import type { ButtonProps as AntdButtonProps } from '/@/components/Button'; +import type { FormItem } from './formItem'; +import type { ColEx, ComponentType } from './index'; +import type { TableActionType } from '/@/components/Table/src/types/table'; +import type { CSSProperties } from 'vue'; +import type { RowProps } from 'ant-design-vue/lib/grid/Row'; + +export type FieldMapToTime = [string, [string, string], string?][]; + +export type Rule = RuleObject & { + trigger?: 'blur' | 'change' | ['change', 'blur']; +}; + +export interface RenderCallbackParams { + schema: FormSchema; + values: Recordable; + model: Recordable; + field: string; +} + +export interface ButtonProps extends AntdButtonProps { + text?: string; +} + +export interface FormActionType { + submit: () => Promise; + setFieldsValue: (values: T) => Promise; + resetFields: () => Promise; + getFieldsValue: () => Recordable; + clearValidate: (name?: string | string[]) => Promise; + updateSchema: (data: Partial | Partial[]) => Promise; + resetSchema: (data: Partial | Partial[]) => Promise; + setProps: (formProps: Partial) => Promise; + removeSchemaByFiled: (field: string | string[]) => Promise; + appendSchemaByField: ( + schema: FormSchema, + prefixField: string | undefined, + first?: boolean | undefined, + ) => Promise; + validateFields: (nameList?: NamePath[]) => Promise; + validate: (nameList?: NamePath[]) => Promise; + scrollToField: (name: NamePath, options?: ScrollOptions) => Promise; +} + +export type RegisterFn = (formInstance: FormActionType) => void; + +export type UseFormReturnType = [RegisterFn, FormActionType]; + +export interface FormProps { + name?: string; + layout?: 'vertical' | 'inline' | 'horizontal'; + // Form value + model?: Recordable; + // The width of all items in the entire form + labelWidth?: number | string; + // alignment + labelAlign?: 'left' | 'right'; + // Row configuration for the entire form + rowProps?: RowProps; + // Submit form on reset + submitOnReset?: boolean; + // Submit form on form changing + submitOnChange?: boolean; + // Col configuration for the entire form + labelCol?: Partial; + // Col configuration for the entire form + wrapperCol?: Partial; + + // General row style + baseRowStyle?: CSSProperties; + + // General col configuration + baseColProps?: Partial; + + // Form configuration rules + schemas?: FormSchema[]; + // Function values used to merge into dynamic control form items + mergeDynamicData?: Recordable; + // Compact mode for search forms + compact?: boolean; + // Blank line span + emptySpan?: number | Partial; + // Internal component size of the form + size?: 'default' | 'small' | 'large'; + // Whether to disable + disabled?: boolean; + // Time interval fields are mapped into multiple + fieldMapToTime?: FieldMapToTime; + // Placeholder is set automatically + autoSetPlaceHolder?: boolean; + // Auto submit on press enter on input + autoSubmitOnEnter?: boolean; + // Check whether the information is added to the label + rulesMessageJoinLabel?: boolean; + // Whether to show collapse and expand buttons + showAdvancedButton?: boolean; + // Whether to focus on the first input box, only works when the first form item is input + autoFocusFirstItem?: boolean; + // Automatically collapse over the specified number of rows + autoAdvancedLine?: number; + // Always show lines + alwaysShowLines?: number; + // Whether to show the operation button + showActionButtonGroup?: boolean; + + // Reset button configuration + resetButtonOptions?: Partial; + + // Confirm button configuration + submitButtonOptions?: Partial; + + // Operation column configuration + actionColOptions?: Partial; + + // Show reset button + showResetButton?: boolean; + // Show confirmation button + showSubmitButton?: boolean; + + resetFunc?: () => Promise; + submitFunc?: () => Promise; + transformDateFunc?: (date: any) => string; + colon?: boolean; +} +export interface FormSchema { + // Field name + field: string; + // Event name triggered by internal value change, default change + changeEvent?: string; + // Variable name bound to v-model Default value + valueField?: string; + // Label name + label: string | VNode; + // Auxiliary text + subLabel?: string; + // Help text on the right side of the text + helpMessage?: + | string + | string[] + | ((renderCallbackParams: RenderCallbackParams) => string | string[]); + // BaseHelp component props + helpComponentProps?: Partial; + // Label width, if it is passed, the labelCol and WrapperCol configured by itemProps will be invalid + labelWidth?: string | number; + // Disable the adjustment of labelWidth with global settings of formModel, and manually set labelCol and wrapperCol by yourself + disabledLabelWidth?: boolean; + // render component + component: ComponentType; + // Component parameters + componentProps?: + | ((opt: { + schema: FormSchema; + tableAction: TableActionType; + formActionType: FormActionType; + formModel: Recordable; + }) => Recordable) + | object; + // Required + required?: boolean | ((renderCallbackParams: RenderCallbackParams) => boolean); + + suffix?: string | number | ((values: RenderCallbackParams) => string | number); + + // Validation rules + rules?: Rule[]; + // Check whether the information is added to the label + rulesMessageJoinLabel?: boolean; + + // Reference formModelItem + itemProps?: Partial; + + // col configuration outside formModelItem + colProps?: Partial; + + // 默认值 + defaultValue?: any; + isAdvanced?: boolean; + + // Matching details components + span?: number; + + ifShow?: boolean | ((renderCallbackParams: RenderCallbackParams) => boolean); + + show?: boolean | ((renderCallbackParams: RenderCallbackParams) => boolean); + + // Render the content in the form-item tag + render?: (renderCallbackParams: RenderCallbackParams) => VNode | VNode[] | string; + + // Rendering col content requires outer wrapper form-item + renderColContent?: (renderCallbackParams: RenderCallbackParams) => VNode | VNode[] | string; + + renderComponentContent?: + | ((renderCallbackParams: RenderCallbackParams) => any) + | VNode + | VNode[] + | string; + + // Custom slot, in from-item + slot?: string; + + // Custom slot, similar to renderColContent + colSlot?: string; + + dynamicDisabled?: boolean | ((renderCallbackParams: RenderCallbackParams) => boolean); + + dynamicRules?: (renderCallbackParams: RenderCallbackParams) => Rule[]; +} +export interface HelpComponentProps { + maxWidth: string; + // Whether to display the serial number + showIndex: boolean; + // Text list + text: any; + // colour + color: string; + // font size + fontSize: string; + icon: string; + absolute: boolean; + // Positioning + position: any; +} diff --git a/monolithic/frontend/src/components/Form/src/types/formItem.ts b/monolithic/frontend/src/components/Form/src/types/formItem.ts new file mode 100644 index 0000000..77b238a --- /dev/null +++ b/monolithic/frontend/src/components/Form/src/types/formItem.ts @@ -0,0 +1,91 @@ +import type { NamePath } from 'ant-design-vue/lib/form/interface'; +import type { ColProps } from 'ant-design-vue/lib/grid/Col'; +import type { HTMLAttributes, VNodeChild } from 'vue'; + +export interface FormItem { + /** + * Used with label, whether to display : after label text. + * @default true + * @type boolean + */ + colon?: boolean; + + /** + * The extra prompt message. It is similar to help. Usage example: to display error message and prompt message at the same time. + * @type any (string | slot) + */ + extra?: string | VNodeChild | JSX.Element; + + /** + * Used with validateStatus, this option specifies the validation status icon. Recommended to be used only with Input. + * @default false + * @type boolean + */ + hasFeedback?: boolean; + + /** + * The prompt message. If not provided, the prompt message will be generated by the validation rule. + * @type any (string | slot) + */ + help?: string | VNodeChild | JSX.Element; + + /** + * Label test + * @type any (string | slot) + */ + label?: string | VNodeChild | JSX.Element; + + /** + * The layout of label. You can set span offset to something like {span: 3, offset: 12} or sm: {span: 3, offset: 12} same as with + * @type Col + */ + labelCol?: ColProps & HTMLAttributes; + + /** + * Whether provided or not, it will be generated by the validation rule. + * @default false + * @type boolean + */ + required?: boolean; + + /** + * The validation status. If not provided, it will be generated by validation rule. options: 'success' 'warning' 'error' 'validating' + * @type string + */ + validateStatus?: '' | 'success' | 'warning' | 'error' | 'validating'; + + /** + * The layout for input controls, same as labelCol + * @type Col + */ + wrapperCol?: ColProps; + /** + * Set sub label htmlFor. + */ + htmlFor?: string; + /** + * text align of label + */ + labelAlign?: 'left' | 'right'; + /** + * a key of model. In the setting of validate and resetFields method, the attribute is required + */ + name?: NamePath; + /** + * validation rules of form + */ + rules?: object | object[]; + /** + * Whether to automatically associate form fields. In most cases, you can setting automatic association. + * If the conditions for automatic association are not met, you can manually associate them. See the notes below. + */ + autoLink?: boolean; + /** + * Whether stop validate on first rule of error for this field. + */ + validateFirst?: boolean; + /** + * When to validate the value of children node + */ + validateTrigger?: string | string[] | false; +} diff --git a/monolithic/frontend/src/components/Form/src/types/hooks.ts b/monolithic/frontend/src/components/Form/src/types/hooks.ts new file mode 100644 index 0000000..0308e73 --- /dev/null +++ b/monolithic/frontend/src/components/Form/src/types/hooks.ts @@ -0,0 +1,6 @@ +export interface AdvanceState { + isAdvanced: boolean; + hideAdvanceBtn: boolean; + isLoad: boolean; + actionSpan: number; +} diff --git a/monolithic/frontend/src/components/Form/src/types/index.ts b/monolithic/frontend/src/components/Form/src/types/index.ts new file mode 100644 index 0000000..294b080 --- /dev/null +++ b/monolithic/frontend/src/components/Form/src/types/index.ts @@ -0,0 +1,117 @@ +type ColSpanType = number | string; +export interface ColEx { + style?: any; + /** + * raster number of cells to occupy, 0 corresponds to display: none + * @default none (0) + * @type ColSpanType + */ + span?: ColSpanType; + + /** + * raster order, used in flex layout mode + * @default 0 + * @type ColSpanType + */ + order?: ColSpanType; + + /** + * the layout fill of flex + * @default none + * @type ColSpanType + */ + flex?: ColSpanType; + + /** + * the number of cells to offset Col from the left + * @default 0 + * @type ColSpanType + */ + offset?: ColSpanType; + + /** + * the number of cells that raster is moved to the right + * @default 0 + * @type ColSpanType + */ + push?: ColSpanType; + + /** + * the number of cells that raster is moved to the left + * @default 0 + * @type ColSpanType + */ + pull?: ColSpanType; + + /** + * <576px and also default setting, could be a span value or an object containing above props + * @type { span: ColSpanType, offset: ColSpanType } | ColSpanType + */ + xs?: { span: ColSpanType; offset: ColSpanType } | ColSpanType; + + /** + * ≥576px, could be a span value or an object containing above props + * @type { span: ColSpanType, offset: ColSpanType } | ColSpanType + */ + sm?: { span: ColSpanType; offset: ColSpanType } | ColSpanType; + + /** + * ≥768px, could be a span value or an object containing above props + * @type { span: ColSpanType, offset: ColSpanType } | ColSpanType + */ + md?: { span: ColSpanType; offset: ColSpanType } | ColSpanType; + + /** + * ≥992px, could be a span value or an object containing above props + * @type { span: ColSpanType, offset: ColSpanType } | ColSpanType + */ + lg?: { span: ColSpanType; offset: ColSpanType } | ColSpanType; + + /** + * ≥1200px, could be a span value or an object containing above props + * @type { span: ColSpanType, offset: ColSpanType } | ColSpanType + */ + xl?: { span: ColSpanType; offset: ColSpanType } | ColSpanType; + + /** + * ≥1600px, could be a span value or an object containing above props + * @type { span: ColSpanType, offset: ColSpanType } | ColSpanType + */ + xxl?: { span: ColSpanType; offset: ColSpanType } | ColSpanType; +} + +export type ComponentType = + | 'Input' + | 'InputGroup' + | 'InputPassword' + | 'InputSearch' + | 'InputTextArea' + | 'InputNumber' + | 'InputCountDown' + | 'Select' + | 'ApiSelect' + | 'TreeSelect' + | 'ApiTree' + | 'ApiTreeSelect' + | 'ApiRadioGroup' + | 'RadioButtonGroup' + | 'RadioGroup' + | 'Checkbox' + | 'CheckboxGroup' + | 'AutoComplete' + | 'ApiCascader' + | 'Cascader' + | 'DatePicker' + | 'MonthPicker' + | 'RangePicker' + | 'WeekPicker' + | 'TimePicker' + | 'Switch' + | 'StrengthMeter' + | 'Upload' + | 'IconPicker' + | 'Render' + | 'Slider' + | 'Rate' + | 'Divider' + | 'ApiTransfer'; diff --git a/monolithic/frontend/src/components/Icon/data/icons.data.ts b/monolithic/frontend/src/components/Icon/data/icons.data.ts new file mode 100644 index 0000000..e5fe3e2 --- /dev/null +++ b/monolithic/frontend/src/components/Icon/data/icons.data.ts @@ -0,0 +1,793 @@ +export default { + prefix: 'ant-design', + icons: [ + 'account-book-filled', + 'account-book-outlined', + 'account-book-twotone', + 'aim-outlined', + 'alert-filled', + 'alert-outlined', + 'alert-twotone', + 'alibaba-outlined', + 'align-center-outlined', + 'align-left-outlined', + 'align-right-outlined', + 'alipay-circle-filled', + 'alipay-circle-outlined', + 'alipay-outlined', + 'alipay-square-filled', + 'aliwangwang-filled', + 'aliwangwang-outlined', + 'aliyun-outlined', + 'amazon-circle-filled', + 'amazon-outlined', + 'amazon-square-filled', + 'android-filled', + 'android-outlined', + 'ant-cloud-outlined', + 'ant-design-outlined', + 'apartment-outlined', + 'api-filled', + 'api-outlined', + 'api-twotone', + 'apple-filled', + 'apple-outlined', + 'appstore-add-outlined', + 'appstore-filled', + 'appstore-outlined', + 'appstore-twotone', + 'area-chart-outlined', + 'arrow-down-outlined', + 'arrow-left-outlined', + 'arrow-right-outlined', + 'arrow-up-outlined', + 'arrows-alt-outlined', + 'audio-filled', + 'audio-muted-outlined', + 'audio-outlined', + 'audio-twotone', + 'audit-outlined', + 'backward-filled', + 'backward-outlined', + 'bank-filled', + 'bank-outlined', + 'bank-twotone', + 'bar-chart-outlined', + 'barcode-outlined', + 'bars-outlined', + 'behance-circle-filled', + 'behance-outlined', + 'behance-square-filled', + 'behance-square-outlined', + 'bell-filled', + 'bell-outlined', + 'bell-twotone', + 'bg-colors-outlined', + 'block-outlined', + 'bold-outlined', + 'book-filled', + 'book-outlined', + 'book-twotone', + 'border-bottom-outlined', + 'border-horizontal-outlined', + 'border-inner-outlined', + 'border-left-outlined', + 'border-outer-outlined', + 'border-outlined', + 'border-right-outlined', + 'border-top-outlined', + 'border-verticle-outlined', + 'borderless-table-outlined', + 'box-plot-filled', + 'box-plot-outlined', + 'box-plot-twotone', + 'branches-outlined', + 'bug-filled', + 'bug-outlined', + 'bug-twotone', + 'build-filled', + 'build-outlined', + 'build-twotone', + 'bulb-filled', + 'bulb-outlined', + 'bulb-twotone', + 'calculator-filled', + 'calculator-outlined', + 'calculator-twotone', + 'calendar-filled', + 'calendar-outlined', + 'calendar-twotone', + 'camera-filled', + 'camera-outlined', + 'camera-twotone', + 'car-filled', + 'car-outlined', + 'car-twotone', + 'caret-down-filled', + 'caret-down-outlined', + 'caret-left-filled', + 'caret-left-outlined', + 'caret-right-filled', + 'caret-right-outlined', + 'caret-up-filled', + 'caret-up-outlined', + 'carry-out-filled', + 'carry-out-outlined', + 'carry-out-twotone', + 'check-circle-filled', + 'check-circle-outlined', + 'check-circle-twotone', + 'check-outlined', + 'check-square-filled', + 'check-square-outlined', + 'check-square-twotone', + 'chrome-filled', + 'chrome-outlined', + 'ci-circle-filled', + 'ci-circle-outlined', + 'ci-circle-twotone', + 'ci-outlined', + 'ci-twotone', + 'clear-outlined', + 'clock-circle-filled', + 'clock-circle-outlined', + 'clock-circle-twotone', + 'close-circle-filled', + 'close-circle-outlined', + 'close-circle-twotone', + 'close-outlined', + 'close-square-filled', + 'close-square-outlined', + 'close-square-twotone', + 'cloud-download-outlined', + 'cloud-filled', + 'cloud-outlined', + 'cloud-server-outlined', + 'cloud-sync-outlined', + 'cloud-twotone', + 'cloud-upload-outlined', + 'cluster-outlined', + 'code-filled', + 'code-outlined', + 'code-sandbox-circle-filled', + 'code-sandbox-outlined', + 'code-sandbox-square-filled', + 'code-twotone', + 'codepen-circle-filled', + 'codepen-circle-outlined', + 'codepen-outlined', + 'codepen-square-filled', + 'coffee-outlined', + 'column-height-outlined', + 'column-width-outlined', + 'comment-outlined', + 'compass-filled', + 'compass-outlined', + 'compass-twotone', + 'compress-outlined', + 'console-sql-outlined', + 'contacts-filled', + 'contacts-outlined', + 'contacts-twotone', + 'container-filled', + 'container-outlined', + 'container-twotone', + 'control-filled', + 'control-outlined', + 'control-twotone', + 'copy-filled', + 'copy-outlined', + 'copy-twotone', + 'copyright-circle-filled', + 'copyright-circle-outlined', + 'copyright-circle-twotone', + 'copyright-outlined', + 'copyright-twotone', + 'credit-card-filled', + 'credit-card-outlined', + 'credit-card-twotone', + 'crown-filled', + 'crown-outlined', + 'crown-twotone', + 'customer-service-filled', + 'customer-service-outlined', + 'customer-service-twotone', + 'dash-outlined', + 'dashboard-filled', + 'dashboard-outlined', + 'dashboard-twotone', + 'database-filled', + 'database-outlined', + 'database-twotone', + 'delete-column-outlined', + 'delete-filled', + 'delete-outlined', + 'delete-row-outlined', + 'delete-twotone', + 'delivered-procedure-outlined', + 'deployment-unit-outlined', + 'desktop-outlined', + 'diff-filled', + 'diff-outlined', + 'diff-twotone', + 'dingding-outlined', + 'dingtalk-circle-filled', + 'dingtalk-outlined', + 'dingtalk-square-filled', + 'disconnect-outlined', + 'dislike-filled', + 'dislike-outlined', + 'dislike-twotone', + 'dollar-circle-filled', + 'dollar-circle-outlined', + 'dollar-circle-twotone', + 'dollar-outlined', + 'dollar-twotone', + 'dot-chart-outlined', + 'double-left-outlined', + 'double-right-outlined', + 'down-circle-filled', + 'down-circle-outlined', + 'down-circle-twotone', + 'down-outlined', + 'down-square-filled', + 'down-square-outlined', + 'down-square-twotone', + 'download-outlined', + 'drag-outlined', + 'dribbble-circle-filled', + 'dribbble-outlined', + 'dribbble-square-filled', + 'dribbble-square-outlined', + 'dropbox-circle-filled', + 'dropbox-outlined', + 'dropbox-square-filled', + 'edit-filled', + 'edit-outlined', + 'edit-twotone', + 'ellipsis-outlined', + 'enter-outlined', + 'environment-filled', + 'environment-outlined', + 'environment-twotone', + 'euro-circle-filled', + 'euro-circle-outlined', + 'euro-circle-twotone', + 'euro-outlined', + 'euro-twotone', + 'exception-outlined', + 'exclamation-circle-filled', + 'exclamation-circle-outlined', + 'exclamation-circle-twotone', + 'exclamation-outlined', + 'expand-alt-outlined', + 'expand-outlined', + 'experiment-filled', + 'experiment-outlined', + 'experiment-twotone', + 'export-outlined', + 'eye-filled', + 'eye-invisible-filled', + 'eye-invisible-outlined', + 'eye-invisible-twotone', + 'eye-outlined', + 'eye-twotone', + 'facebook-filled', + 'facebook-outlined', + 'fall-outlined', + 'fast-backward-filled', + 'fast-backward-outlined', + 'fast-forward-filled', + 'fast-forward-outlined', + 'field-binary-outlined', + 'field-number-outlined', + 'field-string-outlined', + 'field-time-outlined', + 'file-add-filled', + 'file-add-outlined', + 'file-add-twotone', + 'file-done-outlined', + 'file-excel-filled', + 'file-excel-outlined', + 'file-excel-twotone', + 'file-exclamation-filled', + 'file-exclamation-outlined', + 'file-exclamation-twotone', + 'file-filled', + 'file-gif-outlined', + 'file-image-filled', + 'file-image-outlined', + 'file-image-twotone', + 'file-jpg-outlined', + 'file-markdown-filled', + 'file-markdown-outlined', + 'file-markdown-twotone', + 'file-outlined', + 'file-pdf-filled', + 'file-pdf-outlined', + 'file-pdf-twotone', + 'file-ppt-filled', + 'file-ppt-outlined', + 'file-ppt-twotone', + 'file-protect-outlined', + 'file-search-outlined', + 'file-sync-outlined', + 'file-text-filled', + 'file-text-outlined', + 'file-text-twotone', + 'file-twotone', + 'file-unknown-filled', + 'file-unknown-outlined', + 'file-unknown-twotone', + 'file-word-filled', + 'file-word-outlined', + 'file-word-twotone', + 'file-zip-filled', + 'file-zip-outlined', + 'file-zip-twotone', + 'filter-filled', + 'filter-outlined', + 'filter-twotone', + 'fire-filled', + 'fire-outlined', + 'fire-twotone', + 'flag-filled', + 'flag-outlined', + 'flag-twotone', + 'folder-add-filled', + 'folder-add-outlined', + 'folder-add-twotone', + 'folder-filled', + 'folder-open-filled', + 'folder-open-outlined', + 'folder-open-twotone', + 'folder-outlined', + 'folder-twotone', + 'folder-view-outlined', + 'font-colors-outlined', + 'font-size-outlined', + 'fork-outlined', + 'form-outlined', + 'format-painter-filled', + 'format-painter-outlined', + 'forward-filled', + 'forward-outlined', + 'frown-filled', + 'frown-outlined', + 'frown-twotone', + 'fullscreen-exit-outlined', + 'fullscreen-outlined', + 'function-outlined', + 'fund-filled', + 'fund-outlined', + 'fund-projection-screen-outlined', + 'fund-twotone', + 'fund-view-outlined', + 'funnel-plot-filled', + 'funnel-plot-outlined', + 'funnel-plot-twotone', + 'gateway-outlined', + 'gif-outlined', + 'gift-filled', + 'gift-outlined', + 'gift-twotone', + 'github-filled', + 'github-outlined', + 'gitlab-filled', + 'gitlab-outlined', + 'global-outlined', + 'gold-filled', + 'gold-outlined', + 'gold-twotone', + 'golden-filled', + 'google-circle-filled', + 'google-outlined', + 'google-plus-circle-filled', + 'google-plus-outlined', + 'google-plus-square-filled', + 'google-square-filled', + 'group-outlined', + 'hdd-filled', + 'hdd-outlined', + 'hdd-twotone', + 'heart-filled', + 'heart-outlined', + 'heart-twotone', + 'heat-map-outlined', + 'highlight-filled', + 'highlight-outlined', + 'highlight-twotone', + 'history-outlined', + 'home-filled', + 'home-outlined', + 'home-twotone', + 'hourglass-filled', + 'hourglass-outlined', + 'hourglass-twotone', + 'html5-filled', + 'html5-outlined', + 'html5-twotone', + 'idcard-filled', + 'idcard-outlined', + 'idcard-twotone', + 'ie-circle-filled', + 'ie-outlined', + 'ie-square-filled', + 'import-outlined', + 'inbox-outlined', + 'info-circle-filled', + 'info-circle-outlined', + 'info-circle-twotone', + 'info-outlined', + 'insert-row-above-outlined', + 'insert-row-below-outlined', + 'insert-row-left-outlined', + 'insert-row-right-outlined', + 'instagram-filled', + 'instagram-outlined', + 'insurance-filled', + 'insurance-outlined', + 'insurance-twotone', + 'interaction-filled', + 'interaction-outlined', + 'interaction-twotone', + 'issues-close-outlined', + 'italic-outlined', + 'key-outlined', + 'laptop-outlined', + 'layout-filled', + 'layout-outlined', + 'layout-twotone', + 'left-circle-filled', + 'left-circle-outlined', + 'left-circle-twotone', + 'left-outlined', + 'left-square-filled', + 'left-square-outlined', + 'left-square-twotone', + 'like-filled', + 'like-outlined', + 'like-twotone', + 'line-chart-outlined', + 'line-height-outlined', + 'line-outlined', + 'link-outlined', + 'linkedin-filled', + 'linkedin-outlined', + 'loading-3-quarters-outlined', + 'loading-outlined', + 'lock-filled', + 'lock-outlined', + 'lock-twotone', + 'login-outlined', + 'logout-outlined', + 'mac-command-filled', + 'mac-command-outlined', + 'mail-filled', + 'mail-outlined', + 'mail-twotone', + 'man-outlined', + 'medicine-box-filled', + 'medicine-box-outlined', + 'medicine-box-twotone', + 'medium-circle-filled', + 'medium-outlined', + 'medium-square-filled', + 'medium-workmark-outlined', + 'meh-filled', + 'meh-outlined', + 'meh-twotone', + 'menu-fold-outlined', + 'menu-outlined', + 'menu-unfold-outlined', + 'merge-cells-outlined', + 'message-filled', + 'message-outlined', + 'message-twotone', + 'minus-circle-filled', + 'minus-circle-outlined', + 'minus-circle-twotone', + 'minus-outlined', + 'minus-square-filled', + 'minus-square-outlined', + 'minus-square-twotone', + 'mobile-filled', + 'mobile-outlined', + 'mobile-twotone', + 'money-collect-filled', + 'money-collect-outlined', + 'money-collect-twotone', + 'monitor-outlined', + 'more-outlined', + 'node-collapse-outlined', + 'node-expand-outlined', + 'node-index-outlined', + 'notification-filled', + 'notification-outlined', + 'notification-twotone', + 'number-outlined', + 'one-to-one-outlined', + 'ordered-list-outlined', + 'paper-clip-outlined', + 'partition-outlined', + 'pause-circle-filled', + 'pause-circle-outlined', + 'pause-circle-twotone', + 'pause-outlined', + 'pay-circle-filled', + 'pay-circle-outlined', + 'percentage-outlined', + 'phone-filled', + 'phone-outlined', + 'phone-twotone', + 'pic-center-outlined', + 'pic-left-outlined', + 'pic-right-outlined', + 'picture-filled', + 'picture-outlined', + 'picture-twotone', + 'pie-chart-filled', + 'pie-chart-outlined', + 'pie-chart-twotone', + 'play-circle-filled', + 'play-circle-outlined', + 'play-circle-twotone', + 'play-square-filled', + 'play-square-outlined', + 'play-square-twotone', + 'plus-circle-filled', + 'plus-circle-outlined', + 'plus-circle-twotone', + 'plus-outlined', + 'plus-square-filled', + 'plus-square-outlined', + 'plus-square-twotone', + 'pound-circle-filled', + 'pound-circle-outlined', + 'pound-circle-twotone', + 'pound-outlined', + 'poweroff-outlined', + 'printer-filled', + 'printer-outlined', + 'printer-twotone', + 'profile-filled', + 'profile-outlined', + 'profile-twotone', + 'project-filled', + 'project-outlined', + 'project-twotone', + 'property-safety-filled', + 'property-safety-outlined', + 'property-safety-twotone', + 'pull-request-outlined', + 'pushpin-filled', + 'pushpin-outlined', + 'pushpin-twotone', + 'qq-circle-filled', + 'qq-outlined', + 'qq-square-filled', + 'qrcode-outlined', + 'question-circle-filled', + 'question-circle-outlined', + 'question-circle-twotone', + 'question-outlined', + 'radar-chart-outlined', + 'radius-bottomleft-outlined', + 'radius-bottomright-outlined', + 'radius-setting-outlined', + 'radius-upleft-outlined', + 'radius-upright-outlined', + 'read-filled', + 'read-outlined', + 'reconciliation-filled', + 'reconciliation-outlined', + 'reconciliation-twotone', + 'red-envelope-filled', + 'red-envelope-outlined', + 'red-envelope-twotone', + 'reddit-circle-filled', + 'reddit-outlined', + 'reddit-square-filled', + 'redo-outlined', + 'reload-outlined', + 'rest-filled', + 'rest-outlined', + 'rest-twotone', + 'retweet-outlined', + 'right-circle-filled', + 'right-circle-outlined', + 'right-circle-twotone', + 'right-outlined', + 'right-square-filled', + 'right-square-outlined', + 'right-square-twotone', + 'rise-outlined', + 'robot-filled', + 'robot-outlined', + 'rocket-filled', + 'rocket-outlined', + 'rocket-twotone', + 'rollback-outlined', + 'rotate-left-outlined', + 'rotate-right-outlined', + 'safety-certificate-filled', + 'safety-certificate-outlined', + 'safety-certificate-twotone', + 'safety-outlined', + 'save-filled', + 'save-outlined', + 'save-twotone', + 'scan-outlined', + 'schedule-filled', + 'schedule-outlined', + 'schedule-twotone', + 'scissor-outlined', + 'search-outlined', + 'security-scan-filled', + 'security-scan-outlined', + 'security-scan-twotone', + 'select-outlined', + 'send-outlined', + 'setting-filled', + 'setting-outlined', + 'setting-twotone', + 'shake-outlined', + 'share-alt-outlined', + 'shop-filled', + 'shop-outlined', + 'shop-twotone', + 'shopping-cart-outlined', + 'shopping-filled', + 'shopping-outlined', + 'shopping-twotone', + 'shrink-outlined', + 'signal-filled', + 'sisternode-outlined', + 'sketch-circle-filled', + 'sketch-outlined', + 'sketch-square-filled', + 'skin-filled', + 'skin-outlined', + 'skin-twotone', + 'skype-filled', + 'skype-outlined', + 'slack-circle-filled', + 'slack-outlined', + 'slack-square-filled', + 'slack-square-outlined', + 'sliders-filled', + 'sliders-outlined', + 'sliders-twotone', + 'small-dash-outlined', + 'smile-filled', + 'smile-outlined', + 'smile-twotone', + 'snippets-filled', + 'snippets-outlined', + 'snippets-twotone', + 'solution-outlined', + 'sort-ascending-outlined', + 'sort-descending-outlined', + 'sound-filled', + 'sound-outlined', + 'sound-twotone', + 'split-cells-outlined', + 'star-filled', + 'star-outlined', + 'star-twotone', + 'step-backward-filled', + 'step-backward-outlined', + 'step-forward-filled', + 'step-forward-outlined', + 'stock-outlined', + 'stop-filled', + 'stop-outlined', + 'stop-twotone', + 'strikethrough-outlined', + 'subnode-outlined', + 'swap-left-outlined', + 'swap-outlined', + 'swap-right-outlined', + 'switcher-filled', + 'switcher-outlined', + 'switcher-twotone', + 'sync-outlined', + 'table-outlined', + 'tablet-filled', + 'tablet-outlined', + 'tablet-twotone', + 'tag-filled', + 'tag-outlined', + 'tag-twotone', + 'tags-filled', + 'tags-outlined', + 'tags-twotone', + 'taobao-circle-filled', + 'taobao-circle-outlined', + 'taobao-outlined', + 'taobao-square-filled', + 'team-outlined', + 'thunderbolt-filled', + 'thunderbolt-outlined', + 'thunderbolt-twotone', + 'to-top-outlined', + 'tool-filled', + 'tool-outlined', + 'tool-twotone', + 'trademark-circle-filled', + 'trademark-circle-outlined', + 'trademark-circle-twotone', + 'trademark-outlined', + 'transaction-outlined', + 'translation-outlined', + 'trophy-filled', + 'trophy-outlined', + 'trophy-twotone', + 'twitter-circle-filled', + 'twitter-outlined', + 'twitter-square-filled', + 'underline-outlined', + 'undo-outlined', + 'ungroup-outlined', + 'unlock-filled', + 'unlock-outlined', + 'unlock-twotone', + 'unordered-list-outlined', + 'up-circle-filled', + 'up-circle-outlined', + 'up-circle-twotone', + 'up-outlined', + 'up-square-filled', + 'up-square-outlined', + 'up-square-twotone', + 'upload-outlined', + 'usb-filled', + 'usb-outlined', + 'usb-twotone', + 'user-add-outlined', + 'user-delete-outlined', + 'user-outlined', + 'user-switch-outlined', + 'usergroup-add-outlined', + 'usergroup-delete-outlined', + 'verified-outlined', + 'vertical-align-bottom-outlined', + 'vertical-align-middle-outlined', + 'vertical-align-top-outlined', + 'vertical-left-outlined', + 'vertical-right-outlined', + 'video-camera-add-outlined', + 'video-camera-filled', + 'video-camera-outlined', + 'video-camera-twotone', + 'wallet-filled', + 'wallet-outlined', + 'wallet-twotone', + 'warning-filled', + 'warning-outlined', + 'warning-twotone', + 'wechat-filled', + 'wechat-outlined', + 'weibo-circle-filled', + 'weibo-circle-outlined', + 'weibo-outlined', + 'weibo-square-filled', + 'weibo-square-outlined', + 'whats-app-outlined', + 'wifi-outlined', + 'windows-filled', + 'windows-outlined', + 'woman-outlined', + 'yahoo-filled', + 'yahoo-outlined', + 'youtube-filled', + 'youtube-outlined', + 'yuque-filled', + 'yuque-outlined', + 'zhihu-circle-filled', + 'zhihu-outlined', + 'zhihu-square-filled', + 'zoom-in-outlined', + 'zoom-out-outlined', + ], +}; diff --git a/monolithic/frontend/src/components/Icon/index.ts b/monolithic/frontend/src/components/Icon/index.ts new file mode 100644 index 0000000..01e7d23 --- /dev/null +++ b/monolithic/frontend/src/components/Icon/index.ts @@ -0,0 +1,7 @@ +import Icon from './src/Icon.vue'; +import SvgIcon from './src/SvgIcon.vue'; +import IconPicker from './src/IconPicker.vue'; + +export { Icon, IconPicker, SvgIcon }; + +export default Icon; diff --git a/monolithic/frontend/src/components/Icon/src/Icon.vue b/monolithic/frontend/src/components/Icon/src/Icon.vue new file mode 100644 index 0000000..4956cf0 --- /dev/null +++ b/monolithic/frontend/src/components/Icon/src/Icon.vue @@ -0,0 +1,121 @@ + + + diff --git a/monolithic/frontend/src/components/Icon/src/IconPicker.vue b/monolithic/frontend/src/components/Icon/src/IconPicker.vue new file mode 100644 index 0000000..40cfe7d --- /dev/null +++ b/monolithic/frontend/src/components/Icon/src/IconPicker.vue @@ -0,0 +1,191 @@ + + + diff --git a/monolithic/frontend/src/components/Icon/src/SvgIcon.vue b/monolithic/frontend/src/components/Icon/src/SvgIcon.vue new file mode 100644 index 0000000..2afa4de --- /dev/null +++ b/monolithic/frontend/src/components/Icon/src/SvgIcon.vue @@ -0,0 +1,65 @@ + + + diff --git a/monolithic/frontend/src/components/Loading/index.ts b/monolithic/frontend/src/components/Loading/index.ts new file mode 100644 index 0000000..3673a44 --- /dev/null +++ b/monolithic/frontend/src/components/Loading/index.ts @@ -0,0 +1,5 @@ +import Loading from './src/Loading.vue'; + +export { Loading }; +export { useLoading } from './src/useLoading'; +export { createLoading } from './src/createLoading'; diff --git a/monolithic/frontend/src/components/Loading/src/Loading.vue b/monolithic/frontend/src/components/Loading/src/Loading.vue new file mode 100644 index 0000000..0f52b28 --- /dev/null +++ b/monolithic/frontend/src/components/Loading/src/Loading.vue @@ -0,0 +1,79 @@ + + + diff --git a/monolithic/frontend/src/components/Loading/src/createLoading.ts b/monolithic/frontend/src/components/Loading/src/createLoading.ts new file mode 100644 index 0000000..966ca53 --- /dev/null +++ b/monolithic/frontend/src/components/Loading/src/createLoading.ts @@ -0,0 +1,65 @@ +import { VNode, defineComponent } from 'vue'; +import type { LoadingProps } from './typing'; + +import { createVNode, render, reactive, h } from 'vue'; +import Loading from './Loading.vue'; + +export function createLoading(props?: Partial, target?: HTMLElement, wait = false) { + let vm: Nullable = null; + const data = reactive({ + tip: '', + loading: true, + ...props, + }); + + const LoadingWrap = defineComponent({ + render() { + return h(Loading, { ...data }); + }, + }); + + vm = createVNode(LoadingWrap); + + if (wait) { + // TODO fix https://github.com/anncwb/vue-vben-admin/issues/438 + setTimeout(() => { + render(vm, document.createElement('div')); + }, 0); + } else { + render(vm, document.createElement('div')); + } + + function close() { + if (vm?.el && vm.el.parentNode) { + vm.el.parentNode.removeChild(vm.el); + } + } + + function open(target: HTMLElement = document.body) { + if (!vm || !vm.el) { + return; + } + target.appendChild(vm.el as HTMLElement); + } + + if (target) { + open(target); + } + return { + vm, + close, + open, + setTip: (tip: string) => { + data.tip = tip; + }, + setLoading: (loading: boolean) => { + data.loading = loading; + }, + get loading() { + return data.loading; + }, + get $el() { + return vm?.el as HTMLElement; + }, + }; +} diff --git a/monolithic/frontend/src/components/Loading/src/typing.ts b/monolithic/frontend/src/components/Loading/src/typing.ts new file mode 100644 index 0000000..9af60e6 --- /dev/null +++ b/monolithic/frontend/src/components/Loading/src/typing.ts @@ -0,0 +1,10 @@ +import { SizeEnum } from '/@/enums/sizeEnum'; + +export interface LoadingProps { + tip: string; + size: SizeEnum; + absolute: boolean; + loading: boolean; + background: string; + theme: 'dark' | 'light'; +} diff --git a/monolithic/frontend/src/components/Loading/src/useLoading.ts b/monolithic/frontend/src/components/Loading/src/useLoading.ts new file mode 100644 index 0000000..356df7d --- /dev/null +++ b/monolithic/frontend/src/components/Loading/src/useLoading.ts @@ -0,0 +1,49 @@ +import { unref } from 'vue'; +import { createLoading } from './createLoading'; +import type { LoadingProps } from './typing'; +import type { Ref } from 'vue'; + +export interface UseLoadingOptions { + target?: any; + props?: Partial; +} + +interface Fn { + (): void; +} + +export function useLoading(props: Partial): [Fn, Fn, (string) => void]; +export function useLoading(opt: Partial): [Fn, Fn, (string) => void]; + +export function useLoading( + opt: Partial | Partial, +): [Fn, Fn, (string) => void] { + let props: Partial; + let target: HTMLElement | Ref = document.body; + + if (Reflect.has(opt, 'target') || Reflect.has(opt, 'props')) { + const options = opt as Partial; + props = options.props || {}; + target = options.target || document.body; + } else { + props = opt as Partial; + } + + const instance = createLoading(props, undefined, true); + + const open = (): void => { + const t = unref(target as Ref); + if (!t) return; + instance.open(t); + }; + + const close = (): void => { + instance.close(); + }; + + const setTip = (tip: string) => { + instance.setTip(tip); + }; + + return [open, close, setTip]; +} diff --git a/monolithic/frontend/src/components/Markdown/index.ts b/monolithic/frontend/src/components/Markdown/index.ts new file mode 100644 index 0000000..d337681 --- /dev/null +++ b/monolithic/frontend/src/components/Markdown/index.ts @@ -0,0 +1,7 @@ +import { withInstall } from '/@/utils'; +import markDown from './src/Markdown.vue'; +import markDownViewer from './src/MarkdownViewer.vue'; + +export const MarkDown = withInstall(markDown); +export const MarkdownViewer = withInstall(markDownViewer); +export * from './src/typing'; diff --git a/monolithic/frontend/src/components/Markdown/src/Markdown.vue b/monolithic/frontend/src/components/Markdown/src/Markdown.vue new file mode 100644 index 0000000..c80c779 --- /dev/null +++ b/monolithic/frontend/src/components/Markdown/src/Markdown.vue @@ -0,0 +1,158 @@ + + diff --git a/monolithic/frontend/src/components/Markdown/src/MarkdownViewer.vue b/monolithic/frontend/src/components/Markdown/src/MarkdownViewer.vue new file mode 100644 index 0000000..538ceda --- /dev/null +++ b/monolithic/frontend/src/components/Markdown/src/MarkdownViewer.vue @@ -0,0 +1,62 @@ + + + diff --git a/monolithic/frontend/src/components/Markdown/src/getTheme.ts b/monolithic/frontend/src/components/Markdown/src/getTheme.ts new file mode 100644 index 0000000..fcfe9d3 --- /dev/null +++ b/monolithic/frontend/src/components/Markdown/src/getTheme.ts @@ -0,0 +1,19 @@ +/** + * 获取主题类型 深色浅色模式 对应的值 + * @param darkModeVal 深色模式值 + * @param themeMode 主题类型——外观(默认), 内容, 代码块 + */ +export const getTheme = ( + darkModeVal: 'light' | 'dark' | string, + themeMode: 'default' | 'content' | 'code' = 'default', +) => { + const isDark = darkModeVal === 'dark'; + switch (themeMode) { + case 'default': + return isDark ? 'dark' : 'classic'; + case 'content': + return isDark ? 'dark' : 'light'; + case 'code': + return isDark ? 'dracula' : 'github'; + } +}; diff --git a/monolithic/frontend/src/components/Markdown/src/typing.ts b/monolithic/frontend/src/components/Markdown/src/typing.ts new file mode 100644 index 0000000..b4bb465 --- /dev/null +++ b/monolithic/frontend/src/components/Markdown/src/typing.ts @@ -0,0 +1,4 @@ +import Vditor from 'vditor'; +export interface MarkDownActionType { + getVditor: () => Vditor; +} diff --git a/monolithic/frontend/src/components/Menu/index.ts b/monolithic/frontend/src/components/Menu/index.ts new file mode 100644 index 0000000..4a59225 --- /dev/null +++ b/monolithic/frontend/src/components/Menu/index.ts @@ -0,0 +1,3 @@ +import BasicMenu from './src/BasicMenu.vue'; + +export { BasicMenu }; diff --git a/monolithic/frontend/src/components/Menu/src/BasicMenu.vue b/monolithic/frontend/src/components/Menu/src/BasicMenu.vue new file mode 100644 index 0000000..aa86bc9 --- /dev/null +++ b/monolithic/frontend/src/components/Menu/src/BasicMenu.vue @@ -0,0 +1,164 @@ + + + diff --git a/monolithic/frontend/src/components/Menu/src/components/BasicMenuItem.vue b/monolithic/frontend/src/components/Menu/src/components/BasicMenuItem.vue new file mode 100644 index 0000000..2a56562 --- /dev/null +++ b/monolithic/frontend/src/components/Menu/src/components/BasicMenuItem.vue @@ -0,0 +1,20 @@ + + diff --git a/monolithic/frontend/src/components/Menu/src/components/BasicSubMenuItem.vue b/monolithic/frontend/src/components/Menu/src/components/BasicSubMenuItem.vue new file mode 100644 index 0000000..d5139fc --- /dev/null +++ b/monolithic/frontend/src/components/Menu/src/components/BasicSubMenuItem.vue @@ -0,0 +1,55 @@ + + diff --git a/monolithic/frontend/src/components/Menu/src/components/MenuItemContent.vue b/monolithic/frontend/src/components/Menu/src/components/MenuItemContent.vue new file mode 100644 index 0000000..3044fbc --- /dev/null +++ b/monolithic/frontend/src/components/Menu/src/components/MenuItemContent.vue @@ -0,0 +1,34 @@ + + diff --git a/monolithic/frontend/src/components/Menu/src/index.less b/monolithic/frontend/src/components/Menu/src/index.less new file mode 100644 index 0000000..8bfbb0d --- /dev/null +++ b/monolithic/frontend/src/components/Menu/src/index.less @@ -0,0 +1,74 @@ +@basic-menu-prefix-cls: ~'@{namespace}-basic-menu'; + +.app-top-menu-popup { + min-width: 150px; +} + +.@{basic-menu-prefix-cls} { + width: 100%; + + .ant-menu-item { + transition: unset; + } + + &__sidebar-hor { + &.ant-menu-horizontal { + display: flex; + align-items: center; + + &.ant-menu-dark { + background-color: transparent; + + .ant-menu-submenu:hover, + .ant-menu-item-open, + .ant-menu-submenu-open, + .ant-menu-item-selected, + .ant-menu-submenu-selected, + .ant-menu-item:hover, + .ant-menu-item-active, + .ant-menu:not(.ant-menu-inline) .ant-menu-submenu-open, + .ant-menu-submenu-active, + .ant-menu-submenu-title:hover { + color: #fff; + background-color: @top-menu-active-bg-color !important; + } + + .ant-menu-item:hover, + .ant-menu-item-active, + .ant-menu:not(.ant-menu-inline) .ant-menu-submenu-open, + .ant-menu-submenu-active, + .ant-menu-submenu-title:hover { + background-color: @top-menu-active-bg-color; + } + + .@{basic-menu-prefix-cls}-item__level1 { + background-color: transparent; + + &.ant-menu-item-selected, + &.ant-menu-submenu-selected { + background-color: @top-menu-active-bg-color !important; + } + } + + .ant-menu-item, + .ant-menu-submenu { + &.@{basic-menu-prefix-cls}-item__level1, + .ant-menu-submenu-title { + height: @header-height; + line-height: @header-height; + } + } + } + } + } + + .ant-menu-submenu, + .ant-menu-submenu-inline { + transition: unset; + } + + .ant-menu-inline.ant-menu-sub { + box-shadow: unset !important; + transition: unset; + } +} diff --git a/monolithic/frontend/src/components/Menu/src/props.ts b/monolithic/frontend/src/components/Menu/src/props.ts new file mode 100644 index 0000000..ed3f010 --- /dev/null +++ b/monolithic/frontend/src/components/Menu/src/props.ts @@ -0,0 +1,60 @@ +import type { Menu } from '/@/router/types'; +import type { PropType } from 'vue'; + +import { MenuModeEnum, MenuTypeEnum } from '/@/enums/menuEnum'; +import { ThemeEnum } from '/@/enums/appEnum'; +import { propTypes } from '/@/utils/propTypes'; +import type { MenuTheme } from 'ant-design-vue'; +import type { MenuMode } from 'ant-design-vue/lib/menu/src/interface'; +export const basicProps = { + items: { + type: Array as PropType, + default: () => [], + }, + collapsedShowTitle: propTypes.bool, + // 最好是4 倍数 + inlineIndent: propTypes.number.def(20), + // 菜单组件的mode属性 + mode: { + type: String as PropType, + default: MenuModeEnum.INLINE, + }, + + type: { + type: String as PropType, + default: MenuTypeEnum.MIX, + }, + theme: { + type: String as PropType, + default: ThemeEnum.DARK, + }, + inlineCollapsed: propTypes.bool, + mixSider: propTypes.bool, + + isHorizontal: propTypes.bool, + accordion: propTypes.bool.def(true), + beforeClickFn: { + type: Function as PropType<(key: string) => Promise>, + }, +}; + +export const itemProps = { + item: { + type: Object as PropType, + default: {}, + }, + level: propTypes.number, + theme: propTypes.oneOf(['dark', 'light']), + showTitle: propTypes.bool, + isHorizontal: propTypes.bool, +}; + +export const contentProps = { + item: { + type: Object as PropType, + default: null, + }, + showTitle: propTypes.bool.def(true), + level: propTypes.number.def(0), + isHorizontal: propTypes.bool.def(true), +}; diff --git a/monolithic/frontend/src/components/Menu/src/types.ts b/monolithic/frontend/src/components/Menu/src/types.ts new file mode 100644 index 0000000..ad711c2 --- /dev/null +++ b/monolithic/frontend/src/components/Menu/src/types.ts @@ -0,0 +1,25 @@ +// import { ComputedRef } from 'vue'; +// import { ThemeEnum } from '/@/enums/appEnum'; +// import { MenuModeEnum } from '/@/enums/menuEnum'; +export interface MenuState { + // 默认选中的列表 + defaultSelectedKeys: string[]; + + // 模式 + // mode: MenuModeEnum; + + // // 主题 + // theme: ComputedRef | ThemeEnum; + + // 缩进 + inlineIndent?: number; + + // 展开数组 + openKeys: string[]; + + // 当前选中的菜单项 key 数组 + selectedKeys: string[]; + + // 收缩状态下展开的数组 + collapsedOpenKeys: string[]; +} diff --git a/monolithic/frontend/src/components/Menu/src/useOpenKeys.ts b/monolithic/frontend/src/components/Menu/src/useOpenKeys.ts new file mode 100644 index 0000000..841dab5 --- /dev/null +++ b/monolithic/frontend/src/components/Menu/src/useOpenKeys.ts @@ -0,0 +1,83 @@ +import { MenuModeEnum } from '/@/enums/menuEnum'; +import type { Menu as MenuType } from '/@/router/types'; +import type { MenuState } from './types'; + +import { computed, Ref, toRaw } from 'vue'; + +import { unref } from 'vue'; +import { uniq } from 'lodash-es'; +import { useMenuSetting } from '/@/hooks/setting/useMenuSetting'; +import { getAllParentPath } from '/@/router/helper/menuHelper'; +import { useTimeoutFn } from '/@/hooks/core/useTimeout'; + +export function useOpenKeys( + menuState: MenuState, + menus: Ref, + mode: Ref, + accordion: Ref, +) { + const { getCollapsed, getIsMixSidebar } = useMenuSetting(); + + async function setOpenKeys(path: string) { + if (mode.value === MenuModeEnum.HORIZONTAL) { + return; + } + const native = unref(getIsMixSidebar); + useTimeoutFn( + () => { + const menuList = toRaw(menus.value); + if (menuList?.length === 0) { + menuState.openKeys = []; + return; + } + if (!unref(accordion)) { + menuState.openKeys = uniq([...menuState.openKeys, ...getAllParentPath(menuList, path)]); + } else { + menuState.openKeys = getAllParentPath(menuList, path); + } + }, + 16, + !native, + ); + } + + const getOpenKeys = computed(() => { + const collapse = unref(getIsMixSidebar) ? false : unref(getCollapsed); + + return collapse ? menuState.collapsedOpenKeys : menuState.openKeys; + }); + + /** + * @description: 重置值 + */ + function resetKeys() { + menuState.selectedKeys = []; + menuState.openKeys = []; + } + + function handleOpenChange(openKeys: string[]) { + if (unref(mode) === MenuModeEnum.HORIZONTAL || !unref(accordion) || unref(getIsMixSidebar)) { + menuState.openKeys = openKeys; + } else { + // const menuList = toRaw(menus.value); + // getAllParentPath(menuList, path); + const rootSubMenuKeys: string[] = []; + for (const { children, path } of unref(menus)) { + if (children && children.length > 0) { + rootSubMenuKeys.push(path); + } + } + if (!unref(getCollapsed)) { + const latestOpenKey = openKeys.find((key) => menuState.openKeys.indexOf(key) === -1); + if (rootSubMenuKeys.indexOf(latestOpenKey as string) === -1) { + menuState.openKeys = openKeys; + } else { + menuState.openKeys = latestOpenKey ? [latestOpenKey] : []; + } + } else { + menuState.collapsedOpenKeys = openKeys; + } + } + } + return { setOpenKeys, resetKeys, getOpenKeys, handleOpenChange }; +} diff --git a/monolithic/frontend/src/components/Modal/index.ts b/monolithic/frontend/src/components/Modal/index.ts new file mode 100644 index 0000000..6188c5c --- /dev/null +++ b/monolithic/frontend/src/components/Modal/index.ts @@ -0,0 +1,8 @@ +import { withInstall } from '/@/utils'; +import './src/index.less'; +import basicModal from './src/BasicModal.vue'; + +export const BasicModal = withInstall(basicModal); +export { useModalContext } from './src/hooks/useModalContext'; +export { useModal, useModalInner } from './src/hooks/useModal'; +export * from './src/typing'; diff --git a/monolithic/frontend/src/components/Modal/src/BasicModal.vue b/monolithic/frontend/src/components/Modal/src/BasicModal.vue new file mode 100644 index 0000000..89bc879 --- /dev/null +++ b/monolithic/frontend/src/components/Modal/src/BasicModal.vue @@ -0,0 +1,242 @@ + + diff --git a/monolithic/frontend/src/components/Modal/src/components/Modal.tsx b/monolithic/frontend/src/components/Modal/src/components/Modal.tsx new file mode 100644 index 0000000..8600d61 --- /dev/null +++ b/monolithic/frontend/src/components/Modal/src/components/Modal.tsx @@ -0,0 +1,31 @@ +import { Modal } from 'ant-design-vue'; +import { defineComponent, toRefs, unref } from 'vue'; +import { basicProps } from '../props'; +import { useModalDragMove } from '../hooks/useModalDrag'; +import { useAttrs } from '/@/hooks/core/useAttrs'; +import { extendSlots } from '/@/utils/helper/tsxHelper'; + +export default defineComponent({ + name: 'Modal', + inheritAttrs: false, + props: basicProps, + emits: ['cancel'], + setup(props, { slots, emit }) { + const { visible, draggable, destroyOnClose } = toRefs(props); + const attrs = useAttrs(); + useModalDragMove({ + visible, + destroyOnClose, + draggable, + }); + + const onCancel = (e: Event) => { + emit('cancel', e); + }; + + return () => { + const propsData = { ...unref(attrs), ...props, onCancel } as Recordable; + return {extendSlots(slots)}; + }; + }, +}); diff --git a/monolithic/frontend/src/components/Modal/src/components/ModalClose.vue b/monolithic/frontend/src/components/Modal/src/components/ModalClose.vue new file mode 100644 index 0000000..a0d9612 --- /dev/null +++ b/monolithic/frontend/src/components/Modal/src/components/ModalClose.vue @@ -0,0 +1,106 @@ + + + diff --git a/monolithic/frontend/src/components/Modal/src/components/ModalFooter.vue b/monolithic/frontend/src/components/Modal/src/components/ModalFooter.vue new file mode 100644 index 0000000..d8cefdb --- /dev/null +++ b/monolithic/frontend/src/components/Modal/src/components/ModalFooter.vue @@ -0,0 +1,40 @@ + + diff --git a/monolithic/frontend/src/components/Modal/src/components/ModalHeader.vue b/monolithic/frontend/src/components/Modal/src/components/ModalHeader.vue new file mode 100644 index 0000000..2f45778 --- /dev/null +++ b/monolithic/frontend/src/components/Modal/src/components/ModalHeader.vue @@ -0,0 +1,22 @@ + + diff --git a/monolithic/frontend/src/components/Modal/src/components/ModalWrapper.vue b/monolithic/frontend/src/components/Modal/src/components/ModalWrapper.vue new file mode 100644 index 0000000..699bf9c --- /dev/null +++ b/monolithic/frontend/src/components/Modal/src/components/ModalWrapper.vue @@ -0,0 +1,169 @@ + + diff --git a/monolithic/frontend/src/components/Modal/src/hooks/useModal.ts b/monolithic/frontend/src/components/Modal/src/hooks/useModal.ts new file mode 100644 index 0000000..fac82b7 --- /dev/null +++ b/monolithic/frontend/src/components/Modal/src/hooks/useModal.ts @@ -0,0 +1,163 @@ +import type { + UseModalReturnType, + ModalMethods, + ModalProps, + ReturnMethods, + UseModalInnerReturnType, +} from '../typing'; +import { + ref, + onUnmounted, + unref, + getCurrentInstance, + reactive, + watchEffect, + nextTick, + toRaw, +} from 'vue'; +import { isProdMode } from '/@/utils/env'; +import { isFunction } from '/@/utils/is'; +import { isEqual } from 'lodash-es'; +import { tryOnUnmounted } from '@vueuse/core'; +import { error } from '/@/utils/log'; +import { computed } from 'vue'; + +const dataTransfer = reactive({}); + +const visibleData = reactive<{ [key: number]: boolean }>({}); + +/** + * @description: Applicable to independent modal and call outside + */ +export function useModal(): UseModalReturnType { + const modal = ref>(null); + const loaded = ref>(false); + const uid = ref(''); + + function register(modalMethod: ModalMethods, uuid: string) { + if (!getCurrentInstance()) { + throw new Error('useModal() can only be used inside setup() or functional components!'); + } + uid.value = uuid; + isProdMode() && + onUnmounted(() => { + modal.value = null; + loaded.value = false; + dataTransfer[unref(uid)] = null; + }); + if (unref(loaded) && isProdMode() && modalMethod === unref(modal)) return; + + modal.value = modalMethod; + loaded.value = true; + modalMethod.emitVisible = (visible: boolean, uid: number) => { + visibleData[uid] = visible; + }; + } + + const getInstance = () => { + const instance = unref(modal); + if (!instance) { + error('useModal instance is undefined!'); + } + return instance; + }; + + const methods: ReturnMethods = { + setModalProps: (props: Partial): void => { + getInstance()?.setModalProps(props); + }, + + getVisible: computed((): boolean => { + return visibleData[~~unref(uid)]; + }), + + redoModalHeight: () => { + getInstance()?.redoModalHeight?.(); + }, + + openModal: (visible = true, data?: T, openOnSet = true): void => { + getInstance()?.setModalProps({ + visible: visible, + }); + + if (!data) return; + const id = unref(uid); + if (openOnSet) { + dataTransfer[id] = null; + dataTransfer[id] = toRaw(data); + return; + } + const equal = isEqual(toRaw(dataTransfer[id]), toRaw(data)); + if (!equal) { + dataTransfer[id] = toRaw(data); + } + }, + + closeModal: () => { + getInstance()?.setModalProps({ visible: false }); + }, + }; + return [register, methods]; +} + +export const useModalInner = (callbackFn?: Fn): UseModalInnerReturnType => { + const modalInstanceRef = ref>(null); + const currentInstance = getCurrentInstance(); + const uidRef = ref(''); + + const getInstance = () => { + const instance = unref(modalInstanceRef); + if (!instance) { + error('useModalInner instance is undefined!'); + } + return instance; + }; + + const register = (modalInstance: ModalMethods, uuid: string) => { + isProdMode() && + tryOnUnmounted(() => { + modalInstanceRef.value = null; + }); + uidRef.value = uuid; + modalInstanceRef.value = modalInstance; + currentInstance?.emit('register', modalInstance, uuid); + }; + + watchEffect(() => { + const data = dataTransfer[unref(uidRef)]; + if (!data) return; + if (!callbackFn || !isFunction(callbackFn)) return; + nextTick(() => { + callbackFn(data); + }); + }); + + return [ + register, + { + changeLoading: (loading = true) => { + getInstance()?.setModalProps({ loading }); + }, + getVisible: computed((): boolean => { + return visibleData[~~unref(uidRef)]; + }), + + changeOkLoading: (loading = true) => { + getInstance()?.setModalProps({ confirmLoading: loading }); + }, + + closeModal: () => { + getInstance()?.setModalProps({ visible: false }); + }, + + setModalProps: (props: Partial) => { + getInstance()?.setModalProps(props); + }, + + redoModalHeight: () => { + const callRedo = getInstance()?.redoModalHeight; + callRedo && callRedo(); + }, + }, + ]; +}; diff --git a/monolithic/frontend/src/components/Modal/src/hooks/useModalContext.ts b/monolithic/frontend/src/components/Modal/src/hooks/useModalContext.ts new file mode 100644 index 0000000..94d4c4e --- /dev/null +++ b/monolithic/frontend/src/components/Modal/src/hooks/useModalContext.ts @@ -0,0 +1,16 @@ +import { InjectionKey } from 'vue'; +import { createContext, useContext } from '/@/hooks/core/useContext'; + +export interface ModalContextProps { + redoModalHeight: () => void; +} + +const key: InjectionKey = Symbol(); + +export function createModalContext(context: ModalContextProps) { + return createContext(context, key); +} + +export function useModalContext() { + return useContext(key); +} diff --git a/monolithic/frontend/src/components/Modal/src/hooks/useModalDrag.ts b/monolithic/frontend/src/components/Modal/src/hooks/useModalDrag.ts new file mode 100644 index 0000000..ff05b7b --- /dev/null +++ b/monolithic/frontend/src/components/Modal/src/hooks/useModalDrag.ts @@ -0,0 +1,107 @@ +import { Ref, unref, watchEffect } from 'vue'; +import { useTimeoutFn } from '/@/hooks/core/useTimeout'; + +export interface UseModalDragMoveContext { + draggable: Ref; + destroyOnClose: Ref | undefined; + visible: Ref; +} + +export function useModalDragMove(context: UseModalDragMoveContext) { + const getStyle = (dom: any, attr: any) => { + return getComputedStyle(dom)[attr]; + }; + const drag = (wrap: any) => { + if (!wrap) return; + wrap.setAttribute('data-drag', unref(context.draggable)); + const dialogHeaderEl = wrap.querySelector('.ant-modal-header'); + const dragDom = wrap.querySelector('.ant-modal'); + + if (!dialogHeaderEl || !dragDom || !unref(context.draggable)) return; + + dialogHeaderEl.style.cursor = 'move'; + + dialogHeaderEl.onmousedown = (e: any) => { + if (!e) return; + // 鼠标按下,计算当前元素距离可视区的距离 + const disX = e.clientX; + const disY = e.clientY; + const screenWidth = document.body.clientWidth; // body当前宽度 + const screenHeight = document.documentElement.clientHeight; // 可见区域高度(应为body高度,可某些环境下无法获取) + + const dragDomWidth = dragDom.offsetWidth; // 对话框宽度 + const dragDomheight = dragDom.offsetHeight; // 对话框高度 + + const minDragDomLeft = dragDom.offsetLeft; + + const maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth; + const minDragDomTop = dragDom.offsetTop; + const maxDragDomTop = screenHeight - dragDom.offsetTop - dragDomheight; + // 获取到的值带px 正则匹配替换 + const domLeft = getStyle(dragDom, 'left'); + const domTop = getStyle(dragDom, 'top'); + let styL = +domLeft; + let styT = +domTop; + + // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px + if (domLeft.includes('%')) { + styL = +document.body.clientWidth * (+domLeft.replace(/%/g, '') / 100); + styT = +document.body.clientHeight * (+domTop.replace(/%/g, '') / 100); + } else { + styL = +domLeft.replace(/px/g, ''); + styT = +domTop.replace(/px/g, ''); + } + + document.onmousemove = function (e) { + // 通过事件委托,计算移动的距离 + let left = e.clientX - disX; + let top = e.clientY - disY; + + // 边界处理 + if (-left > minDragDomLeft) { + left = -minDragDomLeft; + } else if (left > maxDragDomLeft) { + left = maxDragDomLeft; + } + + if (-top > minDragDomTop) { + top = -minDragDomTop; + } else if (top > maxDragDomTop) { + top = maxDragDomTop; + } + + // 移动当前元素 + dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;`; + }; + + document.onmouseup = () => { + document.onmousemove = null; + document.onmouseup = null; + }; + }; + }; + + const handleDrag = () => { + const dragWraps = document.querySelectorAll('.ant-modal-wrap'); + for (const wrap of Array.from(dragWraps)) { + if (!wrap) continue; + const display = getStyle(wrap, 'display'); + const draggable = wrap.getAttribute('data-drag'); + if (display !== 'none') { + // 拖拽位置 + if (draggable === null || unref(context.destroyOnClose)) { + drag(wrap); + } + } + } + }; + + watchEffect(() => { + if (!unref(context.visible) || !unref(context.draggable)) { + return; + } + useTimeoutFn(() => { + handleDrag(); + }, 30); + }); +} diff --git a/monolithic/frontend/src/components/Modal/src/hooks/useModalFullScreen.ts b/monolithic/frontend/src/components/Modal/src/hooks/useModalFullScreen.ts new file mode 100644 index 0000000..b53563a --- /dev/null +++ b/monolithic/frontend/src/components/Modal/src/hooks/useModalFullScreen.ts @@ -0,0 +1,43 @@ +import { computed, Ref, ref, unref } from 'vue'; + +export interface UseFullScreenContext { + wrapClassName: Ref; + modalWrapperRef: Ref; + extHeightRef: Ref; +} + +export function useFullScreen(context: UseFullScreenContext) { + // const formerHeightRef = ref(0); + const fullScreenRef = ref(false); + + const getWrapClassName = computed(() => { + const clsName = unref(context.wrapClassName) || ''; + return unref(fullScreenRef) ? `fullscreen-modal ${clsName} ` : unref(clsName); + }); + + function handleFullScreen(e: Event) { + e && e.stopPropagation(); + fullScreenRef.value = !unref(fullScreenRef); + + // const modalWrapper = unref(context.modalWrapperRef); + + // if (!modalWrapper) return; + + // const wrapperEl = modalWrapper.$el as HTMLElement; + // if (!wrapperEl) return; + // const modalWrapSpinEl = wrapperEl.querySelector('.ant-spin-nested-loading') as HTMLElement; + + // if (!modalWrapSpinEl) return; + + // if (!unref(formerHeightRef) && unref(fullScreenRef)) { + // formerHeightRef.value = modalWrapSpinEl.offsetHeight; + // } + + // if (unref(fullScreenRef)) { + // modalWrapSpinEl.style.height = `${window.innerHeight - unref(context.extHeightRef)}px`; + // } else { + // modalWrapSpinEl.style.height = `${unref(formerHeightRef)}px`; + // } + } + return { getWrapClassName, handleFullScreen, fullScreenRef }; +} diff --git a/monolithic/frontend/src/components/Modal/src/index.less b/monolithic/frontend/src/components/Modal/src/index.less new file mode 100644 index 0000000..a23be29 --- /dev/null +++ b/monolithic/frontend/src/components/Modal/src/index.less @@ -0,0 +1,127 @@ +.fullscreen-modal { + overflow: hidden; + + .ant-modal { + top: 0 !important; + right: 0 !important; + bottom: 0 !important; + left: 0 !important; + width: 100% !important; + height: 100%; + + &-content { + height: 100%; + } + } +} + +.ant-modal { + width: 520px; + padding-bottom: 0; + + .ant-modal-body > .scrollbar { + padding: 14px; + } + + &-title { + font-size: 16px; + font-weight: bold; + + .base-title { + cursor: move !important; + } + } + + .ant-modal-body { + padding: 0; + + > .scrollbar > .scrollbar__bar.is-horizontal { + display: none; + } + } + + &-large { + top: 60px; + + &--mini { + top: 16px; + } + } + + &-header { + padding: 16px; + } + + &-content { + box-shadow: 0 4px 8px 0 rgb(0 0 0 / 20%), 0 6px 20px 0 rgb(0 0 0 / 19%); + } + + &-footer { + button + button { + margin-left: 10px; + } + } + + &-close { + font-weight: normal; + outline: none; + } + + &-close-x { + display: inline-block; + width: 96px; + height: 56px; + line-height: 56px; + } + + &-confirm-body { + .ant-modal-confirm-content { + // color: #fff; + + > * { + color: @text-color-help-dark; + } + } + } + + &-confirm-confirm.error .ant-modal-confirm-body > .anticon { + color: @error-color; + } + + &-confirm-btns { + .ant-btn:last-child { + margin-right: 0; + } + } + + &-confirm-info { + .ant-modal-confirm-body > .anticon { + color: @warning-color; + } + } + + &-confirm-confirm.success { + .ant-modal-confirm-body > .anticon { + color: @success-color; + } + } +} + +.ant-modal-confirm .ant-modal-body { + padding: 24px !important; +} +@media screen and (max-height: 600px) { + .ant-modal { + top: 60px; + } +} +@media screen and (max-height: 540px) { + .ant-modal { + top: 30px; + } +} +@media screen and (max-height: 480px) { + .ant-modal { + top: 10px; + } +} diff --git a/monolithic/frontend/src/components/Modal/src/props.ts b/monolithic/frontend/src/components/Modal/src/props.ts new file mode 100644 index 0000000..c3c70c6 --- /dev/null +++ b/monolithic/frontend/src/components/Modal/src/props.ts @@ -0,0 +1,83 @@ +import type { PropType, CSSProperties } from 'vue'; +import type { ModalWrapperProps } from './typing'; +import { ButtonProps } from 'ant-design-vue/es/button/buttonTypes'; +import { useI18n } from '/@/hooks/web/useI18n'; + +const { t } = useI18n(); + +export const modalProps = { + visible: { type: Boolean }, + scrollTop: { type: Boolean, default: true }, + height: { type: Number }, + minHeight: { type: Number }, + // open drag + draggable: { type: Boolean, default: true }, + centered: { type: Boolean }, + cancelText: { type: String, default: t('common.cancelText') }, + okText: { type: String, default: t('common.okText') }, + + closeFunc: Function as PropType<() => Promise>, +}; + +export const basicProps = Object.assign({}, modalProps, { + defaultFullscreen: { type: Boolean }, + // Can it be full screen + canFullscreen: { type: Boolean, default: true }, + // After enabling the wrapper, the bottom can be increased in height + wrapperFooterOffset: { type: Number, default: 0 }, + // Warm reminder message + helpMessage: [String, Array] as PropType, + // Whether to setting wrapper + useWrapper: { type: Boolean, default: true }, + loading: { type: Boolean }, + loadingTip: { type: String }, + /** + * @description: Show close button + */ + showCancelBtn: { type: Boolean, default: true }, + /** + * @description: Show confirmation button + */ + showOkBtn: { type: Boolean, default: true }, + + wrapperProps: Object as PropType>, + + afterClose: Function as PropType<() => Promise>, + + bodyStyle: Object as PropType, + + closable: { type: Boolean, default: true }, + + closeIcon: Object as PropType, + + confirmLoading: { type: Boolean }, + + destroyOnClose: { type: Boolean }, + + footer: Object as PropType, + + getContainer: Function as PropType<() => any>, + + mask: { type: Boolean, default: true }, + + maskClosable: { type: Boolean, default: true }, + keyboard: { type: Boolean, default: true }, + + maskStyle: Object as PropType, + + okType: { type: String, default: 'primary' }, + + okButtonProps: Object as PropType, + + cancelButtonProps: Object as PropType, + + title: { type: String }, + + visible: { type: Boolean }, + + width: [String, Number] as PropType, + + wrapClassName: { type: String }, + + zIndex: { type: Number }, +}); diff --git a/monolithic/frontend/src/components/Modal/src/typing.ts b/monolithic/frontend/src/components/Modal/src/typing.ts new file mode 100644 index 0000000..36a7e7c --- /dev/null +++ b/monolithic/frontend/src/components/Modal/src/typing.ts @@ -0,0 +1,209 @@ +import type { ButtonProps } from 'ant-design-vue/lib/button/buttonTypes'; +import type { CSSProperties, VNodeChild, ComputedRef } from 'vue'; +/** + * @description: 弹窗对外暴露的方法 + */ +export interface ModalMethods { + setModalProps: (props: Partial) => void; + emitVisible?: (visible: boolean, uid: number) => void; + redoModalHeight?: () => void; +} + +export type RegisterFn = (modalMethods: ModalMethods, uuid?: string) => void; + +export interface ReturnMethods extends ModalMethods { + openModal: (props?: boolean, data?: T, openOnSet?: boolean) => void; + closeModal: () => void; + getVisible?: ComputedRef; +} + +export type UseModalReturnType = [RegisterFn, ReturnMethods]; + +export interface ReturnInnerMethods extends ModalMethods { + closeModal: () => void; + changeLoading: (loading: boolean) => void; + changeOkLoading: (loading: boolean) => void; + getVisible?: ComputedRef; + redoModalHeight: () => void; +} + +export type UseModalInnerReturnType = [RegisterFn, ReturnInnerMethods]; + +export interface ModalProps { + minHeight?: number; + height?: number; + // 启用wrapper后 底部可以适当增加高度 + wrapperFooterOffset?: number; + draggable?: boolean; + scrollTop?: boolean; + + // 是否可以进行全屏 + canFullscreen?: boolean; + defaultFullscreen?: boolean; + visible?: boolean; + // 温馨提醒信息 + helpMessage: string | string[]; + + // 是否使用modalWrapper + useWrapper: boolean; + + loading: boolean; + loadingTip?: string; + + wrapperProps: Omit; + + showOkBtn: boolean; + showCancelBtn: boolean; + closeFunc: () => Promise; + + /** + * Specify a function that will be called when modal is closed completely. + * @type Function + */ + afterClose?: () => any; + + /** + * Body style for modal body element. Such as height, padding etc. + * @default {} + * @type object + */ + bodyStyle?: CSSProperties; + + /** + * Text of the Cancel button + * @default 'cancel' + * @type string + */ + cancelText?: string; + + /** + * Centered Modal + * @default false + * @type boolean + */ + centered?: boolean; + + /** + * Whether a close (x) button is visible on top right of the modal dialog or not + * @default true + * @type boolean + */ + closable?: boolean; + /** + * Whether a close (x) button is visible on top right of the modal dialog or not + */ + closeIcon?: VNodeChild | JSX.Element; + + /** + * Whether to apply loading visual effect for OK button or not + * @default false + * @type boolean + */ + confirmLoading?: boolean; + + /** + * Whether to unmount child components on onClose + * @default false + * @type boolean + */ + destroyOnClose?: boolean; + + /** + * Footer content, set as :footer="null" when you don't need default buttons + * @default OK and Cancel buttons + * @type any (string | slot) + */ + footer?: VNodeChild | JSX.Element; + + /** + * Return the mount node for Modal + * @default () => document.body + * @type Function + */ + getContainer?: (instance: any) => HTMLElement; + + /** + * Whether show mask or not. + * @default true + * @type boolean + */ + mask?: boolean; + + /** + * Whether to close the modal dialog when the mask (area outside the modal) is clicked + * @default true + * @type boolean + */ + maskClosable?: boolean; + + /** + * Style for modal's mask element. + * @default {} + * @type object + */ + maskStyle?: CSSProperties; + + /** + * Text of the OK button + * @default 'OK' + * @type string + */ + okText?: string; + + /** + * Button type of the OK button + * @default 'primary' + * @type string + */ + okType?: 'primary' | 'danger' | 'dashed' | 'ghost' | 'default'; + + /** + * The ok button props, follow jsx rules + * @type object + */ + okButtonProps?: ButtonProps; + + /** + * The cancel button props, follow jsx rules + * @type object + */ + cancelButtonProps?: ButtonProps; + + /** + * The modal dialog's title + * @type any (string | slot) + */ + title?: VNodeChild | JSX.Element; + + /** + * Width of the modal dialog + * @default 520 + * @type string | number + */ + width?: string | number; + + /** + * The class name of the container of the modal dialog + * @type string + */ + wrapClassName?: string; + + /** + * The z-index of the Modal + * @default 1000 + * @type number + */ + zIndex?: number; +} + +export interface ModalWrapperProps { + footerOffset?: number; + loading: boolean; + modalHeaderHeight: number; + modalFooterHeight: number; + minHeight: number; + height: number; + visible: boolean; + fullScreen: boolean; + useWrapper: boolean; +} diff --git a/monolithic/frontend/src/components/Page/index.ts b/monolithic/frontend/src/components/Page/index.ts new file mode 100644 index 0000000..2d3f6dd --- /dev/null +++ b/monolithic/frontend/src/components/Page/index.ts @@ -0,0 +1,9 @@ +import { withInstall } from '/@/utils'; + +import pageFooter from './src/PageFooter.vue'; +import pageWrapper from './src/PageWrapper.vue'; + +export const PageFooter = withInstall(pageFooter); +export const PageWrapper = withInstall(pageWrapper); + +export const PageWrapperFixedHeightKey = 'PageWrapperFixedHeight'; diff --git a/monolithic/frontend/src/components/Page/src/PageFooter.vue b/monolithic/frontend/src/components/Page/src/PageFooter.vue new file mode 100644 index 0000000..e89a6ce --- /dev/null +++ b/monolithic/frontend/src/components/Page/src/PageFooter.vue @@ -0,0 +1,50 @@ + + + diff --git a/monolithic/frontend/src/components/Page/src/PageWrapper.vue b/monolithic/frontend/src/components/Page/src/PageWrapper.vue new file mode 100644 index 0000000..baca629 --- /dev/null +++ b/monolithic/frontend/src/components/Page/src/PageWrapper.vue @@ -0,0 +1,191 @@ + + + diff --git a/monolithic/frontend/src/components/Preview/index.ts b/monolithic/frontend/src/components/Preview/index.ts new file mode 100644 index 0000000..c0b4685 --- /dev/null +++ b/monolithic/frontend/src/components/Preview/index.ts @@ -0,0 +1,2 @@ +export { default as ImagePreview } from './src/Preview.vue'; +export { createImgPreview } from './src/functional'; diff --git a/monolithic/frontend/src/components/Preview/src/Functional.vue b/monolithic/frontend/src/components/Preview/src/Functional.vue new file mode 100644 index 0000000..1c91929 --- /dev/null +++ b/monolithic/frontend/src/components/Preview/src/Functional.vue @@ -0,0 +1,546 @@ + + diff --git a/monolithic/frontend/src/components/Preview/src/Preview.vue b/monolithic/frontend/src/components/Preview/src/Preview.vue new file mode 100644 index 0000000..9996d0b --- /dev/null +++ b/monolithic/frontend/src/components/Preview/src/Preview.vue @@ -0,0 +1,94 @@ + + + diff --git a/monolithic/frontend/src/components/Preview/src/functional.ts b/monolithic/frontend/src/components/Preview/src/functional.ts new file mode 100644 index 0000000..74073a2 --- /dev/null +++ b/monolithic/frontend/src/components/Preview/src/functional.ts @@ -0,0 +1,17 @@ +import type { Options, Props } from './typing'; +import ImgPreview from './Functional.vue'; +import { isClient } from '/@/utils/is'; +import { createVNode, render } from 'vue'; + +let instance: ReturnType | null = null; +export function createImgPreview(options: Options) { + if (!isClient) return; + const propsData: Partial = {}; + const container = document.createElement('div'); + Object.assign(propsData, { show: true, index: 0, scaleStep: 100 }, options); + + instance = createVNode(ImgPreview, propsData); + render(instance, container); + document.body.appendChild(container); + return instance.component?.exposed; +} diff --git a/monolithic/frontend/src/components/Preview/src/typing.ts b/monolithic/frontend/src/components/Preview/src/typing.ts new file mode 100644 index 0000000..bbb8a83 --- /dev/null +++ b/monolithic/frontend/src/components/Preview/src/typing.ts @@ -0,0 +1,49 @@ +export interface Options { + show?: boolean; + imageList: string[]; + index?: number; + scaleStep?: number; + defaultWidth?: number; + maskClosable?: boolean; + rememberState?: boolean; + onImgLoad?: ({ index: number, url: string, dom: HTMLImageElement }) => void; + onImgError?: ({ index: number, url: string, dom: HTMLImageElement }) => void; +} + +export interface Props { + show: boolean; + instance: Props; + imageList: string[]; + index: number; + scaleStep: number; + defaultWidth: number; + maskClosable: boolean; + rememberState: boolean; +} + +export interface PreviewActions { + resume: () => void; + close: () => void; + prev: () => void; + next: () => void; + setScale: (scale: number) => void; + setRotate: (rotate: number) => void; +} + +export interface ImageProps { + alt?: string; + fallback?: string; + src: string; + width: string | number; + height?: string | number; + placeholder?: string | boolean; + preview?: + | boolean + | { + visible?: boolean; + onVisibleChange?: (visible: boolean, prevVisible: boolean) => void; + getContainer: string | HTMLElement | (() => HTMLElement); + }; +} + +export type ImageItem = string | ImageProps; diff --git a/monolithic/frontend/src/components/Qrcode/index.ts b/monolithic/frontend/src/components/Qrcode/index.ts new file mode 100644 index 0000000..16a2f40 --- /dev/null +++ b/monolithic/frontend/src/components/Qrcode/index.ts @@ -0,0 +1,5 @@ +import { withInstall } from '/@/utils'; +import qrCode from './src/Qrcode.vue'; + +export const QrCode = withInstall(qrCode); +export * from './src/typing'; diff --git a/monolithic/frontend/src/components/Qrcode/src/Qrcode.vue b/monolithic/frontend/src/components/Qrcode/src/Qrcode.vue new file mode 100644 index 0000000..81194e1 --- /dev/null +++ b/monolithic/frontend/src/components/Qrcode/src/Qrcode.vue @@ -0,0 +1,112 @@ + + diff --git a/monolithic/frontend/src/components/Qrcode/src/drawCanvas.ts b/monolithic/frontend/src/components/Qrcode/src/drawCanvas.ts new file mode 100644 index 0000000..53198e8 --- /dev/null +++ b/monolithic/frontend/src/components/Qrcode/src/drawCanvas.ts @@ -0,0 +1,37 @@ +import { toCanvas } from 'qrcode'; +import type { QRCodeRenderersOptions } from 'qrcode'; +import { RenderQrCodeParams, ContentType } from './typing'; +import { cloneDeep } from 'lodash-es'; + +export const renderQrCode = ({ + canvas, + content, + width = 0, + options: params = {}, +}: RenderQrCodeParams) => { + const options = cloneDeep(params); + // 容错率,默认对内容少的二维码采用高容错率,内容多的二维码采用低容错率 + options.errorCorrectionLevel = options.errorCorrectionLevel || getErrorCorrectionLevel(content); + + return getOriginWidth(content, options).then((_width: number) => { + options.scale = width === 0 ? undefined : (width / _width) * 4; + return toCanvas(canvas, content, options); + }); +}; + +// 得到原QrCode的大小,以便缩放得到正确的QrCode大小 +function getOriginWidth(content: ContentType, options: QRCodeRenderersOptions) { + const _canvas = document.createElement('canvas'); + return toCanvas(_canvas, content, options).then(() => _canvas.width); +} + +// 对于内容少的QrCode,增大容错率 +function getErrorCorrectionLevel(content: ContentType) { + if (content.length > 36) { + return 'M'; + } else if (content.length > 16) { + return 'Q'; + } else { + return 'H'; + } +} diff --git a/monolithic/frontend/src/components/Qrcode/src/drawLogo.ts b/monolithic/frontend/src/components/Qrcode/src/drawLogo.ts new file mode 100644 index 0000000..85a160f --- /dev/null +++ b/monolithic/frontend/src/components/Qrcode/src/drawLogo.ts @@ -0,0 +1,88 @@ +import { isString } from '/@/utils/is'; +import { RenderQrCodeParams, LogoType } from './typing'; +export const drawLogo = ({ canvas, logo }: RenderQrCodeParams) => { + if (!logo) { + return new Promise((resolve) => { + resolve((canvas as HTMLCanvasElement).toDataURL()); + }); + } + const canvasWidth = (canvas as HTMLCanvasElement).width; + const { + logoSize = 0.15, + bgColor = '#ffffff', + borderSize = 0.05, + crossOrigin, + borderRadius = 8, + logoRadius = 0, + } = logo as LogoType; + + const logoSrc: string = isString(logo) ? logo : logo.src; + const logoWidth = canvasWidth * logoSize; + const logoXY = (canvasWidth * (1 - logoSize)) / 2; + const logoBgWidth = canvasWidth * (logoSize + borderSize); + const logoBgXY = (canvasWidth * (1 - logoSize - borderSize)) / 2; + + const ctx = canvas.getContext('2d'); + if (!ctx) return; + + // logo 底色 + canvasRoundRect(ctx)(logoBgXY, logoBgXY, logoBgWidth, logoBgWidth, borderRadius); + ctx.fillStyle = bgColor; + ctx.fill(); + + // logo + const image = new Image(); + if (crossOrigin || logoRadius) { + image.setAttribute('crossOrigin', crossOrigin || 'anonymous'); + } + image.src = logoSrc; + + // 使用image绘制可以避免某些跨域情况 + const drawLogoWithImage = (image: CanvasImageSource) => { + ctx.drawImage(image, logoXY, logoXY, logoWidth, logoWidth); + }; + + // 使用canvas绘制以获得更多的功能 + const drawLogoWithCanvas = (image: HTMLImageElement) => { + const canvasImage = document.createElement('canvas'); + canvasImage.width = logoXY + logoWidth; + canvasImage.height = logoXY + logoWidth; + const imageCanvas = canvasImage.getContext('2d'); + if (!imageCanvas || !ctx) return; + imageCanvas.drawImage(image, logoXY, logoXY, logoWidth, logoWidth); + + canvasRoundRect(ctx)(logoXY, logoXY, logoWidth, logoWidth, logoRadius); + if (!ctx) return; + const fillStyle = ctx.createPattern(canvasImage, 'no-repeat'); + if (fillStyle) { + ctx.fillStyle = fillStyle; + ctx.fill(); + } + }; + + // 将 logo绘制到 canvas上 + return new Promise((resolve) => { + image.onload = () => { + logoRadius ? drawLogoWithCanvas(image) : drawLogoWithImage(image); + resolve((canvas as HTMLCanvasElement).toDataURL()); + }; + }); +}; + +// copy来的方法,用于绘制圆角 +function canvasRoundRect(ctx: CanvasRenderingContext2D) { + return (x: number, y: number, w: number, h: number, r: number) => { + const minSize = Math.min(w, h); + if (r > minSize / 2) { + r = minSize / 2; + } + ctx.beginPath(); + ctx.moveTo(x + r, y); + ctx.arcTo(x + w, y, x + w, y + h, r); + ctx.arcTo(x + w, y + h, x, y + h, r); + ctx.arcTo(x, y + h, x, y, r); + ctx.arcTo(x, y, x + w, y, r); + ctx.closePath(); + return ctx; + }; +} diff --git a/monolithic/frontend/src/components/Qrcode/src/qrcodePlus.ts b/monolithic/frontend/src/components/Qrcode/src/qrcodePlus.ts new file mode 100644 index 0000000..6439861 --- /dev/null +++ b/monolithic/frontend/src/components/Qrcode/src/qrcodePlus.ts @@ -0,0 +1,4 @@ +// 参考 qr-code-with-logo 进行ts版本修改 +import { toCanvas } from './toCanvas'; +export * from './typing'; +export { toCanvas }; diff --git a/monolithic/frontend/src/components/Qrcode/src/toCanvas.ts b/monolithic/frontend/src/components/Qrcode/src/toCanvas.ts new file mode 100644 index 0000000..f74d596 --- /dev/null +++ b/monolithic/frontend/src/components/Qrcode/src/toCanvas.ts @@ -0,0 +1,10 @@ +import { renderQrCode } from './drawCanvas'; +import { drawLogo } from './drawLogo'; +import { RenderQrCodeParams } from './typing'; +export const toCanvas = (options: RenderQrCodeParams) => { + return renderQrCode(options) + .then(() => { + return options; + }) + .then(drawLogo) as Promise; +}; diff --git a/monolithic/frontend/src/components/Qrcode/src/typing.ts b/monolithic/frontend/src/components/Qrcode/src/typing.ts new file mode 100644 index 0000000..3a037e9 --- /dev/null +++ b/monolithic/frontend/src/components/Qrcode/src/typing.ts @@ -0,0 +1,38 @@ +import type { QRCodeSegment, QRCodeRenderersOptions } from 'qrcode'; + +export type ContentType = string | QRCodeSegment[]; + +export type { QRCodeRenderersOptions }; + +export type LogoType = { + src: string; + logoSize: number; + borderColor: string; + bgColor: string; + borderSize: number; + crossOrigin: string; + borderRadius: number; + logoRadius: number; +}; + +export interface RenderQrCodeParams { + canvas: any; + content: ContentType; + width?: number; + options?: QRCodeRenderersOptions; + logo?: LogoType | string; + image?: HTMLImageElement; + downloadName?: string; + download?: boolean | Fn; +} + +export type ToCanvasFn = (options: RenderQrCodeParams) => Promise; + +export interface QrCodeActionType { + download: (fileName?: string) => void; +} + +export interface QrcodeDoneEventParams { + url: string; + ctx?: CanvasRenderingContext2D | null; +} diff --git a/monolithic/frontend/src/components/Scrollbar/index.ts b/monolithic/frontend/src/components/Scrollbar/index.ts new file mode 100644 index 0000000..e5b2cb2 --- /dev/null +++ b/monolithic/frontend/src/components/Scrollbar/index.ts @@ -0,0 +1,8 @@ +/** + * copy from element-ui + */ + +import Scrollbar from './src/Scrollbar.vue'; + +export { Scrollbar }; +export type { ScrollbarType } from './src/types'; diff --git a/monolithic/frontend/src/components/Scrollbar/src/Scrollbar.vue b/monolithic/frontend/src/components/Scrollbar/src/Scrollbar.vue new file mode 100644 index 0000000..ed08026 --- /dev/null +++ b/monolithic/frontend/src/components/Scrollbar/src/Scrollbar.vue @@ -0,0 +1,206 @@ + + + diff --git a/monolithic/frontend/src/components/Scrollbar/src/bar.ts b/monolithic/frontend/src/components/Scrollbar/src/bar.ts new file mode 100644 index 0000000..64bd289 --- /dev/null +++ b/monolithic/frontend/src/components/Scrollbar/src/bar.ts @@ -0,0 +1,110 @@ +import { + defineComponent, + h, + computed, + ref, + getCurrentInstance, + onUnmounted, + inject, + Ref, +} from 'vue'; +import { on, off } from '/@/utils/domUtils'; + +import { renderThumbStyle, BAR_MAP } from './util'; + +export default defineComponent({ + name: 'Bar', + + props: { + vertical: Boolean, + size: String, + move: Number, + }, + + setup(props) { + const instance = getCurrentInstance(); + const thumb = ref(); + const wrap = inject('scroll-bar-wrap', {} as Ref>) as any; + const bar = computed(() => { + return BAR_MAP[props.vertical ? 'vertical' : 'horizontal']; + }); + const barStore = ref({}); + const cursorDown = ref(); + const clickThumbHandler = (e: any) => { + // prevent click event of right button + if (e.ctrlKey || e.button === 2) { + return; + } + window.getSelection()?.removeAllRanges(); + startDrag(e); + barStore.value[bar.value.axis] = + e.currentTarget[bar.value.offset] - + (e[bar.value.client] - e.currentTarget.getBoundingClientRect()[bar.value.direction]); + }; + + const clickTrackHandler = (e: any) => { + const offset = Math.abs( + e.target.getBoundingClientRect()[bar.value.direction] - e[bar.value.client], + ); + const thumbHalf = thumb.value[bar.value.offset] / 2; + const thumbPositionPercentage = + ((offset - thumbHalf) * 100) / instance?.vnode.el?.[bar.value.offset]; + + wrap.value[bar.value.scroll] = + (thumbPositionPercentage * wrap.value[bar.value.scrollSize]) / 100; + }; + const startDrag = (e: any) => { + e.stopImmediatePropagation(); + cursorDown.value = true; + on(document, 'mousemove', mouseMoveDocumentHandler); + on(document, 'mouseup', mouseUpDocumentHandler); + document.onselectstart = () => false; + }; + + const mouseMoveDocumentHandler = (e: any) => { + if (cursorDown.value === false) return; + const prevPage = barStore.value[bar.value.axis]; + + if (!prevPage) return; + + const offset = + (instance?.vnode.el?.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]) * + -1; + const thumbClickPosition = thumb.value[bar.value.offset] - prevPage; + const thumbPositionPercentage = + ((offset - thumbClickPosition) * 100) / instance?.vnode.el?.[bar.value.offset]; + wrap.value[bar.value.scroll] = + (thumbPositionPercentage * wrap.value[bar.value.scrollSize]) / 100; + }; + + function mouseUpDocumentHandler() { + cursorDown.value = false; + barStore.value[bar.value.axis] = 0; + off(document, 'mousemove', mouseMoveDocumentHandler); + document.onselectstart = null; + } + + onUnmounted(() => { + off(document, 'mouseup', mouseUpDocumentHandler); + }); + + return () => + h( + 'div', + { + class: ['scrollbar__bar', 'is-' + bar.value.key], + onMousedown: clickTrackHandler, + }, + h('div', { + ref: thumb, + class: 'scrollbar__thumb', + onMousedown: clickThumbHandler, + style: renderThumbStyle({ + size: props.size, + move: props.move, + bar: bar.value, + }), + }), + ); + }, +}); diff --git a/monolithic/frontend/src/components/Scrollbar/src/types.d.ts b/monolithic/frontend/src/components/Scrollbar/src/types.d.ts new file mode 100644 index 0000000..4c7eeea --- /dev/null +++ b/monolithic/frontend/src/components/Scrollbar/src/types.d.ts @@ -0,0 +1,18 @@ +export interface BarMapItem { + offset: string; + scroll: string; + scrollSize: string; + size: string; + key: string; + axis: string; + client: string; + direction: string; +} +export interface BarMap { + vertical: BarMapItem; + horizontal: BarMapItem; +} + +export interface ScrollbarType { + wrap: ElRef; +} diff --git a/monolithic/frontend/src/components/Scrollbar/src/util.ts b/monolithic/frontend/src/components/Scrollbar/src/util.ts new file mode 100644 index 0000000..b7c4845 --- /dev/null +++ b/monolithic/frontend/src/components/Scrollbar/src/util.ts @@ -0,0 +1,50 @@ +import type { BarMap } from './types'; +export const BAR_MAP: BarMap = { + vertical: { + offset: 'offsetHeight', + scroll: 'scrollTop', + scrollSize: 'scrollHeight', + size: 'height', + key: 'vertical', + axis: 'Y', + client: 'clientY', + direction: 'top', + }, + horizontal: { + offset: 'offsetWidth', + scroll: 'scrollLeft', + scrollSize: 'scrollWidth', + size: 'width', + key: 'horizontal', + axis: 'X', + client: 'clientX', + direction: 'left', + }, +}; + +// @ts-ignore +export function renderThumbStyle({ move, size, bar }) { + const style = {} as any; + const translate = `translate${bar.axis}(${move}%)`; + + style[bar.size] = size; + style.transform = translate; + style.msTransform = translate; + style.webkitTransform = translate; + + return style; +} + +function extend(to: T, _from: K): T & K { + return Object.assign(to, _from); +} + +export function toObject(arr: Array): Recordable { + const res = {}; + for (let i = 0; i < arr.length; i++) { + if (arr[i]) { + extend(res, arr[i]); + } + } + return res; +} diff --git a/monolithic/frontend/src/components/SimpleMenu/index.ts b/monolithic/frontend/src/components/SimpleMenu/index.ts new file mode 100644 index 0000000..0dfd248 --- /dev/null +++ b/monolithic/frontend/src/components/SimpleMenu/index.ts @@ -0,0 +1,2 @@ +export { default as SimpleMenu } from './src/SimpleMenu.vue'; +export { default as SimpleMenuTag } from './src/SimpleMenuTag.vue'; diff --git a/monolithic/frontend/src/components/SimpleMenu/src/SimpleMenu.vue b/monolithic/frontend/src/components/SimpleMenu/src/SimpleMenu.vue new file mode 100644 index 0000000..45015be --- /dev/null +++ b/monolithic/frontend/src/components/SimpleMenu/src/SimpleMenu.vue @@ -0,0 +1,160 @@ + + + diff --git a/monolithic/frontend/src/components/SimpleMenu/src/SimpleMenuTag.vue b/monolithic/frontend/src/components/SimpleMenu/src/SimpleMenuTag.vue new file mode 100644 index 0000000..b7d3cb3 --- /dev/null +++ b/monolithic/frontend/src/components/SimpleMenu/src/SimpleMenuTag.vue @@ -0,0 +1,68 @@ + + diff --git a/monolithic/frontend/src/components/SimpleMenu/src/SimpleSubMenu.vue b/monolithic/frontend/src/components/SimpleMenu/src/SimpleSubMenu.vue new file mode 100644 index 0000000..5c66a2d --- /dev/null +++ b/monolithic/frontend/src/components/SimpleMenu/src/SimpleSubMenu.vue @@ -0,0 +1,116 @@ + + diff --git a/monolithic/frontend/src/components/SimpleMenu/src/components/Menu.vue b/monolithic/frontend/src/components/SimpleMenu/src/components/Menu.vue new file mode 100644 index 0000000..28f78fb --- /dev/null +++ b/monolithic/frontend/src/components/SimpleMenu/src/components/Menu.vue @@ -0,0 +1,158 @@ + + + + diff --git a/monolithic/frontend/src/components/SimpleMenu/src/components/MenuCollapseTransition.vue b/monolithic/frontend/src/components/SimpleMenu/src/components/MenuCollapseTransition.vue new file mode 100644 index 0000000..5295439 --- /dev/null +++ b/monolithic/frontend/src/components/SimpleMenu/src/components/MenuCollapseTransition.vue @@ -0,0 +1,78 @@ + + diff --git a/monolithic/frontend/src/components/SimpleMenu/src/components/MenuItem.vue b/monolithic/frontend/src/components/SimpleMenu/src/components/MenuItem.vue new file mode 100644 index 0000000..c4976de --- /dev/null +++ b/monolithic/frontend/src/components/SimpleMenu/src/components/MenuItem.vue @@ -0,0 +1,107 @@ + + + diff --git a/monolithic/frontend/src/components/SimpleMenu/src/components/SubMenuItem.vue b/monolithic/frontend/src/components/SimpleMenu/src/components/SubMenuItem.vue new file mode 100644 index 0000000..7d1b5a6 --- /dev/null +++ b/monolithic/frontend/src/components/SimpleMenu/src/components/SubMenuItem.vue @@ -0,0 +1,334 @@ + + + diff --git a/monolithic/frontend/src/components/SimpleMenu/src/components/menu.less b/monolithic/frontend/src/components/SimpleMenu/src/components/menu.less new file mode 100644 index 0000000..0c4c5ca --- /dev/null +++ b/monolithic/frontend/src/components/SimpleMenu/src/components/menu.less @@ -0,0 +1,309 @@ +@menu-prefix-cls: ~'@{namespace}-menu'; +@menu-popup-prefix-cls: ~'@{namespace}-menu-popup'; +@submenu-popup-prefix-cls: ~'@{namespace}-menu-submenu-popup'; + +@transition-time: 0.2s; +@menu-dark-subsidiary-color: rgba(255, 255, 255, 0.7); + +.light-border { + &::after { + position: absolute; + top: 0; + right: 0; + bottom: 0; + display: block; + width: 2px; + content: ''; + background-color: @primary-color; + } +} + +.@{menu-prefix-cls}-menu-popover { + .ant-popover-arrow { + display: none; + } + + .ant-popover-inner-content { + padding: 0; + } + + .@{menu-prefix-cls} { + &-opened > * > &-submenu-title-icon { + transform: translateY(-50%) rotate(90deg) !important; + } + + &-item, + &-submenu-title { + position: relative; + z-index: 1; + padding: 12px 20px; + color: @menu-dark-subsidiary-color; + cursor: pointer; + transition: all @transition-time @ease-in-out; + + &-icon { + position: absolute; + top: 50%; + right: 18px; + transition: transform @transition-time @ease-in-out; + transform: translateY(-50%) rotate(-90deg); + } + } + + &-dark { + .@{menu-prefix-cls}-item, + .@{menu-prefix-cls}-submenu-title { + color: @menu-dark-subsidiary-color; + // background: @menu-dark-active-bg; + + &:hover { + color: #fff; + } + + &-selected { + color: #fff; + background-color: @primary-color !important; + } + } + } + + &-light { + .@{menu-prefix-cls}-item, + .@{menu-prefix-cls}-submenu-title { + color: @text-color-base; + + &:hover { + color: @primary-color; + } + + &-selected { + z-index: 2; + color: @primary-color; + background-color: fade(@primary-color, 10); + + .light-border(); + } + } + } + } +} + +.content(); +.content() { + .@{menu-prefix-cls} { + position: relative; + display: block; + width: 100%; + padding: 0; + margin: 0; + font-size: @font-size-base; + color: @text-color-base; + list-style: none; + outline: none; + + // .collapse-transition { + // transition: @transition-time height ease-in-out, @transition-time padding-top ease-in-out, + // @transition-time padding-bottom ease-in-out; + // } + + &-light { + background-color: #fff; + + .@{menu-prefix-cls}-submenu-active { + color: @primary-color !important; + + &-border { + .light-border(); + } + } + } + + &-dark { + .@{menu-prefix-cls}-submenu-active { + color: #fff !important; + } + } + + &-item { + position: relative; + z-index: 1; + display: flex; + align-items: center; + font-size: @font-size-base; + color: inherit; + list-style: none; + cursor: pointer; + outline: none; + + &:hover, + &:active { + color: inherit; + } + } + + &-item > i { + margin-right: 6px; + } + + &-submenu-title > i, + &-submenu-title span > i { + margin-right: 8px; + } + + // vertical + &-vertical &-item, + &-vertical &-submenu-title { + position: relative; + z-index: 1; + padding: 14px 24px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + cursor: pointer; + + &:hover { + color: @primary-color; + } + + .@{menu-prefix-cls}-tooltip { + width: calc(100% - 0px); + padding: 12px 0; + text-align: center; + } + .@{menu-prefix-cls}-submenu-popup { + padding: 12px 0; + } + } + + &-vertical &-submenu-collapse { + .@{submenu-popup-prefix-cls} { + display: flex; + align-items: center; + justify-content: center; + } + .@{menu-prefix-cls}-submenu-collapsed-show-tit { + flex-direction: column; + } + } + + &-vertical&-collapse &-item, + &-vertical&-collapse &-submenu-title { + padding: 0; + } + + &-vertical &-submenu-title-icon { + position: absolute; + top: 50%; + right: 18px; + transform: translateY(-50%); + } + + &-submenu-title-icon { + transition: transform @transition-time @ease-in-out; + } + + &-vertical &-opened > * > &-submenu-title-icon { + transform: translateY(-50%) rotate(180deg); + } + + &-vertical &-submenu { + &-nested { + padding-left: 20px; + } + .@{menu-prefix-cls}-item { + padding-left: 43px; + } + } + + &-light&-vertical &-item { + &-active:not(.@{menu-prefix-cls}-submenu) { + z-index: 2; + color: @primary-color; + background-color: fade(@primary-color, 10); + + .light-border(); + } + &-active.@{menu-prefix-cls}-submenu { + color: @primary-color; + } + } + + &-light&-vertical&-collapse { + > li.@{menu-prefix-cls}-item-active, + .@{menu-prefix-cls}-submenu-active { + position: relative; + background-color: fade(@primary-color, 5); + + &::after { + display: none; + } + + &::before { + position: absolute; + top: 0; + left: 0; + width: 3px; + height: 100%; + content: ''; + background-color: @primary-color; + } + } + } + + &-dark&-vertical &-item, + &-dark&-vertical &-submenu-title { + color: @menu-dark-subsidiary-color; + &-active:not(.@{menu-prefix-cls}-submenu) { + color: #fff !important; + background-color: @primary-color !important; + } + + &:hover { + color: #fff; + } + } + + &-dark&-vertical&-collapse { + > li.@{menu-prefix-cls}-item-active, + .@{menu-prefix-cls}-submenu-active { + position: relative; + color: #fff !important; + background-color: @sider-dark-darken-bg-color !important; + + &::before { + position: absolute; + top: 0; + left: 0; + width: 3px; + height: 100%; + content: ''; + background-color: @primary-color; + } + + .@{menu-prefix-cls}-submenu-collapse { + background-color: transparent; + } + } + } + + &-dark&-vertical &-submenu &-item { + &-active, + &-active:hover { + color: #fff; + border-right: none; + } + } + + &-dark&-vertical &-child-item-active > &-submenu-title { + color: #fff; + } + + &-dark&-vertical &-opened { + .@{menu-prefix-cls}-submenu-has-parent-submenu { + .@{menu-prefix-cls}-submenu-title { + background-color: transparent; + } + } + } + } +} diff --git a/monolithic/frontend/src/components/SimpleMenu/src/components/types.ts b/monolithic/frontend/src/components/SimpleMenu/src/components/types.ts new file mode 100644 index 0000000..d828e89 --- /dev/null +++ b/monolithic/frontend/src/components/SimpleMenu/src/components/types.ts @@ -0,0 +1,25 @@ +import { Ref } from 'vue'; + +export interface Props { + theme: string; + activeName?: string | number | undefined; + openNames: string[]; + accordion: boolean; + width: string; + collapsedWidth: string; + indentSize: number; + collapse: boolean; + activeSubMenuNames: (string | number)[]; +} + +export interface SubMenuProvider { + addSubMenu: (name: string | number, update?: boolean) => void; + removeSubMenu: (name: string | number, update?: boolean) => void; + removeAll: () => void; + sliceIndex: (index: number) => void; + isRemoveAllPopup: Ref; + getOpenNames: () => (string | number)[]; + handleMouseleave?: Fn; + level: number; + props: Props; +} diff --git a/monolithic/frontend/src/components/SimpleMenu/src/components/useMenu.ts b/monolithic/frontend/src/components/SimpleMenu/src/components/useMenu.ts new file mode 100644 index 0000000..8830559 --- /dev/null +++ b/monolithic/frontend/src/components/SimpleMenu/src/components/useMenu.ts @@ -0,0 +1,84 @@ +import { computed, ComponentInternalInstance, unref } from 'vue'; +import type { CSSProperties } from 'vue'; + +export function useMenuItem(instance: ComponentInternalInstance | null) { + const getParentMenu = computed(() => { + return findParentMenu(['Menu', 'SubMenu']); + }); + + const getParentRootMenu = computed(() => { + return findParentMenu(['Menu']); + }); + + const getParentSubMenu = computed(() => { + return findParentMenu(['SubMenu']); + }); + + const getItemStyle = computed((): CSSProperties => { + let parent = instance?.parent; + if (!parent) return {}; + const indentSize = (unref(getParentRootMenu)?.props.indentSize as number) ?? 20; + let padding = indentSize; + + if (unref(getParentRootMenu)?.props.collapse) { + padding = indentSize; + } else { + while (parent && parent.type.name !== 'Menu') { + if (parent.type.name === 'SubMenu') { + padding += indentSize; + } + parent = parent.parent; + } + } + return { paddingLeft: padding + 'px' }; + }); + + function findParentMenu(name: string[]) { + let parent = instance?.parent; + if (!parent) return null; + while (parent && name.indexOf(parent.type.name!) === -1) { + parent = parent.parent; + } + return parent; + } + + function getParentList() { + let parent = instance; + if (!parent) + return { + uidList: [], + list: [], + }; + const ret: any[] = []; + while (parent && parent.type.name !== 'Menu') { + if (parent.type.name === 'SubMenu') { + ret.push(parent); + } + parent = parent.parent; + } + return { + uidList: ret.map((item) => item.uid), + list: ret, + }; + } + + function getParentInstance(instance: ComponentInternalInstance, name = 'SubMenu') { + let parent = instance.parent; + while (parent) { + if (parent.type.name !== name) { + return parent; + } + parent = parent.parent; + } + return parent; + } + + return { + getParentMenu, + getParentInstance, + getParentRootMenu, + getParentList, + getParentSubMenu, + getItemStyle, + }; +} diff --git a/monolithic/frontend/src/components/SimpleMenu/src/components/useSimpleMenuContext.ts b/monolithic/frontend/src/components/SimpleMenu/src/components/useSimpleMenuContext.ts new file mode 100644 index 0000000..f3d8100 --- /dev/null +++ b/monolithic/frontend/src/components/SimpleMenu/src/components/useSimpleMenuContext.ts @@ -0,0 +1,18 @@ +import type { InjectionKey, Ref } from 'vue'; +import type { Emitter } from '/@/utils/mitt'; +import { createContext, useContext } from '/@/hooks/core/useContext'; + +export interface SimpleRootMenuContextProps { + rootMenuEmitter: Emitter; + activeName: Ref; +} + +const key: InjectionKey = Symbol(); + +export function createSimpleRootMenuContext(context: SimpleRootMenuContextProps) { + return createContext(context, key, { readonly: false, native: true }); +} + +export function useSimpleRootMenuContext() { + return useContext(key); +} diff --git a/monolithic/frontend/src/components/SimpleMenu/src/index.less b/monolithic/frontend/src/components/SimpleMenu/src/index.less new file mode 100644 index 0000000..4f9c9ce --- /dev/null +++ b/monolithic/frontend/src/components/SimpleMenu/src/index.less @@ -0,0 +1,77 @@ +@simple-prefix-cls: ~'@{namespace}-simple-menu'; +@prefix-cls: ~'@{namespace}-menu'; + +.@{prefix-cls} { + &-dark&-vertical .@{simple-prefix-cls}__parent { + background-color: @sider-dark-bg-color; + > .@{prefix-cls}-submenu-title { + background-color: @sider-dark-bg-color; + } + } + + &-dark&-vertical .@{simple-prefix-cls}__children, + &-dark&-popup .@{simple-prefix-cls}__children { + background-color: @sider-dark-lighten-bg-color; + > .@{prefix-cls}-submenu-title { + background-color: @sider-dark-lighten-bg-color; + } + } + + .collapse-title { + overflow: hidden; + font-size: 12px; + text-overflow: ellipsis; + white-space: nowrap; + } +} + +.@{simple-prefix-cls} { + &-sub-title { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + transition: all 0.3s; + } + + &-tag { + position: absolute; + top: calc(50% - 8px); + right: 30px; + display: inline-block; + padding: 2px 3px; + margin-right: 4px; + font-size: 10px; + line-height: 14px; + color: #fff; + border-radius: 2px; + + &--collapse { + top: 6px !important; + right: 2px; + } + + &--dot { + top: calc(50% - 2px); + width: 6px; + height: 6px; + padding: 0; + border-radius: 50%; + } + + &--primary { + background-color: @primary-color; + } + + &--error { + background-color: @error-color; + } + + &--success { + background-color: @success-color; + } + + &--warn { + background-color: @warning-color; + } + } +} diff --git a/monolithic/frontend/src/components/SimpleMenu/src/types.ts b/monolithic/frontend/src/components/SimpleMenu/src/types.ts new file mode 100644 index 0000000..2e292d4 --- /dev/null +++ b/monolithic/frontend/src/components/SimpleMenu/src/types.ts @@ -0,0 +1,5 @@ +export interface MenuState { + activeName: string; + openNames: string[]; + activeSubMenuNames: string[]; +} diff --git a/monolithic/frontend/src/components/SimpleMenu/src/useOpenKeys.ts b/monolithic/frontend/src/components/SimpleMenu/src/useOpenKeys.ts new file mode 100644 index 0000000..1b3cf7b --- /dev/null +++ b/monolithic/frontend/src/components/SimpleMenu/src/useOpenKeys.ts @@ -0,0 +1,50 @@ +import type { Menu as MenuType } from '/@/router/types'; +import type { MenuState } from './types'; + +import { computed, Ref, toRaw } from 'vue'; + +import { unref } from 'vue'; +import { uniq } from 'lodash-es'; +import { getAllParentPath } from '/@/router/helper/menuHelper'; + +import { useTimeoutFn } from '/@/hooks/core/useTimeout'; +import { useDebounceFn } from '@vueuse/core'; + +export function useOpenKeys( + menuState: MenuState, + menus: Ref, + accordion: Ref, + mixSider: Ref, + collapse: Ref, +) { + const debounceSetOpenKeys = useDebounceFn(setOpenKeys, 50); + async function setOpenKeys(path: string) { + const native = !mixSider.value; + const menuList = toRaw(menus.value); + useTimeoutFn( + () => { + if (menuList?.length === 0) { + menuState.activeSubMenuNames = []; + menuState.openNames = []; + return; + } + const keys = getAllParentPath(menuList, path); + + if (!unref(accordion)) { + menuState.openNames = uniq([...menuState.openNames, ...keys]); + } else { + menuState.openNames = keys; + } + menuState.activeSubMenuNames = menuState.openNames; + }, + 30, + native, + ); + } + + const getOpenKeys = computed(() => { + return unref(collapse) ? [] : menuState.openNames; + }); + + return { setOpenKeys: debounceSetOpenKeys, getOpenKeys }; +} diff --git a/monolithic/frontend/src/components/StrengthMeter/index.ts b/monolithic/frontend/src/components/StrengthMeter/index.ts new file mode 100644 index 0000000..9763afa --- /dev/null +++ b/monolithic/frontend/src/components/StrengthMeter/index.ts @@ -0,0 +1,4 @@ +import { withInstall } from '/@/utils'; +import strengthMeter from './src/StrengthMeter.vue'; + +export const StrengthMeter = withInstall(strengthMeter); diff --git a/monolithic/frontend/src/components/StrengthMeter/src/StrengthMeter.vue b/monolithic/frontend/src/components/StrengthMeter/src/StrengthMeter.vue new file mode 100644 index 0000000..e0fc331 --- /dev/null +++ b/monolithic/frontend/src/components/StrengthMeter/src/StrengthMeter.vue @@ -0,0 +1,142 @@ + + + + diff --git a/monolithic/frontend/src/components/Table/index.ts b/monolithic/frontend/src/components/Table/index.ts new file mode 100644 index 0000000..1ec9568 --- /dev/null +++ b/monolithic/frontend/src/components/Table/index.ts @@ -0,0 +1,11 @@ +export { default as BasicTable } from './src/BasicTable.vue'; +export { default as TableAction } from './src/components/TableAction.vue'; +export { default as EditTableHeaderIcon } from './src/components/EditTableHeaderIcon.vue'; +export { default as TableImg } from './src/components/TableImg.vue'; + +export * from './src/types/table'; +export * from './src/types/pagination'; +export * from './src/types/tableAction'; +export { useTable } from './src/hooks/useTable'; +export type { FormSchema, FormProps } from '/@/components/Form/src/types/form'; +export type { EditRecordRow } from './src/components/editable'; diff --git a/monolithic/frontend/src/components/Table/src/BasicTable.vue b/monolithic/frontend/src/components/Table/src/BasicTable.vue new file mode 100644 index 0000000..8b79620 --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/BasicTable.vue @@ -0,0 +1,452 @@ + + + diff --git a/monolithic/frontend/src/components/Table/src/componentMap.ts b/monolithic/frontend/src/components/Table/src/componentMap.ts new file mode 100644 index 0000000..3f72471 --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/componentMap.ts @@ -0,0 +1,36 @@ +import type { Component } from 'vue'; +import { + Input, + Select, + Checkbox, + InputNumber, + Switch, + DatePicker, + TimePicker, + AutoComplete, +} from 'ant-design-vue'; +import type { ComponentType } from './types/componentType'; +import { ApiSelect, ApiTreeSelect } from '/@/components/Form'; + +const componentMap = new Map(); + +componentMap.set('Input', Input); +componentMap.set('InputNumber', InputNumber); +componentMap.set('Select', Select); +componentMap.set('ApiSelect', ApiSelect); +componentMap.set('AutoComplete', AutoComplete); +componentMap.set('ApiTreeSelect', ApiTreeSelect); +componentMap.set('Switch', Switch); +componentMap.set('Checkbox', Checkbox); +componentMap.set('DatePicker', DatePicker); +componentMap.set('TimePicker', TimePicker); + +export function add(compName: ComponentType, component: Component) { + componentMap.set(compName, component); +} + +export function del(compName: ComponentType) { + componentMap.delete(compName); +} + +export { componentMap }; diff --git a/monolithic/frontend/src/components/Table/src/components/EditTableHeaderIcon.vue b/monolithic/frontend/src/components/Table/src/components/EditTableHeaderIcon.vue new file mode 100644 index 0000000..369820e --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/components/EditTableHeaderIcon.vue @@ -0,0 +1,16 @@ + + diff --git a/monolithic/frontend/src/components/Table/src/components/HeaderCell.vue b/monolithic/frontend/src/components/Table/src/components/HeaderCell.vue new file mode 100644 index 0000000..c21bfd0 --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/components/HeaderCell.vue @@ -0,0 +1,48 @@ + + + diff --git a/monolithic/frontend/src/components/Table/src/components/TableAction.vue b/monolithic/frontend/src/components/Table/src/components/TableAction.vue new file mode 100644 index 0000000..4c5c1ed --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/components/TableAction.vue @@ -0,0 +1,202 @@ + + + diff --git a/monolithic/frontend/src/components/Table/src/components/TableFooter.vue b/monolithic/frontend/src/components/Table/src/components/TableFooter.vue new file mode 100644 index 0000000..68e556b --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/components/TableFooter.vue @@ -0,0 +1,94 @@ + + diff --git a/monolithic/frontend/src/components/Table/src/components/TableHeader.vue b/monolithic/frontend/src/components/Table/src/components/TableHeader.vue new file mode 100644 index 0000000..189e913 --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/components/TableHeader.vue @@ -0,0 +1,81 @@ + + + diff --git a/monolithic/frontend/src/components/Table/src/components/TableImg.vue b/monolithic/frontend/src/components/Table/src/components/TableImg.vue new file mode 100644 index 0000000..6b533aa --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/components/TableImg.vue @@ -0,0 +1,85 @@ + + + diff --git a/monolithic/frontend/src/components/Table/src/components/TableTitle.vue b/monolithic/frontend/src/components/Table/src/components/TableTitle.vue new file mode 100644 index 0000000..0b797e1 --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/components/TableTitle.vue @@ -0,0 +1,53 @@ + + + diff --git a/monolithic/frontend/src/components/Table/src/components/editable/CellComponent.ts b/monolithic/frontend/src/components/Table/src/components/editable/CellComponent.ts new file mode 100644 index 0000000..3a16693 --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/components/editable/CellComponent.ts @@ -0,0 +1,44 @@ +import type { FunctionalComponent, defineComponent } from 'vue'; +import type { ComponentType } from '../../types/componentType'; +import { componentMap } from '/@/components/Table/src/componentMap'; + +import { Popover } from 'ant-design-vue'; +import { h } from 'vue'; + +export interface ComponentProps { + component: ComponentType; + rule: boolean; + popoverVisible: boolean; + ruleMessage: string; + getPopupContainer?: Fn; +} + +export const CellComponent: FunctionalComponent = ( + { + component = 'Input', + rule = true, + ruleMessage, + popoverVisible, + getPopupContainer, + }: ComponentProps, + { attrs }, +) => { + const Comp = componentMap.get(component) as typeof defineComponent; + + const DefaultComp = h(Comp, attrs); + if (!rule) { + return DefaultComp; + } + return h( + Popover, + { + overlayClassName: 'edit-cell-rule-popover', + visible: !!popoverVisible, + ...(getPopupContainer ? { getPopupContainer } : {}), + }, + { + default: () => DefaultComp, + content: () => ruleMessage, + }, + ); +}; diff --git a/monolithic/frontend/src/components/Table/src/components/editable/EditableCell.vue b/monolithic/frontend/src/components/Table/src/components/editable/EditableCell.vue new file mode 100644 index 0000000..90e5f9a --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/components/editable/EditableCell.vue @@ -0,0 +1,531 @@ + + diff --git a/monolithic/frontend/src/components/Table/src/components/editable/helper.ts b/monolithic/frontend/src/components/Table/src/components/editable/helper.ts new file mode 100644 index 0000000..9c600c9 --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/components/editable/helper.ts @@ -0,0 +1,28 @@ +import { ComponentType } from '../../types/componentType'; +import { useI18n } from '/@/hooks/web/useI18n'; + +const { t } = useI18n(); + +/** + * @description: 生成placeholder + */ +export function createPlaceholderMessage(component: ComponentType) { + if (component.includes('Input') || component.includes('AutoComplete')) { + return t('common.inputText'); + } + if (component.includes('Picker')) { + return t('common.chooseText'); + } + + if ( + component.includes('Select') || + component.includes('Checkbox') || + component.includes('Radio') || + component.includes('Switch') || + component.includes('DatePicker') || + component.includes('TimePicker') + ) { + return t('common.chooseText'); + } + return ''; +} diff --git a/monolithic/frontend/src/components/Table/src/components/editable/index.ts b/monolithic/frontend/src/components/Table/src/components/editable/index.ts new file mode 100644 index 0000000..4f7d4da --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/components/editable/index.ts @@ -0,0 +1,68 @@ +import type { BasicColumn } from '/@/components/Table/src/types/table'; + +import { h, Ref } from 'vue'; + +import EditableCell from './EditableCell.vue'; +import { isArray } from '/@/utils/is'; + +interface Params { + text: string; + record: Recordable; + index: number; +} + +export function renderEditCell(column: BasicColumn) { + return ({ text: value, record, index }: Params) => { + record.onValid = async () => { + if (isArray(record?.validCbs)) { + const validFns = (record?.validCbs || []).map((fn) => fn()); + const res = await Promise.all(validFns); + return res.every((item) => !!item); + } else { + return false; + } + }; + + record.onEdit = async (edit: boolean, submit = false) => { + if (!submit) { + record.editable = edit; + } + + if (!edit && submit) { + if (!(await record.onValid())) return false; + const res = await record.onSubmitEdit?.(); + if (res) { + record.editable = false; + return true; + } + return false; + } + // cancel + if (!edit && !submit) { + record.onCancelEdit?.(); + } + return true; + }; + + return h(EditableCell, { + value, + record, + column, + index, + }); + }; +} + +export type EditRecordRow = Partial< + { + onEdit: (editable: boolean, submit?: boolean) => Promise; + onValid: () => Promise; + editable: boolean; + onCancel: Fn; + onSubmit: Fn; + submitCbs: Fn[]; + cancelCbs: Fn[]; + validCbs: Fn[]; + editValueRefs: Recordable; + } & T +>; diff --git a/monolithic/frontend/src/components/Table/src/components/settings/ColumnSetting.vue b/monolithic/frontend/src/components/Table/src/components/settings/ColumnSetting.vue new file mode 100644 index 0000000..dc72a35 --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/components/settings/ColumnSetting.vue @@ -0,0 +1,482 @@ + + + diff --git a/monolithic/frontend/src/components/Table/src/components/settings/FullScreenSetting.vue b/monolithic/frontend/src/components/Table/src/components/settings/FullScreenSetting.vue new file mode 100644 index 0000000..af07f84 --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/components/settings/FullScreenSetting.vue @@ -0,0 +1,38 @@ + + diff --git a/monolithic/frontend/src/components/Table/src/components/settings/RedoSetting.vue b/monolithic/frontend/src/components/Table/src/components/settings/RedoSetting.vue new file mode 100644 index 0000000..81829a1 --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/components/settings/RedoSetting.vue @@ -0,0 +1,33 @@ + + diff --git a/monolithic/frontend/src/components/Table/src/components/settings/SizeSetting.vue b/monolithic/frontend/src/components/Table/src/components/settings/SizeSetting.vue new file mode 100644 index 0000000..79c4a22 --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/components/settings/SizeSetting.vue @@ -0,0 +1,64 @@ + + diff --git a/monolithic/frontend/src/components/Table/src/components/settings/index.vue b/monolithic/frontend/src/components/Table/src/components/settings/index.vue new file mode 100644 index 0000000..ab03cb2 --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/components/settings/index.vue @@ -0,0 +1,76 @@ + + + diff --git a/monolithic/frontend/src/components/Table/src/const.ts b/monolithic/frontend/src/components/Table/src/const.ts new file mode 100644 index 0000000..9888687 --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/const.ts @@ -0,0 +1,38 @@ +import componentSetting from '/@/settings/componentSetting'; + +const { table } = componentSetting; + +const { + pageSizeOptions, + defaultPageSize, + fetchSetting, + defaultSize, + defaultSortFn, + defaultFilterFn, +} = table; + +export const ROW_KEY = 'key'; + +// Optional display number per page; +export const PAGE_SIZE_OPTIONS = pageSizeOptions; + +// Number of items displayed per page +export const PAGE_SIZE = defaultPageSize; + +// Common interfaces field settings +export const FETCH_SETTING = fetchSetting; + +// Default Size +export const DEFAULT_SIZE = defaultSize; + +// Configure general sort function +export const DEFAULT_SORT_FN = defaultSortFn; + +export const DEFAULT_FILTER_FN = defaultFilterFn; + +// Default layout of table cells +export const DEFAULT_ALIGN = 'center'; + +export const INDEX_COLUMN_FLAG = 'INDEX'; + +export const ACTION_COLUMN_FLAG = 'ACTION'; diff --git a/monolithic/frontend/src/components/Table/src/hooks/useColumns.ts b/monolithic/frontend/src/components/Table/src/hooks/useColumns.ts new file mode 100644 index 0000000..e450d9b --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/hooks/useColumns.ts @@ -0,0 +1,317 @@ +import type { BasicColumn, BasicTableProps, CellFormat, GetColumnsParams } from '../types/table'; +import type { PaginationProps } from '../types/pagination'; +import type { ComputedRef } from 'vue'; +import { computed, Ref, ref, reactive, toRaw, unref, watch } from 'vue'; +import { renderEditCell } from '../components/editable'; +import { usePermission } from '/@/hooks/web/usePermission'; +import { useI18n } from '/@/hooks/web/useI18n'; +import { isArray, isBoolean, isFunction, isMap, isString } from '/@/utils/is'; +import { cloneDeep, isEqual } from 'lodash-es'; +import { formatToDate } from '/@/utils/dateUtil'; +import { ACTION_COLUMN_FLAG, DEFAULT_ALIGN, INDEX_COLUMN_FLAG, PAGE_SIZE } from '../const'; + +function handleItem(item: BasicColumn, ellipsis: boolean) { + const { key, dataIndex, children } = item; + item.align = item.align || DEFAULT_ALIGN; + if (ellipsis) { + if (!key) { + item.key = dataIndex; + } + if (!isBoolean(item.ellipsis)) { + Object.assign(item, { + ellipsis, + }); + } + } + if (children && children.length) { + handleChildren(children, !!ellipsis); + } +} + +function handleChildren(children: BasicColumn[] | undefined, ellipsis: boolean) { + if (!children) return; + children.forEach((item) => { + const { children } = item; + handleItem(item, ellipsis); + handleChildren(children, ellipsis); + }); +} + +function handleIndexColumn( + propsRef: ComputedRef, + getPaginationRef: ComputedRef, + columns: BasicColumn[], +) { + const { t } = useI18n(); + + const { showIndexColumn, indexColumnProps, isTreeTable } = unref(propsRef); + + let pushIndexColumns = false; + if (unref(isTreeTable)) { + return; + } + columns.forEach(() => { + const indIndex = columns.findIndex((column) => column.flag === INDEX_COLUMN_FLAG); + if (showIndexColumn) { + pushIndexColumns = indIndex === -1; + } else if (!showIndexColumn && indIndex !== -1) { + columns.splice(indIndex, 1); + } + }); + + if (!pushIndexColumns) return; + + const isFixedLeft = columns.some((item) => item.fixed === 'left'); + + columns.unshift({ + flag: INDEX_COLUMN_FLAG, + width: 50, + title: t('component.table.index'), + align: 'center', + customRender: ({ index }) => { + const getPagination = unref(getPaginationRef); + if (isBoolean(getPagination)) { + return `${index + 1}`; + } + const { current = 1, pageSize = PAGE_SIZE } = getPagination; + return ((current < 1 ? 1 : current) - 1) * pageSize + index + 1; + }, + ...(isFixedLeft + ? { + fixed: 'left', + } + : {}), + ...indexColumnProps, + }); +} + +function handleActionColumn(propsRef: ComputedRef, columns: BasicColumn[]) { + const { actionColumn } = unref(propsRef); + if (!actionColumn) return; + + const hasIndex = columns.findIndex((column) => column.flag === ACTION_COLUMN_FLAG); + if (hasIndex === -1) { + columns.push({ + ...columns[hasIndex], + fixed: 'right', + ...actionColumn, + flag: ACTION_COLUMN_FLAG, + }); + } +} + +export function useColumns( + propsRef: ComputedRef, + getPaginationRef: ComputedRef, +) { + const columnsRef = ref(unref(propsRef).columns) as unknown as Ref; + let cacheColumns = unref(propsRef).columns; + + const getColumnsRef = computed(() => { + const columns = cloneDeep(unref(columnsRef)); + + handleIndexColumn(propsRef, getPaginationRef, columns); + handleActionColumn(propsRef, columns); + if (!columns) { + return []; + } + const { ellipsis } = unref(propsRef); + + columns.forEach((item) => { + const { customRender, slots } = item; + + handleItem( + item, + Reflect.has(item, 'ellipsis') ? !!item.ellipsis : !!ellipsis && !customRender && !slots, + ); + }); + return columns; + }); + + function isIfShow(column: BasicColumn): boolean { + const ifShow = column.ifShow; + + let isIfShow = true; + + if (isBoolean(ifShow)) { + isIfShow = ifShow; + } + if (isFunction(ifShow)) { + isIfShow = ifShow(column); + } + return isIfShow; + } + const { hasPermission } = usePermission(); + + const getViewColumns = computed(() => { + const viewColumns = sortFixedColumn(unref(getColumnsRef)); + + const columns = cloneDeep(viewColumns); + return columns + .filter((column) => { + return hasPermission(column.auth) && isIfShow(column); + }) + .map((column) => { + const { slots, customRender, format, edit, editRow, flag } = column; + + if (!slots || !slots?.title) { + // column.slots = { title: `header-${dataIndex}`, ...(slots || {}) }; + column.customTitle = column.title; + Reflect.deleteProperty(column, 'title'); + } + const isDefaultAction = [INDEX_COLUMN_FLAG, ACTION_COLUMN_FLAG].includes(flag!); + if (!customRender && format && !edit && !isDefaultAction) { + column.customRender = ({ text, record, index }) => { + return formatCell(text, format, record, index); + }; + } + + // edit table + if ((edit || editRow) && !isDefaultAction) { + column.customRender = renderEditCell(column); + } + return reactive(column); + }); + }); + + watch( + () => unref(propsRef).columns, + (columns) => { + columnsRef.value = columns; + cacheColumns = columns?.filter((item) => !item.flag) ?? []; + }, + ); + + function setCacheColumnsByField(dataIndex: string | undefined, value: Partial) { + if (!dataIndex || !value) { + return; + } + cacheColumns.forEach((item) => { + if (item.dataIndex === dataIndex) { + Object.assign(item, value); + return; + } + }); + } + /** + * set columns + * @param columnList key|column + */ + function setColumns(columnList: Partial[] | (string | string[])[]) { + const columns = cloneDeep(columnList); + if (!isArray(columns)) return; + + if (columns.length <= 0) { + columnsRef.value = []; + return; + } + + const firstColumn = columns[0]; + + const cacheKeys = cacheColumns.map((item) => item.dataIndex); + + if (!isString(firstColumn) && !isArray(firstColumn)) { + columnsRef.value = columns as BasicColumn[]; + } else { + const columnKeys = (columns as (string | string[])[]).map((m) => m.toString()); + const newColumns: BasicColumn[] = []; + cacheColumns.forEach((item) => { + newColumns.push({ + ...item, + defaultHidden: !columnKeys.includes(item.dataIndex?.toString() || (item.key as string)), + }); + }); + // Sort according to another array + if (!isEqual(cacheKeys, columns)) { + newColumns.sort((prev, next) => { + return ( + columnKeys.indexOf(prev.dataIndex?.toString() as string) - + columnKeys.indexOf(next.dataIndex?.toString() as string) + ); + }); + } + columnsRef.value = newColumns; + } + } + + function getColumns(opt?: GetColumnsParams) { + const { ignoreIndex, ignoreAction, sort } = opt || {}; + let columns = toRaw(unref(getColumnsRef)); + if (ignoreIndex) { + columns = columns.filter((item) => item.flag !== INDEX_COLUMN_FLAG); + } + if (ignoreAction) { + columns = columns.filter((item) => item.flag !== ACTION_COLUMN_FLAG); + } + + if (sort) { + columns = sortFixedColumn(columns); + } + + return columns; + } + function getCacheColumns() { + return cacheColumns; + } + + return { + getColumnsRef, + getCacheColumns, + getColumns, + setColumns, + getViewColumns, + setCacheColumnsByField, + }; +} + +function sortFixedColumn(columns: BasicColumn[]) { + const fixedLeftColumns: BasicColumn[] = []; + const fixedRightColumns: BasicColumn[] = []; + const defColumns: BasicColumn[] = []; + for (const column of columns) { + if (column.fixed === 'left') { + fixedLeftColumns.push(column); + continue; + } + if (column.fixed === 'right') { + fixedRightColumns.push(column); + continue; + } + defColumns.push(column); + } + return [...fixedLeftColumns, ...defColumns, ...fixedRightColumns].filter( + (item) => !item.defaultHidden, + ); +} + +// format cell +export function formatCell(text: string, format: CellFormat, record: Recordable, index: number) { + if (!format) { + return text; + } + + // custom function + if (isFunction(format)) { + return format(text, record, index); + } + + try { + // date type + const DATE_FORMAT_PREFIX = 'date|'; + if (isString(format) && format.startsWith(DATE_FORMAT_PREFIX) && text) { + const dateFormat = format.replace(DATE_FORMAT_PREFIX, ''); + + if (!dateFormat) { + return text; + } + return formatToDate(text, dateFormat); + } + + // Map + if (isMap(format)) { + return format.get(text); + } + } catch (error) { + return text; + } +} diff --git a/monolithic/frontend/src/components/Table/src/hooks/useCustomRow.ts b/monolithic/frontend/src/components/Table/src/hooks/useCustomRow.ts new file mode 100644 index 0000000..5618720 --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/hooks/useCustomRow.ts @@ -0,0 +1,100 @@ +import type { ComputedRef } from 'vue'; +import type { BasicTableProps } from '../types/table'; +import { unref } from 'vue'; +import { ROW_KEY } from '../const'; +import { isString, isFunction } from '/@/utils/is'; + +interface Options { + setSelectedRowKeys: (keys: string[]) => void; + getSelectRowKeys: () => string[]; + clearSelectedRowKeys: () => void; + emit: EmitType; + getAutoCreateKey: ComputedRef; +} + +function getKey( + record: Recordable, + rowKey: string | ((record: Record) => string) | undefined, + autoCreateKey?: boolean, +) { + if (!rowKey || autoCreateKey) { + return record[ROW_KEY]; + } + if (isString(rowKey)) { + return record[rowKey]; + } + if (isFunction(rowKey)) { + return record[rowKey(record)]; + } + return null; +} + +export function useCustomRow( + propsRef: ComputedRef, + { setSelectedRowKeys, getSelectRowKeys, getAutoCreateKey, clearSelectedRowKeys, emit }: Options, +) { + const customRow = (record: Recordable, index: number) => { + return { + onClick: (e: Event) => { + e?.stopPropagation(); + function handleClick() { + const { rowSelection, rowKey, clickToRowSelect } = unref(propsRef); + if (!rowSelection || !clickToRowSelect) return; + const keys = getSelectRowKeys(); + const key = getKey(record, rowKey, unref(getAutoCreateKey)); + if (!key) return; + + const isCheckbox = rowSelection.type === 'checkbox'; + if (isCheckbox) { + // 找到tr + const tr: HTMLElement = (e as MouseEvent) + .composedPath?.() + .find((dom: HTMLElement) => dom.tagName === 'TR') as HTMLElement; + if (!tr) return; + // 找到Checkbox,检查是否为disabled + const checkBox = tr.querySelector('input[type=checkbox]'); + if (!checkBox || checkBox.hasAttribute('disabled')) return; + if (!keys.includes(key)) { + setSelectedRowKeys([...keys, key]); + return; + } + const keyIndex = keys.findIndex((item) => item === key); + keys.splice(keyIndex, 1); + setSelectedRowKeys(keys); + return; + } + + const isRadio = rowSelection.type === 'radio'; + if (isRadio) { + if (!keys.includes(key)) { + if (keys.length) { + clearSelectedRowKeys(); + } + setSelectedRowKeys([key]); + return; + } + clearSelectedRowKeys(); + } + } + handleClick(); + emit('row-click', record, index, e); + }, + onDblclick: (event: Event) => { + emit('row-dbClick', record, index, event); + }, + onContextmenu: (event: Event) => { + emit('row-contextmenu', record, index, event); + }, + onMouseenter: (event: Event) => { + emit('row-mouseenter', record, index, event); + }, + onMouseleave: (event: Event) => { + emit('row-mouseleave', record, index, event); + }, + }; + }; + + return { + customRow, + }; +} diff --git a/monolithic/frontend/src/components/Table/src/hooks/useDataSource.ts b/monolithic/frontend/src/components/Table/src/hooks/useDataSource.ts new file mode 100644 index 0000000..1bf36a4 --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/hooks/useDataSource.ts @@ -0,0 +1,403 @@ +import type { BasicTableProps, FetchParams, SorterResult } from '../types/table'; +import type { PaginationProps } from '../types/pagination'; +import { + ref, + unref, + ComputedRef, + computed, + onMounted, + watch, + reactive, + Ref, + watchEffect, +} from 'vue'; +import { useTimeoutFn } from '/@/hooks/core/useTimeout'; +import { buildUUID } from '/@/utils/uuid'; +import { isFunction, isBoolean } from '/@/utils/is'; +import { get, cloneDeep, merge } from 'lodash-es'; +import { FETCH_SETTING, ROW_KEY, PAGE_SIZE } from '../const'; + +interface ActionType { + getPaginationInfo: ComputedRef; + setPagination: (info: Partial) => void; + setLoading: (loading: boolean) => void; + getFieldsValue: () => Recordable; + clearSelectedRowKeys: () => void; + tableData: Ref; +} + +interface SearchState { + sortInfo: Recordable; + filterInfo: Record; +} +export function useDataSource( + propsRef: ComputedRef, + { + getPaginationInfo, + setPagination, + setLoading, + getFieldsValue, + clearSelectedRowKeys, + tableData, + }: ActionType, + emit: EmitType, +) { + const searchState = reactive({ + sortInfo: {}, + filterInfo: {}, + }); + const dataSourceRef = ref([]); + const rawDataSourceRef = ref({}); + + watchEffect(() => { + tableData.value = unref(dataSourceRef); + }); + + watch( + () => unref(propsRef).dataSource, + () => { + const { dataSource, api } = unref(propsRef); + !api && dataSource && (dataSourceRef.value = dataSource); + }, + { + immediate: true, + }, + ); + + function handleTableChange( + pagination: PaginationProps, + filters: Partial>, + sorter: SorterResult, + ) { + const { clearSelectOnPageChange, sortFn, filterFn } = unref(propsRef); + if (clearSelectOnPageChange) { + clearSelectedRowKeys(); + } + setPagination(pagination); + + const params: Recordable = {}; + if (sorter && isFunction(sortFn)) { + const sortInfo = sortFn(sorter); + searchState.sortInfo = sortInfo; + params.sortInfo = sortInfo; + } + + if (filters && isFunction(filterFn)) { + const filterInfo = filterFn(filters); + searchState.filterInfo = filterInfo; + params.filterInfo = filterInfo; + } + fetch(params); + } + + function setTableKey(items: any[]) { + if (!items || !Array.isArray(items)) return; + items.forEach((item) => { + if (!item[ROW_KEY]) { + item[ROW_KEY] = buildUUID(); + } + if (item.children && item.children.length) { + setTableKey(item.children); + } + }); + } + + const getAutoCreateKey = computed(() => { + return unref(propsRef).autoCreateKey && !unref(propsRef).rowKey; + }); + + const getRowKey = computed(() => { + const { rowKey } = unref(propsRef); + return unref(getAutoCreateKey) ? ROW_KEY : rowKey; + }); + + const getDataSourceRef = computed(() => { + const dataSource = unref(dataSourceRef); + if (!dataSource || dataSource.length === 0) { + return unref(dataSourceRef); + } + if (unref(getAutoCreateKey)) { + const firstItem = dataSource[0]; + const lastItem = dataSource[dataSource.length - 1]; + + if (firstItem && lastItem) { + if (!firstItem[ROW_KEY] || !lastItem[ROW_KEY]) { + const data = cloneDeep(unref(dataSourceRef)); + data.forEach((item) => { + if (!item[ROW_KEY]) { + item[ROW_KEY] = buildUUID(); + } + if (item.children && item.children.length) { + setTableKey(item.children); + } + }); + dataSourceRef.value = data; + } + } + } + return unref(dataSourceRef); + }); + + async function updateTableData(index: number, key: string, value: any) { + const record = dataSourceRef.value[index]; + if (record) { + dataSourceRef.value[index][key] = value; + } + return dataSourceRef.value[index]; + } + + function updateTableDataRecord( + rowKey: string | number, + record: Recordable, + ): Recordable | undefined { + const row = findTableDataRecord(rowKey); + + if (row) { + for (const field in row) { + if (Reflect.has(record, field)) row[field] = record[field]; + } + return row; + } + } + + function deleteTableDataRecord(rowKey: string | number | string[] | number[]) { + if (!dataSourceRef.value || dataSourceRef.value.length == 0) return; + const rowKeyName = unref(getRowKey); + if (!rowKeyName) return; + const rowKeys = !Array.isArray(rowKey) ? [rowKey] : rowKey; + for (const key of rowKeys) { + let index: number | undefined = dataSourceRef.value.findIndex((row) => { + let targetKeyName: string; + if (typeof rowKeyName === 'function') { + targetKeyName = rowKeyName(row); + } else { + targetKeyName = rowKeyName as string; + } + return row[targetKeyName] === key; + }); + if (index >= 0) { + dataSourceRef.value.splice(index, 1); + } + index = unref(propsRef).dataSource?.findIndex((row) => { + let targetKeyName: string; + if (typeof rowKeyName === 'function') { + targetKeyName = rowKeyName(row); + } else { + targetKeyName = rowKeyName as string; + } + return row[targetKeyName] === key; + }); + if (typeof index !== 'undefined' && index !== -1) + unref(propsRef).dataSource?.splice(index, 1); + } + setPagination({ + total: unref(propsRef).dataSource?.length, + }); + } + + function insertTableDataRecord(record: Recordable, index: number): Recordable | undefined { + // if (!dataSourceRef.value || dataSourceRef.value.length == 0) return; + index = index ?? dataSourceRef.value?.length; + unref(dataSourceRef).splice(index, 0, record); + return unref(dataSourceRef); + } + + function findTableDataRecord(rowKey: string | number) { + if (!dataSourceRef.value || dataSourceRef.value.length == 0) return; + + const rowKeyName = unref(getRowKey); + if (!rowKeyName) return; + + const { childrenColumnName = 'children' } = unref(propsRef); + + const findRow = (array: any[]) => { + let ret; + array.some(function iter(r) { + if (typeof rowKeyName === 'function') { + if ((rowKeyName(r) as string) === rowKey) { + ret = r; + return true; + } + } else { + if (Reflect.has(r, rowKeyName) && r[rowKeyName] === rowKey) { + ret = r; + return true; + } + } + return r[childrenColumnName] && r[childrenColumnName].some(iter); + }); + return ret; + }; + + // const row = dataSourceRef.value.find(r => { + // if (typeof rowKeyName === 'function') { + // return (rowKeyName(r) as string) === rowKey + // } else { + // return Reflect.has(r, rowKeyName) && r[rowKeyName] === rowKey + // } + // }) + return findRow(dataSourceRef.value); + } + + async function fetch(opt?: FetchParams) { + const { + api, + searchInfo, + defSort, + fetchSetting, + beforeFetch, + afterFetch, + useSearchForm, + pagination, + } = unref(propsRef); + if (!api || !isFunction(api)) return; + try { + setLoading(true); + const { pageField, sizeField, listField, totalField } = Object.assign( + {}, + FETCH_SETTING, + fetchSetting, + ); + let pageParams: Recordable = {}; + + const { current = 1, pageSize = PAGE_SIZE } = unref(getPaginationInfo) as PaginationProps; + + if ((isBoolean(pagination) && !pagination) || isBoolean(getPaginationInfo)) { + pageParams = { nopaging: true }; + } else { + pageParams[pageField] = (opt && opt.page) || current; + pageParams[sizeField] = pageSize; + } + + const { sortInfo = {}, filterInfo } = searchState; + + const sortParams = sortInfo || defSort || opt?.sortInfo; + + const filterParams = filterInfo || opt?.filterInfo; + + const queryParams: Recordable = merge( + useSearchForm ? getFieldsValue() : {}, + opt?.searchInfo ?? {}, + ); + + // YLB EDIT: 增加排序和过滤 + + const queryMap: { [key: string]: string } = {}; + let queryCount = 0; + for (const k in queryParams) { + const v = (queryParams as any)[k]; + if (v) { + queryMap[k] = v; + ++queryCount; + } + } + for (const k in filterParams) { + const v = (filterParams as any)[k]; + if (v) { + // 暂时只支持一个过滤条件吧 + queryMap[k] = v[0]; + ++queryCount; + } + } + + const sortMap: { [key: string]: string } = {}; + let sortCount = 0; + if (sortParams.hasOwnProperty('field') && sortParams.hasOwnProperty('order')) { + sortMap[sortParams.field] = sortParams.order; + ++sortCount; + } + + let params: Recordable = merge( + pageParams, + queryCount == 0 ? {} : { query: queryMap }, + sortCount == 0 ? {} : { orderBy: sortMap }, + ); + if (beforeFetch && isFunction(beforeFetch)) { + params = (await beforeFetch(params)) || params; + } + const res = await api(params); + rawDataSourceRef.value = res; + + const isArrayResult = Array.isArray(res); + + let resultItems: Recordable[] = isArrayResult ? res : get(res, listField); + const resultTotal: number = isArrayResult ? 0 : get(res, totalField); + + // 假如数据变少,导致总页数变少并小于当前选中页码,通过getPaginationRef获取到的页码是不正确的,需获取正确的页码再次执行 + if (resultTotal) { + const currentTotalPage = Math.ceil(resultTotal / pageSize); + if (current > currentTotalPage) { + setPagination({ + current: currentTotalPage, + }); + return await fetch(opt); + } + } + + if (afterFetch && isFunction(afterFetch)) { + resultItems = (await afterFetch(resultItems)) || resultItems; + } + dataSourceRef.value = resultItems; + setPagination({ + total: resultTotal || 0, + }); + if (opt && opt.page) { + setPagination({ + current: opt.page || 1, + }); + } + emit('fetch-success', { + items: unref(resultItems), + total: resultTotal, + }); + return resultItems; + } catch (error) { + emit('fetch-error', error); + dataSourceRef.value = []; + setPagination({ + total: 0, + }); + } finally { + setLoading(false); + } + } + + function setTableData(values: T[]) { + dataSourceRef.value = values; + } + + function getDataSource() { + return getDataSourceRef.value as T[]; + } + + function getRawDataSource() { + return rawDataSourceRef.value as T; + } + + async function reload(opt?: FetchParams) { + return await fetch(opt); + } + + onMounted(() => { + useTimeoutFn(() => { + unref(propsRef).immediate && fetch(); + }, 16); + }); + + return { + getDataSourceRef, + getDataSource, + getRawDataSource, + getRowKey, + setTableData, + getAutoCreateKey, + fetch, + reload, + updateTableData, + updateTableDataRecord, + deleteTableDataRecord, + insertTableDataRecord, + findTableDataRecord, + handleTableChange, + }; +} diff --git a/monolithic/frontend/src/components/Table/src/hooks/useLoading.ts b/monolithic/frontend/src/components/Table/src/hooks/useLoading.ts new file mode 100644 index 0000000..fe8a0f1 --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/hooks/useLoading.ts @@ -0,0 +1,21 @@ +import { ref, ComputedRef, unref, computed, watch } from 'vue'; +import type { BasicTableProps } from '../types/table'; + +export function useLoading(props: ComputedRef) { + const loadingRef = ref(unref(props).loading); + + watch( + () => unref(props).loading, + (loading) => { + loadingRef.value = loading; + }, + ); + + const getLoading = computed(() => unref(loadingRef)); + + function setLoading(loading: boolean) { + loadingRef.value = loading; + } + + return { getLoading, setLoading }; +} diff --git a/monolithic/frontend/src/components/Table/src/hooks/usePagination.tsx b/monolithic/frontend/src/components/Table/src/hooks/usePagination.tsx new file mode 100644 index 0000000..ba310bd --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/hooks/usePagination.tsx @@ -0,0 +1,85 @@ +import type { PaginationProps } from '../types/pagination'; +import type { BasicTableProps } from '../types/table'; +import { computed, unref, ref, ComputedRef, watch } from 'vue'; +import { LeftOutlined, RightOutlined } from '@ant-design/icons-vue'; +import { isBoolean } from '/@/utils/is'; +import { PAGE_SIZE, PAGE_SIZE_OPTIONS } from '../const'; +import { useI18n } from '/@/hooks/web/useI18n'; + +interface ItemRender { + page: number; + type: 'page' | 'prev' | 'next'; + originalElement: any; +} + +function itemRender({ page, type, originalElement }: ItemRender) { + if (type === 'prev') { + return page === 0 ? null : ; + } else if (type === 'next') { + return page === 1 ? null : ; + } + return originalElement; +} + +export function usePagination(refProps: ComputedRef) { + const { t } = useI18n(); + + const configRef = ref({}); + const show = ref(true); + + watch( + () => unref(refProps).pagination, + (pagination) => { + if (!isBoolean(pagination) && pagination) { + configRef.value = { + ...unref(configRef), + ...(pagination ?? {}), + }; + } + }, + ); + + const getPaginationInfo = computed((): PaginationProps | boolean => { + const { pagination } = unref(refProps); + + if (!unref(show) || (isBoolean(pagination) && !pagination)) { + return false; + } + + return { + current: 1, + pageSize: PAGE_SIZE, + size: 'small', + defaultPageSize: PAGE_SIZE, + showTotal: (total) => t('component.table.total', { total }), + showSizeChanger: true, + pageSizeOptions: PAGE_SIZE_OPTIONS, + itemRender: itemRender, + showQuickJumper: true, + ...(isBoolean(pagination) ? {} : pagination), + ...unref(configRef), + }; + }); + + function setPagination(info: Partial) { + const paginationInfo = unref(getPaginationInfo); + configRef.value = { + ...(!isBoolean(paginationInfo) ? paginationInfo : {}), + ...info, + }; + } + + function getPagination() { + return unref(getPaginationInfo); + } + + function getShowPagination() { + return unref(show); + } + + async function setShowPagination(flag: boolean) { + show.value = flag; + } + + return { getPagination, getPaginationInfo, setShowPagination, getShowPagination, setPagination }; +} diff --git a/monolithic/frontend/src/components/Table/src/hooks/useRowSelection.ts b/monolithic/frontend/src/components/Table/src/hooks/useRowSelection.ts new file mode 100644 index 0000000..3439a22 --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/hooks/useRowSelection.ts @@ -0,0 +1,122 @@ +import { isFunction } from '/@/utils/is'; +import type { BasicTableProps, TableRowSelection } from '../types/table'; +import { computed, ComputedRef, nextTick, Ref, ref, toRaw, unref, watch } from 'vue'; +import { ROW_KEY } from '../const'; +import { omit } from 'lodash-es'; +import { findNodeAll } from '/@/utils/helper/treeHelper'; + +export function useRowSelection( + propsRef: ComputedRef, + tableData: Ref, + emit: EmitType, +) { + const selectedRowKeysRef = ref([]); + const selectedRowRef = ref([]); + + const getRowSelectionRef = computed((): TableRowSelection | null => { + const { rowSelection } = unref(propsRef); + if (!rowSelection) { + return null; + } + + return { + selectedRowKeys: unref(selectedRowKeysRef), + onChange: (selectedRowKeys: string[]) => { + setSelectedRowKeys(selectedRowKeys); + }, + ...omit(rowSelection, ['onChange']), + }; + }); + + watch( + () => unref(propsRef).rowSelection?.selectedRowKeys, + (v: string[]) => { + setSelectedRowKeys(v); + }, + ); + + watch( + () => unref(selectedRowKeysRef), + () => { + nextTick(() => { + const { rowSelection } = unref(propsRef); + if (rowSelection) { + const { onChange } = rowSelection; + if (onChange && isFunction(onChange)) onChange(getSelectRowKeys(), getSelectRows()); + } + emit('selection-change', { + keys: getSelectRowKeys(), + rows: getSelectRows(), + }); + }); + }, + { deep: true }, + ); + + const getAutoCreateKey = computed(() => { + return unref(propsRef).autoCreateKey && !unref(propsRef).rowKey; + }); + + const getRowKey = computed(() => { + const { rowKey } = unref(propsRef); + return unref(getAutoCreateKey) ? ROW_KEY : rowKey; + }); + + function setSelectedRowKeys(rowKeys: string[]) { + selectedRowKeysRef.value = rowKeys; + const allSelectedRows = findNodeAll( + toRaw(unref(tableData)).concat(toRaw(unref(selectedRowRef))), + (item) => rowKeys.includes(item[unref(getRowKey) as string]), + { + children: propsRef.value.childrenColumnName ?? 'children', + }, + ); + const trueSelectedRows: any[] = []; + rowKeys.forEach((key: string) => { + const found = allSelectedRows.find((item) => item[unref(getRowKey) as string] === key); + found && trueSelectedRows.push(found); + }); + selectedRowRef.value = trueSelectedRows; + } + + function setSelectedRows(rows: Recordable[]) { + selectedRowRef.value = rows; + } + + function clearSelectedRowKeys() { + selectedRowRef.value = []; + selectedRowKeysRef.value = []; + } + + function deleteSelectRowByKey(key: string) { + const selectedRowKeys = unref(selectedRowKeysRef); + const index = selectedRowKeys.findIndex((item) => item === key); + if (index !== -1) { + unref(selectedRowKeysRef).splice(index, 1); + } + } + + function getSelectRowKeys() { + return unref(selectedRowKeysRef); + } + + function getSelectRows() { + // const ret = toRaw(unref(selectedRowRef)).map((item) => toRaw(item)); + return unref(selectedRowRef) as T[]; + } + + function getRowSelection() { + return unref(getRowSelectionRef)!; + } + + return { + getRowSelection, + getRowSelectionRef, + getSelectRows, + getSelectRowKeys, + setSelectedRowKeys, + clearSelectedRowKeys, + deleteSelectRowByKey, + setSelectedRows, + }; +} diff --git a/monolithic/frontend/src/components/Table/src/hooks/useScrollTo.ts b/monolithic/frontend/src/components/Table/src/hooks/useScrollTo.ts new file mode 100644 index 0000000..b368f81 --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/hooks/useScrollTo.ts @@ -0,0 +1,55 @@ +import type { ComputedRef, Ref } from 'vue'; +import { nextTick, unref } from 'vue'; +import { warn } from '/@/utils/log'; + +export function useTableScrollTo( + tableElRef: Ref, + getDataSourceRef: ComputedRef, +) { + let bodyEl: HTMLElement | null; + + async function findTargetRowToScroll(targetRowData: Recordable) { + const { id } = targetRowData; + const targetRowEl: HTMLElement | null | undefined = bodyEl?.querySelector( + `[data-row-key="${id}"]`, + ); + //Add a delay to get new dataSource + await nextTick(); + bodyEl?.scrollTo({ + top: targetRowEl?.offsetTop ?? 0, + behavior: 'smooth', + }); + } + + function scrollTo(pos: string): void { + const table = unref(tableElRef); + if (!table) return; + + const tableEl: Element = table.$el; + if (!tableEl) return; + + if (!bodyEl) { + bodyEl = tableEl.querySelector('.ant-table-body'); + if (!bodyEl) return; + } + + const dataSource = unref(getDataSourceRef); + if (!dataSource) return; + + // judge pos type + if (pos === 'top') { + findTargetRowToScroll(dataSource[0]); + } else if (pos === 'bottom') { + findTargetRowToScroll(dataSource[dataSource.length - 1]); + } else { + const targetRowData = dataSource.find((data) => data.id === pos); + if (targetRowData) { + findTargetRowToScroll(targetRowData); + } else { + warn(`id: ${pos} doesn't exist`); + } + } + } + + return { scrollTo }; +} diff --git a/monolithic/frontend/src/components/Table/src/hooks/useTable.ts b/monolithic/frontend/src/components/Table/src/hooks/useTable.ts new file mode 100644 index 0000000..824249e --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/hooks/useTable.ts @@ -0,0 +1,167 @@ +import type { BasicTableProps, TableActionType, FetchParams, BasicColumn } from '../types/table'; +import type { PaginationProps } from '../types/pagination'; +import type { DynamicProps } from '/#/utils'; +import type { FormActionType } from '/@/components/Form'; +import type { WatchStopHandle } from 'vue'; +import { getDynamicProps } from '/@/utils'; +import { ref, onUnmounted, unref, watch, toRaw } from 'vue'; +import { isProdMode } from '/@/utils/env'; +import { error } from '/@/utils/log'; + +type Props = Partial>; + +type UseTableMethod = TableActionType & { + getForm: () => FormActionType; +}; + +export function useTable(tableProps?: Props): [ + (instance: TableActionType, formInstance: UseTableMethod) => void, + TableActionType & { + getForm: () => FormActionType; + }, +] { + const tableRef = ref>(null); + const loadedRef = ref>(false); + const formRef = ref>(null); + + let stopWatch: WatchStopHandle; + + function register(instance: TableActionType, formInstance: UseTableMethod) { + isProdMode() && + onUnmounted(() => { + tableRef.value = null; + loadedRef.value = null; + }); + + if (unref(loadedRef) && isProdMode() && instance === unref(tableRef)) return; + + tableRef.value = instance; + formRef.value = formInstance; + tableProps && instance.setProps(getDynamicProps(tableProps)); + loadedRef.value = true; + + stopWatch?.(); + + stopWatch = watch( + () => tableProps, + () => { + tableProps && instance.setProps(getDynamicProps(tableProps)); + }, + { + immediate: true, + deep: true, + }, + ); + } + + function getTableInstance(): TableActionType { + const table = unref(tableRef); + if (!table) { + error( + 'The table instance has not been obtained yet, please make sure the table is presented when performing the table operation!', + ); + } + return table as TableActionType; + } + + const methods: TableActionType & { + getForm: () => FormActionType; + } = { + reload: async (opt?: FetchParams) => { + return await getTableInstance().reload(opt); + }, + setProps: (props: Partial) => { + getTableInstance().setProps(props); + }, + redoHeight: () => { + getTableInstance().redoHeight(); + }, + setLoading: (loading: boolean) => { + getTableInstance().setLoading(loading); + }, + getDataSource: () => { + return getTableInstance().getDataSource(); + }, + getRawDataSource: () => { + return getTableInstance().getRawDataSource(); + }, + getColumns: ({ ignoreIndex = false }: { ignoreIndex?: boolean } = {}) => { + const columns = getTableInstance().getColumns({ ignoreIndex }) || []; + return toRaw(columns); + }, + setColumns: (columns: BasicColumn[]) => { + getTableInstance().setColumns(columns); + }, + setTableData: (values: any[]) => { + return getTableInstance().setTableData(values); + }, + setPagination: (info: Partial) => { + return getTableInstance().setPagination(info); + }, + deleteSelectRowByKey: (key: string) => { + getTableInstance().deleteSelectRowByKey(key); + }, + getSelectRowKeys: () => { + return toRaw(getTableInstance().getSelectRowKeys()); + }, + getSelectRows: () => { + return toRaw(getTableInstance().getSelectRows()); + }, + clearSelectedRowKeys: () => { + getTableInstance().clearSelectedRowKeys(); + }, + setSelectedRowKeys: (keys: string[] | number[]) => { + getTableInstance().setSelectedRowKeys(keys); + }, + getPaginationRef: () => { + return getTableInstance().getPaginationRef(); + }, + getSize: () => { + return toRaw(getTableInstance().getSize()); + }, + updateTableData: (index: number, key: string, value: any) => { + return getTableInstance().updateTableData(index, key, value); + }, + deleteTableDataRecord: (rowKey: string | number | string[] | number[]) => { + return getTableInstance().deleteTableDataRecord(rowKey); + }, + insertTableDataRecord: (record: Recordable | Recordable[], index?: number) => { + return getTableInstance().insertTableDataRecord(record, index); + }, + updateTableDataRecord: (rowKey: string | number, record: Recordable) => { + return getTableInstance().updateTableDataRecord(rowKey, record); + }, + findTableDataRecord: (rowKey: string | number) => { + return getTableInstance().findTableDataRecord(rowKey); + }, + getRowSelection: () => { + return toRaw(getTableInstance().getRowSelection()); + }, + getCacheColumns: () => { + return toRaw(getTableInstance().getCacheColumns()); + }, + getForm: () => { + return unref(formRef) as unknown as FormActionType; + }, + setShowPagination: async (show: boolean) => { + getTableInstance().setShowPagination(show); + }, + getShowPagination: () => { + return toRaw(getTableInstance().getShowPagination()); + }, + expandAll: () => { + getTableInstance().expandAll(); + }, + expandRows: (keys: string[]) => { + getTableInstance().expandRows(keys); + }, + collapseAll: () => { + getTableInstance().collapseAll(); + }, + scrollTo: (pos: string) => { + getTableInstance().scrollTo(pos); + }, + }; + + return [register, methods]; +} diff --git a/monolithic/frontend/src/components/Table/src/hooks/useTableContext.ts b/monolithic/frontend/src/components/Table/src/hooks/useTableContext.ts new file mode 100644 index 0000000..b657bb2 --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/hooks/useTableContext.ts @@ -0,0 +1,22 @@ +import type { Ref } from 'vue'; +import type { BasicTableProps, TableActionType } from '../types/table'; +import { provide, inject, ComputedRef } from 'vue'; + +const key = Symbol('basic-table'); + +type Instance = TableActionType & { + wrapRef: Ref>; + getBindValues: ComputedRef; +}; + +type RetInstance = Omit & { + getBindValues: ComputedRef; +}; + +export function createTableContext(instance: Instance) { + provide(key, instance); +} + +export function useTableContext(): RetInstance { + return inject(key) as RetInstance; +} diff --git a/monolithic/frontend/src/components/Table/src/hooks/useTableExpand.ts b/monolithic/frontend/src/components/Table/src/hooks/useTableExpand.ts new file mode 100644 index 0000000..2628365 --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/hooks/useTableExpand.ts @@ -0,0 +1,65 @@ +import type { ComputedRef, Ref } from 'vue'; +import type { BasicTableProps } from '../types/table'; +import { computed, unref, ref, toRaw } from 'vue'; +import { ROW_KEY } from '../const'; + +export function useTableExpand( + propsRef: ComputedRef, + tableData: Ref, + emit: EmitType, +) { + const expandedRowKeys = ref([]); + + const getAutoCreateKey = computed(() => { + return unref(propsRef).autoCreateKey && !unref(propsRef).rowKey; + }); + + const getRowKey = computed(() => { + const { rowKey } = unref(propsRef); + return unref(getAutoCreateKey) ? ROW_KEY : rowKey; + }); + + const getExpandOption = computed(() => { + const { isTreeTable } = unref(propsRef); + if (!isTreeTable) return {}; + + return { + expandedRowKeys: unref(expandedRowKeys), + onExpandedRowsChange: (keys: string[]) => { + expandedRowKeys.value = keys; + emit('expanded-rows-change', keys); + }, + }; + }); + + function expandAll() { + const keys = getAllKeys(); + expandedRowKeys.value = keys; + } + + function expandRows(keys: string[]) { + // use row ID expands the specified table row + const { isTreeTable } = unref(propsRef); + if (!isTreeTable) return; + expandedRowKeys.value = [...expandedRowKeys.value, ...keys]; + } + + function getAllKeys(data?: Recordable[]) { + const keys: string[] = []; + const { childrenColumnName } = unref(propsRef); + toRaw(data || unref(tableData)).forEach((item) => { + keys.push(item[unref(getRowKey) as string]); + const children = item[childrenColumnName || 'children']; + if (children?.length) { + keys.push(...getAllKeys(children)); + } + }); + return keys; + } + + function collapseAll() { + expandedRowKeys.value = []; + } + + return { getExpandOption, expandAll, expandRows, collapseAll }; +} diff --git a/monolithic/frontend/src/components/Table/src/hooks/useTableFooter.ts b/monolithic/frontend/src/components/Table/src/hooks/useTableFooter.ts new file mode 100644 index 0000000..6a3aa58 --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/hooks/useTableFooter.ts @@ -0,0 +1,56 @@ +import type { ComputedRef, Ref } from 'vue'; +import type { BasicTableProps } from '../types/table'; +import { unref, computed, h, nextTick, watchEffect } from 'vue'; +import TableFooter from '../components/TableFooter.vue'; +import { useEventListener } from '/@/hooks/event/useEventListener'; + +export function useTableFooter( + propsRef: ComputedRef, + scrollRef: ComputedRef<{ + x: string | number | true; + y: string | number | null; + scrollToFirstRowOnChange: boolean; + }>, + tableElRef: Ref, + getDataSourceRef: ComputedRef, +) { + const getIsEmptyData = computed(() => { + return (unref(getDataSourceRef) || []).length === 0; + }); + + const getFooterProps = computed((): Recordable | undefined => { + const { summaryFunc, showSummary, summaryData } = unref(propsRef); + return showSummary && !unref(getIsEmptyData) + ? () => h(TableFooter, { summaryFunc, summaryData, scroll: unref(scrollRef) }) + : undefined; + }); + + watchEffect(() => { + handleSummary(); + }); + + function handleSummary() { + const { showSummary } = unref(propsRef); + if (!showSummary || unref(getIsEmptyData)) return; + + nextTick(() => { + const tableEl = unref(tableElRef); + if (!tableEl) return; + const bodyDom = tableEl.$el.querySelector('.ant-table-content'); + useEventListener({ + el: bodyDom, + name: 'scroll', + listener: () => { + const footerBodyDom = tableEl.$el.querySelector( + '.ant-table-footer .ant-table-content', + ) as HTMLDivElement; + if (!footerBodyDom || !bodyDom) return; + footerBodyDom.scrollLeft = bodyDom.scrollLeft; + }, + wait: 0, + options: true, + }); + }); + } + return { getFooterProps }; +} diff --git a/monolithic/frontend/src/components/Table/src/hooks/useTableForm.ts b/monolithic/frontend/src/components/Table/src/hooks/useTableForm.ts new file mode 100644 index 0000000..bc09c7f --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/hooks/useTableForm.ts @@ -0,0 +1,50 @@ +import type { ComputedRef, Slots } from 'vue'; +import type { BasicTableProps, FetchParams } from '../types/table'; +import { unref, computed } from 'vue'; +import type { FormProps } from '/@/components/Form'; +import { isFunction } from '/@/utils/is'; + +export function useTableForm( + propsRef: ComputedRef, + slots: Slots, + fetch: (opt?: FetchParams | undefined) => Promise, + getLoading: ComputedRef, +) { + const getFormProps = computed((): Partial => { + const { formConfig } = unref(propsRef); + const { submitButtonOptions } = formConfig || {}; + return { + showAdvancedButton: true, + ...formConfig, + submitButtonOptions: { loading: unref(getLoading), ...submitButtonOptions }, + compact: true, + }; + }); + + const getFormSlotKeys: ComputedRef = computed(() => { + const keys = Object.keys(slots); + return keys + .map((item) => (item.startsWith('form-') ? item : null)) + .filter((item) => !!item) as string[]; + }); + + function replaceFormSlotKey(key: string) { + if (!key) return ''; + return key?.replace?.(/form\-/, '') ?? ''; + } + + function handleSearchInfoChange(info: Recordable) { + const { handleSearchInfoFn } = unref(propsRef); + if (handleSearchInfoFn && isFunction(handleSearchInfoFn)) { + info = handleSearchInfoFn(info) || info; + } + fetch({ searchInfo: info, page: 1 }); + } + + return { + getFormProps, + replaceFormSlotKey, + getFormSlotKeys, + handleSearchInfoChange, + }; +} diff --git a/monolithic/frontend/src/components/Table/src/hooks/useTableHeader.ts b/monolithic/frontend/src/components/Table/src/hooks/useTableHeader.ts new file mode 100644 index 0000000..e728207 --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/hooks/useTableHeader.ts @@ -0,0 +1,54 @@ +import type { ComputedRef, Slots } from 'vue'; +import type { BasicTableProps, InnerHandlers } from '../types/table'; +import { unref, computed, h } from 'vue'; +import TableHeader from '../components/TableHeader.vue'; +import { isString } from '/@/utils/is'; +import { getSlot } from '/@/utils/helper/tsxHelper'; + +export function useTableHeader( + propsRef: ComputedRef, + slots: Slots, + handlers: InnerHandlers, +) { + const getHeaderProps = computed((): Recordable => { + const { title, showTableSetting, titleHelpMessage, tableSetting } = unref(propsRef); + const hideTitle = !slots.tableTitle && !title && !slots.toolbar && !showTableSetting; + if (hideTitle && !isString(title)) { + return {}; + } + + return { + title: hideTitle + ? null + : () => + h( + TableHeader, + { + title, + titleHelpMessage, + showTableSetting, + tableSetting, + onColumnsChange: handlers.onColumnsChange, + } as Recordable, + { + ...(slots.toolbar + ? { + toolbar: () => getSlot(slots, 'toolbar'), + } + : {}), + ...(slots.tableTitle + ? { + tableTitle: () => getSlot(slots, 'tableTitle'), + } + : {}), + ...(slots.headerTop + ? { + headerTop: () => getSlot(slots, 'headerTop'), + } + : {}), + }, + ), + }; + }); + return { getHeaderProps }; +} diff --git a/monolithic/frontend/src/components/Table/src/hooks/useTableScroll.ts b/monolithic/frontend/src/components/Table/src/hooks/useTableScroll.ts new file mode 100644 index 0000000..839ae0f --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/hooks/useTableScroll.ts @@ -0,0 +1,220 @@ +import type { BasicTableProps, TableRowSelection, BasicColumn } from '../types/table'; +import { Ref, ComputedRef, ref } from 'vue'; +import { computed, unref, nextTick, watch } from 'vue'; +import { getViewportOffset } from '/@/utils/domUtils'; +import { isBoolean } from '/@/utils/is'; +import { useWindowSizeFn } from '/@/hooks/event/useWindowSizeFn'; +import { useModalContext } from '/@/components/Modal'; +import { onMountedOrActivated } from '/@/hooks/core/onMountedOrActivated'; +import { useDebounceFn } from '@vueuse/core'; + +export function useTableScroll( + propsRef: ComputedRef, + tableElRef: Ref, + columnsRef: ComputedRef, + rowSelectionRef: ComputedRef, + getDataSourceRef: ComputedRef, + wrapRef: Ref, + formRef: Ref, +) { + const tableHeightRef: Ref> = ref(167); + const modalFn = useModalContext(); + + // Greater than animation time 280 + const debounceRedoHeight = useDebounceFn(redoHeight, 100); + + const getCanResize = computed(() => { + const { canResize, scroll } = unref(propsRef); + return canResize && !(scroll || {}).y; + }); + + watch( + () => [unref(getCanResize), unref(getDataSourceRef)?.length], + () => { + debounceRedoHeight(); + }, + { + flush: 'post', + }, + ); + + function redoHeight() { + nextTick(() => { + calcTableHeight(); + }); + } + + function setHeight(height: number) { + tableHeightRef.value = height; + // Solve the problem of modal adaptive height calculation when the form is placed in the modal + modalFn?.redoModalHeight?.(); + } + + // No need to repeat queries + let paginationEl: HTMLElement | null; + let footerEl: HTMLElement | null; + let bodyEl: HTMLElement | null; + + async function calcTableHeight() { + const { resizeHeightOffset, pagination, maxHeight, isCanResizeParent, useSearchForm } = + unref(propsRef); + const tableData = unref(getDataSourceRef); + + const table = unref(tableElRef); + if (!table) return; + + const tableEl: Element = table.$el; + if (!tableEl) return; + + if (!bodyEl) { + bodyEl = tableEl.querySelector('.ant-table-body'); + if (!bodyEl) return; + } + + const hasScrollBarY = bodyEl.scrollHeight > bodyEl.clientHeight; + const hasScrollBarX = bodyEl.scrollWidth > bodyEl.clientWidth; + + if (hasScrollBarY) { + tableEl.classList.contains('hide-scrollbar-y') && + tableEl.classList.remove('hide-scrollbar-y'); + } else { + !tableEl.classList.contains('hide-scrollbar-y') && tableEl.classList.add('hide-scrollbar-y'); + } + + if (hasScrollBarX) { + tableEl.classList.contains('hide-scrollbar-x') && + tableEl.classList.remove('hide-scrollbar-x'); + } else { + !tableEl.classList.contains('hide-scrollbar-x') && tableEl.classList.add('hide-scrollbar-x'); + } + + bodyEl!.style.height = 'unset'; + + if (!unref(getCanResize) || !unref(tableData) || tableData.length === 0) return; + + await nextTick(); + // Add a delay to get the correct bottomIncludeBody paginationHeight footerHeight headerHeight + + const headEl = tableEl.querySelector('.ant-table-thead '); + + if (!headEl) return; + + // Table height from bottom height-custom offset + let paddingHeight = 32; + // Pager height + let paginationHeight = 2; + if (!isBoolean(pagination)) { + paginationEl = tableEl.querySelector('.ant-pagination') as HTMLElement; + if (paginationEl) { + const offsetHeight = paginationEl.offsetHeight; + paginationHeight += offsetHeight || 0; + } else { + // TODO First fix 24 + paginationHeight += 24; + } + } else { + paginationHeight = -8; + } + + let footerHeight = 0; + if (!isBoolean(pagination)) { + if (!footerEl) { + footerEl = tableEl.querySelector('.ant-table-footer') as HTMLElement; + } else { + const offsetHeight = footerEl.offsetHeight; + footerHeight += offsetHeight || 0; + } + } + + let headerHeight = 0; + if (headEl) { + headerHeight = (headEl as HTMLElement).offsetHeight; + } + + let bottomIncludeBody = 0; + if (unref(wrapRef) && isCanResizeParent) { + const tablePadding = 12; + const formMargin = 16; + let paginationMargin = 10; + const wrapHeight = unref(wrapRef)?.offsetHeight ?? 0; + + let formHeight = unref(formRef)?.$el.offsetHeight ?? 0; + if (formHeight) { + formHeight += formMargin; + } + if (isBoolean(pagination) && !pagination) { + paginationMargin = 0; + } + if (isBoolean(useSearchForm) && !useSearchForm) { + paddingHeight = 0; + } + + const headerCellHeight = + (tableEl.querySelector('.ant-table-title') as HTMLElement)?.offsetHeight ?? 0; + + console.log(wrapHeight - formHeight - headerCellHeight - tablePadding - paginationMargin); + bottomIncludeBody = + wrapHeight - formHeight - headerCellHeight - tablePadding - paginationMargin; + } else { + // Table height from bottom + bottomIncludeBody = getViewportOffset(headEl).bottomIncludeBody; + } + + let height = + bottomIncludeBody - + (resizeHeightOffset || 0) - + paddingHeight - + paginationHeight - + footerHeight - + headerHeight; + height = (height > maxHeight! ? (maxHeight as number) : height) ?? height; + setHeight(height); + + bodyEl!.style.height = `${height}px`; + } + useWindowSizeFn(calcTableHeight, 280); + onMountedOrActivated(() => { + calcTableHeight(); + nextTick(() => { + debounceRedoHeight(); + }); + }); + + const getScrollX = computed(() => { + let width = 0; + if (unref(rowSelectionRef)) { + width += 60; + } + + // TODO props ?? 0; + const NORMAL_WIDTH = 150; + + const columns = unref(columnsRef).filter((item) => !item.defaultHidden); + columns.forEach((item) => { + width += Number.parseFloat(item.width as string) || 0; + }); + const unsetWidthColumns = columns.filter((item) => !Reflect.has(item, 'width')); + + const len = unsetWidthColumns.length; + if (len !== 0) { + width += len * NORMAL_WIDTH; + } + + const table = unref(tableElRef); + const tableWidth = table?.$el?.offsetWidth ?? 0; + return tableWidth > width ? '100%' : width; + }); + + const getScrollRef = computed(() => { + const tableHeight = unref(tableHeightRef); + const { canResize, scroll } = unref(propsRef); + return { + x: unref(getScrollX), + y: canResize ? tableHeight : null, + scrollToFirstRowOnChange: false, + ...scroll, + }; + }); + + return { getScrollRef, redoHeight }; +} diff --git a/monolithic/frontend/src/components/Table/src/hooks/useTableStyle.ts b/monolithic/frontend/src/components/Table/src/hooks/useTableStyle.ts new file mode 100644 index 0000000..292187d --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/hooks/useTableStyle.ts @@ -0,0 +1,20 @@ +import type { ComputedRef } from 'vue'; +import type { BasicTableProps, TableCustomRecord } from '../types/table'; +import { unref } from 'vue'; +import { isFunction } from '/@/utils/is'; + +export function useTableStyle(propsRef: ComputedRef, prefixCls: string) { + function getRowClassName(record: TableCustomRecord, index: number) { + const { striped, rowClassName } = unref(propsRef); + const classNames: string[] = []; + if (striped) { + classNames.push((index || 0) % 2 === 1 ? `${prefixCls}-row__striped` : ''); + } + if (rowClassName && isFunction(rowClassName)) { + classNames.push(rowClassName(record, index)); + } + return classNames.filter((cls) => !!cls).join(' '); + } + + return { getRowClassName }; +} diff --git a/monolithic/frontend/src/components/Table/src/props.ts b/monolithic/frontend/src/components/Table/src/props.ts new file mode 100644 index 0000000..20e0209 --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/props.ts @@ -0,0 +1,151 @@ +import type { PropType } from 'vue'; +import type { PaginationProps } from './types/pagination'; +import type { + BasicColumn, + FetchSetting, + TableSetting, + SorterResult, + TableCustomRecord, + TableRowSelection, + SizeType, +} from './types/table'; +import type { FormProps } from '/@/components/Form'; + +import { DEFAULT_FILTER_FN, DEFAULT_SORT_FN, FETCH_SETTING, DEFAULT_SIZE } from './const'; +import { propTypes } from '/@/utils/propTypes'; + +export const basicProps = { + clickToRowSelect: { type: Boolean, default: true }, + isTreeTable: Boolean, + tableSetting: propTypes.shape({}), + inset: Boolean, + sortFn: { + type: Function as PropType<(sortInfo: SorterResult) => any>, + default: DEFAULT_SORT_FN, + }, + filterFn: { + type: Function as PropType<(data: Partial>) => any>, + default: DEFAULT_FILTER_FN, + }, + showTableSetting: Boolean, + autoCreateKey: { type: Boolean, default: true }, + striped: { type: Boolean, default: true }, + showSummary: Boolean, + summaryFunc: { + type: [Function, Array] as PropType<(...arg: any[]) => any[]>, + default: null, + }, + summaryData: { + type: Array as PropType, + default: null, + }, + indentSize: propTypes.number.def(24), + canColDrag: { type: Boolean, default: true }, + api: { + type: Function as PropType<(...arg: any[]) => Promise>, + default: null, + }, + beforeFetch: { + type: Function as PropType, + default: null, + }, + afterFetch: { + type: Function as PropType, + default: null, + }, + handleSearchInfoFn: { + type: Function as PropType, + default: null, + }, + fetchSetting: { + type: Object as PropType, + default: () => { + return FETCH_SETTING; + }, + }, + // 立即请求接口 + immediate: { type: Boolean, default: true }, + emptyDataIsShowTable: { type: Boolean, default: true }, + // 额外的请求参数 + searchInfo: { + type: Object as PropType, + default: null, + }, + // 默认的排序参数 + defSort: { + type: Object as PropType, + default: null, + }, + // 使用搜索表单 + useSearchForm: propTypes.bool, + // 表单配置 + formConfig: { + type: Object as PropType>, + default: null, + }, + columns: { + type: [Array] as PropType, + default: () => [], + }, + showIndexColumn: { type: Boolean, default: true }, + indexColumnProps: { + type: Object as PropType, + default: null, + }, + actionColumn: { + type: Object as PropType, + default: null, + }, + ellipsis: { type: Boolean, default: true }, + isCanResizeParent: { type: Boolean, default: false }, + canResize: { type: Boolean, default: true }, + clearSelectOnPageChange: propTypes.bool, + resizeHeightOffset: propTypes.number.def(0), + rowSelection: { + type: Object as PropType, + default: null, + }, + title: { + type: [String, Function] as PropType string)>, + default: null, + }, + titleHelpMessage: { + type: [String, Array] as PropType, + }, + maxHeight: propTypes.number, + dataSource: { + type: Array as PropType, + default: null, + }, + rowKey: { + type: [String, Function] as PropType string)>, + default: '', + }, + bordered: propTypes.bool, + pagination: { + type: [Object, Boolean] as PropType, + default: null, + }, + loading: propTypes.bool, + rowClassName: { + type: Function as PropType<(record: TableCustomRecord, index: number) => string>, + }, + scroll: { + type: Object as PropType<{ x: number | true; y: number }>, + default: null, + }, + beforeEditSubmit: { + type: Function as PropType< + (data: { + record: Recordable; + index: number; + key: string | number; + value: any; + }) => Promise + >, + }, + size: { + type: String as PropType, + default: DEFAULT_SIZE, + }, +}; diff --git a/monolithic/frontend/src/components/Table/src/types/column.ts b/monolithic/frontend/src/components/Table/src/types/column.ts new file mode 100644 index 0000000..785e6df --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/types/column.ts @@ -0,0 +1,198 @@ +import { VNodeChild } from 'vue'; + +export interface ColumnFilterItem { + text?: string; + value?: string; + children?: any; +} + +export declare type SortOrder = 'ascend' | 'descend'; + +export interface RecordProps { + text: any; + record: T; + index: number; +} + +export interface FilterDropdownProps { + prefixCls?: string; + setSelectedKeys?: (selectedKeys: string[]) => void; + selectedKeys?: string[]; + confirm?: () => void; + clearFilters?: () => void; + filters?: ColumnFilterItem[]; + getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement; + visible?: boolean; +} + +export declare type CustomRenderFunction = (record: RecordProps) => VNodeChild | JSX.Element; + +export interface ColumnProps { + /** + * specify how content is aligned + * @default 'left' + * @type string + */ + align?: 'left' | 'right' | 'center'; + + /** + * ellipsize cell content, not working with sorter and filters for now. + * tableLayout would be fixed when ellipsis is true. + * @default false + * @type boolean + */ + ellipsis?: boolean; + + /** + * Span of this column's title + * @type number + */ + colSpan?: number; + + /** + * Display field of the data record, could be set like a.b.c + * @type string + */ + dataIndex?: string; + + /** + * Default filtered values + * @type string[] + */ + defaultFilteredValue?: string[]; + + /** + * Default order of sorted values: 'ascend' 'descend' null + * @type string + */ + defaultSortOrder?: SortOrder; + + /** + * Customized filter overlay + * @type any (slot) + */ + filterDropdown?: + | VNodeChild + | JSX.Element + | ((props: FilterDropdownProps) => VNodeChild | JSX.Element); + + /** + * Whether filterDropdown is visible + * @type boolean + */ + filterDropdownVisible?: boolean; + + /** + * Whether the dataSource is filtered + * @default false + * @type boolean + */ + filtered?: boolean; + + /** + * Controlled filtered value, filter icon will highlight + * @type string[] + */ + filteredValue?: string[]; + + /** + * Customized filter icon + * @default false + * @type any + */ + filterIcon?: boolean | VNodeChild | JSX.Element; + + /** + * Whether multiple filters can be selected + * @default true + * @type boolean + */ + filterMultiple?: boolean; + + /** + * Filter menu config + * @type object[] + */ + filters?: ColumnFilterItem[]; + + /** + * Set column to be fixed: true(same as left) 'left' 'right' + * @default false + * @type boolean | string + */ + fixed?: boolean | 'left' | 'right'; + + /** + * Unique key of this column, you can ignore this prop if you've set a unique dataIndex + * @type string + */ + key?: string; + + /** + * Renderer of the table cell. The return value should be a VNode, or an object for colSpan/rowSpan config + * @type Function | ScopedSlot + */ + customRender?: CustomRenderFunction | VNodeChild | JSX.Element; + + /** + * Sort function for local sort, see Array.sort's compareFunction. If you need sort buttons only, set to true + * @type boolean | Function + */ + sorter?: boolean | Function; + + /** + * Order of sorted values: 'ascend' 'descend' false + * @type boolean | string + */ + sortOrder?: boolean | SortOrder; + + /** + * supported sort way, could be 'ascend', 'descend' + * @default ['ascend', 'descend'] + * @type string[] + */ + sortDirections?: SortOrder[]; + + /** + * Title of this column + * @type any (string | slot) + */ + title?: VNodeChild | JSX.Element; + + /** + * Width of this column + * @type string | number + */ + width?: string | number; + + /** + * Set props on per cell + * @type Function + */ + customCell?: (record: T, rowIndex: number) => object; + + /** + * Set props on per header cell + * @type object + */ + customHeaderCell?: (column: ColumnProps) => object; + + /** + * Callback executed when the confirm filter button is clicked, Use as a filter event when using template or jsx + * @type Function + */ + onFilter?: (value: any, record: T) => boolean; + + /** + * Callback executed when filterDropdownVisible is changed, Use as a filterDropdownVisible event when using template or jsx + * @type Function + */ + onFilterDropdownVisibleChange?: (visible: boolean) => void; + + /** + * When using columns, you can setting this property to configure the properties that support the slot, + * such as slots: { filterIcon: 'XXX'} + * @type object + */ + slots?: Recordable; +} diff --git a/monolithic/frontend/src/components/Table/src/types/componentType.ts b/monolithic/frontend/src/components/Table/src/types/componentType.ts new file mode 100644 index 0000000..a683f1d --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/types/componentType.ts @@ -0,0 +1,11 @@ +export type ComponentType = + | 'Input' + | 'InputNumber' + | 'Select' + | 'ApiSelect' + | 'AutoComplete' + | 'ApiTreeSelect' + | 'Checkbox' + | 'Switch' + | 'DatePicker' + | 'TimePicker'; diff --git a/monolithic/frontend/src/components/Table/src/types/pagination.ts b/monolithic/frontend/src/components/Table/src/types/pagination.ts new file mode 100644 index 0000000..c705f33 --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/types/pagination.ts @@ -0,0 +1,115 @@ +import Pagination from 'ant-design-vue/lib/pagination'; +import { VNodeChild } from 'vue'; + +interface PaginationRenderProps { + page: number; + type: 'page' | 'prev' | 'next'; + originalElement: any; +} + +type PaginationPositon = + | 'topLeft' + | 'topCenter' + | 'topRight' + | 'bottomLeft' + | 'bottomCenter' + | 'bottomRight'; + +export declare class PaginationConfig extends Pagination { + position?: PaginationPositon[]; +} + +export interface PaginationProps { + /** + * total number of data items + * @default 0 + * @type number + */ + total?: number; + + /** + * default initial page number + * @default 1 + * @type number + */ + defaultCurrent?: number; + + /** + * current page number + * @type number + */ + current?: number; + + /** + * default number of data items per page + * @default 10 + * @type number + */ + defaultPageSize?: number; + + /** + * number of data items per page + * @type number + */ + pageSize?: number; + + /** + * Whether to hide pager on single page + * @default false + * @type boolean + */ + hideOnSinglePage?: boolean; + + /** + * determine whether pageSize can be changed + * @default false + * @type boolean + */ + showSizeChanger?: boolean; + + /** + * specify the sizeChanger options + * @default ['10', '20', '30', '40'] + * @type string[] + */ + pageSizeOptions?: string[]; + + /** + * determine whether you can jump to pages directly + * @default false + * @type boolean + */ + showQuickJumper?: boolean | object; + + /** + * to display the total number and range + * @type Function + */ + showTotal?: (total: number, range: [number, number]) => any; + + /** + * specify the size of Pagination, can be set to small + * @default '' + * @type string + */ + size?: string; + + /** + * whether to setting simple mode + * @type boolean + */ + simple?: boolean; + + /** + * to customize item innerHTML + * @type Function + */ + itemRender?: (props: PaginationRenderProps) => VNodeChild | JSX.Element; + + /** + * specify the position of Pagination + * @default ['bottomRight'] + * @type string[] + */ + position?: PaginationPositon[]; +} diff --git a/monolithic/frontend/src/components/Table/src/types/table.ts b/monolithic/frontend/src/components/Table/src/types/table.ts new file mode 100644 index 0000000..ad16249 --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/types/table.ts @@ -0,0 +1,478 @@ +import type { VNodeChild } from 'vue'; +import type { PaginationProps } from './pagination'; +import type { FormProps } from '/@/components/Form'; +import type { TableRowSelection as ITableRowSelection } from 'ant-design-vue/lib/table/interface'; +import type { ColumnProps } from 'ant-design-vue/lib/table'; + +import { ComponentType } from './componentType'; +import { VueNode } from '/@/utils/propTypes'; +import { RoleEnum } from '/@/enums/roleEnum'; + +export declare type SortOrder = 'ascend' | 'descend'; + +export interface TableCurrentDataSource { + currentDataSource: T[]; +} + +export interface TableRowSelection extends ITableRowSelection { + /** + * Callback executed when selected rows change + * @type Function + */ + onChange?: (selectedRowKeys: string[] | number[], selectedRows: T[]) => any; + + /** + * Callback executed when select/deselect one row + * @type Function + */ + onSelect?: (record: T, selected: boolean, selectedRows: Object[], nativeEvent: Event) => any; + + /** + * Callback executed when select/deselect all rows + * @type Function + */ + onSelectAll?: (selected: boolean, selectedRows: T[], changeRows: T[]) => any; + + /** + * Callback executed when row selection is inverted + * @type Function + */ + onSelectInvert?: (selectedRows: string[] | number[]) => any; +} + +export interface TableCustomRecord { + record?: T; + index?: number; +} + +export interface ExpandedRowRenderRecord extends TableCustomRecord { + indent?: number; + expanded?: boolean; +} +export interface ColumnFilterItem { + text?: string; + value?: string; + children?: any; +} + +export interface TableCustomRecord { + record?: T; + index?: number; +} + +export interface SorterResult { + column: ColumnProps; + order: SortOrder; + field: string; + columnKey: string; +} + +export interface FetchParams { + searchInfo?: Recordable; + page?: number; + sortInfo?: Recordable; + filterInfo?: Recordable; +} + +export interface GetColumnsParams { + ignoreIndex?: boolean; + ignoreAction?: boolean; + sort?: boolean; +} + +export type SizeType = 'default' | 'middle' | 'small' | 'large'; + +export interface TableActionType { + reload: (opt?: FetchParams) => Promise; + getSelectRows: () => T[]; + clearSelectedRowKeys: () => void; + expandAll: () => void; + expandRows: (keys: string[]) => void; + collapseAll: () => void; + scrollTo: (pos: string) => void; // pos: id | "top" | "bottom" + getSelectRowKeys: () => string[]; + deleteSelectRowByKey: (key: string) => void; + setPagination: (info: Partial) => void; + setTableData: (values: T[]) => void; + updateTableDataRecord: (rowKey: string | number, record: Recordable) => Recordable | void; + deleteTableDataRecord: (rowKey: string | number | string[] | number[]) => void; + insertTableDataRecord: (record: Recordable, index?: number) => Recordable | void; + findTableDataRecord: (rowKey: string | number) => Recordable | void; + getColumns: (opt?: GetColumnsParams) => BasicColumn[]; + setColumns: (columns: BasicColumn[] | string[]) => void; + getDataSource: () => T[]; + getRawDataSource: () => T; + setLoading: (loading: boolean) => void; + setProps: (props: Partial) => void; + redoHeight: () => void; + setSelectedRowKeys: (rowKeys: string[] | number[]) => void; + getPaginationRef: () => PaginationProps | boolean; + getSize: () => SizeType; + getRowSelection: () => TableRowSelection; + getCacheColumns: () => BasicColumn[]; + emit?: EmitType; + updateTableData: (index: number, key: string, value: any) => Recordable; + setShowPagination: (show: boolean) => Promise; + getShowPagination: () => boolean; + setCacheColumnsByField?: (dataIndex: string | undefined, value: BasicColumn) => void; +} + +export interface FetchSetting { + // 请求接口当前页数 + pageField: string; + // 每页显示多少条 + sizeField: string; + // 请求结果列表字段 支持 a.b.c + listField: string; + // 请求结果总数字段 支持 a.b.c + totalField: string; +} + +export interface TableSetting { + redo?: boolean; + size?: boolean; + setting?: boolean; + fullScreen?: boolean; +} + +export interface BasicTableProps { + // 点击行选中 + clickToRowSelect?: boolean; + isTreeTable?: boolean; + // 自定义排序方法 + sortFn?: (sortInfo: SorterResult) => any; + // 排序方法 + filterFn?: (data: Partial>) => any; + // 取消表格的默认padding + inset?: boolean; + // 显示表格设置 + showTableSetting?: boolean; + tableSetting?: TableSetting; + // 斑马纹 + striped?: boolean; + // 是否自动生成key + autoCreateKey?: boolean; + // 计算合计行的方法 + summaryFunc?: (...arg: any) => Recordable[]; + // 自定义合计表格内容 + summaryData?: Recordable[]; + // 是否显示合计行 + showSummary?: boolean; + // 是否可拖拽列 + canColDrag?: boolean; + // 接口请求对象 + api?: (...arg: any) => Promise; + // 请求之前处理参数 + beforeFetch?: Fn; + // 自定义处理接口返回参数 + afterFetch?: Fn; + // 查询条件请求之前处理 + handleSearchInfoFn?: Fn; + // 请求接口配置 + fetchSetting?: Partial; + // 立即请求接口 + immediate?: boolean; + // 在开起搜索表单的时候,如果没有数据是否显示表格 + emptyDataIsShowTable?: boolean; + // 额外的请求参数 + searchInfo?: Recordable; + // 默认的排序参数 + defSort?: Recordable; + // 使用搜索表单 + useSearchForm?: boolean; + // 表单配置 + formConfig?: Partial; + // 列配置 + columns: BasicColumn[]; + // 是否显示序号列 + showIndexColumn?: boolean; + // 序号列配置 + indexColumnProps?: BasicColumn; + actionColumn?: BasicColumn; + // 文本超过宽度是否显示。。。 + ellipsis?: boolean; + // 是否继承父级高度(父级高度-表单高度-padding高度) + isCanResizeParent?: boolean; + // 是否可以自适应高度 + canResize?: boolean; + // 自适应高度偏移, 计算结果-偏移量 + resizeHeightOffset?: number; + + // 在分页改变的时候清空选项 + clearSelectOnPageChange?: boolean; + // + rowKey?: string | ((record: Recordable) => string); + // 数据 + dataSource?: Recordable[]; + // 标题右侧提示 + titleHelpMessage?: string | string[]; + // 表格滚动最大高度 + maxHeight?: number; + // 是否显示边框 + bordered?: boolean; + // 分页配置 + pagination?: PaginationProps | boolean; + // loading加载 + loading?: boolean; + + /** + * The column contains children to display + * @default 'children' + * @type string | string[] + */ + childrenColumnName?: string; + + /** + * Override default table elements + * @type object + */ + components?: object; + + /** + * Expand all rows initially + * @default false + * @type boolean + */ + defaultExpandAllRows?: boolean; + + /** + * Initial expanded row keys + * @type string[] + */ + defaultExpandedRowKeys?: string[]; + + /** + * Current expanded row keys + * @type string[] + */ + expandedRowKeys?: string[]; + + /** + * Expanded container render for each row + * @type Function + */ + expandedRowRender?: (record?: ExpandedRowRenderRecord) => VNodeChild | JSX.Element; + + /** + * Customize row expand Icon. + * @type Function | VNodeChild + */ + expandIcon?: Function | VNodeChild | JSX.Element; + + /** + * Whether to expand row by clicking anywhere in the whole row + * @default false + * @type boolean + */ + expandRowByClick?: boolean; + + /** + * The index of `expandIcon` which column will be inserted when `expandIconAsCell` is false. default 0 + */ + expandIconColumnIndex?: number; + + /** + * Table footer renderer + * @type Function | VNodeChild + */ + footer?: Function | VNodeChild | JSX.Element; + + /** + * Indent size in pixels of tree data + * @default 15 + * @type number + */ + indentSize?: number; + + /** + * i18n text including filter, sort, empty text, etc + * @default { filterConfirm: 'Ok', filterReset: 'Reset', emptyText: 'No Data' } + * @type object + */ + locale?: object; + + /** + * Row's className + * @type Function + */ + rowClassName?: (record: TableCustomRecord, index: number) => string; + + /** + * Row selection config + * @type object + */ + rowSelection?: TableRowSelection; + + /** + * Set horizontal or vertical scrolling, can also be used to specify the width and height of the scroll area. + * It is recommended to set a number for x, if you want to set it to true, + * you need to add style .ant-table td { white-space: nowrap; }. + * @type object + */ + scroll?: { x?: number | true; y?: number }; + + /** + * Whether to show table header + * @default true + * @type boolean + */ + showHeader?: boolean; + + /** + * Size of table + * @default 'default' + * @type string + */ + size?: SizeType; + + /** + * Table title renderer + * @type Function | ScopedSlot + */ + title?: VNodeChild | JSX.Element | string | ((data: Recordable) => string); + + /** + * Set props on per header row + * @type Function + */ + customHeaderRow?: (column: ColumnProps, index: number) => object; + + /** + * Set props on per row + * @type Function + */ + customRow?: (record: T, index: number) => object; + + /** + * `table-layout` attribute of table element + * `fixed` when header/columns are fixed, or using `column.ellipsis` + * + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/table-layout + * @version 1.5.0 + */ + tableLayout?: 'auto' | 'fixed' | string; + + /** + * the render container of dropdowns in table + * @param triggerNode + * @version 1.5.0 + */ + getPopupContainer?: (triggerNode?: HTMLElement) => HTMLElement; + + /** + * Data can be changed again before rendering. + * The default configuration of general user empty data. + * You can configured globally through [ConfigProvider](https://antdv.com/components/config-provider-cn/) + * + * @version 1.5.4 + */ + transformCellText?: Function; + + /** + * Callback executed before editable cell submit value, not for row-editor + * + * The cell will not submit data while callback return false + */ + beforeEditSubmit?: (data: { + record: Recordable; + index: number; + key: string | number; + value: any; + }) => Promise; + + /** + * Callback executed when pagination, filters or sorter is changed + * @param pagination + * @param filters + * @param sorter + * @param currentDataSource + */ + onChange?: (pagination: any, filters: any, sorter: any, extra: any) => void; + + /** + * Callback executed when the row expand icon is clicked + * + * @param expanded + * @param record + */ + onExpand?: (expande: boolean, record: T) => void; + + /** + * Callback executed when the expanded rows change + * @param expandedRows + */ + onExpandedRowsChange?: (expandedRows: string[] | number[]) => void; + + onColumnsChange?: (data: ColumnChangeParam[]) => void; +} + +export type CellFormat = + | string + | ((text: string, record: Recordable, index: number) => string | number) + | Map; + +// @ts-ignore +export interface BasicColumn extends ColumnProps { + children?: BasicColumn[]; + filters?: { + text: string; + value: string; + children?: + | unknown[] + | (((props: Record) => unknown[]) & (() => unknown[]) & (() => unknown[])); + }[]; + + // + flag?: 'INDEX' | 'DEFAULT' | 'CHECKBOX' | 'RADIO' | 'ACTION'; + customTitle?: VueNode; + + slots?: Recordable; + + // Whether to hide the column by default, it can be displayed in the column configuration + defaultHidden?: boolean; + + // Help text for table column header + helpMessage?: string | string[]; + + format?: CellFormat; + + // Editable + edit?: boolean; + editRow?: boolean; + editable?: boolean; + editComponent?: ComponentType; + editComponentProps?: + | ((opt: { + text: string | number | boolean | Recordable; + record: Recordable; + column: BasicColumn; + index: number; + }) => Recordable) + | Recordable; + editRule?: boolean | ((text: string, record: Recordable) => Promise); + editValueMap?: (value: any) => string; + onEditRow?: () => void; + // 权限编码控制是否显示 + auth?: RoleEnum | RoleEnum[] | string | string[]; + // 业务控制是否显示 + ifShow?: boolean | ((column: BasicColumn) => boolean); + // 自定义修改后显示的内容 + editRender?: (opt: { + text: string | number | boolean | Recordable; + record: Recordable; + column: BasicColumn; + index: number; + }) => VNodeChild | JSX.Element; + // 动态 Disabled + editDynamicDisabled?: boolean | ((record: Recordable) => boolean); +} + +export type ColumnChangeParam = { + dataIndex: string; + fixed: boolean | 'left' | 'right' | undefined; + visible: boolean; +}; + +export interface InnerHandlers { + onColumnsChange: (data: ColumnChangeParam[]) => void; +} diff --git a/monolithic/frontend/src/components/Table/src/types/tableAction.ts b/monolithic/frontend/src/components/Table/src/types/tableAction.ts new file mode 100644 index 0000000..028cf80 --- /dev/null +++ b/monolithic/frontend/src/components/Table/src/types/tableAction.ts @@ -0,0 +1,39 @@ +import { ButtonProps } from 'ant-design-vue/es/button/buttonTypes'; +import { TooltipProps } from 'ant-design-vue/es/tooltip/Tooltip'; +import { RoleEnum } from '/@/enums/roleEnum'; +export interface ActionItem extends ButtonProps { + onClick?: Fn; + label?: string; + color?: 'success' | 'error' | 'warning'; + icon?: string; + popConfirm?: PopConfirm; + disabled?: boolean; + divider?: boolean; + // 权限编码控制是否显示 + auth?: RoleEnum | RoleEnum[] | string | string[]; + // 业务控制是否显示 + ifShow?: boolean | ((action: ActionItem) => boolean); + tooltip?: string | TooltipProps; +} + +export interface PopConfirm { + title: string; + okText?: string; + cancelText?: string; + confirm: Fn; + cancel?: Fn; + icon?: string; + placement?: + | 'top' + | 'left' + | 'right' + | 'bottom' + | 'topLeft' + | 'topRight' + | 'leftTop' + | 'leftBottom' + | 'rightTop' + | 'rightBottom' + | 'bottomLeft' + | 'bottomRight'; +} diff --git a/monolithic/frontend/src/components/Time/index.ts b/monolithic/frontend/src/components/Time/index.ts new file mode 100644 index 0000000..7e2f4c0 --- /dev/null +++ b/monolithic/frontend/src/components/Time/index.ts @@ -0,0 +1,4 @@ +import { withInstall } from '/@/utils/index'; +import time from './src/Time.vue'; + +export const Time = withInstall(time); diff --git a/monolithic/frontend/src/components/Time/src/Time.vue b/monolithic/frontend/src/components/Time/src/Time.vue new file mode 100644 index 0000000..2789368 --- /dev/null +++ b/monolithic/frontend/src/components/Time/src/Time.vue @@ -0,0 +1,108 @@ + + diff --git a/monolithic/frontend/src/components/Tinymce/index.ts b/monolithic/frontend/src/components/Tinymce/index.ts new file mode 100644 index 0000000..ce07f95 --- /dev/null +++ b/monolithic/frontend/src/components/Tinymce/index.ts @@ -0,0 +1,4 @@ +import { withInstall } from '/@/utils/index'; +import tinymce from './src/Editor.vue'; + +export const Tinymce = withInstall(tinymce); diff --git a/monolithic/frontend/src/components/Tinymce/src/Editor.vue b/monolithic/frontend/src/components/Tinymce/src/Editor.vue new file mode 100644 index 0000000..b84c5fb --- /dev/null +++ b/monolithic/frontend/src/components/Tinymce/src/Editor.vue @@ -0,0 +1,346 @@ + + + + + + + diff --git a/monolithic/frontend/src/components/Tinymce/src/ImgUpload.vue b/monolithic/frontend/src/components/Tinymce/src/ImgUpload.vue new file mode 100644 index 0000000..f878709 --- /dev/null +++ b/monolithic/frontend/src/components/Tinymce/src/ImgUpload.vue @@ -0,0 +1,96 @@ + + + diff --git a/monolithic/frontend/src/components/Tinymce/src/helper.ts b/monolithic/frontend/src/components/Tinymce/src/helper.ts new file mode 100644 index 0000000..2526ae7 --- /dev/null +++ b/monolithic/frontend/src/components/Tinymce/src/helper.ts @@ -0,0 +1,81 @@ +const validEvents = [ + 'onActivate', + 'onAddUndo', + 'onBeforeAddUndo', + 'onBeforeExecCommand', + 'onBeforeGetContent', + 'onBeforeRenderUI', + 'onBeforeSetContent', + 'onBeforePaste', + 'onBlur', + 'onChange', + 'onClearUndos', + 'onClick', + 'onContextMenu', + 'onCopy', + 'onCut', + 'onDblclick', + 'onDeactivate', + 'onDirty', + 'onDrag', + 'onDragDrop', + 'onDragEnd', + 'onDragGesture', + 'onDragOver', + 'onDrop', + 'onExecCommand', + 'onFocus', + 'onFocusIn', + 'onFocusOut', + 'onGetContent', + 'onHide', + 'onInit', + 'onKeyDown', + 'onKeyPress', + 'onKeyUp', + 'onLoadContent', + 'onMouseDown', + 'onMouseEnter', + 'onMouseLeave', + 'onMouseMove', + 'onMouseOut', + 'onMouseOver', + 'onMouseUp', + 'onNodeChange', + 'onObjectResizeStart', + 'onObjectResized', + 'onObjectSelected', + 'onPaste', + 'onPostProcess', + 'onPostRender', + 'onPreProcess', + 'onProgressState', + 'onRedo', + 'onRemove', + 'onReset', + 'onSaveContent', + 'onSelectionChange', + 'onSetAttrib', + 'onSetContent', + 'onShow', + 'onSubmit', + 'onUndo', + 'onVisualAid', +]; + +const isValidKey = (key: string) => validEvents.indexOf(key) !== -1; + +export const bindHandlers = (initEvent: Event, listeners: any, editor: any): void => { + Object.keys(listeners) + .filter(isValidKey) + .forEach((key: string) => { + const handler = listeners[key]; + if (typeof handler === 'function') { + if (key === 'onInit') { + handler(initEvent, editor); + } else { + editor.on(key.substring(2), (e: any) => handler(e, editor)); + } + } + }); +}; diff --git a/monolithic/frontend/src/components/Tinymce/src/tinymce.ts b/monolithic/frontend/src/components/Tinymce/src/tinymce.ts new file mode 100644 index 0000000..1374b4d --- /dev/null +++ b/monolithic/frontend/src/components/Tinymce/src/tinymce.ts @@ -0,0 +1,13 @@ +// Any plugins you want to setting has to be imported +// Detail plugins list see https://www.tinymce.com/docs/plugins/ +// Custom builds see https://www.tinymce.com/download/custom-builds/ +// colorpicker/contextmenu/textcolor plugin is now built in to the core editor, please remove it from your editor configuration + +export const plugins = [ + 'advlist anchor autolink autosave code codesample directionality fullscreen hr insertdatetime link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace spellchecker tabfocus template textpattern visualblocks visualchars wordcount', +]; + +export const toolbar = [ + 'fontsizeselect lineheight searchreplace bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript code codesample', + 'hr bullist numlist link preview anchor pagebreak insertdatetime media forecolor backcolor fullscreen', +]; diff --git a/monolithic/frontend/src/components/Transition/index.ts b/monolithic/frontend/src/components/Transition/index.ts new file mode 100644 index 0000000..7eb79b5 --- /dev/null +++ b/monolithic/frontend/src/components/Transition/index.ts @@ -0,0 +1,27 @@ +import { createSimpleTransition, createJavascriptTransition } from './src/CreateTransition'; + +import ExpandTransitionGenerator from './src/ExpandTransition'; + +export { default as CollapseTransition } from './src/CollapseTransition.vue'; + +export const FadeTransition = createSimpleTransition('fade-transition'); +export const ScaleTransition = createSimpleTransition('scale-transition'); +export const SlideYTransition = createSimpleTransition('slide-y-transition'); +export const ScrollYTransition = createSimpleTransition('scroll-y-transition'); +export const SlideYReverseTransition = createSimpleTransition('slide-y-reverse-transition'); +export const ScrollYReverseTransition = createSimpleTransition('scroll-y-reverse-transition'); +export const SlideXTransition = createSimpleTransition('slide-x-transition'); +export const ScrollXTransition = createSimpleTransition('scroll-x-transition'); +export const SlideXReverseTransition = createSimpleTransition('slide-x-reverse-transition'); +export const ScrollXReverseTransition = createSimpleTransition('scroll-x-reverse-transition'); +export const ScaleRotateTransition = createSimpleTransition('scale-rotate-transition'); + +export const ExpandXTransition = createJavascriptTransition( + 'expand-x-transition', + ExpandTransitionGenerator('', true), +); + +export const ExpandTransition = createJavascriptTransition( + 'expand-transition', + ExpandTransitionGenerator(''), +); diff --git a/monolithic/frontend/src/components/Transition/src/CollapseTransition.vue b/monolithic/frontend/src/components/Transition/src/CollapseTransition.vue new file mode 100644 index 0000000..6b50fa1 --- /dev/null +++ b/monolithic/frontend/src/components/Transition/src/CollapseTransition.vue @@ -0,0 +1,78 @@ + + diff --git a/monolithic/frontend/src/components/Transition/src/CreateTransition.tsx b/monolithic/frontend/src/components/Transition/src/CreateTransition.tsx new file mode 100644 index 0000000..d12518d --- /dev/null +++ b/monolithic/frontend/src/components/Transition/src/CreateTransition.tsx @@ -0,0 +1,73 @@ +import type { PropType } from 'vue'; + +import { defineComponent, Transition, TransitionGroup } from 'vue'; +import { getSlot } from '/@/utils/helper/tsxHelper'; + +type Mode = 'in-out' | 'out-in' | 'default' | undefined; + +export function createSimpleTransition(name: string, origin = 'top center 0', mode?: Mode) { + return defineComponent({ + name, + props: { + group: { + type: Boolean as PropType, + default: false, + }, + mode: { + type: String as PropType, + default: mode, + }, + origin: { + type: String as PropType, + default: origin, + }, + }, + setup(props, { slots, attrs }) { + const onBeforeEnter = (el: HTMLElement) => { + el.style.transformOrigin = props.origin; + }; + + return () => { + const Tag = !props.group ? Transition : TransitionGroup; + return ( + + {() => getSlot(slots)} + + ); + }; + }, + }); +} +export function createJavascriptTransition( + name: string, + functions: Recordable, + mode: Mode = 'in-out', +) { + return defineComponent({ + name, + props: { + mode: { + type: String as PropType, + default: mode, + }, + }, + setup(props, { attrs, slots }) { + return () => { + return ( + + {() => getSlot(slots)} + + ); + }; + }, + }); +} diff --git a/monolithic/frontend/src/components/Transition/src/ExpandTransition.ts b/monolithic/frontend/src/components/Transition/src/ExpandTransition.ts new file mode 100644 index 0000000..2aaef9a --- /dev/null +++ b/monolithic/frontend/src/components/Transition/src/ExpandTransition.ts @@ -0,0 +1,89 @@ +/** + * Makes the first character of a string uppercase + */ +export function upperFirst(str: string): string { + return str.charAt(0).toUpperCase() + str.slice(1); +} + +interface HTMLExpandElement extends HTMLElement { + _parent?: (Node & ParentNode & HTMLElement) | null; + _initialStyle: { + transition: string; + overflow: string | null; + height?: string | null; + width?: string | null; + }; +} + +export default function (expandedParentClass = '', x = false) { + const sizeProperty = x ? 'width' : ('height' as 'width' | 'height'); + const offsetProperty = `offset${upperFirst(sizeProperty)}` as 'offsetHeight' | 'offsetWidth'; + + return { + beforeEnter(el: HTMLExpandElement) { + el._parent = el.parentNode as (Node & ParentNode & HTMLElement) | null; + el._initialStyle = { + transition: el.style.transition, + overflow: el.style.overflow, + [sizeProperty]: el.style[sizeProperty], + }; + }, + + enter(el: HTMLExpandElement) { + const initialStyle = el._initialStyle; + + el.style.setProperty('transition', 'none', 'important'); + el.style.overflow = 'hidden'; + // const offset = `${el[offsetProperty]}px`; + + // el.style[sizeProperty] = '0'; + + void el.offsetHeight; // force reflow + + el.style.transition = initialStyle.transition; + + if (expandedParentClass && el._parent) { + el._parent.classList.add(expandedParentClass); + } + + requestAnimationFrame(() => { + // el.style[sizeProperty] = offset; + }); + }, + + afterEnter: resetStyles, + enterCancelled: resetStyles, + + leave(el: HTMLExpandElement) { + el._initialStyle = { + transition: '', + overflow: el.style.overflow, + [sizeProperty]: el.style[sizeProperty], + }; + + el.style.overflow = 'hidden'; + el.style[sizeProperty] = `${el[offsetProperty]}px`; + /* eslint-disable-next-line */ + void el.offsetHeight; // force reflow + + requestAnimationFrame(() => (el.style[sizeProperty] = '0')); + }, + + afterLeave, + leaveCancelled: afterLeave, + }; + + function afterLeave(el: HTMLExpandElement) { + if (expandedParentClass && el._parent) { + el._parent.classList.remove(expandedParentClass); + } + resetStyles(el); + } + + function resetStyles(el: HTMLExpandElement) { + const size = el._initialStyle[sizeProperty]; + el.style.overflow = el._initialStyle.overflow!; + if (size != null) el.style[sizeProperty] = size; + Reflect.deleteProperty(el, '_initialStyle'); + } +} diff --git a/monolithic/frontend/src/components/Tree/index.ts b/monolithic/frontend/src/components/Tree/index.ts new file mode 100644 index 0000000..169035a --- /dev/null +++ b/monolithic/frontend/src/components/Tree/index.ts @@ -0,0 +1,6 @@ +import BasicTree from './src/BasicTree.vue'; +import './style'; + +export { BasicTree }; +export type { ContextMenuItem } from '/@/hooks/web/useContextMenu'; +export * from './src/types/tree'; diff --git a/monolithic/frontend/src/components/Tree/src/BasicTree.vue b/monolithic/frontend/src/components/Tree/src/BasicTree.vue new file mode 100644 index 0000000..a4af4ae --- /dev/null +++ b/monolithic/frontend/src/components/Tree/src/BasicTree.vue @@ -0,0 +1,455 @@ + diff --git a/monolithic/frontend/src/components/Tree/src/TreeIcon.ts b/monolithic/frontend/src/components/Tree/src/TreeIcon.ts new file mode 100644 index 0000000..900d6bf --- /dev/null +++ b/monolithic/frontend/src/components/Tree/src/TreeIcon.ts @@ -0,0 +1,13 @@ +import type { VNode, FunctionalComponent } from 'vue'; + +import { h } from 'vue'; +import { isString } from '@vue/shared'; +import { Icon } from '/@/components/Icon'; + +export const TreeIcon: FunctionalComponent = ({ icon }: { icon: VNode | string }) => { + if (!icon) return null; + if (isString(icon)) { + return h(Icon, { icon, class: 'mr-1' }); + } + return Icon; +}; diff --git a/monolithic/frontend/src/components/Tree/src/components/TreeHeader.vue b/monolithic/frontend/src/components/Tree/src/components/TreeHeader.vue new file mode 100644 index 0000000..74aac09 --- /dev/null +++ b/monolithic/frontend/src/components/Tree/src/components/TreeHeader.vue @@ -0,0 +1,170 @@ + + diff --git a/monolithic/frontend/src/components/Tree/src/hooks/useTree.ts b/monolithic/frontend/src/components/Tree/src/hooks/useTree.ts new file mode 100644 index 0000000..17345a2 --- /dev/null +++ b/monolithic/frontend/src/components/Tree/src/hooks/useTree.ts @@ -0,0 +1,207 @@ +import type { InsertNodeParams, KeyType, FieldNames, TreeItem } from '../types/tree'; +import type { Ref, ComputedRef } from 'vue'; +import type { TreeDataItem } from 'ant-design-vue/es/tree/Tree'; + +import { cloneDeep } from 'lodash-es'; +import { unref } from 'vue'; +import { forEach } from '/@/utils/helper/treeHelper'; + +export function useTree(treeDataRef: Ref, getFieldNames: ComputedRef) { + function getAllKeys(list?: TreeDataItem[]) { + const keys: string[] = []; + const treeData = list || unref(treeDataRef); + const { key: keyField, children: childrenField } = unref(getFieldNames); + if (!childrenField || !keyField) return keys; + + for (let index = 0; index < treeData.length; index++) { + const node = treeData[index]; + keys.push(node[keyField]!); + const children = node[childrenField]; + if (children && children.length) { + keys.push(...(getAllKeys(children) as string[])); + } + } + return keys as KeyType[]; + } + + // get keys that can be checked and selected + function getEnabledKeys(list?: TreeDataItem[]) { + const keys: string[] = []; + const treeData = list || unref(treeDataRef); + const { key: keyField, children: childrenField } = unref(getFieldNames); + if (!childrenField || !keyField) return keys; + + for (let index = 0; index < treeData.length; index++) { + const node = treeData[index]; + node.disabled !== true && node.selectable !== false && keys.push(node[keyField]!); + const children = node[childrenField]; + if (children && children.length) { + keys.push(...(getEnabledKeys(children) as string[])); + } + } + return keys as KeyType[]; + } + + function getChildrenKeys(nodeKey: string | number, list?: TreeDataItem[]) { + const keys: KeyType[] = []; + const treeData = list || unref(treeDataRef); + const { key: keyField, children: childrenField } = unref(getFieldNames); + if (!childrenField || !keyField) return keys; + for (let index = 0; index < treeData.length; index++) { + const node = treeData[index]; + const children = node[childrenField]; + if (nodeKey === node[keyField]) { + keys.push(node[keyField]!); + if (children && children.length) { + keys.push(...(getAllKeys(children) as string[])); + } + } else { + if (children && children.length) { + keys.push(...getChildrenKeys(nodeKey, children)); + } + } + } + return keys as KeyType[]; + } + + // Update node + function updateNodeByKey(key: string, node: TreeDataItem, list?: TreeDataItem[]) { + if (!key) return; + const treeData = list || unref(treeDataRef); + const { key: keyField, children: childrenField } = unref(getFieldNames); + + if (!childrenField || !keyField) return; + + for (let index = 0; index < treeData.length; index++) { + const element: any = treeData[index]; + const children = element[childrenField]; + + if (element[keyField] === key) { + treeData[index] = { ...treeData[index], ...node }; + break; + } else if (children && children.length) { + updateNodeByKey(key, node, element[childrenField]); + } + } + } + + // Expand the specified level + function filterByLevel(level = 1, list?: TreeDataItem[], currentLevel = 1) { + if (!level) { + return []; + } + const res: (string | number)[] = []; + const data = list || unref(treeDataRef) || []; + for (let index = 0; index < data.length; index++) { + const item = data[index]; + + const { key: keyField, children: childrenField } = unref(getFieldNames); + const key = keyField ? item[keyField] : ''; + const children = childrenField ? item[childrenField] : []; + res.push(key); + if (children && children.length && currentLevel < level) { + currentLevel += 1; + res.push(...filterByLevel(level, children, currentLevel)); + } + } + return res as string[] | number[]; + } + + /** + * 添加节点 + */ + function insertNodeByKey({ parentKey = null, node, push = 'push' }: InsertNodeParams) { + const treeData: any = cloneDeep(unref(treeDataRef)); + if (!parentKey) { + treeData[push](node); + treeDataRef.value = treeData; + return; + } + const { key: keyField, children: childrenField } = unref(getFieldNames); + if (!childrenField || !keyField) return; + + forEach(treeData, (treeItem) => { + if (treeItem[keyField] === parentKey) { + treeItem[childrenField] = treeItem[childrenField] || []; + treeItem[childrenField][push](node); + return true; + } + }); + treeDataRef.value = treeData; + } + /** + * 批量添加节点 + */ + function insertNodesByKey({ parentKey = null, list, push = 'push' }: InsertNodeParams) { + const treeData: any = cloneDeep(unref(treeDataRef)); + if (!list || list.length < 1) { + return; + } + if (!parentKey) { + for (let i = 0; i < list.length; i++) { + treeData[push](list[i]); + } + } else { + const { key: keyField, children: childrenField } = unref(getFieldNames); + if (!childrenField || !keyField) return; + + forEach(treeData, (treeItem) => { + if (treeItem[keyField] === parentKey) { + treeItem[childrenField] = treeItem[childrenField] || []; + for (let i = 0; i < list.length; i++) { + treeItem[childrenField][push](list[i]); + } + treeDataRef.value = treeData; + return true; + } + }); + } + } + // Delete node + function deleteNodeByKey(key: string, list?: TreeDataItem[]) { + if (!key) return; + const treeData = list || unref(treeDataRef); + const { key: keyField, children: childrenField } = unref(getFieldNames); + if (!childrenField || !keyField) return; + + for (let index = 0; index < treeData.length; index++) { + const element: any = treeData[index]; + const children = element[childrenField]; + + if (element[keyField] === key) { + treeData.splice(index, 1); + break; + } else if (children && children.length) { + deleteNodeByKey(key, element[childrenField]); + } + } + } + + // Get selected node + function getSelectedNode(key: KeyType, list?: TreeItem[], selectedNode?: TreeItem | null) { + if (!key && key !== 0) return null; + const treeData = list || unref(treeDataRef); + treeData.forEach((item) => { + if (selectedNode?.key || selectedNode?.key === 0) return selectedNode; + if (item.key === key) { + selectedNode = item; + return; + } + if (item.children && item.children.length) { + selectedNode = getSelectedNode(key, item.children, selectedNode); + } + }); + return selectedNode || null; + } + return { + deleteNodeByKey, + insertNodeByKey, + insertNodesByKey, + filterByLevel, + updateNodeByKey, + getAllKeys, + getChildrenKeys, + getEnabledKeys, + getSelectedNode, + }; +} diff --git a/monolithic/frontend/src/components/Tree/src/types/tree.ts b/monolithic/frontend/src/components/Tree/src/types/tree.ts new file mode 100644 index 0000000..03fe57f --- /dev/null +++ b/monolithic/frontend/src/components/Tree/src/types/tree.ts @@ -0,0 +1,194 @@ +import type { ExtractPropTypes } from 'vue'; +import type { TreeDataItem } from 'ant-design-vue/es/tree/Tree'; + +import { buildProps } from '/@/utils/props'; + +export enum ToolbarEnum { + SELECT_ALL, + UN_SELECT_ALL, + EXPAND_ALL, + UN_EXPAND_ALL, + CHECK_STRICTLY, + CHECK_UN_STRICTLY, +} + +export const treeEmits = [ + 'update:expandedKeys', + 'update:selectedKeys', + 'update:value', + 'change', + 'check', + 'update:searchValue', +]; + +export interface TreeState { + expandedKeys: KeyType[]; + selectedKeys: KeyType[]; + checkedKeys: CheckKeys; + checkStrictly: boolean; +} + +export interface FieldNames { + children?: string; + title?: string; + key?: string; +} + +export type KeyType = string | number; + +export type CheckKeys = + | KeyType[] + | { checked: string[] | number[]; halfChecked: string[] | number[] }; + +export const treeProps = buildProps({ + value: { + type: [Object, Array] as PropType, + }, + + renderIcon: { + type: Function as PropType<(params: Recordable) => string>, + }, + + helpMessage: { + type: [String, Array] as PropType, + default: '', + }, + + title: { + type: String, + default: '', + }, + toolbar: Boolean, + search: Boolean, + searchValue: { + type: String, + default: '', + }, + checkStrictly: Boolean, + clickRowToExpand: { + type: Boolean, + default: false, + }, + checkable: Boolean, + defaultExpandLevel: { + type: [String, Number] as PropType, + default: '', + }, + defaultExpandAll: Boolean, + + fieldNames: { + type: Object as PropType, + }, + + treeData: { + type: Array as PropType, + }, + + actionList: { + type: Array as PropType, + default: () => [], + }, + + expandedKeys: { + type: Array as PropType, + default: () => [], + }, + + selectedKeys: { + type: Array as PropType, + default: () => [], + }, + + checkedKeys: { + type: Array as PropType, + default: () => [], + }, + + beforeRightClick: { + type: Function as PropType<(...arg: any) => ContextMenuItem[] | ContextMenuOptions>, + default: undefined, + }, + + rightMenuList: { + type: Array as PropType, + }, + // 自定义数据过滤判断方法(注: 不是整个过滤方法,而是内置过滤的判断方法,用于增强原本仅能通过title进行过滤的方式) + filterFn: { + type: Function as PropType< + (searchValue: any, node: TreeItem, fieldNames: FieldNames) => boolean + >, + default: undefined, + }, + // 高亮搜索值,仅高亮具体匹配值(通过title)值为true时使用默认色值,值为#xxx时使用此值替代且高亮开启 + highlight: { + type: [Boolean, String] as PropType, + default: false, + }, + // 搜索完成时自动展开结果 + expandOnSearch: Boolean, + // 搜索完成自动选中所有结果,当且仅当 checkable===true 时生效 + checkOnSearch: Boolean, + // 搜索完成自动select所有结果 + selectedOnSearch: Boolean, + loading: { + type: Boolean, + default: false, + }, +}); + +export type TreeProps = ExtractPropTypes; + +export interface ContextMenuItem { + label: string; + icon?: string; + hidden?: boolean; + disabled?: boolean; + handler?: Fn; + divider?: boolean; + children?: ContextMenuItem[]; +} + +export interface ContextMenuOptions { + icon?: string; + styles?: any; + items?: ContextMenuItem[]; +} + +export interface TreeItem extends TreeDataItem { + icon?: any; +} + +export interface TreeActionItem { + render: (record: Recordable) => any; + show?: boolean | ((record: Recordable) => boolean); +} + +export interface InsertNodeParams { + parentKey: string | null; + node: TreeDataItem; + list?: TreeDataItem[]; + push?: 'push' | 'unshift'; +} + +export interface TreeActionType { + checkAll: (checkAll: boolean) => void; + expandAll: (expandAll: boolean) => void; + setExpandedKeys: (keys: KeyType[]) => void; + getExpandedKeys: () => KeyType[]; + setSelectedKeys: (keys: KeyType[]) => void; + getSelectedKeys: () => KeyType[]; + setCheckedKeys: (keys: CheckKeys) => void; + getCheckedKeys: () => CheckKeys; + filterByLevel: (level: number) => void; + insertNodeByKey: (opt: InsertNodeParams) => void; + insertNodesByKey: (opt: InsertNodeParams) => void; + deleteNodeByKey: (key: string) => void; + updateNodeByKey: (key: string, node: Omit) => void; + setSearchValue: (value: string) => void; + getSearchValue: () => string; + getSelectedNode: ( + key: KeyType, + treeList?: TreeItem[], + selectNode?: TreeItem | null, + ) => TreeItem | null; +} diff --git a/monolithic/frontend/src/components/Tree/style/index.less b/monolithic/frontend/src/components/Tree/style/index.less new file mode 100644 index 0000000..472d4ca --- /dev/null +++ b/monolithic/frontend/src/components/Tree/style/index.less @@ -0,0 +1,52 @@ +@tree-prefix-cls: ~'@{namespace}-tree'; + +.@{tree-prefix-cls} { + background-color: @component-background; + + .ant-tree-node-content-wrapper { + position: relative; + + .ant-tree-title { + position: absolute; + left: 0; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + } + + &__title { + position: relative; + display: flex; + align-items: center; + width: 100%; + padding-right: 10px; + + &:hover { + .@{tree-prefix-cls}__action { + visibility: visible; + } + } + } + + &__content { + overflow: hidden; + } + + &__actions { + position: absolute; + //top: 2px; + right: 3px; + display: flex; + } + + &__action { + margin-left: 4px; + visibility: hidden; + } + + &-header { + border-bottom: 1px solid @border-color-base; + } +} diff --git a/monolithic/frontend/src/components/Tree/style/index.ts b/monolithic/frontend/src/components/Tree/style/index.ts new file mode 100644 index 0000000..d74e52e --- /dev/null +++ b/monolithic/frontend/src/components/Tree/style/index.ts @@ -0,0 +1 @@ +import './index.less'; diff --git a/monolithic/frontend/src/components/Upload/index.ts b/monolithic/frontend/src/components/Upload/index.ts new file mode 100644 index 0000000..568a7d9 --- /dev/null +++ b/monolithic/frontend/src/components/Upload/index.ts @@ -0,0 +1,4 @@ +import { withInstall } from '/@/utils'; +import basicUpload from './src/BasicUpload.vue'; + +export const BasicUpload = withInstall(basicUpload); diff --git a/monolithic/frontend/src/components/Upload/src/BasicUpload.vue b/monolithic/frontend/src/components/Upload/src/BasicUpload.vue new file mode 100644 index 0000000..1d3b9c0 --- /dev/null +++ b/monolithic/frontend/src/components/Upload/src/BasicUpload.vue @@ -0,0 +1,123 @@ + + diff --git a/monolithic/frontend/src/components/Upload/src/FileList.vue b/monolithic/frontend/src/components/Upload/src/FileList.vue new file mode 100644 index 0000000..ddb087e --- /dev/null +++ b/monolithic/frontend/src/components/Upload/src/FileList.vue @@ -0,0 +1,104 @@ + + diff --git a/monolithic/frontend/src/components/Upload/src/ThumbUrl.vue b/monolithic/frontend/src/components/Upload/src/ThumbUrl.vue new file mode 100644 index 0000000..80fb203 --- /dev/null +++ b/monolithic/frontend/src/components/Upload/src/ThumbUrl.vue @@ -0,0 +1,29 @@ + + + diff --git a/monolithic/frontend/src/components/Upload/src/UploadModal.vue b/monolithic/frontend/src/components/Upload/src/UploadModal.vue new file mode 100644 index 0000000..e39cd18 --- /dev/null +++ b/monolithic/frontend/src/components/Upload/src/UploadModal.vue @@ -0,0 +1,322 @@ + + + diff --git a/monolithic/frontend/src/components/Upload/src/UploadPreviewModal.vue b/monolithic/frontend/src/components/Upload/src/UploadPreviewModal.vue new file mode 100644 index 0000000..bc4091b --- /dev/null +++ b/monolithic/frontend/src/components/Upload/src/UploadPreviewModal.vue @@ -0,0 +1,99 @@ + + + diff --git a/monolithic/frontend/src/components/Upload/src/data.tsx b/monolithic/frontend/src/components/Upload/src/data.tsx new file mode 100644 index 0000000..8e08833 --- /dev/null +++ b/monolithic/frontend/src/components/Upload/src/data.tsx @@ -0,0 +1,153 @@ +import type { BasicColumn, ActionItem } from '/@/components/Table'; +import { FileItem, PreviewFileItem, UploadResultStatus } from './typing'; +import { + // checkImgType, + isImgTypeByName, +} from './helper'; +import { Progress, Tag } from 'ant-design-vue'; +import TableAction from '/@/components/Table/src/components/TableAction.vue'; +import ThumbUrl from './ThumbUrl.vue'; +import { useI18n } from '/@/hooks/web/useI18n'; + +const { t } = useI18n(); + +// 文件上传列表 +export function createTableColumns(): BasicColumn[] { + return [ + { + dataIndex: 'thumbUrl', + title: t('component.upload.legend'), + width: 100, + customRender: ({ record }) => { + const { thumbUrl } = (record as FileItem) || {}; + return thumbUrl && ; + }, + }, + { + dataIndex: 'name', + title: t('component.upload.fileName'), + align: 'left', + customRender: ({ text, record }) => { + const { percent, status: uploadStatus } = (record as FileItem) || {}; + let status: 'normal' | 'exception' | 'active' | 'success' = 'normal'; + if (uploadStatus === UploadResultStatus.ERROR) { + status = 'exception'; + } else if (uploadStatus === UploadResultStatus.UPLOADING) { + status = 'active'; + } else if (uploadStatus === UploadResultStatus.SUCCESS) { + status = 'success'; + } + return ( + +

+ {text} +

+ +
+ ); + }, + }, + { + dataIndex: 'size', + title: t('component.upload.fileSize'), + width: 100, + customRender: ({ text = 0 }) => { + return text && (text / 1024).toFixed(2) + 'KB'; + }, + }, + // { + // dataIndex: 'type', + // title: '文件类型', + // width: 100, + // }, + { + dataIndex: 'status', + title: t('component.upload.fileStatue'), + width: 100, + customRender: ({ text }) => { + if (text === UploadResultStatus.SUCCESS) { + return {() => t('component.upload.uploadSuccess')}; + } else if (text === UploadResultStatus.ERROR) { + return {() => t('component.upload.uploadError')}; + } else if (text === UploadResultStatus.UPLOADING) { + return {() => t('component.upload.uploading')}; + } + + return text; + }, + }, + ]; +} +export function createActionColumn(handleRemove: Function): BasicColumn { + return { + width: 120, + title: t('component.upload.operating'), + dataIndex: 'action', + fixed: false, + customRender: ({ record }) => { + const actions: ActionItem[] = [ + { + label: t('component.upload.del'), + color: 'error', + onClick: handleRemove.bind(null, record), + }, + ]; + // if (checkImgType(record)) { + // actions.unshift({ + // label: t('component.upload.preview'), + // onClick: handlePreview.bind(null, record), + // }); + // } + return ; + }, + }; +} +// 文件预览列表 +export function createPreviewColumns(): BasicColumn[] { + return [ + { + dataIndex: 'url', + title: t('component.upload.legend'), + width: 100, + customRender: ({ record }) => { + const { url } = (record as PreviewFileItem) || {}; + return isImgTypeByName(url) && ; + }, + }, + { + dataIndex: 'name', + title: t('component.upload.fileName'), + align: 'left', + }, + ]; +} + +export function createPreviewActionColumn({ + handleRemove, + handleDownload, +}: { + handleRemove: Fn; + handleDownload: Fn; +}): BasicColumn { + return { + width: 160, + title: t('component.upload.operating'), + dataIndex: 'action', + fixed: false, + customRender: ({ record }) => { + const actions: ActionItem[] = [ + { + label: t('component.upload.del'), + color: 'error', + onClick: handleRemove.bind(null, record), + }, + { + label: t('component.upload.download'), + onClick: handleDownload.bind(null, record), + }, + ]; + + return ; + }, + }; +} diff --git a/monolithic/frontend/src/components/Upload/src/helper.ts b/monolithic/frontend/src/components/Upload/src/helper.ts new file mode 100644 index 0000000..a0c574b --- /dev/null +++ b/monolithic/frontend/src/components/Upload/src/helper.ts @@ -0,0 +1,27 @@ +export function checkFileType(file: File, accepts: string[]) { + const newTypes = accepts.join('|'); + // const reg = /\.(jpg|jpeg|png|gif|txt|doc|docx|xls|xlsx|xml)$/i; + const reg = new RegExp('\\.(' + newTypes + ')$', 'i'); + + return reg.test(file.name); +} + +export function checkImgType(file: File) { + return isImgTypeByName(file.name); +} + +export function isImgTypeByName(name: string) { + return /\.(jpg|jpeg|png|gif)$/i.test(name); +} + +export function getBase64WithFile(file: File) { + return new Promise<{ + result: string; + file: File; + }>((resolve, reject) => { + const reader = new FileReader(); + reader.readAsDataURL(file); + reader.onload = () => resolve({ result: reader.result as string, file }); + reader.onerror = (error) => reject(error); + }); +} diff --git a/monolithic/frontend/src/components/Upload/src/props.ts b/monolithic/frontend/src/components/Upload/src/props.ts new file mode 100644 index 0000000..413b95d --- /dev/null +++ b/monolithic/frontend/src/components/Upload/src/props.ts @@ -0,0 +1,83 @@ +import type { PropType } from 'vue'; +import { FileBasicColumn } from './typing'; + +export const basicProps = { + helpText: { + type: String as PropType, + default: '', + }, + // 文件最大多少MB + maxSize: { + type: Number as PropType, + default: 2, + }, + // 最大数量的文件,Infinity不限制 + maxNumber: { + type: Number as PropType, + default: Infinity, + }, + // 根据后缀,或者其他 + accept: { + type: Array as PropType, + default: () => [], + }, + multiple: { + type: Boolean as PropType, + default: true, + }, + uploadParams: { + type: Object as PropType, + default: {}, + }, + api: { + type: Function as PropType, + default: null, + required: true, + }, + name: { + type: String as PropType, + default: 'file', + }, + filename: { + type: String as PropType, + default: null, + }, +}; + +export const uploadContainerProps = { + value: { + type: Array as PropType, + default: () => [], + }, + ...basicProps, + showPreviewNumber: { + type: Boolean as PropType, + default: true, + }, + emptyHidePreview: { + type: Boolean as PropType, + default: false, + }, +}; + +export const previewProps = { + value: { + type: Array as PropType, + default: () => [], + }, +}; + +export const fileListProps = { + columns: { + type: [Array] as PropType, + default: null, + }, + actionColumn: { + type: Object as PropType, + default: null, + }, + dataSource: { + type: Array as PropType, + default: null, + }, +}; diff --git a/monolithic/frontend/src/components/Upload/src/typing.ts b/monolithic/frontend/src/components/Upload/src/typing.ts new file mode 100644 index 0000000..c630110 --- /dev/null +++ b/monolithic/frontend/src/components/Upload/src/typing.ts @@ -0,0 +1,55 @@ +import { UploadApiResult } from '/@/api/sys/model/uploadModel'; + +export enum UploadResultStatus { + SUCCESS = 'success', + ERROR = 'error', + UPLOADING = 'uploading', +} + +export interface FileItem { + thumbUrl?: string; + name: string; + size: string | number; + type?: string; + percent: number; + file: File; + status?: UploadResultStatus; + responseData?: UploadApiResult; + uuid: string; +} + +export interface PreviewFileItem { + url: string; + name: string; + type: string; +} + +export interface FileBasicColumn { + /** + * Renderer of the table cell. The return value should be a VNode, or an object for colSpan/rowSpan config + * @type Function | ScopedSlot + */ + customRender?: Function; + /** + * Title of this column + * @type any (string | slot) + */ + title: string; + + /** + * Width of this column + * @type string | number + */ + width?: number; + /** + * Display field of the data record, could be set like a.b.c + * @type string + */ + dataIndex: string; + /** + * specify how content is aligned + * @default 'left' + * @type string + */ + align?: 'left' | 'right' | 'center'; +} diff --git a/monolithic/frontend/src/components/Upload/src/useUpload.ts b/monolithic/frontend/src/components/Upload/src/useUpload.ts new file mode 100644 index 0000000..694cc27 --- /dev/null +++ b/monolithic/frontend/src/components/Upload/src/useUpload.ts @@ -0,0 +1,60 @@ +import { Ref, unref, computed } from 'vue'; +import { useI18n } from '/@/hooks/web/useI18n'; +const { t } = useI18n(); +export function useUploadType({ + acceptRef, + helpTextRef, + maxNumberRef, + maxSizeRef, +}: { + acceptRef: Ref; + helpTextRef: Ref; + maxNumberRef: Ref; + maxSizeRef: Ref; +}) { + // 文件类型限制 + const getAccept = computed(() => { + const accept = unref(acceptRef); + if (accept && accept.length > 0) { + return accept; + } + return []; + }); + const getStringAccept = computed(() => { + return unref(getAccept) + .map((item) => { + if (item.indexOf('/') > 0 || item.startsWith('.')) { + return item; + } else { + return `.${item}`; + } + }) + .join(','); + }); + + // 支持jpg、jpeg、png格式,不超过2M,最多可选择10张图片,。 + const getHelpText = computed(() => { + const helpText = unref(helpTextRef); + if (helpText) { + return helpText; + } + const helpTexts: string[] = []; + + const accept = unref(acceptRef); + if (accept.length > 0) { + helpTexts.push(t('component.upload.accept', [accept.join(',')])); + } + + const maxSize = unref(maxSizeRef); + if (maxSize) { + helpTexts.push(t('component.upload.maxSize', [maxSize])); + } + + const maxNumber = unref(maxNumberRef); + if (maxNumber && maxNumber !== Infinity) { + helpTexts.push(t('component.upload.maxNumber', [maxNumber])); + } + return helpTexts.join(','); + }); + return { getAccept, getStringAccept, getHelpText }; +} diff --git a/monolithic/frontend/src/components/Verify/index.ts b/monolithic/frontend/src/components/Verify/index.ts new file mode 100644 index 0000000..7c67101 --- /dev/null +++ b/monolithic/frontend/src/components/Verify/index.ts @@ -0,0 +1,7 @@ +import { withInstall } from '/@/utils/index'; +import basicDragVerify from './src/DragVerify.vue'; +import rotateDragVerify from './src/ImgRotate.vue'; + +export const BasicDragVerify = withInstall(basicDragVerify); +export const RotateDragVerify = withInstall(rotateDragVerify); +export * from './src/typing'; diff --git a/monolithic/frontend/src/components/Verify/src/DragVerify.vue b/monolithic/frontend/src/components/Verify/src/DragVerify.vue new file mode 100644 index 0000000..c457bc0 --- /dev/null +++ b/monolithic/frontend/src/components/Verify/src/DragVerify.vue @@ -0,0 +1,371 @@ + + diff --git a/monolithic/frontend/src/components/Verify/src/ImgRotate.vue b/monolithic/frontend/src/components/Verify/src/ImgRotate.vue new file mode 100644 index 0000000..53788ed --- /dev/null +++ b/monolithic/frontend/src/components/Verify/src/ImgRotate.vue @@ -0,0 +1,220 @@ + + diff --git a/monolithic/frontend/src/components/Verify/src/props.ts b/monolithic/frontend/src/components/Verify/src/props.ts new file mode 100644 index 0000000..1e14970 --- /dev/null +++ b/monolithic/frontend/src/components/Verify/src/props.ts @@ -0,0 +1,87 @@ +import type { PropType } from 'vue'; +import { useI18n } from '/@/hooks/web/useI18n'; + +const { t } = useI18n(); +export const basicProps = { + value: { + type: Boolean as PropType, + default: false, + }, + + isSlot: { + type: Boolean as PropType, + default: false, + }, + + text: { + type: [String] as PropType, + default: t('component.verify.dragText'), + }, + successText: { + type: [String] as PropType, + default: t('component.verify.successText'), + }, + height: { + type: [Number, String] as PropType, + default: 40, + }, + + width: { + type: [Number, String] as PropType, + default: 220, + }, + + circle: { + type: Boolean as PropType, + default: false, + }, + + wrapStyle: { + type: Object as PropType, + default: {}, + }, + contentStyle: { + type: Object as PropType, + default: {}, + }, + barStyle: { + type: Object as PropType, + default: {}, + }, + actionStyle: { + type: Object as PropType, + default: {}, + }, +}; + +export const rotateProps = { + ...basicProps, + src: { + type: String as PropType, + }, + + imgWidth: { + type: Number as PropType, + default: 260, + }, + + imgWrapStyle: { + type: Object as PropType, + default: {}, + }, + + minDegree: { + type: Number as PropType, + default: 90, + }, + + maxDegree: { + type: Number as PropType, + default: 270, + }, + + diffDegree: { + type: Number as PropType, + default: 20, + }, +}; diff --git a/monolithic/frontend/src/components/Verify/src/typing.ts b/monolithic/frontend/src/components/Verify/src/typing.ts new file mode 100644 index 0000000..48f7d4c --- /dev/null +++ b/monolithic/frontend/src/components/Verify/src/typing.ts @@ -0,0 +1,14 @@ +export interface DragVerifyActionType { + resume: () => void; +} + +export interface PassingData { + isPassing: boolean; + time: number; +} + +export interface MoveData { + event: MouseEvent | TouchEvent; + moveDistance: number; + moveX: number; +} diff --git a/monolithic/frontend/src/components/VirtualScroll/index.ts b/monolithic/frontend/src/components/VirtualScroll/index.ts new file mode 100644 index 0000000..a4c6089 --- /dev/null +++ b/monolithic/frontend/src/components/VirtualScroll/index.ts @@ -0,0 +1,4 @@ +import { withInstall } from '/@/utils/index'; +import vScroll from './src/VirtualScroll.vue'; + +export const VScroll = withInstall(vScroll); diff --git a/monolithic/frontend/src/components/VirtualScroll/src/VirtualScroll.vue b/monolithic/frontend/src/components/VirtualScroll/src/VirtualScroll.vue new file mode 100644 index 0000000..b37a058 --- /dev/null +++ b/monolithic/frontend/src/components/VirtualScroll/src/VirtualScroll.vue @@ -0,0 +1,190 @@ + + diff --git a/monolithic/frontend/src/components/registerGlobComp.ts b/monolithic/frontend/src/components/registerGlobComp.ts new file mode 100644 index 0000000..a3ee310 --- /dev/null +++ b/monolithic/frontend/src/components/registerGlobComp.ts @@ -0,0 +1,7 @@ +import type { App } from 'vue'; +import { Button } from './Button'; +import { Input, Layout } from 'ant-design-vue'; + +export function registerGlobComp(app: App) { + app.use(Input).use(Button).use(Layout); +} diff --git a/monolithic/frontend/src/design/ant/btn.less b/monolithic/frontend/src/design/ant/btn.less new file mode 100644 index 0000000..c997d01 --- /dev/null +++ b/monolithic/frontend/src/design/ant/btn.less @@ -0,0 +1,285 @@ +// button reset +.ant-btn { + &-link:hover, + &-link:focus, + &-link:active { + border-color: transparent !important; + } + + &-primary { + color: @white; + background-color: @button-primary-color; + + &:hover, + &:focus { + color: @white; + background-color: @button-primary-hover-color; + } + } + + &-primary:not(&-background-ghost):not([disabled]) { + color: @white; + } + + &-default { + color: @button-cancel-color; + background-color: @button-cancel-bg-color; + border-color: @button-cancel-border-color; + + &:hover, + &:focus { + color: @button-cancel-hover-color; + background-color: @button-cancel-hover-bg-color; + border-color: @button-cancel-hover-border-color; + } + // + //&[disabled], + //&[disabled]:hover { + // color: fade(@button-cancel-color, 40%) !important; + // background: fade(@button-cancel-bg-color, 40%) !important; + // border-color: fade(@button-cancel-border-color, 40%) !important; + //} + } + + [data-theme='light'] &.ant-btn-link.is-disabled { + color: rgb(0 0 0 / 25%); + text-shadow: none; + cursor: not-allowed !important; + background-color: transparent !important; + border-color: transparent !important; + box-shadow: none; + } + + [data-theme='dark'] &.ant-btn-link.is-disabled { + color: rgb(255 255 255 / 25%) !important; + text-shadow: none; + cursor: not-allowed !important; + background-color: transparent !important; + border-color: transparent !important; + box-shadow: none; + } + + // color: @white; + + &-success.ant-btn-link:not([disabled='disabled']) { + color: @button-success-color; + + &:hover, + &:focus { + color: @button-success-hover-color; + border-color: transparent; + } + + &:active { + color: @button-success-active-color; + } + } + + &-success.ant-btn-link.ant-btn-loading, + &-warning.ant-btn-link.ant-btn-loading, + &-error.ant-btn-link.ant-btn-loading, + &-background-ghost.ant-btn-link.ant-btn-loading, + &.ant-btn-link.ant-btn-loading { + &::before { + background: transparent; + } + } + + &-success:not(.ant-btn-link, .is-disabled) { + color: @white; + background-color: @button-success-color; + border-color: @button-success-color; + //border-width: 0; + + &:hover, + &:focus { + color: @white; + background-color: @button-success-hover-color; + border-color: @button-success-hover-color; + } + + &:active { + background-color: @button-success-active-color; + border-color: @button-success-active-color; + } + } + + &-warning.ant-btn-link:not([disabled='disabled']) { + color: @button-warn-color; + + &:hover, + &:focus { + color: @button-warn-hover-color; + border-color: transparent; + } + + &:active { + color: @button-warn-active-color; + } + } + + &-warning:not(.ant-btn-link, .is-disabled) { + color: @white; + background-color: @button-warn-color; + border-color: @button-warn-color; + //border-width: 0; + + &:hover, + &:focus { + color: @white; + background-color: @button-warn-hover-color; + border-color: @button-warn-hover-color; + } + + &:active { + background-color: @button-warn-active-color; + border-color: @button-warn-active-color; + } + + //&[disabled], + //&[disabled]:hover { + // color: @white; + // background-color: fade(@button-warn-color, 40%); + // border-color: fade(@button-warn-color, 40%); + //} + } + + &-error.ant-btn-link:not([disabled='disabled']) { + color: @button-error-color; + + &:hover, + &:focus { + color: @button-error-hover-color; + border-color: transparent; + } + + &:active { + color: @button-error-active-color; + } + } + + &-error:not(.ant-btn-link, .is-disabled) { + color: @white; + background-color: @button-error-color; + border-color: @button-error-color; + //border-width: 0; + + &:hover, + &:focus { + color: @white; + background-color: @button-error-hover-color; + border-color: @button-error-hover-color; + } + + &:active { + background-color: @button-error-active-color; + border-color: @button-error-active-color; + } + + //&[disabled], + //&[disabled]:hover { + // color: @white; + // background-color: fade(@button-error-color, 40%); + // border-color: fade(@button-error-color, 40%); + //} + } + + &-background-ghost { + border-width: 1px; + background-color: transparent !important; + + &[disabled], + &[disabled]:hover { + color: fade(@white, 40%) !important; + background-color: transparent !important; + border-color: fade(@white, 40%) !important; + } + } + + &-dashed&-background-ghost, + &-default&-background-ghost { + color: @button-ghost-color; + border-color: @button-ghost-color; + + &:hover, + &:focus { + color: @button-ghost-hover-color; + border-color: @button-ghost-hover-color; + } + + &:active { + color: @button-ghost-active-color; + border-color: @button-ghost-active-color; + } + + &[disabled], + &[disabled]:hover { + color: fade(@white, 40%) !important; + border-color: fade(@white, 40%) !important; + } + } + + &-background-ghost&-success:not(.ant-btn-link) { + color: @button-success-color; + background-color: transparent; + border-color: @button-success-color; + border-width: 1px; + + &:hover, + &:focus { + color: @button-success-hover-color !important; + border-color: @button-success-hover-color; + } + + &:active { + color: @button-success-active-color; + border-color: @button-success-active-color; + } + } + + &-background-ghost&-warning:not(.ant-btn-link) { + color: @button-warn-color; + background-color: transparent; + border-color: @button-warn-color; + border-width: 1px; + + &:hover, + &:focus { + color: @button-warn-hover-color !important; + border-color: @button-warn-hover-color; + } + + &:active { + color: @button-warn-active-color; + border-color: @button-warn-active-color; + } + } + + &-background-ghost&-error:not(.ant-btn-link) { + color: @button-error-color; + background-color: transparent; + border-color: @button-error-color; + border-width: 1px; + + &:hover, + &:focus { + color: @button-error-hover-color !important; + border-color: @button-error-hover-color; + } + + &:active { + color: @button-error-active-color; + border-color: @button-error-active-color; + } + } + + &-ghost.ant-btn-link:not([disabled='disabled']) { + color: @button-ghost-color; + + &:hover, + &:focus { + color: @button-ghost-hover-color; + border-color: transparent; + } + } +} diff --git a/monolithic/frontend/src/design/ant/index.less b/monolithic/frontend/src/design/ant/index.less new file mode 100644 index 0000000..f9334bb --- /dev/null +++ b/monolithic/frontend/src/design/ant/index.less @@ -0,0 +1,59 @@ +@import './pagination.less'; +@import './input.less'; +@import './btn.less'; + +.ant-image-preview-root { + img { + display: unset; + } +} + +span.anticon:not(.app-iconify) { + vertical-align: 0.125em !important; +} + +.ant-back-top { + right: 20px; + bottom: 20px; +} + +.collapse-container__body { + > .ant-descriptions { + margin-left: 6px; + } +} + +.ant-image-preview-operations { + background-color: rgb(0 0 0 / 30%); +} + +.ant-popover { + &-content { + box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%); + } +} + +// ================================= +// ==============modal message====== +// ================================= +.modal-icon-warning { + color: @warning-color !important; +} + +.modal-icon-success { + color: @success-color !important; +} + +.modal-icon-error { + color: @error-color !important; +} + +.modal-icon-info { + color: @primary-color !important; +} + +.ant-checkbox-checked .ant-checkbox-inner::after, +.ant-tree-checkbox-checked .ant-tree-checkbox-inner::after { + border-top: 0 !important; + border-left: 0 !important; +} diff --git a/monolithic/frontend/src/design/ant/input.less b/monolithic/frontend/src/design/ant/input.less new file mode 100644 index 0000000..645afb3 --- /dev/null +++ b/monolithic/frontend/src/design/ant/input.less @@ -0,0 +1,31 @@ +@import (reference) '../color.less'; + +// input +.ant-input { + &-number { + min-width: 110px; + } +} + +.ant-input-affix-wrapper .ant-input-suffix { + right: 9px; +} + +.ant-input-clear-icon { + margin-right: 5px; +} + +.ant-input-affix-wrapper-textarea-with-clear-btn { + padding: 0 !important; + + textarea.ant-input { + padding: 4px; + } +} + +.ant-input-number { + width: 100% !important; + max-width: 100%; +} + + diff --git a/monolithic/frontend/src/design/ant/pagination.less b/monolithic/frontend/src/design/ant/pagination.less new file mode 100644 index 0000000..b3580f9 --- /dev/null +++ b/monolithic/frontend/src/design/ant/pagination.less @@ -0,0 +1,96 @@ +html[data-theme='dark'] { + .ant-pagination { + &.mini { + .ant-pagination-prev, + .ant-pagination-next, + .ant-pagination-item { + background-color: rgb(255 255 255 / 4%) !important; + + a { + color: #8b949e !important; + } + } + + .ant-select-arrow { + color: @text-color-secondary !important; + } + + .ant-pagination-item-active { + background-color: @primary-color !important; + border: none; + border-radius: none !important; + + a { + color: @white !important; + } + } + } + } +} + +.ant-pagination { + &.mini { + .ant-pagination-prev, + .ant-pagination-next { + font-size: 12px; + color: @text-color-base; + border: 1px solid; + } + + .ant-pagination-prev:hover, + .ant-pagination-next:hover, + .ant-pagination-item:focus, + .ant-pagination-item:hover { + a { + color: @primary-color; + } + } + + .ant-pagination-prev, + .ant-pagination-next, + .ant-pagination-item { + margin: 0 4px !important; + background-color: #f4f4f5 !important; + border: none; + border-radius: none !important; + + a { + margin-top: 1px; + color: #606266; + } + + &:last-child { + margin-right: 0 !important; + } + } + + .ant-pagination-item-active { + background-color: @primary-color !important; + border: none; + border-radius: none !important; + + a { + color: @white !important; + } + } + + .ant-pagination-options { + margin-left: 12px; + } + + .ant-pagination-options-quick-jumper input { + height: 22px; + margin: 0 6px; + line-height: 22px; + text-align: center; + } + + .ant-select-arrow { + color: @border-color-shallow-dark; + } + } + + &-disabled { + display: none !important; + } +} diff --git a/monolithic/frontend/src/design/ant/table.less b/monolithic/frontend/src/design/ant/table.less new file mode 100644 index 0000000..ee62b99 --- /dev/null +++ b/monolithic/frontend/src/design/ant/table.less @@ -0,0 +1,76 @@ +@prefix-cls: ~'@{namespace}-basic-table'; + +// fix table unnecessary scrollbar +.@{prefix-cls} { + .hide-scrollbar-y { + .ant-spin-nested-loading { + .ant-spin-container { + .ant-table { + .ant-table-content { + .ant-table-scroll { + .ant-table-hide-scrollbar { + overflow-y: auto !important; + } + + .ant-table-body { + overflow-y: auto !important; + } + } + + .ant-table-fixed-right { + .ant-table-body-outer { + .ant-table-body-inner { + overflow-y: auto !important; + } + } + } + + .ant-table-fixed-left { + .ant-table-body-outer { + .ant-table-body-inner { + overflow-y: auto !important; + } + } + } + } + } + } + } + } + + .hide-scrollbar-x { + .ant-spin-nested-loading { + .ant-spin-container { + .ant-table { + .ant-table-content { + .ant-table-scroll { + .ant-table-hide-scrollbar { + //overflow-x: auto !important; + } + + .ant-table-body { + overflow: auto !important; + } + } + + .ant-table-fixed-right { + .ant-table-body-outer { + .ant-table-body-inner { + overflow-x: auto !important; + } + } + } + + .ant-table-fixed-left { + .ant-table-body-outer { + .ant-table-body-inner { + overflow-x: auto !important; + } + } + } + } + } + } + } + } +} diff --git a/monolithic/frontend/src/design/color.less b/monolithic/frontend/src/design/color.less new file mode 100644 index 0000000..9d2138c --- /dev/null +++ b/monolithic/frontend/src/design/color.less @@ -0,0 +1,138 @@ +html { + // header + --header-bg-color: #394664; + --header-bg-hover-color: #273352; + --header-active-menu-bg-color: #273352; + + // sider + --sider-dark-bg-color: #273352; + --sider-dark-darken-bg-color: #273352; + --sider-dark-lighten-bg-color: #273352; +} + +@white: #fff; + +@content-bg: #f4f7f9; + +// :export { +// name: "less"; +// mainColor: @mainColor; +// fontSize: @fontSize; +// } +@iconify-bg-color: #5551; + +// ================================= +// ==============border-color======= +// ================================= + +// Dark-dark +@border-color-dark: #b6b7b9; + +// Dark-light +@border-color-shallow-dark: #cececd; + +// Light-dark +@border-color-light: @border-color-base; + +// ================================= +// ==============message============== +// ================================= + +// success-bg-color +@success-background-color: #f1f9ec; +// info-bg-color +@info-background-color: #e8eff8; +// warn-bg-color +@warning-background-color: #fdf6ed; +// danger-bg-color +@danger-background-color: #fef0f0; + +// ================================= +// ==============Header============= +// ================================= + +@header-dark-bg-color: var(--header-bg-color); +@header-dark-bg-hover-color: var(--header-bg-hover-color); +@header-light-bg-hover-color: #f6f6f6; +@header-light-desc-color: #7c8087; +@header-light-bottom-border-color: #eee; +// top-menu +@top-menu-active-bg-color: var(--header-active-menu-bg-color); + +// ================================= +// ==============Menu============ +// ================================= + +// let -menu +@sider-dark-bg-color: var(--sider-dark-bg-color); +@sider-dark-darken-bg-color: var(--sider-dark-darken-bg-color); +@sider-dark-lighten-bg-color: var(--sider-dark-lighten-bg-color); + +// trigger +@trigger-dark-hover-bg-color: rgba(255, 255, 255, 0.2); +@trigger-dark-bg-color: rgba(255, 255, 255, 0.1); + +// ================================= +// ==============tree============ +// ================================= +// tree item hover background +@tree-hover-background-color: #f5f7fa; +// tree item hover font color +@tree-hover-font-color: #f5f7fa; + +// ================================= +// ==============link============ +// ================================= +@link-hover-color: @primary-color; +@link-active-color: darken(@primary-color, 10%); + +// ================================= +// ==============Text color-============= +// ================================= + +// Main text color +@text-color-base: @text-color; + +// Label color +@text-color-call-out: #606266; + +// Auxiliary information color-dark +@text-color-help-dark: #909399; + +// ================================= +// ==============breadcrumb========= +// ================================= +@breadcrumb-item-normal-color: #999; +// ================================= +// ==============button============= +// ================================= + +@button-primary-color: @primary-color; +@button-primary-hover-color: lighten(@primary-color, 5%); +@button-primary-active-color: darken(@primary-color, 5%); + +@button-ghost-color: @white; +@button-ghost-hover-color: lighten(@white, 10%); +@button-ghost-hover-bg-color: #e1ebf6; +@button-ghost-active-color: darken(@white, 10%); + +@button-success-color: @success-color; +@button-success-hover-color: lighten(@success-color, 10%); +@button-success-active-color: darken(@success-color, 10%); + +@button-warn-color: @warning-color; +@button-warn-hover-color: lighten(@warning-color, 10%); +@button-warn-active-color: darken(@warning-color, 10%); + +@button-error-color: @error-color; +@button-error-hover-color: lighten(@error-color, 10%); +@button-error-active-color: darken(@error-color, 10%); + +@button-cancel-color: @text-color-call-out; +@button-cancel-bg-color: @white; +@button-cancel-border-color: @border-color-shallow-dark; + +// Mouse over +@button-cancel-hover-color: @primary-color; +@button-cancel-hover-bg-color: @white; +@button-cancel-hover-border-color: @primary-color; diff --git a/monolithic/frontend/src/design/config.less b/monolithic/frontend/src/design/config.less new file mode 100644 index 0000000..64c33f6 --- /dev/null +++ b/monolithic/frontend/src/design/config.less @@ -0,0 +1,2 @@ +@import (reference) 'color.less'; +@import (reference) 'var/index.less'; diff --git a/monolithic/frontend/src/design/index.less b/monolithic/frontend/src/design/index.less new file mode 100644 index 0000000..7727586 --- /dev/null +++ b/monolithic/frontend/src/design/index.less @@ -0,0 +1,44 @@ +@import 'transition/index.less'; +@import 'var/index.less'; +@import 'public.less'; +@import 'ant/index.less'; +@import './theme.less'; + +input:-webkit-autofill { + box-shadow: 0 0 0 1000px white inset !important; +} + +:-webkit-autofill { + transition: background-color 5000s ease-in-out 0s !important; +} + +html { + overflow: hidden; + text-size-adjust: 100%; +} + +html, +body { + width: 100%; + height: 100%; + overflow: visible; + overflow-x: hidden; + + &.color-weak { + filter: invert(80%); + } + + &.gray-mode { + filter: grayscale(100%); + filter: progid:dximagetransform.microsoft.basicimage(grayscale=1); + } +} + +a:focus, +a:active, +button, +div, +svg, +span { + outline: none; +} diff --git a/monolithic/frontend/src/design/public.less b/monolithic/frontend/src/design/public.less new file mode 100644 index 0000000..644bfab --- /dev/null +++ b/monolithic/frontend/src/design/public.less @@ -0,0 +1,51 @@ +#app { + width: 100%; + height: 100%; +} + +// ================================= +// ==============scrollbar========== +// ================================= + +::-webkit-scrollbar { + width: 7px; + height: 8px; +} + +// ::-webkit-scrollbar-track { +// background: transparent; +// } + +::-webkit-scrollbar-track { + background-color: rgb(0 0 0 / 5%); +} + +::-webkit-scrollbar-thumb { + // background: rgba(0, 0, 0, 0.6); + background-color: rgb(144 147 153 / 30%); + // background-color: rgba(144, 147, 153, 0.3); + border-radius: 2px; + box-shadow: inset 0 0 6px rgb(0 0 0 / 20%); +} + +::-webkit-scrollbar-thumb:hover { + background-color: @border-color-dark; +} + +// ================================= +// ==============nprogress========== +// ================================= +#nprogress { + pointer-events: none; + + .bar { + position: fixed; + top: 0; + left: 0; + z-index: 99999; + width: 100%; + height: 2px; + background-color: @primary-color; + opacity: 0.75; + } +} diff --git a/monolithic/frontend/src/design/theme.less b/monolithic/frontend/src/design/theme.less new file mode 100644 index 0000000..aa05033 --- /dev/null +++ b/monolithic/frontend/src/design/theme.less @@ -0,0 +1,52 @@ +.bg-white { + background-color: @component-background !important; +} + +html[data-theme='light'] { + .text-secondary { + color: rgb(0 0 0 / 45%); + } + + .ant-alert-success { + background-color: #f6ffed; + border: 1px solid #b7eb8f; + } + + .ant-alert-error { + background-color: #fff2f0; + border: 1px solid #ffccc7; + } + + .ant-alert-warning { + background-color: #fffbe6; + border: 1px solid #ffe58f; + } + + :not(:root):fullscreen::backdrop { + background-color: @layout-body-background !important; + } +} + +[data-theme='dark'] { + .text-secondary { + color: #8b949e; + } + + .ant-card-grid-hoverable:hover { + box-shadow: 0 3px 6px -4px rgb(0 0 0 / 48%), 0 6px 16px 0 rgb(0 0 0 / 32%), + 0 9px 28px 8px rgb(0 0 0 / 20%); + } + + .ant-card-grid { + box-shadow: 1px 0 0 0 #434343, 0 1px 0 0 #434343, 1px 1px 0 0 #434343, 1px 0 0 0 #434343 inset, + 0 1px 0 0 #434343 inset; + } + + .ant-calendar-selected-day .ant-calendar-date { + color: rgb(0 0 0 / 80%); + } + + .ant-select-tree li .ant-select-tree-node-content-wrapper.ant-select-tree-node-selected { + color: rgb(0 0 0 / 90%); + } +} diff --git a/monolithic/frontend/src/design/transition/base.less b/monolithic/frontend/src/design/transition/base.less new file mode 100644 index 0000000..7944c8b --- /dev/null +++ b/monolithic/frontend/src/design/transition/base.less @@ -0,0 +1,18 @@ +.transition-default() { + &-enter-active, + &-leave-active { + transition: 0.3s cubic-bezier(0.25, 0.8, 0.5, 1) !important; + } + + &-move { + transition: transform 0.4s; + } +} + +.expand-transition { + .transition-default(); +} + +.expand-x-transition { + .transition-default(); +} diff --git a/monolithic/frontend/src/design/transition/fade.less b/monolithic/frontend/src/design/transition/fade.less new file mode 100644 index 0000000..6ed1771 --- /dev/null +++ b/monolithic/frontend/src/design/transition/fade.less @@ -0,0 +1,93 @@ +.fade-transition { + &-enter-active, + &-leave-active { + transition: opacity 0.2s ease-in-out; + } + + &-enter-from, + &-leave-to { + opacity: 0; + } +} + +.fade-enter-active, +.fade-leave-active { + transition: opacity 0.2s ease-in-out; +} + +.fade-enter-from, +.fade-leave-to { + opacity: 0; +} + +/* fade-slide */ +.fade-slide-leave-active, +.fade-slide-enter-active { + transition: all 0.3s; +} + +.fade-slide-enter-from { + opacity: 0; + transform: translateX(-30px); +} + +.fade-slide-leave-to { + opacity: 0; + transform: translateX(30px); +} + +// /////////////////////////////////////////////// +// Fade Bottom +// /////////////////////////////////////////////// + +// Speed: 1x +.fade-bottom-enter-active, +.fade-bottom-leave-active { + transition: opacity 0.25s, transform 0.3s; +} + +.fade-bottom-enter-from { + opacity: 0; + transform: translateY(-10%); +} + +.fade-bottom-leave-to { + opacity: 0; + transform: translateY(10%); +} + +// fade-scale +.fade-scale-leave-active, +.fade-scale-enter-active { + transition: all 0.28s; +} + +.fade-scale-enter-from { + opacity: 0; + transform: scale(1.2); +} + +.fade-scale-leave-to { + opacity: 0; + transform: scale(0.8); +} + +// /////////////////////////////////////////////// +// Fade Top +// /////////////////////////////////////////////// + +// Speed: 1x +.fade-top-enter-active, +.fade-top-leave-active { + transition: opacity 0.2s, transform 0.25s; +} + +.fade-top-enter-from { + opacity: 0; + transform: translateY(8%); +} + +.fade-top-leave-to { + opacity: 0; + transform: translateY(-8%); +} diff --git a/monolithic/frontend/src/design/transition/index.less b/monolithic/frontend/src/design/transition/index.less new file mode 100644 index 0000000..e372b25 --- /dev/null +++ b/monolithic/frontend/src/design/transition/index.less @@ -0,0 +1,10 @@ +@import './base.less'; +@import './fade.less'; +@import './scale.less'; +@import './slide.less'; +@import './scroll.less'; +@import './zoom.less'; + +.collapse-transition { + transition: 0.2s height ease-in-out, 0.2s padding-top ease-in-out, 0.2s padding-bottom ease-in-out; +} diff --git a/monolithic/frontend/src/design/transition/scale.less b/monolithic/frontend/src/design/transition/scale.less new file mode 100644 index 0000000..c965493 --- /dev/null +++ b/monolithic/frontend/src/design/transition/scale.less @@ -0,0 +1,21 @@ +.scale-transition { + .transition-default(); + + &-enter-from, + &-leave, + &-leave-to { + opacity: 0; + transform: scale(0); + } +} + +.scale-rotate-transition { + .transition-default(); + + &-enter-from, + &-leave, + &-leave-to { + opacity: 0; + transform: scale(0) rotate(-45deg); + } +} diff --git a/monolithic/frontend/src/design/transition/scroll.less b/monolithic/frontend/src/design/transition/scroll.less new file mode 100644 index 0000000..a5f45e4 --- /dev/null +++ b/monolithic/frontend/src/design/transition/scroll.less @@ -0,0 +1,67 @@ +.scroll-y-transition { + .transition-default(); + + &-enter-from, + &-leave-to { + opacity: 0; + } + + &-enter-from { + transform: translateY(-15px); + } + + &-leave-to { + transform: translateY(15px); + } +} + +.scroll-y-reverse-transition { + .transition-default(); + + &-enter-from, + &-leave-to { + opacity: 0; + } + + &-enter-from { + transform: translateY(15px); + } + + &-leave-to { + transform: translateY(-15px); + } +} + +.scroll-x-transition { + .transition-default(); + + &-enter-from, + &-leave-to { + opacity: 0; + } + + &-enter-from { + transform: translateX(-15px); + } + + &-leave-to { + transform: translateX(15px); + } +} + +.scroll-x-reverse-transition { + .transition-default(); + + &-enter-from, + &-leave-to { + opacity: 0; + } + + &-enter-from { + transform: translateX(15px); + } + + &-leave-to { + transform: translateX(-15px); + } +} diff --git a/monolithic/frontend/src/design/transition/slide.less b/monolithic/frontend/src/design/transition/slide.less new file mode 100644 index 0000000..79b00df --- /dev/null +++ b/monolithic/frontend/src/design/transition/slide.less @@ -0,0 +1,39 @@ +.slide-y-transition { + .transition-default(); + + &-enter-from, + &-leave-to { + opacity: 0; + transform: translateY(-15px); + } +} + +.slide-y-reverse-transition { + .transition-default(); + + &-enter-from, + &-leave-to { + opacity: 0; + transform: translateY(15px); + } +} + +.slide-x-transition { + .transition-default(); + + &-enter-from, + &-leave-to { + opacity: 0; + transform: translateX(-15px); + } +} + +.slide-x-reverse-transition { + .transition-default(); + + &-enter-from, + &-leave-to { + opacity: 0; + transform: translateX(15px); + } +} diff --git a/monolithic/frontend/src/design/transition/zoom.less b/monolithic/frontend/src/design/transition/zoom.less new file mode 100644 index 0000000..2ea378c --- /dev/null +++ b/monolithic/frontend/src/design/transition/zoom.less @@ -0,0 +1,27 @@ +// zoom-out +.zoom-out-enter-active, +.zoom-out-leave-active { + transition: opacity 0.1 ease-in-out, transform 0.15s ease-out; +} + +.zoom-out-enter-from, +.zoom-out-leave-to { + opacity: 0; + transform: scale(0); +} + +// zoom-fade +.zoom-fade-enter-active, +.zoom-fade-leave-active { + transition: transform 0.2s, opacity 0.3s ease-out; +} + +.zoom-fade-enter-from { + opacity: 0; + transform: scale(0.92); +} + +.zoom-fade-leave-to { + opacity: 0; + transform: scale(1.06); +} diff --git a/monolithic/frontend/src/design/var/breakpoint.less b/monolithic/frontend/src/design/var/breakpoint.less new file mode 100644 index 0000000..793e826 --- /dev/null +++ b/monolithic/frontend/src/design/var/breakpoint.less @@ -0,0 +1,33 @@ +// ================================= +// ==============屏幕断点============ +// ================================= + +// Extra small screen / phone +@screen-xs: 480px; +@screen-xs-min: @screen-xs; + +// Small screen / tablet +@screen-sm: 576px; +@screen-sm-min: @screen-sm; + +// Medium screen / desktop +@screen-md: 768px; +@screen-md-min: @screen-md; + +// Large screen / wide desktop +@screen-lg: 992px; +@screen-lg-min: @screen-lg; + +// Extra large screen / full hd +@screen-xl: 1200px; +@screen-xl-min: @screen-xl; + +// Extra extra large screen / large desktop +@screen-2xl: 1600px; +@screen-2xl-min: @screen-2xl; + +@screen-xs-max: (@screen-sm-min - 1px); +@screen-sm-max: (@screen-md-min - 1px); +@screen-md-max: (@screen-lg-min - 1px); +@screen-lg-max: (@screen-xl-min - 1px); +@screen-xl-max: (@screen-2xl-min - 1px); diff --git a/monolithic/frontend/src/design/var/easing.less b/monolithic/frontend/src/design/var/easing.less new file mode 100644 index 0000000..e19735f --- /dev/null +++ b/monolithic/frontend/src/design/var/easing.less @@ -0,0 +1,18 @@ +// ================================= +// ==============动画函数-=========== +// ================================= + +@ease-base-out: cubic-bezier(0.7, 0.3, 0.1, 1); +@ease-base-in: cubic-bezier(0.9, 0, 0.3, 0.7); +@ease-out: cubic-bezier(0.215, 0.61, 0.355, 1); +@ease-in: cubic-bezier(0.55, 0.055, 0.675, 0.19); +@ease-in-out: cubic-bezier(0.645, 0.045, 0.355, 1); +@ease-out-back: cubic-bezier(0.12, 0.4, 0.29, 1.46); +@ease-in-back: cubic-bezier(0.71, -0.46, 0.88, 0.6); +@ease-in-out-back: cubic-bezier(0.71, -0.46, 0.29, 1.46); +@ease-out-circ: cubic-bezier(0.08, 0.82, 0.17, 1); +@ease-in-circ: cubic-bezier(0.6, 0.04, 0.98, 0.34); +@ease-in-out-circ: cubic-bezier(0.78, 0.14, 0.15, 0.86); +@ease-out-quint: cubic-bezier(0.23, 1, 0.32, 1); +@ease-in-quint: cubic-bezier(0.755, 0.05, 0.855, 0.06); +@ease-in-out-quint: cubic-bezier(0.86, 0, 0.07, 1); diff --git a/monolithic/frontend/src/design/var/index.less b/monolithic/frontend/src/design/var/index.less new file mode 100644 index 0000000..1689f76 --- /dev/null +++ b/monolithic/frontend/src/design/var/index.less @@ -0,0 +1,39 @@ +@import (reference) '../color.less'; +@import 'easing'; +@import 'breakpoint'; + +@namespace: vben; + +// tabs +@multiple-height: 30px; + +// headers +@header-height: 48px; + +// logo width +@logo-width: 32px; + +// +@side-drag-z-index: 200; + +@page-loading-z-index: 10000; + +@lock-page-z-index: 3000; + +@layout-header-fixed-z-index: 500; + +@multiple-tab-fixed-z-index: 505; + +@layout-sider-fixed-z-index: 510; + +@layout-mix-sider-fixed-z-index: 550; + +@preview-comp-z-index: 1000; + +@page-footer-z-index: 99; + +.bem(@n; @content) { + @{namespace}-@{n} { + @content(); + } +} diff --git a/monolithic/frontend/src/directives/clickOutside.ts b/monolithic/frontend/src/directives/clickOutside.ts new file mode 100644 index 0000000..f6f3051 --- /dev/null +++ b/monolithic/frontend/src/directives/clickOutside.ts @@ -0,0 +1,86 @@ +import { on } from '/@/utils/domUtils'; +import { isServer } from '/@/utils/is'; +import type { ComponentPublicInstance, DirectiveBinding, ObjectDirective } from 'vue'; + +type DocumentHandler = (mouseup: T, mousedown: T) => void; + +type FlushList = Map< + HTMLElement, + { + documentHandler: DocumentHandler; + bindingFn: (...args: unknown[]) => unknown; + } +>; + +const nodeList: FlushList = new Map(); + +let startClick: MouseEvent; + +if (!isServer) { + on(document, 'mousedown', (e: MouseEvent) => (startClick = e)); + on(document, 'mouseup', (e: MouseEvent) => { + for (const { documentHandler } of nodeList.values()) { + documentHandler(e, startClick); + } + }); +} + +function createDocumentHandler(el: HTMLElement, binding: DirectiveBinding): DocumentHandler { + let excludes: HTMLElement[] = []; + if (Array.isArray(binding.arg)) { + excludes = binding.arg; + } else { + // due to current implementation on binding type is wrong the type casting is necessary here + excludes.push(binding.arg as unknown as HTMLElement); + } + return function (mouseup, mousedown) { + const popperRef = ( + binding.instance as ComponentPublicInstance<{ + popperRef: Nullable; + }> + ).popperRef; + const mouseUpTarget = mouseup.target as Node; + const mouseDownTarget = mousedown.target as Node; + const isBound = !binding || !binding.instance; + const isTargetExists = !mouseUpTarget || !mouseDownTarget; + const isContainedByEl = el.contains(mouseUpTarget) || el.contains(mouseDownTarget); + const isSelf = el === mouseUpTarget; + + const isTargetExcluded = + (excludes.length && excludes.some((item) => item?.contains(mouseUpTarget))) || + (excludes.length && excludes.includes(mouseDownTarget as HTMLElement)); + const isContainedByPopper = + popperRef && (popperRef.contains(mouseUpTarget) || popperRef.contains(mouseDownTarget)); + if ( + isBound || + isTargetExists || + isContainedByEl || + isSelf || + isTargetExcluded || + isContainedByPopper + ) { + return; + } + binding.value(); + }; +} + +const ClickOutside: ObjectDirective = { + beforeMount(el, binding) { + nodeList.set(el, { + documentHandler: createDocumentHandler(el, binding), + bindingFn: binding.value, + }); + }, + updated(el, binding) { + nodeList.set(el, { + documentHandler: createDocumentHandler(el, binding), + bindingFn: binding.value, + }); + }, + unmounted(el) { + nodeList.delete(el); + }, +}; + +export default ClickOutside; diff --git a/monolithic/frontend/src/directives/index.ts b/monolithic/frontend/src/directives/index.ts new file mode 100644 index 0000000..0329eb6 --- /dev/null +++ b/monolithic/frontend/src/directives/index.ts @@ -0,0 +1,11 @@ +/** + * Configure and register global directives + */ +import type { App } from 'vue'; +import { setupPermissionDirective } from './permission'; +import { setupLoadingDirective } from './loading'; + +export function setupGlobDirectives(app: App) { + setupPermissionDirective(app); + setupLoadingDirective(app); +} diff --git a/monolithic/frontend/src/directives/loading.ts b/monolithic/frontend/src/directives/loading.ts new file mode 100644 index 0000000..712b71c --- /dev/null +++ b/monolithic/frontend/src/directives/loading.ts @@ -0,0 +1,39 @@ +import { createLoading } from '/@/components/Loading'; +import type { Directive, App } from 'vue'; + +const loadingDirective: Directive = { + mounted(el, binding) { + const tip = el.getAttribute('loading-tip'); + const background = el.getAttribute('loading-background'); + const size = el.getAttribute('loading-size'); + const fullscreen = !!binding.modifiers.fullscreen; + const instance = createLoading( + { + tip, + background, + size: size || 'large', + loading: !!binding.value, + absolute: !fullscreen, + }, + fullscreen ? document.body : el, + ); + el.instance = instance; + }, + updated(el, binding) { + const instance = el.instance; + if (!instance) return; + instance.setTip(el.getAttribute('loading-tip')); + if (binding.oldValue !== binding.value) { + instance.setLoading?.(binding.value && !instance.loading); + } + }, + unmounted(el) { + el?.instance?.close(); + }, +}; + +export function setupLoadingDirective(app: App) { + app.directive('loading', loadingDirective); +} + +export default loadingDirective; diff --git a/monolithic/frontend/src/directives/permission.ts b/monolithic/frontend/src/directives/permission.ts new file mode 100644 index 0000000..ca5d0fc --- /dev/null +++ b/monolithic/frontend/src/directives/permission.ts @@ -0,0 +1,32 @@ +/** + * Global authority directive + * Used for fine-grained control of component permissions + * @Example v-auth="RoleEnum.TEST" + */ +import type { App, Directive, DirectiveBinding } from 'vue'; + +import { usePermission } from '/@/hooks/web/usePermission'; + +function isAuth(el: Element, binding: any) { + const { hasPermission } = usePermission(); + + const value = binding.value; + if (!value) return; + if (!hasPermission(value)) { + el.parentNode?.removeChild(el); + } +} + +const mounted = (el: Element, binding: DirectiveBinding) => { + isAuth(el, binding); +}; + +const authDirective: Directive = { + mounted, +}; + +export function setupPermissionDirective(app: App) { + app.directive('auth', authDirective); +} + +export default authDirective; diff --git a/monolithic/frontend/src/directives/repeatClick.ts b/monolithic/frontend/src/directives/repeatClick.ts new file mode 100644 index 0000000..d4ef150 --- /dev/null +++ b/monolithic/frontend/src/directives/repeatClick.ts @@ -0,0 +1,31 @@ +/** + * Prevent repeated clicks + * @Example v-repeat-click="()=>{}" + */ +import { on, once } from '/@/utils/domUtils'; +import type { Directive, DirectiveBinding } from 'vue'; + +const repeatDirective: Directive = { + beforeMount(el: Element, binding: DirectiveBinding) { + let interval: Nullable = null; + let startTime = 0; + const handler = (): void => binding?.value(); + const clear = (): void => { + if (Date.now() - startTime < 100) { + handler(); + } + interval && clearInterval(interval); + interval = null; + }; + + on(el, 'mousedown', (e: MouseEvent): void => { + if ((e as any).button !== 0) return; + startTime = Date.now(); + once(document as any, 'mouseup', clear); + interval && clearInterval(interval); + interval = setInterval(handler, 100); + }); + }, +}; + +export default repeatDirective; diff --git a/monolithic/frontend/src/directives/ripple/index.less b/monolithic/frontend/src/directives/ripple/index.less new file mode 100644 index 0000000..9c0718e --- /dev/null +++ b/monolithic/frontend/src/directives/ripple/index.less @@ -0,0 +1,21 @@ +.ripple-container { + position: absolute; + top: 0; + left: 0; + width: 0; + height: 0; + overflow: hidden; + pointer-events: none; +} + +.ripple-effect { + position: relative; + z-index: 9999; + width: 1px; + height: 1px; + margin-top: 0; + margin-left: 0; + pointer-events: none; + border-radius: 50%; + transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1); +} diff --git a/monolithic/frontend/src/directives/ripple/index.ts b/monolithic/frontend/src/directives/ripple/index.ts new file mode 100644 index 0000000..85a80e8 --- /dev/null +++ b/monolithic/frontend/src/directives/ripple/index.ts @@ -0,0 +1,191 @@ +import type { Directive } from 'vue'; +import './index.less'; +export interface RippleOptions { + event: string; + transition: number; +} + +export interface RippleProto { + background?: string; + zIndex?: string; +} + +export type EventType = Event & MouseEvent & TouchEvent; + +const options: RippleOptions = { + event: 'mousedown', + transition: 400, +}; + +const RippleDirective: Directive & RippleProto = { + beforeMount: (el: HTMLElement, binding) => { + if (binding.value === false) return; + + const bg = el.getAttribute('ripple-background'); + setProps(Object.keys(binding.modifiers), options); + + const background = bg || RippleDirective.background; + const zIndex = RippleDirective.zIndex; + + el.addEventListener(options.event, (event: EventType) => { + rippler({ + event, + el, + background, + zIndex, + }); + }); + }, + updated(el, binding) { + if (!binding.value) { + el?.clearRipple?.(); + return; + } + const bg = el.getAttribute('ripple-background'); + el?.setBackground?.(bg); + }, +}; + +function rippler({ + event, + el, + zIndex, + background, +}: { event: EventType; el: HTMLElement } & RippleProto) { + const targetBorder = parseInt(getComputedStyle(el).borderWidth.replace('px', '')); + const clientX = event.clientX || event.touches[0].clientX; + const clientY = event.clientY || event.touches[0].clientY; + + const rect = el.getBoundingClientRect(); + const { left, top } = rect; + const { offsetWidth: width, offsetHeight: height } = el; + const { transition } = options; + const dx = clientX - left; + const dy = clientY - top; + const maxX = Math.max(dx, width - dx); + const maxY = Math.max(dy, height - dy); + const style = window.getComputedStyle(el); + const radius = Math.sqrt(maxX * maxX + maxY * maxY); + const border = targetBorder > 0 ? targetBorder : 0; + + const ripple = document.createElement('div'); + const rippleContainer = document.createElement('div'); + + // Styles for ripple + ripple.className = 'ripple'; + + Object.assign(ripple.style ?? {}, { + marginTop: '0px', + marginLeft: '0px', + width: '1px', + height: '1px', + transition: `all ${transition}ms cubic-bezier(0.4, 0, 0.2, 1)`, + borderRadius: '50%', + pointerEvents: 'none', + position: 'relative', + zIndex: zIndex ?? '9999', + backgroundColor: background ?? 'rgba(0, 0, 0, 0.12)', + }); + + // Styles for rippleContainer + rippleContainer.className = 'ripple-container'; + Object.assign(rippleContainer.style ?? {}, { + position: 'absolute', + left: `${0 - border}px`, + top: `${0 - border}px`, + height: '0', + width: '0', + pointerEvents: 'none', + overflow: 'hidden', + }); + + const storedTargetPosition = + el.style.position.length > 0 ? el.style.position : getComputedStyle(el).position; + + if (storedTargetPosition !== 'relative') { + el.style.position = 'relative'; + } + + rippleContainer.appendChild(ripple); + el.appendChild(rippleContainer); + + Object.assign(ripple.style, { + marginTop: `${dy}px`, + marginLeft: `${dx}px`, + }); + + const { + borderTopLeftRadius, + borderTopRightRadius, + borderBottomLeftRadius, + borderBottomRightRadius, + } = style; + Object.assign(rippleContainer.style, { + width: `${width}px`, + height: `${height}px`, + direction: 'ltr', + borderTopLeftRadius, + borderTopRightRadius, + borderBottomLeftRadius, + borderBottomRightRadius, + }); + + setTimeout(() => { + const wh = `${radius * 2}px`; + Object.assign(ripple.style ?? {}, { + width: wh, + height: wh, + marginLeft: `${dx - radius}px`, + marginTop: `${dy - radius}px`, + }); + }, 0); + + function clearRipple() { + setTimeout(() => { + ripple.style.backgroundColor = 'rgba(0, 0, 0, 0)'; + }, 250); + + setTimeout(() => { + rippleContainer?.parentNode?.removeChild(rippleContainer); + }, 850); + el.removeEventListener('mouseup', clearRipple, false); + el.removeEventListener('mouseleave', clearRipple, false); + el.removeEventListener('dragstart', clearRipple, false); + setTimeout(() => { + let clearPosition = true; + for (let i = 0; i < el.childNodes.length; i++) { + if ((el.childNodes[i] as Recordable).className === 'ripple-container') { + clearPosition = false; + } + } + + if (clearPosition) { + el.style.position = storedTargetPosition !== 'static' ? storedTargetPosition : ''; + } + }, options.transition + 260); + } + + if (event.type === 'mousedown') { + el.addEventListener('mouseup', clearRipple, false); + el.addEventListener('mouseleave', clearRipple, false); + el.addEventListener('dragstart', clearRipple, false); + } else { + clearRipple(); + } + + (el as Recordable).setBackground = (bgColor: string) => { + if (!bgColor) { + return; + } + ripple.style.backgroundColor = bgColor; + }; +} + +function setProps(modifiers: Recordable, props: Recordable) { + modifiers.forEach((item: Recordable) => { + if (isNaN(Number(item))) props.event = item; + else props.transition = item; + }); +} + +export default RippleDirective; diff --git a/monolithic/frontend/src/enums/appEnum.ts b/monolithic/frontend/src/enums/appEnum.ts new file mode 100644 index 0000000..1fc3989 --- /dev/null +++ b/monolithic/frontend/src/enums/appEnum.ts @@ -0,0 +1,52 @@ +export const SIDE_BAR_MINI_WIDTH = 48; +export const SIDE_BAR_SHOW_TIT_MINI_WIDTH = 80; + +export enum ContentEnum { + // auto width + FULL = 'full', + // fixed width + FIXED = 'fixed', +} + +// menu theme enum +export enum ThemeEnum { + DARK = 'dark', + LIGHT = 'light', +} + +export enum SettingButtonPositionEnum { + AUTO = 'auto', + HEADER = 'header', + FIXED = 'fixed', +} + +export enum SessionTimeoutProcessingEnum { + ROUTE_JUMP, + PAGE_COVERAGE, +} + +/** + * 权限模式 + */ +export enum PermissionModeEnum { + // role + // 角色权限 + ROLE = 'ROLE', + // black + // 后端 + BACK = 'BACK', + // route mapping + // 路由映射 + ROUTE_MAPPING = 'ROUTE_MAPPING', +} + +// Route switching animation +// 路由切换动画 +export enum RouterTransitionEnum { + ZOOM_FADE = 'zoom-fade', + ZOOM_OUT = 'zoom-out', + FADE_SIDE = 'fade-slide', + FADE = 'fade', + FADE_BOTTOM = 'fade-bottom', + FADE_SCALE = 'fade-scale', +} diff --git a/monolithic/frontend/src/enums/breakpointEnum.ts b/monolithic/frontend/src/enums/breakpointEnum.ts new file mode 100644 index 0000000..93acc1a --- /dev/null +++ b/monolithic/frontend/src/enums/breakpointEnum.ts @@ -0,0 +1,28 @@ +export enum sizeEnum { + XS = 'XS', + SM = 'SM', + MD = 'MD', + LG = 'LG', + XL = 'XL', + XXL = 'XXL', +} + +export enum screenEnum { + XS = 480, + SM = 576, + MD = 768, + LG = 992, + XL = 1200, + XXL = 1600, +} + +const screenMap = new Map(); + +screenMap.set(sizeEnum.XS, screenEnum.XS); +screenMap.set(sizeEnum.SM, screenEnum.SM); +screenMap.set(sizeEnum.MD, screenEnum.MD); +screenMap.set(sizeEnum.LG, screenEnum.LG); +screenMap.set(sizeEnum.XL, screenEnum.XL); +screenMap.set(sizeEnum.XXL, screenEnum.XXL); + +export { screenMap }; diff --git a/monolithic/frontend/src/enums/cacheEnum.ts b/monolithic/frontend/src/enums/cacheEnum.ts new file mode 100644 index 0000000..4a5cc11 --- /dev/null +++ b/monolithic/frontend/src/enums/cacheEnum.ts @@ -0,0 +1,31 @@ +// token key +export const TOKEN_KEY = 'TOKEN__'; + +export const LOCALE_KEY = 'LOCALE__'; + +// user info key +export const USER_INFO_KEY = 'USER__INFO__'; + +// role info key +export const ROLES_KEY = 'ROLES__KEY__'; + +// project config key +export const PROJ_CFG_KEY = 'PROJ__CFG__KEY__'; + +// lock info +export const LOCK_INFO_KEY = 'LOCK__INFO__KEY__'; + +export const MULTIPLE_TABS_KEY = 'MULTIPLE_TABS__KEY__'; + +export const APP_DARK_MODE_KEY_ = '__APP__DARK__MODE__'; + +// base global local key +export const APP_LOCAL_CACHE_KEY = 'COMMON__LOCAL__KEY__'; + +// base global session key +export const APP_SESSION_CACHE_KEY = 'COMMON__SESSION__KEY__'; + +export enum CacheTypeEnum { + SESSION, + LOCAL, +} diff --git a/monolithic/frontend/src/enums/exceptionEnum.ts b/monolithic/frontend/src/enums/exceptionEnum.ts new file mode 100644 index 0000000..d28f4d0 --- /dev/null +++ b/monolithic/frontend/src/enums/exceptionEnum.ts @@ -0,0 +1,27 @@ +/** + * @description: Exception related enumeration + */ +export enum ExceptionEnum { + // page not access + PAGE_NOT_ACCESS = 403, + + // page not found + PAGE_NOT_FOUND = 404, + + // error + ERROR = 500, + + // net work error + NET_WORK_ERROR = 10000, + + // No data on the page. In fact, it is not an exception page + PAGE_NOT_DATA = 10100, +} + +export enum ErrorTypeEnum { + VUE = 'vue', + SCRIPT = 'script', + RESOURCE = 'resource', + AJAX = 'ajax', + PROMISE = 'promise', +} diff --git a/monolithic/frontend/src/enums/httpEnum.ts b/monolithic/frontend/src/enums/httpEnum.ts new file mode 100644 index 0000000..857109b --- /dev/null +++ b/monolithic/frontend/src/enums/httpEnum.ts @@ -0,0 +1,57 @@ +/** + * @description: Request result set + */ +export enum ResultEnum { + SUCCESS = 0, + ERROR = -1, + TIMEOUT = 401, + TYPE = 'success', +} + +/** + * @description: request method + */ +export enum RequestEnum { + GET = 'GET', + POST = 'POST', + PUT = 'PUT', + DELETE = 'DELETE', +} + +/** + * @description: contentType + */ +export enum ContentTypeEnum { + // json + JSON = 'application/json;charset=UTF-8', + // form-data qs + FORM_URLENCODED = 'application/x-www-form-urlencoded;charset=UTF-8', + // form-data upload + FORM_DATA = 'multipart/form-data;charset=UTF-8', +} + +/** + * @description: 开关状态 + */ +export const SwitchStatusEnum = { + // 开启 + ON: 'ON', + + // 关闭 + OFF: 'OFF', +}; +export const isOn = (status?: string) => status === SwitchStatusEnum.ON; + +export const MenuTypeEnum = { + // 目录 + FOLDER: 'FOLDER', + + // 菜单 + MENU: 'MENU', + + // 按钮 + BUTTON: 'BUTTON', +}; +export const isDir = (menuType?: string) => menuType === MenuTypeEnum.FOLDER; +export const isMenu = (menuType?: string) => menuType === MenuTypeEnum.MENU; +export const isButton = (menuType?: string) => menuType === MenuTypeEnum.BUTTON; diff --git a/monolithic/frontend/src/enums/menuEnum.ts b/monolithic/frontend/src/enums/menuEnum.ts new file mode 100644 index 0000000..89cfa9f --- /dev/null +++ b/monolithic/frontend/src/enums/menuEnum.ts @@ -0,0 +1,50 @@ +/** + * @description: menu type + */ +export enum MenuTypeEnum { + // left menu + SIDEBAR = 'sidebar', + + MIX_SIDEBAR = 'mix-sidebar', + // mixin menu + MIX = 'mix', + // top menu + TOP_MENU = 'top-menu', +} + +// 折叠触发器位置 +export enum TriggerEnum { + // 不显示 + NONE = 'NONE', + // 菜单底部 + FOOTER = 'FOOTER', + // 头部 + HEADER = 'HEADER', +} + +export type Mode = 'vertical' | 'vertical-right' | 'horizontal' | 'inline'; + +// menu mode +export enum MenuModeEnum { + VERTICAL = 'vertical', + HORIZONTAL = 'horizontal', + VERTICAL_RIGHT = 'vertical-right', + INLINE = 'inline', +} + +export enum MenuSplitTyeEnum { + NONE, + TOP, + LEFT, +} + +export enum TopMenuAlignEnum { + CENTER = 'center', + START = 'start', + END = 'end', +} + +export enum MixSidebarTriggerEnum { + HOVER = 'hover', + CLICK = 'click', +} diff --git a/monolithic/frontend/src/enums/pageEnum.ts b/monolithic/frontend/src/enums/pageEnum.ts new file mode 100644 index 0000000..c7ca363 --- /dev/null +++ b/monolithic/frontend/src/enums/pageEnum.ts @@ -0,0 +1,10 @@ +export enum PageEnum { + // basic login path + BASE_LOGIN = '/login', + // basic home path + BASE_HOME = '/dashboard', + // error page path + ERROR_PAGE = '/exception', + // error log page path + ERROR_LOG_PAGE = '/error-log/list', +} diff --git a/monolithic/frontend/src/enums/roleEnum.ts b/monolithic/frontend/src/enums/roleEnum.ts new file mode 100644 index 0000000..857868d --- /dev/null +++ b/monolithic/frontend/src/enums/roleEnum.ts @@ -0,0 +1,7 @@ +export enum RoleEnum { + // super admin + SUPER = 'super', + + // tester + TEST = 'test', +} diff --git a/monolithic/frontend/src/enums/sizeEnum.ts b/monolithic/frontend/src/enums/sizeEnum.ts new file mode 100644 index 0000000..9bac184 --- /dev/null +++ b/monolithic/frontend/src/enums/sizeEnum.ts @@ -0,0 +1,19 @@ +export enum SizeEnum { + DEFAULT = 'default', + SMALL = 'small', + LARGE = 'large', +} + +export enum SizeNumberEnum { + DEFAULT = 48, + SMALL = 16, + LARGE = 64, +} + +export const sizeMap: Map = (() => { + const map = new Map(); + map.set(SizeEnum.DEFAULT, SizeNumberEnum.DEFAULT); + map.set(SizeEnum.SMALL, SizeNumberEnum.SMALL); + map.set(SizeEnum.LARGE, SizeNumberEnum.LARGE); + return map; +})(); diff --git a/monolithic/frontend/src/hooks/component/useFormItem.ts b/monolithic/frontend/src/hooks/component/useFormItem.ts new file mode 100644 index 0000000..cee415e --- /dev/null +++ b/monolithic/frontend/src/hooks/component/useFormItem.ts @@ -0,0 +1,60 @@ +import type { UnwrapRef, Ref, WritableComputedRef, DeepReadonly } from 'vue'; +import { + reactive, + readonly, + computed, + getCurrentInstance, + watchEffect, + unref, + nextTick, + toRaw, +} from 'vue'; + +import { isEqual } from 'lodash-es'; + +export function useRuleFormItem>( + props: T, + key?: K, + changeEvent?, + emitData?: Ref, +): [WritableComputedRef, (val: V) => void, DeepReadonly]; + +export function useRuleFormItem( + props: T, + key: keyof T = 'value', + changeEvent = 'change', + emitData?: Ref, +) { + const instance = getCurrentInstance(); + const emit = instance?.emit; + + const innerState = reactive({ + value: props[key], + }); + + const defaultState = readonly(innerState); + + const setState = (val: UnwrapRef): void => { + innerState.value = val as T[keyof T]; + }; + + watchEffect(() => { + innerState.value = props[key]; + }); + + const state: any = computed({ + get() { + return innerState.value; + }, + set(value) { + if (isEqual(value, defaultState.value)) return; + + innerState.value = value as T[keyof T]; + nextTick(() => { + emit?.(changeEvent, value, ...(toRaw(unref(emitData)) || [])); + }); + }, + }); + + return [state, setState, defaultState]; +} diff --git a/monolithic/frontend/src/hooks/component/usePageContext.ts b/monolithic/frontend/src/hooks/component/usePageContext.ts new file mode 100644 index 0000000..12cc160 --- /dev/null +++ b/monolithic/frontend/src/hooks/component/usePageContext.ts @@ -0,0 +1,18 @@ +import type { InjectionKey, ComputedRef, Ref } from 'vue'; +import { createContext, useContext } from '/@/hooks/core/useContext'; + +export interface PageContextProps { + contentHeight: ComputedRef; + pageHeight: Ref; + setPageHeight: (height: number) => Promise; +} + +const key: InjectionKey = Symbol(); + +export function createPageContext(context: PageContextProps) { + return createContext(context, key, { native: true }); +} + +export function usePageContext() { + return useContext(key); +} diff --git a/monolithic/frontend/src/hooks/core/onMountedOrActivated.ts b/monolithic/frontend/src/hooks/core/onMountedOrActivated.ts new file mode 100644 index 0000000..ffabf18 --- /dev/null +++ b/monolithic/frontend/src/hooks/core/onMountedOrActivated.ts @@ -0,0 +1,18 @@ +import { nextTick, onMounted, onActivated } from 'vue'; + +export function onMountedOrActivated(hook: Fn) { + let mounted: boolean; + + onMounted(() => { + hook(); + nextTick(() => { + mounted = true; + }); + }); + + onActivated(() => { + if (mounted) { + hook(); + } + }); +} diff --git a/monolithic/frontend/src/hooks/core/useAttrs.ts b/monolithic/frontend/src/hooks/core/useAttrs.ts new file mode 100644 index 0000000..a7c5bd7 --- /dev/null +++ b/monolithic/frontend/src/hooks/core/useAttrs.ts @@ -0,0 +1,40 @@ +import { getCurrentInstance, reactive, shallowRef, watchEffect } from 'vue'; +import type { Ref } from 'vue'; +interface Params { + excludeListeners?: boolean; + excludeKeys?: string[]; + excludeDefaultKeys?: boolean; +} + +const DEFAULT_EXCLUDE_KEYS = ['class', 'style']; +const LISTENER_PREFIX = /^on[A-Z]/; + +export function entries(obj: Recordable): [string, T][] { + return Object.keys(obj).map((key: string) => [key, obj[key]]); +} + +export function useAttrs(params: Params = {}): Ref | {} { + const instance = getCurrentInstance(); + if (!instance) return {}; + + const { excludeListeners = false, excludeKeys = [], excludeDefaultKeys = true } = params; + const attrs = shallowRef({}); + const allExcludeKeys = excludeKeys.concat(excludeDefaultKeys ? DEFAULT_EXCLUDE_KEYS : []); + + // Since attrs are not reactive, make it reactive instead of doing in `onUpdated` hook for better performance + instance.attrs = reactive(instance.attrs); + + watchEffect(() => { + const res = entries(instance.attrs).reduce((acm, [key, val]) => { + if (!allExcludeKeys.includes(key) && !(excludeListeners && LISTENER_PREFIX.test(key))) { + acm[key] = val; + } + + return acm; + }, {} as Recordable); + + attrs.value = res; + }); + + return attrs; +} diff --git a/monolithic/frontend/src/hooks/core/useContext.ts b/monolithic/frontend/src/hooks/core/useContext.ts new file mode 100644 index 0000000..c686187 --- /dev/null +++ b/monolithic/frontend/src/hooks/core/useContext.ts @@ -0,0 +1,44 @@ +import { + InjectionKey, + provide, + inject, + reactive, + readonly as defineReadonly, + // defineComponent, + UnwrapRef, +} from 'vue'; + +export interface CreateContextOptions { + readonly?: boolean; + createProvider?: boolean; + native?: boolean; +} + +type ShallowUnwrap = { + [P in keyof T]: UnwrapRef; +}; + +export function createContext( + context: any, + key: InjectionKey = Symbol(), + options: CreateContextOptions = {}, +) { + const { readonly = true, createProvider = false, native = false } = options; + + const state = reactive(context); + const provideData = readonly ? defineReadonly(state) : state; + !createProvider && provide(key, native ? context : provideData); + + return { + state, + }; +} + +export function useContext(key: InjectionKey, native?: boolean): T; + +export function useContext( + key: InjectionKey = Symbol(), + defaultValue?: any, +): ShallowUnwrap { + return inject(key, defaultValue || {}); +} diff --git a/monolithic/frontend/src/hooks/core/useLockFn.ts b/monolithic/frontend/src/hooks/core/useLockFn.ts new file mode 100644 index 0000000..0fd271f --- /dev/null +++ b/monolithic/frontend/src/hooks/core/useLockFn.ts @@ -0,0 +1,17 @@ +import { ref, unref } from 'vue'; + +export function useLockFn

(fn: (...args: P) => Promise) { + const lockRef = ref(false); + return async function (...args: P) { + if (unref(lockRef)) return; + lockRef.value = true; + try { + const ret = await fn(...args); + lockRef.value = false; + return ret; + } catch (e: any) { + lockRef.value = false; + throw e; + } + }; +} diff --git a/monolithic/frontend/src/hooks/core/useRefs.ts b/monolithic/frontend/src/hooks/core/useRefs.ts new file mode 100644 index 0000000..180bb14 --- /dev/null +++ b/monolithic/frontend/src/hooks/core/useRefs.ts @@ -0,0 +1,16 @@ +import type { Ref } from 'vue'; +import { ref, onBeforeUpdate } from 'vue'; + +export function useRefs(): [Ref, (index: number) => (el: HTMLElement) => void] { + const refs = ref([]) as Ref; + + onBeforeUpdate(() => { + refs.value = []; + }); + + const setRefs = (index: number) => (el: HTMLElement) => { + refs.value[index] = el; + }; + + return [refs, setRefs]; +} diff --git a/monolithic/frontend/src/hooks/core/useTimeout.ts b/monolithic/frontend/src/hooks/core/useTimeout.ts new file mode 100644 index 0000000..9905c2b --- /dev/null +++ b/monolithic/frontend/src/hooks/core/useTimeout.ts @@ -0,0 +1,45 @@ +import { ref, watch } from 'vue'; +import { tryOnUnmounted } from '@vueuse/core'; +import { isFunction } from '/@/utils/is'; + +export function useTimeoutFn(handle: Fn, wait: number, native = false) { + if (!isFunction(handle)) { + throw new Error('handle is not Function!'); + } + + const { readyRef, stop, start } = useTimeoutRef(wait); + if (native) { + handle(); + } else { + watch( + readyRef, + (maturity) => { + maturity && handle(); + }, + { immediate: false }, + ); + } + return { readyRef, stop, start }; +} + +export function useTimeoutRef(wait: number) { + const readyRef = ref(false); + + let timer: TimeoutHandle; + function stop(): void { + readyRef.value = false; + timer && window.clearTimeout(timer); + } + function start(): void { + stop(); + timer = setTimeout(() => { + readyRef.value = true; + }, wait); + } + + start(); + + tryOnUnmounted(stop); + + return { readyRef, stop, start }; +} diff --git a/monolithic/frontend/src/hooks/event/useBreakpoint.ts b/monolithic/frontend/src/hooks/event/useBreakpoint.ts new file mode 100644 index 0000000..01bbbec --- /dev/null +++ b/monolithic/frontend/src/hooks/event/useBreakpoint.ts @@ -0,0 +1,89 @@ +import { ref, computed, ComputedRef, unref } from 'vue'; +import { useEventListener } from '/@/hooks/event/useEventListener'; +import { screenMap, sizeEnum, screenEnum } from '/@/enums/breakpointEnum'; + +let globalScreenRef: ComputedRef; +let globalWidthRef: ComputedRef; +let globalRealWidthRef: ComputedRef; + +export interface CreateCallbackParams { + screen: ComputedRef; + width: ComputedRef; + realWidth: ComputedRef; + screenEnum: typeof screenEnum; + screenMap: Map; + sizeEnum: typeof sizeEnum; +} + +export function useBreakpoint() { + return { + screenRef: computed(() => unref(globalScreenRef)), + widthRef: globalWidthRef, + screenEnum, + realWidthRef: globalRealWidthRef, + }; +} + +// Just call it once +export function createBreakpointListen(fn?: (opt: CreateCallbackParams) => void) { + const screenRef = ref(sizeEnum.XL); + const realWidthRef = ref(window.innerWidth); + + function getWindowWidth() { + const width = document.body.clientWidth; + const xs = screenMap.get(sizeEnum.XS)!; + const sm = screenMap.get(sizeEnum.SM)!; + const md = screenMap.get(sizeEnum.MD)!; + const lg = screenMap.get(sizeEnum.LG)!; + const xl = screenMap.get(sizeEnum.XL)!; + if (width < xs) { + screenRef.value = sizeEnum.XS; + } else if (width < sm) { + screenRef.value = sizeEnum.SM; + } else if (width < md) { + screenRef.value = sizeEnum.MD; + } else if (width < lg) { + screenRef.value = sizeEnum.LG; + } else if (width < xl) { + screenRef.value = sizeEnum.XL; + } else { + screenRef.value = sizeEnum.XXL; + } + realWidthRef.value = width; + } + + useEventListener({ + el: window, + name: 'resize', + + listener: () => { + getWindowWidth(); + resizeFn(); + }, + // wait: 100, + }); + + getWindowWidth(); + globalScreenRef = computed(() => unref(screenRef)); + globalWidthRef = computed((): number => screenMap.get(unref(screenRef)!)!); + globalRealWidthRef = computed((): number => unref(realWidthRef)); + + function resizeFn() { + fn?.({ + screen: globalScreenRef, + width: globalWidthRef, + realWidth: globalRealWidthRef, + screenEnum, + screenMap, + sizeEnum, + }); + } + + resizeFn(); + return { + screenRef: globalScreenRef, + screenEnum, + widthRef: globalWidthRef, + realWidthRef: globalRealWidthRef, + }; +} diff --git a/monolithic/frontend/src/hooks/event/useEventListener.ts b/monolithic/frontend/src/hooks/event/useEventListener.ts new file mode 100644 index 0000000..892cd92 --- /dev/null +++ b/monolithic/frontend/src/hooks/event/useEventListener.ts @@ -0,0 +1,58 @@ +import type { Ref } from 'vue'; +import { ref, watch, unref } from 'vue'; +import { useThrottleFn, useDebounceFn } from '@vueuse/core'; + +export type RemoveEventFn = () => void; +export interface UseEventParams { + el?: Element | Ref | Window | any; + name: string; + listener: EventListener; + options?: boolean | AddEventListenerOptions; + autoRemove?: boolean; + isDebounce?: boolean; + wait?: number; +} +export function useEventListener({ + el = window, + name, + listener, + options, + autoRemove = true, + isDebounce = true, + wait = 80, +}: UseEventParams): { removeEvent: RemoveEventFn } { + /* eslint-disable-next-line */ + let remove: RemoveEventFn = () => {}; + const isAddRef = ref(false); + + if (el) { + const element = ref(el as Element) as Ref; + + const handler = isDebounce ? useDebounceFn(listener, wait) : useThrottleFn(listener, wait); + const realHandler = wait ? handler : listener; + const removeEventListener = (e: Element) => { + isAddRef.value = true; + e.removeEventListener(name, realHandler, options); + }; + const addEventListener = (e: Element) => e.addEventListener(name, realHandler, options); + + const removeWatch = watch( + element, + (v, _ov, cleanUp) => { + if (v) { + !unref(isAddRef) && addEventListener(v); + cleanUp(() => { + autoRemove && removeEventListener(v); + }); + } + }, + { immediate: true }, + ); + + remove = () => { + removeEventListener(element.value); + removeWatch(); + }; + } + return { removeEvent: remove }; +} diff --git a/monolithic/frontend/src/hooks/event/useIntersectionObserver.ts b/monolithic/frontend/src/hooks/event/useIntersectionObserver.ts new file mode 100644 index 0000000..b9badca --- /dev/null +++ b/monolithic/frontend/src/hooks/event/useIntersectionObserver.ts @@ -0,0 +1,48 @@ +import { Ref, watchEffect, ref } from 'vue'; + +interface IntersectionObserverProps { + target: Ref; + root?: Ref; + onIntersect: IntersectionObserverCallback; + rootMargin?: string; + threshold?: number; +} + +export function useIntersectionObserver({ + target, + root, + onIntersect, + rootMargin = '0px', + threshold = 0.1, +}: IntersectionObserverProps) { + let cleanup = () => {}; + const observer: Ref> = ref(null); + const stopEffect = watchEffect(() => { + cleanup(); + + observer.value = new IntersectionObserver(onIntersect, { + root: root ? root.value : null, + rootMargin, + threshold, + }); + + const current = target.value; + + current && observer.value.observe(current); + + cleanup = () => { + if (observer.value) { + observer.value.disconnect(); + target.value && observer.value.unobserve(target.value); + } + }; + }); + + return { + observer, + stop: () => { + cleanup(); + stopEffect(); + }, + }; +} diff --git a/monolithic/frontend/src/hooks/event/useScroll.ts b/monolithic/frontend/src/hooks/event/useScroll.ts new file mode 100644 index 0000000..cc60f9b --- /dev/null +++ b/monolithic/frontend/src/hooks/event/useScroll.ts @@ -0,0 +1,65 @@ +import type { Ref } from 'vue'; + +import { ref, onMounted, watch, onUnmounted } from 'vue'; +import { isWindow, isObject } from '/@/utils/is'; +import { useThrottleFn } from '@vueuse/core'; + +export function useScroll( + refEl: Ref, + options?: { + wait?: number; + leading?: boolean; + trailing?: boolean; + }, +) { + const refX = ref(0); + const refY = ref(0); + let handler = () => { + if (isWindow(refEl.value)) { + refX.value = refEl.value.scrollX; + refY.value = refEl.value.scrollY; + } else if (refEl.value) { + refX.value = (refEl.value as Element).scrollLeft; + refY.value = (refEl.value as Element).scrollTop; + } + }; + + if (isObject(options)) { + let wait = 0; + if (options.wait && options.wait > 0) { + wait = options.wait; + Reflect.deleteProperty(options, 'wait'); + } + + handler = useThrottleFn(handler, wait); + } + + let stopWatch: () => void; + onMounted(() => { + stopWatch = watch( + refEl, + (el, prevEl, onCleanup) => { + if (el) { + el.addEventListener('scroll', handler); + } else if (prevEl) { + prevEl.removeEventListener('scroll', handler); + } + onCleanup(() => { + refX.value = refY.value = 0; + el && el.removeEventListener('scroll', handler); + }); + }, + { immediate: true }, + ); + }); + + onUnmounted(() => { + refEl.value && refEl.value.removeEventListener('scroll', handler); + }); + + function stop() { + stopWatch && stopWatch(); + } + + return { refX, refY, stop }; +} diff --git a/monolithic/frontend/src/hooks/event/useScrollTo.ts b/monolithic/frontend/src/hooks/event/useScrollTo.ts new file mode 100644 index 0000000..f6d5dc6 --- /dev/null +++ b/monolithic/frontend/src/hooks/event/useScrollTo.ts @@ -0,0 +1,59 @@ +import { isFunction, isUnDef } from '/@/utils/is'; +import { ref, unref } from 'vue'; + +export interface ScrollToParams { + el: any; + to: number; + duration?: number; + callback?: () => any; +} + +const easeInOutQuad = (t: number, b: number, c: number, d: number) => { + t /= d / 2; + if (t < 1) { + return (c / 2) * t * t + b; + } + t--; + return (-c / 2) * (t * (t - 2) - 1) + b; +}; +const move = (el: HTMLElement, amount: number) => { + el.scrollTop = amount; +}; + +const position = (el: HTMLElement) => { + return el.scrollTop; +}; +export function useScrollTo({ el, to, duration = 500, callback }: ScrollToParams) { + const isActiveRef = ref(false); + const start = position(el); + const change = to - start; + const increment = 20; + let currentTime = 0; + duration = isUnDef(duration) ? 500 : duration; + + const animateScroll = function () { + if (!unref(isActiveRef)) { + return; + } + currentTime += increment; + const val = easeInOutQuad(currentTime, start, change, duration); + move(el, val); + if (currentTime < duration && unref(isActiveRef)) { + requestAnimationFrame(animateScroll); + } else { + if (callback && isFunction(callback)) { + callback(); + } + } + }; + const run = () => { + isActiveRef.value = true; + animateScroll(); + }; + + const stop = () => { + isActiveRef.value = false; + }; + + return { start: run, stop }; +} diff --git a/monolithic/frontend/src/hooks/event/useWindowSizeFn.ts b/monolithic/frontend/src/hooks/event/useWindowSizeFn.ts new file mode 100644 index 0000000..01cdc75 --- /dev/null +++ b/monolithic/frontend/src/hooks/event/useWindowSizeFn.ts @@ -0,0 +1,35 @@ +import { tryOnMounted, tryOnUnmounted, useDebounceFn } from '@vueuse/core'; + +interface WindowSizeOptions { + once?: boolean; + immediate?: boolean; + listenerOptions?: AddEventListenerOptions | boolean; +} + +export function useWindowSizeFn(fn: Fn, wait = 150, options?: WindowSizeOptions) { + let handler = () => { + fn(); + }; + const handleSize = useDebounceFn(handler, wait); + handler = handleSize; + + const start = () => { + if (options && options.immediate) { + handler(); + } + window.addEventListener('resize', handler); + }; + + const stop = () => { + window.removeEventListener('resize', handler); + }; + + tryOnMounted(() => { + start(); + }); + + tryOnUnmounted(() => { + stop(); + }); + return [start, stop]; +} diff --git a/monolithic/frontend/src/hooks/setting/index.ts b/monolithic/frontend/src/hooks/setting/index.ts new file mode 100644 index 0000000..56e393f --- /dev/null +++ b/monolithic/frontend/src/hooks/setting/index.ts @@ -0,0 +1,30 @@ +import type { GlobConfig } from '/#/config'; + +import { warn } from '/@/utils/log'; +import { getAppEnvConfig } from '/@/utils/env'; + +export const useGlobSetting = (): Readonly => { + const { + VITE_GLOB_APP_TITLE, + VITE_GLOB_API_URL, + VITE_GLOB_APP_SHORT_NAME, + VITE_GLOB_API_URL_PREFIX, + VITE_GLOB_UPLOAD_URL, + } = getAppEnvConfig(); + + if (!/[a-zA-Z\_]*/.test(VITE_GLOB_APP_SHORT_NAME)) { + warn( + `VITE_GLOB_APP_SHORT_NAME Variables can only be characters/underscores, please modify in the environment variables and re-running.`, + ); + } + + // Take global configuration + const glob: Readonly = { + title: VITE_GLOB_APP_TITLE, + apiUrl: VITE_GLOB_API_URL, + shortName: VITE_GLOB_APP_SHORT_NAME, + urlPrefix: VITE_GLOB_API_URL_PREFIX, + uploadUrl: VITE_GLOB_UPLOAD_URL, + }; + return glob as Readonly; +}; diff --git a/monolithic/frontend/src/hooks/setting/useHeaderSetting.ts b/monolithic/frontend/src/hooks/setting/useHeaderSetting.ts new file mode 100644 index 0000000..d590be8 --- /dev/null +++ b/monolithic/frontend/src/hooks/setting/useHeaderSetting.ts @@ -0,0 +1,105 @@ +import type { HeaderSetting } from '/#/config'; + +import { computed, unref } from 'vue'; + +import { useAppStore } from '/@/store/modules/app'; + +import { useMenuSetting } from '/@/hooks/setting/useMenuSetting'; +import { useRootSetting } from '/@/hooks/setting/useRootSetting'; +import { useFullContent } from '/@/hooks/web/useFullContent'; +import { MenuModeEnum } from '/@/enums/menuEnum'; + +export function useHeaderSetting() { + const { getFullContent } = useFullContent(); + const appStore = useAppStore(); + + const getShowFullHeaderRef = computed(() => { + return ( + !unref(getFullContent) && + unref(getShowMixHeaderRef) && + unref(getShowHeader) && + !unref(getIsTopMenu) && + !unref(getIsMixSidebar) + ); + }); + + const getUnFixedAndFull = computed(() => !unref(getFixed) && !unref(getShowFullHeaderRef)); + + const getShowInsetHeaderRef = computed(() => { + const need = !unref(getFullContent) && unref(getShowHeader); + return ( + (need && !unref(getShowMixHeaderRef)) || + (need && unref(getIsTopMenu)) || + (need && unref(getIsMixSidebar)) + ); + }); + + const { + getMenuMode, + getSplit, + getShowHeaderTrigger, + getIsSidebarType, + getIsMixSidebar, + getIsTopMenu, + } = useMenuSetting(); + const { getShowBreadCrumb, getShowLogo } = useRootSetting(); + + const getShowMixHeaderRef = computed(() => !unref(getIsSidebarType) && unref(getShowHeader)); + + const getShowDoc = computed(() => appStore.getHeaderSetting.showDoc); + + const getHeaderTheme = computed(() => appStore.getHeaderSetting.theme); + + const getShowHeader = computed(() => appStore.getHeaderSetting.show); + + const getFixed = computed(() => appStore.getHeaderSetting.fixed); + + const getHeaderBgColor = computed(() => appStore.getHeaderSetting.bgColor); + + const getShowSearch = computed(() => appStore.getHeaderSetting.showSearch); + + const getUseLockPage = computed(() => appStore.getHeaderSetting.useLockPage); + + const getShowFullScreen = computed(() => appStore.getHeaderSetting.showFullScreen); + + const getShowNotice = computed(() => appStore.getHeaderSetting.showNotice); + + const getShowBread = computed(() => { + return ( + unref(getMenuMode) !== MenuModeEnum.HORIZONTAL && unref(getShowBreadCrumb) && !unref(getSplit) + ); + }); + + const getShowHeaderLogo = computed(() => { + return unref(getShowLogo) && !unref(getIsSidebarType) && !unref(getIsMixSidebar); + }); + + const getShowContent = computed(() => { + return unref(getShowBread) || unref(getShowHeaderTrigger); + }); + + // Set header configuration + function setHeaderSetting(headerSetting: Partial) { + appStore.setProjectConfig({ headerSetting }); + } + return { + setHeaderSetting, + + getShowDoc, + getShowSearch, + getHeaderTheme, + getUseLockPage, + getShowFullScreen, + getShowNotice, + getShowBread, + getShowContent, + getShowHeaderLogo, + getShowHeader, + getFixed, + getShowMixHeaderRef, + getShowFullHeaderRef, + getShowInsetHeaderRef, + getUnFixedAndFull, + getHeaderBgColor, + }; +} diff --git a/monolithic/frontend/src/hooks/setting/useMenuSetting.ts b/monolithic/frontend/src/hooks/setting/useMenuSetting.ts new file mode 100644 index 0000000..3566bfd --- /dev/null +++ b/monolithic/frontend/src/hooks/setting/useMenuSetting.ts @@ -0,0 +1,170 @@ +import type { MenuSetting } from '/#/config'; + +import { computed, unref, ref } from 'vue'; + +import { useAppStore } from '/@/store/modules/app'; + +import { SIDE_BAR_MINI_WIDTH, SIDE_BAR_SHOW_TIT_MINI_WIDTH } from '/@/enums/appEnum'; +import { MenuModeEnum, MenuTypeEnum, TriggerEnum } from '/@/enums/menuEnum'; +import { useFullContent } from '/@/hooks/web/useFullContent'; + +const mixSideHasChildren = ref(false); + +export function useMenuSetting() { + const { getFullContent: fullContent } = useFullContent(); + const appStore = useAppStore(); + + const getShowSidebar = computed(() => { + return ( + unref(getSplit) || + (unref(getShowMenu) && unref(getMenuMode) !== MenuModeEnum.HORIZONTAL && !unref(fullContent)) + ); + }); + + const getCollapsed = computed(() => appStore.getMenuSetting.collapsed); + + const getMenuType = computed(() => appStore.getMenuSetting.type); + + const getMenuMode = computed(() => appStore.getMenuSetting.mode); + + const getMenuFixed = computed(() => appStore.getMenuSetting.fixed); + + const getShowMenu = computed(() => appStore.getMenuSetting.show); + + const getMenuHidden = computed(() => appStore.getMenuSetting.hidden); + + const getMenuWidth = computed(() => appStore.getMenuSetting.menuWidth); + + const getTrigger = computed(() => appStore.getMenuSetting.trigger); + + const getMenuTheme = computed(() => appStore.getMenuSetting.theme); + + const getSplit = computed(() => appStore.getMenuSetting.split); + + const getMenuBgColor = computed(() => appStore.getMenuSetting.bgColor); + + const getMixSideTrigger = computed(() => appStore.getMenuSetting.mixSideTrigger); + + const getCanDrag = computed(() => appStore.getMenuSetting.canDrag); + + const getAccordion = computed(() => appStore.getMenuSetting.accordion); + + const getMixSideFixed = computed(() => appStore.getMenuSetting.mixSideFixed); + + const getTopMenuAlign = computed(() => appStore.getMenuSetting.topMenuAlign); + + const getCloseMixSidebarOnChange = computed( + () => appStore.getMenuSetting.closeMixSidebarOnChange, + ); + + const getIsSidebarType = computed(() => unref(getMenuType) === MenuTypeEnum.SIDEBAR); + + const getIsTopMenu = computed(() => unref(getMenuType) === MenuTypeEnum.TOP_MENU); + + const getCollapsedShowTitle = computed(() => appStore.getMenuSetting.collapsedShowTitle); + + const getShowTopMenu = computed(() => { + return unref(getMenuMode) === MenuModeEnum.HORIZONTAL || unref(getSplit); + }); + + const getShowHeaderTrigger = computed(() => { + if ( + unref(getMenuType) === MenuTypeEnum.TOP_MENU || + !unref(getShowMenu) || + unref(getMenuHidden) + ) { + return false; + } + + return unref(getTrigger) === TriggerEnum.HEADER; + }); + + const getIsHorizontal = computed(() => { + return unref(getMenuMode) === MenuModeEnum.HORIZONTAL; + }); + + const getIsMixSidebar = computed(() => { + return unref(getMenuType) === MenuTypeEnum.MIX_SIDEBAR; + }); + + const getIsMixMode = computed(() => { + return unref(getMenuMode) === MenuModeEnum.INLINE && unref(getMenuType) === MenuTypeEnum.MIX; + }); + + const getRealWidth = computed(() => { + if (unref(getIsMixSidebar)) { + return unref(getCollapsed) && !unref(getMixSideFixed) + ? unref(getMiniWidthNumber) + : unref(getMenuWidth); + } + return unref(getCollapsed) ? unref(getMiniWidthNumber) : unref(getMenuWidth); + }); + + const getMiniWidthNumber = computed(() => { + const { collapsedShowTitle, siderHidden } = appStore.getMenuSetting; + return siderHidden + ? 0 + : collapsedShowTitle + ? SIDE_BAR_SHOW_TIT_MINI_WIDTH + : SIDE_BAR_MINI_WIDTH; + }); + + const getCalcContentWidth = computed(() => { + const width = + unref(getIsTopMenu) || !unref(getShowMenu) || (unref(getSplit) && unref(getMenuHidden)) + ? 0 + : unref(getIsMixSidebar) + ? (unref(getCollapsed) ? SIDE_BAR_MINI_WIDTH : SIDE_BAR_SHOW_TIT_MINI_WIDTH) + + (unref(getMixSideFixed) && unref(mixSideHasChildren) ? unref(getRealWidth) : 0) + : unref(getRealWidth); + + return `calc(100% - ${unref(width)}px)`; + }); + + // Set menu configuration + function setMenuSetting(menuSetting: Partial): void { + appStore.setProjectConfig({ menuSetting }); + } + + function toggleCollapsed() { + setMenuSetting({ + collapsed: !unref(getCollapsed), + }); + } + return { + setMenuSetting, + + toggleCollapsed, + + getMenuFixed, + getRealWidth, + getMenuType, + getMenuMode, + getShowMenu, + getCollapsed, + getMiniWidthNumber, + getCalcContentWidth, + getMenuWidth, + getTrigger, + getSplit, + getMenuTheme, + getCanDrag, + getCollapsedShowTitle, + getIsHorizontal, + getIsSidebarType, + getAccordion, + getShowTopMenu, + getShowHeaderTrigger, + getTopMenuAlign, + getMenuHidden, + getIsTopMenu, + getMenuBgColor, + getShowSidebar, + getIsMixMode, + getIsMixSidebar, + getCloseMixSidebarOnChange, + getMixSideTrigger, + getMixSideFixed, + mixSideHasChildren, + }; +} diff --git a/monolithic/frontend/src/hooks/setting/useMultipleTabSetting.ts b/monolithic/frontend/src/hooks/setting/useMultipleTabSetting.ts new file mode 100644 index 0000000..7caa753 --- /dev/null +++ b/monolithic/frontend/src/hooks/setting/useMultipleTabSetting.ts @@ -0,0 +1,28 @@ +import type { MultiTabsSetting } from '/#/config'; + +import { computed } from 'vue'; + +import { useAppStore } from '/@/store/modules/app'; + +export function useMultipleTabSetting() { + const appStore = useAppStore(); + + const getShowMultipleTab = computed(() => appStore.getMultiTabsSetting.show); + + const getShowQuick = computed(() => appStore.getMultiTabsSetting.showQuick); + + const getShowRedo = computed(() => appStore.getMultiTabsSetting.showRedo); + + const getShowFold = computed(() => appStore.getMultiTabsSetting.showFold); + + function setMultipleTabSetting(multiTabsSetting: Partial) { + appStore.setProjectConfig({ multiTabsSetting }); + } + return { + setMultipleTabSetting, + getShowMultipleTab, + getShowQuick, + getShowRedo, + getShowFold, + }; +} diff --git a/monolithic/frontend/src/hooks/setting/useRootSetting.ts b/monolithic/frontend/src/hooks/setting/useRootSetting.ts new file mode 100644 index 0000000..4976e40 --- /dev/null +++ b/monolithic/frontend/src/hooks/setting/useRootSetting.ts @@ -0,0 +1,95 @@ +import type { ProjectConfig } from '/#/config'; + +import { computed } from 'vue'; + +import { useAppStore } from '/@/store/modules/app'; +import { ContentEnum, ThemeEnum } from '/@/enums/appEnum'; + +type RootSetting = Omit< + ProjectConfig, + 'locale' | 'headerSetting' | 'menuSetting' | 'multiTabsSetting' +>; + +export function useRootSetting() { + const appStore = useAppStore(); + + const getPageLoading = computed(() => appStore.getPageLoading); + + const getOpenKeepAlive = computed(() => appStore.getProjectConfig.openKeepAlive); + + const getSettingButtonPosition = computed(() => appStore.getProjectConfig.settingButtonPosition); + + const getCanEmbedIFramePage = computed(() => appStore.getProjectConfig.canEmbedIFramePage); + + const getPermissionMode = computed(() => appStore.getProjectConfig.permissionMode); + + const getShowLogo = computed(() => appStore.getProjectConfig.showLogo); + + const getContentMode = computed(() => appStore.getProjectConfig.contentMode); + + const getUseOpenBackTop = computed(() => appStore.getProjectConfig.useOpenBackTop); + + const getShowSettingButton = computed(() => appStore.getProjectConfig.showSettingButton); + + const getUseErrorHandle = computed(() => appStore.getProjectConfig.useErrorHandle); + + const getShowFooter = computed(() => appStore.getProjectConfig.showFooter); + + const getShowBreadCrumb = computed(() => appStore.getProjectConfig.showBreadCrumb); + + const getThemeColor = computed(() => appStore.getProjectConfig.themeColor); + + const getShowBreadCrumbIcon = computed(() => appStore.getProjectConfig.showBreadCrumbIcon); + + const getFullContent = computed(() => appStore.getProjectConfig.fullContent); + + const getColorWeak = computed(() => appStore.getProjectConfig.colorWeak); + + const getGrayMode = computed(() => appStore.getProjectConfig.grayMode); + + const getLockTime = computed(() => appStore.getProjectConfig.lockTime); + + const getShowDarkModeToggle = computed(() => appStore.getProjectConfig.showDarkModeToggle); + + const getDarkMode = computed(() => appStore.getDarkMode); + + const getLayoutContentMode = computed(() => + appStore.getProjectConfig.contentMode === ContentEnum.FULL + ? ContentEnum.FULL + : ContentEnum.FIXED, + ); + + function setRootSetting(setting: Partial) { + appStore.setProjectConfig(setting); + } + + function setDarkMode(mode: ThemeEnum) { + appStore.setDarkMode(mode); + } + return { + setRootSetting, + + getSettingButtonPosition, + getFullContent, + getColorWeak, + getGrayMode, + getLayoutContentMode, + getPageLoading, + getOpenKeepAlive, + getCanEmbedIFramePage, + getPermissionMode, + getShowLogo, + getUseErrorHandle, + getShowBreadCrumb, + getShowBreadCrumbIcon, + getUseOpenBackTop, + getShowSettingButton, + getShowFooter, + getContentMode, + getLockTime, + getThemeColor, + getDarkMode, + setDarkMode, + getShowDarkModeToggle, + }; +} diff --git a/monolithic/frontend/src/hooks/setting/useTransitionSetting.ts b/monolithic/frontend/src/hooks/setting/useTransitionSetting.ts new file mode 100644 index 0000000..b6d421a --- /dev/null +++ b/monolithic/frontend/src/hooks/setting/useTransitionSetting.ts @@ -0,0 +1,31 @@ +import type { TransitionSetting } from '/#/config'; + +import { computed } from 'vue'; + +import { useAppStore } from '/@/store/modules/app'; + +export function useTransitionSetting() { + const appStore = useAppStore(); + + const getEnableTransition = computed(() => appStore.getTransitionSetting?.enable); + + const getOpenNProgress = computed(() => appStore.getTransitionSetting?.openNProgress); + + const getOpenPageLoading = computed((): boolean => { + return !!appStore.getTransitionSetting?.openPageLoading; + }); + + const getBasicTransition = computed(() => appStore.getTransitionSetting?.basicTransition); + + function setTransitionSetting(transitionSetting: Partial) { + appStore.setProjectConfig({ transitionSetting }); + } + return { + setTransitionSetting, + + getEnableTransition, + getOpenNProgress, + getOpenPageLoading, + getBasicTransition, + }; +} diff --git a/monolithic/frontend/src/hooks/web/useAppInject.ts b/monolithic/frontend/src/hooks/web/useAppInject.ts new file mode 100644 index 0000000..7d6efb2 --- /dev/null +++ b/monolithic/frontend/src/hooks/web/useAppInject.ts @@ -0,0 +1,10 @@ +import { useAppProviderContext } from '/@/components/Application'; +import { computed, unref } from 'vue'; + +export function useAppInject() { + const values = useAppProviderContext(); + + return { + getIsMobile: computed(() => unref(values.isMobile)), + }; +} diff --git a/monolithic/frontend/src/hooks/web/useContentHeight.ts b/monolithic/frontend/src/hooks/web/useContentHeight.ts new file mode 100644 index 0000000..d51f4ca --- /dev/null +++ b/monolithic/frontend/src/hooks/web/useContentHeight.ts @@ -0,0 +1,191 @@ +import { ComputedRef, isRef, nextTick, Ref, ref, unref, watch } from 'vue'; +import { onMountedOrActivated } from '/@/hooks/core/onMountedOrActivated'; +import { useWindowSizeFn } from '/@/hooks/event/useWindowSizeFn'; +import { useLayoutHeight } from '/@/layouts/default/content/useContentViewHeight'; +import { getViewportOffset } from '/@/utils/domUtils'; +import { isNumber, isString } from '/@/utils/is'; + +export interface CompensationHeight { + // 使用 layout Footer 高度作为判断补偿高度的条件 + useLayoutFooter: boolean; + // refs HTMLElement + elements?: Ref[]; +} + +type Upward = number | string | null | undefined; + +/** + * 动态计算内容高度,根据锚点dom最下坐标到屏幕最下坐标,根据传入dom的高度、padding、margin等值进行动态计算 + * 最终获取合适的内容高度 + * + * @param flag 用于开启计算的响应式标识 + * @param anchorRef 锚点组件 Ref + * @param subtractHeightRefs 待减去高度的组件列表 Ref + * @param substractSpaceRefs 待减去空闲空间(margins/paddings)的组件列表 Ref + * @param offsetHeightRef 计算偏移的响应式高度,计算高度时将直接减去此值 + * @param upwardSpace 向上递归减去空闲空间的 层级 或 直到指定class为止 数值为2代表向上递归两次|数值为ant-layout表示向上递归直到碰见.ant-layout为止 + * @returns 响应式高度 + */ +export function useContentHeight( + flag: ComputedRef, + anchorRef: Ref, + subtractHeightRefs: Ref[], + substractSpaceRefs: Ref[], + upwardSpace: Ref | ComputedRef | Upward = 0, + offsetHeightRef: Ref = ref(0), +) { + const contentHeight: Ref> = ref(null); + const { footerHeightRef: layoutFooterHeightRef } = useLayoutHeight(); + let compensationHeight: CompensationHeight = { + useLayoutFooter: true, + }; + + const setCompensation = (params: CompensationHeight) => { + compensationHeight = params; + }; + + function redoHeight() { + nextTick(() => { + calcContentHeight(); + }); + } + + function calcSubtractSpace( + element: Element | null | undefined, + direction: 'all' | 'top' | 'bottom' = 'all', + ): number { + function numberPx(px: string) { + return Number(px.replace(/[^\d]/g, '')); + } + let subtractHeight = 0; + const ZERO_PX = '0px'; + if (element) { + const cssStyle = getComputedStyle(element); + const marginTop = numberPx(cssStyle?.marginTop ?? ZERO_PX); + const marginBottom = numberPx(cssStyle?.marginBottom ?? ZERO_PX); + const paddingTop = numberPx(cssStyle?.paddingTop ?? ZERO_PX); + const paddingBottom = numberPx(cssStyle?.paddingBottom ?? ZERO_PX); + if (direction === 'all') { + subtractHeight += marginTop; + subtractHeight += marginBottom; + subtractHeight += paddingTop; + subtractHeight += paddingBottom; + } else if (direction === 'top') { + subtractHeight += marginTop; + subtractHeight += paddingTop; + } else { + subtractHeight += marginBottom; + subtractHeight += paddingBottom; + } + } + return subtractHeight; + } + + function getEl(element: any): Nullable { + if (element == null) { + return null; + } + return (element instanceof HTMLDivElement ? element : element.$el) as HTMLDivElement; + } + + async function calcContentHeight() { + if (!flag.value) { + return; + } + // Add a delay to get the correct height + await nextTick(); + + const anchorEl = getEl(unref(anchorRef)); + if (!anchorEl) { + return; + } + const { bottomIncludeBody } = getViewportOffset(anchorEl); + + // substract elements height + let substractHeight = 0; + subtractHeightRefs.forEach((item) => { + substractHeight += getEl(unref(item))?.offsetHeight ?? 0; + }); + + // subtract margins / paddings + let substractSpaceHeight = calcSubtractSpace(anchorEl) ?? 0; + substractSpaceRefs.forEach((item) => { + substractSpaceHeight += calcSubtractSpace(getEl(unref(item))); + }); + + // upwardSpace + let upwardSpaceHeight = 0; + function upward(element: Element | null, upwardLvlOrClass: number | string | null | undefined) { + if (element && upwardLvlOrClass) { + const parent = element.parentElement; + if (parent) { + if (isString(upwardLvlOrClass)) { + if (!parent.classList.contains(upwardLvlOrClass)) { + upwardSpaceHeight += calcSubtractSpace(parent, 'bottom'); + upward(parent, upwardLvlOrClass); + } else { + upwardSpaceHeight += calcSubtractSpace(parent, 'bottom'); + } + } else if (isNumber(upwardLvlOrClass)) { + if (upwardLvlOrClass > 0) { + upwardSpaceHeight += calcSubtractSpace(parent, 'bottom'); + upward(parent, --upwardLvlOrClass); + } + } + } + } + } + if (isRef(upwardSpace)) { + upward(anchorEl, unref(upwardSpace)); + } else { + upward(anchorEl, upwardSpace); + } + + let height = + bottomIncludeBody - + unref(layoutFooterHeightRef) - + unref(offsetHeightRef) - + substractHeight - + substractSpaceHeight - + upwardSpaceHeight; + + // compensation height + const calcCompensationHeight = () => { + compensationHeight.elements?.forEach((item) => { + height += getEl(unref(item))?.offsetHeight ?? 0; + }); + }; + if (compensationHeight.useLayoutFooter && unref(layoutFooterHeightRef) > 0) { + calcCompensationHeight(); + } else { + calcCompensationHeight(); + } + + contentHeight.value = height; + } + + onMountedOrActivated(() => { + nextTick(() => { + calcContentHeight(); + }); + }); + useWindowSizeFn( + () => { + calcContentHeight(); + }, + 50, + { immediate: true }, + ); + watch( + () => [layoutFooterHeightRef.value], + () => { + calcContentHeight(); + }, + { + flush: 'post', + immediate: true, + }, + ); + + return { redoHeight, setCompensation, contentHeight }; +} diff --git a/monolithic/frontend/src/hooks/web/useContextMenu.ts b/monolithic/frontend/src/hooks/web/useContextMenu.ts new file mode 100644 index 0000000..d3c53ce --- /dev/null +++ b/monolithic/frontend/src/hooks/web/useContextMenu.ts @@ -0,0 +1,12 @@ +import { onUnmounted, getCurrentInstance } from 'vue'; +import { createContextMenu, destroyContextMenu } from '/@/components/ContextMenu'; +import type { ContextMenuItem } from '/@/components/ContextMenu'; +export type { ContextMenuItem }; +export function useContextMenu(authRemove = true) { + if (getCurrentInstance() && authRemove) { + onUnmounted(() => { + destroyContextMenu(); + }); + } + return [createContextMenu, destroyContextMenu]; +} diff --git a/monolithic/frontend/src/hooks/web/useCopyToClipboard.ts b/monolithic/frontend/src/hooks/web/useCopyToClipboard.ts new file mode 100644 index 0000000..69abf26 --- /dev/null +++ b/monolithic/frontend/src/hooks/web/useCopyToClipboard.ts @@ -0,0 +1,69 @@ +import { ref, watch } from 'vue'; + +import { isDef } from '/@/utils/is'; +interface Options { + target?: HTMLElement; +} +export function useCopyToClipboard(initial?: string) { + const clipboardRef = ref(initial || ''); + const isSuccessRef = ref(false); + const copiedRef = ref(false); + + watch( + clipboardRef, + (str?: string) => { + if (isDef(str)) { + copiedRef.value = true; + isSuccessRef.value = copyTextToClipboard(str); + } + }, + { immediate: !!initial, flush: 'sync' }, + ); + + return { clipboardRef, isSuccessRef, copiedRef }; +} + +export function copyTextToClipboard(input: string, { target = document.body }: Options = {}) { + const element = document.createElement('textarea'); + const previouslyFocusedElement = document.activeElement; + + element.value = input; + + element.setAttribute('readonly', ''); + + (element.style as any).contain = 'strict'; + element.style.position = 'absolute'; + element.style.left = '-9999px'; + element.style.fontSize = '12pt'; + + const selection = document.getSelection(); + let originalRange; + if (selection && selection.rangeCount > 0) { + originalRange = selection.getRangeAt(0); + } + + target.append(element); + element.select(); + + element.selectionStart = 0; + element.selectionEnd = input.length; + + let isSuccess = false; + try { + isSuccess = document.execCommand('copy'); + } catch (e: any) { + throw new Error(e); + } + + element.remove(); + + if (originalRange && selection) { + selection.removeAllRanges(); + selection.addRange(originalRange); + } + + if (previouslyFocusedElement) { + (previouslyFocusedElement as HTMLElement).focus(); + } + return isSuccess; +} diff --git a/monolithic/frontend/src/hooks/web/useDesign.ts b/monolithic/frontend/src/hooks/web/useDesign.ts new file mode 100644 index 0000000..046674b --- /dev/null +++ b/monolithic/frontend/src/hooks/web/useDesign.ts @@ -0,0 +1,22 @@ +import { useAppProviderContext } from '/@/components/Application'; +// import { computed } from 'vue'; +// import { lowerFirst } from 'lodash-es'; +export function useDesign(scope: string) { + const values = useAppProviderContext(); + // const $style = cssModule ? useCssModule() : {}; + + // const style: Record = {}; + // if (cssModule) { + // Object.keys($style).forEach((key) => { + // // const moduleCls = $style[key]; + // const k = key.replace(new RegExp(`^${values.prefixCls}-?`, 'ig'), ''); + // style[lowerFirst(k)] = $style[key]; + // }); + // } + return { + // prefixCls: computed(() => `${values.prefixCls}-${scope}`), + prefixCls: `${values.prefixCls}-${scope}`, + prefixVar: values.prefixCls, + // style, + }; +} diff --git a/monolithic/frontend/src/hooks/web/useECharts.ts b/monolithic/frontend/src/hooks/web/useECharts.ts new file mode 100644 index 0000000..cdc02ef --- /dev/null +++ b/monolithic/frontend/src/hooks/web/useECharts.ts @@ -0,0 +1,121 @@ +import type { EChartsOption } from 'echarts'; +import type { Ref } from 'vue'; +import { useTimeoutFn } from '/@/hooks/core/useTimeout'; +import { tryOnUnmounted } from '@vueuse/core'; +import { unref, nextTick, watch, computed, ref } from 'vue'; +import { useDebounceFn } from '@vueuse/core'; +import { useEventListener } from '/@/hooks/event/useEventListener'; +import { useBreakpoint } from '/@/hooks/event/useBreakpoint'; +import echarts from '/@/utils/lib/echarts'; +import { useRootSetting } from '/@/hooks/setting/useRootSetting'; + +export function useECharts( + elRef: Ref, + theme: 'light' | 'dark' | 'default' = 'default', +) { + const { getDarkMode: getSysDarkMode } = useRootSetting(); + + const getDarkMode = computed(() => { + return theme === 'default' ? getSysDarkMode.value : theme; + }); + let chartInstance: echarts.ECharts | null = null; + let resizeFn: Fn = resize; + const cacheOptions = ref({}) as Ref; + let removeResizeFn: Fn = () => {}; + + resizeFn = useDebounceFn(resize, 200); + + const getOptions = computed(() => { + if (getDarkMode.value !== 'dark') { + return cacheOptions.value as EChartsOption; + } + return { + backgroundColor: 'transparent', + ...cacheOptions.value, + } as EChartsOption; + }); + + function initCharts(t = theme) { + const el = unref(elRef); + if (!el || !unref(el)) { + return; + } + + chartInstance = echarts.init(el, t); + const { removeEvent } = useEventListener({ + el: window, + name: 'resize', + listener: resizeFn, + }); + removeResizeFn = removeEvent; + const { widthRef, screenEnum } = useBreakpoint(); + if (unref(widthRef) <= screenEnum.MD || el.offsetHeight === 0) { + useTimeoutFn(() => { + resizeFn(); + }, 30); + } + } + + function setOptions(options: EChartsOption, clear = true) { + cacheOptions.value = options; + if (unref(elRef)?.offsetHeight === 0) { + useTimeoutFn(() => { + setOptions(unref(getOptions)); + }, 30); + return; + } + nextTick(() => { + useTimeoutFn(() => { + if (!chartInstance) { + initCharts(getDarkMode.value as 'default'); + + if (!chartInstance) return; + } + clear && chartInstance?.clear(); + + chartInstance?.setOption(unref(getOptions)); + }, 30); + }); + } + + function resize() { + chartInstance?.resize({ + animation: { + duration: 300, + easing: 'quadraticIn', + }, + }); + } + + watch( + () => getDarkMode.value, + (theme) => { + if (chartInstance) { + chartInstance.dispose(); + initCharts(theme as 'default'); + setOptions(cacheOptions.value); + } + }, + ); + + tryOnUnmounted(() => { + if (!chartInstance) return; + removeResizeFn(); + chartInstance.dispose(); + chartInstance = null; + }); + + function getInstance(): echarts.ECharts | null { + if (!chartInstance) { + initCharts(getDarkMode.value as 'default'); + } + return chartInstance; + } + + return { + setOptions, + resize, + echarts, + getInstance, + }; +} diff --git a/monolithic/frontend/src/hooks/web/useFullContent.ts b/monolithic/frontend/src/hooks/web/useFullContent.ts new file mode 100644 index 0000000..7dea077 --- /dev/null +++ b/monolithic/frontend/src/hooks/web/useFullContent.ts @@ -0,0 +1,28 @@ +import { computed, unref } from 'vue'; + +import { useAppStore } from '/@/store/modules/app'; + +import { useRouter } from 'vue-router'; + +/** + * @description: Full screen display content + */ +export const useFullContent = () => { + const appStore = useAppStore(); + const router = useRouter(); + const { currentRoute } = router; + + // Whether to display the content in full screen without displaying the menu + const getFullContent = computed(() => { + // Query parameters, the full screen is displayed when the address bar has a full parameter + const route = unref(currentRoute); + const query = route.query; + if (query && Reflect.has(query, '__full__')) { + return true; + } + // Return to the configuration in the configuration file + return appStore.getProjectConfig.fullContent; + }); + + return { getFullContent }; +}; diff --git a/monolithic/frontend/src/hooks/web/useI18n.ts b/monolithic/frontend/src/hooks/web/useI18n.ts new file mode 100644 index 0000000..2a777b7 --- /dev/null +++ b/monolithic/frontend/src/hooks/web/useI18n.ts @@ -0,0 +1,55 @@ +import { i18n } from '/@/locales/setupI18n'; + +type I18nGlobalTranslation = { + (key: string): string; + (key: string, locale: string): string; + (key: string, locale: string, list: unknown[]): string; + (key: string, locale: string, named: Record): string; + (key: string, list: unknown[]): string; + (key: string, named: Record): string; +}; + +type I18nTranslationRestParameters = [string, any]; + +function getKey(namespace: string | undefined, key: string) { + if (!namespace) { + return key; + } + if (key.startsWith(namespace)) { + return key; + } + return `${namespace}.${key}`; +} + +export function useI18n(namespace?: string): { + t: I18nGlobalTranslation; +} { + const normalFn = { + t: (key: string) => { + return getKey(namespace, key); + }, + }; + + if (!i18n) { + return normalFn; + } + + const { t, ...methods } = i18n.global; + + const tFn: I18nGlobalTranslation = (key: string, ...arg: any[]) => { + if (!key) return ''; + if (!key.includes('.') && !namespace) return key; + return t(getKey(namespace, key), ...(arg as I18nTranslationRestParameters)); + }; + return { + ...methods, + t: tFn, + }; +} + +// Why write this function? +// Mainly to configure the vscode i18nn ally plugin. This function is only used for routing and menus. Please use useI18n for other places + +// 为什么要编写此函数? +// 主要用于配合vscode i18nn ally插件。此功能仅用于路由和菜单。请在其他地方使用useI18n +export const t = (key: string) => key; diff --git a/monolithic/frontend/src/hooks/web/useLockPage.ts b/monolithic/frontend/src/hooks/web/useLockPage.ts new file mode 100644 index 0000000..c543be9 --- /dev/null +++ b/monolithic/frontend/src/hooks/web/useLockPage.ts @@ -0,0 +1,72 @@ +import { computed, onUnmounted, unref, watchEffect } from 'vue'; +import { useThrottleFn } from '@vueuse/core'; + +import { useAppStore } from '/@/store/modules/app'; +import { useLockStore } from '/@/store/modules/lock'; + +import { useUserStore } from '/@/store/modules/user'; +import { useRootSetting } from '../setting/useRootSetting'; + +export function useLockPage() { + const { getLockTime } = useRootSetting(); + const lockStore = useLockStore(); + const userStore = useUserStore(); + const appStore = useAppStore(); + + let timeId: TimeoutHandle; + + function clear(): void { + window.clearTimeout(timeId); + } + + function resetCalcLockTimeout(): void { + // not login + if (!userStore.getToken) { + clear(); + return; + } + const lockTime = appStore.getProjectConfig.lockTime; + if (!lockTime || lockTime < 1) { + clear(); + return; + } + clear(); + + timeId = setTimeout(() => { + lockPage(); + }, lockTime * 60 * 1000); + } + + function lockPage(): void { + lockStore.setLockInfo({ + isLock: true, + pwd: undefined, + }); + } + + watchEffect((onClean) => { + if (userStore.getToken) { + resetCalcLockTimeout(); + } else { + clear(); + } + onClean(() => { + clear(); + }); + }); + + onUnmounted(() => { + clear(); + }); + + const keyupFn = useThrottleFn(resetCalcLockTimeout, 2000); + + return computed(() => { + if (unref(getLockTime)) { + return { onKeyup: keyupFn, onMousemove: keyupFn }; + } else { + clear(); + return {}; + } + }); +} diff --git a/monolithic/frontend/src/hooks/web/useMessage.tsx b/monolithic/frontend/src/hooks/web/useMessage.tsx new file mode 100644 index 0000000..91112f3 --- /dev/null +++ b/monolithic/frontend/src/hooks/web/useMessage.tsx @@ -0,0 +1,123 @@ +import type { ModalFunc, ModalFuncProps } from 'ant-design-vue/lib/modal/Modal'; + +import { Modal, message as Message, notification } from 'ant-design-vue'; +import { InfoCircleFilled, CheckCircleFilled, CloseCircleFilled } from '@ant-design/icons-vue'; + +import { NotificationArgsProps, ConfigProps } from 'ant-design-vue/lib/notification'; +import { useI18n } from './useI18n'; +import { isString } from '/@/utils/is'; + +export interface NotifyApi { + info(config: NotificationArgsProps): void; + success(config: NotificationArgsProps): void; + error(config: NotificationArgsProps): void; + warn(config: NotificationArgsProps): void; + warning(config: NotificationArgsProps): void; + open(args: NotificationArgsProps): void; + close(key: String): void; + config(options: ConfigProps): void; + destroy(): void; +} + +export declare type NotificationPlacement = 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight'; +export declare type IconType = 'success' | 'info' | 'error' | 'warning'; +export interface ModalOptionsEx extends Omit { + iconType: 'warning' | 'success' | 'error' | 'info'; +} +export type ModalOptionsPartial = Partial & Pick; + +interface ConfirmOptions { + info: ModalFunc; + success: ModalFunc; + error: ModalFunc; + warn: ModalFunc; + warning: ModalFunc; +} + +function getIcon(iconType: string) { + if (iconType === 'warning') { + return ; + } else if (iconType === 'success') { + return ; + } else if (iconType === 'info') { + return ; + } else { + return ; + } +} + +function renderContent({ content }: Pick) { + if (isString(content)) { + return

${content as string}
`}>; + } else { + return content; + } +} + +/** + * @description: Create confirmation box + */ +function createConfirm(options: ModalOptionsEx): ConfirmOptions { + const iconType = options.iconType || 'warning'; + Reflect.deleteProperty(options, 'iconType'); + const opt: ModalFuncProps = { + centered: true, + icon: getIcon(iconType), + ...options, + content: renderContent(options), + }; + return Modal.confirm(opt) as unknown as ConfirmOptions; +} + +const getBaseOptions = () => { + const { t } = useI18n(); + return { + okText: t('common.okText'), + centered: true, + }; +}; + +function createModalOptions(options: ModalOptionsPartial, icon: string): ModalOptionsPartial { + return { + ...getBaseOptions(), + ...options, + content: renderContent(options), + icon: getIcon(icon), + }; +} + +function createSuccessModal(options: ModalOptionsPartial) { + return Modal.success(createModalOptions(options, 'success')); +} + +function createErrorModal(options: ModalOptionsPartial) { + return Modal.error(createModalOptions(options, 'close')); +} + +function createInfoModal(options: ModalOptionsPartial) { + return Modal.info(createModalOptions(options, 'info')); +} + +function createWarningModal(options: ModalOptionsPartial) { + return Modal.warning(createModalOptions(options, 'warning')); +} + +notification.config({ + placement: 'topRight', + duration: 3, +}); + +/** + * @description: message + */ +export function useMessage() { + return { + createMessage: Message, + notification: notification as NotifyApi, + createConfirm: createConfirm, + createSuccessModal, + createErrorModal, + createInfoModal, + createWarningModal, + }; +} diff --git a/monolithic/frontend/src/hooks/web/usePage.ts b/monolithic/frontend/src/hooks/web/usePage.ts new file mode 100644 index 0000000..0618070 --- /dev/null +++ b/monolithic/frontend/src/hooks/web/usePage.ts @@ -0,0 +1,53 @@ +import type { RouteLocationRaw, Router } from 'vue-router'; + +import { PageEnum } from '/@/enums/pageEnum'; +import { unref } from 'vue'; + +import { useRouter } from 'vue-router'; +import { REDIRECT_NAME } from '/@/router/constant'; + +export type PathAsPageEnum = T extends { path: string } ? T & { path: PageEnum } : T; +export type RouteLocationRawEx = PathAsPageEnum; + +function handleError(e: Error) { + console.error(e); +} + +/** + * page switch + */ +export function useGo(_router?: Router) { + const { push, replace } = _router || useRouter(); + function go(opt: RouteLocationRawEx = PageEnum.BASE_HOME, isReplace = false) { + if (!opt) { + return; + } + isReplace ? replace(opt).catch(handleError) : push(opt).catch(handleError); + } + return go; +} + +/** + * @description: redo current page + */ +export const useRedo = (_router?: Router) => { + const { replace, currentRoute } = _router || useRouter(); + const { query, params = {}, name, fullPath } = unref(currentRoute.value); + function redo(): Promise { + return new Promise((resolve) => { + if (name === REDIRECT_NAME) { + resolve(false); + return; + } + if (name && Object.keys(params).length > 0) { + params['_redirect_type'] = 'name'; + params['path'] = String(name); + } else { + params['_redirect_type'] = 'path'; + params['path'] = fullPath; + } + replace({ name: REDIRECT_NAME, params, query }).then(() => resolve(true)); + }); + } + return redo; +}; diff --git a/monolithic/frontend/src/hooks/web/usePagination.ts b/monolithic/frontend/src/hooks/web/usePagination.ts new file mode 100644 index 0000000..1e19913 --- /dev/null +++ b/monolithic/frontend/src/hooks/web/usePagination.ts @@ -0,0 +1,34 @@ +import type { Ref } from 'vue'; +import { ref, unref, computed } from 'vue'; + +function pagination(list: T[], pageNo: number, pageSize: number): T[] { + const offset = (pageNo - 1) * Number(pageSize); + const ret = + offset + Number(pageSize) >= list.length + ? list.slice(offset, list.length) + : list.slice(offset, offset + Number(pageSize)); + return ret; +} + +export function usePagination(list: Ref, pageSize: number) { + const currentPage = ref(1); + const pageSizeRef = ref(pageSize); + + const getPaginationList = computed(() => { + return pagination(unref(list), unref(currentPage), unref(pageSizeRef)); + }); + + const getTotal = computed(() => { + return unref(list).length; + }); + + function setCurrentPage(page: number) { + currentPage.value = page; + } + + function setPageSize(pageSize: number) { + pageSizeRef.value = pageSize; + } + + return { setCurrentPage, getTotal, setPageSize, getPaginationList }; +} diff --git a/monolithic/frontend/src/hooks/web/usePermission.ts b/monolithic/frontend/src/hooks/web/usePermission.ts new file mode 100644 index 0000000..bfff591 --- /dev/null +++ b/monolithic/frontend/src/hooks/web/usePermission.ts @@ -0,0 +1,111 @@ +import type { RouteRecordRaw } from 'vue-router'; + +import { useAppStore } from '/@/store/modules/app'; +import { usePermissionStore } from '/@/store/modules/permission'; +import { useUserStore } from '/@/store/modules/user'; + +import { useTabs } from './useTabs'; + +import { router, resetRouter } from '/@/router'; +// import { RootRoute } from '/@/router/routes'; + +import projectSetting from '/@/settings/projectSetting'; +import { PermissionModeEnum } from '/@/enums/appEnum'; +import { RoleEnum } from '/@/enums/roleEnum'; + +import { intersection } from 'lodash-es'; +import { isArray } from '/@/utils/is'; +import { useMultipleTabStore } from '/@/store/modules/multipleTab'; + +// User permissions related operations +export function usePermission() { + const userStore = useUserStore(); + const appStore = useAppStore(); + const permissionStore = usePermissionStore(); + const { closeAll } = useTabs(router); + + /** + * Change permission mode + */ + async function togglePermissionMode() { + appStore.setProjectConfig({ + permissionMode: + projectSetting.permissionMode === PermissionModeEnum.BACK + ? PermissionModeEnum.ROUTE_MAPPING + : PermissionModeEnum.BACK, + }); + location.reload(); + } + + /** + * Reset and regain authority resource information + * 重置和重新获得权限资源信息 + * @param id + */ + async function resume() { + const tabStore = useMultipleTabStore(); + tabStore.clearCacheTabs(); + resetRouter(); + const routes = await permissionStore.buildRoutesAction(); + routes.forEach((route) => { + router.addRoute(route as unknown as RouteRecordRaw); + }); + permissionStore.setLastBuildMenuTime(); + closeAll(); + } + + /** + * Determine whether there is permission + */ + function hasPermission(value?: RoleEnum | RoleEnum[] | string | string[], def = true): boolean { + // Visible by default + if (!value) { + return def; + } + + const permMode = projectSetting.permissionMode; + + if ([PermissionModeEnum.ROUTE_MAPPING, PermissionModeEnum.ROLE].includes(permMode)) { + if (!isArray(value)) { + return userStore.getRoleList?.includes(value as RoleEnum); + } + return (intersection(value, userStore.getRoleList) as RoleEnum[]).length > 0; + } + + if (PermissionModeEnum.BACK === permMode) { + const allCodeList = permissionStore.getPermCodeList as string[]; + if (!isArray(value)) { + return allCodeList.includes(value); + } + return (intersection(value, allCodeList) as string[]).length > 0; + } + return true; + } + + /** + * Change roles + * @param roles + */ + async function changeRole(roles: RoleEnum | RoleEnum[]): Promise { + if (projectSetting.permissionMode !== PermissionModeEnum.ROUTE_MAPPING) { + throw new Error( + 'Please switch PermissionModeEnum to ROUTE_MAPPING mode in the configuration to operate!', + ); + } + + if (!isArray(roles)) { + roles = [roles]; + } + userStore.setRoleList(roles); + await resume(); + } + + /** + * refresh menu data + */ + async function refreshMenu() { + resume(); + } + + return { changeRole, hasPermission, togglePermissionMode, refreshMenu }; +} diff --git a/monolithic/frontend/src/hooks/web/useScript.ts b/monolithic/frontend/src/hooks/web/useScript.ts new file mode 100644 index 0000000..9707116 --- /dev/null +++ b/monolithic/frontend/src/hooks/web/useScript.ts @@ -0,0 +1,46 @@ +import { onMounted, onUnmounted, ref } from 'vue'; + +interface ScriptOptions { + src: string; +} + +export function useScript(opts: ScriptOptions) { + const isLoading = ref(false); + const error = ref(false); + const success = ref(false); + let script: HTMLScriptElement; + + const promise = new Promise((resolve, reject) => { + onMounted(() => { + script = document.createElement('script'); + script.type = 'text/javascript'; + script.onload = function () { + isLoading.value = false; + success.value = true; + error.value = false; + resolve(''); + }; + + script.onerror = function (err) { + isLoading.value = false; + success.value = false; + error.value = true; + reject(err); + }; + + script.src = opts.src; + document.head.appendChild(script); + }); + }); + + onUnmounted(() => { + script && script.remove(); + }); + + return { + isLoading, + error, + success, + toPromise: () => promise, + }; +} diff --git a/monolithic/frontend/src/hooks/web/useSortable.ts b/monolithic/frontend/src/hooks/web/useSortable.ts new file mode 100644 index 0000000..4c66b6a --- /dev/null +++ b/monolithic/frontend/src/hooks/web/useSortable.ts @@ -0,0 +1,21 @@ +import { nextTick, unref } from 'vue'; +import type { Ref } from 'vue'; +import type { Options } from 'sortablejs'; + +export function useSortable(el: HTMLElement | Ref, options?: Options) { + function initSortable() { + nextTick(async () => { + if (!el) return; + + const Sortable = (await import('sortablejs')).default; + Sortable.create(unref(el), { + animation: 500, + delay: 400, + delayOnTouchOnly: true, + ...options, + }); + }); + } + + return { initSortable }; +} diff --git a/monolithic/frontend/src/hooks/web/useTabs.ts b/monolithic/frontend/src/hooks/web/useTabs.ts new file mode 100644 index 0000000..14dde2f --- /dev/null +++ b/monolithic/frontend/src/hooks/web/useTabs.ts @@ -0,0 +1,103 @@ +import type { RouteLocationNormalized, Router } from 'vue-router'; + +import { useRouter } from 'vue-router'; +import { unref } from 'vue'; + +import { useMultipleTabStore } from '/@/store/modules/multipleTab'; +import { useAppStore } from '/@/store/modules/app'; + +enum TableActionEnum { + REFRESH, + CLOSE_ALL, + CLOSE_LEFT, + CLOSE_RIGHT, + CLOSE_OTHER, + CLOSE_CURRENT, + CLOSE, +} + +export function useTabs(_router?: Router) { + const appStore = useAppStore(); + + function canIUseTabs(): boolean { + const { show } = appStore.getMultiTabsSetting; + if (!show) { + throw new Error('The multi-tab page is currently not open, please open it in the settings!'); + } + return !!show; + } + + const tabStore = useMultipleTabStore(); + const router = _router || useRouter(); + + const { currentRoute } = router; + + function getCurrentTab() { + const route = unref(currentRoute); + return tabStore.getTabList.find((item) => item.fullPath === route.fullPath)!; + } + + async function updateTabTitle(title: string, tab?: RouteLocationNormalized) { + const canIUse = canIUseTabs; + if (!canIUse) { + return; + } + const targetTab = tab || getCurrentTab(); + await tabStore.setTabTitle(title, targetTab); + } + + async function updateTabPath(path: string, tab?: RouteLocationNormalized) { + const canIUse = canIUseTabs; + if (!canIUse) { + return; + } + const targetTab = tab || getCurrentTab(); + await tabStore.updateTabPath(path, targetTab); + } + + async function handleTabAction(action: TableActionEnum, tab?: RouteLocationNormalized) { + const canIUse = canIUseTabs; + if (!canIUse) { + return; + } + const currentTab = getCurrentTab(); + switch (action) { + case TableActionEnum.REFRESH: + await tabStore.refreshPage(router); + break; + + case TableActionEnum.CLOSE_ALL: + await tabStore.closeAllTab(router); + break; + + case TableActionEnum.CLOSE_LEFT: + await tabStore.closeLeftTabs(currentTab, router); + break; + + case TableActionEnum.CLOSE_RIGHT: + await tabStore.closeRightTabs(currentTab, router); + break; + + case TableActionEnum.CLOSE_OTHER: + await tabStore.closeOtherTabs(currentTab, router); + break; + + case TableActionEnum.CLOSE_CURRENT: + case TableActionEnum.CLOSE: + await tabStore.closeTab(tab || currentTab, router); + break; + } + } + + return { + refreshPage: () => handleTabAction(TableActionEnum.REFRESH), + closeAll: () => handleTabAction(TableActionEnum.CLOSE_ALL), + closeLeft: () => handleTabAction(TableActionEnum.CLOSE_LEFT), + closeRight: () => handleTabAction(TableActionEnum.CLOSE_RIGHT), + closeOther: () => handleTabAction(TableActionEnum.CLOSE_OTHER), + closeCurrent: () => handleTabAction(TableActionEnum.CLOSE_CURRENT), + close: (tab?: RouteLocationNormalized) => handleTabAction(TableActionEnum.CLOSE, tab), + setTitle: (title: string, tab?: RouteLocationNormalized) => updateTabTitle(title, tab), + updatePath: (fullPath: string, tab?: RouteLocationNormalized) => updateTabPath(fullPath, tab), + }; +} diff --git a/monolithic/frontend/src/hooks/web/useTitle.ts b/monolithic/frontend/src/hooks/web/useTitle.ts new file mode 100644 index 0000000..a7f48d8 --- /dev/null +++ b/monolithic/frontend/src/hooks/web/useTitle.ts @@ -0,0 +1,35 @@ +import { watch, unref } from 'vue'; +import { useI18n } from '/@/hooks/web/useI18n'; +import { useTitle as usePageTitle } from '@vueuse/core'; +import { useGlobSetting } from '/@/hooks/setting'; +import { useRouter } from 'vue-router'; +import { useLocaleStore } from '/@/store/modules/locale'; + +import { REDIRECT_NAME } from '/@/router/constant'; + +/** + * Listening to page changes and dynamically changing site titles + */ +export function useTitle() { + const { title } = useGlobSetting(); + const { t } = useI18n(); + const { currentRoute } = useRouter(); + const localeStore = useLocaleStore(); + + const pageTitle = usePageTitle(); + + watch( + [() => currentRoute.value.path, () => localeStore.getLocale], + () => { + const route = unref(currentRoute); + + if (route.name === REDIRECT_NAME) { + return; + } + + const tTitle = t(route?.meta?.title as string); + pageTitle.value = tTitle ? ` ${tTitle} - ${title} ` : `${title}`; + }, + { immediate: true }, + ); +} diff --git a/monolithic/frontend/src/hooks/web/useWatermark.ts b/monolithic/frontend/src/hooks/web/useWatermark.ts new file mode 100644 index 0000000..a42b84b --- /dev/null +++ b/monolithic/frontend/src/hooks/web/useWatermark.ts @@ -0,0 +1,100 @@ +import { getCurrentInstance, onBeforeUnmount, ref, Ref, shallowRef, unref } from 'vue'; +import { useRafThrottle } from '/@/utils/domUtils'; +import { addResizeListener, removeResizeListener } from '/@/utils/event'; +import { isDef } from '/@/utils/is'; + +const domSymbol = Symbol('watermark-dom'); + +export function useWatermark( + appendEl: Ref = ref(document.body) as Ref, +) { + const func = useRafThrottle(function () { + const el = unref(appendEl); + if (!el) return; + const { clientHeight: height, clientWidth: width } = el; + updateWatermark({ height, width }); + }); + const id = domSymbol.toString(); + const watermarkEl = shallowRef(); + + const clear = () => { + const domId = unref(watermarkEl); + watermarkEl.value = undefined; + const el = unref(appendEl); + if (!el) return; + domId && el.removeChild(domId); + removeResizeListener(el, func); + }; + + function createBase64(str: string) { + const can = document.createElement('canvas'); + const width = 300; + const height = 240; + Object.assign(can, { width, height }); + + const cans = can.getContext('2d'); + if (cans) { + cans.rotate((-20 * Math.PI) / 120); + cans.font = '15px Vedana'; + cans.fillStyle = 'rgba(0, 0, 0, 0.15)'; + cans.textAlign = 'left'; + cans.textBaseline = 'middle'; + cans.fillText(str, width / 20, height); + } + return can.toDataURL('image/png'); + } + + function updateWatermark( + options: { + width?: number; + height?: number; + str?: string; + } = {}, + ) { + const el = unref(watermarkEl); + if (!el) return; + if (isDef(options.width)) { + el.style.width = `${options.width}px`; + } + if (isDef(options.height)) { + el.style.height = `${options.height}px`; + } + if (isDef(options.str)) { + el.style.background = `url(${createBase64(options.str)}) left top repeat`; + } + } + + const createWatermark = (str: string) => { + if (unref(watermarkEl)) { + updateWatermark({ str }); + return id; + } + const div = document.createElement('div'); + watermarkEl.value = div; + div.id = id; + div.style.pointerEvents = 'none'; + div.style.top = '0px'; + div.style.left = '0px'; + div.style.position = 'absolute'; + div.style.zIndex = '100000'; + const el = unref(appendEl); + if (!el) return id; + const { clientHeight: height, clientWidth: width } = el; + updateWatermark({ str, width, height }); + el.appendChild(div); + return id; + }; + + function setWatermark(str: string) { + createWatermark(str); + addResizeListener(document.documentElement, func); + const instance = getCurrentInstance(); + if (instance) { + onBeforeUnmount(() => { + clear(); + }); + } + } + + return { setWatermark, clear }; +} diff --git a/monolithic/frontend/src/layouts/default/content/index.vue b/monolithic/frontend/src/layouts/default/content/index.vue new file mode 100644 index 0000000..3f6d193 --- /dev/null +++ b/monolithic/frontend/src/layouts/default/content/index.vue @@ -0,0 +1,51 @@ + + + diff --git a/monolithic/frontend/src/layouts/default/content/useContentContext.ts b/monolithic/frontend/src/layouts/default/content/useContentContext.ts new file mode 100644 index 0000000..f12e77b --- /dev/null +++ b/monolithic/frontend/src/layouts/default/content/useContentContext.ts @@ -0,0 +1,17 @@ +import type { InjectionKey, ComputedRef } from 'vue'; +import { createContext, useContext } from '/@/hooks/core/useContext'; + +export interface ContentContextProps { + contentHeight: ComputedRef; + setPageHeight: (height: number) => Promise; +} + +const key: InjectionKey = Symbol(); + +export function createContentContext(context: ContentContextProps) { + return createContext(context, key, { native: true }); +} + +export function useContentContext() { + return useContext(key); +} diff --git a/monolithic/frontend/src/layouts/default/content/useContentViewHeight.ts b/monolithic/frontend/src/layouts/default/content/useContentViewHeight.ts new file mode 100644 index 0000000..f620a33 --- /dev/null +++ b/monolithic/frontend/src/layouts/default/content/useContentViewHeight.ts @@ -0,0 +1,42 @@ +import { ref, computed, unref } from 'vue'; +import { createPageContext } from '/@/hooks/component/usePageContext'; +import { useWindowSizeFn } from '/@/hooks/event/useWindowSizeFn'; + +const headerHeightRef = ref(0); +const footerHeightRef = ref(0); + +export function useLayoutHeight() { + function setHeaderHeight(val) { + headerHeightRef.value = val; + } + function setFooterHeight(val) { + footerHeightRef.value = val; + } + return { headerHeightRef, footerHeightRef, setHeaderHeight, setFooterHeight }; +} + +export function useContentViewHeight() { + const contentHeight = ref(window.innerHeight); + const pageHeight = ref(window.innerHeight); + const getViewHeight = computed(() => { + return unref(contentHeight) - unref(headerHeightRef) - unref(footerHeightRef) || 0; + }); + + useWindowSizeFn( + () => { + contentHeight.value = window.innerHeight; + }, + 100, + { immediate: true }, + ); + + async function setPageHeight(height: number) { + pageHeight.value = height; + } + + createPageContext({ + contentHeight: getViewHeight, + setPageHeight, + pageHeight, + }); +} diff --git a/monolithic/frontend/src/layouts/default/feature/index.vue b/monolithic/frontend/src/layouts/default/feature/index.vue new file mode 100644 index 0000000..0db26ef --- /dev/null +++ b/monolithic/frontend/src/layouts/default/feature/index.vue @@ -0,0 +1,83 @@ + + + + + diff --git a/monolithic/frontend/src/layouts/default/footer/index.vue b/monolithic/frontend/src/layouts/default/footer/index.vue new file mode 100644 index 0000000..62e3c5e --- /dev/null +++ b/monolithic/frontend/src/layouts/default/footer/index.vue @@ -0,0 +1,95 @@ + + + + diff --git a/monolithic/frontend/src/layouts/default/header/MultipleHeader.vue b/monolithic/frontend/src/layouts/default/header/MultipleHeader.vue new file mode 100644 index 0000000..c852b7e --- /dev/null +++ b/monolithic/frontend/src/layouts/default/header/MultipleHeader.vue @@ -0,0 +1,126 @@ + + + diff --git a/monolithic/frontend/src/layouts/default/header/components/Breadcrumb.vue b/monolithic/frontend/src/layouts/default/header/components/Breadcrumb.vue new file mode 100644 index 0000000..67266d2 --- /dev/null +++ b/monolithic/frontend/src/layouts/default/header/components/Breadcrumb.vue @@ -0,0 +1,204 @@ + + + diff --git a/monolithic/frontend/src/layouts/default/header/components/ErrorAction.vue b/monolithic/frontend/src/layouts/default/header/components/ErrorAction.vue new file mode 100644 index 0000000..243e587 --- /dev/null +++ b/monolithic/frontend/src/layouts/default/header/components/ErrorAction.vue @@ -0,0 +1,48 @@ + + diff --git a/monolithic/frontend/src/layouts/default/header/components/FullScreen.vue b/monolithic/frontend/src/layouts/default/header/components/FullScreen.vue new file mode 100644 index 0000000..374ee76 --- /dev/null +++ b/monolithic/frontend/src/layouts/default/header/components/FullScreen.vue @@ -0,0 +1,37 @@ + + diff --git a/monolithic/frontend/src/layouts/default/header/components/index.ts b/monolithic/frontend/src/layouts/default/header/components/index.ts new file mode 100644 index 0000000..09e767e --- /dev/null +++ b/monolithic/frontend/src/layouts/default/header/components/index.ts @@ -0,0 +1,14 @@ +import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent'; +import FullScreen from './FullScreen.vue'; + +export const UserDropDown = createAsyncComponent(() => import('./user-dropdown/index.vue'), { + loading: true, +}); + +export const LayoutBreadcrumb = createAsyncComponent(() => import('./Breadcrumb.vue')); + +export const Notify = createAsyncComponent(() => import('./notify/index.vue')); + +export const ErrorAction = createAsyncComponent(() => import('./ErrorAction.vue')); + +export { FullScreen }; diff --git a/monolithic/frontend/src/layouts/default/header/components/lock/LockModal.vue b/monolithic/frontend/src/layouts/default/header/components/lock/LockModal.vue new file mode 100644 index 0000000..f2d0459 --- /dev/null +++ b/monolithic/frontend/src/layouts/default/header/components/lock/LockModal.vue @@ -0,0 +1,126 @@ + + + diff --git a/monolithic/frontend/src/layouts/default/header/components/notify/NoticeList.vue b/monolithic/frontend/src/layouts/default/header/components/notify/NoticeList.vue new file mode 100644 index 0000000..dbc0939 --- /dev/null +++ b/monolithic/frontend/src/layouts/default/header/components/notify/NoticeList.vue @@ -0,0 +1,189 @@ + + + diff --git a/monolithic/frontend/src/layouts/default/header/components/notify/data.ts b/monolithic/frontend/src/layouts/default/header/components/notify/data.ts new file mode 100644 index 0000000..15d524d --- /dev/null +++ b/monolithic/frontend/src/layouts/default/header/components/notify/data.ts @@ -0,0 +1,193 @@ +export interface ListItem { + id: string; + avatar: string; + // 通知的标题内容 + title: string; + // 是否在标题上显示删除线 + titleDelete?: boolean; + datetime: string; + type: string; + read?: boolean; + description: string; + clickClose?: boolean; + extra?: string; + color?: string; +} + +export interface TabItem { + key: string; + name: string; + list: ListItem[]; + unreadlist?: ListItem[]; +} + +export const tabListData: TabItem[] = [ + { + key: '1', + name: '通知', + list: [ + { + id: '000000001', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png', + title: '你收到了 14 份新周报', + description: '', + datetime: '2017-08-09', + type: '1', + }, + { + id: '000000002', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png', + title: '你推荐的 曲妮妮 已通过第三轮面试', + description: '', + datetime: '2017-08-08', + type: '1', + }, + { + id: '000000003', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png', + title: '这种模板可以区分多种通知类型', + description: '', + datetime: '2017-08-07', + // read: true, + type: '1', + }, + { + id: '000000004', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png', + title: '左侧图标用于区分不同的类型', + description: '', + datetime: '2017-08-07', + type: '1', + }, + { + id: '000000005', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png', + title: + '标题可以设置自动显示省略号,本例中标题行数已设为1行,如果内容超过1行将自动截断并支持tooltip显示完整标题。', + description: '', + datetime: '2017-08-07', + type: '1', + }, + { + id: '000000006', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png', + title: '左侧图标用于区分不同的类型', + description: '', + datetime: '2017-08-07', + type: '1', + }, + { + id: '000000007', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png', + title: '左侧图标用于区分不同的类型', + description: '', + datetime: '2017-08-07', + type: '1', + }, + { + id: '000000008', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png', + title: '左侧图标用于区分不同的类型', + description: '', + datetime: '2017-08-07', + type: '1', + }, + { + id: '000000009', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png', + title: '左侧图标用于区分不同的类型', + description: '', + datetime: '2017-08-07', + type: '1', + }, + { + id: '000000010', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png', + title: '左侧图标用于区分不同的类型', + description: '', + datetime: '2017-08-07', + type: '1', + }, + ], + }, + { + key: '2', + name: '消息', + list: [ + { + id: '000000006', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg', + title: '曲丽丽 评论了你', + description: '描述信息描述信息描述信息', + datetime: '2017-08-07', + type: '2', + clickClose: true, + }, + { + id: '000000007', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg', + title: '朱偏右 回复了你', + description: '这种模板用于提醒谁与你发生了互动', + datetime: '2017-08-07', + type: '2', + clickClose: true, + }, + { + id: '000000008', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg', + title: '标题', + description: + '请将鼠标移动到此处,以便测试超长的消息在此处将如何处理。本例中设置的描述最大行数为2,超过2行的描述内容将被省略并且可以通过tooltip查看完整内容', + datetime: '2017-08-07', + type: '2', + clickClose: true, + }, + ], + }, + { + key: '3', + name: '待办', + list: [ + { + id: '000000009', + avatar: '', + title: '任务名称', + description: '任务需要在 2017-01-12 20:00 前启动', + datetime: '', + extra: '未开始', + color: '', + type: '3', + }, + { + id: '000000010', + avatar: '', + title: '第三方紧急代码变更', + description: '冠霖 需在 2017-01-07 前完成代码变更任务', + datetime: '', + extra: '马上到期', + color: 'red', + type: '3', + }, + { + id: '000000011', + avatar: '', + title: '信息安全考试', + description: '指派竹尔于 2017-01-09 前完成更新并发布', + datetime: '', + extra: '已耗时 8 天', + color: 'gold', + type: '3', + }, + { + id: '000000012', + avatar: '', + title: 'ABCD 版本发布', + description: '指派竹尔于 2017-01-09 前完成更新并发布', + datetime: '', + extra: '进行中', + color: 'blue', + type: '3', + }, + ], + }, +]; diff --git a/monolithic/frontend/src/layouts/default/header/components/notify/index.vue b/monolithic/frontend/src/layouts/default/header/components/notify/index.vue new file mode 100644 index 0000000..da66aff --- /dev/null +++ b/monolithic/frontend/src/layouts/default/header/components/notify/index.vue @@ -0,0 +1,91 @@ + + + diff --git a/monolithic/frontend/src/layouts/default/header/components/user-dropdown/DropMenuItem.vue b/monolithic/frontend/src/layouts/default/header/components/user-dropdown/DropMenuItem.vue new file mode 100644 index 0000000..987af27 --- /dev/null +++ b/monolithic/frontend/src/layouts/default/header/components/user-dropdown/DropMenuItem.vue @@ -0,0 +1,32 @@ + + diff --git a/monolithic/frontend/src/layouts/default/header/components/user-dropdown/index.vue b/monolithic/frontend/src/layouts/default/header/components/user-dropdown/index.vue new file mode 100644 index 0000000..ca72b9f --- /dev/null +++ b/monolithic/frontend/src/layouts/default/header/components/user-dropdown/index.vue @@ -0,0 +1,177 @@ + + + + diff --git a/monolithic/frontend/src/layouts/default/header/index.less b/monolithic/frontend/src/layouts/default/header/index.less new file mode 100644 index 0000000..b16007e --- /dev/null +++ b/monolithic/frontend/src/layouts/default/header/index.less @@ -0,0 +1,196 @@ +@header-trigger-prefix-cls: ~'@{namespace}-layout-header-trigger'; +@header-prefix-cls: ~'@{namespace}-layout-header'; +@breadcrumb-prefix-cls: ~'@{namespace}-layout-breadcrumb'; +@logo-prefix-cls: ~'@{namespace}-app-logo'; + +.@{header-prefix-cls} { + display: flex; + height: @header-height; + padding: 0; + margin-left: -1px; + line-height: @header-height; + color: @white; + background-color: @white; + align-items: center; + justify-content: space-between; + + &--mobile { + .@{breadcrumb-prefix-cls}, + .error-action, + .notify-item, + .fullscreen-item { + display: none; + } + + .@{logo-prefix-cls} { + min-width: unset; + padding-right: 0; + + &__title { + display: none; + } + } + .@{header-trigger-prefix-cls} { + padding: 0 4px 0 8px !important; + } + .@{header-prefix-cls}-action { + padding-right: 4px; + } + } + + &--fixed { + position: fixed; + top: 0; + left: 0; + z-index: @layout-header-fixed-z-index; + width: 100%; + } + + &-logo { + height: @header-height; + min-width: 192px; + padding: 0 10px; + font-size: 14px; + + img { + width: @logo-width; + height: @logo-width; + margin-right: 2px; + } + } + + &-left { + display: flex; + height: 100%; + align-items: center; + + .@{header-trigger-prefix-cls} { + display: flex; + height: 100%; + padding: 1px 10px 0; + cursor: pointer; + align-items: center; + + .anticon { + font-size: 16px; + } + + &.light { + &:hover { + background-color: @header-light-bg-hover-color; + } + + svg { + fill: #000; + } + } + + &.dark { + &:hover { + background-color: @header-dark-bg-hover-color; + } + } + } + } + + &-menu { + height: 100%; + min-width: 0; + flex: 1; + align-items: center; + } + + &-action { + display: flex; + min-width: 180px; + // padding-right: 12px; + align-items: center; + + &__item { + display: flex !important; + height: @header-height; + padding: 0 2px; + font-size: 1.2em; + cursor: pointer; + align-items: center; + + .ant-badge { + height: @header-height; + line-height: @header-height; + } + + .ant-badge-dot { + top: 10px; + right: 2px; + } + } + + span[role='img'] { + padding: 0 8px; + } + } + + &--light { + background-color: @white !important; + border-bottom: 1px solid @header-light-bottom-border-color; + border-left: 1px solid @header-light-bottom-border-color; + + .@{header-prefix-cls}-logo { + color: @text-color-base; + + &:hover { + background-color: @header-light-bg-hover-color; + } + } + + .@{header-prefix-cls}-action { + &__item { + color: @text-color-base; + + .app-iconify { + padding: 0 10px; + font-size: 16px !important; + } + + &:hover { + background-color: @header-light-bg-hover-color; + } + } + + &-icon, + span[role='img'] { + color: @text-color-base; + } + } + } + + &--dark { + background-color: @header-dark-bg-color !important; + // border-bottom: 1px solid @border-color-base; + border-left: 1px solid @border-color-base; + .@{header-prefix-cls}-logo { + &:hover { + background-color: @header-dark-bg-hover-color; + } + } + + .@{header-prefix-cls}-action { + &__item { + .app-iconify { + padding: 0 10px; + font-size: 16px !important; + } + + .ant-badge { + span { + color: @white; + } + } + + &:hover { + background-color: @header-dark-bg-hover-color; + } + } + } + } +} diff --git a/monolithic/frontend/src/layouts/default/header/index.vue b/monolithic/frontend/src/layouts/default/header/index.vue new file mode 100644 index 0000000..6ce6a93 --- /dev/null +++ b/monolithic/frontend/src/layouts/default/header/index.vue @@ -0,0 +1,201 @@ + + + diff --git a/monolithic/frontend/src/layouts/default/index.vue b/monolithic/frontend/src/layouts/default/index.vue new file mode 100644 index 0000000..4a230ba --- /dev/null +++ b/monolithic/frontend/src/layouts/default/index.vue @@ -0,0 +1,92 @@ + + + + diff --git a/monolithic/frontend/src/layouts/default/menu/index.vue b/monolithic/frontend/src/layouts/default/menu/index.vue new file mode 100644 index 0000000..a6b7dff --- /dev/null +++ b/monolithic/frontend/src/layouts/default/menu/index.vue @@ -0,0 +1,197 @@ + + diff --git a/monolithic/frontend/src/layouts/default/menu/useLayoutMenu.ts b/monolithic/frontend/src/layouts/default/menu/useLayoutMenu.ts new file mode 100644 index 0000000..33c7768 --- /dev/null +++ b/monolithic/frontend/src/layouts/default/menu/useLayoutMenu.ts @@ -0,0 +1,109 @@ +import type { Menu } from '/@/router/types'; +import type { Ref } from 'vue'; +import { watch, unref, ref, computed } from 'vue'; +import { useRouter } from 'vue-router'; +import { MenuSplitTyeEnum } from '/@/enums/menuEnum'; +import { useThrottleFn } from '@vueuse/core'; +import { useMenuSetting } from '/@/hooks/setting/useMenuSetting'; +import { getChildrenMenus, getCurrentParentPath, getMenus, getShallowMenus } from '/@/router/menus'; +import { usePermissionStore } from '/@/store/modules/permission'; +import { useAppInject } from '/@/hooks/web/useAppInject'; + +export function useSplitMenu(splitType: Ref) { + // Menu array + const menusRef = ref([]); + const { currentRoute } = useRouter(); + const { getIsMobile } = useAppInject(); + const permissionStore = usePermissionStore(); + const { setMenuSetting, getIsHorizontal, getSplit } = useMenuSetting(); + + const throttleHandleSplitLeftMenu = useThrottleFn(handleSplitLeftMenu, 50); + + const splitNotLeft = computed( + () => unref(splitType) !== MenuSplitTyeEnum.LEFT && !unref(getIsHorizontal), + ); + + const getSplitLeft = computed( + () => !unref(getSplit) || unref(splitType) !== MenuSplitTyeEnum.LEFT, + ); + + const getSpiltTop = computed(() => unref(splitType) === MenuSplitTyeEnum.TOP); + + const normalType = computed(() => { + return unref(splitType) === MenuSplitTyeEnum.NONE || !unref(getSplit); + }); + + watch( + [() => unref(currentRoute).path, () => unref(splitType)], + async ([path]: [string, MenuSplitTyeEnum]) => { + if (unref(splitNotLeft) || unref(getIsMobile)) return; + + const { meta } = unref(currentRoute); + const currentActiveMenu = meta.currentActiveMenu as string; + let parentPath = await getCurrentParentPath(path); + if (!parentPath) { + parentPath = await getCurrentParentPath(currentActiveMenu); + } + parentPath && throttleHandleSplitLeftMenu(parentPath); + }, + { + immediate: true, + }, + ); + + // Menu changes + watch( + [() => permissionStore.getLastBuildMenuTime, () => permissionStore.getBackMenuList], + () => { + genMenus(); + }, + { + immediate: true, + }, + ); + + // split Menu changes + watch( + () => getSplit.value, + () => { + if (unref(splitNotLeft)) return; + genMenus(); + }, + ); + + // Handle left menu split + async function handleSplitLeftMenu(parentPath: string) { + if (unref(getSplitLeft) || unref(getIsMobile)) return; + + // spilt mode left + const children = await getChildrenMenus(parentPath); + + if (!children || !children.length) { + setMenuSetting({ hidden: true }); + menusRef.value = []; + return; + } + + setMenuSetting({ hidden: false }); + menusRef.value = children; + } + + // get menus + async function genMenus() { + // normal mode + if (unref(normalType) || unref(getIsMobile)) { + menusRef.value = await getMenus(); + return; + } + + // split-top + if (unref(getSpiltTop)) { + const shallowMenus = await getShallowMenus(); + + menusRef.value = shallowMenus; + return; + } + } + + return { menusRef }; +} diff --git a/monolithic/frontend/src/layouts/default/setting/SettingDrawer.tsx b/monolithic/frontend/src/layouts/default/setting/SettingDrawer.tsx new file mode 100644 index 0000000..d28310f --- /dev/null +++ b/monolithic/frontend/src/layouts/default/setting/SettingDrawer.tsx @@ -0,0 +1,427 @@ +import { defineComponent, computed, unref } from 'vue'; +import { BasicDrawer } from '/@/components/Drawer/index'; +import { Divider } from 'ant-design-vue'; +import { + TypePicker, + ThemeColorPicker, + SettingFooter, + SwitchItem, + SelectItem, + InputNumberItem, +} from './components'; + +import { AppDarkModeToggle } from '/@/components/Application'; + +import { MenuTypeEnum, TriggerEnum } from '/@/enums/menuEnum'; + +import { useRootSetting } from '/@/hooks/setting/useRootSetting'; +import { useMenuSetting } from '/@/hooks/setting/useMenuSetting'; +import { useHeaderSetting } from '/@/hooks/setting/useHeaderSetting'; +import { useMultipleTabSetting } from '/@/hooks/setting/useMultipleTabSetting'; +import { useTransitionSetting } from '/@/hooks/setting/useTransitionSetting'; +import { useI18n } from '/@/hooks/web/useI18n'; + +import { baseHandler } from './handler'; + +import { + HandlerEnum, + contentModeOptions, + topMenuAlignOptions, + getMenuTriggerOptions, + routerTransitionOptions, + menuTypeList, + mixSidebarTriggerOptions, +} from './enum'; + +import { + HEADER_PRESET_BG_COLOR_LIST, + SIDE_BAR_BG_COLOR_LIST, + APP_PRESET_COLOR_LIST, +} from '/@/settings/designSetting'; + +const { t } = useI18n(); + +export default defineComponent({ + name: 'SettingDrawer', + setup(_, { attrs }) { + const { + getContentMode, + getShowFooter, + getShowBreadCrumb, + getShowBreadCrumbIcon, + getShowLogo, + getFullContent, + getColorWeak, + getGrayMode, + getLockTime, + getShowDarkModeToggle, + getThemeColor, + } = useRootSetting(); + + const { getOpenPageLoading, getBasicTransition, getEnableTransition, getOpenNProgress } = + useTransitionSetting(); + + const { + getIsHorizontal, + getShowMenu, + getMenuType, + getTrigger, + getCollapsedShowTitle, + getMenuFixed, + getCollapsed, + getCanDrag, + getTopMenuAlign, + getAccordion, + getMenuWidth, + getMenuBgColor, + getIsTopMenu, + getSplit, + getIsMixSidebar, + getCloseMixSidebarOnChange, + getMixSideTrigger, + getMixSideFixed, + } = useMenuSetting(); + + const { + getShowHeader, + getFixed: getHeaderFixed, + getHeaderBgColor, + getShowSearch, + } = useHeaderSetting(); + + const { getShowMultipleTab, getShowQuick, getShowRedo, getShowFold } = useMultipleTabSetting(); + + const getShowMenuRef = computed(() => { + return unref(getShowMenu) && !unref(getIsHorizontal); + }); + + function renderSidebar() { + return ( + <> + { + baseHandler(HandlerEnum.CHANGE_LAYOUT, { + mode: item.mode, + type: item.type, + split: unref(getIsHorizontal) ? false : undefined, + }); + }} + def={unref(getMenuType)} + /> + + ); + } + + function renderHeaderTheme() { + return ( + + ); + } + + function renderSiderTheme() { + return ( + + ); + } + + function renderMainTheme() { + return ( + + ); + } + + /** + * @description: + */ + function renderFeatures() { + let triggerDef = unref(getTrigger); + + const triggerOptions = getMenuTriggerOptions(unref(getSplit)); + const some = triggerOptions.some((item) => item.value === triggerDef); + if (!some) { + triggerDef = TriggerEnum.FOOTER; + } + + return ( + <> + + + + + + + + + + + + + + + + + + + { + return parseInt(value) === 0 + ? `0(${t('layout.setting.notAutoScreenLock')})` + : `${value}${t('layout.setting.minute')}`; + }} + /> + `${parseInt(value)}px`} + /> + + ); + } + + function renderContent() { + return ( + <> + + + + + + + + + + + + + + + + + + + + + + + ); + } + + function renderTransition() { + return ( + <> + + + + + + + + ); + } + + return () => ( + + {unref(getShowDarkModeToggle) && {() => t('layout.setting.darkMode')}} + {unref(getShowDarkModeToggle) && } + {() => t('layout.setting.navMode')} + {renderSidebar()} + {() => t('layout.setting.sysTheme')} + {renderMainTheme()} + {() => t('layout.setting.headerTheme')} + {renderHeaderTheme()} + {() => t('layout.setting.sidebarTheme')} + {renderSiderTheme()} + {() => t('layout.setting.interfaceFunction')} + {renderFeatures()} + {() => t('layout.setting.interfaceDisplay')} + {renderContent()} + {() => t('layout.setting.animation')} + {renderTransition()} + + + + ); + }, +}); diff --git a/monolithic/frontend/src/layouts/default/setting/components/InputNumberItem.vue b/monolithic/frontend/src/layouts/default/setting/components/InputNumberItem.vue new file mode 100644 index 0000000..a2f5bc5 --- /dev/null +++ b/monolithic/frontend/src/layouts/default/setting/components/InputNumberItem.vue @@ -0,0 +1,56 @@ + + + diff --git a/monolithic/frontend/src/layouts/default/setting/components/SelectItem.vue b/monolithic/frontend/src/layouts/default/setting/components/SelectItem.vue new file mode 100644 index 0000000..676ca91 --- /dev/null +++ b/monolithic/frontend/src/layouts/default/setting/components/SelectItem.vue @@ -0,0 +1,75 @@ + + + diff --git a/monolithic/frontend/src/layouts/default/setting/components/SettingFooter.vue b/monolithic/frontend/src/layouts/default/setting/components/SettingFooter.vue new file mode 100644 index 0000000..dc002aa --- /dev/null +++ b/monolithic/frontend/src/layouts/default/setting/components/SettingFooter.vue @@ -0,0 +1,99 @@ + + + diff --git a/monolithic/frontend/src/layouts/default/setting/components/SwitchItem.vue b/monolithic/frontend/src/layouts/default/setting/components/SwitchItem.vue new file mode 100644 index 0000000..ff27477 --- /dev/null +++ b/monolithic/frontend/src/layouts/default/setting/components/SwitchItem.vue @@ -0,0 +1,66 @@ + + + diff --git a/monolithic/frontend/src/layouts/default/setting/components/ThemeColorPicker.vue b/monolithic/frontend/src/layouts/default/setting/components/ThemeColorPicker.vue new file mode 100644 index 0000000..d0f28ba --- /dev/null +++ b/monolithic/frontend/src/layouts/default/setting/components/ThemeColorPicker.vue @@ -0,0 +1,88 @@ + + + diff --git a/monolithic/frontend/src/layouts/default/setting/components/TypePicker.vue b/monolithic/frontend/src/layouts/default/setting/components/TypePicker.vue new file mode 100644 index 0000000..ce8610a --- /dev/null +++ b/monolithic/frontend/src/layouts/default/setting/components/TypePicker.vue @@ -0,0 +1,178 @@ + + + diff --git a/monolithic/frontend/src/layouts/default/setting/components/index.ts b/monolithic/frontend/src/layouts/default/setting/components/index.ts new file mode 100644 index 0000000..bd24888 --- /dev/null +++ b/monolithic/frontend/src/layouts/default/setting/components/index.ts @@ -0,0 +1,8 @@ +import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent'; + +export const TypePicker = createAsyncComponent(() => import('./TypePicker.vue')); +export const ThemeColorPicker = createAsyncComponent(() => import('./ThemeColorPicker.vue')); +export const SettingFooter = createAsyncComponent(() => import('./SettingFooter.vue')); +export const SwitchItem = createAsyncComponent(() => import('./SwitchItem.vue')); +export const SelectItem = createAsyncComponent(() => import('./SelectItem.vue')); +export const InputNumberItem = createAsyncComponent(() => import('./InputNumberItem.vue')); diff --git a/monolithic/frontend/src/layouts/default/setting/enum.ts b/monolithic/frontend/src/layouts/default/setting/enum.ts new file mode 100644 index 0000000..1e9633a --- /dev/null +++ b/monolithic/frontend/src/layouts/default/setting/enum.ts @@ -0,0 +1,156 @@ +import { ContentEnum, RouterTransitionEnum } from '/@/enums/appEnum'; +import { + MenuModeEnum, + MenuTypeEnum, + TopMenuAlignEnum, + TriggerEnum, + MixSidebarTriggerEnum, +} from '/@/enums/menuEnum'; + +import { useI18n } from '/@/hooks/web/useI18n'; + +const { t } = useI18n(); + +export enum HandlerEnum { + CHANGE_LAYOUT, + CHANGE_THEME_COLOR, + CHANGE_THEME, + // menu + MENU_HAS_DRAG, + MENU_ACCORDION, + MENU_TRIGGER, + MENU_TOP_ALIGN, + MENU_COLLAPSED, + MENU_COLLAPSED_SHOW_TITLE, + MENU_WIDTH, + MENU_SHOW_SIDEBAR, + MENU_THEME, + MENU_SPLIT, + MENU_FIXED, + MENU_CLOSE_MIX_SIDEBAR_ON_CHANGE, + MENU_TRIGGER_MIX_SIDEBAR, + MENU_FIXED_MIX_SIDEBAR, + + // header + HEADER_SHOW, + HEADER_THEME, + HEADER_FIXED, + + HEADER_SEARCH, + + TABS_SHOW_QUICK, + TABS_SHOW_REDO, + TABS_SHOW, + TABS_SHOW_FOLD, + + LOCK_TIME, + FULL_CONTENT, + CONTENT_MODE, + SHOW_BREADCRUMB, + SHOW_BREADCRUMB_ICON, + GRAY_MODE, + COLOR_WEAK, + SHOW_LOGO, + SHOW_FOOTER, + + ROUTER_TRANSITION, + OPEN_PROGRESS, + OPEN_PAGE_LOADING, + OPEN_ROUTE_TRANSITION, +} + +export const contentModeOptions = [ + { + value: ContentEnum.FULL, + label: t('layout.setting.contentModeFull'), + }, + { + value: ContentEnum.FIXED, + label: t('layout.setting.contentModeFixed'), + }, +]; + +export const topMenuAlignOptions = [ + { + value: TopMenuAlignEnum.CENTER, + label: t('layout.setting.topMenuAlignRight'), + }, + { + value: TopMenuAlignEnum.START, + label: t('layout.setting.topMenuAlignLeft'), + }, + { + value: TopMenuAlignEnum.END, + label: t('layout.setting.topMenuAlignCenter'), + }, +]; + +export const getMenuTriggerOptions = (hideTop: boolean) => { + return [ + { + value: TriggerEnum.NONE, + label: t('layout.setting.menuTriggerNone'), + }, + { + value: TriggerEnum.FOOTER, + label: t('layout.setting.menuTriggerBottom'), + }, + ...(hideTop + ? [] + : [ + { + value: TriggerEnum.HEADER, + label: t('layout.setting.menuTriggerTop'), + }, + ]), + ]; +}; + +export const routerTransitionOptions = [ + RouterTransitionEnum.ZOOM_FADE, + RouterTransitionEnum.FADE, + RouterTransitionEnum.ZOOM_OUT, + RouterTransitionEnum.FADE_SIDE, + RouterTransitionEnum.FADE_BOTTOM, + RouterTransitionEnum.FADE_SCALE, +].map((item) => { + return { + label: item, + value: item, + }; +}); + +export const menuTypeList = [ + { + title: t('layout.setting.menuTypeSidebar'), + mode: MenuModeEnum.INLINE, + type: MenuTypeEnum.SIDEBAR, + }, + { + title: t('layout.setting.menuTypeMix'), + mode: MenuModeEnum.INLINE, + type: MenuTypeEnum.MIX, + }, + + { + title: t('layout.setting.menuTypeTopMenu'), + mode: MenuModeEnum.HORIZONTAL, + type: MenuTypeEnum.TOP_MENU, + }, + { + title: t('layout.setting.menuTypeMixSidebar'), + mode: MenuModeEnum.INLINE, + type: MenuTypeEnum.MIX_SIDEBAR, + }, +]; + +export const mixSidebarTriggerOptions = [ + { + value: MixSidebarTriggerEnum.HOVER, + label: t('layout.setting.triggerHover'), + }, + { + value: MixSidebarTriggerEnum.CLICK, + label: t('layout.setting.triggerClick'), + }, +]; diff --git a/monolithic/frontend/src/layouts/default/setting/handler.ts b/monolithic/frontend/src/layouts/default/setting/handler.ts new file mode 100644 index 0000000..0909008 --- /dev/null +++ b/monolithic/frontend/src/layouts/default/setting/handler.ts @@ -0,0 +1,174 @@ +import { HandlerEnum } from './enum'; +import { updateHeaderBgColor, updateSidebarBgColor } from '/@/logics/theme/updateBackground'; +import { updateColorWeak } from '/@/logics/theme/updateColorWeak'; +import { updateGrayMode } from '/@/logics/theme/updateGrayMode'; + +import { useAppStore } from '/@/store/modules/app'; +import { ProjectConfig } from '/#/config'; +import { changeTheme } from '/@/logics/theme'; +import { updateDarkTheme } from '/@/logics/theme/dark'; +import { useRootSetting } from '/@/hooks/setting/useRootSetting'; + +export function baseHandler(event: HandlerEnum, value: any) { + const appStore = useAppStore(); + const config = handler(event, value); + appStore.setProjectConfig(config); + if (event === HandlerEnum.CHANGE_THEME) { + updateHeaderBgColor(); + updateSidebarBgColor(); + } +} + +export function handler(event: HandlerEnum, value: any): DeepPartial { + const appStore = useAppStore(); + + const { getThemeColor, getDarkMode } = useRootSetting(); + switch (event) { + case HandlerEnum.CHANGE_LAYOUT: + const { mode, type, split } = value; + const splitOpt = split === undefined ? { split } : {}; + + return { + menuSetting: { + mode, + type, + collapsed: false, + show: true, + hidden: false, + ...splitOpt, + }, + }; + + case HandlerEnum.CHANGE_THEME_COLOR: + if (getThemeColor.value === value) { + return {}; + } + changeTheme(value); + + return { themeColor: value }; + + case HandlerEnum.CHANGE_THEME: + if (getDarkMode.value === value) { + return {}; + } + updateDarkTheme(value); + + return {}; + + case HandlerEnum.MENU_HAS_DRAG: + return { menuSetting: { canDrag: value } }; + + case HandlerEnum.MENU_ACCORDION: + return { menuSetting: { accordion: value } }; + + case HandlerEnum.MENU_TRIGGER: + return { menuSetting: { trigger: value } }; + + case HandlerEnum.MENU_TOP_ALIGN: + return { menuSetting: { topMenuAlign: value } }; + + case HandlerEnum.MENU_COLLAPSED: + return { menuSetting: { collapsed: value } }; + + case HandlerEnum.MENU_WIDTH: + return { menuSetting: { menuWidth: value } }; + + case HandlerEnum.MENU_SHOW_SIDEBAR: + return { menuSetting: { show: value } }; + + case HandlerEnum.MENU_COLLAPSED_SHOW_TITLE: + return { menuSetting: { collapsedShowTitle: value } }; + + case HandlerEnum.MENU_THEME: + updateSidebarBgColor(value); + return { menuSetting: { bgColor: value } }; + + case HandlerEnum.MENU_SPLIT: + return { menuSetting: { split: value } }; + + case HandlerEnum.MENU_CLOSE_MIX_SIDEBAR_ON_CHANGE: + return { menuSetting: { closeMixSidebarOnChange: value } }; + + case HandlerEnum.MENU_FIXED: + return { menuSetting: { fixed: value } }; + + case HandlerEnum.MENU_TRIGGER_MIX_SIDEBAR: + return { menuSetting: { mixSideTrigger: value } }; + + case HandlerEnum.MENU_FIXED_MIX_SIDEBAR: + return { menuSetting: { mixSideFixed: value } }; + + // ============transition================== + case HandlerEnum.OPEN_PAGE_LOADING: + appStore.setPageLoading(false); + return { transitionSetting: { openPageLoading: value } }; + + case HandlerEnum.ROUTER_TRANSITION: + return { transitionSetting: { basicTransition: value } }; + + case HandlerEnum.OPEN_ROUTE_TRANSITION: + return { transitionSetting: { enable: value } }; + + case HandlerEnum.OPEN_PROGRESS: + return { transitionSetting: { openNProgress: value } }; + // ============root================== + + case HandlerEnum.LOCK_TIME: + return { lockTime: value }; + + case HandlerEnum.FULL_CONTENT: + return { fullContent: value }; + + case HandlerEnum.CONTENT_MODE: + return { contentMode: value }; + + case HandlerEnum.SHOW_BREADCRUMB: + return { showBreadCrumb: value }; + + case HandlerEnum.SHOW_BREADCRUMB_ICON: + return { showBreadCrumbIcon: value }; + + case HandlerEnum.GRAY_MODE: + updateGrayMode(value); + return { grayMode: value }; + + case HandlerEnum.SHOW_FOOTER: + return { showFooter: value }; + + case HandlerEnum.COLOR_WEAK: + updateColorWeak(value); + return { colorWeak: value }; + + case HandlerEnum.SHOW_LOGO: + return { showLogo: value }; + + // ============tabs================== + case HandlerEnum.TABS_SHOW_QUICK: + return { multiTabsSetting: { showQuick: value } }; + + case HandlerEnum.TABS_SHOW: + return { multiTabsSetting: { show: value } }; + + case HandlerEnum.TABS_SHOW_REDO: + return { multiTabsSetting: { showRedo: value } }; + + case HandlerEnum.TABS_SHOW_FOLD: + return { multiTabsSetting: { showFold: value } }; + + // ============header================== + case HandlerEnum.HEADER_THEME: + updateHeaderBgColor(value); + return { headerSetting: { bgColor: value } }; + + case HandlerEnum.HEADER_SEARCH: + return { headerSetting: { showSearch: value } }; + + case HandlerEnum.HEADER_FIXED: + return { headerSetting: { fixed: value } }; + + case HandlerEnum.HEADER_SHOW: + return { headerSetting: { show: value } }; + default: + return {}; + } +} diff --git a/monolithic/frontend/src/layouts/default/setting/index.vue b/monolithic/frontend/src/layouts/default/setting/index.vue new file mode 100644 index 0000000..9c5bb87 --- /dev/null +++ b/monolithic/frontend/src/layouts/default/setting/index.vue @@ -0,0 +1,26 @@ + + diff --git a/monolithic/frontend/src/layouts/default/sider/DragBar.vue b/monolithic/frontend/src/layouts/default/sider/DragBar.vue new file mode 100644 index 0000000..9bae60c --- /dev/null +++ b/monolithic/frontend/src/layouts/default/sider/DragBar.vue @@ -0,0 +1,66 @@ + + + diff --git a/monolithic/frontend/src/layouts/default/sider/LayoutSider.vue b/monolithic/frontend/src/layouts/default/sider/LayoutSider.vue new file mode 100644 index 0000000..2144505 --- /dev/null +++ b/monolithic/frontend/src/layouts/default/sider/LayoutSider.vue @@ -0,0 +1,185 @@ + + + diff --git a/monolithic/frontend/src/layouts/default/sider/MixSider.vue b/monolithic/frontend/src/layouts/default/sider/MixSider.vue new file mode 100644 index 0000000..5e4fae5 --- /dev/null +++ b/monolithic/frontend/src/layouts/default/sider/MixSider.vue @@ -0,0 +1,591 @@ + + + diff --git a/monolithic/frontend/src/layouts/default/sider/index.vue b/monolithic/frontend/src/layouts/default/sider/index.vue new file mode 100644 index 0000000..d5357f4 --- /dev/null +++ b/monolithic/frontend/src/layouts/default/sider/index.vue @@ -0,0 +1,57 @@ + + + diff --git a/monolithic/frontend/src/layouts/default/sider/useLayoutSider.ts b/monolithic/frontend/src/layouts/default/sider/useLayoutSider.ts new file mode 100644 index 0000000..66656b2 --- /dev/null +++ b/monolithic/frontend/src/layouts/default/sider/useLayoutSider.ts @@ -0,0 +1,143 @@ +import type { Ref } from 'vue'; + +import { computed, unref, onMounted, nextTick } from 'vue'; + +import { TriggerEnum } from '/@/enums/menuEnum'; + +import { useMenuSetting } from '/@/hooks/setting/useMenuSetting'; +import { useDebounceFn } from '@vueuse/core'; +import { useAppStore } from '/@/store/modules/app'; + +/** + * Handle related operations of menu events + */ +export function useSiderEvent() { + const appStore = useAppStore(); + const { getMiniWidthNumber } = useMenuSetting(); + + const getCollapsedWidth = computed(() => { + return unref(getMiniWidthNumber); + }); + + function onBreakpointChange(broken: boolean) { + appStore.setProjectConfig({ + menuSetting: { + siderHidden: broken, + }, + }); + } + + return { getCollapsedWidth, onBreakpointChange }; +} + +/** + * Handle related operations of menu folding + */ +export function useTrigger(getIsMobile: Ref) { + const { getTrigger, getSplit } = useMenuSetting(); + + const getShowTrigger = computed(() => { + const trigger = unref(getTrigger); + + return ( + trigger !== TriggerEnum.NONE && + !unref(getIsMobile) && + (trigger === TriggerEnum.FOOTER || unref(getSplit)) + ); + }); + + const getTriggerAttr = computed(() => { + if (unref(getShowTrigger)) { + return {}; + } + return { + trigger: null, + }; + }); + + return { getTriggerAttr, getShowTrigger }; +} + +/** + * Handle menu drag and drop related operations + * @param siderRef + * @param dragBarRef + */ +export function useDragLine(siderRef: Ref, dragBarRef: Ref, mix = false) { + const { getMiniWidthNumber, getCollapsed, setMenuSetting } = useMenuSetting(); + + onMounted(() => { + nextTick(() => { + const exec = useDebounceFn(changeWrapWidth, 80); + exec(); + }); + }); + + function getEl(elRef: Ref): any { + const el = unref(elRef); + if (!el) return null; + if (Reflect.has(el, '$el')) { + return (unref(elRef) as ComponentRef)?.$el; + } + return unref(elRef); + } + + function handleMouseMove(ele: HTMLElement, wrap: HTMLElement, clientX: number) { + document.onmousemove = function (innerE) { + let iT = (ele as any).left + (innerE.clientX - clientX); + innerE = innerE || window.event; + const maxT = 800; + const minT = unref(getMiniWidthNumber); + iT < 0 && (iT = 0); + iT > maxT && (iT = maxT); + iT < minT && (iT = minT); + ele.style.left = wrap.style.width = iT + 'px'; + return false; + }; + } + + // Drag and drop in the menu area-release the mouse + function removeMouseup(ele: any) { + const wrap = getEl(siderRef); + document.onmouseup = function () { + document.onmousemove = null; + document.onmouseup = null; + wrap.style.transition = 'width 0.2s'; + const width = parseInt(wrap.style.width); + + if (!mix) { + const miniWidth = unref(getMiniWidthNumber); + if (!unref(getCollapsed)) { + width > miniWidth + 20 + ? setMenuSetting({ menuWidth: width }) + : setMenuSetting({ collapsed: true }); + } else { + width > miniWidth && setMenuSetting({ collapsed: false, menuWidth: width }); + } + } else { + setMenuSetting({ menuWidth: width }); + } + + ele.releaseCapture?.(); + }; + } + + function changeWrapWidth() { + const ele = getEl(dragBarRef); + if (!ele) return; + const wrap = getEl(siderRef); + if (!wrap) return; + + ele.onmousedown = (e: any) => { + wrap.style.transition = 'unset'; + const clientX = e?.clientX; + ele.left = ele.offsetLeft; + handleMouseMove(ele, wrap, clientX); + removeMouseup(ele); + ele.setCapture?.(); + return false; + }; + } + + return {}; +} diff --git a/monolithic/frontend/src/layouts/default/tabs/components/FoldButton.vue b/monolithic/frontend/src/layouts/default/tabs/components/FoldButton.vue new file mode 100644 index 0000000..c8ea290 --- /dev/null +++ b/monolithic/frontend/src/layouts/default/tabs/components/FoldButton.vue @@ -0,0 +1,42 @@ + + diff --git a/monolithic/frontend/src/layouts/default/tabs/components/TabContent.vue b/monolithic/frontend/src/layouts/default/tabs/components/TabContent.vue new file mode 100644 index 0000000..27a065d --- /dev/null +++ b/monolithic/frontend/src/layouts/default/tabs/components/TabContent.vue @@ -0,0 +1,76 @@ + + diff --git a/monolithic/frontend/src/layouts/default/tabs/components/TabRedo.vue b/monolithic/frontend/src/layouts/default/tabs/components/TabRedo.vue new file mode 100644 index 0000000..a6fa657 --- /dev/null +++ b/monolithic/frontend/src/layouts/default/tabs/components/TabRedo.vue @@ -0,0 +1,33 @@ + + diff --git a/monolithic/frontend/src/layouts/default/tabs/index.less b/monolithic/frontend/src/layouts/default/tabs/index.less new file mode 100644 index 0000000..e6cdeb3 --- /dev/null +++ b/monolithic/frontend/src/layouts/default/tabs/index.less @@ -0,0 +1,207 @@ +@prefix-cls: ~'@{namespace}-multiple-tabs'; + +html[data-theme='dark'] { + .@{prefix-cls} { + .ant-tabs-tab { + border-bottom: 1px solid @border-color-base; + } + } +} + +html[data-theme='light'] { + .@{prefix-cls} { + .ant-tabs-tab:not(.ant-tabs-tab-active) { + border: 1px solid #d9d9d9 !important; + } + } +} + +.@{prefix-cls} { + z-index: 10; + height: @multiple-height + 2; + line-height: @multiple-height + 2; + background-color: @component-background; + border-bottom: 1px solid @border-color-base; + + .ant-tabs-small { + height: @multiple-height; + } + + .ant-tabs.ant-tabs-card { + .ant-tabs-nav { + padding-top: 2px; + height: @multiple-height; + margin: 0; + background-color: @component-background; + border: 0; + box-shadow: none; + + .ant-tabs-nav-container { + height: @multiple-height; + padding-top: 2px; + } + + .ant-tabs-tab { + height: calc(@multiple-height - 2px); + padding-right: 12px; + line-height: calc(@multiple-height - 2px); + color: @text-color-base; + background-color: @component-background; + transition: none; + + &:hover { + .ant-tabs-tab-remove { + opacity: 1; + } + } + + .ant-tabs-tab-remove { + width: 8px; + height: 28px; + font-size: 12px; + color: inherit; + opacity: 0; + transition: none; + margin-left: 2px; + margin-right: -4px; + + &:hover { + svg { + width: 0.8em; + } + } + } + + // > div { + // display: flex; + // justify-content: center; + // align-items: center; + // } + + svg { + fill: @text-color-base; + } + } + + .ant-tabs-tab:not(.ant-tabs-tab-active) { + &:hover { + color: @primary-color; + } + } + + .ant-tabs-tab-active { + position: relative; + padding-left: 18px; + background: @primary-color; + border: 0; + transition: none; + + span { + color: @white !important; + } + + .ant-tabs-tab-remove { + opacity: 1; + } + + svg { + width: 0.7em; + fill: @white; + } + } + } + + .ant-tabs-nav > div:nth-child(1) { + padding: 0 6px; + + .ant-tabs-tab { + margin-right: 3px !important; + } + } + } + + .ant-tabs-tab:not(.ant-tabs-tab-active) { + .anticon-close { + font-size: 12px; + + svg { + width: 0.6em; + } + } + } + + .ant-dropdown-trigger { + display: inline-flex; + } + + &--hide-close { + .ant-tabs-tab-remove { + opacity: 0 !important; + } + } + + &-content { + &__extra-quick, + &__extra-redo, + &__extra-fold { + display: inline-block; + width: 36px; + height: @multiple-height; + line-height: @multiple-height; + color: @text-color-secondary; + text-align: center; + cursor: pointer; + border-left: 1px solid @border-color-base; + + &:hover { + color: @text-color-base; + } + + span[role='img'] { + transform: rotate(90deg); + } + } + + &__extra-redo { + span[role='img'] { + transform: rotate(0deg); + } + } + + &__info { + display: inline-block; + width: 100%; + height: @multiple-height - 2; + padding-left: 0; + margin-left: -10px; + font-size: 12px; + cursor: pointer; + user-select: none; + } + } +} + +.ant-tabs-dropdown-menu { + &-title-content { + display: flex; + align-items: center; + + .@{prefix-cls} { + &-content__info { + width: auto; + margin-left: 0; + line-height: 28px; + } + } + } + + &-item-remove { + margin-left: auto; + } +} + +.multiple-tabs__dropdown { + .ant-dropdown-content { + width: 172px; + } +} diff --git a/monolithic/frontend/src/layouts/default/tabs/index.vue b/monolithic/frontend/src/layouts/default/tabs/index.vue new file mode 100644 index 0000000..553baeb --- /dev/null +++ b/monolithic/frontend/src/layouts/default/tabs/index.vue @@ -0,0 +1,144 @@ + + + diff --git a/monolithic/frontend/src/layouts/default/tabs/types.ts b/monolithic/frontend/src/layouts/default/tabs/types.ts new file mode 100644 index 0000000..3a8cfd9 --- /dev/null +++ b/monolithic/frontend/src/layouts/default/tabs/types.ts @@ -0,0 +1,25 @@ +import type { DropMenu } from '/@/components/Dropdown/index'; +import type { RouteLocationNormalized } from 'vue-router'; + +export enum TabContentEnum { + TAB_TYPE, + EXTRA_TYPE, +} + +export type { DropMenu }; + +export interface TabContentProps { + tabItem: RouteLocationNormalized; + type?: TabContentEnum; + trigger?: ('click' | 'hover' | 'contextmenu')[]; +} + +export enum MenuEventEnum { + REFRESH_PAGE, + CLOSE_CURRENT, + CLOSE_LEFT, + CLOSE_RIGHT, + CLOSE_OTHER, + CLOSE_ALL, + SCALE, +} diff --git a/monolithic/frontend/src/layouts/default/tabs/useMultipleTabs.ts b/monolithic/frontend/src/layouts/default/tabs/useMultipleTabs.ts new file mode 100644 index 0000000..71b9029 --- /dev/null +++ b/monolithic/frontend/src/layouts/default/tabs/useMultipleTabs.ts @@ -0,0 +1,80 @@ +import { toRaw, ref, nextTick } from 'vue'; +import type { RouteLocationNormalized } from 'vue-router'; +import { useDesign } from '/@/hooks/web/useDesign'; +import { useSortable } from '/@/hooks/web/useSortable'; +import { useMultipleTabStore } from '/@/store/modules/multipleTab'; +import { isNullAndUnDef } from '/@/utils/is'; +import projectSetting from '/@/settings/projectSetting'; +import { useRouter } from 'vue-router'; + +export function initAffixTabs(): string[] { + const affixList = ref([]); + + const tabStore = useMultipleTabStore(); + const router = useRouter(); + /** + * @description: Filter all fixed routes + */ + function filterAffixTabs(routes: RouteLocationNormalized[]) { + const tabs: RouteLocationNormalized[] = []; + routes && + routes.forEach((route) => { + if (route.meta && route.meta.affix) { + tabs.push(toRaw(route)); + } + }); + return tabs; + } + + /** + * @description: Set fixed tabs + */ + function addAffixTabs(): void { + const affixTabs = filterAffixTabs(router.getRoutes() as unknown as RouteLocationNormalized[]); + affixList.value = affixTabs; + for (const tab of affixTabs) { + tabStore.addTab({ + meta: tab.meta, + name: tab.name, + path: tab.path, + } as unknown as RouteLocationNormalized); + } + } + + let isAddAffix = false; + + if (!isAddAffix) { + addAffixTabs(); + isAddAffix = true; + } + return affixList.value.map((item) => item.meta?.title).filter(Boolean) as string[]; +} + +export function useTabsDrag(affixTextList: string[]) { + const tabStore = useMultipleTabStore(); + const { multiTabsSetting } = projectSetting; + const { prefixCls } = useDesign('multiple-tabs'); + nextTick(() => { + if (!multiTabsSetting.canDrag) return; + const el = document.querySelectorAll( + `.${prefixCls} .ant-tabs-nav-wrap > div`, + )?.[0] as HTMLElement; + const { initSortable } = useSortable(el, { + filter: (e: ChangeEvent) => { + const text = e?.target?.innerText; + if (!text) return false; + return affixTextList.includes(text); + }, + onEnd: (evt) => { + const { oldIndex, newIndex } = evt; + + if (isNullAndUnDef(oldIndex) || isNullAndUnDef(newIndex) || oldIndex === newIndex) { + return; + } + + tabStore.sortTabs(oldIndex, newIndex); + }, + }); + initSortable(); + }); +} diff --git a/monolithic/frontend/src/layouts/default/tabs/useTabDropdown.ts b/monolithic/frontend/src/layouts/default/tabs/useTabDropdown.ts new file mode 100644 index 0000000..016ce8c --- /dev/null +++ b/monolithic/frontend/src/layouts/default/tabs/useTabDropdown.ts @@ -0,0 +1,140 @@ +import type { TabContentProps } from './types'; +import type { DropMenu } from '/@/components/Dropdown'; +import type { ComputedRef } from 'vue'; + +import { computed, unref, reactive } from 'vue'; +import { MenuEventEnum } from './types'; +import { useMultipleTabStore } from '/@/store/modules/multipleTab'; +import { RouteLocationNormalized, useRouter } from 'vue-router'; +import { useTabs } from '/@/hooks/web/useTabs'; +import { useI18n } from '/@/hooks/web/useI18n'; + +export function useTabDropdown(tabContentProps: TabContentProps, getIsTabs: ComputedRef) { + const state = reactive({ + current: null as Nullable, + currentIndex: 0, + }); + + const { t } = useI18n(); + const tabStore = useMultipleTabStore(); + const { currentRoute } = useRouter(); + const { refreshPage, closeAll, close, closeLeft, closeOther, closeRight } = useTabs(); + + const getTargetTab = computed((): RouteLocationNormalized => { + return unref(getIsTabs) ? tabContentProps.tabItem : unref(currentRoute); + }); + + /** + * @description: drop-down list + */ + const getDropMenuList = computed(() => { + if (!unref(getTargetTab)) { + return; + } + const { meta } = unref(getTargetTab); + const { path } = unref(currentRoute); + + const curItem = state.current; + + const isCurItem = curItem ? curItem.path === path : false; + + // Refresh button + const index = state.currentIndex; + const refreshDisabled = !isCurItem; + // Close left + const closeLeftDisabled = index === 0 || !isCurItem; + + const disabled = tabStore.getTabList.length === 1; + + // Close right + const closeRightDisabled = + !isCurItem || (index === tabStore.getTabList.length - 1 && tabStore.getLastDragEndIndex >= 0); + const dropMenuList: DropMenu[] = [ + { + icon: 'ion:reload-sharp', + event: MenuEventEnum.REFRESH_PAGE, + text: t('layout.multipleTab.reload'), + disabled: refreshDisabled, + }, + { + icon: 'clarity:close-line', + event: MenuEventEnum.CLOSE_CURRENT, + text: t('layout.multipleTab.close'), + disabled: !!meta?.affix || disabled, + divider: true, + }, + { + icon: 'line-md:arrow-close-left', + event: MenuEventEnum.CLOSE_LEFT, + text: t('layout.multipleTab.closeLeft'), + disabled: closeLeftDisabled, + divider: false, + }, + { + icon: 'line-md:arrow-close-right', + event: MenuEventEnum.CLOSE_RIGHT, + text: t('layout.multipleTab.closeRight'), + disabled: closeRightDisabled, + divider: true, + }, + { + icon: 'dashicons:align-center', + event: MenuEventEnum.CLOSE_OTHER, + text: t('layout.multipleTab.closeOther'), + disabled: disabled || !isCurItem, + }, + { + icon: 'clarity:minus-line', + event: MenuEventEnum.CLOSE_ALL, + text: t('layout.multipleTab.closeAll'), + disabled: disabled, + }, + ]; + + return dropMenuList; + }); + + function handleContextMenu(tabItem: RouteLocationNormalized) { + return (e: Event) => { + if (!tabItem) { + return; + } + e?.preventDefault(); + const index = tabStore.getTabList.findIndex((tab) => tab.path === tabItem.path); + state.current = tabItem; + state.currentIndex = index; + }; + } + + // Handle right click event + function handleMenuEvent(menu: DropMenu): void { + const { event } = menu; + switch (event) { + case MenuEventEnum.REFRESH_PAGE: + // refresh page + refreshPage(); + break; + // Close current + case MenuEventEnum.CLOSE_CURRENT: + close(tabContentProps.tabItem); + break; + // Close left + case MenuEventEnum.CLOSE_LEFT: + closeLeft(); + break; + // Close right + case MenuEventEnum.CLOSE_RIGHT: + closeRight(); + break; + // Close other + case MenuEventEnum.CLOSE_OTHER: + closeOther(); + break; + // Close all + case MenuEventEnum.CLOSE_ALL: + closeAll(); + break; + } + } + return { getDropMenuList, handleMenuEvent, handleContextMenu }; +} diff --git a/monolithic/frontend/src/layouts/default/trigger/HeaderTrigger.vue b/monolithic/frontend/src/layouts/default/trigger/HeaderTrigger.vue new file mode 100644 index 0000000..d7dbb23 --- /dev/null +++ b/monolithic/frontend/src/layouts/default/trigger/HeaderTrigger.vue @@ -0,0 +1,25 @@ + + diff --git a/monolithic/frontend/src/layouts/default/trigger/SiderTrigger.vue b/monolithic/frontend/src/layouts/default/trigger/SiderTrigger.vue new file mode 100644 index 0000000..0eb38b5 --- /dev/null +++ b/monolithic/frontend/src/layouts/default/trigger/SiderTrigger.vue @@ -0,0 +1,21 @@ + + diff --git a/monolithic/frontend/src/layouts/default/trigger/index.vue b/monolithic/frontend/src/layouts/default/trigger/index.vue new file mode 100644 index 0000000..61f43b3 --- /dev/null +++ b/monolithic/frontend/src/layouts/default/trigger/index.vue @@ -0,0 +1,22 @@ + + diff --git a/monolithic/frontend/src/layouts/iframe/index.vue b/monolithic/frontend/src/layouts/iframe/index.vue new file mode 100644 index 0000000..d9ee7e5 --- /dev/null +++ b/monolithic/frontend/src/layouts/iframe/index.vue @@ -0,0 +1,29 @@ + + diff --git a/monolithic/frontend/src/layouts/iframe/useFrameKeepAlive.ts b/monolithic/frontend/src/layouts/iframe/useFrameKeepAlive.ts new file mode 100644 index 0000000..e84c49f --- /dev/null +++ b/monolithic/frontend/src/layouts/iframe/useFrameKeepAlive.ts @@ -0,0 +1,59 @@ +import type { AppRouteRecordRaw } from '/@/router/types'; + +import { computed, toRaw, unref } from 'vue'; + +import { useMultipleTabStore } from '/@/store/modules/multipleTab'; + +import { uniqBy } from 'lodash-es'; + +import { useMultipleTabSetting } from '/@/hooks/setting/useMultipleTabSetting'; + +import { useRouter } from 'vue-router'; + +export function useFrameKeepAlive() { + const router = useRouter(); + const { currentRoute } = router; + const { getShowMultipleTab } = useMultipleTabSetting(); + const tabStore = useMultipleTabStore(); + const getFramePages = computed(() => { + const ret = getAllFramePages(toRaw(router.getRoutes()) as unknown as AppRouteRecordRaw[]) || []; + return ret; + }); + + const getOpenTabList = computed((): string[] => { + return tabStore.getTabList.reduce((prev: string[], next) => { + if (next.meta && Reflect.has(next.meta, 'frameSrc')) { + prev.push(next.name as string); + } + return prev; + }, []); + }); + + function getAllFramePages(routes: AppRouteRecordRaw[]): AppRouteRecordRaw[] { + let res: AppRouteRecordRaw[] = []; + for (const route of routes) { + const { meta: { frameSrc } = {}, children } = route; + if (frameSrc) { + res.push(route); + } + if (children && children.length) { + res.push(...getAllFramePages(children)); + } + } + res = uniqBy(res, 'name'); + return res; + } + + function showIframe(item: AppRouteRecordRaw) { + return item.name === unref(currentRoute).name; + } + + function hasRenderFrame(name: string) { + if (!unref(getShowMultipleTab)) { + return router.currentRoute.value.name === name; + } + return unref(getOpenTabList).includes(name); + } + + return { hasRenderFrame, getFramePages, showIframe, getAllFramePages }; +} diff --git a/monolithic/frontend/src/layouts/page/index.vue b/monolithic/frontend/src/layouts/page/index.vue new file mode 100644 index 0000000..d1cd114 --- /dev/null +++ b/monolithic/frontend/src/layouts/page/index.vue @@ -0,0 +1,72 @@ + + + diff --git a/monolithic/frontend/src/layouts/page/transition.ts b/monolithic/frontend/src/layouts/page/transition.ts new file mode 100644 index 0000000..9e93009 --- /dev/null +++ b/monolithic/frontend/src/layouts/page/transition.ts @@ -0,0 +1,33 @@ +import type { FunctionalComponent } from 'vue'; +import type { RouteLocation } from 'vue-router'; + +export interface DefaultContext { + Component: FunctionalComponent & { type: Recordable }; + route: RouteLocation; +} + +export function getTransitionName({ + route, + openCache, + cacheTabs, + enableTransition, + def, +}: Pick & { + enableTransition: boolean; + openCache: boolean; + def: string; + cacheTabs: string[]; +}): string | undefined { + if (!enableTransition) { + return undefined; + } + + const isInCache = cacheTabs.includes(route.name as string); + const transitionName = 'fade-slide'; + let name: string | undefined = transitionName; + + if (openCache) { + name = isInCache && route.meta.loaded ? transitionName : undefined; + } + return name || (route.meta.transitionName as string) || def; +} diff --git a/monolithic/frontend/src/locales/helper.ts b/monolithic/frontend/src/locales/helper.ts new file mode 100644 index 0000000..4f78439 --- /dev/null +++ b/monolithic/frontend/src/locales/helper.ts @@ -0,0 +1,37 @@ +import type { LocaleType } from '/#/config'; + +import { set } from 'lodash-es'; + +export const loadLocalePool: LocaleType[] = []; + +export function setHtmlPageLang(locale: LocaleType) { + document.querySelector('html')?.setAttribute('lang', locale); +} + +export function setLoadLocalePool(cb: (loadLocalePool: LocaleType[]) => void) { + cb(loadLocalePool); +} + +export function genMessage(langs: Record>, prefix = 'lang') { + const obj: Recordable = {}; + + Object.keys(langs).forEach((key) => { + const langFileModule = langs[key].default; + let fileName = key.replace(`./${prefix}/`, '').replace(/^\.\//, ''); + const lastIndex = fileName.lastIndexOf('.'); + fileName = fileName.substring(0, lastIndex); + const keyList = fileName.split('/'); + const moduleName = keyList.shift(); + const objKey = keyList.join('.'); + + if (moduleName) { + if (objKey) { + set(obj, moduleName, obj[moduleName] || {}); + set(obj[moduleName], objKey, langFileModule); + } else { + set(obj, moduleName, langFileModule || {}); + } + } + }); + return obj; +} diff --git a/monolithic/frontend/src/locales/lang/en.ts b/monolithic/frontend/src/locales/lang/en.ts new file mode 100644 index 0000000..f2bf247 --- /dev/null +++ b/monolithic/frontend/src/locales/lang/en.ts @@ -0,0 +1,12 @@ +import { genMessage } from '../helper'; +import antdLocale from 'ant-design-vue/es/locale/en_US'; + +const modules = import.meta.globEager('./en/**/*.ts'); +export default { + message: { + ...genMessage(modules, 'en'), + antdLocale, + }, + dateLocale: null, + dateLocaleName: 'en', +}; diff --git a/monolithic/frontend/src/locales/lang/en/common.ts b/monolithic/frontend/src/locales/lang/en/common.ts new file mode 100644 index 0000000..f7cdce0 --- /dev/null +++ b/monolithic/frontend/src/locales/lang/en/common.ts @@ -0,0 +1,20 @@ +export default { + okText: 'OK', + closeText: 'Close', + cancelText: 'Cancel', + loadingText: 'Loading...', + saveText: 'Save', + delText: 'Delete', + resetText: 'Reset', + searchText: 'Search', + queryText: 'Search', + + inputText: 'Please enter', + chooseText: 'Please choose', + + redo: 'Refresh', + back: 'Back', + + light: 'Light', + dark: 'Dark', +}; diff --git a/monolithic/frontend/src/locales/lang/en/component.ts b/monolithic/frontend/src/locales/lang/en/component.ts new file mode 100644 index 0000000..b93dbd5 --- /dev/null +++ b/monolithic/frontend/src/locales/lang/en/component.ts @@ -0,0 +1,129 @@ +export default { + app: { + searchNotData: 'No search results yet', + toSearch: 'to search', + toNavigate: 'to navigate', + }, + countdown: { + normalText: 'Get SMS code', + sendText: 'Reacquire in {0}s', + }, + cropper: { + selectImage: 'Select Image', + uploadSuccess: 'Uploaded success!', + modalTitle: 'Avatar upload', + okText: 'Confirm and upload', + btn_reset: 'Reset', + btn_rotate_left: 'Counterclockwise rotation', + btn_rotate_right: 'Clockwise rotation', + btn_scale_x: 'Flip horizontal', + btn_scale_y: 'Flip vertical', + btn_zoom_in: 'Zoom in', + btn_zoom_out: 'Zoom out', + preview: 'Preivew', + }, + drawer: { + loadingText: 'Loading...', + cancelText: 'Close', + okText: 'Confirm', + }, + excel: { + exportModalTitle: 'Export data', + fileType: 'File type', + fileName: 'File name', + }, + form: { + putAway: 'Put away', + unfold: 'Unfold', + maxTip: 'The number of characters should be less than {0}', + apiSelectNotFound: 'Wait for data loading to complete...', + }, + icon: { + placeholder: 'Click the select icon', + search: 'Search icon', + copy: 'Copy icon successfully!', + }, + menu: { + search: 'Menu search', + }, + modal: { + cancelText: 'Close', + okText: 'Confirm', + close: 'Close', + maximize: 'Maximize', + restore: 'Restore', + }, + table: { + settingDens: 'Density', + settingDensDefault: 'Default', + settingDensMiddle: 'Middle', + settingDensSmall: 'Compact', + settingColumn: 'Column settings', + settingColumnShow: 'Column display', + settingIndexColumnShow: 'Index Column', + settingSelectColumnShow: 'Selection Column', + settingFixedLeft: 'Fixed Left', + settingFixedRight: 'Fixed Right', + settingFullScreen: 'Full Screen', + index: 'Index', + total: 'total of {total}', + }, + time: { + before: ' ago', + after: ' after', + just: 'just now', + seconds: ' seconds', + minutes: ' minutes', + hours: ' hours', + days: ' days', + }, + tree: { + selectAll: 'Select All', + unSelectAll: 'Cancel Select', + expandAll: 'Expand All', + unExpandAll: 'Collapse all', + + checkStrictly: 'Hierarchical association', + checkUnStrictly: 'Hierarchical independence', + }, + upload: { + save: 'Save', + upload: 'Upload', + imgUpload: 'ImageUpload', + uploaded: 'Uploaded', + + operating: 'Operating', + del: 'Delete', + download: 'download', + saveWarn: 'Please wait for the file to upload and save!', + saveError: 'There is no file successfully uploaded and cannot be saved!', + + preview: 'Preview', + choose: 'Select the file', + + accept: 'Support {0} format', + acceptUpload: 'Only upload files in {0} format', + maxSize: 'A single file does not exceed {0}MB ', + maxSizeMultiple: 'Only upload files up to {0}MB!', + maxNumber: 'Only upload up to {0} files', + + legend: 'Legend', + fileName: 'File name', + fileSize: 'File size', + fileStatue: 'File status', + + startUpload: 'Start upload', + uploadSuccess: 'Upload successfully', + uploadError: 'Upload failed', + uploading: 'Uploading', + uploadWait: 'Please wait for the file upload to finish', + reUploadFailed: 'Re-upload failed files', + }, + verify: { + error: 'verification failed!', + time: 'The verification is successful and it takes {time} seconds!', + redoTip: 'Click the picture to refresh', + dragText: 'Hold down the slider and drag', + successText: 'Verified', + }, +}; diff --git a/monolithic/frontend/src/locales/lang/en/layout.ts b/monolithic/frontend/src/locales/lang/en/layout.ts new file mode 100644 index 0000000..ee6890c --- /dev/null +++ b/monolithic/frontend/src/locales/lang/en/layout.ts @@ -0,0 +1,116 @@ +export default { + footer: { onlinePreview: 'Preview', onlineDocument: 'Document' }, + header: { + // user dropdown + dropdownItemDoc: 'Document', + dropdownItemUser: 'User Setting', + dropdownItemLoginOut: 'Login Out', + + tooltipErrorLog: 'Error log', + tooltipLock: 'Lock screen', + tooltipNotify: 'Notification', + + tooltipEntryFull: 'Full Screen', + tooltipExitFull: 'Exit Full Screen', + + // lock + lockScreenPassword: 'Lock screen password', + lockScreen: 'Lock screen', + lockScreenBtn: 'Locking', + + home: 'Home', + }, + multipleTab: { + reload: 'Refresh current', + close: 'Close current', + closeLeft: 'Close Left', + closeRight: 'Close Right', + closeOther: 'Close Other', + closeAll: 'Close All', + }, + setting: { + // content mode + contentModeFull: 'Full', + contentModeFixed: 'Fixed width', + // topMenu align + topMenuAlignLeft: 'Left', + topMenuAlignRight: 'Center', + topMenuAlignCenter: 'Right', + // menu trigger + menuTriggerNone: 'Not Show', + menuTriggerBottom: 'Bottom', + menuTriggerTop: 'Top', + // menu type + menuTypeSidebar: 'Left menu mode', + menuTypeMixSidebar: 'Left menu mixed mode', + menuTypeMix: 'Top Menu Mix mode', + menuTypeTopMenu: 'Top menu mode', + + on: 'On', + off: 'Off', + minute: 'Minute', + + operatingTitle: 'Successful!', + operatingContent: + 'The copy is successful, please go to src/settings/projectSetting.ts to modify the configuration!', + resetSuccess: 'Successfully reset!', + + copyBtn: 'Copy', + clearBtn: 'Clear cache and to the login page', + + drawerTitle: 'Configuration', + + darkMode: 'Dark mode', + navMode: 'Navigation mode', + interfaceFunction: 'Interface function', + interfaceDisplay: 'Interface display', + animation: 'Animation', + splitMenu: 'Split menu', + closeMixSidebarOnChange: 'Switch page to close menu', + + sysTheme: 'System theme', + headerTheme: 'Header theme', + sidebarTheme: 'Menu theme', + + menuDrag: 'Drag Sidebar', + menuSearch: 'Menu search', + menuAccordion: 'Sidebar accordion', + menuCollapse: 'Collapse menu', + collapseMenuDisplayName: 'Collapse menu display name', + topMenuLayout: 'Top menu layout', + menuCollapseButton: 'Menu collapse button', + contentMode: 'Content area width', + expandedMenuWidth: 'Expanded menu width', + + breadcrumb: 'Breadcrumbs', + breadcrumbIcon: 'Breadcrumbs Icon', + tabs: 'Tabs', + tabDetail: 'Tab Detail', + tabsQuickBtn: 'Tabs quick button', + tabsRedoBtn: 'Tabs redo button', + tabsFoldBtn: 'Tabs flod button', + sidebar: 'Sidebar', + header: 'Header', + footer: 'Footer', + fullContent: 'Full content', + grayMode: 'Gray mode', + colorWeak: 'Color Weak Mode', + + progress: 'Progress', + switchLoading: 'Switch Loading', + switchAnimation: 'Switch animation', + animationType: 'Animation type', + + autoScreenLock: 'Auto screen lock', + notAutoScreenLock: 'Not auto lock', + + fixedHeader: 'Fixed header', + fixedSideBar: 'Fixed Sidebar', + + mixSidebarTrigger: 'Mixed menu Trigger', + triggerHover: 'Hover', + triggerClick: 'Click', + + mixSidebarFixed: 'Fixed expanded menu', + }, +}; diff --git a/monolithic/frontend/src/locales/lang/en/routes/app.ts b/monolithic/frontend/src/locales/lang/en/routes/app.ts new file mode 100644 index 0000000..fd25d26 --- /dev/null +++ b/monolithic/frontend/src/locales/lang/en/routes/app.ts @@ -0,0 +1,14 @@ +export default { + system: { + moduleName: 'System management', + + account: 'Account management', + account_detail: 'Account detail', + password: 'Change password', + + dept: 'Department management', + + menu: 'Menu management', + role: 'Role management', + }, +}; diff --git a/monolithic/frontend/src/locales/lang/en/routes/basic.ts b/monolithic/frontend/src/locales/lang/en/routes/basic.ts new file mode 100644 index 0000000..b6faa00 --- /dev/null +++ b/monolithic/frontend/src/locales/lang/en/routes/basic.ts @@ -0,0 +1,4 @@ +export default { + login: 'Login', + errorLogList: 'Error Log', +}; diff --git a/monolithic/frontend/src/locales/lang/en/routes/dashboard.ts b/monolithic/frontend/src/locales/lang/en/routes/dashboard.ts new file mode 100644 index 0000000..6d047b5 --- /dev/null +++ b/monolithic/frontend/src/locales/lang/en/routes/dashboard.ts @@ -0,0 +1,6 @@ +export default { + dashboard: 'Dashboard', + about: 'About', + workbench: 'Workbench', + analysis: 'Analysis', +}; diff --git a/monolithic/frontend/src/locales/lang/en/sys.ts b/monolithic/frontend/src/locales/lang/en/sys.ts new file mode 100644 index 0000000..c193077 --- /dev/null +++ b/monolithic/frontend/src/locales/lang/en/sys.ts @@ -0,0 +1,109 @@ +export default { + api: { + operationFailed: 'Operation failed', + errorTip: 'Error Tip', + errorMessage: 'The operation failed, the system is abnormal!', + timeoutMessage: 'Login timed out, please log in again!', + apiTimeoutMessage: 'The interfaces request timed out, please refresh the page and try again!', + apiRequestFailed: 'The interfaces request failed, please try again later!', + networkException: 'network anomaly', + networkExceptionMsg: + 'Please check if your network connection is normal! The network is abnormal', + + UNAUTHORIZED: 'The user does not have permission (token, user name, password error)!', + NOT_LOGGED_IN: 'The user does not have permission (token, user name, password error)!', + ACCESS_FORBIDDEN: 'The user is authorized, but access is forbidden!', + RESOURCE_NOT_FOUND: 'Network request error, the resource was not found!', + METHOD_NOT_ALLOWED: 'Network request error, request method not allowed!', + REQUEST_TIMEOUT: 'Network request timed out!', + INTERNAL_SERVER_ERROR: 'Server error, please contact the administrator!', + NOT_IMPLEMENTED: 'The network is not implemented!', + NETWORK_ERROR: 'Network Error!', + SERVICE_UNAVAILABLE: + 'The service is unavailable, the server is temporarily overloaded or maintained!', + NETWORK_TIMEOUT: 'Network timeout!', + REQUEST_NOT_SUPPORT: 'The http version does not support the request!', + + USER_NOT_FOUND: 'user name, password error!', + USER_NOT_EXIST: 'user name, password error!', + }, + app: { + logoutTip: 'Reminder', + logoutMessage: 'Confirm to exit the system?', + menuLoading: 'Menu loading...', + }, + errorLog: { + tableTitle: 'Error log list', + tableColumnType: 'Type', + tableColumnDate: 'Time', + tableColumnFile: 'File', + tableColumnMsg: 'Error message', + tableColumnStackMsg: 'Stack info', + + tableActionDesc: 'Details', + + modalTitle: 'Error details', + + fireVueError: 'Fire vue error', + fireResourceError: 'Fire resource error', + fireAjaxError: 'Fire ajax error', + + enableMessage: 'Only effective when useErrorHandle=true in `/src/settings/projectSetting.ts`.', + }, + exception: { + backLogin: 'Back Login', + backHome: 'Back Home', + subTitle403: "Sorry, you don't have access to this page.", + subTitle404: 'Sorry, the page you visited does not exist.', + subTitle500: 'Sorry, the server is reporting an error.', + noDataTitle: 'No data on the current page.', + networkErrorTitle: 'Network Error', + networkErrorSubTitle: + 'Sorry,Your network connection has been disconnected, please check your network!', + }, + lock: { + unlock: 'Click to unlock', + alert: 'Lock screen password error', + backToLogin: 'Back to login', + entry: 'Enter the system', + placeholder: 'Please enter the lock screen password or user password', + }, + login: { + backSignIn: 'Back sign in', + mobileSignInFormTitle: 'Mobile sign in', + qrSignInFormTitle: 'Qr code sign in', + signInFormTitle: 'Sign in', + signUpFormTitle: 'Sign up', + forgetFormTitle: 'Reset password', + + signInTitle: 'Backstage management system', + signInDesc: 'Enter your personal details and get started!', + policy: 'I agree to the xxx Privacy Policy', + scanSign: `scanning the code to complete the login`, + + loginButton: 'Sign in', + registerButton: 'Sign up', + rememberMe: 'Remember me', + forgetPassword: 'Forget Password?', + otherSignIn: 'Sign in with', + + // notify + loginSuccessTitle: 'Login successful', + loginSuccessDesc: 'Welcome back', + + // placeholder + usernamePlaceholder: 'Please input username', + passwordPlaceholder: 'Please input password', + smsPlaceholder: 'Please input sms code', + mobilePlaceholder: 'Please input mobile', + policyPlaceholder: 'Register after checking', + diffPwd: 'The two passwords are inconsistent', + + userName: 'Username', + password: 'Password', + confirmPassword: 'Confirm Password', + email: 'Email', + smsCode: 'SMS code', + mobile: 'Mobile', + }, +}; diff --git a/monolithic/frontend/src/locales/lang/zh-CN/antdLocale/DatePicker.ts b/monolithic/frontend/src/locales/lang/zh-CN/antdLocale/DatePicker.ts new file mode 100644 index 0000000..452dff0 --- /dev/null +++ b/monolithic/frontend/src/locales/lang/zh-CN/antdLocale/DatePicker.ts @@ -0,0 +1,19 @@ +export default { + lang: { + shortWeekDays: ['一', '二', '三', '四', '五', '六', '日'], + shortMonths: [ + '1月', + '2月', + '3月', + '4月', + '5月', + '6月', + '7月', + '8月', + '9月', + '10月', + '11月', + '12月', + ], + }, +}; diff --git a/monolithic/frontend/src/locales/lang/zh-CN/common.ts b/monolithic/frontend/src/locales/lang/zh-CN/common.ts new file mode 100644 index 0000000..478c625 --- /dev/null +++ b/monolithic/frontend/src/locales/lang/zh-CN/common.ts @@ -0,0 +1,20 @@ +export default { + okText: '确认', + closeText: '关闭', + cancelText: '取消', + loadingText: '加载中...', + saveText: '保存', + delText: '删除', + resetText: '重置', + searchText: '搜索', + queryText: '查询', + + inputText: '请输入', + chooseText: '请选择', + + redo: '刷新', + back: '返回', + + light: '亮色主题', + dark: '黑暗主题', +}; diff --git a/monolithic/frontend/src/locales/lang/zh-CN/component.ts b/monolithic/frontend/src/locales/lang/zh-CN/component.ts new file mode 100644 index 0000000..d9b54eb --- /dev/null +++ b/monolithic/frontend/src/locales/lang/zh-CN/component.ts @@ -0,0 +1,134 @@ +export default { + app: { + searchNotData: '暂无搜索结果', + toSearch: '确认', + toNavigate: '切换', + }, + countdown: { + normalText: '获取验证码', + sendText: '{0}秒后重新获取', + }, + cropper: { + selectImage: '选择图片', + uploadSuccess: '上传成功', + modalTitle: '头像上传', + okText: '确认并上传', + btn_reset: '重置', + btn_rotate_left: '逆时针旋转', + btn_rotate_right: '顺时针旋转', + btn_scale_x: '水平翻转', + btn_scale_y: '垂直翻转', + btn_zoom_in: '放大', + btn_zoom_out: '缩小', + preview: '预览', + }, + drawer: { + loadingText: '加载中...', + cancelText: '关闭', + okText: '确认', + }, + excel: { + exportModalTitle: '导出数据', + fileType: '文件类型', + fileName: '文件名', + }, + form: { + putAway: '收起', + unfold: '展开', + + maxTip: '字符数应小于{0}位', + + apiSelectNotFound: '请等待数据加载完成...', + }, + icon: { + placeholder: '点击选择图标', + search: '搜索图标', + copy: '复制图标成功!', + }, + menu: { + search: '菜单搜索', + }, + modal: { + cancelText: '关闭', + okText: '确认', + close: '关闭', + maximize: '最大化', + restore: '还原', + }, + table: { + settingDens: '密度', + settingDensDefault: '默认', + settingDensMiddle: '中等', + settingDensSmall: '紧凑', + settingColumn: '列设置', + settingColumnShow: '列展示', + settingIndexColumnShow: '序号列', + settingSelectColumnShow: '勾选列', + settingFixedLeft: '固定到左侧', + settingFixedRight: '固定到右侧', + settingFullScreen: '全屏', + + index: '序号', + + total: '共 {total} 条数据', + }, + time: { + before: '前', + after: '后', + just: '刚刚', + seconds: '秒', + minutes: '分钟', + hours: '小时', + days: '天', + }, + tree: { + selectAll: '选择全部', + unSelectAll: '取消选择', + expandAll: '展开全部', + unExpandAll: '折叠全部', + checkStrictly: '层级关联', + checkUnStrictly: '层级独立', + }, + upload: { + save: '保存', + upload: '上传', + imgUpload: '图片上传', + uploaded: '已上传', + + operating: '操作', + del: '删除', + download: '下载', + saveWarn: '请等待文件上传后,保存!', + saveError: '没有上传成功的文件,无法保存!', + + preview: '预览', + choose: '选择文件', + + accept: '支持{0}格式', + acceptUpload: '只能上传{0}格式文件', + maxSize: '单个文件不超过{0}MB', + maxSizeMultiple: '只能上传不超过{0}MB的文件!', + maxNumber: '最多只能上传{0}个文件', + + legend: '略缩图', + fileName: '文件名', + fileSize: '文件大小', + fileStatue: '状态', + + startUpload: '开始上传', + uploadSuccess: '上传成功', + uploadError: '上传失败', + uploading: '上传中', + uploadWait: '请等待文件上传结束后操作', + reUploadFailed: '重新上传失败文件', + }, + verify: { + error: '验证失败!', + time: '验证校验成功,耗时{time}秒!', + + redoTip: '点击图片可刷新', + + dragText: '请按住滑块拖动', + successText: '验证通过', + }, +}; diff --git a/monolithic/frontend/src/locales/lang/zh-CN/layout.ts b/monolithic/frontend/src/locales/lang/zh-CN/layout.ts new file mode 100644 index 0000000..1c8eabb --- /dev/null +++ b/monolithic/frontend/src/locales/lang/zh-CN/layout.ts @@ -0,0 +1,116 @@ +export default { + footer: { onlinePreview: '在线预览', onlineDocument: '在线文档' }, + header: { + // user dropdown + dropdownItemDoc: '文档', + dropdownItemUser: '个人设置', + dropdownItemLoginOut: '退出系统', + + // tooltip + tooltipErrorLog: '错误日志', + tooltipLock: '锁定屏幕', + tooltipNotify: '消息通知', + + tooltipEntryFull: '全屏', + tooltipExitFull: '退出全屏', + + // lock + lockScreenPassword: '锁屏密码', + lockScreen: '锁定屏幕', + lockScreenBtn: '锁定', + + home: '首页', + }, + multipleTab: { + reload: '重新加载', + close: '关闭标签页', + closeLeft: '关闭左侧标签页', + closeRight: '关闭右侧标签页', + closeOther: '关闭其它标签页', + closeAll: '关闭全部标签页', + }, + setting: { + // content mode + contentModeFull: '流式', + contentModeFixed: '定宽', + // topMenu align + topMenuAlignLeft: '居左', + topMenuAlignRight: '居中', + topMenuAlignCenter: '居右', + // menu trigger + menuTriggerNone: '不显示', + menuTriggerBottom: '底部', + menuTriggerTop: '顶部', + // menu type + menuTypeSidebar: '左侧菜单模式', + menuTypeMixSidebar: '左侧菜单混合模式', + menuTypeMix: '顶部菜单混合模式', + menuTypeTopMenu: '顶部菜单模式', + + on: '开', + off: '关', + minute: '分钟', + + operatingTitle: '操作成功', + operatingContent: '复制成功,请到 src/settings/projectSetting.ts 中修改配置!', + resetSuccess: '重置成功!', + + copyBtn: '拷贝', + clearBtn: '清空缓存并返回登录页', + + drawerTitle: '项目配置', + + darkMode: '主题', + navMode: '导航栏模式', + interfaceFunction: '界面功能', + interfaceDisplay: '界面显示', + animation: '动画', + splitMenu: '分割菜单', + closeMixSidebarOnChange: '切换页面关闭菜单', + + sysTheme: '系统主题', + headerTheme: '顶栏主题', + sidebarTheme: '菜单主题', + + menuDrag: '侧边菜单拖拽', + menuSearch: '菜单搜索', + menuAccordion: '侧边菜单手风琴模式', + menuCollapse: '折叠菜单', + collapseMenuDisplayName: '折叠菜单显示名称', + topMenuLayout: '顶部菜单布局', + menuCollapseButton: '菜单折叠按钮', + contentMode: '内容区域宽度', + expandedMenuWidth: '菜单展开宽度', + + breadcrumb: '面包屑', + breadcrumbIcon: '面包屑图标', + tabs: '标签页', + tabDetail: '标签详情页', + tabsQuickBtn: '标签页快捷按钮', + tabsRedoBtn: '标签页刷新按钮', + tabsFoldBtn: '标签页折叠按钮', + sidebar: '左侧菜单', + header: '顶栏', + footer: '页脚', + fullContent: '全屏内容', + grayMode: '灰色模式', + colorWeak: '色弱模式', + + progress: '顶部进度条', + switchLoading: '切换loading', + switchAnimation: '切换动画', + animationType: '动画类型', + + autoScreenLock: '自动锁屏', + notAutoScreenLock: '不自动锁屏', + + fixedHeader: '固定header', + fixedSideBar: '固定Sidebar', + + mixSidebarTrigger: '混合菜单触发方式', + triggerHover: '悬停', + triggerClick: '点击', + + mixSidebarFixed: '固定展开菜单', + }, +}; diff --git a/monolithic/frontend/src/locales/lang/zh-CN/routes/basic.ts b/monolithic/frontend/src/locales/lang/zh-CN/routes/basic.ts new file mode 100644 index 0000000..3d03e8e --- /dev/null +++ b/monolithic/frontend/src/locales/lang/zh-CN/routes/basic.ts @@ -0,0 +1,4 @@ +export default { + login: '登录', + errorLogList: '错误日志列表', +}; diff --git a/monolithic/frontend/src/locales/lang/zh-CN/routes/dashboard.ts b/monolithic/frontend/src/locales/lang/zh-CN/routes/dashboard.ts new file mode 100644 index 0000000..955314d --- /dev/null +++ b/monolithic/frontend/src/locales/lang/zh-CN/routes/dashboard.ts @@ -0,0 +1,6 @@ +export default { + dashboard: '仪表盘', + about: '关于', + workbench: '工作台', + analysis: '分析页', +}; diff --git a/monolithic/frontend/src/locales/lang/zh-CN/routes/menu.ts b/monolithic/frontend/src/locales/lang/zh-CN/routes/menu.ts new file mode 100644 index 0000000..facda0f --- /dev/null +++ b/monolithic/frontend/src/locales/lang/zh-CN/routes/menu.ts @@ -0,0 +1,27 @@ +export default { + dashboard: { + index: '数据中心', + analysis: '统计分析', + 'data-screen': '数据大屏', + }, + + system: { + moduleName: '系统管理', + system: '系统管理', + role: '角色管理', + position: '职务管理', + user: '用户管理', + 'user-detail': '账号详情', + org: '部门管理', + permission: '权限管理', + menu: '菜单管理', + password: '修改密码', + account: '我的账号', + }, + + account: { + account: '个人中心', + settings: '个人设置', + notification: '通知订阅', + }, +}; diff --git a/monolithic/frontend/src/locales/lang/zh-CN/sys.ts b/monolithic/frontend/src/locales/lang/zh-CN/sys.ts new file mode 100644 index 0000000..ab26281 --- /dev/null +++ b/monolithic/frontend/src/locales/lang/zh-CN/sys.ts @@ -0,0 +1,102 @@ +export default { + api: { + operationFailed: '操作失败', + errorTip: '错误提示', + errorMessage: '操作失败,系统异常!', + timeoutMessage: '登录超时,请重新登录!', + apiTimeoutMessage: '接口请求超时,请刷新页面重试!', + apiRequestFailed: '请求出错,请稍候重试', + networkException: '网络异常', + networkExceptionMsg: '网络异常,请检查您的网络连接是否正常!', + + UNAUTHORIZED: '用户没有权限(令牌、用户名、密码错误)!', // 401 + NOT_LOGGED_IN: '用户没有权限(令牌、用户名、密码错误)!', // 401 + ACCESS_FORBIDDEN: '用户得到授权,但是访问是被禁止的!', // 403 + RESOURCE_NOT_FOUND: '网络请求错误,未找到该资源!', // 404 + METHOD_NOT_ALLOWED: '网络请求错误,请求方法未允许!', // 405 + REQUEST_TIMEOUT: '网络请求超时!', // 408 + INTERNAL_SERVER_ERROR: '服务器错误,请联系管理员!', // 500 + NOT_IMPLEMENTED: '网络未实现!', // 501 + NETWORK_ERROR: '服务不可用,服务器暂时过载或维护!', // 502 + SERVICE_UNAVAILABLE: '服务不可用,服务器暂时过载或维护!', // 503 + NETWORK_TIMEOUT: '服务不可用,服务器暂时过载或维护!', // 504 + REQUEST_NOT_SUPPORT: 'http版本不支持该请求!', // 505 + + USER_NOT_FOUND: '用户未找到或者密码错误', // 600 + USER_NOT_EXIST: '用户未找到或者密码错误', // 600 + }, + app: { logoutTip: '温馨提醒', logoutMessage: '是否确认退出系统?', menuLoading: '菜单加载中...' }, + errorLog: { + tableTitle: '错误日志列表', + tableColumnType: '类型', + tableColumnDate: '时间', + tableColumnFile: '文件', + tableColumnMsg: '错误信息', + tableColumnStackMsg: 'stack信息', + + tableActionDesc: '详情', + + modalTitle: '错误详情', + + fireVueError: '点击触发vue错误', + fireResourceError: '点击触发资源加载错误', + fireAjaxError: '点击触发ajax错误', + + enableMessage: '只在`/src/settings/projectSetting.ts` 内的useErrorHandle=true时生效.', + }, + exception: { + backLogin: '返回登录', + backHome: '返回首页', + subTitle403: '抱歉,您无权访问此页面。', + subTitle404: '抱歉,您访问的页面不存在。', + subTitle500: '抱歉,服务器报告错误。', + noDataTitle: '当前页无数据', + networkErrorTitle: '网络错误', + networkErrorSubTitle: '抱歉,您的网络连接已断开,请检查您的网络!', + }, + lock: { + unlock: '点击解锁', + alert: '锁屏密码错误', + backToLogin: '返回登录', + entry: '进入系统', + placeholder: '请输入锁屏密码或者用户密码', + }, + login: { + backSignIn: '返回', + signInFormTitle: '登录', + mobileSignInFormTitle: '手机登录', + qrSignInFormTitle: '二维码登录', + signUpFormTitle: '注册', + forgetFormTitle: '重置密码', + + signInTitle: '后台管理系统', + signInDesc: '输入您的个人详细信息开始使用!', + policy: '我同意xxx隐私政策', + scanSign: `扫码后点击"确认",即可完成登录`, + + loginButton: '登录', + registerButton: '注册', + rememberMe: '记住我', + forgetPassword: '忘记密码?', + otherSignIn: '其他登录方式', + + // notify + loginSuccessTitle: '登录成功', + loginSuccessDesc: '欢迎回来', + + // placeholder + usernamePlaceholder: '请输入账号', + passwordPlaceholder: '请输入密码', + smsPlaceholder: '请输入验证码', + mobilePlaceholder: '请输入手机号码', + policyPlaceholder: '勾选后才能注册', + diffPwd: '两次输入密码不一致', + + userName: '账号', + password: '密码', + confirmPassword: '确认密码', + email: '邮箱', + smsCode: '短信验证码', + mobile: '手机号码', + }, +}; diff --git a/monolithic/frontend/src/locales/lang/zh_CN.ts b/monolithic/frontend/src/locales/lang/zh_CN.ts new file mode 100644 index 0000000..d715c58 --- /dev/null +++ b/monolithic/frontend/src/locales/lang/zh_CN.ts @@ -0,0 +1,10 @@ +import { genMessage } from '../helper'; +import antdLocale from 'ant-design-vue/es/locale/zh_CN'; + +const modules = import.meta.globEager('./zh-CN/**/*.ts'); +export default { + message: { + ...genMessage(modules, 'zh-CN'), + antdLocale, + }, +}; diff --git a/monolithic/frontend/src/locales/setupI18n.ts b/monolithic/frontend/src/locales/setupI18n.ts new file mode 100644 index 0000000..405fb0c --- /dev/null +++ b/monolithic/frontend/src/locales/setupI18n.ts @@ -0,0 +1,44 @@ +import type { App } from 'vue'; +import type { I18n, I18nOptions } from 'vue-i18n'; + +import { createI18n } from 'vue-i18n'; +import { setHtmlPageLang, setLoadLocalePool } from './helper'; +import { localeSetting } from '/@/settings/localeSetting'; +import { useLocaleStoreWithOut } from '/@/store/modules/locale'; + +const { fallback, availableLocales } = localeSetting; + +export let i18n: ReturnType; + +async function createI18nOptions(): Promise { + const localeStore = useLocaleStoreWithOut(); + const locale = localeStore.getLocale; + const defaultLocal = await import(`./lang/${locale}.ts`); + const message = defaultLocal.default?.message ?? {}; + + setHtmlPageLang(locale); + setLoadLocalePool((loadLocalePool) => { + loadLocalePool.push(locale); + }); + + return { + legacy: false, + locale, + fallbackLocale: fallback, + messages: { + [locale]: message, + }, + availableLocales: availableLocales, + sync: true, //If you don’t want to inherit locale from global scope, you need to set sync of i18n component option to false. + silentTranslationWarn: true, // true - warning off + missingWarn: false, + silentFallbackWarn: true, + }; +} + +// setup i18n instance with glob +export async function setupI18n(app: App) { + const options = await createI18nOptions(); + i18n = createI18n(options) as I18n; + app.use(i18n); +} diff --git a/monolithic/frontend/src/locales/useLocale.ts b/monolithic/frontend/src/locales/useLocale.ts new file mode 100644 index 0000000..64bd4a1 --- /dev/null +++ b/monolithic/frontend/src/locales/useLocale.ts @@ -0,0 +1,69 @@ +/** + * Multi-language related operations + */ +import type { LocaleType } from '/#/config'; + +import { i18n } from './setupI18n'; +import { useLocaleStoreWithOut } from '/@/store/modules/locale'; +import { unref, computed } from 'vue'; +import { loadLocalePool, setHtmlPageLang } from './helper'; + +interface LangModule { + message: Recordable; + dateLocale: Recordable; + dateLocaleName: string; +} + +function setI18nLanguage(locale: LocaleType) { + const localeStore = useLocaleStoreWithOut(); + + if (i18n.mode === 'legacy') { + i18n.global.locale = locale; + } else { + (i18n.global.locale as any).value = locale; + } + localeStore.setLocaleInfo({ locale }); + setHtmlPageLang(locale); +} + +export function useLocale() { + const localeStore = useLocaleStoreWithOut(); + const getLocale = computed(() => localeStore.getLocale); + const getShowLocalePicker = computed(() => localeStore.getShowPicker); + + const getAntdLocale = computed((): any => { + return i18n.global.getLocaleMessage(unref(getLocale))?.antdLocale ?? {}; + }); + + // Switching the language will change the locale of useI18n + // And submit to configuration modification + async function changeLocale(locale: LocaleType) { + const globalI18n = i18n.global; + const currentLocale = unref(globalI18n.locale); + if (currentLocale === locale) { + return locale; + } + + if (loadLocalePool.includes(locale)) { + setI18nLanguage(locale); + return locale; + } + const langModule = ((await import(`./lang/${locale}.ts`)) as any).default as LangModule; + if (!langModule) return; + + const { message } = langModule; + + globalI18n.setLocaleMessage(locale, message); + loadLocalePool.push(locale); + + setI18nLanguage(locale); + return locale; + } + + return { + getLocale, + getShowLocalePicker, + changeLocale, + getAntdLocale, + }; +} diff --git a/monolithic/frontend/src/logics/error-handle/index.ts b/monolithic/frontend/src/logics/error-handle/index.ts new file mode 100644 index 0000000..e04c009 --- /dev/null +++ b/monolithic/frontend/src/logics/error-handle/index.ts @@ -0,0 +1,184 @@ +/** + * Used to configure the global error handling function, which can monitor vue errors, script errors, static resource errors and Promise errors + */ + +import type { ErrorLogInfo } from '/#/store'; + +import { useErrorLogStoreWithOut } from '/@/store/modules/errorLog'; + +import { ErrorTypeEnum } from '/@/enums/exceptionEnum'; +import { App } from 'vue'; +import projectSetting from '/@/settings/projectSetting'; + +/** + * Handling error stack information + * @param error + */ +function processStackMsg(error: Error) { + if (!error.stack) { + return ''; + } + let stack = error.stack + .replace(/\n/gi, '') // Remove line breaks to save the size of the transmitted content + .replace(/\bat\b/gi, '@') // At in chrome, @ in ff + .split('@') // Split information with @ + .slice(0, 9) // The maximum stack length (Error.stackTraceLimit = 10), so only take the first 10 + .map((v) => v.replace(/^\s*|\s*$/g, '')) // Remove extra spaces + .join('~') // Manually add separators for later display + .replace(/\?[^:]+/gi, ''); // Remove redundant parameters of js file links (?x=1 and the like) + const msg = error.toString(); + if (stack.indexOf(msg) < 0) { + stack = msg + '@' + stack; + } + return stack; +} + +/** + * get comp name + * @param vm + */ +function formatComponentName(vm: any) { + if (vm.$root === vm) { + return { + name: 'root', + path: 'root', + }; + } + + const options = vm.$options as any; + if (!options) { + return { + name: 'anonymous', + path: 'anonymous', + }; + } + const name = options.name || options._componentTag; + return { + name: name, + path: options.__file, + }; +} + +/** + * Configure Vue error handling function + */ + +function vueErrorHandler(err: Error, vm: any, info: string) { + const errorLogStore = useErrorLogStoreWithOut(); + const { name, path } = formatComponentName(vm); + errorLogStore.addErrorLogInfo({ + type: ErrorTypeEnum.VUE, + name, + file: path, + message: err.message, + stack: processStackMsg(err), + detail: info, + url: window.location.href, + }); +} + +/** + * Configure script error handling function + */ +export function scriptErrorHandler( + event: Event | string, + source?: string, + lineno?: number, + colno?: number, + error?: Error, +) { + if (event === 'Script error.' && !source) { + return false; + } + const errorInfo: Partial = {}; + colno = colno || (window.event && (window.event as any).errorCharacter) || 0; + errorInfo.message = event as string; + if (error?.stack) { + errorInfo.stack = error.stack; + } else { + errorInfo.stack = ''; + } + const name = source ? source.substr(source.lastIndexOf('/') + 1) : 'script'; + const errorLogStore = useErrorLogStoreWithOut(); + errorLogStore.addErrorLogInfo({ + type: ErrorTypeEnum.SCRIPT, + name: name, + file: source as string, + detail: 'lineno' + lineno, + url: window.location.href, + ...(errorInfo as Pick), + }); + return true; +} + +/** + * Configure Promise error handling function + */ +function registerPromiseErrorHandler() { + window.addEventListener( + 'unhandledrejection', + function (event) { + const errorLogStore = useErrorLogStoreWithOut(); + errorLogStore.addErrorLogInfo({ + type: ErrorTypeEnum.PROMISE, + name: 'Promise Error!', + file: 'none', + detail: 'promise error!', + url: window.location.href, + stack: 'promise error!', + message: event.reason, + }); + }, + true, + ); +} + +/** + * Configure monitoring resource loading error handling function + */ +function registerResourceErrorHandler() { + // Monitoring resource loading error(img,script,css,and jsonp) + window.addEventListener( + 'error', + function (e: Event) { + const target = e.target ? e.target : (e.srcElement as any); + const errorLogStore = useErrorLogStoreWithOut(); + errorLogStore.addErrorLogInfo({ + type: ErrorTypeEnum.RESOURCE, + name: 'Resource Error!', + file: (e.target || ({} as any)).currentSrc, + detail: JSON.stringify({ + tagName: target.localName, + html: target.outerHTML, + type: e.type, + }), + url: window.location.href, + stack: 'resource is not found', + message: (e.target || ({} as any)).localName + ' is load error', + }); + }, + true, + ); +} + +/** + * Configure global error handling + * @param app + */ +export function setupErrorHandle(app: App) { + const { useErrorHandle } = projectSetting; + if (!useErrorHandle) { + return; + } + // Vue exception monitoring; + app.config.errorHandler = vueErrorHandler; + + // script error + window.onerror = scriptErrorHandler; + + // promise exception + registerPromiseErrorHandler(); + + // Static resource exception + registerResourceErrorHandler(); +} diff --git a/monolithic/frontend/src/logics/initAppConfig.ts b/monolithic/frontend/src/logics/initAppConfig.ts new file mode 100644 index 0000000..39e5d3f --- /dev/null +++ b/monolithic/frontend/src/logics/initAppConfig.ts @@ -0,0 +1,84 @@ +/** + * Application configuration + */ +import type { ProjectConfig } from '/#/config'; + +import { PROJ_CFG_KEY } from '/@/enums/cacheEnum'; +import projectSetting from '/@/settings/projectSetting'; + +import { updateHeaderBgColor, updateSidebarBgColor } from '/@/logics/theme/updateBackground'; +import { updateColorWeak } from '/@/logics/theme/updateColorWeak'; +import { updateGrayMode } from '/@/logics/theme/updateGrayMode'; +import { updateDarkTheme } from '/@/logics/theme/dark'; +import { changeTheme } from '/@/logics/theme'; + +import { useAppStore } from '/@/store/modules/app'; +import { useLocaleStore } from '/@/store/modules/locale'; + +import { getCommonStoragePrefix, getStorageShortName } from '/@/utils/env'; + +import { primaryColor } from '../../build/config/themeConfig'; +import { Persistent } from '/@/utils/cache/persistent'; +import { deepMerge } from '/@/utils'; +import { ThemeEnum } from '/@/enums/appEnum'; + +// Initial project configuration +export function initAppConfigStore() { + const localeStore = useLocaleStore(); + const appStore = useAppStore(); + let projCfg: ProjectConfig = Persistent.getLocal(PROJ_CFG_KEY) as ProjectConfig; + projCfg = deepMerge(projectSetting, projCfg || {}); + const darkMode = appStore.getDarkMode; + const { + colorWeak, + grayMode, + themeColor, + + headerSetting: { bgColor: headerBgColor } = {}, + menuSetting: { bgColor } = {}, + } = projCfg; + try { + if (themeColor && themeColor !== primaryColor) { + changeTheme(themeColor); + } + + grayMode && updateGrayMode(grayMode); + colorWeak && updateColorWeak(colorWeak); + } catch (e: any) { + console.log(e); + } + appStore.setProjectConfig(projCfg); + + // init dark mode + updateDarkTheme(darkMode); + if (darkMode === ThemeEnum.DARK) { + updateHeaderBgColor(); + updateSidebarBgColor(); + } else { + headerBgColor && updateHeaderBgColor(headerBgColor); + bgColor && updateSidebarBgColor(bgColor); + } + // init store + localeStore.initLocale(); + + setTimeout(() => { + clearObsoleteStorage(); + }, 16); +} + +/** + * As the version continues to iterate, there will be more and more cache keys stored in localStorage. + * This method is used to delete useless keys + */ +export function clearObsoleteStorage() { + const commonPrefix = getCommonStoragePrefix(); + const shortPrefix = getStorageShortName(); + + [localStorage, sessionStorage].forEach((item: Storage) => { + Object.keys(item).forEach((key) => { + if (key && key.startsWith(commonPrefix) && !key.startsWith(shortPrefix)) { + item.removeItem(key); + } + }); + }); +} diff --git a/monolithic/frontend/src/logics/mitt/routeChange.ts b/monolithic/frontend/src/logics/mitt/routeChange.ts new file mode 100644 index 0000000..864828e --- /dev/null +++ b/monolithic/frontend/src/logics/mitt/routeChange.ts @@ -0,0 +1,31 @@ +/** + * Used to monitor routing changes to change the status of menus and tabs. There is no need to monitor the route, because the route status change is affected by the page rendering time, which will be slow + */ + +import mitt from '/@/utils/mitt'; +import type { RouteLocationNormalized } from 'vue-router'; +import { getRawRoute } from '/@/utils'; + +const emitter = mitt(); + +const key = Symbol(); + +let lastChangeTab: RouteLocationNormalized; + +export function setRouteChange(lastChangeRoute: RouteLocationNormalized) { + const r = getRawRoute(lastChangeRoute); + emitter.emit(key, r); + lastChangeTab = r; +} + +export function listenerRouteChange( + callback: (route: RouteLocationNormalized) => void, + immediate = true, +) { + emitter.on(key, callback); + immediate && lastChangeTab && callback(lastChangeTab); +} + +export function removeTabChangeListener() { + emitter.clear(); +} diff --git a/monolithic/frontend/src/logics/theme/dark.ts b/monolithic/frontend/src/logics/theme/dark.ts new file mode 100644 index 0000000..7069826 --- /dev/null +++ b/monolithic/frontend/src/logics/theme/dark.ts @@ -0,0 +1,24 @@ +import { darkCssIsReady, loadDarkThemeCss } from 'vite-plugin-theme/es/client'; +import { addClass, hasClass, removeClass } from '/@/utils/domUtils'; + +export async function updateDarkTheme(mode: string | null = 'light') { + const htmlRoot = document.getElementById('htmlRoot'); + if (!htmlRoot) { + return; + } + const hasDarkClass = hasClass(htmlRoot, 'dark'); + if (mode === 'dark') { + if (import.meta.env.PROD && !darkCssIsReady) { + await loadDarkThemeCss(); + } + htmlRoot.setAttribute('data-theme', 'dark'); + if (!hasDarkClass) { + addClass(htmlRoot, 'dark'); + } + } else { + htmlRoot.setAttribute('data-theme', 'light'); + if (hasDarkClass) { + removeClass(htmlRoot, 'dark'); + } + } +} diff --git a/monolithic/frontend/src/logics/theme/index.ts b/monolithic/frontend/src/logics/theme/index.ts new file mode 100644 index 0000000..5635a60 --- /dev/null +++ b/monolithic/frontend/src/logics/theme/index.ts @@ -0,0 +1,17 @@ +import { getThemeColors, generateColors } from '../../../build/config/themeConfig'; + +import { replaceStyleVariables } from 'vite-plugin-theme/es/client'; +import { mixLighten, mixDarken, tinycolor } from 'vite-plugin-theme/es/colorUtils'; + +export async function changeTheme(color: string) { + const colors = generateColors({ + mixDarken, + mixLighten, + tinycolor, + color, + }); + + return await replaceStyleVariables({ + colorVariables: [...getThemeColors(color), ...colors], + }); +} diff --git a/monolithic/frontend/src/logics/theme/updateBackground.ts b/monolithic/frontend/src/logics/theme/updateBackground.ts new file mode 100644 index 0000000..3f15c90 --- /dev/null +++ b/monolithic/frontend/src/logics/theme/updateBackground.ts @@ -0,0 +1,75 @@ +import { colorIsDark, lighten, darken } from '/@/utils/color'; +import { useAppStore } from '/@/store/modules/app'; +import { ThemeEnum } from '/@/enums/appEnum'; +import { setCssVar } from './util'; + +const HEADER_BG_COLOR_VAR = '--header-bg-color'; +const HEADER_BG_HOVER_COLOR_VAR = '--header-bg-hover-color'; +const HEADER_MENU_ACTIVE_BG_COLOR_VAR = '--header-active-menu-bg-color'; + +const SIDER_DARK_BG_COLOR = '--sider-dark-bg-color'; +const SIDER_DARK_DARKEN_BG_COLOR = '--sider-dark-darken-bg-color'; +const SIDER_LIGHTEN_BG_COLOR = '--sider-dark-lighten-bg-color'; + +/** + * Change the background color of the top header + * @param color + */ +export function updateHeaderBgColor(color?: string) { + const appStore = useAppStore(); + const darkMode = appStore.getDarkMode === ThemeEnum.DARK; + if (!color) { + if (darkMode) { + color = '#151515'; + } else { + color = appStore.getHeaderSetting.bgColor; + } + } + // bg color + setCssVar(HEADER_BG_COLOR_VAR, color); + + // hover color + const hoverColor = lighten(color!, 6); + setCssVar(HEADER_BG_HOVER_COLOR_VAR, hoverColor); + setCssVar(HEADER_MENU_ACTIVE_BG_COLOR_VAR, hoverColor); + + // Determine the depth of the color value and automatically switch the theme + const isDark = colorIsDark(color!); + + appStore.setProjectConfig({ + headerSetting: { + theme: isDark || darkMode ? ThemeEnum.DARK : ThemeEnum.LIGHT, + }, + }); +} + +/** + * Change the background color of the left menu + * @param color bg color + */ +export function updateSidebarBgColor(color?: string) { + const appStore = useAppStore(); + + // if (!isHexColor(color)) return; + const darkMode = appStore.getDarkMode === ThemeEnum.DARK; + if (!color) { + if (darkMode) { + color = '#212121'; + } else { + color = appStore.getMenuSetting.bgColor; + } + } + setCssVar(SIDER_DARK_BG_COLOR, color); + setCssVar(SIDER_DARK_DARKEN_BG_COLOR, darken(color!, 6)); + setCssVar(SIDER_LIGHTEN_BG_COLOR, lighten(color!, 5)); + + // only #ffffff is light + // Only when the background color is #fff, the theme of the menu will be changed to light + const isLight = ['#fff', '#ffffff'].includes(color!.toLowerCase()); + + appStore.setProjectConfig({ + menuSetting: { + theme: isLight && !darkMode ? ThemeEnum.LIGHT : ThemeEnum.DARK, + }, + }); +} diff --git a/monolithic/frontend/src/logics/theme/updateColorWeak.ts b/monolithic/frontend/src/logics/theme/updateColorWeak.ts new file mode 100644 index 0000000..8a0e64a --- /dev/null +++ b/monolithic/frontend/src/logics/theme/updateColorWeak.ts @@ -0,0 +1,9 @@ +import { toggleClass } from './util'; + +/** + * Change the status of the project's color weakness mode + * @param colorWeak + */ +export function updateColorWeak(colorWeak: boolean) { + toggleClass(colorWeak, 'color-weak', document.documentElement); +} diff --git a/monolithic/frontend/src/logics/theme/updateGrayMode.ts b/monolithic/frontend/src/logics/theme/updateGrayMode.ts new file mode 100644 index 0000000..0fd16fe --- /dev/null +++ b/monolithic/frontend/src/logics/theme/updateGrayMode.ts @@ -0,0 +1,9 @@ +import { toggleClass } from './util'; + +/** + * Change project gray mode status + * @param gray + */ +export function updateGrayMode(gray: boolean) { + toggleClass(gray, 'gray-mode', document.documentElement); +} diff --git a/monolithic/frontend/src/logics/theme/util.ts b/monolithic/frontend/src/logics/theme/util.ts new file mode 100644 index 0000000..30aef37 --- /dev/null +++ b/monolithic/frontend/src/logics/theme/util.ts @@ -0,0 +1,11 @@ +const docEle = document.documentElement; +export function toggleClass(flag: boolean, clsName: string, target?: HTMLElement) { + const targetEl = target || document.body; + let { className } = targetEl; + className = className.replace(clsName, ''); + targetEl.className = flag ? `${className} ${clsName} ` : className; +} + +export function setCssVar(prop: string, val: any, dom = docEle) { + dom.style.setProperty(prop, val); +} diff --git a/monolithic/frontend/src/main.ts b/monolithic/frontend/src/main.ts new file mode 100644 index 0000000..ccd709f --- /dev/null +++ b/monolithic/frontend/src/main.ts @@ -0,0 +1,61 @@ +import 'virtual:windi-base.css'; +import 'virtual:windi-components.css'; +import '/@/design/index.less'; +import 'virtual:windi-utilities.css'; +// Register icon sprite +import 'virtual:svg-icons-register'; +import App from './App.vue'; +import { createApp } from 'vue'; +import { initAppConfigStore } from '/@/logics/initAppConfig'; +import { setupErrorHandle } from '/@/logics/error-handle'; +import { router, setupRouter } from '/@/router'; +import { setupRouterGuard } from '/@/router/guard'; +import { setupStore } from '/@/store'; +import { setupGlobDirectives } from '/@/directives'; +import { setupI18n } from '/@/locales/setupI18n'; +import { registerGlobComp } from '/@/components/registerGlobComp'; + +async function bootstrap() { + const app = createApp(App); + + // Configure store + // 配置 store + setupStore(app); + + // Initialize internal system configuration + // 初始化内部系统配置 + initAppConfigStore(); + + // Register global components + // 注册全局组件 + registerGlobComp(app); + + // Multilingual configuration + // 多语言配置 + // Asynchronous case: language files may be obtained from the server side + // 异步案例:语言文件可能从服务器端获取 + await setupI18n(app); + + // Configure routing + // 配置路由 + setupRouter(app); + + // router-guard + // 路由守卫 + setupRouterGuard(router); + + // Register global directive + // 注册全局指令 + setupGlobDirectives(app); + + // Configure global error handling + // 配置全局错误处理 + setupErrorHandle(app); + + // https://next.router.vuejs.org/api/#isready + // await router.isReady(); + + app.mount('#app'); +} + +bootstrap(); diff --git a/monolithic/frontend/src/router/constant.ts b/monolithic/frontend/src/router/constant.ts new file mode 100644 index 0000000..d39a67e --- /dev/null +++ b/monolithic/frontend/src/router/constant.ts @@ -0,0 +1,24 @@ +export const REDIRECT_NAME = 'Redirect'; + +export const PARENT_LAYOUT_NAME = 'ParentLayout'; + +export const PAGE_NOT_FOUND_NAME = 'PageNotFound'; + +export const EXCEPTION_COMPONENT = () => import('/@/views/sys/exception/Exception.vue'); + +/** + * @description: default layout + */ +export const LAYOUT = () => import('/@/layouts/default/index.vue'); + +/** + * @description: parent-layout + */ +export const getParentLayout = (_name?: string) => { + return () => + new Promise((resolve) => { + resolve({ + name: PARENT_LAYOUT_NAME, + }); + }); +}; diff --git a/monolithic/frontend/src/router/guard/index.ts b/monolithic/frontend/src/router/guard/index.ts new file mode 100644 index 0000000..b65a89a --- /dev/null +++ b/monolithic/frontend/src/router/guard/index.ts @@ -0,0 +1,147 @@ +import type { Router, RouteLocationNormalized } from 'vue-router'; +import { useAppStoreWithOut } from '/@/store/modules/app'; +import { useUserStoreWithOut } from '/@/store/modules/user'; +import { useTransitionSetting } from '/@/hooks/setting/useTransitionSetting'; +import { AxiosCanceler } from '/@/utils/http/axios/axiosCancel'; +import { Modal, notification } from 'ant-design-vue'; +import { warn } from '/@/utils/log'; +import { unref } from 'vue'; +import { setRouteChange } from '/@/logics/mitt/routeChange'; +import { createPermissionGuard } from './permissionGuard'; +import { createStateGuard } from './stateGuard'; +import nProgress from 'nprogress'; +import projectSetting from '/@/settings/projectSetting'; +import { createParamMenuGuard } from './paramMenuGuard'; + +// Don't change the order of creation +export function setupRouterGuard(router: Router) { + createPageGuard(router); + createPageLoadingGuard(router); + createHttpGuard(router); + createScrollGuard(router); + createMessageGuard(router); + createProgressGuard(router); + createPermissionGuard(router); + createParamMenuGuard(router); // must after createPermissionGuard (menu has been built.) + createStateGuard(router); +} + +/** + * Hooks for handling page state + */ +function createPageGuard(router: Router) { + const loadedPageMap = new Map(); + + router.beforeEach(async (to) => { + // The page has already been loaded, it will be faster to open it again, you don’t need to do loading and other processing + to.meta.loaded = !!loadedPageMap.get(to.path); + // Notify routing changes + setRouteChange(to); + + return true; + }); + + router.afterEach((to) => { + loadedPageMap.set(to.path, true); + }); +} + +// Used to handle page loading status +function createPageLoadingGuard(router: Router) { + const userStore = useUserStoreWithOut(); + const appStore = useAppStoreWithOut(); + const { getOpenPageLoading } = useTransitionSetting(); + router.beforeEach(async (to) => { + if (!userStore.getToken) { + return true; + } + if (to.meta.loaded) { + return true; + } + + if (unref(getOpenPageLoading)) { + appStore.setPageLoadingAction(true); + return true; + } + + return true; + }); + router.afterEach(async () => { + if (unref(getOpenPageLoading)) { + // TODO Looking for a better way + // The timer simulates the loading time to prevent flashing too fast, + setTimeout(() => { + appStore.setPageLoading(false); + }, 220); + } + return true; + }); +} + +/** + * The interfaces used to close the current page to complete the request when the route is switched + * @param router + */ +function createHttpGuard(router: Router) { + const { removeAllHttpPending } = projectSetting; + let axiosCanceler: Nullable; + if (removeAllHttpPending) { + axiosCanceler = new AxiosCanceler(); + } + router.beforeEach(async () => { + // Switching the route will delete the previous request + axiosCanceler?.removeAllPending(); + return true; + }); +} + +// Routing switch back to the top +function createScrollGuard(router: Router) { + const isHash = (href: string) => { + return /^#/.test(href); + }; + + const body = document.body; + + router.afterEach(async (to) => { + // scroll top + isHash((to as RouteLocationNormalized & { href: string })?.href) && body.scrollTo(0, 0); + return true; + }); +} + +/** + * Used to close the message instance when the route is switched + * @param router + */ +export function createMessageGuard(router: Router) { + const { closeMessageOnSwitch } = projectSetting; + + router.beforeEach(async () => { + try { + if (closeMessageOnSwitch) { + Modal.destroyAll(); + notification.destroy(); + } + } catch (e: any) { + warn('message guard error:' + e); + } + return true; + }); +} + +export function createProgressGuard(router: Router) { + const { getOpenNProgress } = useTransitionSetting(); + router.beforeEach(async (to) => { + if (to.meta.loaded) { + return true; + } + unref(getOpenNProgress) && nProgress.start(); + return true; + }); + + router.afterEach(async () => { + unref(getOpenNProgress) && nProgress.done(); + return true; + }); +} diff --git a/monolithic/frontend/src/router/guard/paramMenuGuard.ts b/monolithic/frontend/src/router/guard/paramMenuGuard.ts new file mode 100644 index 0000000..1c75157 --- /dev/null +++ b/monolithic/frontend/src/router/guard/paramMenuGuard.ts @@ -0,0 +1,47 @@ +import type { Router } from 'vue-router'; +import { configureDynamicParamsMenu } from '../helper/menuHelper'; +import { Menu } from '../types'; +import { PermissionModeEnum } from '/@/enums/appEnum'; +import { useAppStoreWithOut } from '/@/store/modules/app'; + +import { usePermissionStoreWithOut } from '/@/store/modules/permission'; + +export function createParamMenuGuard(router: Router) { + const permissionStore = usePermissionStoreWithOut(); + router.beforeEach(async (to, _, next) => { + // filter no name route + if (!to.name) { + next(); + return; + } + + // menu has been built. + if (!permissionStore.getIsDynamicAddedRoute) { + next(); + return; + } + + let menus: Menu[] = []; + if (isBackMode()) { + menus = permissionStore.getBackMenuList; + } else if (isRouteMappingMode()) { + menus = permissionStore.getFrontMenuList; + } + menus.forEach((item) => configureDynamicParamsMenu(item, to.params)); + + next(); + }); +} + +const getPermissionMode = () => { + const appStore = useAppStoreWithOut(); + return appStore.getProjectConfig.permissionMode; +}; + +const isBackMode = () => { + return getPermissionMode() === PermissionModeEnum.BACK; +}; + +const isRouteMappingMode = () => { + return getPermissionMode() === PermissionModeEnum.ROUTE_MAPPING; +}; diff --git a/monolithic/frontend/src/router/guard/permissionGuard.ts b/monolithic/frontend/src/router/guard/permissionGuard.ts new file mode 100644 index 0000000..cff5903 --- /dev/null +++ b/monolithic/frontend/src/router/guard/permissionGuard.ts @@ -0,0 +1,118 @@ +import type { Router, RouteRecordRaw } from 'vue-router'; + +import { usePermissionStoreWithOut } from '/@/store/modules/permission'; + +import { PageEnum } from '/@/enums/pageEnum'; +import { useUserStoreWithOut } from '/@/store/modules/user'; + +import { PAGE_NOT_FOUND_ROUTE } from '/@/router/routes/basic'; + +import { RootRoute } from '/@/router/routes'; + +const LOGIN_PATH = PageEnum.BASE_LOGIN; + +const ROOT_PATH = RootRoute.path; + +const whitePathList: PageEnum[] = [LOGIN_PATH]; + +export function createPermissionGuard(router: Router) { + const userStore = useUserStoreWithOut(); + const permissionStore = usePermissionStoreWithOut(); + router.beforeEach(async (to, from, next) => { + if ( + from.path === ROOT_PATH && + to.path === PageEnum.BASE_HOME && + userStore.getUserInfo.homePath && + userStore.getUserInfo.homePath !== PageEnum.BASE_HOME + ) { + next(userStore.getUserInfo.homePath); + return; + } + + const token = userStore.getToken; + + // Whitelist can be directly entered + if (whitePathList.includes(to.path as PageEnum)) { + if (to.path === LOGIN_PATH && token) { + const isSessionTimeout = userStore.getSessionTimeout; + try { + await userStore.afterLoginAction(); + if (!isSessionTimeout) { + next((to.query?.redirect as string) || '/'); + return; + } + } catch {} + } + next(); + return; + } + + // token does not exist + if (!token) { + // You can access without permission. You need to set the routing meta.ignoreAuth to true + if (to.meta.ignoreAuth) { + next(); + return; + } + + // redirect login page + const redirectData: { path: string; replace: boolean; query?: Recordable } = { + path: LOGIN_PATH, + replace: true, + }; + if (to.path) { + redirectData.query = { + ...redirectData.query, + redirect: to.path, + }; + } + next(redirectData); + return; + } + + // Jump to the 404 page after processing the login + if ( + from.path === LOGIN_PATH && + to.name === PAGE_NOT_FOUND_ROUTE.name && + to.fullPath !== (userStore.getUserInfo.homePath || PageEnum.BASE_HOME) + ) { + next(userStore.getUserInfo.homePath || PageEnum.BASE_HOME); + return; + } + + // get userinfo while last fetch time is empty + if (userStore.getLastUpdateTime === 0) { + try { + await userStore.getUserInfoAction(); + } catch (e: any) { + next(); + return; + } + } + + if (permissionStore.getIsDynamicAddedRoute) { + next(); + return; + } + + const routes = await permissionStore.buildRoutesAction(); + + routes.forEach((route) => { + router.addRoute(route as unknown as RouteRecordRaw); + }); + + router.addRoute(PAGE_NOT_FOUND_ROUTE as unknown as RouteRecordRaw); + + permissionStore.setDynamicAddedRoute(true); + + if (to.name === PAGE_NOT_FOUND_ROUTE.name) { + // 动态添加路由后,此处应当重定向到fullPath,否则会加载404页面内容 + next({ path: to.fullPath, replace: true, query: to.query }); + } else { + const redirectPath = (from.query.redirect || to.path) as string; + const redirect = decodeURIComponent(redirectPath); + const nextData = to.path === redirect ? { ...to, replace: true } : { path: redirect }; + next(nextData); + } + }); +} diff --git a/monolithic/frontend/src/router/guard/stateGuard.ts b/monolithic/frontend/src/router/guard/stateGuard.ts new file mode 100644 index 0000000..c34513c --- /dev/null +++ b/monolithic/frontend/src/router/guard/stateGuard.ts @@ -0,0 +1,24 @@ +import type { Router } from 'vue-router'; +import { useAppStore } from '/@/store/modules/app'; +import { useMultipleTabStore } from '/@/store/modules/multipleTab'; +import { useUserStore } from '/@/store/modules/user'; +import { usePermissionStore } from '/@/store/modules/permission'; +import { PageEnum } from '/@/enums/pageEnum'; +import { removeTabChangeListener } from '/@/logics/mitt/routeChange'; + +export function createStateGuard(router: Router) { + router.afterEach((to) => { + // Just enter the login page and clear the authentication information + if (to.path === PageEnum.BASE_LOGIN) { + const tabStore = useMultipleTabStore(); + const userStore = useUserStore(); + const appStore = useAppStore(); + const permissionStore = usePermissionStore(); + appStore.resetAllState(); + permissionStore.resetState(); + tabStore.resetState(); + userStore.resetState(); + removeTabChangeListener(); + } + }); +} diff --git a/monolithic/frontend/src/router/helper/menuHelper.ts b/monolithic/frontend/src/router/helper/menuHelper.ts new file mode 100644 index 0000000..f0767b2 --- /dev/null +++ b/monolithic/frontend/src/router/helper/menuHelper.ts @@ -0,0 +1,106 @@ +import { AppRouteModule } from '/@/router/types'; +import type { MenuModule, Menu, AppRouteRecordRaw } from '/@/router/types'; +import { findPath, treeMap } from '/@/utils/helper/treeHelper'; +import { cloneDeep } from 'lodash-es'; +import { isUrl } from '/@/utils/is'; +import { RouteParams } from 'vue-router'; +import { toRaw } from 'vue'; + +export function getAllParentPath(treeData: T[], path: string) { + const menuList = findPath(treeData, (n) => n.path === path) as Menu[]; + return (menuList || []).map((item) => item.path); +} + +// 路径处理 +function joinParentPath(menus: Menu[], parentPath = '') { + for (let index = 0; index < menus.length; index++) { + const menu = menus[index]; + // https://next.router.vuejs.org/guide/essentials/nested-routes.html + // Note that nested paths that start with / will be treated as a root path. + // 请注意,以 / 开头的嵌套路径将被视为根路径。 + // This allows you to leverage the component nesting without having to use a nested URL. + // 这允许你利用组件嵌套,而无需使用嵌套 URL。 + if (!(menu.path.startsWith('/') || isUrl(menu.path))) { + // path doesn't start with /, nor is it a url, join parent path + // 路径不以 / 开头,也不是 url,加入父路径 + menu.path = `${parentPath}/${menu.path}`; + } + if (menu?.children?.length) { + joinParentPath(menu.children, menu.meta?.hidePathForChildren ? parentPath : menu.path); + } + } +} + +// Parsing the menu module +export function transformMenuModule(menuModule: MenuModule): Menu { + const { menu } = menuModule; + + const menuList = [menu]; + + joinParentPath(menuList); + return menuList[0]; +} + +// 将路由转换成菜单 +export function transformRouteToMenu(routeModList: AppRouteModule[], routerMapping = false) { + // 借助 lodash 深拷贝 + const cloneRouteModList = cloneDeep(routeModList); + const routeList: AppRouteRecordRaw[] = []; + + // 对路由项进行修改 + cloneRouteModList.forEach((item) => { + if (routerMapping && item.meta.hideChildrenInMenu && typeof item.redirect === 'string') { + item.path = item.redirect; + } + + if (item.meta?.single) { + const realItem = item?.children?.[0]; + realItem && routeList.push(realItem); + } else { + routeList.push(item); + } + }); + // 提取树指定结构 + const list = treeMap(routeList, { + conversion: (node: AppRouteRecordRaw) => { + const { meta: { title, hideMenu = false } = {} } = node; + + return { + ...(node.meta || {}), + meta: node.meta, + name: title, + hideMenu, + path: node.path, + ...(node.redirect ? { redirect: node.redirect } : {}), + }; + }, + }); + // 路径处理 + joinParentPath(list); + return cloneDeep(list); +} + +/** + * config menu with given params + */ +const menuParamRegex = /(?::)([\s\S]+?)((?=\/)|$)/g; + +export function configureDynamicParamsMenu(menu: Menu, params: RouteParams) { + const { path, paramPath } = toRaw(menu); + let realPath = paramPath ? paramPath : path; + const matchArr = realPath.match(menuParamRegex); + + matchArr?.forEach((it) => { + const realIt = it.substr(1); + if (params[realIt]) { + realPath = realPath.replace(`:${realIt}`, params[realIt] as string); + } + }); + // save original param path. + if (!paramPath && matchArr && matchArr.length > 0) { + menu.paramPath = path; + } + menu.path = realPath; + // children + menu.children?.forEach((item) => configureDynamicParamsMenu(item, params)); +} diff --git a/monolithic/frontend/src/router/helper/routeHelper.ts b/monolithic/frontend/src/router/helper/routeHelper.ts new file mode 100644 index 0000000..d133209 --- /dev/null +++ b/monolithic/frontend/src/router/helper/routeHelper.ts @@ -0,0 +1,178 @@ +import type { AppRouteModule, AppRouteRecordRaw } from '/@/router/types'; +import type { Router, RouteRecordNormalized } from 'vue-router'; + +import { getParentLayout, LAYOUT, EXCEPTION_COMPONENT } from '/@/router/constant'; +import { cloneDeep, omit } from 'lodash-es'; +import { warn } from '/@/utils/log'; +import { createRouter, createWebHashHistory } from 'vue-router'; + +export type LayoutMapKey = 'LAYOUT'; +const IFRAME = () => import('/@/views/sys/iframe/FrameBlank.vue'); + +const LayoutMap = new Map Promise>(); + +LayoutMap.set('LAYOUT', LAYOUT); +LayoutMap.set('IFRAME', IFRAME); + +let dynamicViewsModules: Record Promise>; + +// Dynamic introduction +function asyncImportRoute(routes: AppRouteRecordRaw[] | undefined) { + dynamicViewsModules = dynamicViewsModules || import.meta.glob('../../views/**/*.{vue,tsx}'); + if (!routes) return; + routes.forEach((item) => { + if (!item.component && item.meta?.frameSrc) { + item.component = 'IFRAME'; + } + const { component, name } = item; + const { children } = item; + if (component) { + const layoutFound = LayoutMap.get(component.toUpperCase()); + if (layoutFound) { + item.component = layoutFound; + } else { + item.component = dynamicImport(dynamicViewsModules, component as string); + } + } else if (name) { + item.component = getParentLayout(); + } + children && asyncImportRoute(children); + }); +} + +function dynamicImport( + dynamicViewsModules: Record Promise>, + component: string, +) { + const keys = Object.keys(dynamicViewsModules); + const matchKeys = keys.filter((key) => { + const k = key.replace('../../views', ''); + const startFlag = component.startsWith('/'); + const endFlag = component.endsWith('.vue') || component.endsWith('.tsx'); + const startIndex = startFlag ? 0 : 1; + const lastIndex = endFlag ? k.length : k.lastIndexOf('.'); + return k.substring(startIndex, lastIndex) === component; + }); + if (matchKeys?.length === 1) { + const matchKey = matchKeys[0]; + return dynamicViewsModules[matchKey]; + } else if (matchKeys?.length > 1) { + warn( + 'Please do not create `.vue` and `.TSX` files with the same file name in the same hierarchical directory under the views folder. This will cause dynamic introduction failure', + ); + return; + } else { + warn('在src/views/下找不到`' + component + '.vue` 或 `' + component + '.tsx`, 请自行创建!'); + return EXCEPTION_COMPONENT; + } +} + +// Turn background objects into routing objects +// 将背景对象变成路由对象 +export function transformObjToRoute(routeList: AppRouteModule[]): T[] { + routeList.forEach((route) => { + const component = route.component as string; + if (component) { + if (component.toUpperCase() === 'LAYOUT') { + route.component = LayoutMap.get(component.toUpperCase()); + } else { + route.children = [cloneDeep(route)]; + route.component = LAYOUT; + route.name = `${route.name}Parent`; + route.path = ''; + const meta = route.meta || {}; + meta.single = true; + meta.affix = false; + route.meta = meta; + } + } else { + warn('请正确配置路由:' + route?.name + '的component属性'); + } + route.children && asyncImportRoute(route.children); + }); + return routeList as unknown as T[]; +} + +/** + * Convert multi-level routing to level 2 routing + * 将多级路由转换为 2 级路由 + */ +export function flatMultiLevelRoutes(routeModules: AppRouteModule[]) { + const modules: AppRouteModule[] = cloneDeep(routeModules); + + for (let index = 0; index < modules.length; index++) { + const routeModule = modules[index]; + // 判断级别是否 多级 路由 + if (!isMultipleRoute(routeModule)) { + // 声明终止当前循环, 即跳过此次循环,进行下一轮 + continue; + } + // 路由等级提升 + promoteRouteLevel(routeModule); + } + return modules; +} + +// Routing level upgrade +// 路由等级提升 +function promoteRouteLevel(routeModule: AppRouteModule) { + // Use vue-router to splice menus + // 使用vue-router拼接菜单 + // createRouter 创建一个可以被 Vue 应用程序使用的路由实例 + let router: Router | null = createRouter({ + routes: [routeModule as unknown as RouteRecordNormalized], + history: createWebHashHistory(), + }); + // getRoutes: 获取所有 路由记录的完整列表。 + const routes = router.getRoutes(); + // 将所有子路由添加到二级路由 + addToChildren(routes, routeModule.children || [], routeModule); + router = null; + + // omit lodash的函数 对传入的item对象的children进行删除 + routeModule.children = routeModule.children?.map((item) => omit(item, 'children')); +} + +// Add all sub-routes to the secondary route +// 将所有子路由添加到二级路由 +function addToChildren( + routes: RouteRecordNormalized[], + children: AppRouteRecordRaw[], + routeModule: AppRouteModule, +) { + for (let index = 0; index < children.length; index++) { + const child = children[index]; + const route = routes.find((item) => item.name === child.name); + if (!route) { + continue; + } + routeModule.children = routeModule.children || []; + if (!routeModule.children.find((item) => item.name === route.name)) { + routeModule.children?.push(route as unknown as AppRouteModule); + } + if (child.children?.length) { + addToChildren(routes, child.children, routeModule); + } + } +} + +// Determine whether the level exceeds 2 levels +// 判断级别是否超过2级 +function isMultipleRoute(routeModule: AppRouteModule) { + // Reflect.has 与 in 操作符 相同, 用于检查一个对象(包括它原型链上)是否拥有某个属性 + if (!routeModule || !Reflect.has(routeModule, 'children') || !routeModule.children?.length) { + return false; + } + + const children = routeModule.children; + + let flag = false; + for (let index = 0; index < children.length; index++) { + const child = children[index]; + if (child.children?.length) { + flag = true; + break; + } + } + return flag; +} diff --git a/monolithic/frontend/src/router/index.ts b/monolithic/frontend/src/router/index.ts new file mode 100644 index 0000000..bcfc17f --- /dev/null +++ b/monolithic/frontend/src/router/index.ts @@ -0,0 +1,42 @@ +import type { RouteRecordRaw } from 'vue-router'; +import type { App } from 'vue'; + +import { createRouter, createWebHashHistory } from 'vue-router'; +import { basicRoutes } from './routes'; + +// 白名单应该包含基本静态路由 +const WHITE_NAME_LIST: string[] = []; +const getRouteNames = (array: any[]) => + array.forEach((item) => { + WHITE_NAME_LIST.push(item.name); + getRouteNames(item.children || []); + }); +getRouteNames(basicRoutes); + +// app router +// 创建一个可以被 Vue 应用程序使用的路由实例 +export const router = createRouter({ + // 创建一个 hash 历史记录。 + history: createWebHashHistory(import.meta.env.VITE_PUBLIC_PATH), + // 应该添加到路由的初始路由列表。 + routes: basicRoutes as unknown as RouteRecordRaw[], + // 是否应该禁止尾部斜杠。默认为假 + strict: true, + scrollBehavior: () => ({ left: 0, top: 0 }), +}); + +// reset router +export function resetRouter() { + router.getRoutes().forEach((route) => { + const { name } = route; + if (name && !WHITE_NAME_LIST.includes(name as string)) { + router.hasRoute(name) && router.removeRoute(name); + } + }); +} + +// config router +// 配置路由器 +export function setupRouter(app: App) { + app.use(router); +} diff --git a/monolithic/frontend/src/router/menus/index.ts b/monolithic/frontend/src/router/menus/index.ts new file mode 100644 index 0000000..bf67721 --- /dev/null +++ b/monolithic/frontend/src/router/menus/index.ts @@ -0,0 +1,126 @@ +import type { Menu, MenuModule } from '/@/router/types'; +import type { RouteRecordNormalized } from 'vue-router'; + +import { useAppStoreWithOut } from '/@/store/modules/app'; +import { usePermissionStore } from '/@/store/modules/permission'; +import { transformMenuModule, getAllParentPath } from '/@/router/helper/menuHelper'; +import { filter } from '/@/utils/helper/treeHelper'; +import { isUrl } from '/@/utils/is'; +import { router } from '/@/router'; +import { PermissionModeEnum } from '/@/enums/appEnum'; +import { pathToRegexp } from 'path-to-regexp'; + +const modules = import.meta.globEager('./modules/**/*.ts'); + +const menuModules: MenuModule[] = []; + +Object.keys(modules).forEach((key) => { + const mod = modules[key].default || {}; + const modList = Array.isArray(mod) ? [...mod] : [mod]; + menuModules.push(...modList); +}); + +// =========================== +// ==========Helper=========== +// =========================== + +const getPermissionMode = () => { + const appStore = useAppStoreWithOut(); + return appStore.getProjectConfig.permissionMode; +}; +const isBackMode = () => { + return getPermissionMode() === PermissionModeEnum.BACK; +}; + +const isRouteMappingMode = () => { + return getPermissionMode() === PermissionModeEnum.ROUTE_MAPPING; +}; + +const isRoleMode = () => { + return getPermissionMode() === PermissionModeEnum.ROLE; +}; + +const staticMenus: Menu[] = []; +(() => { + menuModules.sort((a, b) => { + return (a.orderNo || 0) - (b.orderNo || 0); + }); + + for (const menu of menuModules) { + staticMenus.push(transformMenuModule(menu)); + } +})(); + +async function getAsyncMenus() { + const permissionStore = usePermissionStore(); + if (isBackMode()) { + return permissionStore.getBackMenuList.filter((item) => !item.meta?.hideMenu && !item.hideMenu); + } + if (isRouteMappingMode()) { + return permissionStore.getFrontMenuList.filter((item) => !item.hideMenu); + } + return staticMenus; +} + +export const getMenus = async (): Promise => { + const menus = await getAsyncMenus(); + if (isRoleMode()) { + const routes = router.getRoutes(); + return filter(menus, basicFilter(routes)); + } + return menus; +}; + +export async function getCurrentParentPath(currentPath: string) { + const menus = await getAsyncMenus(); + const allParentPath = await getAllParentPath(menus, currentPath); + return allParentPath?.[0]; +} + +// Get the level 1 menu, delete children +export async function getShallowMenus(): Promise { + const menus = await getAsyncMenus(); + const shallowMenuList = menus.map((item) => ({ ...item, children: undefined })); + if (isRoleMode()) { + const routes = router.getRoutes(); + return shallowMenuList.filter(basicFilter(routes)); + } + return shallowMenuList; +} + +// Get the children of the menu +export async function getChildrenMenus(parentPath: string) { + const menus = await getMenus(); + const parent = menus.find((item) => item.path === parentPath); + if (!parent || !parent.children || !!parent?.meta?.hideChildrenInMenu) { + return [] as Menu[]; + } + if (isRoleMode()) { + const routes = router.getRoutes(); + return filter(parent.children, basicFilter(routes)); + } + return parent.children; +} + +function basicFilter(routes: RouteRecordNormalized[]) { + return (menu: Menu) => { + const matchRoute = routes.find((route) => { + if (isUrl(menu.path)) return true; + + if (route.meta?.carryParam) { + return pathToRegexp(route.path).test(menu.path); + } + const isSame = route.path === menu.path; + if (!isSame) return false; + + if (route.meta?.ignoreAuth) return true; + + return isSame || pathToRegexp(route.path).test(menu.path); + }); + + if (!matchRoute) return false; + menu.icon = (menu.icon || matchRoute.meta.icon) as string; + menu.meta = matchRoute.meta; + return true; + }; +} diff --git a/monolithic/frontend/src/router/routes/basic.ts b/monolithic/frontend/src/router/routes/basic.ts new file mode 100644 index 0000000..58db494 --- /dev/null +++ b/monolithic/frontend/src/router/routes/basic.ts @@ -0,0 +1,78 @@ +import type { AppRouteRecordRaw } from '/@/router/types'; +import { t } from '/@/hooks/web/useI18n'; +import { + REDIRECT_NAME, + LAYOUT, + EXCEPTION_COMPONENT, + PAGE_NOT_FOUND_NAME, +} from '/@/router/constant'; + +// 404 on a page +export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = { + path: '/:path(.*)*', + name: PAGE_NOT_FOUND_NAME, + component: LAYOUT, + meta: { + title: 'ErrorPage', + hideBreadcrumb: true, + hideMenu: true, + }, + children: [ + { + path: '/:path(.*)*', + name: PAGE_NOT_FOUND_NAME, + component: EXCEPTION_COMPONENT, + meta: { + title: 'ErrorPage', + hideBreadcrumb: true, + hideMenu: true, + }, + }, + ], +}; + +export const REDIRECT_ROUTE: AppRouteRecordRaw = { + path: '/redirect', + component: LAYOUT, + name: 'RedirectTo', + meta: { + title: REDIRECT_NAME, + hideBreadcrumb: true, + hideMenu: true, + }, + children: [ + { + path: '/redirect/:path(.*)', + name: REDIRECT_NAME, + component: () => import('/@/views/sys/redirect/index.vue'), + meta: { + title: REDIRECT_NAME, + hideBreadcrumb: true, + }, + }, + ], +}; + +export const ERROR_LOG_ROUTE: AppRouteRecordRaw = { + path: '/error-log', + name: 'ErrorLog', + component: LAYOUT, + redirect: '/error-log/list', + meta: { + title: 'ErrorLog', + hideBreadcrumb: true, + hideChildrenInMenu: true, + }, + children: [ + { + path: 'list', + name: 'ErrorLogList', + component: () => import('/@/views/sys/error-log/index.vue'), + meta: { + title: t('routes.basic.errorLogList'), + hideBreadcrumb: true, + currentActiveMenu: '/error-log', + }, + }, + ], +}; diff --git a/monolithic/frontend/src/router/routes/index.ts b/monolithic/frontend/src/router/routes/index.ts new file mode 100644 index 0000000..5262342 --- /dev/null +++ b/monolithic/frontend/src/router/routes/index.ts @@ -0,0 +1,49 @@ +import type { AppRouteRecordRaw, AppRouteModule } from '/@/router/types'; + +import { PAGE_NOT_FOUND_ROUTE, REDIRECT_ROUTE } from '/@/router/routes/basic'; + +import { mainOutRoutes } from './mainOut'; +import { PageEnum } from '/@/enums/pageEnum'; +import { t } from '/@/hooks/web/useI18n'; + +// import.meta.globEager() 直接引入所有的模块 Vite 独有的功能 +const modules = import.meta.globEager('./modules/**/*.ts'); +const routeModuleList: AppRouteModule[] = []; + +// 加入到路由集合中 +Object.keys(modules).forEach((key) => { + const mod = modules[key].default || {}; + const modList = Array.isArray(mod) ? [...mod] : [mod]; + routeModuleList.push(...modList); +}); + +export const asyncRoutes = [PAGE_NOT_FOUND_ROUTE, ...routeModuleList]; + +// 根路由 +export const RootRoute: AppRouteRecordRaw = { + path: '/', + name: 'Root', + redirect: PageEnum.BASE_HOME, + meta: { + title: 'Root', + }, +}; + +export const LoginRoute: AppRouteRecordRaw = { + path: '/login', + name: 'Login', + component: () => import('/@/views/sys/login/Login.vue'), + meta: { + title: t('routes.basic.login'), + }, +}; + +// Basic routing without permission +// 未经许可的基本路由 +export const basicRoutes = [ + LoginRoute, + RootRoute, + ...mainOutRoutes, + REDIRECT_ROUTE, + PAGE_NOT_FOUND_ROUTE, +]; diff --git a/monolithic/frontend/src/router/routes/mainOut.ts b/monolithic/frontend/src/router/routes/mainOut.ts new file mode 100644 index 0000000..b0e403f --- /dev/null +++ b/monolithic/frontend/src/router/routes/mainOut.ts @@ -0,0 +1,22 @@ +/** +The routing of this file will not show the layout. +It is an independent new page. +the contents of the file still need to log in to access + */ +import type { AppRouteModule } from '/@/router/types'; + +// test +// http:ip:port/main-out +export const mainOutRoutes: AppRouteModule[] = [ + { + path: '/main-out', + name: 'MainOut', + component: () => import('/src/views/sys/main-out/index.vue'), + meta: { + title: 'MainOut', + ignoreAuth: true, + }, + }, +]; + +export const mainOutRouteNames = mainOutRoutes.map((item) => item.name); diff --git a/monolithic/frontend/src/router/routes/modules/app/system.ts b/monolithic/frontend/src/router/routes/modules/app/system.ts new file mode 100644 index 0000000..c395b29 --- /dev/null +++ b/monolithic/frontend/src/router/routes/modules/app/system.ts @@ -0,0 +1,94 @@ +import type { AppRouteModule } from '/@/router/types'; + +import { LAYOUT } from '/@/router/constant'; +import { t } from '/@/hooks/web/useI18n'; + +const system: AppRouteModule = { + path: '/system', + name: 'System', + component: LAYOUT, + meta: { + orderNo: 2000, + icon: 'ant-design:setting-outline', + title: t('routes.menu.system.moduleName'), + }, + children: [ + { + path: 'account', + name: 'AccountPage', + component: () => import('/@/views/app/system/account/index.vue'), + meta: { + title: t('routes.menu.system.account'), + hideMenu: true, + }, + }, + + { + path: 'users', + name: 'UserManagement', + meta: { + icon: 'ion:person-outline', + title: t('routes.menu.system.user'), + ignoreKeepAlive: false, + }, + component: () => import('/@/views/app/system/users/index.vue'), + }, + { + path: 'users/detail/:id', + name: 'UserDetail', + meta: { + hideMenu: true, + title: t('routes.menu.system.user-detail'), + ignoreKeepAlive: true, + currentActiveMenu: '/system/user', + }, + component: () => import('/@/views/app/system/users/detail/index.vue'), + }, + + { + path: 'menu', + name: 'MenuManagement', + meta: { + icon: 'ion:menu-outline', + title: t('routes.menu.system.menu'), + ignoreKeepAlive: true, + }, + component: () => import('/@/views/app/system/menu/index.vue'), + }, + { + path: 'org', + name: 'OrganizationManagement', + meta: { + icon: 'ant-design:apartment-outlined', + title: t('routes.menu.system.org'), + ignoreKeepAlive: true, + }, + component: () => import('/@/views/app/system/org/index.vue'), + }, + + { + path: 'role', + name: 'RoleManagement', + meta: { + icon: 'ant-design:team-outlined', + title: t('routes.menu.system.role'), + ignoreKeepAlive: true, + hideMenu: false, + }, + component: () => import('/@/views/app/system/role/index.vue'), + }, + { + path: 'position', + name: 'PositionManagement', + meta: { + icon: 'ion:person-circle-outline', + title: t('routes.menu.system.position'), + ignoreKeepAlive: true, + hideMenu: false, + }, + component: () => import('/@/views/app/system/position/index.vue'), + }, + ], +}; + +export default system; diff --git a/monolithic/frontend/src/router/routes/modules/dashboard.ts b/monolithic/frontend/src/router/routes/modules/dashboard.ts new file mode 100644 index 0000000..bd39959 --- /dev/null +++ b/monolithic/frontend/src/router/routes/modules/dashboard.ts @@ -0,0 +1,38 @@ +import type { AppRouteModule } from '/@/router/types'; + +import { LAYOUT } from '/@/router/constant'; +import { t } from '/@/hooks/web/useI18n'; + +const dashboard: AppRouteModule = { + path: '/dashboard', + name: 'Dashboard', + component: LAYOUT, + redirect: '/dashboard/analysis', + meta: { + orderNo: 1, + icon: 'ant-design:dashboard-outlined', + title: t('routes.dashboard.dashboard'), + }, + children: [ + { + path: 'analysis', + name: 'Analysis', + component: () => import('/@/views/dashboard/analysis/index.vue'), + meta: { + icon: 'ant-design:line-chart-outlined', + title: t('routes.dashboard.analysis'), + }, + }, + { + path: 'workbench', + name: 'Workbench', + component: () => import('/@/views/dashboard/workbench/index.vue'), + meta: { + icon: 'ant-design:home-outlined', + title: t('routes.dashboard.workbench'), + }, + }, + ], +}; + +export default dashboard; diff --git a/monolithic/frontend/src/router/types.ts b/monolithic/frontend/src/router/types.ts new file mode 100644 index 0000000..082d208 --- /dev/null +++ b/monolithic/frontend/src/router/types.ts @@ -0,0 +1,58 @@ +import type { RouteRecordRaw, RouteMeta } from 'vue-router'; +import { RoleEnum } from '/@/enums/roleEnum'; +import { defineComponent } from 'vue'; + +export type Component = + | ReturnType + | (() => Promise) + | (() => Promise); + +// @ts-ignore +export interface AppRouteRecordRaw extends Omit { + name: string; + meta: RouteMeta; + component?: Component | string; + components?: Component; + children?: AppRouteRecordRaw[]; + props?: Recordable; + fullPath?: string; +} + +export interface MenuTag { + type?: 'primary' | 'error' | 'warn' | 'success'; + content?: string; + dot?: boolean; +} + +export interface Menu { + name: string; + + icon?: string; + + path: string; + + // path contains param, auto assignment. + paramPath?: string; + + disabled?: boolean; + + children?: Menu[]; + + orderNo?: number; + + roles?: RoleEnum[]; + + meta?: Partial; + + tag?: MenuTag; + + hideMenu?: boolean; +} + +export interface MenuModule { + orderNo?: number; + menu: Menu; +} + +// export type AppRouteModule = RouteModule | AppRouteRecordRaw; +export type AppRouteModule = AppRouteRecordRaw; diff --git a/monolithic/frontend/src/settings/componentSetting.ts b/monolithic/frontend/src/settings/componentSetting.ts new file mode 100644 index 0000000..790544c --- /dev/null +++ b/monolithic/frontend/src/settings/componentSetting.ts @@ -0,0 +1,51 @@ +// Used to configure the general configuration of some components without modifying the components + +import type { SorterResult } from '../components/Table'; + +export default { + // basic-table setting + table: { + // Form interfaces request general configuration + // support xxx.xxx.xxx + fetchSetting: { + // The field name of the current page passed to the background + pageField: 'page', + // The number field name of each page displayed in the background + sizeField: 'pageSize', + // Field name of the form data returned by the interfaces + listField: 'items', + // Total number of tables returned by the interfaces field name + totalField: 'total', + }, + // Number of pages that can be selected + pageSizeOptions: ['10', '50', '80', '100'], + // Default display quantity on one page + defaultPageSize: 10, + // Default Size + defaultSize: 'middle', + // Custom general sort function + defaultSortFn: (sortInfo: SorterResult) => { + const { field, order } = sortInfo; + if (field && order) { + return { + // The sort field passed to the backend you + field, + // Sorting method passed to the background asc/desc + order, + }; + } else { + return {}; + } + }, + // Custom general filter function + defaultFilterFn: (data: Partial>) => { + return data; + }, + }, + // scrollbar setting + scrollbar: { + // Whether to use native scroll bar + // After opening, the menu, modal, drawer will change the pop-up scroll bar to native + native: false, + }, +}; diff --git a/monolithic/frontend/src/settings/designSetting.ts b/monolithic/frontend/src/settings/designSetting.ts new file mode 100644 index 0000000..a81b576 --- /dev/null +++ b/monolithic/frontend/src/settings/designSetting.ts @@ -0,0 +1,48 @@ +import { ThemeEnum } from '../enums/appEnum'; + +export const prefixCls = 'vben'; + +export const darkMode = ThemeEnum.LIGHT; + +// app theme preset color +export const APP_PRESET_COLOR_LIST: string[] = [ + '#0960bd', + '#0084f4', + '#009688', + '#536dfe', + '#ff5c93', + '#ee4f12', + '#0096c7', + '#9c27b0', + '#ff9800', +]; + +// header preset color +export const HEADER_PRESET_BG_COLOR_LIST: string[] = [ + '#ffffff', + '#151515', + '#009688', + '#5172DC', + '#018ffb', + '#409eff', + '#e74c3c', + '#24292e', + '#394664', + '#001529', + '#383f45', +]; + +// sider preset color +export const SIDE_BAR_BG_COLOR_LIST: string[] = [ + '#001529', + '#212121', + '#273352', + '#ffffff', + '#191b24', + '#191a23', + '#304156', + '#001628', + '#28333E', + '#344058', + '#383f45', +]; diff --git a/monolithic/frontend/src/settings/encryptionSetting.ts b/monolithic/frontend/src/settings/encryptionSetting.ts new file mode 100644 index 0000000..3d61776 --- /dev/null +++ b/monolithic/frontend/src/settings/encryptionSetting.ts @@ -0,0 +1,13 @@ +import { isDevMode } from '/@/utils/env'; + +// System default cache time, in seconds +export const DEFAULT_CACHE_TIME = 60 * 60 * 24 * 7; + +// aes encryption key +export const cacheCipher = { + key: '_11111000001111@', + iv: '@11111000001111_', +}; + +// Whether the system cache is encrypted using aes +export const enableStorageEncryption = !isDevMode(); diff --git a/monolithic/frontend/src/settings/localeSetting.ts b/monolithic/frontend/src/settings/localeSetting.ts new file mode 100644 index 0000000..5452568 --- /dev/null +++ b/monolithic/frontend/src/settings/localeSetting.ts @@ -0,0 +1,29 @@ +import type { DropMenu } from '../components/Dropdown'; +import type { LocaleSetting, LocaleType } from '/#/config'; + +export const LOCALE: { [key: string]: LocaleType } = { + ZH_CN: 'zh_CN', + EN_US: 'en', +}; + +export const localeSetting: LocaleSetting = { + showPicker: true, + // Locale + locale: LOCALE.ZH_CN, + // Default locale + fallback: LOCALE.ZH_CN, + // available Locales + availableLocales: [LOCALE.ZH_CN, LOCALE.EN_US], +}; + +// locale list +export const localeList: DropMenu[] = [ + { + text: '简体中文', + event: LOCALE.ZH_CN, + }, + { + text: 'English', + event: LOCALE.EN_US, + }, +]; diff --git a/monolithic/frontend/src/settings/projectSetting.ts b/monolithic/frontend/src/settings/projectSetting.ts new file mode 100644 index 0000000..33d1cf1 --- /dev/null +++ b/monolithic/frontend/src/settings/projectSetting.ts @@ -0,0 +1,182 @@ +import type { ProjectConfig } from '/#/config'; +import { MenuTypeEnum, MenuModeEnum, TriggerEnum, MixSidebarTriggerEnum } from '/@/enums/menuEnum'; +import { CacheTypeEnum } from '/@/enums/cacheEnum'; +import { + ContentEnum, + PermissionModeEnum, + ThemeEnum, + RouterTransitionEnum, + SettingButtonPositionEnum, + SessionTimeoutProcessingEnum, +} from '/@/enums/appEnum'; +import { SIDE_BAR_BG_COLOR_LIST, HEADER_PRESET_BG_COLOR_LIST } from './designSetting'; +import { primaryColor } from '../../build/config/themeConfig'; + +// ! You need to clear the browser cache after the change +const setting: ProjectConfig = { + // Whether to show the configuration button + showSettingButton: true, + + // Whether to show the theme switch button + showDarkModeToggle: true, + + // `Settings` button position + settingButtonPosition: SettingButtonPositionEnum.AUTO, + + // Permission mode + permissionMode: PermissionModeEnum.ROUTE_MAPPING, + + // Permission-related cache is stored in sessionStorage or localStorage + permissionCacheType: CacheTypeEnum.LOCAL, + + // Session timeout processing + sessionTimeoutProcessing: SessionTimeoutProcessingEnum.ROUTE_JUMP, + + // color + themeColor: primaryColor, + + // Website gray mode, open for possible mourning dates + grayMode: false, + + // Color Weakness Mode + colorWeak: false, + + // Whether to cancel the menu, the top, the multi-tab page display, for possible embedded in other systems + fullContent: false, + + // content mode + contentMode: ContentEnum.FULL, + + // Whether to display the logo + showLogo: true, + + // Whether to show footer + showFooter: false, + + // Header configuration + headerSetting: { + // header bg color + bgColor: HEADER_PRESET_BG_COLOR_LIST[0], + // Fixed at the top + fixed: true, + // Whether to show top + show: true, + // theme + theme: ThemeEnum.LIGHT, + // Whether to enable the lock screen function + useLockPage: true, + // Whether to show the full screen button + showFullScreen: true, + // Whether to show the document button + showDoc: true, + // Whether to show the notification button + showNotice: true, + // Whether to display the menu search + showSearch: true, + }, + + // Menu configuration + menuSetting: { + // sidebar menu bg color + bgColor: SIDE_BAR_BG_COLOR_LIST[0], + // Whether to fix the left menu + fixed: true, + // Menu collapse + collapsed: false, + // When sider hide because of the responsive layout + siderHidden: false, + // Whether to display the menu name when folding the menu + collapsedShowTitle: false, + // Whether it can be dragged + // Only limited to the opening of the left menu, the mouse has a drag bar on the right side of the menu + canDrag: false, + // Whether to show no dom + show: true, + // Whether to show dom + hidden: false, + // Menu width + menuWidth: 210, + // Menu mode + mode: MenuModeEnum.INLINE, + // Menu type + type: MenuTypeEnum.SIDEBAR, + // Menu theme + theme: ThemeEnum.DARK, + // Split menu + split: false, + // Top menu layout + topMenuAlign: 'center', + // Fold trigger position + trigger: TriggerEnum.HEADER, + // Turn on accordion mode, only show a menu + accordion: true, + // Switch page to close menu + closeMixSidebarOnChange: false, + // Module opening method ‘click’ |'hover' + mixSideTrigger: MixSidebarTriggerEnum.CLICK, + // Fixed expanded menu + mixSideFixed: false, + }, + + // Multi-label + multiTabsSetting: { + cache: false, + // Turn on + show: true, + // Is it possible to drag and drop sorting tabs + canDrag: true, + // Turn on quick actions + showQuick: true, + // Whether to show the refresh button + showRedo: true, + // Whether to show the collapse button + showFold: true, + }, + + // Transition Setting + transitionSetting: { + // Whether to open the page switching animation + // The disabled state will also disable pageLoading + enable: true, + + // Route basic switching animation + basicTransition: RouterTransitionEnum.FADE_SIDE, + + // Whether to open page switching loading + // Only open when enable=true + openPageLoading: true, + + // Whether to open the top progress bar + openNProgress: false, + }, + + // Whether to enable KeepAlive cache is best to close during development, otherwise the cache needs to be cleared every time + openKeepAlive: true, + + // Automatic screen lock time, 0 does not lock the screen. Unit minute default 0 + lockTime: 0, + + // Whether to show breadcrumbs + showBreadCrumb: true, + + // Whether to show the breadcrumb icon + showBreadCrumbIcon: false, + + // Use error-handler-plugin + useErrorHandle: false, + + // Whether to open back to top + useOpenBackTop: true, + + // Is it possible to embed iframe pages + canEmbedIFramePage: true, + + // Whether to delete unclosed messages and notify when switching the interfaces + closeMessageOnSwitch: true, + + // Whether to cancel the http request that has been sent but not responded when switching the interfaces. + // If it is enabled, I want to overwrite a single interfaces. Can be set in a separate interfaces + removeAllHttpPending: false, +}; + +export default setting; diff --git a/monolithic/frontend/src/settings/siteSetting.ts b/monolithic/frontend/src/settings/siteSetting.ts new file mode 100644 index 0000000..ced23e7 --- /dev/null +++ b/monolithic/frontend/src/settings/siteSetting.ts @@ -0,0 +1,3 @@ +export const GITHUB_URL = ''; +export const DOC_URL = ''; +export const SITE_URL = ''; diff --git a/monolithic/frontend/src/store/index.ts b/monolithic/frontend/src/store/index.ts new file mode 100644 index 0000000..efaf6c9 --- /dev/null +++ b/monolithic/frontend/src/store/index.ts @@ -0,0 +1,10 @@ +import type { App } from 'vue'; +import { createPinia } from 'pinia'; + +const store = createPinia(); + +export function setupStore(app: App) { + app.use(store); +} + +export { store }; diff --git a/monolithic/frontend/src/store/modules/app.ts b/monolithic/frontend/src/store/modules/app.ts new file mode 100644 index 0000000..72f9bf6 --- /dev/null +++ b/monolithic/frontend/src/store/modules/app.ts @@ -0,0 +1,108 @@ +import type { + ProjectConfig, + HeaderSetting, + MenuSetting, + TransitionSetting, + MultiTabsSetting, +} from '/#/config'; +import type { BeforeMiniState } from '/#/store'; + +import { defineStore } from 'pinia'; +import { store } from '/@/store'; + +import { ThemeEnum } from '/@/enums/appEnum'; +import { APP_DARK_MODE_KEY_, PROJ_CFG_KEY } from '/@/enums/cacheEnum'; +import { Persistent } from '/@/utils/cache/persistent'; +import { darkMode } from '/@/settings/designSetting'; +import { resetRouter } from '/@/router'; +import { deepMerge } from '/@/utils'; + +interface AppState { + darkMode?: ThemeEnum; + // Page loading status + pageLoading: boolean; + // project config + projectConfig: ProjectConfig | null; + // When the window shrinks, remember some states, and restore these states when the window is restored + beforeMiniInfo: BeforeMiniState; +} +let timeId: TimeoutHandle; +export const useAppStore = defineStore({ + id: 'app', + state: (): AppState => ({ + darkMode: undefined, + pageLoading: false, + projectConfig: Persistent.getLocal(PROJ_CFG_KEY), + beforeMiniInfo: {}, + }), + getters: { + getPageLoading(): boolean { + return this.pageLoading; + }, + getDarkMode(): 'light' | 'dark' | string { + return this.darkMode || localStorage.getItem(APP_DARK_MODE_KEY_) || darkMode; + }, + + getBeforeMiniInfo(): BeforeMiniState { + return this.beforeMiniInfo; + }, + + getProjectConfig(): ProjectConfig { + return this.projectConfig || ({} as ProjectConfig); + }, + + getHeaderSetting(): HeaderSetting { + return this.getProjectConfig.headerSetting; + }, + getMenuSetting(): MenuSetting { + return this.getProjectConfig.menuSetting; + }, + getTransitionSetting(): TransitionSetting { + return this.getProjectConfig.transitionSetting; + }, + getMultiTabsSetting(): MultiTabsSetting { + return this.getProjectConfig.multiTabsSetting; + }, + }, + actions: { + setPageLoading(loading: boolean): void { + this.pageLoading = loading; + }, + + setDarkMode(mode: ThemeEnum): void { + this.darkMode = mode; + localStorage.setItem(APP_DARK_MODE_KEY_, mode); + }, + + setBeforeMiniInfo(state: BeforeMiniState): void { + this.beforeMiniInfo = state; + }, + + setProjectConfig(config: DeepPartial): void { + this.projectConfig = deepMerge(this.projectConfig || {}, config); + Persistent.setLocal(PROJ_CFG_KEY, this.projectConfig); + }, + + async resetAllState() { + resetRouter(); + Persistent.clearAll(); + }, + async setPageLoadingAction(loading: boolean): Promise { + if (loading) { + clearTimeout(timeId); + // Prevent flicker + timeId = setTimeout(() => { + this.setPageLoading(loading); + }, 50); + } else { + this.setPageLoading(loading); + clearTimeout(timeId); + } + }, + }, +}); + +// Need to be used outside the setup +export function useAppStoreWithOut() { + return useAppStore(store); +} diff --git a/monolithic/frontend/src/store/modules/errorLog.ts b/monolithic/frontend/src/store/modules/errorLog.ts new file mode 100644 index 0000000..2df6c67 --- /dev/null +++ b/monolithic/frontend/src/store/modules/errorLog.ts @@ -0,0 +1,78 @@ +import type { ErrorLogInfo } from '/#/store'; + +import { defineStore } from 'pinia'; +import { store } from '/@/store'; + +import { formatToDateTime } from '/@/utils/dateUtil'; +import projectSetting from '/@/settings/projectSetting'; + +import { ErrorTypeEnum } from '/@/enums/exceptionEnum'; +import dayjs from 'dayjs'; + +export interface ErrorLogState { + errorLogInfoList: Nullable; + errorLogListCount: number; +} + +export const useErrorLogStore = defineStore({ + id: 'app-error-log', + state: (): ErrorLogState => ({ + errorLogInfoList: null, + errorLogListCount: 0, + }), + getters: { + getErrorLogInfoList(): ErrorLogInfo[] { + return this.errorLogInfoList || []; + }, + getErrorLogListCount(): number { + return this.errorLogListCount; + }, + }, + actions: { + addErrorLogInfo(info: ErrorLogInfo) { + const item = { + ...info, + time: formatToDateTime(new dayjs.Dayjs()), + }; + this.errorLogInfoList = [item, ...(this.errorLogInfoList || [])]; + this.errorLogListCount += 1; + }, + + setErrorLogListCount(count: number): void { + this.errorLogListCount = count; + }, + + /** + * Triggered after ajax request error + * @param error + * @returns + */ + addAjaxErrorInfo(error) { + const { useErrorHandle } = projectSetting; + if (!useErrorHandle) { + return; + } + const errInfo: Partial = { + message: error.message, + type: ErrorTypeEnum.AJAX, + }; + if (error.response) { + const { + config: { url = '', data: params = '', method = 'get', headers = {} } = {}, + data = {}, + } = error.response; + errInfo.url = url; + errInfo.name = 'Ajax Error!'; + errInfo.file = '-'; + errInfo.stack = JSON.stringify(data); + errInfo.detail = JSON.stringify({ params, method, headers }); + } + this.addErrorLogInfo(errInfo as ErrorLogInfo); + }, + }, +}); + +// Need to be used outside the setup +export function useErrorLogStoreWithOut() { + return useErrorLogStore(store); +} diff --git a/monolithic/frontend/src/store/modules/locale.ts b/monolithic/frontend/src/store/modules/locale.ts new file mode 100644 index 0000000..8d72ffc --- /dev/null +++ b/monolithic/frontend/src/store/modules/locale.ts @@ -0,0 +1,55 @@ +import type { LocaleSetting, LocaleType } from '/#/config'; + +import { defineStore } from 'pinia'; +import { store } from '/@/store'; + +import { LOCALE_KEY } from '/@/enums/cacheEnum'; +import { createLocalStorage } from '/@/utils/cache'; +import { localeSetting } from '/@/settings/localeSetting'; + +const ls = createLocalStorage(); + +const lsLocaleSetting = (ls.get(LOCALE_KEY) || localeSetting) as LocaleSetting; + +interface LocaleState { + localInfo: LocaleSetting; +} + +export const useLocaleStore = defineStore({ + id: 'app-locale', + state: (): LocaleState => ({ + localInfo: lsLocaleSetting, + }), + getters: { + getShowPicker(): boolean { + return !!this.localInfo?.showPicker; + }, + getLocale(): LocaleType { + return this.localInfo?.locale ?? 'zh_CN'; + }, + }, + actions: { + /** + * Set up multilingual information and cache + * @param info multilingual info + */ + setLocaleInfo(info: Partial) { + this.localInfo = { ...this.localInfo, ...info }; + ls.set(LOCALE_KEY, this.localInfo); + }, + /** + * Initialize multilingual information and load the existing configuration from the local cache + */ + initLocale() { + this.setLocaleInfo({ + ...localeSetting, + ...this.localInfo, + }); + }, + }, +}); + +// Need to be used outside the setup +export function useLocaleStoreWithOut() { + return useLocaleStore(store); +} diff --git a/monolithic/frontend/src/store/modules/lock.ts b/monolithic/frontend/src/store/modules/lock.ts new file mode 100644 index 0000000..78465a3 --- /dev/null +++ b/monolithic/frontend/src/store/modules/lock.ts @@ -0,0 +1,62 @@ +import type {LockInfo} from '/#/store'; + +import {defineStore} from 'pinia'; + +import {LOCK_INFO_KEY} from '/@/enums/cacheEnum'; +import {Persistent} from '/@/utils/cache/persistent'; +import {useUserStore} from './user'; + +interface LockState { + lockInfo: Nullable; +} + +export const useLockStore = defineStore({ + id: 'app-lock', + state: (): LockState => ({ + lockInfo: Persistent.getLocal(LOCK_INFO_KEY), + }), + getters: { + getLockInfo(): Nullable { + return this.lockInfo; + }, + }, + actions: { + setLockInfo(info: LockInfo) { + this.lockInfo = Object.assign({}, this.lockInfo, info); + Persistent.setLocal(LOCK_INFO_KEY, this.lockInfo, true); + }, + resetLockInfo() { + Persistent.removeLocal(LOCK_INFO_KEY, true); + this.lockInfo = null; + }, + // Unlock + async unLock(password?: string) { + const userStore = useUserStore(); + if (this.lockInfo?.pwd === password) { + this.resetLockInfo(); + return true; + } + const tryLogin = async () => { + try { + const userName = userStore.getUserInfo?.userName; + const res = await userStore.login( + { + username: userName!, + password: password!, + grand_type: 'password', + }, + false, + 'none', + ); + if (res) { + this.resetLockInfo(); + } + return res; + } catch (e: any) { + return false; + } + }; + return await tryLogin(); + }, + }, +}); diff --git a/monolithic/frontend/src/store/modules/multipleTab.ts b/monolithic/frontend/src/store/modules/multipleTab.ts new file mode 100644 index 0000000..00bad4d --- /dev/null +++ b/monolithic/frontend/src/store/modules/multipleTab.ts @@ -0,0 +1,359 @@ +import type { RouteLocationNormalized, RouteLocationRaw, Router } from 'vue-router'; + +import { toRaw, unref } from 'vue'; +import { defineStore } from 'pinia'; +import { store } from '/@/store'; + +import { useGo, useRedo } from '/@/hooks/web/usePage'; +import { Persistent } from '/@/utils/cache/persistent'; + +import { PageEnum } from '/@/enums/pageEnum'; +import { PAGE_NOT_FOUND_ROUTE, REDIRECT_ROUTE } from '/@/router/routes/basic'; +import { getRawRoute } from '/@/utils'; +import { MULTIPLE_TABS_KEY } from '/@/enums/cacheEnum'; + +import projectSetting from '/@/settings/projectSetting'; +import { useUserStore } from '/@/store/modules/user'; + +export interface MultipleTabState { + cacheTabList: Set; + tabList: RouteLocationNormalized[]; + lastDragEndIndex: number; +} + +function handleGotoPage(router: Router) { + const go = useGo(router); + go(unref(router.currentRoute).path, true); +} + +const getToTarget = (tabItem: RouteLocationNormalized) => { + const { params, path, query } = tabItem; + return { + params: params || {}, + path, + query: query || {}, + }; +}; + +const cacheTab = projectSetting.multiTabsSetting.cache; + +export const useMultipleTabStore = defineStore({ + id: 'app-multiple-tab', + state: (): MultipleTabState => ({ + // Tabs that need to be cached + cacheTabList: new Set(), + // multiple tab list + tabList: cacheTab ? Persistent.getLocal(MULTIPLE_TABS_KEY) || [] : [], + // Index of the last moved tab + lastDragEndIndex: 0, + }), + getters: { + getTabList(): RouteLocationNormalized[] { + return this.tabList; + }, + getCachedTabList(): string[] { + return Array.from(this.cacheTabList); + }, + getLastDragEndIndex(): number { + return this.lastDragEndIndex; + }, + }, + actions: { + /** + * Update the cache according to the currently opened tabs + */ + async updateCacheTab() { + const cacheMap: Set = new Set(); + + for (const tab of this.tabList) { + const item = getRawRoute(tab); + // Ignore the cache + const needCache = !item.meta?.ignoreKeepAlive; + if (!needCache) { + continue; + } + const name = item.name as string; + cacheMap.add(name); + } + this.cacheTabList = cacheMap; + }, + + /** + * Refresh tabs + */ + async refreshPage(router: Router) { + const { currentRoute } = router; + const route = unref(currentRoute); + const name = route.name; + + const findTab = this.getCachedTabList.find((item) => item === name); + if (findTab) { + this.cacheTabList.delete(findTab); + } + const redo = useRedo(router); + await redo(); + }, + clearCacheTabs(): void { + this.cacheTabList = new Set(); + }, + resetState(): void { + this.tabList = []; + this.clearCacheTabs(); + }, + goToPage(router: Router) { + const go = useGo(router); + const len = this.tabList.length; + const { path } = unref(router.currentRoute); + + let toPath: PageEnum | string = PageEnum.BASE_HOME; + + if (len > 0) { + const page = this.tabList[len - 1]; + const p = page.fullPath || page.path; + if (p) { + toPath = p; + } + } + // Jump to the current page and report an error + path !== toPath && go(toPath as PageEnum, true); + }, + + async addTab(route: RouteLocationNormalized) { + const { path, name, fullPath, params, query, meta } = getRawRoute(route); + // 404 The page does not need to add a tab + if ( + path === PageEnum.ERROR_PAGE || + path === PageEnum.BASE_LOGIN || + !name || + [REDIRECT_ROUTE.name, PAGE_NOT_FOUND_ROUTE.name].includes(name as string) + ) { + return; + } + + let updateIndex = -1; + // Existing pages, do not add tabs repeatedly + const tabHasExits = this.tabList.some((tab, index) => { + updateIndex = index; + return (tab.fullPath || tab.path) === (fullPath || path); + }); + + // If the tab already exists, perform the update operation + if (tabHasExits) { + const curTab = toRaw(this.tabList)[updateIndex]; + if (!curTab) { + return; + } + curTab.params = params || curTab.params; + curTab.query = query || curTab.query; + curTab.fullPath = fullPath || curTab.fullPath; + this.tabList.splice(updateIndex, 1, curTab); + } else { + // Add tab + // 获取动态路由打开数,超过 0 即代表需要控制打开数 + const dynamicLevel = meta?.dynamicLevel ?? -1; + if (dynamicLevel > 0) { + // 如果动态路由层级大于 0 了,那么就要限制该路由的打开数限制了 + // 首先获取到真实的路由,使用配置方式减少计算开销. + // const nickName: string = path.match(/(\S*)\//)![1]; + const realPath = meta?.realPath ?? ''; + // 获取到已经打开的动态路由数, 判断是否大于某一个值 + if ( + this.tabList.filter((e) => e.meta?.realPath ?? '' === realPath).length >= dynamicLevel + ) { + // 关闭第一个 + const index = this.tabList.findIndex((item) => item.meta.realPath === realPath); + index !== -1 && this.tabList.splice(index, 1); + } + } + this.tabList.push(route); + } + this.updateCacheTab(); + cacheTab && Persistent.setLocal(MULTIPLE_TABS_KEY, this.tabList); + }, + + async closeTab(tab: RouteLocationNormalized, router: Router) { + const close = (route: RouteLocationNormalized) => { + const { fullPath, meta: { affix } = {} } = route; + if (affix) { + return; + } + const index = this.tabList.findIndex((item) => item.fullPath === fullPath); + index !== -1 && this.tabList.splice(index, 1); + }; + + const { currentRoute, replace } = router; + + const { path } = unref(currentRoute); + if (path !== tab.path) { + // Closed is not the activation tab + close(tab); + return; + } + + // Closed is activated atb + let toTarget: RouteLocationRaw = {}; + + const index = this.tabList.findIndex((item) => item.path === path); + + // If the current is the leftmost tab + if (index === 0) { + // There is only one tab, then jump to the homepage, otherwise jump to the right tab + if (this.tabList.length === 1) { + const userStore = useUserStore(); + toTarget = userStore.getUserInfo.homePath || PageEnum.BASE_HOME; + } else { + // Jump to the right tab + const page = this.tabList[index + 1]; + toTarget = getToTarget(page); + } + } else { + // Close the current tab + const page = this.tabList[index - 1]; + toTarget = getToTarget(page); + } + close(currentRoute.value); + await replace(toTarget); + }, + + // Close according to key + async closeTabByKey(key: string, router: Router) { + const index = this.tabList.findIndex((item) => (item.fullPath || item.path) === key); + if (index !== -1) { + await this.closeTab(this.tabList[index], router); + const { currentRoute, replace } = router; + // 检查当前路由是否存在于tabList中 + const isActivated = this.tabList.findIndex((item) => { + return item.fullPath === currentRoute.value.fullPath; + }); + // 如果当前路由不存在于TabList中,尝试切换到其它路由 + if (isActivated === -1) { + let pageIndex; + if (index > 0) { + pageIndex = index - 1; + } else if (index < this.tabList.length - 1) { + pageIndex = index + 1; + } else { + pageIndex = -1; + } + if (pageIndex >= 0) { + const page = this.tabList[index - 1]; + const toTarget = getToTarget(page); + await replace(toTarget); + } + } + } + }, + + // Sort the tabs + async sortTabs(oldIndex: number, newIndex: number) { + const currentTab = this.tabList[oldIndex]; + this.tabList.splice(oldIndex, 1); + this.tabList.splice(newIndex, 0, currentTab); + this.lastDragEndIndex = this.lastDragEndIndex + 1; + }, + + // Close the tab on the right and jump + async closeLeftTabs(route: RouteLocationNormalized, router: Router) { + const index = this.tabList.findIndex((item) => item.path === route.path); + + if (index > 0) { + const leftTabs = this.tabList.slice(0, index); + const pathList: string[] = []; + for (const item of leftTabs) { + const affix = item?.meta?.affix ?? false; + if (!affix) { + pathList.push(item.fullPath); + } + } + this.bulkCloseTabs(pathList); + } + this.updateCacheTab(); + handleGotoPage(router); + }, + + // Close the tab on the left and jump + async closeRightTabs(route: RouteLocationNormalized, router: Router) { + const index = this.tabList.findIndex((item) => item.fullPath === route.fullPath); + + if (index >= 0 && index < this.tabList.length - 1) { + const rightTabs = this.tabList.slice(index + 1, this.tabList.length); + + const pathList: string[] = []; + for (const item of rightTabs) { + const affix = item?.meta?.affix ?? false; + if (!affix) { + pathList.push(item.fullPath); + } + } + this.bulkCloseTabs(pathList); + } + this.updateCacheTab(); + handleGotoPage(router); + }, + + async closeAllTab(router: Router) { + this.tabList = this.tabList.filter((item) => item?.meta?.affix ?? false); + this.clearCacheTabs(); + this.goToPage(router); + }, + + /** + * Close other tabs + */ + async closeOtherTabs(route: RouteLocationNormalized, router: Router) { + const closePathList = this.tabList.map((item) => item.fullPath); + + const pathList: string[] = []; + + for (const path of closePathList) { + if (path !== route.fullPath) { + const closeItem = this.tabList.find((item) => item.path === path); + if (!closeItem) { + continue; + } + const affix = closeItem?.meta?.affix ?? false; + if (!affix) { + pathList.push(closeItem.fullPath); + } + } + } + this.bulkCloseTabs(pathList); + this.updateCacheTab(); + handleGotoPage(router); + }, + + /** + * Close tabs in bulk + */ + async bulkCloseTabs(pathList: string[]) { + this.tabList = this.tabList.filter((item) => !pathList.includes(item.fullPath)); + }, + + /** + * Set tab's title + */ + async setTabTitle(title: string, route: RouteLocationNormalized) { + const findTab = this.getTabList.find((item) => item === route); + if (findTab) { + findTab.meta.title = title; + await this.updateCacheTab(); + } + }, + /** + * replace tab's path + * **/ + async updateTabPath(fullPath: string, route: RouteLocationNormalized) { + const findTab = this.getTabList.find((item) => item === route); + if (findTab) { + findTab.fullPath = fullPath; + findTab.path = fullPath; + await this.updateCacheTab(); + } + }, + }, +}); + +// Need to be used outside the setup +export function useMultipleTabWithOutStore() { + return useMultipleTabStore(store); +} diff --git a/monolithic/frontend/src/store/modules/permission.ts b/monolithic/frontend/src/store/modules/permission.ts new file mode 100644 index 0000000..5447dcf --- /dev/null +++ b/monolithic/frontend/src/store/modules/permission.ts @@ -0,0 +1,260 @@ +import type { AppRouteRecordRaw, Menu } from '/@/router/types'; + +import { defineStore } from 'pinia'; +import { store } from '/@/store'; +import { useI18n } from '/@/hooks/web/useI18n'; +import { useUserStore } from './user'; +import { useAppStoreWithOut } from './app'; +import { toRaw } from 'vue'; +import { transformObjToRoute, flatMultiLevelRoutes } from '/@/router/helper/routeHelper'; +import { transformRouteToMenu } from '/@/router/helper/menuHelper'; + +import projectSetting from '/@/settings/projectSetting'; + +import { PermissionModeEnum } from '/@/enums/appEnum'; + +import { asyncRoutes } from '/@/router/routes'; +import { ERROR_LOG_ROUTE, PAGE_NOT_FOUND_ROUTE } from '/@/router/routes/basic'; + +import { filter } from '/@/utils/helper/treeHelper'; + +// import { getMenuList } from '/@/api/sys/routes'; +// import { getPermCode } from '/@/api/sys/user'; + +import { useMessage } from '/@/hooks/web/useMessage'; +import { PageEnum } from '/@/enums/pageEnum'; + +interface PermissionState { + // Permission code list + // 权限代码列表 + permCodeList: string[] | number[]; + // Whether the route has been dynamically added + // 路由是否动态添加 + isDynamicAddedRoute: boolean; + // To trigger a menu update + // 触发菜单更新 + lastBuildMenuTime: number; + // Backstage menu list + // 后台菜单列表 + backMenuList: Menu[]; + // 菜单列表 + frontMenuList: Menu[]; +} + +export const usePermissionStore = defineStore({ + id: 'app-permission', + state: (): PermissionState => ({ + // 权限代码列表 + permCodeList: [], + // Whether the route has been dynamically added + // 路由是否动态添加 + isDynamicAddedRoute: false, + // To trigger a menu update + // 触发菜单更新 + lastBuildMenuTime: 0, + // Backstage menu list + // 后台菜单列表 + backMenuList: [], + // menu List + // 菜单列表 + frontMenuList: [], + }), + getters: { + getPermCodeList(): string[] | number[] { + return this.permCodeList; + }, + getBackMenuList(): Menu[] { + return this.backMenuList; + }, + getFrontMenuList(): Menu[] { + return this.frontMenuList; + }, + getLastBuildMenuTime(): number { + return this.lastBuildMenuTime; + }, + getIsDynamicAddedRoute(): boolean { + return this.isDynamicAddedRoute; + }, + }, + actions: { + setPermCodeList(codeList: string[]) { + this.permCodeList = codeList; + }, + + setBackMenuList(list: Menu[]) { + this.backMenuList = list; + list?.length > 0 && this.setLastBuildMenuTime(); + }, + + setFrontMenuList(list: Menu[]) { + this.frontMenuList = list; + }, + + setLastBuildMenuTime() { + this.lastBuildMenuTime = new Date().getTime(); + }, + + setDynamicAddedRoute(added: boolean) { + this.isDynamicAddedRoute = added; + }, + resetState(): void { + this.isDynamicAddedRoute = false; + this.permCodeList = []; + this.backMenuList = []; + this.lastBuildMenuTime = 0; + }, + async changePermissionCode() { + // const codeList = await getPermCode(); + // this.setPermCodeList(codeList); + }, + + // 构建路由 + async buildRoutesAction(): Promise { + const { t } = useI18n(); + const userStore = useUserStore(); + const appStore = useAppStoreWithOut(); + + let routes: AppRouteRecordRaw[] = []; + const roleList = toRaw(userStore.getRoleList) || []; + const { permissionMode = projectSetting.permissionMode } = appStore.getProjectConfig; + + // 路由过滤器 在 函数filter 作为回调传入遍历使用 + const routeFilter = (route: AppRouteRecordRaw) => { + const { meta } = route; + // 抽出角色 + const { roles } = meta || {}; + if (!roles) return true; + // 进行角色权限判断 + return roleList.some((role) => roles.includes(role)); + }; + + const routeRemoveIgnoreFilter = (route: AppRouteRecordRaw) => { + const { meta } = route; + // ignoreRoute 为true 则路由仅用于菜单生成,不会在实际的路由表中出现 + const { ignoreRoute } = meta || {}; + // arr.filter 返回 true 表示该元素通过测试 + return !ignoreRoute; + }; + + /** + * @description 根据设置的首页path,修正routes中的affix标记(固定首页) + * */ + const patchHomeAffix = (routes: AppRouteRecordRaw[]) => { + if (!routes || routes.length === 0) return; + let homePath: string = userStore.getUserInfo.homePath || PageEnum.BASE_HOME; + + function patcher(routes: AppRouteRecordRaw[], parentPath = '') { + if (parentPath) parentPath = parentPath + '/'; + routes.forEach((route: AppRouteRecordRaw) => { + const { path, children, redirect } = route; + const currentPath = path.startsWith('/') ? path : parentPath + path; + if (currentPath === homePath) { + if (redirect) { + homePath = route.redirect! as string; + } else { + route.meta = Object.assign({}, route.meta, { affix: true }); + throw new Error('end'); + } + } + children && children.length > 0 && patcher(children, currentPath); + }); + } + + try { + patcher(routes); + } catch (e: any) { + // 已处理完毕跳出循环 + } + return; + }; + + switch (permissionMode) { + // 角色权限 + case PermissionModeEnum.ROLE: + // 对非一级路由进行过滤 + routes = filter(asyncRoutes, routeFilter); + // 对一级路由根据角色权限过滤 + routes = routes.filter(routeFilter); + // Convert multi-level routing to level 2 routing + // 将多级路由转换为 2 级路由 + routes = flatMultiLevelRoutes(routes); + break; + + // 路由映射, 默认进入该case + case PermissionModeEnum.ROUTE_MAPPING: + // 对非一级路由进行过滤 + routes = filter(asyncRoutes, routeFilter); + // 对一级路由再次根据角色权限过滤 + routes = routes.filter(routeFilter); + // 将路由转换成菜单 + const menuList = transformRouteToMenu(routes, true); + // 移除掉 ignoreRoute: true 的路由 非一级路由 + routes = filter(routes, routeRemoveIgnoreFilter); + // 移除掉 ignoreRoute: true 的路由 一级路由; + routes = routes.filter(routeRemoveIgnoreFilter); + // 对菜单进行排序 + menuList.sort((a, b) => { + return (a.meta?.orderNo || 0) - (b.meta?.orderNo || 0); + }); + + // 设置菜单列表 + this.setFrontMenuList(menuList); + + // Convert multi-level routing to level 2 routing + // 将多级路由转换为 2 级路由 + routes = flatMultiLevelRoutes(routes); + break; + + // If you are sure that you do not need to do background dynamic permissions, please comment the entire judgment below + // 如果确定不需要做后台动态权限,请在下方评论整个判断 + case PermissionModeEnum.BACK: + const { createMessage } = useMessage(); + + createMessage.loading({ + content: t('sys.app.menuLoading'), + duration: 1, + }); + + // !Simulate to obtain permission codes from the background, + // 模拟从后台获取权限码, + // this function may only need to be executed once, and the actual project can be put at the right time by itself + // 这个功能可能只需要执行一次,实际项目可以自己放在合适的时间 + let routeList: AppRouteRecordRaw[] = []; + try { + await this.changePermissionCode(); + //routeList = (await getMenuList()) as AppRouteRecordRaw[]; + } catch (e: any) { + console.error(e); + } + + // Dynamically introduce components + // 动态引入组件 + routeList = transformObjToRoute(routeList); + + // Background routing to menu structure + // 后台路由到菜单结构 + const backMenuList = transformRouteToMenu(routeList); + this.setBackMenuList(backMenuList); + + // remove meta.ignoreRoute item + // 删除 meta.ignoreRoute 项 + routeList = filter(routeList, routeRemoveIgnoreFilter); + routeList = routeList.filter(routeRemoveIgnoreFilter); + + routeList = flatMultiLevelRoutes(routeList); + routes = [PAGE_NOT_FOUND_ROUTE, ...routeList]; + break; + } + + routes.push(ERROR_LOG_ROUTE); + patchHomeAffix(routes); + return routes; + }, + }, +}); + +// Need to be used outside the setup +// 需要在设置之外使用 +export function usePermissionStoreWithOut() { + return usePermissionStore(store); +} diff --git a/monolithic/frontend/src/store/modules/user.ts b/monolithic/frontend/src/store/modules/user.ts new file mode 100644 index 0000000..1826a67 --- /dev/null +++ b/monolithic/frontend/src/store/modules/user.ts @@ -0,0 +1,169 @@ +import {h} from 'vue'; +import {defineStore} from 'pinia'; +import {RouteRecordRaw} from 'vue-router'; + +import type {ErrorMessageMode} from '/#/axios'; +import {store} from '/@/store'; +import {RoleEnum} from '/@/enums/roleEnum'; +import {PageEnum} from '/@/enums/pageEnum'; +import {ROLES_KEY, TOKEN_KEY, USER_INFO_KEY} from '/@/enums/cacheEnum'; +import {getAuthCache, setAuthCache} from '/@/utils/auth'; +import {useI18n} from '/@/hooks/web/useI18n'; +import {useMessage} from '/@/hooks/web/useMessage'; +import {router} from '/@/router'; +import {usePermissionStore} from '/@/store/modules/permission'; +import {PAGE_NOT_FOUND_ROUTE} from '/@/router/routes/basic'; +import {GetMe, Logon, Logout} from '/@/api/app/authentication'; +import {UserInfo} from "/#/store"; + +interface UserState { + userInfo: Nullable; + token?: string; + roleList: RoleEnum[]; + sessionTimeout?: boolean; + lastUpdateTime: number; +} + +export const useUserStore = defineStore({ + id: 'app-user', + state: (): UserState => ({ + // user info + userInfo: null, + // token + token: undefined, + // roleList + roleList: [], + // Whether the login expired + sessionTimeout: false, + // Last fetch time + lastUpdateTime: 0, + }), + getters: { + getUserInfo(): UserInfo { + return this.userInfo || getAuthCache(USER_INFO_KEY) || {}; + }, + getToken(): string { + return this.token || getAuthCache(TOKEN_KEY); + }, + getRoleList(): RoleEnum[] { + return this.roleList.length > 0 ? this.roleList : getAuthCache(ROLES_KEY); + }, + getSessionTimeout(): boolean { + return !!this.sessionTimeout; + }, + getLastUpdateTime(): number { + return this.lastUpdateTime; + }, + }, + actions: { + setToken(info: string | undefined) { + this.token = info ? info : ''; // for null or undefined value + setAuthCache(TOKEN_KEY, info); + }, + setRoleList(roleList: RoleEnum[]) { + this.roleList = roleList; + setAuthCache(ROLES_KEY, roleList); + }, + setUserInfo(info: UserInfo | null) { + this.userInfo = info; + this.lastUpdateTime = new Date().getTime(); + setAuthCache(USER_INFO_KEY, info); + }, + setSessionTimeout(flag: boolean) { + this.sessionTimeout = flag; + }, + resetState() { + this.userInfo = null; + this.token = ''; + this.roleList = []; + this.sessionTimeout = false; + }, + /** + * @description: login + */ + async login( + params: any, + goHome?: boolean, + mode?: ErrorMessageMode + ): Promise { + try { + const {...loginParams} = params; + goHome = goHome || true + mode = mode || 'none' + const data = await Logon(loginParams, mode); + const {access_token} = data!; + + // save token + this.setToken(access_token); + return this.afterLoginAction(goHome); + } catch (e: any) { + return Promise.reject(e); + } + }, + async afterLoginAction(goHome?: boolean): Promise { + if (!this.getToken) return null; + // get user info + const userInfo = await this.getUserInfoAction(); + + const sessionTimeout = this.sessionTimeout; + if (sessionTimeout) { + this.setSessionTimeout(false); + } else { + const permissionStore = usePermissionStore(); + if (!permissionStore.isDynamicAddedRoute) { + const routes = await permissionStore.buildRoutesAction(); + routes.forEach((route) => { + router.addRoute(route as unknown as RouteRecordRaw); + }); + router.addRoute(PAGE_NOT_FOUND_ROUTE as unknown as RouteRecordRaw); + permissionStore.setDynamicAddedRoute(true); + } + goHome && (await router.replace(PageEnum.BASE_HOME)); + } + return userInfo; + }, + async getUserInfoAction(): Promise { + if (!this.getToken) return null; + const userInfo = (await GetMe()) as UserInfo; + this.setUserInfo(userInfo); + return userInfo; + }, + /** + * @description: logout + */ + async logout(goLogin = false) { + if (this.getToken) { + try { + await Logout({id: this?.userInfo?.id}); + } catch { + console.log('注销Token失败'); + } + } + this.setToken(undefined); + this.setSessionTimeout(false); + this.setUserInfo(null); + goLogin && (await router.push(PageEnum.BASE_LOGIN)); + }, + + /** + * @description: Confirm before logging out + */ + confirmLoginOut() { + const {createConfirm} = useMessage(); + const {t} = useI18n(); + createConfirm({ + iconType: 'warning', + title: () => h('span', t('sys.app.logoutTip')), + content: () => h('span', t('sys.app.logoutMessage')), + onOk: async () => { + await this.logout(true); + }, + }); + }, + }, +}); + +// Need to be used outside the setup +export function useUserStoreWithOut() { + return useUserStore(store); +} diff --git a/monolithic/frontend/src/utils/auth/index.ts b/monolithic/frontend/src/utils/auth/index.ts new file mode 100644 index 0000000..fdec836 --- /dev/null +++ b/monolithic/frontend/src/utils/auth/index.ts @@ -0,0 +1,26 @@ +import { Persistent, BasicKeys } from '/@/utils/cache/persistent'; +import { CacheTypeEnum } from '/@/enums/cacheEnum'; +import projectSetting from '/@/settings/projectSetting'; +import { TOKEN_KEY } from '/@/enums/cacheEnum'; + +const { permissionCacheType } = projectSetting; +const isLocal = permissionCacheType === CacheTypeEnum.LOCAL; + +export function getToken() { + return getAuthCache(TOKEN_KEY); +} + +export function getAuthCache(key: BasicKeys) { + const fn = isLocal ? Persistent.getLocal : Persistent.getSession; + return fn(key) as T; +} + +export function setAuthCache(key: BasicKeys, value) { + const fn = isLocal ? Persistent.setLocal : Persistent.setSession; + return fn(key, value, true); +} + +export function clearAuthCache(immediate = true) { + const fn = isLocal ? Persistent.clearLocal : Persistent.clearSession; + return fn(immediate); +} diff --git a/monolithic/frontend/src/utils/bem.ts b/monolithic/frontend/src/utils/bem.ts new file mode 100644 index 0000000..7dcadbc --- /dev/null +++ b/monolithic/frontend/src/utils/bem.ts @@ -0,0 +1,52 @@ +import { prefixCls } from '/@/settings/designSetting'; + +type Mod = string | { [key: string]: any }; +type Mods = Mod | Mod[]; + +export type BEM = ReturnType; + +function genBem(name: string, mods?: Mods): string { + if (!mods) { + return ''; + } + + if (typeof mods === 'string') { + return ` ${name}--${mods}`; + } + + if (Array.isArray(mods)) { + return mods.reduce((ret, item) => ret + genBem(name, item), ''); + } + + return Object.keys(mods).reduce((ret, key) => ret + (mods[key] ? genBem(name, key) : ''), ''); +} + +/** + * bem helper + * b() // 'button' + * b('text') // 'button__text' + * b({ disabled }) // 'button button--disabled' + * b('text', { disabled }) // 'button__text button__text--disabled' + * b(['disabled', 'primary']) // 'button button--disabled button--primary' + */ +export function buildBEM(name: string) { + return (el?: Mods, mods?: Mods): Mods => { + if (el && typeof el !== 'string') { + mods = el; + el = ''; + } + + el = el ? `${name}__${el}` : name; + + return `${el}${genBem(el, mods)}`; + }; +} + +export function createBEM(name: string) { + return [buildBEM(`${prefixCls}-${name}`)]; +} + +export function createNamespace(name: string) { + const prefixedName = `${prefixCls}-${name}`; + return [prefixedName, buildBEM(prefixedName)] as const; +} diff --git a/monolithic/frontend/src/utils/cache/index.ts b/monolithic/frontend/src/utils/cache/index.ts new file mode 100644 index 0000000..2004c66 --- /dev/null +++ b/monolithic/frontend/src/utils/cache/index.ts @@ -0,0 +1,32 @@ +import { getStorageShortName } from '/@/utils/env'; +import { createStorage as create, CreateStorageParams } from './storageCache'; +import { enableStorageEncryption } from '/@/settings/encryptionSetting'; +import { DEFAULT_CACHE_TIME } from '/@/settings/encryptionSetting'; + +export type Options = Partial; + +const createOptions = (storage: Storage, options: Options = {}): Options => { + return { + // No encryption in debug mode + hasEncrypt: enableStorageEncryption, + storage, + prefixKey: getStorageShortName(), + ...options, + }; +}; + +export const WebStorage = create(createOptions(sessionStorage)); + +export const createStorage = (storage: Storage = sessionStorage, options: Options = {}) => { + return create(createOptions(storage, options)); +}; + +export const createSessionStorage = (options: Options = {}) => { + return createStorage(sessionStorage, { ...options, timeout: DEFAULT_CACHE_TIME }); +}; + +export const createLocalStorage = (options: Options = {}) => { + return createStorage(localStorage, { ...options, timeout: DEFAULT_CACHE_TIME }); +}; + +export default WebStorage; diff --git a/monolithic/frontend/src/utils/cache/memory.ts b/monolithic/frontend/src/utils/cache/memory.ts new file mode 100644 index 0000000..08a0a64 --- /dev/null +++ b/monolithic/frontend/src/utils/cache/memory.ts @@ -0,0 +1,107 @@ +export interface Cache { + value?: V; + timeoutId?: ReturnType; + time?: number; + alive?: number; +} + +const NOT_ALIVE = 0; + +export class Memory { + private cache: { [key in keyof T]?: Cache } = {}; + private alive: number; + + constructor(alive = NOT_ALIVE) { + // Unit second + this.alive = alive * 1000; + } + + get getCache() { + return this.cache; + } + + setCache(cache) { + this.cache = cache; + } + + // get(key: K) { + // const item = this.getItem(key); + // const time = item?.time; + // if (!isNullOrUnDef(time) && time < new Date().getTime()) { + // this.remove(key); + // } + // return item?.value ?? undefined; + // } + + get(key: K) { + return this.cache[key]; + } + + set(key: K, value: V, expires?: number) { + let item = this.get(key); + + if (!expires || (expires as number) <= 0) { + expires = this.alive; + } + if (item) { + if (item.timeoutId) { + clearTimeout(item.timeoutId); + item.timeoutId = undefined; + } + item.value = value; + } else { + item = { value, alive: expires }; + this.cache[key] = item; + } + + if (!expires) { + return value; + } + const now = new Date().getTime(); + /** + * Prevent overflow of the setTimeout Maximum delay value + * Maximum delay value 2,147,483,647 ms + * https://developer.mozilla.org/en-US/docs/Web/API/setTimeout#maximum_delay_value + */ + item.time = expires > now ? expires : now + expires; + item.timeoutId = setTimeout( + () => { + this.remove(key); + }, + expires > now ? expires - now : expires, + ); + + return value; + } + + remove(key: K) { + const item = this.get(key); + Reflect.deleteProperty(this.cache, key); + if (item) { + clearTimeout(item.timeoutId!); + return item.value; + } + } + + resetCache(cache: { [K in keyof T]: Cache }) { + Object.keys(cache).forEach((key) => { + const k = key as any as keyof T; + const item = cache[k]; + if (item && item.time) { + const now = new Date().getTime(); + const expire = item.time; + if (expire > now) { + this.set(k, item.value, expire); + } + } + }); + } + + clear() { + Object.keys(this.cache).forEach((key) => { + const item = this.cache[key]; + item.timeoutId && clearTimeout(item.timeoutId); + }); + this.cache = {}; + } +} diff --git a/monolithic/frontend/src/utils/cache/persistent.ts b/monolithic/frontend/src/utils/cache/persistent.ts new file mode 100644 index 0000000..cd68a36 --- /dev/null +++ b/monolithic/frontend/src/utils/cache/persistent.ts @@ -0,0 +1,132 @@ +import type { LockInfo, UserInfo } from '/#/store'; +import type { ProjectConfig } from '/#/config'; +import type { RouteLocationNormalized } from 'vue-router'; + +import { createLocalStorage, createSessionStorage } from '/@/utils/cache'; +import { Memory } from './memory'; +import { + TOKEN_KEY, + USER_INFO_KEY, + ROLES_KEY, + LOCK_INFO_KEY, + PROJ_CFG_KEY, + APP_LOCAL_CACHE_KEY, + APP_SESSION_CACHE_KEY, + MULTIPLE_TABS_KEY, +} from '/@/enums/cacheEnum'; +import { DEFAULT_CACHE_TIME } from '/@/settings/encryptionSetting'; +import { toRaw } from 'vue'; +import { pick, omit } from 'lodash-es'; + +interface BasicStore { + [TOKEN_KEY]: string | number | null | undefined; + [USER_INFO_KEY]: UserInfo; + [ROLES_KEY]: string[]; + [LOCK_INFO_KEY]: LockInfo; + [PROJ_CFG_KEY]: ProjectConfig; + [MULTIPLE_TABS_KEY]: RouteLocationNormalized[]; +} + +type LocalStore = BasicStore; + +type SessionStore = BasicStore; + +export type BasicKeys = keyof BasicStore; +type LocalKeys = keyof LocalStore; +type SessionKeys = keyof SessionStore; + +const ls = createLocalStorage(); +const ss = createSessionStorage(); + +const localMemory = new Memory(DEFAULT_CACHE_TIME); +const sessionMemory = new Memory(DEFAULT_CACHE_TIME); + +function initPersistentMemory() { + const localCache = ls.get(APP_LOCAL_CACHE_KEY); + const sessionCache = ss.get(APP_SESSION_CACHE_KEY); + localCache && localMemory.resetCache(localCache); + sessionCache && sessionMemory.resetCache(sessionCache); +} + +export class Persistent { + static getLocal(key: LocalKeys) { + return localMemory.get(key)?.value as Nullable; + } + + static setLocal(key: LocalKeys, value: LocalStore[LocalKeys], immediate = false): void { + localMemory.set(key, toRaw(value)); + immediate && ls.set(APP_LOCAL_CACHE_KEY, localMemory.getCache); + } + + static removeLocal(key: LocalKeys, immediate = false): void { + localMemory.remove(key); + immediate && ls.set(APP_LOCAL_CACHE_KEY, localMemory.getCache); + } + + static clearLocal(immediate = false): void { + localMemory.clear(); + immediate && ls.clear(); + } + + static getSession(key: SessionKeys) { + return sessionMemory.get(key)?.value as Nullable; + } + + static setSession(key: SessionKeys, value: SessionStore[SessionKeys], immediate = false): void { + sessionMemory.set(key, toRaw(value)); + immediate && ss.set(APP_SESSION_CACHE_KEY, sessionMemory.getCache); + } + + static removeSession(key: SessionKeys, immediate = false): void { + sessionMemory.remove(key); + immediate && ss.set(APP_SESSION_CACHE_KEY, sessionMemory.getCache); + } + static clearSession(immediate = false): void { + sessionMemory.clear(); + immediate && ss.clear(); + } + + static clearAll(immediate = false) { + sessionMemory.clear(); + localMemory.clear(); + if (immediate) { + ls.clear(); + ss.clear(); + } + } +} + +window.addEventListener('beforeunload', function () { + // TOKEN_KEY 在登录或注销时已经写入到storage了,此处为了解决同时打开多个窗口时token不同步的问题 + // LOCK_INFO_KEY 在锁屏和解锁时写入,此处也不应修改 + ls.set(APP_LOCAL_CACHE_KEY, { + ...omit(localMemory.getCache, LOCK_INFO_KEY), + ...pick(ls.get(APP_LOCAL_CACHE_KEY), [TOKEN_KEY, USER_INFO_KEY, LOCK_INFO_KEY]), + }); + ss.set(APP_SESSION_CACHE_KEY, { + ...omit(sessionMemory.getCache, LOCK_INFO_KEY), + ...pick(ss.get(APP_SESSION_CACHE_KEY), [TOKEN_KEY, USER_INFO_KEY, LOCK_INFO_KEY]), + }); +}); + +function storageChange(e: any) { + const { key, newValue, oldValue } = e; + + if (!key) { + Persistent.clearAll(); + return; + } + + if (!!newValue && !!oldValue) { + if (APP_LOCAL_CACHE_KEY === key) { + Persistent.clearLocal(); + } + if (APP_SESSION_CACHE_KEY === key) { + Persistent.clearSession(); + } + } +} + +window.addEventListener('storage', storageChange); + +initPersistentMemory(); diff --git a/monolithic/frontend/src/utils/cache/storageCache.ts b/monolithic/frontend/src/utils/cache/storageCache.ts new file mode 100644 index 0000000..927b297 --- /dev/null +++ b/monolithic/frontend/src/utils/cache/storageCache.ts @@ -0,0 +1,111 @@ +import { cacheCipher } from '/@/settings/encryptionSetting'; +import type { EncryptionParams } from '/@/utils/cipher'; +import { AesEncryption } from '/@/utils/cipher'; +import { isNullOrUnDef } from '/@/utils/is'; + +export interface CreateStorageParams extends EncryptionParams { + prefixKey: string; + storage: Storage; + hasEncrypt: boolean; + timeout?: Nullable; +} +export const createStorage = ({ + prefixKey = '', + storage = sessionStorage, + key = cacheCipher.key, + iv = cacheCipher.iv, + timeout = null, + hasEncrypt = true, +}: Partial = {}) => { + if (hasEncrypt && [key.length, iv.length].some((item) => item !== 16)) { + throw new Error('When hasEncrypt is true, the key or iv must be 16 bits!'); + } + + const encryption = new AesEncryption({ key, iv }); + + /** + * Cache class + * Construction parameters can be passed into sessionStorage, localStorage, + * @class Cache + * @example + */ + const WebStorage = class WebStorage { + private storage: Storage; + private prefixKey?: string; + private encryption: AesEncryption; + private hasEncrypt: boolean; + /** + * + * @param {*} storage + */ + constructor() { + this.storage = storage; + this.prefixKey = prefixKey; + this.encryption = encryption; + this.hasEncrypt = hasEncrypt; + } + + private getKey(key: string) { + return `${this.prefixKey}${key}`.toUpperCase(); + } + + /** + * Set cache + * @param {string} key + * @param {*} value + * @param {*} expire Expiration time in seconds + * @memberof Cache + */ + set(key: string, value: any, expire: number | null = timeout) { + const stringData = JSON.stringify({ + value, + time: Date.now(), + expire: !isNullOrUnDef(expire) ? new Date().getTime() + expire * 1000 : null, + }); + const stringifyValue = this.hasEncrypt + ? this.encryption.encryptByAES(stringData) + : stringData; + this.storage.setItem(this.getKey(key), stringifyValue); + } + + /** + * Read cache + * @param {string} key + * @param {*} def + * @memberof Cache + */ + get(key: string, def: any = null): any { + const val = this.storage.getItem(this.getKey(key)); + if (!val) return def; + + try { + const decVal = this.hasEncrypt ? this.encryption.decryptByAES(val) : val; + const data = JSON.parse(decVal); + const { value, expire } = data; + if (isNullOrUnDef(expire) || expire >= new Date().getTime()) { + return value; + } + this.remove(key); + } catch (e: any) { + return def; + } + } + + /** + * Delete cache based on key + * @param {string} key + * @memberof Cache + */ + remove(key: string) { + this.storage.removeItem(this.getKey(key)); + } + + /** + * Delete all caches of this instance + */ + clear(): void { + this.storage.clear(); + } + }; + return new WebStorage(); +}; diff --git a/monolithic/frontend/src/utils/cipher.ts b/monolithic/frontend/src/utils/cipher.ts new file mode 100644 index 0000000..9a8a89a --- /dev/null +++ b/monolithic/frontend/src/utils/cipher.ts @@ -0,0 +1,55 @@ +import { encrypt, decrypt } from 'crypto-js/aes'; +import { parse } from 'crypto-js/enc-utf8'; +import pkcs7 from 'crypto-js/pad-pkcs7'; +import ECB from 'crypto-js/mode-ecb'; +import md5 from 'crypto-js/md5'; +import UTF8 from 'crypto-js/enc-utf8'; +import Base64 from 'crypto-js/enc-base64'; + +export interface EncryptionParams { + key: string; + iv: string; +} + +export class AesEncryption { + private key; + private iv; + + constructor(opt: Partial = {}) { + const { key, iv } = opt; + if (key) { + this.key = parse(key); + } + if (iv) { + this.iv = parse(iv); + } + } + + get getOptions() { + return { + mode: ECB, + padding: pkcs7, + iv: this.iv, + }; + } + + encryptByAES(cipherText: string) { + return encrypt(cipherText, this.key, this.getOptions).toString(); + } + + decryptByAES(cipherText: string) { + return decrypt(cipherText, this.key, this.getOptions).toString(UTF8); + } +} + +export function encryptByBase64(cipherText: string) { + return UTF8.parse(cipherText).toString(Base64); +} + +export function decodeByBase64(cipherText: string) { + return Base64.parse(cipherText).toString(UTF8); +} + +export function encryptByMd5(password: string) { + return md5(password).toString(); +} diff --git a/monolithic/frontend/src/utils/color.ts b/monolithic/frontend/src/utils/color.ts new file mode 100644 index 0000000..04f502e --- /dev/null +++ b/monolithic/frontend/src/utils/color.ts @@ -0,0 +1,151 @@ +/** + * 判断是否 十六进制颜色值. + * 输入形式可为 #fff000 #f00 + * + * @param {String} color 十六进制颜色值 + * @return {Boolean} + */ +export function isHexColor(color: string) { + const reg = /^#([0-9a-fA-F]{3}|[0-9a-fA-f]{6})$/; + return reg.test(color); +} + +/** + * RGB 颜色值转换为 十六进制颜色值. + * r, g, 和 b 需要在 [0, 255] 范围内 + * + * @return String 类似#ff00ff + * @param r + * @param g + * @param b + */ +export function rgbToHex(r: number, g: number, b: number) { + // tslint:disable-next-line:no-bitwise + const hex = ((r << 16) | (g << 8) | b).toString(16); + return '#' + new Array(Math.abs(hex.length - 7)).join('0') + hex; +} + +/** + * Transform a HEX color to its RGB representation + * @param {string} hex The color to transform + * @returns The RGB representation of the passed color + */ +export function hexToRGB(hex: string) { + let sHex = hex.toLowerCase(); + if (isHexColor(hex)) { + if (sHex.length === 4) { + let sColorNew = '#'; + for (let i = 1; i < 4; i += 1) { + sColorNew += sHex.slice(i, i + 1).concat(sHex.slice(i, i + 1)); + } + sHex = sColorNew; + } + const sColorChange: number[] = []; + for (let i = 1; i < 7; i += 2) { + sColorChange.push(parseInt('0x' + sHex.slice(i, i + 2))); + } + return 'RGB(' + sColorChange.join(',') + ')'; + } + return sHex; +} + +export function colorIsDark(color: string) { + if (!isHexColor(color)) return; + const [r, g, b] = hexToRGB(color) + .replace(/(?:\(|\)|rgb|RGB)*/g, '') + .split(',') + .map((item) => Number(item)); + return r * 0.299 + g * 0.578 + b * 0.114 < 192; +} + +/** + * Darkens a HEX color given the passed percentage + * @param {string} color The color to process + * @param {number} amount The amount to change the color by + * @returns {string} The HEX representation of the processed color + */ +export function darken(color: string, amount: number) { + color = color.indexOf('#') >= 0 ? color.substring(1, color.length) : color; + amount = Math.trunc((255 * amount) / 100); + return `#${subtractLight(color.substring(0, 2), amount)}${subtractLight( + color.substring(2, 4), + amount, + )}${subtractLight(color.substring(4, 6), amount)}`; +} + +/** + * Lightens a 6 char HEX color according to the passed percentage + * @param {string} color The color to change + * @param {number} amount The amount to change the color by + * @returns {string} The processed color represented as HEX + */ +export function lighten(color: string, amount: number) { + color = color.indexOf('#') >= 0 ? color.substring(1, color.length) : color; + amount = Math.trunc((255 * amount) / 100); + return `#${addLight(color.substring(0, 2), amount)}${addLight( + color.substring(2, 4), + amount, + )}${addLight(color.substring(4, 6), amount)}`; +} + +/* Suma el porcentaje indicado a un color (RR, GG o BB) hexadecimal para aclararlo */ +/** + * Sums the passed percentage to the R, G or B of a HEX color + * @param {string} color The color to change + * @param {number} amount The amount to change the color by + * @returns {string} The processed part of the color + */ +function addLight(color: string, amount: number) { + const cc = parseInt(color, 16) + amount; + const c = cc > 255 ? 255 : cc; + return c.toString(16).length > 1 ? c.toString(16) : `0${c.toString(16)}`; +} + +/** + * Calculates luminance of an rgb color + * @param {number} r red + * @param {number} g green + * @param {number} b blue + */ +function luminanace(r: number, g: number, b: number) { + const a = [r, g, b].map((v) => { + v /= 255; + return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4); + }); + return a[0] * 0.2126 + a[1] * 0.7152 + a[2] * 0.0722; +} + +/** + * Calculates contrast between two rgb colors + * @param {string} rgb1 rgb color 1 + * @param {string} rgb2 rgb color 2 + */ +function contrast(rgb1: string[], rgb2: number[]) { + return ( + (luminanace(~~rgb1[0], ~~rgb1[1], ~~rgb1[2]) + 0.05) / + (luminanace(rgb2[0], rgb2[1], rgb2[2]) + 0.05) + ); +} + +/** + * Determines what the best text color is (black or white) based con the contrast with the background + * @param hexColor - Last selected color by the user + */ +export function calculateBestTextColor(hexColor: string) { + const rgbColor = hexToRGB(hexColor.substring(1)); + const contrastWithBlack = contrast(rgbColor.split(','), [0, 0, 0]); + + return contrastWithBlack >= 12 ? '#000000' : '#FFFFFF'; +} + +/** + * Subtracts the indicated percentage to the R, G or B of a HEX color + * @param {string} color The color to change + * @param {number} amount The amount to change the color by + * @returns {string} The processed part of the color + */ +function subtractLight(color: string, amount: number) { + const cc = parseInt(color, 16) - amount; + const c = cc < 0 ? 0 : cc; + return c.toString(16).length > 1 ? c.toString(16) : `0${c.toString(16)}`; +} diff --git a/monolithic/frontend/src/utils/dateUtil.ts b/monolithic/frontend/src/utils/dateUtil.ts new file mode 100644 index 0000000..7fb5787 --- /dev/null +++ b/monolithic/frontend/src/utils/dateUtil.ts @@ -0,0 +1,23 @@ +/** + * Independent time operation tool to facilitate subsequent switch to dayjs + */ +import dayjs from 'dayjs'; + +const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss'; +const DATE_FORMAT = 'YYYY-MM-DD'; + +export function formatToDateTime( + date: dayjs.Dayjs | undefined = undefined, + format = DATE_TIME_FORMAT, +): string { + return dayjs(date).format(format); +} + +export function formatToDate( + date: dayjs.Dayjs | undefined = undefined, + format = DATE_FORMAT, +): string { + return dayjs(date).format(format); +} + +export const dateUtil = dayjs; diff --git a/monolithic/frontend/src/utils/domUtils.ts b/monolithic/frontend/src/utils/domUtils.ts new file mode 100644 index 0000000..7efe9cb --- /dev/null +++ b/monolithic/frontend/src/utils/domUtils.ts @@ -0,0 +1,180 @@ +import type { FunctionArgs } from '@vueuse/core'; +import { upperFirst } from 'lodash-es'; + +export interface ViewportOffsetResult { + left: number; + top: number; + right: number; + bottom: number; + rightIncludeBody: number; + bottomIncludeBody: number; +} + +export function getBoundingClientRect(element: Element): DOMRect | number { + if (!element || !element.getBoundingClientRect) { + return 0; + } + return element.getBoundingClientRect(); +} + +function trim(string: string) { + return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, ''); +} + +/* istanbul ignore next */ +export function hasClass(el: Element, cls: string) { + if (!el || !cls) return false; + if (cls.indexOf(' ') !== -1) throw new Error('className should not contain space.'); + if (el.classList) { + return el.classList.contains(cls); + } else { + return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1; + } +} + +/* istanbul ignore next */ +export function addClass(el: Element, cls: string) { + if (!el) return; + let curClass = el.className; + const classes = (cls || '').split(' '); + + for (let i = 0, j = classes.length; i < j; i++) { + const clsName = classes[i]; + if (!clsName) continue; + + if (el.classList) { + el.classList.add(clsName); + } else if (!hasClass(el, clsName)) { + curClass += ' ' + clsName; + } + } + if (!el.classList) { + el.className = curClass; + } +} + +/* istanbul ignore next */ +export function removeClass(el: Element, cls: string) { + if (!el || !cls) return; + const classes = cls.split(' '); + let curClass = ' ' + el.className + ' '; + + for (let i = 0, j = classes.length; i < j; i++) { + const clsName = classes[i]; + if (!clsName) continue; + + if (el.classList) { + el.classList.remove(clsName); + } else if (hasClass(el, clsName)) { + curClass = curClass.replace(' ' + clsName + ' ', ' '); + } + } + if (!el.classList) { + el.className = trim(curClass); + } +} +/** + * Get the left and top offset of the current element + * left: the distance between the leftmost element and the left side of the document + * top: the distance from the top of the element to the top of the document + * right: the distance from the far right of the element to the right of the document + * bottom: the distance from the bottom of the element to the bottom of the document + * rightIncludeBody: the distance between the leftmost element and the right side of the document + * bottomIncludeBody: the distance from the bottom of the element to the bottom of the document + * + * @description: + */ +export function getViewportOffset(element: Element): ViewportOffsetResult { + const doc = document.documentElement; + + const docScrollLeft = doc.scrollLeft; + const docScrollTop = doc.scrollTop; + const docClientLeft = doc.clientLeft; + const docClientTop = doc.clientTop; + + const pageXOffset = window.pageXOffset; + const pageYOffset = window.pageYOffset; + + const box = getBoundingClientRect(element); + + const { left: retLeft, top: rectTop, width: rectWidth, height: rectHeight } = box as DOMRect; + + const scrollLeft = (pageXOffset || docScrollLeft) - (docClientLeft || 0); + const scrollTop = (pageYOffset || docScrollTop) - (docClientTop || 0); + const offsetLeft = retLeft + pageXOffset; + const offsetTop = rectTop + pageYOffset; + + const left = offsetLeft - scrollLeft; + const top = offsetTop - scrollTop; + + const clientWidth = window.document.documentElement.clientWidth; + const clientHeight = window.document.documentElement.clientHeight; + return { + left: left, + top: top, + right: clientWidth - rectWidth - left, + bottom: clientHeight - rectHeight - top, + rightIncludeBody: clientWidth - left, + bottomIncludeBody: clientHeight - top, + }; +} + +export function hackCss(attr: string, value: string) { + const prefix: string[] = ['webkit', 'Moz', 'ms', 'OT']; + + const styleObj: any = {}; + prefix.forEach((item) => { + styleObj[`${item}${upperFirst(attr)}`] = value; + }); + return { + ...styleObj, + [attr]: value, + }; +} + +/* istanbul ignore next */ +export function on( + element: Element | HTMLElement | Document | Window, + event: string, + handler: EventListenerOrEventListenerObject, +): void { + if (element && event && handler) { + element.addEventListener(event, handler, false); + } +} + +/* istanbul ignore next */ +export function off( + element: Element | HTMLElement | Document | Window, + event: string, + handler: Fn, +): void { + if (element && event && handler) { + element.removeEventListener(event, handler, false); + } +} + +/* istanbul ignore next */ +export function once(el: HTMLElement, event: string, fn: EventListener): void { + const listener = function (this: any, ...args: unknown[]) { + if (fn) { + fn.apply(this, args); + } + off(el, event, listener); + }; + on(el, event, listener); +} + +export function useRafThrottle(fn: T): T { + let locked = false; + // @ts-ignore + return function (...args: any[]) { + if (locked) return; + locked = true; + window.requestAnimationFrame(() => { + // @ts-ignore + fn.apply(this, args); + locked = false; + }); + }; +} diff --git a/monolithic/frontend/src/utils/env.ts b/monolithic/frontend/src/utils/env.ts new file mode 100644 index 0000000..408398a --- /dev/null +++ b/monolithic/frontend/src/utils/env.ts @@ -0,0 +1,83 @@ +import type { GlobEnvConfig } from '/#/config'; + +import { warn } from '/@/utils/log'; +import pkg from '../../package.json'; +import { getConfigFileName } from '../../build/getConfigFileName'; + +export function getCommonStoragePrefix() { + const { VITE_GLOB_APP_SHORT_NAME } = getAppEnvConfig(); + return `${VITE_GLOB_APP_SHORT_NAME}__${getEnv()}`.toUpperCase(); +} + +// Generate cache key according to version +export function getStorageShortName() { + return `${getCommonStoragePrefix()}${`__${pkg.version}`}__`.toUpperCase(); +} + +export function getAppEnvConfig() { + const ENV_NAME = getConfigFileName(import.meta.env); + + const ENV = (import.meta.env.DEV + ? // Get the global configuration (the configuration will be extracted independently when packaging) + (import.meta.env as unknown as GlobEnvConfig) + : window[ENV_NAME as any]) as unknown as GlobEnvConfig; + + const { + VITE_GLOB_APP_TITLE, + VITE_GLOB_API_URL, + VITE_GLOB_APP_SHORT_NAME, + VITE_GLOB_API_URL_PREFIX, + VITE_GLOB_UPLOAD_URL, + } = ENV; + + if (!/^[a-zA-Z\_]*$/.test(VITE_GLOB_APP_SHORT_NAME)) { + warn( + `VITE_GLOB_APP_SHORT_NAME Variables can only be characters/underscores, please modify in the environment variables and re-running.`, + ); + } + + return { + VITE_GLOB_APP_TITLE, + VITE_GLOB_API_URL, + VITE_GLOB_APP_SHORT_NAME, + VITE_GLOB_API_URL_PREFIX, + VITE_GLOB_UPLOAD_URL, + }; +} + +/** + * @description: Development mode + */ +export const devMode = 'development'; + +/** + * @description: Production mode + */ +export const prodMode = 'production'; + +/** + * @description: Get environment variables + * @returns: + * @example: + */ +export function getEnv(): string { + return import.meta.env.MODE; +} + +/** + * @description: Is it a development mode + * @returns: + * @example: + */ +export function isDevMode(): boolean { + return import.meta.env.DEV; +} + +/** + * @description: Is it a production mode + * @returns: + * @example: + */ +export function isProdMode(): boolean { + return import.meta.env.PROD; +} diff --git a/monolithic/frontend/src/utils/event/index.ts b/monolithic/frontend/src/utils/event/index.ts new file mode 100644 index 0000000..3a60d7c --- /dev/null +++ b/monolithic/frontend/src/utils/event/index.ts @@ -0,0 +1,42 @@ +import ResizeObserver from 'resize-observer-polyfill'; + +const isServer = typeof window === 'undefined'; + +/* istanbul ignore next */ +function resizeHandler(entries: any[]) { + for (const entry of entries) { + const listeners = entry.target.__resizeListeners__ || []; + if (listeners.length) { + listeners.forEach((fn: () => any) => { + fn(); + }); + } + } +} + +/* istanbul ignore next */ +export function addResizeListener(element: any, fn: () => any) { + if (isServer) return; + if (!element.__resizeListeners__) { + element.__resizeListeners__ = []; + element.__ro__ = new ResizeObserver(resizeHandler); + element.__ro__.observe(element); + } + element.__resizeListeners__.push(fn); +} + +/* istanbul ignore next */ +export function removeResizeListener(element: any, fn: () => any) { + if (!element || !element.__resizeListeners__) return; + element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1); + if (!element.__resizeListeners__.length) { + element.__ro__.disconnect(); + } +} + +export function triggerWindowResize() { + const event = document.createEvent('HTMLEvents'); + event.initEvent('resize', true, true); + (event as any).eventType = 'message'; + window.dispatchEvent(event); +} diff --git a/monolithic/frontend/src/utils/factory/createAsyncComponent.tsx b/monolithic/frontend/src/utils/factory/createAsyncComponent.tsx new file mode 100644 index 0000000..fc5e2a6 --- /dev/null +++ b/monolithic/frontend/src/utils/factory/createAsyncComponent.tsx @@ -0,0 +1,63 @@ +import { + defineAsyncComponent, + // FunctionalComponent, CSSProperties +} from 'vue'; +import { Spin } from 'ant-design-vue'; +import { noop } from '/@/utils'; + +// const Loading: FunctionalComponent<{ size: 'small' | 'default' | 'large' }> = (props) => { +// const style: CSSProperties = { +// position: 'absolute', +// display: 'flex', +// justifyContent: 'center', +// alignItems: 'center', +// }; +// return ( +//
+// +//
+// ); +// }; + +interface Options { + size?: 'default' | 'small' | 'large'; + delay?: number; + timeout?: number; + loading?: boolean; + retry?: boolean; +} + +export function createAsyncComponent(loader: Fn, options: Options = {}) { + const { size = 'small', delay = 100, timeout = 30000, loading = false, retry = true } = options; + return defineAsyncComponent({ + loader, + loadingComponent: loading ? : undefined, + // The error component will be displayed if a timeout is + // provided and exceeded. Default: Infinity. + // TODO + timeout, + // errorComponent + // Defining if component is suspensible. Default: true. + // suspensible: false, + delay, + /** + * + * @param {*} error Error message object + * @param {*} retry A function that indicating whether the async component should retry when the loader promise rejects + * @param {*} fail End of failure + * @param {*} attempts Maximum allowed retries number + */ + onError: !retry + ? noop + : (error, retry, fail, attempts) => { + if (error.message.match(/fetch/) && attempts <= 3) { + // retry on fetch errors, 3 max attempts + retry(); + } else { + // Note that retry/fail are like resolve/reject of a promise: + // one of them must be called for the error handling to continue. + fail(); + } + }, + }); +} diff --git a/monolithic/frontend/src/utils/file/base64Conver.ts b/monolithic/frontend/src/utils/file/base64Conver.ts new file mode 100644 index 0000000..6751d97 --- /dev/null +++ b/monolithic/frontend/src/utils/file/base64Conver.ts @@ -0,0 +1,41 @@ +/** + * @description: base64 to blob + */ +export function dataURLtoBlob(base64Buf: string): Blob { + const arr = base64Buf.split(','); + const typeItem = arr[0]; + const mime = typeItem.match(/:(.*?);/)![1]; + const bstr = window.atob(arr[1]); + let n = bstr.length; + const u8arr = new Uint8Array(n); + while (n--) { + u8arr[n] = bstr.charCodeAt(n); + } + return new Blob([u8arr], { type: mime }); +} + +/** + * img url to base64 + * @param url + */ +export function urlToBase64(url: string, mineType?: string): Promise { + return new Promise((resolve, reject) => { + let canvas = document.createElement('CANVAS') as Nullable; + const ctx = canvas!.getContext('2d'); + + const img = new Image(); + img.crossOrigin = ''; + img.onload = function () { + if (!canvas || !ctx) { + return reject(); + } + canvas.height = img.height; + canvas.width = img.width; + ctx.drawImage(img, 0, 0); + const dataURL = canvas.toDataURL(mineType || 'image/png'); + canvas = null; + resolve(dataURL); + }; + img.src = url; + }); +} diff --git a/monolithic/frontend/src/utils/file/download.ts b/monolithic/frontend/src/utils/file/download.ts new file mode 100644 index 0000000..ba0a2ca --- /dev/null +++ b/monolithic/frontend/src/utils/file/download.ts @@ -0,0 +1,96 @@ +import { openWindow } from '..'; +import { dataURLtoBlob, urlToBase64 } from './base64Conver'; + +/** + * Download online pictures + * @param url + * @param filename + * @param mime + * @param bom + */ +export function downloadByOnlineUrl(url: string, filename: string, mime?: string, bom?: BlobPart) { + urlToBase64(url).then((base64) => { + downloadByBase64(base64, filename, mime, bom); + }); +} + +/** + * Download pictures based on base64 + * @param buf + * @param filename + * @param mime + * @param bom + */ +export function downloadByBase64(buf: string, filename: string, mime?: string, bom?: BlobPart) { + const base64Buf = dataURLtoBlob(buf); + downloadByData(base64Buf, filename, mime, bom); +} + +/** + * Download according to the background interfaces file stream + * @param {*} data + * @param {*} filename + * @param {*} mime + * @param {*} bom + */ +export function downloadByData(data: BlobPart, filename: string, mime?: string, bom?: BlobPart) { + const blobData = typeof bom !== 'undefined' ? [bom, data] : [data]; + const blob = new Blob(blobData, { type: mime || 'application/octet-stream' }); + + const blobURL = window.URL.createObjectURL(blob); + const tempLink = document.createElement('a'); + tempLink.style.display = 'none'; + tempLink.href = blobURL; + tempLink.setAttribute('download', filename); + if (typeof tempLink.download === 'undefined') { + tempLink.setAttribute('target', '_blank'); + } + document.body.appendChild(tempLink); + tempLink.click(); + document.body.removeChild(tempLink); + window.URL.revokeObjectURL(blobURL); +} + +/** + * Download file according to file address + * @param {*} sUrl + */ +export function downloadByUrl({ + url, + target = '_blank', + fileName, +}: { + url: string; + target?: TargetContext; + fileName?: string; +}): boolean { + const isChrome = window.navigator.userAgent.toLowerCase().indexOf('chrome') > -1; + const isSafari = window.navigator.userAgent.toLowerCase().indexOf('safari') > -1; + + if (/(iP)/g.test(window.navigator.userAgent)) { + console.error('Your browser does not support download!'); + return false; + } + if (isChrome || isSafari) { + const link = document.createElement('a'); + link.href = url; + link.target = target; + + if (link.download !== undefined) { + link.download = fileName || url.substring(url.lastIndexOf('/') + 1, url.length); + } + + if (document.createEvent) { + const e = document.createEvent('MouseEvents'); + e.initEvent('click', true, true); + link.dispatchEvent(e); + return true; + } + } + if (url.indexOf('?') === -1) { + url += '?download'; + } + + openWindow(url, { target }); + return true; +} diff --git a/monolithic/frontend/src/utils/helper/treeHelper.ts b/monolithic/frontend/src/utils/helper/treeHelper.ts new file mode 100644 index 0000000..922a473 --- /dev/null +++ b/monolithic/frontend/src/utils/helper/treeHelper.ts @@ -0,0 +1,216 @@ +interface TreeHelperConfig { + id: string; + children: string; + pid: string; +} + +// 默认配置 +const DEFAULT_CONFIG: TreeHelperConfig = { + id: 'id', + children: 'children', + pid: 'pid', +}; + +// 获取配置。 Object.assign 从一个或多个源对象复制到目标对象 +const getConfig = (config: Partial) => Object.assign({}, DEFAULT_CONFIG, config); + +// tree from list +// 列表中的树 +export function listToTree(list: any[], config: Partial = {}): T[] { + const conf = getConfig(config) as TreeHelperConfig; + const nodeMap = new Map(); + const result: T[] = []; + const { id, children, pid } = conf; + + for (const node of list) { + node[children] = node[children] || []; + nodeMap.set(node[id], node); + } + for (const node of list) { + const parent = nodeMap.get(node[pid]); + (parent ? parent[children] : result).push(node); + } + return result; +} + +export function treeToList(tree: any, config: Partial = {}): T { + config = getConfig(config); + const { children } = config; + const result: any = [...tree]; + for (let i = 0; i < result.length; i++) { + if (!result[i][children!]) continue; + result.splice(i + 1, 0, ...result[i][children!]); + } + return result; +} + +export function findNode( + tree: any, + func: Fn, + config: Partial = {}, +): T | null { + config = getConfig(config); + const { children } = config; + const list = [...tree]; + for (const node of list) { + if (func(node)) return node; + node[children!] && list.push(...node[children!]); + } + return null; +} + +export function findNodeAll( + tree: any, + func: Fn, + config: Partial = {}, +): T[] { + config = getConfig(config); + const { children } = config; + const list = [...tree]; + const result: T[] = []; + for (const node of list) { + func(node) && result.push(node); + node[children!] && list.push(...node[children!]); + } + return result; +} + +export function findPath( + tree: any, + func: Fn, + config: Partial = {}, +): T | T[] | null { + config = getConfig(config); + const path: T[] = []; + const list = [...tree]; + const visitedSet = new Set(); + const { children } = config; + while (list.length) { + const node = list[0]; + if (visitedSet.has(node)) { + path.pop(); + list.shift(); + } else { + visitedSet.add(node); + node[children!] && list.unshift(...node[children!]); + path.push(node); + if (func(node)) { + return path; + } + } + } + return null; +} + +export function findPathAll(tree: any, func: Fn, config: Partial = {}) { + config = getConfig(config); + const path: any[] = []; + const list = [...tree]; + const result: any[] = []; + const visitedSet = new Set(), + { children } = config; + while (list.length) { + const node = list[0]; + if (visitedSet.has(node)) { + path.pop(); + list.shift(); + } else { + visitedSet.add(node); + node[children!] && list.unshift(...node[children!]); + path.push(node); + func(node) && result.push([...path]); + } + } + return result; +} + +export function filter( + tree: T[], + func: (n: T) => boolean, + // Partial 将 T 中的所有属性设为可选 + config: Partial = {}, +): T[] { + // 获取配置 + config = getConfig(config); + const children = config.children as string; + + function listFilter(list: T[]) { + return list + .map((node: any) => ({ ...node })) + .filter((node) => { + // 递归调用 对含有children项 进行再次调用自身函数 listFilter + node[children] = node[children] && listFilter(node[children]); + // 执行传入的回调 func 进行过滤 + return func(node) || (node[children] && node[children].length); + }); + } + + return listFilter(tree); +} + +export function forEach( + tree: T[], + func: (n: T) => any, + config: Partial = {}, +): void { + config = getConfig(config); + const list: any[] = [...tree]; + const { children } = config; + for (let i = 0; i < list.length; i++) { + //func 返回true就终止遍历,避免大量节点场景下无意义循环,引起浏览器卡顿 + if (func(list[i])) { + return; + } + children && list[i][children] && list.splice(i + 1, 0, ...list[i][children]); + } +} + +/** + * @description: Extract tree specified structure + * @description: 提取树指定结构 + */ +export function treeMap(treeData: T[], opt: { children?: string; conversion: Fn }): T[] { + return treeData.map((item) => treeMapEach(item, opt)); +} + +/** + * @description: Extract tree specified structure + * @description: 提取树指定结构 + */ +export function treeMapEach( + data: any, + { children = 'children', conversion }: { children?: string; conversion: Fn }, +) { + const haveChildren = Array.isArray(data[children]) && data[children].length > 0; + const conversionData = conversion(data) || {}; + if (haveChildren) { + return { + ...conversionData, + [children]: data[children].map((i: number) => + treeMapEach(i, { + children, + conversion, + }), + ), + }; + } else { + return { + ...conversionData, + }; + } +} + +/** + * 递归遍历树结构 + * @param treeDatas 树 + * @param callBack 回调 + * @param parentNode 父节点 + */ +export function eachTree(treeDatas: any[], callBack: Fn, parentNode = {}) { + treeDatas.forEach((element) => { + const newNode = callBack(element, parentNode) || element; + if (element.children) { + eachTree(element.children, callBack, newNode); + } + }); +} diff --git a/monolithic/frontend/src/utils/helper/tsxHelper.tsx b/monolithic/frontend/src/utils/helper/tsxHelper.tsx new file mode 100644 index 0000000..a75327a --- /dev/null +++ b/monolithic/frontend/src/utils/helper/tsxHelper.tsx @@ -0,0 +1,35 @@ +import { Slots } from 'vue'; +import { isFunction } from '/@/utils/is'; + +/** + * @description: Get slot to prevent empty error + */ +export function getSlot(slots: Slots, slot = 'default', data?: any) { + if (!slots || !Reflect.has(slots, slot)) { + return null; + } + if (!isFunction(slots[slot])) { + console.error(`${slot} is not a function!`); + return null; + } + const slotFn = slots[slot]; + if (!slotFn) return null; + return slotFn(data); +} + +/** + * extends slots + * @param slots + * @param excludeKeys + */ +export function extendSlots(slots: Slots, excludeKeys: string[] = []) { + const slotKeys = Object.keys(slots); + const ret: any = {}; + slotKeys.map((key) => { + if (excludeKeys.includes(key)) { + return null; + } + ret[key] = (data?: any) => getSlot(slots, key, data); + }); + return ret; +} diff --git a/monolithic/frontend/src/utils/http/axios/Axios.ts b/monolithic/frontend/src/utils/http/axios/Axios.ts new file mode 100644 index 0000000..c55a703 --- /dev/null +++ b/monolithic/frontend/src/utils/http/axios/Axios.ts @@ -0,0 +1,237 @@ +import type { AxiosRequestConfig, AxiosInstance, AxiosResponse, AxiosError } from 'axios'; +import type { RequestOptions, Result, UploadFileParams } from '/#/axios'; +import type { CreateAxiosOptions } from './axiosTransform'; +import axios from 'axios'; +import qs from 'qs'; +import { AxiosCanceler } from './axiosCancel'; +import { isFunction } from '/@/utils/is'; +import { cloneDeep } from 'lodash-es'; +import { ContentTypeEnum } from '/@/enums/httpEnum'; +import { RequestEnum } from '/@/enums/httpEnum'; + +export * from './axiosTransform'; + +/** + * @description: axios module + */ +export class VAxios { + private axiosInstance: AxiosInstance; + private readonly options: CreateAxiosOptions; + + constructor(options: CreateAxiosOptions) { + this.options = options; + this.axiosInstance = axios.create(options); + this.setupInterceptors(); + } + + /** + * @description: Create axios instance + */ + private createAxios(config: CreateAxiosOptions): void { + this.axiosInstance = axios.create(config); + } + + private getTransform() { + const { transform } = this.options; + return transform; + } + + getAxios(): AxiosInstance { + return this.axiosInstance; + } + + /** + * @description: Reconfigure axios + */ + configAxios(config: CreateAxiosOptions) { + if (!this.axiosInstance) { + return; + } + this.createAxios(config); + } + + /** + * @description: Set general header + */ + setHeader(headers: any): void { + if (!this.axiosInstance) { + return; + } + Object.assign(this.axiosInstance.defaults.headers, headers); + } + + /** + * @description: Interceptor configuration 拦截器配置 + */ + private setupInterceptors() { + const transform = this.getTransform(); + if (!transform) { + return; + } + const { + requestInterceptors, + requestInterceptorsCatch, + responseInterceptors, + responseInterceptorsCatch, + } = transform; + + const axiosCanceler = new AxiosCanceler(); + + // Request interceptor configuration processing + this.axiosInstance.interceptors.request.use((config: AxiosRequestConfig) => { + // If cancel repeat request is turned on, then cancel repeat request is prohibited + // @ts-ignore + const { ignoreCancelToken } = config.requestOptions; + const ignoreCancel = + ignoreCancelToken !== undefined + ? ignoreCancelToken + : this.options.requestOptions?.ignoreCancelToken; + + !ignoreCancel && axiosCanceler.addPending(config); + if (requestInterceptors && isFunction(requestInterceptors)) { + config = requestInterceptors(config, this.options); + } + return config; + }, undefined); + + // Request interceptor error capture + requestInterceptorsCatch && + isFunction(requestInterceptorsCatch) && + this.axiosInstance.interceptors.request.use(undefined, requestInterceptorsCatch); + + // Response result interceptor processing + this.axiosInstance.interceptors.response.use((res: AxiosResponse) => { + res && axiosCanceler.removePending(res.config); + if (responseInterceptors && isFunction(responseInterceptors)) { + res = responseInterceptors(res); + } + return res; + }, undefined); + + // Response result interceptor error capture + responseInterceptorsCatch && + isFunction(responseInterceptorsCatch) && + this.axiosInstance.interceptors.response.use(undefined, (error) => { + // @ts-ignore + return responseInterceptorsCatch(this.axiosInstance, error); + }); + } + + /** + * @description: File Upload + */ + uploadFile(config: AxiosRequestConfig, params: UploadFileParams) { + const formData = new window.FormData(); + const customFilename = params.name || 'file'; + + if (params.filename) { + formData.append(customFilename, params.file, params.filename); + } else { + formData.append(customFilename, params.file); + } + + if (params.data) { + Object.keys(params.data).forEach((key) => { + const value = params.data![key]; + if (Array.isArray(value)) { + value.forEach((item) => { + formData.append(`${key}[]`, item); + }); + return; + } + + formData.append(key, params.data![key]); + }); + } + + return this.axiosInstance.request({ + ...config, + method: 'POST', + data: formData, + headers: { + 'Content-type': ContentTypeEnum.FORM_DATA, + // @ts-ignore + ignoreCancelToken: true, + }, + }); + } + + // support form-data + supportFormData(config: AxiosRequestConfig) { + const headers = config.headers || this.options.headers; + const contentType = headers?.['Content-Type'] || headers?.['content-type']; + + if ( + contentType !== ContentTypeEnum.FORM_URLENCODED || + !Reflect.has(config, 'data') || + config.method?.toUpperCase() === RequestEnum.GET + ) { + return config; + } + + return { + ...config, + data: qs.stringify(config.data, { arrayFormat: 'brackets' }), + }; + } + + get(config: AxiosRequestConfig, options?: RequestOptions): Promise { + return this.request({ ...config, method: 'GET' }, options); + } + + post(config: AxiosRequestConfig, options?: RequestOptions): Promise { + return this.request({ ...config, method: 'POST' }, options); + } + + put(config: AxiosRequestConfig, options?: RequestOptions): Promise { + return this.request({ ...config, method: 'PUT' }, options); + } + + delete(config: AxiosRequestConfig, options?: RequestOptions): Promise { + return this.request({ ...config, method: 'DELETE' }, options); + } + + request(config: AxiosRequestConfig, options?: RequestOptions): Promise { + let conf: CreateAxiosOptions = cloneDeep(config); + const transform = this.getTransform(); + + const { requestOptions } = this.options; + + const opt: RequestOptions = Object.assign({}, requestOptions, options); + + const { beforeRequestHook, requestCatchHook, transformResponseHook } = transform || {}; + if (beforeRequestHook && isFunction(beforeRequestHook)) { + conf = beforeRequestHook(conf, opt); + } + conf.requestOptions = opt; + + conf = this.supportFormData(conf); + + return new Promise((resolve, reject) => { + this.axiosInstance + .request>(conf) + .then((res: AxiosResponse) => { + if (transformResponseHook && isFunction(transformResponseHook)) { + try { + const ret = transformResponseHook(res, opt); + resolve(ret); + } catch (e: any) { + reject(e || new Error('request error!')); + } + return; + } + resolve(res as unknown as Promise); + }) + .catch((e: Error | AxiosError) => { + if (requestCatchHook && isFunction(requestCatchHook)) { + reject(requestCatchHook(e, opt)); + return; + } + if (axios.isAxiosError(e)) { + // rewrite error message from axios in here + } + reject(e); + }); + }); + } +} diff --git a/monolithic/frontend/src/utils/http/axios/axiosCancel.ts b/monolithic/frontend/src/utils/http/axios/axiosCancel.ts new file mode 100644 index 0000000..081233e --- /dev/null +++ b/monolithic/frontend/src/utils/http/axios/axiosCancel.ts @@ -0,0 +1,60 @@ +import type { AxiosRequestConfig, Canceler } from 'axios'; +import axios from 'axios'; +import { isFunction } from '/@/utils/is'; + +// Used to store the identification and cancellation function of each request +let pendingMap = new Map(); + +export const getPendingUrl = (config: AxiosRequestConfig) => [config.method, config.url].join('&'); + +export class AxiosCanceler { + /** + * Add request + * @param {Object} config + */ + addPending(config: AxiosRequestConfig) { + this.removePending(config); + const url = getPendingUrl(config); + config.cancelToken = + config.cancelToken || + new axios.CancelToken((cancel) => { + if (!pendingMap.has(url)) { + // If there is no current request in pending, add it + pendingMap.set(url, cancel); + } + }); + } + + /** + * @description: Clear all pending + */ + removeAllPending() { + pendingMap.forEach((cancel) => { + cancel && isFunction(cancel) && cancel(); + }); + pendingMap.clear(); + } + + /** + * Removal request + * @param {Object} config + */ + removePending(config: AxiosRequestConfig) { + const url = getPendingUrl(config); + + if (pendingMap.has(url)) { + // If there is a current request identifier in pending, + // the current request needs to be cancelled and removed + const cancel = pendingMap.get(url); + cancel && cancel(url); + pendingMap.delete(url); + } + } + + /** + * @description: reset + */ + reset(): void { + pendingMap = new Map(); + } +} diff --git a/monolithic/frontend/src/utils/http/axios/axiosRetry.ts b/monolithic/frontend/src/utils/http/axios/axiosRetry.ts new file mode 100644 index 0000000..d081b96 --- /dev/null +++ b/monolithic/frontend/src/utils/http/axios/axiosRetry.ts @@ -0,0 +1,28 @@ +import { AxiosError, AxiosInstance } from 'axios'; +/** + * 请求重试机制 + */ + +export class AxiosRetry { + /** + * 重试 + */ + retry(AxiosInstance: AxiosInstance, error: AxiosError) { + // @ts-ignore + const { config } = error.response; + const { waitTime, count } = config?.requestOptions?.retryRequest; + config.__retryCount = config.__retryCount || 0; + if (config.__retryCount >= count) { + return Promise.reject(error); + } + config.__retryCount += 1; + return this.delay(waitTime).then(() => AxiosInstance(config)); + } + + /** + * 延迟 + */ + private delay(waitTime: number) { + return new Promise((resolve) => setTimeout(resolve, waitTime)); + } +} diff --git a/monolithic/frontend/src/utils/http/axios/axiosTransform.ts b/monolithic/frontend/src/utils/http/axios/axiosTransform.ts new file mode 100644 index 0000000..f65def9 --- /dev/null +++ b/monolithic/frontend/src/utils/http/axios/axiosTransform.ts @@ -0,0 +1,52 @@ +/** + * Data processing class, can be configured according to the project + */ +import type { AxiosRequestConfig, AxiosResponse } from 'axios'; +import type { RequestOptions, Result } from '/#/axios'; + +export interface CreateAxiosOptions extends AxiosRequestConfig { + authenticationScheme?: string; + transform?: AxiosTransform; + requestOptions?: RequestOptions; +} + +export abstract class AxiosTransform { + /** + * @description: Process configuration before request + * @description: Process configuration before request + */ + beforeRequestHook?: (config: AxiosRequestConfig, options: RequestOptions) => AxiosRequestConfig; + + /** + * @description: 处理响应数据 + */ + transformResponseHook?: (res: AxiosResponse, options: RequestOptions) => any; + + /** + * @description: 请求失败处理 + */ + requestCatchHook?: (e: Error, options: RequestOptions) => Promise; + + /** + * @description: 请求之前的拦截器 + */ + requestInterceptors?: ( + config: AxiosRequestConfig, + options: CreateAxiosOptions, + ) => AxiosRequestConfig; + + /** + * @description: 请求之后的拦截器 + */ + responseInterceptors?: (res: AxiosResponse) => AxiosResponse; + + /** + * @description: 请求之前的拦截器错误处理 + */ + requestInterceptorsCatch?: (error: Error) => void; + + /** + * @description: 请求之后的拦截器错误处理 + */ + responseInterceptorsCatch?: (axiosInstance: AxiosResponse, error: Error) => void; +} diff --git a/monolithic/frontend/src/utils/http/axios/checkStatus.ts b/monolithic/frontend/src/utils/http/axios/checkStatus.ts new file mode 100644 index 0000000..ad9d77c --- /dev/null +++ b/monolithic/frontend/src/utils/http/axios/checkStatus.ts @@ -0,0 +1,100 @@ +import type { ErrorMessageMode } from '/#/axios'; +import { useMessage } from '/@/hooks/web/useMessage'; +import { useI18n } from '/@/hooks/web/useI18n'; +// import router from '/@/router'; +// import { PageEnum } from '/@/enums/pageEnum'; +import { useUserStoreWithOut } from '/@/store/modules/user'; +import projectSetting from '/@/settings/projectSetting'; +import { SessionTimeoutProcessingEnum } from '/@/enums/appEnum'; + +const { createMessage, createErrorModal } = useMessage(); +const error = createMessage.error!; +const stp = projectSetting.sessionTimeoutProcessing; + +export function checkStatus( + status: number, + reason: string, + msg: string, + mode: ErrorMessageMode = 'message', +): void { + const { t } = useI18n(); + const userStore = useUserStoreWithOut(); + + let jumpToLogin = false; + let errMessage = reason == '' ? msg : reason; + if (errMessage === '') { + switch (status) { + case 400: + errMessage = `${msg}`; + break; + + case 401: + // 401: Not logged in + // 跳转到登陆页面 + jumpToLogin = true; + errMessage = msg || t('sys.api.UNAUTHORIZED'); + break; + + case 403: + errMessage = t('sys.api.ACCESS_FORBIDDEN'); + break; + + // 请求不存在 + case 404: + errMessage = t('sys.api.RESOURCE_NOT_FOUND'); + break; + + case 405: + errMessage = t('sys.api.METHOD_NOT_ALLOWED'); + break; + + case 408: + errMessage = t('sys.api.REQUEST_TIMEOUT'); + break; + + case 500: + errMessage = t('sys.api.INTERNAL_SERVER_ERROR'); + break; + + case 501: + errMessage = t('sys.api.NOT_IMPLEMENTED'); + break; + + case 502: + errMessage = t('sys.api.NETWORK_ERROR'); + break; + + case 503: + errMessage = t('sys.api.SERVICE_UNAVAILABLE'); + break; + + case 504: + errMessage = t('sys.api.NETWORK_TIMEOUT'); + break; + + case 505: + errMessage = t('sys.api.REQUEST_NOT_SUPPORT'); + break; + default: + } + } + + if (jumpToLogin) { + userStore.setToken(undefined); + if (stp === SessionTimeoutProcessingEnum.PAGE_COVERAGE) { + userStore.setSessionTimeout(true); + } else { + userStore.logout().then(); + } + } + + // console.log('checkStatus', status, errMessage, mode); + + if (errMessage) { + if (mode === 'modal') { + createErrorModal({ title: t('sys.api.errorTip'), content: errMessage }); + } else if (mode === 'message') { + error(errMessage); + } + } +} diff --git a/monolithic/frontend/src/utils/http/axios/helper.ts b/monolithic/frontend/src/utils/http/axios/helper.ts new file mode 100644 index 0000000..5849e52 --- /dev/null +++ b/monolithic/frontend/src/utils/http/axios/helper.ts @@ -0,0 +1,48 @@ +import { isObject, isString } from '/@/utils/is'; + +const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss'; + +export function joinTimestamp( + join: boolean, + restful: T, +): T extends true ? string : object; + +export function joinTimestamp(join: boolean, restful = false): string | object { + if (!join) { + return restful ? '' : {}; + } + const now = new Date().getTime(); + if (restful) { + return `?_t=${now}`; + } + return { _t: now }; +} + +/** + * @description: Format request parameter time + */ +export function formatRequestDate(params: Recordable) { + if (Object.prototype.toString.call(params) !== '[object Object]') { + return; + } + + for (const key in params) { + const format = params[key]?.format ?? null; + if (format && typeof format === 'function') { + params[key] = params[key].format(DATE_TIME_FORMAT); + } + if (isString(key)) { + const value = params[key]; + if (value) { + try { + params[key] = isString(value) ? value.trim() : value; + } catch (e: any) { + throw new Error(e); + } + } + } + if (isObject(params[key])) { + formatRequestDate(params[key]); + } + } +} diff --git a/monolithic/frontend/src/utils/http/axios/index.ts b/monolithic/frontend/src/utils/http/axios/index.ts new file mode 100644 index 0000000..ff99ed1 --- /dev/null +++ b/monolithic/frontend/src/utils/http/axios/index.ts @@ -0,0 +1,278 @@ +// axios配置 可自行根据项目进行更改,只需更改该文件即可,其他文件可以不动 +// The axios configuration can be changed according to the project, just change the file, other files can be left unchanged + +import type { AxiosResponse } from 'axios'; +import { clone } from 'lodash-es'; +import type { RequestOptions, Result } from '/#/axios'; +import type { AxiosTransform, CreateAxiosOptions } from './axiosTransform'; +import { VAxios } from './Axios'; +import { checkStatus } from './checkStatus'; +import { useGlobSetting } from '/@/hooks/setting'; +import { useMessage } from '/@/hooks/web/useMessage'; +import { RequestEnum, ContentTypeEnum } from '/@/enums/httpEnum'; +import { isString } from '/@/utils/is'; +import { getToken } from '/@/utils/auth'; +import { setObjToUrlParams, deepMerge } from '/@/utils'; +import { useErrorLogStoreWithOut } from '/@/store/modules/errorLog'; +import { useI18n } from '/@/hooks/web/useI18n'; +import { joinTimestamp, formatRequestDate } from './helper'; +import { useUserStoreWithOut } from '/@/store/modules/user'; +import { AxiosRetry } from '/@/utils/http/axios/axiosRetry'; + +const globSetting = useGlobSetting(); +const urlPrefix = globSetting.urlPrefix; +const { createMessage, createErrorModal } = useMessage(); + +/** + * @description: 数据处理,方便区分多种处理方式 + */ +const transform: AxiosTransform = { + /** + * @description: 处理响应数据。如果数据不是预期格式,可直接抛出错误 + */ + transformResponseHook: (res: AxiosResponse, options: RequestOptions) => { + const { t } = useI18n(); + const { isTransformResponse, isReturnNativeResponse } = options; + // 是否返回原生响应头 比如:需要获取响应头时使用该属性 + if (isReturnNativeResponse) { + return res; + } + // 不进行任何处理,直接返回 + // 用于页面代码可能需要直接获取code,data,message这些信息时开启 + if (!isTransformResponse) { + return res.data; + } + // 错误的时候返回 + + const { status = 200, data } = res; + if (!data) { + // return '[HTTP] Request has no return value'; + throw new Error(t('sys.api.apiRequestFailed')); + } + + if (data && status == 200) { + return data; + } + + // 这里 code,result,message为 后台统一的字段,需要在 types.ts内修改为项目自己的接口返回格式 + const { code = 0, message } = data; + + // 在此处根据自己项目的实际情况对不同的code执行不同的操作 + // 如果不希望中断当前请求,请return数据,否则直接抛出异常即可 + let timeoutMsg = ''; + switch (code) { + case 401: + timeoutMsg = t('sys.api.timeoutMessage'); + const userStore = useUserStoreWithOut(); + userStore.setToken(undefined); + userStore.logout(true).then(); + break; + + default: + if (message) { + timeoutMsg = message; + } + } + + // errorMessageMode=‘modal’的时候会显示modal错误弹窗,而不是消息提示,用于一些比较重要的错误 + // errorMessageMode='none' 一般是调用时明确表示不希望自动弹出错误提示 + if (options.errorMessageMode === 'modal') { + createErrorModal({ + title: t('sys.api.errorTip'), + content: timeoutMsg, + }); + } else if (options.errorMessageMode === 'message') { + createMessage.error(timeoutMsg); + } + + throw new Error(timeoutMsg || t('sys.api.apiRequestFailed')); + }, + + // 请求之前处理config + beforeRequestHook: (config, options) => { + const { apiUrl, joinPrefix, joinParamsToUrl, formatDate, joinTime = true, urlPrefix } = options; + + if (joinPrefix) { + config.url = `${urlPrefix}${config.url}`; + } + + if (apiUrl && isString(apiUrl)) { + config.url = `${apiUrl}${config.url}`; + } + const params = config.params || {}; + const data = config.data || false; + formatDate && data && !isString(data) && formatRequestDate(data); + if (config.method?.toUpperCase() === RequestEnum.GET) { + if (!isString(params)) { + // 给 get 请求加上时间戳参数,避免从缓存中拿数据。 + config.params = Object.assign(params || {}, joinTimestamp(joinTime, false)); + } else { + // 兼容restful风格 + config.url = config.url + params + `${joinTimestamp(joinTime, true)}`; + config.params = undefined; + } + } else { + if (!isString(params)) { + formatDate && formatRequestDate(params); + if ( + Reflect.has(config, 'data') && + config.data && + (Object.keys(config.data).length > 0 || config.data instanceof FormData) + ) { + config.data = data; + config.params = params; + } else { + // 非GET请求如果没有提供data,则将params视为data + config.data = params; + config.params = undefined; + } + if (joinParamsToUrl) { + config.url = setObjToUrlParams( + config.url as string, + Object.assign({}, config.params, config.data), + ); + } + } else { + // 兼容restful风格 + config.url = config.url + params; + config.params = undefined; + } + } + return config; + }, + + /** + * @description: 请求拦截器处理 + */ + requestInterceptors: (config, options) => { + // 请求之前处理config + const token = getToken(); + if (token && (config as Recordable)?.requestOptions?.withToken !== false) { + // jwt token + (config as Recordable).headers.Authorization = options.authenticationScheme + ? `${options.authenticationScheme} ${token}` + : token; + } + return config; + }, + + /** + * @description: 响应拦截器处理 + */ + responseInterceptors: (res: AxiosResponse) => { + return res; + }, + + /** + * @description: 响应错误处理 + */ + responseInterceptorsCatch: (axiosInstance: AxiosResponse, error: any) => { + const { t } = useI18n(); + + const errorLogStore = useErrorLogStoreWithOut(); + errorLogStore.addAjaxErrorInfo(error); + + const { response, code, message, config } = error || {}; + const errorMessageMode = config?.requestOptions?.errorMessageMode || 'none'; + // const statusCode: number = response?.data?.code ?? 0; + const msg: string = response?.data?.message ?? ''; + const reason: string = response?.data?.reason ?? ''; + const err: string = error?.toString?.() ?? ''; + let errMessage = ''; + + try { + if (code === 'ECONNABORTED' && message.indexOf('timeout') !== -1) { + errMessage = t('sys.api.apiTimeoutMessage'); + } + if (err?.includes('Network Error')) { + errMessage = t('sys.api.networkExceptionMsg'); + } + + if (errMessage) { + if (errorMessageMode === 'modal') { + createErrorModal({ title: t('sys.api.errorTip'), content: errMessage }); + } else if (errorMessageMode === 'message') { + createMessage.error(errMessage); + } + return Promise.reject(error); + } + } catch (e: any) { + throw new Error(error as unknown as string); + } + + checkStatus(error?.response?.status, reason, msg, errorMessageMode); + + // 添加自动重试机制 保险起见 只针对GET请求 + const retryRequest = new AxiosRetry(); + const { isOpenRetry } = config.requestOptions.retryRequest; + config.method?.toUpperCase() === RequestEnum.GET && + isOpenRetry && + // @ts-ignore + retryRequest.retry(axiosInstance, error); + return Promise.reject(error); + }, +}; + +function createAxios(opt?: Partial) { + return new VAxios( + // 深度合并 + deepMerge( + { + // See https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication#authentication_schemes + // authentication schemes,e.g: Bearer + // authenticationScheme: 'Bearer', + authenticationScheme: 'Bearer', + timeout: 10 * 1000, + // 基础接口地址 + // baseURL: globSetting.apiUrl, + + headers: { 'Content-Type': ContentTypeEnum.JSON }, + // 如果是form-data格式 + // headers: { 'Content-Type': ContentTypeEnum.FORM_URLENCODED }, + // 数据处理方式 + transform: clone(transform), + // 配置项,下面的选项都可以在独立的接口请求中覆盖 + requestOptions: { + // 默认将prefix 添加到url + joinPrefix: true, + // 是否返回原生响应头 比如:需要获取响应头时使用该属性 + isReturnNativeResponse: false, + // 需要对返回数据进行处理 + isTransformResponse: true, + // post请求的时候添加参数到url + joinParamsToUrl: false, + // 格式化提交参数时间 + formatDate: true, + // 消息提示类型 + errorMessageMode: 'message', + // 接口地址 + apiUrl: globSetting.apiUrl, + // 接口拼接地址 + urlPrefix: urlPrefix, + // 是否加入时间戳 + joinTime: true, + // 忽略重复请求 + ignoreCancelToken: true, + // 是否携带token + withToken: true, + retryRequest: { + isOpenRetry: true, + count: 5, + waitTime: 100, + }, + }, + }, + opt || {}, + ), + ); +} + +export const defHttp = createAxios(); + +// other api url +// export const otherHttp = createAxios({ +// requestOptions: { +// apiUrl: 'xxx', +// urlPrefix: 'xxx', +// }, +// }); diff --git a/monolithic/frontend/src/utils/index.ts b/monolithic/frontend/src/utils/index.ts new file mode 100644 index 0000000..78022c6 --- /dev/null +++ b/monolithic/frontend/src/utils/index.ts @@ -0,0 +1,92 @@ +import type { RouteLocationNormalized, RouteRecordNormalized } from 'vue-router'; +import type { App, Plugin } from 'vue'; + +import { unref } from 'vue'; +import { isObject } from '/@/utils/is'; + +export const noop = () => {}; + +/** + * @description: Set ui mount node + */ +export function getPopupContainer(node?: HTMLElement): HTMLElement { + return (node?.parentNode as HTMLElement) ?? document.body; +} + +/** + * Add the object as a parameter to the URL + * @param baseUrl url + * @param obj + * @returns {string} + * eg: + * let obj = {a: '3', b: '4'} + * setObjToUrlParams('www.baidu.com', obj) + * ==>www.baidu.com?a=3&b=4 + */ +export function setObjToUrlParams(baseUrl: string, obj: any): string { + let parameters = ''; + for (const key in obj) { + parameters += key + '=' + encodeURIComponent(obj[key]) + '&'; + } + parameters = parameters.replace(/&$/, ''); + return /\?$/.test(baseUrl) ? baseUrl + parameters : baseUrl.replace(/\/?$/, '?') + parameters; +} + +// 深度合并 +export function deepMerge(src: any = {}, target: any = {}): T { + let key: string; + for (key in target) { + src[key] = isObject(src[key]) ? deepMerge(src[key], target[key]) : (src[key] = target[key]); + } + return src; +} + +export function openWindow( + url: string, + opt?: { target?: TargetContext | string; noopener?: boolean; noreferrer?: boolean }, +) { + const { target = '__blank', noopener = true, noreferrer = true } = opt || {}; + const feature: string[] = []; + + noopener && feature.push('noopener=yes'); + noreferrer && feature.push('noreferrer=yes'); + + window.open(url, target, feature.join(',')); +} + +// dynamic use hook props +export function getDynamicProps(props: T): Partial { + const ret: Recordable = {}; + + Object.keys(props).map((key) => { + ret[key] = unref((props as Recordable)[key]); + }); + + return ret as Partial; +} + +export function getRawRoute(route: RouteLocationNormalized): RouteLocationNormalized { + if (!route) return route; + const { matched, ...opt } = route; + return { + ...opt, + matched: (matched + ? matched.map((item) => ({ + meta: item.meta, + name: item.name, + path: item.path, + })) + : undefined) as RouteRecordNormalized[], + }; +} + +export const withInstall = (component: T, alias?: string) => { + const comp = component as any; + comp.install = (app: App) => { + app.component(comp.name || comp.displayName, component); + if (alias) { + app.config.globalProperties[alias] = component; + } + }; + return component as T & Plugin; +}; diff --git a/monolithic/frontend/src/utils/is.ts b/monolithic/frontend/src/utils/is.ts new file mode 100644 index 0000000..0252aa0 --- /dev/null +++ b/monolithic/frontend/src/utils/is.ts @@ -0,0 +1,99 @@ +const toString = Object.prototype.toString; + +export function is(val: unknown, type: string) { + return toString.call(val) === `[object ${type}]`; +} + +export function isDef(val?: T): val is T { + return typeof val !== 'undefined'; +} + +export function isUnDef(val?: T): val is T { + return !isDef(val); +} + +export function isObject(val: any): val is Record { + return val !== null && is(val, 'Object'); +} + +export function isEmpty(val: T): val is T { + if (isArray(val) || isString(val)) { + return val.length === 0; + } + + if (val instanceof Map || val instanceof Set) { + return val.size === 0; + } + + if (isObject(val)) { + return Object.keys(val).length === 0; + } + + return false; +} + +export function isDate(val: unknown): val is Date { + return is(val, 'Date'); +} + +export function isNull(val: unknown): val is null { + return val === null; +} + +export function isNullAndUnDef(val: unknown): val is null | undefined { + return isUnDef(val) && isNull(val); +} + +export function isNullOrUnDef(val: unknown): val is null | undefined { + return isUnDef(val) || isNull(val); +} + +export function isNumber(val: unknown): val is number { + return is(val, 'Number'); +} + +export function isPromise(val: unknown): val is Promise { + return is(val, 'Promise') && isObject(val) && isFunction(val.then) && isFunction(val.catch); +} + +export function isString(val: unknown): val is string { + return is(val, 'String'); +} + +export function isFunction(val: unknown): val is Function { + return typeof val === 'function'; +} + +export function isBoolean(val: unknown): val is boolean { + return is(val, 'Boolean'); +} + +export function isRegExp(val: unknown): val is RegExp { + return is(val, 'RegExp'); +} + +export function isArray(val: any): val is Array { + return val && Array.isArray(val); +} + +export function isWindow(val: any): val is Window { + return typeof window !== 'undefined' && is(val, 'Window'); +} + +export function isElement(val: unknown): val is Element { + return isObject(val) && !!val.tagName; +} + +export function isMap(val: unknown): val is Map { + return is(val, 'Map'); +} + +export const isServer = typeof window === 'undefined'; + +export const isClient = !isServer; + +export function isUrl(path: string): boolean { + const reg = + /^(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?(\/#\/)?(?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/; + return reg.test(path); +} diff --git a/monolithic/frontend/src/utils/lib/echarts.ts b/monolithic/frontend/src/utils/lib/echarts.ts new file mode 100644 index 0000000..e1f95cd --- /dev/null +++ b/monolithic/frontend/src/utils/lib/echarts.ts @@ -0,0 +1,57 @@ +import * as echarts from 'echarts/core'; + +import { + BarChart, + LineChart, + PieChart, + MapChart, + PictorialBarChart, + RadarChart, + ScatterChart, +} from 'echarts/charts'; + +import { + TitleComponent, + TooltipComponent, + GridComponent, + PolarComponent, + AriaComponent, + ParallelComponent, + LegendComponent, + RadarComponent, + ToolboxComponent, + DataZoomComponent, + VisualMapComponent, + TimelineComponent, + CalendarComponent, + GraphicComponent, +} from 'echarts/components'; + +import { SVGRenderer } from 'echarts/renderers'; + +echarts.use([ + LegendComponent, + TitleComponent, + TooltipComponent, + GridComponent, + PolarComponent, + AriaComponent, + ParallelComponent, + BarChart, + LineChart, + PieChart, + MapChart, + RadarChart, + SVGRenderer, + PictorialBarChart, + RadarComponent, + ToolboxComponent, + DataZoomComponent, + VisualMapComponent, + TimelineComponent, + CalendarComponent, + GraphicComponent, + ScatterChart, +]); + +export default echarts; diff --git a/monolithic/frontend/src/utils/log.ts b/monolithic/frontend/src/utils/log.ts new file mode 100644 index 0000000..8f79800 --- /dev/null +++ b/monolithic/frontend/src/utils/log.ts @@ -0,0 +1,9 @@ +const projectName = import.meta.env.VITE_GLOB_APP_TITLE; + +export function warn(message: string) { + console.warn(`[${projectName} warn]:${message}`); +} + +export function error(message: string) { + throw new Error(`[${projectName} error]:${message}`); +} diff --git a/monolithic/frontend/src/utils/mitt.ts b/monolithic/frontend/src/utils/mitt.ts new file mode 100644 index 0000000..4b15bba --- /dev/null +++ b/monolithic/frontend/src/utils/mitt.ts @@ -0,0 +1,101 @@ +/** + * copy to https://github.com/developit/mitt + * Expand clear method + */ + +export type EventType = string | symbol; + +// An event handler can take an optional event argument +// and should not return a value +export type Handler = (event?: T) => void; +export type WildcardHandler = (type: EventType, event?: any) => void; + +// An array of all currently registered event handlers for a type +export type EventHandlerList = Array; +export type WildCardEventHandlerList = Array; + +// A map of event types and their corresponding event handlers. +export type EventHandlerMap = Map; + +export interface Emitter { + all: EventHandlerMap; + + on(type: EventType, handler: Handler): void; + on(type: '*', handler: WildcardHandler): void; + + off(type: EventType, handler: Handler): void; + off(type: '*', handler: WildcardHandler): void; + + emit(type: EventType, event?: T): void; + emit(type: '*', event?: any): void; + clear(): void; +} + +/** + * Mitt: Tiny (~200b) functional event emitter / pubsub. + * @name mitt + * @returns {Mitt} + */ +export default function mitt(all?: EventHandlerMap): Emitter { + all = all || new Map(); + + return { + /** + * A Map of event names to registered handler functions. + */ + all, + + /** + * Register an event handler for the given type. + * @param {string|symbol} type Type of event to listen for, or `"*"` for all events + * @param {Function} handler Function to call in response to given event + * @memberOf mitt + */ + on(type: EventType, handler: Handler) { + const handlers = all?.get(type); + const added = handlers && handlers.push(handler); + if (!added) { + all?.set(type, [handler]); + } + }, + + /** + * Remove an event handler for the given type. + * @param {string|symbol} type Type of event to unregister `handler` from, or `"*"` + * @param {Function} handler Handler function to remove + * @memberOf mitt + */ + off(type: EventType, handler: Handler) { + const handlers = all?.get(type); + if (handlers) { + handlers.splice(handlers.indexOf(handler) >>> 0, 1); + } + }, + + /** + * Invoke all handlers for the given type. + * If present, `"*"` handlers are invoked after type-matched handlers. + * + * Note: Manually firing "*" handlers is not supported. + * + * @param {string|symbol} type The event type to invoke + * @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler + * @memberOf mitt + */ + emit(type: EventType, evt: T) { + ((all?.get(type) || []) as EventHandlerList).slice().map((handler) => { + handler(evt); + }); + ((all?.get('*') || []) as WildCardEventHandlerList).slice().map((handler) => { + handler(type, evt); + }); + }, + + /** + * Clear all + */ + clear() { + this.all.clear(); + }, + }; +} diff --git a/monolithic/frontend/src/utils/openapi-axios/index.ts b/monolithic/frontend/src/utils/openapi-axios/index.ts new file mode 100644 index 0000000..5fa5a68 --- /dev/null +++ b/monolithic/frontend/src/utils/openapi-axios/index.ts @@ -0,0 +1,245 @@ +import type { + ErrorResponse, + FilterKeys, + HasRequiredKeys, + HttpMethod, + MediaType, + OperationRequestBodyContent, + PathsWithMethod, + ResponseObjectMap, + SuccessResponse, +} from "openapi-typescript-helpers"; +import {defHttp} from "/@/utils/http/axios"; +import type {RequestOptions as AxiosRequestOptions} from '/#/axios'; + + +export interface DefaultParamsOption { + params?: { + query?: Record + }; +} + +export type ParamsOption = T extends { + parameters: any + } + ? HasRequiredKeys extends never + ? { + params?: T["parameters"] + } + : { + params: T["parameters"] + } + : DefaultParamsOption; +// v7 breaking change: TODO uncomment for openapi-typescript@7 support +// : never; + +export type RequestBodyOption = OperationRequestBodyContent extends never + ? { + data?: never + } + : undefined extends OperationRequestBodyContent + ? { + data?: OperationRequestBodyContent + } + : { + data: OperationRequestBodyContent + }; + +export type FetchSuccessResponse = FilterKeys>, MediaType>; +export type FetchErrorResponse = FilterKeys>, MediaType>; + +export type FetchResponse = + | { + data: FilterKeys>, MediaType>; + error?: never; + response: Response; +} + | { + data?: never; + error: FilterKeys>, MediaType>; + response: Response; +}; + +export type RequestOptions = ParamsOption & RequestBodyOption; + +export type FetchOptions = RequestOptions & Omit; + + +export default function createClient() { + + async function coreFetch

( + url: P, + fetchOptions: FetchOptions, + options?: AxiosRequestOptions + ) + : Promise> { + + const { + method, + data: requestBody, + params = {}, + } = fetchOptions || {}; + + // console.log('mode', JSON.stringify(params), JSON.stringify(requestBody), JSON.stringify(options)) + + return await defHttp.request( + {url: url as string, data: requestBody, params: params, method: method}, + options + ) + } + + type GetPaths = PathsWithMethod; + type PutPaths = PathsWithMethod; + type PostPaths = PathsWithMethod; + type DeletePaths = PathsWithMethod; + type OptionsPaths = PathsWithMethod; + type HeadPaths = PathsWithMethod; + type PatchPaths = PathsWithMethod; + type TracePaths = PathsWithMethod; + + type GetFetchOptions

= FetchOptions< + FilterKeys + >; + type PutFetchOptions

= FetchOptions< + FilterKeys + >; + type PostFetchOptions

= FetchOptions< + FilterKeys + >; + type DeleteFetchOptions

= FetchOptions< + FilterKeys + >; + type OptionsFetchOptions

= FetchOptions< + FilterKeys + >; + type HeadFetchOptions

= FetchOptions< + FilterKeys + >; + type PatchFetchOptions

= FetchOptions< + FilterKeys + >; + type TraceFetchOptions

= FetchOptions< + FilterKeys + >; + + return { + /** Call a GET endpoint */ + async GET

( + url: P, + options?: AxiosRequestOptions, + ...init: HasRequiredKeys> extends never + ? [GetFetchOptions

?] + : [GetFetchOptions

] + ) { + return coreFetch( + url, + {...init[0], method: "GET"} as any, + options + ); + }, + /** Call a PUT endpoint */ + async PUT

( + url: P, + options?: AxiosRequestOptions, + ...init: HasRequiredKeys> extends never + ? [PutFetchOptions

?] + : [PutFetchOptions

] + ) { + return coreFetch( + url, + {...init[0], method: "PUT"} as any, + options + ); + }, + /** Call a POST endpoint */ + async POST

( + url: P, + options?: AxiosRequestOptions, + ...init: HasRequiredKeys> extends never + ? [PostFetchOptions

?] + : [PostFetchOptions

] + ) { + return coreFetch( + url, + {...init[0], method: "POST"} as any, + options + ); + }, + /** Call a DELETE endpoint */ + async DELETE

( + url: P, + options?: AxiosRequestOptions, + ...init: HasRequiredKeys> extends never + ? [DeleteFetchOptions

?] + : [DeleteFetchOptions

] + ) { + return coreFetch( + url, + { + ...init[0], + method: "DELETE", + } as any, + options + ); + }, + /** Call a OPTIONS endpoint */ + async OPTIONS

( + url: P, + options?: AxiosRequestOptions, + ...init: HasRequiredKeys> extends never + ? [OptionsFetchOptions

?] + : [OptionsFetchOptions

] + ) { + return coreFetch( + url, + { + ...init[0], + method: "OPTIONS", + } as any, + options + ); + }, + /** Call a HEAD endpoint */ + async HEAD

( + url: P, + options?: AxiosRequestOptions, + ...init: HasRequiredKeys> extends never + ? [HeadFetchOptions

?] + : [HeadFetchOptions

] + ) { + return coreFetch( + url, + {...init[0], method: "HEAD"} as any, + options + ); + }, + /** Call a PATCH endpoint */ + async PATCH

( + url: P, + options?: AxiosRequestOptions, + ...init: HasRequiredKeys> extends never + ? [PatchFetchOptions

?] + : [PatchFetchOptions

] + ) { + return coreFetch( + url, + {...init[0], method: "PATCH"} as any, + options + ); + }, + /** Call a TRACE endpoint */ + async TRACE

( + url: P, + options?: AxiosRequestOptions, + ...init: HasRequiredKeys> extends never + ? [TraceFetchOptions

?] + : [TraceFetchOptions

] + ) { + return coreFetch( + url, + {...init[0], method: "TRACE"} as any, + options + ); + }, + }; +} diff --git a/monolithic/frontend/src/utils/propTypes.ts b/monolithic/frontend/src/utils/propTypes.ts new file mode 100644 index 0000000..a5b0a47 --- /dev/null +++ b/monolithic/frontend/src/utils/propTypes.ts @@ -0,0 +1,34 @@ +import { CSSProperties, VNodeChild } from 'vue'; +import { createTypes, VueTypeValidableDef, VueTypesInterface } from 'vue-types'; + +export type VueNode = VNodeChild | JSX.Element; + +type PropTypes = VueTypesInterface & { + readonly style: VueTypeValidableDef; + readonly VNodeChild: VueTypeValidableDef; + // readonly trueBool: VueTypeValidableDef; +}; + +const propTypes = createTypes({ + func: undefined, + bool: undefined, + string: undefined, + number: undefined, + object: undefined, + integer: undefined, +}) as PropTypes; + +propTypes.extend([ + { + name: 'style', + getter: true, + type: [String, Object], + default: undefined, + }, + { + name: 'VNodeChild', + getter: true, + type: undefined, + }, +]); +export { propTypes }; diff --git a/monolithic/frontend/src/utils/props.ts b/monolithic/frontend/src/utils/props.ts new file mode 100644 index 0000000..729c9ef --- /dev/null +++ b/monolithic/frontend/src/utils/props.ts @@ -0,0 +1,185 @@ +// copy from element-plus + +import { warn } from 'vue'; +import { isObject } from '@vue/shared'; +import { fromPairs } from 'lodash-es'; +import type { ExtractPropTypes, PropType } from '@vue/runtime-core'; +import type { Mutable } from './types'; + +const wrapperKey = Symbol(); +export type PropWrapper = { [wrapperKey]: T }; + +export const propKey = Symbol(); + +type ResolveProp = ExtractPropTypes<{ + key: { type: T; required: true }; +}>['key']; +type ResolvePropType = ResolveProp extends { type: infer V } ? V : ResolveProp; +type ResolvePropTypeWithReadonly = Readonly extends Readonly> + ? ResolvePropType + : ResolvePropType; + +type IfUnknown = [unknown] extends [T] ? V : T; + +export type BuildPropOption, R, V, C> = { + type?: T; + values?: readonly V[]; + required?: R; + default?: R extends true + ? never + : D extends Record | Array + ? () => D + : (() => D) | D; + validator?: ((val: any) => val is C) | ((val: any) => boolean); +}; + +type _BuildPropType = + | (T extends PropWrapper + ? T[typeof wrapperKey] + : [V] extends [never] + ? ResolvePropTypeWithReadonly + : never) + | V + | C; +export type BuildPropType = _BuildPropType< + IfUnknown, + IfUnknown, + IfUnknown +>; + +type _BuildPropDefault = [T] extends [ + // eslint-disable-next-line @typescript-eslint/ban-types + Record | Array | Function, +] + ? D + : D extends () => T + ? ReturnType + : D; + +export type BuildPropDefault = R extends true + ? { readonly default?: undefined } + : { + readonly default: Exclude extends never + ? undefined + : Exclude<_BuildPropDefault, undefined>; + }; +export type BuildPropReturn = { + readonly type: PropType>; + readonly required: IfUnknown; + readonly validator: ((val: unknown) => boolean) | undefined; + [propKey]: true; +} & BuildPropDefault, IfUnknown, IfUnknown>; + +/** + * @description Build prop. It can better optimize prop types + * @description 生成 prop,能更好地优化类型 + * @example + // limited options + // the type will be PropType<'light' | 'dark'> + buildProp({ + type: String, + values: ['light', 'dark'], + } as const) + * @example + // limited options and other types + // the type will be PropType<'small' | 'medium' | number> + buildProp({ + type: [String, Number], + values: ['small', 'medium'], + validator: (val: unknown): val is number => typeof val === 'number', + } as const) + @link see more: https://github.com/element-plus/element-plus/pull/3341 + */ +export function buildProp< + T = never, + D extends BuildPropType = never, + R extends boolean = false, + V = never, + C = never, +>(option: BuildPropOption, key?: string): BuildPropReturn { + // filter native prop type and nested prop, e.g `null`, `undefined` (from `buildProps`) + if (!isObject(option) || !!option[propKey]) return option as any; + + const { values, required, default: defaultValue, type, validator } = option; + + const _validator = + values || validator + ? (val: unknown) => { + let valid = false; + let allowedValues: unknown[] = []; + + if (values) { + allowedValues = [...values, defaultValue]; + valid ||= allowedValues.includes(val); + } + if (validator) valid ||= validator(val); + + if (!valid && allowedValues.length > 0) { + const allowValuesText = [...new Set(allowedValues)] + .map((value) => JSON.stringify(value)) + .join(', '); + warn( + `Invalid prop: validation failed${ + key ? ` for prop "${key}"` : '' + }. Expected one of [${allowValuesText}], got value ${JSON.stringify(val)}.`, + ); + } + return valid; + } + : undefined; + + return { + type: + typeof type === 'object' && Object.getOwnPropertySymbols(type).includes(wrapperKey) + ? type[wrapperKey] + : type, + required: !!required, + default: defaultValue, + validator: _validator, + [propKey]: true, + } as unknown as BuildPropReturn; +} + +type NativePropType = [((...args: any) => any) | { new (...args: any): any } | undefined | null]; + +export const buildProps = < + O extends { + [K in keyof O]: O[K] extends BuildPropReturn + ? O[K] + : [O[K]] extends NativePropType + ? O[K] + : O[K] extends BuildPropOption + ? D extends BuildPropType + ? BuildPropOption + : never + : never; + }, +>( + props: O, +) => + fromPairs( + Object.entries(props).map(([key, option]) => [key, buildProp(option as any, key)]), + ) as unknown as { + [K in keyof O]: O[K] extends { [propKey]: boolean } + ? O[K] + : [O[K]] extends NativePropType + ? O[K] + : O[K] extends BuildPropOption< + infer T, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + infer _D, + infer R, + infer V, + infer C + > + ? BuildPropReturn + : never; + }; + +export const definePropType = (val: any) => ({ [wrapperKey]: val } as PropWrapper); + +export const keyOf = (arr: T) => Object.keys(arr) as Array; +export const mutable = >(val: T) => + val as Mutable; + +export const componentSize = ['large', 'medium', 'small', 'mini'] as const; diff --git a/monolithic/frontend/src/utils/types.ts b/monolithic/frontend/src/utils/types.ts new file mode 100644 index 0000000..4453ec4 --- /dev/null +++ b/monolithic/frontend/src/utils/types.ts @@ -0,0 +1,42 @@ +// copy from element-plus + +import type { CSSProperties, Plugin } from 'vue'; + +type OptionalKeys> = { + [K in keyof T]: T extends Record ? never : K; +}[keyof T]; + +type RequiredKeys> = Exclude>; + +type MonoArgEmitter = (evt: K, arg?: T[K]) => void; + +type BiArgEmitter = (evt: K, arg: T[K]) => void; + +export type EventEmitter> = MonoArgEmitter> & + BiArgEmitter>; + +export type AnyFunction = (...args: any[]) => T; + +export type PartialReturnType unknown> = Partial>; + +export type SFCWithInstall = T & Plugin; + +export type Nullable = T | null; + +export type RefElement = Nullable; + +export type CustomizedHTMLElement = HTMLElement & T; + +export type Indexable = { + [key: string]: T; +}; + +export type Hash = Indexable; + +export type TimeoutHandle = ReturnType; + +export type ComponentSize = 'large' | 'medium' | 'small' | 'mini'; + +export type StyleValue = string | CSSProperties | Array; + +export type Mutable = { -readonly [P in keyof T]: T[P] }; diff --git a/monolithic/frontend/src/utils/uuid.ts b/monolithic/frontend/src/utils/uuid.ts new file mode 100644 index 0000000..548bcf3 --- /dev/null +++ b/monolithic/frontend/src/utils/uuid.ts @@ -0,0 +1,28 @@ +const hexList: string[] = []; +for (let i = 0; i <= 15; i++) { + hexList[i] = i.toString(16); +} + +export function buildUUID(): string { + let uuid = ''; + for (let i = 1; i <= 36; i++) { + if (i === 9 || i === 14 || i === 19 || i === 24) { + uuid += '-'; + } else if (i === 15) { + uuid += 4; + } else if (i === 20) { + uuid += hexList[(Math.random() * 4) | 8]; + } else { + uuid += hexList[(Math.random() * 16) | 0]; + } + } + return uuid.replace(/-/g, ''); +} + +let unique = 0; +export function buildShortUUID(prefix = ''): string { + const time = Date.now(); + const random = Math.floor(Math.random() * 1000000000); + unique++; + return prefix + '_' + random + unique + String(time); +} diff --git a/monolithic/frontend/src/views/app/system/account/AccountBind.vue b/monolithic/frontend/src/views/app/system/account/AccountBind.vue new file mode 100644 index 0000000..0ec092a --- /dev/null +++ b/monolithic/frontend/src/views/app/system/account/AccountBind.vue @@ -0,0 +1,59 @@ + + + diff --git a/monolithic/frontend/src/views/app/system/account/BaseSetting.vue b/monolithic/frontend/src/views/app/system/account/BaseSetting.vue new file mode 100644 index 0000000..640267b --- /dev/null +++ b/monolithic/frontend/src/views/app/system/account/BaseSetting.vue @@ -0,0 +1,92 @@ + + + + + diff --git a/monolithic/frontend/src/views/app/system/account/MsgNotify.vue b/monolithic/frontend/src/views/app/system/account/MsgNotify.vue new file mode 100644 index 0000000..82705ae --- /dev/null +++ b/monolithic/frontend/src/views/app/system/account/MsgNotify.vue @@ -0,0 +1,55 @@ + + + + + diff --git a/monolithic/frontend/src/views/app/system/account/SecureSetting.vue b/monolithic/frontend/src/views/app/system/account/SecureSetting.vue new file mode 100644 index 0000000..704a809 --- /dev/null +++ b/monolithic/frontend/src/views/app/system/account/SecureSetting.vue @@ -0,0 +1,49 @@ + + + + + diff --git a/monolithic/frontend/src/views/app/system/account/data.tsx b/monolithic/frontend/src/views/app/system/account/data.tsx new file mode 100644 index 0000000..a37ca65 --- /dev/null +++ b/monolithic/frontend/src/views/app/system/account/data.tsx @@ -0,0 +1,149 @@ +import { FormSchema } from '/@/components/Form/index'; + +export interface ListItem { + key: string; + title: string; + description: string; + extra?: string; + avatar?: string; + color?: string; +} + +// tab的list +export const settingList = [ + { + key: '1', + name: '基本设置', + component: 'BaseSetting', + }, + { + key: '2', + name: '安全设置', + component: 'SecureSetting', + }, + { + key: '3', + name: '账号绑定', + component: 'AccountBind', + }, + { + key: '4', + name: '新消息通知', + component: 'MsgNotify', + }, +]; + +// 基础设置 form +export const baseSetschemas: FormSchema[] = [ + { + field: 'email', + component: 'Input', + label: '邮箱', + colProps: { span: 18 }, + }, + { + field: 'name', + component: 'Input', + label: '昵称', + colProps: { span: 18 }, + }, + { + field: 'introduction', + component: 'InputTextArea', + label: '个人简介', + colProps: { span: 18 }, + }, + { + field: 'phone', + component: 'Input', + label: '联系电话', + colProps: { span: 18 }, + }, + { + field: 'address', + component: 'Input', + label: '所在地区', + colProps: { span: 18 }, + }, +]; + +// 安全设置 list +export const secureSettingList: ListItem[] = [ + { + key: '1', + title: '账户密码', + description: '当前密码强度::强', + extra: '修改', + }, + { + key: '2', + title: '密保手机', + description: '已绑定手机::138****8293', + extra: '修改', + }, + { + key: '3', + title: '密保问题', + description: '未设置密保问题,密保问题可有效保护账户安全', + extra: '修改', + }, + { + key: '4', + title: '备用邮箱', + description: '已绑定邮箱::ant***sign.com', + extra: '修改', + }, + { + key: '5', + title: 'MFA 设备', + description: '未绑定 MFA 设备,绑定后,可以进行二次确认', + extra: '修改', + }, +]; + +// 账号绑定 list +export const accountBindList: ListItem[] = [ + { + key: '1', + title: '绑定淘宝', + description: '当前未绑定淘宝账号', + extra: '绑定', + avatar: 'ri:taobao-fill', + color: '#ff4000', + }, + { + key: '2', + title: '绑定支付宝', + description: '当前未绑定支付宝账号', + extra: '绑定', + avatar: 'fa-brands:alipay', + color: '#2eabff', + }, + { + key: '3', + title: '绑定钉钉', + description: '当前未绑定钉钉账号', + extra: '绑定', + avatar: 'ri:dingding-fill', + color: '#2eabff', + }, +]; + +// 新消息通知 list +export const msgNotifyList: ListItem[] = [ + { + key: '1', + title: '账户密码', + description: '其他用户的消息将以站内信的形式通知', + }, + { + key: '2', + title: '系统消息', + description: '系统消息将以站内信的形式通知', + }, + { + key: '3', + title: '待办任务', + description: '待办任务将以站内信的形式通知', + }, +]; diff --git a/monolithic/frontend/src/views/app/system/account/index.vue b/monolithic/frontend/src/views/app/system/account/index.vue new file mode 100644 index 0000000..dd9b774 --- /dev/null +++ b/monolithic/frontend/src/views/app/system/account/index.vue @@ -0,0 +1,61 @@ + + + + diff --git a/monolithic/frontend/src/views/app/system/menu/index.vue b/monolithic/frontend/src/views/app/system/menu/index.vue new file mode 100644 index 0000000..31a8ccb --- /dev/null +++ b/monolithic/frontend/src/views/app/system/menu/index.vue @@ -0,0 +1,106 @@ + + + diff --git a/monolithic/frontend/src/views/app/system/menu/menu-drawer.vue b/monolithic/frontend/src/views/app/system/menu/menu-drawer.vue new file mode 100644 index 0000000..ec31ad9 --- /dev/null +++ b/monolithic/frontend/src/views/app/system/menu/menu-drawer.vue @@ -0,0 +1,76 @@ + + + diff --git a/monolithic/frontend/src/views/app/system/menu/menu.data.tsx b/monolithic/frontend/src/views/app/system/menu/menu.data.tsx new file mode 100644 index 0000000..e598668 --- /dev/null +++ b/monolithic/frontend/src/views/app/system/menu/menu.data.tsx @@ -0,0 +1,210 @@ +import {h} from 'vue'; +import {Tag} from 'ant-design-vue'; +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import {Icon} from '/@/components/Icon'; +import {SwitchStatusEnum, isOn, isDir, isMenu, isButton, MenuTypeEnum} from '/@/enums/httpEnum'; +import {useI18n} from '/@/hooks/web/useI18n'; +import {Menu} from "/@/api/app"; + +const {t} = useI18n(); + +export const columns: BasicColumn[] = [ + { + title: '菜单名称', + dataIndex: 'title', + width: 200, + align: 'left', + customRender: ({record, text}) => { + const {icon} = record as Menu; + const title = t(text); + return icon === '' || icon === undefined + ? h('div', null, h('span', {style: {marginRight: '15px'}}, title)) + : h('div', null, [ + h(Icon, {icon: icon}), + h('span', {style: {marginRight: '15px'}}, title), + ]); + }, + }, + { + title: '排序', + dataIndex: 'orderNo', + width: 50, + }, + { + title: '权限标识', + dataIndex: 'permissionCode', + width: 180, + }, + { + title: '路由地址', + dataIndex: 'path', + }, + { + title: '组件路径', + dataIndex: 'component', + }, + + { + title: '状态', + dataIndex: 'status', + width: 80, + customRender: ({record}) => { + const {status} = record as Menu; + const enable = isOn(status); + const color = enable ? '#108ee9' : '#FF0000'; + const text = enable ? '启用' : '停用'; + return h(Tag, {color: color}, () => text); + }, + }, + { + title: '更新时间', + dataIndex: 'updateTime', + width: 180, + }, +]; + +export const searchFormSchema: FormSchema[] = [ + { + field: 'name', + label: '菜单名称', + component: 'Input', + colProps: {span: 8}, + }, + { + field: 'status', + label: '状态', + component: 'Select', + componentProps: { + options: [ + {label: '启用', value: SwitchStatusEnum.ON}, + {label: '停用', value: SwitchStatusEnum.OFF}, + ], + }, + colProps: {span: 8}, + }, +]; + +export const formSchema: FormSchema[] = [ + { + field: 'type', + label: '菜单类型', + component: 'RadioButtonGroup', + defaultValue: MenuTypeEnum.FOLDER, + componentProps: { + options: [ + {label: '目录', value: MenuTypeEnum.FOLDER}, + {label: '菜单', value: MenuTypeEnum.MENU}, + {label: '按钮', value: MenuTypeEnum.BUTTON}, + ], + }, + colProps: {lg: 24, md: 24}, + }, + { + field: 'name', + label: '菜单名称', + component: 'Input', + required: true, + }, + + { + field: 'parentId', + label: '上级菜单', + component: 'TreeSelect', + componentProps: { + fieldNames: { + label: 'name', + key: 'id', + value: 'id', + }, + getPopupContainer: () => document.body, + }, + }, + + { + field: 'orderNo', + label: '排序', + component: 'InputNumber', + required: true, + }, + { + field: 'icon', + label: '图标', + component: 'IconPicker', + required: true, + ifShow: ({values}) => !isButton(values?.type), + }, + + { + field: 'path', + label: '路由地址', + component: 'Input', + required: true, + ifShow: ({values}) => !isButton(values?.type), + }, + { + field: 'component', + label: '组件路径', + component: 'Input', + ifShow: ({values}) => isMenu(values?.type), + }, + { + field: 'permissionCode', + label: '权限标识', + component: 'Input', + ifShow: ({values}) => !isDir(values?.type), + }, + { + field: 'status', + label: '状态', + component: 'RadioButtonGroup', + defaultValue: SwitchStatusEnum.OFF, + componentProps: { + options: [ + {label: '启用', value: SwitchStatusEnum.ON}, + {label: '禁用', value: SwitchStatusEnum.OFF}, + ], + }, + }, + { + field: 'isExt', + label: '是否外链', + component: 'RadioButtonGroup', + defaultValue: false, + componentProps: { + options: [ + {label: '是', value: true}, + {label: '否', value: false}, + ], + }, + ifShow: ({values}) => !isButton(values?.type), + }, + + { + field: 'keepAlive', + label: '是否缓存', + component: 'RadioButtonGroup', + defaultValue: false, + componentProps: { + options: [ + {label: '是', value: true}, + {label: '否', value: false}, + ], + }, + ifShow: ({values}) => isMenu(values?.type), + }, + + { + field: 'show', + label: '是否显示', + component: 'RadioButtonGroup', + defaultValue: false, + componentProps: { + options: [ + {label: '是', value: true}, + {label: '否', value: false}, + ], + }, + ifShow: ({values}) => !isButton(values?.type), + }, +]; diff --git a/monolithic/frontend/src/views/app/system/org/index.vue b/monolithic/frontend/src/views/app/system/org/index.vue new file mode 100644 index 0000000..85bf5e4 --- /dev/null +++ b/monolithic/frontend/src/views/app/system/org/index.vue @@ -0,0 +1,93 @@ + + + diff --git a/monolithic/frontend/src/views/app/system/org/org-modal.vue b/monolithic/frontend/src/views/app/system/org/org-modal.vue new file mode 100644 index 0000000..5ff4a90 --- /dev/null +++ b/monolithic/frontend/src/views/app/system/org/org-modal.vue @@ -0,0 +1,71 @@ + + + diff --git a/monolithic/frontend/src/views/app/system/org/org.data.tsx b/monolithic/frontend/src/views/app/system/org/org.data.tsx new file mode 100644 index 0000000..87a093d --- /dev/null +++ b/monolithic/frontend/src/views/app/system/org/org.data.tsx @@ -0,0 +1,110 @@ +import {h} from 'vue'; +import {Tag} from 'ant-design-vue'; +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import {isOn, SwitchStatusEnum} from '/@/enums/httpEnum'; +import {Organization} from "/@/api/app"; + +export const columns: BasicColumn[] = [ + { + title: '部门名称', + dataIndex: 'name', + width: 160, + align: 'left', + }, + { + title: '排序', + dataIndex: 'orderNo', + width: 50, + }, + { + title: '状态', + dataIndex: 'status', + width: 80, + customRender: ({record}) => { + const {status} = record as Organization; + const enable = isOn(status); + const color = enable ? '#108ee9' : '#FF0000'; + const text = enable ? '启用' : '停用'; + return h(Tag, {color: color}, () => text); + }, + }, + { + title: '创建时间', + dataIndex: 'createTime', + width: 180, + }, + { + title: '备注', + dataIndex: 'remark', + }, +]; + +export const searchFormSchema: FormSchema[] = [ + { + field: 'name', + label: '部门名称', + component: 'Input', + colProps: {span: 8}, + }, + { + field: 'status', + label: '状态', + component: 'Select', + componentProps: { + options: [ + {label: '启用', value: SwitchStatusEnum.ON}, + {label: '停用', value: SwitchStatusEnum.OFF}, + ], + }, + colProps: {span: 8}, + }, +]; + +export const formSchema: FormSchema[] = [ + { + field: 'name', + label: '部门名称', + component: 'Input', + required: true, + }, + { + field: 'parentId', + label: '上级部门', + component: 'TreeSelect', + + componentProps: { + fieldNames: { + label: 'name', + key: 'id', + value: 'id', + }, + getPopupContainer: () => document.body, + }, + required: false, + }, + { + field: 'orderNo', + label: '排序', + component: 'InputNumber', + required: true, + }, + { + field: 'status', + label: '状态', + component: 'RadioButtonGroup', + defaultValue: SwitchStatusEnum.OFF, + componentProps: { + options: [ + {label: '启用', value: SwitchStatusEnum.ON}, + {label: '停用', value: SwitchStatusEnum.OFF}, + ], + }, + required: true, + }, + { + label: '备注', + field: 'remark', + component: 'InputTextArea', + }, +]; diff --git a/monolithic/frontend/src/views/app/system/position/index.vue b/monolithic/frontend/src/views/app/system/position/index.vue new file mode 100644 index 0000000..597132a --- /dev/null +++ b/monolithic/frontend/src/views/app/system/position/index.vue @@ -0,0 +1,104 @@ + + + diff --git a/monolithic/frontend/src/views/app/system/position/position-drawer.vue b/monolithic/frontend/src/views/app/system/position/position-drawer.vue new file mode 100644 index 0000000..60137ea --- /dev/null +++ b/monolithic/frontend/src/views/app/system/position/position-drawer.vue @@ -0,0 +1,89 @@ + + + diff --git a/monolithic/frontend/src/views/app/system/position/position.data.tsx b/monolithic/frontend/src/views/app/system/position/position.data.tsx new file mode 100644 index 0000000..22c2c3f --- /dev/null +++ b/monolithic/frontend/src/views/app/system/position/position.data.tsx @@ -0,0 +1,112 @@ +import {h} from 'vue'; +import {Switch} from 'ant-design-vue'; +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import {useMessage} from '/@/hooks/web/useMessage'; +import {SwitchStatusEnum} from '/@/enums/httpEnum'; +import {UpdatePosition} from '/@/api/app/position'; +import {Position} from "/@/api/app"; + +export const columns: BasicColumn[] = [ + { + title: '排序', + dataIndex: 'orderNo', + width: 50, + }, + { + title: '职位名称', + dataIndex: 'name', + width: 200, + }, + { + title: '备注', + dataIndex: 'remark', + }, + { + title: '状态', + dataIndex: 'status', + width: 120, + customRender: ({record}) => { + const rd = record as Position; + + if (!Reflect.has(rd, 'pendingStatus')) { + rd['pendingStatus'] = false; + } + return h(Switch, { + checked: rd.status === SwitchStatusEnum.ON, + checkedChildren: '已启用', + unCheckedChildren: '已禁用', + loading: rd['pendingStatus'], + onChange(checked: boolean) { + rd['pendingStatus'] = true; + const newStatus: any = checked ? SwitchStatusEnum.ON : SwitchStatusEnum.OFF; + const {createMessage} = useMessage(); + UpdatePosition({id: rd.id, position: {status: newStatus}}) + .then(async () => { + rd.status = newStatus; + await createMessage.success(`已成功修改职位状态`); + }) + .catch(async () => { + await createMessage.error('修改职位状态失败'); + }) + .finally(() => { + rd['pendingStatus'] = false; + }); + }, + }); + }, + }, +]; + +export const searchFormSchema: FormSchema[] = [ + { + field: 'name', + label: '职位名称', + component: 'Input', + colProps: {span: 8}, + }, + { + field: 'status', + label: '状态', + component: 'Select', + componentProps: { + options: [ + {label: '启用', value: SwitchStatusEnum.ON}, + {label: '停用', value: SwitchStatusEnum.OFF}, + ], + }, + colProps: {span: 8}, + }, +]; + +export const formSchema: FormSchema[] = [ + { + field: 'name', + label: '职位名称', + required: true, + component: 'Input', + }, + { + field: 'status', + label: '状态', + component: 'RadioButtonGroup', + defaultValue: SwitchStatusEnum.OFF, + componentProps: { + options: [ + {label: '启用', value: SwitchStatusEnum.ON}, + {label: '停用', value: SwitchStatusEnum.OFF}, + ], + }, + }, + { + label: '备注', + field: 'remark', + component: 'InputTextArea', + }, + { + label: ' ', + field: 'menu', + slot: 'menu', + component: 'Input', + }, +]; diff --git a/monolithic/frontend/src/views/app/system/role/index.vue b/monolithic/frontend/src/views/app/system/role/index.vue new file mode 100644 index 0000000..62b665e --- /dev/null +++ b/monolithic/frontend/src/views/app/system/role/index.vue @@ -0,0 +1,104 @@ + + + diff --git a/monolithic/frontend/src/views/app/system/role/role-drawer.vue b/monolithic/frontend/src/views/app/system/role/role-drawer.vue new file mode 100644 index 0000000..503e735 --- /dev/null +++ b/monolithic/frontend/src/views/app/system/role/role-drawer.vue @@ -0,0 +1,90 @@ + + + diff --git a/monolithic/frontend/src/views/app/system/role/role.data.tsx b/monolithic/frontend/src/views/app/system/role/role.data.tsx new file mode 100644 index 0000000..1bcea48 --- /dev/null +++ b/monolithic/frontend/src/views/app/system/role/role.data.tsx @@ -0,0 +1,123 @@ +import {h} from 'vue'; +import {Switch} from 'ant-design-vue'; +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import {useMessage} from '/@/hooks/web/useMessage'; +import {SwitchStatusEnum} from '/@/enums/httpEnum'; +import {Role} from "/@/api/app"; +import {UpdateRole} from "/@/api/app/role"; + +export const columns: BasicColumn[] = [ + { + title: '排序', + dataIndex: 'orderNo', + width: 50, + }, + { + title: '角色名称', + dataIndex: 'name', + width: 200, + }, + { + title: '角色标识', + dataIndex: 'code', + width: 180, + }, + { + title: '备注', + dataIndex: 'remark', + }, + { + title: '状态', + dataIndex: 'status', + width: 120, + customRender: ({record}) => { + const rd = record as Role; + + if (!Reflect.has(rd, 'pendingStatus')) { + rd['pendingStatus'] = false; + } + return h(Switch, { + checked: rd.status === SwitchStatusEnum.ON, + checkedChildren: '已启用', + unCheckedChildren: '已禁用', + loading: rd['pendingStatus'], + onChange(checked: boolean) { + rd['pendingStatus'] = true; + const newStatus: any = checked ? SwitchStatusEnum.ON : SwitchStatusEnum.OFF; + const {createMessage} = useMessage(); + UpdateRole({id: rd.id, role: {status: newStatus}}) + .then(async () => { + rd.status = newStatus; + await createMessage.success(`已成功修改角色状态`); + }) + .catch(async () => { + await createMessage.error('修改角色状态失败'); + }) + .finally(() => { + rd['pendingStatus'] = false; + }); + }, + }); + }, + }, +]; + +export const searchFormSchema: FormSchema[] = [ + { + field: 'name', + label: '角色名称', + component: 'Input', + colProps: {span: 8}, + }, + { + field: 'status', + label: '状态', + component: 'Select', + componentProps: { + options: [ + {label: '启用', value: SwitchStatusEnum.ON}, + {label: '停用', value: SwitchStatusEnum.OFF}, + ], + }, + colProps: {span: 8}, + }, +]; + +export const formSchema: FormSchema[] = [ + { + field: 'name', + label: '角色名称', + required: true, + component: 'Input', + }, + { + field: 'code', + label: '角色标识', + required: true, + component: 'Input', + }, + { + field: 'status', + label: '状态', + component: 'RadioButtonGroup', + defaultValue: SwitchStatusEnum.OFF, + componentProps: { + options: [ + {label: '启用', value: SwitchStatusEnum.ON}, + {label: '停用', value: SwitchStatusEnum.OFF}, + ], + }, + }, + { + label: '备注', + field: 'remark', + component: 'InputTextArea', + }, + { + label: ' ', + field: 'menu', + slot: 'menu', + component: 'Input', + }, +]; diff --git a/monolithic/frontend/src/views/app/system/users/detail/index.vue b/monolithic/frontend/src/views/app/system/users/detail/index.vue new file mode 100644 index 0000000..64f3204 --- /dev/null +++ b/monolithic/frontend/src/views/app/system/users/detail/index.vue @@ -0,0 +1,64 @@ + + + + + diff --git a/monolithic/frontend/src/views/app/system/users/index.vue b/monolithic/frontend/src/views/app/system/users/index.vue new file mode 100644 index 0000000..948cbe2 --- /dev/null +++ b/monolithic/frontend/src/views/app/system/users/index.vue @@ -0,0 +1,120 @@ + + + diff --git a/monolithic/frontend/src/views/app/system/users/org-tree.vue b/monolithic/frontend/src/views/app/system/users/org-tree.vue new file mode 100644 index 0000000..f763e61 --- /dev/null +++ b/monolithic/frontend/src/views/app/system/users/org-tree.vue @@ -0,0 +1,35 @@ + + + diff --git a/monolithic/frontend/src/views/app/system/users/user-modal.vue b/monolithic/frontend/src/views/app/system/users/user-modal.vue new file mode 100644 index 0000000..683b496 --- /dev/null +++ b/monolithic/frontend/src/views/app/system/users/user-modal.vue @@ -0,0 +1,79 @@ + + + diff --git a/monolithic/frontend/src/views/app/system/users/users.data.tsx b/monolithic/frontend/src/views/app/system/users/users.data.tsx new file mode 100644 index 0000000..2984e22 --- /dev/null +++ b/monolithic/frontend/src/views/app/system/users/users.data.tsx @@ -0,0 +1,158 @@ +import {h} from 'vue'; +import {Switch} from 'ant-design-vue'; +import {BasicColumn, FormSchema} from '/@/components/Table'; +import {SwitchStatusEnum} from '/@/enums/httpEnum'; +import {useMessage} from '/@/hooks/web/useMessage'; +import {UpdateUser} from '/@/api/app/user'; +import {User} from "/@/api/app"; + +export const columns: BasicColumn[] = [ + { + title: '用户名', + dataIndex: 'userName', + width: 180, + }, + { + title: '姓名', + dataIndex: 'realName', + width: 180, + }, + { + title: '邮箱', + dataIndex: 'email', + width: 200, + }, + { + title: '手机', + dataIndex: 'phone', + width: 120, + }, + { + title: '状态', + dataIndex: 'status', + width: 80, + customRender: ({record}) => { + const rd = record as User; + + if (!Reflect.has(rd, 'pendingStatus')) { + rd['pendingStatus'] = false; + } + return h(Switch, { + checked: rd.status === SwitchStatusEnum.ON, + loading: rd['pendingStatus'], + onChange(checked: boolean) { + rd['pendingStatus'] = true; + const newStatus: any = checked ? SwitchStatusEnum.ON : SwitchStatusEnum.OFF; + const {createMessage} = useMessage(); + UpdateUser({id: rd.id, status: newStatus}) + .then(async () => { + rd.status = newStatus; + await createMessage.success(`已成功修改用户状态`); + }) + .catch(async () => { + await createMessage.error('修改用户状态失败'); + }) + .finally(() => { + rd['pendingStatus'] = false; + }); + }, + }); + }, + }, + { + title: '创建时间', + dataIndex: 'createTime', + width: 180, + }, +]; + +export const searchFormSchema: FormSchema[] = [ + { + field: 'realName', + label: '姓名', + component: 'Input', + colProps: { + span: 8, + }, + }, + { + field: 'phone', + label: '手机', + component: 'Input', + colProps: { + span: 8, + }, + }, +]; + +export const createUserFormSchema: FormSchema[] = [ + { + field: 'userName', + label: '用户名', + component: 'Input', + rules: [ + { + required: true, + message: '请输入用户名', + }, + ], + }, + { + field: 'password', + label: '密码', + component: 'InputPassword', + required: true, + ifShow: true, + }, + { + field: 'realName', + label: '名字', + component: 'Input', + required: true, + }, + { + label: '邮箱', + field: 'email', + component: 'Input', + required: true, + }, + { + label: '手机', + field: 'phone', + component: 'Input', + required: true, + }, + { + field: 'orgId', + label: '所属部门', + component: 'TreeSelect', + componentProps: { + fieldNames: { + label: 'name', + key: 'id', + value: 'id', + }, + getPopupContainer: () => document.body, + }, + required: false, + }, + { + field: 'positionId', + label: '所在岗位', + component: 'TreeSelect', + componentProps: { + fieldNames: { + label: 'name', + key: 'id', + value: 'id', + }, + getPopupContainer: () => document.body, + }, + required: false, + }, + { + label: '备注', + field: 'remark', + component: 'InputTextArea', + }, +]; diff --git a/monolithic/frontend/src/views/dashboard/analysis/components/GrowCard.vue b/monolithic/frontend/src/views/dashboard/analysis/components/GrowCard.vue new file mode 100644 index 0000000..5f660b9 --- /dev/null +++ b/monolithic/frontend/src/views/dashboard/analysis/components/GrowCard.vue @@ -0,0 +1,40 @@ + + + diff --git a/monolithic/frontend/src/views/dashboard/analysis/components/SalesProductPie.vue b/monolithic/frontend/src/views/dashboard/analysis/components/SalesProductPie.vue new file mode 100644 index 0000000..c6e7cf8 --- /dev/null +++ b/monolithic/frontend/src/views/dashboard/analysis/components/SalesProductPie.vue @@ -0,0 +1,64 @@ + + diff --git a/monolithic/frontend/src/views/dashboard/analysis/components/SiteAnalysis.vue b/monolithic/frontend/src/views/dashboard/analysis/components/SiteAnalysis.vue new file mode 100644 index 0000000..17d7d39 --- /dev/null +++ b/monolithic/frontend/src/views/dashboard/analysis/components/SiteAnalysis.vue @@ -0,0 +1,38 @@ + + diff --git a/monolithic/frontend/src/views/dashboard/analysis/components/VisitAnalysis.vue b/monolithic/frontend/src/views/dashboard/analysis/components/VisitAnalysis.vue new file mode 100644 index 0000000..2f4f7a5 --- /dev/null +++ b/monolithic/frontend/src/views/dashboard/analysis/components/VisitAnalysis.vue @@ -0,0 +1,89 @@ + + + diff --git a/monolithic/frontend/src/views/dashboard/analysis/components/VisitAnalysisBar.vue b/monolithic/frontend/src/views/dashboard/analysis/components/VisitAnalysisBar.vue new file mode 100644 index 0000000..8bd6597 --- /dev/null +++ b/monolithic/frontend/src/views/dashboard/analysis/components/VisitAnalysisBar.vue @@ -0,0 +1,47 @@ + + + diff --git a/monolithic/frontend/src/views/dashboard/analysis/components/VisitRadar.vue b/monolithic/frontend/src/views/dashboard/analysis/components/VisitRadar.vue new file mode 100644 index 0000000..f73f01e --- /dev/null +++ b/monolithic/frontend/src/views/dashboard/analysis/components/VisitRadar.vue @@ -0,0 +1,94 @@ + + diff --git a/monolithic/frontend/src/views/dashboard/analysis/components/VisitSource.vue b/monolithic/frontend/src/views/dashboard/analysis/components/VisitSource.vue new file mode 100644 index 0000000..918f8ca --- /dev/null +++ b/monolithic/frontend/src/views/dashboard/analysis/components/VisitSource.vue @@ -0,0 +1,81 @@ + + diff --git a/monolithic/frontend/src/views/dashboard/analysis/components/props.ts b/monolithic/frontend/src/views/dashboard/analysis/components/props.ts new file mode 100644 index 0000000..8643650 --- /dev/null +++ b/monolithic/frontend/src/views/dashboard/analysis/components/props.ts @@ -0,0 +1,16 @@ +import { PropType } from 'vue'; + +export interface BasicProps { + width: string; + height: string; +} +export const basicProps = { + width: { + type: String as PropType, + default: '100%', + }, + height: { + type: String as PropType, + default: '280px', + }, +}; diff --git a/monolithic/frontend/src/views/dashboard/analysis/data.tsx b/monolithic/frontend/src/views/dashboard/analysis/data.tsx new file mode 100644 index 0000000..ee37231 --- /dev/null +++ b/monolithic/frontend/src/views/dashboard/analysis/data.tsx @@ -0,0 +1,43 @@ +export interface GrowCardItem { + icon: string; + title: string; + value: number; + total: number; + color: string; + action: string; +} + +export const growCardList: GrowCardItem[] = [ + { + title: '文章数', + icon: 'post-count|svg', + value: 2000, + total: 120000, + color: 'green', + action: '周', + }, + { + title: '评论数', + icon: 'comment-count|svg', + value: 20000, + total: 500000, + color: 'blue', + action: '周', + }, + { + title: '阅读量', + icon: 'reading-count|svg', + value: 8000, + total: 120000, + color: 'orange', + action: '周', + }, + { + title: '访问数', + icon: 'visit-count|svg', + value: 5000, + total: 50000, + color: 'purple', + action: '月', + }, +]; diff --git a/monolithic/frontend/src/views/dashboard/analysis/index.vue b/monolithic/frontend/src/views/dashboard/analysis/index.vue new file mode 100644 index 0000000..55cf2ab --- /dev/null +++ b/monolithic/frontend/src/views/dashboard/analysis/index.vue @@ -0,0 +1,18 @@ + + + diff --git a/monolithic/frontend/src/views/dashboard/workbench/components/DynamicInfo.vue b/monolithic/frontend/src/views/dashboard/workbench/components/DynamicInfo.vue new file mode 100644 index 0000000..b2eeecb --- /dev/null +++ b/monolithic/frontend/src/views/dashboard/workbench/components/DynamicInfo.vue @@ -0,0 +1,31 @@ + + diff --git a/monolithic/frontend/src/views/dashboard/workbench/components/ProjectCard.vue b/monolithic/frontend/src/views/dashboard/workbench/components/ProjectCard.vue new file mode 100644 index 0000000..0c4990b --- /dev/null +++ b/monolithic/frontend/src/views/dashboard/workbench/components/ProjectCard.vue @@ -0,0 +1,32 @@ + + diff --git a/monolithic/frontend/src/views/dashboard/workbench/components/QuickNav.vue b/monolithic/frontend/src/views/dashboard/workbench/components/QuickNav.vue new file mode 100644 index 0000000..e129772 --- /dev/null +++ b/monolithic/frontend/src/views/dashboard/workbench/components/QuickNav.vue @@ -0,0 +1,17 @@ + + diff --git a/monolithic/frontend/src/views/dashboard/workbench/components/SaleRadar.vue b/monolithic/frontend/src/views/dashboard/workbench/components/SaleRadar.vue new file mode 100644 index 0000000..3d176f2 --- /dev/null +++ b/monolithic/frontend/src/views/dashboard/workbench/components/SaleRadar.vue @@ -0,0 +1,94 @@ + + diff --git a/monolithic/frontend/src/views/dashboard/workbench/components/WorkbenchHeader.vue b/monolithic/frontend/src/views/dashboard/workbench/components/WorkbenchHeader.vue new file mode 100644 index 0000000..64da08e --- /dev/null +++ b/monolithic/frontend/src/views/dashboard/workbench/components/WorkbenchHeader.vue @@ -0,0 +1,20 @@ + + + diff --git a/monolithic/frontend/src/views/dashboard/workbench/components/data.ts b/monolithic/frontend/src/views/dashboard/workbench/components/data.ts new file mode 100644 index 0000000..c7172c3 --- /dev/null +++ b/monolithic/frontend/src/views/dashboard/workbench/components/data.ts @@ -0,0 +1,156 @@ +interface GroupItem { + title: string; + icon: string; + color: string; + desc: string; + date: string; + group: string; +} + +interface NavItem { + title: string; + icon: string; + color: string; +} + +interface DynamicInfoItem { + avatar: string; + name: string; + date: string; + desc: string; +} + +export const navItems: NavItem[] = [ + { + title: '首页', + icon: 'ion:home-outline', + color: '#1fdaca', + }, + { + title: '仪表盘', + icon: 'ion:grid-outline', + color: '#bf0c2c', + }, + { + title: '组件', + icon: 'ion:layers-outline', + color: '#e18525', + }, + { + title: '系统管理', + icon: 'ion:settings-outline', + color: '#3fb27f', + }, + { + title: '权限管理', + icon: 'ion:key-outline', + color: '#4daf1bc9', + }, + { + title: '图表', + icon: 'ion:bar-chart-outline', + color: '#00d8ff', + }, +]; + +export const dynamicInfoItems: DynamicInfoItem[] = [ + { + avatar: 'dynamic-avatar-1|svg', + name: '威廉', + date: '刚刚', + desc: `在 开源组 创建了项目 Vue`, + }, + { + avatar: 'dynamic-avatar-2|svg', + name: '艾文', + date: '1个小时前', + desc: `关注了 威廉 `, + }, + { + avatar: 'dynamic-avatar-3|svg', + name: '克里斯', + date: '1天前', + desc: `发布了 个人动态 `, + }, + { + avatar: 'dynamic-avatar-4|svg', + name: 'Vben', + date: '2天前', + desc: `发表文章 如何编写一个Vite插件 `, + }, + { + avatar: 'dynamic-avatar-5|svg', + name: '皮特', + date: '3天前', + desc: `回复了 杰克 的问题 如何进行项目优化?`, + }, + { + avatar: 'dynamic-avatar-6|svg', + name: '杰克', + date: '1周前', + desc: `关闭了问题 如何运行项目 `, + }, + { + avatar: 'dynamic-avatar-1|svg', + name: '威廉', + date: '1周前', + desc: `发布了 个人动态 `, + }, + { + avatar: 'dynamic-avatar-1|svg', + name: '威廉', + date: '2021-04-01 20:00', + desc: `推送了代码到 Github`, + }, +]; + +export const groupItems: GroupItem[] = [ + { + title: 'Github', + icon: 'carbon:logo-github', + color: '', + desc: '不要等待机会,而要创造机会。', + group: '开源组', + date: '2021-04-01', + }, + { + title: 'Vue', + icon: 'ion:logo-vue', + color: '#3fb27f', + desc: '现在的你决定将来的你。', + group: '算法组', + date: '2021-04-01', + }, + { + title: 'Html5', + icon: 'ion:logo-html5', + color: '#e18525', + desc: '没有什么才能比努力更重要。', + group: '上班摸鱼', + date: '2021-04-01', + }, + { + title: 'Angular', + icon: 'ion:logo-angular', + color: '#bf0c2c', + desc: '热情和欲望可以突破一切难关。', + group: 'UI', + date: '2021-04-01', + }, + { + title: 'React', + icon: 'bx:bxl-react', + color: '#00d8ff', + desc: '健康的身体是实目标的基石。', + group: '技术牛', + date: '2021-04-01', + }, + { + title: 'Js', + icon: 'ion:logo-javascript', + color: '#4daf1bc9', + desc: '路是走出来的,而不是空想出来的。', + group: '架构组', + date: '2021-04-01', + }, +]; diff --git a/monolithic/frontend/src/views/dashboard/workbench/index.vue b/monolithic/frontend/src/views/dashboard/workbench/index.vue new file mode 100644 index 0000000..78b1d3b --- /dev/null +++ b/monolithic/frontend/src/views/dashboard/workbench/index.vue @@ -0,0 +1,37 @@ + + + diff --git a/monolithic/frontend/src/views/sys/error-log/DetailModal.vue b/monolithic/frontend/src/views/sys/error-log/DetailModal.vue new file mode 100644 index 0000000..2047707 --- /dev/null +++ b/monolithic/frontend/src/views/sys/error-log/DetailModal.vue @@ -0,0 +1,27 @@ + + diff --git a/monolithic/frontend/src/views/sys/error-log/data.tsx b/monolithic/frontend/src/views/sys/error-log/data.tsx new file mode 100644 index 0000000..3ffc2f4 --- /dev/null +++ b/monolithic/frontend/src/views/sys/error-log/data.tsx @@ -0,0 +1,67 @@ +import { Tag } from 'ant-design-vue'; +import { BasicColumn } from '/@/components/Table/index'; +import { ErrorTypeEnum } from '/@/enums/exceptionEnum'; +import { useI18n } from '/@/hooks/web/useI18n'; + +const { t } = useI18n(); + +export function getColumns(): BasicColumn[] { + return [ + { + dataIndex: 'type', + title: t('sys.errorLog.tableColumnType'), + width: 80, + customRender: ({ text }) => { + const color = + text === ErrorTypeEnum.VUE + ? 'green' + : text === ErrorTypeEnum.RESOURCE + ? 'cyan' + : text === ErrorTypeEnum.PROMISE + ? 'blue' + : ErrorTypeEnum.AJAX + ? 'red' + : 'purple'; + return {() => text}; + }, + }, + { + dataIndex: 'url', + title: 'URL', + width: 200, + }, + { + dataIndex: 'time', + title: t('sys.errorLog.tableColumnDate'), + width: 160, + }, + { + dataIndex: 'file', + title: t('sys.errorLog.tableColumnFile'), + width: 200, + }, + { + dataIndex: 'name', + title: 'Name', + width: 200, + }, + { + dataIndex: 'message', + title: t('sys.errorLog.tableColumnMsg'), + width: 300, + }, + { + dataIndex: 'stack', + title: t('sys.errorLog.tableColumnStackMsg'), + }, + ]; +} + +export function getDescSchema(): any { + return getColumns().map((column) => { + return { + field: column.dataIndex!, + label: column.title, + }; + }); +} diff --git a/monolithic/frontend/src/views/sys/error-log/index.vue b/monolithic/frontend/src/views/sys/error-log/index.vue new file mode 100644 index 0000000..4552181 --- /dev/null +++ b/monolithic/frontend/src/views/sys/error-log/index.vue @@ -0,0 +1,94 @@ + + + diff --git a/monolithic/frontend/src/views/sys/exception/Exception.vue b/monolithic/frontend/src/views/sys/exception/Exception.vue new file mode 100644 index 0000000..6e56f08 --- /dev/null +++ b/monolithic/frontend/src/views/sys/exception/Exception.vue @@ -0,0 +1,148 @@ + + diff --git a/monolithic/frontend/src/views/sys/exception/index.ts b/monolithic/frontend/src/views/sys/exception/index.ts new file mode 100644 index 0000000..5002c4a --- /dev/null +++ b/monolithic/frontend/src/views/sys/exception/index.ts @@ -0,0 +1 @@ +export { default as Exception } from './Exception.vue'; diff --git a/monolithic/frontend/src/views/sys/iframe/FrameBlank.vue b/monolithic/frontend/src/views/sys/iframe/FrameBlank.vue new file mode 100644 index 0000000..a8a61f5 --- /dev/null +++ b/monolithic/frontend/src/views/sys/iframe/FrameBlank.vue @@ -0,0 +1,9 @@ + + diff --git a/monolithic/frontend/src/views/sys/iframe/index.vue b/monolithic/frontend/src/views/sys/iframe/index.vue new file mode 100644 index 0000000..fea0e7e --- /dev/null +++ b/monolithic/frontend/src/views/sys/iframe/index.vue @@ -0,0 +1,90 @@ + + + diff --git a/monolithic/frontend/src/views/sys/lock/LockPage.vue b/monolithic/frontend/src/views/sys/lock/LockPage.vue new file mode 100644 index 0000000..1d49270 --- /dev/null +++ b/monolithic/frontend/src/views/sys/lock/LockPage.vue @@ -0,0 +1,234 @@ + + + diff --git a/monolithic/frontend/src/views/sys/lock/index.vue b/monolithic/frontend/src/views/sys/lock/index.vue new file mode 100644 index 0000000..e8c4d55 --- /dev/null +++ b/monolithic/frontend/src/views/sys/lock/index.vue @@ -0,0 +1,13 @@ + + diff --git a/monolithic/frontend/src/views/sys/lock/useNow.ts b/monolithic/frontend/src/views/sys/lock/useNow.ts new file mode 100644 index 0000000..ee461fc --- /dev/null +++ b/monolithic/frontend/src/views/sys/lock/useNow.ts @@ -0,0 +1,60 @@ +import { dateUtil } from '/@/utils/dateUtil'; +import { reactive, toRefs } from 'vue'; +import { tryOnMounted, tryOnUnmounted } from '@vueuse/core'; + +export function useNow(immediate = true) { + let timer: IntervalHandle; + + const state = reactive({ + year: 0, + month: 0, + week: '', + day: 0, + hour: '', + minute: '', + second: 0, + meridiem: '', + }); + + const update = () => { + const now = dateUtil(); + + const h = now.format('HH'); + const m = now.format('mm'); + const s = now.get('s'); + + state.year = now.get('y'); + state.month = now.get('M') + 1; + state.week = '星期' + ['日', '一', '二', '三', '四', '五', '六'][now.day()]; + state.day = now.get('date'); + state.hour = h; + state.minute = m; + state.second = s; + + state.meridiem = now.format('A'); + }; + + function start() { + update(); + clearInterval(timer); + timer = setInterval(() => update(), 1000); + } + + function stop() { + clearInterval(timer); + } + + tryOnMounted(() => { + immediate && start(); + }); + + tryOnUnmounted(() => { + stop(); + }); + + return { + ...toRefs(state), + start, + stop, + }; +} diff --git a/monolithic/frontend/src/views/sys/login/ForgetPasswordForm.vue b/monolithic/frontend/src/views/sys/login/ForgetPasswordForm.vue new file mode 100644 index 0000000..cb17e08 --- /dev/null +++ b/monolithic/frontend/src/views/sys/login/ForgetPasswordForm.vue @@ -0,0 +1,65 @@ + + + diff --git a/monolithic/frontend/src/views/sys/login/Login.vue b/monolithic/frontend/src/views/sys/login/Login.vue new file mode 100644 index 0000000..c537b17 --- /dev/null +++ b/monolithic/frontend/src/views/sys/login/Login.vue @@ -0,0 +1,217 @@ + + + diff --git a/monolithic/frontend/src/views/sys/login/LoginForm.vue b/monolithic/frontend/src/views/sys/login/LoginForm.vue new file mode 100644 index 0000000..47e453a --- /dev/null +++ b/monolithic/frontend/src/views/sys/login/LoginForm.vue @@ -0,0 +1,135 @@ + + + diff --git a/monolithic/frontend/src/views/sys/login/LoginFormTitle.vue b/monolithic/frontend/src/views/sys/login/LoginFormTitle.vue new file mode 100644 index 0000000..a673636 --- /dev/null +++ b/monolithic/frontend/src/views/sys/login/LoginFormTitle.vue @@ -0,0 +1,25 @@ + + diff --git a/monolithic/frontend/src/views/sys/login/MobileForm.vue b/monolithic/frontend/src/views/sys/login/MobileForm.vue new file mode 100644 index 0000000..83d40fe --- /dev/null +++ b/monolithic/frontend/src/views/sys/login/MobileForm.vue @@ -0,0 +1,64 @@ + + + diff --git a/monolithic/frontend/src/views/sys/login/QrCodeForm.vue b/monolithic/frontend/src/views/sys/login/QrCodeForm.vue new file mode 100644 index 0000000..b0ba6a6 --- /dev/null +++ b/monolithic/frontend/src/views/sys/login/QrCodeForm.vue @@ -0,0 +1,32 @@ + + + diff --git a/monolithic/frontend/src/views/sys/login/RegisterForm.vue b/monolithic/frontend/src/views/sys/login/RegisterForm.vue new file mode 100644 index 0000000..7c02e55 --- /dev/null +++ b/monolithic/frontend/src/views/sys/login/RegisterForm.vue @@ -0,0 +1,105 @@ + + + diff --git a/monolithic/frontend/src/views/sys/login/SessionTimeoutLogin.vue b/monolithic/frontend/src/views/sys/login/SessionTimeoutLogin.vue new file mode 100644 index 0000000..d1a2f34 --- /dev/null +++ b/monolithic/frontend/src/views/sys/login/SessionTimeoutLogin.vue @@ -0,0 +1,53 @@ + + + diff --git a/monolithic/frontend/src/views/sys/login/useLogin.ts b/monolithic/frontend/src/views/sys/login/useLogin.ts new file mode 100644 index 0000000..915f83c --- /dev/null +++ b/monolithic/frontend/src/views/sys/login/useLogin.ts @@ -0,0 +1,132 @@ +import type {FormInstance} from 'ant-design-vue/lib/form/Form'; +import type { + RuleObject, + NamePath, + Rule as ValidationRule, +} from 'ant-design-vue/lib/form/interface'; +import {ref, computed, unref, Ref} from 'vue'; +import {useI18n} from '/@/hooks/web/useI18n'; + +export enum LoginStateEnum { + LOGIN, + REGISTER, + RESET_PASSWORD, + MOBILE, + QR_CODE, +} + +const currentState = ref(LoginStateEnum.LOGIN); + +// 这里也可以优化 +// import { createGlobalState } from '@vueuse/core' + +export function useLoginState() { + function setLoginState(state: LoginStateEnum) { + currentState.value = state; + } + + const getLoginState = computed(() => currentState.value); + + function handleBackLogin() { + setLoginState(LoginStateEnum.LOGIN); + } + + return {setLoginState, getLoginState, handleBackLogin}; +} + +export function useFormValid(formRef: Ref) { + const validate = computed(() => { + const form = unref(formRef); + return form?.validate ?? ((_nameList?: NamePath) => Promise.resolve()); + }); + + async function validForm() { + const form = unref(formRef); + if (!form) return; + const data = await form.validate(); + return data as T; + } + + return {validate, validForm}; +} + +export function useFormRules(formData?: Recordable) { + const {t} = useI18n(); + + const getUserNameFormRule = computed(() => createRule(t('sys.login.usernamePlaceholder'))); + const getPasswordFormRule = computed(() => createRule(t('sys.login.passwordPlaceholder'))); + const getSmsFormRule = computed(() => createRule(t('sys.login.smsPlaceholder'))); + const getMobileFormRule = computed(() => createRule(t('sys.login.mobilePlaceholder'))); + + const validatePolicy = async (_: RuleObject, value: boolean) => { + return !value ? Promise.reject(t('sys.login.policyPlaceholder')) : Promise.resolve(); + }; + + const validateConfirmPassword = (password: string) => { + return async (_: RuleObject, value: string) => { + if (!value) { + return Promise.reject(t('sys.login.passwordPlaceholder')); + } + if (value !== password) { + return Promise.reject(t('sys.login.diffPwd')); + } + return Promise.resolve(); + }; + }; + + const getFormRules = computed((): { + [k: string]: ValidationRule | ValidationRule[] + } => { + const userNameFormRule = unref(getUserNameFormRule); + const passwordFormRule = unref(getPasswordFormRule); + const smsFormRule = unref(getSmsFormRule); + const mobileFormRule = unref(getMobileFormRule); + + const mobileRule = { + sms: smsFormRule, + mobile: mobileFormRule, + }; + switch (unref(currentState)) { + // register form rules + case LoginStateEnum.REGISTER: + return { + userName: userNameFormRule, + password: passwordFormRule, + confirmPassword: [ + {validator: validateConfirmPassword(formData?.password), trigger: 'change'}, + ], + policy: [{validator: validatePolicy, trigger: 'change'}], + ...mobileRule, + }; + + // reset password form rules + case LoginStateEnum.RESET_PASSWORD: + return { + userName: userNameFormRule, + ...mobileRule, + }; + + // mobile form rules + case LoginStateEnum.MOBILE: + return mobileRule; + + // login form rules + default: + return { + userName: userNameFormRule, + password: passwordFormRule, + }; + } + }); + return {getFormRules}; +} + +function createRule(message: string): ValidationRule[] { + return [ + { + required: true, + message, + trigger: 'change', + }, + ]; +} diff --git a/monolithic/frontend/src/views/sys/main-out/index.vue b/monolithic/frontend/src/views/sys/main-out/index.vue new file mode 100644 index 0000000..2406632 --- /dev/null +++ b/monolithic/frontend/src/views/sys/main-out/index.vue @@ -0,0 +1,6 @@ + diff --git a/monolithic/frontend/src/views/sys/redirect/index.vue b/monolithic/frontend/src/views/sys/redirect/index.vue new file mode 100644 index 0000000..7aa5463 --- /dev/null +++ b/monolithic/frontend/src/views/sys/redirect/index.vue @@ -0,0 +1,30 @@ + + diff --git a/monolithic/frontend/stylelint.config.js b/monolithic/frontend/stylelint.config.js new file mode 100644 index 0000000..4b3501d --- /dev/null +++ b/monolithic/frontend/stylelint.config.js @@ -0,0 +1,100 @@ +module.exports = { + root: true, + plugins: ['stylelint-order'], + extends: ['stylelint-config-standard', 'stylelint-config-prettier'], + customSyntax: 'postcss-html', + rules: { + 'function-no-unknown': null, + 'selector-class-pattern': null, + 'selector-pseudo-class-no-unknown': [ + true, + { + ignorePseudoClasses: ['global'], + }, + ], + 'selector-pseudo-element-no-unknown': [ + true, + { + ignorePseudoElements: ['v-deep'], + }, + ], + 'at-rule-no-unknown': [ + true, + { + ignoreAtRules: [ + 'tailwind', + 'apply', + 'variants', + 'responsive', + 'screen', + 'function', + 'if', + 'each', + 'include', + 'mixin', + ], + }, + ], + 'no-empty-source': null, + 'string-quotes': null, + 'named-grid-areas-no-invalid': null, + 'unicode-bom': 'never', + 'no-descending-specificity': null, + 'font-family-no-missing-generic-family-keyword': null, + 'declaration-colon-space-after': 'always-single-line', + 'declaration-colon-space-before': 'never', + // 'declaration-block-trailing-semicolon': 'always', + 'rule-empty-line-before': [ + 'always', + { + ignore: ['after-comment', 'first-nested'], + }, + ], + 'unit-no-unknown': [true, { ignoreUnits: ['rpx'] }], + 'order/order': [ + [ + 'dollar-variables', + 'custom-properties', + 'at-rules', + 'declarations', + { + type: 'at-rule', + name: 'supports', + }, + { + type: 'at-rule', + name: 'media', + }, + 'rules', + ], + { severity: 'warning' }, + ], + }, + ignoreFiles: ['**/*.js', '**/*.jsx', '**/*.tsx', '**/*.ts'], + overrides: [ + { + files: ['*.vue', '**/*.vue', '*.html', '**/*.html'], + extends: ['stylelint-config-recommended'], + rules: { + 'keyframes-name-pattern': null, + 'selector-pseudo-class-no-unknown': [ + true, + { + ignorePseudoClasses: ['deep', 'global'], + }, + ], + 'selector-pseudo-element-no-unknown': [ + true, + { + ignorePseudoElements: ['v-deep', 'v-global', 'v-slotted'], + }, + ], + }, + }, + { + files: ['*.less', '**/*.less'], + customSyntax: 'postcss-less', + extends: ['stylelint-config-standard', 'stylelint-config-recommended-vue'], + }, + ], +}; diff --git a/monolithic/frontend/tsconfig.json b/monolithic/frontend/tsconfig.json new file mode 100644 index 0000000..f82d5ef --- /dev/null +++ b/monolithic/frontend/tsconfig.json @@ -0,0 +1,57 @@ +{ + "compilerOptions": { + "target": "esnext", + "module": "esnext", + "moduleResolution": "node", + "strict": true, + "noLib": false, + "forceConsistentCasingInFileNames": true, + "allowSyntheticDefaultImports": true, + "strictFunctionTypes": false, + "jsx": "preserve", + "baseUrl": "./", + "allowJs": true, + "sourceMap": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "experimentalDecorators": true, + "lib": [ + "dom", + "esnext" + ], + "noImplicitAny": false, + "skipLibCheck": true, + "types": [ + "vite/client" + ], + "removeComments": true, + "paths": { + "/@/*": [ + "src/*" + ], + "/#/*": [ + "types/*" + ] + } + }, + "include": [ + "tests/**/*.ts", + "src/**/*.ts", + "src/**/*.d.ts", + "src/**/*.tsx", + "src/**/*.vue", + "types/**/*.d.ts", + "types/**/*.ts", + "build/**/*.ts", + "build/**/*.d.ts", + "vite.config.ts" + ], + "exclude": [ + "node_modules", + "tests/server/**/*.ts", + "dist", + "**/*.js" + ] +} diff --git a/monolithic/frontend/types/axios.d.ts b/monolithic/frontend/types/axios.d.ts new file mode 100644 index 0000000..d86962c --- /dev/null +++ b/monolithic/frontend/types/axios.d.ts @@ -0,0 +1,61 @@ +export type ErrorMessageMode = 'none' | 'modal' | 'message' | undefined; + +export interface RequestOptions { + // Splicing request parameters to url + joinParamsToUrl?: boolean; + // Format request parameter time + formatDate?: boolean; + // Whether to process the request result + isTransformResponse?: boolean; + // Whether to return native response headers + // For example: use this attribute when you need to get the response headers + isReturnNativeResponse?: boolean; + // Whether to join url + joinPrefix?: boolean; + // Interface address, use the default apiUrl if you leave it blank + apiUrl?: string; + // 请求拼接路径 + urlPrefix?: string; + // Error message prompt type + errorMessageMode?: ErrorMessageMode; + // Whether to add a timestamp + joinTime?: boolean; + ignoreCancelToken?: boolean; + // Whether to send token in header + withToken?: boolean; + // 请求重试机制 + retryRequest?: RetryRequest; +} + +export interface RetryRequest { + isOpenRetry: boolean; + count: number; + waitTime: number; +} + +/* export interfaces Result { + code: number; + type: 'success' | 'error' | 'warning'; + message: string; + result: T; +} */ + +export interface Result { + code: number; + reason: string; + message: string; + metadata: object; +} + +// multipart/form-data: upload file +export interface UploadFileParams { + // Other parameters + data?: Recordable; + // File parameter interfaces field name + name?: string; + // file name + file: File | Blob; + // file name + filename?: string; + [key: string]: any; +} diff --git a/monolithic/frontend/types/config.d.ts b/monolithic/frontend/types/config.d.ts new file mode 100644 index 0000000..b4b246a --- /dev/null +++ b/monolithic/frontend/types/config.d.ts @@ -0,0 +1,162 @@ +import { MenuTypeEnum, MenuModeEnum, TriggerEnum, MixSidebarTriggerEnum } from '/@/enums/menuEnum'; +import { + ContentEnum, + PermissionModeEnum, + ThemeEnum, + RouterTransitionEnum, + SettingButtonPositionEnum, + SessionTimeoutProcessingEnum, +} from '/@/enums/appEnum'; + +import { CacheTypeEnum } from '/@/enums/cacheEnum'; + +export type LocaleType = 'zh_CN' | 'en' | 'ru' | 'ja' | 'ko'; + +export interface MenuSetting { + bgColor: string; + fixed: boolean; + collapsed: boolean; + siderHidden: boolean; + canDrag: boolean; + show: boolean; + hidden: boolean; + split: boolean; + menuWidth: number; + mode: MenuModeEnum; + type: MenuTypeEnum; + theme: ThemeEnum; + topMenuAlign: 'start' | 'center' | 'end'; + trigger: TriggerEnum; + accordion: boolean; + closeMixSidebarOnChange: boolean; + collapsedShowTitle: boolean; + mixSideTrigger: MixSidebarTriggerEnum; + mixSideFixed: boolean; +} + +export interface MultiTabsSetting { + cache: boolean; + show: boolean; + showQuick: boolean; + canDrag: boolean; + showRedo: boolean; + showFold: boolean; +} + +export interface HeaderSetting { + bgColor: string; + fixed: boolean; + show: boolean; + theme: ThemeEnum; + // Turn on full screen + showFullScreen: boolean; + // Whether to show the lock screen + useLockPage: boolean; + // Show document button + showDoc: boolean; + // Show message center button + showNotice: boolean; + showSearch: boolean; +} + +export interface LocaleSetting { + showPicker: boolean; + // Current language + locale: LocaleType; + // default language + fallback: LocaleType; + // available Locales + availableLocales: LocaleType[]; +} + +export interface TransitionSetting { + // Whether to open the page switching animation + enable: boolean; + // Route basic switching animation + basicTransition: RouterTransitionEnum; + // Whether to open page switching loading + openPageLoading: boolean; + // Whether to open the top progress bar + openNProgress: boolean; +} + +export interface ProjectConfig { + // Storage location of permission related information + permissionCacheType: CacheTypeEnum; + // Whether to show the configuration button + showSettingButton: boolean; + // Whether to show the theme switch button + showDarkModeToggle: boolean; + // Configure where the button is displayed + settingButtonPosition: SettingButtonPositionEnum; + // Permission mode + permissionMode: PermissionModeEnum; + // Session timeout processing + sessionTimeoutProcessing: SessionTimeoutProcessingEnum; + // Website gray mode, open for possible mourning dates + grayMode: boolean; + // Whether to turn on the color weak mode + colorWeak: boolean; + // Theme color + themeColor: string; + + // The main interfaces is displayed in full screen, the menu is not displayed, and the top + fullContent: boolean; + // content width + contentMode: ContentEnum; + // Whether to display the logo + showLogo: boolean; + // Whether to show the global footer + showFooter: boolean; + // menuType: MenuTypeEnum; + headerSetting: HeaderSetting; + // menuSetting + menuSetting: MenuSetting; + // Multi-tab settings + multiTabsSetting: MultiTabsSetting; + // Animation configuration + transitionSetting: TransitionSetting; + // pageLayout whether to enable keep-alive + openKeepAlive: boolean; + // Lock screen time + lockTime: number; + // Show breadcrumbs + showBreadCrumb: boolean; + // Show breadcrumb icon + showBreadCrumbIcon: boolean; + // Use error-handler-plugin + useErrorHandle: boolean; + // Whether to open back to top + useOpenBackTop: boolean; + // Is it possible to embed iframe pages + canEmbedIFramePage: boolean; + // Whether to delete unclosed messages and notify when switching the interfaces + closeMessageOnSwitch: boolean; + // Whether to cancel the http request that has been sent but not responded when switching the interfaces. + removeAllHttpPending: boolean; +} + +export interface GlobConfig { + // Site title + title: string; + // Service interfaces url + apiUrl: string; + // Upload url + uploadUrl?: string; + // Service interfaces url prefix + urlPrefix?: string; + // Project abbreviation + shortName: string; +} +export interface GlobEnvConfig { + // Site title + VITE_GLOB_APP_TITLE: string; + // Service interfaces url + VITE_GLOB_API_URL: string; + // Service interfaces url prefix + VITE_GLOB_API_URL_PREFIX?: string; + // Project abbreviation + VITE_GLOB_APP_SHORT_NAME: string; + // Upload url + VITE_GLOB_UPLOAD_URL?: string; +} diff --git a/monolithic/frontend/types/global.d.ts b/monolithic/frontend/types/global.d.ts new file mode 100644 index 0000000..a387c65 --- /dev/null +++ b/monolithic/frontend/types/global.d.ts @@ -0,0 +1,100 @@ +import type { + ComponentRenderProxy, + VNode, + VNodeChild, + ComponentPublicInstance, + FunctionalComponent, + PropType as VuePropType, +} from 'vue'; + +declare global { + const __APP_INFO__: { + pkg: { + name: string; + version: string; + dependencies: Recordable; + devDependencies: Recordable; + }; + lastBuildTime: string; + }; + // declare interfaces Window { + // // Global vue app instance + // __APP__: App; + // } + + // vue + declare type PropType = VuePropType; + declare type VueNode = VNodeChild | JSX.Element; + + export type Writable = { + -readonly [P in keyof T]: T[P]; + }; + + declare type Nullable = T | null; + declare type NonNullable = T extends null | undefined ? never : T; + declare type Recordable = Record; + declare type ReadonlyRecordable = { + readonly [key: string]: T; + }; + declare type Indexable = { + [key: string]: T; + }; + declare type DeepPartial = { + [P in keyof T]?: DeepPartial; + }; + declare type TimeoutHandle = ReturnType; + declare type IntervalHandle = ReturnType; + + declare interface ChangeEvent extends Event { + target: HTMLInputElement; + } + + declare interface WheelEvent { + path?: EventTarget[]; + } + interface ImportMetaEnv extends ViteEnv { + __: unknown; + } + + declare interface ViteEnv { + VITE_PORT: number; + VITE_USE_PWA: boolean; + VITE_PUBLIC_PATH: string; + VITE_PROXY: [string, string][]; + VITE_GLOB_APP_TITLE: string; + VITE_GLOB_APP_SHORT_NAME: string; + VITE_USE_CDN: boolean; + VITE_DROP_CONSOLE: boolean; + VITE_BUILD_COMPRESS: 'gzip' | 'brotli' | 'none'; + VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE: boolean; + VITE_LEGACY: boolean; + VITE_USE_IMAGEMIN: boolean; + VITE_GENERATE_UI: string; + } + + declare function parseInt(s: string | number, radix?: number): number; + + declare function parseFloat(string: string | number): number; + + namespace JSX { + // tslint:disable no-empty-interfaces + type Element = VNode; + // tslint:disable no-empty-interfaces + type ElementClass = ComponentRenderProxy; + interface ElementAttributesProperty { + $props: any; + } + interface IntrinsicElements { + [elem: string]: any; + } + interface IntrinsicAttributes { + [elem: string]: any; + } + } +} + +declare module 'vue' { + export type JSXComponent = + | { new (): ComponentPublicInstance } + | FunctionalComponent; +} diff --git a/monolithic/frontend/types/index.d.ts b/monolithic/frontend/types/index.d.ts new file mode 100644 index 0000000..b279c0a --- /dev/null +++ b/monolithic/frontend/types/index.d.ts @@ -0,0 +1,27 @@ +declare interface Fn { + (...arg: T[]): R; +} + +declare interface PromiseFn { + (...arg: T[]): Promise; +} + +declare type RefType = T | null; + +declare type LabelValueOptions = { + label: string; + value: any; + [key: string]: string | number | boolean; +}[]; + +declare type EmitType = (event: string, ...args: any[]) => void; + +declare type TargetContext = '_self' | '_blank'; + +declare interface ComponentElRef { + $el: T; +} + +declare type ComponentRef = ComponentElRef | null; + +declare type ElRef = Nullable; diff --git a/monolithic/frontend/types/module.d.ts b/monolithic/frontend/types/module.d.ts new file mode 100644 index 0000000..9615206 --- /dev/null +++ b/monolithic/frontend/types/module.d.ts @@ -0,0 +1,16 @@ +declare module '*.vue' { + import { DefineComponent } from 'vue'; + const Component: DefineComponent<{}, {}, any>; + export default Component; +} + +declare module 'ant-design-vue/es/locale/*' { + import { Locale } from 'ant-design-vue/types/locale-provider'; + const locale: Locale & ReadonlyRecordable; + export default locale as Locale & ReadonlyRecordable; +} + +declare module 'virtual:*' { + const result: any; + export default result; +} diff --git a/monolithic/frontend/types/openapi.d.ts b/monolithic/frontend/types/openapi.d.ts new file mode 100644 index 0000000..6361572 --- /dev/null +++ b/monolithic/frontend/types/openapi.d.ts @@ -0,0 +1,1381 @@ +/** + * This file was auto-generated by openapi-typescript. + * Do not make direct changes to the file. + */ + + +export interface paths { + "/admin/v1/dict:details": { + /** @description 查询字典详情列表 */ + get: operations["DictDetailService_ListDictDetail"]; + /** @description 创建字典详情 */ + post: operations["DictDetailService_CreateDictDetail"]; + }; + "/admin/v1/dict:details/{detail.id}": { + /** @description 更新字典详情 */ + put: operations["DictDetailService_UpdateDictDetail"]; + }; + "/admin/v1/dict:details/{id}": { + /** @description 查询字典详情 */ + get: operations["DictDetailService_GetDictDetail"]; + /** @description 删除字典详情 */ + delete: operations["DictDetailService_DeleteDictDetail"]; + }; + "/admin/v1/dicts": { + /** @description 查询字典列表 */ + get: operations["DictService_ListDict"]; + /** @description 创建字典 */ + post: operations["DictService_CreateDict"]; + }; + "/admin/v1/dicts/{dict.id}": { + /** @description 更新字典 */ + put: operations["DictService_UpdateDict"]; + }; + "/admin/v1/dicts/{id}": { + /** @description 查询字典 */ + get: operations["DictService_GetDict"]; + /** @description 删除字典 */ + delete: operations["DictService_DeleteDict"]; + }; + "/admin/v1/login": { + /** @description 登陆 */ + post: operations["AuthenticationService_Login"]; + }; + "/admin/v1/logout": { + /** @description 登出 */ + post: operations["AuthenticationService_Logout"]; + }; + "/admin/v1/me": { + /** @description 后台获取已经登陆的用户的数据 */ + get: operations["AuthenticationService_GetMe"]; + }; + "/admin/v1/menus": { + /** @description 查询菜单列表 */ + get: operations["MenuService_ListMenu"]; + /** @description 创建菜单 */ + post: operations["MenuService_CreateMenu"]; + }; + "/admin/v1/menus/{id}": { + /** @description 查询菜单详情 */ + get: operations["MenuService_GetMenu"]; + /** @description 删除菜单 */ + delete: operations["MenuService_DeleteMenu"]; + }; + "/admin/v1/menus/{menu.id}": { + /** @description 更新菜单 */ + put: operations["MenuService_UpdateMenu"]; + }; + "/admin/v1/orgs": { + /** @description 查询部门列表 */ + get: operations["OrganizationService_ListOrganization"]; + /** @description 创建部门 */ + post: operations["OrganizationService_CreateOrganization"]; + }; + "/admin/v1/orgs/{id}": { + /** @description 查询部门详情 */ + get: operations["OrganizationService_GetOrganization"]; + /** @description 删除部门 */ + delete: operations["OrganizationService_DeleteOrganization"]; + }; + "/admin/v1/orgs/{org.id}": { + /** @description 更新部门 */ + put: operations["OrganizationService_UpdateOrganization"]; + }; + "/admin/v1/perm-codes": { + /** @description 查询权限码列表 */ + get: operations["RouterService_ListPermissionCode"]; + }; + "/admin/v1/positions": { + /** @description 查询职位列表 */ + get: operations["PositionService_ListPosition"]; + /** @description 创建职位 */ + post: operations["PositionService_CreatePosition"]; + }; + "/admin/v1/positions/{id}": { + /** @description 查询职位详情 */ + get: operations["PositionService_GetPosition"]; + /** @description 删除职位 */ + delete: operations["PositionService_DeletePosition"]; + }; + "/admin/v1/positions/{position.id}": { + /** @description 更新职位 */ + put: operations["PositionService_UpdatePosition"]; + }; + "/admin/v1/refresh_token": { + /** @description 刷新认证令牌 */ + post: operations["AuthenticationService_RefreshToken"]; + }; + "/admin/v1/roles": { + /** @description 查询角色列表 */ + get: operations["RoleService_ListRole"]; + /** @description 创建角色 */ + post: operations["RoleService_CreateRole"]; + }; + "/admin/v1/roles/{id}": { + /** @description 查询角色详情 */ + get: operations["RoleService_GetRole"]; + /** @description 删除角色 */ + delete: operations["RoleService_DeleteRole"]; + }; + "/admin/v1/roles/{role.id}": { + /** @description 更新角色 */ + put: operations["RoleService_UpdateRole"]; + }; + "/admin/v1/routes": { + /** @description 查询路由列表 */ + get: operations["RouterService_ListRoute"]; + }; + "/admin/v1/users": { + /** @description 获取用户列表 */ + get: operations["UserService_ListUser"]; + /** @description 创建用户 */ + post: operations["UserService_CreateUser"]; + }; + "/admin/v1/users/{id}": { + /** @description 获取用户数据 */ + get: operations["UserService_GetUser"]; + /** @description 删除用户 */ + delete: operations["UserService_DeleteUser"]; + }; + "/admin/v1/users/{user.id}": { + /** @description 更新用户 */ + put: operations["UserService_UpdateUser"]; + }; +} + +export type webhooks = Record; + +export interface components { + schemas: { + /** @description 创建字典详情 - 请求 */ + CreateDictDetailRequest: { + detail?: components["schemas"]["DictDetail"]; + /** Format: uint32 */ + operatorId?: number; + }; + /** @description 创建字典 - 请求 */ + CreateDictRequest: { + dict?: components["schemas"]["Dict"]; + /** Format: uint32 */ + operatorId?: number; + }; + /** @description 创建菜单 - 请求 */ + CreateMenuRequest: { + menu?: components["schemas"]["Menu"]; + /** Format: uint32 */ + operatorId?: number; + }; + /** @description 创建部门 - 请求 */ + CreateOrganizationRequest: { + /** Format: uint32 */ + operatorId?: number; + org?: components["schemas"]["Organization"]; + }; + /** @description 创建职位 - 请求 */ + CreatePositionRequest: { + position?: components["schemas"]["Position"]; + /** Format: uint32 */ + operatorId?: number; + }; + /** @description 创建角色 - 请求 */ + CreateRoleRequest: { + role?: components["schemas"]["Role"]; + /** Format: uint32 */ + operatorId?: number; + }; + /** @description 数据字典 */ + Dict: { + /** + * Format: uint32 + * @description ID + */ + id?: number; + /** @description 字典名称 */ + name?: string; + /** @description 描述 */ + description?: string; + /** + * Format: uint32 + * @description 创建者ID + */ + creatorId?: number; + /** + * Format: uint32 + * @description 创建者名字 + */ + creatorName?: number; + createTime?: string; + updateTime?: string; + deleteTime?: string; + }; + /** @description 数据字典详情 */ + DictDetail: { + /** + * Format: uint32 + * @description 字典详情ID + */ + id?: number; + /** + * Format: uint32 + * @description 字典ID + */ + dictId?: number; + /** + * Format: int32 + * @description 排序号 + */ + orderNo?: number; + /** @description 字典标签 */ + label?: string; + /** @description 字典值 */ + value?: string; + /** + * Format: uint32 + * @description 创建者ID + */ + creatorId?: number; + /** + * Format: uint32 + * @description 创建者名字 + */ + creatorName?: number; + createTime?: string; + updateTime?: string; + deleteTime?: string; + }; + /** @description Kratos错误返回 */ + KratosStatus: { + /** + * Format: int32 + * @description 错误码 + */ + code?: number; + /** @description 错误消息 */ + message?: string; + /** @description 错误原因 */ + reason?: string; + /** @description 元数据 */ + metadata?: Record; + }; + /** @description 查询字典详情列表 - 答复 */ + ListDictDetailResponse: { + items?: components["schemas"]["DictDetail"][]; + /** Format: int32 */ + total?: number; + }; + /** @description 查询字典列表 - 答复 */ + ListDictResponse: { + items?: components["schemas"]["Dict"][]; + /** Format: int32 */ + total?: number; + }; + /** @description 查询菜单列表 - 回应 */ + ListMenuResponse: { + items?: components["schemas"]["Menu"][]; + /** Format: int32 */ + total?: number; + }; + /** @description 部门列表 - 答复 */ + ListOrganizationResponse: { + items?: components["schemas"]["Organization"][]; + /** Format: int32 */ + total?: number; + }; + /** @description 查询权限码列表 - 回应 */ + ListPermissionCodeResponse: { + codes?: string[]; + }; + /** @description 获取职位列表 - 答复 */ + ListPositionResponse: { + items?: components["schemas"]["Position"][]; + /** Format: int32 */ + total?: number; + }; + /** @description 角色列表 - 答复 */ + ListRoleResponse: { + items?: components["schemas"]["Role"][]; + /** Format: int32 */ + total?: number; + }; + /** @description 查询路由列表 - 回应 */ + ListRouteResponse: { + items?: components["schemas"]["RouteItem"][]; + }; + /** @description 获取用户列表 - 答复 */ + ListUserResponse: { + items?: components["schemas"]["User"][]; + /** Format: int32 */ + total?: number; + }; + /** @description 用户后台登陆 - 请求 */ + LoginRequest: { + username: string; + password: string; + /** + * @description 授权类型,此处的值固定为"password",必选项。 + * @default password + */ + grand_type: string; + scope?: string; + }; + /** @description 用户后台登陆 - 回应 */ + LoginResponse: { + access_token?: string; + refresh_token?: string; + token_type?: string; + expires_in?: string; + }; + /** @description 用户后台登出 - 请求 */ + LogoutRequest: { + /** Format: uint32 */ + id?: number; + }; + /** @description 菜单 */ + Menu: { + /** Format: int32 */ + id?: number; + /** Format: int32 */ + parentId?: number; + /** Format: int32 */ + orderNo?: number; + name?: string; + /** + * Format: enum + * @description 类型 + * @default FOLDER + * @enum {string} + */ + type?: "FOLDER" | "MENU" | "BUTTON"; + /** + * @description 状态 + * @default ON + * @enum {string} + */ + status?: "ON" | "OFF"; + path?: string; + title?: string; + component?: string; + icon?: string; + permissions?: string[]; + children?: components["schemas"]["Menu"][]; + keepAlive?: boolean; + show?: boolean; + isExt?: boolean; + extUrl?: string; + hideBreadcrumb?: boolean; + hideTab?: boolean; + hideMenu?: boolean; + hideChildrenInMenu?: boolean; + hidePathForChildren?: boolean; + currentActiveMenu?: string; + redirect?: string; + createTime?: string; + updateTime?: string; + deleteTime?: string; + }; + /** @description 部门 */ + Organization: { + /** Format: uint32 */ + id?: number; + name?: string; + /** Format: uint32 */ + parentId?: number; + /** Format: int32 */ + orderNo?: number; + /** + * @description 状态 + * @default ON + * @enum {string} + */ + status?: "ON" | "OFF"; + remark?: string; + children?: components["schemas"]["Organization"][]; + createTime?: string; + updateTime?: string; + deleteTime?: string; + }; + /** @description 职位 */ + Position: { + /** Format: uint32 */ + id?: number; + name?: string; + /** Format: uint32 */ + parentId?: number; + /** Format: int32 */ + orderNo?: number; + code?: string; + /** + * @description 状态 + * @default ON + * @enum {string} + */ + status?: "ON" | "OFF"; + remark?: string; + createTime?: string; + updateTime?: string; + deleteTime?: string; + }; + /** @description 用户刷新令牌 - 请求 */ + RefreshTokenRequest: { + refresh_token: string; + /** + * @description 授权类型,此处的值固定为"password",必选项。 + * @default password + */ + grand_type: string; + scope?: string; + }; + /** @description 角色 */ + Role: { + /** Format: uint32 */ + id?: number; + name?: string; + /** Format: uint32 */ + parentId?: number; + /** Format: int32 */ + orderNo?: number; + code?: string; + /** + * @description 状态 + * @default ON + * @enum {string} + */ + status?: "ON" | "OFF"; + remark?: string; + createTime?: string; + updateTime?: string; + deleteTime?: string; + }; + /** @description 路由项 */ + RouteItem: { + name?: string; + alias?: string; + path?: string; + component?: string; + redirect?: string; + caseSensitive?: boolean; + meta?: components["schemas"]["RouteMeta"]; + children?: components["schemas"]["RouteItem"][]; + }; + /** @description 路由元数据 */ + RouteMeta: { + /** Format: int32 */ + orderNo?: number; + title?: string; + /** Format: int32 */ + dynamicLevel?: number; + realPath?: string; + icon?: string; + frameSrc?: string; + transitionName?: string; + affix?: boolean; + carryParam?: boolean; + single?: boolean; + ignoreAuth?: boolean; + ignoreKeepAlive?: boolean; + ignoreRoute?: boolean; + hideBreadcrumb?: boolean; + hideChildrenInMenu?: boolean; + hideTab?: boolean; + hideMenu?: boolean; + isLink?: boolean; + hidePathForChildren?: boolean; + currentActiveMenu?: string; + }; + /** @description 用户 */ + User: { + /** Format: uint32 */ + id?: number; + /** + * Format: uint32 + * @description 角色ID + */ + roleId?: number; + /** + * Format: uint32 + * @description 工号 + */ + workId?: number; + /** + * Format: uint32 + * @description 部门ID + */ + orgId?: number; + /** + * Format: uint32 + * @description 岗位ID + */ + positionId?: number; + /** + * Format: uint32 + * @description 创建者ID + */ + creatorId?: number; + /** @description 登录名 */ + userName?: string; + /** @description 昵称 */ + nickName?: string; + /** @description 真实姓名 */ + realName?: string; + /** @description 头像 */ + avatar?: string; + /** @description 邮箱 */ + email?: string; + /** @description 手机号 */ + phone?: string; + /** @description 性别 */ + gender?: string; + /** @description 住址 */ + address?: string; + /** @description 个人描述 */ + description?: string; + /** @description 最后登录时间 */ + lastLoginTime?: string; + /** @description 最后登录IP */ + lastLoginIp?: string; + /** + * @description 用户状态 + * @default ON + * @enum {string} + */ + status?: "ON" | "OFF"; + /** + * Format: enum + * @description 权限 + * @default CUSTOMER_USER + * @enum {string} + */ + authority?: "SYS_ADMIN" | "CUSTOMER_USER" | "GUEST_USER" | "REFRESH_TOKEN"; + createTime?: string; + updateTime?: string; + deleteTime?: string; + }; + }; + responses: { + /** @description default kratos response */ + default: { + content: { + "application/json": components["schemas"]["KratosStatus"]; + }; + }; + }; + parameters: never; + requestBodies: never; + headers: never; + pathItems: never; +} + +export type $defs = Record; + +export type external = Record; + +export interface operations { + + /** @description 查询字典详情列表 */ + DictDetailService_ListDictDetail: { + parameters: { + query?: { + /** @description 当前页码 */ + page?: number; + /** @description 每页的行数 */ + pageSize?: number; + /** @description 与过滤参数 */ + query?: string; + /** @description 或过滤参数 */ + or?: string; + /** @description 排序条件 */ + orderBy?: string[]; + /** @description 是否不分页 */ + nopaging?: boolean; + /** @description 字段掩码 */ + fieldMask?: string; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["ListDictDetailResponse"]; + }; + }; + }; + }; + /** @description 创建字典详情 */ + DictDetailService_CreateDictDetail: { + requestBody: { + content: { + "application/json": components["schemas"]["CreateDictDetailRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + }; + }; + }; + }; + /** @description 更新字典详情 */ + DictDetailService_UpdateDictDetail: { + parameters: { + query?: { + operatorId?: number; + }; + path: { + "detail.id": string; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DictDetail"]; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + }; + }; + }; + }; + /** @description 查询字典详情 */ + DictDetailService_GetDictDetail: { + parameters: { + query?: { + code?: string; + }; + path: { + id: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["DictDetail"]; + }; + }; + }; + }; + /** @description 删除字典详情 */ + DictDetailService_DeleteDictDetail: { + parameters: { + query?: { + operatorId?: number; + }; + path: { + id: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + }; + }; + }; + }; + /** @description 查询字典列表 */ + DictService_ListDict: { + parameters: { + query?: { + /** @description 当前页码 */ + page?: number; + /** @description 每页的行数 */ + pageSize?: number; + /** @description 与过滤参数 */ + query?: string; + /** @description 或过滤参数 */ + or?: string; + /** @description 排序条件 */ + orderBy?: string[]; + /** @description 是否不分页 */ + nopaging?: boolean; + /** @description 字段掩码 */ + fieldMask?: string; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["ListDictResponse"]; + }; + }; + }; + }; + /** @description 创建字典 */ + DictService_CreateDict: { + requestBody: { + content: { + "application/json": components["schemas"]["CreateDictRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + }; + }; + }; + }; + /** @description 更新字典 */ + DictService_UpdateDict: { + parameters: { + query?: { + operatorId?: number; + }; + path: { + "dict.id": string; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["Dict"]; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + }; + }; + }; + }; + /** @description 查询字典 */ + DictService_GetDict: { + parameters: { + query?: { + name?: string; + }; + path: { + id: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["Dict"]; + }; + }; + }; + }; + /** @description 删除字典 */ + DictService_DeleteDict: { + parameters: { + query?: { + operatorId?: number; + }; + path: { + id: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + }; + }; + }; + }; + /** @description 登陆 */ + AuthenticationService_Login: { + requestBody: { + content: { + "application/json": components["schemas"]["LoginRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["LoginResponse"]; + }; + }; + }; + }; + /** @description 登出 */ + AuthenticationService_Logout: { + requestBody: { + content: { + "application/json": components["schemas"]["LogoutRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + }; + }; + }; + }; + /** @description 后台获取已经登陆的用户的数据 */ + AuthenticationService_GetMe: { + parameters: { + query?: { + id?: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["User"]; + }; + }; + }; + }; + /** @description 查询菜单列表 */ + MenuService_ListMenu: { + parameters: { + query?: { + /** @description 当前页码 */ + page?: number; + /** @description 每页的行数 */ + pageSize?: number; + /** @description 与过滤参数 */ + query?: string; + /** @description 或过滤参数 */ + or?: string; + /** @description 排序条件 */ + orderBy?: string[]; + /** @description 是否不分页 */ + nopaging?: boolean; + /** @description 字段掩码 */ + fieldMask?: string; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["ListMenuResponse"]; + }; + }; + }; + }; + /** @description 创建菜单 */ + MenuService_CreateMenu: { + requestBody: { + content: { + "application/json": components["schemas"]["CreateMenuRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + }; + }; + }; + }; + /** @description 查询菜单详情 */ + MenuService_GetMenu: { + parameters: { + path: { + id: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["Menu"]; + }; + }; + }; + }; + /** @description 删除菜单 */ + MenuService_DeleteMenu: { + parameters: { + query?: { + operatorId?: number; + }; + path: { + id: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + }; + }; + }; + }; + /** @description 更新菜单 */ + MenuService_UpdateMenu: { + parameters: { + query?: { + operatorId?: number; + }; + path: { + "menu.id": string; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["Menu"]; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + }; + }; + }; + }; + /** @description 查询部门列表 */ + OrganizationService_ListOrganization: { + parameters: { + query?: { + /** @description 当前页码 */ + page?: number; + /** @description 每页的行数 */ + pageSize?: number; + /** @description 与过滤参数 */ + query?: string; + /** @description 或过滤参数 */ + or?: string; + /** @description 排序条件 */ + orderBy?: string[]; + /** @description 是否不分页 */ + nopaging?: boolean; + /** @description 字段掩码 */ + fieldMask?: string; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["ListOrganizationResponse"]; + }; + }; + }; + }; + /** @description 创建部门 */ + OrganizationService_CreateOrganization: { + requestBody: { + content: { + "application/json": components["schemas"]["CreateOrganizationRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + }; + }; + }; + }; + /** @description 查询部门详情 */ + OrganizationService_GetOrganization: { + parameters: { + path: { + id: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["Organization"]; + }; + }; + }; + }; + /** @description 删除部门 */ + OrganizationService_DeleteOrganization: { + parameters: { + query?: { + operatorId?: number; + }; + path: { + id: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + }; + }; + }; + }; + /** @description 更新部门 */ + OrganizationService_UpdateOrganization: { + parameters: { + query?: { + operatorId?: number; + }; + path: { + "org.id": string; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["Organization"]; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + }; + }; + }; + }; + /** @description 查询权限码列表 */ + RouterService_ListPermissionCode: { + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["ListPermissionCodeResponse"]; + }; + }; + }; + }; + /** @description 查询职位列表 */ + PositionService_ListPosition: { + parameters: { + query?: { + /** @description 当前页码 */ + page?: number; + /** @description 每页的行数 */ + pageSize?: number; + /** @description 与过滤参数 */ + query?: string; + /** @description 或过滤参数 */ + or?: string; + /** @description 排序条件 */ + orderBy?: string[]; + /** @description 是否不分页 */ + nopaging?: boolean; + /** @description 字段掩码 */ + fieldMask?: string; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["ListPositionResponse"]; + }; + }; + }; + }; + /** @description 创建职位 */ + PositionService_CreatePosition: { + requestBody: { + content: { + "application/json": components["schemas"]["CreatePositionRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + }; + }; + }; + }; + /** @description 查询职位详情 */ + PositionService_GetPosition: { + parameters: { + path: { + id: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["Position"]; + }; + }; + }; + }; + /** @description 删除职位 */ + PositionService_DeletePosition: { + parameters: { + query?: { + operatorId?: number; + }; + path: { + id: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + }; + }; + }; + }; + /** @description 更新职位 */ + PositionService_UpdatePosition: { + parameters: { + query?: { + operatorId?: number; + }; + path: { + "position.id": string; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["Position"]; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + }; + }; + }; + }; + /** @description 刷新认证令牌 */ + AuthenticationService_RefreshToken: { + requestBody: { + content: { + "application/json": components["schemas"]["RefreshTokenRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["LoginResponse"]; + }; + }; + }; + }; + /** @description 查询角色列表 */ + RoleService_ListRole: { + parameters: { + query?: { + /** @description 当前页码 */ + page?: number; + /** @description 每页的行数 */ + pageSize?: number; + /** @description 与过滤参数 */ + query?: string; + /** @description 或过滤参数 */ + or?: string; + /** @description 排序条件 */ + orderBy?: string[]; + /** @description 是否不分页 */ + nopaging?: boolean; + /** @description 字段掩码 */ + fieldMask?: string; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["ListRoleResponse"]; + }; + }; + }; + }; + /** @description 创建角色 */ + RoleService_CreateRole: { + requestBody: { + content: { + "application/json": components["schemas"]["CreateRoleRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + }; + }; + }; + }; + /** @description 查询角色详情 */ + RoleService_GetRole: { + parameters: { + path: { + id: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["Role"]; + }; + }; + }; + }; + /** @description 删除角色 */ + RoleService_DeleteRole: { + parameters: { + query?: { + operatorId?: number; + }; + path: { + id: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + }; + }; + }; + }; + /** @description 更新角色 */ + RoleService_UpdateRole: { + parameters: { + query?: { + operatorId?: number; + }; + path: { + "role.id": string; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["Role"]; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + }; + }; + }; + }; + /** @description 查询路由列表 */ + RouterService_ListRoute: { + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["ListRouteResponse"]; + }; + }; + }; + }; + /** @description 获取用户列表 */ + UserService_ListUser: { + parameters: { + query?: { + /** @description 当前页码 */ + page?: number; + /** @description 每页的行数 */ + pageSize?: number; + /** @description 与过滤参数 */ + query?: string; + /** @description 或过滤参数 */ + or?: string; + /** @description 排序条件 */ + orderBy?: string[]; + /** @description 是否不分页 */ + nopaging?: boolean; + /** @description 字段掩码 */ + fieldMask?: string; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["ListUserResponse"]; + }; + }; + }; + }; + /** @description 创建用户 */ + UserService_CreateUser: { + parameters: { + query?: { + operatorId?: number; + password?: string; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["User"]; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + }; + }; + }; + }; + /** @description 获取用户数据 */ + UserService_GetUser: { + parameters: { + path: { + id: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["User"]; + }; + }; + }; + }; + /** @description 删除用户 */ + UserService_DeleteUser: { + parameters: { + query?: { + operatorId?: number; + }; + path: { + id: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + }; + }; + }; + }; + /** @description 更新用户 */ + UserService_UpdateUser: { + parameters: { + query?: { + operatorId?: number; + password?: string; + updateMask?: string; + allowMissing?: boolean; + }; + path: { + "user.id": string; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["User"]; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + }; + }; + }; + }; +} diff --git a/monolithic/frontend/types/store.d.ts b/monolithic/frontend/types/store.d.ts new file mode 100644 index 0000000..3055833 --- /dev/null +++ b/monolithic/frontend/types/store.d.ts @@ -0,0 +1,68 @@ +import {ErrorTypeEnum} from '/@/enums/exceptionEnum'; +import {MenuModeEnum, MenuTypeEnum} from '/@/enums/menuEnum'; + +// Lock screen information +export interface LockInfo { + // Password required + pwd?: string | undefined; + // Is it locked? + isLock?: boolean; +} + +// Error-log information +export interface ErrorLogInfo { + // Type of error + type: ErrorTypeEnum; + // Error file + file: string; + // Error name + name?: string; + // Error message + message: string; + // Error stack + stack?: string; + // Error detail + detail: string; + // Error url + url: string; + // Error time + time?: string; +} + +// 用户信息 +export interface UserInfo { + // 用户id + id: string | number; + // 用户名 + userName: string; + // 昵称 + nickName: string; + // 真实名字 + realName: string; + // 头像 + avatar: string; + // 电话号码 + phone: string; + // 家庭住址 + address: string; + // 电子邮箱 + email: string; + // 个人描述 + description?: string; + + // 主页 + homePath?: string; + // 角色信息 + roles: RoleInfo[]; +} + +export interface BeforeMiniState { + // 收缩 + menuCollapsed?: boolean; + // 分割 + menuSplit?: boolean; + // 模式 + menuMode?: MenuModeEnum; + // 类型 + menuType?: MenuTypeEnum; +} diff --git a/monolithic/frontend/types/utils.d.ts b/monolithic/frontend/types/utils.d.ts new file mode 100644 index 0000000..6500d44 --- /dev/null +++ b/monolithic/frontend/types/utils.d.ts @@ -0,0 +1,5 @@ +import type { ComputedRef, Ref } from 'vue'; + +export type DynamicProps = { + [P in keyof T]: Ref | T[P] | ComputedRef; +}; diff --git a/monolithic/frontend/types/vue-router.d.ts b/monolithic/frontend/types/vue-router.d.ts new file mode 100644 index 0000000..93fd788 --- /dev/null +++ b/monolithic/frontend/types/vue-router.d.ts @@ -0,0 +1,45 @@ +export {}; + +declare module 'vue-router' { + interface RouteMeta extends Record { + orderNo?: number; + // title + title: string; + // dynamic router level. + dynamicLevel?: number; + // dynamic router real route path (For performance). + realPath?: string; + // Whether to ignore permissions + ignoreAuth?: boolean; + // role info + roles?: RoleEnum[]; + // Whether not to cache + ignoreKeepAlive?: boolean; + // Is it fixed on tab + affix?: boolean; + // icon on tab + icon?: string; + frameSrc?: string; + // current page transition + transitionName?: string; + // Whether the route has been dynamically added + hideBreadcrumb?: boolean; + // Hide submenu + hideChildrenInMenu?: boolean; + // Carrying parameters + carryParam?: boolean; + // Used internally to mark single-level menus + single?: boolean; + // Currently active menu + currentActiveMenu?: string; + // Never show in tab + hideTab?: boolean; + // Never show in menu + hideMenu?: boolean; + isLink?: boolean; + // only build for Menu + ignoreRoute?: boolean; + // Hide path for children + hidePathForChildren?: boolean; + } +} diff --git a/monolithic/frontend/vite.config.ts b/monolithic/frontend/vite.config.ts new file mode 100644 index 0000000..d315597 --- /dev/null +++ b/monolithic/frontend/vite.config.ts @@ -0,0 +1,115 @@ +import type { UserConfig, ConfigEnv } from 'vite'; +import pkg from './package.json'; +import dayjs from 'dayjs'; +import { loadEnv } from 'vite'; +import { resolve } from 'path'; +import { generateModifyVars } from './build/generate/generateModifyVars'; +import { createProxy } from './build/vite/proxy'; +import { wrapperEnv } from './build/utils'; +import { createVitePlugins } from './build/vite/plugin'; +import { OUTPUT_DIR } from './build/constant'; + +function pathResolve(dir: string) { + return resolve(process.cwd(), '.', dir); +} + +const { dependencies, devDependencies, name, version } = pkg; +const __APP_INFO__ = { + pkg: { dependencies, devDependencies, name, version }, + lastBuildTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), +}; + +export default ({ command, mode }: ConfigEnv): UserConfig => { + const root = process.cwd(); + + const env = loadEnv(mode, root); + + // The boolean type read by loadEnv is a string. This function can be converted to boolean type + const viteEnv = wrapperEnv(env); + + const { VITE_PORT, VITE_PUBLIC_PATH, VITE_PROXY, VITE_DROP_CONSOLE } = viteEnv; + + const isBuild = command === 'build'; + + return { + base: VITE_PUBLIC_PATH, + root, + resolve: { + alias: [ + { + find: 'vue-i18n', + replacement: 'vue-i18n/dist/vue-i18n.cjs.js', + }, + // /@/xxxx => src/xxxx + { + find: /\/@\//, + replacement: pathResolve('src') + '/', + }, + // /#/xxxx => types/xxxx + { + find: /\/#\//, + replacement: pathResolve('types') + '/', + }, + ], + }, + server: { + https: false, + // Listening on all local IPs + host: true, + port: VITE_PORT, + // Load proxy configuration from .env + proxy: createProxy(VITE_PROXY), + }, + esbuild: { + pure: VITE_DROP_CONSOLE ? ['console.log', 'debugger'] : [], + }, + build: { + target: 'es2015', + cssTarget: 'chrome80', + outDir: OUTPUT_DIR, + // minify: 'terser', + /** + * 当 minify=“minify:'terser'” 解开注释 + * Uncomment when minify="minify:'terser'" + */ + // terserOptions: { + // compress: { + // keep_infinity: true, + // drop_console: VITE_DROP_CONSOLE, + // }, + // }, + // Turning off brotliSize display can slightly reduce packaging time + brotliSize: false, + chunkSizeWarningLimit: 2000, + }, + define: { + // setting vue-i18-next + // Suppress warning + __INTLIFY_PROD_DEVTOOLS__: false, + __APP_INFO__: JSON.stringify(__APP_INFO__), + }, + + css: { + preprocessorOptions: { + less: { + modifyVars: generateModifyVars(), + javascriptEnabled: true, + }, + }, + }, + + // The vite plugin used by the project. The quantity is large, so it is separately extracted and managed + plugins: createVitePlugins(viteEnv, isBuild), + + optimizeDeps: { + // @iconify/iconify: The dependency is dynamically and virtually loaded by @purge-icons/generated, so it needs to be specified explicitly + include: [ + '@vue/runtime-core', + '@vue/shared', + '@iconify/iconify', + 'ant-design-vue/es/locale/zh_CN', + 'ant-design-vue/es/locale/en_US', + ], + }, + }; +}; diff --git a/monolithic/frontend/windi.config.ts b/monolithic/frontend/windi.config.ts new file mode 100644 index 0000000..0f3d1f2 --- /dev/null +++ b/monolithic/frontend/windi.config.ts @@ -0,0 +1,74 @@ +import { defineConfig } from 'vite-plugin-windicss'; +import { primaryColor } from './build/config/themeConfig'; + +export default defineConfig({ + darkMode: 'class', + plugins: [createEnterPlugin()], + theme: { + extend: { + zIndex: { + '-1': '-1', + }, + colors: { + primary: primaryColor, + }, + screens: { + sm: '576px', + md: '768px', + lg: '992px', + xl: '1200px', + '2xl': '1600px', + }, + }, + }, +}); + +/** + * Used for animation when the element is displayed. + * @param maxOutput The larger the maxOutput output, the larger the generated css volume. + */ +function createEnterPlugin(maxOutput = 6) { + const createCss = (index: number, d = 'x') => { + const upd = d.toUpperCase(); + return { + [`*> .enter-${d}:nth-child(${index})`]: { + transform: `translate${upd}(50px)`, + }, + [`*> .-enter-${d}:nth-child(${index})`]: { + transform: `translate${upd}(-50px)`, + }, + [`* > .enter-${d}:nth-child(${index}),* > .-enter-${d}:nth-child(${index})`]: { + 'z-index': `${10 - index}`, + opacity: '0', + animation: `enter-${d}-animation 0.4s ease-in-out 0.3s`, + 'animation-fill-mode': 'forwards', + 'animation-delay': `${(index * 1) / 10}s`, + }, + }; + }; + const handler = ({ addBase }) => { + const addRawCss = {}; + for (let index = 1; index < maxOutput; index++) { + Object.assign(addRawCss, { + ...createCss(index, 'x'), + ...createCss(index, 'y'), + }); + } + addBase({ + ...addRawCss, + [`@keyframes enter-x-animation`]: { + to: { + opacity: '1', + transform: 'translateX(0)', + }, + }, + [`@keyframes enter-y-animation`]: { + to: { + opacity: '1', + transform: 'translateY(0)', + }, + }, + }); + }; + return { handler }; +} From 72e718a7c80226f3bf056a659cb2a1637ceb3fd4 Mon Sep 17 00:00:00 2001 From: tx7do Date: Mon, 15 Jan 2024 22:10:14 +0800 Subject: [PATCH 2/2] feat: add ent curd examples for ent and gorm. --- README-CN.md | 2 + README.md | 2 + orm/ent/.gitignore | 21 + orm/ent/LICENSE | 21 + orm/ent/Makefile | 80 + orm/ent/README.md | 1 + orm/ent/WORKSPACE | 143 + orm/ent/api/buf.lock | 23 + orm/ent/api/buf.yaml | 15 + orm/ent/api/common/conf/bootstrap.proto | 26 + orm/ent/api/common/conf/client.proto | 26 + orm/ent/api/common/conf/config.proto | 53 + orm/ent/api/common/conf/data.proto | 34 + orm/ent/api/common/conf/logger.proto | 55 + orm/ent/api/common/conf/middleware.proto | 38 + orm/ent/api/common/conf/oss.proto | 20 + orm/ent/api/common/conf/registry.proto | 82 + orm/ent/api/common/conf/server.proto | 75 + orm/ent/api/common/conf/tracer.proto | 13 + .../api/common/pagination/pagination.proto | 78 + orm/ent/api/third_party/README.md | 13 + orm/ent/api/third_party/buf.yaml | 7 + orm/ent/api/third_party/errors/errors.proto | 18 + .../openapi/discovery/v1/discovery.proto | 269 ++ .../gnostic/openapi/v2/openapiv2.proto | 665 ++++ .../third_party/gnostic/openapi/v3/README.md | 26 + .../gnostic/openapi/v3/annotations.proto | 60 + .../gnostic/openapi/v3/openapiv3.proto | 671 ++++ .../third_party/google/api/annotations.proto | 31 + .../google/api/field_behavior.proto | 90 + orm/ent/api/third_party/google/api/http.proto | 375 +++ .../api/third_party/google/api/httpbody.proto | 81 + .../api/third_party/google/protobuf/any.proto | 155 + .../api/third_party/google/protobuf/api.proto | 210 ++ .../google/protobuf/descriptor.proto | 885 +++++ .../google/protobuf/duration.proto | 116 + .../third_party/google/protobuf/empty.proto | 52 + .../google/protobuf/field_mask.proto | 245 ++ .../google/protobuf/source_context.proto | 48 + .../third_party/google/protobuf/struct.proto | 95 + .../google/protobuf/timestamp.proto | 138 + .../third_party/google/protobuf/type.proto | 187 ++ .../google/protobuf/wrappers.proto | 123 + orm/ent/api/third_party/validate/README.md | 3 + .../api/third_party/validate/validate.proto | 862 +++++ orm/ent/api/user/service/v1/user.proto | 74 + orm/ent/api/user/service/v1/user_error.proto | 33 + orm/ent/app.mk | 140 + orm/ent/app/user/service/.gitignore | 35 + orm/ent/app/user/service/LICENSE | 21 + orm/ent/app/user/service/Makefile | 1 + orm/ent/app/user/service/README.md | 1 + orm/ent/app/user/service/cmd/server/main.go | 50 + orm/ent/app/user/service/cmd/server/wire.go | 25 + .../app/user/service/cmd/server/wire_gen.go | 38 + .../app/user/service/configs/bootstrap.yaml | 33 + orm/ent/app/user/service/configs/logger.yaml | 31 + .../app/user/service/configs/registry.yaml | 50 + orm/ent/app/user/service/configs/remote.yaml | 6 + .../app/user/service/internal/biz/README.md | 1 + orm/ent/app/user/service/internal/biz/init.go | 8 + orm/ent/app/user/service/internal/biz/user.go | 72 + .../app/user/service/internal/data/README.md | 1 + .../app/user/service/internal/data/data.go | 43 + .../user/service/internal/data/ent/client.go | 317 ++ .../app/user/service/internal/data/ent/ent.go | 608 ++++ .../user/service/internal/data/ent/entql.go | 113 + .../internal/data/ent/enttest/enttest.go | 84 + .../service/internal/data/ent/hook/hook.go | 198 ++ .../internal/data/ent/migrate/migrate.go | 64 + .../internal/data/ent/migrate/schema.go | 53 + .../service/internal/data/ent/mutation.go | 851 +++++ .../internal/data/ent/predicate/predicate.go | 10 + .../internal/data/ent/privacy/privacy.go | 225 ++ .../user/service/internal/data/ent/runtime.go | 74 + .../internal/data/ent/runtime/runtime.go | 10 + .../service/internal/data/ent/schema/user.go | 76 + .../app/user/service/internal/data/ent/tx.go | 210 ++ .../user/service/internal/data/ent/user.go | 177 + .../service/internal/data/ent/user/user.go | 102 + .../service/internal/data/ent/user/where.go | 491 +++ .../service/internal/data/ent/user_create.go | 854 +++++ .../service/internal/data/ent/user_delete.go | 88 + .../service/internal/data/ent/user_query.go | 548 ++++ .../service/internal/data/ent/user_update.go | 489 +++ .../user/service/internal/data/ent_client.go | 43 + .../app/user/service/internal/data/init.go | 13 + .../app/user/service/internal/data/user.go | 150 + .../app/user/service/internal/server/grpc.go | 25 + .../app/user/service/internal/server/init.go | 8 + .../user/service/internal/service/README.md | 1 + .../app/user/service/internal/service/init.go | 10 + .../app/user/service/internal/service/user.go | 53 + orm/ent/buf.gen.yaml | 37 + orm/ent/buf.lock | 2 + orm/ent/buf.work.yaml | 3 + orm/ent/buf.yaml | 7 + .../gen/api/go/common/conf/bootstrap.pb.go | 260 ++ .../go/common/conf/bootstrap.pb.validate.go | 367 +++ orm/ent/gen/api/go/common/conf/client.pb.go | 325 ++ .../api/go/common/conf/client.pb.validate.go | 506 +++ orm/ent/gen/api/go/common/conf/config.pb.go | 687 ++++ .../api/go/common/conf/config.pb.validate.go | 978 ++++++ orm/ent/gen/api/go/common/conf/data.pb.go | 413 +++ .../api/go/common/conf/data.pb.validate.go | 525 +++ orm/ent/gen/api/go/common/conf/logger.pb.go | 663 ++++ .../api/go/common/conf/logger.pb.validate.go | 818 +++++ .../gen/api/go/common/conf/middleware.pb.go | 457 +++ .../go/common/conf/middleware.pb.validate.go | 550 ++++ orm/ent/gen/api/go/common/conf/oss.pb.go | 269 ++ .../gen/api/go/common/conf/oss.pb.validate.go | 276 ++ orm/ent/gen/api/go/common/conf/registry.pb.go | 972 ++++++ .../go/common/conf/registry.pb.validate.go | 1358 ++++++++ orm/ent/gen/api/go/common/conf/server.pb.go | 913 ++++++ .../api/go/common/conf/server.pb.validate.go | 1361 ++++++++ orm/ent/gen/api/go/common/conf/tracer.pb.go | 174 + .../api/go/common/conf/tracer.pb.validate.go | 142 + .../api/go/common/pagination/pagination.pb.go | 370 +++ .../pagination/pagination.pb.validate.go | 292 ++ orm/ent/gen/api/go/user/service/v1/user.pb.go | 695 ++++ .../go/user/service/v1/user.pb.validate.go | 876 +++++ .../api/go/user/service/v1/user_error.pb.go | 220 ++ .../user/service/v1/user_error.pb.validate.go | 36 + .../user/service/v1/user_error_errors.pb.go | 286 ++ .../api/go/user/service/v1/user_grpc.pb.go | 269 ++ orm/ent/go.mod | 199 ++ orm/ent/go.sum | 2449 ++++++++++++++ orm/ent/pkg/README.md | 1 + orm/ent/pkg/bootstrap/bootstrap.go | 35 + orm/ent/pkg/bootstrap/cli.go | 14 + orm/ent/pkg/bootstrap/config.go | 323 ++ orm/ent/pkg/bootstrap/daemon.go | 39 + orm/ent/pkg/bootstrap/flag.go | 35 + orm/ent/pkg/bootstrap/grpc.go | 69 + orm/ent/pkg/bootstrap/logger.go | 180 + orm/ent/pkg/bootstrap/oss.go | 25 + orm/ent/pkg/bootstrap/redis.go | 29 + orm/ent/pkg/bootstrap/registry.go | 284 ++ orm/ent/pkg/bootstrap/registry_test.go | 77 + orm/ent/pkg/bootstrap/rest.go | 65 + orm/ent/pkg/bootstrap/service_info.go | 30 + orm/ent/pkg/bootstrap/tracer.go | 84 + orm/ent/pkg/service/name.go | 5 + orm/gorm/.gitignore | 21 + orm/gorm/LICENSE | 21 + orm/gorm/Makefile | 80 + orm/gorm/README.md | 1 + orm/gorm/WORKSPACE | 143 + orm/gorm/api/buf.lock | 23 + orm/gorm/api/buf.yaml | 15 + orm/gorm/api/common/conf/bootstrap.proto | 26 + orm/gorm/api/common/conf/client.proto | 26 + orm/gorm/api/common/conf/config.proto | 53 + orm/gorm/api/common/conf/data.proto | 31 + orm/gorm/api/common/conf/logger.proto | 55 + orm/gorm/api/common/conf/middleware.proto | 38 + orm/gorm/api/common/conf/oss.proto | 20 + orm/gorm/api/common/conf/registry.proto | 82 + orm/gorm/api/common/conf/server.proto | 75 + orm/gorm/api/common/conf/tracer.proto | 13 + .../api/common/pagination/pagination.proto | 42 + orm/gorm/api/third_party/README.md | 13 + orm/gorm/api/third_party/buf.yaml | 7 + orm/gorm/api/third_party/errors/errors.proto | 18 + .../openapi/discovery/v1/discovery.proto | 269 ++ .../gnostic/openapi/v2/openapiv2.proto | 665 ++++ .../third_party/gnostic/openapi/v3/README.md | 26 + .../gnostic/openapi/v3/annotations.proto | 60 + .../gnostic/openapi/v3/openapiv3.proto | 671 ++++ .../third_party/google/api/annotations.proto | 31 + .../google/api/field_behavior.proto | 90 + .../api/third_party/google/api/http.proto | 375 +++ .../api/third_party/google/api/httpbody.proto | 81 + .../api/third_party/google/protobuf/any.proto | 155 + .../api/third_party/google/protobuf/api.proto | 210 ++ .../google/protobuf/descriptor.proto | 885 +++++ .../google/protobuf/duration.proto | 116 + .../third_party/google/protobuf/empty.proto | 52 + .../google/protobuf/field_mask.proto | 245 ++ .../google/protobuf/source_context.proto | 48 + .../third_party/google/protobuf/struct.proto | 95 + .../google/protobuf/timestamp.proto | 138 + .../third_party/google/protobuf/type.proto | 187 ++ .../google/protobuf/wrappers.proto | 123 + orm/gorm/api/third_party/validate/README.md | 3 + .../api/third_party/validate/validate.proto | 862 +++++ orm/gorm/api/user/service/v1/user.proto | 74 + orm/gorm/api/user/service/v1/user_error.proto | 33 + orm/gorm/app.mk | 140 + orm/gorm/app/user/service/.gitignore | 35 + orm/gorm/app/user/service/LICENSE | 21 + orm/gorm/app/user/service/Makefile | 1 + orm/gorm/app/user/service/README.md | 1 + orm/gorm/app/user/service/cmd/server/main.go | 50 + orm/gorm/app/user/service/cmd/server/wire.go | 25 + .../app/user/service/cmd/server/wire_gen.go | 38 + .../app/user/service/configs/bootstrap.yaml | 33 + orm/gorm/app/user/service/configs/logger.yaml | 31 + .../app/user/service/configs/registry.yaml | 50 + orm/gorm/app/user/service/configs/remote.yaml | 6 + .../app/user/service/internal/biz/README.md | 1 + .../app/user/service/internal/biz/init.go | 8 + .../app/user/service/internal/biz/user.go | 72 + .../app/user/service/internal/data/README.md | 1 + .../app/user/service/internal/data/data.go | 91 + .../app/user/service/internal/data/init.go | 13 + .../user/service/internal/data/models/user.go | 14 + .../app/user/service/internal/data/user.go | 132 + .../app/user/service/internal/server/grpc.go | 25 + .../app/user/service/internal/server/init.go | 8 + .../user/service/internal/service/README.md | 1 + .../app/user/service/internal/service/init.go | 10 + .../app/user/service/internal/service/user.go | 53 + orm/gorm/buf.gen.yaml | 37 + orm/gorm/buf.lock | 2 + orm/gorm/buf.work.yaml | 3 + orm/gorm/buf.yaml | 7 + .../gen/api/go/common/conf/bootstrap.pb.go | 260 ++ .../go/common/conf/bootstrap.pb.validate.go | 367 +++ orm/gorm/gen/api/go/common/conf/client.pb.go | 325 ++ .../api/go/common/conf/client.pb.validate.go | 506 +++ orm/gorm/gen/api/go/common/conf/config.pb.go | 687 ++++ .../api/go/common/conf/config.pb.validate.go | 978 ++++++ orm/gorm/gen/api/go/common/conf/data.pb.go | 377 +++ .../api/go/common/conf/data.pb.validate.go | 492 +++ orm/gorm/gen/api/go/common/conf/logger.pb.go | 663 ++++ .../api/go/common/conf/logger.pb.validate.go | 818 +++++ .../gen/api/go/common/conf/middleware.pb.go | 457 +++ .../go/common/conf/middleware.pb.validate.go | 550 ++++ orm/gorm/gen/api/go/common/conf/oss.pb.go | 269 ++ .../gen/api/go/common/conf/oss.pb.validate.go | 276 ++ .../gen/api/go/common/conf/registry.pb.go | 972 ++++++ .../go/common/conf/registry.pb.validate.go | 1358 ++++++++ orm/gorm/gen/api/go/common/conf/server.pb.go | 913 ++++++ .../api/go/common/conf/server.pb.validate.go | 1361 ++++++++ orm/gorm/gen/api/go/common/conf/tracer.pb.go | 174 + .../api/go/common/conf/tracer.pb.validate.go | 142 + .../api/go/common/pagination/pagination.pb.go | 352 ++ .../pagination/pagination.pb.validate.go | 288 ++ .../gen/api/go/user/service/v1/user.pb.go | 695 ++++ .../go/user/service/v1/user.pb.validate.go | 876 +++++ .../api/go/user/service/v1/user_error.pb.go | 220 ++ .../user/service/v1/user_error.pb.validate.go | 36 + .../user/service/v1/user_error_errors.pb.go | 286 ++ .../api/go/user/service/v1/user_grpc.pb.go | 269 ++ orm/gorm/go.mod | 203 ++ orm/gorm/go.sum | 2916 +++++++++++++++++ orm/gorm/pkg/README.md | 1 + orm/gorm/pkg/bootstrap/bootstrap.go | 35 + orm/gorm/pkg/bootstrap/cli.go | 14 + orm/gorm/pkg/bootstrap/config.go | 323 ++ orm/gorm/pkg/bootstrap/daemon.go | 39 + orm/gorm/pkg/bootstrap/flag.go | 35 + orm/gorm/pkg/bootstrap/grpc.go | 69 + orm/gorm/pkg/bootstrap/logger.go | 180 + orm/gorm/pkg/bootstrap/oss.go | 25 + orm/gorm/pkg/bootstrap/redis.go | 29 + orm/gorm/pkg/bootstrap/registry.go | 284 ++ orm/gorm/pkg/bootstrap/registry_test.go | 77 + orm/gorm/pkg/bootstrap/rest.go | 65 + orm/gorm/pkg/bootstrap/service_info.go | 30 + orm/gorm/pkg/bootstrap/tracer.go | 84 + orm/gorm/pkg/service/name.go | 5 + orm/gorm/tests/user.http | 22 + 264 files changed, 58500 insertions(+) create mode 100644 orm/ent/.gitignore create mode 100644 orm/ent/LICENSE create mode 100644 orm/ent/Makefile create mode 100644 orm/ent/README.md create mode 100644 orm/ent/WORKSPACE create mode 100644 orm/ent/api/buf.lock create mode 100644 orm/ent/api/buf.yaml create mode 100644 orm/ent/api/common/conf/bootstrap.proto create mode 100644 orm/ent/api/common/conf/client.proto create mode 100644 orm/ent/api/common/conf/config.proto create mode 100644 orm/ent/api/common/conf/data.proto create mode 100644 orm/ent/api/common/conf/logger.proto create mode 100644 orm/ent/api/common/conf/middleware.proto create mode 100644 orm/ent/api/common/conf/oss.proto create mode 100644 orm/ent/api/common/conf/registry.proto create mode 100644 orm/ent/api/common/conf/server.proto create mode 100644 orm/ent/api/common/conf/tracer.proto create mode 100644 orm/ent/api/common/pagination/pagination.proto create mode 100644 orm/ent/api/third_party/README.md create mode 100644 orm/ent/api/third_party/buf.yaml create mode 100644 orm/ent/api/third_party/errors/errors.proto create mode 100644 orm/ent/api/third_party/gnostic/openapi/discovery/v1/discovery.proto create mode 100644 orm/ent/api/third_party/gnostic/openapi/v2/openapiv2.proto create mode 100644 orm/ent/api/third_party/gnostic/openapi/v3/README.md create mode 100644 orm/ent/api/third_party/gnostic/openapi/v3/annotations.proto create mode 100644 orm/ent/api/third_party/gnostic/openapi/v3/openapiv3.proto create mode 100644 orm/ent/api/third_party/google/api/annotations.proto create mode 100644 orm/ent/api/third_party/google/api/field_behavior.proto create mode 100644 orm/ent/api/third_party/google/api/http.proto create mode 100644 orm/ent/api/third_party/google/api/httpbody.proto create mode 100644 orm/ent/api/third_party/google/protobuf/any.proto create mode 100644 orm/ent/api/third_party/google/protobuf/api.proto create mode 100644 orm/ent/api/third_party/google/protobuf/descriptor.proto create mode 100644 orm/ent/api/third_party/google/protobuf/duration.proto create mode 100644 orm/ent/api/third_party/google/protobuf/empty.proto create mode 100644 orm/ent/api/third_party/google/protobuf/field_mask.proto create mode 100644 orm/ent/api/third_party/google/protobuf/source_context.proto create mode 100644 orm/ent/api/third_party/google/protobuf/struct.proto create mode 100644 orm/ent/api/third_party/google/protobuf/timestamp.proto create mode 100644 orm/ent/api/third_party/google/protobuf/type.proto create mode 100644 orm/ent/api/third_party/google/protobuf/wrappers.proto create mode 100644 orm/ent/api/third_party/validate/README.md create mode 100644 orm/ent/api/third_party/validate/validate.proto create mode 100644 orm/ent/api/user/service/v1/user.proto create mode 100644 orm/ent/api/user/service/v1/user_error.proto create mode 100644 orm/ent/app.mk create mode 100644 orm/ent/app/user/service/.gitignore create mode 100644 orm/ent/app/user/service/LICENSE create mode 100644 orm/ent/app/user/service/Makefile create mode 100644 orm/ent/app/user/service/README.md create mode 100644 orm/ent/app/user/service/cmd/server/main.go create mode 100644 orm/ent/app/user/service/cmd/server/wire.go create mode 100644 orm/ent/app/user/service/cmd/server/wire_gen.go create mode 100644 orm/ent/app/user/service/configs/bootstrap.yaml create mode 100644 orm/ent/app/user/service/configs/logger.yaml create mode 100644 orm/ent/app/user/service/configs/registry.yaml create mode 100644 orm/ent/app/user/service/configs/remote.yaml create mode 100644 orm/ent/app/user/service/internal/biz/README.md create mode 100644 orm/ent/app/user/service/internal/biz/init.go create mode 100644 orm/ent/app/user/service/internal/biz/user.go create mode 100644 orm/ent/app/user/service/internal/data/README.md create mode 100644 orm/ent/app/user/service/internal/data/data.go create mode 100644 orm/ent/app/user/service/internal/data/ent/client.go create mode 100644 orm/ent/app/user/service/internal/data/ent/ent.go create mode 100644 orm/ent/app/user/service/internal/data/ent/entql.go create mode 100644 orm/ent/app/user/service/internal/data/ent/enttest/enttest.go create mode 100644 orm/ent/app/user/service/internal/data/ent/hook/hook.go create mode 100644 orm/ent/app/user/service/internal/data/ent/migrate/migrate.go create mode 100644 orm/ent/app/user/service/internal/data/ent/migrate/schema.go create mode 100644 orm/ent/app/user/service/internal/data/ent/mutation.go create mode 100644 orm/ent/app/user/service/internal/data/ent/predicate/predicate.go create mode 100644 orm/ent/app/user/service/internal/data/ent/privacy/privacy.go create mode 100644 orm/ent/app/user/service/internal/data/ent/runtime.go create mode 100644 orm/ent/app/user/service/internal/data/ent/runtime/runtime.go create mode 100644 orm/ent/app/user/service/internal/data/ent/schema/user.go create mode 100644 orm/ent/app/user/service/internal/data/ent/tx.go create mode 100644 orm/ent/app/user/service/internal/data/ent/user.go create mode 100644 orm/ent/app/user/service/internal/data/ent/user/user.go create mode 100644 orm/ent/app/user/service/internal/data/ent/user/where.go create mode 100644 orm/ent/app/user/service/internal/data/ent/user_create.go create mode 100644 orm/ent/app/user/service/internal/data/ent/user_delete.go create mode 100644 orm/ent/app/user/service/internal/data/ent/user_query.go create mode 100644 orm/ent/app/user/service/internal/data/ent/user_update.go create mode 100644 orm/ent/app/user/service/internal/data/ent_client.go create mode 100644 orm/ent/app/user/service/internal/data/init.go create mode 100644 orm/ent/app/user/service/internal/data/user.go create mode 100644 orm/ent/app/user/service/internal/server/grpc.go create mode 100644 orm/ent/app/user/service/internal/server/init.go create mode 100644 orm/ent/app/user/service/internal/service/README.md create mode 100644 orm/ent/app/user/service/internal/service/init.go create mode 100644 orm/ent/app/user/service/internal/service/user.go create mode 100644 orm/ent/buf.gen.yaml create mode 100644 orm/ent/buf.lock create mode 100644 orm/ent/buf.work.yaml create mode 100644 orm/ent/buf.yaml create mode 100644 orm/ent/gen/api/go/common/conf/bootstrap.pb.go create mode 100644 orm/ent/gen/api/go/common/conf/bootstrap.pb.validate.go create mode 100644 orm/ent/gen/api/go/common/conf/client.pb.go create mode 100644 orm/ent/gen/api/go/common/conf/client.pb.validate.go create mode 100644 orm/ent/gen/api/go/common/conf/config.pb.go create mode 100644 orm/ent/gen/api/go/common/conf/config.pb.validate.go create mode 100644 orm/ent/gen/api/go/common/conf/data.pb.go create mode 100644 orm/ent/gen/api/go/common/conf/data.pb.validate.go create mode 100644 orm/ent/gen/api/go/common/conf/logger.pb.go create mode 100644 orm/ent/gen/api/go/common/conf/logger.pb.validate.go create mode 100644 orm/ent/gen/api/go/common/conf/middleware.pb.go create mode 100644 orm/ent/gen/api/go/common/conf/middleware.pb.validate.go create mode 100644 orm/ent/gen/api/go/common/conf/oss.pb.go create mode 100644 orm/ent/gen/api/go/common/conf/oss.pb.validate.go create mode 100644 orm/ent/gen/api/go/common/conf/registry.pb.go create mode 100644 orm/ent/gen/api/go/common/conf/registry.pb.validate.go create mode 100644 orm/ent/gen/api/go/common/conf/server.pb.go create mode 100644 orm/ent/gen/api/go/common/conf/server.pb.validate.go create mode 100644 orm/ent/gen/api/go/common/conf/tracer.pb.go create mode 100644 orm/ent/gen/api/go/common/conf/tracer.pb.validate.go create mode 100644 orm/ent/gen/api/go/common/pagination/pagination.pb.go create mode 100644 orm/ent/gen/api/go/common/pagination/pagination.pb.validate.go create mode 100644 orm/ent/gen/api/go/user/service/v1/user.pb.go create mode 100644 orm/ent/gen/api/go/user/service/v1/user.pb.validate.go create mode 100644 orm/ent/gen/api/go/user/service/v1/user_error.pb.go create mode 100644 orm/ent/gen/api/go/user/service/v1/user_error.pb.validate.go create mode 100644 orm/ent/gen/api/go/user/service/v1/user_error_errors.pb.go create mode 100644 orm/ent/gen/api/go/user/service/v1/user_grpc.pb.go create mode 100644 orm/ent/go.mod create mode 100644 orm/ent/go.sum create mode 100644 orm/ent/pkg/README.md create mode 100644 orm/ent/pkg/bootstrap/bootstrap.go create mode 100644 orm/ent/pkg/bootstrap/cli.go create mode 100644 orm/ent/pkg/bootstrap/config.go create mode 100644 orm/ent/pkg/bootstrap/daemon.go create mode 100644 orm/ent/pkg/bootstrap/flag.go create mode 100644 orm/ent/pkg/bootstrap/grpc.go create mode 100644 orm/ent/pkg/bootstrap/logger.go create mode 100644 orm/ent/pkg/bootstrap/oss.go create mode 100644 orm/ent/pkg/bootstrap/redis.go create mode 100644 orm/ent/pkg/bootstrap/registry.go create mode 100644 orm/ent/pkg/bootstrap/registry_test.go create mode 100644 orm/ent/pkg/bootstrap/rest.go create mode 100644 orm/ent/pkg/bootstrap/service_info.go create mode 100644 orm/ent/pkg/bootstrap/tracer.go create mode 100644 orm/ent/pkg/service/name.go create mode 100644 orm/gorm/.gitignore create mode 100644 orm/gorm/LICENSE create mode 100644 orm/gorm/Makefile create mode 100644 orm/gorm/README.md create mode 100644 orm/gorm/WORKSPACE create mode 100644 orm/gorm/api/buf.lock create mode 100644 orm/gorm/api/buf.yaml create mode 100644 orm/gorm/api/common/conf/bootstrap.proto create mode 100644 orm/gorm/api/common/conf/client.proto create mode 100644 orm/gorm/api/common/conf/config.proto create mode 100644 orm/gorm/api/common/conf/data.proto create mode 100644 orm/gorm/api/common/conf/logger.proto create mode 100644 orm/gorm/api/common/conf/middleware.proto create mode 100644 orm/gorm/api/common/conf/oss.proto create mode 100644 orm/gorm/api/common/conf/registry.proto create mode 100644 orm/gorm/api/common/conf/server.proto create mode 100644 orm/gorm/api/common/conf/tracer.proto create mode 100644 orm/gorm/api/common/pagination/pagination.proto create mode 100644 orm/gorm/api/third_party/README.md create mode 100644 orm/gorm/api/third_party/buf.yaml create mode 100644 orm/gorm/api/third_party/errors/errors.proto create mode 100644 orm/gorm/api/third_party/gnostic/openapi/discovery/v1/discovery.proto create mode 100644 orm/gorm/api/third_party/gnostic/openapi/v2/openapiv2.proto create mode 100644 orm/gorm/api/third_party/gnostic/openapi/v3/README.md create mode 100644 orm/gorm/api/third_party/gnostic/openapi/v3/annotations.proto create mode 100644 orm/gorm/api/third_party/gnostic/openapi/v3/openapiv3.proto create mode 100644 orm/gorm/api/third_party/google/api/annotations.proto create mode 100644 orm/gorm/api/third_party/google/api/field_behavior.proto create mode 100644 orm/gorm/api/third_party/google/api/http.proto create mode 100644 orm/gorm/api/third_party/google/api/httpbody.proto create mode 100644 orm/gorm/api/third_party/google/protobuf/any.proto create mode 100644 orm/gorm/api/third_party/google/protobuf/api.proto create mode 100644 orm/gorm/api/third_party/google/protobuf/descriptor.proto create mode 100644 orm/gorm/api/third_party/google/protobuf/duration.proto create mode 100644 orm/gorm/api/third_party/google/protobuf/empty.proto create mode 100644 orm/gorm/api/third_party/google/protobuf/field_mask.proto create mode 100644 orm/gorm/api/third_party/google/protobuf/source_context.proto create mode 100644 orm/gorm/api/third_party/google/protobuf/struct.proto create mode 100644 orm/gorm/api/third_party/google/protobuf/timestamp.proto create mode 100644 orm/gorm/api/third_party/google/protobuf/type.proto create mode 100644 orm/gorm/api/third_party/google/protobuf/wrappers.proto create mode 100644 orm/gorm/api/third_party/validate/README.md create mode 100644 orm/gorm/api/third_party/validate/validate.proto create mode 100644 orm/gorm/api/user/service/v1/user.proto create mode 100644 orm/gorm/api/user/service/v1/user_error.proto create mode 100644 orm/gorm/app.mk create mode 100644 orm/gorm/app/user/service/.gitignore create mode 100644 orm/gorm/app/user/service/LICENSE create mode 100644 orm/gorm/app/user/service/Makefile create mode 100644 orm/gorm/app/user/service/README.md create mode 100644 orm/gorm/app/user/service/cmd/server/main.go create mode 100644 orm/gorm/app/user/service/cmd/server/wire.go create mode 100644 orm/gorm/app/user/service/cmd/server/wire_gen.go create mode 100644 orm/gorm/app/user/service/configs/bootstrap.yaml create mode 100644 orm/gorm/app/user/service/configs/logger.yaml create mode 100644 orm/gorm/app/user/service/configs/registry.yaml create mode 100644 orm/gorm/app/user/service/configs/remote.yaml create mode 100644 orm/gorm/app/user/service/internal/biz/README.md create mode 100644 orm/gorm/app/user/service/internal/biz/init.go create mode 100644 orm/gorm/app/user/service/internal/biz/user.go create mode 100644 orm/gorm/app/user/service/internal/data/README.md create mode 100644 orm/gorm/app/user/service/internal/data/data.go create mode 100644 orm/gorm/app/user/service/internal/data/init.go create mode 100644 orm/gorm/app/user/service/internal/data/models/user.go create mode 100644 orm/gorm/app/user/service/internal/data/user.go create mode 100644 orm/gorm/app/user/service/internal/server/grpc.go create mode 100644 orm/gorm/app/user/service/internal/server/init.go create mode 100644 orm/gorm/app/user/service/internal/service/README.md create mode 100644 orm/gorm/app/user/service/internal/service/init.go create mode 100644 orm/gorm/app/user/service/internal/service/user.go create mode 100644 orm/gorm/buf.gen.yaml create mode 100644 orm/gorm/buf.lock create mode 100644 orm/gorm/buf.work.yaml create mode 100644 orm/gorm/buf.yaml create mode 100644 orm/gorm/gen/api/go/common/conf/bootstrap.pb.go create mode 100644 orm/gorm/gen/api/go/common/conf/bootstrap.pb.validate.go create mode 100644 orm/gorm/gen/api/go/common/conf/client.pb.go create mode 100644 orm/gorm/gen/api/go/common/conf/client.pb.validate.go create mode 100644 orm/gorm/gen/api/go/common/conf/config.pb.go create mode 100644 orm/gorm/gen/api/go/common/conf/config.pb.validate.go create mode 100644 orm/gorm/gen/api/go/common/conf/data.pb.go create mode 100644 orm/gorm/gen/api/go/common/conf/data.pb.validate.go create mode 100644 orm/gorm/gen/api/go/common/conf/logger.pb.go create mode 100644 orm/gorm/gen/api/go/common/conf/logger.pb.validate.go create mode 100644 orm/gorm/gen/api/go/common/conf/middleware.pb.go create mode 100644 orm/gorm/gen/api/go/common/conf/middleware.pb.validate.go create mode 100644 orm/gorm/gen/api/go/common/conf/oss.pb.go create mode 100644 orm/gorm/gen/api/go/common/conf/oss.pb.validate.go create mode 100644 orm/gorm/gen/api/go/common/conf/registry.pb.go create mode 100644 orm/gorm/gen/api/go/common/conf/registry.pb.validate.go create mode 100644 orm/gorm/gen/api/go/common/conf/server.pb.go create mode 100644 orm/gorm/gen/api/go/common/conf/server.pb.validate.go create mode 100644 orm/gorm/gen/api/go/common/conf/tracer.pb.go create mode 100644 orm/gorm/gen/api/go/common/conf/tracer.pb.validate.go create mode 100644 orm/gorm/gen/api/go/common/pagination/pagination.pb.go create mode 100644 orm/gorm/gen/api/go/common/pagination/pagination.pb.validate.go create mode 100644 orm/gorm/gen/api/go/user/service/v1/user.pb.go create mode 100644 orm/gorm/gen/api/go/user/service/v1/user.pb.validate.go create mode 100644 orm/gorm/gen/api/go/user/service/v1/user_error.pb.go create mode 100644 orm/gorm/gen/api/go/user/service/v1/user_error.pb.validate.go create mode 100644 orm/gorm/gen/api/go/user/service/v1/user_error_errors.pb.go create mode 100644 orm/gorm/gen/api/go/user/service/v1/user_grpc.pb.go create mode 100644 orm/gorm/go.mod create mode 100644 orm/gorm/go.sum create mode 100644 orm/gorm/pkg/README.md create mode 100644 orm/gorm/pkg/bootstrap/bootstrap.go create mode 100644 orm/gorm/pkg/bootstrap/cli.go create mode 100644 orm/gorm/pkg/bootstrap/config.go create mode 100644 orm/gorm/pkg/bootstrap/daemon.go create mode 100644 orm/gorm/pkg/bootstrap/flag.go create mode 100644 orm/gorm/pkg/bootstrap/grpc.go create mode 100644 orm/gorm/pkg/bootstrap/logger.go create mode 100644 orm/gorm/pkg/bootstrap/oss.go create mode 100644 orm/gorm/pkg/bootstrap/redis.go create mode 100644 orm/gorm/pkg/bootstrap/registry.go create mode 100644 orm/gorm/pkg/bootstrap/registry_test.go create mode 100644 orm/gorm/pkg/bootstrap/rest.go create mode 100644 orm/gorm/pkg/bootstrap/service_info.go create mode 100644 orm/gorm/pkg/bootstrap/tracer.go create mode 100644 orm/gorm/pkg/service/name.go create mode 100644 orm/gorm/tests/user.http diff --git a/README-CN.md b/README-CN.md index 03de883..ca1472f 100644 --- a/README-CN.md +++ b/README-CN.md @@ -31,3 +31,5 @@ | [validate](./validate) | Protobuf 参数校验器使用示例 | | [ws](./ws) | 最简单的 Websocket 示例 | | [monolithic](./monolithic) | 巨石系统(单体系统)应用实例,包含前后端。 | +| [ent orm](./orm/ent/) | Ent 的 CURD 完整应用实例。 | +| [gorm](./monolithic) | GORM 的 CURD 完整应用实例。 | diff --git a/README.md b/README.md index 1aba29a..44b0d9f 100644 --- a/README.md +++ b/README.md @@ -31,3 +31,5 @@ English | [简体中文](README-CN.md) | [validate](./validate) | Example of Protobuf parameter validator usage | | [ws](./ws) | ws is implementation of transport interface with websocket example | | [monolithic](./monolithic) | Monolithic Application example, including frontend and backends. | +| [ent orm](./orm/ent/) | CURD full application example of Ent. | +| [gorm](./monolithic) | CURD full application example of GORM. | diff --git a/orm/ent/.gitignore b/orm/ent/.gitignore new file mode 100644 index 0000000..3b735ec --- /dev/null +++ b/orm/ent/.gitignore @@ -0,0 +1,21 @@ +# If you prefer the allow list template instead of the deny list, see community template: +# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore +# +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ + +# Go workspace file +go.work diff --git a/orm/ent/LICENSE b/orm/ent/LICENSE new file mode 100644 index 0000000..0ceaadc --- /dev/null +++ b/orm/ent/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Bobo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/orm/ent/Makefile b/orm/ent/Makefile new file mode 100644 index 0000000..82703b9 --- /dev/null +++ b/orm/ent/Makefile @@ -0,0 +1,80 @@ +# Not Support Windows + +.PHONY: help wire conf ent build api openapi init all + +ifeq ($(OS),Windows_NT) + IS_WINDOWS:=1 +endif + +CURRENT_DIR := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST))))) +ROOT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST)))) + +SRCS_MK := $(foreach dir, app, $(wildcard $(dir)/*/*/Makefile)) + +# generate wire code +wire: + $(foreach dir, $(dir $(realpath $(SRCS_MK))),\ + cd $(dir);\ + make wire;\ + ) + +# generate config define code +conf: + $(foreach dir, $(dir $(realpath $(SRCS_MK))),\ + cd $(dir);\ + make conf;\ + ) + +# generate ent code +ent: + $(foreach dir, $(dir $(realpath $(SRCS_MK))),\ + cd $(dir);\ + make ent;\ + ) + +# generate protobuf api go code +api: + buf generate + +# generate OpenAPI v3 docs. +openapi: + buf generate --path api/admin/service/v1 --template api/admin/service/v1/buf.openapi.gen.yaml + buf generate --path api/front/service/v1 --template api/front/service/v1/buf.openapi.gen.yaml + +# initialize develop environment +init: + cd $(lastword $(dir $(realpath $(SRCS_MK))));\ + make init; + +# build all service applications +build: + $(foreach dir, $(dir $(realpath $(SRCS_MK))),\ + cd $(dir);\ + make build;\ + ) + +# generate & build all service applications +all: + $(foreach dir, $(dir $(realpath $(SRCS_MK))),\ + cd $(dir);\ + make app;\ + ) + +# show help +help: + @echo "" + @echo "Usage:" + @echo " make [target]" + @echo "" + @echo 'Targets:' + @awk '/^[a-zA-Z\-_0-9]+:/ { \ + helpMessage = match(lastLine, /^# (.*)/); \ + if (helpMessage) { \ + helpCommand = substr($$1, 0, index($$1, ":")-1); \ + helpMessage = substr(lastLine, RSTART + 2, RLENGTH); \ + printf "\033[36m%-22s\033[0m %s\n", helpCommand,helpMessage; \ + } \ + } \ + { lastLine = $$0 }' $(MAKEFILE_LIST) + +.DEFAULT_GOAL := help diff --git a/orm/ent/README.md b/orm/ent/README.md new file mode 100644 index 0000000..5e2d2bf --- /dev/null +++ b/orm/ent/README.md @@ -0,0 +1 @@ +# Kratos Ent ORM实例 diff --git a/orm/ent/WORKSPACE b/orm/ent/WORKSPACE new file mode 100644 index 0000000..09dd45e --- /dev/null +++ b/orm/ent/WORKSPACE @@ -0,0 +1,143 @@ +# gazelle:repo bazel_gazelle +workspace(name = "com_github_tx7do_kratos_blog") + +######################################### +## 下载所需要的软件包 +######################################### + +load("//:DOWNLOAD.bzl", "download_package") + +download_package() + +######################################### +## Bazel Go语言 规则集 初始化 +######################################### + +load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") + +go_rules_dependencies() + +go_register_toolchains(version = "1.19.5") + +######################################### +## Bazel Gazelle 规则集 初始化 +######################################### + +load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") +load("//:repos.bzl", "go_dependencies") + +# gazelle:repository_macro repos.bzl%go_dependencies +go_dependencies() + +gazelle_dependencies() + +######################################### +## Bazel Docker 规则集 初始化 +######################################### + +load( + "@io_bazel_rules_docker//repositories:repositories.bzl", + container_repositories = "repositories", +) + +container_repositories() + +load("@io_bazel_rules_docker//repositories:deps.bzl", container_deps = "deps") + +container_deps() + +load("@io_bazel_rules_docker//container:pull.bzl", "container_pull") + +# 拉取Alpine Linux +# 该发行版使用musl libc,并且缺乏一些调试工具。 +container_pull( + name = "alpine_linux_amd64", + registry = "index.docker.io", + repository = "library/alpine", + tag = "latest", +) + +# 拉取Debian-Slim Linux +container_pull( + name = "slim_linux_amd64", + registry = "index.docker.io", + repository = "library/debian", + tag = "stable-slim", +) + +# 拉取Centos Linux +container_pull( + name = "centos_linux_amd64", + registry = "index.docker.io", + repository = "library/centos", + tag = "7", +) + +# 拉取Ubuntu Linux +container_pull( + name = "ubuntu_linux_amd64", + registry = "index.docker.io", + repository = "library/ubuntu", + tag = "latest", +) + +######################################### +## Bazel Kubernetes 规则集 初始化 +######################################### + +load("@io_bazel_rules_k8s//k8s:k8s.bzl", "k8s_repositories") + +k8s_repositories() + +######################################### +## Bazel pkg 规则集 初始化 +######################################### + +load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") + +rules_pkg_dependencies() + +######################################### +## Bazel protoc 初始化 +######################################### + +load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") + +protobuf_deps() + +######################################### +## Bazel Buf 规则集 初始化 +######################################### + +# load("@rules_buf//buf:repositories.bzl", "rules_buf_dependencies", "rules_buf_toolchains") +# load("@rules_buf//gazelle/buf:repositories.bzl", "gazelle_buf_dependencies") +# load("//:buf_deps.bzl", "buf_deps") + +# # gazelle:repository_macro buf_deps.bzl%buf_deps +# buf_deps() + +# rules_buf_dependencies() + +# rules_buf_toolchains(version = "v1.12.0") + +# gazelle_buf_dependencies() + +######################################### +## Bazel gPRC 规则集 初始化 +######################################### + +# load("@rules_proto_grpc//:repositories.bzl", "rules_proto_grpc_repos", "rules_proto_grpc_toolchains") + +# rules_proto_grpc_toolchains() + +# rules_proto_grpc_repos() + +######################################### +## Bazel Protobuf 规则集 初始化 +######################################### + +# load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") + +# rules_proto_dependencies() + +# rules_proto_toolchains() diff --git a/orm/ent/api/buf.lock b/orm/ent/api/buf.lock new file mode 100644 index 0000000..afdc004 --- /dev/null +++ b/orm/ent/api/buf.lock @@ -0,0 +1,23 @@ +# Generated by buf. DO NOT EDIT. +version: v1 +deps: + - remote: buf.build + owner: envoyproxy + repository: protoc-gen-validate + commit: 6607b10f00ed4a3d98f906807131c44a + - remote: buf.build + owner: gogo + repository: protobuf + commit: 5461a3dfa9d941da82028ab185dc2a0e + - remote: buf.build + owner: googleapis + repository: googleapis + commit: 75b4300737fb4efca0831636be94e517 + - remote: buf.build + owner: kratos + repository: apis + commit: c2de25f14fa445a79a054214f31d17a8 + - remote: buf.build + owner: tx7do + repository: gnostic + commit: b9ecfa10359449f681e6e12b50b78f98 diff --git a/orm/ent/api/buf.yaml b/orm/ent/api/buf.yaml new file mode 100644 index 0000000..c332ac4 --- /dev/null +++ b/orm/ent/api/buf.yaml @@ -0,0 +1,15 @@ +version: v1 +build: + excludes: [third_party] +deps: + - buf.build/googleapis/googleapis + - buf.build/envoyproxy/protoc-gen-validate + - buf.build/kratos/apis + - buf.build/tx7do/gnostic + - buf.build/gogo/protobuf +breaking: + use: + - FILE +lint: + use: + - DEFAULT diff --git a/orm/ent/api/common/conf/bootstrap.proto b/orm/ent/api/common/conf/bootstrap.proto new file mode 100644 index 0000000..1eea302 --- /dev/null +++ b/orm/ent/api/common/conf/bootstrap.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +package common.conf; + +option go_package = "kratos-ent-example/gen/api/go/common/conf;conf"; + +import "common/conf/tracer.proto"; +import "common/conf/data.proto"; +import "common/conf/server.proto"; +import "common/conf/client.proto"; +import "common/conf/logger.proto"; +import "common/conf/registry.proto"; +import "common/conf/oss.proto"; +import "common/conf/config.proto"; + +// 引导信息 +message Bootstrap { + Server server = 1; + Client client = 2; + Data data = 3; + Tracer trace = 4; + Logger logger = 5; + Registry registry = 6; + RemoteConfig config = 7; + OSS oss = 8; +} diff --git a/orm/ent/api/common/conf/client.proto b/orm/ent/api/common/conf/client.proto new file mode 100644 index 0000000..4dd9dd2 --- /dev/null +++ b/orm/ent/api/common/conf/client.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +package common.conf; + +option go_package = "kratos-ent-example/gen/api/go/common/conf;conf"; + +import "google/protobuf/duration.proto"; +import "common/conf/middleware.proto"; + +// 客户端 +message Client { + // REST + message REST { + google.protobuf.Duration timeout = 1; // 超时时间 + Middleware middleware = 2; + } + + // gPRC + message GRPC { + google.protobuf.Duration timeout = 1; // 超时时间 + Middleware middleware = 2; + } + + REST rest = 1; // REST服务 + GRPC grpc = 2; // gRPC服务 +} diff --git a/orm/ent/api/common/conf/config.proto b/orm/ent/api/common/conf/config.proto new file mode 100644 index 0000000..7b2c30c --- /dev/null +++ b/orm/ent/api/common/conf/config.proto @@ -0,0 +1,53 @@ +syntax = "proto3"; + +package common.conf; + +option go_package = "kratos-ent-example/gen/api/go/common/conf;conf"; + +import "google/protobuf/duration.proto"; + +// 配置服务 +message RemoteConfig { + message Nacos { + string address = 1; // 服务端地址 + uint64 port = 2; // 服务端端口 + string key = 3; // + } + + message Etcd { + repeated string endpoints = 1; + google.protobuf.Duration timeout = 2; + string key = 3; // + } + + message Consul { + string scheme = 1; // 网络样式 + string address = 2; // 服务端地址 + string key = 3; // + } + + message Apollo { + string endpoint = 1; + string app_id = 2; + string cluster = 3; + string namespace = 4; + string secret = 5; + } + + message Kubernetes { + string namespace = 1; + } + + message Polaris { + + } + + string type = 1; + + Etcd etcd = 2; + Consul consul = 3; + Nacos nacos = 4; + Apollo apollo = 6; + Kubernetes kubernetes = 7; + Polaris polaris = 8; +} diff --git a/orm/ent/api/common/conf/data.proto b/orm/ent/api/common/conf/data.proto new file mode 100644 index 0000000..728b77c --- /dev/null +++ b/orm/ent/api/common/conf/data.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; + +package common.conf; + +option go_package = "kratos-ent-example/gen/api/go/common/conf;conf"; + +import "google/protobuf/duration.proto"; + +// 数据 +message Data { + // 数据库 + message Database { + string driver = 1; // 驱动名:mysql、postgresql、mongodb、sqlite…… + string source = 2; // 数据源(DSN字符串) + bool migrate = 3; // 数据迁移开关 + int32 max_idle_connections = 4; // 连接池最大空闲连接数 + int32 max_open_connections = 5; // 连接池最大打开连接数 + google.protobuf.Duration connection_max_lifetime = 6; // 连接可重用的最大时间长度 + } + + // redis + message Redis { + string network = 1; // 网络 + string addr = 2; // 服务端地址 + string password = 3; // 密码 + int32 db = 4; // 数据库索引 + google.protobuf.Duration dial_timeout = 5; // 连接超时时间 + google.protobuf.Duration read_timeout = 6; // 读取超时时间 + google.protobuf.Duration write_timeout = 7; // 写入超时时间 + } + + Database database = 1; // 数据库 + Redis redis = 2; // Redis +} diff --git a/orm/ent/api/common/conf/logger.proto b/orm/ent/api/common/conf/logger.proto new file mode 100644 index 0000000..44a1f01 --- /dev/null +++ b/orm/ent/api/common/conf/logger.proto @@ -0,0 +1,55 @@ +syntax = "proto3"; + +package common.conf; + +option go_package = "kratos-ent-example/gen/api/go/common/conf;conf"; + +// 日志 +message Logger { + // Zap + message Zap { + string filename = 1; // + string level = 2; // + int32 max_size = 3; // + int32 max_age = 4; // + int32 max_backups = 5; // + } + + // logrus + message Logrus { + string level = 1; // 日志等级 + string formatter = 2; // 输出格式:text, json. + string timestamp_format = 3; // 定义时间戳格式,例如:"2006-01-02 15:04:05" + bool disable_colors = 4; // 不需要彩色日志 + bool disable_timestamp = 5; // 不需要时间戳 + } + + // Fluent + message Fluent { + string endpoint = 1; // 公网接入地址 + } + + // 阿里云 + message Aliyun { + string endpoint = 1; // 公网接入地址 + string project = 2; // + string access_key = 3; // 访问密钥ID + string access_secret = 4; // 访问密钥 + } + + // 腾讯 + message Tencent { + string endpoint = 1; // 公网接入地址 + string topic_id = 2; // + string access_key = 3; // 访问密钥ID + string access_secret = 4; // 访问密钥 + } + + string type = 1; + + Zap zap = 2; + Logrus logrus = 3; + Fluent fluent = 4; + Aliyun aliyun = 5; + Tencent tencent = 6; +} diff --git a/orm/ent/api/common/conf/middleware.proto b/orm/ent/api/common/conf/middleware.proto new file mode 100644 index 0000000..0785956 --- /dev/null +++ b/orm/ent/api/common/conf/middleware.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; + +package common.conf; + +option go_package = "kratos-ent-example/gen/api/go/common/conf;conf"; + +import "google/protobuf/duration.proto"; + +message Middleware { + // JWT校验 + message Auth { + string method = 1; // JWT签名的算法,支持算法:HS256 + string key = 2; // JWT 秘钥 + } + + // 限流器 + message RateLimiter { + string name = 1; // 限流器名字,支持:bbr。 + } + + // 性能指标 + message Metrics { + bool histogram = 1; // 直方图 + bool counter = 2; // 计数器 + bool gauge = 3; // 仪表盘 + bool summary = 4; // 摘要 + } + + bool enable_logging = 1; // 日志开关 + bool enable_recovery = 2; // 异常恢复 + bool enable_tracing = 3; // 链路追踪开关 + bool enable_validate = 4; // 参数校验开关 + bool enable_circuit_breaker = 5; // 熔断器 + + RateLimiter limiter = 6; + Metrics metrics = 7; + Auth auth = 8; +} diff --git a/orm/ent/api/common/conf/oss.proto b/orm/ent/api/common/conf/oss.proto new file mode 100644 index 0000000..b8ef2db --- /dev/null +++ b/orm/ent/api/common/conf/oss.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package common.conf; + +option go_package = "kratos-ent-example/gen/api/go/common/conf;conf"; + +message OSS { + // MinIO + message MinIO { + string endpoint = 1; // 对端端口 + string access_key = 2; // 访问密钥 + string secret_key = 3; // 密钥 + string token = 4; // 令牌 + bool use_ssl = 5; // 使用SSL + string upload_host = 6; // 上传链接的主机名 + string download_host = 7; // 下载链接的主机名 + } + + MinIO minio = 1; +} diff --git a/orm/ent/api/common/conf/registry.proto b/orm/ent/api/common/conf/registry.proto new file mode 100644 index 0000000..724eda8 --- /dev/null +++ b/orm/ent/api/common/conf/registry.proto @@ -0,0 +1,82 @@ +syntax = "proto3"; + +package common.conf; + +option go_package = "kratos-ent-example/gen/api/go/common/conf;conf"; + +import "google/protobuf/duration.proto"; + +// 注册发现中心 +message Registry { + // Consul + message Consul { + string scheme = 1; // 网络样式 + string address = 2; // 服务端地址 + bool health_check = 3; // 健康检查 + } + + // Etcd + message Etcd { + repeated string endpoints = 1; + } + + // ZooKeeper + message ZooKeeper { + repeated string endpoints = 1; + google.protobuf.Duration timeout = 2; + } + + // Nacos + message Nacos { + string address = 1; // 服务端地址 + uint64 port = 2; // 服务端端口 + string namespace_id = 3; // + string log_level = 4; // 日志等级 + string cache_dir = 5; // 缓存目录 + string log_dir = 6; // 日志目录 + int32 update_thread_num = 7; // 更新服务的线程数 + google.protobuf.Duration timeout = 8; // http请求超时时间,单位: 毫秒 + google.protobuf.Duration beat_interval = 9; // 心跳间隔时间,单位: 毫秒 + bool not_load_cache_at_start = 10; // 在启动时不读取本地缓存数据,true: 不读取,false: 读取 + bool update_cache_when_empty = 11; // 当服务列表为空时是否更新本地缓存,true: 更新,false: 不更新 + } + + // Kubernetes + message Kubernetes { + + } + + // Eureka + message Eureka { + repeated string endpoints = 1; + google.protobuf.Duration heartbeat_interval = 2; + google.protobuf.Duration refresh_interval = 3; + string path = 4; + } + + // Polaris + message Polaris { + string address = 1; // 服务端地址 + int32 port = 2; // 服务端端口 + int32 instance_count = 3; + string namespace = 4; + string service = 5; + string token = 6; + } + + // Servicecomb + message Servicecomb { + repeated string endpoints = 1; + } + + string type = 1; + + Consul consul = 2; // Consul + Etcd etcd = 3; // Etcd + ZooKeeper zookeeper = 4; // ZooKeeper + Nacos nacos = 5; // Nacos + Kubernetes kubernetes = 6; // Kubernetes + Eureka eureka = 7; // Eureka + Polaris polaris = 8; // Polaris + Servicecomb servicecomb = 9; // Servicecomb +} diff --git a/orm/ent/api/common/conf/server.proto b/orm/ent/api/common/conf/server.proto new file mode 100644 index 0000000..0029a49 --- /dev/null +++ b/orm/ent/api/common/conf/server.proto @@ -0,0 +1,75 @@ +syntax = "proto3"; + +package common.conf; + +option go_package = "kratos-ent-example/gen/api/go/common/conf;conf"; + +import "google/protobuf/duration.proto"; +import "common/conf/middleware.proto"; + +// 服务器 +message Server { + // REST + message REST { + message CORS { + repeated string headers = 1; // + repeated string methods = 2; // + repeated string origins = 3; // + } + + string network = 1; // 网络 + string addr = 2; // 服务监听地址 + google.protobuf.Duration timeout = 3; // 超时时间 + CORS cors = 4; // 服务监听地址 + Middleware middleware = 5; // 中间件 + } + + // gPRC + message GRPC { + string network = 1; // 网络 + string addr = 2; // 服务监听地址 + google.protobuf.Duration timeout = 3; // 超时时间 + Middleware middleware = 4; + } + + // Websocket + message Websocket { + string network = 1; // 网络样式:http、https + string addr = 2; // 服务监听地址 + string path = 3; // 路径 + string codec = 4; // 编解码器 + google.protobuf.Duration timeout = 5; // 超时时间 + } + + // MQTT + message Mqtt { + string addr = 1; // 对端网络地址 + } + + // Kafka + message Kafka { + repeated string addrs = 1; // 对端网络地址 + } + + // RabbitMQ + message RabbitMQ { + repeated string addrs = 1; // 对端网络地址 + } + + // SSE + message SSE { + string network = 1; // 网络 + string addr = 2; // 服务监听地址 + google.protobuf.Duration timeout = 3; // 超时时间 + string path = 4; // 路径 + string codec = 5; // 编解码器 + } + + REST rest = 1; // REST服务 + GRPC grpc = 2; // gRPC服务 + Websocket websocket = 3; // Websocket服务 + Mqtt mqtt = 4; // MQTT服务 + Kafka kafka = 5; // Kafka服务 + RabbitMQ rabbitmq = 6; // RabbitMQ服务 + SSE sse = 7; // SSE服务 +} diff --git a/orm/ent/api/common/conf/tracer.proto b/orm/ent/api/common/conf/tracer.proto new file mode 100644 index 0000000..d4b6f86 --- /dev/null +++ b/orm/ent/api/common/conf/tracer.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; + +package common.conf; + +option go_package = "kratos-ent-example/gen/api/go/common/conf;conf"; + +// 链路追踪 +message Tracer { + string batcher = 1; // jaeger或者zipkin + string endpoint = 2; // 端口 + double sampler = 3; // 采样率,默认:1.0 + string env = 4; // 运行环境:dev、debug、product +} diff --git a/orm/ent/api/common/pagination/pagination.proto b/orm/ent/api/common/pagination/pagination.proto new file mode 100644 index 0000000..3a5d857 --- /dev/null +++ b/orm/ent/api/common/pagination/pagination.proto @@ -0,0 +1,78 @@ +syntax = "proto3"; + +package pagination; +option go_package = "kratos-ent-example/gen/api/go/common/pagination;pagination"; + +import "google/protobuf/any.proto"; +import "gnostic/openapi/v3/annotations.proto"; + +// 排序类型 +enum SortOrder { + // 不排序 + UNSORTED = 0; + // 升序 + ASCENDING = 1; + // 降序 + DESCENDING = 2; +} + +// 分页通用请求 +message PagingRequest { + // 当前页码 + optional int32 page = 1 [ + (gnostic.openapi.v3.property) = { + description: "当前页码", + default: {number: 1} + } + ]; + + // 每页的行数 + optional int32 pageSize = 2 [ + json_name = "pageSize", + (gnostic.openapi.v3.property) = { + description: "每一页的行数", + default: {number: 10} + } + ]; + + //AND过滤条件 + optional string query = 3 [ + json_name = "query", + (gnostic.openapi.v3.property) = { + description: "AND过滤条件", + example: {yaml: "{\"key1\":\"val1\",\"key2\":\"val2\"}"} + } + ]; + + // OR过滤条件 + optional string orQuery = 4 [ + json_name = "or", + (gnostic.openapi.v3.property) = { + description: "OR过滤条件", + example: {yaml: "{\"key1\":\"val1\",\"key2\":\"val2\"}"} + } + ]; + + // 排序条件 + repeated string orderBy = 5 [ + json_name = "orderBy", + (gnostic.openapi.v3.property) = { + description: "排序条件,字段名前加'-'为降序,否则为升序。" + example: {yaml: "{\"val1\", \"-val2\"}"} + } + ]; + + // 是否不分页 + optional bool noPaging = 6 [ + json_name = "nopaging", + (gnostic.openapi.v3.property) = {description: "是否不分页"} + ]; +} + +// 分页通用结果 +message PagingResponse { + // 总数 + int32 total = 1; + // 分页数据 + repeated google.protobuf.Any items = 2; +} diff --git a/orm/ent/api/third_party/README.md b/orm/ent/api/third_party/README.md new file mode 100644 index 0000000..bee229b --- /dev/null +++ b/orm/ent/api/third_party/README.md @@ -0,0 +1,13 @@ +# Protobuf 第三方库 + +- [Krator Errors](https://github.com/go-kratos/kratos/v2/errors) +- [googleapis](https://google.golang.org/genproto/googleapis) +- [gnostic OpenAPI v3](https://github.com/google/gnostic/openapiv3) +- [protoc-gen-validate](https://github.com/envoyproxy/protoc-gen-validate) + +Protobuf使用[Buf.build](https://buf.build)进行管理编译,第三方库也使用Buf进行管理: + +- `buf.build/googleapis/googleapis` +- `buf.build/envoyproxy/protoc-gen-validate` +- `buf.build/kratos/apis` +- `buf.build/tx7do/gnostic` diff --git a/orm/ent/api/third_party/buf.yaml b/orm/ent/api/third_party/buf.yaml new file mode 100644 index 0000000..03b90d5 --- /dev/null +++ b/orm/ent/api/third_party/buf.yaml @@ -0,0 +1,7 @@ +version: v1 +breaking: + use: + - FILE +lint: + use: + - DEFAULT diff --git a/orm/ent/api/third_party/errors/errors.proto b/orm/ent/api/third_party/errors/errors.proto new file mode 100644 index 0000000..edfb0d3 --- /dev/null +++ b/orm/ent/api/third_party/errors/errors.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +package errors; + +option go_package = "github.com/go-kratos/kratos/v2/errors;errors"; +option java_multiple_files = true; +option java_package = "com.github.kratos.errors"; +option objc_class_prefix = "KratosErrors"; + +import "google/protobuf/descriptor.proto"; + +extend google.protobuf.EnumOptions { + int32 default_code = 1108; +} + +extend google.protobuf.EnumValueOptions { + int32 code = 1109; +} \ No newline at end of file diff --git a/orm/ent/api/third_party/gnostic/openapi/discovery/v1/discovery.proto b/orm/ent/api/third_party/gnostic/openapi/discovery/v1/discovery.proto new file mode 100644 index 0000000..64b604e --- /dev/null +++ b/orm/ent/api/third_party/gnostic/openapi/discovery/v1/discovery.proto @@ -0,0 +1,269 @@ +// Copyright 2020 Google LLC. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// THIS FILE IS AUTOMATICALLY GENERATED. + +syntax = "proto3"; + +package gnostic.discovery.v1; + +import "google/protobuf/any.proto"; + +// This option lets the proto compiler generate Java code inside the package +// name (see below) instead of inside an outer class. It creates a simpler +// developer experience by reducing one-level of name nesting and be +// consistent with most programming languages that don't support outer classes. +option java_multiple_files = true; + +// The Java outer classname should be the filename in UpperCamelCase. This +// class is only used to hold proto descriptor, so developers don't need to +// work with it directly. +option java_outer_classname = "OpenAPIProto"; + +// The Java package name must be proto package name with proper prefix. +option java_package = "org.discovery_v1"; + +// A reasonable prefix for the Objective-C symbols generated from the package. +// It should at a minimum be 3 characters long, all uppercase, and convention +// is to use an abbreviation of the package name. Something short, but +// hopefully unique enough to not conflict with things that may come along in +// the future. 'GPB' is reserved for the protocol buffer implementation itself. +option objc_class_prefix = "OAS"; + +// The Go package name. +option go_package = "github.com/google/gnostic/discovery;discovery_v1"; + +message Annotations { + repeated string required = 1; +} + +message Any { + google.protobuf.Any value = 1; + string yaml = 2; +} + +message Auth { + Oauth2 oauth2 = 1; +} + +message Document { + string kind = 1; + string discovery_version = 2; + string id = 3; + string name = 4; + string version = 5; + string revision = 6; + string title = 7; + string description = 8; + Icons icons = 9; + string documentation_link = 10; + repeated string labels = 11; + string protocol = 12; + string base_url = 13; + string base_path = 14; + string root_url = 15; + string service_path = 16; + string batch_path = 17; + Parameters parameters = 18; + Auth auth = 19; + repeated string features = 20; + Schemas schemas = 21; + Methods methods = 22; + Resources resources = 23; + string etag = 24; + string owner_domain = 25; + string owner_name = 26; + bool version_module = 27; + string canonical_name = 28; + bool fully_encode_reserved_expansion = 29; + string package_path = 30; + string mtls_root_url = 31; +} + +// Icons that represent the API. +message Icons { + string x16 = 1; + string x32 = 2; +} + +message MediaUpload { + repeated string accept = 1; + string max_size = 2; + Protocols protocols = 3; + bool supports_subscription = 4; +} + +message Method { + string id = 1; + string path = 2; + string http_method = 3; + string description = 4; + Parameters parameters = 5; + repeated string parameter_order = 6; + Request request = 7; + Response response = 8; + repeated string scopes = 9; + bool supports_media_download = 10; + bool supports_media_upload = 11; + bool use_media_download_service = 12; + MediaUpload media_upload = 13; + bool supports_subscription = 14; + string flat_path = 15; + bool etag_required = 16; + string streaming_type = 17; +} + +message Methods { + repeated NamedMethod additional_properties = 1; +} + +// Automatically-generated message used to represent maps of Method as ordered (name,value) pairs. +message NamedMethod { + // Map key + string name = 1; + // Mapped value + Method value = 2; +} + +// Automatically-generated message used to represent maps of Parameter as ordered (name,value) pairs. +message NamedParameter { + // Map key + string name = 1; + // Mapped value + Parameter value = 2; +} + +// Automatically-generated message used to represent maps of Resource as ordered (name,value) pairs. +message NamedResource { + // Map key + string name = 1; + // Mapped value + Resource value = 2; +} + +// Automatically-generated message used to represent maps of Schema as ordered (name,value) pairs. +message NamedSchema { + // Map key + string name = 1; + // Mapped value + Schema value = 2; +} + +// Automatically-generated message used to represent maps of Scope as ordered (name,value) pairs. +message NamedScope { + // Map key + string name = 1; + // Mapped value + Scope value = 2; +} + +message Oauth2 { + Scopes scopes = 1; +} + +message Parameter { + string id = 1; + string type = 2; + string _ref = 3; + string description = 4; + string default = 5; + bool required = 6; + string format = 7; + string pattern = 8; + string minimum = 9; + string maximum = 10; + repeated string enum = 11; + repeated string enum_descriptions = 12; + bool repeated = 13; + string location = 14; + Schemas properties = 15; + Schema additional_properties = 16; + Schema items = 17; + Annotations annotations = 18; +} + +message Parameters { + repeated NamedParameter additional_properties = 1; +} + +message Protocols { + Simple simple = 1; + Resumable resumable = 2; +} + +message Request { + string _ref = 1; + string parameter_name = 2; +} + +message Resource { + Methods methods = 1; + Resources resources = 2; +} + +message Resources { + repeated NamedResource additional_properties = 1; +} + +message Response { + string _ref = 1; +} + +message Resumable { + bool multipart = 1; + string path = 2; +} + +message Schema { + string id = 1; + string type = 2; + string description = 3; + string default = 4; + bool required = 5; + string format = 6; + string pattern = 7; + string minimum = 8; + string maximum = 9; + repeated string enum = 10; + repeated string enum_descriptions = 11; + bool repeated = 12; + string location = 13; + Schemas properties = 14; + Schema additional_properties = 15; + Schema items = 16; + string _ref = 17; + Annotations annotations = 18; + bool read_only = 19; +} + +message Schemas { + repeated NamedSchema additional_properties = 1; +} + +message Scope { + string description = 1; +} + +message Scopes { + repeated NamedScope additional_properties = 1; +} + +message Simple { + bool multipart = 1; + string path = 2; +} + +message StringArray { + repeated string value = 1; +} diff --git a/orm/ent/api/third_party/gnostic/openapi/v2/openapiv2.proto b/orm/ent/api/third_party/gnostic/openapi/v2/openapiv2.proto new file mode 100644 index 0000000..ee5e7c0 --- /dev/null +++ b/orm/ent/api/third_party/gnostic/openapi/v2/openapiv2.proto @@ -0,0 +1,665 @@ +// Copyright 2020 Google LLC. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// THIS FILE IS AUTOMATICALLY GENERATED. + +syntax = "proto3"; + +package gnostic.openapi.v2; + +import "google/protobuf/any.proto"; + +// This option lets the proto compiler generate Java code inside the package +// name (see below) instead of inside an outer class. It creates a simpler +// developer experience by reducing one-level of name nesting and be +// consistent with most programming languages that don't support outer classes. +option java_multiple_files = true; + +// The Java outer classname should be the filename in UpperCamelCase. This +// class is only used to hold proto descriptor, so developers don't need to +// work with it directly. +option java_outer_classname = "OpenAPIProto"; + +// The Java package name must be proto package name with proper prefix. +option java_package = "org.openapi_v2"; + +// A reasonable prefix for the Objective-C symbols generated from the package. +// It should at a minimum be 3 characters long, all uppercase, and convention +// is to use an abbreviation of the package name. Something short, but +// hopefully unique enough to not conflict with things that may come along in +// the future. 'GPB' is reserved for the protocol buffer implementation itself. +option objc_class_prefix = "OAS"; + +// The Go package name. +option go_package = "github.com/google/gnostic/openapiv2;openapi_v2"; + +message AdditionalPropertiesItem { + oneof oneof { + Schema schema = 1; + bool boolean = 2; + } +} + +message Any { + google.protobuf.Any value = 1; + string yaml = 2; +} + +message ApiKeySecurity { + string type = 1; + string name = 2; + string in = 3; + string description = 4; + repeated NamedAny vendor_extension = 5; +} + +message BasicAuthenticationSecurity { + string type = 1; + string description = 2; + repeated NamedAny vendor_extension = 3; +} + +message BodyParameter { + // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. + string description = 1; + // The name of the parameter. + string name = 2; + // Determines the location of the parameter. + string in = 3; + // Determines whether or not this parameter is required or optional. + bool required = 4; + Schema schema = 5; + repeated NamedAny vendor_extension = 6; +} + +// Contact information for the owners of the API. +message Contact { + // The identifying name of the contact person/organization. + string name = 1; + // The URL pointing to the contact information. + string url = 2; + // The email address of the contact person/organization. + string email = 3; + repeated NamedAny vendor_extension = 4; +} + +message Default { + repeated NamedAny additional_properties = 1; +} + +// One or more JSON objects describing the schemas being consumed and produced by the API. +message Definitions { + repeated NamedSchema additional_properties = 1; +} + +message Document { + // The Swagger version of this document. + string swagger = 1; + Info info = 2; + // The host (name or ip) of the API. Example: 'swagger.io' + string host = 3; + // The base path to the API. Example: '/api'. + string base_path = 4; + // The transfer protocol of the API. + repeated string schemes = 5; + // A list of MIME types accepted by the API. + repeated string consumes = 6; + // A list of MIME types the API can produce. + repeated string produces = 7; + Paths paths = 8; + Definitions definitions = 9; + ParameterDefinitions parameters = 10; + ResponseDefinitions responses = 11; + repeated SecurityRequirement security = 12; + SecurityDefinitions security_definitions = 13; + repeated Tag tags = 14; + ExternalDocs external_docs = 15; + repeated NamedAny vendor_extension = 16; +} + +message Examples { + repeated NamedAny additional_properties = 1; +} + +// information about external documentation +message ExternalDocs { + string description = 1; + string url = 2; + repeated NamedAny vendor_extension = 3; +} + +// A deterministic version of a JSON Schema object. +message FileSchema { + string format = 1; + string title = 2; + string description = 3; + Any default = 4; + repeated string required = 5; + string type = 6; + bool read_only = 7; + ExternalDocs external_docs = 8; + Any example = 9; + repeated NamedAny vendor_extension = 10; +} + +message FormDataParameterSubSchema { + // Determines whether or not this parameter is required or optional. + bool required = 1; + // Determines the location of the parameter. + string in = 2; + // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. + string description = 3; + // The name of the parameter. + string name = 4; + // allows sending a parameter by name only or with an empty value. + bool allow_empty_value = 5; + string type = 6; + string format = 7; + PrimitivesItems items = 8; + string collection_format = 9; + Any default = 10; + double maximum = 11; + bool exclusive_maximum = 12; + double minimum = 13; + bool exclusive_minimum = 14; + int64 max_length = 15; + int64 min_length = 16; + string pattern = 17; + int64 max_items = 18; + int64 min_items = 19; + bool unique_items = 20; + repeated Any enum = 21; + double multiple_of = 22; + repeated NamedAny vendor_extension = 23; +} + +message Header { + string type = 1; + string format = 2; + PrimitivesItems items = 3; + string collection_format = 4; + Any default = 5; + double maximum = 6; + bool exclusive_maximum = 7; + double minimum = 8; + bool exclusive_minimum = 9; + int64 max_length = 10; + int64 min_length = 11; + string pattern = 12; + int64 max_items = 13; + int64 min_items = 14; + bool unique_items = 15; + repeated Any enum = 16; + double multiple_of = 17; + string description = 18; + repeated NamedAny vendor_extension = 19; +} + +message HeaderParameterSubSchema { + // Determines whether or not this parameter is required or optional. + bool required = 1; + // Determines the location of the parameter. + string in = 2; + // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. + string description = 3; + // The name of the parameter. + string name = 4; + string type = 5; + string format = 6; + PrimitivesItems items = 7; + string collection_format = 8; + Any default = 9; + double maximum = 10; + bool exclusive_maximum = 11; + double minimum = 12; + bool exclusive_minimum = 13; + int64 max_length = 14; + int64 min_length = 15; + string pattern = 16; + int64 max_items = 17; + int64 min_items = 18; + bool unique_items = 19; + repeated Any enum = 20; + double multiple_of = 21; + repeated NamedAny vendor_extension = 22; +} + +message Headers { + repeated NamedHeader additional_properties = 1; +} + +// General information about the API. +message Info { + // A unique and precise title of the API. + string title = 1; + // A semantic version number of the API. + string version = 2; + // A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed. + string description = 3; + // The terms of service for the API. + string terms_of_service = 4; + Contact contact = 5; + License license = 6; + repeated NamedAny vendor_extension = 7; +} + +message ItemsItem { + repeated Schema schema = 1; +} + +message JsonReference { + string _ref = 1; + string description = 2; +} + +message License { + // The name of the license type. It's encouraged to use an OSI compatible license. + string name = 1; + // The URL pointing to the license. + string url = 2; + repeated NamedAny vendor_extension = 3; +} + +// Automatically-generated message used to represent maps of Any as ordered (name,value) pairs. +message NamedAny { + // Map key + string name = 1; + // Mapped value + Any value = 2; +} + +// Automatically-generated message used to represent maps of Header as ordered (name,value) pairs. +message NamedHeader { + // Map key + string name = 1; + // Mapped value + Header value = 2; +} + +// Automatically-generated message used to represent maps of Parameter as ordered (name,value) pairs. +message NamedParameter { + // Map key + string name = 1; + // Mapped value + Parameter value = 2; +} + +// Automatically-generated message used to represent maps of PathItem as ordered (name,value) pairs. +message NamedPathItem { + // Map key + string name = 1; + // Mapped value + PathItem value = 2; +} + +// Automatically-generated message used to represent maps of Response as ordered (name,value) pairs. +message NamedResponse { + // Map key + string name = 1; + // Mapped value + Response value = 2; +} + +// Automatically-generated message used to represent maps of ResponseValue as ordered (name,value) pairs. +message NamedResponseValue { + // Map key + string name = 1; + // Mapped value + ResponseValue value = 2; +} + +// Automatically-generated message used to represent maps of Schema as ordered (name,value) pairs. +message NamedSchema { + // Map key + string name = 1; + // Mapped value + Schema value = 2; +} + +// Automatically-generated message used to represent maps of SecurityDefinitionsItem as ordered (name,value) pairs. +message NamedSecurityDefinitionsItem { + // Map key + string name = 1; + // Mapped value + SecurityDefinitionsItem value = 2; +} + +// Automatically-generated message used to represent maps of string as ordered (name,value) pairs. +message NamedString { + // Map key + string name = 1; + // Mapped value + string value = 2; +} + +// Automatically-generated message used to represent maps of StringArray as ordered (name,value) pairs. +message NamedStringArray { + // Map key + string name = 1; + // Mapped value + StringArray value = 2; +} + +message NonBodyParameter { + oneof oneof { + HeaderParameterSubSchema header_parameter_sub_schema = 1; + FormDataParameterSubSchema form_data_parameter_sub_schema = 2; + QueryParameterSubSchema query_parameter_sub_schema = 3; + PathParameterSubSchema path_parameter_sub_schema = 4; + } +} + +message Oauth2AccessCodeSecurity { + string type = 1; + string flow = 2; + Oauth2Scopes scopes = 3; + string authorization_url = 4; + string token_url = 5; + string description = 6; + repeated NamedAny vendor_extension = 7; +} + +message Oauth2ApplicationSecurity { + string type = 1; + string flow = 2; + Oauth2Scopes scopes = 3; + string token_url = 4; + string description = 5; + repeated NamedAny vendor_extension = 6; +} + +message Oauth2ImplicitSecurity { + string type = 1; + string flow = 2; + Oauth2Scopes scopes = 3; + string authorization_url = 4; + string description = 5; + repeated NamedAny vendor_extension = 6; +} + +message Oauth2PasswordSecurity { + string type = 1; + string flow = 2; + Oauth2Scopes scopes = 3; + string token_url = 4; + string description = 5; + repeated NamedAny vendor_extension = 6; +} + +message Oauth2Scopes { + repeated NamedString additional_properties = 1; +} + +message Operation { + repeated string tags = 1; + // A brief summary of the operation. + string summary = 2; + // A longer description of the operation, GitHub Flavored Markdown is allowed. + string description = 3; + ExternalDocs external_docs = 4; + // A unique identifier of the operation. + string operation_id = 5; + // A list of MIME types the API can produce. + repeated string produces = 6; + // A list of MIME types the API can consume. + repeated string consumes = 7; + // The parameters needed to send a valid API call. + repeated ParametersItem parameters = 8; + Responses responses = 9; + // The transfer protocol of the API. + repeated string schemes = 10; + bool deprecated = 11; + repeated SecurityRequirement security = 12; + repeated NamedAny vendor_extension = 13; +} + +message Parameter { + oneof oneof { + BodyParameter body_parameter = 1; + NonBodyParameter non_body_parameter = 2; + } +} + +// One or more JSON representations for parameters +message ParameterDefinitions { + repeated NamedParameter additional_properties = 1; +} + +message ParametersItem { + oneof oneof { + Parameter parameter = 1; + JsonReference json_reference = 2; + } +} + +message PathItem { + string _ref = 1; + Operation get = 2; + Operation put = 3; + Operation post = 4; + Operation delete = 5; + Operation options = 6; + Operation head = 7; + Operation patch = 8; + // The parameters needed to send a valid API call. + repeated ParametersItem parameters = 9; + repeated NamedAny vendor_extension = 10; +} + +message PathParameterSubSchema { + // Determines whether or not this parameter is required or optional. + bool required = 1; + // Determines the location of the parameter. + string in = 2; + // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. + string description = 3; + // The name of the parameter. + string name = 4; + string type = 5; + string format = 6; + PrimitivesItems items = 7; + string collection_format = 8; + Any default = 9; + double maximum = 10; + bool exclusive_maximum = 11; + double minimum = 12; + bool exclusive_minimum = 13; + int64 max_length = 14; + int64 min_length = 15; + string pattern = 16; + int64 max_items = 17; + int64 min_items = 18; + bool unique_items = 19; + repeated Any enum = 20; + double multiple_of = 21; + repeated NamedAny vendor_extension = 22; +} + +// Relative paths to the individual endpoints. They must be relative to the 'basePath'. +message Paths { + repeated NamedAny vendor_extension = 1; + repeated NamedPathItem path = 2; +} + +message PrimitivesItems { + string type = 1; + string format = 2; + PrimitivesItems items = 3; + string collection_format = 4; + Any default = 5; + double maximum = 6; + bool exclusive_maximum = 7; + double minimum = 8; + bool exclusive_minimum = 9; + int64 max_length = 10; + int64 min_length = 11; + string pattern = 12; + int64 max_items = 13; + int64 min_items = 14; + bool unique_items = 15; + repeated Any enum = 16; + double multiple_of = 17; + repeated NamedAny vendor_extension = 18; +} + +message Properties { + repeated NamedSchema additional_properties = 1; +} + +message QueryParameterSubSchema { + // Determines whether or not this parameter is required or optional. + bool required = 1; + // Determines the location of the parameter. + string in = 2; + // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. + string description = 3; + // The name of the parameter. + string name = 4; + // allows sending a parameter by name only or with an empty value. + bool allow_empty_value = 5; + string type = 6; + string format = 7; + PrimitivesItems items = 8; + string collection_format = 9; + Any default = 10; + double maximum = 11; + bool exclusive_maximum = 12; + double minimum = 13; + bool exclusive_minimum = 14; + int64 max_length = 15; + int64 min_length = 16; + string pattern = 17; + int64 max_items = 18; + int64 min_items = 19; + bool unique_items = 20; + repeated Any enum = 21; + double multiple_of = 22; + repeated NamedAny vendor_extension = 23; +} + +message Response { + string description = 1; + SchemaItem schema = 2; + Headers headers = 3; + Examples examples = 4; + repeated NamedAny vendor_extension = 5; +} + +// One or more JSON representations for responses +message ResponseDefinitions { + repeated NamedResponse additional_properties = 1; +} + +message ResponseValue { + oneof oneof { + Response response = 1; + JsonReference json_reference = 2; + } +} + +// Response objects names can either be any valid HTTP status code or 'default'. +message Responses { + repeated NamedResponseValue response_code = 1; + repeated NamedAny vendor_extension = 2; +} + +// A deterministic version of a JSON Schema object. +message Schema { + string _ref = 1; + string format = 2; + string title = 3; + string description = 4; + Any default = 5; + double multiple_of = 6; + double maximum = 7; + bool exclusive_maximum = 8; + double minimum = 9; + bool exclusive_minimum = 10; + int64 max_length = 11; + int64 min_length = 12; + string pattern = 13; + int64 max_items = 14; + int64 min_items = 15; + bool unique_items = 16; + int64 max_properties = 17; + int64 min_properties = 18; + repeated string required = 19; + repeated Any enum = 20; + AdditionalPropertiesItem additional_properties = 21; + TypeItem type = 22; + ItemsItem items = 23; + repeated Schema all_of = 24; + Properties properties = 25; + string discriminator = 26; + bool read_only = 27; + Xml xml = 28; + ExternalDocs external_docs = 29; + Any example = 30; + repeated NamedAny vendor_extension = 31; +} + +message SchemaItem { + oneof oneof { + Schema schema = 1; + FileSchema file_schema = 2; + } +} + +message SecurityDefinitions { + repeated NamedSecurityDefinitionsItem additional_properties = 1; +} + +message SecurityDefinitionsItem { + oneof oneof { + BasicAuthenticationSecurity basic_authentication_security = 1; + ApiKeySecurity api_key_security = 2; + Oauth2ImplicitSecurity oauth2_implicit_security = 3; + Oauth2PasswordSecurity oauth2_password_security = 4; + Oauth2ApplicationSecurity oauth2_application_security = 5; + Oauth2AccessCodeSecurity oauth2_access_code_security = 6; + } +} + +message SecurityRequirement { + repeated NamedStringArray additional_properties = 1; +} + +message StringArray { + repeated string value = 1; +} + +message Tag { + string name = 1; + string description = 2; + ExternalDocs external_docs = 3; + repeated NamedAny vendor_extension = 4; +} + +message TypeItem { + repeated string value = 1; +} + +// Any property starting with x- is valid. +message VendorExtension { + repeated NamedAny additional_properties = 1; +} + +message Xml { + string name = 1; + string namespace = 2; + string prefix = 3; + bool attribute = 4; + bool wrapped = 5; + repeated NamedAny vendor_extension = 6; +} diff --git a/orm/ent/api/third_party/gnostic/openapi/v3/README.md b/orm/ent/api/third_party/gnostic/openapi/v3/README.md new file mode 100644 index 0000000..0b015bc --- /dev/null +++ b/orm/ent/api/third_party/gnostic/openapi/v3/README.md @@ -0,0 +1,26 @@ +# OpenAPI v3 Protocol Buffer Models + +This directory contains a Protocol Buffer-language model and related code for +supporting OpenAPI v3. + +Gnostic applications and plugins can use OpenAPIv3.proto to generate Protocol +Buffer support code for their preferred languages. + +OpenAPIv3.go is used by Gnostic to read JSON and YAML OpenAPI descriptions into +the Protocol Buffer-based datastructures generated from OpenAPIv3.proto. + +OpenAPIv3.proto and OpenAPIv3.go are generated by the Gnostic compiler +generator, and OpenAPIv3.pb.go is generated by protoc, the Protocol Buffer +compiler, and protoc-gen-go, the Protocol Buffer Go code generation plugin. + +openapi-3.1.json is a JSON schema for OpenAPI 3.1 that is automatically +generated from the OpenAPI 3.1 specification. It is not an official JSON Schema +for OpenAPI. + +The schema-generator directory contains support code which generates +openapi-3.1.json from the OpenAPI 3.1 specification document (Markdown). + +### How to rebuild + +Run: +`COMPILE-PROTOS.sh` diff --git a/orm/ent/api/third_party/gnostic/openapi/v3/annotations.proto b/orm/ent/api/third_party/gnostic/openapi/v3/annotations.proto new file mode 100644 index 0000000..b855751 --- /dev/null +++ b/orm/ent/api/third_party/gnostic/openapi/v3/annotations.proto @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package gnostic.openapi.v3; + +import "gnostic/openapi/v3/openapiv3.proto"; +import "google/protobuf/descriptor.proto"; + +// This option lets the proto compiler generate Java code inside the package +// name (see below) instead of inside an outer class. It creates a simpler +// developer experience by reducing one-level of name nesting and be +// consistent with most programming languages that don't support outer classes. +option java_multiple_files = true; + +// The Java outer classname should be the filename in UpperCamelCase. This +// class is only used to hold proto descriptor, so developers don't need to +// work with it directly. +option java_outer_classname = "AnnotationsProto"; + +// The Java package name must be proto package name with proper prefix. +option java_package = "org.openapi_v3"; + +// A reasonable prefix for the Objective-C symbols generated from the package. +// It should at a minimum be 3 characters long, all uppercase, and convention +// is to use an abbreviation of the package name. Something short, but +// hopefully unique enough to not conflict with things that may come along in +// the future. 'GPB' is reserved for the protocol buffer implementation itself. +option objc_class_prefix = "OAS"; + +// The Go package name. +option go_package = "github.com/google/gnostic/openapiv3;openapi_v3"; + +extend google.protobuf.FileOptions { + Document document = 1143; +} + +extend google.protobuf.MethodOptions { + Operation operation = 1143; +} + +extend google.protobuf.MessageOptions { + Schema schema = 1143; +} + +extend google.protobuf.FieldOptions { + Schema property = 1143; +} diff --git a/orm/ent/api/third_party/gnostic/openapi/v3/openapiv3.proto b/orm/ent/api/third_party/gnostic/openapi/v3/openapiv3.proto new file mode 100644 index 0000000..e783564 --- /dev/null +++ b/orm/ent/api/third_party/gnostic/openapi/v3/openapiv3.proto @@ -0,0 +1,671 @@ +// Copyright 2020 Google LLC. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// THIS FILE IS AUTOMATICALLY GENERATED. + +syntax = "proto3"; + +package gnostic.openapi.v3; + +import "google/protobuf/any.proto"; + +// This option lets the proto compiler generate Java code inside the package +// name (see below) instead of inside an outer class. It creates a simpler +// developer experience by reducing one-level of name nesting and be +// consistent with most programming languages that don't support outer classes. +option java_multiple_files = true; + +// The Java outer classname should be the filename in UpperCamelCase. This +// class is only used to hold proto descriptor, so developers don't need to +// work with it directly. +option java_outer_classname = "OpenAPIProto"; + +// The Java package name must be proto package name with proper prefix. +option java_package = "org.openapi_v3"; + +// A reasonable prefix for the Objective-C symbols generated from the package. +// It should at a minimum be 3 characters long, all uppercase, and convention +// is to use an abbreviation of the package name. Something short, but +// hopefully unique enough to not conflict with things that may come along in +// the future. 'GPB' is reserved for the protocol buffer implementation itself. +option objc_class_prefix = "OAS"; + +// The Go package name. +option go_package = "github.com/google/gnostic/openapiv3;openapi_v3"; + +message AdditionalPropertiesItem { + oneof oneof { + SchemaOrReference schema_or_reference = 1; + bool boolean = 2; + } +} + +message Any { + google.protobuf.Any value = 1; + string yaml = 2; +} + +message AnyOrExpression { + oneof oneof { + Any any = 1; + Expression expression = 2; + } +} + +// A map of possible out-of band callbacks related to the parent operation. Each value in the map is a Path Item Object that describes a set of requests that may be initiated by the API provider and the expected responses. The key value used to identify the callback object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation. +message Callback { + repeated NamedPathItem path = 1; + repeated NamedAny specification_extension = 2; +} + +message CallbackOrReference { + oneof oneof { + Callback callback = 1; + Reference reference = 2; + } +} + +message CallbacksOrReferences { + repeated NamedCallbackOrReference additional_properties = 1; +} + +// Holds a set of reusable objects for different aspects of the OAS. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object. +message Components { + SchemasOrReferences schemas = 1; + ResponsesOrReferences responses = 2; + ParametersOrReferences parameters = 3; + ExamplesOrReferences examples = 4; + RequestBodiesOrReferences request_bodies = 5; + HeadersOrReferences headers = 6; + SecuritySchemesOrReferences security_schemes = 7; + LinksOrReferences links = 8; + CallbacksOrReferences callbacks = 9; + repeated NamedAny specification_extension = 10; +} + +// Contact information for the exposed API. +message Contact { + string name = 1; + string url = 2; + string email = 3; + repeated NamedAny specification_extension = 4; +} + +message DefaultType { + oneof oneof { + double number = 1; + bool boolean = 2; + string string = 3; + } +} + +// When request bodies or response payloads may be one of a number of different schemas, a `discriminator` object can be used to aid in serialization, deserialization, and validation. The discriminator is a specific object in a schema which is used to inform the consumer of the specification of an alternative schema based on the value associated with it. When using the discriminator, _inline_ schemas will not be considered. +message Discriminator { + string property_name = 1; + Strings mapping = 2; + repeated NamedAny specification_extension = 3; +} + +message Document { + string openapi = 1; + Info info = 2; + repeated Server servers = 3; + Paths paths = 4; + Components components = 5; + repeated SecurityRequirement security = 6; + repeated Tag tags = 7; + ExternalDocs external_docs = 8; + repeated NamedAny specification_extension = 9; +} + +// A single encoding definition applied to a single schema property. +message Encoding { + string content_type = 1; + HeadersOrReferences headers = 2; + string style = 3; + bool explode = 4; + bool allow_reserved = 5; + repeated NamedAny specification_extension = 6; +} + +message Encodings { + repeated NamedEncoding additional_properties = 1; +} + +message Example { + string summary = 1; + string description = 2; + Any value = 3; + string external_value = 4; + repeated NamedAny specification_extension = 5; +} + +message ExampleOrReference { + oneof oneof { + Example example = 1; + Reference reference = 2; + } +} + +message ExamplesOrReferences { + repeated NamedExampleOrReference additional_properties = 1; +} + +message Expression { + repeated NamedAny additional_properties = 1; +} + +// Allows referencing an external resource for extended documentation. +message ExternalDocs { + string description = 1; + string url = 2; + repeated NamedAny specification_extension = 3; +} + +// The Header Object follows the structure of the Parameter Object with the following changes: 1. `name` MUST NOT be specified, it is given in the corresponding `headers` map. 1. `in` MUST NOT be specified, it is implicitly in `header`. 1. All traits that are affected by the location MUST be applicable to a location of `header` (for example, `style`). +message Header { + string description = 1; + bool required = 2; + bool deprecated = 3; + bool allow_empty_value = 4; + string style = 5; + bool explode = 6; + bool allow_reserved = 7; + SchemaOrReference schema = 8; + Any example = 9; + ExamplesOrReferences examples = 10; + MediaTypes content = 11; + repeated NamedAny specification_extension = 12; +} + +message HeaderOrReference { + oneof oneof { + Header header = 1; + Reference reference = 2; + } +} + +message HeadersOrReferences { + repeated NamedHeaderOrReference additional_properties = 1; +} + +// The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience. +message Info { + string title = 1; + string description = 2; + string terms_of_service = 3; + Contact contact = 4; + License license = 5; + string version = 6; + repeated NamedAny specification_extension = 7; + string summary = 8; +} + +message ItemsItem { + repeated SchemaOrReference schema_or_reference = 1; +} + +// License information for the exposed API. +message License { + string name = 1; + string url = 2; + repeated NamedAny specification_extension = 3; +} + +// The `Link object` represents a possible design-time link for a response. The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations. Unlike _dynamic_ links (i.e. links provided **in** the response payload), the OAS linking mechanism does not require link information in the runtime response. For computing links, and providing instructions to execute them, a runtime expression is used for accessing values in an operation and using them as parameters while invoking the linked operation. +message Link { + string operation_ref = 1; + string operation_id = 2; + AnyOrExpression parameters = 3; + AnyOrExpression request_body = 4; + string description = 5; + Server server = 6; + repeated NamedAny specification_extension = 7; +} + +message LinkOrReference { + oneof oneof { + Link link = 1; + Reference reference = 2; + } +} + +message LinksOrReferences { + repeated NamedLinkOrReference additional_properties = 1; +} + +// Each Media Type Object provides schema and examples for the media type identified by its key. +message MediaType { + SchemaOrReference schema = 1; + Any example = 2; + ExamplesOrReferences examples = 3; + Encodings encoding = 4; + repeated NamedAny specification_extension = 5; +} + +message MediaTypes { + repeated NamedMediaType additional_properties = 1; +} + +// Automatically-generated message used to represent maps of Any as ordered (name,value) pairs. +message NamedAny { + // Map key + string name = 1; + // Mapped value + Any value = 2; +} + +// Automatically-generated message used to represent maps of CallbackOrReference as ordered (name,value) pairs. +message NamedCallbackOrReference { + // Map key + string name = 1; + // Mapped value + CallbackOrReference value = 2; +} + +// Automatically-generated message used to represent maps of Encoding as ordered (name,value) pairs. +message NamedEncoding { + // Map key + string name = 1; + // Mapped value + Encoding value = 2; +} + +// Automatically-generated message used to represent maps of ExampleOrReference as ordered (name,value) pairs. +message NamedExampleOrReference { + // Map key + string name = 1; + // Mapped value + ExampleOrReference value = 2; +} + +// Automatically-generated message used to represent maps of HeaderOrReference as ordered (name,value) pairs. +message NamedHeaderOrReference { + // Map key + string name = 1; + // Mapped value + HeaderOrReference value = 2; +} + +// Automatically-generated message used to represent maps of LinkOrReference as ordered (name,value) pairs. +message NamedLinkOrReference { + // Map key + string name = 1; + // Mapped value + LinkOrReference value = 2; +} + +// Automatically-generated message used to represent maps of MediaType as ordered (name,value) pairs. +message NamedMediaType { + // Map key + string name = 1; + // Mapped value + MediaType value = 2; +} + +// Automatically-generated message used to represent maps of ParameterOrReference as ordered (name,value) pairs. +message NamedParameterOrReference { + // Map key + string name = 1; + // Mapped value + ParameterOrReference value = 2; +} + +// Automatically-generated message used to represent maps of PathItem as ordered (name,value) pairs. +message NamedPathItem { + // Map key + string name = 1; + // Mapped value + PathItem value = 2; +} + +// Automatically-generated message used to represent maps of RequestBodyOrReference as ordered (name,value) pairs. +message NamedRequestBodyOrReference { + // Map key + string name = 1; + // Mapped value + RequestBodyOrReference value = 2; +} + +// Automatically-generated message used to represent maps of ResponseOrReference as ordered (name,value) pairs. +message NamedResponseOrReference { + // Map key + string name = 1; + // Mapped value + ResponseOrReference value = 2; +} + +// Automatically-generated message used to represent maps of SchemaOrReference as ordered (name,value) pairs. +message NamedSchemaOrReference { + // Map key + string name = 1; + // Mapped value + SchemaOrReference value = 2; +} + +// Automatically-generated message used to represent maps of SecuritySchemeOrReference as ordered (name,value) pairs. +message NamedSecuritySchemeOrReference { + // Map key + string name = 1; + // Mapped value + SecuritySchemeOrReference value = 2; +} + +// Automatically-generated message used to represent maps of ServerVariable as ordered (name,value) pairs. +message NamedServerVariable { + // Map key + string name = 1; + // Mapped value + ServerVariable value = 2; +} + +// Automatically-generated message used to represent maps of string as ordered (name,value) pairs. +message NamedString { + // Map key + string name = 1; + // Mapped value + string value = 2; +} + +// Automatically-generated message used to represent maps of StringArray as ordered (name,value) pairs. +message NamedStringArray { + // Map key + string name = 1; + // Mapped value + StringArray value = 2; +} + +// Configuration details for a supported OAuth Flow +message OauthFlow { + string authorization_url = 1; + string token_url = 2; + string refresh_url = 3; + Strings scopes = 4; + repeated NamedAny specification_extension = 5; +} + +// Allows configuration of the supported OAuth Flows. +message OauthFlows { + OauthFlow implicit = 1; + OauthFlow password = 2; + OauthFlow client_credentials = 3; + OauthFlow authorization_code = 4; + repeated NamedAny specification_extension = 5; +} + +message Object { + repeated NamedAny additional_properties = 1; +} + +// Describes a single API operation on a path. +message Operation { + repeated string tags = 1; + string summary = 2; + string description = 3; + ExternalDocs external_docs = 4; + string operation_id = 5; + repeated ParameterOrReference parameters = 6; + RequestBodyOrReference request_body = 7; + Responses responses = 8; + CallbacksOrReferences callbacks = 9; + bool deprecated = 10; + repeated SecurityRequirement security = 11; + repeated Server servers = 12; + repeated NamedAny specification_extension = 13; +} + +// Describes a single operation parameter. A unique parameter is defined by a combination of a name and location. +message Parameter { + string name = 1; + string in = 2; + string description = 3; + bool required = 4; + bool deprecated = 5; + bool allow_empty_value = 6; + string style = 7; + bool explode = 8; + bool allow_reserved = 9; + SchemaOrReference schema = 10; + Any example = 11; + ExamplesOrReferences examples = 12; + MediaTypes content = 13; + repeated NamedAny specification_extension = 14; +} + +message ParameterOrReference { + oneof oneof { + Parameter parameter = 1; + Reference reference = 2; + } +} + +message ParametersOrReferences { + repeated NamedParameterOrReference additional_properties = 1; +} + +// Describes the operations available on a single path. A Path Item MAY be empty, due to ACL constraints. The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available. +message PathItem { + string _ref = 1; + string summary = 2; + string description = 3; + Operation get = 4; + Operation put = 5; + Operation post = 6; + Operation delete = 7; + Operation options = 8; + Operation head = 9; + Operation patch = 10; + Operation trace = 11; + repeated Server servers = 12; + repeated ParameterOrReference parameters = 13; + repeated NamedAny specification_extension = 14; +} + +// Holds the relative paths to the individual endpoints and their operations. The path is appended to the URL from the `Server Object` in order to construct the full URL. The Paths MAY be empty, due to ACL constraints. +message Paths { + repeated NamedPathItem path = 1; + repeated NamedAny specification_extension = 2; +} + +message Properties { + repeated NamedSchemaOrReference additional_properties = 1; +} + +// A simple object to allow referencing other components in the specification, internally and externally. The Reference Object is defined by JSON Reference and follows the same structure, behavior and rules. For this specification, reference resolution is accomplished as defined by the JSON Reference specification and not by the JSON Schema specification. +message Reference { + string _ref = 1; + string summary = 2; + string description = 3; +} + +message RequestBodiesOrReferences { + repeated NamedRequestBodyOrReference additional_properties = 1; +} + +// Describes a single request body. +message RequestBody { + string description = 1; + MediaTypes content = 2; + bool required = 3; + repeated NamedAny specification_extension = 4; +} + +message RequestBodyOrReference { + oneof oneof { + RequestBody request_body = 1; + Reference reference = 2; + } +} + +// Describes a single response from an API Operation, including design-time, static `links` to operations based on the response. +message Response { + string description = 1; + HeadersOrReferences headers = 2; + MediaTypes content = 3; + LinksOrReferences links = 4; + repeated NamedAny specification_extension = 5; +} + +message ResponseOrReference { + oneof oneof { + Response response = 1; + Reference reference = 2; + } +} + +// A container for the expected responses of an operation. The container maps a HTTP response code to the expected response. The documentation is not necessarily expected to cover all possible HTTP response codes because they may not be known in advance. However, documentation is expected to cover a successful operation response and any known errors. The `default` MAY be used as a default response object for all HTTP codes that are not covered individually by the specification. The `Responses Object` MUST contain at least one response code, and it SHOULD be the response for a successful operation call. +message Responses { + ResponseOrReference default = 1; + repeated NamedResponseOrReference response_or_reference = 2; + repeated NamedAny specification_extension = 3; +} + +message ResponsesOrReferences { + repeated NamedResponseOrReference additional_properties = 1; +} + +// The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is an extended subset of the JSON Schema Specification Wright Draft 00. For more information about the properties, see JSON Schema Core and JSON Schema Validation. Unless stated otherwise, the property definitions follow the JSON Schema. +message Schema { + bool nullable = 1; + Discriminator discriminator = 2; + bool read_only = 3; + bool write_only = 4; + Xml xml = 5; + ExternalDocs external_docs = 6; + Any example = 7; + bool deprecated = 8; + string title = 9; + double multiple_of = 10; + double maximum = 11; + bool exclusive_maximum = 12; + double minimum = 13; + bool exclusive_minimum = 14; + int64 max_length = 15; + int64 min_length = 16; + string pattern = 17; + int64 max_items = 18; + int64 min_items = 19; + bool unique_items = 20; + int64 max_properties = 21; + int64 min_properties = 22; + repeated string required = 23; + repeated Any enum = 24; + string type = 25; + repeated SchemaOrReference all_of = 26; + repeated SchemaOrReference one_of = 27; + repeated SchemaOrReference any_of = 28; + Schema not = 29; + ItemsItem items = 30; + Properties properties = 31; + AdditionalPropertiesItem additional_properties = 32; + DefaultType default = 33; + string description = 34; + string format = 35; + repeated NamedAny specification_extension = 36; +} + +message SchemaOrReference { + oneof oneof { + Schema schema = 1; + Reference reference = 2; + } +} + +message SchemasOrReferences { + repeated NamedSchemaOrReference additional_properties = 1; +} + +// Lists the required security schemes to execute this operation. The name used for each property MUST correspond to a security scheme declared in the Security Schemes under the Components Object. Security Requirement Objects that contain multiple schemes require that all schemes MUST be satisfied for a request to be authorized. This enables support for scenarios where multiple query parameters or HTTP headers are required to convey security information. When a list of Security Requirement Objects is defined on the OpenAPI Object or Operation Object, only one of the Security Requirement Objects in the list needs to be satisfied to authorize the request. +message SecurityRequirement { + repeated NamedStringArray additional_properties = 1; +} + +// Defines a security scheme that can be used by the operations. Supported schemes are HTTP authentication, an API key (either as a header, a cookie parameter or as a query parameter), mutual TLS (use of a client certificate), OAuth2's common flows (implicit, password, application and access code) as defined in RFC6749, and OpenID Connect. Please note that currently (2019) the implicit flow is about to be deprecated OAuth 2.0 Security Best Current Practice. Recommended for most use case is Authorization Code Grant flow with PKCE. +message SecurityScheme { + string type = 1; + string description = 2; + string name = 3; + string in = 4; + string scheme = 5; + string bearer_format = 6; + OauthFlows flows = 7; + string open_id_connect_url = 8; + repeated NamedAny specification_extension = 9; +} + +message SecuritySchemeOrReference { + oneof oneof { + SecurityScheme security_scheme = 1; + Reference reference = 2; + } +} + +message SecuritySchemesOrReferences { + repeated NamedSecuritySchemeOrReference additional_properties = 1; +} + +// An object representing a Server. +message Server { + string url = 1; + string description = 2; + ServerVariables variables = 3; + repeated NamedAny specification_extension = 4; +} + +// An object representing a Server Variable for server URL template substitution. +message ServerVariable { + repeated string enum = 1; + string default = 2; + string description = 3; + repeated NamedAny specification_extension = 4; +} + +message ServerVariables { + repeated NamedServerVariable additional_properties = 1; +} + +// Any property starting with x- is valid. +message SpecificationExtension { + oneof oneof { + double number = 1; + bool boolean = 2; + string string = 3; + } +} + +message StringArray { + repeated string value = 1; +} + +message Strings { + repeated NamedString additional_properties = 1; +} + +// Adds metadata to a single tag that is used by the Operation Object. It is not mandatory to have a Tag Object per tag defined in the Operation Object instances. +message Tag { + string name = 1; + string description = 2; + ExternalDocs external_docs = 3; + repeated NamedAny specification_extension = 4; +} + +// A metadata object that allows for more fine-tuned XML model definitions. When using arrays, XML element names are *not* inferred (for singular/plural forms) and the `name` property SHOULD be used to add that information. See examples for expected behavior. +message Xml { + string name = 1; + string namespace = 2; + string prefix = 3; + bool attribute = 4; + bool wrapped = 5; + repeated NamedAny specification_extension = 6; +} diff --git a/orm/ent/api/third_party/google/api/annotations.proto b/orm/ent/api/third_party/google/api/annotations.proto new file mode 100644 index 0000000..d18aeb5 --- /dev/null +++ b/orm/ent/api/third_party/google/api/annotations.proto @@ -0,0 +1,31 @@ +// Copyright 2015 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +import "google/api/http.proto"; +import "google/protobuf/descriptor.proto"; + +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "AnnotationsProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +extend google.protobuf.MethodOptions { + // See `HttpRule`. + HttpRule http = 72295728; +} diff --git a/orm/ent/api/third_party/google/api/field_behavior.proto b/orm/ent/api/third_party/google/api/field_behavior.proto new file mode 100644 index 0000000..c4abe3b --- /dev/null +++ b/orm/ent/api/third_party/google/api/field_behavior.proto @@ -0,0 +1,90 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +import "google/protobuf/descriptor.proto"; + +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "FieldBehaviorProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +extend google.protobuf.FieldOptions { + // A designation of a specific field behavior (required, output only, etc.) + // in protobuf messages. + // + // Examples: + // + // string name = 1 [(google.api.field_behavior) = REQUIRED]; + // State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + // google.protobuf.Duration ttl = 1 + // [(google.api.field_behavior) = INPUT_ONLY]; + // google.protobuf.Timestamp expire_time = 1 + // [(google.api.field_behavior) = OUTPUT_ONLY, + // (google.api.field_behavior) = IMMUTABLE]; + repeated google.api.FieldBehavior field_behavior = 1052; +} + +// An indicator of the behavior of a given field (for example, that a field +// is required in requests, or given as output but ignored as input). +// This **does not** change the behavior in protocol buffers itself; it only +// denotes the behavior and may affect how API tooling handles the field. +// +// Note: This enum **may** receive new values in the future. +enum FieldBehavior { + // Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0; + + // Specifically denotes a field as optional. + // While all fields in protocol buffers are optional, this may be specified + // for emphasis if appropriate. + OPTIONAL = 1; + + // Denotes a field as required. + // This indicates that the field **must** be provided as part of the request, + // and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2; + + // Denotes a field as output only. + // This indicates that the field is provided in responses, but including the + // field in a request does nothing (the server *must* ignore it and + // *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3; + + // Denotes a field as input only. + // This indicates that the field is provided in requests, and the + // corresponding field is not included in output. + INPUT_ONLY = 4; + + // Denotes a field as immutable. + // This indicates that the field may be set once in a request to create a + // resource, but may not be changed thereafter. + IMMUTABLE = 5; + + // Denotes that a (repeated) field is an unordered list. + // This indicates that the service may provide the elements of the list + // in any arbitrary order, rather than the order the user originally + // provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6; + + // Denotes that this field returns a non-empty default value if not set. + // This indicates that if the user provides the empty value in a request, + // a non-empty value will be returned. The user will not be aware of what + // non-empty value to expect. + NON_EMPTY_DEFAULT = 7; +} diff --git a/orm/ent/api/third_party/google/api/http.proto b/orm/ent/api/third_party/google/api/http.proto new file mode 100644 index 0000000..2965740 --- /dev/null +++ b/orm/ent/api/third_party/google/api/http.proto @@ -0,0 +1,375 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "HttpProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +// Defines the HTTP configuration for an API service. It contains a list of +// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method +// to one or more HTTP REST API methods. +message Http { + // A list of HTTP configuration rules that apply to individual API methods. + // + // **NOTE:** All service configuration rules follow "last one wins" order. + repeated HttpRule rules = 1; + + // When set to true, URL path parameters will be fully URI-decoded except in + // cases of single segment matches in reserved expansion, where "%2F" will be + // left encoded. + // + // The default behavior is to not decode RFC 6570 reserved characters in multi + // segment matches. + bool fully_decode_reserved_expansion = 2; +} + +// # gRPC Transcoding +// +// gRPC Transcoding is a feature for mapping between a gRPC method and one or +// more HTTP REST endpoints. It allows developers to build a single API service +// that supports both gRPC APIs and REST APIs. Many systems, including [Google +// APIs](https://github.com/googleapis/googleapis), +// [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC +// Gateway](https://github.com/grpc-ecosystem/grpc-gateway), +// and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature +// and use it for large scale production services. +// +// `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies +// how different portions of the gRPC request message are mapped to the URL +// path, URL query parameters, and HTTP request body. It also controls how the +// gRPC response message is mapped to the HTTP response body. `HttpRule` is +// typically specified as an `google.api.http` annotation on the gRPC method. +// +// Each mapping specifies a URL path template and an HTTP method. The path +// template may refer to one or more fields in the gRPC request message, as long +// as each field is a non-repeated field with a primitive (non-message) type. +// The path template controls how fields of the request message are mapped to +// the URL path. +// +// Example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get: "/v1/{name=messages/*}" +// }; +// } +// } +// message GetMessageRequest { +// string name = 1; // Mapped to URL path. +// } +// message Message { +// string text = 1; // The resource content. +// } +// +// This enables an HTTP REST to gRPC mapping as below: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` +// +// Any fields in the request message which are not bound by the path template +// automatically become HTTP query parameters if there is no HTTP request body. +// For example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get:"/v1/messages/{message_id}" +// }; +// } +// } +// message GetMessageRequest { +// message SubMessage { +// string subfield = 1; +// } +// string message_id = 1; // Mapped to URL path. +// int64 revision = 2; // Mapped to URL query parameter `revision`. +// SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. +// } +// +// This enables a HTTP JSON to RPC mapping as below: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | +// `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: +// "foo"))` +// +// Note that fields which are mapped to URL query parameters must have a +// primitive type or a repeated primitive type or a non-repeated message type. +// In the case of a repeated type, the parameter can be repeated in the URL +// as `...?param=A¶m=B`. In the case of a message type, each field of the +// message is mapped to a separate parameter, such as +// `...?foo.a=A&foo.b=B&foo.c=C`. +// +// For HTTP methods that allow a request body, the `body` field +// specifies the mapping. Consider a REST update method on the +// message resource collection: +// +// service Messaging { +// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { +// option (google.api.http) = { +// patch: "/v1/messages/{message_id}" +// body: "message" +// }; +// } +// } +// message UpdateMessageRequest { +// string message_id = 1; // mapped to the URL +// Message message = 2; // mapped to the body +// } +// +// The following HTTP JSON to RPC mapping is enabled, where the +// representation of the JSON in the request body is determined by +// protos JSON encoding: +// +// HTTP | gRPC +// -----|----- +// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: +// "123456" message { text: "Hi!" })` +// +// The special name `*` can be used in the body mapping to define that +// every field not bound by the path template should be mapped to the +// request body. This enables the following alternative definition of +// the update method: +// +// service Messaging { +// rpc UpdateMessage(Message) returns (Message) { +// option (google.api.http) = { +// patch: "/v1/messages/{message_id}" +// body: "*" +// }; +// } +// } +// message Message { +// string message_id = 1; +// string text = 2; +// } +// +// +// The following HTTP JSON to RPC mapping is enabled: +// +// HTTP | gRPC +// -----|----- +// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: +// "123456" text: "Hi!")` +// +// Note that when using `*` in the body mapping, it is not possible to +// have HTTP parameters, as all fields not bound by the path end in +// the body. This makes this option more rarely used in practice when +// defining REST APIs. The common usage of `*` is in custom methods +// which don't use the URL at all for transferring data. +// +// It is possible to define multiple HTTP methods for one RPC by using +// the `additional_bindings` option. Example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get: "/v1/messages/{message_id}" +// additional_bindings { +// get: "/v1/users/{user_id}/messages/{message_id}" +// } +// }; +// } +// } +// message GetMessageRequest { +// string message_id = 1; +// string user_id = 2; +// } +// +// This enables the following two alternative HTTP JSON to RPC mappings: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` +// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: +// "123456")` +// +// ## Rules for HTTP mapping +// +// 1. Leaf request fields (recursive expansion nested messages in the request +// message) are classified into three categories: +// - Fields referred by the path template. They are passed via the URL path. +// - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP +// request body. +// - All other fields are passed via the URL query parameters, and the +// parameter name is the field path in the request message. A repeated +// field can be represented as multiple query parameters under the same +// name. +// 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields +// are passed via URL path and HTTP request body. +// 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all +// fields are passed via URL path and URL query parameters. +// +// ### Path template syntax +// +// Template = "/" Segments [ Verb ] ; +// Segments = Segment { "/" Segment } ; +// Segment = "*" | "**" | LITERAL | Variable ; +// Variable = "{" FieldPath [ "=" Segments ] "}" ; +// FieldPath = IDENT { "." IDENT } ; +// Verb = ":" LITERAL ; +// +// The syntax `*` matches a single URL path segment. The syntax `**` matches +// zero or more URL path segments, which must be the last part of the URL path +// except the `Verb`. +// +// The syntax `Variable` matches part of the URL path as specified by its +// template. A variable template must not contain other variables. If a variable +// matches a single path segment, its template may be omitted, e.g. `{var}` +// is equivalent to `{var=*}`. +// +// The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` +// contains any reserved character, such characters should be percent-encoded +// before the matching. +// +// If a variable contains exactly one path segment, such as `"{var}"` or +// `"{var=*}"`, when such a variable is expanded into a URL path on the client +// side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The +// server side does the reverse decoding. Such variables show up in the +// [Discovery +// Document](https://developers.google.com/discovery/v1/reference/apis) as +// `{var}`. +// +// If a variable contains multiple path segments, such as `"{var=foo/*}"` +// or `"{var=**}"`, when such a variable is expanded into a URL path on the +// client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. +// The server side does the reverse decoding, except "%2F" and "%2f" are left +// unchanged. Such variables show up in the +// [Discovery +// Document](https://developers.google.com/discovery/v1/reference/apis) as +// `{+var}`. +// +// ## Using gRPC API Service Configuration +// +// gRPC API Service Configuration (service config) is a configuration language +// for configuring a gRPC service to become a user-facing product. The +// service config is simply the YAML representation of the `google.api.Service` +// proto message. +// +// As an alternative to annotating your proto file, you can configure gRPC +// transcoding in your service config YAML files. You do this by specifying a +// `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same +// effect as the proto annotation. This can be particularly useful if you +// have a proto that is reused in multiple services. Note that any transcoding +// specified in the service config will override any matching transcoding +// configuration in the proto. +// +// Example: +// +// http: +// rules: +// # Selects a gRPC method and applies HttpRule to it. +// - selector: example.v1.Messaging.GetMessage +// get: /v1/messages/{message_id}/{sub.subfield} +// +// ## Special notes +// +// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the +// proto to JSON conversion must follow the [proto3 +// specification](https://developers.google.com/protocol-buffers/docs/proto3#json). +// +// While the single segment variable follows the semantics of +// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String +// Expansion, the multi segment variable **does not** follow RFC 6570 Section +// 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion +// does not expand special characters like `?` and `#`, which would lead +// to invalid URLs. As the result, gRPC Transcoding uses a custom encoding +// for multi segment variables. +// +// The path variables **must not** refer to any repeated or mapped field, +// because client libraries are not capable of handling such variable expansion. +// +// The path variables **must not** capture the leading "/" character. The reason +// is that the most common use case "{var}" does not capture the leading "/" +// character. For consistency, all path variables must share the same behavior. +// +// Repeated message fields must not be mapped to URL query parameters, because +// no client library can support such complicated mapping. +// +// If an API needs to use a JSON array for request or response body, it can map +// the request or response body to a repeated field. However, some gRPC +// Transcoding implementations may not support this feature. +message HttpRule { + // Selects a method to which this rule applies. + // + // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + string selector = 1; + + // Determines the URL pattern is matched by this rules. This pattern can be + // used with any of the {get|put|post|delete|patch} methods. A custom method + // can be defined using the 'custom' field. + oneof pattern { + // Maps to HTTP GET. Used for listing and getting information about + // resources. + string get = 2; + + // Maps to HTTP PUT. Used for replacing a resource. + string put = 3; + + // Maps to HTTP POST. Used for creating a resource or performing an action. + string post = 4; + + // Maps to HTTP DELETE. Used for deleting a resource. + string delete = 5; + + // Maps to HTTP PATCH. Used for updating a resource. + string patch = 6; + + // The custom pattern is used for specifying an HTTP method that is not + // included in the `pattern` field, such as HEAD, or "*" to leave the + // HTTP method unspecified for this rule. The wild-card rule is useful + // for services that provide content to Web (HTML) clients. + CustomHttpPattern custom = 8; + } + + // The name of the request field whose value is mapped to the HTTP request + // body, or `*` for mapping all request fields not captured by the path + // pattern to the HTTP body, or omitted for not having any HTTP request body. + // + // NOTE: the referred field must be present at the top-level of the request + // message type. + string body = 7; + + // Optional. The name of the response field whose value is mapped to the HTTP + // response body. When omitted, the entire response message will be used + // as the HTTP response body. + // + // NOTE: The referred field must be present at the top-level of the response + // message type. + string response_body = 12; + + // Additional HTTP bindings for the selector. Nested bindings must + // not contain an `additional_bindings` field themselves (that is, + // the nesting may only be one level deep). + repeated HttpRule additional_bindings = 11; +} + +// A custom pattern is used for defining custom HTTP verb. +message CustomHttpPattern { + // The name of this custom HTTP verb. + string kind = 1; + + // The path matched by this custom verb. + string path = 2; +} diff --git a/orm/ent/api/third_party/google/api/httpbody.proto b/orm/ent/api/third_party/google/api/httpbody.proto new file mode 100644 index 0000000..950be8f --- /dev/null +++ b/orm/ent/api/third_party/google/api/httpbody.proto @@ -0,0 +1,81 @@ +// Copyright 2015 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +import "google/protobuf/any.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "HttpBodyProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +// Message that represents an arbitrary HTTP body. It should only be used for +// payload formats that can't be represented as JSON, such as raw binary or +// an HTML page. +// +// +// This message can be used both in streaming and non-streaming API methods in +// the request as well as the response. +// +// It can be used as a top-level request field, which is convenient if one +// wants to extract parameters from either the URL or HTTP template into the +// request fields and also want access to the raw HTTP body. +// +// Example: +// +// message GetResourceRequest { +// // A unique request id. +// string request_id = 1; +// +// // The raw HTTP body is bound to this field. +// google.api.HttpBody http_body = 2; +// +// } +// +// service ResourceService { +// rpc GetResource(GetResourceRequest) +// returns (google.api.HttpBody); +// rpc UpdateResource(google.api.HttpBody) +// returns (google.protobuf.Empty); +// +// } +// +// Example with streaming methods: +// +// service CaldavService { +// rpc GetCalendar(stream google.api.HttpBody) +// returns (stream google.api.HttpBody); +// rpc UpdateCalendar(stream google.api.HttpBody) +// returns (stream google.api.HttpBody); +// +// } +// +// Use of this type only changes how the request and response bodies are +// handled, all other features will continue to work unchanged. +message HttpBody { + // The HTTP Content-Type header value specifying the content type of the body. + string content_type = 1; + + // The HTTP request/response body as raw binary. + bytes data = 2; + + // Application specific response metadata. Must be set in the first response + // for streaming APIs. + repeated google.protobuf.Any extensions = 3; +} diff --git a/orm/ent/api/third_party/google/protobuf/any.proto b/orm/ent/api/third_party/google/protobuf/any.proto new file mode 100644 index 0000000..c9be854 --- /dev/null +++ b/orm/ent/api/third_party/google/protobuf/any.proto @@ -0,0 +1,155 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "github.com/golang/protobuf/ptypes/any"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "AnyProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// `Any` contains an arbitrary serialized protocol buffer message along with a +// URL that describes the type of the serialized message. +// +// Protobuf library provides support to pack/unpack Any values in the form +// of utility functions or additional generated methods of the Any type. +// +// Example 1: Pack and unpack a message in C++. +// +// Foo foo = ...; +// Any any; +// any.PackFrom(foo); +// ... +// if (any.UnpackTo(&foo)) { +// ... +// } +// +// Example 2: Pack and unpack a message in Java. +// +// Foo foo = ...; +// Any any = Any.pack(foo); +// ... +// if (any.is(Foo.class)) { +// foo = any.unpack(Foo.class); +// } +// +// Example 3: Pack and unpack a message in Python. +// +// foo = Foo(...) +// any = Any() +// any.Pack(foo) +// ... +// if any.Is(Foo.DESCRIPTOR): +// any.Unpack(foo) +// ... +// +// Example 4: Pack and unpack a message in Go +// +// foo := &pb.Foo{...} +// any, err := ptypes.MarshalAny(foo) +// ... +// foo := &pb.Foo{} +// if err := ptypes.UnmarshalAny(any, foo); err != nil { +// ... +// } +// +// The pack methods provided by protobuf library will by default use +// 'type.googleapis.com/full.type.name' as the type URL and the unpack +// methods only use the fully qualified type name after the last '/' +// in the type URL, for example "foo.bar.com/x/y.z" will yield type +// name "y.z". +// +// +// JSON +// ==== +// The JSON representation of an `Any` value uses the regular +// representation of the deserialized, embedded message, with an +// additional field `@type` which contains the type URL. Example: +// +// package google.profile; +// message Person { +// string first_name = 1; +// string last_name = 2; +// } +// +// { +// "@type": "type.googleapis.com/google.profile.Person", +// "firstName": , +// "lastName": +// } +// +// If the embedded message type is well-known and has a custom JSON +// representation, that representation will be embedded adding a field +// `value` which holds the custom JSON in addition to the `@type` +// field. Example (for message [google.protobuf.Duration][]): +// +// { +// "@type": "type.googleapis.com/google.protobuf.Duration", +// "value": "1.212s" +// } +// +message Any { + // A URL/resource name that uniquely identifies the type of the serialized + // protocol buffer message. This string must contain at least + // one "/" character. The last segment of the URL's path must represent + // the fully qualified name of the type (as in + // `path/google.protobuf.Duration`). The name should be in a canonical form + // (e.g., leading "." is not accepted). + // + // In practice, teams usually precompile into the binary all types that they + // expect it to use in the context of Any. However, for URLs which use the + // scheme `http`, `https`, or no scheme, one can optionally set up a type + // server that maps type URLs to message definitions as follows: + // + // * If no scheme is provided, `https` is assumed. + // * An HTTP GET on the URL must yield a [google.protobuf.Type][] + // value in binary format, or produce an error. + // * Applications are allowed to cache lookup results based on the + // URL, or have them precompiled into a binary to avoid any + // lookup. Therefore, binary compatibility needs to be preserved + // on changes to types. (Use versioned type names to manage + // breaking changes.) + // + // Note: this functionality is not currently available in the official + // protobuf release, and it is not used for type URLs beginning with + // type.googleapis.com. + // + // Schemes other than `http`, `https` (or the empty scheme) might be + // used with implementation specific semantics. + // + string type_url = 1; + + // Must be a valid serialized protocol buffer of the above specified type. + bytes value = 2; +} diff --git a/orm/ent/api/third_party/google/protobuf/api.proto b/orm/ent/api/third_party/google/protobuf/api.proto new file mode 100644 index 0000000..f37ee2f --- /dev/null +++ b/orm/ent/api/third_party/google/protobuf/api.proto @@ -0,0 +1,210 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +import "google/protobuf/source_context.proto"; +import "google/protobuf/type.proto"; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "ApiProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option go_package = "google.golang.org/genproto/protobuf/api;api"; + +// Api is a light-weight descriptor for an API Interface. +// +// Interfaces are also described as "protocol buffer services" in some contexts, +// such as by the "service" keyword in a .proto file, but they are different +// from API Services, which represent a concrete implementation of an interface +// as opposed to simply a description of methods and bindings. They are also +// sometimes simply referred to as "APIs" in other contexts, such as the name of +// this message itself. See https://cloud.google.com/apis/design/glossary for +// detailed terminology. +message Api { + + // The fully qualified name of this interface, including package name + // followed by the interface's simple name. + string name = 1; + + // The methods of this interface, in unspecified order. + repeated Method methods = 2; + + // Any metadata attached to the interface. + repeated Option options = 3; + + // A version string for this interface. If specified, must have the form + // `major-version.minor-version`, as in `1.10`. If the minor version is + // omitted, it defaults to zero. If the entire version field is empty, the + // major version is derived from the package name, as outlined below. If the + // field is not empty, the version in the package name will be verified to be + // consistent with what is provided here. + // + // The versioning schema uses [semantic + // versioning](http://semver.org) where the major version number + // indicates a breaking change and the minor version an additive, + // non-breaking change. Both version numbers are signals to users + // what to expect from different versions, and should be carefully + // chosen based on the product plan. + // + // The major version is also reflected in the package name of the + // interface, which must end in `v`, as in + // `google.feature.v1`. For major versions 0 and 1, the suffix can + // be omitted. Zero major versions must only be used for + // experimental, non-GA interfaces. + // + // + string version = 4; + + // Source context for the protocol buffer service represented by this + // message. + SourceContext source_context = 5; + + // Included interfaces. See [Mixin][]. + repeated Mixin mixins = 6; + + // The source syntax of the service. + Syntax syntax = 7; +} + +// Method represents a method of an API interface. +message Method { + + // The simple name of this method. + string name = 1; + + // A URL of the input message type. + string request_type_url = 2; + + // If true, the request is streamed. + bool request_streaming = 3; + + // The URL of the output message type. + string response_type_url = 4; + + // If true, the response is streamed. + bool response_streaming = 5; + + // Any metadata attached to the method. + repeated Option options = 6; + + // The source syntax of this method. + Syntax syntax = 7; +} + +// Declares an API Interface to be included in this interface. The including +// interface must redeclare all the methods from the included interface, but +// documentation and options are inherited as follows: +// +// - If after comment and whitespace stripping, the documentation +// string of the redeclared method is empty, it will be inherited +// from the original method. +// +// - Each annotation belonging to the service config (http, +// visibility) which is not set in the redeclared method will be +// inherited. +// +// - If an http annotation is inherited, the path pattern will be +// modified as follows. Any version prefix will be replaced by the +// version of the including interface plus the [root][] path if +// specified. +// +// Example of a simple mixin: +// +// package google.acl.v1; +// service AccessControl { +// // Get the underlying ACL object. +// rpc GetAcl(GetAclRequest) returns (Acl) { +// option (google.api.http).get = "/v1/{resource=**}:getAcl"; +// } +// } +// +// package google.storage.v2; +// service Storage { +// rpc GetAcl(GetAclRequest) returns (Acl); +// +// // Get a data record. +// rpc GetData(GetDataRequest) returns (Data) { +// option (google.api.http).get = "/v2/{resource=**}"; +// } +// } +// +// Example of a mixin configuration: +// +// apis: +// - name: google.storage.v2.Storage +// mixins: +// - name: google.acl.v1.AccessControl +// +// The mixin construct implies that all methods in `AccessControl` are +// also declared with same name and request/response types in +// `Storage`. A documentation generator or annotation processor will +// see the effective `Storage.GetAcl` method after inherting +// documentation and annotations as follows: +// +// service Storage { +// // Get the underlying ACL object. +// rpc GetAcl(GetAclRequest) returns (Acl) { +// option (google.api.http).get = "/v2/{resource=**}:getAcl"; +// } +// ... +// } +// +// Note how the version in the path pattern changed from `v1` to `v2`. +// +// If the `root` field in the mixin is specified, it should be a +// relative path under which inherited HTTP paths are placed. Example: +// +// apis: +// - name: google.storage.v2.Storage +// mixins: +// - name: google.acl.v1.AccessControl +// root: acls +// +// This implies the following inherited HTTP annotation: +// +// service Storage { +// // Get the underlying ACL object. +// rpc GetAcl(GetAclRequest) returns (Acl) { +// option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; +// } +// ... +// } +message Mixin { + // The fully qualified name of the interface which is included. + string name = 1; + + // If non-empty specifies a path under which inherited HTTP paths + // are rooted. + string root = 2; +} diff --git a/orm/ent/api/third_party/google/protobuf/descriptor.proto b/orm/ent/api/third_party/google/protobuf/descriptor.proto new file mode 100644 index 0000000..a2102d7 --- /dev/null +++ b/orm/ent/api/third_party/google/protobuf/descriptor.proto @@ -0,0 +1,885 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// The messages in this file describe the definitions found in .proto files. +// A valid .proto file can be translated directly to a FileDescriptorProto +// without any other information (e.g. without reading its imports). + + +syntax = "proto2"; + +package google.protobuf; + +option go_package = "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "DescriptorProtos"; +option csharp_namespace = "Google.Protobuf.Reflection"; +option objc_class_prefix = "GPB"; +option cc_enable_arenas = true; + +// descriptor.proto must be optimized for speed because reflection-based +// algorithms don't work during bootstrapping. +option optimize_for = SPEED; + +// The protocol compiler can output a FileDescriptorSet containing the .proto +// files it parses. +message FileDescriptorSet { + repeated FileDescriptorProto file = 1; +} + +// Describes a complete .proto file. +message FileDescriptorProto { + optional string name = 1; // file name, relative to root of source tree + optional string package = 2; // e.g. "foo", "foo.bar", etc. + + // Names of files imported by this file. + repeated string dependency = 3; + // Indexes of the public imported files in the dependency list above. + repeated int32 public_dependency = 10; + // Indexes of the weak imported files in the dependency list. + // For Google-internal migration only. Do not use. + repeated int32 weak_dependency = 11; + + // All top-level definitions in this file. + repeated DescriptorProto message_type = 4; + repeated EnumDescriptorProto enum_type = 5; + repeated ServiceDescriptorProto service = 6; + repeated FieldDescriptorProto extension = 7; + + optional FileOptions options = 8; + + // This field contains optional information about the original source code. + // You may safely remove this entire field without harming runtime + // functionality of the descriptors -- the information is needed only by + // development tools. + optional SourceCodeInfo source_code_info = 9; + + // The syntax of the proto file. + // The supported values are "proto2" and "proto3". + optional string syntax = 12; +} + +// Describes a message type. +message DescriptorProto { + optional string name = 1; + + repeated FieldDescriptorProto field = 2; + repeated FieldDescriptorProto extension = 6; + + repeated DescriptorProto nested_type = 3; + repeated EnumDescriptorProto enum_type = 4; + + message ExtensionRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. + + optional ExtensionRangeOptions options = 3; + } + repeated ExtensionRange extension_range = 5; + + repeated OneofDescriptorProto oneof_decl = 8; + + optional MessageOptions options = 7; + + // Range of reserved tag numbers. Reserved tag numbers may not be used by + // fields or extension ranges in the same message. Reserved ranges may + // not overlap. + message ReservedRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. + } + repeated ReservedRange reserved_range = 9; + // Reserved field names, which may not be used by fields in the same message. + // A given name may only be reserved once. + repeated string reserved_name = 10; +} + +message ExtensionRangeOptions { + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +// Describes a field within a message. +message FieldDescriptorProto { + enum Type { + // 0 is reserved for errors. + // Order is weird for historical reasons. + TYPE_DOUBLE = 1; + TYPE_FLOAT = 2; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + // negative values are likely. + TYPE_INT64 = 3; + TYPE_UINT64 = 4; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + // negative values are likely. + TYPE_INT32 = 5; + TYPE_FIXED64 = 6; + TYPE_FIXED32 = 7; + TYPE_BOOL = 8; + TYPE_STRING = 9; + // Tag-delimited aggregate. + // Group type is deprecated and not supported in proto3. However, Proto3 + // implementations should still be able to parse the group wire format and + // treat group fields as unknown fields. + TYPE_GROUP = 10; + TYPE_MESSAGE = 11; // Length-delimited aggregate. + + // New in version 2. + TYPE_BYTES = 12; + TYPE_UINT32 = 13; + TYPE_ENUM = 14; + TYPE_SFIXED32 = 15; + TYPE_SFIXED64 = 16; + TYPE_SINT32 = 17; // Uses ZigZag encoding. + TYPE_SINT64 = 18; // Uses ZigZag encoding. + } + + enum Label { + // 0 is reserved for errors + LABEL_OPTIONAL = 1; + LABEL_REQUIRED = 2; + LABEL_REPEATED = 3; + } + + optional string name = 1; + optional int32 number = 3; + optional Label label = 4; + + // If type_name is set, this need not be set. If both this and type_name + // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + optional Type type = 5; + + // For message and enum types, this is the name of the type. If the name + // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + // rules are used to find the type (i.e. first the nested types within this + // message are searched, then within the parent, on up to the root + // namespace). + optional string type_name = 6; + + // For extensions, this is the name of the type being extended. It is + // resolved in the same manner as type_name. + optional string extendee = 2; + + // For numeric types, contains the original text representation of the value. + // For booleans, "true" or "false". + // For strings, contains the default text contents (not escaped in any way). + // For bytes, contains the C escaped value. All bytes >= 128 are escaped. + // TODO(kenton): Base-64 encode? + optional string default_value = 7; + + // If set, gives the index of a oneof in the containing type's oneof_decl + // list. This field is a member of that oneof. + optional int32 oneof_index = 9; + + // JSON name of this field. The value is set by protocol compiler. If the + // user has set a "json_name" option on this field, that option's value + // will be used. Otherwise, it's deduced from the field's name by converting + // it to camelCase. + optional string json_name = 10; + + optional FieldOptions options = 8; +} + +// Describes a oneof. +message OneofDescriptorProto { + optional string name = 1; + optional OneofOptions options = 2; +} + +// Describes an enum type. +message EnumDescriptorProto { + optional string name = 1; + + repeated EnumValueDescriptorProto value = 2; + + optional EnumOptions options = 3; + + // Range of reserved numeric values. Reserved values may not be used by + // entries in the same enum. Reserved ranges may not overlap. + // + // Note that this is distinct from DescriptorProto.ReservedRange in that it + // is inclusive such that it can appropriately represent the entire int32 + // domain. + message EnumReservedRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Inclusive. + } + + // Range of reserved numeric values. Reserved numeric values may not be used + // by enum values in the same enum declaration. Reserved ranges may not + // overlap. + repeated EnumReservedRange reserved_range = 4; + + // Reserved enum value names, which may not be reused. A given name may only + // be reserved once. + repeated string reserved_name = 5; +} + +// Describes a value within an enum. +message EnumValueDescriptorProto { + optional string name = 1; + optional int32 number = 2; + + optional EnumValueOptions options = 3; +} + +// Describes a service. +message ServiceDescriptorProto { + optional string name = 1; + repeated MethodDescriptorProto method = 2; + + optional ServiceOptions options = 3; +} + +// Describes a method of a service. +message MethodDescriptorProto { + optional string name = 1; + + // Input and output type names. These are resolved in the same way as + // FieldDescriptorProto.type_name, but must refer to a message type. + optional string input_type = 2; + optional string output_type = 3; + + optional MethodOptions options = 4; + + // Identifies if client streams multiple client messages + optional bool client_streaming = 5 [default = false]; + // Identifies if server streams multiple server messages + optional bool server_streaming = 6 [default = false]; +} + + +// =================================================================== +// Options + +// Each of the definitions above may have "options" attached. These are +// just annotations which may cause code to be generated slightly differently +// or may contain hints for code that manipulates protocol messages. +// +// Clients may define custom options as extensions of the *Options messages. +// These extensions may not yet be known at parsing time, so the parser cannot +// store the values in them. Instead it stores them in a field in the *Options +// message called uninterpreted_option. This field must have the same name +// across all *Options messages. We then use this field to populate the +// extensions when we build a descriptor, at which point all protos have been +// parsed and so all extensions are known. +// +// Extension numbers for custom options may be chosen as follows: +// * For options which will only be used within a single application or +// organization, or for experimental options, use field numbers 50000 +// through 99999. It is up to you to ensure that you do not use the +// same number for multiple options. +// * For options which will be published and used publicly by multiple +// independent entities, e-mail protobuf-global-extension-registry@google.com +// to reserve extension numbers. Simply provide your project name (e.g. +// Objective-C plugin) and your project website (if available) -- there's no +// need to explain how you intend to use them. Usually you only need one +// extension number. You can declare multiple options with only one extension +// number by putting them in a sub-message. See the Custom Options section of +// the docs for examples: +// https://developers.google.com/protocol-buffers/docs/proto#options +// If this turns out to be popular, a web service will be set up +// to automatically assign option numbers. + +message FileOptions { + + // Sets the Java package where classes generated from this .proto will be + // placed. By default, the proto package is used, but this is often + // inappropriate because proto packages do not normally start with backwards + // domain names. + optional string java_package = 1; + + + // If set, all the classes from the .proto file are wrapped in a single + // outer class with the given name. This applies to both Proto1 + // (equivalent to the old "--one_java_file" option) and Proto2 (where + // a .proto always translates to a single class, but you may want to + // explicitly choose the class name). + optional string java_outer_classname = 8; + + // If set true, then the Java code generator will generate a separate .java + // file for each top-level message, enum, and service defined in the .proto + // file. Thus, these types will *not* be nested inside the outer class + // named by java_outer_classname. However, the outer class will still be + // generated to contain the file's getDescriptor() method as well as any + // top-level extensions defined in the file. + optional bool java_multiple_files = 10 [default = false]; + + // This option does nothing. + optional bool java_generate_equals_and_hash = 20 [deprecated=true]; + + // If set true, then the Java2 code generator will generate code that + // throws an exception whenever an attempt is made to assign a non-UTF-8 + // byte sequence to a string field. + // Message reflection will do the same. + // However, an extension field still accepts non-UTF-8 byte sequences. + // This option has no effect on when used with the lite runtime. + optional bool java_string_check_utf8 = 27 [default = false]; + + + // Generated classes can be optimized for speed or code size. + enum OptimizeMode { + SPEED = 1; // Generate complete code for parsing, serialization, + // etc. + CODE_SIZE = 2; // Use ReflectionOps to implement these methods. + LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. + } + optional OptimizeMode optimize_for = 9 [default = SPEED]; + + // Sets the Go package where structs generated from this .proto will be + // placed. If omitted, the Go package will be derived from the following: + // - The basename of the package import path, if provided. + // - Otherwise, the package statement in the .proto file, if present. + // - Otherwise, the basename of the .proto file, without extension. + optional string go_package = 11; + + + + + // Should generic services be generated in each language? "Generic" services + // are not specific to any particular RPC system. They are generated by the + // main code generators in each language (without additional plugins). + // Generic services were the only kind of service generation supported by + // early versions of google.protobuf. + // + // Generic services are now considered deprecated in favor of using plugins + // that generate code specific to your particular RPC system. Therefore, + // these default to false. Old code which depends on generic services should + // explicitly set them to true. + optional bool cc_generic_services = 16 [default = false]; + optional bool java_generic_services = 17 [default = false]; + optional bool py_generic_services = 18 [default = false]; + optional bool php_generic_services = 42 [default = false]; + + // Is this file deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for everything in the file, or it will be completely ignored; in the very + // least, this is a formalization for deprecating files. + optional bool deprecated = 23 [default = false]; + + // Enables the use of arenas for the proto messages in this file. This applies + // only to generated classes for C++. + optional bool cc_enable_arenas = 31 [default = false]; + + + // Sets the objective c class prefix which is prepended to all objective c + // generated classes from this .proto. There is no default. + optional string objc_class_prefix = 36; + + // Namespace for generated classes; defaults to the package. + optional string csharp_namespace = 37; + + // By default Swift generators will take the proto package and CamelCase it + // replacing '.' with underscore and use that to prefix the types/symbols + // defined. When this options is provided, they will use this value instead + // to prefix the types/symbols defined. + optional string swift_prefix = 39; + + // Sets the php class prefix which is prepended to all php generated classes + // from this .proto. Default is empty. + optional string php_class_prefix = 40; + + // Use this option to change the namespace of php generated classes. Default + // is empty. When this option is empty, the package name will be used for + // determining the namespace. + optional string php_namespace = 41; + + // Use this option to change the namespace of php generated metadata classes. + // Default is empty. When this option is empty, the proto file name will be + // used for determining the namespace. + optional string php_metadata_namespace = 44; + + // Use this option to change the package of ruby generated classes. Default + // is empty. When this option is not set, the package name will be used for + // determining the ruby package. + optional string ruby_package = 45; + + + // The parser stores options it doesn't recognize here. + // See the documentation for the "Options" section above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. + // See the documentation for the "Options" section above. + extensions 1000 to max; + + reserved 38; +} + +message MessageOptions { + // Set true to use the old proto1 MessageSet wire format for extensions. + // This is provided for backwards-compatibility with the MessageSet wire + // format. You should not use this for any other reason: It's less + // efficient, has fewer features, and is more complicated. + // + // The message must be defined exactly as follows: + // message Foo { + // option message_set_wire_format = true; + // extensions 4 to max; + // } + // Note that the message cannot have any defined fields; MessageSets only + // have extensions. + // + // All extensions of your type must be singular messages; e.g. they cannot + // be int32s, enums, or repeated messages. + // + // Because this is an option, the above two restrictions are not enforced by + // the protocol compiler. + optional bool message_set_wire_format = 1 [default = false]; + + // Disables the generation of the standard "descriptor()" accessor, which can + // conflict with a field of the same name. This is meant to make migration + // from proto1 easier; new code should avoid fields named "descriptor". + optional bool no_standard_descriptor_accessor = 2 [default = false]; + + // Is this message deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the message, or it will be completely ignored; in the very least, + // this is a formalization for deprecating messages. + optional bool deprecated = 3 [default = false]; + + // Whether the message is an automatically generated map entry type for the + // maps field. + // + // For maps fields: + // map map_field = 1; + // The parsed descriptor looks like: + // message MapFieldEntry { + // option map_entry = true; + // optional KeyType key = 1; + // optional ValueType value = 2; + // } + // repeated MapFieldEntry map_field = 1; + // + // Implementations may choose not to generate the map_entry=true message, but + // use a native map in the target language to hold the keys and values. + // The reflection APIs in such implementations still need to work as + // if the field is a repeated message field. + // + // NOTE: Do not set the option in .proto files. Always use the maps syntax + // instead. The option should only be implicitly set by the proto compiler + // parser. + optional bool map_entry = 7; + + reserved 8; // javalite_serializable + reserved 9; // javanano_as_lite + + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message FieldOptions { + // The ctype option instructs the C++ code generator to use a different + // representation of the field than it normally would. See the specific + // options below. This option is not yet implemented in the open source + // release -- sorry, we'll try to include it in a future version! + optional CType ctype = 1 [default = STRING]; + enum CType { + // Default mode. + STRING = 0; + + CORD = 1; + + STRING_PIECE = 2; + } + // The packed option can be enabled for repeated primitive fields to enable + // a more efficient representation on the wire. Rather than repeatedly + // writing the tag and type for each element, the entire array is encoded as + // a single length-delimited blob. In proto3, only explicit setting it to + // false will avoid using packed encoding. + optional bool packed = 2; + + // The jstype option determines the JavaScript type used for values of the + // field. The option is permitted only for 64 bit integral and fixed types + // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + // is represented as JavaScript string, which avoids loss of precision that + // can happen when a large value is converted to a floating point JavaScript. + // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + // use the JavaScript "number" type. The behavior of the default option + // JS_NORMAL is implementation dependent. + // + // This option is an enum to permit additional types to be added, e.g. + // goog.math.Integer. + optional JSType jstype = 6 [default = JS_NORMAL]; + enum JSType { + // Use the default type. + JS_NORMAL = 0; + + // Use JavaScript strings. + JS_STRING = 1; + + // Use JavaScript numbers. + JS_NUMBER = 2; + } + + // Should this field be parsed lazily? Lazy applies only to message-type + // fields. It means that when the outer message is initially parsed, the + // inner message's contents will not be parsed but instead stored in encoded + // form. The inner message will actually be parsed when it is first accessed. + // + // This is only a hint. Implementations are free to choose whether to use + // eager or lazy parsing regardless of the value of this option. However, + // setting this option true suggests that the protocol author believes that + // using lazy parsing on this field is worth the additional bookkeeping + // overhead typically needed to implement it. + // + // This option does not affect the public interface of any generated code; + // all method signatures remain the same. Furthermore, thread-safety of the + // interface is not affected by this option; const methods remain safe to + // call from multiple threads concurrently, while non-const methods continue + // to require exclusive access. + // + // + // Note that implementations may choose not to check required fields within + // a lazy sub-message. That is, calling IsInitialized() on the outer message + // may return true even if the inner message has missing required fields. + // This is necessary because otherwise the inner message would have to be + // parsed in order to perform the check, defeating the purpose of lazy + // parsing. An implementation which chooses not to check required fields + // must be consistent about it. That is, for any particular sub-message, the + // implementation must either *always* check its required fields, or *never* + // check its required fields, regardless of whether or not the message has + // been parsed. + optional bool lazy = 5 [default = false]; + + // Is this field deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for accessors, or it will be completely ignored; in the very least, this + // is a formalization for deprecating fields. + optional bool deprecated = 3 [default = false]; + + // For Google-internal migration only. Do not use. + optional bool weak = 10 [default = false]; + + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; + + reserved 4; // removed jtype +} + +message OneofOptions { + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message EnumOptions { + + // Set this option to true to allow mapping different tag names to the same + // value. + optional bool allow_alias = 2; + + // Is this enum deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum, or it will be completely ignored; in the very least, this + // is a formalization for deprecating enums. + optional bool deprecated = 3 [default = false]; + + reserved 5; // javanano_as_lite + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message EnumValueOptions { + // Is this enum value deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum value, or it will be completely ignored; in the very least, + // this is a formalization for deprecating enum values. + optional bool deprecated = 1 [default = false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message ServiceOptions { + + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + // Is this service deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the service, or it will be completely ignored; in the very least, + // this is a formalization for deprecating services. + optional bool deprecated = 33 [default = false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message MethodOptions { + + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + // Is this method deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the method, or it will be completely ignored; in the very least, + // this is a formalization for deprecating methods. + optional bool deprecated = 33 [default = false]; + + // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + // or neither? HTTP based RPC implementation may choose GET verb for safe + // methods, and PUT verb for idempotent methods instead of the default POST. + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0; + NO_SIDE_EFFECTS = 1; // implies idempotent + IDEMPOTENT = 2; // idempotent, but may have side effects + } + optional IdempotencyLevel idempotency_level = 34 + [default = IDEMPOTENCY_UNKNOWN]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + + +// A message representing a option the parser does not recognize. This only +// appears in options protos created by the compiler::Parser class. +// DescriptorPool resolves these when building Descriptor objects. Therefore, +// options protos in descriptor objects (e.g. returned by Descriptor::options(), +// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions +// in them. +message UninterpretedOption { + // The name of the uninterpreted option. Each string represents a segment in + // a dot-separated name. is_extension is true iff a segment represents an + // extension (denoted with parentheses in options specs in .proto files). + // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents + // "foo.(bar.baz).qux". + message NamePart { + required string name_part = 1; + required bool is_extension = 2; + } + repeated NamePart name = 2; + + // The value of the uninterpreted option, in whatever type the tokenizer + // identified it as during parsing. Exactly one of these should be set. + optional string identifier_value = 3; + optional uint64 positive_int_value = 4; + optional int64 negative_int_value = 5; + optional double double_value = 6; + optional bytes string_value = 7; + optional string aggregate_value = 8; +} + +// =================================================================== +// Optional source code info + +// Encapsulates information about the original source file from which a +// FileDescriptorProto was generated. +message SourceCodeInfo { + // A Location identifies a piece of source code in a .proto file which + // corresponds to a particular definition. This information is intended + // to be useful to IDEs, code indexers, documentation generators, and similar + // tools. + // + // For example, say we have a file like: + // message Foo { + // optional string foo = 1; + // } + // Let's look at just the field definition: + // optional string foo = 1; + // ^ ^^ ^^ ^ ^^^ + // a bc de f ghi + // We have the following locations: + // span path represents + // [a,i) [ 4, 0, 2, 0 ] The whole field definition. + // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + // + // Notes: + // - A location may refer to a repeated field itself (i.e. not to any + // particular index within it). This is used whenever a set of elements are + // logically enclosed in a single code segment. For example, an entire + // extend block (possibly containing multiple extension definitions) will + // have an outer location whose path refers to the "extensions" repeated + // field without an index. + // - Multiple locations may have the same path. This happens when a single + // logical declaration is spread out across multiple places. The most + // obvious example is the "extend" block again -- there may be multiple + // extend blocks in the same scope, each of which will have the same path. + // - A location's span is not always a subset of its parent's span. For + // example, the "extendee" of an extension declaration appears at the + // beginning of the "extend" block and is shared by all extensions within + // the block. + // - Just because a location's span is a subset of some other location's span + // does not mean that it is a descendant. For example, a "group" defines + // both a type and a field in a single declaration. Thus, the locations + // corresponding to the type and field and their components will overlap. + // - Code which tries to interpret locations should probably be designed to + // ignore those that it doesn't understand, as more types of locations could + // be recorded in the future. + repeated Location location = 1; + message Location { + // Identifies which part of the FileDescriptorProto was defined at this + // location. + // + // Each element is a field number or an index. They form a path from + // the root FileDescriptorProto to the place where the definition. For + // example, this path: + // [ 4, 3, 2, 7, 1 ] + // refers to: + // file.message_type(3) // 4, 3 + // .field(7) // 2, 7 + // .name() // 1 + // This is because FileDescriptorProto.message_type has field number 4: + // repeated DescriptorProto message_type = 4; + // and DescriptorProto.field has field number 2: + // repeated FieldDescriptorProto field = 2; + // and FieldDescriptorProto.name has field number 1: + // optional string name = 1; + // + // Thus, the above path gives the location of a field name. If we removed + // the last element: + // [ 4, 3, 2, 7 ] + // this path refers to the whole field declaration (from the beginning + // of the label to the terminating semicolon). + repeated int32 path = 1 [packed = true]; + + // Always has exactly three or four elements: start line, start column, + // end line (optional, otherwise assumed same as start line), end column. + // These are packed into a single field for efficiency. Note that line + // and column numbers are zero-based -- typically you will want to add + // 1 to each before displaying to a user. + repeated int32 span = 2 [packed = true]; + + // If this SourceCodeInfo represents a complete declaration, these are any + // comments appearing before and after the declaration which appear to be + // attached to the declaration. + // + // A series of line comments appearing on consecutive lines, with no other + // tokens appearing on those lines, will be treated as a single comment. + // + // leading_detached_comments will keep paragraphs of comments that appear + // before (but not connected to) the current element. Each paragraph, + // separated by empty lines, will be one comment element in the repeated + // field. + // + // Only the comment content is provided; comment markers (e.g. //) are + // stripped out. For block comments, leading whitespace and an asterisk + // will be stripped from the beginning of each line other than the first. + // Newlines are included in the output. + // + // Examples: + // + // optional int32 foo = 1; // Comment attached to foo. + // // Comment attached to bar. + // optional int32 bar = 2; + // + // optional string baz = 3; + // // Comment attached to baz. + // // Another line attached to baz. + // + // // Comment attached to qux. + // // + // // Another line attached to qux. + // optional double qux = 4; + // + // // Detached comment for corge. This is not leading or trailing comments + // // to qux or corge because there are blank lines separating it from + // // both. + // + // // Detached comment for corge paragraph 2. + // + // optional string corge = 5; + // /* Block comment attached + // * to corge. Leading asterisks + // * will be removed. */ + // /* Block comment attached to + // * grault. */ + // optional int32 grault = 6; + // + // // ignored detached comments. + optional string leading_comments = 3; + optional string trailing_comments = 4; + repeated string leading_detached_comments = 6; + } +} + +// Describes the relationship between generated code and its original source +// file. A GeneratedCodeInfo message is associated with only one generated +// source file, but may contain references to different source .proto files. +message GeneratedCodeInfo { + // An Annotation connects some span of text in generated code to an element + // of its generating .proto file. + repeated Annotation annotation = 1; + message Annotation { + // Identifies the element in the original source .proto file. This field + // is formatted the same as SourceCodeInfo.Location.path. + repeated int32 path = 1 [packed = true]; + + // Identifies the filesystem path to the original source .proto. + optional string source_file = 2; + + // Identifies the starting offset in bytes in the generated code + // that relates to the identified object. + optional int32 begin = 3; + + // Identifies the ending offset in bytes in the generated code that + // relates to the identified offset. The end offset should be one past + // the last relevant byte (so the length of the text = end - begin). + optional int32 end = 4; + } +} diff --git a/orm/ent/api/third_party/google/protobuf/duration.proto b/orm/ent/api/third_party/google/protobuf/duration.proto new file mode 100644 index 0000000..99cb102 --- /dev/null +++ b/orm/ent/api/third_party/google/protobuf/duration.proto @@ -0,0 +1,116 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option go_package = "github.com/golang/protobuf/ptypes/duration"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "DurationProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// A Duration represents a signed, fixed-length span of time represented +// as a count of seconds and fractions of seconds at nanosecond +// resolution. It is independent of any calendar and concepts like "day" +// or "month". It is related to Timestamp in that the difference between +// two Timestamp values is a Duration and it can be added or subtracted +// from a Timestamp. Range is approximately +-10,000 years. +// +// # Examples +// +// Example 1: Compute Duration from two Timestamps in pseudo code. +// +// Timestamp start = ...; +// Timestamp end = ...; +// Duration duration = ...; +// +// duration.seconds = end.seconds - start.seconds; +// duration.nanos = end.nanos - start.nanos; +// +// if (duration.seconds < 0 && duration.nanos > 0) { +// duration.seconds += 1; +// duration.nanos -= 1000000000; +// } else if (duration.seconds > 0 && duration.nanos < 0) { +// duration.seconds -= 1; +// duration.nanos += 1000000000; +// } +// +// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. +// +// Timestamp start = ...; +// Duration duration = ...; +// Timestamp end = ...; +// +// end.seconds = start.seconds + duration.seconds; +// end.nanos = start.nanos + duration.nanos; +// +// if (end.nanos < 0) { +// end.seconds -= 1; +// end.nanos += 1000000000; +// } else if (end.nanos >= 1000000000) { +// end.seconds += 1; +// end.nanos -= 1000000000; +// } +// +// Example 3: Compute Duration from datetime.timedelta in Python. +// +// td = datetime.timedelta(days=3, minutes=10) +// duration = Duration() +// duration.FromTimedelta(td) +// +// # JSON Mapping +// +// In JSON format, the Duration type is encoded as a string rather than an +// object, where the string ends in the suffix "s" (indicating seconds) and +// is preceded by the number of seconds, with nanoseconds expressed as +// fractional seconds. For example, 3 seconds with 0 nanoseconds should be +// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should +// be expressed in JSON format as "3.000000001s", and 3 seconds and 1 +// microsecond should be expressed in JSON format as "3.000001s". +// +// +message Duration { + // Signed seconds of the span of time. Must be from -315,576,000,000 + // to +315,576,000,000 inclusive. Note: these bounds are computed from: + // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + int64 seconds = 1; + + // Signed fractions of a second at nanosecond resolution of the span + // of time. Durations less than one second are represented with a 0 + // `seconds` field and a positive or negative `nanos` field. For durations + // of one second or more, a non-zero value for the `nanos` field must be + // of the same sign as the `seconds` field. Must be from -999,999,999 + // to +999,999,999 inclusive. + int32 nanos = 2; +} diff --git a/orm/ent/api/third_party/google/protobuf/empty.proto b/orm/ent/api/third_party/google/protobuf/empty.proto new file mode 100644 index 0000000..03cacd2 --- /dev/null +++ b/orm/ent/api/third_party/google/protobuf/empty.proto @@ -0,0 +1,52 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "github.com/golang/protobuf/ptypes/empty"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "EmptyProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option cc_enable_arenas = true; + +// A generic empty message that you can re-use to avoid defining duplicated +// empty messages in your APIs. A typical example is to use it as the request +// or the response type of an API method. For instance: +// +// service Foo { +// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +// } +// +// The JSON representation for `Empty` is empty JSON object `{}`. +message Empty {} diff --git a/orm/ent/api/third_party/google/protobuf/field_mask.proto b/orm/ent/api/third_party/google/protobuf/field_mask.proto new file mode 100644 index 0000000..baac874 --- /dev/null +++ b/orm/ent/api/third_party/google/protobuf/field_mask.proto @@ -0,0 +1,245 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "FieldMaskProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option go_package = "google.golang.org/genproto/protobuf/field_mask;field_mask"; +option cc_enable_arenas = true; + +// `FieldMask` represents a set of symbolic field paths, for example: +// +// paths: "f.a" +// paths: "f.b.d" +// +// Here `f` represents a field in some root message, `a` and `b` +// fields in the message found in `f`, and `d` a field found in the +// message in `f.b`. +// +// Field masks are used to specify a subset of fields that should be +// returned by a get operation or modified by an update operation. +// Field masks also have a custom JSON encoding (see below). +// +// # Field Masks in Projections +// +// When used in the context of a projection, a response message or +// sub-message is filtered by the API to only contain those fields as +// specified in the mask. For example, if the mask in the previous +// example is applied to a response message as follows: +// +// f { +// a : 22 +// b { +// d : 1 +// x : 2 +// } +// y : 13 +// } +// z: 8 +// +// The result will not contain specific values for fields x,y and z +// (their value will be set to the default, and omitted in proto text +// output): +// +// +// f { +// a : 22 +// b { +// d : 1 +// } +// } +// +// A repeated field is not allowed except at the last position of a +// paths string. +// +// If a FieldMask object is not present in a get operation, the +// operation applies to all fields (as if a FieldMask of all fields +// had been specified). +// +// Note that a field mask does not necessarily apply to the +// top-level response message. In case of a REST get operation, the +// field mask applies directly to the response, but in case of a REST +// list operation, the mask instead applies to each individual message +// in the returned resource list. In case of a REST custom method, +// other definitions may be used. Where the mask applies will be +// clearly documented together with its declaration in the API. In +// any case, the effect on the returned resource/resources is required +// behavior for APIs. +// +// # Field Masks in Update Operations +// +// A field mask in update operations specifies which fields of the +// targeted resource are going to be updated. The API is required +// to only change the values of the fields as specified in the mask +// and leave the others untouched. If a resource is passed in to +// describe the updated values, the API ignores the values of all +// fields not covered by the mask. +// +// If a repeated field is specified for an update operation, new values will +// be appended to the existing repeated field in the target resource. Note that +// a repeated field is only allowed in the last position of a `paths` string. +// +// If a sub-message is specified in the last position of the field mask for an +// update operation, then new value will be merged into the existing sub-message +// in the target resource. +// +// For example, given the target message: +// +// f { +// b { +// d: 1 +// x: 2 +// } +// c: [1] +// } +// +// And an update message: +// +// f { +// b { +// d: 10 +// } +// c: [2] +// } +// +// then if the field mask is: +// +// paths: ["f.b", "f.c"] +// +// then the result will be: +// +// f { +// b { +// d: 10 +// x: 2 +// } +// c: [1, 2] +// } +// +// An implementation may provide options to override this default behavior for +// repeated and message fields. +// +// In order to reset a field's value to the default, the field must +// be in the mask and set to the default value in the provided resource. +// Hence, in order to reset all fields of a resource, provide a default +// instance of the resource and set all fields in the mask, or do +// not provide a mask as described below. +// +// If a field mask is not present on update, the operation applies to +// all fields (as if a field mask of all fields has been specified). +// Note that in the presence of schema evolution, this may mean that +// fields the client does not know and has therefore not filled into +// the request will be reset to their default. If this is unwanted +// behavior, a specific service may require a client to always specify +// a field mask, producing an error if not. +// +// As with get operations, the location of the resource which +// describes the updated values in the request message depends on the +// operation kind. In any case, the effect of the field mask is +// required to be honored by the API. +// +// ## Considerations for HTTP REST +// +// The HTTP kind of an update operation which uses a field mask must +// be set to PATCH instead of PUT in order to satisfy HTTP semantics +// (PUT must only be used for full updates). +// +// # JSON Encoding of Field Masks +// +// In JSON, a field mask is encoded as a single string where paths are +// separated by a comma. Fields name in each path are converted +// to/from lower-camel naming conventions. +// +// As an example, consider the following message declarations: +// +// message Profile { +// User user = 1; +// Photo photo = 2; +// } +// message User { +// string display_name = 1; +// string address = 2; +// } +// +// In proto a field mask for `Profile` may look as such: +// +// mask { +// paths: "user.display_name" +// paths: "photo" +// } +// +// In JSON, the same mask is represented as below: +// +// { +// mask: "user.displayName,photo" +// } +// +// # Field Masks and Oneof Fields +// +// Field masks treat fields in oneofs just as regular fields. Consider the +// following message: +// +// message SampleMessage { +// oneof test_oneof { +// string name = 4; +// SubMessage sub_message = 9; +// } +// } +// +// The field mask can be: +// +// mask { +// paths: "name" +// } +// +// Or: +// +// mask { +// paths: "sub_message" +// } +// +// Note that oneof type names ("test_oneof" in this case) cannot be used in +// paths. +// +// ## Field Mask Verification +// +// The implementation of any API method which has a FieldMask type field in the +// request should verify the included field paths, and return an +// `INVALID_ARGUMENT` error if any path is unmappable. +message FieldMask { + // The set of field mask paths. + repeated string paths = 1; +} diff --git a/orm/ent/api/third_party/google/protobuf/source_context.proto b/orm/ent/api/third_party/google/protobuf/source_context.proto new file mode 100644 index 0000000..f3b2c96 --- /dev/null +++ b/orm/ent/api/third_party/google/protobuf/source_context.proto @@ -0,0 +1,48 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "SourceContextProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option go_package = "google.golang.org/genproto/protobuf/source_context;source_context"; + +// `SourceContext` represents information about the source of a +// protobuf element, like the file in which it is defined. +message SourceContext { + // The path-qualified name of the .proto file that contained the associated + // protobuf element. For example: `"google/protobuf/source_context.proto"`. + string file_name = 1; +} diff --git a/orm/ent/api/third_party/google/protobuf/struct.proto b/orm/ent/api/third_party/google/protobuf/struct.proto new file mode 100644 index 0000000..ed990e3 --- /dev/null +++ b/orm/ent/api/third_party/google/protobuf/struct.proto @@ -0,0 +1,95 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option go_package = "github.com/golang/protobuf/ptypes/struct;structpb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "StructProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// `Struct` represents a structured data value, consisting of fields +// which map to dynamically typed values. In some languages, `Struct` +// might be supported by a native representation. For example, in +// scripting languages like JS a struct is represented as an +// object. The details of that representation are described together +// with the proto support for the language. +// +// The JSON representation for `Struct` is JSON object. +message Struct { + // Unordered map of dynamically typed values. + map fields = 1; +} + +// `Value` represents a dynamically typed value which can be either +// null, a number, a string, a boolean, a recursive struct value, or a +// list of values. A producer of value is expected to set one of that +// variants, absence of any variant indicates an error. +// +// The JSON representation for `Value` is JSON value. +message Value { + // The kind of value. + oneof kind { + // Represents a null value. + NullValue null_value = 1; + // Represents a double value. + double number_value = 2; + // Represents a string value. + string string_value = 3; + // Represents a boolean value. + bool bool_value = 4; + // Represents a structured value. + Struct struct_value = 5; + // Represents a repeated `Value`. + ListValue list_value = 6; + } +} + +// `NullValue` is a singleton enumeration to represent the null value for the +// `Value` type union. +// +// The JSON representation for `NullValue` is JSON `null`. +enum NullValue { + // Null value. + NULL_VALUE = 0; +} + +// `ListValue` is a wrapper around a repeated field of values. +// +// The JSON representation for `ListValue` is JSON array. +message ListValue { + // Repeated field of dynamically typed values. + repeated Value values = 1; +} diff --git a/orm/ent/api/third_party/google/protobuf/timestamp.proto b/orm/ent/api/third_party/google/protobuf/timestamp.proto new file mode 100644 index 0000000..cd35786 --- /dev/null +++ b/orm/ent/api/third_party/google/protobuf/timestamp.proto @@ -0,0 +1,138 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option go_package = "github.com/golang/protobuf/ptypes/timestamp"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "TimestampProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// A Timestamp represents a point in time independent of any time zone or local +// calendar, encoded as a count of seconds and fractions of seconds at +// nanosecond resolution. The count is relative to an epoch at UTC midnight on +// January 1, 1970, in the proleptic Gregorian calendar which extends the +// Gregorian calendar backwards to year one. +// +// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap +// second table is needed for interpretation, using a [24-hour linear +// smear](https://developers.google.com/time/smear). +// +// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By +// restricting to that range, we ensure that we can convert to and from [RFC +// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. +// +// # Examples +// +// Example 1: Compute Timestamp from POSIX `time()`. +// +// Timestamp timestamp; +// timestamp.set_seconds(time(NULL)); +// timestamp.set_nanos(0); +// +// Example 2: Compute Timestamp from POSIX `gettimeofday()`. +// +// struct timeval tv; +// gettimeofday(&tv, NULL); +// +// Timestamp timestamp; +// timestamp.set_seconds(tv.tv_sec); +// timestamp.set_nanos(tv.tv_usec * 1000); +// +// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. +// +// FILETIME ft; +// GetSystemTimeAsFileTime(&ft); +// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; +// +// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z +// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. +// Timestamp timestamp; +// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); +// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); +// +// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. +// +// long millis = System.currentTimeMillis(); +// +// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) +// .setNanos((int) ((millis % 1000) * 1000000)).build(); +// +// +// Example 5: Compute Timestamp from current time in Python. +// +// timestamp = Timestamp() +// timestamp.GetCurrentTime() +// +// # JSON Mapping +// +// In JSON format, the Timestamp type is encoded as a string in the +// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the +// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" +// where {year} is always expressed using four digits while {month}, {day}, +// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional +// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), +// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone +// is required. A proto3 JSON serializer should always use UTC (as indicated by +// "Z") when printing the Timestamp type and a proto3 JSON parser should be +// able to accept both UTC and other timezones (as indicated by an offset). +// +// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past +// 01:30 UTC on January 15, 2017. +// +// In JavaScript, one can convert a Date object to this format using the +// standard +// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) +// method. In Python, a standard `datetime.datetime` object can be converted +// to this format using +// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with +// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use +// the Joda Time's [`ISODateTimeFormat.dateTime()`]( +// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D +// ) to obtain a formatter capable of generating timestamps in this format. +// +// +message Timestamp { + // Represents seconds of UTC time since Unix epoch + // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + // 9999-12-31T23:59:59Z inclusive. + int64 seconds = 1; + + // Non-negative fractions of a second at nanosecond resolution. Negative + // second values with fractions must still have non-negative nanos values + // that count forward in time. Must be from 0 to 999,999,999 + // inclusive. + int32 nanos = 2; +} diff --git a/orm/ent/api/third_party/google/protobuf/type.proto b/orm/ent/api/third_party/google/protobuf/type.proto new file mode 100644 index 0000000..e4b1d3a --- /dev/null +++ b/orm/ent/api/third_party/google/protobuf/type.proto @@ -0,0 +1,187 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +import "google/protobuf/any.proto"; +import "google/protobuf/source_context.proto"; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option java_package = "com.google.protobuf"; +option java_outer_classname = "TypeProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option go_package = "google.golang.org/genproto/protobuf/ptype;ptype"; + +// A protocol buffer message type. +message Type { + // The fully qualified message name. + string name = 1; + // The list of fields. + repeated Field fields = 2; + // The list of types appearing in `oneof` definitions in this type. + repeated string oneofs = 3; + // The protocol buffer options. + repeated Option options = 4; + // The source context. + SourceContext source_context = 5; + // The source syntax. + Syntax syntax = 6; +} + +// A single field of a message type. +message Field { + // Basic field types. + enum Kind { + // Field type unknown. + TYPE_UNKNOWN = 0; + // Field type double. + TYPE_DOUBLE = 1; + // Field type float. + TYPE_FLOAT = 2; + // Field type int64. + TYPE_INT64 = 3; + // Field type uint64. + TYPE_UINT64 = 4; + // Field type int32. + TYPE_INT32 = 5; + // Field type fixed64. + TYPE_FIXED64 = 6; + // Field type fixed32. + TYPE_FIXED32 = 7; + // Field type bool. + TYPE_BOOL = 8; + // Field type string. + TYPE_STRING = 9; + // Field type group. Proto2 syntax only, and deprecated. + TYPE_GROUP = 10; + // Field type message. + TYPE_MESSAGE = 11; + // Field type bytes. + TYPE_BYTES = 12; + // Field type uint32. + TYPE_UINT32 = 13; + // Field type enum. + TYPE_ENUM = 14; + // Field type sfixed32. + TYPE_SFIXED32 = 15; + // Field type sfixed64. + TYPE_SFIXED64 = 16; + // Field type sint32. + TYPE_SINT32 = 17; + // Field type sint64. + TYPE_SINT64 = 18; + } + + // Whether a field is optional, required, or repeated. + enum Cardinality { + // For fields with unknown cardinality. + CARDINALITY_UNKNOWN = 0; + // For optional fields. + CARDINALITY_OPTIONAL = 1; + // For required fields. Proto2 syntax only. + CARDINALITY_REQUIRED = 2; + // For repeated fields. + CARDINALITY_REPEATED = 3; + }; + + // The field type. + Kind kind = 1; + // The field cardinality. + Cardinality cardinality = 2; + // The field number. + int32 number = 3; + // The field name. + string name = 4; + // The field type URL, without the scheme, for message or enumeration + // types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + string type_url = 6; + // The index of the field type in `Type.oneofs`, for message or enumeration + // types. The first type has index 1; zero means the type is not in the list. + int32 oneof_index = 7; + // Whether to use alternative packed wire representation. + bool packed = 8; + // The protocol buffer options. + repeated Option options = 9; + // The field JSON name. + string json_name = 10; + // The string value of the default value of this field. Proto2 syntax only. + string default_value = 11; +} + +// Enum type definition. +message Enum { + // Enum type name. + string name = 1; + // Enum value definitions. + repeated EnumValue enumvalue = 2; + // Protocol buffer options. + repeated Option options = 3; + // The source context. + SourceContext source_context = 4; + // The source syntax. + Syntax syntax = 5; +} + +// Enum value definition. +message EnumValue { + // Enum value name. + string name = 1; + // Enum value number. + int32 number = 2; + // Protocol buffer options. + repeated Option options = 3; +} + +// A protocol buffer option, which can be attached to a message, field, +// enumeration, etc. +message Option { + // The option's name. For protobuf built-in options (options defined in + // descriptor.proto), this is the short name. For example, `"map_entry"`. + // For custom options, it should be the fully-qualified name. For example, + // `"google.api.http"`. + string name = 1; + // The option's value packed in an Any message. If the value is a primitive, + // the corresponding wrapper type defined in google/protobuf/wrappers.proto + // should be used. If the value is an enum, it should be stored as an int32 + // value using the google.protobuf.Int32Value type. + Any value = 2; +} + +// The syntax in which a protocol buffer element is defined. +enum Syntax { + // Syntax `proto2`. + SYNTAX_PROTO2 = 0; + // Syntax `proto3`. + SYNTAX_PROTO3 = 1; +} diff --git a/orm/ent/api/third_party/google/protobuf/wrappers.proto b/orm/ent/api/third_party/google/protobuf/wrappers.proto new file mode 100644 index 0000000..9ee41e3 --- /dev/null +++ b/orm/ent/api/third_party/google/protobuf/wrappers.proto @@ -0,0 +1,123 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Wrappers for primitive (non-message) types. These types are useful +// for embedding primitives in the `google.protobuf.Any` type and for places +// where we need to distinguish between the absence of a primitive +// typed field and its default value. +// +// These wrappers have no meaningful use within repeated fields as they lack +// the ability to detect presence on individual elements. +// These wrappers have no meaningful use within a map or a oneof since +// individual entries of a map or fields of a oneof can already detect presence. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option go_package = "github.com/golang/protobuf/ptypes/wrappers"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "WrappersProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// Wrapper message for `double`. +// +// The JSON representation for `DoubleValue` is JSON number. +message DoubleValue { + // The double value. + double value = 1; +} + +// Wrapper message for `float`. +// +// The JSON representation for `FloatValue` is JSON number. +message FloatValue { + // The float value. + float value = 1; +} + +// Wrapper message for `int64`. +// +// The JSON representation for `Int64Value` is JSON string. +message Int64Value { + // The int64 value. + int64 value = 1; +} + +// Wrapper message for `uint64`. +// +// The JSON representation for `UInt64Value` is JSON string. +message UInt64Value { + // The uint64 value. + uint64 value = 1; +} + +// Wrapper message for `int32`. +// +// The JSON representation for `Int32Value` is JSON number. +message Int32Value { + // The int32 value. + int32 value = 1; +} + +// Wrapper message for `uint32`. +// +// The JSON representation for `UInt32Value` is JSON number. +message UInt32Value { + // The uint32 value. + uint32 value = 1; +} + +// Wrapper message for `bool`. +// +// The JSON representation for `BoolValue` is JSON `true` and `false`. +message BoolValue { + // The bool value. + bool value = 1; +} + +// Wrapper message for `string`. +// +// The JSON representation for `StringValue` is JSON string. +message StringValue { + // The string value. + string value = 1; +} + +// Wrapper message for `bytes`. +// +// The JSON representation for `BytesValue` is JSON string. +message BytesValue { + // The bytes value. + bytes value = 1; +} diff --git a/orm/ent/api/third_party/validate/README.md b/orm/ent/api/third_party/validate/README.md new file mode 100644 index 0000000..f5c4274 --- /dev/null +++ b/orm/ent/api/third_party/validate/README.md @@ -0,0 +1,3 @@ +# protoc-gen-validate (PGV) + +* https://github.com/envoyproxy/protoc-gen-validate diff --git a/orm/ent/api/third_party/validate/validate.proto b/orm/ent/api/third_party/validate/validate.proto new file mode 100644 index 0000000..b9b3fb2 --- /dev/null +++ b/orm/ent/api/third_party/validate/validate.proto @@ -0,0 +1,862 @@ +syntax = "proto2"; +package validate; + +option go_package = "github.com/envoyproxy/protoc-gen-validate/validate"; +option java_package = "io.envoyproxy.pgv.validate"; + +import "google/protobuf/descriptor.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +// Validation rules applied at the message level +extend google.protobuf.MessageOptions { + // Disabled nullifies any validation rules for this message, including any + // message fields associated with it that do support validation. + optional bool disabled = 1071; + // Ignore skips generation of validation methods for this message. + optional bool ignored = 1072; +} + +// Validation rules applied at the oneof level +extend google.protobuf.OneofOptions { + // Required ensures that exactly one the field options in a oneof is set; + // validation fails if no fields in the oneof are set. + optional bool required = 1071; +} + +// Validation rules applied at the field level +extend google.protobuf.FieldOptions { + // Rules specify the validations to be performed on this field. By default, + // no validation is performed against a field. + optional FieldRules rules = 1071; +} + +// FieldRules encapsulates the rules for each type of field. Depending on the +// field, the correct set should be used to ensure proper validations. +message FieldRules { + optional MessageRules message = 17; + oneof type { + // Scalar Field Types + FloatRules float = 1; + DoubleRules double = 2; + Int32Rules int32 = 3; + Int64Rules int64 = 4; + UInt32Rules uint32 = 5; + UInt64Rules uint64 = 6; + SInt32Rules sint32 = 7; + SInt64Rules sint64 = 8; + Fixed32Rules fixed32 = 9; + Fixed64Rules fixed64 = 10; + SFixed32Rules sfixed32 = 11; + SFixed64Rules sfixed64 = 12; + BoolRules bool = 13; + StringRules string = 14; + BytesRules bytes = 15; + + // Complex Field Types + EnumRules enum = 16; + RepeatedRules repeated = 18; + MapRules map = 19; + + // Well-Known Field Types + AnyRules any = 20; + DurationRules duration = 21; + TimestampRules timestamp = 22; + } +} + +// FloatRules describes the constraints applied to `float` values +message FloatRules { + // Const specifies that this field must be exactly the specified value + optional float const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional float lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional float lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional float gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional float gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated float in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated float not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// DoubleRules describes the constraints applied to `double` values +message DoubleRules { + // Const specifies that this field must be exactly the specified value + optional double const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional double lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional double lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional double gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional double gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated double in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated double not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// Int32Rules describes the constraints applied to `int32` values +message Int32Rules { + // Const specifies that this field must be exactly the specified value + optional int32 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional int32 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional int32 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional int32 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional int32 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated int32 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated int32 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// Int64Rules describes the constraints applied to `int64` values +message Int64Rules { + // Const specifies that this field must be exactly the specified value + optional int64 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional int64 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional int64 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional int64 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional int64 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated int64 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated int64 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// UInt32Rules describes the constraints applied to `uint32` values +message UInt32Rules { + // Const specifies that this field must be exactly the specified value + optional uint32 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional uint32 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional uint32 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional uint32 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional uint32 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated uint32 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated uint32 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// UInt64Rules describes the constraints applied to `uint64` values +message UInt64Rules { + // Const specifies that this field must be exactly the specified value + optional uint64 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional uint64 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional uint64 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional uint64 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional uint64 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated uint64 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated uint64 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// SInt32Rules describes the constraints applied to `sint32` values +message SInt32Rules { + // Const specifies that this field must be exactly the specified value + optional sint32 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional sint32 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional sint32 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional sint32 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional sint32 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated sint32 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated sint32 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// SInt64Rules describes the constraints applied to `sint64` values +message SInt64Rules { + // Const specifies that this field must be exactly the specified value + optional sint64 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional sint64 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional sint64 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional sint64 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional sint64 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated sint64 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated sint64 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// Fixed32Rules describes the constraints applied to `fixed32` values +message Fixed32Rules { + // Const specifies that this field must be exactly the specified value + optional fixed32 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional fixed32 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional fixed32 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional fixed32 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional fixed32 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated fixed32 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated fixed32 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// Fixed64Rules describes the constraints applied to `fixed64` values +message Fixed64Rules { + // Const specifies that this field must be exactly the specified value + optional fixed64 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional fixed64 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional fixed64 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional fixed64 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional fixed64 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated fixed64 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated fixed64 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// SFixed32Rules describes the constraints applied to `sfixed32` values +message SFixed32Rules { + // Const specifies that this field must be exactly the specified value + optional sfixed32 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional sfixed32 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional sfixed32 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional sfixed32 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional sfixed32 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated sfixed32 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated sfixed32 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// SFixed64Rules describes the constraints applied to `sfixed64` values +message SFixed64Rules { + // Const specifies that this field must be exactly the specified value + optional sfixed64 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional sfixed64 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional sfixed64 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional sfixed64 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional sfixed64 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated sfixed64 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated sfixed64 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// BoolRules describes the constraints applied to `bool` values +message BoolRules { + // Const specifies that this field must be exactly the specified value + optional bool const = 1; +} + +// StringRules describe the constraints applied to `string` values +message StringRules { + // Const specifies that this field must be exactly the specified value + optional string const = 1; + + // Len specifies that this field must be the specified number of + // characters (Unicode code points). Note that the number of + // characters may differ from the number of bytes in the string. + optional uint64 len = 19; + + // MinLen specifies that this field must be the specified number of + // characters (Unicode code points) at a minimum. Note that the number of + // characters may differ from the number of bytes in the string. + optional uint64 min_len = 2; + + // MaxLen specifies that this field must be the specified number of + // characters (Unicode code points) at a maximum. Note that the number of + // characters may differ from the number of bytes in the string. + optional uint64 max_len = 3; + + // LenBytes specifies that this field must be the specified number of bytes + optional uint64 len_bytes = 20; + + // MinBytes specifies that this field must be the specified number of bytes + // at a minimum + optional uint64 min_bytes = 4; + + // MaxBytes specifies that this field must be the specified number of bytes + // at a maximum + optional uint64 max_bytes = 5; + + // Pattern specifes that this field must match against the specified + // regular expression (RE2 syntax). The included expression should elide + // any delimiters. + optional string pattern = 6; + + // Prefix specifies that this field must have the specified substring at + // the beginning of the string. + optional string prefix = 7; + + // Suffix specifies that this field must have the specified substring at + // the end of the string. + optional string suffix = 8; + + // Contains specifies that this field must have the specified substring + // anywhere in the string. + optional string contains = 9; + + // NotContains specifies that this field cannot have the specified substring + // anywhere in the string. + optional string not_contains = 23; + + // In specifies that this field must be equal to one of the specified + // values + repeated string in = 10; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated string not_in = 11; + + // WellKnown rules provide advanced constraints against common string + // patterns + oneof well_known { + // Email specifies that the field must be a valid email address as + // defined by RFC 5322 + bool email = 12; + + // Hostname specifies that the field must be a valid hostname as + // defined by RFC 1034. This constraint does not support + // internationalized domain names (IDNs). + bool hostname = 13; + + // Ip specifies that the field must be a valid IP (v4 or v6) address. + // Valid IPv6 addresses should not include surrounding square brackets. + bool ip = 14; + + // Ipv4 specifies that the field must be a valid IPv4 address. + bool ipv4 = 15; + + // Ipv6 specifies that the field must be a valid IPv6 address. Valid + // IPv6 addresses should not include surrounding square brackets. + bool ipv6 = 16; + + // Uri specifies that the field must be a valid, absolute URI as defined + // by RFC 3986 + bool uri = 17; + + // UriRef specifies that the field must be a valid URI as defined by RFC + // 3986 and may be relative or absolute. + bool uri_ref = 18; + + // Address specifies that the field must be either a valid hostname as + // defined by RFC 1034 (which does not support internationalized domain + // names or IDNs), or it can be a valid IP (v4 or v6). + bool address = 21; + + // Uuid specifies that the field must be a valid UUID as defined by + // RFC 4122 + bool uuid = 22; + + // WellKnownRegex specifies a common well known pattern defined as a regex. + KnownRegex well_known_regex = 24; + } + + // This applies to regexes HTTP_HEADER_NAME and HTTP_HEADER_VALUE to enable + // strict header validation. + // By default, this is true, and HTTP header validations are RFC-compliant. + // Setting to false will enable a looser validations that only disallows + // \r\n\0 characters, which can be used to bypass header matching rules. + optional bool strict = 25 [default = true]; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 26; +} + +// WellKnownRegex contain some well-known patterns. +enum KnownRegex { + UNKNOWN = 0; + + // HTTP header name as defined by RFC 7230. + HTTP_HEADER_NAME = 1; + + // HTTP header value as defined by RFC 7230. + HTTP_HEADER_VALUE = 2; +} + +// BytesRules describe the constraints applied to `bytes` values +message BytesRules { + // Const specifies that this field must be exactly the specified value + optional bytes const = 1; + + // Len specifies that this field must be the specified number of bytes + optional uint64 len = 13; + + // MinLen specifies that this field must be the specified number of bytes + // at a minimum + optional uint64 min_len = 2; + + // MaxLen specifies that this field must be the specified number of bytes + // at a maximum + optional uint64 max_len = 3; + + // Pattern specifes that this field must match against the specified + // regular expression (RE2 syntax). The included expression should elide + // any delimiters. + optional string pattern = 4; + + // Prefix specifies that this field must have the specified bytes at the + // beginning of the string. + optional bytes prefix = 5; + + // Suffix specifies that this field must have the specified bytes at the + // end of the string. + optional bytes suffix = 6; + + // Contains specifies that this field must have the specified bytes + // anywhere in the string. + optional bytes contains = 7; + + // In specifies that this field must be equal to one of the specified + // values + repeated bytes in = 8; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated bytes not_in = 9; + + // WellKnown rules provide advanced constraints against common byte + // patterns + oneof well_known { + // Ip specifies that the field must be a valid IP (v4 or v6) address in + // byte format + bool ip = 10; + + // Ipv4 specifies that the field must be a valid IPv4 address in byte + // format + bool ipv4 = 11; + + // Ipv6 specifies that the field must be a valid IPv6 address in byte + // format + bool ipv6 = 12; + } + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 14; +} + +// EnumRules describe the constraints applied to enum values +message EnumRules { + // Const specifies that this field must be exactly the specified value + optional int32 const = 1; + + // DefinedOnly specifies that this field must be only one of the defined + // values for this enum, failing on any undefined value. + optional bool defined_only = 2; + + // In specifies that this field must be equal to one of the specified + // values + repeated int32 in = 3; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated int32 not_in = 4; +} + +// MessageRules describe the constraints applied to embedded message values. +// For message-type fields, validation is performed recursively. +message MessageRules { + // Skip specifies that the validation rules of this field should not be + // evaluated + optional bool skip = 1; + + // Required specifies that this field must be set + optional bool required = 2; +} + +// RepeatedRules describe the constraints applied to `repeated` values +message RepeatedRules { + // MinItems specifies that this field must have the specified number of + // items at a minimum + optional uint64 min_items = 1; + + // MaxItems specifies that this field must have the specified number of + // items at a maximum + optional uint64 max_items = 2; + + // Unique specifies that all elements in this field must be unique. This + // contraint is only applicable to scalar and enum types (messages are not + // supported). + optional bool unique = 3; + + // Items specifies the contraints to be applied to each item in the field. + // Repeated message fields will still execute validation against each item + // unless skip is specified here. + optional FieldRules items = 4; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 5; +} + +// MapRules describe the constraints applied to `map` values +message MapRules { + // MinPairs specifies that this field must have the specified number of + // KVs at a minimum + optional uint64 min_pairs = 1; + + // MaxPairs specifies that this field must have the specified number of + // KVs at a maximum + optional uint64 max_pairs = 2; + + // NoSparse specifies values in this field cannot be unset. This only + // applies to map's with message value types. + optional bool no_sparse = 3; + + // Keys specifies the constraints to be applied to each key in the field. + optional FieldRules keys = 4; + + // Values specifies the constraints to be applied to the value of each key + // in the field. Message values will still have their validations evaluated + // unless skip is specified here. + optional FieldRules values = 5; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 6; +} + +// AnyRules describe constraints applied exclusively to the +// `google.protobuf.Any` well-known type +message AnyRules { + // Required specifies that this field must be set + optional bool required = 1; + + // In specifies that this field's `type_url` must be equal to one of the + // specified values. + repeated string in = 2; + + // NotIn specifies that this field's `type_url` must not be equal to any of + // the specified values. + repeated string not_in = 3; +} + +// DurationRules describe the constraints applied exclusively to the +// `google.protobuf.Duration` well-known type +message DurationRules { + // Required specifies that this field must be set + optional bool required = 1; + + // Const specifies that this field must be exactly the specified value + optional google.protobuf.Duration const = 2; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional google.protobuf.Duration lt = 3; + + // Lt specifies that this field must be less than the specified value, + // inclusive + optional google.protobuf.Duration lte = 4; + + // Gt specifies that this field must be greater than the specified value, + // exclusive + optional google.protobuf.Duration gt = 5; + + // Gte specifies that this field must be greater than the specified value, + // inclusive + optional google.protobuf.Duration gte = 6; + + // In specifies that this field must be equal to one of the specified + // values + repeated google.protobuf.Duration in = 7; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated google.protobuf.Duration not_in = 8; +} + +// TimestampRules describe the constraints applied exclusively to the +// `google.protobuf.Timestamp` well-known type +message TimestampRules { + // Required specifies that this field must be set + optional bool required = 1; + + // Const specifies that this field must be exactly the specified value + optional google.protobuf.Timestamp const = 2; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional google.protobuf.Timestamp lt = 3; + + // Lte specifies that this field must be less than the specified value, + // inclusive + optional google.protobuf.Timestamp lte = 4; + + // Gt specifies that this field must be greater than the specified value, + // exclusive + optional google.protobuf.Timestamp gt = 5; + + // Gte specifies that this field must be greater than the specified value, + // inclusive + optional google.protobuf.Timestamp gte = 6; + + // LtNow specifies that this must be less than the current time. LtNow + // can only be used with the Within rule. + optional bool lt_now = 7; + + // GtNow specifies that this must be greater than the current time. GtNow + // can only be used with the Within rule. + optional bool gt_now = 8; + + // Within specifies that this field must be within this duration of the + // current time. This constraint can be used alone or with the LtNow and + // GtNow rules. + optional google.protobuf.Duration within = 9; +} diff --git a/orm/ent/api/user/service/v1/user.proto b/orm/ent/api/user/service/v1/user.proto new file mode 100644 index 0000000..bba8846 --- /dev/null +++ b/orm/ent/api/user/service/v1/user.proto @@ -0,0 +1,74 @@ +syntax = "proto3"; + +package user.service.v1; +option go_package = "kratos-ent-example/gen/api/go/user/service/v1;v1"; + +import "gnostic/openapi/v3/annotations.proto"; +import "google/protobuf/empty.proto"; + +import "common/pagination/pagination.proto"; + +// 变量的命名一律使用小驼峰命名法,例如:firstName、lastName等。 + +// 用户服务 +service UserService { + // 查询用户列表 + rpc ListUser (pagination.PagingRequest) returns (ListUserResponse) {} + + // 查询用户详情 + rpc GetUser (GetUserRequest) returns (User) {} + + // 创建用户 + rpc CreateUser (CreateUserRequest) returns (User) {} + + // 更新用户 + rpc UpdateUser (UpdateUserRequest) returns (User) {} + + // 删除用户 + rpc DeleteUser (DeleteUserRequest) returns (google.protobuf.Empty) {} +} + +// 用户 +message User { + uint32 id = 1; + optional string userName = 2; + optional string nickName = 3; + optional string password = 4; + + optional string createTime = 10; + optional string updateTime = 11; + optional string deleteTime = 12; +} + +// 获取用户列表 - 答复 +message ListUserResponse { + repeated User items = 1; + int32 total = 2; +} + +// 获取用户数据 - 请求 +message GetUserRequest { + uint32 id = 1; +} +message GetUserByUserNameRequest { + string userName = 1; +} + +// 创建用户 - 请求 +message CreateUserRequest { + User user = 1; + uint32 operatorId = 2; +} + +// 更新用户 - 请求 +message UpdateUserRequest { + uint32 id = 1; + User user = 2; + uint32 operatorId = 3; +} + +// 删除用户 - 请求 +message DeleteUserRequest { + uint32 id = 1; + uint32 operatorId = 2; +} diff --git a/orm/ent/api/user/service/v1/user_error.proto b/orm/ent/api/user/service/v1/user_error.proto new file mode 100644 index 0000000..fe09cbe --- /dev/null +++ b/orm/ent/api/user/service/v1/user_error.proto @@ -0,0 +1,33 @@ +syntax = "proto3"; + +package user.service.v1; +option go_package = "kratos-ent-example/gen/api/go/user/service/v1;v1"; + +import "errors/errors.proto"; + +enum UserErrorReason { + option (errors.default_code) = 500; + + NOT_LOGGED_IN = 0 [(errors.code) = 401];// 401 + ACCESS_FORBIDDEN = 1 [(errors.code) = 403]; // 403 + RESOURCE_NOT_FOUND = 2 [(errors.code) = 404]; // 404 + METHOD_NOT_ALLOWED = 3 [(errors.code) = 405]; // 405 + REQUEST_TIMEOUT = 4 [(errors.code) = 408]; // 408 + INTERNAL_SERVER_ERROR = 5 [(errors.code) = 500]; // 500 + NOT_IMPLEMENTED = 6 [(errors.code) = 501]; // 501 + NETWORK_ERROR = 7 [(errors.code) = 502]; // 502 + SERVICE_UNAVAILABLE = 8 [(errors.code) = 503]; // 503 + NETWORK_TIMEOUT = 9 [(errors.code) = 504]; // 504 + REQUEST_NOT_SUPPORT = 10 [(errors.code) = 505]; // 505 + + USER_NOT_FOUND = 11 [(errors.code) = 600]; + INCORRECT_PASSWORD = 12 [(errors.code) = 599]; + USER_FREEZE = 13 [(errors.code) = 598]; + + INVALID_USERID = 14 [(errors.code) = 101];// 用户ID无效 + INVALID_PASSWORD = 15 [(errors.code) = 102];// 密码无效 + TOKEN_EXPIRED = 16 [(errors.code) = 103];// token过期 + INVALID_TOKEN = 17 [(errors.code) = 104];// token无效 + TOKEN_NOT_EXIST = 18 [(errors.code) = 105];// token不存在 + USER_NOT_EXIST = 19 [(errors.code) = 106];// 用户不存在 +} diff --git a/orm/ent/app.mk b/orm/ent/app.mk new file mode 100644 index 0000000..e0503fb --- /dev/null +++ b/orm/ent/app.mk @@ -0,0 +1,140 @@ +GOPATH ?= $(shell go env GOPATH) + +# Ensure GOPATH is set before running build process. +ifeq "$(GOPATH)" "" + $(error Please set the environment variable GOPATH before running `make`) +endif +FAIL_ON_STDOUT := awk '{ print } END { if (NR > 0) { exit 1 } }' + +GO := GO111MODULE=on go + +ARCH := "`uname -s`" +LINUX := "Linux" +MAC := "Darwin" + +ifeq ($(OS),Windows_NT) + IS_WINDOWS:=1 +endif + +APP_VERSION=$(shell git describe --tags --always) +APP_RELATIVE_PATH=$(shell a=`basename $$PWD` && cd .. && b=`basename $$PWD` && echo $$b/$$a) +APP_NAME=$(shell echo $(APP_RELATIVE_PATH) | sed -En "s/\//-/p") +APP_DOCKER_IMAGE=$(shell echo $(APP_NAME) |awk -F '@' '{print "kratos-ent-example/" $$0 ":0.1.0"}') + + +.PHONY: init dep vendor build clean docker conf ent wire api openapi run test cover vet lint app + +# initialize develop environment +init: + @go install google.golang.org/protobuf/cmd/protoc-gen-go@latest + @go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest + @go install github.com/go-kratos/kratos/cmd/protoc-gen-go-http/v2@latest + @go install github.com/go-kratos/kratos/cmd/protoc-gen-go-errors/v2@latest + @go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@latest + @go install github.com/google/gnostic/cmd/protoc-gen-openapi@latest + @go install github.com/envoyproxy/protoc-gen-validate@latest + @go install github.com/bufbuild/buf/cmd/buf@latest + @go install github.com/google/gnostic@latest + @go install entgo.io/ent/cmd/ent@latest + @go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest + @go install github.com/go-kratos/kratos/cmd/kratos/v2@latest + +# download dependencies of module +dep: + @go mod download + +# create vendor +vendor: + @go mod vendor + +# build golang application +build: +ifeq ("$(wildcard ./bin/)","") + mkdir bin +endif + @go build -ldflags "-X main.Service.Version=$(APP_VERSION)" -o ./bin/ ./... + +# clean build files +clean: + @go clean + $(if $(IS_WINDOWS), del "coverage.out", rm -f "coverage.out") + +# build docker image +docker: + @docker build -t $(APP_DOCKER_IMAGE) . \ + -f ../../../.docker/Dockerfile \ + --build-arg APP_RELATIVE_PATH=$(APP_RELATIVE_PATH) GRPC_PORT=9000 REST_PORT=8000 + +# generate config define code +conf: + protoc --proto_path=./internal/conf/ \ + --proto_path=../../../api/third_party \ + --go_out=paths=source_relative:./internal/conf/ \ + ./internal/conf/conf.proto + +# generate ent code +ent: +ifneq ("$(wildcard ./internal/data/ent)","") + @go run -mod=mod entgo.io/ent/cmd/ent generate \ + --feature privacy \ + --feature sql/modifier \ + --feature entql \ + --feature sql/upsert \ + ./internal/data/ent/schema +endif + +# generate wire code +wire: + @go run -mod=mod github.com/google/wire/cmd/wire ./cmd/server + +# generate protobuf api go code +api: + @cd ../../../ && \ + buf generate + +# generate OpenAPI v3 doc +openapi: + @cd ../../../ && \ + buf generate --path api/admin/service/v1 --template api/admin/service/v1/buf.openapi.gen.yaml + +# run application +run: + @go run ./cmd/server -conf ./configs + +# run tests +test: + @go test ./... + +# run coverage tests +cover: + @go test -v ./... -coverprofile=coverage.out + +# run static analysis +vet: + @go vet + +# run lint +lint: + @golangci-lint run + +# build service app +app: api wire conf ent build + +# show help +help: + @echo "" + @echo "Usage:" + @echo " make [target]" + @echo "" + @echo 'Targets:' + @awk '/^[a-zA-Z\-_0-9]+:/ { \ + helpMessage = match(lastLine, /^# (.*)/); \ + if (helpMessage) { \ + helpCommand = substr($$1, 0, index($$1, ":")-1); \ + helpMessage = substr(lastLine, RSTART + 2, RLENGTH); \ + printf "\033[36m%-22s\033[0m %s\n", helpCommand,helpMessage; \ + } \ + } \ + { lastLine = $$0 }' $(MAKEFILE_LIST) + +.DEFAULT_GOAL := help diff --git a/orm/ent/app/user/service/.gitignore b/orm/ent/app/user/service/.gitignore new file mode 100644 index 0000000..5904cde --- /dev/null +++ b/orm/ent/app/user/service/.gitignore @@ -0,0 +1,35 @@ +# Reference https://github.com/github/gitignore/blob/master/Go.gitignore +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +vendor/ + +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a + +# OS General +Thumbs.db +.DS_Store + +# project +*.cert +*.key +*.log +bin/ + +# Develop tools +.vscode/ +.idea/ +*.swp diff --git a/orm/ent/app/user/service/LICENSE b/orm/ent/app/user/service/LICENSE new file mode 100644 index 0000000..3bf33c3 --- /dev/null +++ b/orm/ent/app/user/service/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 go-kratos + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/orm/ent/app/user/service/Makefile b/orm/ent/app/user/service/Makefile new file mode 100644 index 0000000..bc1a63c --- /dev/null +++ b/orm/ent/app/user/service/Makefile @@ -0,0 +1 @@ +include ../../../app.mk \ No newline at end of file diff --git a/orm/ent/app/user/service/README.md b/orm/ent/app/user/service/README.md new file mode 100644 index 0000000..4546add --- /dev/null +++ b/orm/ent/app/user/service/README.md @@ -0,0 +1 @@ +# User Service diff --git a/orm/ent/app/user/service/cmd/server/main.go b/orm/ent/app/user/service/cmd/server/main.go new file mode 100644 index 0000000..bcc496c --- /dev/null +++ b/orm/ent/app/user/service/cmd/server/main.go @@ -0,0 +1,50 @@ +package main + +import ( + "github.com/go-kratos/kratos/v2" + "github.com/go-kratos/kratos/v2/log" + "github.com/go-kratos/kratos/v2/registry" + "github.com/go-kratos/kratos/v2/transport/grpc" + + "kratos-ent-example/pkg/bootstrap" + "kratos-ent-example/pkg/service" +) + +// go build -ldflags "-X main.Service.Version=x.y.z" + +var ( + Service = bootstrap.NewServiceInfo( + service.UserService, + "1.0.0", + "", + ) +) + +func newApp(ll log.Logger, rr registry.Registrar, gs *grpc.Server) *kratos.App { + return kratos.New( + kratos.ID(Service.GetInstanceId()), + kratos.Name(Service.Name), + kratos.Version(Service.Version), + kratos.Metadata(Service.Metadata), + kratos.Logger(ll), + kratos.Server( + gs, + ), + kratos.Registrar(rr), + ) +} + +func main() { + // bootstrap + cfg, ll, reg := bootstrap.Bootstrap(Service) + + app, cleanup, err := initApp(ll, reg, cfg) + if err != nil { + panic(err) + } + defer cleanup() + + if err := app.Run(); err != nil { + panic(err) + } +} diff --git a/orm/ent/app/user/service/cmd/server/wire.go b/orm/ent/app/user/service/cmd/server/wire.go new file mode 100644 index 0000000..00be3e8 --- /dev/null +++ b/orm/ent/app/user/service/cmd/server/wire.go @@ -0,0 +1,25 @@ +//go:build wireinject +// +build wireinject + +// The build tag makes sure the stub is not built in the final build. + +package main + +import ( + "github.com/google/wire" + + "github.com/go-kratos/kratos/v2" + "github.com/go-kratos/kratos/v2/log" + "github.com/go-kratos/kratos/v2/registry" + + "kratos-ent-example/app/user/service/internal/biz" + "kratos-ent-example/app/user/service/internal/data" + "kratos-ent-example/app/user/service/internal/server" + "kratos-ent-example/app/user/service/internal/service" + "kratos-ent-example/gen/api/go/common/conf" +) + +// initApp init kratos application. +func initApp(log.Logger, registry.Registrar, *conf.Bootstrap) (*kratos.App, func(), error) { + panic(wire.Build(server.ProviderSet, data.ProviderSet, biz.ProviderSet, service.ProviderSet, newApp)) +} diff --git a/orm/ent/app/user/service/cmd/server/wire_gen.go b/orm/ent/app/user/service/cmd/server/wire_gen.go new file mode 100644 index 0000000..8c92966 --- /dev/null +++ b/orm/ent/app/user/service/cmd/server/wire_gen.go @@ -0,0 +1,38 @@ +// Code generated by Wire. DO NOT EDIT. + +//go:generate go run github.com/google/wire/cmd/wire +//go:build !wireinject +// +build !wireinject + +package main + +import ( + "github.com/go-kratos/kratos/v2" + "github.com/go-kratos/kratos/v2/log" + "github.com/go-kratos/kratos/v2/registry" + "kratos-ent-example/app/user/service/internal/biz" + "kratos-ent-example/app/user/service/internal/data" + "kratos-ent-example/app/user/service/internal/server" + "kratos-ent-example/app/user/service/internal/service" + "kratos-ent-example/gen/api/go/common/conf" +) + +// Injectors from wire.go: + +// initApp init kratos application. +func initApp(logger log.Logger, registrar registry.Registrar, bootstrap *conf.Bootstrap) (*kratos.App, func(), error) { + entClient := data.NewEntClient(bootstrap, logger) + client := data.NewRedisClient(bootstrap, logger) + dataData, cleanup, err := data.NewData(entClient, client, logger) + if err != nil { + return nil, nil, err + } + userRepo := data.NewUserRepo(dataData, logger) + userUseCase := biz.NewUserUseCase(userRepo, logger) + userService := service.NewUserService(logger, userUseCase) + grpcServer := server.NewGRPCServer(bootstrap, logger, userService) + app := newApp(logger, registrar, grpcServer) + return app, func() { + cleanup() + }, nil +} diff --git a/orm/ent/app/user/service/configs/bootstrap.yaml b/orm/ent/app/user/service/configs/bootstrap.yaml new file mode 100644 index 0000000..19626d1 --- /dev/null +++ b/orm/ent/app/user/service/configs/bootstrap.yaml @@ -0,0 +1,33 @@ +server: + grpc: + addr: "0.0.0.0:0" + timeout: 10s + middleware: +client: + grpc: + timeout: 10s + middleware: + enable_logging: true + enable_recovery: true + enable_tracing: true + enable_validate: true + enable_circuit_breaker: true + auth: + method: "" + key: "some_api_key" +data: + database: + driver: "postgres" + source: "host=localhost port=5432 user=postgres password=123456 dbname=example sslmode=disable" + migrate: true + redis: + addr: "127.0.0.1:6379" + password: "123456" + dial_timeout: 10s + read_timeout: 0.4s + write_timeout: 0.6s +trace: + endpoint: "http://127.0.0.1:14268/api/traces" + batcher: "jaeger" + sampler: 1.0 + env: "dev" diff --git a/orm/ent/app/user/service/configs/logger.yaml b/orm/ent/app/user/service/configs/logger.yaml new file mode 100644 index 0000000..f06ee78 --- /dev/null +++ b/orm/ent/app/user/service/configs/logger.yaml @@ -0,0 +1,31 @@ +logger: + type: std + + fluent: + endpoint: "tcp://127.0.0.1:24224" + + zap: + level: "debug" + filename: "./logs/info.log" + max_size: 1 + max_age: 30 + max_backups: 5 + + logrus: + level: "debug" + formatter: "text" + timestamp_format: "2006-01-02 15:04:05" + disable_colors: false + disable_timestamp: false + + aliyun: + endpoint: "" + project: "" + access_key: "" + access_secret: "" + + tencent: + endpoint: "" + topic_id: + access_key: "" + access_secret: "" diff --git a/orm/ent/app/user/service/configs/registry.yaml b/orm/ent/app/user/service/configs/registry.yaml new file mode 100644 index 0000000..347c2cb --- /dev/null +++ b/orm/ent/app/user/service/configs/registry.yaml @@ -0,0 +1,50 @@ +registry: + type: "consul" + + consul: + address: "127.0.0.1:8500" + scheme: "http" + health_check: false + + etcd: + endpoints: + - "127.0.0.1:8500" + + zookeeper: + endpoints: + - "127.0.0.1:8500" + timeout: 10s + + nacos: + address: "localhost" + port: 8848 + namespace_id: "public" + log_level: "../../configs/cache" + cache_dir: "../../configs/log" + log_dir: "debug" + update_thread_num: 20 + timeout: 10s + beat_interval: 5s + not_load_cache_at_start: true + update_cache_when_empty: true + + kubernetes: + + eureka: + endpoints: + - "127.0.0.1:18761" + heartbeat_interval: 10s + refresh_interval: 10s + path: + + polaris: + address: + port: + instance_count: + namespace: + service: + token: + + servicecomb: + endpoints: + - "127.0.0.1:8500" diff --git a/orm/ent/app/user/service/configs/remote.yaml b/orm/ent/app/user/service/configs/remote.yaml new file mode 100644 index 0000000..e644ca6 --- /dev/null +++ b/orm/ent/app/user/service/configs/remote.yaml @@ -0,0 +1,6 @@ +config: + type: "consul" + consul: + scheme: "http" + address: "127.0.0.1:8500" + key: "kratos-ent-example/user/service" diff --git a/orm/ent/app/user/service/internal/biz/README.md b/orm/ent/app/user/service/internal/biz/README.md new file mode 100644 index 0000000..b49e819 --- /dev/null +++ b/orm/ent/app/user/service/internal/biz/README.md @@ -0,0 +1 @@ +# Biz diff --git a/orm/ent/app/user/service/internal/biz/init.go b/orm/ent/app/user/service/internal/biz/init.go new file mode 100644 index 0000000..c1d6c21 --- /dev/null +++ b/orm/ent/app/user/service/internal/biz/init.go @@ -0,0 +1,8 @@ +package biz + +import "github.com/google/wire" + +// ProviderSet is biz providers. +var ProviderSet = wire.NewSet( + NewUserUseCase, +) diff --git a/orm/ent/app/user/service/internal/biz/user.go b/orm/ent/app/user/service/internal/biz/user.go new file mode 100644 index 0000000..31e7ba1 --- /dev/null +++ b/orm/ent/app/user/service/internal/biz/user.go @@ -0,0 +1,72 @@ +package biz + +import ( + "context" + + "github.com/go-kratos/kratos/v2/log" + + "kratos-ent-example/gen/api/go/common/pagination" + v1 "kratos-ent-example/gen/api/go/user/service/v1" +) + +type UserRepo interface { + List(ctx context.Context, req *pagination.PagingRequest) (*v1.ListUserResponse, error) + Get(ctx context.Context, req *v1.GetUserRequest) (*v1.User, error) + Create(ctx context.Context, req *v1.CreateUserRequest) (*v1.User, error) + Update(ctx context.Context, req *v1.UpdateUserRequest) (*v1.User, error) + Delete(ctx context.Context, req *v1.DeleteUserRequest) (bool, error) +} + +type UserUseCase struct { + repo UserRepo + log *log.Helper +} + +func NewUserUseCase(repo UserRepo, logger log.Logger) *UserUseCase { + l := log.NewHelper(log.With(logger, "module", "user/usecase/user-service")) + return &UserUseCase{ + repo: repo, + log: l, + } +} + +func (uc *UserUseCase) Get(ctx context.Context, req *v1.GetUserRequest) (*v1.User, error) { + user, err := uc.repo.Get(ctx, req) + if user != nil { + user.Password = nil + } + return user, err +} + +func (uc *UserUseCase) List(ctx context.Context, req *pagination.PagingRequest) (*v1.ListUserResponse, error) { + resp, err := uc.repo.List(ctx, req) + if err != nil { + return nil, err + } + + for i := 0; i < len(resp.Items); i++ { + resp.Items[i].Password = nil + } + + return resp, err +} + +func (uc *UserUseCase) Create(ctx context.Context, req *v1.CreateUserRequest) (*v1.User, error) { + user, err := uc.repo.Create(ctx, req) + if user != nil { + user.Password = nil + } + return user, err +} + +func (uc *UserUseCase) Update(ctx context.Context, req *v1.UpdateUserRequest) (*v1.User, error) { + user, err := uc.repo.Update(ctx, req) + if user != nil { + user.Password = nil + } + return user, err +} + +func (uc *UserUseCase) Delete(ctx context.Context, req *v1.DeleteUserRequest) (bool, error) { + return uc.repo.Delete(ctx, req) +} diff --git a/orm/ent/app/user/service/internal/data/README.md b/orm/ent/app/user/service/internal/data/README.md new file mode 100644 index 0000000..1cda725 --- /dev/null +++ b/orm/ent/app/user/service/internal/data/README.md @@ -0,0 +1 @@ +# Data diff --git a/orm/ent/app/user/service/internal/data/data.go b/orm/ent/app/user/service/internal/data/data.go new file mode 100644 index 0000000..de5b4fa --- /dev/null +++ b/orm/ent/app/user/service/internal/data/data.go @@ -0,0 +1,43 @@ +package data + +import ( + "github.com/go-kratos/kratos/v2/log" + "github.com/go-redis/redis/v8" + "github.com/tx7do/kratos-utils/entgo" + + "kratos-ent-example/app/user/service/internal/data/ent" + "kratos-ent-example/gen/api/go/common/conf" + "kratos-ent-example/pkg/bootstrap" +) + +// Data . +type Data struct { + log *log.Helper + db *entgo.EntClient[*ent.Client] + rdb *redis.Client +} + +// NewData . +func NewData(entClient *entgo.EntClient[*ent.Client], redisClient *redis.Client, logger log.Logger) (*Data, func(), error) { + l := log.NewHelper(log.With(logger, "module", "data/user-service")) + + d := &Data{ + db: entClient, + rdb: redisClient, + log: l, + } + + return d, func() { + l.Info("message", "closing the data resources") + d.db.Close() + if err := d.rdb.Close(); err != nil { + l.Error(err) + } + }, nil +} + +// NewRedisClient 创建Redis客户端 +func NewRedisClient(cfg *conf.Bootstrap, logger log.Logger) *redis.Client { + l := log.NewHelper(log.With(logger, "module", "redis/data/user-service")) + return bootstrap.NewRedisClient(cfg, l) +} diff --git a/orm/ent/app/user/service/internal/data/ent/client.go b/orm/ent/app/user/service/internal/data/ent/client.go new file mode 100644 index 0000000..8451f2b --- /dev/null +++ b/orm/ent/app/user/service/internal/data/ent/client.go @@ -0,0 +1,317 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "errors" + "fmt" + "log" + + "kratos-ent-example/app/user/service/internal/data/ent/migrate" + + "kratos-ent-example/app/user/service/internal/data/ent/user" + + "entgo.io/ent" + "entgo.io/ent/dialect" + "entgo.io/ent/dialect/sql" +) + +// Client is the client that holds all ent builders. +type Client struct { + config + // Schema is the client for creating, migrating and dropping schema. + Schema *migrate.Schema + // User is the client for interacting with the User builders. + User *UserClient +} + +// NewClient creates a new client configured with the given options. +func NewClient(opts ...Option) *Client { + cfg := config{log: log.Println, hooks: &hooks{}, inters: &inters{}} + cfg.options(opts...) + client := &Client{config: cfg} + client.init() + return client +} + +func (c *Client) init() { + c.Schema = migrate.NewSchema(c.driver) + c.User = NewUserClient(c.config) +} + +type ( + // config is the configuration for the client and its builder. + config struct { + // driver used for executing database requests. + driver dialect.Driver + // debug enable a debug logging. + debug bool + // log used for logging on debug mode. + log func(...any) + // hooks to execute on mutations. + hooks *hooks + // interceptors to execute on queries. + inters *inters + } + // Option function to configure the client. + Option func(*config) +) + +// options applies the options on the config object. +func (c *config) options(opts ...Option) { + for _, opt := range opts { + opt(c) + } + if c.debug { + c.driver = dialect.Debug(c.driver, c.log) + } +} + +// Debug enables debug logging on the ent.Driver. +func Debug() Option { + return func(c *config) { + c.debug = true + } +} + +// Log sets the logging function for debug mode. +func Log(fn func(...any)) Option { + return func(c *config) { + c.log = fn + } +} + +// Driver configures the client driver. +func Driver(driver dialect.Driver) Option { + return func(c *config) { + c.driver = driver + } +} + +// Open opens a database/sql.DB specified by the driver name and +// the data source name, and returns a new client attached to it. +// Optional parameters can be added for configuring the client. +func Open(driverName, dataSourceName string, options ...Option) (*Client, error) { + switch driverName { + case dialect.MySQL, dialect.Postgres, dialect.SQLite: + drv, err := sql.Open(driverName, dataSourceName) + if err != nil { + return nil, err + } + return NewClient(append(options, Driver(drv))...), nil + default: + return nil, fmt.Errorf("unsupported driver: %q", driverName) + } +} + +// Tx returns a new transactional client. The provided context +// is used until the transaction is committed or rolled back. +func (c *Client) Tx(ctx context.Context) (*Tx, error) { + if _, ok := c.driver.(*txDriver); ok { + return nil, errors.New("ent: cannot start a transaction within a transaction") + } + tx, err := newTx(ctx, c.driver) + if err != nil { + return nil, fmt.Errorf("ent: starting a transaction: %w", err) + } + cfg := c.config + cfg.driver = tx + return &Tx{ + ctx: ctx, + config: cfg, + User: NewUserClient(cfg), + }, nil +} + +// BeginTx returns a transactional client with specified options. +func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) { + if _, ok := c.driver.(*txDriver); ok { + return nil, errors.New("ent: cannot start a transaction within a transaction") + } + tx, err := c.driver.(interface { + BeginTx(context.Context, *sql.TxOptions) (dialect.Tx, error) + }).BeginTx(ctx, opts) + if err != nil { + return nil, fmt.Errorf("ent: starting a transaction: %w", err) + } + cfg := c.config + cfg.driver = &txDriver{tx: tx, drv: c.driver} + return &Tx{ + ctx: ctx, + config: cfg, + User: NewUserClient(cfg), + }, nil +} + +// Debug returns a new debug-client. It's used to get verbose logging on specific operations. +// +// client.Debug(). +// User. +// Query(). +// Count(ctx) +func (c *Client) Debug() *Client { + if c.debug { + return c + } + cfg := c.config + cfg.driver = dialect.Debug(c.driver, c.log) + client := &Client{config: cfg} + client.init() + return client +} + +// Close closes the database connection and prevents new queries from starting. +func (c *Client) Close() error { + return c.driver.Close() +} + +// Use adds the mutation hooks to all the entity clients. +// In order to add hooks to a specific client, call: `client.Node.Use(...)`. +func (c *Client) Use(hooks ...Hook) { + c.User.Use(hooks...) +} + +// Intercept adds the query interceptors to all the entity clients. +// In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`. +func (c *Client) Intercept(interceptors ...Interceptor) { + c.User.Intercept(interceptors...) +} + +// Mutate implements the ent.Mutator interface. +func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error) { + switch m := m.(type) { + case *UserMutation: + return c.User.mutate(ctx, m) + default: + return nil, fmt.Errorf("ent: unknown mutation type %T", m) + } +} + +// UserClient is a client for the User schema. +type UserClient struct { + config +} + +// NewUserClient returns a client for the User from the given config. +func NewUserClient(c config) *UserClient { + return &UserClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`. +func (c *UserClient) Use(hooks ...Hook) { + c.hooks.User = append(c.hooks.User, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`. +func (c *UserClient) Intercept(interceptors ...Interceptor) { + c.inters.User = append(c.inters.User, interceptors...) +} + +// Create returns a builder for creating a User entity. +func (c *UserClient) Create() *UserCreate { + mutation := newUserMutation(c.config, OpCreate) + return &UserCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of User entities. +func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk { + return &UserCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for User. +func (c *UserClient) Update() *UserUpdate { + mutation := newUserMutation(c.config, OpUpdate) + return &UserUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *UserClient) UpdateOne(u *User) *UserUpdateOne { + mutation := newUserMutation(c.config, OpUpdateOne, withUser(u)) + return &UserUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *UserClient) UpdateOneID(id uint32) *UserUpdateOne { + mutation := newUserMutation(c.config, OpUpdateOne, withUserID(id)) + return &UserUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for User. +func (c *UserClient) Delete() *UserDelete { + mutation := newUserMutation(c.config, OpDelete) + return &UserDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *UserClient) DeleteOne(u *User) *UserDeleteOne { + return c.DeleteOneID(u.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *UserClient) DeleteOneID(id uint32) *UserDeleteOne { + builder := c.Delete().Where(user.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &UserDeleteOne{builder} +} + +// Query returns a query builder for User. +func (c *UserClient) Query() *UserQuery { + return &UserQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeUser}, + inters: c.Interceptors(), + } +} + +// Get returns a User entity by its id. +func (c *UserClient) Get(ctx context.Context, id uint32) (*User, error) { + return c.Query().Where(user.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *UserClient) GetX(ctx context.Context, id uint32) *User { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// Hooks returns the client hooks. +func (c *UserClient) Hooks() []Hook { + return c.hooks.User +} + +// Interceptors returns the client interceptors. +func (c *UserClient) Interceptors() []Interceptor { + return c.inters.User +} + +func (c *UserClient) mutate(ctx context.Context, m *UserMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&UserCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&UserUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&UserUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&UserDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("ent: unknown User mutation op: %q", m.Op()) + } +} + +// hooks and interceptors per client, for fast access. +type ( + hooks struct { + User []ent.Hook + } + inters struct { + User []ent.Interceptor + } +) diff --git a/orm/ent/app/user/service/internal/data/ent/ent.go b/orm/ent/app/user/service/internal/data/ent/ent.go new file mode 100644 index 0000000..280cd31 --- /dev/null +++ b/orm/ent/app/user/service/internal/data/ent/ent.go @@ -0,0 +1,608 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "errors" + "fmt" + "kratos-ent-example/app/user/service/internal/data/ent/user" + "reflect" + "sync" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +// ent aliases to avoid import conflicts in user's code. +type ( + Op = ent.Op + Hook = ent.Hook + Value = ent.Value + Query = ent.Query + QueryContext = ent.QueryContext + Querier = ent.Querier + QuerierFunc = ent.QuerierFunc + Interceptor = ent.Interceptor + InterceptFunc = ent.InterceptFunc + Traverser = ent.Traverser + TraverseFunc = ent.TraverseFunc + Policy = ent.Policy + Mutator = ent.Mutator + Mutation = ent.Mutation + MutateFunc = ent.MutateFunc +) + +type clientCtxKey struct{} + +// FromContext returns a Client stored inside a context, or nil if there isn't one. +func FromContext(ctx context.Context) *Client { + c, _ := ctx.Value(clientCtxKey{}).(*Client) + return c +} + +// NewContext returns a new context with the given Client attached. +func NewContext(parent context.Context, c *Client) context.Context { + return context.WithValue(parent, clientCtxKey{}, c) +} + +type txCtxKey struct{} + +// TxFromContext returns a Tx stored inside a context, or nil if there isn't one. +func TxFromContext(ctx context.Context) *Tx { + tx, _ := ctx.Value(txCtxKey{}).(*Tx) + return tx +} + +// NewTxContext returns a new context with the given Tx attached. +func NewTxContext(parent context.Context, tx *Tx) context.Context { + return context.WithValue(parent, txCtxKey{}, tx) +} + +// OrderFunc applies an ordering on the sql selector. +// Deprecated: Use Asc/Desc functions or the package builders instead. +type OrderFunc func(*sql.Selector) + +var ( + initCheck sync.Once + columnCheck sql.ColumnCheck +) + +// columnChecker checks if the column exists in the given table. +func checkColumn(table, column string) error { + initCheck.Do(func() { + columnCheck = sql.NewColumnCheck(map[string]func(string) bool{ + user.Table: user.ValidColumn, + }) + }) + return columnCheck(table, column) +} + +// Asc applies the given fields in ASC order. +func Asc(fields ...string) func(*sql.Selector) { + return func(s *sql.Selector) { + for _, f := range fields { + if err := checkColumn(s.TableName(), f); err != nil { + s.AddError(&ValidationError{Name: f, err: fmt.Errorf("ent: %w", err)}) + } + s.OrderBy(sql.Asc(s.C(f))) + } + } +} + +// Desc applies the given fields in DESC order. +func Desc(fields ...string) func(*sql.Selector) { + return func(s *sql.Selector) { + for _, f := range fields { + if err := checkColumn(s.TableName(), f); err != nil { + s.AddError(&ValidationError{Name: f, err: fmt.Errorf("ent: %w", err)}) + } + s.OrderBy(sql.Desc(s.C(f))) + } + } +} + +// AggregateFunc applies an aggregation step on the group-by traversal/selector. +type AggregateFunc func(*sql.Selector) string + +// As is a pseudo aggregation function for renaming another other functions with custom names. For example: +// +// GroupBy(field1, field2). +// Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). +// Scan(ctx, &v) +func As(fn AggregateFunc, end string) AggregateFunc { + return func(s *sql.Selector) string { + return sql.As(fn(s), end) + } +} + +// Count applies the "count" aggregation function on each group. +func Count() AggregateFunc { + return func(s *sql.Selector) string { + return sql.Count("*") + } +} + +// Max applies the "max" aggregation function on the given field of each group. +func Max(field string) AggregateFunc { + return func(s *sql.Selector) string { + if err := checkColumn(s.TableName(), field); err != nil { + s.AddError(&ValidationError{Name: field, err: fmt.Errorf("ent: %w", err)}) + return "" + } + return sql.Max(s.C(field)) + } +} + +// Mean applies the "mean" aggregation function on the given field of each group. +func Mean(field string) AggregateFunc { + return func(s *sql.Selector) string { + if err := checkColumn(s.TableName(), field); err != nil { + s.AddError(&ValidationError{Name: field, err: fmt.Errorf("ent: %w", err)}) + return "" + } + return sql.Avg(s.C(field)) + } +} + +// Min applies the "min" aggregation function on the given field of each group. +func Min(field string) AggregateFunc { + return func(s *sql.Selector) string { + if err := checkColumn(s.TableName(), field); err != nil { + s.AddError(&ValidationError{Name: field, err: fmt.Errorf("ent: %w", err)}) + return "" + } + return sql.Min(s.C(field)) + } +} + +// Sum applies the "sum" aggregation function on the given field of each group. +func Sum(field string) AggregateFunc { + return func(s *sql.Selector) string { + if err := checkColumn(s.TableName(), field); err != nil { + s.AddError(&ValidationError{Name: field, err: fmt.Errorf("ent: %w", err)}) + return "" + } + return sql.Sum(s.C(field)) + } +} + +// ValidationError returns when validating a field or edge fails. +type ValidationError struct { + Name string // Field or edge name. + err error +} + +// Error implements the error interface. +func (e *ValidationError) Error() string { + return e.err.Error() +} + +// Unwrap implements the errors.Wrapper interface. +func (e *ValidationError) Unwrap() error { + return e.err +} + +// IsValidationError returns a boolean indicating whether the error is a validation error. +func IsValidationError(err error) bool { + if err == nil { + return false + } + var e *ValidationError + return errors.As(err, &e) +} + +// NotFoundError returns when trying to fetch a specific entity and it was not found in the database. +type NotFoundError struct { + label string +} + +// Error implements the error interface. +func (e *NotFoundError) Error() string { + return "ent: " + e.label + " not found" +} + +// IsNotFound returns a boolean indicating whether the error is a not found error. +func IsNotFound(err error) bool { + if err == nil { + return false + } + var e *NotFoundError + return errors.As(err, &e) +} + +// MaskNotFound masks not found error. +func MaskNotFound(err error) error { + if IsNotFound(err) { + return nil + } + return err +} + +// NotSingularError returns when trying to fetch a singular entity and more then one was found in the database. +type NotSingularError struct { + label string +} + +// Error implements the error interface. +func (e *NotSingularError) Error() string { + return "ent: " + e.label + " not singular" +} + +// IsNotSingular returns a boolean indicating whether the error is a not singular error. +func IsNotSingular(err error) bool { + if err == nil { + return false + } + var e *NotSingularError + return errors.As(err, &e) +} + +// NotLoadedError returns when trying to get a node that was not loaded by the query. +type NotLoadedError struct { + edge string +} + +// Error implements the error interface. +func (e *NotLoadedError) Error() string { + return "ent: " + e.edge + " edge was not loaded" +} + +// IsNotLoaded returns a boolean indicating whether the error is a not loaded error. +func IsNotLoaded(err error) bool { + if err == nil { + return false + } + var e *NotLoadedError + return errors.As(err, &e) +} + +// ConstraintError returns when trying to create/update one or more entities and +// one or more of their constraints failed. For example, violation of edge or +// field uniqueness. +type ConstraintError struct { + msg string + wrap error +} + +// Error implements the error interface. +func (e ConstraintError) Error() string { + return "ent: constraint failed: " + e.msg +} + +// Unwrap implements the errors.Wrapper interface. +func (e *ConstraintError) Unwrap() error { + return e.wrap +} + +// IsConstraintError returns a boolean indicating whether the error is a constraint failure. +func IsConstraintError(err error) bool { + if err == nil { + return false + } + var e *ConstraintError + return errors.As(err, &e) +} + +// selector embedded by the different Select/GroupBy builders. +type selector struct { + label string + flds *[]string + fns []AggregateFunc + scan func(context.Context, any) error +} + +// ScanX is like Scan, but panics if an error occurs. +func (s *selector) ScanX(ctx context.Context, v any) { + if err := s.scan(ctx, v); err != nil { + panic(err) + } +} + +// Strings returns list of strings from a selector. It is only allowed when selecting one field. +func (s *selector) Strings(ctx context.Context) ([]string, error) { + if len(*s.flds) > 1 { + return nil, errors.New("ent: Strings is not achievable when selecting more than 1 field") + } + var v []string + if err := s.scan(ctx, &v); err != nil { + return nil, err + } + return v, nil +} + +// StringsX is like Strings, but panics if an error occurs. +func (s *selector) StringsX(ctx context.Context) []string { + v, err := s.Strings(ctx) + if err != nil { + panic(err) + } + return v +} + +// String returns a single string from a selector. It is only allowed when selecting one field. +func (s *selector) String(ctx context.Context) (_ string, err error) { + var v []string + if v, err = s.Strings(ctx); err != nil { + return + } + switch len(v) { + case 1: + return v[0], nil + case 0: + err = &NotFoundError{s.label} + default: + err = fmt.Errorf("ent: Strings returned %d results when one was expected", len(v)) + } + return +} + +// StringX is like String, but panics if an error occurs. +func (s *selector) StringX(ctx context.Context) string { + v, err := s.String(ctx) + if err != nil { + panic(err) + } + return v +} + +// Ints returns list of ints from a selector. It is only allowed when selecting one field. +func (s *selector) Ints(ctx context.Context) ([]int, error) { + if len(*s.flds) > 1 { + return nil, errors.New("ent: Ints is not achievable when selecting more than 1 field") + } + var v []int + if err := s.scan(ctx, &v); err != nil { + return nil, err + } + return v, nil +} + +// IntsX is like Ints, but panics if an error occurs. +func (s *selector) IntsX(ctx context.Context) []int { + v, err := s.Ints(ctx) + if err != nil { + panic(err) + } + return v +} + +// Int returns a single int from a selector. It is only allowed when selecting one field. +func (s *selector) Int(ctx context.Context) (_ int, err error) { + var v []int + if v, err = s.Ints(ctx); err != nil { + return + } + switch len(v) { + case 1: + return v[0], nil + case 0: + err = &NotFoundError{s.label} + default: + err = fmt.Errorf("ent: Ints returned %d results when one was expected", len(v)) + } + return +} + +// IntX is like Int, but panics if an error occurs. +func (s *selector) IntX(ctx context.Context) int { + v, err := s.Int(ctx) + if err != nil { + panic(err) + } + return v +} + +// Float64s returns list of float64s from a selector. It is only allowed when selecting one field. +func (s *selector) Float64s(ctx context.Context) ([]float64, error) { + if len(*s.flds) > 1 { + return nil, errors.New("ent: Float64s is not achievable when selecting more than 1 field") + } + var v []float64 + if err := s.scan(ctx, &v); err != nil { + return nil, err + } + return v, nil +} + +// Float64sX is like Float64s, but panics if an error occurs. +func (s *selector) Float64sX(ctx context.Context) []float64 { + v, err := s.Float64s(ctx) + if err != nil { + panic(err) + } + return v +} + +// Float64 returns a single float64 from a selector. It is only allowed when selecting one field. +func (s *selector) Float64(ctx context.Context) (_ float64, err error) { + var v []float64 + if v, err = s.Float64s(ctx); err != nil { + return + } + switch len(v) { + case 1: + return v[0], nil + case 0: + err = &NotFoundError{s.label} + default: + err = fmt.Errorf("ent: Float64s returned %d results when one was expected", len(v)) + } + return +} + +// Float64X is like Float64, but panics if an error occurs. +func (s *selector) Float64X(ctx context.Context) float64 { + v, err := s.Float64(ctx) + if err != nil { + panic(err) + } + return v +} + +// Bools returns list of bools from a selector. It is only allowed when selecting one field. +func (s *selector) Bools(ctx context.Context) ([]bool, error) { + if len(*s.flds) > 1 { + return nil, errors.New("ent: Bools is not achievable when selecting more than 1 field") + } + var v []bool + if err := s.scan(ctx, &v); err != nil { + return nil, err + } + return v, nil +} + +// BoolsX is like Bools, but panics if an error occurs. +func (s *selector) BoolsX(ctx context.Context) []bool { + v, err := s.Bools(ctx) + if err != nil { + panic(err) + } + return v +} + +// Bool returns a single bool from a selector. It is only allowed when selecting one field. +func (s *selector) Bool(ctx context.Context) (_ bool, err error) { + var v []bool + if v, err = s.Bools(ctx); err != nil { + return + } + switch len(v) { + case 1: + return v[0], nil + case 0: + err = &NotFoundError{s.label} + default: + err = fmt.Errorf("ent: Bools returned %d results when one was expected", len(v)) + } + return +} + +// BoolX is like Bool, but panics if an error occurs. +func (s *selector) BoolX(ctx context.Context) bool { + v, err := s.Bool(ctx) + if err != nil { + panic(err) + } + return v +} + +// withHooks invokes the builder operation with the given hooks, if any. +func withHooks[V Value, M any, PM interface { + *M + Mutation +}](ctx context.Context, exec func(context.Context) (V, error), mutation PM, hooks []Hook) (value V, err error) { + if len(hooks) == 0 { + return exec(ctx) + } + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutationT, ok := any(m).(PM) + if !ok { + return nil, fmt.Errorf("unexpected mutation type %T", m) + } + // Set the mutation to the builder. + *mutation = *mutationT + return exec(ctx) + }) + for i := len(hooks) - 1; i >= 0; i-- { + if hooks[i] == nil { + return value, fmt.Errorf("ent: uninitialized hook (forgotten import ent/runtime?)") + } + mut = hooks[i](mut) + } + v, err := mut.Mutate(ctx, mutation) + if err != nil { + return value, err + } + nv, ok := v.(V) + if !ok { + return value, fmt.Errorf("unexpected node type %T returned from %T", v, mutation) + } + return nv, nil +} + +// setContextOp returns a new context with the given QueryContext attached (including its op) in case it does not exist. +func setContextOp(ctx context.Context, qc *QueryContext, op string) context.Context { + if ent.QueryFromContext(ctx) == nil { + qc.Op = op + ctx = ent.NewQueryContext(ctx, qc) + } + return ctx +} + +func querierAll[V Value, Q interface { + sqlAll(context.Context, ...queryHook) (V, error) +}]() Querier { + return QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + query, ok := q.(Q) + if !ok { + return nil, fmt.Errorf("unexpected query type %T", q) + } + return query.sqlAll(ctx) + }) +} + +func querierCount[Q interface { + sqlCount(context.Context) (int, error) +}]() Querier { + return QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + query, ok := q.(Q) + if !ok { + return nil, fmt.Errorf("unexpected query type %T", q) + } + return query.sqlCount(ctx) + }) +} + +func withInterceptors[V Value](ctx context.Context, q Query, qr Querier, inters []Interceptor) (v V, err error) { + for i := len(inters) - 1; i >= 0; i-- { + qr = inters[i].Intercept(qr) + } + rv, err := qr.Query(ctx, q) + if err != nil { + return v, err + } + vt, ok := rv.(V) + if !ok { + return v, fmt.Errorf("unexpected type %T returned from %T. expected type: %T", vt, q, v) + } + return vt, nil +} + +func scanWithInterceptors[Q1 ent.Query, Q2 interface { + sqlScan(context.Context, Q1, any) error +}](ctx context.Context, rootQuery Q1, selectOrGroup Q2, inters []Interceptor, v any) error { + rv := reflect.ValueOf(v) + var qr Querier = QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + query, ok := q.(Q1) + if !ok { + return nil, fmt.Errorf("unexpected query type %T", q) + } + if err := selectOrGroup.sqlScan(ctx, query, v); err != nil { + return nil, err + } + if k := rv.Kind(); k == reflect.Pointer && rv.Elem().CanInterface() { + return rv.Elem().Interface(), nil + } + return v, nil + }) + for i := len(inters) - 1; i >= 0; i-- { + qr = inters[i].Intercept(qr) + } + vv, err := qr.Query(ctx, rootQuery) + if err != nil { + return err + } + switch rv2 := reflect.ValueOf(vv); { + case rv.IsNil(), rv2.IsNil(), rv.Kind() != reflect.Pointer: + case rv.Type() == rv2.Type(): + rv.Elem().Set(rv2.Elem()) + case rv.Elem().Type() == rv2.Type(): + rv.Elem().Set(rv2) + } + return nil +} + +// queryHook describes an internal hook for the different sqlAll methods. +type queryHook func(context.Context, *sqlgraph.QuerySpec) diff --git a/orm/ent/app/user/service/internal/data/ent/entql.go b/orm/ent/app/user/service/internal/data/ent/entql.go new file mode 100644 index 0000000..ea1460b --- /dev/null +++ b/orm/ent/app/user/service/internal/data/ent/entql.go @@ -0,0 +1,113 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "kratos-ent-example/app/user/service/internal/data/ent/user" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/entql" + "entgo.io/ent/schema/field" +) + +// schemaGraph holds a representation of ent/schema at runtime. +var schemaGraph = func() *sqlgraph.Schema { + graph := &sqlgraph.Schema{Nodes: make([]*sqlgraph.Node, 1)} + graph.Nodes[0] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: user.Table, + Columns: user.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeUint32, + Column: user.FieldID, + }, + }, + Type: "User", + Fields: map[string]*sqlgraph.FieldSpec{ + user.FieldCreateTime: {Type: field.TypeInt64, Column: user.FieldCreateTime}, + user.FieldUpdateTime: {Type: field.TypeInt64, Column: user.FieldUpdateTime}, + user.FieldDeleteTime: {Type: field.TypeInt64, Column: user.FieldDeleteTime}, + user.FieldUserName: {Type: field.TypeString, Column: user.FieldUserName}, + user.FieldNickName: {Type: field.TypeString, Column: user.FieldNickName}, + user.FieldPassword: {Type: field.TypeString, Column: user.FieldPassword}, + }, + } + return graph +}() + +// predicateAdder wraps the addPredicate method. +// All update, update-one and query builders implement this interface. +type predicateAdder interface { + addPredicate(func(s *sql.Selector)) +} + +// addPredicate implements the predicateAdder interface. +func (uq *UserQuery) addPredicate(pred func(s *sql.Selector)) { + uq.predicates = append(uq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the UserQuery builder. +func (uq *UserQuery) Filter() *UserFilter { + return &UserFilter{config: uq.config, predicateAdder: uq} +} + +// addPredicate implements the predicateAdder interface. +func (m *UserMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the UserMutation builder. +func (m *UserMutation) Filter() *UserFilter { + return &UserFilter{config: m.config, predicateAdder: m} +} + +// UserFilter provides a generic filtering capability at runtime for UserQuery. +type UserFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *UserFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[0].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql uint32 predicate on the id field. +func (f *UserFilter) WhereID(p entql.Uint32P) { + f.Where(p.Field(user.FieldID)) +} + +// WhereCreateTime applies the entql int64 predicate on the create_time field. +func (f *UserFilter) WhereCreateTime(p entql.Int64P) { + f.Where(p.Field(user.FieldCreateTime)) +} + +// WhereUpdateTime applies the entql int64 predicate on the update_time field. +func (f *UserFilter) WhereUpdateTime(p entql.Int64P) { + f.Where(p.Field(user.FieldUpdateTime)) +} + +// WhereDeleteTime applies the entql int64 predicate on the delete_time field. +func (f *UserFilter) WhereDeleteTime(p entql.Int64P) { + f.Where(p.Field(user.FieldDeleteTime)) +} + +// WhereUserName applies the entql string predicate on the user_name field. +func (f *UserFilter) WhereUserName(p entql.StringP) { + f.Where(p.Field(user.FieldUserName)) +} + +// WhereNickName applies the entql string predicate on the nick_name field. +func (f *UserFilter) WhereNickName(p entql.StringP) { + f.Where(p.Field(user.FieldNickName)) +} + +// WherePassword applies the entql string predicate on the password field. +func (f *UserFilter) WherePassword(p entql.StringP) { + f.Where(p.Field(user.FieldPassword)) +} diff --git a/orm/ent/app/user/service/internal/data/ent/enttest/enttest.go b/orm/ent/app/user/service/internal/data/ent/enttest/enttest.go new file mode 100644 index 0000000..27584dc --- /dev/null +++ b/orm/ent/app/user/service/internal/data/ent/enttest/enttest.go @@ -0,0 +1,84 @@ +// Code generated by ent, DO NOT EDIT. + +package enttest + +import ( + "context" + "kratos-ent-example/app/user/service/internal/data/ent" + // required by schema hooks. + _ "kratos-ent-example/app/user/service/internal/data/ent/runtime" + + "kratos-ent-example/app/user/service/internal/data/ent/migrate" + + "entgo.io/ent/dialect/sql/schema" +) + +type ( + // TestingT is the interface that is shared between + // testing.T and testing.B and used by enttest. + TestingT interface { + FailNow() + Error(...any) + } + + // Option configures client creation. + Option func(*options) + + options struct { + opts []ent.Option + migrateOpts []schema.MigrateOption + } +) + +// WithOptions forwards options to client creation. +func WithOptions(opts ...ent.Option) Option { + return func(o *options) { + o.opts = append(o.opts, opts...) + } +} + +// WithMigrateOptions forwards options to auto migration. +func WithMigrateOptions(opts ...schema.MigrateOption) Option { + return func(o *options) { + o.migrateOpts = append(o.migrateOpts, opts...) + } +} + +func newOptions(opts []Option) *options { + o := &options{} + for _, opt := range opts { + opt(o) + } + return o +} + +// Open calls ent.Open and auto-run migration. +func Open(t TestingT, driverName, dataSourceName string, opts ...Option) *ent.Client { + o := newOptions(opts) + c, err := ent.Open(driverName, dataSourceName, o.opts...) + if err != nil { + t.Error(err) + t.FailNow() + } + migrateSchema(t, c, o) + return c +} + +// NewClient calls ent.NewClient and auto-run migration. +func NewClient(t TestingT, opts ...Option) *ent.Client { + o := newOptions(opts) + c := ent.NewClient(o.opts...) + migrateSchema(t, c, o) + return c +} +func migrateSchema(t TestingT, c *ent.Client, o *options) { + tables, err := schema.CopyTables(migrate.Tables) + if err != nil { + t.Error(err) + t.FailNow() + } + if err := migrate.Create(context.Background(), c.Schema, tables, o.migrateOpts...); err != nil { + t.Error(err) + t.FailNow() + } +} diff --git a/orm/ent/app/user/service/internal/data/ent/hook/hook.go b/orm/ent/app/user/service/internal/data/ent/hook/hook.go new file mode 100644 index 0000000..da8aeef --- /dev/null +++ b/orm/ent/app/user/service/internal/data/ent/hook/hook.go @@ -0,0 +1,198 @@ +// Code generated by ent, DO NOT EDIT. + +package hook + +import ( + "context" + "fmt" + "kratos-ent-example/app/user/service/internal/data/ent" +) + +// The UserFunc type is an adapter to allow the use of ordinary +// function as User mutator. +type UserFunc func(context.Context, *ent.UserMutation) (ent.Value, error) + +// Mutate calls f(ctx, m). +func (f UserFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if mv, ok := m.(*ent.UserMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.UserMutation", m) +} + +// Condition is a hook condition function. +type Condition func(context.Context, ent.Mutation) bool + +// And groups conditions with the AND operator. +func And(first, second Condition, rest ...Condition) Condition { + return func(ctx context.Context, m ent.Mutation) bool { + if !first(ctx, m) || !second(ctx, m) { + return false + } + for _, cond := range rest { + if !cond(ctx, m) { + return false + } + } + return true + } +} + +// Or groups conditions with the OR operator. +func Or(first, second Condition, rest ...Condition) Condition { + return func(ctx context.Context, m ent.Mutation) bool { + if first(ctx, m) || second(ctx, m) { + return true + } + for _, cond := range rest { + if cond(ctx, m) { + return true + } + } + return false + } +} + +// Not negates a given condition. +func Not(cond Condition) Condition { + return func(ctx context.Context, m ent.Mutation) bool { + return !cond(ctx, m) + } +} + +// HasOp is a condition testing mutation operation. +func HasOp(op ent.Op) Condition { + return func(_ context.Context, m ent.Mutation) bool { + return m.Op().Is(op) + } +} + +// HasAddedFields is a condition validating `.AddedField` on fields. +func HasAddedFields(field string, fields ...string) Condition { + return func(_ context.Context, m ent.Mutation) bool { + if _, exists := m.AddedField(field); !exists { + return false + } + for _, field := range fields { + if _, exists := m.AddedField(field); !exists { + return false + } + } + return true + } +} + +// HasClearedFields is a condition validating `.FieldCleared` on fields. +func HasClearedFields(field string, fields ...string) Condition { + return func(_ context.Context, m ent.Mutation) bool { + if exists := m.FieldCleared(field); !exists { + return false + } + for _, field := range fields { + if exists := m.FieldCleared(field); !exists { + return false + } + } + return true + } +} + +// HasFields is a condition validating `.Field` on fields. +func HasFields(field string, fields ...string) Condition { + return func(_ context.Context, m ent.Mutation) bool { + if _, exists := m.Field(field); !exists { + return false + } + for _, field := range fields { + if _, exists := m.Field(field); !exists { + return false + } + } + return true + } +} + +// If executes the given hook under condition. +// +// hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...))) +func If(hk ent.Hook, cond Condition) ent.Hook { + return func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if cond(ctx, m) { + return hk(next).Mutate(ctx, m) + } + return next.Mutate(ctx, m) + }) + } +} + +// On executes the given hook only for the given operation. +// +// hook.On(Log, ent.Delete|ent.Create) +func On(hk ent.Hook, op ent.Op) ent.Hook { + return If(hk, HasOp(op)) +} + +// Unless skips the given hook only for the given operation. +// +// hook.Unless(Log, ent.Update|ent.UpdateOne) +func Unless(hk ent.Hook, op ent.Op) ent.Hook { + return If(hk, Not(HasOp(op))) +} + +// FixedError is a hook returning a fixed error. +func FixedError(err error) ent.Hook { + return func(ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(context.Context, ent.Mutation) (ent.Value, error) { + return nil, err + }) + } +} + +// Reject returns a hook that rejects all operations that match op. +// +// func (T) Hooks() []ent.Hook { +// return []ent.Hook{ +// Reject(ent.Delete|ent.Update), +// } +// } +func Reject(op ent.Op) ent.Hook { + hk := FixedError(fmt.Errorf("%s operation is not allowed", op)) + return On(hk, op) +} + +// Chain acts as a list of hooks and is effectively immutable. +// Once created, it will always hold the same set of hooks in the same order. +type Chain struct { + hooks []ent.Hook +} + +// NewChain creates a new chain of hooks. +func NewChain(hooks ...ent.Hook) Chain { + return Chain{append([]ent.Hook(nil), hooks...)} +} + +// Hook chains the list of hooks and returns the final hook. +func (c Chain) Hook() ent.Hook { + return func(mutator ent.Mutator) ent.Mutator { + for i := len(c.hooks) - 1; i >= 0; i-- { + mutator = c.hooks[i](mutator) + } + return mutator + } +} + +// Append extends a chain, adding the specified hook +// as the last ones in the mutation flow. +func (c Chain) Append(hooks ...ent.Hook) Chain { + newHooks := make([]ent.Hook, 0, len(c.hooks)+len(hooks)) + newHooks = append(newHooks, c.hooks...) + newHooks = append(newHooks, hooks...) + return Chain{newHooks} +} + +// Extend extends a chain, adding the specified chain +// as the last ones in the mutation flow. +func (c Chain) Extend(chain Chain) Chain { + return c.Append(chain.hooks...) +} diff --git a/orm/ent/app/user/service/internal/data/ent/migrate/migrate.go b/orm/ent/app/user/service/internal/data/ent/migrate/migrate.go new file mode 100644 index 0000000..1956a6b --- /dev/null +++ b/orm/ent/app/user/service/internal/data/ent/migrate/migrate.go @@ -0,0 +1,64 @@ +// Code generated by ent, DO NOT EDIT. + +package migrate + +import ( + "context" + "fmt" + "io" + + "entgo.io/ent/dialect" + "entgo.io/ent/dialect/sql/schema" +) + +var ( + // WithGlobalUniqueID sets the universal ids options to the migration. + // If this option is enabled, ent migration will allocate a 1<<32 range + // for the ids of each entity (table). + // Note that this option cannot be applied on tables that already exist. + WithGlobalUniqueID = schema.WithGlobalUniqueID + // WithDropColumn sets the drop column option to the migration. + // If this option is enabled, ent migration will drop old columns + // that were used for both fields and edges. This defaults to false. + WithDropColumn = schema.WithDropColumn + // WithDropIndex sets the drop index option to the migration. + // If this option is enabled, ent migration will drop old indexes + // that were defined in the schema. This defaults to false. + // Note that unique constraints are defined using `UNIQUE INDEX`, + // and therefore, it's recommended to enable this option to get more + // flexibility in the schema changes. + WithDropIndex = schema.WithDropIndex + // WithForeignKeys enables creating foreign-key in schema DDL. This defaults to true. + WithForeignKeys = schema.WithForeignKeys +) + +// Schema is the API for creating, migrating and dropping a schema. +type Schema struct { + drv dialect.Driver +} + +// NewSchema creates a new schema client. +func NewSchema(drv dialect.Driver) *Schema { return &Schema{drv: drv} } + +// Create creates all schema resources. +func (s *Schema) Create(ctx context.Context, opts ...schema.MigrateOption) error { + return Create(ctx, s, Tables, opts...) +} + +// Create creates all table resources using the given schema driver. +func Create(ctx context.Context, s *Schema, tables []*schema.Table, opts ...schema.MigrateOption) error { + migrate, err := schema.NewMigrate(s.drv, opts...) + if err != nil { + return fmt.Errorf("ent/migrate: %w", err) + } + return migrate.Create(ctx, tables...) +} + +// WriteTo writes the schema changes to w instead of running them against the database. +// +// if err := client.Schema.WriteTo(context.Background(), os.Stdout); err != nil { +// log.Fatal(err) +// } +func (s *Schema) WriteTo(ctx context.Context, w io.Writer, opts ...schema.MigrateOption) error { + return Create(ctx, &Schema{drv: &schema.WriteDriver{Writer: w, Driver: s.drv}}, Tables, opts...) +} diff --git a/orm/ent/app/user/service/internal/data/ent/migrate/schema.go b/orm/ent/app/user/service/internal/data/ent/migrate/schema.go new file mode 100644 index 0000000..f5f8773 --- /dev/null +++ b/orm/ent/app/user/service/internal/data/ent/migrate/schema.go @@ -0,0 +1,53 @@ +// Code generated by ent, DO NOT EDIT. + +package migrate + +import ( + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/dialect/sql/schema" + "entgo.io/ent/schema/field" +) + +var ( + // UsersColumns holds the columns for the "users" table. + UsersColumns = []*schema.Column{ + {Name: "id", Type: field.TypeUint32, Increment: true, Comment: "id", SchemaType: map[string]string{"mysql": "int", "postgres": "serial"}}, + {Name: "create_time", Type: field.TypeInt64, Nullable: true, Comment: "创建时间"}, + {Name: "update_time", Type: field.TypeInt64, Nullable: true, Comment: "更新时间"}, + {Name: "delete_time", Type: field.TypeInt64, Nullable: true, Comment: "删除时间"}, + {Name: "user_name", Type: field.TypeString, Unique: true, Nullable: true, Size: 50, Comment: "用户名"}, + {Name: "nick_name", Type: field.TypeString, Nullable: true, Size: 128, Comment: "昵称"}, + {Name: "password", Type: field.TypeString, Nullable: true, Size: 255, Comment: "登陆密码"}, + } + // UsersTable holds the schema information for the "users" table. + UsersTable = &schema.Table{ + Name: "users", + Comment: "用户账号", + Columns: UsersColumns, + PrimaryKey: []*schema.Column{UsersColumns[0]}, + Indexes: []*schema.Index{ + { + Name: "user_id", + Unique: false, + Columns: []*schema.Column{UsersColumns[0]}, + }, + { + Name: "user_id_user_name", + Unique: true, + Columns: []*schema.Column{UsersColumns[0], UsersColumns[4]}, + }, + }, + } + // Tables holds all the tables in the schema. + Tables = []*schema.Table{ + UsersTable, + } +) + +func init() { + UsersTable.Annotation = &entsql.Annotation{ + Table: "users", + Charset: "utf8mb4", + Collation: "utf8mb4_bin", + } +} diff --git a/orm/ent/app/user/service/internal/data/ent/mutation.go b/orm/ent/app/user/service/internal/data/ent/mutation.go new file mode 100644 index 0000000..5220c57 --- /dev/null +++ b/orm/ent/app/user/service/internal/data/ent/mutation.go @@ -0,0 +1,851 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "errors" + "fmt" + "kratos-ent-example/app/user/service/internal/data/ent/predicate" + "kratos-ent-example/app/user/service/internal/data/ent/user" + "sync" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" +) + +const ( + // Operation types. + OpCreate = ent.OpCreate + OpDelete = ent.OpDelete + OpDeleteOne = ent.OpDeleteOne + OpUpdate = ent.OpUpdate + OpUpdateOne = ent.OpUpdateOne + + // Node types. + TypeUser = "User" +) + +// UserMutation represents an operation that mutates the User nodes in the graph. +type UserMutation struct { + config + op Op + typ string + id *uint32 + create_time *int64 + addcreate_time *int64 + update_time *int64 + addupdate_time *int64 + delete_time *int64 + adddelete_time *int64 + user_name *string + nick_name *string + password *string + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*User, error) + predicates []predicate.User +} + +var _ ent.Mutation = (*UserMutation)(nil) + +// userOption allows management of the mutation configuration using functional options. +type userOption func(*UserMutation) + +// newUserMutation creates new mutation for the User entity. +func newUserMutation(c config, op Op, opts ...userOption) *UserMutation { + m := &UserMutation{ + config: c, + op: op, + typ: TypeUser, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withUserID sets the ID field of the mutation. +func withUserID(id uint32) userOption { + return func(m *UserMutation) { + var ( + err error + once sync.Once + value *User + ) + m.oldValue = func(ctx context.Context) (*User, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().User.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withUser sets the old User of the mutation. +func withUser(node *User) userOption { + return func(m *UserMutation) { + m.oldValue = func(context.Context) (*User, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m UserMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m UserMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of User entities. +func (m *UserMutation) SetID(id uint32) { + m.id = &id +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *UserMutation) ID() (id uint32, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *UserMutation) IDs(ctx context.Context) ([]uint32, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []uint32{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().User.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreateTime sets the "create_time" field. +func (m *UserMutation) SetCreateTime(i int64) { + m.create_time = &i + m.addcreate_time = nil +} + +// CreateTime returns the value of the "create_time" field in the mutation. +func (m *UserMutation) CreateTime() (r int64, exists bool) { + v := m.create_time + if v == nil { + return + } + return *v, true +} + +// OldCreateTime returns the old "create_time" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldCreateTime(ctx context.Context) (v *int64, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreateTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreateTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreateTime: %w", err) + } + return oldValue.CreateTime, nil +} + +// AddCreateTime adds i to the "create_time" field. +func (m *UserMutation) AddCreateTime(i int64) { + if m.addcreate_time != nil { + *m.addcreate_time += i + } else { + m.addcreate_time = &i + } +} + +// AddedCreateTime returns the value that was added to the "create_time" field in this mutation. +func (m *UserMutation) AddedCreateTime() (r int64, exists bool) { + v := m.addcreate_time + if v == nil { + return + } + return *v, true +} + +// ClearCreateTime clears the value of the "create_time" field. +func (m *UserMutation) ClearCreateTime() { + m.create_time = nil + m.addcreate_time = nil + m.clearedFields[user.FieldCreateTime] = struct{}{} +} + +// CreateTimeCleared returns if the "create_time" field was cleared in this mutation. +func (m *UserMutation) CreateTimeCleared() bool { + _, ok := m.clearedFields[user.FieldCreateTime] + return ok +} + +// ResetCreateTime resets all changes to the "create_time" field. +func (m *UserMutation) ResetCreateTime() { + m.create_time = nil + m.addcreate_time = nil + delete(m.clearedFields, user.FieldCreateTime) +} + +// SetUpdateTime sets the "update_time" field. +func (m *UserMutation) SetUpdateTime(i int64) { + m.update_time = &i + m.addupdate_time = nil +} + +// UpdateTime returns the value of the "update_time" field in the mutation. +func (m *UserMutation) UpdateTime() (r int64, exists bool) { + v := m.update_time + if v == nil { + return + } + return *v, true +} + +// OldUpdateTime returns the old "update_time" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldUpdateTime(ctx context.Context) (v *int64, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdateTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdateTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdateTime: %w", err) + } + return oldValue.UpdateTime, nil +} + +// AddUpdateTime adds i to the "update_time" field. +func (m *UserMutation) AddUpdateTime(i int64) { + if m.addupdate_time != nil { + *m.addupdate_time += i + } else { + m.addupdate_time = &i + } +} + +// AddedUpdateTime returns the value that was added to the "update_time" field in this mutation. +func (m *UserMutation) AddedUpdateTime() (r int64, exists bool) { + v := m.addupdate_time + if v == nil { + return + } + return *v, true +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (m *UserMutation) ClearUpdateTime() { + m.update_time = nil + m.addupdate_time = nil + m.clearedFields[user.FieldUpdateTime] = struct{}{} +} + +// UpdateTimeCleared returns if the "update_time" field was cleared in this mutation. +func (m *UserMutation) UpdateTimeCleared() bool { + _, ok := m.clearedFields[user.FieldUpdateTime] + return ok +} + +// ResetUpdateTime resets all changes to the "update_time" field. +func (m *UserMutation) ResetUpdateTime() { + m.update_time = nil + m.addupdate_time = nil + delete(m.clearedFields, user.FieldUpdateTime) +} + +// SetDeleteTime sets the "delete_time" field. +func (m *UserMutation) SetDeleteTime(i int64) { + m.delete_time = &i + m.adddelete_time = nil +} + +// DeleteTime returns the value of the "delete_time" field in the mutation. +func (m *UserMutation) DeleteTime() (r int64, exists bool) { + v := m.delete_time + if v == nil { + return + } + return *v, true +} + +// OldDeleteTime returns the old "delete_time" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldDeleteTime(ctx context.Context) (v *int64, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeleteTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeleteTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeleteTime: %w", err) + } + return oldValue.DeleteTime, nil +} + +// AddDeleteTime adds i to the "delete_time" field. +func (m *UserMutation) AddDeleteTime(i int64) { + if m.adddelete_time != nil { + *m.adddelete_time += i + } else { + m.adddelete_time = &i + } +} + +// AddedDeleteTime returns the value that was added to the "delete_time" field in this mutation. +func (m *UserMutation) AddedDeleteTime() (r int64, exists bool) { + v := m.adddelete_time + if v == nil { + return + } + return *v, true +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (m *UserMutation) ClearDeleteTime() { + m.delete_time = nil + m.adddelete_time = nil + m.clearedFields[user.FieldDeleteTime] = struct{}{} +} + +// DeleteTimeCleared returns if the "delete_time" field was cleared in this mutation. +func (m *UserMutation) DeleteTimeCleared() bool { + _, ok := m.clearedFields[user.FieldDeleteTime] + return ok +} + +// ResetDeleteTime resets all changes to the "delete_time" field. +func (m *UserMutation) ResetDeleteTime() { + m.delete_time = nil + m.adddelete_time = nil + delete(m.clearedFields, user.FieldDeleteTime) +} + +// SetUserName sets the "user_name" field. +func (m *UserMutation) SetUserName(s string) { + m.user_name = &s +} + +// UserName returns the value of the "user_name" field in the mutation. +func (m *UserMutation) UserName() (r string, exists bool) { + v := m.user_name + if v == nil { + return + } + return *v, true +} + +// OldUserName returns the old "user_name" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldUserName(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUserName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUserName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUserName: %w", err) + } + return oldValue.UserName, nil +} + +// ClearUserName clears the value of the "user_name" field. +func (m *UserMutation) ClearUserName() { + m.user_name = nil + m.clearedFields[user.FieldUserName] = struct{}{} +} + +// UserNameCleared returns if the "user_name" field was cleared in this mutation. +func (m *UserMutation) UserNameCleared() bool { + _, ok := m.clearedFields[user.FieldUserName] + return ok +} + +// ResetUserName resets all changes to the "user_name" field. +func (m *UserMutation) ResetUserName() { + m.user_name = nil + delete(m.clearedFields, user.FieldUserName) +} + +// SetNickName sets the "nick_name" field. +func (m *UserMutation) SetNickName(s string) { + m.nick_name = &s +} + +// NickName returns the value of the "nick_name" field in the mutation. +func (m *UserMutation) NickName() (r string, exists bool) { + v := m.nick_name + if v == nil { + return + } + return *v, true +} + +// OldNickName returns the old "nick_name" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldNickName(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldNickName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldNickName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNickName: %w", err) + } + return oldValue.NickName, nil +} + +// ClearNickName clears the value of the "nick_name" field. +func (m *UserMutation) ClearNickName() { + m.nick_name = nil + m.clearedFields[user.FieldNickName] = struct{}{} +} + +// NickNameCleared returns if the "nick_name" field was cleared in this mutation. +func (m *UserMutation) NickNameCleared() bool { + _, ok := m.clearedFields[user.FieldNickName] + return ok +} + +// ResetNickName resets all changes to the "nick_name" field. +func (m *UserMutation) ResetNickName() { + m.nick_name = nil + delete(m.clearedFields, user.FieldNickName) +} + +// SetPassword sets the "password" field. +func (m *UserMutation) SetPassword(s string) { + m.password = &s +} + +// Password returns the value of the "password" field in the mutation. +func (m *UserMutation) Password() (r string, exists bool) { + v := m.password + if v == nil { + return + } + return *v, true +} + +// OldPassword returns the old "password" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldPassword(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldPassword is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldPassword requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPassword: %w", err) + } + return oldValue.Password, nil +} + +// ClearPassword clears the value of the "password" field. +func (m *UserMutation) ClearPassword() { + m.password = nil + m.clearedFields[user.FieldPassword] = struct{}{} +} + +// PasswordCleared returns if the "password" field was cleared in this mutation. +func (m *UserMutation) PasswordCleared() bool { + _, ok := m.clearedFields[user.FieldPassword] + return ok +} + +// ResetPassword resets all changes to the "password" field. +func (m *UserMutation) ResetPassword() { + m.password = nil + delete(m.clearedFields, user.FieldPassword) +} + +// Where appends a list predicates to the UserMutation builder. +func (m *UserMutation) Where(ps ...predicate.User) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the UserMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *UserMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.User, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *UserMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *UserMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (User). +func (m *UserMutation) Type() string { + return m.typ +} + +// Fields returns all fields that were changed during this mutation. Note that in +// order to get all numeric fields that were incremented/decremented, call +// AddedFields(). +func (m *UserMutation) Fields() []string { + fields := make([]string, 0, 6) + if m.create_time != nil { + fields = append(fields, user.FieldCreateTime) + } + if m.update_time != nil { + fields = append(fields, user.FieldUpdateTime) + } + if m.delete_time != nil { + fields = append(fields, user.FieldDeleteTime) + } + if m.user_name != nil { + fields = append(fields, user.FieldUserName) + } + if m.nick_name != nil { + fields = append(fields, user.FieldNickName) + } + if m.password != nil { + fields = append(fields, user.FieldPassword) + } + return fields +} + +// Field returns the value of a field with the given name. The second boolean +// return value indicates that this field was not set, or was not defined in the +// schema. +func (m *UserMutation) Field(name string) (ent.Value, bool) { + switch name { + case user.FieldCreateTime: + return m.CreateTime() + case user.FieldUpdateTime: + return m.UpdateTime() + case user.FieldDeleteTime: + return m.DeleteTime() + case user.FieldUserName: + return m.UserName() + case user.FieldNickName: + return m.NickName() + case user.FieldPassword: + return m.Password() + } + return nil, false +} + +// OldField returns the old value of the field from the database. An error is +// returned if the mutation operation is not UpdateOne, or the query to the +// database failed. +func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case user.FieldCreateTime: + return m.OldCreateTime(ctx) + case user.FieldUpdateTime: + return m.OldUpdateTime(ctx) + case user.FieldDeleteTime: + return m.OldDeleteTime(ctx) + case user.FieldUserName: + return m.OldUserName(ctx) + case user.FieldNickName: + return m.OldNickName(ctx) + case user.FieldPassword: + return m.OldPassword(ctx) + } + return nil, fmt.Errorf("unknown User field %s", name) +} + +// SetField sets the value of a field with the given name. It returns an error if +// the field is not defined in the schema, or if the type mismatched the field +// type. +func (m *UserMutation) SetField(name string, value ent.Value) error { + switch name { + case user.FieldCreateTime: + v, ok := value.(int64) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreateTime(v) + return nil + case user.FieldUpdateTime: + v, ok := value.(int64) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdateTime(v) + return nil + case user.FieldDeleteTime: + v, ok := value.(int64) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeleteTime(v) + return nil + case user.FieldUserName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUserName(v) + return nil + case user.FieldNickName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetNickName(v) + return nil + case user.FieldPassword: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetPassword(v) + return nil + } + return fmt.Errorf("unknown User field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *UserMutation) AddedFields() []string { + var fields []string + if m.addcreate_time != nil { + fields = append(fields, user.FieldCreateTime) + } + if m.addupdate_time != nil { + fields = append(fields, user.FieldUpdateTime) + } + if m.adddelete_time != nil { + fields = append(fields, user.FieldDeleteTime) + } + return fields +} + +// AddedField returns the numeric value that was incremented/decremented on a field +// with the given name. The second boolean return value indicates that this field +// was not set, or was not defined in the schema. +func (m *UserMutation) AddedField(name string) (ent.Value, bool) { + switch name { + case user.FieldCreateTime: + return m.AddedCreateTime() + case user.FieldUpdateTime: + return m.AddedUpdateTime() + case user.FieldDeleteTime: + return m.AddedDeleteTime() + } + return nil, false +} + +// AddField adds the value to the field with the given name. It returns an error if +// the field is not defined in the schema, or if the type mismatched the field +// type. +func (m *UserMutation) AddField(name string, value ent.Value) error { + switch name { + case user.FieldCreateTime: + v, ok := value.(int64) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddCreateTime(v) + return nil + case user.FieldUpdateTime: + v, ok := value.(int64) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddUpdateTime(v) + return nil + case user.FieldDeleteTime: + v, ok := value.(int64) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddDeleteTime(v) + return nil + } + return fmt.Errorf("unknown User numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *UserMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(user.FieldCreateTime) { + fields = append(fields, user.FieldCreateTime) + } + if m.FieldCleared(user.FieldUpdateTime) { + fields = append(fields, user.FieldUpdateTime) + } + if m.FieldCleared(user.FieldDeleteTime) { + fields = append(fields, user.FieldDeleteTime) + } + if m.FieldCleared(user.FieldUserName) { + fields = append(fields, user.FieldUserName) + } + if m.FieldCleared(user.FieldNickName) { + fields = append(fields, user.FieldNickName) + } + if m.FieldCleared(user.FieldPassword) { + fields = append(fields, user.FieldPassword) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *UserMutation) FieldCleared(name string) bool { + _, ok := m.clearedFields[name] + return ok +} + +// ClearField clears the value of the field with the given name. It returns an +// error if the field is not defined in the schema. +func (m *UserMutation) ClearField(name string) error { + switch name { + case user.FieldCreateTime: + m.ClearCreateTime() + return nil + case user.FieldUpdateTime: + m.ClearUpdateTime() + return nil + case user.FieldDeleteTime: + m.ClearDeleteTime() + return nil + case user.FieldUserName: + m.ClearUserName() + return nil + case user.FieldNickName: + m.ClearNickName() + return nil + case user.FieldPassword: + m.ClearPassword() + return nil + } + return fmt.Errorf("unknown User nullable field %s", name) +} + +// ResetField resets all changes in the mutation for the field with the given name. +// It returns an error if the field is not defined in the schema. +func (m *UserMutation) ResetField(name string) error { + switch name { + case user.FieldCreateTime: + m.ResetCreateTime() + return nil + case user.FieldUpdateTime: + m.ResetUpdateTime() + return nil + case user.FieldDeleteTime: + m.ResetDeleteTime() + return nil + case user.FieldUserName: + m.ResetUserName() + return nil + case user.FieldNickName: + m.ResetNickName() + return nil + case user.FieldPassword: + m.ResetPassword() + return nil + } + return fmt.Errorf("unknown User field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *UserMutation) AddedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *UserMutation) AddedIDs(name string) []ent.Value { + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *UserMutation) RemovedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *UserMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *UserMutation) ClearedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *UserMutation) EdgeCleared(name string) bool { + return false +} + +// ClearEdge clears the value of the edge with the given name. It returns an error +// if that edge is not defined in the schema. +func (m *UserMutation) ClearEdge(name string) error { + return fmt.Errorf("unknown User unique edge %s", name) +} + +// ResetEdge resets all changes to the edge with the given name in this mutation. +// It returns an error if the edge is not defined in the schema. +func (m *UserMutation) ResetEdge(name string) error { + return fmt.Errorf("unknown User edge %s", name) +} diff --git a/orm/ent/app/user/service/internal/data/ent/predicate/predicate.go b/orm/ent/app/user/service/internal/data/ent/predicate/predicate.go new file mode 100644 index 0000000..af21dfe --- /dev/null +++ b/orm/ent/app/user/service/internal/data/ent/predicate/predicate.go @@ -0,0 +1,10 @@ +// Code generated by ent, DO NOT EDIT. + +package predicate + +import ( + "entgo.io/ent/dialect/sql" +) + +// User is the predicate function for user builders. +type User func(*sql.Selector) diff --git a/orm/ent/app/user/service/internal/data/ent/privacy/privacy.go b/orm/ent/app/user/service/internal/data/ent/privacy/privacy.go new file mode 100644 index 0000000..e4540d6 --- /dev/null +++ b/orm/ent/app/user/service/internal/data/ent/privacy/privacy.go @@ -0,0 +1,225 @@ +// Code generated by ent, DO NOT EDIT. + +package privacy + +import ( + "context" + "fmt" + "kratos-ent-example/app/user/service/internal/data/ent" + + "entgo.io/ent/entql" + "entgo.io/ent/privacy" +) + +var ( + // Allow may be returned by rules to indicate that the policy + // evaluation should terminate with allow decision. + Allow = privacy.Allow + + // Deny may be returned by rules to indicate that the policy + // evaluation should terminate with deny decision. + Deny = privacy.Deny + + // Skip may be returned by rules to indicate that the policy + // evaluation should continue to the next rule. + Skip = privacy.Skip +) + +// Allowf returns an formatted wrapped Allow decision. +func Allowf(format string, a ...any) error { + return fmt.Errorf(format+": %w", append(a, Allow)...) +} + +// Denyf returns an formatted wrapped Deny decision. +func Denyf(format string, a ...any) error { + return fmt.Errorf(format+": %w", append(a, Deny)...) +} + +// Skipf returns an formatted wrapped Skip decision. +func Skipf(format string, a ...any) error { + return fmt.Errorf(format+": %w", append(a, Skip)...) +} + +// DecisionContext creates a new context from the given parent context with +// a policy decision attach to it. +func DecisionContext(parent context.Context, decision error) context.Context { + return privacy.DecisionContext(parent, decision) +} + +// DecisionFromContext retrieves the policy decision from the context. +func DecisionFromContext(ctx context.Context) (error, bool) { + return privacy.DecisionFromContext(ctx) +} + +type ( + // Policy groups query and mutation policies. + Policy = privacy.Policy + + // QueryRule defines the interface deciding whether a + // query is allowed and optionally modify it. + QueryRule = privacy.QueryRule + // QueryPolicy combines multiple query rules into a single policy. + QueryPolicy = privacy.QueryPolicy + + // MutationRule defines the interface which decides whether a + // mutation is allowed and optionally modifies it. + MutationRule = privacy.MutationRule + // MutationPolicy combines multiple mutation rules into a single policy. + MutationPolicy = privacy.MutationPolicy +) + +// QueryRuleFunc type is an adapter to allow the use of +// ordinary functions as query rules. +type QueryRuleFunc func(context.Context, ent.Query) error + +// Eval returns f(ctx, q). +func (f QueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error { + return f(ctx, q) +} + +// MutationRuleFunc type is an adapter which allows the use of +// ordinary functions as mutation rules. +type MutationRuleFunc func(context.Context, ent.Mutation) error + +// EvalMutation returns f(ctx, m). +func (f MutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error { + return f(ctx, m) +} + +// QueryMutationRule is an interface which groups query and mutation rules. +type QueryMutationRule interface { + QueryRule + MutationRule +} + +// AlwaysAllowRule returns a rule that returns an allow decision. +func AlwaysAllowRule() QueryMutationRule { + return fixedDecision{Allow} +} + +// AlwaysDenyRule returns a rule that returns a deny decision. +func AlwaysDenyRule() QueryMutationRule { + return fixedDecision{Deny} +} + +type fixedDecision struct { + decision error +} + +func (f fixedDecision) EvalQuery(context.Context, ent.Query) error { + return f.decision +} + +func (f fixedDecision) EvalMutation(context.Context, ent.Mutation) error { + return f.decision +} + +type contextDecision struct { + eval func(context.Context) error +} + +// ContextQueryMutationRule creates a query/mutation rule from a context eval func. +func ContextQueryMutationRule(eval func(context.Context) error) QueryMutationRule { + return contextDecision{eval} +} + +func (c contextDecision) EvalQuery(ctx context.Context, _ ent.Query) error { + return c.eval(ctx) +} + +func (c contextDecision) EvalMutation(ctx context.Context, _ ent.Mutation) error { + return c.eval(ctx) +} + +// OnMutationOperation evaluates the given rule only on a given mutation operation. +func OnMutationOperation(rule MutationRule, op ent.Op) MutationRule { + return MutationRuleFunc(func(ctx context.Context, m ent.Mutation) error { + if m.Op().Is(op) { + return rule.EvalMutation(ctx, m) + } + return Skip + }) +} + +// DenyMutationOperationRule returns a rule denying specified mutation operation. +func DenyMutationOperationRule(op ent.Op) MutationRule { + rule := MutationRuleFunc(func(_ context.Context, m ent.Mutation) error { + return Denyf("ent/privacy: operation %s is not allowed", m.Op()) + }) + return OnMutationOperation(rule, op) +} + +// The UserQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type UserQueryRuleFunc func(context.Context, *ent.UserQuery) error + +// EvalQuery return f(ctx, q). +func (f UserQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error { + if q, ok := q.(*ent.UserQuery); ok { + return f(ctx, q) + } + return Denyf("ent/privacy: unexpected query type %T, expect *ent.UserQuery", q) +} + +// The UserMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type UserMutationRuleFunc func(context.Context, *ent.UserMutation) error + +// EvalMutation calls f(ctx, m). +func (f UserMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error { + if m, ok := m.(*ent.UserMutation); ok { + return f(ctx, m) + } + return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.UserMutation", m) +} + +type ( + // Filter is the interface that wraps the Where function + // for filtering nodes in queries and mutations. + Filter interface { + // Where applies a filter on the executed query/mutation. + Where(entql.P) + } + + // The FilterFunc type is an adapter that allows the use of ordinary + // functions as filters for query and mutation types. + FilterFunc func(context.Context, Filter) error +) + +// EvalQuery calls f(ctx, q) if the query implements the Filter interface, otherwise it is denied. +func (f FilterFunc) EvalQuery(ctx context.Context, q ent.Query) error { + fr, err := queryFilter(q) + if err != nil { + return err + } + return f(ctx, fr) +} + +// EvalMutation calls f(ctx, q) if the mutation implements the Filter interface, otherwise it is denied. +func (f FilterFunc) EvalMutation(ctx context.Context, m ent.Mutation) error { + fr, err := mutationFilter(m) + if err != nil { + return err + } + return f(ctx, fr) +} + +var _ QueryMutationRule = FilterFunc(nil) + +func queryFilter(q ent.Query) (Filter, error) { + switch q := q.(type) { + case *ent.UserQuery: + return q.Filter(), nil + default: + return nil, Denyf("ent/privacy: unexpected query type %T for query filter", q) + } +} + +func mutationFilter(m ent.Mutation) (Filter, error) { + switch m := m.(type) { + case *ent.UserMutation: + return m.Filter(), nil + default: + return nil, Denyf("ent/privacy: unexpected mutation type %T for mutation filter", m) + } +} diff --git a/orm/ent/app/user/service/internal/data/ent/runtime.go b/orm/ent/app/user/service/internal/data/ent/runtime.go new file mode 100644 index 0000000..7610cfc --- /dev/null +++ b/orm/ent/app/user/service/internal/data/ent/runtime.go @@ -0,0 +1,74 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "kratos-ent-example/app/user/service/internal/data/ent/schema" + "kratos-ent-example/app/user/service/internal/data/ent/user" +) + +// The init function reads all schema descriptors with runtime code +// (default values, validators, hooks and policies) and stitches it +// to their package variables. +func init() { + userMixin := schema.User{}.Mixin() + userMixinFields0 := userMixin[0].Fields() + _ = userMixinFields0 + userMixinFields1 := userMixin[1].Fields() + _ = userMixinFields1 + userFields := schema.User{}.Fields() + _ = userFields + // userDescCreateTime is the schema descriptor for create_time field. + userDescCreateTime := userMixinFields1[0].Descriptor() + // user.DefaultCreateTime holds the default value on creation for the create_time field. + user.DefaultCreateTime = userDescCreateTime.Default.(func() int64) + // userDescUpdateTime is the schema descriptor for update_time field. + userDescUpdateTime := userMixinFields1[1].Descriptor() + // user.UpdateDefaultUpdateTime holds the default value on update for the update_time field. + user.UpdateDefaultUpdateTime = userDescUpdateTime.UpdateDefault.(func() int64) + // userDescUserName is the schema descriptor for user_name field. + userDescUserName := userFields[0].Descriptor() + // user.UserNameValidator is a validator for the "user_name" field. It is called by the builders before save. + user.UserNameValidator = func() func(string) error { + validators := userDescUserName.Validators + fns := [...]func(string) error{ + validators[0].(func(string) error), + validators[1].(func(string) error), + validators[2].(func(string) error), + } + return func(user_name string) error { + for _, fn := range fns { + if err := fn(user_name); err != nil { + return err + } + } + return nil + } + }() + // userDescNickName is the schema descriptor for nick_name field. + userDescNickName := userFields[1].Descriptor() + // user.NickNameValidator is a validator for the "nick_name" field. It is called by the builders before save. + user.NickNameValidator = userDescNickName.Validators[0].(func(string) error) + // userDescPassword is the schema descriptor for password field. + userDescPassword := userFields[2].Descriptor() + // user.PasswordValidator is a validator for the "password" field. It is called by the builders before save. + user.PasswordValidator = func() func(string) error { + validators := userDescPassword.Validators + fns := [...]func(string) error{ + validators[0].(func(string) error), + validators[1].(func(string) error), + } + return func(password string) error { + for _, fn := range fns { + if err := fn(password); err != nil { + return err + } + } + return nil + } + }() + // userDescID is the schema descriptor for id field. + userDescID := userMixinFields0[0].Descriptor() + // user.IDValidator is a validator for the "id" field. It is called by the builders before save. + user.IDValidator = userDescID.Validators[0].(func(uint32) error) +} diff --git a/orm/ent/app/user/service/internal/data/ent/runtime/runtime.go b/orm/ent/app/user/service/internal/data/ent/runtime/runtime.go new file mode 100644 index 0000000..446a045 --- /dev/null +++ b/orm/ent/app/user/service/internal/data/ent/runtime/runtime.go @@ -0,0 +1,10 @@ +// Code generated by ent, DO NOT EDIT. + +package runtime + +// The schema-stitching logic is generated in kratos-ent-example/app/user/service/internal/data/ent/runtime.go + +const ( + Version = "v0.12.3" // Version of ent codegen. + Sum = "h1:N5lO2EOrHpCH5HYfiMOCHYbo+oh5M8GjT0/cx5x6xkk=" // Sum of ent codegen. +) diff --git a/orm/ent/app/user/service/internal/data/ent/schema/user.go b/orm/ent/app/user/service/internal/data/ent/schema/user.go new file mode 100644 index 0000000..7ec038a --- /dev/null +++ b/orm/ent/app/user/service/internal/data/ent/schema/user.go @@ -0,0 +1,76 @@ +package schema + +import ( + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + "github.com/tx7do/kratos-utils/entgo/mixin" + "regexp" +) + +// User holds the schema definition for the User entity. +type User struct { + ent.Schema +} + +func (User) Annotations() []schema.Annotation { + return []schema.Annotation{ + entsql.Annotation{ + Table: "users", + Charset: "utf8mb4", + Collation: "utf8mb4_bin", + }, + entsql.WithComments(true), + schema.Comment("用户账号"), + } +} + +// Fields of the User. +func (User) Fields() []ent.Field { + return []ent.Field{ + field.String("user_name"). + Comment("用户名"). + Unique(). + MaxLen(50). + NotEmpty(). + Immutable(). + Optional(). + Nillable(). + Match(regexp.MustCompile("^[a-zA-Z0-9]{4,16}$")), + + field.String("nick_name"). + Comment("昵称"). + MaxLen(128). + Optional(). + Nillable(), + + field.String("password"). + Comment("登陆密码"). + MaxLen(255). + Optional(). + Nillable(). + NotEmpty(), + } +} + +// Mixin of the User. +func (User) Mixin() []ent.Mixin { + return []ent.Mixin{ + mixin.AutoIncrementId{}, + mixin.Time{}, + } +} + +// Edges of the User. +func (User) Edges() []ent.Edge { + return nil +} + +// Indexes of the User. +func (User) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("id", "user_name").Unique(), + } +} diff --git a/orm/ent/app/user/service/internal/data/ent/tx.go b/orm/ent/app/user/service/internal/data/ent/tx.go new file mode 100644 index 0000000..8bbe7fa --- /dev/null +++ b/orm/ent/app/user/service/internal/data/ent/tx.go @@ -0,0 +1,210 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "sync" + + "entgo.io/ent/dialect" +) + +// Tx is a transactional client that is created by calling Client.Tx(). +type Tx struct { + config + // User is the client for interacting with the User builders. + User *UserClient + + // lazily loaded. + client *Client + clientOnce sync.Once + // ctx lives for the life of the transaction. It is + // the same context used by the underlying connection. + ctx context.Context +} + +type ( + // Committer is the interface that wraps the Commit method. + Committer interface { + Commit(context.Context, *Tx) error + } + + // The CommitFunc type is an adapter to allow the use of ordinary + // function as a Committer. If f is a function with the appropriate + // signature, CommitFunc(f) is a Committer that calls f. + CommitFunc func(context.Context, *Tx) error + + // CommitHook defines the "commit middleware". A function that gets a Committer + // and returns a Committer. For example: + // + // hook := func(next ent.Committer) ent.Committer { + // return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error { + // // Do some stuff before. + // if err := next.Commit(ctx, tx); err != nil { + // return err + // } + // // Do some stuff after. + // return nil + // }) + // } + // + CommitHook func(Committer) Committer +) + +// Commit calls f(ctx, m). +func (f CommitFunc) Commit(ctx context.Context, tx *Tx) error { + return f(ctx, tx) +} + +// Commit commits the transaction. +func (tx *Tx) Commit() error { + txDriver := tx.config.driver.(*txDriver) + var fn Committer = CommitFunc(func(context.Context, *Tx) error { + return txDriver.tx.Commit() + }) + txDriver.mu.Lock() + hooks := append([]CommitHook(nil), txDriver.onCommit...) + txDriver.mu.Unlock() + for i := len(hooks) - 1; i >= 0; i-- { + fn = hooks[i](fn) + } + return fn.Commit(tx.ctx, tx) +} + +// OnCommit adds a hook to call on commit. +func (tx *Tx) OnCommit(f CommitHook) { + txDriver := tx.config.driver.(*txDriver) + txDriver.mu.Lock() + txDriver.onCommit = append(txDriver.onCommit, f) + txDriver.mu.Unlock() +} + +type ( + // Rollbacker is the interface that wraps the Rollback method. + Rollbacker interface { + Rollback(context.Context, *Tx) error + } + + // The RollbackFunc type is an adapter to allow the use of ordinary + // function as a Rollbacker. If f is a function with the appropriate + // signature, RollbackFunc(f) is a Rollbacker that calls f. + RollbackFunc func(context.Context, *Tx) error + + // RollbackHook defines the "rollback middleware". A function that gets a Rollbacker + // and returns a Rollbacker. For example: + // + // hook := func(next ent.Rollbacker) ent.Rollbacker { + // return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error { + // // Do some stuff before. + // if err := next.Rollback(ctx, tx); err != nil { + // return err + // } + // // Do some stuff after. + // return nil + // }) + // } + // + RollbackHook func(Rollbacker) Rollbacker +) + +// Rollback calls f(ctx, m). +func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error { + return f(ctx, tx) +} + +// Rollback rollbacks the transaction. +func (tx *Tx) Rollback() error { + txDriver := tx.config.driver.(*txDriver) + var fn Rollbacker = RollbackFunc(func(context.Context, *Tx) error { + return txDriver.tx.Rollback() + }) + txDriver.mu.Lock() + hooks := append([]RollbackHook(nil), txDriver.onRollback...) + txDriver.mu.Unlock() + for i := len(hooks) - 1; i >= 0; i-- { + fn = hooks[i](fn) + } + return fn.Rollback(tx.ctx, tx) +} + +// OnRollback adds a hook to call on rollback. +func (tx *Tx) OnRollback(f RollbackHook) { + txDriver := tx.config.driver.(*txDriver) + txDriver.mu.Lock() + txDriver.onRollback = append(txDriver.onRollback, f) + txDriver.mu.Unlock() +} + +// Client returns a Client that binds to current transaction. +func (tx *Tx) Client() *Client { + tx.clientOnce.Do(func() { + tx.client = &Client{config: tx.config} + tx.client.init() + }) + return tx.client +} + +func (tx *Tx) init() { + tx.User = NewUserClient(tx.config) +} + +// txDriver wraps the given dialect.Tx with a nop dialect.Driver implementation. +// The idea is to support transactions without adding any extra code to the builders. +// When a builder calls to driver.Tx(), it gets the same dialect.Tx instance. +// Commit and Rollback are nop for the internal builders and the user must call one +// of them in order to commit or rollback the transaction. +// +// If a closed transaction is embedded in one of the generated entities, and the entity +// applies a query, for example: User.QueryXXX(), the query will be executed +// through the driver which created this transaction. +// +// Note that txDriver is not goroutine safe. +type txDriver struct { + // the driver we started the transaction from. + drv dialect.Driver + // tx is the underlying transaction. + tx dialect.Tx + // completion hooks. + mu sync.Mutex + onCommit []CommitHook + onRollback []RollbackHook +} + +// newTx creates a new transactional driver. +func newTx(ctx context.Context, drv dialect.Driver) (*txDriver, error) { + tx, err := drv.Tx(ctx) + if err != nil { + return nil, err + } + return &txDriver{tx: tx, drv: drv}, nil +} + +// Tx returns the transaction wrapper (txDriver) to avoid Commit or Rollback calls +// from the internal builders. Should be called only by the internal builders. +func (tx *txDriver) Tx(context.Context) (dialect.Tx, error) { return tx, nil } + +// Dialect returns the dialect of the driver we started the transaction from. +func (tx *txDriver) Dialect() string { return tx.drv.Dialect() } + +// Close is a nop close. +func (*txDriver) Close() error { return nil } + +// Commit is a nop commit for the internal builders. +// User must call `Tx.Commit` in order to commit the transaction. +func (*txDriver) Commit() error { return nil } + +// Rollback is a nop rollback for the internal builders. +// User must call `Tx.Rollback` in order to rollback the transaction. +func (*txDriver) Rollback() error { return nil } + +// Exec calls tx.Exec. +func (tx *txDriver) Exec(ctx context.Context, query string, args, v any) error { + return tx.tx.Exec(ctx, query, args, v) +} + +// Query calls tx.Query. +func (tx *txDriver) Query(ctx context.Context, query string, args, v any) error { + return tx.tx.Query(ctx, query, args, v) +} + +var _ dialect.Driver = (*txDriver)(nil) diff --git a/orm/ent/app/user/service/internal/data/ent/user.go b/orm/ent/app/user/service/internal/data/ent/user.go new file mode 100644 index 0000000..749cd06 --- /dev/null +++ b/orm/ent/app/user/service/internal/data/ent/user.go @@ -0,0 +1,177 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "fmt" + "kratos-ent-example/app/user/service/internal/data/ent/user" + "strings" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" +) + +// 用户账号 +type User struct { + config `json:"-"` + // ID of the ent. + // id + ID uint32 `json:"id,omitempty"` + // 创建时间 + CreateTime *int64 `json:"create_time,omitempty"` + // 更新时间 + UpdateTime *int64 `json:"update_time,omitempty"` + // 删除时间 + DeleteTime *int64 `json:"delete_time,omitempty"` + // 用户名 + UserName *string `json:"user_name,omitempty"` + // 昵称 + NickName *string `json:"nick_name,omitempty"` + // 登陆密码 + Password *string `json:"password,omitempty"` + selectValues sql.SelectValues +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*User) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case user.FieldID, user.FieldCreateTime, user.FieldUpdateTime, user.FieldDeleteTime: + values[i] = new(sql.NullInt64) + case user.FieldUserName, user.FieldNickName, user.FieldPassword: + values[i] = new(sql.NullString) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the User fields. +func (u *User) assignValues(columns []string, values []any) error { + if m, n := len(values), len(columns); m < n { + return fmt.Errorf("mismatch number of scan values: %d != %d", m, n) + } + for i := range columns { + switch columns[i] { + case user.FieldID: + value, ok := values[i].(*sql.NullInt64) + if !ok { + return fmt.Errorf("unexpected type %T for field id", value) + } + u.ID = uint32(value.Int64) + case user.FieldCreateTime: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field create_time", values[i]) + } else if value.Valid { + u.CreateTime = new(int64) + *u.CreateTime = value.Int64 + } + case user.FieldUpdateTime: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field update_time", values[i]) + } else if value.Valid { + u.UpdateTime = new(int64) + *u.UpdateTime = value.Int64 + } + case user.FieldDeleteTime: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field delete_time", values[i]) + } else if value.Valid { + u.DeleteTime = new(int64) + *u.DeleteTime = value.Int64 + } + case user.FieldUserName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field user_name", values[i]) + } else if value.Valid { + u.UserName = new(string) + *u.UserName = value.String + } + case user.FieldNickName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field nick_name", values[i]) + } else if value.Valid { + u.NickName = new(string) + *u.NickName = value.String + } + case user.FieldPassword: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field password", values[i]) + } else if value.Valid { + u.Password = new(string) + *u.Password = value.String + } + default: + u.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the User. +// This includes values selected through modifiers, order, etc. +func (u *User) Value(name string) (ent.Value, error) { + return u.selectValues.Get(name) +} + +// Update returns a builder for updating this User. +// Note that you need to call User.Unwrap() before calling this method if this User +// was returned from a transaction, and the transaction was committed or rolled back. +func (u *User) Update() *UserUpdateOne { + return NewUserClient(u.config).UpdateOne(u) +} + +// Unwrap unwraps the User entity that was returned from a transaction after it was closed, +// so that all future queries will be executed through the driver which created the transaction. +func (u *User) Unwrap() *User { + _tx, ok := u.config.driver.(*txDriver) + if !ok { + panic("ent: User is not a transactional entity") + } + u.config.driver = _tx.drv + return u +} + +// String implements the fmt.Stringer. +func (u *User) String() string { + var builder strings.Builder + builder.WriteString("User(") + builder.WriteString(fmt.Sprintf("id=%v, ", u.ID)) + if v := u.CreateTime; v != nil { + builder.WriteString("create_time=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := u.UpdateTime; v != nil { + builder.WriteString("update_time=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := u.DeleteTime; v != nil { + builder.WriteString("delete_time=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteString(", ") + if v := u.UserName; v != nil { + builder.WriteString("user_name=") + builder.WriteString(*v) + } + builder.WriteString(", ") + if v := u.NickName; v != nil { + builder.WriteString("nick_name=") + builder.WriteString(*v) + } + builder.WriteString(", ") + if v := u.Password; v != nil { + builder.WriteString("password=") + builder.WriteString(*v) + } + builder.WriteByte(')') + return builder.String() +} + +// Users is a parsable slice of User. +type Users []*User diff --git a/orm/ent/app/user/service/internal/data/ent/user/user.go b/orm/ent/app/user/service/internal/data/ent/user/user.go new file mode 100644 index 0000000..431a703 --- /dev/null +++ b/orm/ent/app/user/service/internal/data/ent/user/user.go @@ -0,0 +1,102 @@ +// Code generated by ent, DO NOT EDIT. + +package user + +import ( + "entgo.io/ent/dialect/sql" +) + +const ( + // Label holds the string label denoting the user type in the database. + Label = "user" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreateTime holds the string denoting the create_time field in the database. + FieldCreateTime = "create_time" + // FieldUpdateTime holds the string denoting the update_time field in the database. + FieldUpdateTime = "update_time" + // FieldDeleteTime holds the string denoting the delete_time field in the database. + FieldDeleteTime = "delete_time" + // FieldUserName holds the string denoting the user_name field in the database. + FieldUserName = "user_name" + // FieldNickName holds the string denoting the nick_name field in the database. + FieldNickName = "nick_name" + // FieldPassword holds the string denoting the password field in the database. + FieldPassword = "password" + // Table holds the table name of the user in the database. + Table = "users" +) + +// Columns holds all SQL columns for user fields. +var Columns = []string{ + FieldID, + FieldCreateTime, + FieldUpdateTime, + FieldDeleteTime, + FieldUserName, + FieldNickName, + FieldPassword, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +var ( + // DefaultCreateTime holds the default value on creation for the "create_time" field. + DefaultCreateTime func() int64 + // UpdateDefaultUpdateTime holds the default value on update for the "update_time" field. + UpdateDefaultUpdateTime func() int64 + // UserNameValidator is a validator for the "user_name" field. It is called by the builders before save. + UserNameValidator func(string) error + // NickNameValidator is a validator for the "nick_name" field. It is called by the builders before save. + NickNameValidator func(string) error + // PasswordValidator is a validator for the "password" field. It is called by the builders before save. + PasswordValidator func(string) error + // IDValidator is a validator for the "id" field. It is called by the builders before save. + IDValidator func(uint32) error +) + +// OrderOption defines the ordering options for the User queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreateTime orders the results by the create_time field. +func ByCreateTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreateTime, opts...).ToFunc() +} + +// ByUpdateTime orders the results by the update_time field. +func ByUpdateTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdateTime, opts...).ToFunc() +} + +// ByDeleteTime orders the results by the delete_time field. +func ByDeleteTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeleteTime, opts...).ToFunc() +} + +// ByUserName orders the results by the user_name field. +func ByUserName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUserName, opts...).ToFunc() +} + +// ByNickName orders the results by the nick_name field. +func ByNickName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldNickName, opts...).ToFunc() +} + +// ByPassword orders the results by the password field. +func ByPassword(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldPassword, opts...).ToFunc() +} diff --git a/orm/ent/app/user/service/internal/data/ent/user/where.go b/orm/ent/app/user/service/internal/data/ent/user/where.go new file mode 100644 index 0000000..3aff83e --- /dev/null +++ b/orm/ent/app/user/service/internal/data/ent/user/where.go @@ -0,0 +1,491 @@ +// Code generated by ent, DO NOT EDIT. + +package user + +import ( + "kratos-ent-example/app/user/service/internal/data/ent/predicate" + + "entgo.io/ent/dialect/sql" +) + +// ID filters vertices based on their ID field. +func ID(id uint32) predicate.User { + return predicate.User(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id uint32) predicate.User { + return predicate.User(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id uint32) predicate.User { + return predicate.User(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...uint32) predicate.User { + return predicate.User(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...uint32) predicate.User { + return predicate.User(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id uint32) predicate.User { + return predicate.User(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id uint32) predicate.User { + return predicate.User(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id uint32) predicate.User { + return predicate.User(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id uint32) predicate.User { + return predicate.User(sql.FieldLTE(FieldID, id)) +} + +// CreateTime applies equality check predicate on the "create_time" field. It's identical to CreateTimeEQ. +func CreateTime(v int64) predicate.User { + return predicate.User(sql.FieldEQ(FieldCreateTime, v)) +} + +// UpdateTime applies equality check predicate on the "update_time" field. It's identical to UpdateTimeEQ. +func UpdateTime(v int64) predicate.User { + return predicate.User(sql.FieldEQ(FieldUpdateTime, v)) +} + +// DeleteTime applies equality check predicate on the "delete_time" field. It's identical to DeleteTimeEQ. +func DeleteTime(v int64) predicate.User { + return predicate.User(sql.FieldEQ(FieldDeleteTime, v)) +} + +// UserName applies equality check predicate on the "user_name" field. It's identical to UserNameEQ. +func UserName(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldUserName, v)) +} + +// NickName applies equality check predicate on the "nick_name" field. It's identical to NickNameEQ. +func NickName(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldNickName, v)) +} + +// Password applies equality check predicate on the "password" field. It's identical to PasswordEQ. +func Password(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldPassword, v)) +} + +// CreateTimeEQ applies the EQ predicate on the "create_time" field. +func CreateTimeEQ(v int64) predicate.User { + return predicate.User(sql.FieldEQ(FieldCreateTime, v)) +} + +// CreateTimeNEQ applies the NEQ predicate on the "create_time" field. +func CreateTimeNEQ(v int64) predicate.User { + return predicate.User(sql.FieldNEQ(FieldCreateTime, v)) +} + +// CreateTimeIn applies the In predicate on the "create_time" field. +func CreateTimeIn(vs ...int64) predicate.User { + return predicate.User(sql.FieldIn(FieldCreateTime, vs...)) +} + +// CreateTimeNotIn applies the NotIn predicate on the "create_time" field. +func CreateTimeNotIn(vs ...int64) predicate.User { + return predicate.User(sql.FieldNotIn(FieldCreateTime, vs...)) +} + +// CreateTimeGT applies the GT predicate on the "create_time" field. +func CreateTimeGT(v int64) predicate.User { + return predicate.User(sql.FieldGT(FieldCreateTime, v)) +} + +// CreateTimeGTE applies the GTE predicate on the "create_time" field. +func CreateTimeGTE(v int64) predicate.User { + return predicate.User(sql.FieldGTE(FieldCreateTime, v)) +} + +// CreateTimeLT applies the LT predicate on the "create_time" field. +func CreateTimeLT(v int64) predicate.User { + return predicate.User(sql.FieldLT(FieldCreateTime, v)) +} + +// CreateTimeLTE applies the LTE predicate on the "create_time" field. +func CreateTimeLTE(v int64) predicate.User { + return predicate.User(sql.FieldLTE(FieldCreateTime, v)) +} + +// CreateTimeIsNil applies the IsNil predicate on the "create_time" field. +func CreateTimeIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldCreateTime)) +} + +// CreateTimeNotNil applies the NotNil predicate on the "create_time" field. +func CreateTimeNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldCreateTime)) +} + +// UpdateTimeEQ applies the EQ predicate on the "update_time" field. +func UpdateTimeEQ(v int64) predicate.User { + return predicate.User(sql.FieldEQ(FieldUpdateTime, v)) +} + +// UpdateTimeNEQ applies the NEQ predicate on the "update_time" field. +func UpdateTimeNEQ(v int64) predicate.User { + return predicate.User(sql.FieldNEQ(FieldUpdateTime, v)) +} + +// UpdateTimeIn applies the In predicate on the "update_time" field. +func UpdateTimeIn(vs ...int64) predicate.User { + return predicate.User(sql.FieldIn(FieldUpdateTime, vs...)) +} + +// UpdateTimeNotIn applies the NotIn predicate on the "update_time" field. +func UpdateTimeNotIn(vs ...int64) predicate.User { + return predicate.User(sql.FieldNotIn(FieldUpdateTime, vs...)) +} + +// UpdateTimeGT applies the GT predicate on the "update_time" field. +func UpdateTimeGT(v int64) predicate.User { + return predicate.User(sql.FieldGT(FieldUpdateTime, v)) +} + +// UpdateTimeGTE applies the GTE predicate on the "update_time" field. +func UpdateTimeGTE(v int64) predicate.User { + return predicate.User(sql.FieldGTE(FieldUpdateTime, v)) +} + +// UpdateTimeLT applies the LT predicate on the "update_time" field. +func UpdateTimeLT(v int64) predicate.User { + return predicate.User(sql.FieldLT(FieldUpdateTime, v)) +} + +// UpdateTimeLTE applies the LTE predicate on the "update_time" field. +func UpdateTimeLTE(v int64) predicate.User { + return predicate.User(sql.FieldLTE(FieldUpdateTime, v)) +} + +// UpdateTimeIsNil applies the IsNil predicate on the "update_time" field. +func UpdateTimeIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldUpdateTime)) +} + +// UpdateTimeNotNil applies the NotNil predicate on the "update_time" field. +func UpdateTimeNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldUpdateTime)) +} + +// DeleteTimeEQ applies the EQ predicate on the "delete_time" field. +func DeleteTimeEQ(v int64) predicate.User { + return predicate.User(sql.FieldEQ(FieldDeleteTime, v)) +} + +// DeleteTimeNEQ applies the NEQ predicate on the "delete_time" field. +func DeleteTimeNEQ(v int64) predicate.User { + return predicate.User(sql.FieldNEQ(FieldDeleteTime, v)) +} + +// DeleteTimeIn applies the In predicate on the "delete_time" field. +func DeleteTimeIn(vs ...int64) predicate.User { + return predicate.User(sql.FieldIn(FieldDeleteTime, vs...)) +} + +// DeleteTimeNotIn applies the NotIn predicate on the "delete_time" field. +func DeleteTimeNotIn(vs ...int64) predicate.User { + return predicate.User(sql.FieldNotIn(FieldDeleteTime, vs...)) +} + +// DeleteTimeGT applies the GT predicate on the "delete_time" field. +func DeleteTimeGT(v int64) predicate.User { + return predicate.User(sql.FieldGT(FieldDeleteTime, v)) +} + +// DeleteTimeGTE applies the GTE predicate on the "delete_time" field. +func DeleteTimeGTE(v int64) predicate.User { + return predicate.User(sql.FieldGTE(FieldDeleteTime, v)) +} + +// DeleteTimeLT applies the LT predicate on the "delete_time" field. +func DeleteTimeLT(v int64) predicate.User { + return predicate.User(sql.FieldLT(FieldDeleteTime, v)) +} + +// DeleteTimeLTE applies the LTE predicate on the "delete_time" field. +func DeleteTimeLTE(v int64) predicate.User { + return predicate.User(sql.FieldLTE(FieldDeleteTime, v)) +} + +// DeleteTimeIsNil applies the IsNil predicate on the "delete_time" field. +func DeleteTimeIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldDeleteTime)) +} + +// DeleteTimeNotNil applies the NotNil predicate on the "delete_time" field. +func DeleteTimeNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldDeleteTime)) +} + +// UserNameEQ applies the EQ predicate on the "user_name" field. +func UserNameEQ(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldUserName, v)) +} + +// UserNameNEQ applies the NEQ predicate on the "user_name" field. +func UserNameNEQ(v string) predicate.User { + return predicate.User(sql.FieldNEQ(FieldUserName, v)) +} + +// UserNameIn applies the In predicate on the "user_name" field. +func UserNameIn(vs ...string) predicate.User { + return predicate.User(sql.FieldIn(FieldUserName, vs...)) +} + +// UserNameNotIn applies the NotIn predicate on the "user_name" field. +func UserNameNotIn(vs ...string) predicate.User { + return predicate.User(sql.FieldNotIn(FieldUserName, vs...)) +} + +// UserNameGT applies the GT predicate on the "user_name" field. +func UserNameGT(v string) predicate.User { + return predicate.User(sql.FieldGT(FieldUserName, v)) +} + +// UserNameGTE applies the GTE predicate on the "user_name" field. +func UserNameGTE(v string) predicate.User { + return predicate.User(sql.FieldGTE(FieldUserName, v)) +} + +// UserNameLT applies the LT predicate on the "user_name" field. +func UserNameLT(v string) predicate.User { + return predicate.User(sql.FieldLT(FieldUserName, v)) +} + +// UserNameLTE applies the LTE predicate on the "user_name" field. +func UserNameLTE(v string) predicate.User { + return predicate.User(sql.FieldLTE(FieldUserName, v)) +} + +// UserNameContains applies the Contains predicate on the "user_name" field. +func UserNameContains(v string) predicate.User { + return predicate.User(sql.FieldContains(FieldUserName, v)) +} + +// UserNameHasPrefix applies the HasPrefix predicate on the "user_name" field. +func UserNameHasPrefix(v string) predicate.User { + return predicate.User(sql.FieldHasPrefix(FieldUserName, v)) +} + +// UserNameHasSuffix applies the HasSuffix predicate on the "user_name" field. +func UserNameHasSuffix(v string) predicate.User { + return predicate.User(sql.FieldHasSuffix(FieldUserName, v)) +} + +// UserNameIsNil applies the IsNil predicate on the "user_name" field. +func UserNameIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldUserName)) +} + +// UserNameNotNil applies the NotNil predicate on the "user_name" field. +func UserNameNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldUserName)) +} + +// UserNameEqualFold applies the EqualFold predicate on the "user_name" field. +func UserNameEqualFold(v string) predicate.User { + return predicate.User(sql.FieldEqualFold(FieldUserName, v)) +} + +// UserNameContainsFold applies the ContainsFold predicate on the "user_name" field. +func UserNameContainsFold(v string) predicate.User { + return predicate.User(sql.FieldContainsFold(FieldUserName, v)) +} + +// NickNameEQ applies the EQ predicate on the "nick_name" field. +func NickNameEQ(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldNickName, v)) +} + +// NickNameNEQ applies the NEQ predicate on the "nick_name" field. +func NickNameNEQ(v string) predicate.User { + return predicate.User(sql.FieldNEQ(FieldNickName, v)) +} + +// NickNameIn applies the In predicate on the "nick_name" field. +func NickNameIn(vs ...string) predicate.User { + return predicate.User(sql.FieldIn(FieldNickName, vs...)) +} + +// NickNameNotIn applies the NotIn predicate on the "nick_name" field. +func NickNameNotIn(vs ...string) predicate.User { + return predicate.User(sql.FieldNotIn(FieldNickName, vs...)) +} + +// NickNameGT applies the GT predicate on the "nick_name" field. +func NickNameGT(v string) predicate.User { + return predicate.User(sql.FieldGT(FieldNickName, v)) +} + +// NickNameGTE applies the GTE predicate on the "nick_name" field. +func NickNameGTE(v string) predicate.User { + return predicate.User(sql.FieldGTE(FieldNickName, v)) +} + +// NickNameLT applies the LT predicate on the "nick_name" field. +func NickNameLT(v string) predicate.User { + return predicate.User(sql.FieldLT(FieldNickName, v)) +} + +// NickNameLTE applies the LTE predicate on the "nick_name" field. +func NickNameLTE(v string) predicate.User { + return predicate.User(sql.FieldLTE(FieldNickName, v)) +} + +// NickNameContains applies the Contains predicate on the "nick_name" field. +func NickNameContains(v string) predicate.User { + return predicate.User(sql.FieldContains(FieldNickName, v)) +} + +// NickNameHasPrefix applies the HasPrefix predicate on the "nick_name" field. +func NickNameHasPrefix(v string) predicate.User { + return predicate.User(sql.FieldHasPrefix(FieldNickName, v)) +} + +// NickNameHasSuffix applies the HasSuffix predicate on the "nick_name" field. +func NickNameHasSuffix(v string) predicate.User { + return predicate.User(sql.FieldHasSuffix(FieldNickName, v)) +} + +// NickNameIsNil applies the IsNil predicate on the "nick_name" field. +func NickNameIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldNickName)) +} + +// NickNameNotNil applies the NotNil predicate on the "nick_name" field. +func NickNameNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldNickName)) +} + +// NickNameEqualFold applies the EqualFold predicate on the "nick_name" field. +func NickNameEqualFold(v string) predicate.User { + return predicate.User(sql.FieldEqualFold(FieldNickName, v)) +} + +// NickNameContainsFold applies the ContainsFold predicate on the "nick_name" field. +func NickNameContainsFold(v string) predicate.User { + return predicate.User(sql.FieldContainsFold(FieldNickName, v)) +} + +// PasswordEQ applies the EQ predicate on the "password" field. +func PasswordEQ(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldPassword, v)) +} + +// PasswordNEQ applies the NEQ predicate on the "password" field. +func PasswordNEQ(v string) predicate.User { + return predicate.User(sql.FieldNEQ(FieldPassword, v)) +} + +// PasswordIn applies the In predicate on the "password" field. +func PasswordIn(vs ...string) predicate.User { + return predicate.User(sql.FieldIn(FieldPassword, vs...)) +} + +// PasswordNotIn applies the NotIn predicate on the "password" field. +func PasswordNotIn(vs ...string) predicate.User { + return predicate.User(sql.FieldNotIn(FieldPassword, vs...)) +} + +// PasswordGT applies the GT predicate on the "password" field. +func PasswordGT(v string) predicate.User { + return predicate.User(sql.FieldGT(FieldPassword, v)) +} + +// PasswordGTE applies the GTE predicate on the "password" field. +func PasswordGTE(v string) predicate.User { + return predicate.User(sql.FieldGTE(FieldPassword, v)) +} + +// PasswordLT applies the LT predicate on the "password" field. +func PasswordLT(v string) predicate.User { + return predicate.User(sql.FieldLT(FieldPassword, v)) +} + +// PasswordLTE applies the LTE predicate on the "password" field. +func PasswordLTE(v string) predicate.User { + return predicate.User(sql.FieldLTE(FieldPassword, v)) +} + +// PasswordContains applies the Contains predicate on the "password" field. +func PasswordContains(v string) predicate.User { + return predicate.User(sql.FieldContains(FieldPassword, v)) +} + +// PasswordHasPrefix applies the HasPrefix predicate on the "password" field. +func PasswordHasPrefix(v string) predicate.User { + return predicate.User(sql.FieldHasPrefix(FieldPassword, v)) +} + +// PasswordHasSuffix applies the HasSuffix predicate on the "password" field. +func PasswordHasSuffix(v string) predicate.User { + return predicate.User(sql.FieldHasSuffix(FieldPassword, v)) +} + +// PasswordIsNil applies the IsNil predicate on the "password" field. +func PasswordIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldPassword)) +} + +// PasswordNotNil applies the NotNil predicate on the "password" field. +func PasswordNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldPassword)) +} + +// PasswordEqualFold applies the EqualFold predicate on the "password" field. +func PasswordEqualFold(v string) predicate.User { + return predicate.User(sql.FieldEqualFold(FieldPassword, v)) +} + +// PasswordContainsFold applies the ContainsFold predicate on the "password" field. +func PasswordContainsFold(v string) predicate.User { + return predicate.User(sql.FieldContainsFold(FieldPassword, v)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.User) predicate.User { + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.User) predicate.User { + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() + } + p(s1) + } + s.Where(s1.P()) + }) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.User) predicate.User { + return predicate.User(func(s *sql.Selector) { + p(s.Not()) + }) +} diff --git a/orm/ent/app/user/service/internal/data/ent/user_create.go b/orm/ent/app/user/service/internal/data/ent/user_create.go new file mode 100644 index 0000000..9907699 --- /dev/null +++ b/orm/ent/app/user/service/internal/data/ent/user_create.go @@ -0,0 +1,854 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "errors" + "fmt" + "kratos-ent-example/app/user/service/internal/data/ent/user" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// UserCreate is the builder for creating a User entity. +type UserCreate struct { + config + mutation *UserMutation + hooks []Hook + conflict []sql.ConflictOption +} + +// SetCreateTime sets the "create_time" field. +func (uc *UserCreate) SetCreateTime(i int64) *UserCreate { + uc.mutation.SetCreateTime(i) + return uc +} + +// SetNillableCreateTime sets the "create_time" field if the given value is not nil. +func (uc *UserCreate) SetNillableCreateTime(i *int64) *UserCreate { + if i != nil { + uc.SetCreateTime(*i) + } + return uc +} + +// SetUpdateTime sets the "update_time" field. +func (uc *UserCreate) SetUpdateTime(i int64) *UserCreate { + uc.mutation.SetUpdateTime(i) + return uc +} + +// SetNillableUpdateTime sets the "update_time" field if the given value is not nil. +func (uc *UserCreate) SetNillableUpdateTime(i *int64) *UserCreate { + if i != nil { + uc.SetUpdateTime(*i) + } + return uc +} + +// SetDeleteTime sets the "delete_time" field. +func (uc *UserCreate) SetDeleteTime(i int64) *UserCreate { + uc.mutation.SetDeleteTime(i) + return uc +} + +// SetNillableDeleteTime sets the "delete_time" field if the given value is not nil. +func (uc *UserCreate) SetNillableDeleteTime(i *int64) *UserCreate { + if i != nil { + uc.SetDeleteTime(*i) + } + return uc +} + +// SetUserName sets the "user_name" field. +func (uc *UserCreate) SetUserName(s string) *UserCreate { + uc.mutation.SetUserName(s) + return uc +} + +// SetNillableUserName sets the "user_name" field if the given value is not nil. +func (uc *UserCreate) SetNillableUserName(s *string) *UserCreate { + if s != nil { + uc.SetUserName(*s) + } + return uc +} + +// SetNickName sets the "nick_name" field. +func (uc *UserCreate) SetNickName(s string) *UserCreate { + uc.mutation.SetNickName(s) + return uc +} + +// SetNillableNickName sets the "nick_name" field if the given value is not nil. +func (uc *UserCreate) SetNillableNickName(s *string) *UserCreate { + if s != nil { + uc.SetNickName(*s) + } + return uc +} + +// SetPassword sets the "password" field. +func (uc *UserCreate) SetPassword(s string) *UserCreate { + uc.mutation.SetPassword(s) + return uc +} + +// SetNillablePassword sets the "password" field if the given value is not nil. +func (uc *UserCreate) SetNillablePassword(s *string) *UserCreate { + if s != nil { + uc.SetPassword(*s) + } + return uc +} + +// SetID sets the "id" field. +func (uc *UserCreate) SetID(u uint32) *UserCreate { + uc.mutation.SetID(u) + return uc +} + +// Mutation returns the UserMutation object of the builder. +func (uc *UserCreate) Mutation() *UserMutation { + return uc.mutation +} + +// Save creates the User in the database. +func (uc *UserCreate) Save(ctx context.Context) (*User, error) { + uc.defaults() + return withHooks(ctx, uc.sqlSave, uc.mutation, uc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (uc *UserCreate) SaveX(ctx context.Context) *User { + v, err := uc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (uc *UserCreate) Exec(ctx context.Context) error { + _, err := uc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (uc *UserCreate) ExecX(ctx context.Context) { + if err := uc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (uc *UserCreate) defaults() { + if _, ok := uc.mutation.CreateTime(); !ok { + v := user.DefaultCreateTime() + uc.mutation.SetCreateTime(v) + } +} + +// check runs all checks and user-defined validators on the builder. +func (uc *UserCreate) check() error { + if v, ok := uc.mutation.UserName(); ok { + if err := user.UserNameValidator(v); err != nil { + return &ValidationError{Name: "user_name", err: fmt.Errorf(`ent: validator failed for field "User.user_name": %w`, err)} + } + } + if v, ok := uc.mutation.NickName(); ok { + if err := user.NickNameValidator(v); err != nil { + return &ValidationError{Name: "nick_name", err: fmt.Errorf(`ent: validator failed for field "User.nick_name": %w`, err)} + } + } + if v, ok := uc.mutation.Password(); ok { + if err := user.PasswordValidator(v); err != nil { + return &ValidationError{Name: "password", err: fmt.Errorf(`ent: validator failed for field "User.password": %w`, err)} + } + } + if v, ok := uc.mutation.ID(); ok { + if err := user.IDValidator(v); err != nil { + return &ValidationError{Name: "id", err: fmt.Errorf(`ent: validator failed for field "User.id": %w`, err)} + } + } + return nil +} + +func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { + if err := uc.check(); err != nil { + return nil, err + } + _node, _spec := uc.createSpec() + if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { + if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + if _spec.ID.Value != _node.ID { + id := _spec.ID.Value.(int64) + _node.ID = uint32(id) + } + uc.mutation.id = &_node.ID + uc.mutation.done = true + return _node, nil +} + +func (uc *UserCreate) createSpec() (*User, *sqlgraph.CreateSpec) { + var ( + _node = &User{config: uc.config} + _spec = sqlgraph.NewCreateSpec(user.Table, sqlgraph.NewFieldSpec(user.FieldID, field.TypeUint32)) + ) + _spec.OnConflict = uc.conflict + if id, ok := uc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := uc.mutation.CreateTime(); ok { + _spec.SetField(user.FieldCreateTime, field.TypeInt64, value) + _node.CreateTime = &value + } + if value, ok := uc.mutation.UpdateTime(); ok { + _spec.SetField(user.FieldUpdateTime, field.TypeInt64, value) + _node.UpdateTime = &value + } + if value, ok := uc.mutation.DeleteTime(); ok { + _spec.SetField(user.FieldDeleteTime, field.TypeInt64, value) + _node.DeleteTime = &value + } + if value, ok := uc.mutation.UserName(); ok { + _spec.SetField(user.FieldUserName, field.TypeString, value) + _node.UserName = &value + } + if value, ok := uc.mutation.NickName(); ok { + _spec.SetField(user.FieldNickName, field.TypeString, value) + _node.NickName = &value + } + if value, ok := uc.mutation.Password(); ok { + _spec.SetField(user.FieldPassword, field.TypeString, value) + _node.Password = &value + } + return _node, _spec +} + +// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause +// of the `INSERT` statement. For example: +// +// client.User.Create(). +// SetCreateTime(v). +// OnConflict( +// // Update the row with the new values +// // the was proposed for insertion. +// sql.ResolveWithNewValues(), +// ). +// // Override some of the fields with custom +// // update values. +// Update(func(u *ent.UserUpsert) { +// SetCreateTime(v+v). +// }). +// Exec(ctx) +func (uc *UserCreate) OnConflict(opts ...sql.ConflictOption) *UserUpsertOne { + uc.conflict = opts + return &UserUpsertOne{ + create: uc, + } +} + +// OnConflictColumns calls `OnConflict` and configures the columns +// as conflict target. Using this option is equivalent to using: +// +// client.User.Create(). +// OnConflict(sql.ConflictColumns(columns...)). +// Exec(ctx) +func (uc *UserCreate) OnConflictColumns(columns ...string) *UserUpsertOne { + uc.conflict = append(uc.conflict, sql.ConflictColumns(columns...)) + return &UserUpsertOne{ + create: uc, + } +} + +type ( + // UserUpsertOne is the builder for "upsert"-ing + // one User node. + UserUpsertOne struct { + create *UserCreate + } + + // UserUpsert is the "OnConflict" setter. + UserUpsert struct { + *sql.UpdateSet + } +) + +// SetUpdateTime sets the "update_time" field. +func (u *UserUpsert) SetUpdateTime(v int64) *UserUpsert { + u.Set(user.FieldUpdateTime, v) + return u +} + +// UpdateUpdateTime sets the "update_time" field to the value that was provided on create. +func (u *UserUpsert) UpdateUpdateTime() *UserUpsert { + u.SetExcluded(user.FieldUpdateTime) + return u +} + +// AddUpdateTime adds v to the "update_time" field. +func (u *UserUpsert) AddUpdateTime(v int64) *UserUpsert { + u.Add(user.FieldUpdateTime, v) + return u +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (u *UserUpsert) ClearUpdateTime() *UserUpsert { + u.SetNull(user.FieldUpdateTime) + return u +} + +// SetDeleteTime sets the "delete_time" field. +func (u *UserUpsert) SetDeleteTime(v int64) *UserUpsert { + u.Set(user.FieldDeleteTime, v) + return u +} + +// UpdateDeleteTime sets the "delete_time" field to the value that was provided on create. +func (u *UserUpsert) UpdateDeleteTime() *UserUpsert { + u.SetExcluded(user.FieldDeleteTime) + return u +} + +// AddDeleteTime adds v to the "delete_time" field. +func (u *UserUpsert) AddDeleteTime(v int64) *UserUpsert { + u.Add(user.FieldDeleteTime, v) + return u +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (u *UserUpsert) ClearDeleteTime() *UserUpsert { + u.SetNull(user.FieldDeleteTime) + return u +} + +// SetNickName sets the "nick_name" field. +func (u *UserUpsert) SetNickName(v string) *UserUpsert { + u.Set(user.FieldNickName, v) + return u +} + +// UpdateNickName sets the "nick_name" field to the value that was provided on create. +func (u *UserUpsert) UpdateNickName() *UserUpsert { + u.SetExcluded(user.FieldNickName) + return u +} + +// ClearNickName clears the value of the "nick_name" field. +func (u *UserUpsert) ClearNickName() *UserUpsert { + u.SetNull(user.FieldNickName) + return u +} + +// SetPassword sets the "password" field. +func (u *UserUpsert) SetPassword(v string) *UserUpsert { + u.Set(user.FieldPassword, v) + return u +} + +// UpdatePassword sets the "password" field to the value that was provided on create. +func (u *UserUpsert) UpdatePassword() *UserUpsert { + u.SetExcluded(user.FieldPassword) + return u +} + +// ClearPassword clears the value of the "password" field. +func (u *UserUpsert) ClearPassword() *UserUpsert { + u.SetNull(user.FieldPassword) + return u +} + +// UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. +// Using this option is equivalent to using: +// +// client.User.Create(). +// OnConflict( +// sql.ResolveWithNewValues(), +// sql.ResolveWith(func(u *sql.UpdateSet) { +// u.SetIgnore(user.FieldID) +// }), +// ). +// Exec(ctx) +func (u *UserUpsertOne) UpdateNewValues() *UserUpsertOne { + u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues()) + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) { + if _, exists := u.create.mutation.ID(); exists { + s.SetIgnore(user.FieldID) + } + if _, exists := u.create.mutation.CreateTime(); exists { + s.SetIgnore(user.FieldCreateTime) + } + if _, exists := u.create.mutation.UserName(); exists { + s.SetIgnore(user.FieldUserName) + } + })) + return u +} + +// Ignore sets each column to itself in case of conflict. +// Using this option is equivalent to using: +// +// client.User.Create(). +// OnConflict(sql.ResolveWithIgnore()). +// Exec(ctx) +func (u *UserUpsertOne) Ignore() *UserUpsertOne { + u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore()) + return u +} + +// DoNothing configures the conflict_action to `DO NOTHING`. +// Supported only by SQLite and PostgreSQL. +func (u *UserUpsertOne) DoNothing() *UserUpsertOne { + u.create.conflict = append(u.create.conflict, sql.DoNothing()) + return u +} + +// Update allows overriding fields `UPDATE` values. See the UserCreate.OnConflict +// documentation for more info. +func (u *UserUpsertOne) Update(set func(*UserUpsert)) *UserUpsertOne { + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) { + set(&UserUpsert{UpdateSet: update}) + })) + return u +} + +// SetUpdateTime sets the "update_time" field. +func (u *UserUpsertOne) SetUpdateTime(v int64) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.SetUpdateTime(v) + }) +} + +// AddUpdateTime adds v to the "update_time" field. +func (u *UserUpsertOne) AddUpdateTime(v int64) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.AddUpdateTime(v) + }) +} + +// UpdateUpdateTime sets the "update_time" field to the value that was provided on create. +func (u *UserUpsertOne) UpdateUpdateTime() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.UpdateUpdateTime() + }) +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (u *UserUpsertOne) ClearUpdateTime() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.ClearUpdateTime() + }) +} + +// SetDeleteTime sets the "delete_time" field. +func (u *UserUpsertOne) SetDeleteTime(v int64) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.SetDeleteTime(v) + }) +} + +// AddDeleteTime adds v to the "delete_time" field. +func (u *UserUpsertOne) AddDeleteTime(v int64) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.AddDeleteTime(v) + }) +} + +// UpdateDeleteTime sets the "delete_time" field to the value that was provided on create. +func (u *UserUpsertOne) UpdateDeleteTime() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.UpdateDeleteTime() + }) +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (u *UserUpsertOne) ClearDeleteTime() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.ClearDeleteTime() + }) +} + +// SetNickName sets the "nick_name" field. +func (u *UserUpsertOne) SetNickName(v string) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.SetNickName(v) + }) +} + +// UpdateNickName sets the "nick_name" field to the value that was provided on create. +func (u *UserUpsertOne) UpdateNickName() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.UpdateNickName() + }) +} + +// ClearNickName clears the value of the "nick_name" field. +func (u *UserUpsertOne) ClearNickName() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.ClearNickName() + }) +} + +// SetPassword sets the "password" field. +func (u *UserUpsertOne) SetPassword(v string) *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.SetPassword(v) + }) +} + +// UpdatePassword sets the "password" field to the value that was provided on create. +func (u *UserUpsertOne) UpdatePassword() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.UpdatePassword() + }) +} + +// ClearPassword clears the value of the "password" field. +func (u *UserUpsertOne) ClearPassword() *UserUpsertOne { + return u.Update(func(s *UserUpsert) { + s.ClearPassword() + }) +} + +// Exec executes the query. +func (u *UserUpsertOne) Exec(ctx context.Context) error { + if len(u.create.conflict) == 0 { + return errors.New("ent: missing options for UserCreate.OnConflict") + } + return u.create.Exec(ctx) +} + +// ExecX is like Exec, but panics if an error occurs. +func (u *UserUpsertOne) ExecX(ctx context.Context) { + if err := u.create.Exec(ctx); err != nil { + panic(err) + } +} + +// Exec executes the UPSERT query and returns the inserted/updated ID. +func (u *UserUpsertOne) ID(ctx context.Context) (id uint32, err error) { + node, err := u.create.Save(ctx) + if err != nil { + return id, err + } + return node.ID, nil +} + +// IDX is like ID, but panics if an error occurs. +func (u *UserUpsertOne) IDX(ctx context.Context) uint32 { + id, err := u.ID(ctx) + if err != nil { + panic(err) + } + return id +} + +// UserCreateBulk is the builder for creating many User entities in bulk. +type UserCreateBulk struct { + config + builders []*UserCreate + conflict []sql.ConflictOption +} + +// Save creates the User entities in the database. +func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { + specs := make([]*sqlgraph.CreateSpec, len(ucb.builders)) + nodes := make([]*User, len(ucb.builders)) + mutators := make([]Mutator, len(ucb.builders)) + for i := range ucb.builders { + func(i int, root context.Context) { + builder := ucb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*UserMutation) + if !ok { + return nil, fmt.Errorf("unexpected mutation type %T", m) + } + if err := builder.check(); err != nil { + return nil, err + } + builder.mutation = mutation + var err error + nodes[i], specs[i] = builder.createSpec() + if i < len(mutators)-1 { + _, err = mutators[i+1].Mutate(root, ucb.builders[i+1].mutation) + } else { + spec := &sqlgraph.BatchCreateSpec{Nodes: specs} + spec.OnConflict = ucb.conflict + // Invoke the actual operation on the latest mutation in the chain. + if err = sqlgraph.BatchCreate(ctx, ucb.driver, spec); err != nil { + if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + } + } + if err != nil { + return nil, err + } + mutation.id = &nodes[i].ID + if specs[i].ID.Value != nil && nodes[i].ID == 0 { + id := specs[i].ID.Value.(int64) + nodes[i].ID = uint32(id) + } + mutation.done = true + return nodes[i], nil + }) + for i := len(builder.hooks) - 1; i >= 0; i-- { + mut = builder.hooks[i](mut) + } + mutators[i] = mut + }(i, ctx) + } + if len(mutators) > 0 { + if _, err := mutators[0].Mutate(ctx, ucb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User { + v, err := ucb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ucb *UserCreateBulk) Exec(ctx context.Context) error { + _, err := ucb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ucb *UserCreateBulk) ExecX(ctx context.Context) { + if err := ucb.Exec(ctx); err != nil { + panic(err) + } +} + +// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause +// of the `INSERT` statement. For example: +// +// client.User.CreateBulk(builders...). +// OnConflict( +// // Update the row with the new values +// // the was proposed for insertion. +// sql.ResolveWithNewValues(), +// ). +// // Override some of the fields with custom +// // update values. +// Update(func(u *ent.UserUpsert) { +// SetCreateTime(v+v). +// }). +// Exec(ctx) +func (ucb *UserCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserUpsertBulk { + ucb.conflict = opts + return &UserUpsertBulk{ + create: ucb, + } +} + +// OnConflictColumns calls `OnConflict` and configures the columns +// as conflict target. Using this option is equivalent to using: +// +// client.User.Create(). +// OnConflict(sql.ConflictColumns(columns...)). +// Exec(ctx) +func (ucb *UserCreateBulk) OnConflictColumns(columns ...string) *UserUpsertBulk { + ucb.conflict = append(ucb.conflict, sql.ConflictColumns(columns...)) + return &UserUpsertBulk{ + create: ucb, + } +} + +// UserUpsertBulk is the builder for "upsert"-ing +// a bulk of User nodes. +type UserUpsertBulk struct { + create *UserCreateBulk +} + +// UpdateNewValues updates the mutable fields using the new values that +// were set on create. Using this option is equivalent to using: +// +// client.User.Create(). +// OnConflict( +// sql.ResolveWithNewValues(), +// sql.ResolveWith(func(u *sql.UpdateSet) { +// u.SetIgnore(user.FieldID) +// }), +// ). +// Exec(ctx) +func (u *UserUpsertBulk) UpdateNewValues() *UserUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues()) + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) { + for _, b := range u.create.builders { + if _, exists := b.mutation.ID(); exists { + s.SetIgnore(user.FieldID) + } + if _, exists := b.mutation.CreateTime(); exists { + s.SetIgnore(user.FieldCreateTime) + } + if _, exists := b.mutation.UserName(); exists { + s.SetIgnore(user.FieldUserName) + } + } + })) + return u +} + +// Ignore sets each column to itself in case of conflict. +// Using this option is equivalent to using: +// +// client.User.Create(). +// OnConflict(sql.ResolveWithIgnore()). +// Exec(ctx) +func (u *UserUpsertBulk) Ignore() *UserUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore()) + return u +} + +// DoNothing configures the conflict_action to `DO NOTHING`. +// Supported only by SQLite and PostgreSQL. +func (u *UserUpsertBulk) DoNothing() *UserUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.DoNothing()) + return u +} + +// Update allows overriding fields `UPDATE` values. See the UserCreateBulk.OnConflict +// documentation for more info. +func (u *UserUpsertBulk) Update(set func(*UserUpsert)) *UserUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) { + set(&UserUpsert{UpdateSet: update}) + })) + return u +} + +// SetUpdateTime sets the "update_time" field. +func (u *UserUpsertBulk) SetUpdateTime(v int64) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.SetUpdateTime(v) + }) +} + +// AddUpdateTime adds v to the "update_time" field. +func (u *UserUpsertBulk) AddUpdateTime(v int64) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.AddUpdateTime(v) + }) +} + +// UpdateUpdateTime sets the "update_time" field to the value that was provided on create. +func (u *UserUpsertBulk) UpdateUpdateTime() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.UpdateUpdateTime() + }) +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (u *UserUpsertBulk) ClearUpdateTime() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.ClearUpdateTime() + }) +} + +// SetDeleteTime sets the "delete_time" field. +func (u *UserUpsertBulk) SetDeleteTime(v int64) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.SetDeleteTime(v) + }) +} + +// AddDeleteTime adds v to the "delete_time" field. +func (u *UserUpsertBulk) AddDeleteTime(v int64) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.AddDeleteTime(v) + }) +} + +// UpdateDeleteTime sets the "delete_time" field to the value that was provided on create. +func (u *UserUpsertBulk) UpdateDeleteTime() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.UpdateDeleteTime() + }) +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (u *UserUpsertBulk) ClearDeleteTime() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.ClearDeleteTime() + }) +} + +// SetNickName sets the "nick_name" field. +func (u *UserUpsertBulk) SetNickName(v string) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.SetNickName(v) + }) +} + +// UpdateNickName sets the "nick_name" field to the value that was provided on create. +func (u *UserUpsertBulk) UpdateNickName() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.UpdateNickName() + }) +} + +// ClearNickName clears the value of the "nick_name" field. +func (u *UserUpsertBulk) ClearNickName() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.ClearNickName() + }) +} + +// SetPassword sets the "password" field. +func (u *UserUpsertBulk) SetPassword(v string) *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.SetPassword(v) + }) +} + +// UpdatePassword sets the "password" field to the value that was provided on create. +func (u *UserUpsertBulk) UpdatePassword() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.UpdatePassword() + }) +} + +// ClearPassword clears the value of the "password" field. +func (u *UserUpsertBulk) ClearPassword() *UserUpsertBulk { + return u.Update(func(s *UserUpsert) { + s.ClearPassword() + }) +} + +// Exec executes the query. +func (u *UserUpsertBulk) Exec(ctx context.Context) error { + for i, b := range u.create.builders { + if len(b.conflict) != 0 { + return fmt.Errorf("ent: OnConflict was set for builder %d. Set it on the UserCreateBulk instead", i) + } + } + if len(u.create.conflict) == 0 { + return errors.New("ent: missing options for UserCreateBulk.OnConflict") + } + return u.create.Exec(ctx) +} + +// ExecX is like Exec, but panics if an error occurs. +func (u *UserUpsertBulk) ExecX(ctx context.Context) { + if err := u.create.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/orm/ent/app/user/service/internal/data/ent/user_delete.go b/orm/ent/app/user/service/internal/data/ent/user_delete.go new file mode 100644 index 0000000..7804395 --- /dev/null +++ b/orm/ent/app/user/service/internal/data/ent/user_delete.go @@ -0,0 +1,88 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "kratos-ent-example/app/user/service/internal/data/ent/predicate" + "kratos-ent-example/app/user/service/internal/data/ent/user" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// UserDelete is the builder for deleting a User entity. +type UserDelete struct { + config + hooks []Hook + mutation *UserMutation +} + +// Where appends a list predicates to the UserDelete builder. +func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete { + ud.mutation.Where(ps...) + return ud +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (ud *UserDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, ud.sqlExec, ud.mutation, ud.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (ud *UserDelete) ExecX(ctx context.Context) int { + n, err := ud.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (ud *UserDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(user.Table, sqlgraph.NewFieldSpec(user.FieldID, field.TypeUint32)) + if ps := ud.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, ud.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + ud.mutation.done = true + return affected, err +} + +// UserDeleteOne is the builder for deleting a single User entity. +type UserDeleteOne struct { + ud *UserDelete +} + +// Where appends a list predicates to the UserDelete builder. +func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne { + udo.ud.mutation.Where(ps...) + return udo +} + +// Exec executes the deletion query. +func (udo *UserDeleteOne) Exec(ctx context.Context) error { + n, err := udo.ud.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{user.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (udo *UserDeleteOne) ExecX(ctx context.Context) { + if err := udo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/orm/ent/app/user/service/internal/data/ent/user_query.go b/orm/ent/app/user/service/internal/data/ent/user_query.go new file mode 100644 index 0000000..a2b1e7e --- /dev/null +++ b/orm/ent/app/user/service/internal/data/ent/user_query.go @@ -0,0 +1,548 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "fmt" + "kratos-ent-example/app/user/service/internal/data/ent/predicate" + "kratos-ent-example/app/user/service/internal/data/ent/user" + "math" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// UserQuery is the builder for querying User entities. +type UserQuery struct { + config + ctx *QueryContext + order []user.OrderOption + inters []Interceptor + predicates []predicate.User + modifiers []func(*sql.Selector) + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the UserQuery builder. +func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery { + uq.predicates = append(uq.predicates, ps...) + return uq +} + +// Limit the number of records to be returned by this query. +func (uq *UserQuery) Limit(limit int) *UserQuery { + uq.ctx.Limit = &limit + return uq +} + +// Offset to start from. +func (uq *UserQuery) Offset(offset int) *UserQuery { + uq.ctx.Offset = &offset + return uq +} + +// Unique configures the query builder to filter duplicate records on query. +// By default, unique is set to true, and can be disabled using this method. +func (uq *UserQuery) Unique(unique bool) *UserQuery { + uq.ctx.Unique = &unique + return uq +} + +// Order specifies how the records should be ordered. +func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery { + uq.order = append(uq.order, o...) + return uq +} + +// First returns the first User entity from the query. +// Returns a *NotFoundError when no User was found. +func (uq *UserQuery) First(ctx context.Context) (*User, error) { + nodes, err := uq.Limit(1).All(setContextOp(ctx, uq.ctx, "First")) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{user.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (uq *UserQuery) FirstX(ctx context.Context) *User { + node, err := uq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first User ID from the query. +// Returns a *NotFoundError when no User ID was found. +func (uq *UserQuery) FirstID(ctx context.Context) (id uint32, err error) { + var ids []uint32 + if ids, err = uq.Limit(1).IDs(setContextOp(ctx, uq.ctx, "FirstID")); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{user.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (uq *UserQuery) FirstIDX(ctx context.Context) uint32 { + id, err := uq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single User entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one User entity is found. +// Returns a *NotFoundError when no User entities are found. +func (uq *UserQuery) Only(ctx context.Context) (*User, error) { + nodes, err := uq.Limit(2).All(setContextOp(ctx, uq.ctx, "Only")) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{user.Label} + default: + return nil, &NotSingularError{user.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (uq *UserQuery) OnlyX(ctx context.Context) *User { + node, err := uq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only User ID in the query. +// Returns a *NotSingularError when more than one User ID is found. +// Returns a *NotFoundError when no entities are found. +func (uq *UserQuery) OnlyID(ctx context.Context) (id uint32, err error) { + var ids []uint32 + if ids, err = uq.Limit(2).IDs(setContextOp(ctx, uq.ctx, "OnlyID")); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{user.Label} + default: + err = &NotSingularError{user.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (uq *UserQuery) OnlyIDX(ctx context.Context) uint32 { + id, err := uq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of Users. +func (uq *UserQuery) All(ctx context.Context) ([]*User, error) { + ctx = setContextOp(ctx, uq.ctx, "All") + if err := uq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*User, *UserQuery]() + return withInterceptors[[]*User](ctx, uq, qr, uq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (uq *UserQuery) AllX(ctx context.Context) []*User { + nodes, err := uq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of User IDs. +func (uq *UserQuery) IDs(ctx context.Context) (ids []uint32, err error) { + if uq.ctx.Unique == nil && uq.path != nil { + uq.Unique(true) + } + ctx = setContextOp(ctx, uq.ctx, "IDs") + if err = uq.Select(user.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (uq *UserQuery) IDsX(ctx context.Context) []uint32 { + ids, err := uq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (uq *UserQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, uq.ctx, "Count") + if err := uq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, uq, querierCount[*UserQuery](), uq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (uq *UserQuery) CountX(ctx context.Context) int { + count, err := uq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (uq *UserQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, uq.ctx, "Exist") + switch _, err := uq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("ent: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (uq *UserQuery) ExistX(ctx context.Context) bool { + exist, err := uq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (uq *UserQuery) Clone() *UserQuery { + if uq == nil { + return nil + } + return &UserQuery{ + config: uq.config, + ctx: uq.ctx.Clone(), + order: append([]user.OrderOption{}, uq.order...), + inters: append([]Interceptor{}, uq.inters...), + predicates: append([]predicate.User{}, uq.predicates...), + // clone intermediate query. + sql: uq.sql.Clone(), + path: uq.path, + } +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreateTime int64 `json:"create_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.User.Query(). +// GroupBy(user.FieldCreateTime). +// Aggregate(ent.Count()). +// Scan(ctx, &v) +func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy { + uq.ctx.Fields = append([]string{field}, fields...) + grbuild := &UserGroupBy{build: uq} + grbuild.flds = &uq.ctx.Fields + grbuild.label = user.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreateTime int64 `json:"create_time,omitempty"` +// } +// +// client.User.Query(). +// Select(user.FieldCreateTime). +// Scan(ctx, &v) +func (uq *UserQuery) Select(fields ...string) *UserSelect { + uq.ctx.Fields = append(uq.ctx.Fields, fields...) + sbuild := &UserSelect{UserQuery: uq} + sbuild.label = user.Label + sbuild.flds, sbuild.scan = &uq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a UserSelect configured with the given aggregations. +func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect { + return uq.Select().Aggregate(fns...) +} + +func (uq *UserQuery) prepareQuery(ctx context.Context) error { + for _, inter := range uq.inters { + if inter == nil { + return fmt.Errorf("ent: uninitialized interceptor (forgotten import ent/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, uq); err != nil { + return err + } + } + } + for _, f := range uq.ctx.Fields { + if !user.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)} + } + } + if uq.path != nil { + prev, err := uq.path(ctx) + if err != nil { + return err + } + uq.sql = prev + } + return nil +} + +func (uq *UserQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*User, error) { + var ( + nodes = []*User{} + _spec = uq.querySpec() + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*User).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &User{config: uq.config} + nodes = append(nodes, node) + return node.assignValues(columns, values) + } + if len(uq.modifiers) > 0 { + _spec.Modifiers = uq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, uq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + return nodes, nil +} + +func (uq *UserQuery) sqlCount(ctx context.Context) (int, error) { + _spec := uq.querySpec() + if len(uq.modifiers) > 0 { + _spec.Modifiers = uq.modifiers + } + _spec.Node.Columns = uq.ctx.Fields + if len(uq.ctx.Fields) > 0 { + _spec.Unique = uq.ctx.Unique != nil && *uq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, uq.driver, _spec) +} + +func (uq *UserQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(user.Table, user.Columns, sqlgraph.NewFieldSpec(user.FieldID, field.TypeUint32)) + _spec.From = uq.sql + if unique := uq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if uq.path != nil { + _spec.Unique = true + } + if fields := uq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, user.FieldID) + for i := range fields { + if fields[i] != user.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := uq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := uq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := uq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := uq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (uq *UserQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(uq.driver.Dialect()) + t1 := builder.Table(user.Table) + columns := uq.ctx.Fields + if len(columns) == 0 { + columns = user.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if uq.sql != nil { + selector = uq.sql + selector.Select(selector.Columns(columns...)...) + } + if uq.ctx.Unique != nil && *uq.ctx.Unique { + selector.Distinct() + } + for _, m := range uq.modifiers { + m(selector) + } + for _, p := range uq.predicates { + p(selector) + } + for _, p := range uq.order { + p(selector) + } + if offset := uq.ctx.Offset; offset != nil { + // limit is mandatory for offset clause. We start + // with default value, and override it below if needed. + selector.Offset(*offset).Limit(math.MaxInt32) + } + if limit := uq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// Modify adds a query modifier for attaching custom logic to queries. +func (uq *UserQuery) Modify(modifiers ...func(s *sql.Selector)) *UserSelect { + uq.modifiers = append(uq.modifiers, modifiers...) + return uq.Select() +} + +// UserGroupBy is the group-by builder for User entities. +type UserGroupBy struct { + selector + build *UserQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy { + ugb.fns = append(ugb.fns, fns...) + return ugb +} + +// Scan applies the selector query and scans the result into the given value. +func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ugb.build.ctx, "GroupBy") + if err := ugb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*UserQuery, *UserGroupBy](ctx, ugb.build, ugb, ugb.build.inters, v) +} + +func (ugb *UserGroupBy) sqlScan(ctx context.Context, root *UserQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(ugb.fns)) + for _, fn := range ugb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*ugb.flds)+len(ugb.fns)) + for _, f := range *ugb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*ugb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := ugb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// UserSelect is the builder for selecting fields of User entities. +type UserSelect struct { + *UserQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect { + us.fns = append(us.fns, fns...) + return us +} + +// Scan applies the selector query and scans the result into the given value. +func (us *UserSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, us.ctx, "Select") + if err := us.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*UserQuery, *UserSelect](ctx, us.UserQuery, us, us.inters, v) +} + +func (us *UserSelect) sqlScan(ctx context.Context, root *UserQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(us.fns)) + for _, fn := range us.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*us.selector.flds); { + case n == 0 && len(aggregation) > 0: + selector.Select(aggregation...) + case n != 0 && len(aggregation) > 0: + selector.AppendSelect(aggregation...) + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := us.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// Modify adds a query modifier for attaching custom logic to queries. +func (us *UserSelect) Modify(modifiers ...func(s *sql.Selector)) *UserSelect { + us.modifiers = append(us.modifiers, modifiers...) + return us +} diff --git a/orm/ent/app/user/service/internal/data/ent/user_update.go b/orm/ent/app/user/service/internal/data/ent/user_update.go new file mode 100644 index 0000000..b649631 --- /dev/null +++ b/orm/ent/app/user/service/internal/data/ent/user_update.go @@ -0,0 +1,489 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "errors" + "fmt" + "kratos-ent-example/app/user/service/internal/data/ent/predicate" + "kratos-ent-example/app/user/service/internal/data/ent/user" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// UserUpdate is the builder for updating User entities. +type UserUpdate struct { + config + hooks []Hook + mutation *UserMutation + modifiers []func(*sql.UpdateBuilder) +} + +// Where appends a list predicates to the UserUpdate builder. +func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate { + uu.mutation.Where(ps...) + return uu +} + +// SetUpdateTime sets the "update_time" field. +func (uu *UserUpdate) SetUpdateTime(i int64) *UserUpdate { + uu.mutation.ResetUpdateTime() + uu.mutation.SetUpdateTime(i) + return uu +} + +// AddUpdateTime adds i to the "update_time" field. +func (uu *UserUpdate) AddUpdateTime(i int64) *UserUpdate { + uu.mutation.AddUpdateTime(i) + return uu +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (uu *UserUpdate) ClearUpdateTime() *UserUpdate { + uu.mutation.ClearUpdateTime() + return uu +} + +// SetDeleteTime sets the "delete_time" field. +func (uu *UserUpdate) SetDeleteTime(i int64) *UserUpdate { + uu.mutation.ResetDeleteTime() + uu.mutation.SetDeleteTime(i) + return uu +} + +// SetNillableDeleteTime sets the "delete_time" field if the given value is not nil. +func (uu *UserUpdate) SetNillableDeleteTime(i *int64) *UserUpdate { + if i != nil { + uu.SetDeleteTime(*i) + } + return uu +} + +// AddDeleteTime adds i to the "delete_time" field. +func (uu *UserUpdate) AddDeleteTime(i int64) *UserUpdate { + uu.mutation.AddDeleteTime(i) + return uu +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (uu *UserUpdate) ClearDeleteTime() *UserUpdate { + uu.mutation.ClearDeleteTime() + return uu +} + +// SetNickName sets the "nick_name" field. +func (uu *UserUpdate) SetNickName(s string) *UserUpdate { + uu.mutation.SetNickName(s) + return uu +} + +// SetNillableNickName sets the "nick_name" field if the given value is not nil. +func (uu *UserUpdate) SetNillableNickName(s *string) *UserUpdate { + if s != nil { + uu.SetNickName(*s) + } + return uu +} + +// ClearNickName clears the value of the "nick_name" field. +func (uu *UserUpdate) ClearNickName() *UserUpdate { + uu.mutation.ClearNickName() + return uu +} + +// SetPassword sets the "password" field. +func (uu *UserUpdate) SetPassword(s string) *UserUpdate { + uu.mutation.SetPassword(s) + return uu +} + +// SetNillablePassword sets the "password" field if the given value is not nil. +func (uu *UserUpdate) SetNillablePassword(s *string) *UserUpdate { + if s != nil { + uu.SetPassword(*s) + } + return uu +} + +// ClearPassword clears the value of the "password" field. +func (uu *UserUpdate) ClearPassword() *UserUpdate { + uu.mutation.ClearPassword() + return uu +} + +// Mutation returns the UserMutation object of the builder. +func (uu *UserUpdate) Mutation() *UserMutation { + return uu.mutation +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (uu *UserUpdate) Save(ctx context.Context) (int, error) { + uu.defaults() + return withHooks(ctx, uu.sqlSave, uu.mutation, uu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (uu *UserUpdate) SaveX(ctx context.Context) int { + affected, err := uu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (uu *UserUpdate) Exec(ctx context.Context) error { + _, err := uu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (uu *UserUpdate) ExecX(ctx context.Context) { + if err := uu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (uu *UserUpdate) defaults() { + if _, ok := uu.mutation.UpdateTime(); !ok && !uu.mutation.UpdateTimeCleared() { + v := user.UpdateDefaultUpdateTime() + uu.mutation.SetUpdateTime(v) + } +} + +// check runs all checks and user-defined validators on the builder. +func (uu *UserUpdate) check() error { + if v, ok := uu.mutation.NickName(); ok { + if err := user.NickNameValidator(v); err != nil { + return &ValidationError{Name: "nick_name", err: fmt.Errorf(`ent: validator failed for field "User.nick_name": %w`, err)} + } + } + if v, ok := uu.mutation.Password(); ok { + if err := user.PasswordValidator(v); err != nil { + return &ValidationError{Name: "password", err: fmt.Errorf(`ent: validator failed for field "User.password": %w`, err)} + } + } + return nil +} + +// Modify adds a statement modifier for attaching custom logic to the UPDATE statement. +func (uu *UserUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *UserUpdate { + uu.modifiers = append(uu.modifiers, modifiers...) + return uu +} + +func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := uu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(user.Table, user.Columns, sqlgraph.NewFieldSpec(user.FieldID, field.TypeUint32)) + if ps := uu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if uu.mutation.CreateTimeCleared() { + _spec.ClearField(user.FieldCreateTime, field.TypeInt64) + } + if value, ok := uu.mutation.UpdateTime(); ok { + _spec.SetField(user.FieldUpdateTime, field.TypeInt64, value) + } + if value, ok := uu.mutation.AddedUpdateTime(); ok { + _spec.AddField(user.FieldUpdateTime, field.TypeInt64, value) + } + if uu.mutation.UpdateTimeCleared() { + _spec.ClearField(user.FieldUpdateTime, field.TypeInt64) + } + if value, ok := uu.mutation.DeleteTime(); ok { + _spec.SetField(user.FieldDeleteTime, field.TypeInt64, value) + } + if value, ok := uu.mutation.AddedDeleteTime(); ok { + _spec.AddField(user.FieldDeleteTime, field.TypeInt64, value) + } + if uu.mutation.DeleteTimeCleared() { + _spec.ClearField(user.FieldDeleteTime, field.TypeInt64) + } + if uu.mutation.UserNameCleared() { + _spec.ClearField(user.FieldUserName, field.TypeString) + } + if value, ok := uu.mutation.NickName(); ok { + _spec.SetField(user.FieldNickName, field.TypeString, value) + } + if uu.mutation.NickNameCleared() { + _spec.ClearField(user.FieldNickName, field.TypeString) + } + if value, ok := uu.mutation.Password(); ok { + _spec.SetField(user.FieldPassword, field.TypeString, value) + } + if uu.mutation.PasswordCleared() { + _spec.ClearField(user.FieldPassword, field.TypeString) + } + _spec.AddModifiers(uu.modifiers...) + if n, err = sqlgraph.UpdateNodes(ctx, uu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{user.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + uu.mutation.done = true + return n, nil +} + +// UserUpdateOne is the builder for updating a single User entity. +type UserUpdateOne struct { + config + fields []string + hooks []Hook + mutation *UserMutation + modifiers []func(*sql.UpdateBuilder) +} + +// SetUpdateTime sets the "update_time" field. +func (uuo *UserUpdateOne) SetUpdateTime(i int64) *UserUpdateOne { + uuo.mutation.ResetUpdateTime() + uuo.mutation.SetUpdateTime(i) + return uuo +} + +// AddUpdateTime adds i to the "update_time" field. +func (uuo *UserUpdateOne) AddUpdateTime(i int64) *UserUpdateOne { + uuo.mutation.AddUpdateTime(i) + return uuo +} + +// ClearUpdateTime clears the value of the "update_time" field. +func (uuo *UserUpdateOne) ClearUpdateTime() *UserUpdateOne { + uuo.mutation.ClearUpdateTime() + return uuo +} + +// SetDeleteTime sets the "delete_time" field. +func (uuo *UserUpdateOne) SetDeleteTime(i int64) *UserUpdateOne { + uuo.mutation.ResetDeleteTime() + uuo.mutation.SetDeleteTime(i) + return uuo +} + +// SetNillableDeleteTime sets the "delete_time" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableDeleteTime(i *int64) *UserUpdateOne { + if i != nil { + uuo.SetDeleteTime(*i) + } + return uuo +} + +// AddDeleteTime adds i to the "delete_time" field. +func (uuo *UserUpdateOne) AddDeleteTime(i int64) *UserUpdateOne { + uuo.mutation.AddDeleteTime(i) + return uuo +} + +// ClearDeleteTime clears the value of the "delete_time" field. +func (uuo *UserUpdateOne) ClearDeleteTime() *UserUpdateOne { + uuo.mutation.ClearDeleteTime() + return uuo +} + +// SetNickName sets the "nick_name" field. +func (uuo *UserUpdateOne) SetNickName(s string) *UserUpdateOne { + uuo.mutation.SetNickName(s) + return uuo +} + +// SetNillableNickName sets the "nick_name" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableNickName(s *string) *UserUpdateOne { + if s != nil { + uuo.SetNickName(*s) + } + return uuo +} + +// ClearNickName clears the value of the "nick_name" field. +func (uuo *UserUpdateOne) ClearNickName() *UserUpdateOne { + uuo.mutation.ClearNickName() + return uuo +} + +// SetPassword sets the "password" field. +func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne { + uuo.mutation.SetPassword(s) + return uuo +} + +// SetNillablePassword sets the "password" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillablePassword(s *string) *UserUpdateOne { + if s != nil { + uuo.SetPassword(*s) + } + return uuo +} + +// ClearPassword clears the value of the "password" field. +func (uuo *UserUpdateOne) ClearPassword() *UserUpdateOne { + uuo.mutation.ClearPassword() + return uuo +} + +// Mutation returns the UserMutation object of the builder. +func (uuo *UserUpdateOne) Mutation() *UserMutation { + return uuo.mutation +} + +// Where appends a list predicates to the UserUpdate builder. +func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne { + uuo.mutation.Where(ps...) + return uuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne { + uuo.fields = append([]string{field}, fields...) + return uuo +} + +// Save executes the query and returns the updated User entity. +func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error) { + uuo.defaults() + return withHooks(ctx, uuo.sqlSave, uuo.mutation, uuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User { + node, err := uuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (uuo *UserUpdateOne) Exec(ctx context.Context) error { + _, err := uuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (uuo *UserUpdateOne) ExecX(ctx context.Context) { + if err := uuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (uuo *UserUpdateOne) defaults() { + if _, ok := uuo.mutation.UpdateTime(); !ok && !uuo.mutation.UpdateTimeCleared() { + v := user.UpdateDefaultUpdateTime() + uuo.mutation.SetUpdateTime(v) + } +} + +// check runs all checks and user-defined validators on the builder. +func (uuo *UserUpdateOne) check() error { + if v, ok := uuo.mutation.NickName(); ok { + if err := user.NickNameValidator(v); err != nil { + return &ValidationError{Name: "nick_name", err: fmt.Errorf(`ent: validator failed for field "User.nick_name": %w`, err)} + } + } + if v, ok := uuo.mutation.Password(); ok { + if err := user.PasswordValidator(v); err != nil { + return &ValidationError{Name: "password", err: fmt.Errorf(`ent: validator failed for field "User.password": %w`, err)} + } + } + return nil +} + +// Modify adds a statement modifier for attaching custom logic to the UPDATE statement. +func (uuo *UserUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *UserUpdateOne { + uuo.modifiers = append(uuo.modifiers, modifiers...) + return uuo +} + +func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) { + if err := uuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(user.Table, user.Columns, sqlgraph.NewFieldSpec(user.FieldID, field.TypeUint32)) + id, ok := uuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`ent: missing "User.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := uuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, user.FieldID) + for _, f := range fields { + if !user.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)} + } + if f != user.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := uuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if uuo.mutation.CreateTimeCleared() { + _spec.ClearField(user.FieldCreateTime, field.TypeInt64) + } + if value, ok := uuo.mutation.UpdateTime(); ok { + _spec.SetField(user.FieldUpdateTime, field.TypeInt64, value) + } + if value, ok := uuo.mutation.AddedUpdateTime(); ok { + _spec.AddField(user.FieldUpdateTime, field.TypeInt64, value) + } + if uuo.mutation.UpdateTimeCleared() { + _spec.ClearField(user.FieldUpdateTime, field.TypeInt64) + } + if value, ok := uuo.mutation.DeleteTime(); ok { + _spec.SetField(user.FieldDeleteTime, field.TypeInt64, value) + } + if value, ok := uuo.mutation.AddedDeleteTime(); ok { + _spec.AddField(user.FieldDeleteTime, field.TypeInt64, value) + } + if uuo.mutation.DeleteTimeCleared() { + _spec.ClearField(user.FieldDeleteTime, field.TypeInt64) + } + if uuo.mutation.UserNameCleared() { + _spec.ClearField(user.FieldUserName, field.TypeString) + } + if value, ok := uuo.mutation.NickName(); ok { + _spec.SetField(user.FieldNickName, field.TypeString, value) + } + if uuo.mutation.NickNameCleared() { + _spec.ClearField(user.FieldNickName, field.TypeString) + } + if value, ok := uuo.mutation.Password(); ok { + _spec.SetField(user.FieldPassword, field.TypeString, value) + } + if uuo.mutation.PasswordCleared() { + _spec.ClearField(user.FieldPassword, field.TypeString) + } + _spec.AddModifiers(uuo.modifiers...) + _node = &User{config: uuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, uuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{user.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + uuo.mutation.done = true + return _node, nil +} diff --git a/orm/ent/app/user/service/internal/data/ent_client.go b/orm/ent/app/user/service/internal/data/ent_client.go new file mode 100644 index 0000000..87a6352 --- /dev/null +++ b/orm/ent/app/user/service/internal/data/ent_client.go @@ -0,0 +1,43 @@ +package data + +import ( + "context" + + "github.com/go-kratos/kratos/v2/log" + "github.com/tx7do/kratos-utils/entgo" + + _ "github.com/go-sql-driver/mysql" + _ "github.com/jackc/pgx/v4/stdlib" + _ "github.com/lib/pq" + + "kratos-ent-example/app/user/service/internal/data/ent" + "kratos-ent-example/app/user/service/internal/data/ent/migrate" + + "kratos-ent-example/gen/api/go/common/conf" +) + +// NewEntClient 创建Ent ORM数据库客户端 +func NewEntClient(cfg *conf.Bootstrap, logger log.Logger) *entgo.EntClient[*ent.Client] { + l := log.NewHelper(log.With(logger, "module", "ent/data/user-service")) + + drv, err := entgo.CreateDriver(cfg.Data.Database.Driver, cfg.Data.Database.Source, + int(cfg.Data.Database.MaxIdleConnections), int(cfg.Data.Database.MaxOpenConnections), cfg.Data.Database.ConnectionMaxLifetime.AsDuration()) + if err != nil { + l.Fatal(err.Error()) + return nil + } + + client := ent.NewClient(ent.Driver(drv)) + if client == nil { + l.Fatalf("failed opening connection to db: %v", err) + } + + // 运行数据库迁移工具 + if cfg.Data.Database.Migrate { + if err = client.Schema.Create(context.Background(), migrate.WithForeignKeys(true)); err != nil { + l.Fatalf("failed creating schema resources: %v", err) + } + } + + return entgo.NewEntClient(client, drv) +} diff --git a/orm/ent/app/user/service/internal/data/init.go b/orm/ent/app/user/service/internal/data/init.go new file mode 100644 index 0000000..f236066 --- /dev/null +++ b/orm/ent/app/user/service/internal/data/init.go @@ -0,0 +1,13 @@ +package data + +import "github.com/google/wire" + +// ProviderSet is data providers. +var ProviderSet = wire.NewSet( + NewData, + + NewEntClient, + NewRedisClient, + + NewUserRepo, +) diff --git a/orm/ent/app/user/service/internal/data/user.go b/orm/ent/app/user/service/internal/data/user.go new file mode 100644 index 0000000..fc81d63 --- /dev/null +++ b/orm/ent/app/user/service/internal/data/user.go @@ -0,0 +1,150 @@ +package data + +import ( + "context" + "time" + + "entgo.io/ent/dialect/sql" + "github.com/go-kratos/kratos/v2/log" + "github.com/tx7do/kratos-utils/crypto" + entgo "github.com/tx7do/kratos-utils/entgo/query" + util "github.com/tx7do/kratos-utils/time" + + "kratos-ent-example/app/user/service/internal/biz" + "kratos-ent-example/app/user/service/internal/data/ent" + "kratos-ent-example/app/user/service/internal/data/ent/user" + + "kratos-ent-example/gen/api/go/common/pagination" + v1 "kratos-ent-example/gen/api/go/user/service/v1" +) + +var _ biz.UserRepo = (*UserRepo)(nil) + +type UserRepo struct { + data *Data + log *log.Helper +} + +func NewUserRepo(data *Data, logger log.Logger) biz.UserRepo { + l := log.NewHelper(log.With(logger, "module", "user/repo/user-service")) + return &UserRepo{ + data: data, + log: l, + } +} + +func (r *UserRepo) convertEntToProto(in *ent.User) *v1.User { + if in == nil { + return nil + } + return &v1.User{ + Id: in.ID, + UserName: in.UserName, + NickName: in.NickName, + Password: in.Password, + CreateTime: util.UnixMilliToStringPtr(in.CreateTime), + UpdateTime: util.UnixMilliToStringPtr(in.UpdateTime), + } +} + +func (r *UserRepo) Count(ctx context.Context, whereCond []func(s *sql.Selector)) (int, error) { + builder := r.data.db.Client().User.Query() + if len(whereCond) != 0 { + for _, cond := range whereCond { + builder = builder.Where(cond) + } + } + return builder.Count(ctx) +} + +func (r *UserRepo) List(ctx context.Context, req *pagination.PagingRequest) (*v1.ListUserResponse, error) { + builder := r.data.db.Client().User.Query() + + err, whereSelectors, querySelectors := entgo.BuildQuerySelector(r.data.db.Driver().Dialect(), + req.GetQuery(), req.GetOrQuery(), + req.GetPage(), req.GetPageSize(), req.GetNoPaging(), + req.GetOrderBy(), user.FieldCreateTime) + if err != nil { + r.log.Errorf("解析条件发生错误[%s]", err.Error()) + return nil, err + } + + if querySelectors != nil { + builder.Modify(querySelectors...) + } + + results, err := builder.All(ctx) + if err != nil { + return nil, err + } + + items := make([]*v1.User, 0, len(results)) + for _, res := range results { + item := r.convertEntToProto(res) + items = append(items, item) + } + + count, err := r.Count(ctx, whereSelectors) + if err != nil { + return nil, err + } + + return &v1.ListUserResponse{ + Total: int32(count), + Items: items, + }, nil +} + +func (r *UserRepo) Get(ctx context.Context, req *v1.GetUserRequest) (*v1.User, error) { + res, err := r.data.db.Client().User.Get(ctx, req.GetId()) + if err != nil && !ent.IsNotFound(err) { + return nil, err + } + + return r.convertEntToProto(res), err +} + +func (r *UserRepo) Create(ctx context.Context, req *v1.CreateUserRequest) (*v1.User, error) { + cryptoPassword, err := crypto.HashPassword(req.User.GetPassword()) + if err != nil { + return nil, err + } + + res, err := r.data.db.Client().User.Create(). + SetNillableUserName(req.User.UserName). + SetNillableNickName(req.User.NickName). + SetPassword(cryptoPassword). + SetCreateTime(time.Now().UnixMilli()). + Save(ctx) + if err != nil { + return nil, err + } + + return r.convertEntToProto(res), err +} + +func (r *UserRepo) Update(ctx context.Context, req *v1.UpdateUserRequest) (*v1.User, error) { + cryptoPassword, err := crypto.HashPassword(req.User.GetPassword()) + if err != nil { + return nil, err + } + + builder := r.data.db.Client().User.UpdateOneID(req.Id). + SetNillableNickName(req.User.NickName). + SetPassword(cryptoPassword). + SetUpdateTime(time.Now().UnixMilli()) + + res, err := builder.Save(ctx) + if err != nil { + return nil, err + } + + return r.convertEntToProto(res), err +} + +func (r *UserRepo) Delete(ctx context.Context, req *v1.DeleteUserRequest) (bool, error) { + err := r.data.db.Client().User. + DeleteOneID(req.GetId()). + Exec(ctx) + return err != nil, err +} diff --git a/orm/ent/app/user/service/internal/server/grpc.go b/orm/ent/app/user/service/internal/server/grpc.go new file mode 100644 index 0000000..c584953 --- /dev/null +++ b/orm/ent/app/user/service/internal/server/grpc.go @@ -0,0 +1,25 @@ +package server + +import ( + "github.com/go-kratos/kratos/v2/log" + "github.com/go-kratos/kratos/v2/middleware/logging" + "github.com/go-kratos/kratos/v2/transport/grpc" + + "kratos-ent-example/app/user/service/internal/service" + + "kratos-ent-example/gen/api/go/common/conf" + userV1 "kratos-ent-example/gen/api/go/user/service/v1" + + "kratos-ent-example/pkg/bootstrap" +) + +// NewGRPCServer new a gRPC server. +func NewGRPCServer(cfg *conf.Bootstrap, logger log.Logger, + userSvc *service.UserService, +) *grpc.Server { + srv := bootstrap.CreateGrpcServer(cfg, logging.Server(logger)) + + userV1.RegisterUserServiceServer(srv, userSvc) + + return srv +} diff --git a/orm/ent/app/user/service/internal/server/init.go b/orm/ent/app/user/service/internal/server/init.go new file mode 100644 index 0000000..b5aa82c --- /dev/null +++ b/orm/ent/app/user/service/internal/server/init.go @@ -0,0 +1,8 @@ +package server + +import ( + "github.com/google/wire" +) + +// ProviderSet is server providers. +var ProviderSet = wire.NewSet(NewGRPCServer) diff --git a/orm/ent/app/user/service/internal/service/README.md b/orm/ent/app/user/service/internal/service/README.md new file mode 100644 index 0000000..2cbd151 --- /dev/null +++ b/orm/ent/app/user/service/internal/service/README.md @@ -0,0 +1 @@ +# Service diff --git a/orm/ent/app/user/service/internal/service/init.go b/orm/ent/app/user/service/internal/service/init.go new file mode 100644 index 0000000..33cdc72 --- /dev/null +++ b/orm/ent/app/user/service/internal/service/init.go @@ -0,0 +1,10 @@ +package service + +import ( + "github.com/google/wire" +) + +// ProviderSet is service providers. +var ProviderSet = wire.NewSet( + NewUserService, +) diff --git a/orm/ent/app/user/service/internal/service/user.go b/orm/ent/app/user/service/internal/service/user.go new file mode 100644 index 0000000..a02eebb --- /dev/null +++ b/orm/ent/app/user/service/internal/service/user.go @@ -0,0 +1,53 @@ +package service + +import ( + "context" + + "github.com/go-kratos/kratos/v2/log" + "google.golang.org/protobuf/types/known/emptypb" + + "kratos-ent-example/app/user/service/internal/biz" + + "kratos-ent-example/gen/api/go/common/pagination" + v1 "kratos-ent-example/gen/api/go/user/service/v1" +) + +type UserService struct { + v1.UnimplementedUserServiceServer + + uc *biz.UserUseCase + log *log.Helper +} + +func NewUserService(logger log.Logger, uc *biz.UserUseCase) *UserService { + l := log.NewHelper(log.With(logger, "module", "user/service/user-service")) + return &UserService{ + log: l, + uc: uc, + } +} + +func (s *UserService) ListUser(ctx context.Context, req *pagination.PagingRequest) (*v1.ListUserResponse, error) { + return s.uc.List(ctx, req) +} + +func (s *UserService) GetUser(ctx context.Context, req *v1.GetUserRequest) (*v1.User, error) { + return s.uc.Get(ctx, req) +} + +func (s *UserService) CreateUser(ctx context.Context, req *v1.CreateUserRequest) (*v1.User, error) { + return s.uc.Create(ctx, req) +} + +func (s *UserService) UpdateUser(ctx context.Context, req *v1.UpdateUserRequest) (*v1.User, error) { + return s.uc.Update(ctx, req) +} + +func (s *UserService) DeleteUser(ctx context.Context, req *v1.DeleteUserRequest) (*emptypb.Empty, error) { + _, err := s.uc.Delete(ctx, req) + if err != nil { + return nil, err + } + + return &emptypb.Empty{}, nil +} diff --git a/orm/ent/buf.gen.yaml b/orm/ent/buf.gen.yaml new file mode 100644 index 0000000..d2bd232 --- /dev/null +++ b/orm/ent/buf.gen.yaml @@ -0,0 +1,37 @@ +# 配置protoc生成规则 +version: v1 +managed: + enabled: false +plugins: + # generate go struct code + #- plugin: buf.build/protocolbuffers/go + - name: go + out: gen/api/go + opt: paths=source_relative + + # generate grpc service code + #- plugin: buf.build/grpc/go + - name: go-grpc + out: gen/api/go + opt: + - paths=source_relative + + # generate rest service code + - name: go-http + out: gen/api/go + opt: + - paths=source_relative + + # generate kratos errors code + - name: go-errors + out: gen/api/go + opt: + - paths=source_relative + + # generate message validator code + #- plugin: buf.build/bufbuild/validate-go + - name: validate + out: gen/api/go + opt: + - paths=source_relative + - lang=go diff --git a/orm/ent/buf.lock b/orm/ent/buf.lock new file mode 100644 index 0000000..c91b581 --- /dev/null +++ b/orm/ent/buf.lock @@ -0,0 +1,2 @@ +# Generated by buf. DO NOT EDIT. +version: v1 diff --git a/orm/ent/buf.work.yaml b/orm/ent/buf.work.yaml new file mode 100644 index 0000000..1cd0523 --- /dev/null +++ b/orm/ent/buf.work.yaml @@ -0,0 +1,3 @@ +version: v1 +directories: + - api \ No newline at end of file diff --git a/orm/ent/buf.yaml b/orm/ent/buf.yaml new file mode 100644 index 0000000..1a51945 --- /dev/null +++ b/orm/ent/buf.yaml @@ -0,0 +1,7 @@ +version: v1 +breaking: + use: + - FILE +lint: + use: + - DEFAULT diff --git a/orm/ent/gen/api/go/common/conf/bootstrap.pb.go b/orm/ent/gen/api/go/common/conf/bootstrap.pb.go new file mode 100644 index 0000000..3a9d319 --- /dev/null +++ b/orm/ent/gen/api/go/common/conf/bootstrap.pb.go @@ -0,0 +1,260 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: common/conf/bootstrap.proto + +package conf + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 引导信息 +type Bootstrap struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Server *Server `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"` + Client *Client `protobuf:"bytes,2,opt,name=client,proto3" json:"client,omitempty"` + Data *Data `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + Trace *Tracer `protobuf:"bytes,4,opt,name=trace,proto3" json:"trace,omitempty"` + Logger *Logger `protobuf:"bytes,5,opt,name=logger,proto3" json:"logger,omitempty"` + Registry *Registry `protobuf:"bytes,6,opt,name=registry,proto3" json:"registry,omitempty"` + Config *RemoteConfig `protobuf:"bytes,7,opt,name=config,proto3" json:"config,omitempty"` + Oss *OSS `protobuf:"bytes,8,opt,name=oss,proto3" json:"oss,omitempty"` +} + +func (x *Bootstrap) Reset() { + *x = Bootstrap{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_bootstrap_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Bootstrap) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Bootstrap) ProtoMessage() {} + +func (x *Bootstrap) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_bootstrap_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Bootstrap.ProtoReflect.Descriptor instead. +func (*Bootstrap) Descriptor() ([]byte, []int) { + return file_common_conf_bootstrap_proto_rawDescGZIP(), []int{0} +} + +func (x *Bootstrap) GetServer() *Server { + if x != nil { + return x.Server + } + return nil +} + +func (x *Bootstrap) GetClient() *Client { + if x != nil { + return x.Client + } + return nil +} + +func (x *Bootstrap) GetData() *Data { + if x != nil { + return x.Data + } + return nil +} + +func (x *Bootstrap) GetTrace() *Tracer { + if x != nil { + return x.Trace + } + return nil +} + +func (x *Bootstrap) GetLogger() *Logger { + if x != nil { + return x.Logger + } + return nil +} + +func (x *Bootstrap) GetRegistry() *Registry { + if x != nil { + return x.Registry + } + return nil +} + +func (x *Bootstrap) GetConfig() *RemoteConfig { + if x != nil { + return x.Config + } + return nil +} + +func (x *Bootstrap) GetOss() *OSS { + if x != nil { + return x.Oss + } + return nil +} + +var File_common_conf_bootstrap_proto protoreflect.FileDescriptor + +var file_common_conf_bootstrap_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x62, 0x6f, + 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x18, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, + 0x66, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, + 0x6f, 0x6e, 0x66, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x6c, 0x6f, + 0x67, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, + 0x6f, 0x6e, 0x66, 0x2f, 0x6f, 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xee, 0x02, 0x0a, 0x09, 0x42, 0x6f, 0x6f, 0x74, + 0x73, 0x74, 0x72, 0x61, 0x70, 0x12, 0x2b, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, + 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x06, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, + 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, + 0x25, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, + 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x29, 0x0a, 0x05, 0x74, 0x72, 0x61, 0x63, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, + 0x6f, 0x6e, 0x66, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x72, 0x52, 0x05, 0x74, 0x72, 0x61, 0x63, + 0x65, 0x12, 0x2b, 0x0a, 0x06, 0x6c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, + 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x52, 0x06, 0x6c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x12, 0x31, + 0x0a, 0x08, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x52, 0x08, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, + 0x79, 0x12, 0x31, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, + 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x12, 0x22, 0x0a, 0x03, 0x6f, 0x73, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, + 0x4f, 0x53, 0x53, 0x52, 0x03, 0x6f, 0x73, 0x73, 0x42, 0x30, 0x5a, 0x2e, 0x6b, 0x72, 0x61, 0x74, + 0x6f, 0x73, 0x2d, 0x65, 0x6e, 0x74, 0x2d, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x67, + 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_common_conf_bootstrap_proto_rawDescOnce sync.Once + file_common_conf_bootstrap_proto_rawDescData = file_common_conf_bootstrap_proto_rawDesc +) + +func file_common_conf_bootstrap_proto_rawDescGZIP() []byte { + file_common_conf_bootstrap_proto_rawDescOnce.Do(func() { + file_common_conf_bootstrap_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_conf_bootstrap_proto_rawDescData) + }) + return file_common_conf_bootstrap_proto_rawDescData +} + +var file_common_conf_bootstrap_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_common_conf_bootstrap_proto_goTypes = []interface{}{ + (*Bootstrap)(nil), // 0: common.conf.Bootstrap + (*Server)(nil), // 1: common.conf.Server + (*Client)(nil), // 2: common.conf.Client + (*Data)(nil), // 3: common.conf.Data + (*Tracer)(nil), // 4: common.conf.Tracer + (*Logger)(nil), // 5: common.conf.Logger + (*Registry)(nil), // 6: common.conf.Registry + (*RemoteConfig)(nil), // 7: common.conf.RemoteConfig + (*OSS)(nil), // 8: common.conf.OSS +} +var file_common_conf_bootstrap_proto_depIdxs = []int32{ + 1, // 0: common.conf.Bootstrap.server:type_name -> common.conf.Server + 2, // 1: common.conf.Bootstrap.client:type_name -> common.conf.Client + 3, // 2: common.conf.Bootstrap.data:type_name -> common.conf.Data + 4, // 3: common.conf.Bootstrap.trace:type_name -> common.conf.Tracer + 5, // 4: common.conf.Bootstrap.logger:type_name -> common.conf.Logger + 6, // 5: common.conf.Bootstrap.registry:type_name -> common.conf.Registry + 7, // 6: common.conf.Bootstrap.config:type_name -> common.conf.RemoteConfig + 8, // 7: common.conf.Bootstrap.oss:type_name -> common.conf.OSS + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_common_conf_bootstrap_proto_init() } +func file_common_conf_bootstrap_proto_init() { + if File_common_conf_bootstrap_proto != nil { + return + } + file_common_conf_tracer_proto_init() + file_common_conf_data_proto_init() + file_common_conf_server_proto_init() + file_common_conf_client_proto_init() + file_common_conf_logger_proto_init() + file_common_conf_registry_proto_init() + file_common_conf_oss_proto_init() + file_common_conf_config_proto_init() + if !protoimpl.UnsafeEnabled { + file_common_conf_bootstrap_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Bootstrap); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_conf_bootstrap_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_conf_bootstrap_proto_goTypes, + DependencyIndexes: file_common_conf_bootstrap_proto_depIdxs, + MessageInfos: file_common_conf_bootstrap_proto_msgTypes, + }.Build() + File_common_conf_bootstrap_proto = out.File + file_common_conf_bootstrap_proto_rawDesc = nil + file_common_conf_bootstrap_proto_goTypes = nil + file_common_conf_bootstrap_proto_depIdxs = nil +} diff --git a/orm/ent/gen/api/go/common/conf/bootstrap.pb.validate.go b/orm/ent/gen/api/go/common/conf/bootstrap.pb.validate.go new file mode 100644 index 0000000..4a2b125 --- /dev/null +++ b/orm/ent/gen/api/go/common/conf/bootstrap.pb.validate.go @@ -0,0 +1,367 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: common/conf/bootstrap.proto + +package conf + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on Bootstrap with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Bootstrap) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Bootstrap with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in BootstrapMultiError, or nil +// if none found. +func (m *Bootstrap) ValidateAll() error { + return m.validate(true) +} + +func (m *Bootstrap) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetServer()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Server", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Server", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetServer()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BootstrapValidationError{ + field: "Server", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetClient()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Client", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Client", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetClient()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BootstrapValidationError{ + field: "Client", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetData()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Data", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Data", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetData()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BootstrapValidationError{ + field: "Data", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetTrace()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Trace", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Trace", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTrace()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BootstrapValidationError{ + field: "Trace", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetLogger()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Logger", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Logger", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetLogger()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BootstrapValidationError{ + field: "Logger", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetRegistry()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Registry", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Registry", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRegistry()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BootstrapValidationError{ + field: "Registry", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetConfig()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Config", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Config", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BootstrapValidationError{ + field: "Config", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetOss()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Oss", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Oss", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetOss()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BootstrapValidationError{ + field: "Oss", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return BootstrapMultiError(errors) + } + + return nil +} + +// BootstrapMultiError is an error wrapping multiple validation errors returned +// by Bootstrap.ValidateAll() if the designated constraints aren't met. +type BootstrapMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m BootstrapMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m BootstrapMultiError) AllErrors() []error { return m } + +// BootstrapValidationError is the validation error returned by +// Bootstrap.Validate if the designated constraints aren't met. +type BootstrapValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e BootstrapValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e BootstrapValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e BootstrapValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e BootstrapValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e BootstrapValidationError) ErrorName() string { return "BootstrapValidationError" } + +// Error satisfies the builtin error interface +func (e BootstrapValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sBootstrap.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = BootstrapValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = BootstrapValidationError{} diff --git a/orm/ent/gen/api/go/common/conf/client.pb.go b/orm/ent/gen/api/go/common/conf/client.pb.go new file mode 100644 index 0000000..f9ea491 --- /dev/null +++ b/orm/ent/gen/api/go/common/conf/client.pb.go @@ -0,0 +1,325 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: common/conf/client.proto + +package conf + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 客户端 +type Client struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Rest *Client_REST `protobuf:"bytes,1,opt,name=rest,proto3" json:"rest,omitempty"` // REST服务 + Grpc *Client_GRPC `protobuf:"bytes,2,opt,name=grpc,proto3" json:"grpc,omitempty"` // gRPC服务 +} + +func (x *Client) Reset() { + *x = Client{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_client_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Client) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Client) ProtoMessage() {} + +func (x *Client) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_client_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Client.ProtoReflect.Descriptor instead. +func (*Client) Descriptor() ([]byte, []int) { + return file_common_conf_client_proto_rawDescGZIP(), []int{0} +} + +func (x *Client) GetRest() *Client_REST { + if x != nil { + return x.Rest + } + return nil +} + +func (x *Client) GetGrpc() *Client_GRPC { + if x != nil { + return x.Grpc + } + return nil +} + +// REST +type Client_REST struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timeout *durationpb.Duration `protobuf:"bytes,1,opt,name=timeout,proto3" json:"timeout,omitempty"` // 超时时间 + Middleware *Middleware `protobuf:"bytes,2,opt,name=middleware,proto3" json:"middleware,omitempty"` +} + +func (x *Client_REST) Reset() { + *x = Client_REST{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_client_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Client_REST) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Client_REST) ProtoMessage() {} + +func (x *Client_REST) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_client_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Client_REST.ProtoReflect.Descriptor instead. +func (*Client_REST) Descriptor() ([]byte, []int) { + return file_common_conf_client_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *Client_REST) GetTimeout() *durationpb.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +func (x *Client_REST) GetMiddleware() *Middleware { + if x != nil { + return x.Middleware + } + return nil +} + +// gPRC +type Client_GRPC struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timeout *durationpb.Duration `protobuf:"bytes,1,opt,name=timeout,proto3" json:"timeout,omitempty"` // 超时时间 + Middleware *Middleware `protobuf:"bytes,2,opt,name=middleware,proto3" json:"middleware,omitempty"` +} + +func (x *Client_GRPC) Reset() { + *x = Client_GRPC{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_client_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Client_GRPC) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Client_GRPC) ProtoMessage() {} + +func (x *Client_GRPC) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_client_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Client_GRPC.ProtoReflect.Descriptor instead. +func (*Client_GRPC) Descriptor() ([]byte, []int) { + return file_common_conf_client_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *Client_GRPC) GetTimeout() *durationpb.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +func (x *Client_GRPC) GetMiddleware() *Middleware { + if x != nil { + return x.Middleware + } + return nil +} + +var File_common_conf_client_proto protoreflect.FileDescriptor + +var file_common_conf_client_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, + 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd0, 0x02, 0x0a, 0x06, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x12, 0x2c, 0x0a, 0x04, 0x72, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x2e, 0x52, 0x45, 0x53, 0x54, 0x52, 0x04, 0x72, 0x65, 0x73, 0x74, 0x12, 0x2c, + 0x0a, 0x04, 0x67, 0x72, 0x70, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x2e, 0x47, 0x52, 0x50, 0x43, 0x52, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x74, 0x0a, 0x04, + 0x52, 0x45, 0x53, 0x54, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x37, 0x0a, 0x0a, 0x6d, 0x69, 0x64, + 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4d, 0x69, 0x64, 0x64, + 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x52, 0x0a, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, + 0x72, 0x65, 0x1a, 0x74, 0x0a, 0x04, 0x47, 0x52, 0x50, 0x43, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, + 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, + 0x37, 0x0a, 0x0a, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, + 0x66, 0x2e, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x52, 0x0a, 0x6d, 0x69, + 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x42, 0x30, 0x5a, 0x2e, 0x6b, 0x72, 0x61, 0x74, + 0x6f, 0x73, 0x2d, 0x65, 0x6e, 0x74, 0x2d, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x67, + 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_common_conf_client_proto_rawDescOnce sync.Once + file_common_conf_client_proto_rawDescData = file_common_conf_client_proto_rawDesc +) + +func file_common_conf_client_proto_rawDescGZIP() []byte { + file_common_conf_client_proto_rawDescOnce.Do(func() { + file_common_conf_client_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_conf_client_proto_rawDescData) + }) + return file_common_conf_client_proto_rawDescData +} + +var file_common_conf_client_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_common_conf_client_proto_goTypes = []interface{}{ + (*Client)(nil), // 0: common.conf.Client + (*Client_REST)(nil), // 1: common.conf.Client.REST + (*Client_GRPC)(nil), // 2: common.conf.Client.GRPC + (*durationpb.Duration)(nil), // 3: google.protobuf.Duration + (*Middleware)(nil), // 4: common.conf.Middleware +} +var file_common_conf_client_proto_depIdxs = []int32{ + 1, // 0: common.conf.Client.rest:type_name -> common.conf.Client.REST + 2, // 1: common.conf.Client.grpc:type_name -> common.conf.Client.GRPC + 3, // 2: common.conf.Client.REST.timeout:type_name -> google.protobuf.Duration + 4, // 3: common.conf.Client.REST.middleware:type_name -> common.conf.Middleware + 3, // 4: common.conf.Client.GRPC.timeout:type_name -> google.protobuf.Duration + 4, // 5: common.conf.Client.GRPC.middleware:type_name -> common.conf.Middleware + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_common_conf_client_proto_init() } +func file_common_conf_client_proto_init() { + if File_common_conf_client_proto != nil { + return + } + file_common_conf_middleware_proto_init() + if !protoimpl.UnsafeEnabled { + file_common_conf_client_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Client); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_client_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Client_REST); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_client_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Client_GRPC); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_conf_client_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_conf_client_proto_goTypes, + DependencyIndexes: file_common_conf_client_proto_depIdxs, + MessageInfos: file_common_conf_client_proto_msgTypes, + }.Build() + File_common_conf_client_proto = out.File + file_common_conf_client_proto_rawDesc = nil + file_common_conf_client_proto_goTypes = nil + file_common_conf_client_proto_depIdxs = nil +} diff --git a/orm/ent/gen/api/go/common/conf/client.pb.validate.go b/orm/ent/gen/api/go/common/conf/client.pb.validate.go new file mode 100644 index 0000000..8e47892 --- /dev/null +++ b/orm/ent/gen/api/go/common/conf/client.pb.validate.go @@ -0,0 +1,506 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: common/conf/client.proto + +package conf + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on Client with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Client) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Client with the rules defined in the +// proto definition for this message. If any rules are violated, the result is +// a list of violation errors wrapped in ClientMultiError, or nil if none found. +func (m *Client) ValidateAll() error { + return m.validate(true) +} + +func (m *Client) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetRest()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ClientValidationError{ + field: "Rest", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ClientValidationError{ + field: "Rest", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRest()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClientValidationError{ + field: "Rest", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetGrpc()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ClientValidationError{ + field: "Grpc", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ClientValidationError{ + field: "Grpc", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetGrpc()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClientValidationError{ + field: "Grpc", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return ClientMultiError(errors) + } + + return nil +} + +// ClientMultiError is an error wrapping multiple validation errors returned by +// Client.ValidateAll() if the designated constraints aren't met. +type ClientMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ClientMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ClientMultiError) AllErrors() []error { return m } + +// ClientValidationError is the validation error returned by Client.Validate if +// the designated constraints aren't met. +type ClientValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ClientValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ClientValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ClientValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ClientValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ClientValidationError) ErrorName() string { return "ClientValidationError" } + +// Error satisfies the builtin error interface +func (e ClientValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sClient.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ClientValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ClientValidationError{} + +// Validate checks the field values on Client_REST with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Client_REST) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Client_REST with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Client_RESTMultiError, or +// nil if none found. +func (m *Client_REST) ValidateAll() error { + return m.validate(true) +} + +func (m *Client_REST) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetTimeout()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Client_RESTValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Client_RESTValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Client_RESTValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetMiddleware()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Client_RESTValidationError{ + field: "Middleware", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Client_RESTValidationError{ + field: "Middleware", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMiddleware()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Client_RESTValidationError{ + field: "Middleware", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return Client_RESTMultiError(errors) + } + + return nil +} + +// Client_RESTMultiError is an error wrapping multiple validation errors +// returned by Client_REST.ValidateAll() if the designated constraints aren't met. +type Client_RESTMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Client_RESTMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Client_RESTMultiError) AllErrors() []error { return m } + +// Client_RESTValidationError is the validation error returned by +// Client_REST.Validate if the designated constraints aren't met. +type Client_RESTValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Client_RESTValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Client_RESTValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Client_RESTValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Client_RESTValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Client_RESTValidationError) ErrorName() string { return "Client_RESTValidationError" } + +// Error satisfies the builtin error interface +func (e Client_RESTValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sClient_REST.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Client_RESTValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Client_RESTValidationError{} + +// Validate checks the field values on Client_GRPC with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Client_GRPC) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Client_GRPC with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Client_GRPCMultiError, or +// nil if none found. +func (m *Client_GRPC) ValidateAll() error { + return m.validate(true) +} + +func (m *Client_GRPC) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetTimeout()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Client_GRPCValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Client_GRPCValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Client_GRPCValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetMiddleware()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Client_GRPCValidationError{ + field: "Middleware", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Client_GRPCValidationError{ + field: "Middleware", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMiddleware()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Client_GRPCValidationError{ + field: "Middleware", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return Client_GRPCMultiError(errors) + } + + return nil +} + +// Client_GRPCMultiError is an error wrapping multiple validation errors +// returned by Client_GRPC.ValidateAll() if the designated constraints aren't met. +type Client_GRPCMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Client_GRPCMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Client_GRPCMultiError) AllErrors() []error { return m } + +// Client_GRPCValidationError is the validation error returned by +// Client_GRPC.Validate if the designated constraints aren't met. +type Client_GRPCValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Client_GRPCValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Client_GRPCValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Client_GRPCValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Client_GRPCValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Client_GRPCValidationError) ErrorName() string { return "Client_GRPCValidationError" } + +// Error satisfies the builtin error interface +func (e Client_GRPCValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sClient_GRPC.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Client_GRPCValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Client_GRPCValidationError{} diff --git a/orm/ent/gen/api/go/common/conf/config.pb.go b/orm/ent/gen/api/go/common/conf/config.pb.go new file mode 100644 index 0000000..cbc0630 --- /dev/null +++ b/orm/ent/gen/api/go/common/conf/config.pb.go @@ -0,0 +1,687 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: common/conf/config.proto + +package conf + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 配置服务 +type RemoteConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Etcd *RemoteConfig_Etcd `protobuf:"bytes,2,opt,name=etcd,proto3" json:"etcd,omitempty"` + Consul *RemoteConfig_Consul `protobuf:"bytes,3,opt,name=consul,proto3" json:"consul,omitempty"` + Nacos *RemoteConfig_Nacos `protobuf:"bytes,4,opt,name=nacos,proto3" json:"nacos,omitempty"` + Apollo *RemoteConfig_Apollo `protobuf:"bytes,6,opt,name=apollo,proto3" json:"apollo,omitempty"` + Kubernetes *RemoteConfig_Kubernetes `protobuf:"bytes,7,opt,name=kubernetes,proto3" json:"kubernetes,omitempty"` + Polaris *RemoteConfig_Polaris `protobuf:"bytes,8,opt,name=polaris,proto3" json:"polaris,omitempty"` +} + +func (x *RemoteConfig) Reset() { + *x = RemoteConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_config_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoteConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoteConfig) ProtoMessage() {} + +func (x *RemoteConfig) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_config_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoteConfig.ProtoReflect.Descriptor instead. +func (*RemoteConfig) Descriptor() ([]byte, []int) { + return file_common_conf_config_proto_rawDescGZIP(), []int{0} +} + +func (x *RemoteConfig) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *RemoteConfig) GetEtcd() *RemoteConfig_Etcd { + if x != nil { + return x.Etcd + } + return nil +} + +func (x *RemoteConfig) GetConsul() *RemoteConfig_Consul { + if x != nil { + return x.Consul + } + return nil +} + +func (x *RemoteConfig) GetNacos() *RemoteConfig_Nacos { + if x != nil { + return x.Nacos + } + return nil +} + +func (x *RemoteConfig) GetApollo() *RemoteConfig_Apollo { + if x != nil { + return x.Apollo + } + return nil +} + +func (x *RemoteConfig) GetKubernetes() *RemoteConfig_Kubernetes { + if x != nil { + return x.Kubernetes + } + return nil +} + +func (x *RemoteConfig) GetPolaris() *RemoteConfig_Polaris { + if x != nil { + return x.Polaris + } + return nil +} + +type RemoteConfig_Nacos struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // 服务端地址 + Port uint64 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` // 服务端端口 + Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` // +} + +func (x *RemoteConfig_Nacos) Reset() { + *x = RemoteConfig_Nacos{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_config_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoteConfig_Nacos) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoteConfig_Nacos) ProtoMessage() {} + +func (x *RemoteConfig_Nacos) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_config_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoteConfig_Nacos.ProtoReflect.Descriptor instead. +func (*RemoteConfig_Nacos) Descriptor() ([]byte, []int) { + return file_common_conf_config_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *RemoteConfig_Nacos) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *RemoteConfig_Nacos) GetPort() uint64 { + if x != nil { + return x.Port + } + return 0 +} + +func (x *RemoteConfig_Nacos) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +type RemoteConfig_Etcd struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Endpoints []string `protobuf:"bytes,1,rep,name=endpoints,proto3" json:"endpoints,omitempty"` + Timeout *durationpb.Duration `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout,omitempty"` + Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` // +} + +func (x *RemoteConfig_Etcd) Reset() { + *x = RemoteConfig_Etcd{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_config_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoteConfig_Etcd) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoteConfig_Etcd) ProtoMessage() {} + +func (x *RemoteConfig_Etcd) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_config_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoteConfig_Etcd.ProtoReflect.Descriptor instead. +func (*RemoteConfig_Etcd) Descriptor() ([]byte, []int) { + return file_common_conf_config_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *RemoteConfig_Etcd) GetEndpoints() []string { + if x != nil { + return x.Endpoints + } + return nil +} + +func (x *RemoteConfig_Etcd) GetTimeout() *durationpb.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +func (x *RemoteConfig_Etcd) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +type RemoteConfig_Consul struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Scheme string `protobuf:"bytes,1,opt,name=scheme,proto3" json:"scheme,omitempty"` // 网络样式 + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // 服务端地址 + Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` // +} + +func (x *RemoteConfig_Consul) Reset() { + *x = RemoteConfig_Consul{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_config_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoteConfig_Consul) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoteConfig_Consul) ProtoMessage() {} + +func (x *RemoteConfig_Consul) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_config_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoteConfig_Consul.ProtoReflect.Descriptor instead. +func (*RemoteConfig_Consul) Descriptor() ([]byte, []int) { + return file_common_conf_config_proto_rawDescGZIP(), []int{0, 2} +} + +func (x *RemoteConfig_Consul) GetScheme() string { + if x != nil { + return x.Scheme + } + return "" +} + +func (x *RemoteConfig_Consul) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *RemoteConfig_Consul) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +type RemoteConfig_Apollo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` + AppId string `protobuf:"bytes,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + Cluster string `protobuf:"bytes,3,opt,name=cluster,proto3" json:"cluster,omitempty"` + Namespace string `protobuf:"bytes,4,opt,name=namespace,proto3" json:"namespace,omitempty"` + Secret string `protobuf:"bytes,5,opt,name=secret,proto3" json:"secret,omitempty"` +} + +func (x *RemoteConfig_Apollo) Reset() { + *x = RemoteConfig_Apollo{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_config_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoteConfig_Apollo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoteConfig_Apollo) ProtoMessage() {} + +func (x *RemoteConfig_Apollo) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_config_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoteConfig_Apollo.ProtoReflect.Descriptor instead. +func (*RemoteConfig_Apollo) Descriptor() ([]byte, []int) { + return file_common_conf_config_proto_rawDescGZIP(), []int{0, 3} +} + +func (x *RemoteConfig_Apollo) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +func (x *RemoteConfig_Apollo) GetAppId() string { + if x != nil { + return x.AppId + } + return "" +} + +func (x *RemoteConfig_Apollo) GetCluster() string { + if x != nil { + return x.Cluster + } + return "" +} + +func (x *RemoteConfig_Apollo) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *RemoteConfig_Apollo) GetSecret() string { + if x != nil { + return x.Secret + } + return "" +} + +type RemoteConfig_Kubernetes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` +} + +func (x *RemoteConfig_Kubernetes) Reset() { + *x = RemoteConfig_Kubernetes{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_config_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoteConfig_Kubernetes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoteConfig_Kubernetes) ProtoMessage() {} + +func (x *RemoteConfig_Kubernetes) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_config_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoteConfig_Kubernetes.ProtoReflect.Descriptor instead. +func (*RemoteConfig_Kubernetes) Descriptor() ([]byte, []int) { + return file_common_conf_config_proto_rawDescGZIP(), []int{0, 4} +} + +func (x *RemoteConfig_Kubernetes) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +type RemoteConfig_Polaris struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RemoteConfig_Polaris) Reset() { + *x = RemoteConfig_Polaris{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_config_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoteConfig_Polaris) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoteConfig_Polaris) ProtoMessage() {} + +func (x *RemoteConfig_Polaris) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_config_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoteConfig_Polaris.ProtoReflect.Descriptor instead. +func (*RemoteConfig_Polaris) Descriptor() ([]byte, []int) { + return file_common_conf_config_proto_rawDescGZIP(), []int{0, 5} +} + +var File_common_conf_config_proto protoreflect.FileDescriptor + +var file_common_conf_config_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcd, 0x06, 0x0a, 0x0c, 0x52, 0x65, 0x6d, 0x6f, + 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x32, 0x0a, 0x04, + 0x65, 0x74, 0x63, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x45, 0x74, 0x63, 0x64, 0x52, 0x04, 0x65, 0x74, 0x63, 0x64, + 0x12, 0x38, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x43, 0x6f, 0x6e, 0x73, + 0x75, 0x6c, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x12, 0x35, 0x0a, 0x05, 0x6e, 0x61, + 0x63, 0x6f, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x4e, 0x61, 0x63, 0x6f, 0x73, 0x52, 0x05, 0x6e, 0x61, 0x63, 0x6f, + 0x73, 0x12, 0x38, 0x0a, 0x06, 0x61, 0x70, 0x6f, 0x6c, 0x6c, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, + 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x41, 0x70, 0x6f, + 0x6c, 0x6c, 0x6f, 0x52, 0x06, 0x61, 0x70, 0x6f, 0x6c, 0x6c, 0x6f, 0x12, 0x44, 0x0a, 0x0a, 0x6b, + 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x4b, 0x75, 0x62, 0x65, 0x72, + 0x6e, 0x65, 0x74, 0x65, 0x73, 0x52, 0x0a, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, + 0x73, 0x12, 0x3b, 0x0a, 0x07, 0x70, 0x6f, 0x6c, 0x61, 0x72, 0x69, 0x73, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, + 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x50, 0x6f, + 0x6c, 0x61, 0x72, 0x69, 0x73, 0x52, 0x07, 0x70, 0x6f, 0x6c, 0x61, 0x72, 0x69, 0x73, 0x1a, 0x47, + 0x0a, 0x05, 0x4e, 0x61, 0x63, 0x6f, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x1a, 0x6b, 0x0a, 0x04, 0x45, 0x74, 0x63, 0x64, 0x12, + 0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x09, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x33, 0x0a, + 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, + 0x75, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x1a, 0x4c, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x12, 0x16, + 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x1a, 0x8b, 0x01, 0x0a, 0x06, 0x41, 0x70, 0x6f, 0x6c, 0x6c, 0x6f, 0x12, 0x1a, 0x0a, + 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, + 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, + 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, + 0x1a, 0x2a, 0x0a, 0x0a, 0x4b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x12, 0x1c, + 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x1a, 0x09, 0x0a, 0x07, + 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x69, 0x73, 0x42, 0x30, 0x5a, 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, + 0x73, 0x2d, 0x65, 0x6e, 0x74, 0x2d, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x67, 0x65, + 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, + 0x63, 0x6f, 0x6e, 0x66, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_common_conf_config_proto_rawDescOnce sync.Once + file_common_conf_config_proto_rawDescData = file_common_conf_config_proto_rawDesc +) + +func file_common_conf_config_proto_rawDescGZIP() []byte { + file_common_conf_config_proto_rawDescOnce.Do(func() { + file_common_conf_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_conf_config_proto_rawDescData) + }) + return file_common_conf_config_proto_rawDescData +} + +var file_common_conf_config_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_common_conf_config_proto_goTypes = []interface{}{ + (*RemoteConfig)(nil), // 0: common.conf.RemoteConfig + (*RemoteConfig_Nacos)(nil), // 1: common.conf.RemoteConfig.Nacos + (*RemoteConfig_Etcd)(nil), // 2: common.conf.RemoteConfig.Etcd + (*RemoteConfig_Consul)(nil), // 3: common.conf.RemoteConfig.Consul + (*RemoteConfig_Apollo)(nil), // 4: common.conf.RemoteConfig.Apollo + (*RemoteConfig_Kubernetes)(nil), // 5: common.conf.RemoteConfig.Kubernetes + (*RemoteConfig_Polaris)(nil), // 6: common.conf.RemoteConfig.Polaris + (*durationpb.Duration)(nil), // 7: google.protobuf.Duration +} +var file_common_conf_config_proto_depIdxs = []int32{ + 2, // 0: common.conf.RemoteConfig.etcd:type_name -> common.conf.RemoteConfig.Etcd + 3, // 1: common.conf.RemoteConfig.consul:type_name -> common.conf.RemoteConfig.Consul + 1, // 2: common.conf.RemoteConfig.nacos:type_name -> common.conf.RemoteConfig.Nacos + 4, // 3: common.conf.RemoteConfig.apollo:type_name -> common.conf.RemoteConfig.Apollo + 5, // 4: common.conf.RemoteConfig.kubernetes:type_name -> common.conf.RemoteConfig.Kubernetes + 6, // 5: common.conf.RemoteConfig.polaris:type_name -> common.conf.RemoteConfig.Polaris + 7, // 6: common.conf.RemoteConfig.Etcd.timeout:type_name -> google.protobuf.Duration + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +} + +func init() { file_common_conf_config_proto_init() } +func file_common_conf_config_proto_init() { + if File_common_conf_config_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_common_conf_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoteConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoteConfig_Nacos); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoteConfig_Etcd); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoteConfig_Consul); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoteConfig_Apollo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoteConfig_Kubernetes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_config_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoteConfig_Polaris); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_conf_config_proto_rawDesc, + NumEnums: 0, + NumMessages: 7, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_conf_config_proto_goTypes, + DependencyIndexes: file_common_conf_config_proto_depIdxs, + MessageInfos: file_common_conf_config_proto_msgTypes, + }.Build() + File_common_conf_config_proto = out.File + file_common_conf_config_proto_rawDesc = nil + file_common_conf_config_proto_goTypes = nil + file_common_conf_config_proto_depIdxs = nil +} diff --git a/orm/ent/gen/api/go/common/conf/config.pb.validate.go b/orm/ent/gen/api/go/common/conf/config.pb.validate.go new file mode 100644 index 0000000..6a4e0a6 --- /dev/null +++ b/orm/ent/gen/api/go/common/conf/config.pb.validate.go @@ -0,0 +1,978 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: common/conf/config.proto + +package conf + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on RemoteConfig with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *RemoteConfig) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on RemoteConfig with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in RemoteConfigMultiError, or +// nil if none found. +func (m *RemoteConfig) ValidateAll() error { + return m.validate(true) +} + +func (m *RemoteConfig) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Type + + if all { + switch v := interface{}(m.GetEtcd()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RemoteConfigValidationError{ + field: "Etcd", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RemoteConfigValidationError{ + field: "Etcd", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetEtcd()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RemoteConfigValidationError{ + field: "Etcd", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetConsul()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RemoteConfigValidationError{ + field: "Consul", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RemoteConfigValidationError{ + field: "Consul", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetConsul()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RemoteConfigValidationError{ + field: "Consul", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetNacos()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RemoteConfigValidationError{ + field: "Nacos", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RemoteConfigValidationError{ + field: "Nacos", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetNacos()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RemoteConfigValidationError{ + field: "Nacos", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetApollo()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RemoteConfigValidationError{ + field: "Apollo", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RemoteConfigValidationError{ + field: "Apollo", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetApollo()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RemoteConfigValidationError{ + field: "Apollo", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetKubernetes()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RemoteConfigValidationError{ + field: "Kubernetes", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RemoteConfigValidationError{ + field: "Kubernetes", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetKubernetes()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RemoteConfigValidationError{ + field: "Kubernetes", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetPolaris()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RemoteConfigValidationError{ + field: "Polaris", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RemoteConfigValidationError{ + field: "Polaris", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetPolaris()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RemoteConfigValidationError{ + field: "Polaris", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return RemoteConfigMultiError(errors) + } + + return nil +} + +// RemoteConfigMultiError is an error wrapping multiple validation errors +// returned by RemoteConfig.ValidateAll() if the designated constraints aren't met. +type RemoteConfigMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m RemoteConfigMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m RemoteConfigMultiError) AllErrors() []error { return m } + +// RemoteConfigValidationError is the validation error returned by +// RemoteConfig.Validate if the designated constraints aren't met. +type RemoteConfigValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RemoteConfigValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RemoteConfigValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RemoteConfigValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RemoteConfigValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RemoteConfigValidationError) ErrorName() string { return "RemoteConfigValidationError" } + +// Error satisfies the builtin error interface +func (e RemoteConfigValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRemoteConfig.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RemoteConfigValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RemoteConfigValidationError{} + +// Validate checks the field values on RemoteConfig_Nacos with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *RemoteConfig_Nacos) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on RemoteConfig_Nacos with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// RemoteConfig_NacosMultiError, or nil if none found. +func (m *RemoteConfig_Nacos) ValidateAll() error { + return m.validate(true) +} + +func (m *RemoteConfig_Nacos) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Address + + // no validation rules for Port + + // no validation rules for Key + + if len(errors) > 0 { + return RemoteConfig_NacosMultiError(errors) + } + + return nil +} + +// RemoteConfig_NacosMultiError is an error wrapping multiple validation errors +// returned by RemoteConfig_Nacos.ValidateAll() if the designated constraints +// aren't met. +type RemoteConfig_NacosMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m RemoteConfig_NacosMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m RemoteConfig_NacosMultiError) AllErrors() []error { return m } + +// RemoteConfig_NacosValidationError is the validation error returned by +// RemoteConfig_Nacos.Validate if the designated constraints aren't met. +type RemoteConfig_NacosValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RemoteConfig_NacosValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RemoteConfig_NacosValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RemoteConfig_NacosValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RemoteConfig_NacosValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RemoteConfig_NacosValidationError) ErrorName() string { + return "RemoteConfig_NacosValidationError" +} + +// Error satisfies the builtin error interface +func (e RemoteConfig_NacosValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRemoteConfig_Nacos.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RemoteConfig_NacosValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RemoteConfig_NacosValidationError{} + +// Validate checks the field values on RemoteConfig_Etcd with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *RemoteConfig_Etcd) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on RemoteConfig_Etcd with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// RemoteConfig_EtcdMultiError, or nil if none found. +func (m *RemoteConfig_Etcd) ValidateAll() error { + return m.validate(true) +} + +func (m *RemoteConfig_Etcd) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetTimeout()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RemoteConfig_EtcdValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RemoteConfig_EtcdValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RemoteConfig_EtcdValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for Key + + if len(errors) > 0 { + return RemoteConfig_EtcdMultiError(errors) + } + + return nil +} + +// RemoteConfig_EtcdMultiError is an error wrapping multiple validation errors +// returned by RemoteConfig_Etcd.ValidateAll() if the designated constraints +// aren't met. +type RemoteConfig_EtcdMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m RemoteConfig_EtcdMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m RemoteConfig_EtcdMultiError) AllErrors() []error { return m } + +// RemoteConfig_EtcdValidationError is the validation error returned by +// RemoteConfig_Etcd.Validate if the designated constraints aren't met. +type RemoteConfig_EtcdValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RemoteConfig_EtcdValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RemoteConfig_EtcdValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RemoteConfig_EtcdValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RemoteConfig_EtcdValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RemoteConfig_EtcdValidationError) ErrorName() string { + return "RemoteConfig_EtcdValidationError" +} + +// Error satisfies the builtin error interface +func (e RemoteConfig_EtcdValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRemoteConfig_Etcd.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RemoteConfig_EtcdValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RemoteConfig_EtcdValidationError{} + +// Validate checks the field values on RemoteConfig_Consul with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *RemoteConfig_Consul) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on RemoteConfig_Consul with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// RemoteConfig_ConsulMultiError, or nil if none found. +func (m *RemoteConfig_Consul) ValidateAll() error { + return m.validate(true) +} + +func (m *RemoteConfig_Consul) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Scheme + + // no validation rules for Address + + // no validation rules for Key + + if len(errors) > 0 { + return RemoteConfig_ConsulMultiError(errors) + } + + return nil +} + +// RemoteConfig_ConsulMultiError is an error wrapping multiple validation +// errors returned by RemoteConfig_Consul.ValidateAll() if the designated +// constraints aren't met. +type RemoteConfig_ConsulMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m RemoteConfig_ConsulMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m RemoteConfig_ConsulMultiError) AllErrors() []error { return m } + +// RemoteConfig_ConsulValidationError is the validation error returned by +// RemoteConfig_Consul.Validate if the designated constraints aren't met. +type RemoteConfig_ConsulValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RemoteConfig_ConsulValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RemoteConfig_ConsulValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RemoteConfig_ConsulValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RemoteConfig_ConsulValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RemoteConfig_ConsulValidationError) ErrorName() string { + return "RemoteConfig_ConsulValidationError" +} + +// Error satisfies the builtin error interface +func (e RemoteConfig_ConsulValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRemoteConfig_Consul.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RemoteConfig_ConsulValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RemoteConfig_ConsulValidationError{} + +// Validate checks the field values on RemoteConfig_Apollo with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *RemoteConfig_Apollo) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on RemoteConfig_Apollo with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// RemoteConfig_ApolloMultiError, or nil if none found. +func (m *RemoteConfig_Apollo) ValidateAll() error { + return m.validate(true) +} + +func (m *RemoteConfig_Apollo) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Endpoint + + // no validation rules for AppId + + // no validation rules for Cluster + + // no validation rules for Namespace + + // no validation rules for Secret + + if len(errors) > 0 { + return RemoteConfig_ApolloMultiError(errors) + } + + return nil +} + +// RemoteConfig_ApolloMultiError is an error wrapping multiple validation +// errors returned by RemoteConfig_Apollo.ValidateAll() if the designated +// constraints aren't met. +type RemoteConfig_ApolloMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m RemoteConfig_ApolloMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m RemoteConfig_ApolloMultiError) AllErrors() []error { return m } + +// RemoteConfig_ApolloValidationError is the validation error returned by +// RemoteConfig_Apollo.Validate if the designated constraints aren't met. +type RemoteConfig_ApolloValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RemoteConfig_ApolloValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RemoteConfig_ApolloValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RemoteConfig_ApolloValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RemoteConfig_ApolloValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RemoteConfig_ApolloValidationError) ErrorName() string { + return "RemoteConfig_ApolloValidationError" +} + +// Error satisfies the builtin error interface +func (e RemoteConfig_ApolloValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRemoteConfig_Apollo.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RemoteConfig_ApolloValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RemoteConfig_ApolloValidationError{} + +// Validate checks the field values on RemoteConfig_Kubernetes with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *RemoteConfig_Kubernetes) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on RemoteConfig_Kubernetes with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// RemoteConfig_KubernetesMultiError, or nil if none found. +func (m *RemoteConfig_Kubernetes) ValidateAll() error { + return m.validate(true) +} + +func (m *RemoteConfig_Kubernetes) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Namespace + + if len(errors) > 0 { + return RemoteConfig_KubernetesMultiError(errors) + } + + return nil +} + +// RemoteConfig_KubernetesMultiError is an error wrapping multiple validation +// errors returned by RemoteConfig_Kubernetes.ValidateAll() if the designated +// constraints aren't met. +type RemoteConfig_KubernetesMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m RemoteConfig_KubernetesMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m RemoteConfig_KubernetesMultiError) AllErrors() []error { return m } + +// RemoteConfig_KubernetesValidationError is the validation error returned by +// RemoteConfig_Kubernetes.Validate if the designated constraints aren't met. +type RemoteConfig_KubernetesValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RemoteConfig_KubernetesValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RemoteConfig_KubernetesValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RemoteConfig_KubernetesValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RemoteConfig_KubernetesValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RemoteConfig_KubernetesValidationError) ErrorName() string { + return "RemoteConfig_KubernetesValidationError" +} + +// Error satisfies the builtin error interface +func (e RemoteConfig_KubernetesValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRemoteConfig_Kubernetes.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RemoteConfig_KubernetesValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RemoteConfig_KubernetesValidationError{} + +// Validate checks the field values on RemoteConfig_Polaris with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *RemoteConfig_Polaris) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on RemoteConfig_Polaris with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// RemoteConfig_PolarisMultiError, or nil if none found. +func (m *RemoteConfig_Polaris) ValidateAll() error { + return m.validate(true) +} + +func (m *RemoteConfig_Polaris) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return RemoteConfig_PolarisMultiError(errors) + } + + return nil +} + +// RemoteConfig_PolarisMultiError is an error wrapping multiple validation +// errors returned by RemoteConfig_Polaris.ValidateAll() if the designated +// constraints aren't met. +type RemoteConfig_PolarisMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m RemoteConfig_PolarisMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m RemoteConfig_PolarisMultiError) AllErrors() []error { return m } + +// RemoteConfig_PolarisValidationError is the validation error returned by +// RemoteConfig_Polaris.Validate if the designated constraints aren't met. +type RemoteConfig_PolarisValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RemoteConfig_PolarisValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RemoteConfig_PolarisValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RemoteConfig_PolarisValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RemoteConfig_PolarisValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RemoteConfig_PolarisValidationError) ErrorName() string { + return "RemoteConfig_PolarisValidationError" +} + +// Error satisfies the builtin error interface +func (e RemoteConfig_PolarisValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRemoteConfig_Polaris.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RemoteConfig_PolarisValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RemoteConfig_PolarisValidationError{} diff --git a/orm/ent/gen/api/go/common/conf/data.pb.go b/orm/ent/gen/api/go/common/conf/data.pb.go new file mode 100644 index 0000000..19edc41 --- /dev/null +++ b/orm/ent/gen/api/go/common/conf/data.pb.go @@ -0,0 +1,413 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: common/conf/data.proto + +package conf + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 数据 +type Data struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Database *Data_Database `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` // 数据库 + Redis *Data_Redis `protobuf:"bytes,2,opt,name=redis,proto3" json:"redis,omitempty"` // Redis +} + +func (x *Data) Reset() { + *x = Data{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_data_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Data) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Data) ProtoMessage() {} + +func (x *Data) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_data_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Data.ProtoReflect.Descriptor instead. +func (*Data) Descriptor() ([]byte, []int) { + return file_common_conf_data_proto_rawDescGZIP(), []int{0} +} + +func (x *Data) GetDatabase() *Data_Database { + if x != nil { + return x.Database + } + return nil +} + +func (x *Data) GetRedis() *Data_Redis { + if x != nil { + return x.Redis + } + return nil +} + +// 数据库 +type Data_Database struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Driver string `protobuf:"bytes,1,opt,name=driver,proto3" json:"driver,omitempty"` // 驱动名:mysql、postgresql、mongodb、sqlite…… + Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` // 数据源(DSN字符串) + Migrate bool `protobuf:"varint,3,opt,name=migrate,proto3" json:"migrate,omitempty"` // 数据迁移开关 + MaxIdleConnections int32 `protobuf:"varint,4,opt,name=max_idle_connections,json=maxIdleConnections,proto3" json:"max_idle_connections,omitempty"` // 连接池最大空闲连接数 + MaxOpenConnections int32 `protobuf:"varint,5,opt,name=max_open_connections,json=maxOpenConnections,proto3" json:"max_open_connections,omitempty"` // 连接池最大打开连接数 + ConnectionMaxLifetime *durationpb.Duration `protobuf:"bytes,6,opt,name=connection_max_lifetime,json=connectionMaxLifetime,proto3" json:"connection_max_lifetime,omitempty"` // 连接可重用的最大时间长度 +} + +func (x *Data_Database) Reset() { + *x = Data_Database{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_data_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Data_Database) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Data_Database) ProtoMessage() {} + +func (x *Data_Database) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_data_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Data_Database.ProtoReflect.Descriptor instead. +func (*Data_Database) Descriptor() ([]byte, []int) { + return file_common_conf_data_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *Data_Database) GetDriver() string { + if x != nil { + return x.Driver + } + return "" +} + +func (x *Data_Database) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + +func (x *Data_Database) GetMigrate() bool { + if x != nil { + return x.Migrate + } + return false +} + +func (x *Data_Database) GetMaxIdleConnections() int32 { + if x != nil { + return x.MaxIdleConnections + } + return 0 +} + +func (x *Data_Database) GetMaxOpenConnections() int32 { + if x != nil { + return x.MaxOpenConnections + } + return 0 +} + +func (x *Data_Database) GetConnectionMaxLifetime() *durationpb.Duration { + if x != nil { + return x.ConnectionMaxLifetime + } + return nil +} + +// redis +type Data_Redis struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` // 网络 + Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` // 服务端地址 + Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` // 密码 + Db int32 `protobuf:"varint,4,opt,name=db,proto3" json:"db,omitempty"` // 数据库索引 + DialTimeout *durationpb.Duration `protobuf:"bytes,5,opt,name=dial_timeout,json=dialTimeout,proto3" json:"dial_timeout,omitempty"` // 连接超时时间 + ReadTimeout *durationpb.Duration `protobuf:"bytes,6,opt,name=read_timeout,json=readTimeout,proto3" json:"read_timeout,omitempty"` // 读取超时时间 + WriteTimeout *durationpb.Duration `protobuf:"bytes,7,opt,name=write_timeout,json=writeTimeout,proto3" json:"write_timeout,omitempty"` // 写入超时时间 +} + +func (x *Data_Redis) Reset() { + *x = Data_Redis{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_data_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Data_Redis) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Data_Redis) ProtoMessage() {} + +func (x *Data_Redis) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_data_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Data_Redis.ProtoReflect.Descriptor instead. +func (*Data_Redis) Descriptor() ([]byte, []int) { + return file_common_conf_data_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *Data_Redis) GetNetwork() string { + if x != nil { + return x.Network + } + return "" +} + +func (x *Data_Redis) GetAddr() string { + if x != nil { + return x.Addr + } + return "" +} + +func (x *Data_Redis) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +func (x *Data_Redis) GetDb() int32 { + if x != nil { + return x.Db + } + return 0 +} + +func (x *Data_Redis) GetDialTimeout() *durationpb.Duration { + if x != nil { + return x.DialTimeout + } + return nil +} + +func (x *Data_Redis) GetReadTimeout() *durationpb.Duration { + if x != nil { + return x.ReadTimeout + } + return nil +} + +func (x *Data_Redis) GetWriteTimeout() *durationpb.Duration { + if x != nil { + return x.WriteTimeout + } + return nil +} + +var File_common_conf_data_proto protoreflect.FileDescriptor + +var file_common_conf_data_proto_rawDesc = []byte{ + 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x64, 0x61, + 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9b, 0x05, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x36, + 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, + 0x61, 0x74, 0x61, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x08, 0x64, 0x61, + 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, + 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x64, 0x69, 0x73, 0x52, 0x05, + 0x72, 0x65, 0x64, 0x69, 0x73, 0x1a, 0x8b, 0x02, 0x0a, 0x08, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, + 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x07, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x12, 0x30, 0x0a, 0x14, + 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x64, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x6d, 0x61, 0x78, 0x49, + 0x64, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x30, + 0x0a, 0x14, 0x6d, 0x61, 0x78, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x6d, 0x61, + 0x78, 0x4f, 0x70, 0x65, 0x6e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x51, 0x0a, 0x17, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, + 0x61, 0x78, 0x5f, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x15, 0x63, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x78, 0x4c, 0x69, 0x66, 0x65, 0x74, + 0x69, 0x6d, 0x65, 0x1a, 0x9d, 0x02, 0x0a, 0x05, 0x52, 0x65, 0x64, 0x69, 0x73, 0x12, 0x18, 0x0a, + 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x64, 0x62, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x02, 0x64, 0x62, 0x12, 0x3c, 0x0a, 0x0c, 0x64, 0x69, 0x61, 0x6c, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x69, 0x61, 0x6c, 0x54, 0x69, + 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3c, 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, + 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x6f, 0x75, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, + 0x6f, 0x75, 0x74, 0x42, 0x30, 0x5a, 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x65, 0x6e, + 0x74, 0x2d, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, + 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_common_conf_data_proto_rawDescOnce sync.Once + file_common_conf_data_proto_rawDescData = file_common_conf_data_proto_rawDesc +) + +func file_common_conf_data_proto_rawDescGZIP() []byte { + file_common_conf_data_proto_rawDescOnce.Do(func() { + file_common_conf_data_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_conf_data_proto_rawDescData) + }) + return file_common_conf_data_proto_rawDescData +} + +var file_common_conf_data_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_common_conf_data_proto_goTypes = []interface{}{ + (*Data)(nil), // 0: common.conf.Data + (*Data_Database)(nil), // 1: common.conf.Data.Database + (*Data_Redis)(nil), // 2: common.conf.Data.Redis + (*durationpb.Duration)(nil), // 3: google.protobuf.Duration +} +var file_common_conf_data_proto_depIdxs = []int32{ + 1, // 0: common.conf.Data.database:type_name -> common.conf.Data.Database + 2, // 1: common.conf.Data.redis:type_name -> common.conf.Data.Redis + 3, // 2: common.conf.Data.Database.connection_max_lifetime:type_name -> google.protobuf.Duration + 3, // 3: common.conf.Data.Redis.dial_timeout:type_name -> google.protobuf.Duration + 3, // 4: common.conf.Data.Redis.read_timeout:type_name -> google.protobuf.Duration + 3, // 5: common.conf.Data.Redis.write_timeout:type_name -> google.protobuf.Duration + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_common_conf_data_proto_init() } +func file_common_conf_data_proto_init() { + if File_common_conf_data_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_common_conf_data_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Data); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_data_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Data_Database); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_data_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Data_Redis); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_conf_data_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_conf_data_proto_goTypes, + DependencyIndexes: file_common_conf_data_proto_depIdxs, + MessageInfos: file_common_conf_data_proto_msgTypes, + }.Build() + File_common_conf_data_proto = out.File + file_common_conf_data_proto_rawDesc = nil + file_common_conf_data_proto_goTypes = nil + file_common_conf_data_proto_depIdxs = nil +} diff --git a/orm/ent/gen/api/go/common/conf/data.pb.validate.go b/orm/ent/gen/api/go/common/conf/data.pb.validate.go new file mode 100644 index 0000000..d27a95d --- /dev/null +++ b/orm/ent/gen/api/go/common/conf/data.pb.validate.go @@ -0,0 +1,525 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: common/conf/data.proto + +package conf + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on Data with the rules defined in the proto +// definition for this message. If any rules are violated, the first error +// encountered is returned, or nil if there are no violations. +func (m *Data) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Data with the rules defined in the +// proto definition for this message. If any rules are violated, the result is +// a list of violation errors wrapped in DataMultiError, or nil if none found. +func (m *Data) ValidateAll() error { + return m.validate(true) +} + +func (m *Data) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetDatabase()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, DataValidationError{ + field: "Database", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, DataValidationError{ + field: "Database", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDatabase()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DataValidationError{ + field: "Database", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetRedis()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, DataValidationError{ + field: "Redis", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, DataValidationError{ + field: "Redis", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRedis()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DataValidationError{ + field: "Redis", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return DataMultiError(errors) + } + + return nil +} + +// DataMultiError is an error wrapping multiple validation errors returned by +// Data.ValidateAll() if the designated constraints aren't met. +type DataMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m DataMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m DataMultiError) AllErrors() []error { return m } + +// DataValidationError is the validation error returned by Data.Validate if the +// designated constraints aren't met. +type DataValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DataValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DataValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DataValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DataValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DataValidationError) ErrorName() string { return "DataValidationError" } + +// Error satisfies the builtin error interface +func (e DataValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sData.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DataValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DataValidationError{} + +// Validate checks the field values on Data_Database with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Data_Database) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Data_Database with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Data_DatabaseMultiError, or +// nil if none found. +func (m *Data_Database) ValidateAll() error { + return m.validate(true) +} + +func (m *Data_Database) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Driver + + // no validation rules for Source + + // no validation rules for Migrate + + // no validation rules for MaxIdleConnections + + // no validation rules for MaxOpenConnections + + if all { + switch v := interface{}(m.GetConnectionMaxLifetime()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Data_DatabaseValidationError{ + field: "ConnectionMaxLifetime", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Data_DatabaseValidationError{ + field: "ConnectionMaxLifetime", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetConnectionMaxLifetime()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Data_DatabaseValidationError{ + field: "ConnectionMaxLifetime", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return Data_DatabaseMultiError(errors) + } + + return nil +} + +// Data_DatabaseMultiError is an error wrapping multiple validation errors +// returned by Data_Database.ValidateAll() if the designated constraints +// aren't met. +type Data_DatabaseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Data_DatabaseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Data_DatabaseMultiError) AllErrors() []error { return m } + +// Data_DatabaseValidationError is the validation error returned by +// Data_Database.Validate if the designated constraints aren't met. +type Data_DatabaseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Data_DatabaseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Data_DatabaseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Data_DatabaseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Data_DatabaseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Data_DatabaseValidationError) ErrorName() string { return "Data_DatabaseValidationError" } + +// Error satisfies the builtin error interface +func (e Data_DatabaseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sData_Database.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Data_DatabaseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Data_DatabaseValidationError{} + +// Validate checks the field values on Data_Redis with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Data_Redis) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Data_Redis with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Data_RedisMultiError, or +// nil if none found. +func (m *Data_Redis) ValidateAll() error { + return m.validate(true) +} + +func (m *Data_Redis) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Network + + // no validation rules for Addr + + // no validation rules for Password + + // no validation rules for Db + + if all { + switch v := interface{}(m.GetDialTimeout()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Data_RedisValidationError{ + field: "DialTimeout", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Data_RedisValidationError{ + field: "DialTimeout", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDialTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Data_RedisValidationError{ + field: "DialTimeout", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetReadTimeout()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Data_RedisValidationError{ + field: "ReadTimeout", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Data_RedisValidationError{ + field: "ReadTimeout", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetReadTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Data_RedisValidationError{ + field: "ReadTimeout", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetWriteTimeout()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Data_RedisValidationError{ + field: "WriteTimeout", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Data_RedisValidationError{ + field: "WriteTimeout", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetWriteTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Data_RedisValidationError{ + field: "WriteTimeout", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return Data_RedisMultiError(errors) + } + + return nil +} + +// Data_RedisMultiError is an error wrapping multiple validation errors +// returned by Data_Redis.ValidateAll() if the designated constraints aren't met. +type Data_RedisMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Data_RedisMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Data_RedisMultiError) AllErrors() []error { return m } + +// Data_RedisValidationError is the validation error returned by +// Data_Redis.Validate if the designated constraints aren't met. +type Data_RedisValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Data_RedisValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Data_RedisValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Data_RedisValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Data_RedisValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Data_RedisValidationError) ErrorName() string { return "Data_RedisValidationError" } + +// Error satisfies the builtin error interface +func (e Data_RedisValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sData_Redis.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Data_RedisValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Data_RedisValidationError{} diff --git a/orm/ent/gen/api/go/common/conf/logger.pb.go b/orm/ent/gen/api/go/common/conf/logger.pb.go new file mode 100644 index 0000000..1b6ed22 --- /dev/null +++ b/orm/ent/gen/api/go/common/conf/logger.pb.go @@ -0,0 +1,663 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: common/conf/logger.proto + +package conf + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 日志 +type Logger struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Zap *Logger_Zap `protobuf:"bytes,2,opt,name=zap,proto3" json:"zap,omitempty"` + Logrus *Logger_Logrus `protobuf:"bytes,3,opt,name=logrus,proto3" json:"logrus,omitempty"` + Fluent *Logger_Fluent `protobuf:"bytes,4,opt,name=fluent,proto3" json:"fluent,omitempty"` + Aliyun *Logger_Aliyun `protobuf:"bytes,5,opt,name=aliyun,proto3" json:"aliyun,omitempty"` + Tencent *Logger_Tencent `protobuf:"bytes,6,opt,name=tencent,proto3" json:"tencent,omitempty"` +} + +func (x *Logger) Reset() { + *x = Logger{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_logger_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Logger) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Logger) ProtoMessage() {} + +func (x *Logger) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_logger_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Logger.ProtoReflect.Descriptor instead. +func (*Logger) Descriptor() ([]byte, []int) { + return file_common_conf_logger_proto_rawDescGZIP(), []int{0} +} + +func (x *Logger) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Logger) GetZap() *Logger_Zap { + if x != nil { + return x.Zap + } + return nil +} + +func (x *Logger) GetLogrus() *Logger_Logrus { + if x != nil { + return x.Logrus + } + return nil +} + +func (x *Logger) GetFluent() *Logger_Fluent { + if x != nil { + return x.Fluent + } + return nil +} + +func (x *Logger) GetAliyun() *Logger_Aliyun { + if x != nil { + return x.Aliyun + } + return nil +} + +func (x *Logger) GetTencent() *Logger_Tencent { + if x != nil { + return x.Tencent + } + return nil +} + +// Zap +type Logger_Zap struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"` // + Level string `protobuf:"bytes,2,opt,name=level,proto3" json:"level,omitempty"` // + MaxSize int32 `protobuf:"varint,3,opt,name=max_size,json=maxSize,proto3" json:"max_size,omitempty"` // + MaxAge int32 `protobuf:"varint,4,opt,name=max_age,json=maxAge,proto3" json:"max_age,omitempty"` // + MaxBackups int32 `protobuf:"varint,5,opt,name=max_backups,json=maxBackups,proto3" json:"max_backups,omitempty"` // +} + +func (x *Logger_Zap) Reset() { + *x = Logger_Zap{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_logger_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Logger_Zap) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Logger_Zap) ProtoMessage() {} + +func (x *Logger_Zap) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_logger_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Logger_Zap.ProtoReflect.Descriptor instead. +func (*Logger_Zap) Descriptor() ([]byte, []int) { + return file_common_conf_logger_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *Logger_Zap) GetFilename() string { + if x != nil { + return x.Filename + } + return "" +} + +func (x *Logger_Zap) GetLevel() string { + if x != nil { + return x.Level + } + return "" +} + +func (x *Logger_Zap) GetMaxSize() int32 { + if x != nil { + return x.MaxSize + } + return 0 +} + +func (x *Logger_Zap) GetMaxAge() int32 { + if x != nil { + return x.MaxAge + } + return 0 +} + +func (x *Logger_Zap) GetMaxBackups() int32 { + if x != nil { + return x.MaxBackups + } + return 0 +} + +// logrus +type Logger_Logrus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Level string `protobuf:"bytes,1,opt,name=level,proto3" json:"level,omitempty"` // 日志等级 + Formatter string `protobuf:"bytes,2,opt,name=formatter,proto3" json:"formatter,omitempty"` // 输出格式:text, json. + TimestampFormat string `protobuf:"bytes,3,opt,name=timestamp_format,json=timestampFormat,proto3" json:"timestamp_format,omitempty"` // 定义时间戳格式,例如:"2006-01-02 15:04:05" + DisableColors bool `protobuf:"varint,4,opt,name=disable_colors,json=disableColors,proto3" json:"disable_colors,omitempty"` // 不需要彩色日志 + DisableTimestamp bool `protobuf:"varint,5,opt,name=disable_timestamp,json=disableTimestamp,proto3" json:"disable_timestamp,omitempty"` // 不需要时间戳 +} + +func (x *Logger_Logrus) Reset() { + *x = Logger_Logrus{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_logger_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Logger_Logrus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Logger_Logrus) ProtoMessage() {} + +func (x *Logger_Logrus) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_logger_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Logger_Logrus.ProtoReflect.Descriptor instead. +func (*Logger_Logrus) Descriptor() ([]byte, []int) { + return file_common_conf_logger_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *Logger_Logrus) GetLevel() string { + if x != nil { + return x.Level + } + return "" +} + +func (x *Logger_Logrus) GetFormatter() string { + if x != nil { + return x.Formatter + } + return "" +} + +func (x *Logger_Logrus) GetTimestampFormat() string { + if x != nil { + return x.TimestampFormat + } + return "" +} + +func (x *Logger_Logrus) GetDisableColors() bool { + if x != nil { + return x.DisableColors + } + return false +} + +func (x *Logger_Logrus) GetDisableTimestamp() bool { + if x != nil { + return x.DisableTimestamp + } + return false +} + +// Fluent +type Logger_Fluent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // 公网接入地址 +} + +func (x *Logger_Fluent) Reset() { + *x = Logger_Fluent{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_logger_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Logger_Fluent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Logger_Fluent) ProtoMessage() {} + +func (x *Logger_Fluent) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_logger_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Logger_Fluent.ProtoReflect.Descriptor instead. +func (*Logger_Fluent) Descriptor() ([]byte, []int) { + return file_common_conf_logger_proto_rawDescGZIP(), []int{0, 2} +} + +func (x *Logger_Fluent) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +// 阿里云 +type Logger_Aliyun struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // 公网接入地址 + Project string `protobuf:"bytes,2,opt,name=project,proto3" json:"project,omitempty"` // + AccessKey string `protobuf:"bytes,3,opt,name=access_key,json=accessKey,proto3" json:"access_key,omitempty"` // 访问密钥ID + AccessSecret string `protobuf:"bytes,4,opt,name=access_secret,json=accessSecret,proto3" json:"access_secret,omitempty"` // 访问密钥 +} + +func (x *Logger_Aliyun) Reset() { + *x = Logger_Aliyun{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_logger_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Logger_Aliyun) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Logger_Aliyun) ProtoMessage() {} + +func (x *Logger_Aliyun) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_logger_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Logger_Aliyun.ProtoReflect.Descriptor instead. +func (*Logger_Aliyun) Descriptor() ([]byte, []int) { + return file_common_conf_logger_proto_rawDescGZIP(), []int{0, 3} +} + +func (x *Logger_Aliyun) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +func (x *Logger_Aliyun) GetProject() string { + if x != nil { + return x.Project + } + return "" +} + +func (x *Logger_Aliyun) GetAccessKey() string { + if x != nil { + return x.AccessKey + } + return "" +} + +func (x *Logger_Aliyun) GetAccessSecret() string { + if x != nil { + return x.AccessSecret + } + return "" +} + +// 腾讯 +type Logger_Tencent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // 公网接入地址 + TopicId string `protobuf:"bytes,2,opt,name=topic_id,json=topicId,proto3" json:"topic_id,omitempty"` // + AccessKey string `protobuf:"bytes,3,opt,name=access_key,json=accessKey,proto3" json:"access_key,omitempty"` // 访问密钥ID + AccessSecret string `protobuf:"bytes,4,opt,name=access_secret,json=accessSecret,proto3" json:"access_secret,omitempty"` // 访问密钥 +} + +func (x *Logger_Tencent) Reset() { + *x = Logger_Tencent{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_logger_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Logger_Tencent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Logger_Tencent) ProtoMessage() {} + +func (x *Logger_Tencent) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_logger_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Logger_Tencent.ProtoReflect.Descriptor instead. +func (*Logger_Tencent) Descriptor() ([]byte, []int) { + return file_common_conf_logger_proto_rawDescGZIP(), []int{0, 4} +} + +func (x *Logger_Tencent) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +func (x *Logger_Tencent) GetTopicId() string { + if x != nil { + return x.TopicId + } + return "" +} + +func (x *Logger_Tencent) GetAccessKey() string { + if x != nil { + return x.AccessKey + } + return "" +} + +func (x *Logger_Tencent) GetAccessSecret() string { + if x != nil { + return x.AccessSecret + } + return "" +} + +var File_common_conf_logger_proto protoreflect.FileDescriptor + +var file_common_conf_logger_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x6c, 0x6f, + 0x67, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x22, 0x99, 0x07, 0x0a, 0x06, 0x4c, 0x6f, 0x67, 0x67, + 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x29, 0x0a, 0x03, 0x7a, 0x61, 0x70, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, + 0x66, 0x2e, 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x5a, 0x61, 0x70, 0x52, 0x03, 0x7a, 0x61, + 0x70, 0x12, 0x32, 0x0a, 0x06, 0x6c, 0x6f, 0x67, 0x72, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, + 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x72, 0x75, 0x73, 0x52, 0x06, 0x6c, + 0x6f, 0x67, 0x72, 0x75, 0x73, 0x12, 0x32, 0x0a, 0x06, 0x66, 0x6c, 0x75, 0x65, 0x6e, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, + 0x6f, 0x6e, 0x66, 0x2e, 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x46, 0x6c, 0x75, 0x65, 0x6e, + 0x74, 0x52, 0x06, 0x66, 0x6c, 0x75, 0x65, 0x6e, 0x74, 0x12, 0x32, 0x0a, 0x06, 0x61, 0x6c, 0x69, + 0x79, 0x75, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x41, + 0x6c, 0x69, 0x79, 0x75, 0x6e, 0x52, 0x06, 0x61, 0x6c, 0x69, 0x79, 0x75, 0x6e, 0x12, 0x35, 0x0a, + 0x07, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4c, 0x6f, 0x67, + 0x67, 0x65, 0x72, 0x2e, 0x54, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x52, 0x07, 0x74, 0x65, 0x6e, + 0x63, 0x65, 0x6e, 0x74, 0x1a, 0x8c, 0x01, 0x0a, 0x03, 0x5a, 0x61, 0x70, 0x12, 0x1a, 0x0a, 0x08, + 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, + 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x19, + 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x6d, 0x61, 0x78, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x61, 0x78, + 0x5f, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6d, 0x61, 0x78, 0x41, + 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, + 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6d, 0x61, 0x78, 0x42, 0x61, 0x63, 0x6b, + 0x75, 0x70, 0x73, 0x1a, 0xbb, 0x01, 0x0a, 0x06, 0x4c, 0x6f, 0x67, 0x72, 0x75, 0x73, 0x12, 0x14, + 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, + 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, + 0x65, 0x72, 0x12, 0x29, 0x0a, 0x10, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, + 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x25, 0x0a, + 0x0e, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x73, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x6f, + 0x6c, 0x6f, 0x72, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x10, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x1a, 0x24, 0x0a, 0x06, 0x46, 0x6c, 0x75, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x65, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x1a, 0x82, 0x01, 0x0a, 0x06, 0x41, 0x6c, 0x69, 0x79, + 0x75, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x18, + 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x1a, 0x84, 0x01, 0x0a, + 0x07, 0x54, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x49, 0x64, 0x12, + 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x23, + 0x0a, 0x0d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x63, + 0x72, 0x65, 0x74, 0x42, 0x30, 0x5a, 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x65, 0x6e, + 0x74, 0x2d, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, + 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_common_conf_logger_proto_rawDescOnce sync.Once + file_common_conf_logger_proto_rawDescData = file_common_conf_logger_proto_rawDesc +) + +func file_common_conf_logger_proto_rawDescGZIP() []byte { + file_common_conf_logger_proto_rawDescOnce.Do(func() { + file_common_conf_logger_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_conf_logger_proto_rawDescData) + }) + return file_common_conf_logger_proto_rawDescData +} + +var file_common_conf_logger_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_common_conf_logger_proto_goTypes = []interface{}{ + (*Logger)(nil), // 0: common.conf.Logger + (*Logger_Zap)(nil), // 1: common.conf.Logger.Zap + (*Logger_Logrus)(nil), // 2: common.conf.Logger.Logrus + (*Logger_Fluent)(nil), // 3: common.conf.Logger.Fluent + (*Logger_Aliyun)(nil), // 4: common.conf.Logger.Aliyun + (*Logger_Tencent)(nil), // 5: common.conf.Logger.Tencent +} +var file_common_conf_logger_proto_depIdxs = []int32{ + 1, // 0: common.conf.Logger.zap:type_name -> common.conf.Logger.Zap + 2, // 1: common.conf.Logger.logrus:type_name -> common.conf.Logger.Logrus + 3, // 2: common.conf.Logger.fluent:type_name -> common.conf.Logger.Fluent + 4, // 3: common.conf.Logger.aliyun:type_name -> common.conf.Logger.Aliyun + 5, // 4: common.conf.Logger.tencent:type_name -> common.conf.Logger.Tencent + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_common_conf_logger_proto_init() } +func file_common_conf_logger_proto_init() { + if File_common_conf_logger_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_common_conf_logger_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Logger); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_logger_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Logger_Zap); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_logger_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Logger_Logrus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_logger_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Logger_Fluent); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_logger_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Logger_Aliyun); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_logger_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Logger_Tencent); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_conf_logger_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_conf_logger_proto_goTypes, + DependencyIndexes: file_common_conf_logger_proto_depIdxs, + MessageInfos: file_common_conf_logger_proto_msgTypes, + }.Build() + File_common_conf_logger_proto = out.File + file_common_conf_logger_proto_rawDesc = nil + file_common_conf_logger_proto_goTypes = nil + file_common_conf_logger_proto_depIdxs = nil +} diff --git a/orm/ent/gen/api/go/common/conf/logger.pb.validate.go b/orm/ent/gen/api/go/common/conf/logger.pb.validate.go new file mode 100644 index 0000000..45a32aa --- /dev/null +++ b/orm/ent/gen/api/go/common/conf/logger.pb.validate.go @@ -0,0 +1,818 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: common/conf/logger.proto + +package conf + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on Logger with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Logger) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Logger with the rules defined in the +// proto definition for this message. If any rules are violated, the result is +// a list of violation errors wrapped in LoggerMultiError, or nil if none found. +func (m *Logger) ValidateAll() error { + return m.validate(true) +} + +func (m *Logger) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Type + + if all { + switch v := interface{}(m.GetZap()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, LoggerValidationError{ + field: "Zap", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, LoggerValidationError{ + field: "Zap", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetZap()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return LoggerValidationError{ + field: "Zap", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetLogrus()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, LoggerValidationError{ + field: "Logrus", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, LoggerValidationError{ + field: "Logrus", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetLogrus()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return LoggerValidationError{ + field: "Logrus", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetFluent()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, LoggerValidationError{ + field: "Fluent", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, LoggerValidationError{ + field: "Fluent", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetFluent()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return LoggerValidationError{ + field: "Fluent", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetAliyun()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, LoggerValidationError{ + field: "Aliyun", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, LoggerValidationError{ + field: "Aliyun", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetAliyun()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return LoggerValidationError{ + field: "Aliyun", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetTencent()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, LoggerValidationError{ + field: "Tencent", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, LoggerValidationError{ + field: "Tencent", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTencent()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return LoggerValidationError{ + field: "Tencent", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return LoggerMultiError(errors) + } + + return nil +} + +// LoggerMultiError is an error wrapping multiple validation errors returned by +// Logger.ValidateAll() if the designated constraints aren't met. +type LoggerMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m LoggerMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m LoggerMultiError) AllErrors() []error { return m } + +// LoggerValidationError is the validation error returned by Logger.Validate if +// the designated constraints aren't met. +type LoggerValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e LoggerValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e LoggerValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e LoggerValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e LoggerValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e LoggerValidationError) ErrorName() string { return "LoggerValidationError" } + +// Error satisfies the builtin error interface +func (e LoggerValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sLogger.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = LoggerValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = LoggerValidationError{} + +// Validate checks the field values on Logger_Zap with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Logger_Zap) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Logger_Zap with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Logger_ZapMultiError, or +// nil if none found. +func (m *Logger_Zap) ValidateAll() error { + return m.validate(true) +} + +func (m *Logger_Zap) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Filename + + // no validation rules for Level + + // no validation rules for MaxSize + + // no validation rules for MaxAge + + // no validation rules for MaxBackups + + if len(errors) > 0 { + return Logger_ZapMultiError(errors) + } + + return nil +} + +// Logger_ZapMultiError is an error wrapping multiple validation errors +// returned by Logger_Zap.ValidateAll() if the designated constraints aren't met. +type Logger_ZapMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Logger_ZapMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Logger_ZapMultiError) AllErrors() []error { return m } + +// Logger_ZapValidationError is the validation error returned by +// Logger_Zap.Validate if the designated constraints aren't met. +type Logger_ZapValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Logger_ZapValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Logger_ZapValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Logger_ZapValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Logger_ZapValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Logger_ZapValidationError) ErrorName() string { return "Logger_ZapValidationError" } + +// Error satisfies the builtin error interface +func (e Logger_ZapValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sLogger_Zap.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Logger_ZapValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Logger_ZapValidationError{} + +// Validate checks the field values on Logger_Logrus with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Logger_Logrus) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Logger_Logrus with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Logger_LogrusMultiError, or +// nil if none found. +func (m *Logger_Logrus) ValidateAll() error { + return m.validate(true) +} + +func (m *Logger_Logrus) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Level + + // no validation rules for Formatter + + // no validation rules for TimestampFormat + + // no validation rules for DisableColors + + // no validation rules for DisableTimestamp + + if len(errors) > 0 { + return Logger_LogrusMultiError(errors) + } + + return nil +} + +// Logger_LogrusMultiError is an error wrapping multiple validation errors +// returned by Logger_Logrus.ValidateAll() if the designated constraints +// aren't met. +type Logger_LogrusMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Logger_LogrusMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Logger_LogrusMultiError) AllErrors() []error { return m } + +// Logger_LogrusValidationError is the validation error returned by +// Logger_Logrus.Validate if the designated constraints aren't met. +type Logger_LogrusValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Logger_LogrusValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Logger_LogrusValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Logger_LogrusValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Logger_LogrusValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Logger_LogrusValidationError) ErrorName() string { return "Logger_LogrusValidationError" } + +// Error satisfies the builtin error interface +func (e Logger_LogrusValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sLogger_Logrus.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Logger_LogrusValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Logger_LogrusValidationError{} + +// Validate checks the field values on Logger_Fluent with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Logger_Fluent) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Logger_Fluent with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Logger_FluentMultiError, or +// nil if none found. +func (m *Logger_Fluent) ValidateAll() error { + return m.validate(true) +} + +func (m *Logger_Fluent) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Endpoint + + if len(errors) > 0 { + return Logger_FluentMultiError(errors) + } + + return nil +} + +// Logger_FluentMultiError is an error wrapping multiple validation errors +// returned by Logger_Fluent.ValidateAll() if the designated constraints +// aren't met. +type Logger_FluentMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Logger_FluentMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Logger_FluentMultiError) AllErrors() []error { return m } + +// Logger_FluentValidationError is the validation error returned by +// Logger_Fluent.Validate if the designated constraints aren't met. +type Logger_FluentValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Logger_FluentValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Logger_FluentValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Logger_FluentValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Logger_FluentValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Logger_FluentValidationError) ErrorName() string { return "Logger_FluentValidationError" } + +// Error satisfies the builtin error interface +func (e Logger_FluentValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sLogger_Fluent.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Logger_FluentValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Logger_FluentValidationError{} + +// Validate checks the field values on Logger_Aliyun with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Logger_Aliyun) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Logger_Aliyun with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Logger_AliyunMultiError, or +// nil if none found. +func (m *Logger_Aliyun) ValidateAll() error { + return m.validate(true) +} + +func (m *Logger_Aliyun) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Endpoint + + // no validation rules for Project + + // no validation rules for AccessKey + + // no validation rules for AccessSecret + + if len(errors) > 0 { + return Logger_AliyunMultiError(errors) + } + + return nil +} + +// Logger_AliyunMultiError is an error wrapping multiple validation errors +// returned by Logger_Aliyun.ValidateAll() if the designated constraints +// aren't met. +type Logger_AliyunMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Logger_AliyunMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Logger_AliyunMultiError) AllErrors() []error { return m } + +// Logger_AliyunValidationError is the validation error returned by +// Logger_Aliyun.Validate if the designated constraints aren't met. +type Logger_AliyunValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Logger_AliyunValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Logger_AliyunValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Logger_AliyunValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Logger_AliyunValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Logger_AliyunValidationError) ErrorName() string { return "Logger_AliyunValidationError" } + +// Error satisfies the builtin error interface +func (e Logger_AliyunValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sLogger_Aliyun.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Logger_AliyunValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Logger_AliyunValidationError{} + +// Validate checks the field values on Logger_Tencent with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Logger_Tencent) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Logger_Tencent with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Logger_TencentMultiError, +// or nil if none found. +func (m *Logger_Tencent) ValidateAll() error { + return m.validate(true) +} + +func (m *Logger_Tencent) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Endpoint + + // no validation rules for TopicId + + // no validation rules for AccessKey + + // no validation rules for AccessSecret + + if len(errors) > 0 { + return Logger_TencentMultiError(errors) + } + + return nil +} + +// Logger_TencentMultiError is an error wrapping multiple validation errors +// returned by Logger_Tencent.ValidateAll() if the designated constraints +// aren't met. +type Logger_TencentMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Logger_TencentMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Logger_TencentMultiError) AllErrors() []error { return m } + +// Logger_TencentValidationError is the validation error returned by +// Logger_Tencent.Validate if the designated constraints aren't met. +type Logger_TencentValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Logger_TencentValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Logger_TencentValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Logger_TencentValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Logger_TencentValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Logger_TencentValidationError) ErrorName() string { return "Logger_TencentValidationError" } + +// Error satisfies the builtin error interface +func (e Logger_TencentValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sLogger_Tencent.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Logger_TencentValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Logger_TencentValidationError{} diff --git a/orm/ent/gen/api/go/common/conf/middleware.pb.go b/orm/ent/gen/api/go/common/conf/middleware.pb.go new file mode 100644 index 0000000..181ac10 --- /dev/null +++ b/orm/ent/gen/api/go/common/conf/middleware.pb.go @@ -0,0 +1,457 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: common/conf/middleware.proto + +package conf + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + _ "google.golang.org/protobuf/types/known/durationpb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Middleware struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EnableLogging bool `protobuf:"varint,1,opt,name=enable_logging,json=enableLogging,proto3" json:"enable_logging,omitempty"` // 日志开关 + EnableRecovery bool `protobuf:"varint,2,opt,name=enable_recovery,json=enableRecovery,proto3" json:"enable_recovery,omitempty"` // 异常恢复 + EnableTracing bool `protobuf:"varint,3,opt,name=enable_tracing,json=enableTracing,proto3" json:"enable_tracing,omitempty"` // 链路追踪开关 + EnableValidate bool `protobuf:"varint,4,opt,name=enable_validate,json=enableValidate,proto3" json:"enable_validate,omitempty"` // 参数校验开关 + EnableCircuitBreaker bool `protobuf:"varint,5,opt,name=enable_circuit_breaker,json=enableCircuitBreaker,proto3" json:"enable_circuit_breaker,omitempty"` // 熔断器 + Limiter *Middleware_RateLimiter `protobuf:"bytes,6,opt,name=limiter,proto3" json:"limiter,omitempty"` + Metrics *Middleware_Metrics `protobuf:"bytes,7,opt,name=metrics,proto3" json:"metrics,omitempty"` + Auth *Middleware_Auth `protobuf:"bytes,8,opt,name=auth,proto3" json:"auth,omitempty"` +} + +func (x *Middleware) Reset() { + *x = Middleware{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_middleware_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Middleware) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Middleware) ProtoMessage() {} + +func (x *Middleware) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_middleware_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Middleware.ProtoReflect.Descriptor instead. +func (*Middleware) Descriptor() ([]byte, []int) { + return file_common_conf_middleware_proto_rawDescGZIP(), []int{0} +} + +func (x *Middleware) GetEnableLogging() bool { + if x != nil { + return x.EnableLogging + } + return false +} + +func (x *Middleware) GetEnableRecovery() bool { + if x != nil { + return x.EnableRecovery + } + return false +} + +func (x *Middleware) GetEnableTracing() bool { + if x != nil { + return x.EnableTracing + } + return false +} + +func (x *Middleware) GetEnableValidate() bool { + if x != nil { + return x.EnableValidate + } + return false +} + +func (x *Middleware) GetEnableCircuitBreaker() bool { + if x != nil { + return x.EnableCircuitBreaker + } + return false +} + +func (x *Middleware) GetLimiter() *Middleware_RateLimiter { + if x != nil { + return x.Limiter + } + return nil +} + +func (x *Middleware) GetMetrics() *Middleware_Metrics { + if x != nil { + return x.Metrics + } + return nil +} + +func (x *Middleware) GetAuth() *Middleware_Auth { + if x != nil { + return x.Auth + } + return nil +} + +// JWT校验 +type Middleware_Auth struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Method string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"` // JWT签名的算法,支持算法:HS256 + Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` // JWT 秘钥 +} + +func (x *Middleware_Auth) Reset() { + *x = Middleware_Auth{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_middleware_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Middleware_Auth) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Middleware_Auth) ProtoMessage() {} + +func (x *Middleware_Auth) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_middleware_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Middleware_Auth.ProtoReflect.Descriptor instead. +func (*Middleware_Auth) Descriptor() ([]byte, []int) { + return file_common_conf_middleware_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *Middleware_Auth) GetMethod() string { + if x != nil { + return x.Method + } + return "" +} + +func (x *Middleware_Auth) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +// 限流器 +type Middleware_RateLimiter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // 限流器名字,支持:bbr。 +} + +func (x *Middleware_RateLimiter) Reset() { + *x = Middleware_RateLimiter{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_middleware_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Middleware_RateLimiter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Middleware_RateLimiter) ProtoMessage() {} + +func (x *Middleware_RateLimiter) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_middleware_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Middleware_RateLimiter.ProtoReflect.Descriptor instead. +func (*Middleware_RateLimiter) Descriptor() ([]byte, []int) { + return file_common_conf_middleware_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *Middleware_RateLimiter) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// 性能指标 +type Middleware_Metrics struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Histogram bool `protobuf:"varint,1,opt,name=histogram,proto3" json:"histogram,omitempty"` // 直方图 + Counter bool `protobuf:"varint,2,opt,name=counter,proto3" json:"counter,omitempty"` // 计数器 + Gauge bool `protobuf:"varint,3,opt,name=gauge,proto3" json:"gauge,omitempty"` // 仪表盘 + Summary bool `protobuf:"varint,4,opt,name=summary,proto3" json:"summary,omitempty"` // 摘要 +} + +func (x *Middleware_Metrics) Reset() { + *x = Middleware_Metrics{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_middleware_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Middleware_Metrics) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Middleware_Metrics) ProtoMessage() {} + +func (x *Middleware_Metrics) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_middleware_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Middleware_Metrics.ProtoReflect.Descriptor instead. +func (*Middleware_Metrics) Descriptor() ([]byte, []int) { + return file_common_conf_middleware_proto_rawDescGZIP(), []int{0, 2} +} + +func (x *Middleware_Metrics) GetHistogram() bool { + if x != nil { + return x.Histogram + } + return false +} + +func (x *Middleware_Metrics) GetCounter() bool { + if x != nil { + return x.Counter + } + return false +} + +func (x *Middleware_Metrics) GetGauge() bool { + if x != nil { + return x.Gauge + } + return false +} + +func (x *Middleware_Metrics) GetSummary() bool { + if x != nil { + return x.Summary + } + return false +} + +var File_common_conf_middleware_proto protoreflect.FileDescriptor + +var file_common_conf_middleware_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x6d, 0x69, + 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd6, 0x04, 0x0a, 0x0a, + 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0d, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4c, 0x6f, 0x67, 0x67, 0x69, 0x6e, + 0x67, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x6f, + 0x76, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x65, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0d, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x72, 0x61, 0x63, 0x69, 0x6e, + 0x67, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x65, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x12, 0x34, 0x0a, 0x16, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x63, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74, 0x5f, 0x62, 0x72, 0x65, + 0x61, 0x6b, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x65, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x43, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74, 0x42, 0x72, 0x65, 0x61, 0x6b, 0x65, 0x72, + 0x12, 0x3d, 0x0a, 0x07, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, + 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x52, 0x07, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x12, + 0x39, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4d, + 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, + 0x73, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, 0x30, 0x0a, 0x04, 0x61, 0x75, + 0x74, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, + 0x65, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x52, 0x04, 0x61, 0x75, 0x74, 0x68, 0x1a, 0x30, 0x0a, 0x04, + 0x41, 0x75, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x1a, 0x21, + 0x0a, 0x0b, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x1a, 0x71, 0x0a, 0x07, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, 0x1c, 0x0a, 0x09, + 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x09, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x61, 0x75, 0x67, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x05, 0x67, 0x61, 0x75, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, + 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x6d, + 0x6d, 0x61, 0x72, 0x79, 0x42, 0x30, 0x5a, 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x65, + 0x6e, 0x74, 0x2d, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, + 0x66, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_common_conf_middleware_proto_rawDescOnce sync.Once + file_common_conf_middleware_proto_rawDescData = file_common_conf_middleware_proto_rawDesc +) + +func file_common_conf_middleware_proto_rawDescGZIP() []byte { + file_common_conf_middleware_proto_rawDescOnce.Do(func() { + file_common_conf_middleware_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_conf_middleware_proto_rawDescData) + }) + return file_common_conf_middleware_proto_rawDescData +} + +var file_common_conf_middleware_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_common_conf_middleware_proto_goTypes = []interface{}{ + (*Middleware)(nil), // 0: common.conf.Middleware + (*Middleware_Auth)(nil), // 1: common.conf.Middleware.Auth + (*Middleware_RateLimiter)(nil), // 2: common.conf.Middleware.RateLimiter + (*Middleware_Metrics)(nil), // 3: common.conf.Middleware.Metrics +} +var file_common_conf_middleware_proto_depIdxs = []int32{ + 2, // 0: common.conf.Middleware.limiter:type_name -> common.conf.Middleware.RateLimiter + 3, // 1: common.conf.Middleware.metrics:type_name -> common.conf.Middleware.Metrics + 1, // 2: common.conf.Middleware.auth:type_name -> common.conf.Middleware.Auth + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_common_conf_middleware_proto_init() } +func file_common_conf_middleware_proto_init() { + if File_common_conf_middleware_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_common_conf_middleware_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Middleware); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_middleware_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Middleware_Auth); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_middleware_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Middleware_RateLimiter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_middleware_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Middleware_Metrics); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_conf_middleware_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_conf_middleware_proto_goTypes, + DependencyIndexes: file_common_conf_middleware_proto_depIdxs, + MessageInfos: file_common_conf_middleware_proto_msgTypes, + }.Build() + File_common_conf_middleware_proto = out.File + file_common_conf_middleware_proto_rawDesc = nil + file_common_conf_middleware_proto_goTypes = nil + file_common_conf_middleware_proto_depIdxs = nil +} diff --git a/orm/ent/gen/api/go/common/conf/middleware.pb.validate.go b/orm/ent/gen/api/go/common/conf/middleware.pb.validate.go new file mode 100644 index 0000000..1506940 --- /dev/null +++ b/orm/ent/gen/api/go/common/conf/middleware.pb.validate.go @@ -0,0 +1,550 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: common/conf/middleware.proto + +package conf + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on Middleware with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Middleware) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Middleware with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in MiddlewareMultiError, or +// nil if none found. +func (m *Middleware) ValidateAll() error { + return m.validate(true) +} + +func (m *Middleware) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for EnableLogging + + // no validation rules for EnableRecovery + + // no validation rules for EnableTracing + + // no validation rules for EnableValidate + + // no validation rules for EnableCircuitBreaker + + if all { + switch v := interface{}(m.GetLimiter()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, MiddlewareValidationError{ + field: "Limiter", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, MiddlewareValidationError{ + field: "Limiter", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetLimiter()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return MiddlewareValidationError{ + field: "Limiter", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetMetrics()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, MiddlewareValidationError{ + field: "Metrics", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, MiddlewareValidationError{ + field: "Metrics", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMetrics()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return MiddlewareValidationError{ + field: "Metrics", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetAuth()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, MiddlewareValidationError{ + field: "Auth", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, MiddlewareValidationError{ + field: "Auth", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetAuth()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return MiddlewareValidationError{ + field: "Auth", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return MiddlewareMultiError(errors) + } + + return nil +} + +// MiddlewareMultiError is an error wrapping multiple validation errors +// returned by Middleware.ValidateAll() if the designated constraints aren't met. +type MiddlewareMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m MiddlewareMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m MiddlewareMultiError) AllErrors() []error { return m } + +// MiddlewareValidationError is the validation error returned by +// Middleware.Validate if the designated constraints aren't met. +type MiddlewareValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e MiddlewareValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e MiddlewareValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e MiddlewareValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e MiddlewareValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e MiddlewareValidationError) ErrorName() string { return "MiddlewareValidationError" } + +// Error satisfies the builtin error interface +func (e MiddlewareValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sMiddleware.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = MiddlewareValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = MiddlewareValidationError{} + +// Validate checks the field values on Middleware_Auth with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *Middleware_Auth) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Middleware_Auth with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// Middleware_AuthMultiError, or nil if none found. +func (m *Middleware_Auth) ValidateAll() error { + return m.validate(true) +} + +func (m *Middleware_Auth) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Method + + // no validation rules for Key + + if len(errors) > 0 { + return Middleware_AuthMultiError(errors) + } + + return nil +} + +// Middleware_AuthMultiError is an error wrapping multiple validation errors +// returned by Middleware_Auth.ValidateAll() if the designated constraints +// aren't met. +type Middleware_AuthMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Middleware_AuthMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Middleware_AuthMultiError) AllErrors() []error { return m } + +// Middleware_AuthValidationError is the validation error returned by +// Middleware_Auth.Validate if the designated constraints aren't met. +type Middleware_AuthValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Middleware_AuthValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Middleware_AuthValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Middleware_AuthValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Middleware_AuthValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Middleware_AuthValidationError) ErrorName() string { return "Middleware_AuthValidationError" } + +// Error satisfies the builtin error interface +func (e Middleware_AuthValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sMiddleware_Auth.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Middleware_AuthValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Middleware_AuthValidationError{} + +// Validate checks the field values on Middleware_RateLimiter with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *Middleware_RateLimiter) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Middleware_RateLimiter with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// Middleware_RateLimiterMultiError, or nil if none found. +func (m *Middleware_RateLimiter) ValidateAll() error { + return m.validate(true) +} + +func (m *Middleware_RateLimiter) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Name + + if len(errors) > 0 { + return Middleware_RateLimiterMultiError(errors) + } + + return nil +} + +// Middleware_RateLimiterMultiError is an error wrapping multiple validation +// errors returned by Middleware_RateLimiter.ValidateAll() if the designated +// constraints aren't met. +type Middleware_RateLimiterMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Middleware_RateLimiterMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Middleware_RateLimiterMultiError) AllErrors() []error { return m } + +// Middleware_RateLimiterValidationError is the validation error returned by +// Middleware_RateLimiter.Validate if the designated constraints aren't met. +type Middleware_RateLimiterValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Middleware_RateLimiterValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Middleware_RateLimiterValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Middleware_RateLimiterValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Middleware_RateLimiterValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Middleware_RateLimiterValidationError) ErrorName() string { + return "Middleware_RateLimiterValidationError" +} + +// Error satisfies the builtin error interface +func (e Middleware_RateLimiterValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sMiddleware_RateLimiter.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Middleware_RateLimiterValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Middleware_RateLimiterValidationError{} + +// Validate checks the field values on Middleware_Metrics with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *Middleware_Metrics) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Middleware_Metrics with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// Middleware_MetricsMultiError, or nil if none found. +func (m *Middleware_Metrics) ValidateAll() error { + return m.validate(true) +} + +func (m *Middleware_Metrics) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Histogram + + // no validation rules for Counter + + // no validation rules for Gauge + + // no validation rules for Summary + + if len(errors) > 0 { + return Middleware_MetricsMultiError(errors) + } + + return nil +} + +// Middleware_MetricsMultiError is an error wrapping multiple validation errors +// returned by Middleware_Metrics.ValidateAll() if the designated constraints +// aren't met. +type Middleware_MetricsMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Middleware_MetricsMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Middleware_MetricsMultiError) AllErrors() []error { return m } + +// Middleware_MetricsValidationError is the validation error returned by +// Middleware_Metrics.Validate if the designated constraints aren't met. +type Middleware_MetricsValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Middleware_MetricsValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Middleware_MetricsValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Middleware_MetricsValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Middleware_MetricsValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Middleware_MetricsValidationError) ErrorName() string { + return "Middleware_MetricsValidationError" +} + +// Error satisfies the builtin error interface +func (e Middleware_MetricsValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sMiddleware_Metrics.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Middleware_MetricsValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Middleware_MetricsValidationError{} diff --git a/orm/ent/gen/api/go/common/conf/oss.pb.go b/orm/ent/gen/api/go/common/conf/oss.pb.go new file mode 100644 index 0000000..6681d3c --- /dev/null +++ b/orm/ent/gen/api/go/common/conf/oss.pb.go @@ -0,0 +1,269 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: common/conf/oss.proto + +package conf + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type OSS struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Minio *OSS_MinIO `protobuf:"bytes,1,opt,name=minio,proto3" json:"minio,omitempty"` +} + +func (x *OSS) Reset() { + *x = OSS{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_oss_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OSS) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OSS) ProtoMessage() {} + +func (x *OSS) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_oss_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OSS.ProtoReflect.Descriptor instead. +func (*OSS) Descriptor() ([]byte, []int) { + return file_common_conf_oss_proto_rawDescGZIP(), []int{0} +} + +func (x *OSS) GetMinio() *OSS_MinIO { + if x != nil { + return x.Minio + } + return nil +} + +// MinIO +type OSS_MinIO struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // 对端端口 + AccessKey string `protobuf:"bytes,2,opt,name=access_key,json=accessKey,proto3" json:"access_key,omitempty"` // 访问密钥 + SecretKey string `protobuf:"bytes,3,opt,name=secret_key,json=secretKey,proto3" json:"secret_key,omitempty"` // 密钥 + Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` // 令牌 + UseSsl bool `protobuf:"varint,5,opt,name=use_ssl,json=useSsl,proto3" json:"use_ssl,omitempty"` // 使用SSL + UploadHost string `protobuf:"bytes,6,opt,name=upload_host,json=uploadHost,proto3" json:"upload_host,omitempty"` // 上传链接的主机名 + DownloadHost string `protobuf:"bytes,7,opt,name=download_host,json=downloadHost,proto3" json:"download_host,omitempty"` // 下载链接的主机名 +} + +func (x *OSS_MinIO) Reset() { + *x = OSS_MinIO{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_oss_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OSS_MinIO) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OSS_MinIO) ProtoMessage() {} + +func (x *OSS_MinIO) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_oss_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OSS_MinIO.ProtoReflect.Descriptor instead. +func (*OSS_MinIO) Descriptor() ([]byte, []int) { + return file_common_conf_oss_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *OSS_MinIO) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +func (x *OSS_MinIO) GetAccessKey() string { + if x != nil { + return x.AccessKey + } + return "" +} + +func (x *OSS_MinIO) GetSecretKey() string { + if x != nil { + return x.SecretKey + } + return "" +} + +func (x *OSS_MinIO) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +func (x *OSS_MinIO) GetUseSsl() bool { + if x != nil { + return x.UseSsl + } + return false +} + +func (x *OSS_MinIO) GetUploadHost() string { + if x != nil { + return x.UploadHost + } + return "" +} + +func (x *OSS_MinIO) GetDownloadHost() string { + if x != nil { + return x.DownloadHost + } + return "" +} + +var File_common_conf_oss_proto protoreflect.FileDescriptor + +var file_common_conf_oss_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x6f, 0x73, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x63, 0x6f, 0x6e, 0x66, 0x22, 0x8c, 0x02, 0x0a, 0x03, 0x4f, 0x53, 0x53, 0x12, 0x2c, 0x0a, 0x05, + 0x6d, 0x69, 0x6e, 0x69, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4f, 0x53, 0x53, 0x2e, 0x4d, 0x69, + 0x6e, 0x49, 0x4f, 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x69, 0x6f, 0x1a, 0xd6, 0x01, 0x0a, 0x05, 0x4d, + 0x69, 0x6e, 0x49, 0x4f, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x12, + 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x5f, 0x73, 0x73, 0x6c, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x75, 0x73, 0x65, 0x53, 0x73, 0x6c, 0x12, 0x1f, 0x0a, + 0x0b, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x23, + 0x0a, 0x0d, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x48, + 0x6f, 0x73, 0x74, 0x42, 0x30, 0x5a, 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x65, 0x6e, + 0x74, 0x2d, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, + 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_common_conf_oss_proto_rawDescOnce sync.Once + file_common_conf_oss_proto_rawDescData = file_common_conf_oss_proto_rawDesc +) + +func file_common_conf_oss_proto_rawDescGZIP() []byte { + file_common_conf_oss_proto_rawDescOnce.Do(func() { + file_common_conf_oss_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_conf_oss_proto_rawDescData) + }) + return file_common_conf_oss_proto_rawDescData +} + +var file_common_conf_oss_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_common_conf_oss_proto_goTypes = []interface{}{ + (*OSS)(nil), // 0: common.conf.OSS + (*OSS_MinIO)(nil), // 1: common.conf.OSS.MinIO +} +var file_common_conf_oss_proto_depIdxs = []int32{ + 1, // 0: common.conf.OSS.minio:type_name -> common.conf.OSS.MinIO + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_common_conf_oss_proto_init() } +func file_common_conf_oss_proto_init() { + if File_common_conf_oss_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_common_conf_oss_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OSS); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_oss_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OSS_MinIO); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_conf_oss_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_conf_oss_proto_goTypes, + DependencyIndexes: file_common_conf_oss_proto_depIdxs, + MessageInfos: file_common_conf_oss_proto_msgTypes, + }.Build() + File_common_conf_oss_proto = out.File + file_common_conf_oss_proto_rawDesc = nil + file_common_conf_oss_proto_goTypes = nil + file_common_conf_oss_proto_depIdxs = nil +} diff --git a/orm/ent/gen/api/go/common/conf/oss.pb.validate.go b/orm/ent/gen/api/go/common/conf/oss.pb.validate.go new file mode 100644 index 0000000..30a3abc --- /dev/null +++ b/orm/ent/gen/api/go/common/conf/oss.pb.validate.go @@ -0,0 +1,276 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: common/conf/oss.proto + +package conf + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on OSS with the rules defined in the proto +// definition for this message. If any rules are violated, the first error +// encountered is returned, or nil if there are no violations. +func (m *OSS) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on OSS with the rules defined in the +// proto definition for this message. If any rules are violated, the result is +// a list of violation errors wrapped in OSSMultiError, or nil if none found. +func (m *OSS) ValidateAll() error { + return m.validate(true) +} + +func (m *OSS) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetMinio()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, OSSValidationError{ + field: "Minio", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, OSSValidationError{ + field: "Minio", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMinio()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return OSSValidationError{ + field: "Minio", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return OSSMultiError(errors) + } + + return nil +} + +// OSSMultiError is an error wrapping multiple validation errors returned by +// OSS.ValidateAll() if the designated constraints aren't met. +type OSSMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m OSSMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m OSSMultiError) AllErrors() []error { return m } + +// OSSValidationError is the validation error returned by OSS.Validate if the +// designated constraints aren't met. +type OSSValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e OSSValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e OSSValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e OSSValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e OSSValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e OSSValidationError) ErrorName() string { return "OSSValidationError" } + +// Error satisfies the builtin error interface +func (e OSSValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sOSS.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = OSSValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = OSSValidationError{} + +// Validate checks the field values on OSS_MinIO with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *OSS_MinIO) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on OSS_MinIO with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in OSS_MinIOMultiError, or nil +// if none found. +func (m *OSS_MinIO) ValidateAll() error { + return m.validate(true) +} + +func (m *OSS_MinIO) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Endpoint + + // no validation rules for AccessKey + + // no validation rules for SecretKey + + // no validation rules for Token + + // no validation rules for UseSsl + + // no validation rules for UploadHost + + // no validation rules for DownloadHost + + if len(errors) > 0 { + return OSS_MinIOMultiError(errors) + } + + return nil +} + +// OSS_MinIOMultiError is an error wrapping multiple validation errors returned +// by OSS_MinIO.ValidateAll() if the designated constraints aren't met. +type OSS_MinIOMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m OSS_MinIOMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m OSS_MinIOMultiError) AllErrors() []error { return m } + +// OSS_MinIOValidationError is the validation error returned by +// OSS_MinIO.Validate if the designated constraints aren't met. +type OSS_MinIOValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e OSS_MinIOValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e OSS_MinIOValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e OSS_MinIOValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e OSS_MinIOValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e OSS_MinIOValidationError) ErrorName() string { return "OSS_MinIOValidationError" } + +// Error satisfies the builtin error interface +func (e OSS_MinIOValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sOSS_MinIO.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = OSS_MinIOValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = OSS_MinIOValidationError{} diff --git a/orm/ent/gen/api/go/common/conf/registry.pb.go b/orm/ent/gen/api/go/common/conf/registry.pb.go new file mode 100644 index 0000000..2e7ff92 --- /dev/null +++ b/orm/ent/gen/api/go/common/conf/registry.pb.go @@ -0,0 +1,972 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: common/conf/registry.proto + +package conf + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 注册发现中心 +type Registry struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Consul *Registry_Consul `protobuf:"bytes,2,opt,name=consul,proto3" json:"consul,omitempty"` // Consul + Etcd *Registry_Etcd `protobuf:"bytes,3,opt,name=etcd,proto3" json:"etcd,omitempty"` // Etcd + Zookeeper *Registry_ZooKeeper `protobuf:"bytes,4,opt,name=zookeeper,proto3" json:"zookeeper,omitempty"` // ZooKeeper + Nacos *Registry_Nacos `protobuf:"bytes,5,opt,name=nacos,proto3" json:"nacos,omitempty"` // Nacos + Kubernetes *Registry_Kubernetes `protobuf:"bytes,6,opt,name=kubernetes,proto3" json:"kubernetes,omitempty"` // Kubernetes + Eureka *Registry_Eureka `protobuf:"bytes,7,opt,name=eureka,proto3" json:"eureka,omitempty"` // Eureka + Polaris *Registry_Polaris `protobuf:"bytes,8,opt,name=polaris,proto3" json:"polaris,omitempty"` // Polaris + Servicecomb *Registry_Servicecomb `protobuf:"bytes,9,opt,name=servicecomb,proto3" json:"servicecomb,omitempty"` // Servicecomb +} + +func (x *Registry) Reset() { + *x = Registry{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_registry_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Registry) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Registry) ProtoMessage() {} + +func (x *Registry) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_registry_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Registry.ProtoReflect.Descriptor instead. +func (*Registry) Descriptor() ([]byte, []int) { + return file_common_conf_registry_proto_rawDescGZIP(), []int{0} +} + +func (x *Registry) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Registry) GetConsul() *Registry_Consul { + if x != nil { + return x.Consul + } + return nil +} + +func (x *Registry) GetEtcd() *Registry_Etcd { + if x != nil { + return x.Etcd + } + return nil +} + +func (x *Registry) GetZookeeper() *Registry_ZooKeeper { + if x != nil { + return x.Zookeeper + } + return nil +} + +func (x *Registry) GetNacos() *Registry_Nacos { + if x != nil { + return x.Nacos + } + return nil +} + +func (x *Registry) GetKubernetes() *Registry_Kubernetes { + if x != nil { + return x.Kubernetes + } + return nil +} + +func (x *Registry) GetEureka() *Registry_Eureka { + if x != nil { + return x.Eureka + } + return nil +} + +func (x *Registry) GetPolaris() *Registry_Polaris { + if x != nil { + return x.Polaris + } + return nil +} + +func (x *Registry) GetServicecomb() *Registry_Servicecomb { + if x != nil { + return x.Servicecomb + } + return nil +} + +// Consul +type Registry_Consul struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Scheme string `protobuf:"bytes,1,opt,name=scheme,proto3" json:"scheme,omitempty"` // 网络样式 + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // 服务端地址 + HealthCheck bool `protobuf:"varint,3,opt,name=health_check,json=healthCheck,proto3" json:"health_check,omitempty"` // 健康检查 +} + +func (x *Registry_Consul) Reset() { + *x = Registry_Consul{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_registry_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Registry_Consul) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Registry_Consul) ProtoMessage() {} + +func (x *Registry_Consul) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_registry_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Registry_Consul.ProtoReflect.Descriptor instead. +func (*Registry_Consul) Descriptor() ([]byte, []int) { + return file_common_conf_registry_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *Registry_Consul) GetScheme() string { + if x != nil { + return x.Scheme + } + return "" +} + +func (x *Registry_Consul) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *Registry_Consul) GetHealthCheck() bool { + if x != nil { + return x.HealthCheck + } + return false +} + +// Etcd +type Registry_Etcd struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Endpoints []string `protobuf:"bytes,1,rep,name=endpoints,proto3" json:"endpoints,omitempty"` +} + +func (x *Registry_Etcd) Reset() { + *x = Registry_Etcd{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_registry_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Registry_Etcd) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Registry_Etcd) ProtoMessage() {} + +func (x *Registry_Etcd) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_registry_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Registry_Etcd.ProtoReflect.Descriptor instead. +func (*Registry_Etcd) Descriptor() ([]byte, []int) { + return file_common_conf_registry_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *Registry_Etcd) GetEndpoints() []string { + if x != nil { + return x.Endpoints + } + return nil +} + +// ZooKeeper +type Registry_ZooKeeper struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Endpoints []string `protobuf:"bytes,1,rep,name=endpoints,proto3" json:"endpoints,omitempty"` + Timeout *durationpb.Duration `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout,omitempty"` +} + +func (x *Registry_ZooKeeper) Reset() { + *x = Registry_ZooKeeper{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_registry_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Registry_ZooKeeper) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Registry_ZooKeeper) ProtoMessage() {} + +func (x *Registry_ZooKeeper) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_registry_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Registry_ZooKeeper.ProtoReflect.Descriptor instead. +func (*Registry_ZooKeeper) Descriptor() ([]byte, []int) { + return file_common_conf_registry_proto_rawDescGZIP(), []int{0, 2} +} + +func (x *Registry_ZooKeeper) GetEndpoints() []string { + if x != nil { + return x.Endpoints + } + return nil +} + +func (x *Registry_ZooKeeper) GetTimeout() *durationpb.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +// Nacos +type Registry_Nacos struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // 服务端地址 + Port uint64 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` // 服务端端口 + NamespaceId string `protobuf:"bytes,3,opt,name=namespace_id,json=namespaceId,proto3" json:"namespace_id,omitempty"` // + LogLevel string `protobuf:"bytes,4,opt,name=log_level,json=logLevel,proto3" json:"log_level,omitempty"` // 日志等级 + CacheDir string `protobuf:"bytes,5,opt,name=cache_dir,json=cacheDir,proto3" json:"cache_dir,omitempty"` // 缓存目录 + LogDir string `protobuf:"bytes,6,opt,name=log_dir,json=logDir,proto3" json:"log_dir,omitempty"` // 日志目录 + UpdateThreadNum int32 `protobuf:"varint,7,opt,name=update_thread_num,json=updateThreadNum,proto3" json:"update_thread_num,omitempty"` // 更新服务的线程数 + Timeout *durationpb.Duration `protobuf:"bytes,8,opt,name=timeout,proto3" json:"timeout,omitempty"` // http请求超时时间,单位: 毫秒 + BeatInterval *durationpb.Duration `protobuf:"bytes,9,opt,name=beat_interval,json=beatInterval,proto3" json:"beat_interval,omitempty"` // 心跳间隔时间,单位: 毫秒 + NotLoadCacheAtStart bool `protobuf:"varint,10,opt,name=not_load_cache_at_start,json=notLoadCacheAtStart,proto3" json:"not_load_cache_at_start,omitempty"` // 在启动时不读取本地缓存数据,true: 不读取,false: 读取 + UpdateCacheWhenEmpty bool `protobuf:"varint,11,opt,name=update_cache_when_empty,json=updateCacheWhenEmpty,proto3" json:"update_cache_when_empty,omitempty"` // 当服务列表为空时是否更新本地缓存,true: 更新,false: 不更新 +} + +func (x *Registry_Nacos) Reset() { + *x = Registry_Nacos{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_registry_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Registry_Nacos) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Registry_Nacos) ProtoMessage() {} + +func (x *Registry_Nacos) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_registry_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Registry_Nacos.ProtoReflect.Descriptor instead. +func (*Registry_Nacos) Descriptor() ([]byte, []int) { + return file_common_conf_registry_proto_rawDescGZIP(), []int{0, 3} +} + +func (x *Registry_Nacos) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *Registry_Nacos) GetPort() uint64 { + if x != nil { + return x.Port + } + return 0 +} + +func (x *Registry_Nacos) GetNamespaceId() string { + if x != nil { + return x.NamespaceId + } + return "" +} + +func (x *Registry_Nacos) GetLogLevel() string { + if x != nil { + return x.LogLevel + } + return "" +} + +func (x *Registry_Nacos) GetCacheDir() string { + if x != nil { + return x.CacheDir + } + return "" +} + +func (x *Registry_Nacos) GetLogDir() string { + if x != nil { + return x.LogDir + } + return "" +} + +func (x *Registry_Nacos) GetUpdateThreadNum() int32 { + if x != nil { + return x.UpdateThreadNum + } + return 0 +} + +func (x *Registry_Nacos) GetTimeout() *durationpb.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +func (x *Registry_Nacos) GetBeatInterval() *durationpb.Duration { + if x != nil { + return x.BeatInterval + } + return nil +} + +func (x *Registry_Nacos) GetNotLoadCacheAtStart() bool { + if x != nil { + return x.NotLoadCacheAtStart + } + return false +} + +func (x *Registry_Nacos) GetUpdateCacheWhenEmpty() bool { + if x != nil { + return x.UpdateCacheWhenEmpty + } + return false +} + +// Kubernetes +type Registry_Kubernetes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Registry_Kubernetes) Reset() { + *x = Registry_Kubernetes{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_registry_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Registry_Kubernetes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Registry_Kubernetes) ProtoMessage() {} + +func (x *Registry_Kubernetes) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_registry_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Registry_Kubernetes.ProtoReflect.Descriptor instead. +func (*Registry_Kubernetes) Descriptor() ([]byte, []int) { + return file_common_conf_registry_proto_rawDescGZIP(), []int{0, 4} +} + +// Eureka +type Registry_Eureka struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Endpoints []string `protobuf:"bytes,1,rep,name=endpoints,proto3" json:"endpoints,omitempty"` + HeartbeatInterval *durationpb.Duration `protobuf:"bytes,2,opt,name=heartbeat_interval,json=heartbeatInterval,proto3" json:"heartbeat_interval,omitempty"` + RefreshInterval *durationpb.Duration `protobuf:"bytes,3,opt,name=refresh_interval,json=refreshInterval,proto3" json:"refresh_interval,omitempty"` + Path string `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"` +} + +func (x *Registry_Eureka) Reset() { + *x = Registry_Eureka{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_registry_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Registry_Eureka) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Registry_Eureka) ProtoMessage() {} + +func (x *Registry_Eureka) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_registry_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Registry_Eureka.ProtoReflect.Descriptor instead. +func (*Registry_Eureka) Descriptor() ([]byte, []int) { + return file_common_conf_registry_proto_rawDescGZIP(), []int{0, 5} +} + +func (x *Registry_Eureka) GetEndpoints() []string { + if x != nil { + return x.Endpoints + } + return nil +} + +func (x *Registry_Eureka) GetHeartbeatInterval() *durationpb.Duration { + if x != nil { + return x.HeartbeatInterval + } + return nil +} + +func (x *Registry_Eureka) GetRefreshInterval() *durationpb.Duration { + if x != nil { + return x.RefreshInterval + } + return nil +} + +func (x *Registry_Eureka) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +// Polaris +type Registry_Polaris struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // 服务端地址 + Port int32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` // 服务端端口 + InstanceCount int32 `protobuf:"varint,3,opt,name=instance_count,json=instanceCount,proto3" json:"instance_count,omitempty"` + Namespace string `protobuf:"bytes,4,opt,name=namespace,proto3" json:"namespace,omitempty"` + Service string `protobuf:"bytes,5,opt,name=service,proto3" json:"service,omitempty"` + Token string `protobuf:"bytes,6,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *Registry_Polaris) Reset() { + *x = Registry_Polaris{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_registry_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Registry_Polaris) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Registry_Polaris) ProtoMessage() {} + +func (x *Registry_Polaris) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_registry_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Registry_Polaris.ProtoReflect.Descriptor instead. +func (*Registry_Polaris) Descriptor() ([]byte, []int) { + return file_common_conf_registry_proto_rawDescGZIP(), []int{0, 6} +} + +func (x *Registry_Polaris) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *Registry_Polaris) GetPort() int32 { + if x != nil { + return x.Port + } + return 0 +} + +func (x *Registry_Polaris) GetInstanceCount() int32 { + if x != nil { + return x.InstanceCount + } + return 0 +} + +func (x *Registry_Polaris) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *Registry_Polaris) GetService() string { + if x != nil { + return x.Service + } + return "" +} + +func (x *Registry_Polaris) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +// Servicecomb +type Registry_Servicecomb struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Endpoints []string `protobuf:"bytes,1,rep,name=endpoints,proto3" json:"endpoints,omitempty"` +} + +func (x *Registry_Servicecomb) Reset() { + *x = Registry_Servicecomb{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_registry_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Registry_Servicecomb) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Registry_Servicecomb) ProtoMessage() {} + +func (x *Registry_Servicecomb) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_registry_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Registry_Servicecomb.ProtoReflect.Descriptor instead. +func (*Registry_Servicecomb) Descriptor() ([]byte, []int) { + return file_common_conf_registry_proto_rawDescGZIP(), []int{0, 7} +} + +func (x *Registry_Servicecomb) GetEndpoints() []string { + if x != nil { + return x.Endpoints + } + return nil +} + +var File_common_conf_registry_proto protoreflect.FileDescriptor + +var file_common_conf_registry_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x72, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc4, 0x0c, 0x0a, 0x08, 0x52, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x34, 0x0a, 0x06, 0x63, 0x6f, + 0x6e, 0x73, 0x75, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, + 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, + 0x12, 0x2e, 0x0a, 0x04, 0x65, 0x74, 0x63, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x45, 0x74, 0x63, 0x64, 0x52, 0x04, 0x65, 0x74, 0x63, 0x64, + 0x12, 0x3d, 0x0a, 0x09, 0x7a, 0x6f, 0x6f, 0x6b, 0x65, 0x65, 0x70, 0x65, 0x72, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, + 0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x5a, 0x6f, 0x6f, 0x4b, 0x65, + 0x65, 0x70, 0x65, 0x72, 0x52, 0x09, 0x7a, 0x6f, 0x6f, 0x6b, 0x65, 0x65, 0x70, 0x65, 0x72, 0x12, + 0x31, 0x0a, 0x05, 0x6e, 0x61, 0x63, 0x6f, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x4e, 0x61, 0x63, 0x6f, 0x73, 0x52, 0x05, 0x6e, 0x61, 0x63, + 0x6f, 0x73, 0x12, 0x40, 0x0a, 0x0a, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x4b, 0x75, + 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x52, 0x0a, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, + 0x65, 0x74, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x06, 0x65, 0x75, 0x72, 0x65, 0x6b, 0x61, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, + 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x45, 0x75, 0x72, 0x65, + 0x6b, 0x61, 0x52, 0x06, 0x65, 0x75, 0x72, 0x65, 0x6b, 0x61, 0x12, 0x37, 0x0a, 0x07, 0x70, 0x6f, + 0x6c, 0x61, 0x72, 0x69, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x72, 0x79, 0x2e, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x69, 0x73, 0x52, 0x07, 0x70, 0x6f, 0x6c, 0x61, + 0x72, 0x69, 0x73, 0x12, 0x43, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x63, 0x6f, + 0x6d, 0x62, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x63, 0x6f, 0x6d, 0x62, 0x52, 0x0b, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x63, 0x6f, 0x6d, 0x62, 0x1a, 0x5d, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x73, + 0x75, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x5f, 0x63, + 0x68, 0x65, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x68, 0x65, 0x61, 0x6c, + 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x1a, 0x24, 0x0a, 0x04, 0x45, 0x74, 0x63, 0x64, 0x12, + 0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x09, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x1a, 0x5e, 0x0a, + 0x09, 0x5a, 0x6f, 0x6f, 0x4b, 0x65, 0x65, 0x70, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x6e, + 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x65, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, + 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x1a, 0xb9, 0x03, + 0x0a, 0x05, 0x4e, 0x61, 0x63, 0x6f, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x5f, + 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x67, + 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, 0x64, + 0x69, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x63, 0x68, 0x65, 0x44, + 0x69, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x6c, 0x6f, 0x67, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x6c, 0x6f, 0x67, 0x44, 0x69, 0x72, 0x12, 0x2a, 0x0a, 0x11, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6e, 0x75, 0x6d, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x68, + 0x72, 0x65, 0x61, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, + 0x75, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d, + 0x62, 0x65, 0x61, 0x74, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, + 0x62, 0x65, 0x61, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x34, 0x0a, 0x17, + 0x6e, 0x6f, 0x74, 0x5f, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, 0x61, + 0x74, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x6e, + 0x6f, 0x74, 0x4c, 0x6f, 0x61, 0x64, 0x43, 0x61, 0x63, 0x68, 0x65, 0x41, 0x74, 0x53, 0x74, 0x61, + 0x72, 0x74, 0x12, 0x35, 0x0a, 0x17, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x63, + 0x68, 0x65, 0x5f, 0x77, 0x68, 0x65, 0x6e, 0x5f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x14, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x63, 0x68, 0x65, + 0x57, 0x68, 0x65, 0x6e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x0c, 0x0a, 0x0a, 0x4b, 0x75, 0x62, + 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x1a, 0xca, 0x01, 0x0a, 0x06, 0x45, 0x75, 0x72, 0x65, + 0x6b, 0x61, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, + 0x12, 0x48, 0x0a, 0x12, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x5f, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, + 0x61, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x44, 0x0a, 0x10, 0x72, 0x65, + 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x0f, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, + 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x70, 0x61, 0x74, 0x68, 0x1a, 0xac, 0x01, 0x0a, 0x07, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x69, 0x73, + 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, + 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x25, + 0x0a, 0x0e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x1a, 0x2b, 0x0a, 0x0b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x63, 0x6f, + 0x6d, 0x62, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, + 0x42, 0x30, 0x5a, 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x65, 0x6e, 0x74, 0x2d, 0x65, + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, + 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x3b, 0x63, 0x6f, + 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_common_conf_registry_proto_rawDescOnce sync.Once + file_common_conf_registry_proto_rawDescData = file_common_conf_registry_proto_rawDesc +) + +func file_common_conf_registry_proto_rawDescGZIP() []byte { + file_common_conf_registry_proto_rawDescOnce.Do(func() { + file_common_conf_registry_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_conf_registry_proto_rawDescData) + }) + return file_common_conf_registry_proto_rawDescData +} + +var file_common_conf_registry_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_common_conf_registry_proto_goTypes = []interface{}{ + (*Registry)(nil), // 0: common.conf.Registry + (*Registry_Consul)(nil), // 1: common.conf.Registry.Consul + (*Registry_Etcd)(nil), // 2: common.conf.Registry.Etcd + (*Registry_ZooKeeper)(nil), // 3: common.conf.Registry.ZooKeeper + (*Registry_Nacos)(nil), // 4: common.conf.Registry.Nacos + (*Registry_Kubernetes)(nil), // 5: common.conf.Registry.Kubernetes + (*Registry_Eureka)(nil), // 6: common.conf.Registry.Eureka + (*Registry_Polaris)(nil), // 7: common.conf.Registry.Polaris + (*Registry_Servicecomb)(nil), // 8: common.conf.Registry.Servicecomb + (*durationpb.Duration)(nil), // 9: google.protobuf.Duration +} +var file_common_conf_registry_proto_depIdxs = []int32{ + 1, // 0: common.conf.Registry.consul:type_name -> common.conf.Registry.Consul + 2, // 1: common.conf.Registry.etcd:type_name -> common.conf.Registry.Etcd + 3, // 2: common.conf.Registry.zookeeper:type_name -> common.conf.Registry.ZooKeeper + 4, // 3: common.conf.Registry.nacos:type_name -> common.conf.Registry.Nacos + 5, // 4: common.conf.Registry.kubernetes:type_name -> common.conf.Registry.Kubernetes + 6, // 5: common.conf.Registry.eureka:type_name -> common.conf.Registry.Eureka + 7, // 6: common.conf.Registry.polaris:type_name -> common.conf.Registry.Polaris + 8, // 7: common.conf.Registry.servicecomb:type_name -> common.conf.Registry.Servicecomb + 9, // 8: common.conf.Registry.ZooKeeper.timeout:type_name -> google.protobuf.Duration + 9, // 9: common.conf.Registry.Nacos.timeout:type_name -> google.protobuf.Duration + 9, // 10: common.conf.Registry.Nacos.beat_interval:type_name -> google.protobuf.Duration + 9, // 11: common.conf.Registry.Eureka.heartbeat_interval:type_name -> google.protobuf.Duration + 9, // 12: common.conf.Registry.Eureka.refresh_interval:type_name -> google.protobuf.Duration + 13, // [13:13] is the sub-list for method output_type + 13, // [13:13] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name +} + +func init() { file_common_conf_registry_proto_init() } +func file_common_conf_registry_proto_init() { + if File_common_conf_registry_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_common_conf_registry_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Registry); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_registry_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Registry_Consul); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_registry_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Registry_Etcd); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_registry_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Registry_ZooKeeper); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_registry_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Registry_Nacos); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_registry_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Registry_Kubernetes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_registry_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Registry_Eureka); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_registry_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Registry_Polaris); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_registry_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Registry_Servicecomb); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_conf_registry_proto_rawDesc, + NumEnums: 0, + NumMessages: 9, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_conf_registry_proto_goTypes, + DependencyIndexes: file_common_conf_registry_proto_depIdxs, + MessageInfos: file_common_conf_registry_proto_msgTypes, + }.Build() + File_common_conf_registry_proto = out.File + file_common_conf_registry_proto_rawDesc = nil + file_common_conf_registry_proto_goTypes = nil + file_common_conf_registry_proto_depIdxs = nil +} diff --git a/orm/ent/gen/api/go/common/conf/registry.pb.validate.go b/orm/ent/gen/api/go/common/conf/registry.pb.validate.go new file mode 100644 index 0000000..896b055 --- /dev/null +++ b/orm/ent/gen/api/go/common/conf/registry.pb.validate.go @@ -0,0 +1,1358 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: common/conf/registry.proto + +package conf + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on Registry with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Registry) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Registry with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in RegistryMultiError, or nil +// if none found. +func (m *Registry) ValidateAll() error { + return m.validate(true) +} + +func (m *Registry) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Type + + if all { + switch v := interface{}(m.GetConsul()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Consul", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Consul", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetConsul()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RegistryValidationError{ + field: "Consul", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetEtcd()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Etcd", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Etcd", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetEtcd()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RegistryValidationError{ + field: "Etcd", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetZookeeper()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Zookeeper", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Zookeeper", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetZookeeper()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RegistryValidationError{ + field: "Zookeeper", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetNacos()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Nacos", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Nacos", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetNacos()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RegistryValidationError{ + field: "Nacos", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetKubernetes()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Kubernetes", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Kubernetes", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetKubernetes()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RegistryValidationError{ + field: "Kubernetes", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetEureka()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Eureka", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Eureka", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetEureka()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RegistryValidationError{ + field: "Eureka", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetPolaris()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Polaris", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Polaris", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetPolaris()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RegistryValidationError{ + field: "Polaris", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetServicecomb()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Servicecomb", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Servicecomb", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetServicecomb()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RegistryValidationError{ + field: "Servicecomb", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return RegistryMultiError(errors) + } + + return nil +} + +// RegistryMultiError is an error wrapping multiple validation errors returned +// by Registry.ValidateAll() if the designated constraints aren't met. +type RegistryMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m RegistryMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m RegistryMultiError) AllErrors() []error { return m } + +// RegistryValidationError is the validation error returned by +// Registry.Validate if the designated constraints aren't met. +type RegistryValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RegistryValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RegistryValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RegistryValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RegistryValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RegistryValidationError) ErrorName() string { return "RegistryValidationError" } + +// Error satisfies the builtin error interface +func (e RegistryValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRegistry.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RegistryValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RegistryValidationError{} + +// Validate checks the field values on Registry_Consul with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *Registry_Consul) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Registry_Consul with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// Registry_ConsulMultiError, or nil if none found. +func (m *Registry_Consul) ValidateAll() error { + return m.validate(true) +} + +func (m *Registry_Consul) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Scheme + + // no validation rules for Address + + // no validation rules for HealthCheck + + if len(errors) > 0 { + return Registry_ConsulMultiError(errors) + } + + return nil +} + +// Registry_ConsulMultiError is an error wrapping multiple validation errors +// returned by Registry_Consul.ValidateAll() if the designated constraints +// aren't met. +type Registry_ConsulMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Registry_ConsulMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Registry_ConsulMultiError) AllErrors() []error { return m } + +// Registry_ConsulValidationError is the validation error returned by +// Registry_Consul.Validate if the designated constraints aren't met. +type Registry_ConsulValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Registry_ConsulValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Registry_ConsulValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Registry_ConsulValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Registry_ConsulValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Registry_ConsulValidationError) ErrorName() string { return "Registry_ConsulValidationError" } + +// Error satisfies the builtin error interface +func (e Registry_ConsulValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRegistry_Consul.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Registry_ConsulValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Registry_ConsulValidationError{} + +// Validate checks the field values on Registry_Etcd with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Registry_Etcd) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Registry_Etcd with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Registry_EtcdMultiError, or +// nil if none found. +func (m *Registry_Etcd) ValidateAll() error { + return m.validate(true) +} + +func (m *Registry_Etcd) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return Registry_EtcdMultiError(errors) + } + + return nil +} + +// Registry_EtcdMultiError is an error wrapping multiple validation errors +// returned by Registry_Etcd.ValidateAll() if the designated constraints +// aren't met. +type Registry_EtcdMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Registry_EtcdMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Registry_EtcdMultiError) AllErrors() []error { return m } + +// Registry_EtcdValidationError is the validation error returned by +// Registry_Etcd.Validate if the designated constraints aren't met. +type Registry_EtcdValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Registry_EtcdValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Registry_EtcdValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Registry_EtcdValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Registry_EtcdValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Registry_EtcdValidationError) ErrorName() string { return "Registry_EtcdValidationError" } + +// Error satisfies the builtin error interface +func (e Registry_EtcdValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRegistry_Etcd.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Registry_EtcdValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Registry_EtcdValidationError{} + +// Validate checks the field values on Registry_ZooKeeper with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *Registry_ZooKeeper) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Registry_ZooKeeper with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// Registry_ZooKeeperMultiError, or nil if none found. +func (m *Registry_ZooKeeper) ValidateAll() error { + return m.validate(true) +} + +func (m *Registry_ZooKeeper) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetTimeout()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Registry_ZooKeeperValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Registry_ZooKeeperValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Registry_ZooKeeperValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return Registry_ZooKeeperMultiError(errors) + } + + return nil +} + +// Registry_ZooKeeperMultiError is an error wrapping multiple validation errors +// returned by Registry_ZooKeeper.ValidateAll() if the designated constraints +// aren't met. +type Registry_ZooKeeperMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Registry_ZooKeeperMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Registry_ZooKeeperMultiError) AllErrors() []error { return m } + +// Registry_ZooKeeperValidationError is the validation error returned by +// Registry_ZooKeeper.Validate if the designated constraints aren't met. +type Registry_ZooKeeperValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Registry_ZooKeeperValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Registry_ZooKeeperValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Registry_ZooKeeperValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Registry_ZooKeeperValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Registry_ZooKeeperValidationError) ErrorName() string { + return "Registry_ZooKeeperValidationError" +} + +// Error satisfies the builtin error interface +func (e Registry_ZooKeeperValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRegistry_ZooKeeper.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Registry_ZooKeeperValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Registry_ZooKeeperValidationError{} + +// Validate checks the field values on Registry_Nacos with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Registry_Nacos) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Registry_Nacos with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Registry_NacosMultiError, +// or nil if none found. +func (m *Registry_Nacos) ValidateAll() error { + return m.validate(true) +} + +func (m *Registry_Nacos) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Address + + // no validation rules for Port + + // no validation rules for NamespaceId + + // no validation rules for LogLevel + + // no validation rules for CacheDir + + // no validation rules for LogDir + + // no validation rules for UpdateThreadNum + + if all { + switch v := interface{}(m.GetTimeout()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Registry_NacosValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Registry_NacosValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Registry_NacosValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetBeatInterval()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Registry_NacosValidationError{ + field: "BeatInterval", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Registry_NacosValidationError{ + field: "BeatInterval", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetBeatInterval()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Registry_NacosValidationError{ + field: "BeatInterval", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for NotLoadCacheAtStart + + // no validation rules for UpdateCacheWhenEmpty + + if len(errors) > 0 { + return Registry_NacosMultiError(errors) + } + + return nil +} + +// Registry_NacosMultiError is an error wrapping multiple validation errors +// returned by Registry_Nacos.ValidateAll() if the designated constraints +// aren't met. +type Registry_NacosMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Registry_NacosMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Registry_NacosMultiError) AllErrors() []error { return m } + +// Registry_NacosValidationError is the validation error returned by +// Registry_Nacos.Validate if the designated constraints aren't met. +type Registry_NacosValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Registry_NacosValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Registry_NacosValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Registry_NacosValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Registry_NacosValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Registry_NacosValidationError) ErrorName() string { return "Registry_NacosValidationError" } + +// Error satisfies the builtin error interface +func (e Registry_NacosValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRegistry_Nacos.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Registry_NacosValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Registry_NacosValidationError{} + +// Validate checks the field values on Registry_Kubernetes with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *Registry_Kubernetes) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Registry_Kubernetes with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// Registry_KubernetesMultiError, or nil if none found. +func (m *Registry_Kubernetes) ValidateAll() error { + return m.validate(true) +} + +func (m *Registry_Kubernetes) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return Registry_KubernetesMultiError(errors) + } + + return nil +} + +// Registry_KubernetesMultiError is an error wrapping multiple validation +// errors returned by Registry_Kubernetes.ValidateAll() if the designated +// constraints aren't met. +type Registry_KubernetesMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Registry_KubernetesMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Registry_KubernetesMultiError) AllErrors() []error { return m } + +// Registry_KubernetesValidationError is the validation error returned by +// Registry_Kubernetes.Validate if the designated constraints aren't met. +type Registry_KubernetesValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Registry_KubernetesValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Registry_KubernetesValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Registry_KubernetesValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Registry_KubernetesValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Registry_KubernetesValidationError) ErrorName() string { + return "Registry_KubernetesValidationError" +} + +// Error satisfies the builtin error interface +func (e Registry_KubernetesValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRegistry_Kubernetes.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Registry_KubernetesValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Registry_KubernetesValidationError{} + +// Validate checks the field values on Registry_Eureka with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *Registry_Eureka) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Registry_Eureka with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// Registry_EurekaMultiError, or nil if none found. +func (m *Registry_Eureka) ValidateAll() error { + return m.validate(true) +} + +func (m *Registry_Eureka) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetHeartbeatInterval()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Registry_EurekaValidationError{ + field: "HeartbeatInterval", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Registry_EurekaValidationError{ + field: "HeartbeatInterval", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetHeartbeatInterval()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Registry_EurekaValidationError{ + field: "HeartbeatInterval", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetRefreshInterval()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Registry_EurekaValidationError{ + field: "RefreshInterval", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Registry_EurekaValidationError{ + field: "RefreshInterval", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRefreshInterval()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Registry_EurekaValidationError{ + field: "RefreshInterval", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for Path + + if len(errors) > 0 { + return Registry_EurekaMultiError(errors) + } + + return nil +} + +// Registry_EurekaMultiError is an error wrapping multiple validation errors +// returned by Registry_Eureka.ValidateAll() if the designated constraints +// aren't met. +type Registry_EurekaMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Registry_EurekaMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Registry_EurekaMultiError) AllErrors() []error { return m } + +// Registry_EurekaValidationError is the validation error returned by +// Registry_Eureka.Validate if the designated constraints aren't met. +type Registry_EurekaValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Registry_EurekaValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Registry_EurekaValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Registry_EurekaValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Registry_EurekaValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Registry_EurekaValidationError) ErrorName() string { return "Registry_EurekaValidationError" } + +// Error satisfies the builtin error interface +func (e Registry_EurekaValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRegistry_Eureka.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Registry_EurekaValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Registry_EurekaValidationError{} + +// Validate checks the field values on Registry_Polaris with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *Registry_Polaris) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Registry_Polaris with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// Registry_PolarisMultiError, or nil if none found. +func (m *Registry_Polaris) ValidateAll() error { + return m.validate(true) +} + +func (m *Registry_Polaris) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Address + + // no validation rules for Port + + // no validation rules for InstanceCount + + // no validation rules for Namespace + + // no validation rules for Service + + // no validation rules for Token + + if len(errors) > 0 { + return Registry_PolarisMultiError(errors) + } + + return nil +} + +// Registry_PolarisMultiError is an error wrapping multiple validation errors +// returned by Registry_Polaris.ValidateAll() if the designated constraints +// aren't met. +type Registry_PolarisMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Registry_PolarisMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Registry_PolarisMultiError) AllErrors() []error { return m } + +// Registry_PolarisValidationError is the validation error returned by +// Registry_Polaris.Validate if the designated constraints aren't met. +type Registry_PolarisValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Registry_PolarisValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Registry_PolarisValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Registry_PolarisValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Registry_PolarisValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Registry_PolarisValidationError) ErrorName() string { return "Registry_PolarisValidationError" } + +// Error satisfies the builtin error interface +func (e Registry_PolarisValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRegistry_Polaris.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Registry_PolarisValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Registry_PolarisValidationError{} + +// Validate checks the field values on Registry_Servicecomb with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *Registry_Servicecomb) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Registry_Servicecomb with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// Registry_ServicecombMultiError, or nil if none found. +func (m *Registry_Servicecomb) ValidateAll() error { + return m.validate(true) +} + +func (m *Registry_Servicecomb) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return Registry_ServicecombMultiError(errors) + } + + return nil +} + +// Registry_ServicecombMultiError is an error wrapping multiple validation +// errors returned by Registry_Servicecomb.ValidateAll() if the designated +// constraints aren't met. +type Registry_ServicecombMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Registry_ServicecombMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Registry_ServicecombMultiError) AllErrors() []error { return m } + +// Registry_ServicecombValidationError is the validation error returned by +// Registry_Servicecomb.Validate if the designated constraints aren't met. +type Registry_ServicecombValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Registry_ServicecombValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Registry_ServicecombValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Registry_ServicecombValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Registry_ServicecombValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Registry_ServicecombValidationError) ErrorName() string { + return "Registry_ServicecombValidationError" +} + +// Error satisfies the builtin error interface +func (e Registry_ServicecombValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRegistry_Servicecomb.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Registry_ServicecombValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Registry_ServicecombValidationError{} diff --git a/orm/ent/gen/api/go/common/conf/server.pb.go b/orm/ent/gen/api/go/common/conf/server.pb.go new file mode 100644 index 0000000..e6d5758 --- /dev/null +++ b/orm/ent/gen/api/go/common/conf/server.pb.go @@ -0,0 +1,913 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: common/conf/server.proto + +package conf + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 服务器 +type Server struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Rest *Server_REST `protobuf:"bytes,1,opt,name=rest,proto3" json:"rest,omitempty"` // REST服务 + Grpc *Server_GRPC `protobuf:"bytes,2,opt,name=grpc,proto3" json:"grpc,omitempty"` // gRPC服务 + Websocket *Server_Websocket `protobuf:"bytes,3,opt,name=websocket,proto3" json:"websocket,omitempty"` // Websocket服务 + Mqtt *Server_Mqtt `protobuf:"bytes,4,opt,name=mqtt,proto3" json:"mqtt,omitempty"` // MQTT服务 + Kafka *Server_Kafka `protobuf:"bytes,5,opt,name=kafka,proto3" json:"kafka,omitempty"` // Kafka服务 + Rabbitmq *Server_RabbitMQ `protobuf:"bytes,6,opt,name=rabbitmq,proto3" json:"rabbitmq,omitempty"` // RabbitMQ服务 + Sse *Server_SSE `protobuf:"bytes,7,opt,name=sse,proto3" json:"sse,omitempty"` // SSE服务 +} + +func (x *Server) Reset() { + *x = Server{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_server_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Server) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Server) ProtoMessage() {} + +func (x *Server) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_server_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Server.ProtoReflect.Descriptor instead. +func (*Server) Descriptor() ([]byte, []int) { + return file_common_conf_server_proto_rawDescGZIP(), []int{0} +} + +func (x *Server) GetRest() *Server_REST { + if x != nil { + return x.Rest + } + return nil +} + +func (x *Server) GetGrpc() *Server_GRPC { + if x != nil { + return x.Grpc + } + return nil +} + +func (x *Server) GetWebsocket() *Server_Websocket { + if x != nil { + return x.Websocket + } + return nil +} + +func (x *Server) GetMqtt() *Server_Mqtt { + if x != nil { + return x.Mqtt + } + return nil +} + +func (x *Server) GetKafka() *Server_Kafka { + if x != nil { + return x.Kafka + } + return nil +} + +func (x *Server) GetRabbitmq() *Server_RabbitMQ { + if x != nil { + return x.Rabbitmq + } + return nil +} + +func (x *Server) GetSse() *Server_SSE { + if x != nil { + return x.Sse + } + return nil +} + +// REST +type Server_REST struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` // 网络 + Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` // 服务监听地址 + Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` // 超时时间 + Cors *Server_REST_CORS `protobuf:"bytes,4,opt,name=cors,proto3" json:"cors,omitempty"` // 服务监听地址 + Middleware *Middleware `protobuf:"bytes,5,opt,name=middleware,proto3" json:"middleware,omitempty"` // 中间件 +} + +func (x *Server_REST) Reset() { + *x = Server_REST{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_server_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Server_REST) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Server_REST) ProtoMessage() {} + +func (x *Server_REST) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_server_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Server_REST.ProtoReflect.Descriptor instead. +func (*Server_REST) Descriptor() ([]byte, []int) { + return file_common_conf_server_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *Server_REST) GetNetwork() string { + if x != nil { + return x.Network + } + return "" +} + +func (x *Server_REST) GetAddr() string { + if x != nil { + return x.Addr + } + return "" +} + +func (x *Server_REST) GetTimeout() *durationpb.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +func (x *Server_REST) GetCors() *Server_REST_CORS { + if x != nil { + return x.Cors + } + return nil +} + +func (x *Server_REST) GetMiddleware() *Middleware { + if x != nil { + return x.Middleware + } + return nil +} + +// gPRC +type Server_GRPC struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` // 网络 + Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` // 服务监听地址 + Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` // 超时时间 + Middleware *Middleware `protobuf:"bytes,4,opt,name=middleware,proto3" json:"middleware,omitempty"` +} + +func (x *Server_GRPC) Reset() { + *x = Server_GRPC{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_server_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Server_GRPC) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Server_GRPC) ProtoMessage() {} + +func (x *Server_GRPC) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_server_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Server_GRPC.ProtoReflect.Descriptor instead. +func (*Server_GRPC) Descriptor() ([]byte, []int) { + return file_common_conf_server_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *Server_GRPC) GetNetwork() string { + if x != nil { + return x.Network + } + return "" +} + +func (x *Server_GRPC) GetAddr() string { + if x != nil { + return x.Addr + } + return "" +} + +func (x *Server_GRPC) GetTimeout() *durationpb.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +func (x *Server_GRPC) GetMiddleware() *Middleware { + if x != nil { + return x.Middleware + } + return nil +} + +// Websocket +type Server_Websocket struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` // 网络样式:http、https + Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` // 服务监听地址 + Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` // 路径 + Codec string `protobuf:"bytes,4,opt,name=codec,proto3" json:"codec,omitempty"` // 编解码器 + Timeout *durationpb.Duration `protobuf:"bytes,5,opt,name=timeout,proto3" json:"timeout,omitempty"` // 超时时间 +} + +func (x *Server_Websocket) Reset() { + *x = Server_Websocket{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_server_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Server_Websocket) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Server_Websocket) ProtoMessage() {} + +func (x *Server_Websocket) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_server_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Server_Websocket.ProtoReflect.Descriptor instead. +func (*Server_Websocket) Descriptor() ([]byte, []int) { + return file_common_conf_server_proto_rawDescGZIP(), []int{0, 2} +} + +func (x *Server_Websocket) GetNetwork() string { + if x != nil { + return x.Network + } + return "" +} + +func (x *Server_Websocket) GetAddr() string { + if x != nil { + return x.Addr + } + return "" +} + +func (x *Server_Websocket) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *Server_Websocket) GetCodec() string { + if x != nil { + return x.Codec + } + return "" +} + +func (x *Server_Websocket) GetTimeout() *durationpb.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +// MQTT +type Server_Mqtt struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"` // 对端网络地址 +} + +func (x *Server_Mqtt) Reset() { + *x = Server_Mqtt{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_server_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Server_Mqtt) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Server_Mqtt) ProtoMessage() {} + +func (x *Server_Mqtt) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_server_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Server_Mqtt.ProtoReflect.Descriptor instead. +func (*Server_Mqtt) Descriptor() ([]byte, []int) { + return file_common_conf_server_proto_rawDescGZIP(), []int{0, 3} +} + +func (x *Server_Mqtt) GetAddr() string { + if x != nil { + return x.Addr + } + return "" +} + +// Kafka +type Server_Kafka struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Addrs []string `protobuf:"bytes,1,rep,name=addrs,proto3" json:"addrs,omitempty"` // 对端网络地址 +} + +func (x *Server_Kafka) Reset() { + *x = Server_Kafka{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_server_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Server_Kafka) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Server_Kafka) ProtoMessage() {} + +func (x *Server_Kafka) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_server_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Server_Kafka.ProtoReflect.Descriptor instead. +func (*Server_Kafka) Descriptor() ([]byte, []int) { + return file_common_conf_server_proto_rawDescGZIP(), []int{0, 4} +} + +func (x *Server_Kafka) GetAddrs() []string { + if x != nil { + return x.Addrs + } + return nil +} + +// RabbitMQ +type Server_RabbitMQ struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Addrs []string `protobuf:"bytes,1,rep,name=addrs,proto3" json:"addrs,omitempty"` // 对端网络地址 +} + +func (x *Server_RabbitMQ) Reset() { + *x = Server_RabbitMQ{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_server_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Server_RabbitMQ) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Server_RabbitMQ) ProtoMessage() {} + +func (x *Server_RabbitMQ) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_server_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Server_RabbitMQ.ProtoReflect.Descriptor instead. +func (*Server_RabbitMQ) Descriptor() ([]byte, []int) { + return file_common_conf_server_proto_rawDescGZIP(), []int{0, 5} +} + +func (x *Server_RabbitMQ) GetAddrs() []string { + if x != nil { + return x.Addrs + } + return nil +} + +// SSE +type Server_SSE struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` // 网络 + Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` // 服务监听地址 + Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` // 超时时间 + Path string `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"` // 路径 + Codec string `protobuf:"bytes,5,opt,name=codec,proto3" json:"codec,omitempty"` // 编解码器 +} + +func (x *Server_SSE) Reset() { + *x = Server_SSE{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_server_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Server_SSE) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Server_SSE) ProtoMessage() {} + +func (x *Server_SSE) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_server_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Server_SSE.ProtoReflect.Descriptor instead. +func (*Server_SSE) Descriptor() ([]byte, []int) { + return file_common_conf_server_proto_rawDescGZIP(), []int{0, 6} +} + +func (x *Server_SSE) GetNetwork() string { + if x != nil { + return x.Network + } + return "" +} + +func (x *Server_SSE) GetAddr() string { + if x != nil { + return x.Addr + } + return "" +} + +func (x *Server_SSE) GetTimeout() *durationpb.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +func (x *Server_SSE) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *Server_SSE) GetCodec() string { + if x != nil { + return x.Codec + } + return "" +} + +type Server_REST_CORS struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Headers []string `protobuf:"bytes,1,rep,name=headers,proto3" json:"headers,omitempty"` // + Methods []string `protobuf:"bytes,2,rep,name=methods,proto3" json:"methods,omitempty"` // + Origins []string `protobuf:"bytes,3,rep,name=origins,proto3" json:"origins,omitempty"` // +} + +func (x *Server_REST_CORS) Reset() { + *x = Server_REST_CORS{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_server_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Server_REST_CORS) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Server_REST_CORS) ProtoMessage() {} + +func (x *Server_REST_CORS) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_server_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Server_REST_CORS.ProtoReflect.Descriptor instead. +func (*Server_REST_CORS) Descriptor() ([]byte, []int) { + return file_common_conf_server_proto_rawDescGZIP(), []int{0, 0, 0} +} + +func (x *Server_REST_CORS) GetHeaders() []string { + if x != nil { + return x.Headers + } + return nil +} + +func (x *Server_REST_CORS) GetMethods() []string { + if x != nil { + return x.Methods + } + return nil +} + +func (x *Server_REST_CORS) GetOrigins() []string { + if x != nil { + return x.Origins + } + return nil +} + +var File_common_conf_server_proto protoreflect.FileDescriptor + +var file_common_conf_server_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, + 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc5, 0x09, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x12, 0x2c, 0x0a, 0x04, 0x72, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x2e, 0x52, 0x45, 0x53, 0x54, 0x52, 0x04, 0x72, 0x65, 0x73, 0x74, 0x12, 0x2c, + 0x0a, 0x04, 0x67, 0x72, 0x70, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x2e, 0x47, 0x52, 0x50, 0x43, 0x52, 0x04, 0x67, 0x72, 0x70, 0x63, 0x12, 0x3b, 0x0a, 0x09, + 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x2e, 0x57, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x09, + 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x2c, 0x0a, 0x04, 0x6d, 0x71, 0x74, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x4d, 0x71, 0x74, + 0x74, 0x52, 0x04, 0x6d, 0x71, 0x74, 0x74, 0x12, 0x2f, 0x0a, 0x05, 0x6b, 0x61, 0x66, 0x6b, 0x61, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x4b, 0x61, 0x66, 0x6b, + 0x61, 0x52, 0x05, 0x6b, 0x61, 0x66, 0x6b, 0x61, 0x12, 0x38, 0x0a, 0x08, 0x72, 0x61, 0x62, 0x62, + 0x69, 0x74, 0x6d, 0x71, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, + 0x52, 0x61, 0x62, 0x62, 0x69, 0x74, 0x4d, 0x51, 0x52, 0x08, 0x72, 0x61, 0x62, 0x62, 0x69, 0x74, + 0x6d, 0x71, 0x12, 0x29, 0x0a, 0x03, 0x73, 0x73, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x53, 0x45, 0x52, 0x03, 0x73, 0x73, 0x65, 0x1a, 0xab, 0x02, + 0x0a, 0x04, 0x52, 0x45, 0x53, 0x54, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x61, 0x64, 0x64, 0x72, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x31, 0x0a, 0x04, 0x63, 0x6f, 0x72, + 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x52, 0x45, 0x53, + 0x54, 0x2e, 0x43, 0x4f, 0x52, 0x53, 0x52, 0x04, 0x63, 0x6f, 0x72, 0x73, 0x12, 0x37, 0x0a, 0x0a, + 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4d, + 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x52, 0x0a, 0x6d, 0x69, 0x64, 0x64, 0x6c, + 0x65, 0x77, 0x61, 0x72, 0x65, 0x1a, 0x54, 0x0a, 0x04, 0x43, 0x4f, 0x52, 0x53, 0x12, 0x18, 0x0a, + 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, + 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, + 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x73, 0x1a, 0xa2, 0x01, 0x0a, 0x04, + 0x47, 0x52, 0x50, 0x43, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, + 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, + 0x64, 0x72, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, + 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x37, 0x0a, 0x0a, 0x6d, 0x69, 0x64, 0x64, 0x6c, + 0x65, 0x77, 0x61, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, + 0x77, 0x61, 0x72, 0x65, 0x52, 0x0a, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, + 0x1a, 0x98, 0x01, 0x0a, 0x09, 0x57, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x18, + 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x12, 0x0a, 0x04, + 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, + 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, + 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x1a, 0x1a, 0x0a, 0x04, 0x4d, + 0x71, 0x74, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x1a, 0x1d, 0x0a, 0x05, 0x4b, 0x61, 0x66, 0x6b, 0x61, + 0x12, 0x14, 0x0a, 0x05, 0x61, 0x64, 0x64, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x05, 0x61, 0x64, 0x64, 0x72, 0x73, 0x1a, 0x20, 0x0a, 0x08, 0x52, 0x61, 0x62, 0x62, 0x69, 0x74, + 0x4d, 0x51, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x64, 0x64, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x05, 0x61, 0x64, 0x64, 0x72, 0x73, 0x1a, 0x92, 0x01, 0x0a, 0x03, 0x53, 0x53, 0x45, + 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, + 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x33, + 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, + 0x6f, 0x75, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x42, 0x30, 0x5a, + 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x65, 0x6e, 0x74, 0x2d, 0x65, 0x78, 0x61, 0x6d, + 0x70, 0x6c, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_common_conf_server_proto_rawDescOnce sync.Once + file_common_conf_server_proto_rawDescData = file_common_conf_server_proto_rawDesc +) + +func file_common_conf_server_proto_rawDescGZIP() []byte { + file_common_conf_server_proto_rawDescOnce.Do(func() { + file_common_conf_server_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_conf_server_proto_rawDescData) + }) + return file_common_conf_server_proto_rawDescData +} + +var file_common_conf_server_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_common_conf_server_proto_goTypes = []interface{}{ + (*Server)(nil), // 0: common.conf.Server + (*Server_REST)(nil), // 1: common.conf.Server.REST + (*Server_GRPC)(nil), // 2: common.conf.Server.GRPC + (*Server_Websocket)(nil), // 3: common.conf.Server.Websocket + (*Server_Mqtt)(nil), // 4: common.conf.Server.Mqtt + (*Server_Kafka)(nil), // 5: common.conf.Server.Kafka + (*Server_RabbitMQ)(nil), // 6: common.conf.Server.RabbitMQ + (*Server_SSE)(nil), // 7: common.conf.Server.SSE + (*Server_REST_CORS)(nil), // 8: common.conf.Server.REST.CORS + (*durationpb.Duration)(nil), // 9: google.protobuf.Duration + (*Middleware)(nil), // 10: common.conf.Middleware +} +var file_common_conf_server_proto_depIdxs = []int32{ + 1, // 0: common.conf.Server.rest:type_name -> common.conf.Server.REST + 2, // 1: common.conf.Server.grpc:type_name -> common.conf.Server.GRPC + 3, // 2: common.conf.Server.websocket:type_name -> common.conf.Server.Websocket + 4, // 3: common.conf.Server.mqtt:type_name -> common.conf.Server.Mqtt + 5, // 4: common.conf.Server.kafka:type_name -> common.conf.Server.Kafka + 6, // 5: common.conf.Server.rabbitmq:type_name -> common.conf.Server.RabbitMQ + 7, // 6: common.conf.Server.sse:type_name -> common.conf.Server.SSE + 9, // 7: common.conf.Server.REST.timeout:type_name -> google.protobuf.Duration + 8, // 8: common.conf.Server.REST.cors:type_name -> common.conf.Server.REST.CORS + 10, // 9: common.conf.Server.REST.middleware:type_name -> common.conf.Middleware + 9, // 10: common.conf.Server.GRPC.timeout:type_name -> google.protobuf.Duration + 10, // 11: common.conf.Server.GRPC.middleware:type_name -> common.conf.Middleware + 9, // 12: common.conf.Server.Websocket.timeout:type_name -> google.protobuf.Duration + 9, // 13: common.conf.Server.SSE.timeout:type_name -> google.protobuf.Duration + 14, // [14:14] is the sub-list for method output_type + 14, // [14:14] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name +} + +func init() { file_common_conf_server_proto_init() } +func file_common_conf_server_proto_init() { + if File_common_conf_server_proto != nil { + return + } + file_common_conf_middleware_proto_init() + if !protoimpl.UnsafeEnabled { + file_common_conf_server_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Server); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_server_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Server_REST); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_server_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Server_GRPC); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_server_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Server_Websocket); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_server_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Server_Mqtt); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_server_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Server_Kafka); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_server_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Server_RabbitMQ); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_server_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Server_SSE); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_server_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Server_REST_CORS); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_conf_server_proto_rawDesc, + NumEnums: 0, + NumMessages: 9, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_conf_server_proto_goTypes, + DependencyIndexes: file_common_conf_server_proto_depIdxs, + MessageInfos: file_common_conf_server_proto_msgTypes, + }.Build() + File_common_conf_server_proto = out.File + file_common_conf_server_proto_rawDesc = nil + file_common_conf_server_proto_goTypes = nil + file_common_conf_server_proto_depIdxs = nil +} diff --git a/orm/ent/gen/api/go/common/conf/server.pb.validate.go b/orm/ent/gen/api/go/common/conf/server.pb.validate.go new file mode 100644 index 0000000..5f9e65d --- /dev/null +++ b/orm/ent/gen/api/go/common/conf/server.pb.validate.go @@ -0,0 +1,1361 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: common/conf/server.proto + +package conf + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on Server with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Server) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Server with the rules defined in the +// proto definition for this message. If any rules are violated, the result is +// a list of violation errors wrapped in ServerMultiError, or nil if none found. +func (m *Server) ValidateAll() error { + return m.validate(true) +} + +func (m *Server) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetRest()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ServerValidationError{ + field: "Rest", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ServerValidationError{ + field: "Rest", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRest()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ServerValidationError{ + field: "Rest", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetGrpc()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ServerValidationError{ + field: "Grpc", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ServerValidationError{ + field: "Grpc", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetGrpc()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ServerValidationError{ + field: "Grpc", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetWebsocket()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ServerValidationError{ + field: "Websocket", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ServerValidationError{ + field: "Websocket", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetWebsocket()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ServerValidationError{ + field: "Websocket", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetMqtt()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ServerValidationError{ + field: "Mqtt", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ServerValidationError{ + field: "Mqtt", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMqtt()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ServerValidationError{ + field: "Mqtt", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetKafka()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ServerValidationError{ + field: "Kafka", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ServerValidationError{ + field: "Kafka", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetKafka()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ServerValidationError{ + field: "Kafka", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetRabbitmq()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ServerValidationError{ + field: "Rabbitmq", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ServerValidationError{ + field: "Rabbitmq", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRabbitmq()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ServerValidationError{ + field: "Rabbitmq", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetSse()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ServerValidationError{ + field: "Sse", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ServerValidationError{ + field: "Sse", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetSse()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ServerValidationError{ + field: "Sse", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return ServerMultiError(errors) + } + + return nil +} + +// ServerMultiError is an error wrapping multiple validation errors returned by +// Server.ValidateAll() if the designated constraints aren't met. +type ServerMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ServerMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ServerMultiError) AllErrors() []error { return m } + +// ServerValidationError is the validation error returned by Server.Validate if +// the designated constraints aren't met. +type ServerValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ServerValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ServerValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ServerValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ServerValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ServerValidationError) ErrorName() string { return "ServerValidationError" } + +// Error satisfies the builtin error interface +func (e ServerValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sServer.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ServerValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ServerValidationError{} + +// Validate checks the field values on Server_REST with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Server_REST) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Server_REST with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Server_RESTMultiError, or +// nil if none found. +func (m *Server_REST) ValidateAll() error { + return m.validate(true) +} + +func (m *Server_REST) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Network + + // no validation rules for Addr + + if all { + switch v := interface{}(m.GetTimeout()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Server_RESTValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Server_RESTValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Server_RESTValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetCors()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Server_RESTValidationError{ + field: "Cors", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Server_RESTValidationError{ + field: "Cors", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetCors()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Server_RESTValidationError{ + field: "Cors", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetMiddleware()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Server_RESTValidationError{ + field: "Middleware", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Server_RESTValidationError{ + field: "Middleware", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMiddleware()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Server_RESTValidationError{ + field: "Middleware", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return Server_RESTMultiError(errors) + } + + return nil +} + +// Server_RESTMultiError is an error wrapping multiple validation errors +// returned by Server_REST.ValidateAll() if the designated constraints aren't met. +type Server_RESTMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Server_RESTMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Server_RESTMultiError) AllErrors() []error { return m } + +// Server_RESTValidationError is the validation error returned by +// Server_REST.Validate if the designated constraints aren't met. +type Server_RESTValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Server_RESTValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Server_RESTValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Server_RESTValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Server_RESTValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Server_RESTValidationError) ErrorName() string { return "Server_RESTValidationError" } + +// Error satisfies the builtin error interface +func (e Server_RESTValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sServer_REST.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Server_RESTValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Server_RESTValidationError{} + +// Validate checks the field values on Server_GRPC with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Server_GRPC) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Server_GRPC with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Server_GRPCMultiError, or +// nil if none found. +func (m *Server_GRPC) ValidateAll() error { + return m.validate(true) +} + +func (m *Server_GRPC) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Network + + // no validation rules for Addr + + if all { + switch v := interface{}(m.GetTimeout()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Server_GRPCValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Server_GRPCValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Server_GRPCValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetMiddleware()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Server_GRPCValidationError{ + field: "Middleware", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Server_GRPCValidationError{ + field: "Middleware", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMiddleware()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Server_GRPCValidationError{ + field: "Middleware", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return Server_GRPCMultiError(errors) + } + + return nil +} + +// Server_GRPCMultiError is an error wrapping multiple validation errors +// returned by Server_GRPC.ValidateAll() if the designated constraints aren't met. +type Server_GRPCMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Server_GRPCMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Server_GRPCMultiError) AllErrors() []error { return m } + +// Server_GRPCValidationError is the validation error returned by +// Server_GRPC.Validate if the designated constraints aren't met. +type Server_GRPCValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Server_GRPCValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Server_GRPCValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Server_GRPCValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Server_GRPCValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Server_GRPCValidationError) ErrorName() string { return "Server_GRPCValidationError" } + +// Error satisfies the builtin error interface +func (e Server_GRPCValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sServer_GRPC.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Server_GRPCValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Server_GRPCValidationError{} + +// Validate checks the field values on Server_Websocket with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *Server_Websocket) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Server_Websocket with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// Server_WebsocketMultiError, or nil if none found. +func (m *Server_Websocket) ValidateAll() error { + return m.validate(true) +} + +func (m *Server_Websocket) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Network + + // no validation rules for Addr + + // no validation rules for Path + + // no validation rules for Codec + + if all { + switch v := interface{}(m.GetTimeout()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Server_WebsocketValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Server_WebsocketValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Server_WebsocketValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return Server_WebsocketMultiError(errors) + } + + return nil +} + +// Server_WebsocketMultiError is an error wrapping multiple validation errors +// returned by Server_Websocket.ValidateAll() if the designated constraints +// aren't met. +type Server_WebsocketMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Server_WebsocketMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Server_WebsocketMultiError) AllErrors() []error { return m } + +// Server_WebsocketValidationError is the validation error returned by +// Server_Websocket.Validate if the designated constraints aren't met. +type Server_WebsocketValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Server_WebsocketValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Server_WebsocketValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Server_WebsocketValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Server_WebsocketValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Server_WebsocketValidationError) ErrorName() string { return "Server_WebsocketValidationError" } + +// Error satisfies the builtin error interface +func (e Server_WebsocketValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sServer_Websocket.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Server_WebsocketValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Server_WebsocketValidationError{} + +// Validate checks the field values on Server_Mqtt with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Server_Mqtt) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Server_Mqtt with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Server_MqttMultiError, or +// nil if none found. +func (m *Server_Mqtt) ValidateAll() error { + return m.validate(true) +} + +func (m *Server_Mqtt) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Addr + + if len(errors) > 0 { + return Server_MqttMultiError(errors) + } + + return nil +} + +// Server_MqttMultiError is an error wrapping multiple validation errors +// returned by Server_Mqtt.ValidateAll() if the designated constraints aren't met. +type Server_MqttMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Server_MqttMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Server_MqttMultiError) AllErrors() []error { return m } + +// Server_MqttValidationError is the validation error returned by +// Server_Mqtt.Validate if the designated constraints aren't met. +type Server_MqttValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Server_MqttValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Server_MqttValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Server_MqttValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Server_MqttValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Server_MqttValidationError) ErrorName() string { return "Server_MqttValidationError" } + +// Error satisfies the builtin error interface +func (e Server_MqttValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sServer_Mqtt.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Server_MqttValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Server_MqttValidationError{} + +// Validate checks the field values on Server_Kafka with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Server_Kafka) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Server_Kafka with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Server_KafkaMultiError, or +// nil if none found. +func (m *Server_Kafka) ValidateAll() error { + return m.validate(true) +} + +func (m *Server_Kafka) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return Server_KafkaMultiError(errors) + } + + return nil +} + +// Server_KafkaMultiError is an error wrapping multiple validation errors +// returned by Server_Kafka.ValidateAll() if the designated constraints aren't met. +type Server_KafkaMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Server_KafkaMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Server_KafkaMultiError) AllErrors() []error { return m } + +// Server_KafkaValidationError is the validation error returned by +// Server_Kafka.Validate if the designated constraints aren't met. +type Server_KafkaValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Server_KafkaValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Server_KafkaValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Server_KafkaValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Server_KafkaValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Server_KafkaValidationError) ErrorName() string { return "Server_KafkaValidationError" } + +// Error satisfies the builtin error interface +func (e Server_KafkaValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sServer_Kafka.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Server_KafkaValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Server_KafkaValidationError{} + +// Validate checks the field values on Server_RabbitMQ with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *Server_RabbitMQ) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Server_RabbitMQ with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// Server_RabbitMQMultiError, or nil if none found. +func (m *Server_RabbitMQ) ValidateAll() error { + return m.validate(true) +} + +func (m *Server_RabbitMQ) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return Server_RabbitMQMultiError(errors) + } + + return nil +} + +// Server_RabbitMQMultiError is an error wrapping multiple validation errors +// returned by Server_RabbitMQ.ValidateAll() if the designated constraints +// aren't met. +type Server_RabbitMQMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Server_RabbitMQMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Server_RabbitMQMultiError) AllErrors() []error { return m } + +// Server_RabbitMQValidationError is the validation error returned by +// Server_RabbitMQ.Validate if the designated constraints aren't met. +type Server_RabbitMQValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Server_RabbitMQValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Server_RabbitMQValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Server_RabbitMQValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Server_RabbitMQValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Server_RabbitMQValidationError) ErrorName() string { return "Server_RabbitMQValidationError" } + +// Error satisfies the builtin error interface +func (e Server_RabbitMQValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sServer_RabbitMQ.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Server_RabbitMQValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Server_RabbitMQValidationError{} + +// Validate checks the field values on Server_SSE with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Server_SSE) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Server_SSE with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Server_SSEMultiError, or +// nil if none found. +func (m *Server_SSE) ValidateAll() error { + return m.validate(true) +} + +func (m *Server_SSE) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Network + + // no validation rules for Addr + + if all { + switch v := interface{}(m.GetTimeout()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Server_SSEValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Server_SSEValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Server_SSEValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for Path + + // no validation rules for Codec + + if len(errors) > 0 { + return Server_SSEMultiError(errors) + } + + return nil +} + +// Server_SSEMultiError is an error wrapping multiple validation errors +// returned by Server_SSE.ValidateAll() if the designated constraints aren't met. +type Server_SSEMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Server_SSEMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Server_SSEMultiError) AllErrors() []error { return m } + +// Server_SSEValidationError is the validation error returned by +// Server_SSE.Validate if the designated constraints aren't met. +type Server_SSEValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Server_SSEValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Server_SSEValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Server_SSEValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Server_SSEValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Server_SSEValidationError) ErrorName() string { return "Server_SSEValidationError" } + +// Error satisfies the builtin error interface +func (e Server_SSEValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sServer_SSE.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Server_SSEValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Server_SSEValidationError{} + +// Validate checks the field values on Server_REST_CORS with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *Server_REST_CORS) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Server_REST_CORS with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// Server_REST_CORSMultiError, or nil if none found. +func (m *Server_REST_CORS) ValidateAll() error { + return m.validate(true) +} + +func (m *Server_REST_CORS) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return Server_REST_CORSMultiError(errors) + } + + return nil +} + +// Server_REST_CORSMultiError is an error wrapping multiple validation errors +// returned by Server_REST_CORS.ValidateAll() if the designated constraints +// aren't met. +type Server_REST_CORSMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Server_REST_CORSMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Server_REST_CORSMultiError) AllErrors() []error { return m } + +// Server_REST_CORSValidationError is the validation error returned by +// Server_REST_CORS.Validate if the designated constraints aren't met. +type Server_REST_CORSValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Server_REST_CORSValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Server_REST_CORSValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Server_REST_CORSValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Server_REST_CORSValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Server_REST_CORSValidationError) ErrorName() string { return "Server_REST_CORSValidationError" } + +// Error satisfies the builtin error interface +func (e Server_REST_CORSValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sServer_REST_CORS.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Server_REST_CORSValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Server_REST_CORSValidationError{} diff --git a/orm/ent/gen/api/go/common/conf/tracer.pb.go b/orm/ent/gen/api/go/common/conf/tracer.pb.go new file mode 100644 index 0000000..a02bbaa --- /dev/null +++ b/orm/ent/gen/api/go/common/conf/tracer.pb.go @@ -0,0 +1,174 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: common/conf/tracer.proto + +package conf + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 链路追踪 +type Tracer struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Batcher string `protobuf:"bytes,1,opt,name=batcher,proto3" json:"batcher,omitempty"` // jaeger或者zipkin + Endpoint string `protobuf:"bytes,2,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // 端口 + Sampler float64 `protobuf:"fixed64,3,opt,name=sampler,proto3" json:"sampler,omitempty"` // 采样率,默认:1.0 + Env string `protobuf:"bytes,4,opt,name=env,proto3" json:"env,omitempty"` // 运行环境:dev、debug、product +} + +func (x *Tracer) Reset() { + *x = Tracer{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_tracer_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Tracer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Tracer) ProtoMessage() {} + +func (x *Tracer) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_tracer_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Tracer.ProtoReflect.Descriptor instead. +func (*Tracer) Descriptor() ([]byte, []int) { + return file_common_conf_tracer_proto_rawDescGZIP(), []int{0} +} + +func (x *Tracer) GetBatcher() string { + if x != nil { + return x.Batcher + } + return "" +} + +func (x *Tracer) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +func (x *Tracer) GetSampler() float64 { + if x != nil { + return x.Sampler + } + return 0 +} + +func (x *Tracer) GetEnv() string { + if x != nil { + return x.Env + } + return "" +} + +var File_common_conf_tracer_proto protoreflect.FileDescriptor + +var file_common_conf_tracer_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x74, 0x72, + 0x61, 0x63, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x22, 0x6a, 0x0a, 0x06, 0x54, 0x72, 0x61, 0x63, 0x65, + 0x72, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x62, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x65, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x72, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x65, 0x6e, 0x76, 0x42, 0x30, 0x5a, 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x65, 0x6e, + 0x74, 0x2d, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, + 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_common_conf_tracer_proto_rawDescOnce sync.Once + file_common_conf_tracer_proto_rawDescData = file_common_conf_tracer_proto_rawDesc +) + +func file_common_conf_tracer_proto_rawDescGZIP() []byte { + file_common_conf_tracer_proto_rawDescOnce.Do(func() { + file_common_conf_tracer_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_conf_tracer_proto_rawDescData) + }) + return file_common_conf_tracer_proto_rawDescData +} + +var file_common_conf_tracer_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_common_conf_tracer_proto_goTypes = []interface{}{ + (*Tracer)(nil), // 0: common.conf.Tracer +} +var file_common_conf_tracer_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_common_conf_tracer_proto_init() } +func file_common_conf_tracer_proto_init() { + if File_common_conf_tracer_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_common_conf_tracer_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Tracer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_conf_tracer_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_conf_tracer_proto_goTypes, + DependencyIndexes: file_common_conf_tracer_proto_depIdxs, + MessageInfos: file_common_conf_tracer_proto_msgTypes, + }.Build() + File_common_conf_tracer_proto = out.File + file_common_conf_tracer_proto_rawDesc = nil + file_common_conf_tracer_proto_goTypes = nil + file_common_conf_tracer_proto_depIdxs = nil +} diff --git a/orm/ent/gen/api/go/common/conf/tracer.pb.validate.go b/orm/ent/gen/api/go/common/conf/tracer.pb.validate.go new file mode 100644 index 0000000..128fad2 --- /dev/null +++ b/orm/ent/gen/api/go/common/conf/tracer.pb.validate.go @@ -0,0 +1,142 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: common/conf/tracer.proto + +package conf + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on Tracer with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Tracer) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Tracer with the rules defined in the +// proto definition for this message. If any rules are violated, the result is +// a list of violation errors wrapped in TracerMultiError, or nil if none found. +func (m *Tracer) ValidateAll() error { + return m.validate(true) +} + +func (m *Tracer) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Batcher + + // no validation rules for Endpoint + + // no validation rules for Sampler + + // no validation rules for Env + + if len(errors) > 0 { + return TracerMultiError(errors) + } + + return nil +} + +// TracerMultiError is an error wrapping multiple validation errors returned by +// Tracer.ValidateAll() if the designated constraints aren't met. +type TracerMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m TracerMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m TracerMultiError) AllErrors() []error { return m } + +// TracerValidationError is the validation error returned by Tracer.Validate if +// the designated constraints aren't met. +type TracerValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e TracerValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e TracerValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e TracerValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e TracerValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e TracerValidationError) ErrorName() string { return "TracerValidationError" } + +// Error satisfies the builtin error interface +func (e TracerValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sTracer.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = TracerValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = TracerValidationError{} diff --git a/orm/ent/gen/api/go/common/pagination/pagination.pb.go b/orm/ent/gen/api/go/common/pagination/pagination.pb.go new file mode 100644 index 0000000..a8ea1ea --- /dev/null +++ b/orm/ent/gen/api/go/common/pagination/pagination.pb.go @@ -0,0 +1,370 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: common/pagination/pagination.proto + +package pagination + +import ( + _ "github.com/google/gnostic/openapiv3" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 排序类型 +type SortOrder int32 + +const ( + // 不排序 + SortOrder_UNSORTED SortOrder = 0 + // 升序 + SortOrder_ASCENDING SortOrder = 1 + // 降序 + SortOrder_DESCENDING SortOrder = 2 +) + +// Enum value maps for SortOrder. +var ( + SortOrder_name = map[int32]string{ + 0: "UNSORTED", + 1: "ASCENDING", + 2: "DESCENDING", + } + SortOrder_value = map[string]int32{ + "UNSORTED": 0, + "ASCENDING": 1, + "DESCENDING": 2, + } +) + +func (x SortOrder) Enum() *SortOrder { + p := new(SortOrder) + *p = x + return p +} + +func (x SortOrder) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SortOrder) Descriptor() protoreflect.EnumDescriptor { + return file_common_pagination_pagination_proto_enumTypes[0].Descriptor() +} + +func (SortOrder) Type() protoreflect.EnumType { + return &file_common_pagination_pagination_proto_enumTypes[0] +} + +func (x SortOrder) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SortOrder.Descriptor instead. +func (SortOrder) EnumDescriptor() ([]byte, []int) { + return file_common_pagination_pagination_proto_rawDescGZIP(), []int{0} +} + +// 分页通用请求 +type PagingRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 当前页码 + Page *int32 `protobuf:"varint,1,opt,name=page,proto3,oneof" json:"page,omitempty"` + // 每页的行数 + PageSize *int32 `protobuf:"varint,2,opt,name=pageSize,proto3,oneof" json:"pageSize,omitempty"` + //AND过滤条件 + Query *string `protobuf:"bytes,3,opt,name=query,proto3,oneof" json:"query,omitempty"` + // OR过滤条件 + OrQuery *string `protobuf:"bytes,4,opt,name=orQuery,json=or,proto3,oneof" json:"orQuery,omitempty"` + // 排序条件 + OrderBy []string `protobuf:"bytes,5,rep,name=orderBy,proto3" json:"orderBy,omitempty"` + // 是否不分页 + NoPaging *bool `protobuf:"varint,6,opt,name=noPaging,json=nopaging,proto3,oneof" json:"noPaging,omitempty"` +} + +func (x *PagingRequest) Reset() { + *x = PagingRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_common_pagination_pagination_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PagingRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PagingRequest) ProtoMessage() {} + +func (x *PagingRequest) ProtoReflect() protoreflect.Message { + mi := &file_common_pagination_pagination_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PagingRequest.ProtoReflect.Descriptor instead. +func (*PagingRequest) Descriptor() ([]byte, []int) { + return file_common_pagination_pagination_proto_rawDescGZIP(), []int{0} +} + +func (x *PagingRequest) GetPage() int32 { + if x != nil && x.Page != nil { + return *x.Page + } + return 0 +} + +func (x *PagingRequest) GetPageSize() int32 { + if x != nil && x.PageSize != nil { + return *x.PageSize + } + return 0 +} + +func (x *PagingRequest) GetQuery() string { + if x != nil && x.Query != nil { + return *x.Query + } + return "" +} + +func (x *PagingRequest) GetOrQuery() string { + if x != nil && x.OrQuery != nil { + return *x.OrQuery + } + return "" +} + +func (x *PagingRequest) GetOrderBy() []string { + if x != nil { + return x.OrderBy + } + return nil +} + +func (x *PagingRequest) GetNoPaging() bool { + if x != nil && x.NoPaging != nil { + return *x.NoPaging + } + return false +} + +// 分页通用结果 +type PagingResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 总数 + Total int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + // 分页数据 + Items []*anypb.Any `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` +} + +func (x *PagingResponse) Reset() { + *x = PagingResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_common_pagination_pagination_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PagingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PagingResponse) ProtoMessage() {} + +func (x *PagingResponse) ProtoReflect() protoreflect.Message { + mi := &file_common_pagination_pagination_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PagingResponse.ProtoReflect.Descriptor instead. +func (*PagingResponse) Descriptor() ([]byte, []int) { + return file_common_pagination_pagination_proto_rawDescGZIP(), []int{1} +} + +func (x *PagingResponse) GetTotal() int32 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *PagingResponse) GetItems() []*anypb.Any { + if x != nil { + return x.Items + } + return nil +} + +var File_common_pagination_pagination_proto protoreflect.FileDescriptor + +var file_common_pagination_pagination_proto_rawDesc = []byte{ + 0x0a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x24, 0x67, 0x6e, 0x6f, + 0x73, 0x74, 0x69, 0x63, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x33, 0x2f, + 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x9a, 0x04, 0x0a, 0x0d, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x42, 0x1e, 0xba, 0x47, 0x1b, 0x8a, 0x02, 0x09, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0x3f, 0x92, 0x02, 0x0c, 0xe5, 0xbd, 0x93, 0xe5, 0x89, 0x8d, 0xe9, 0xa1, 0xb5, 0xe7, 0xa0, + 0x81, 0x48, 0x00, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x88, 0x01, 0x01, 0x12, 0x45, 0x0a, 0x08, + 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x42, 0x24, + 0xba, 0x47, 0x21, 0x8a, 0x02, 0x09, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40, 0x92, + 0x02, 0x12, 0xe6, 0xaf, 0x8f, 0xe4, 0xb8, 0x80, 0xe9, 0xa1, 0xb5, 0xe7, 0x9a, 0x84, 0xe8, 0xa1, + 0x8c, 0xe6, 0x95, 0xb0, 0x48, 0x01, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, + 0x88, 0x01, 0x01, 0x12, 0x51, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x36, 0xba, 0x47, 0x33, 0x3a, 0x1f, 0x12, 0x1d, 0x7b, 0x22, 0x6b, 0x65, 0x79, + 0x31, 0x22, 0x3a, 0x22, 0x76, 0x61, 0x6c, 0x31, 0x22, 0x2c, 0x22, 0x6b, 0x65, 0x79, 0x32, 0x22, + 0x3a, 0x22, 0x76, 0x61, 0x6c, 0x32, 0x22, 0x7d, 0x92, 0x02, 0x0f, 0x41, 0x4e, 0x44, 0xe8, 0xbf, + 0x87, 0xe6, 0xbb, 0xa4, 0xe6, 0x9d, 0xa1, 0xe4, 0xbb, 0xb6, 0x48, 0x02, 0x52, 0x05, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x88, 0x01, 0x01, 0x12, 0x4f, 0x0a, 0x07, 0x6f, 0x72, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x35, 0xba, 0x47, 0x32, 0x3a, 0x1f, 0x12, 0x1d, + 0x7b, 0x22, 0x6b, 0x65, 0x79, 0x31, 0x22, 0x3a, 0x22, 0x76, 0x61, 0x6c, 0x31, 0x22, 0x2c, 0x22, + 0x6b, 0x65, 0x79, 0x32, 0x22, 0x3a, 0x22, 0x76, 0x61, 0x6c, 0x32, 0x22, 0x7d, 0x92, 0x02, 0x0e, + 0x4f, 0x52, 0xe8, 0xbf, 0x87, 0xe6, 0xbb, 0xa4, 0xe6, 0x9d, 0xa1, 0xe4, 0xbb, 0xb6, 0x48, 0x03, + 0x52, 0x02, 0x6f, 0x72, 0x88, 0x01, 0x01, 0x12, 0x74, 0x0a, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, + 0x42, 0x79, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x42, 0x5a, 0xba, 0x47, 0x57, 0x3a, 0x13, 0x12, + 0x11, 0x7b, 0x22, 0x76, 0x61, 0x6c, 0x31, 0x22, 0x2c, 0x20, 0x22, 0x2d, 0x76, 0x61, 0x6c, 0x32, + 0x22, 0x7d, 0x92, 0x02, 0x3f, 0xe6, 0x8e, 0x92, 0xe5, 0xba, 0x8f, 0xe6, 0x9d, 0xa1, 0xe4, 0xbb, + 0xb6, 0xef, 0xbc, 0x8c, 0xe5, 0xad, 0x97, 0xe6, 0xae, 0xb5, 0xe5, 0x90, 0x8d, 0xe5, 0x89, 0x8d, + 0xe5, 0x8a, 0xa0, 0x27, 0x2d, 0x27, 0xe4, 0xb8, 0xba, 0xe9, 0x99, 0x8d, 0xe5, 0xba, 0x8f, 0xef, + 0xbc, 0x8c, 0xe5, 0x90, 0xa6, 0xe5, 0x88, 0x99, 0xe4, 0xb8, 0xba, 0xe5, 0x8d, 0x87, 0xe5, 0xba, + 0x8f, 0xe3, 0x80, 0x82, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x79, 0x12, 0x36, 0x0a, + 0x08, 0x6e, 0x6f, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x42, + 0x15, 0xba, 0x47, 0x12, 0x92, 0x02, 0x0f, 0xe6, 0x98, 0xaf, 0xe5, 0x90, 0xa6, 0xe4, 0xb8, 0x8d, + 0xe5, 0x88, 0x86, 0xe9, 0xa1, 0xb5, 0x48, 0x04, 0x52, 0x08, 0x6e, 0x6f, 0x70, 0x61, 0x67, 0x69, + 0x6e, 0x67, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x42, 0x0b, + 0x0a, 0x09, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x5f, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x6f, 0x72, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6e, 0x6f, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x22, 0x52, + 0x0a, 0x0e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x2a, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x69, 0x74, 0x65, + 0x6d, 0x73, 0x2a, 0x38, 0x0a, 0x09, 0x53, 0x6f, 0x72, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, + 0x0c, 0x0a, 0x08, 0x55, 0x4e, 0x53, 0x4f, 0x52, 0x54, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, + 0x09, 0x41, 0x53, 0x43, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, + 0x44, 0x45, 0x53, 0x43, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x42, 0x3c, 0x5a, 0x3a, + 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x65, 0x6e, 0x74, 0x2d, 0x65, 0x78, 0x61, 0x6d, 0x70, + 0x6c, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3b, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_common_pagination_pagination_proto_rawDescOnce sync.Once + file_common_pagination_pagination_proto_rawDescData = file_common_pagination_pagination_proto_rawDesc +) + +func file_common_pagination_pagination_proto_rawDescGZIP() []byte { + file_common_pagination_pagination_proto_rawDescOnce.Do(func() { + file_common_pagination_pagination_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_pagination_pagination_proto_rawDescData) + }) + return file_common_pagination_pagination_proto_rawDescData +} + +var file_common_pagination_pagination_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_common_pagination_pagination_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_common_pagination_pagination_proto_goTypes = []interface{}{ + (SortOrder)(0), // 0: pagination.SortOrder + (*PagingRequest)(nil), // 1: pagination.PagingRequest + (*PagingResponse)(nil), // 2: pagination.PagingResponse + (*anypb.Any)(nil), // 3: google.protobuf.Any +} +var file_common_pagination_pagination_proto_depIdxs = []int32{ + 3, // 0: pagination.PagingResponse.items:type_name -> google.protobuf.Any + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_common_pagination_pagination_proto_init() } +func file_common_pagination_pagination_proto_init() { + if File_common_pagination_pagination_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_common_pagination_pagination_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PagingRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_pagination_pagination_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PagingResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_common_pagination_pagination_proto_msgTypes[0].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_pagination_pagination_proto_rawDesc, + NumEnums: 1, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_pagination_pagination_proto_goTypes, + DependencyIndexes: file_common_pagination_pagination_proto_depIdxs, + EnumInfos: file_common_pagination_pagination_proto_enumTypes, + MessageInfos: file_common_pagination_pagination_proto_msgTypes, + }.Build() + File_common_pagination_pagination_proto = out.File + file_common_pagination_pagination_proto_rawDesc = nil + file_common_pagination_pagination_proto_goTypes = nil + file_common_pagination_pagination_proto_depIdxs = nil +} diff --git a/orm/ent/gen/api/go/common/pagination/pagination.pb.validate.go b/orm/ent/gen/api/go/common/pagination/pagination.pb.validate.go new file mode 100644 index 0000000..db5fc81 --- /dev/null +++ b/orm/ent/gen/api/go/common/pagination/pagination.pb.validate.go @@ -0,0 +1,292 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: common/pagination/pagination.proto + +package pagination + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on PagingRequest with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *PagingRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on PagingRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in PagingRequestMultiError, or +// nil if none found. +func (m *PagingRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *PagingRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if m.Page != nil { + // no validation rules for Page + } + + if m.PageSize != nil { + // no validation rules for PageSize + } + + if m.Query != nil { + // no validation rules for Query + } + + if m.OrQuery != nil { + // no validation rules for OrQuery + } + + if m.NoPaging != nil { + // no validation rules for NoPaging + } + + if len(errors) > 0 { + return PagingRequestMultiError(errors) + } + + return nil +} + +// PagingRequestMultiError is an error wrapping multiple validation errors +// returned by PagingRequest.ValidateAll() if the designated constraints +// aren't met. +type PagingRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m PagingRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m PagingRequestMultiError) AllErrors() []error { return m } + +// PagingRequestValidationError is the validation error returned by +// PagingRequest.Validate if the designated constraints aren't met. +type PagingRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e PagingRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e PagingRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e PagingRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e PagingRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e PagingRequestValidationError) ErrorName() string { return "PagingRequestValidationError" } + +// Error satisfies the builtin error interface +func (e PagingRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sPagingRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = PagingRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = PagingRequestValidationError{} + +// Validate checks the field values on PagingResponse with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *PagingResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on PagingResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in PagingResponseMultiError, +// or nil if none found. +func (m *PagingResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *PagingResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Total + + for idx, item := range m.GetItems() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, PagingResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, PagingResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return PagingResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return PagingResponseMultiError(errors) + } + + return nil +} + +// PagingResponseMultiError is an error wrapping multiple validation errors +// returned by PagingResponse.ValidateAll() if the designated constraints +// aren't met. +type PagingResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m PagingResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m PagingResponseMultiError) AllErrors() []error { return m } + +// PagingResponseValidationError is the validation error returned by +// PagingResponse.Validate if the designated constraints aren't met. +type PagingResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e PagingResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e PagingResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e PagingResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e PagingResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e PagingResponseValidationError) ErrorName() string { return "PagingResponseValidationError" } + +// Error satisfies the builtin error interface +func (e PagingResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sPagingResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = PagingResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = PagingResponseValidationError{} diff --git a/orm/ent/gen/api/go/user/service/v1/user.pb.go b/orm/ent/gen/api/go/user/service/v1/user.pb.go new file mode 100644 index 0000000..a002cce --- /dev/null +++ b/orm/ent/gen/api/go/user/service/v1/user.pb.go @@ -0,0 +1,695 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: user/service/v1/user.proto + +package v1 + +import ( + _ "github.com/google/gnostic/openapiv3" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + pagination "kratos-ent-example/gen/api/go/common/pagination" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 用户 +type User struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + UserName *string `protobuf:"bytes,2,opt,name=userName,proto3,oneof" json:"userName,omitempty"` + NickName *string `protobuf:"bytes,3,opt,name=nickName,proto3,oneof" json:"nickName,omitempty"` + Password *string `protobuf:"bytes,4,opt,name=password,proto3,oneof" json:"password,omitempty"` + CreateTime *string `protobuf:"bytes,10,opt,name=createTime,proto3,oneof" json:"createTime,omitempty"` + UpdateTime *string `protobuf:"bytes,11,opt,name=updateTime,proto3,oneof" json:"updateTime,omitempty"` + DeleteTime *string `protobuf:"bytes,12,opt,name=deleteTime,proto3,oneof" json:"deleteTime,omitempty"` +} + +func (x *User) Reset() { + *x = User{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_user_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *User) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*User) ProtoMessage() {} + +func (x *User) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_user_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use User.ProtoReflect.Descriptor instead. +func (*User) Descriptor() ([]byte, []int) { + return file_user_service_v1_user_proto_rawDescGZIP(), []int{0} +} + +func (x *User) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *User) GetUserName() string { + if x != nil && x.UserName != nil { + return *x.UserName + } + return "" +} + +func (x *User) GetNickName() string { + if x != nil && x.NickName != nil { + return *x.NickName + } + return "" +} + +func (x *User) GetPassword() string { + if x != nil && x.Password != nil { + return *x.Password + } + return "" +} + +func (x *User) GetCreateTime() string { + if x != nil && x.CreateTime != nil { + return *x.CreateTime + } + return "" +} + +func (x *User) GetUpdateTime() string { + if x != nil && x.UpdateTime != nil { + return *x.UpdateTime + } + return "" +} + +func (x *User) GetDeleteTime() string { + if x != nil && x.DeleteTime != nil { + return *x.DeleteTime + } + return "" +} + +// 获取用户列表 - 答复 +type ListUserResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Items []*User `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` + Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` +} + +func (x *ListUserResponse) Reset() { + *x = ListUserResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_user_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListUserResponse) ProtoMessage() {} + +func (x *ListUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_user_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListUserResponse.ProtoReflect.Descriptor instead. +func (*ListUserResponse) Descriptor() ([]byte, []int) { + return file_user_service_v1_user_proto_rawDescGZIP(), []int{1} +} + +func (x *ListUserResponse) GetItems() []*User { + if x != nil { + return x.Items + } + return nil +} + +func (x *ListUserResponse) GetTotal() int32 { + if x != nil { + return x.Total + } + return 0 +} + +// 获取用户数据 - 请求 +type GetUserRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GetUserRequest) Reset() { + *x = GetUserRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_user_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserRequest) ProtoMessage() {} + +func (x *GetUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_user_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserRequest.ProtoReflect.Descriptor instead. +func (*GetUserRequest) Descriptor() ([]byte, []int) { + return file_user_service_v1_user_proto_rawDescGZIP(), []int{2} +} + +func (x *GetUserRequest) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +type GetUserByUserNameRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserName string `protobuf:"bytes,1,opt,name=userName,proto3" json:"userName,omitempty"` +} + +func (x *GetUserByUserNameRequest) Reset() { + *x = GetUserByUserNameRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_user_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUserByUserNameRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserByUserNameRequest) ProtoMessage() {} + +func (x *GetUserByUserNameRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_user_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserByUserNameRequest.ProtoReflect.Descriptor instead. +func (*GetUserByUserNameRequest) Descriptor() ([]byte, []int) { + return file_user_service_v1_user_proto_rawDescGZIP(), []int{3} +} + +func (x *GetUserByUserNameRequest) GetUserName() string { + if x != nil { + return x.UserName + } + return "" +} + +// 创建用户 - 请求 +type CreateUserRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` + OperatorId uint32 `protobuf:"varint,2,opt,name=operatorId,proto3" json:"operatorId,omitempty"` +} + +func (x *CreateUserRequest) Reset() { + *x = CreateUserRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_user_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateUserRequest) ProtoMessage() {} + +func (x *CreateUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_user_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead. +func (*CreateUserRequest) Descriptor() ([]byte, []int) { + return file_user_service_v1_user_proto_rawDescGZIP(), []int{4} +} + +func (x *CreateUserRequest) GetUser() *User { + if x != nil { + return x.User + } + return nil +} + +func (x *CreateUserRequest) GetOperatorId() uint32 { + if x != nil { + return x.OperatorId + } + return 0 +} + +// 更新用户 - 请求 +type UpdateUserRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + User *User `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` + OperatorId uint32 `protobuf:"varint,3,opt,name=operatorId,proto3" json:"operatorId,omitempty"` +} + +func (x *UpdateUserRequest) Reset() { + *x = UpdateUserRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_user_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUserRequest) ProtoMessage() {} + +func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_user_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateUserRequest.ProtoReflect.Descriptor instead. +func (*UpdateUserRequest) Descriptor() ([]byte, []int) { + return file_user_service_v1_user_proto_rawDescGZIP(), []int{5} +} + +func (x *UpdateUserRequest) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateUserRequest) GetUser() *User { + if x != nil { + return x.User + } + return nil +} + +func (x *UpdateUserRequest) GetOperatorId() uint32 { + if x != nil { + return x.OperatorId + } + return 0 +} + +// 删除用户 - 请求 +type DeleteUserRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + OperatorId uint32 `protobuf:"varint,2,opt,name=operatorId,proto3" json:"operatorId,omitempty"` +} + +func (x *DeleteUserRequest) Reset() { + *x = DeleteUserRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_user_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteUserRequest) ProtoMessage() {} + +func (x *DeleteUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_user_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteUserRequest.ProtoReflect.Descriptor instead. +func (*DeleteUserRequest) Descriptor() ([]byte, []int) { + return file_user_service_v1_user_proto_rawDescGZIP(), []int{6} +} + +func (x *DeleteUserRequest) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *DeleteUserRequest) GetOperatorId() uint32 { + if x != nil { + return x.OperatorId + } + return 0 +} + +var File_user_service_v1_user_proto protoreflect.FileDescriptor + +var file_user_service_v1_user_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, + 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x75, 0x73, + 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x24, 0x67, + 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x33, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbc, 0x02, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, + 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x00, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1f, + 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x01, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, + 0x1f, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x02, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x88, 0x01, 0x01, + 0x12, 0x23, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, + 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, + 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x48, 0x04, 0x52, 0x0a, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x64, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x48, 0x05, + 0x52, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, + 0x0b, 0x0a, 0x09, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x0b, 0x0a, 0x09, + 0x5f, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x70, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x54, 0x69, 0x6d, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, + 0x69, 0x6d, 0x65, 0x22, 0x55, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, 0x69, + 0x74, 0x65, 0x6d, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x20, 0x0a, 0x0e, 0x47, 0x65, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, 0x36, 0x0a, 0x18, + 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, + 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, + 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x5e, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x04, 0x75, 0x73, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, + 0x75, 0x73, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, + 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x6f, 0x72, 0x49, 0x64, 0x22, 0x6e, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x29, 0x0a, 0x04, 0x75, 0x73, 0x65, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, + 0x75, 0x73, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, + 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x6f, 0x72, 0x49, 0x64, 0x22, 0x43, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x32, 0x80, 0x03, 0x0a, 0x0b, 0x55, 0x73, + 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4a, 0x0a, 0x08, 0x4c, 0x69, 0x73, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x21, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, + 0x12, 0x1f, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x0a, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x22, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, + 0x73, 0x65, 0x72, 0x12, 0x22, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x00, + 0x12, 0x4a, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x22, + 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x42, 0x32, 0x5a, 0x30, + 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x65, 0x6e, 0x74, 0x2d, 0x65, 0x78, 0x61, 0x6d, 0x70, + 0x6c, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x75, 0x73, + 0x65, 0x72, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_user_service_v1_user_proto_rawDescOnce sync.Once + file_user_service_v1_user_proto_rawDescData = file_user_service_v1_user_proto_rawDesc +) + +func file_user_service_v1_user_proto_rawDescGZIP() []byte { + file_user_service_v1_user_proto_rawDescOnce.Do(func() { + file_user_service_v1_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_user_service_v1_user_proto_rawDescData) + }) + return file_user_service_v1_user_proto_rawDescData +} + +var file_user_service_v1_user_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_user_service_v1_user_proto_goTypes = []interface{}{ + (*User)(nil), // 0: user.service.v1.User + (*ListUserResponse)(nil), // 1: user.service.v1.ListUserResponse + (*GetUserRequest)(nil), // 2: user.service.v1.GetUserRequest + (*GetUserByUserNameRequest)(nil), // 3: user.service.v1.GetUserByUserNameRequest + (*CreateUserRequest)(nil), // 4: user.service.v1.CreateUserRequest + (*UpdateUserRequest)(nil), // 5: user.service.v1.UpdateUserRequest + (*DeleteUserRequest)(nil), // 6: user.service.v1.DeleteUserRequest + (*pagination.PagingRequest)(nil), // 7: pagination.PagingRequest + (*emptypb.Empty)(nil), // 8: google.protobuf.Empty +} +var file_user_service_v1_user_proto_depIdxs = []int32{ + 0, // 0: user.service.v1.ListUserResponse.items:type_name -> user.service.v1.User + 0, // 1: user.service.v1.CreateUserRequest.user:type_name -> user.service.v1.User + 0, // 2: user.service.v1.UpdateUserRequest.user:type_name -> user.service.v1.User + 7, // 3: user.service.v1.UserService.ListUser:input_type -> pagination.PagingRequest + 2, // 4: user.service.v1.UserService.GetUser:input_type -> user.service.v1.GetUserRequest + 4, // 5: user.service.v1.UserService.CreateUser:input_type -> user.service.v1.CreateUserRequest + 5, // 6: user.service.v1.UserService.UpdateUser:input_type -> user.service.v1.UpdateUserRequest + 6, // 7: user.service.v1.UserService.DeleteUser:input_type -> user.service.v1.DeleteUserRequest + 1, // 8: user.service.v1.UserService.ListUser:output_type -> user.service.v1.ListUserResponse + 0, // 9: user.service.v1.UserService.GetUser:output_type -> user.service.v1.User + 0, // 10: user.service.v1.UserService.CreateUser:output_type -> user.service.v1.User + 0, // 11: user.service.v1.UserService.UpdateUser:output_type -> user.service.v1.User + 8, // 12: user.service.v1.UserService.DeleteUser:output_type -> google.protobuf.Empty + 8, // [8:13] is the sub-list for method output_type + 3, // [3:8] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_user_service_v1_user_proto_init() } +func file_user_service_v1_user_proto_init() { + if File_user_service_v1_user_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_user_service_v1_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*User); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_user_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListUserResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_user_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUserRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_user_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUserByUserNameRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_user_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateUserRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_user_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateUserRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_user_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteUserRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_user_service_v1_user_proto_msgTypes[0].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_user_service_v1_user_proto_rawDesc, + NumEnums: 0, + NumMessages: 7, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_user_service_v1_user_proto_goTypes, + DependencyIndexes: file_user_service_v1_user_proto_depIdxs, + MessageInfos: file_user_service_v1_user_proto_msgTypes, + }.Build() + File_user_service_v1_user_proto = out.File + file_user_service_v1_user_proto_rawDesc = nil + file_user_service_v1_user_proto_goTypes = nil + file_user_service_v1_user_proto_depIdxs = nil +} diff --git a/orm/ent/gen/api/go/user/service/v1/user.pb.validate.go b/orm/ent/gen/api/go/user/service/v1/user.pb.validate.go new file mode 100644 index 0000000..8f7ce37 --- /dev/null +++ b/orm/ent/gen/api/go/user/service/v1/user.pb.validate.go @@ -0,0 +1,876 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: user/service/v1/user.proto + +package v1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on User with the rules defined in the proto +// definition for this message. If any rules are violated, the first error +// encountered is returned, or nil if there are no violations. +func (m *User) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on User with the rules defined in the +// proto definition for this message. If any rules are violated, the result is +// a list of violation errors wrapped in UserMultiError, or nil if none found. +func (m *User) ValidateAll() error { + return m.validate(true) +} + +func (m *User) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if m.UserName != nil { + // no validation rules for UserName + } + + if m.NickName != nil { + // no validation rules for NickName + } + + if m.Password != nil { + // no validation rules for Password + } + + if m.CreateTime != nil { + // no validation rules for CreateTime + } + + if m.UpdateTime != nil { + // no validation rules for UpdateTime + } + + if m.DeleteTime != nil { + // no validation rules for DeleteTime + } + + if len(errors) > 0 { + return UserMultiError(errors) + } + + return nil +} + +// UserMultiError is an error wrapping multiple validation errors returned by +// User.ValidateAll() if the designated constraints aren't met. +type UserMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UserMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m UserMultiError) AllErrors() []error { return m } + +// UserValidationError is the validation error returned by User.Validate if the +// designated constraints aren't met. +type UserValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UserValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UserValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UserValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UserValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UserValidationError) ErrorName() string { return "UserValidationError" } + +// Error satisfies the builtin error interface +func (e UserValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUser.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UserValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UserValidationError{} + +// Validate checks the field values on ListUserResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *ListUserResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ListUserResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ListUserResponseMultiError, or nil if none found. +func (m *ListUserResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *ListUserResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + for idx, item := range m.GetItems() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ListUserResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ListUserResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ListUserResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + // no validation rules for Total + + if len(errors) > 0 { + return ListUserResponseMultiError(errors) + } + + return nil +} + +// ListUserResponseMultiError is an error wrapping multiple validation errors +// returned by ListUserResponse.ValidateAll() if the designated constraints +// aren't met. +type ListUserResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ListUserResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ListUserResponseMultiError) AllErrors() []error { return m } + +// ListUserResponseValidationError is the validation error returned by +// ListUserResponse.Validate if the designated constraints aren't met. +type ListUserResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ListUserResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ListUserResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ListUserResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ListUserResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ListUserResponseValidationError) ErrorName() string { return "ListUserResponseValidationError" } + +// Error satisfies the builtin error interface +func (e ListUserResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sListUserResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ListUserResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ListUserResponseValidationError{} + +// Validate checks the field values on GetUserRequest with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *GetUserRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetUserRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in GetUserRequestMultiError, +// or nil if none found. +func (m *GetUserRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *GetUserRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if len(errors) > 0 { + return GetUserRequestMultiError(errors) + } + + return nil +} + +// GetUserRequestMultiError is an error wrapping multiple validation errors +// returned by GetUserRequest.ValidateAll() if the designated constraints +// aren't met. +type GetUserRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetUserRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetUserRequestMultiError) AllErrors() []error { return m } + +// GetUserRequestValidationError is the validation error returned by +// GetUserRequest.Validate if the designated constraints aren't met. +type GetUserRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetUserRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetUserRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetUserRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetUserRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetUserRequestValidationError) ErrorName() string { return "GetUserRequestValidationError" } + +// Error satisfies the builtin error interface +func (e GetUserRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetUserRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetUserRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetUserRequestValidationError{} + +// Validate checks the field values on GetUserByUserNameRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *GetUserByUserNameRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetUserByUserNameRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// GetUserByUserNameRequestMultiError, or nil if none found. +func (m *GetUserByUserNameRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *GetUserByUserNameRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for UserName + + if len(errors) > 0 { + return GetUserByUserNameRequestMultiError(errors) + } + + return nil +} + +// GetUserByUserNameRequestMultiError is an error wrapping multiple validation +// errors returned by GetUserByUserNameRequest.ValidateAll() if the designated +// constraints aren't met. +type GetUserByUserNameRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetUserByUserNameRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetUserByUserNameRequestMultiError) AllErrors() []error { return m } + +// GetUserByUserNameRequestValidationError is the validation error returned by +// GetUserByUserNameRequest.Validate if the designated constraints aren't met. +type GetUserByUserNameRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetUserByUserNameRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetUserByUserNameRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetUserByUserNameRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetUserByUserNameRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetUserByUserNameRequestValidationError) ErrorName() string { + return "GetUserByUserNameRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e GetUserByUserNameRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetUserByUserNameRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetUserByUserNameRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetUserByUserNameRequestValidationError{} + +// Validate checks the field values on CreateUserRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *CreateUserRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on CreateUserRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// CreateUserRequestMultiError, or nil if none found. +func (m *CreateUserRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *CreateUserRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetUser()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CreateUserRequestValidationError{ + field: "User", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CreateUserRequestValidationError{ + field: "User", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetUser()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateUserRequestValidationError{ + field: "User", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for OperatorId + + if len(errors) > 0 { + return CreateUserRequestMultiError(errors) + } + + return nil +} + +// CreateUserRequestMultiError is an error wrapping multiple validation errors +// returned by CreateUserRequest.ValidateAll() if the designated constraints +// aren't met. +type CreateUserRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m CreateUserRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m CreateUserRequestMultiError) AllErrors() []error { return m } + +// CreateUserRequestValidationError is the validation error returned by +// CreateUserRequest.Validate if the designated constraints aren't met. +type CreateUserRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CreateUserRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CreateUserRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CreateUserRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CreateUserRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CreateUserRequestValidationError) ErrorName() string { + return "CreateUserRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e CreateUserRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCreateUserRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CreateUserRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CreateUserRequestValidationError{} + +// Validate checks the field values on UpdateUserRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *UpdateUserRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on UpdateUserRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// UpdateUserRequestMultiError, or nil if none found. +func (m *UpdateUserRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *UpdateUserRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if all { + switch v := interface{}(m.GetUser()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UpdateUserRequestValidationError{ + field: "User", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UpdateUserRequestValidationError{ + field: "User", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetUser()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpdateUserRequestValidationError{ + field: "User", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for OperatorId + + if len(errors) > 0 { + return UpdateUserRequestMultiError(errors) + } + + return nil +} + +// UpdateUserRequestMultiError is an error wrapping multiple validation errors +// returned by UpdateUserRequest.ValidateAll() if the designated constraints +// aren't met. +type UpdateUserRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UpdateUserRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m UpdateUserRequestMultiError) AllErrors() []error { return m } + +// UpdateUserRequestValidationError is the validation error returned by +// UpdateUserRequest.Validate if the designated constraints aren't met. +type UpdateUserRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UpdateUserRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UpdateUserRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UpdateUserRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UpdateUserRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UpdateUserRequestValidationError) ErrorName() string { + return "UpdateUserRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e UpdateUserRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUpdateUserRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UpdateUserRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UpdateUserRequestValidationError{} + +// Validate checks the field values on DeleteUserRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *DeleteUserRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on DeleteUserRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// DeleteUserRequestMultiError, or nil if none found. +func (m *DeleteUserRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *DeleteUserRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + // no validation rules for OperatorId + + if len(errors) > 0 { + return DeleteUserRequestMultiError(errors) + } + + return nil +} + +// DeleteUserRequestMultiError is an error wrapping multiple validation errors +// returned by DeleteUserRequest.ValidateAll() if the designated constraints +// aren't met. +type DeleteUserRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m DeleteUserRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m DeleteUserRequestMultiError) AllErrors() []error { return m } + +// DeleteUserRequestValidationError is the validation error returned by +// DeleteUserRequest.Validate if the designated constraints aren't met. +type DeleteUserRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DeleteUserRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DeleteUserRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DeleteUserRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DeleteUserRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DeleteUserRequestValidationError) ErrorName() string { + return "DeleteUserRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e DeleteUserRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDeleteUserRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DeleteUserRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DeleteUserRequestValidationError{} diff --git a/orm/ent/gen/api/go/user/service/v1/user_error.pb.go b/orm/ent/gen/api/go/user/service/v1/user_error.pb.go new file mode 100644 index 0000000..7fdc404 --- /dev/null +++ b/orm/ent/gen/api/go/user/service/v1/user_error.pb.go @@ -0,0 +1,220 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: user/service/v1/user_error.proto + +package v1 + +import ( + _ "github.com/go-kratos/kratos/v2/errors" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type UserErrorReason int32 + +const ( + UserErrorReason_NOT_LOGGED_IN UserErrorReason = 0 // 401 + UserErrorReason_ACCESS_FORBIDDEN UserErrorReason = 1 // 403 + UserErrorReason_RESOURCE_NOT_FOUND UserErrorReason = 2 // 404 + UserErrorReason_METHOD_NOT_ALLOWED UserErrorReason = 3 // 405 + UserErrorReason_REQUEST_TIMEOUT UserErrorReason = 4 // 408 + UserErrorReason_INTERNAL_SERVER_ERROR UserErrorReason = 5 // 500 + UserErrorReason_NOT_IMPLEMENTED UserErrorReason = 6 // 501 + UserErrorReason_NETWORK_ERROR UserErrorReason = 7 // 502 + UserErrorReason_SERVICE_UNAVAILABLE UserErrorReason = 8 // 503 + UserErrorReason_NETWORK_TIMEOUT UserErrorReason = 9 // 504 + UserErrorReason_REQUEST_NOT_SUPPORT UserErrorReason = 10 // 505 + UserErrorReason_USER_NOT_FOUND UserErrorReason = 11 + UserErrorReason_INCORRECT_PASSWORD UserErrorReason = 12 + UserErrorReason_USER_FREEZE UserErrorReason = 13 + UserErrorReason_INVALID_USERID UserErrorReason = 14 // 用户ID无效 + UserErrorReason_INVALID_PASSWORD UserErrorReason = 15 // 密码无效 + UserErrorReason_TOKEN_EXPIRED UserErrorReason = 16 // token过期 + UserErrorReason_INVALID_TOKEN UserErrorReason = 17 // token无效 + UserErrorReason_TOKEN_NOT_EXIST UserErrorReason = 18 // token不存在 + UserErrorReason_USER_NOT_EXIST UserErrorReason = 19 // 用户不存在 +) + +// Enum value maps for UserErrorReason. +var ( + UserErrorReason_name = map[int32]string{ + 0: "NOT_LOGGED_IN", + 1: "ACCESS_FORBIDDEN", + 2: "RESOURCE_NOT_FOUND", + 3: "METHOD_NOT_ALLOWED", + 4: "REQUEST_TIMEOUT", + 5: "INTERNAL_SERVER_ERROR", + 6: "NOT_IMPLEMENTED", + 7: "NETWORK_ERROR", + 8: "SERVICE_UNAVAILABLE", + 9: "NETWORK_TIMEOUT", + 10: "REQUEST_NOT_SUPPORT", + 11: "USER_NOT_FOUND", + 12: "INCORRECT_PASSWORD", + 13: "USER_FREEZE", + 14: "INVALID_USERID", + 15: "INVALID_PASSWORD", + 16: "TOKEN_EXPIRED", + 17: "INVALID_TOKEN", + 18: "TOKEN_NOT_EXIST", + 19: "USER_NOT_EXIST", + } + UserErrorReason_value = map[string]int32{ + "NOT_LOGGED_IN": 0, + "ACCESS_FORBIDDEN": 1, + "RESOURCE_NOT_FOUND": 2, + "METHOD_NOT_ALLOWED": 3, + "REQUEST_TIMEOUT": 4, + "INTERNAL_SERVER_ERROR": 5, + "NOT_IMPLEMENTED": 6, + "NETWORK_ERROR": 7, + "SERVICE_UNAVAILABLE": 8, + "NETWORK_TIMEOUT": 9, + "REQUEST_NOT_SUPPORT": 10, + "USER_NOT_FOUND": 11, + "INCORRECT_PASSWORD": 12, + "USER_FREEZE": 13, + "INVALID_USERID": 14, + "INVALID_PASSWORD": 15, + "TOKEN_EXPIRED": 16, + "INVALID_TOKEN": 17, + "TOKEN_NOT_EXIST": 18, + "USER_NOT_EXIST": 19, + } +) + +func (x UserErrorReason) Enum() *UserErrorReason { + p := new(UserErrorReason) + *p = x + return p +} + +func (x UserErrorReason) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (UserErrorReason) Descriptor() protoreflect.EnumDescriptor { + return file_user_service_v1_user_error_proto_enumTypes[0].Descriptor() +} + +func (UserErrorReason) Type() protoreflect.EnumType { + return &file_user_service_v1_user_error_proto_enumTypes[0] +} + +func (x UserErrorReason) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use UserErrorReason.Descriptor instead. +func (UserErrorReason) EnumDescriptor() ([]byte, []int) { + return file_user_service_v1_user_error_proto_rawDescGZIP(), []int{0} +} + +var File_user_service_v1_user_error_proto protoreflect.FileDescriptor + +var file_user_service_v1_user_error_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, + 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x0f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x76, 0x31, 0x1a, 0x13, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2f, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2a, 0xb7, 0x04, 0x0a, 0x0f, 0x55, 0x73, 0x65, + 0x72, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x0d, + 0x4e, 0x4f, 0x54, 0x5f, 0x4c, 0x4f, 0x47, 0x47, 0x45, 0x44, 0x5f, 0x49, 0x4e, 0x10, 0x00, 0x1a, + 0x04, 0xa8, 0x45, 0x91, 0x03, 0x12, 0x1a, 0x0a, 0x10, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, + 0x46, 0x4f, 0x52, 0x42, 0x49, 0x44, 0x44, 0x45, 0x4e, 0x10, 0x01, 0x1a, 0x04, 0xa8, 0x45, 0x93, + 0x03, 0x12, 0x1c, 0x0a, 0x12, 0x52, 0x45, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x4e, 0x4f, + 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x02, 0x1a, 0x04, 0xa8, 0x45, 0x94, 0x03, 0x12, + 0x1c, 0x0a, 0x12, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x41, 0x4c, + 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x10, 0x03, 0x1a, 0x04, 0xa8, 0x45, 0x95, 0x03, 0x12, 0x19, 0x0a, + 0x0f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x54, 0x49, 0x4d, 0x45, 0x4f, 0x55, 0x54, + 0x10, 0x04, 0x1a, 0x04, 0xa8, 0x45, 0x98, 0x03, 0x12, 0x1f, 0x0a, 0x15, 0x49, 0x4e, 0x54, 0x45, + 0x52, 0x4e, 0x41, 0x4c, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x5f, 0x45, 0x52, 0x52, 0x4f, + 0x52, 0x10, 0x05, 0x1a, 0x04, 0xa8, 0x45, 0xf4, 0x03, 0x12, 0x19, 0x0a, 0x0f, 0x4e, 0x4f, 0x54, + 0x5f, 0x49, 0x4d, 0x50, 0x4c, 0x45, 0x4d, 0x45, 0x4e, 0x54, 0x45, 0x44, 0x10, 0x06, 0x1a, 0x04, + 0xa8, 0x45, 0xf5, 0x03, 0x12, 0x17, 0x0a, 0x0d, 0x4e, 0x45, 0x54, 0x57, 0x4f, 0x52, 0x4b, 0x5f, + 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x07, 0x1a, 0x04, 0xa8, 0x45, 0xf6, 0x03, 0x12, 0x1d, 0x0a, + 0x13, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x41, 0x56, 0x41, 0x49, 0x4c, + 0x41, 0x42, 0x4c, 0x45, 0x10, 0x08, 0x1a, 0x04, 0xa8, 0x45, 0xf7, 0x03, 0x12, 0x19, 0x0a, 0x0f, + 0x4e, 0x45, 0x54, 0x57, 0x4f, 0x52, 0x4b, 0x5f, 0x54, 0x49, 0x4d, 0x45, 0x4f, 0x55, 0x54, 0x10, + 0x09, 0x1a, 0x04, 0xa8, 0x45, 0xf8, 0x03, 0x12, 0x1d, 0x0a, 0x13, 0x52, 0x45, 0x51, 0x55, 0x45, + 0x53, 0x54, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x53, 0x55, 0x50, 0x50, 0x4f, 0x52, 0x54, 0x10, 0x0a, + 0x1a, 0x04, 0xa8, 0x45, 0xf9, 0x03, 0x12, 0x18, 0x0a, 0x0e, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x4e, + 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x0b, 0x1a, 0x04, 0xa8, 0x45, 0xd8, 0x04, + 0x12, 0x1c, 0x0a, 0x12, 0x49, 0x4e, 0x43, 0x4f, 0x52, 0x52, 0x45, 0x43, 0x54, 0x5f, 0x50, 0x41, + 0x53, 0x53, 0x57, 0x4f, 0x52, 0x44, 0x10, 0x0c, 0x1a, 0x04, 0xa8, 0x45, 0xd7, 0x04, 0x12, 0x15, + 0x0a, 0x0b, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x46, 0x52, 0x45, 0x45, 0x5a, 0x45, 0x10, 0x0d, 0x1a, + 0x04, 0xa8, 0x45, 0xd6, 0x04, 0x12, 0x17, 0x0a, 0x0e, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, + 0x5f, 0x55, 0x53, 0x45, 0x52, 0x49, 0x44, 0x10, 0x0e, 0x1a, 0x03, 0xa8, 0x45, 0x65, 0x12, 0x19, + 0x0a, 0x10, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x50, 0x41, 0x53, 0x53, 0x57, 0x4f, + 0x52, 0x44, 0x10, 0x0f, 0x1a, 0x03, 0xa8, 0x45, 0x66, 0x12, 0x16, 0x0a, 0x0d, 0x54, 0x4f, 0x4b, + 0x45, 0x4e, 0x5f, 0x45, 0x58, 0x50, 0x49, 0x52, 0x45, 0x44, 0x10, 0x10, 0x1a, 0x03, 0xa8, 0x45, + 0x67, 0x12, 0x16, 0x0a, 0x0d, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x54, 0x4f, 0x4b, + 0x45, 0x4e, 0x10, 0x11, 0x1a, 0x03, 0xa8, 0x45, 0x68, 0x12, 0x18, 0x0a, 0x0f, 0x54, 0x4f, 0x4b, + 0x45, 0x4e, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x58, 0x49, 0x53, 0x54, 0x10, 0x12, 0x1a, 0x03, + 0xa8, 0x45, 0x69, 0x12, 0x17, 0x0a, 0x0e, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, + 0x45, 0x58, 0x49, 0x53, 0x54, 0x10, 0x13, 0x1a, 0x03, 0xa8, 0x45, 0x6a, 0x1a, 0x04, 0xa0, 0x45, + 0xf4, 0x03, 0x42, 0x32, 0x5a, 0x30, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x65, 0x6e, 0x74, + 0x2d, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x67, 0x6f, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_user_service_v1_user_error_proto_rawDescOnce sync.Once + file_user_service_v1_user_error_proto_rawDescData = file_user_service_v1_user_error_proto_rawDesc +) + +func file_user_service_v1_user_error_proto_rawDescGZIP() []byte { + file_user_service_v1_user_error_proto_rawDescOnce.Do(func() { + file_user_service_v1_user_error_proto_rawDescData = protoimpl.X.CompressGZIP(file_user_service_v1_user_error_proto_rawDescData) + }) + return file_user_service_v1_user_error_proto_rawDescData +} + +var file_user_service_v1_user_error_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_user_service_v1_user_error_proto_goTypes = []interface{}{ + (UserErrorReason)(0), // 0: user.service.v1.UserErrorReason +} +var file_user_service_v1_user_error_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_user_service_v1_user_error_proto_init() } +func file_user_service_v1_user_error_proto_init() { + if File_user_service_v1_user_error_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_user_service_v1_user_error_proto_rawDesc, + NumEnums: 1, + NumMessages: 0, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_user_service_v1_user_error_proto_goTypes, + DependencyIndexes: file_user_service_v1_user_error_proto_depIdxs, + EnumInfos: file_user_service_v1_user_error_proto_enumTypes, + }.Build() + File_user_service_v1_user_error_proto = out.File + file_user_service_v1_user_error_proto_rawDesc = nil + file_user_service_v1_user_error_proto_goTypes = nil + file_user_service_v1_user_error_proto_depIdxs = nil +} diff --git a/orm/ent/gen/api/go/user/service/v1/user_error.pb.validate.go b/orm/ent/gen/api/go/user/service/v1/user_error.pb.validate.go new file mode 100644 index 0000000..644a37c --- /dev/null +++ b/orm/ent/gen/api/go/user/service/v1/user_error.pb.validate.go @@ -0,0 +1,36 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: user/service/v1/user_error.proto + +package v1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) diff --git a/orm/ent/gen/api/go/user/service/v1/user_error_errors.pb.go b/orm/ent/gen/api/go/user/service/v1/user_error_errors.pb.go new file mode 100644 index 0000000..b8245a6 --- /dev/null +++ b/orm/ent/gen/api/go/user/service/v1/user_error_errors.pb.go @@ -0,0 +1,286 @@ +// Code generated by protoc-gen-go-errors. DO NOT EDIT. + +package v1 + +import ( + fmt "fmt" + errors "github.com/go-kratos/kratos/v2/errors" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the kratos package it is being compiled against. +const _ = errors.SupportPackageIsVersion1 + +// 401 +func IsNotLoggedIn(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_NOT_LOGGED_IN.String() && e.Code == 401 +} + +// 401 +func ErrorNotLoggedIn(format string, args ...interface{}) *errors.Error { + return errors.New(401, UserErrorReason_NOT_LOGGED_IN.String(), fmt.Sprintf(format, args...)) +} + +// 403 +func IsAccessForbidden(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_ACCESS_FORBIDDEN.String() && e.Code == 403 +} + +// 403 +func ErrorAccessForbidden(format string, args ...interface{}) *errors.Error { + return errors.New(403, UserErrorReason_ACCESS_FORBIDDEN.String(), fmt.Sprintf(format, args...)) +} + +// 404 +func IsResourceNotFound(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_RESOURCE_NOT_FOUND.String() && e.Code == 404 +} + +// 404 +func ErrorResourceNotFound(format string, args ...interface{}) *errors.Error { + return errors.New(404, UserErrorReason_RESOURCE_NOT_FOUND.String(), fmt.Sprintf(format, args...)) +} + +// 405 +func IsMethodNotAllowed(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_METHOD_NOT_ALLOWED.String() && e.Code == 405 +} + +// 405 +func ErrorMethodNotAllowed(format string, args ...interface{}) *errors.Error { + return errors.New(405, UserErrorReason_METHOD_NOT_ALLOWED.String(), fmt.Sprintf(format, args...)) +} + +// 408 +func IsRequestTimeout(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_REQUEST_TIMEOUT.String() && e.Code == 408 +} + +// 408 +func ErrorRequestTimeout(format string, args ...interface{}) *errors.Error { + return errors.New(408, UserErrorReason_REQUEST_TIMEOUT.String(), fmt.Sprintf(format, args...)) +} + +// 500 +func IsInternalServerError(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_INTERNAL_SERVER_ERROR.String() && e.Code == 500 +} + +// 500 +func ErrorInternalServerError(format string, args ...interface{}) *errors.Error { + return errors.New(500, UserErrorReason_INTERNAL_SERVER_ERROR.String(), fmt.Sprintf(format, args...)) +} + +// 501 +func IsNotImplemented(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_NOT_IMPLEMENTED.String() && e.Code == 501 +} + +// 501 +func ErrorNotImplemented(format string, args ...interface{}) *errors.Error { + return errors.New(501, UserErrorReason_NOT_IMPLEMENTED.String(), fmt.Sprintf(format, args...)) +} + +// 502 +func IsNetworkError(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_NETWORK_ERROR.String() && e.Code == 502 +} + +// 502 +func ErrorNetworkError(format string, args ...interface{}) *errors.Error { + return errors.New(502, UserErrorReason_NETWORK_ERROR.String(), fmt.Sprintf(format, args...)) +} + +// 503 +func IsServiceUnavailable(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_SERVICE_UNAVAILABLE.String() && e.Code == 503 +} + +// 503 +func ErrorServiceUnavailable(format string, args ...interface{}) *errors.Error { + return errors.New(503, UserErrorReason_SERVICE_UNAVAILABLE.String(), fmt.Sprintf(format, args...)) +} + +// 504 +func IsNetworkTimeout(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_NETWORK_TIMEOUT.String() && e.Code == 504 +} + +// 504 +func ErrorNetworkTimeout(format string, args ...interface{}) *errors.Error { + return errors.New(504, UserErrorReason_NETWORK_TIMEOUT.String(), fmt.Sprintf(format, args...)) +} + +// 505 +func IsRequestNotSupport(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_REQUEST_NOT_SUPPORT.String() && e.Code == 505 +} + +// 505 +func ErrorRequestNotSupport(format string, args ...interface{}) *errors.Error { + return errors.New(505, UserErrorReason_REQUEST_NOT_SUPPORT.String(), fmt.Sprintf(format, args...)) +} + +func IsUserNotFound(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_USER_NOT_FOUND.String() && e.Code == 600 +} + +func ErrorUserNotFound(format string, args ...interface{}) *errors.Error { + return errors.New(600, UserErrorReason_USER_NOT_FOUND.String(), fmt.Sprintf(format, args...)) +} + +func IsIncorrectPassword(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_INCORRECT_PASSWORD.String() && e.Code == 599 +} + +func ErrorIncorrectPassword(format string, args ...interface{}) *errors.Error { + return errors.New(599, UserErrorReason_INCORRECT_PASSWORD.String(), fmt.Sprintf(format, args...)) +} + +func IsUserFreeze(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_USER_FREEZE.String() && e.Code == 598 +} + +func ErrorUserFreeze(format string, args ...interface{}) *errors.Error { + return errors.New(598, UserErrorReason_USER_FREEZE.String(), fmt.Sprintf(format, args...)) +} + +// 用户ID无效 +func IsInvalidUserid(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_INVALID_USERID.String() && e.Code == 101 +} + +// 用户ID无效 +func ErrorInvalidUserid(format string, args ...interface{}) *errors.Error { + return errors.New(101, UserErrorReason_INVALID_USERID.String(), fmt.Sprintf(format, args...)) +} + +// 密码无效 +func IsInvalidPassword(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_INVALID_PASSWORD.String() && e.Code == 102 +} + +// 密码无效 +func ErrorInvalidPassword(format string, args ...interface{}) *errors.Error { + return errors.New(102, UserErrorReason_INVALID_PASSWORD.String(), fmt.Sprintf(format, args...)) +} + +// token过期 +func IsTokenExpired(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_TOKEN_EXPIRED.String() && e.Code == 103 +} + +// token过期 +func ErrorTokenExpired(format string, args ...interface{}) *errors.Error { + return errors.New(103, UserErrorReason_TOKEN_EXPIRED.String(), fmt.Sprintf(format, args...)) +} + +// token无效 +func IsInvalidToken(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_INVALID_TOKEN.String() && e.Code == 104 +} + +// token无效 +func ErrorInvalidToken(format string, args ...interface{}) *errors.Error { + return errors.New(104, UserErrorReason_INVALID_TOKEN.String(), fmt.Sprintf(format, args...)) +} + +// token不存在 +func IsTokenNotExist(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_TOKEN_NOT_EXIST.String() && e.Code == 105 +} + +// token不存在 +func ErrorTokenNotExist(format string, args ...interface{}) *errors.Error { + return errors.New(105, UserErrorReason_TOKEN_NOT_EXIST.String(), fmt.Sprintf(format, args...)) +} + +// 用户不存在 +func IsUserNotExist(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_USER_NOT_EXIST.String() && e.Code == 106 +} + +// 用户不存在 +func ErrorUserNotExist(format string, args ...interface{}) *errors.Error { + return errors.New(106, UserErrorReason_USER_NOT_EXIST.String(), fmt.Sprintf(format, args...)) +} diff --git a/orm/ent/gen/api/go/user/service/v1/user_grpc.pb.go b/orm/ent/gen/api/go/user/service/v1/user_grpc.pb.go new file mode 100644 index 0000000..100c9f4 --- /dev/null +++ b/orm/ent/gen/api/go/user/service/v1/user_grpc.pb.go @@ -0,0 +1,269 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: user/service/v1/user.proto + +package v1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" + pagination "kratos-ent-example/gen/api/go/common/pagination" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + UserService_ListUser_FullMethodName = "/user.service.v1.UserService/ListUser" + UserService_GetUser_FullMethodName = "/user.service.v1.UserService/GetUser" + UserService_CreateUser_FullMethodName = "/user.service.v1.UserService/CreateUser" + UserService_UpdateUser_FullMethodName = "/user.service.v1.UserService/UpdateUser" + UserService_DeleteUser_FullMethodName = "/user.service.v1.UserService/DeleteUser" +) + +// UserServiceClient is the client API for UserService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type UserServiceClient interface { + // 查询用户列表 + ListUser(ctx context.Context, in *pagination.PagingRequest, opts ...grpc.CallOption) (*ListUserResponse, error) + // 查询用户详情 + GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*User, error) + // 创建用户 + CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*User, error) + // 更新用户 + UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*User, error) + // 删除用户 + DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type userServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient { + return &userServiceClient{cc} +} + +func (c *userServiceClient) ListUser(ctx context.Context, in *pagination.PagingRequest, opts ...grpc.CallOption) (*ListUserResponse, error) { + out := new(ListUserResponse) + err := c.cc.Invoke(ctx, UserService_ListUser_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*User, error) { + out := new(User) + err := c.cc.Invoke(ctx, UserService_GetUser_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*User, error) { + out := new(User) + err := c.cc.Invoke(ctx, UserService_CreateUser_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*User, error) { + out := new(User) + err := c.cc.Invoke(ctx, UserService_UpdateUser_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, UserService_DeleteUser_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// UserServiceServer is the server API for UserService service. +// All implementations must embed UnimplementedUserServiceServer +// for forward compatibility +type UserServiceServer interface { + // 查询用户列表 + ListUser(context.Context, *pagination.PagingRequest) (*ListUserResponse, error) + // 查询用户详情 + GetUser(context.Context, *GetUserRequest) (*User, error) + // 创建用户 + CreateUser(context.Context, *CreateUserRequest) (*User, error) + // 更新用户 + UpdateUser(context.Context, *UpdateUserRequest) (*User, error) + // 删除用户 + DeleteUser(context.Context, *DeleteUserRequest) (*emptypb.Empty, error) + mustEmbedUnimplementedUserServiceServer() +} + +// UnimplementedUserServiceServer must be embedded to have forward compatible implementations. +type UnimplementedUserServiceServer struct { +} + +func (UnimplementedUserServiceServer) ListUser(context.Context, *pagination.PagingRequest) (*ListUserResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListUser not implemented") +} +func (UnimplementedUserServiceServer) GetUser(context.Context, *GetUserRequest) (*User, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented") +} +func (UnimplementedUserServiceServer) CreateUser(context.Context, *CreateUserRequest) (*User, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateUser not implemented") +} +func (UnimplementedUserServiceServer) UpdateUser(context.Context, *UpdateUserRequest) (*User, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateUser not implemented") +} +func (UnimplementedUserServiceServer) DeleteUser(context.Context, *DeleteUserRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteUser not implemented") +} +func (UnimplementedUserServiceServer) mustEmbedUnimplementedUserServiceServer() {} + +// UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to UserServiceServer will +// result in compilation errors. +type UnsafeUserServiceServer interface { + mustEmbedUnimplementedUserServiceServer() +} + +func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer) { + s.RegisterService(&UserService_ServiceDesc, srv) +} + +func _UserService_ListUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(pagination.PagingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).ListUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_ListUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).ListUser(ctx, req.(*pagination.PagingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).GetUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_GetUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).GetUser(ctx, req.(*GetUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).CreateUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_CreateUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).CreateUser(ctx, req.(*CreateUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_UpdateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).UpdateUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_UpdateUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).UpdateUser(ctx, req.(*UpdateUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_DeleteUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).DeleteUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_DeleteUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).DeleteUser(ctx, req.(*DeleteUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// UserService_ServiceDesc is the grpc.ServiceDesc for UserService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var UserService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "user.service.v1.UserService", + HandlerType: (*UserServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListUser", + Handler: _UserService_ListUser_Handler, + }, + { + MethodName: "GetUser", + Handler: _UserService_GetUser_Handler, + }, + { + MethodName: "CreateUser", + Handler: _UserService_CreateUser_Handler, + }, + { + MethodName: "UpdateUser", + Handler: _UserService_UpdateUser_Handler, + }, + { + MethodName: "DeleteUser", + Handler: _UserService_DeleteUser_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "user/service/v1/user.proto", +} diff --git a/orm/ent/go.mod b/orm/ent/go.mod new file mode 100644 index 0000000..a11e520 --- /dev/null +++ b/orm/ent/go.mod @@ -0,0 +1,199 @@ +module kratos-ent-example + +go 1.20 + +require ( + entgo.io/ent v0.12.4 + github.com/go-chassis/sc-client v0.7.0 + github.com/go-kratos/aegis v0.2.0 + github.com/go-kratos/kratos/contrib/config/apollo/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/config/consul/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/config/etcd/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/config/kubernetes/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/config/nacos/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/log/aliyun/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/log/fluent/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/log/logrus/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/log/tencent/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/log/zap/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/registry/etcd/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/registry/eureka/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/registry/kubernetes/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/registry/nacos/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/registry/servicecomb/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/registry/zookeeper/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/v2 v2.7.1 + github.com/go-redis/redis/extra/redisotel/v8 v8.11.5 + github.com/go-redis/redis/v8 v8.11.5 + github.com/go-sql-driver/mysql v1.7.1 + github.com/go-zookeeper/zk v1.0.3 + github.com/google/gnostic v0.6.9 + github.com/google/subcommands v1.2.0 + github.com/google/wire v0.5.0 + github.com/gorilla/handlers v1.5.1 + github.com/hashicorp/consul/api v1.20.0 + github.com/jackc/pgx/v4 v4.18.1 + github.com/lib/pq v1.10.9 + github.com/minio/minio-go/v7 v7.0.53 + github.com/nacos-group/nacos-sdk-go v1.1.4 + github.com/olekukonko/tablewriter v0.0.5 + github.com/sirupsen/logrus v1.9.2 + github.com/spf13/cobra v1.7.0 + github.com/stretchr/testify v1.8.4 + github.com/tx7do/kratos-utils v0.0.0-20231025061804-798ccd50d6fb + go.etcd.io/etcd/client/v3 v3.5.9 + go.opentelemetry.io/otel v1.16.0 + go.opentelemetry.io/otel/exporters/jaeger v1.16.0 + go.opentelemetry.io/otel/exporters/zipkin v1.16.0 + go.opentelemetry.io/otel/sdk v1.16.0 + go.uber.org/zap v1.24.0 + golang.org/x/tools v0.14.0 + google.golang.org/grpc v1.57.0 + google.golang.org/protobuf v1.31.0 + gopkg.in/natefinch/lumberjack.v2 v2.2.1 + k8s.io/client-go v0.27.2 +) + +require ( + ariga.io/atlas v0.15.0 // indirect + entgo.io/contrib v0.4.5 // indirect + github.com/agext/levenshtein v1.2.3 // indirect + github.com/aliyun/alibaba-cloud-sdk-go v1.61.18 // indirect + github.com/aliyun/aliyun-log-go-sdk v0.1.44 // indirect + github.com/apolloconfig/agollo/v4 v4.3.0 // indirect + github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect + github.com/armon/go-metrics v0.3.10 // indirect + github.com/bufbuild/protocompile v0.6.0 // indirect + github.com/buger/jsonparser v1.1.1 // indirect + github.com/cenkalti/backoff v2.2.1+incompatible // indirect + github.com/cenkalti/backoff/v4 v4.1.1 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/coreos/go-semver v0.3.0 // indirect + github.com/coreos/go-systemd/v22 v22.3.2 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/deckarep/golang-set v1.7.1 // indirect + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect + github.com/dustin/go-humanize v1.0.1 // indirect + github.com/emicklei/go-restful/v3 v3.9.0 // indirect + github.com/fatih/color v1.13.0 // indirect + github.com/felixge/httpsnoop v1.0.1 // indirect + github.com/fluent/fluent-logger-golang v1.9.0 // indirect + github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/go-chassis/cari v0.6.0 // indirect + github.com/go-chassis/foundation v0.4.0 // indirect + github.com/go-chassis/openlog v1.1.3 // indirect + github.com/go-errors/errors v1.0.1 // indirect + github.com/go-kit/kit v0.10.0 // indirect + github.com/go-logfmt/logfmt v0.5.1 // indirect + github.com/go-logr/logr v1.2.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-ole/go-ole v1.2.6 // indirect + github.com/go-openapi/inflect v0.19.0 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.1 // indirect + github.com/go-openapi/swag v0.22.3 // indirect + github.com/go-playground/form/v4 v4.2.1 // indirect + github.com/go-redis/redis/extra/rediscmd/v8 v8.11.5 // indirect + github.com/gofrs/uuid v4.2.0+incompatible // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/google/go-cmp v0.6.0 // indirect + github.com/google/gofuzz v1.1.0 // indirect + github.com/google/uuid v1.3.1 // indirect + github.com/gorilla/mux v1.8.0 // indirect + github.com/gorilla/websocket v1.5.0 // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect + github.com/hashicorp/go-hclog v1.2.0 // indirect + github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-rootcerts v1.0.2 // indirect + github.com/hashicorp/golang-lru v0.5.4 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/hcl/v2 v2.19.1 // indirect + github.com/hashicorp/serf v0.10.1 // indirect + github.com/imdario/mergo v0.3.16 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/jackc/chunkreader/v2 v2.0.1 // indirect + github.com/jackc/pgconn v1.14.0 // indirect + github.com/jackc/pgio v1.0.0 // indirect + github.com/jackc/pgpassfile v1.0.0 // indirect + github.com/jackc/pgproto3/v2 v2.3.2 // indirect + github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect + github.com/jackc/pgtype v1.14.0 // indirect + github.com/jhump/protoreflect v1.15.3 // indirect + github.com/jmespath/go-jmespath v0.4.0 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/karlseguin/ccache/v2 v2.0.8 // indirect + github.com/klauspost/compress v1.16.5 // indirect + github.com/klauspost/cpuid/v2 v2.2.4 // indirect + github.com/lufia/plan9stats v0.0.0-20230326075908-cb1d2100619a // indirect + github.com/magiconair/properties v1.8.6 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.17 // indirect + github.com/mattn/go-runewidth v0.0.9 // indirect + github.com/minio/md5-simd v1.1.2 // indirect + github.com/minio/sha256-simd v1.0.0 // indirect + github.com/mitchellh/go-homedir v1.1.0 // indirect + github.com/mitchellh/go-wordwrap v1.0.1 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/openzipkin/zipkin-go v0.4.1 // indirect + github.com/patrickmn/go-cache v2.1.0+incompatible // indirect + github.com/pelletier/go-toml v1.9.4 // indirect + github.com/pelletier/go-toml/v2 v2.0.0-beta.8 // indirect + github.com/philhofer/fwd v1.1.1 // indirect + github.com/pierrec/lz4 v2.6.1+incompatible // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b // indirect + github.com/rs/xid v1.4.0 // indirect + github.com/shirou/gopsutil/v3 v3.23.6 // indirect + github.com/spf13/afero v1.9.2 // indirect + github.com/spf13/cast v1.4.1 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/spf13/viper v1.11.0 // indirect + github.com/subosito/gotenv v1.2.0 // indirect + github.com/tencentcloud/tencentcloud-cls-sdk-go v1.0.2 // indirect + github.com/tinylib/msgp v1.1.6 // indirect + github.com/tklauser/go-sysconf v0.3.11 // indirect + github.com/tklauser/numcpus v0.6.1 // indirect + github.com/tx7do/kratos-utils/entgo v0.0.0-20231025063335-8807fc25ca22 // indirect + github.com/yusufpapurcu/wmi v1.2.3 // indirect + github.com/zclconf/go-cty v1.14.1 // indirect + go.etcd.io/etcd/api/v3 v3.5.9 // indirect + go.etcd.io/etcd/client/pkg/v3 v3.5.9 // indirect + go.opentelemetry.io/otel/metric v1.16.0 // indirect + go.opentelemetry.io/otel/trace v1.16.0 // indirect + go.uber.org/atomic v1.11.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/crypto v0.14.0 // indirect + golang.org/x/mod v0.13.0 // indirect + golang.org/x/net v0.16.0 // indirect + golang.org/x/oauth2 v0.7.0 // indirect + golang.org/x/sync v0.4.0 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/term v0.13.0 // indirect + golang.org/x/text v0.13.0 // indirect + golang.org/x/time v0.1.0 // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/genproto v0.0.0-20230629202037-9506855d4529 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230629202037-9506855d4529 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + k8s.io/api v0.27.2 // indirect + k8s.io/apimachinery v0.27.2 // indirect + k8s.io/klog/v2 v2.90.1 // indirect + k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect + k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect + sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect + sigs.k8s.io/yaml v1.3.0 // indirect +) diff --git a/orm/ent/go.sum b/orm/ent/go.sum new file mode 100644 index 0000000..f2109e6 --- /dev/null +++ b/orm/ent/go.sum @@ -0,0 +1,2449 @@ +ariga.io/atlas v0.11.0 h1:aGR7MzsUfmdlDYCpRErQeY2NSuRlPE0/q6drNE/5buM= +ariga.io/atlas v0.11.0/go.mod h1:+TR129FJZ5Lvzms6dvCeGWh1yR6hMvmXBhug4hrNIGk= +ariga.io/atlas v0.14.1/go.mod h1:isZrlzJ5cpoCoKFoY9knZug7Lq4pP1cm8g3XciLZ0Pw= +ariga.io/atlas v0.15.0/go.mod h1:isZrlzJ5cpoCoKFoY9knZug7Lq4pP1cm8g3XciLZ0Pw= +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= +cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= +cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= +cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= +cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= +cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= +cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= +cloud.google.com/go v0.100.1/go.mod h1:fs4QogzfH5n2pBXBP9vRiU+eCny7lD2vmFZy79Iuw1U= +cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= +cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= +cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= +cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= +cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= +cloud.google.com/go v0.107.0/go.mod h1:wpc2eNrD7hXUTy8EKS10jkxpZBjASrORK7goS+3YX2I= +cloud.google.com/go/accessapproval v1.4.0/go.mod h1:zybIuC3KpDOvotz59lFe5qxRZx6C75OtwbisN56xYB4= +cloud.google.com/go/accessapproval v1.5.0/go.mod h1:HFy3tuiGvMdcd/u+Cu5b9NkO1pEICJ46IR82PoUdplw= +cloud.google.com/go/accesscontextmanager v1.3.0/go.mod h1:TgCBehyr5gNMz7ZaH9xubp+CE8dkrszb4oK9CWyvD4o= +cloud.google.com/go/accesscontextmanager v1.4.0/go.mod h1:/Kjh7BBu/Gh83sv+K60vN9QE5NJcd80sU33vIe2IFPE= +cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= +cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= +cloud.google.com/go/aiplatform v1.27.0/go.mod h1:Bvxqtl40l0WImSb04d0hXFU7gDOiq9jQmorivIiWcKg= +cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= +cloud.google.com/go/analytics v0.12.0/go.mod h1:gkfj9h6XRf9+TS4bmuhPEShsh3hH8PAZzm/41OOhQd4= +cloud.google.com/go/apigateway v1.3.0/go.mod h1:89Z8Bhpmxu6AmUxuVRg/ECRGReEdiP3vQtk4Z1J9rJk= +cloud.google.com/go/apigateway v1.4.0/go.mod h1:pHVY9MKGaH9PQ3pJ4YLzoj6U5FUDeDFBllIz7WmzJoc= +cloud.google.com/go/apigeeconnect v1.3.0/go.mod h1:G/AwXFAKo0gIXkPTVfZDd2qA1TxBXJ3MgMRBQkIi9jc= +cloud.google.com/go/apigeeconnect v1.4.0/go.mod h1:kV4NwOKqjvt2JYR0AoIWo2QGfoRtn/pkS3QlHp0Ni04= +cloud.google.com/go/appengine v1.4.0/go.mod h1:CS2NhuBuDXM9f+qscZ6V86m1MIIqPj3WC/UoEuR1Sno= +cloud.google.com/go/appengine v1.5.0/go.mod h1:TfasSozdkFI0zeoxW3PTBLiNqRmzraodCWatWI9Dmak= +cloud.google.com/go/area120 v0.5.0/go.mod h1:DE/n4mp+iqVyvxHN41Vf1CR602GiHQjFPusMFW6bGR4= +cloud.google.com/go/area120 v0.6.0/go.mod h1:39yFJqWVgm0UZqWTOdqkLhjoC7uFfgXRC8g/ZegeAh0= +cloud.google.com/go/artifactregistry v1.6.0/go.mod h1:IYt0oBPSAGYj/kprzsBjZ/4LnG/zOcHyFHjWPCi6SAQ= +cloud.google.com/go/artifactregistry v1.7.0/go.mod h1:mqTOFOnGZx8EtSqK/ZWcsm/4U8B77rbcLP6ruDU2Ixk= +cloud.google.com/go/artifactregistry v1.8.0/go.mod h1:w3GQXkJX8hiKN0v+at4b0qotwijQbYUqF2GWkZzAhC0= +cloud.google.com/go/artifactregistry v1.9.0/go.mod h1:2K2RqvA2CYvAeARHRkLDhMDJ3OXy26h3XW+3/Jh2uYc= +cloud.google.com/go/asset v1.5.0/go.mod h1:5mfs8UvcM5wHhqtSv8J1CtxxaQq3AdBxxQi2jGW/K4o= +cloud.google.com/go/asset v1.7.0/go.mod h1:YbENsRK4+xTiL+Ofoj5Ckf+O17kJtgp3Y3nn4uzZz5s= +cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjbytpUaW0= +cloud.google.com/go/asset v1.9.0/go.mod h1:83MOE6jEJBMqFKadM9NLRcs80Gdw76qGuHn8m3h8oHQ= +cloud.google.com/go/asset v1.10.0/go.mod h1:pLz7uokL80qKhzKr4xXGvBQXnzHn5evJAEAtZiIb0wY= +cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= +cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= +cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= +cloud.google.com/go/assuredworkloads v1.8.0/go.mod h1:AsX2cqyNCOvEQC8RMPnoc0yEarXQk6WEKkxYfL6kGIo= +cloud.google.com/go/assuredworkloads v1.9.0/go.mod h1:kFuI1P78bplYtT77Tb1hi0FMxM0vVpRC7VVoJC3ZoT0= +cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= +cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= +cloud.google.com/go/automl v1.7.0/go.mod h1:RL9MYCCsJEOmt0Wf3z9uzG0a7adTT1fe+aObgSpkCt8= +cloud.google.com/go/automl v1.8.0/go.mod h1:xWx7G/aPEe/NP+qzYXktoBSDfjO+vnKMGgsApGJJquM= +cloud.google.com/go/baremetalsolution v0.3.0/go.mod h1:XOrocE+pvK1xFfleEnShBlNAXf+j5blPPxrhjKgnIFc= +cloud.google.com/go/baremetalsolution v0.4.0/go.mod h1:BymplhAadOO/eBa7KewQ0Ppg4A4Wplbn+PsFKRLo0uI= +cloud.google.com/go/batch v0.3.0/go.mod h1:TR18ZoAekj1GuirsUsR1ZTKN3FC/4UDnScjT8NXImFE= +cloud.google.com/go/batch v0.4.0/go.mod h1:WZkHnP43R/QCGQsZ+0JyG4i79ranE2u8xvjq/9+STPE= +cloud.google.com/go/beyondcorp v0.2.0/go.mod h1:TB7Bd+EEtcw9PCPQhCJtJGjk/7TC6ckmnSFS+xwTfm4= +cloud.google.com/go/beyondcorp v0.3.0/go.mod h1:E5U5lcrcXMsCuoDNyGrpyTm/hn7ne941Jz2vmksAxW8= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA= +cloud.google.com/go/bigquery v1.43.0/go.mod h1:ZMQcXHsl+xmU1z36G2jNGZmKp9zNY5BUua5wDgmNCfw= +cloud.google.com/go/bigquery v1.44.0/go.mod h1:0Y33VqXTEsbamHJvJHdFmtqHvMIY28aK1+dFsvaChGc= +cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY= +cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s= +cloud.google.com/go/billing v1.6.0/go.mod h1:WoXzguj+BeHXPbKfNWkqVtDdzORazmCjraY+vrxcyvI= +cloud.google.com/go/billing v1.7.0/go.mod h1:q457N3Hbj9lYwwRbnlD7vUpyjq6u5U1RAOArInEiD5Y= +cloud.google.com/go/binaryauthorization v1.1.0/go.mod h1:xwnoWu3Y84jbuHa0zd526MJYmtnVXn0syOjaJgy4+dM= +cloud.google.com/go/binaryauthorization v1.2.0/go.mod h1:86WKkJHtRcv5ViNABtYMhhNWRrD1Vpi//uKEy7aYEfI= +cloud.google.com/go/binaryauthorization v1.3.0/go.mod h1:lRZbKgjDIIQvzYQS1p99A7/U1JqvqeZg0wiI5tp6tg0= +cloud.google.com/go/binaryauthorization v1.4.0/go.mod h1:tsSPQrBd77VLplV70GUhBf/Zm3FsKmgSqgm4UmiDItk= +cloud.google.com/go/certificatemanager v1.3.0/go.mod h1:n6twGDvcUBFu9uBgt4eYvvf3sQ6My8jADcOVwHmzadg= +cloud.google.com/go/certificatemanager v1.4.0/go.mod h1:vowpercVFyqs8ABSmrdV+GiFf2H/ch3KyudYQEMM590= +cloud.google.com/go/channel v1.8.0/go.mod h1:W5SwCXDJsq/rg3tn3oG0LOxpAo6IMxNa09ngphpSlnk= +cloud.google.com/go/channel v1.9.0/go.mod h1:jcu05W0my9Vx4mt3/rEHpfxc9eKi9XwsdDL8yBMbKUk= +cloud.google.com/go/cloudbuild v1.3.0/go.mod h1:WequR4ULxlqvMsjDEEEFnOG5ZSRSgWOywXYDb1vPE6U= +cloud.google.com/go/cloudbuild v1.4.0/go.mod h1:5Qwa40LHiOXmz3386FrjrYM93rM/hdRr7b53sySrTqA= +cloud.google.com/go/clouddms v1.3.0/go.mod h1:oK6XsCDdW4Ib3jCCBugx+gVjevp2TMXFtgxvPSee3OM= +cloud.google.com/go/clouddms v1.4.0/go.mod h1:Eh7sUGCC+aKry14O1NRljhjyrr0NFC0G2cjwX0cByRk= +cloud.google.com/go/cloudtasks v1.5.0/go.mod h1:fD92REy1x5woxkKEkLdvavGnPJGEn8Uic9nWuLzqCpY= +cloud.google.com/go/cloudtasks v1.6.0/go.mod h1:C6Io+sxuke9/KNRkbQpihnW93SWDU3uXt92nu85HkYI= +cloud.google.com/go/cloudtasks v1.7.0/go.mod h1:ImsfdYWwlWNJbdgPIIGJWC+gemEGTBK/SunNQQNCAb4= +cloud.google.com/go/cloudtasks v1.8.0/go.mod h1:gQXUIwCSOI4yPVK7DgTVFiiP0ZW/eQkydWzwVMdHxrI= +cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= +cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= +cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= +cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= +cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= +cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= +cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= +cloud.google.com/go/compute v1.12.0/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= +cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= +cloud.google.com/go/compute v1.13.0/go.mod h1:5aPTS0cUNMIc1CE546K+Th6weJUNQErARyZtRXDJ8GE= +cloud.google.com/go/compute v1.14.0/go.mod h1:YfLtxrj9sU4Yxv+sXzZkyPjEyPBZfXHUvjxega5vAdo= +cloud.google.com/go/compute v1.15.1/go.mod h1:bjjoF/NtFUrkD/urWfdHaKuOPDR5nWIs63rR+SXhcpA= +cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU= +cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +cloud.google.com/go/contactcenterinsights v1.3.0/go.mod h1:Eu2oemoePuEFc/xKFPjbTuPSj0fYJcPls9TFlPNnHHY= +cloud.google.com/go/contactcenterinsights v1.4.0/go.mod h1:L2YzkGbPsv+vMQMCADxJoT9YiTTnSEd6fEvCeHTYVck= +cloud.google.com/go/container v1.6.0/go.mod h1:Xazp7GjJSeUYo688S+6J5V+n/t+G5sKBTFkKNudGRxg= +cloud.google.com/go/container v1.7.0/go.mod h1:Dp5AHtmothHGX3DwwIHPgq45Y8KmNsgN3amoYfxVkLo= +cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= +cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= +cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= +cloud.google.com/go/datacatalog v1.5.0/go.mod h1:M7GPLNQeLfWqeIm3iuiruhPzkt65+Bx8dAKvScX8jvs= +cloud.google.com/go/datacatalog v1.6.0/go.mod h1:+aEyF8JKg+uXcIdAmmaMUmZ3q1b/lKLtXCmXdnc0lbc= +cloud.google.com/go/datacatalog v1.7.0/go.mod h1:9mEl4AuDYWw81UGc41HonIHH7/sn52H0/tc8f8ZbZIE= +cloud.google.com/go/datacatalog v1.8.0/go.mod h1:KYuoVOv9BM8EYz/4eMFxrr4DUKhGIOXxZoKYF5wdISM= +cloud.google.com/go/dataflow v0.6.0/go.mod h1:9QwV89cGoxjjSR9/r7eFDqqjtvbKxAK2BaYU6PVk9UM= +cloud.google.com/go/dataflow v0.7.0/go.mod h1:PX526vb4ijFMesO1o202EaUmouZKBpjHsTlCtB4parQ= +cloud.google.com/go/dataform v0.3.0/go.mod h1:cj8uNliRlHpa6L3yVhDOBrUXH+BPAO1+KFMQQNSThKo= +cloud.google.com/go/dataform v0.4.0/go.mod h1:fwV6Y4Ty2yIFL89huYlEkwUPtS7YZinZbzzj5S9FzCE= +cloud.google.com/go/dataform v0.5.0/go.mod h1:GFUYRe8IBa2hcomWplodVmUx/iTL0FrsauObOM3Ipr0= +cloud.google.com/go/datafusion v1.4.0/go.mod h1:1Zb6VN+W6ALo85cXnM1IKiPw+yQMKMhB9TsTSRDo/38= +cloud.google.com/go/datafusion v1.5.0/go.mod h1:Kz+l1FGHB0J+4XF2fud96WMmRiq/wj8N9u007vyXZ2w= +cloud.google.com/go/datalabeling v0.5.0/go.mod h1:TGcJ0G2NzcsXSE/97yWjIZO0bXj0KbVlINXMG9ud42I= +cloud.google.com/go/datalabeling v0.6.0/go.mod h1:WqdISuk/+WIGeMkpw/1q7bK/tFEZxsrFJOJdY2bXvTQ= +cloud.google.com/go/dataplex v1.3.0/go.mod h1:hQuRtDg+fCiFgC8j0zV222HvzFQdRd+SVX8gdmFcZzA= +cloud.google.com/go/dataplex v1.4.0/go.mod h1:X51GfLXEMVJ6UN47ESVqvlsRplbLhcsAt0kZCCKsU0A= +cloud.google.com/go/dataproc v1.7.0/go.mod h1:CKAlMjII9H90RXaMpSxQ8EU6dQx6iAYNPcYPOkSbi8s= +cloud.google.com/go/dataproc v1.8.0/go.mod h1:5OW+zNAH0pMpw14JVrPONsxMQYMBqJuzORhIBfBn9uI= +cloud.google.com/go/dataqna v0.5.0/go.mod h1:90Hyk596ft3zUQ8NkFfvICSIfHFh1Bc7C4cK3vbhkeo= +cloud.google.com/go/dataqna v0.6.0/go.mod h1:1lqNpM7rqNLVgWBJyk5NF6Uen2PHym0jtVJonplVsDA= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/datastore v1.10.0/go.mod h1:PC5UzAmDEkAmkfaknstTYbNpgE49HAgW2J1gcgUfmdM= +cloud.google.com/go/datastream v1.2.0/go.mod h1:i/uTP8/fZwgATHS/XFu0TcNUhuA0twZxxQ3EyCUQMwo= +cloud.google.com/go/datastream v1.3.0/go.mod h1:cqlOX8xlyYF/uxhiKn6Hbv6WjwPPuI9W2M9SAXwaLLQ= +cloud.google.com/go/datastream v1.4.0/go.mod h1:h9dpzScPhDTs5noEMQVWP8Wx8AFBRyS0s8KWPx/9r0g= +cloud.google.com/go/datastream v1.5.0/go.mod h1:6TZMMNPwjUqZHBKPQ1wwXpb0d5VDVPl2/XoS5yi88q4= +cloud.google.com/go/deploy v1.4.0/go.mod h1:5Xghikd4VrmMLNaF6FiRFDlHb59VM59YoDQnOUdsH/c= +cloud.google.com/go/deploy v1.5.0/go.mod h1:ffgdD0B89tToyW/U/D2eL0jN2+IEV/3EMuXHA0l4r+s= +cloud.google.com/go/dialogflow v1.15.0/go.mod h1:HbHDWs33WOGJgn6rfzBW1Kv807BE3O1+xGbn59zZWI4= +cloud.google.com/go/dialogflow v1.16.1/go.mod h1:po6LlzGfK+smoSmTBnbkIZY2w8ffjz/RcGSS+sh1el0= +cloud.google.com/go/dialogflow v1.17.0/go.mod h1:YNP09C/kXA1aZdBgC/VtXX74G/TKn7XVCcVumTflA+8= +cloud.google.com/go/dialogflow v1.18.0/go.mod h1:trO7Zu5YdyEuR+BhSNOqJezyFQ3aUzz0njv7sMx/iek= +cloud.google.com/go/dialogflow v1.19.0/go.mod h1:JVmlG1TwykZDtxtTXujec4tQ+D8SBFMoosgy+6Gn0s0= +cloud.google.com/go/dlp v1.6.0/go.mod h1:9eyB2xIhpU0sVwUixfBubDoRwP+GjeUoxxeueZmqvmM= +cloud.google.com/go/dlp v1.7.0/go.mod h1:68ak9vCiMBjbasxeVD17hVPxDEck+ExiHavX8kiHG+Q= +cloud.google.com/go/documentai v1.7.0/go.mod h1:lJvftZB5NRiFSX4moiye1SMxHx0Bc3x1+p9e/RfXYiU= +cloud.google.com/go/documentai v1.8.0/go.mod h1:xGHNEB7CtsnySCNrCFdCyyMz44RhFEEX2Q7UD0c5IhU= +cloud.google.com/go/documentai v1.9.0/go.mod h1:FS5485S8R00U10GhgBC0aNGrJxBP8ZVpEeJ7PQDZd6k= +cloud.google.com/go/documentai v1.10.0/go.mod h1:vod47hKQIPeCfN2QS/jULIvQTugbmdc0ZvxxfQY1bg4= +cloud.google.com/go/domains v0.6.0/go.mod h1:T9Rz3GasrpYk6mEGHh4rymIhjlnIuB4ofT1wTxDeT4Y= +cloud.google.com/go/domains v0.7.0/go.mod h1:PtZeqS1xjnXuRPKE/88Iru/LdfoRyEHYA9nFQf4UKpg= +cloud.google.com/go/edgecontainer v0.1.0/go.mod h1:WgkZ9tp10bFxqO8BLPqv2LlfmQF1X8lZqwW4r1BTajk= +cloud.google.com/go/edgecontainer v0.2.0/go.mod h1:RTmLijy+lGpQ7BXuTDa4C4ssxyXT34NIuHIgKuP4s5w= +cloud.google.com/go/errorreporting v0.3.0/go.mod h1:xsP2yaAp+OAW4OIm60An2bbLpqIhKXdWR/tawvl7QzU= +cloud.google.com/go/essentialcontacts v1.3.0/go.mod h1:r+OnHa5jfj90qIfZDO/VztSFqbQan7HV75p8sA+mdGI= +cloud.google.com/go/essentialcontacts v1.4.0/go.mod h1:8tRldvHYsmnBCHdFpvU+GL75oWiBKl80BiqlFh9tp+8= +cloud.google.com/go/eventarc v1.7.0/go.mod h1:6ctpF3zTnaQCxUjHUdcfgcA1A2T309+omHZth7gDfmc= +cloud.google.com/go/eventarc v1.8.0/go.mod h1:imbzxkyAU4ubfsaKYdQg04WS1NvncblHEup4kvF+4gw= +cloud.google.com/go/filestore v1.3.0/go.mod h1:+qbvHGvXU1HaKX2nD0WEPo92TP/8AQuCVEBXNY9z0+w= +cloud.google.com/go/filestore v1.4.0/go.mod h1:PaG5oDfo9r224f8OYXURtAsY+Fbyq/bLYoINEK8XQAI= +cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= +cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= +cloud.google.com/go/firestore v1.9.0/go.mod h1:HMkjKHNTtRyZNiMzu7YAsLr9K3X2udY2AMwDaMEQiiE= +cloud.google.com/go/functions v1.6.0/go.mod h1:3H1UA3qiIPRWD7PeZKLvHZ9SaQhR26XIJcC0A5GbvAk= +cloud.google.com/go/functions v1.7.0/go.mod h1:+d+QBcWM+RsrgZfV9xo6KfA1GlzJfxcfZcRPEhDDfzg= +cloud.google.com/go/functions v1.8.0/go.mod h1:RTZ4/HsQjIqIYP9a9YPbU+QFoQsAlYgrwOXJWHn1POY= +cloud.google.com/go/functions v1.9.0/go.mod h1:Y+Dz8yGguzO3PpIjhLTbnqV1CWmgQ5UwtlpzoyquQ08= +cloud.google.com/go/gaming v1.5.0/go.mod h1:ol7rGcxP/qHTRQE/RO4bxkXq+Fix0j6D4LFPzYTIrDM= +cloud.google.com/go/gaming v1.6.0/go.mod h1:YMU1GEvA39Qt3zWGyAVA9bpYz/yAhTvaQ1t2sK4KPUA= +cloud.google.com/go/gaming v1.7.0/go.mod h1:LrB8U7MHdGgFG851iHAfqUdLcKBdQ55hzXy9xBJz0+w= +cloud.google.com/go/gaming v1.8.0/go.mod h1:xAqjS8b7jAVW0KFYeRUxngo9My3f33kFmua++Pi+ggM= +cloud.google.com/go/gkebackup v0.2.0/go.mod h1:XKvv/4LfG829/B8B7xRkk8zRrOEbKtEam6yNfuQNH60= +cloud.google.com/go/gkebackup v0.3.0/go.mod h1:n/E671i1aOQvUxT541aTkCwExO/bTer2HDlj4TsBRAo= +cloud.google.com/go/gkeconnect v0.5.0/go.mod h1:c5lsNAg5EwAy7fkqX/+goqFsU1Da/jQFqArp+wGNr/o= +cloud.google.com/go/gkeconnect v0.6.0/go.mod h1:Mln67KyU/sHJEBY8kFZ0xTeyPtzbq9StAVvEULYK16A= +cloud.google.com/go/gkehub v0.9.0/go.mod h1:WYHN6WG8w9bXU0hqNxt8rm5uxnk8IH+lPY9J2TV7BK0= +cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y977wO+hBH0= +cloud.google.com/go/gkemulticloud v0.3.0/go.mod h1:7orzy7O0S+5kq95e4Hpn7RysVA7dPs8W/GgfUtsPbrA= +cloud.google.com/go/gkemulticloud v0.4.0/go.mod h1:E9gxVBnseLWCk24ch+P9+B2CoDFJZTyIgLKSalC7tuI= +cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= +cloud.google.com/go/gsuiteaddons v1.3.0/go.mod h1:EUNK/J1lZEZO8yPtykKxLXI6JSVN2rg9bN8SXOa0bgM= +cloud.google.com/go/gsuiteaddons v1.4.0/go.mod h1:rZK5I8hht7u7HxFQcFei0+AtfS9uSushomRlg+3ua1o= +cloud.google.com/go/iam v0.1.0/go.mod h1:vcUNEa0pEm0qRVpmWepWaFMIAI8/hjB9mO8rNCJtF6c= +cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= +cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= +cloud.google.com/go/iam v0.6.0/go.mod h1:+1AH33ueBne5MzYccyMHtEKqLE4/kJOibtffMHDMFMc= +cloud.google.com/go/iam v0.7.0/go.mod h1:H5Br8wRaDGNc8XP3keLc4unfUUZeyH3Sfl9XpQEYOeg= +cloud.google.com/go/iam v0.8.0/go.mod h1:lga0/y3iH6CX7sYqypWJ33hf7kkfXJag67naqGESjkE= +cloud.google.com/go/iap v1.4.0/go.mod h1:RGFwRJdihTINIe4wZ2iCP0zF/qu18ZwyKxrhMhygBEc= +cloud.google.com/go/iap v1.5.0/go.mod h1:UH/CGgKd4KyohZL5Pt0jSKE4m3FR51qg6FKQ/z/Ix9A= +cloud.google.com/go/ids v1.1.0/go.mod h1:WIuwCaYVOzHIj2OhN9HAwvW+DBdmUAdcWlFxRl+KubM= +cloud.google.com/go/ids v1.2.0/go.mod h1:5WXvp4n25S0rA/mQWAg1YEEBBq6/s+7ml1RDCW1IrcY= +cloud.google.com/go/iot v1.3.0/go.mod h1:r7RGh2B61+B8oz0AGE+J72AhA0G7tdXItODWsaA2oLs= +cloud.google.com/go/iot v1.4.0/go.mod h1:dIDxPOn0UvNDUMD8Ger7FIaTuvMkj+aGk94RPP0iV+g= +cloud.google.com/go/kms v1.4.0/go.mod h1:fajBHndQ+6ubNw6Ss2sSd+SWvjL26RNo/dr7uxsnnOA= +cloud.google.com/go/kms v1.5.0/go.mod h1:QJS2YY0eJGBg3mnDfuaCyLauWwBJiHRboYxJ++1xJNg= +cloud.google.com/go/kms v1.6.0/go.mod h1:Jjy850yySiasBUDi6KFUwUv2n1+o7QZFyuUJg6OgjA0= +cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= +cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= +cloud.google.com/go/language v1.7.0/go.mod h1:DJ6dYN/W+SQOjF8e1hLQXMF21AkH2w9wiPzPCJa2MIE= +cloud.google.com/go/language v1.8.0/go.mod h1:qYPVHf7SPoNNiCL2Dr0FfEFNil1qi3pQEyygwpgVKB8= +cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= +cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= +cloud.google.com/go/logging v1.6.1/go.mod h1:5ZO0mHHbvm8gEmeEUHrmDlTDSu5imF6MUP9OfilNXBw= +cloud.google.com/go/longrunning v0.1.1/go.mod h1:UUFxuDWkv22EuY93jjmDMFT5GPQKeFVJBIF6QlTqdsE= +cloud.google.com/go/longrunning v0.3.0/go.mod h1:qth9Y41RRSUE69rDcOn6DdK3HfQfsUI0YSmW3iIlLJc= +cloud.google.com/go/managedidentities v1.3.0/go.mod h1:UzlW3cBOiPrzucO5qWkNkh0w33KFtBJU281hacNvsdE= +cloud.google.com/go/managedidentities v1.4.0/go.mod h1:NWSBYbEMgqmbZsLIyKvxrYbtqOsxY1ZrGM+9RgDqInM= +cloud.google.com/go/maps v0.1.0/go.mod h1:BQM97WGyfw9FWEmQMpZ5T6cpovXXSd1cGmFma94eubI= +cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= +cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= +cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= +cloud.google.com/go/memcache v1.5.0/go.mod h1:dk3fCK7dVo0cUU2c36jKb4VqKPS22BTkf81Xq617aWM= +cloud.google.com/go/memcache v1.6.0/go.mod h1:XS5xB0eQZdHtTuTF9Hf8eJkKtR3pVRCcvJwtm68T3rA= +cloud.google.com/go/memcache v1.7.0/go.mod h1:ywMKfjWhNtkQTxrWxCkCFkoPjLHPW6A7WOTVI8xy3LY= +cloud.google.com/go/metastore v1.5.0/go.mod h1:2ZNrDcQwghfdtCwJ33nM0+GrBGlVuh8rakL3vdPY3XY= +cloud.google.com/go/metastore v1.6.0/go.mod h1:6cyQTls8CWXzk45G55x57DVQ9gWg7RiH65+YgPsNh9s= +cloud.google.com/go/metastore v1.7.0/go.mod h1:s45D0B4IlsINu87/AsWiEVYbLaIMeUSoxlKKDqBGFS8= +cloud.google.com/go/metastore v1.8.0/go.mod h1:zHiMc4ZUpBiM7twCIFQmJ9JMEkDSyZS9U12uf7wHqSI= +cloud.google.com/go/monitoring v1.7.0/go.mod h1:HpYse6kkGo//7p6sT0wsIC6IBDET0RhIsnmlA53dvEk= +cloud.google.com/go/monitoring v1.8.0/go.mod h1:E7PtoMJ1kQXWxPjB6mv2fhC5/15jInuulFdYYtlcvT4= +cloud.google.com/go/networkconnectivity v1.4.0/go.mod h1:nOl7YL8odKyAOtzNX73/M5/mGZgqqMeryi6UPZTk/rA= +cloud.google.com/go/networkconnectivity v1.5.0/go.mod h1:3GzqJx7uhtlM3kln0+x5wyFvuVH1pIBJjhCpjzSt75o= +cloud.google.com/go/networkconnectivity v1.6.0/go.mod h1:OJOoEXW+0LAxHh89nXd64uGG+FbQoeH8DtxCHVOMlaM= +cloud.google.com/go/networkconnectivity v1.7.0/go.mod h1:RMuSbkdbPwNMQjB5HBWD5MpTBnNm39iAVpC3TmsExt8= +cloud.google.com/go/networkmanagement v1.4.0/go.mod h1:Q9mdLLRn60AsOrPc8rs8iNV6OHXaGcDdsIQe1ohekq8= +cloud.google.com/go/networkmanagement v1.5.0/go.mod h1:ZnOeZ/evzUdUsnvRt792H0uYEnHQEMaz+REhhzJRcf4= +cloud.google.com/go/networksecurity v0.5.0/go.mod h1:xS6fOCoqpVC5zx15Z/MqkfDwH4+m/61A3ODiDV1xmiQ= +cloud.google.com/go/networksecurity v0.6.0/go.mod h1:Q5fjhTr9WMI5mbpRYEbiexTzROf7ZbDzvzCrNl14nyU= +cloud.google.com/go/notebooks v1.2.0/go.mod h1:9+wtppMfVPUeJ8fIWPOq1UnATHISkGXGqTkxeieQ6UY= +cloud.google.com/go/notebooks v1.3.0/go.mod h1:bFR5lj07DtCPC7YAAJ//vHskFBxA5JzYlH68kXVdk34= +cloud.google.com/go/notebooks v1.4.0/go.mod h1:4QPMngcwmgb6uw7Po99B2xv5ufVoIQ7nOGDyL4P8AgA= +cloud.google.com/go/notebooks v1.5.0/go.mod h1:q8mwhnP9aR8Hpfnrc5iN5IBhrXUy8S2vuYs+kBJ/gu0= +cloud.google.com/go/optimization v1.1.0/go.mod h1:5po+wfvX5AQlPznyVEZjGJTMr4+CAkJf2XSTQOOl9l4= +cloud.google.com/go/optimization v1.2.0/go.mod h1:Lr7SOHdRDENsh+WXVmQhQTrzdu9ybg0NecjHidBq6xs= +cloud.google.com/go/orchestration v1.3.0/go.mod h1:Sj5tq/JpWiB//X/q3Ngwdl5K7B7Y0KZ7bfv0wL6fqVA= +cloud.google.com/go/orchestration v1.4.0/go.mod h1:6W5NLFWs2TlniBphAViZEVhrXRSMgUGDfW7vrWKvsBk= +cloud.google.com/go/orgpolicy v1.4.0/go.mod h1:xrSLIV4RePWmP9P3tBl8S93lTmlAxjm06NSm2UTmKvE= +cloud.google.com/go/orgpolicy v1.5.0/go.mod h1:hZEc5q3wzwXJaKrsx5+Ewg0u1LxJ51nNFlext7Tanwc= +cloud.google.com/go/osconfig v1.7.0/go.mod h1:oVHeCeZELfJP7XLxcBGTMBvRO+1nQ5tFG9VQTmYS2Fs= +cloud.google.com/go/osconfig v1.8.0/go.mod h1:EQqZLu5w5XA7eKizepumcvWx+m8mJUhEwiPqWiZeEdg= +cloud.google.com/go/osconfig v1.9.0/go.mod h1:Yx+IeIZJ3bdWmzbQU4fxNl8xsZ4amB+dygAwFPlvnNo= +cloud.google.com/go/osconfig v1.10.0/go.mod h1:uMhCzqC5I8zfD9zDEAfvgVhDS8oIjySWh+l4WK6GnWw= +cloud.google.com/go/oslogin v1.4.0/go.mod h1:YdgMXWRaElXz/lDk1Na6Fh5orF7gvmJ0FGLIs9LId4E= +cloud.google.com/go/oslogin v1.5.0/go.mod h1:D260Qj11W2qx/HVF29zBg+0fd6YCSjSqLUkY/qEenQU= +cloud.google.com/go/oslogin v1.6.0/go.mod h1:zOJ1O3+dTU8WPlGEkFSh7qeHPPSoxrcMbbK1Nm2iX70= +cloud.google.com/go/oslogin v1.7.0/go.mod h1:e04SN0xO1UNJ1M5GP0vzVBFicIe4O53FOfcixIqTyXo= +cloud.google.com/go/phishingprotection v0.5.0/go.mod h1:Y3HZknsK9bc9dMi+oE8Bim0lczMU6hrX0UpADuMefr0= +cloud.google.com/go/phishingprotection v0.6.0/go.mod h1:9Y3LBLgy0kDTcYET8ZH3bq/7qni15yVUoAxiFxnlSUA= +cloud.google.com/go/policytroubleshooter v1.3.0/go.mod h1:qy0+VwANja+kKrjlQuOzmlvscn4RNsAc0e15GGqfMxg= +cloud.google.com/go/policytroubleshooter v1.4.0/go.mod h1:DZT4BcRw3QoO8ota9xw/LKtPa8lKeCByYeKTIf/vxdE= +cloud.google.com/go/privatecatalog v0.5.0/go.mod h1:XgosMUvvPyxDjAVNDYxJ7wBW8//hLDDYmnsNcMGq1K0= +cloud.google.com/go/privatecatalog v0.6.0/go.mod h1:i/fbkZR0hLN29eEWiiwue8Pb+GforiEIBnV9yrRUOKI= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/pubsub v1.26.0/go.mod h1:QgBH3U/jdJy/ftjPhTkyXNj543Tin1pRYcdcPRnFIRI= +cloud.google.com/go/pubsub v1.27.1/go.mod h1:hQN39ymbV9geqBnfQq6Xf63yNhUAhv9CZhzp5O6qsW0= +cloud.google.com/go/pubsublite v1.5.0/go.mod h1:xapqNQ1CuLfGi23Yda/9l4bBCKz/wC3KIJ5gKcxveZg= +cloud.google.com/go/recaptchaenterprise v1.3.1/go.mod h1:OdD+q+y4XGeAlxRaMn1Y7/GveP6zmq76byL6tjPE7d4= +cloud.google.com/go/recaptchaenterprise/v2 v2.1.0/go.mod h1:w9yVqajwroDNTfGuhmOjPDN//rZGySaf6PtFVcSCa7o= +cloud.google.com/go/recaptchaenterprise/v2 v2.2.0/go.mod h1:/Zu5jisWGeERrd5HnlS3EUGb/D335f9k51B/FVil0jk= +cloud.google.com/go/recaptchaenterprise/v2 v2.3.0/go.mod h1:O9LwGCjrhGHBQET5CA7dd5NwwNQUErSgEDit1DLNTdo= +cloud.google.com/go/recaptchaenterprise/v2 v2.4.0/go.mod h1:Am3LHfOuBstrLrNCBrlI5sbwx9LBg3te2N6hGvHn2mE= +cloud.google.com/go/recaptchaenterprise/v2 v2.5.0/go.mod h1:O8LzcHXN3rz0j+LBC91jrwI3R+1ZSZEWrfL7XHgNo9U= +cloud.google.com/go/recommendationengine v0.5.0/go.mod h1:E5756pJcVFeVgaQv3WNpImkFP8a+RptV6dDLGPILjvg= +cloud.google.com/go/recommendationengine v0.6.0/go.mod h1:08mq2umu9oIqc7tDy8sx+MNJdLG0fUi3vaSVbztHgJ4= +cloud.google.com/go/recommender v1.5.0/go.mod h1:jdoeiBIVrJe9gQjwd759ecLJbxCDED4A6p+mqoqDvTg= +cloud.google.com/go/recommender v1.6.0/go.mod h1:+yETpm25mcoiECKh9DEScGzIRyDKpZ0cEhWGo+8bo+c= +cloud.google.com/go/recommender v1.7.0/go.mod h1:XLHs/W+T8olwlGOgfQenXBTbIseGclClff6lhFVe9Bs= +cloud.google.com/go/recommender v1.8.0/go.mod h1:PkjXrTT05BFKwxaUxQmtIlrtj0kph108r02ZZQ5FE70= +cloud.google.com/go/redis v1.7.0/go.mod h1:V3x5Jq1jzUcg+UNsRvdmsfuFnit1cfe3Z/PGyq/lm4Y= +cloud.google.com/go/redis v1.8.0/go.mod h1:Fm2szCDavWzBk2cDKxrkmWBqoCiL1+Ctwq7EyqBCA/A= +cloud.google.com/go/redis v1.9.0/go.mod h1:HMYQuajvb2D0LvMgZmLDZW8V5aOC/WxstZHiy4g8OiA= +cloud.google.com/go/redis v1.10.0/go.mod h1:ThJf3mMBQtW18JzGgh41/Wld6vnDDc/F/F35UolRZPM= +cloud.google.com/go/resourcemanager v1.3.0/go.mod h1:bAtrTjZQFJkiWTPDb1WBjzvc6/kifjj4QBYuKCCoqKA= +cloud.google.com/go/resourcemanager v1.4.0/go.mod h1:MwxuzkumyTX7/a3n37gmsT3py7LIXwrShilPh3P1tR0= +cloud.google.com/go/resourcesettings v1.3.0/go.mod h1:lzew8VfESA5DQ8gdlHwMrqZs1S9V87v3oCnKCWoOuQU= +cloud.google.com/go/resourcesettings v1.4.0/go.mod h1:ldiH9IJpcrlC3VSuCGvjR5of/ezRrOxFtpJoJo5SmXg= +cloud.google.com/go/retail v1.8.0/go.mod h1:QblKS8waDmNUhghY2TI9O3JLlFk8jybHeV4BF19FrE4= +cloud.google.com/go/retail v1.9.0/go.mod h1:g6jb6mKuCS1QKnH/dpu7isX253absFl6iE92nHwlBUY= +cloud.google.com/go/retail v1.10.0/go.mod h1:2gDk9HsL4HMS4oZwz6daui2/jmKvqShXKQuB2RZ+cCc= +cloud.google.com/go/retail v1.11.0/go.mod h1:MBLk1NaWPmh6iVFSz9MeKG/Psyd7TAgm6y/9L2B4x9Y= +cloud.google.com/go/run v0.2.0/go.mod h1:CNtKsTA1sDcnqqIFR3Pb5Tq0usWxJJvsWOCPldRU3Do= +cloud.google.com/go/run v0.3.0/go.mod h1:TuyY1+taHxTjrD0ZFk2iAR+xyOXEA0ztb7U3UNA0zBo= +cloud.google.com/go/scheduler v1.4.0/go.mod h1:drcJBmxF3aqZJRhmkHQ9b3uSSpQoltBPGPxGAWROx6s= +cloud.google.com/go/scheduler v1.5.0/go.mod h1:ri073ym49NW3AfT6DZi21vLZrG07GXr5p3H1KxN5QlI= +cloud.google.com/go/scheduler v1.6.0/go.mod h1:SgeKVM7MIwPn3BqtcBntpLyrIJftQISRrYB5ZtT+KOk= +cloud.google.com/go/scheduler v1.7.0/go.mod h1:jyCiBqWW956uBjjPMMuX09n3x37mtyPJegEWKxRsn44= +cloud.google.com/go/secretmanager v1.6.0/go.mod h1:awVa/OXF6IiyaU1wQ34inzQNc4ISIDIrId8qE5QGgKA= +cloud.google.com/go/secretmanager v1.8.0/go.mod h1:hnVgi/bN5MYHd3Gt0SPuTPPp5ENina1/LxM+2W9U9J4= +cloud.google.com/go/secretmanager v1.9.0/go.mod h1:b71qH2l1yHmWQHt9LC80akm86mX8AL6X1MA01dW8ht4= +cloud.google.com/go/security v1.5.0/go.mod h1:lgxGdyOKKjHL4YG3/YwIL2zLqMFCKs0UbQwgyZmfJl4= +cloud.google.com/go/security v1.7.0/go.mod h1:mZklORHl6Bg7CNnnjLH//0UlAlaXqiG7Lb9PsPXLfD0= +cloud.google.com/go/security v1.8.0/go.mod h1:hAQOwgmaHhztFhiQ41CjDODdWP0+AE1B3sX4OFlq+GU= +cloud.google.com/go/security v1.9.0/go.mod h1:6Ta1bO8LXI89nZnmnsZGp9lVoVWXqsVbIq/t9dzI+2Q= +cloud.google.com/go/security v1.10.0/go.mod h1:QtOMZByJVlibUT2h9afNDWRZ1G96gVywH8T5GUSb9IA= +cloud.google.com/go/securitycenter v1.13.0/go.mod h1:cv5qNAqjY84FCN6Y9z28WlkKXyWsgLO832YiWwkCWcU= +cloud.google.com/go/securitycenter v1.14.0/go.mod h1:gZLAhtyKv85n52XYWt6RmeBdydyxfPeTrpToDPw4Auc= +cloud.google.com/go/securitycenter v1.15.0/go.mod h1:PeKJ0t8MoFmmXLXWm41JidyzI3PJjd8sXWaVqg43WWk= +cloud.google.com/go/securitycenter v1.16.0/go.mod h1:Q9GMaLQFUD+5ZTabrbujNWLtSLZIZF7SAR0wWECrjdk= +cloud.google.com/go/servicecontrol v1.4.0/go.mod h1:o0hUSJ1TXJAmi/7fLJAedOovnujSEvjKCAFNXPQ1RaU= +cloud.google.com/go/servicecontrol v1.5.0/go.mod h1:qM0CnXHhyqKVuiZnGKrIurvVImCs8gmqWsDoqe9sU1s= +cloud.google.com/go/servicedirectory v1.4.0/go.mod h1:gH1MUaZCgtP7qQiI+F+A+OpeKF/HQWgtAddhTbhL2bs= +cloud.google.com/go/servicedirectory v1.5.0/go.mod h1:QMKFL0NUySbpZJ1UZs3oFAmdvVxhhxB6eJ/Vlp73dfg= +cloud.google.com/go/servicedirectory v1.6.0/go.mod h1:pUlbnWsLH9c13yGkxCmfumWEPjsRs1RlmJ4pqiNjVL4= +cloud.google.com/go/servicedirectory v1.7.0/go.mod h1:5p/U5oyvgYGYejufvxhgwjL8UVXjkuw7q5XcG10wx1U= +cloud.google.com/go/servicemanagement v1.4.0/go.mod h1:d8t8MDbezI7Z2R1O/wu8oTggo3BI2GKYbdG4y/SJTco= +cloud.google.com/go/servicemanagement v1.5.0/go.mod h1:XGaCRe57kfqu4+lRxaFEAuqmjzF0r+gWHjWqKqBvKFo= +cloud.google.com/go/serviceusage v1.3.0/go.mod h1:Hya1cozXM4SeSKTAgGXgj97GlqUvF5JaoXacR1JTP/E= +cloud.google.com/go/serviceusage v1.4.0/go.mod h1:SB4yxXSaYVuUBYUml6qklyONXNLt83U0Rb+CXyhjEeU= +cloud.google.com/go/shell v1.3.0/go.mod h1:VZ9HmRjZBsjLGXusm7K5Q5lzzByZmJHf1d0IWHEN5X4= +cloud.google.com/go/shell v1.4.0/go.mod h1:HDxPzZf3GkDdhExzD/gs8Grqk+dmYcEjGShZgYa9URw= +cloud.google.com/go/spanner v1.41.0/go.mod h1:MLYDBJR/dY4Wt7ZaMIQ7rXOTLjYrmxLE/5ve9vFfWos= +cloud.google.com/go/speech v1.6.0/go.mod h1:79tcr4FHCimOp56lwC01xnt/WPJZc4v3gzyT7FoBkCM= +cloud.google.com/go/speech v1.7.0/go.mod h1:KptqL+BAQIhMsj1kOP2la5DSEEerPDuOP/2mmkhHhZQ= +cloud.google.com/go/speech v1.8.0/go.mod h1:9bYIl1/tjsAnMgKGHKmBZzXKEkGgtU+MpdDPTE9f7y0= +cloud.google.com/go/speech v1.9.0/go.mod h1:xQ0jTcmnRFFM2RfX/U+rk6FQNUF6DQlydUSyoooSpco= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= +cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= +cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= +cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= +cloud.google.com/go/storagetransfer v1.5.0/go.mod h1:dxNzUopWy7RQevYFHewchb29POFv3/AaBgnhqzqiK0w= +cloud.google.com/go/storagetransfer v1.6.0/go.mod h1:y77xm4CQV/ZhFZH75PLEXY0ROiS7Gh6pSKrM8dJyg6I= +cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= +cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= +cloud.google.com/go/talent v1.3.0/go.mod h1:CmcxwJ/PKfRgd1pBjQgU6W3YBwiewmUzQYH5HHmSCmM= +cloud.google.com/go/talent v1.4.0/go.mod h1:ezFtAgVuRf8jRsvyE6EwmbTK5LKciD4KVnHuDEFmOOA= +cloud.google.com/go/texttospeech v1.4.0/go.mod h1:FX8HQHA6sEpJ7rCMSfXuzBcysDAuWusNNNvN9FELDd8= +cloud.google.com/go/texttospeech v1.5.0/go.mod h1:oKPLhR4n4ZdQqWKURdwxMy0uiTS1xU161C8W57Wkea4= +cloud.google.com/go/tpu v1.3.0/go.mod h1:aJIManG0o20tfDQlRIej44FcwGGl/cD0oiRyMKG19IQ= +cloud.google.com/go/tpu v1.4.0/go.mod h1:mjZaX8p0VBgllCzF6wcU2ovUXN9TONFLd7iz227X2Xg= +cloud.google.com/go/trace v1.3.0/go.mod h1:FFUE83d9Ca57C+K8rDl/Ih8LwOzWIV1krKgxg6N0G28= +cloud.google.com/go/trace v1.4.0/go.mod h1:UG0v8UBqzusp+z63o7FK74SdFE+AXpCLdFb1rshXG+Y= +cloud.google.com/go/translate v1.3.0/go.mod h1:gzMUwRjvOqj5i69y/LYLd8RrNQk+hOmIXTi9+nb3Djs= +cloud.google.com/go/translate v1.4.0/go.mod h1:06Dn/ppvLD6WvA5Rhdp029IX2Mi3Mn7fpMRLPvXT5Wg= +cloud.google.com/go/video v1.8.0/go.mod h1:sTzKFc0bUSByE8Yoh8X0mn8bMymItVGPfTuUBUyRgxk= +cloud.google.com/go/video v1.9.0/go.mod h1:0RhNKFRF5v92f8dQt0yhaHrEuH95m068JYOvLZYnJSw= +cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= +cloud.google.com/go/videointelligence v1.7.0/go.mod h1:k8pI/1wAhjznARtVT9U1llUaFNPh7muw8QyOUpavru4= +cloud.google.com/go/videointelligence v1.8.0/go.mod h1:dIcCn4gVDdS7yte/w+koiXn5dWVplOZkE+xwG9FgK+M= +cloud.google.com/go/videointelligence v1.9.0/go.mod h1:29lVRMPDYHikk3v8EdPSaL8Ku+eMzDljjuvRs105XoU= +cloud.google.com/go/vision v1.2.0/go.mod h1:SmNwgObm5DpFBme2xpyOyasvBc1aPdjvMk2bBk0tKD0= +cloud.google.com/go/vision/v2 v2.2.0/go.mod h1:uCdV4PpN1S0jyCyq8sIM42v2Y6zOLkZs+4R9LrGYwFo= +cloud.google.com/go/vision/v2 v2.3.0/go.mod h1:UO61abBx9QRMFkNBbf1D8B1LXdS2cGiiCRx0vSpZoUo= +cloud.google.com/go/vision/v2 v2.4.0/go.mod h1:VtI579ll9RpVTrdKdkMzckdnwMyX2JILb+MhPqRbPsY= +cloud.google.com/go/vision/v2 v2.5.0/go.mod h1:MmaezXOOE+IWa+cS7OhRRLK2cNv1ZL98zhqFFZaaH2E= +cloud.google.com/go/vmmigration v1.2.0/go.mod h1:IRf0o7myyWFSmVR1ItrBSFLFD/rJkfDCUTO4vLlJvsE= +cloud.google.com/go/vmmigration v1.3.0/go.mod h1:oGJ6ZgGPQOFdjHuocGcLqX4lc98YQ7Ygq8YQwHh9A7g= +cloud.google.com/go/vmwareengine v0.1.0/go.mod h1:RsdNEf/8UDvKllXhMz5J40XxDrNJNN4sagiox+OI208= +cloud.google.com/go/vpcaccess v1.4.0/go.mod h1:aQHVbTWDYUR1EbTApSVvMq1EnT57ppDmQzZ3imqIk4w= +cloud.google.com/go/vpcaccess v1.5.0/go.mod h1:drmg4HLk9NkZpGfCmZ3Tz0Bwnm2+DKqViEpeEpOq0m8= +cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xXZmFiHmGE= +cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= +cloud.google.com/go/webrisk v1.6.0/go.mod h1:65sW9V9rOosnc9ZY7A7jsy1zoHS5W9IAXv6dGqhMQMc= +cloud.google.com/go/webrisk v1.7.0/go.mod h1:mVMHgEYH0r337nmt1JyLthzMr6YxwN1aAIEc2fTcq7A= +cloud.google.com/go/websecurityscanner v1.3.0/go.mod h1:uImdKm2wyeXQevQJXeh8Uun/Ym1VqworNDlBXQevGMo= +cloud.google.com/go/websecurityscanner v1.4.0/go.mod h1:ebit/Fp0a+FWu5j4JOmJEV8S8CzdTkAS77oDsiSqYWQ= +cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= +cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= +cloud.google.com/go/workflows v1.8.0/go.mod h1:ysGhmEajwZxGn1OhGOGKsTXc5PyxOc0vfKf5Af+to4M= +cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT3ujaO/WwSA= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +entgo.io/contrib v0.4.5 h1:BFaOHwFLE8WZjVJadP0XHCIaxgcC1BAtUvAyw7M/GHk= +entgo.io/contrib v0.4.5/go.mod h1:wpZyq2DJgthugFvDBlaqMXj9mV4/9ebyGEn7xlTVQqE= +entgo.io/ent v0.12.3 h1:N5lO2EOrHpCH5HYfiMOCHYbo+oh5M8GjT0/cx5x6xkk= +entgo.io/ent v0.12.3/go.mod h1:AigGGx+tbrBBYHAzGOg8ND661E5cxx1Uiu5o/otJ6Yg= +entgo.io/ent v0.12.4 h1:LddPnAyxls/O7DTXZvUGDj0NZIdGSu317+aoNLJWbD8= +entgo.io/ent v0.12.4/go.mod h1:Y3JVAjtlIk8xVZYSn3t3mf8xlZIn5SAOXZQxD6kKI+Q= +github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= +github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= +github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= +github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= +github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= +github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= +github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= +github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= +github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= +github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= +github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= +github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/Shonminh/apollo-client v0.4.0/go.mod h1:Jk6K99uIGxQm7Uyy1gCQTvM/kc1YLp4Qo9/jtGkEXvI= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= +github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= +github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= +github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= +github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/aliyun/alibaba-cloud-sdk-go v1.61.18 h1:zOVTBdCKFd9JbCKz9/nt+FovbjPFmb7mUnp8nH9fQBA= +github.com/aliyun/alibaba-cloud-sdk-go v1.61.18/go.mod h1:v8ESoHo4SyHmuB4b1tJqDHxfTGEciD+yhvOU/5s1Rfk= +github.com/aliyun/aliyun-log-go-sdk v0.1.44 h1:K3+CXPnHZYNepVUGyTSx3SJ7v3zg57yFs6AQRY1MB+U= +github.com/aliyun/aliyun-log-go-sdk v0.1.44/go.mod h1:1QQ59pEJiVVXqKgbHcU6FWIgxT5RKBt+CT8AiQ2bEts= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apolloconfig/agollo/v4 v4.3.0 h1:AarIBtpDE76jIevHUOzzgT9eLB5HPvIQ8oL+OpScOPU= +github.com/apolloconfig/agollo/v4 v4.3.0/go.mod h1:SuvTjtg0p4UlSzSbik+ibLRr6oR1xRsfy65QzP3GEAs= +github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= +github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= +github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-metrics v0.3.10 h1:FR+drcQStOe+32sYyJYyZ7FIdgoGGBnwLl+flodp8Uo= +github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= +github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= +github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= +github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= +github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= +github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= +github.com/bufbuild/protocompile v0.5.1 h1:mixz5lJX4Hiz4FpqFREJHIXLfaLBntfaJv1h+/jS+Qg= +github.com/bufbuild/protocompile v0.5.1/go.mod h1:G5iLmavmF4NsYtpZFvE3B/zFch2GIY8+wjsYLR/lc40= +github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= +github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= +github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= +github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= +github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= +github.com/cenkalti/backoff v2.0.0+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= +github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/cenkalti/backoff/v4 v4.1.1 h1:G2HAfAmvm/GcKan2oOQpBXOd2tT2G57ZnZGWa1PxPBQ= +github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g= +github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= +github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= +github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= +github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= +github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58 h1:F1EaeKL/ta07PY/k9Os/UFtwERei2/XzGemhpGnBKNg= +github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k= +github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= +github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= +github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= +github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= +github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= +github.com/coocood/freecache v1.0.1/go.mod h1:ePwxCDzOYvARfHdr1pByNct1at3CoKnsipOHwKlNbzI= +github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd/v22 v22.3.2 h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI= +github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deckarep/golang-set v1.7.1 h1:SCQV0S6gTtp6itiFrTqI+pfmJ4LN85S1YzhDf9rTHJQ= +github.com/deckarep/golang-set v1.7.1/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= +github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful v2.12.0+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= +github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= +github.com/envoyproxy/go-control-plane v0.10.3/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34= +github.com/envoyproxy/go-control-plane v0.11.2-0.20230627204322-7d0032219fcb h1:kxNVXsNro/lpR5WD+P1FI/yUHn2G03Glber3k8cQL2Y= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= +github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w= +github.com/envoyproxy/protoc-gen-validate v0.10.1 h1:c0g45+xCJhdgFGw7a5QAfdS4byAbud7miNWJ1WwEVf8= +github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239/go.mod h1:Gdwt2ce0yfBxPvZrHkprdPPTTS3N5rwmLE8T22KBXlw= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= +github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0= +github.com/fluent/fluent-logger-golang v1.9.0 h1:zUdY44CHX2oIUc7VTNZc+4m+ORuO/mldQDA7czhWXEg= +github.com/fluent/fluent-logger-golang v1.9.0/go.mod h1:2/HCT/jTy78yGyeNGQLGQsjF3zzzAuy6Xlk6FCMV5eU= +github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= +github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= +github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= +github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= +github.com/frankban/quicktest v1.10.2/go.mod h1:K+q6oSqb0W0Ininfk863uOk1lMy69l/P6txr3mVT54s= +github.com/frankban/quicktest v1.14.0 h1:+cqqvzZV87b4adx/5ayVOaYZ2CrvM4ejQvUdBzPPUss= +github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= +github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= +github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= +github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= +github.com/go-chassis/cari v0.0.0-20201210041921-7b6fbef2df11/go.mod h1:MgtsEI0AM4Ush6Lyw27z9Gk4nQ/8GWTSXrFzupawWDM= +github.com/go-chassis/cari v0.4.0/go.mod h1:av/19fqwEP4eOC8unL/z67AAbFDwXUCko6SKa4Avrd8= +github.com/go-chassis/cari v0.5.0/go.mod h1:av/19fqwEP4eOC8unL/z67AAbFDwXUCko6SKa4Avrd8= +github.com/go-chassis/cari v0.5.1-0.20210823023004-74041d1363c4/go.mod h1:av/19fqwEP4eOC8unL/z67AAbFDwXUCko6SKa4Avrd8= +github.com/go-chassis/cari v0.6.0 h1:cwBchwt9L8JOyO6QkzXFAsseMJ10zVSiVK8eDLD0HkA= +github.com/go-chassis/cari v0.6.0/go.mod h1:mSDRCOQXGmlD69A6NG0hsv0UP1xbVPtL6HCGI6X1tqs= +github.com/go-chassis/foundation v0.2.2-0.20201210043510-9f6d3de40234/go.mod h1:2PjwqpVwYEVaAldl5A58a08viH8p27pNeYaiE3ZxOBA= +github.com/go-chassis/foundation v0.2.2/go.mod h1:2PjwqpVwYEVaAldl5A58a08viH8p27pNeYaiE3ZxOBA= +github.com/go-chassis/foundation v0.3.0/go.mod h1:2PjwqpVwYEVaAldl5A58a08viH8p27pNeYaiE3ZxOBA= +github.com/go-chassis/foundation v0.4.0 h1:z0xETnSxF+vRXWjoIhOdzt6rywjZ4sB++utEl4YgWEY= +github.com/go-chassis/foundation v0.4.0/go.mod h1:6NsIUaHghTFRGfCBcZN011zl196F6OR5QvD9N+P4oWU= +github.com/go-chassis/go-archaius v1.5.1/go.mod h1:QPwvvtBxvwiC48rmydoAqxopqOr93RCQ6syWsIkXPXQ= +github.com/go-chassis/go-chassis/v2 v2.3.0/go.mod h1:iyJ2DWSkqfnCmad/0Il9nXWHaob7RcwPGlIDRNxccH0= +github.com/go-chassis/go-restful-swagger20 v1.0.3/go.mod h1:eW62fYuzlNFDvIacB6AV8bhUDCTy4myfTCv0bT9Gbb0= +github.com/go-chassis/kie-client v0.0.0-20201210060018-938c7680a9ab/go.mod h1:UTdbtyN5ge/v9DmQzdVRxQP7z51Q4z6hyl+W6ZpUHFM= +github.com/go-chassis/openlog v1.1.2/go.mod h1:+eYCADVxWyJkwsFMUBrMxyQlNqW+UUsCxvR2LrYZUaA= +github.com/go-chassis/openlog v1.1.3 h1:XqIOvZ8YPJ9o9lLtLBskQNNWolK5kC6a4Sv7r4s9sZ4= +github.com/go-chassis/openlog v1.1.3/go.mod h1:+eYCADVxWyJkwsFMUBrMxyQlNqW+UUsCxvR2LrYZUaA= +github.com/go-chassis/sc-client v0.6.1-0.20210615014358-a45e9090c751/go.mod h1:TBS9g7OaIeu1OR/9tVPJEl6BgHFcYEdbuJlgVDQczbc= +github.com/go-chassis/sc-client v0.7.0 h1:c2LSdbFMuZ3RcbDu7So//kFCzjDCkzdQ0CNKhm8Dy7I= +github.com/go-chassis/sc-client v0.7.0/go.mod h1:DmclCLMhyNpYN42ae0f5AgiF4lTrpG6NyJJgmyAgC+E= +github.com/go-chassis/seclog v1.3.0/go.mod h1:a/zGvX5BRiwtq/O0fRqS6VWjrBaXYtqFJBx3EX9xzSE= +github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w= +github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.10.0 h1:dXFJfIHVvUcpSgDOV+Ne6t7jXri8Tfv2uOLHUZ2XNuo= +github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-kratos/aegis v0.1.2/go.mod h1:jYeSQ3Gesba478zEnujOiG5QdsyF3Xk/8owFUeKcHxw= +github.com/go-kratos/aegis v0.2.0 h1:dObzCDWn3XVjUkgxyBp6ZeWtx/do0DPZ7LY3yNSJLUQ= +github.com/go-kratos/aegis v0.2.0/go.mod h1:v0R2m73WgEEYB3XYu6aE2WcMwsZkJ/Rzuf5eVccm7bI= +github.com/go-kratos/kratos/contrib/config/apollo/v2 v2.0.0-20230519061918-96480c11ee42 h1:TvlB9uURr9gDmK3co24MrKMdAUzvVdEdcw+kdpasdGQ= +github.com/go-kratos/kratos/contrib/config/apollo/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:kQOEU+48HDXQyY+niLA3fAczwbEWbR6PIlpuoZoJewk= +github.com/go-kratos/kratos/contrib/config/consul/v2 v2.0.0-20230519061918-96480c11ee42 h1:rjzOgpwmC60uAFbo7V9PR0phfimNaWtSys2mYlo6fak= +github.com/go-kratos/kratos/contrib/config/consul/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:GumeFOPxBX0blR5I4T5C8Yw6VCf6dBNt9Ey2DmWbU2U= +github.com/go-kratos/kratos/contrib/config/etcd/v2 v2.0.0-20230519061918-96480c11ee42 h1:TwgumYYDlsgjCAJzQhR+IHqs8uvALWO/2zaIImxBJ4k= +github.com/go-kratos/kratos/contrib/config/etcd/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:Wxqd0+tez5dT4MIPJuVKYW2bEAZgzxuRkFUOPFQ5Myw= +github.com/go-kratos/kratos/contrib/config/kubernetes/v2 v2.0.0-20230519061918-96480c11ee42 h1:Fjf8mvuH3jd234U4EJ736d+Fgtvpaw4ZycscwVkqLaA= +github.com/go-kratos/kratos/contrib/config/kubernetes/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:JUzy8mAhZFpC0boXnK5eQQofzFzkigWulUjDf9zA/qk= +github.com/go-kratos/kratos/contrib/config/nacos/v2 v2.0.0-20230519061918-96480c11ee42 h1:3e82mLP1l7bOPI3lcf4b6s9kfrXaKjEfSIV3UK582UA= +github.com/go-kratos/kratos/contrib/config/nacos/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:MGczIUxDu+YAZWmuKQW5vES9eISFGJW9bbYcJ2VzQJA= +github.com/go-kratos/kratos/contrib/log/aliyun/v2 v2.0.0-20230519061918-96480c11ee42 h1:mvYeZ6gpNJMYvjr5ChkbQPuaSQZ/u0+ZBS0a54B8CgE= +github.com/go-kratos/kratos/contrib/log/aliyun/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:QNxIxFC3lDB+MNdiI1YU9O2F0RgsVE4pZP0sPpLwoLs= +github.com/go-kratos/kratos/contrib/log/fluent/v2 v2.0.0-20230519061918-96480c11ee42 h1:E+dZxXwGOwTH2/Nvwqpg7FMFc29IPP81lw/vmaceJn0= +github.com/go-kratos/kratos/contrib/log/fluent/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:9QgXn9PQ0IWWoXVlzb/GWVURsUutH1DkUJb4SCAa9ys= +github.com/go-kratos/kratos/contrib/log/logrus/v2 v2.0.0-20230519061918-96480c11ee42 h1:h89CTUYx/SyXkmFfIeQYNW8tjU4NkhtTO/GkMlD+CV4= +github.com/go-kratos/kratos/contrib/log/logrus/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:0apSUuIR6tr7/MlCDJ+qPO6Cy7aMtXEmL3Sh5tekd1w= +github.com/go-kratos/kratos/contrib/log/tencent/v2 v2.0.0-20230519061918-96480c11ee42 h1:lWdKU1pwNW2HufJyFh2QepEZzxbmDEj604mHwwSxpYI= +github.com/go-kratos/kratos/contrib/log/tencent/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:JUJcHcSvO41khLdgPRuoJa/bQcR6X0dL82hiBCbtHEM= +github.com/go-kratos/kratos/contrib/log/zap/v2 v2.0.0-20230519061918-96480c11ee42 h1:asznZDDYQzItDQCBeFxKGex11vyC6BU1JgZP+Wgt8ZM= +github.com/go-kratos/kratos/contrib/log/zap/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:mpWmmltg+ju0bFzUJGMo8+0Bx6mpfZ4ULTNC/VrATq0= +github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20230519061918-96480c11ee42 h1:VJhnXurxo13Jyk4EVQXzYO/3u/scDG2/QtRNuxznn7s= +github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:BI0LIs3jJw80l2onjjWDEn4TiHKrGJ0p9ORMGCIc1ko= +github.com/go-kratos/kratos/contrib/registry/etcd/v2 v2.0.0-20230519061918-96480c11ee42 h1:/OYtpk4jMOKrBtkFVCNsapqqjt5e0Hous+FXII8NwJs= +github.com/go-kratos/kratos/contrib/registry/etcd/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:Hw3swhxfr0NPYgEpsAkB4mwGZfVdz6XbeMMHkNXnjgk= +github.com/go-kratos/kratos/contrib/registry/eureka/v2 v2.0.0-20230519061918-96480c11ee42 h1:OFUR80Dx7n1gPPoF9qCwZrf2DuTIXz9Wn/oX0c7tWEY= +github.com/go-kratos/kratos/contrib/registry/eureka/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:Ak+GOAcZxa8c56+bh/5M9MXyiMibegr3dsLDzKSGn+E= +github.com/go-kratos/kratos/contrib/registry/kubernetes/v2 v2.0.0-20230519061918-96480c11ee42 h1:DEd6CA4UJDL0g/QFUCpNFedKgMr4vUczIgGUgqgJUG8= +github.com/go-kratos/kratos/contrib/registry/kubernetes/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:+eYCeF0F7Z6W6CjwftKnPYgoroxd3D1gacyr/PQ5fuc= +github.com/go-kratos/kratos/contrib/registry/nacos/v2 v2.0.0-20230519061918-96480c11ee42 h1:0B7m0Io2reL+yhg6fxxh2diJ0SaKYGxYMR85nkyxVro= +github.com/go-kratos/kratos/contrib/registry/nacos/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:6T9lKFjPyENu96KnNvVcVLlpy79mB5a0XwAA5cM2Kug= +github.com/go-kratos/kratos/contrib/registry/servicecomb/v2 v2.0.0-20230519061918-96480c11ee42 h1:DOV4MfEzElIctdTQHft8w2QAqzw1mqSmjHkmupBByLs= +github.com/go-kratos/kratos/contrib/registry/servicecomb/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:kPTtQIB8F0vBXJiGk7ZbGOBFmRUVPCJFQtP/oh8RZKA= +github.com/go-kratos/kratos/contrib/registry/zookeeper/v2 v2.0.0-20230519061918-96480c11ee42 h1:oVYxPHx3O8pGKxrZPJEKzBV0vIqNRraCvA91hI7wQ+4= +github.com/go-kratos/kratos/contrib/registry/zookeeper/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:ODxlfT8vbQe/r/FOlsanc0HUoyWfOK5nBbXd/MnoOYY= +github.com/go-kratos/kratos/v2 v2.3.1/go.mod h1:5acyLj4EgY428AJnZl2EwCrMV1OVlttQFBum+SghMiA= +github.com/go-kratos/kratos/v2 v2.6.2/go.mod h1:xTeAeI9iYBP8MauISfxmRGSmKdDTLRQ3rbarKYmt6P4= +github.com/go-kratos/kratos/v2 v2.6.3 h1:zuejN8CnszyMnbLWd7ObCN9rLuKucJe2/2P6hHpePDc= +github.com/go-kratos/kratos/v2 v2.6.3/go.mod h1:nlBMkZueZps7UaP3GdbqG8V8N/eAX0jh019OKSm4xew= +github.com/go-kratos/kratos/v2 v2.7.1 h1:PNMUaWxS5ZGDp1EyID5ZosJb1OA/YiHnBxB0yUmocnc= +github.com/go-kratos/kratos/v2 v2.7.1/go.mod h1:CPn82O93OLHjtnbuyOKhAG5TkSvw+mFnL32c4lZFDwU= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= +github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= +github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-openapi/inflect v0.19.0 h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNPXu/4= +github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4= +github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= +github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= +github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= +github.com/go-openapi/jsonreference v0.20.1 h1:FBLnyygC4/IZZr893oiomc9XaghoveYTrLC1F86HID8= +github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= +github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= +github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/form/v4 v4.2.0/go.mod h1:q1a2BY+AQUUzhl6xA/6hBetay6dEIhMHjgvJiGo6K7U= +github.com/go-playground/form/v4 v4.2.1 h1:HjdRDKO0fftVMU5epjPW2SOREcZ6/wLUzEobqUGJuPw= +github.com/go-playground/form/v4 v4.2.1/go.mod h1:q1a2BY+AQUUzhl6xA/6hBetay6dEIhMHjgvJiGo6K7U= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/validator v9.31.0+incompatible/go.mod h1:yrEkQXlcI+PugkyDjY2bRrL/UBU4f3rvrgkN3V8JEig= +github.com/go-redis/redis/extra/rediscmd/v8 v8.11.5 h1:ftG8tp8SG81xyuL2woNEx5t2RZ8mOJuC2+tumi+/NR8= +github.com/go-redis/redis/extra/rediscmd/v8 v8.11.5/go.mod h1:s9f/6bSbS5r/jC2ozpWhWZ2GsoHDNf6iL+kZKnZnasc= +github.com/go-redis/redis/extra/redisotel/v8 v8.11.5 h1:BqyYJgvdSr2S/6O2l7zmCj26ocUTxDLgagsGIRfkS+Q= +github.com/go-redis/redis/extra/redisotel/v8 v8.11.5/go.mod h1:LlDT9RRdBgOrMGvFjT/m1+GrZAmRlBaMcM3UXHPWf8g= +github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= +github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= +github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= +github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= +github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= +github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/go-zookeeper/zk v1.0.3 h1:7M2kwOsc//9VeeFiPtf+uSJlVpU66x9Ba5+8XK7/TDg= +github.com/go-zookeeper/zk v1.0.3/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= +github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= +github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= +github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= +github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= +github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= +github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= +github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= +github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= +github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= +github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= +github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= +github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= +github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= +github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= +github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= +github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0= +github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= +github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/golang-jwt/jwt/v4 v4.4.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= +github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= +github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= +github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= +github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= +github.com/google/gnostic v0.6.9 h1:ZK/5VhkoX835RikCHpSUJV9a+S3e1zLh59YnyWeBW+0= +github.com/google/gnostic v0.6.9/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= +github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= +github.com/google/subcommands v1.2.0 h1:vWQspBTo2nEqTUFita5/KeEWlUL8kQObDFbub/EN9oE= +github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/wire v0.5.0 h1:I7ELFeVBr3yfPIcc8+MWvrjk+3VjbcSzoXm3JVa+jD8= +github.com/google/wire v0.5.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU= +github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= +github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= +github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= +github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= +github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= +github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= +github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= +github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= +github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= +github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= +github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= +github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= +github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= +github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= +github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.4.3-0.20210424162022-e8629af678b7/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= +github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= +github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= +github.com/hashicorp/consul/api v1.20.0 h1:9IHTjNVSZ7MIwjlW3N3a7iGiykCMDpxZu8jsxFJh0yc= +github.com/hashicorp/consul/api v1.20.0/go.mod h1:nR64eD44KQ59Of/ECwt2vUmIK2DKsDzAwTmwmLl8Wpo= +github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= +github.com/hashicorp/consul/sdk v0.13.1 h1:EygWVWWMczTzXGpO93awkHFzfUka6hLYJ0qhETd+6lY= +github.com/hashicorp/consul/sdk v0.13.1/go.mod h1:SW/mM4LbKfqmMvcFu8v+eiQQ7oitXEFeiBe9StxERb0= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM= +github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.3.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= +github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI= +github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc= +github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= +github.com/hashicorp/go-version v1.0.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.2.1 h1:zEfKbn2+PDgroKdiOzqiE8rsmLqU2uwi5PB5pBJ3TkI= +github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/hcl/v2 v2.16.2 h1:mpkHZh/Tv+xet3sy3F9Ld4FyI2tUpWe9x3XtPx9f1a0= +github.com/hashicorp/hcl/v2 v2.16.2/go.mod h1:JRmR89jycNkrrqnMmvPDMd56n1rQJ2Q6KocSLCMCXng= +github.com/hashicorp/hcl/v2 v2.18.0/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE= +github.com/hashicorp/hcl/v2 v2.19.1/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= +github.com/hashicorp/memberlist v0.5.0 h1:EtYPN8DpAURiapus508I4n9CzHs2W+8NZGbmmR/prTM= +github.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4mHgHUZ8lrOI0= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= +github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= +github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY= +github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= +github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= +github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= +github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= +github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= +github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= +github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= +github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= +github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= +github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= +github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= +github.com/jackc/pgconn v1.14.0 h1:vrbA9Ud87g6JdFWkHTJXppVce58qPIdP7N8y0Ml/A7Q= +github.com/jackc/pgconn v1.14.0/go.mod h1:9mBNlny0UvkgJdCDvdVHYSjI+8tD2rnKK69Wz8ti++E= +github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= +github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= +github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= +github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= +github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 h1:DadwsjnMwFjfWc9y5Wi/+Zz7xoE5ALHsRQlOctkOiHc= +github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= +github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= +github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.3.2 h1:7eY55bdBeCz1F2fTzSz69QC+pG46jYq9/jtSPiJ5nn0= +github.com/jackc/pgproto3/v2 v2.3.2/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= +github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= +github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= +github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= +github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= +github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= +github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= +github.com/jackc/pgtype v1.14.0 h1:y+xUdabmyMkJLyApYuPj38mW+aAIqCe5uuBB51rH3Vw= +github.com/jackc/pgtype v1.14.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= +github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= +github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= +github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= +github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= +github.com/jackc/pgx/v4 v4.18.1 h1:YP7G1KABtKpB5IHrO9vYwSrCOhs7p3uqhvhhQBptya0= +github.com/jackc/pgx/v4 v4.18.1/go.mod h1:FydWkUyadDmdNH/mHnGob881GawxeEm7TcMCzkb+qQE= +github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.3.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869/go.mod h1:cJ6Cj7dQo+O6GJNiMx+Pa94qKj+TG8ONdKHgMNIyyag= +github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= +github.com/jhump/protoreflect v1.15.2/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= +github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/karlseguin/ccache/v2 v2.0.8 h1:lT38cE//uyf6KcFok0rlgXtGFBWxkI6h/qg4tbFyDnA= +github.com/karlseguin/ccache/v2 v2.0.8/go.mod h1:2BDThcfQMf/c0jnZowt16eW405XIqZPavt+HoYEtcxQ= +github.com/karlseguin/expect v1.0.2-0.20190806010014-778a5f0c6003 h1:vJ0Snvo+SLMY72r5J4sEfkuE7AFbixEP2qRbEcum/wA= +github.com/karlseguin/expect v1.0.2-0.20190806010014-778a5f0c6003/go.mod h1:zNBxMY8P21owkeogJELCLeHIt+voOSduHYTFUbwRAV8= +github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= +github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.15.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= +github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= +github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4= +github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/lestrrat/go-envload v0.0.0-20180220120943-6ed08b54a570/go.mod h1:BLt8L9ld7wVsvEWQbuLrUZnCMnUmLZ+CGDzKtclrTlE= +github.com/lestrrat/go-file-rotatelogs v0.0.0-20180223000712-d3151e2a480f/go.mod h1:UGmTpUd3rjbtfIpwAPrcfmGf/Z1HS95TATB+m57TPB8= +github.com/lestrrat/go-strftime v0.0.0-20180220042222-ba3bf9c1d042/go.mod h1:TPpsiPUEh0zFL1Snz4crhMlBe60PYxRHr5oFF3rRYg0= +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= +github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= +github.com/little-cui/etcdadpt v0.3.2/go.mod h1:HnRRpIrVEVNWobkiCvG2EHLWKKZ+L047EcI29ma2zA4= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= +github.com/lufia/plan9stats v0.0.0-20230110061619-bbe2e5e100de h1:V53FWzU6KAZVi1tPp5UIsMoUWJ2/PNwYIDXnu7QuBCE= +github.com/lufia/plan9stats v0.0.0-20230110061619-bbe2e5e100de/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lufia/plan9stats v0.0.0-20230326075908-cb1d2100619a/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= +github.com/lyft/protoc-gen-star v0.6.1/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= +github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= +github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= +github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= +github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= +github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY= +github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= +github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= +github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= +github.com/minio/minio-go/v7 v7.0.53 h1:qtPyQ+b0Cc1ums3LsnVMAYULPNdAGz8qdX8R2zl9XMU= +github.com/minio/minio-go/v7 v7.0.53/go.mod h1:IbbodHyjUAguneyucUaahv+VMNs/EOTV9du7A7/Z3HU= +github.com/minio/sha256-simd v1.0.0 h1:v1ta+49hkWZyvaKwrQB8elexRqm6Y0aMLjCNsrYxo6g= +github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= +github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= +github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/nacos-group/nacos-sdk-go v1.0.9/go.mod h1:hlAPn3UdzlxIlSILAyOXKxjFSvDJ9oLzTJ9hLAK1KzA= +github.com/nacos-group/nacos-sdk-go v1.1.4 h1:qyrZ7HTWM4aeymFfqnbgNRERh7TWuER10pCB7ddRcTY= +github.com/nacos-group/nacos-sdk-go v1.1.4/go.mod h1:cBv9wy5iObs7khOqov1ERFQrCuTR4ILpgaiaVMxEmGI= +github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= +github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= +github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= +github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= +github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= +github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= +github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU= +github.com/onsi/ginkgo/v2 v2.1.6/go.mod h1:MEH45j8TBi6u9BMogfbp0stKC5cdGjumZj5Y7AG4VIk= +github.com/onsi/ginkgo/v2 v2.3.0/go.mod h1:Eew0uilEqZmIEZr8JrvYlvOM7Rr6xzTmMV8AyFNU9d0= +github.com/onsi/ginkgo/v2 v2.4.0/go.mod h1:iHkDK1fKGcBoEHT5W7YBq4RFWaQulw+caOMkAt4OrFo= +github.com/onsi/ginkgo/v2 v2.9.1 h1:zie5Ly042PD3bsCvsSOPvRnFwyo3rKe64TJlD6nu0mk= +github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= +github.com/onsi/gomega v1.20.1/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= +github.com/onsi/gomega v1.21.1/go.mod h1:iYAIXgPSaDHak0LCMA+AWBpIKBr8WZicMxnE8luStNc= +github.com/onsi/gomega v1.22.1/go.mod h1:x6n7VNe4hw0vkyYUM4mjIXx3JbLiPaBPNgB7PRQ1tuM= +github.com/onsi/gomega v1.23.0/go.mod h1:Z/NWtiqwBrwUt4/2loMmHL63EDLnYHmVbuBpDr2vQAg= +github.com/onsi/gomega v1.27.4 h1:Z2AnStgsdSayCMDiCU42qIz+HLqEPcgiOCXjAU/w+8E= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= +github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= +github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= +github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= +github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/openzipkin/zipkin-go v0.4.1 h1:kNd/ST2yLLWhaWrkgchya40TJabe8Hioj9udfPcEO5A= +github.com/openzipkin/zipkin-go v0.4.1/go.mod h1:qY0VqDSN1pOBN94dBc6w2GJlWLiovAyg7Qt6/I9HecM= +github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= +github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= +github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= +github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pelletier/go-toml/v2 v2.0.0-beta.8 h1:dy81yyLYJDwMTifq24Oi/IslOslRrDSb3jwDggjz3Z0= +github.com/pelletier/go-toml/v2 v2.0.0-beta.8/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= +github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= +github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/philhofer/fwd v1.1.1 h1:GdGcTjf5RNAxwS4QLsiMzJYj5KEvPJD3Abr261yRQXQ= +github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= +github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4 v2.6.0+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM= +github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= +github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b h1:0LFwY6Q3gMACTjAbMZBjXAqTOzOwFaj2Ld6cjeQ7Rig= +github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= +github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= +github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= +github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= +github.com/rs/xid v1.4.0 h1:qd7wPTDkN6KQx2VmMBLrpHkiyQwgFXRnkOLacUiaSNY= +github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= +github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/crypt v0.5.0/go.mod h1:l+nzl7KWh51rpzp2h7t4MZWyiEWdhNpOAnclKvg+mdA= +github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= +github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/shirou/gopsutil/v3 v3.21.8/go.mod h1:YWp/H8Qs5fVmf17v7JNZzA0mPJ+mS2e9JdiUF9LlKzQ= +github.com/shirou/gopsutil/v3 v3.23.2 h1:PAWSuiAszn7IhPMBtXsbSCafej7PqUOvY6YywlQUExU= +github.com/shirou/gopsutil/v3 v3.23.2/go.mod h1:gv0aQw33GLo3pG8SiWKiQrbDzbRY1K80RyZJ7V4Th1M= +github.com/shirou/gopsutil/v3 v3.23.6/go.mod h1:j7QX50DrXYggrpN30W0Mo+I4/8U2UUIQrnrhqUeWrAU= +github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= +github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= +github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= +github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.9.2 h1:oxx1eChJGI6Uks2ZC4W1zpLlVgqB8ner4EuQwV4Ik1Y= +github.com/sirupsen/logrus v1.9.2/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= +github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= +github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= +github.com/spf13/afero v1.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw= +github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= +github.com/spf13/cast v1.2.0/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA= +github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= +github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= +github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/spf13/viper v1.11.0 h1:7OX/1FS6n7jHD1zGrZTM7WtY13ZELRyosK4k93oPr44= +github.com/spf13/viper v1.11.0/go.mod h1:djo0X/bA5+tYVoCn+C7cAYJGcVn/qYLFTG8gdUsX7Zk= +github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= +github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/tebeka/strftime v0.1.3/go.mod h1:7wJm3dZlpr4l/oVK0t1HYIc4rMzQ2XJlOMIUJUJH6XQ= +github.com/tencentcloud/tencentcloud-cls-sdk-go v1.0.2 h1:29QoDxUqlFWd0Pgyt4lqGTGMNvJGxVQ3lRx1haRaPnw= +github.com/tencentcloud/tencentcloud-cls-sdk-go v1.0.2/go.mod h1:WU+0TXfVbSctEsUUf4KmIKnfr+tknbjcsnx/TrEIPH4= +github.com/tevid/gohamcrest v1.1.1 h1:ou+xSqlIw1xfGTg1uq1nif/htZ2S3EzRqLm2BP+tYU0= +github.com/tevid/gohamcrest v1.1.1/go.mod h1:3UvtWlqm8j5JbwYZh80D/PVBt0mJ1eJiYgZMibh0H/k= +github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/tinylib/msgp v1.1.6 h1:i+SbKraHhnrf9M5MYmvQhFnbLhAXSDWF8WWsuyRdocw= +github.com/tinylib/msgp v1.1.6/go.mod h1:75BAfg2hauQhs3qedfdDZmWAPcFMAvJE5b9rGOMufyw= +github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs= +github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM= +github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI= +github.com/tklauser/numcpus v0.3.0/go.mod h1:yFGUr7TUHQRAhyqBcEg0Ge34zDBAsIvJJcyE6boqnA8= +github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYms= +github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4= +github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= +github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/toolkits/concurrent v0.0.0-20150624120057-a4371d70e3e3/go.mod h1:QDlpd3qS71vYtakd2hmdpqhJ9nwv6mD6A30bQ1BPBFE= +github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/twmb/murmur3 v1.1.6/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ= +github.com/tx7do/kratos-utils v0.0.0-20230523004815-97a553d22f52 h1:83y6QqHY9gX8OCzvLICySkEwAsPflT7jmGNJxVL3jYA= +github.com/tx7do/kratos-utils v0.0.0-20230523004815-97a553d22f52/go.mod h1:iDoQXF+37VqMnJ8UJcxGyBr2qxixiUiUGXlQvYoCzkY= +github.com/tx7do/kratos-utils v0.0.0-20231024141829-5b2a7ab92223 h1:LapVgerDpOtrkvISivndbNz9q6x3+p8pF0cMINDLcPo= +github.com/tx7do/kratos-utils v0.0.0-20231024141829-5b2a7ab92223/go.mod h1:YSJwjH2sJHzt0i8UXL1IIk7TFjgdLPqZ7jl4THgsbrg= +github.com/tx7do/kratos-utils v0.0.0-20231025061804-798ccd50d6fb h1:OBxqR5x8tS+v4ZWNbkqfTbFEhfAVuPLke6UdOGh0rhM= +github.com/tx7do/kratos-utils v0.0.0-20231025061804-798ccd50d6fb/go.mod h1:rTeeqeABjK9HamIwKZ+uLozVIk/hGiEbNsi6rVr4l0w= +github.com/tx7do/kratos-utils/entgo v0.0.0-20231025061804-798ccd50d6fb h1:XfDDv7JGDIPRu4YxF+48spCNJJX+bDBbZlkxzdwlrUw= +github.com/tx7do/kratos-utils/entgo v0.0.0-20231025061804-798ccd50d6fb/go.mod h1:9FE/T//UNa6zFaN9bSf94j3Ga3VEGJ77sNmMrU8gb5E= +github.com/tx7do/kratos-utils/entgo v0.0.0-20231025062829-f8eedb020b71 h1:JAHNW0dB60uGu6orh0YVBLRPg6maDQm52eZxKv3jSJg= +github.com/tx7do/kratos-utils/entgo v0.0.0-20231025062829-f8eedb020b71/go.mod h1:9FE/T//UNa6zFaN9bSf94j3Ga3VEGJ77sNmMrU8gb5E= +github.com/tx7do/kratos-utils/entgo v0.0.0-20231025063335-8807fc25ca22 h1:T9W6LW7HZh4uOsFV/J4wZMWu62ar6/KBOgM0hiuKBS8= +github.com/tx7do/kratos-utils/entgo v0.0.0-20231025063335-8807fc25ca22/go.mod h1:9FE/T//UNa6zFaN9bSf94j3Ga3VEGJ77sNmMrU8gb5E= +github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/wsxiaoys/terminal v0.0.0-20160513160801-0940f3fc43a0 h1:3UeQBvD0TFrlVjOeLOBz+CPAI8dnbqNSVwUwRrkp7vQ= +github.com/wsxiaoys/terminal v0.0.0-20160513160801-0940f3fc43a0/go.mod h1:IXCdmsXIht47RaVFLEdVnh1t+pgYtTAhQGj73kz+2DM= +github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= +github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= +github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= +github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= +github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +github.com/zclconf/go-cty v1.13.1 h1:0a6bRwuiSHtAmqCqNOE+c2oHgepv0ctoxU4FUe43kwc= +github.com/zclconf/go-cty v1.13.1/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= +github.com/zclconf/go-cty v1.14.0/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zclconf/go-cty v1.14.1/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= +github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= +go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= +go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/api/v3 v3.5.2/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= +go.etcd.io/etcd/api/v3 v3.5.8/go.mod h1:uyAal843mC8uUVSLWz6eHa/d971iDGnCRpmKd2Z+X8k= +go.etcd.io/etcd/api/v3 v3.5.9 h1:4wSsluwyTbGGmyjJktOf3wFQoTBIURXHnq9n/G/JQHs= +go.etcd.io/etcd/api/v3 v3.5.9/go.mod h1:uyAal843mC8uUVSLWz6eHa/d971iDGnCRpmKd2Z+X8k= +go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/pkg/v3 v3.5.2/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/pkg/v3 v3.5.8/go.mod h1:y+CzeSmkMpWN2Jyu1npecjB9BBnABxGM4pN8cGuJeL4= +go.etcd.io/etcd/client/pkg/v3 v3.5.9 h1:oidDC4+YEuSIQbsR94rY9gur91UPL6DnxDCIYd2IGsE= +go.etcd.io/etcd/client/pkg/v3 v3.5.9/go.mod h1:y+CzeSmkMpWN2Jyu1npecjB9BBnABxGM4pN8cGuJeL4= +go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= +go.etcd.io/etcd/client/v2 v2.305.2/go.mod h1:2D7ZejHVMIfog1221iLSYlQRzrtECw3kz4I4VAQm3qI= +go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lLS/oTh0= +go.etcd.io/etcd/client/v3 v3.5.8/go.mod h1:idZYIPVkttBJBiRigkB5EM0MmEyx8jcl18zCV3F5noc= +go.etcd.io/etcd/client/v3 v3.5.9 h1:r5xghnU7CwbUxD/fbUtRyJGaYNfDun8sp/gTr1hew6E= +go.etcd.io/etcd/client/v3 v3.5.9/go.mod h1:i/Eo5LrZ5IKqpbtpPDuaUnDOUv471oDg8cjQaUr2MbA= +go.etcd.io/etcd/pkg/v3 v3.5.0/go.mod h1:UzJGatBQ1lXChBkQF0AuAtkRQMYnHubxAEYIrC3MSsE= +go.etcd.io/etcd/raft/v3 v3.5.0/go.mod h1:UFOHSIvO/nKwd4lhkwabrTD3cqW5yVyYYf/KlD00Szc= +go.etcd.io/etcd/server/v3 v3.5.0/go.mod h1:3Ah5ruV+M+7RZr0+Y/5mNLwC+eQlni+mQmOVdCRJoS4= +go.mongodb.org/mongo-driver v1.5.1/go.mod h1:gRXCHX4Jo7J0IJ1oDQyUxF7jfy19UfxniMS4xxMmUqw= +go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E= +go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= +go.opentelemetry.io/otel v1.4.1/go.mod h1:StM6F/0fSwpd8dKWDCdRr7uRvEPYdW0hBSlbdTiUde4= +go.opentelemetry.io/otel v1.5.0/go.mod h1:Jm/m+rNp/z0eqJc74H7LPwQ3G87qkU/AnnAydAjSAHk= +go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk= +go.opentelemetry.io/otel v1.16.0 h1:Z7GVAX/UkAXPKsy94IU+i6thsQS4nb7LviLpnaNeW8s= +go.opentelemetry.io/otel v1.16.0/go.mod h1:vl0h9NUa1D5s1nv3A5vZOYWn8av4K8Ml6JDeHrT/bx4= +go.opentelemetry.io/otel/exporters/jaeger v1.16.0 h1:YhxxmXZ011C0aDZKoNw+juVWAmEfv/0W2XBOv9aHTaA= +go.opentelemetry.io/otel/exporters/jaeger v1.16.0/go.mod h1:grYbBo/5afWlPpdPZYhyn78Bk04hnvxn2+hvxQhKIQM= +go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM= +go.opentelemetry.io/otel/exporters/zipkin v1.16.0 h1:WdMSH6vIJ+myJfr/HB/pjsYoJWQP0Wz/iJ1haNO5hX4= +go.opentelemetry.io/otel/exporters/zipkin v1.16.0/go.mod h1:QjDOKdylighHJBc7pf4Vo6fdhtiEJEqww/3Df8TOWjo= +go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= +go.opentelemetry.io/otel/metric v1.16.0 h1:RbrpwVG1Hfv85LgnZ7+txXioPDoh6EdbZHo26Q3hqOo= +go.opentelemetry.io/otel/metric v1.16.0/go.mod h1:QE47cpOmkwipPiefDwo2wDzwJrlfxxNYodqc4xnGCo4= +go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= +go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= +go.opentelemetry.io/otel/sdk v1.4.1/go.mod h1:NBwHDgDIBYjwK2WNu1OPgsIc2IJzmBXNnvIJxJc8BpE= +go.opentelemetry.io/otel/sdk v1.7.0/go.mod h1:uTEOTwaqIVuTGiJN7ii13Ibp75wJmYUDe374q6cZwUU= +go.opentelemetry.io/otel/sdk v1.16.0 h1:Z1Ok1YsijYL0CSJpHt4cS3wDDh7p572grzNrBMiMWgE= +go.opentelemetry.io/otel/sdk v1.16.0/go.mod h1:tMsIuKXuuIWPBAOrH+eHtvhTL+SntFtXF9QD68aP6p4= +go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE= +go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE= +go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= +go.opentelemetry.io/otel/trace v1.4.1/go.mod h1:iYEVbroFCNut9QkwEczV9vMRPHNKSSwYZjulEtsmhFc= +go.opentelemetry.io/otel/trace v1.5.0/go.mod h1:sq55kfhjXYr1zVSyexg0w1mpa03AYXR5eyTkB9NPPdE= +go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU= +go.opentelemetry.io/otel/trace v1.16.0 h1:8JRpaObFoW0pxuVPapkgH8UhHQj+bJW8jJsCZEu5MQs= +go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= +go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= +go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/ratelimit v0.1.0/go.mod h1:2X8KaoNd1J0lZV+PxJk/5+DGbO/tpwLR1m++a7FnB/Y= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= +go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= +go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY= +go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= +go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= +golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= +golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= +golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= +golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= +golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= +golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= +golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= +golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= +golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= +golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= +golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.9.0 h1:GRRCnKYhdQrD8kfRAdQ6Zcw1P0OcELxGLKJvtjVMZ28= +golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= +golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= +golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20220922220347-f3bd1da661af/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.1.0 h1:xYY+Bajn2a7VBmTM5GikTmnK8ZuX8YgnQCqZpbBNtmA= +golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= +golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= +golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= +golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= +golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= +google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= +google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= +google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= +google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= +google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= +google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= +google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= +google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= +google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= +google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= +google.golang.org/api v0.77.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= +google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= +google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= +google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= +google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= +google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI= +google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.99.0/go.mod h1:1YOf74vkVndF7pG6hIHuINsM7eWwpVTAfNMNiL91A08= +google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= +google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo= +google.golang.org/api v0.103.0/go.mod h1:hGtW6nK1AC+d9si/UBhw8Xli+QMOf6xyNAyJw4qU9w0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= +google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= +google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220722212130-b98a9ff5e252/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= +google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220817144833-d7fd3f11b9b1/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220829144015-23454907ede3/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220829175752-36a9c930ecbf/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220913154956-18f8339a66a5/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220914142337-ca0e39ece12f/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220916172020-2692e8806bfa/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220919141832-68c03719ef51/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006/go.mod h1:ht8XFiar2npT/g4vkk7O0WYS1sHOHbdujxbEp7CJWbw= +google.golang.org/genproto v0.0.0-20220926165614-551eb538f295/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= +google.golang.org/genproto v0.0.0-20220926220553-6981cbe3cfce/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= +google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqwhZAwq4wsRUaVG555sVgsNmIjRtO7t/JH29U= +google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= +google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= +google.golang.org/genproto v0.0.0-20221024153911-1573dae28c9c/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= +google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= +google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo= +google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221117204609-8f9c96812029/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd/go.mod h1:cTsE614GARnxrLsqKREzmNYJACSWWpAWdNMwnD7c2BE= +google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc h1:8DyZCyvI8mE1IdLy/60bS+52xfymkE72wv1asokgtao= +google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= +google.golang.org/genproto v0.0.0-20230629202037-9506855d4529/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= +google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc h1:kVKPf/IiYSBWEWtkIn6wZXwWGCnLKcC8oWfZvXjsGnM= +google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= +google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230629202037-9506855d4529/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= +google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= +google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= +google.golang.org/grpc v1.56.1 h1:z0dNfjIl0VpaZ9iSVjA6daGatAYwPGstTjt5vkRMFkQ= +google.golang.org/grpc v1.56.1/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= +google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= +gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= +gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= +gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= +gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= +gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +k8s.io/api v0.17.0/go.mod h1:npsyOePkeP0CPwyGfXDHxvypiYMJxBWAMpQxCaJ4ZxI= +k8s.io/api v0.24.3/go.mod h1:elGR/XSZrS7z7cSZPzVWaycpJuGIw57j9b95/1PdJNI= +k8s.io/api v0.26.3/go.mod h1:PXsqwPMXBSBcL1lJ9CYDKy7kIReUydukS5JiRlxC3qE= +k8s.io/api v0.27.2 h1:+H17AJpUMvl+clT+BPnKf0E3ksMAzoBBg7CntpSuADo= +k8s.io/api v0.27.2/go.mod h1:ENmbocXfBT2ADujUXcBhHV55RIT31IIEvkntP6vZKS4= +k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= +k8s.io/apimachinery v0.24.3/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= +k8s.io/apimachinery v0.26.3/go.mod h1:ats7nN1LExKHvJ9TmwootT00Yz05MuYqPXEXaVeOy5I= +k8s.io/apimachinery v0.27.2 h1:vBjGaKKieaIreI+oQwELalVG4d8f3YAMNpWLzDXkxeg= +k8s.io/apimachinery v0.27.2/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E= +k8s.io/client-go v0.17.0/go.mod h1:TYgR6EUHs6k45hb6KWjVD6jFZvJV4gHDikv/It0xz+k= +k8s.io/client-go v0.24.3/go.mod h1:AAovolf5Z9bY1wIg2FZ8LPQlEdKHjLI7ZD4rw920BJw= +k8s.io/client-go v0.26.3/go.mod h1:ZPNu9lm8/dbRIPAgteN30RSXea6vrCpFvq+MateTUuQ= +k8s.io/client-go v0.27.2 h1:vDLSeuYvCHKeoQRhCXjxXO45nHVv2Ip4Fe0MfioMrhE= +k8s.io/client-go v0.27.2/go.mod h1:tY0gVmUsHrAmjzHX9zs7eCjxcBsf8IiNe7KQ52biTcQ= +k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= +k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= +k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= +k8s.io/klog/v2 v2.60.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw= +k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= +k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42/go.mod h1:Z/45zLw8lUo4wdiUkI+v/ImEGAvu3WatcZl3lPMR4Rk= +k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4= +k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg= +k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg= +k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20221107191617-1a15be271d1d/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY= +k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2/go.mod h1:B+TnT182UBxE84DiCz4CVE26eOSDAeYCpfDnC2kdKMY= +sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= +sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= +sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= +sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/orm/ent/pkg/README.md b/orm/ent/pkg/README.md new file mode 100644 index 0000000..d28623c --- /dev/null +++ b/orm/ent/pkg/README.md @@ -0,0 +1 @@ +# common used packages \ No newline at end of file diff --git a/orm/ent/pkg/bootstrap/bootstrap.go b/orm/ent/pkg/bootstrap/bootstrap.go new file mode 100644 index 0000000..a2d7ae0 --- /dev/null +++ b/orm/ent/pkg/bootstrap/bootstrap.go @@ -0,0 +1,35 @@ +package bootstrap + +import ( + "github.com/go-kratos/kratos/v2/log" + "github.com/go-kratos/kratos/v2/registry" + + "kratos-ent-example/gen/api/go/common/conf" +) + +// Bootstrap 应用引导启动 +func Bootstrap(serviceInfo *ServiceInfo) (*conf.Bootstrap, log.Logger, registry.Registrar) { + // inject command flags + Flags := NewCommandFlags() + Flags.Init() + + // load configs + cfg := LoadBootstrapConfig(Flags.Conf) + if cfg == nil { + panic("load config failed") + } + + // init logger + ll := NewLoggerProvider(cfg.Logger, serviceInfo) + + // init registrar + reg := NewRegistry(cfg.Registry) + + // init tracer + err := NewTracerProvider(cfg.Trace, serviceInfo) + if err != nil { + panic(err) + } + + return cfg, ll, reg +} diff --git a/orm/ent/pkg/bootstrap/cli.go b/orm/ent/pkg/bootstrap/cli.go new file mode 100644 index 0000000..eda1386 --- /dev/null +++ b/orm/ent/pkg/bootstrap/cli.go @@ -0,0 +1,14 @@ +package bootstrap + +// FIX: missing go.sum entry for module providing package XXXXXXXXXXXXXXXXXXXXX + +import ( + // wire + _ "github.com/google/subcommands" + _ "golang.org/x/tools/go/ast/astutil" + _ "golang.org/x/tools/go/packages" + + // ent + _ "github.com/olekukonko/tablewriter" + _ "github.com/spf13/cobra" +) diff --git a/orm/ent/pkg/bootstrap/config.go b/orm/ent/pkg/bootstrap/config.go new file mode 100644 index 0000000..14e8f76 --- /dev/null +++ b/orm/ent/pkg/bootstrap/config.go @@ -0,0 +1,323 @@ +package bootstrap + +import ( + "os" + "path/filepath" + "strings" + + "google.golang.org/grpc" + + "github.com/go-kratos/kratos/v2/config" + "github.com/go-kratos/kratos/v2/log" + + // file + fileKratos "github.com/go-kratos/kratos/v2/config/file" + + // etcd + etcdKratos "github.com/go-kratos/kratos/contrib/config/etcd/v2" + etcdClient "go.etcd.io/etcd/client/v3" + + // consul + consulKratos "github.com/go-kratos/kratos/contrib/config/consul/v2" + consulApi "github.com/hashicorp/consul/api" + + // nacos + nacosKratos "github.com/go-kratos/kratos/contrib/config/nacos/v2" + nacosClients "github.com/nacos-group/nacos-sdk-go/clients" + nacosConstant "github.com/nacos-group/nacos-sdk-go/common/constant" + nacosVo "github.com/nacos-group/nacos-sdk-go/vo" + + // apollo + apolloKratos "github.com/go-kratos/kratos/contrib/config/apollo/v2" + + // kubernetes + k8sKratos "github.com/go-kratos/kratos/contrib/config/kubernetes/v2" + k8sUtil "k8s.io/client-go/util/homedir" + + "kratos-ent-example/gen/api/go/common/conf" +) + +const remoteConfigSourceConfigFile = "remote.yaml" + +// NewConfigProvider 创建一个配置 +func NewConfigProvider(configPath string) config.Config { + err, rc := LoadRemoteConfigSourceConfigs(configPath) + if err != nil { + log.Error("LoadRemoteConfigSourceConfigs: ", err.Error()) + } + if rc != nil { + return config.New( + config.WithSource( + NewFileConfigSource(configPath), + NewRemoteConfigSource(rc), + ), + ) + } else { + return config.New( + config.WithSource( + NewFileConfigSource(configPath), + ), + ) + } +} + +// LoadBootstrapConfig 加载程序引导配置 +func LoadBootstrapConfig(configPath string) *conf.Bootstrap { + cfg := NewConfigProvider(configPath) + if err := cfg.Load(); err != nil { + panic(err) + } + + var bc conf.Bootstrap + if err := cfg.Scan(&bc); err != nil { + panic(err) + } + + if bc.Server == nil { + bc.Server = &conf.Server{} + _ = cfg.Scan(&bc.Server) + } + + if bc.Client == nil { + bc.Client = &conf.Client{} + _ = cfg.Scan(&bc.Client) + } + + if bc.Data == nil { + bc.Data = &conf.Data{} + _ = cfg.Scan(&bc.Data) + } + + if bc.Trace == nil { + bc.Trace = &conf.Tracer{} + _ = cfg.Scan(&bc.Trace) + } + + if bc.Logger == nil { + bc.Logger = &conf.Logger{} + _ = cfg.Scan(&bc.Logger) + } + + if bc.Registry == nil { + bc.Registry = &conf.Registry{} + _ = cfg.Scan(&bc.Registry) + } + + if bc.Oss == nil { + bc.Oss = &conf.OSS{} + _ = cfg.Scan(&bc.Oss) + } + + return &bc +} + +func pathExists(path string) bool { + _, err := os.Stat(path) + if err == nil { + return true + } + if os.IsNotExist(err) { + return false + } + return false +} + +// LoadRemoteConfigSourceConfigs 加载远程配置源的本地配置 +func LoadRemoteConfigSourceConfigs(configPath string) (error, *conf.RemoteConfig) { + configPath = configPath + "/" + remoteConfigSourceConfigFile + if !pathExists(configPath) { + return nil, nil + } + + cfg := config.New( + config.WithSource( + NewFileConfigSource(configPath), + ), + ) + defer func(cfg config.Config) { + err := cfg.Close() + if err != nil { + panic(err) + } + }(cfg) + + var err error + + if err = cfg.Load(); err != nil { + return err, nil + } + + var rc conf.Bootstrap + if err = cfg.Scan(&rc); err != nil { + return err, nil + } + + return nil, rc.Config +} + +type ConfigType string + +const ( + ConfigTypeLocalFile ConfigType = "file" + ConfigTypeNacos ConfigType = "nacos" + ConfigTypeConsul ConfigType = "consul" + ConfigTypeEtcd ConfigType = "etcd" + ConfigTypeApollo ConfigType = "apollo" + ConfigTypeKubernetes ConfigType = "kubernetes" + ConfigTypePolaris ConfigType = "polaris" +) + +// NewRemoteConfigSource 创建一个远程配置源 +func NewRemoteConfigSource(c *conf.RemoteConfig) config.Source { + switch ConfigType(c.Type) { + default: + fallthrough + case ConfigTypeLocalFile: + return nil + case ConfigTypeNacos: + return NewNacosConfigSource(c) + case ConfigTypeConsul: + return NewConsulConfigSource(c) + case ConfigTypeEtcd: + return NewEtcdConfigSource(c) + case ConfigTypeApollo: + return NewApolloConfigSource(c) + case ConfigTypeKubernetes: + return NewKubernetesConfigSource(c) + case ConfigTypePolaris: + return NewPolarisConfigSource(c) + } +} + +// getConfigKey 获取合法的配置名 +func getConfigKey(configKey string, useBackslash bool) string { + if useBackslash { + return strings.Replace(configKey, `.`, `/`, -1) + } else { + return configKey + } +} + +// NewFileConfigSource 创建一个本地文件配置源 +func NewFileConfigSource(filePath string) config.Source { + return fileKratos.NewSource(filePath) +} + +// NewNacosConfigSource 创建一个远程配置源 - Nacos +func NewNacosConfigSource(c *conf.RemoteConfig) config.Source { + srvConf := []nacosConstant.ServerConfig{ + *nacosConstant.NewServerConfig(c.Nacos.Address, c.Nacos.Port), + } + + cliConf := nacosConstant.ClientConfig{ + TimeoutMs: 10 * 1000, // http请求超时时间,单位毫秒 + BeatInterval: 5 * 1000, // 心跳间隔时间,单位毫秒 + UpdateThreadNum: 20, // 更新服务的线程数 + LogLevel: "debug", + CacheDir: "../../configs/cache", // 缓存目录 + LogDir: "../../configs/log", // 日志目录 + NotLoadCacheAtStart: true, // 在启动时不读取本地缓存数据,true--不读取,false--读取 + UpdateCacheWhenEmpty: true, // 当服务列表为空时是否更新本地缓存,true--更新,false--不更新 + } + + nacosClient, err := nacosClients.NewConfigClient( + nacosVo.NacosClientParam{ + ClientConfig: &cliConf, + ServerConfigs: srvConf, + }, + ) + if err != nil { + log.Fatal(err) + } + + return nacosKratos.NewConfigSource(nacosClient, + nacosKratos.WithGroup(getConfigKey(c.Nacos.Key, false)), + nacosKratos.WithDataID("bootstrap.yaml"), + ) +} + +// NewEtcdConfigSource 创建一个远程配置源 - Etcd +func NewEtcdConfigSource(c *conf.RemoteConfig) config.Source { + cfg := etcdClient.Config{ + Endpoints: c.Etcd.Endpoints, + DialTimeout: c.Etcd.Timeout.AsDuration(), + DialOptions: []grpc.DialOption{grpc.WithBlock()}, + } + + cli, err := etcdClient.New(cfg) + if err != nil { + panic(err) + } + + source, err := etcdKratos.New(cli, etcdKratos.WithPath(getConfigKey(c.Etcd.Key, true))) + if err != nil { + log.Fatal(err) + } + + return source +} + +// NewConsulConfigSource 创建一个远程配置源 - Consul +func NewConsulConfigSource(c *conf.RemoteConfig) config.Source { + cfg := consulApi.DefaultConfig() + cfg.Address = c.Consul.Address + cfg.Scheme = c.Consul.Scheme + + cli, err := consulApi.NewClient(cfg) + if err != nil { + log.Fatal(err) + } + + source, err := consulKratos.New(cli, + consulKratos.WithPath(getConfigKey(c.Consul.Key, true)), + ) + if err != nil { + log.Fatal(err) + } + + return source +} + +// NewApolloConfigSource 创建一个远程配置源 - Apollo +func NewApolloConfigSource(c *conf.RemoteConfig) config.Source { + source := apolloKratos.NewSource( + apolloKratos.WithAppID(c.Apollo.AppId), + apolloKratos.WithCluster(c.Apollo.Cluster), + apolloKratos.WithEndpoint(c.Apollo.Endpoint), + apolloKratos.WithNamespace(c.Apollo.Namespace), + apolloKratos.WithSecret(c.Apollo.Secret), + apolloKratos.WithEnableBackup(), + ) + return source +} + +// NewKubernetesConfigSource 创建一个远程配置源 - Kubernetes +func NewKubernetesConfigSource(c *conf.RemoteConfig) config.Source { + source := k8sKratos.NewSource( + k8sKratos.Namespace(c.Kubernetes.Namespace), + k8sKratos.LabelSelector(""), + k8sKratos.KubeConfig(filepath.Join(k8sUtil.HomeDir(), ".kube", "config")), + ) + return source +} + +// NewPolarisConfigSource 创建一个远程配置源 - Polaris +func NewPolarisConfigSource(_ *conf.RemoteConfig) config.Source { + //configApi, err := polarisApi.NewConfigAPI() + //if err != nil { + // log.Fatal(err) + //} + // + //var opts []polarisKratos.Option + //opts = append(opts, polarisKratos.WithNamespace("default")) + //opts = append(opts, polarisKratos.WithFileGroup("default")) + //opts = append(opts, polarisKratos.WithFileName("default.yaml")) + // + //source, err := polarisKratos.New(configApi, opts...) + //if err != nil { + // log.Fatal(err) + //} + // + //return source + return nil +} diff --git a/orm/ent/pkg/bootstrap/daemon.go b/orm/ent/pkg/bootstrap/daemon.go new file mode 100644 index 0000000..477048f --- /dev/null +++ b/orm/ent/pkg/bootstrap/daemon.go @@ -0,0 +1,39 @@ +package bootstrap + +import ( + "fmt" + "os" + "os/exec" +) + +func stripSlice(slice []string, element string) []string { + for i := 0; i < len(slice); { + if slice[i] == element && i != len(slice)-1 { + slice = append(slice[:i], slice[i+1:]...) + } else if slice[i] == element && i == len(slice)-1 { + slice = slice[:i] + } else { + i++ + } + } + return slice +} + +func subProcess(args []string) *exec.Cmd { + cmd := exec.Command(args[0], args[1:]...) + cmd.Stdin = os.Stdin + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + err := cmd.Start() + if err != nil { + _, _ = fmt.Fprintf(os.Stderr, "[-] Error: %s\n", err) + } + return cmd +} + +// BeDaemon 将当前进程转为守护进程 +func BeDaemon(arg string) { + subProcess(stripSlice(os.Args, arg)) + fmt.Printf("[*] Daemon running in PID: %d PPID: %d\n", os.Getpid(), os.Getppid()) + os.Exit(0) +} diff --git a/orm/ent/pkg/bootstrap/flag.go b/orm/ent/pkg/bootstrap/flag.go new file mode 100644 index 0000000..eaead94 --- /dev/null +++ b/orm/ent/pkg/bootstrap/flag.go @@ -0,0 +1,35 @@ +package bootstrap + +import "flag" + +type CommandFlags struct { + Conf string // 引导配置文件路径,默认为:../../configs + Env string // 开发环境:dev、debug…… + ConfigHost string // 远程配置服务端地址 + ConfigType string // 远程配置服务端类型 + Daemon bool // 是否转为守护进程 +} + +func NewCommandFlags() *CommandFlags { + return &CommandFlags{ + Conf: "", + Env: "", + ConfigHost: "", + ConfigType: "", + Daemon: false, + } +} + +func (f *CommandFlags) Init() { + flag.StringVar(&f.Conf, "conf", "../../configs", "config path, eg: -conf ../../configs") + flag.StringVar(&f.Env, "env", "dev", "runtime environment, eg: -env dev") + flag.StringVar(&f.ConfigHost, "chost", "127.0.0.1:8500", "config server host, eg: -chost 127.0.0.1:8500") + flag.StringVar(&f.ConfigType, "ctype", "consul", "config server host, eg: -ctype consul") + flag.BoolVar(&f.Daemon, "d", false, "run app as a daemon with -d=true.") + + if f.Daemon { + BeDaemon("-d") + } + + flag.Parse() +} diff --git a/orm/ent/pkg/bootstrap/grpc.go b/orm/ent/pkg/bootstrap/grpc.go new file mode 100644 index 0000000..2de701d --- /dev/null +++ b/orm/ent/pkg/bootstrap/grpc.go @@ -0,0 +1,69 @@ +package bootstrap + +import ( + "context" + "time" + + "google.golang.org/grpc" + "google.golang.org/protobuf/types/known/durationpb" + + "github.com/go-kratos/kratos/v2/log" + "github.com/go-kratos/kratos/v2/middleware" + "github.com/go-kratos/kratos/v2/middleware/recovery" + "github.com/go-kratos/kratos/v2/middleware/tracing" + "github.com/go-kratos/kratos/v2/registry" + kratosGrpc "github.com/go-kratos/kratos/v2/transport/grpc" + + "kratos-ent-example/gen/api/go/common/conf" +) + +const defaultTimeout = 5 * time.Second + +// CreateGrpcClient 创建GRPC客户端 +func CreateGrpcClient(ctx context.Context, r registry.Discovery, serviceName string, timeoutDuration *durationpb.Duration) grpc.ClientConnInterface { + timeout := defaultTimeout + if timeoutDuration != nil { + timeout = timeoutDuration.AsDuration() + } + + endpoint := "discovery:///" + serviceName + + conn, err := kratosGrpc.DialInsecure( + ctx, + kratosGrpc.WithEndpoint(endpoint), + kratosGrpc.WithDiscovery(r), + kratosGrpc.WithTimeout(timeout), + kratosGrpc.WithMiddleware( + tracing.Client(), + recovery.Recovery(), + ), + ) + if err != nil { + log.Fatalf("dial grpc client [%s] failed: %s", serviceName, err.Error()) + } + + return conn +} + +// CreateGrpcServer 创建GRPC服务端 +func CreateGrpcServer(cfg *conf.Bootstrap, m ...middleware.Middleware) *kratosGrpc.Server { + var opts []kratosGrpc.ServerOption + + var ms []middleware.Middleware + ms = append(ms, recovery.Recovery()) + ms = append(ms, tracing.Server()) + ms = append(ms, m...) + opts = append(opts, kratosGrpc.Middleware(ms...)) + + if cfg.Server.Grpc.Network != "" { + opts = append(opts, kratosGrpc.Network(cfg.Server.Grpc.Network)) + } + if cfg.Server.Grpc.Addr != "" { + opts = append(opts, kratosGrpc.Address(cfg.Server.Grpc.Addr)) + } + if cfg.Server.Grpc.Timeout != nil { + opts = append(opts, kratosGrpc.Timeout(cfg.Server.Grpc.Timeout.AsDuration())) + } + + return kratosGrpc.NewServer(opts...) +} diff --git a/orm/ent/pkg/bootstrap/logger.go b/orm/ent/pkg/bootstrap/logger.go new file mode 100644 index 0000000..a9dc4c1 --- /dev/null +++ b/orm/ent/pkg/bootstrap/logger.go @@ -0,0 +1,180 @@ +package bootstrap + +import ( + "os" + + "github.com/sirupsen/logrus" + + "go.uber.org/zap" + "go.uber.org/zap/zapcore" + "gopkg.in/natefinch/lumberjack.v2" + + aliyunLogger "github.com/go-kratos/kratos/contrib/log/aliyun/v2" + fluentLogger "github.com/go-kratos/kratos/contrib/log/fluent/v2" + logrusLogger "github.com/go-kratos/kratos/contrib/log/logrus/v2" + tencentLogger "github.com/go-kratos/kratos/contrib/log/tencent/v2" + zapLogger "github.com/go-kratos/kratos/contrib/log/zap/v2" + + "github.com/go-kratos/kratos/v2/log" + "github.com/go-kratos/kratos/v2/middleware/tracing" + + "kratos-ent-example/gen/api/go/common/conf" +) + +type LoggerType string + +const ( + LoggerTypeStd LoggerType = "std" + LoggerTypeFluent LoggerType = "fluent" + LoggerTypeLogrus LoggerType = "logrus" + LoggerTypeZap LoggerType = "zap" + LoggerTypeAliyun LoggerType = "aliyun" + LoggerTypeTencent LoggerType = "tencent" +) + +// NewLoggerProvider 创建一个新的日志记录器提供者 +func NewLoggerProvider(cfg *conf.Logger, serviceInfo *ServiceInfo) log.Logger { + l := NewLogger(cfg) + + return log.With( + l, + "service.id", serviceInfo.Id, + "service.name", serviceInfo.Name, + "service.version", serviceInfo.Version, + "ts", log.DefaultTimestamp, + "caller", log.DefaultCaller, + "trace_id", tracing.TraceID(), + "span_id", tracing.SpanID(), + ) +} + +// NewLogger 创建一个新的日志记录器 +func NewLogger(cfg *conf.Logger) log.Logger { + if cfg == nil { + return NewStdLogger() + } + + switch LoggerType(cfg.Type) { + default: + fallthrough + case LoggerTypeStd: + return NewStdLogger() + case LoggerTypeFluent: + return NewFluentLogger(cfg) + case LoggerTypeZap: + return NewZapLogger(cfg) + case LoggerTypeLogrus: + return NewLogrusLogger(cfg) + case LoggerTypeAliyun: + return NewAliyunLogger(cfg) + case LoggerTypeTencent: + return NewTencentLogger(cfg) + } +} + +// NewStdLogger 创建一个新的日志记录器 - Kratos内置,控制台输出 +func NewStdLogger() log.Logger { + l := log.NewStdLogger(os.Stdout) + return l +} + +// NewZapLogger 创建一个新的日志记录器 - Zap +func NewZapLogger(cfg *conf.Logger) log.Logger { + encoderConfig := zap.NewProductionEncoderConfig() + encoderConfig.EncodeTime = zapcore.ISO8601TimeEncoder + encoderConfig.TimeKey = "time" + encoderConfig.EncodeLevel = zapcore.CapitalLevelEncoder + encoderConfig.EncodeDuration = zapcore.SecondsDurationEncoder + encoderConfig.EncodeCaller = zapcore.ShortCallerEncoder + jsonEncoder := zapcore.NewJSONEncoder(encoderConfig) + + lumberJackLogger := &lumberjack.Logger{ + Filename: cfg.Zap.Filename, + MaxSize: int(cfg.Zap.MaxSize), + MaxBackups: int(cfg.Zap.MaxBackups), + MaxAge: int(cfg.Zap.MaxAge), + } + writeSyncer := zapcore.AddSync(lumberJackLogger) + + var lvl = new(zapcore.Level) + if err := lvl.UnmarshalText([]byte(cfg.Zap.Level)); err != nil { + return nil + } + + core := zapcore.NewCore(jsonEncoder, writeSyncer, lvl) + logger := zap.New(core).WithOptions() + + wrapped := zapLogger.NewLogger(logger) + + return wrapped +} + +// NewLogrusLogger 创建一个新的日志记录器 - Logrus +func NewLogrusLogger(cfg *conf.Logger) log.Logger { + loggerLevel, err := logrus.ParseLevel(cfg.Logrus.Level) + if err != nil { + loggerLevel = logrus.InfoLevel + } + + var loggerFormatter logrus.Formatter + switch cfg.Logrus.Formatter { + default: + fallthrough + case "text": + loggerFormatter = &logrus.TextFormatter{ + DisableColors: cfg.Logrus.DisableColors, + DisableTimestamp: cfg.Logrus.DisableTimestamp, + TimestampFormat: cfg.Logrus.TimestampFormat, + } + break + case "json": + loggerFormatter = &logrus.JSONFormatter{ + DisableTimestamp: cfg.Logrus.DisableTimestamp, + TimestampFormat: cfg.Logrus.TimestampFormat, + } + break + } + + logger := logrus.New() + logger.Level = loggerLevel + logger.Formatter = loggerFormatter + + wrapped := logrusLogger.NewLogger(logger) + return wrapped +} + +// NewFluentLogger 创建一个新的日志记录器 - Fluent +func NewFluentLogger(cfg *conf.Logger) log.Logger { + wrapped, err := fluentLogger.NewLogger(cfg.Fluent.Endpoint) + if err != nil { + panic("create fluent logger failed") + return nil + } + return wrapped +} + +// NewAliyunLogger 创建一个新的日志记录器 - Aliyun +func NewAliyunLogger(cfg *conf.Logger) log.Logger { + wrapped := aliyunLogger.NewAliyunLog( + aliyunLogger.WithProject(cfg.Aliyun.Project), + aliyunLogger.WithEndpoint(cfg.Aliyun.Endpoint), + aliyunLogger.WithAccessKey(cfg.Aliyun.AccessKey), + aliyunLogger.WithAccessSecret(cfg.Aliyun.AccessSecret), + ) + return wrapped +} + +// NewTencentLogger 创建一个新的日志记录器 - Tencent +func NewTencentLogger(cfg *conf.Logger) log.Logger { + wrapped, err := tencentLogger.NewLogger( + tencentLogger.WithTopicID(cfg.Tencent.TopicId), + tencentLogger.WithEndpoint(cfg.Tencent.Endpoint), + tencentLogger.WithAccessKey(cfg.Tencent.AccessKey), + tencentLogger.WithAccessSecret(cfg.Tencent.AccessSecret), + ) + if err != nil { + panic(err) + return nil + } + return wrapped +} diff --git a/orm/ent/pkg/bootstrap/oss.go b/orm/ent/pkg/bootstrap/oss.go new file mode 100644 index 0000000..7107e61 --- /dev/null +++ b/orm/ent/pkg/bootstrap/oss.go @@ -0,0 +1,25 @@ +package bootstrap + +import ( + "github.com/go-kratos/kratos/v2/log" + "github.com/minio/minio-go/v7" + + "github.com/minio/minio-go/v7/pkg/credentials" + + "kratos-ent-example/gen/api/go/common/conf" +) + +func NewMinIoClient(conf *conf.OSS) *minio.Client { + impl, err := minio.New(conf.Minio.Endpoint, + &minio.Options{ + Creds: credentials.NewStaticV4(conf.Minio.AccessKey, conf.Minio.SecretKey, conf.Minio.Token), + Secure: conf.Minio.UseSsl, + }, + ) + if err != nil { + log.Fatal("failed opening connection to minio", err) + return nil + } + + return impl +} diff --git a/orm/ent/pkg/bootstrap/redis.go b/orm/ent/pkg/bootstrap/redis.go new file mode 100644 index 0000000..d879caa --- /dev/null +++ b/orm/ent/pkg/bootstrap/redis.go @@ -0,0 +1,29 @@ +package bootstrap + +import ( + "github.com/go-kratos/kratos/v2/log" + + "github.com/go-redis/redis/extra/redisotel/v8" + "github.com/go-redis/redis/v8" + + "kratos-ent-example/gen/api/go/common/conf" +) + +// NewRedisClient 创建Redis客户端 +func NewRedisClient(cfg *conf.Bootstrap, logger *log.Helper) *redis.Client { + rdb := redis.NewClient(&redis.Options{ + Addr: cfg.Data.Redis.Addr, + Password: cfg.Data.Redis.Password, + DB: int(cfg.Data.Redis.Db), + DialTimeout: cfg.Data.Redis.DialTimeout.AsDuration(), + WriteTimeout: cfg.Data.Redis.WriteTimeout.AsDuration(), + ReadTimeout: cfg.Data.Redis.ReadTimeout.AsDuration(), + }) + if rdb == nil { + logger.Fatalf("failed opening connection to redis") + return nil + } + rdb.AddHook(redisotel.NewTracingHook()) + + return rdb +} diff --git a/orm/ent/pkg/bootstrap/registry.go b/orm/ent/pkg/bootstrap/registry.go new file mode 100644 index 0000000..5f49cc1 --- /dev/null +++ b/orm/ent/pkg/bootstrap/registry.go @@ -0,0 +1,284 @@ +package bootstrap + +import ( + "github.com/go-kratos/kratos/v2/log" + "github.com/go-kratos/kratos/v2/registry" + "path/filepath" + + // etcd + etcdKratos "github.com/go-kratos/kratos/contrib/registry/etcd/v2" + etcdClient "go.etcd.io/etcd/client/v3" + + // consul + consulKratos "github.com/go-kratos/kratos/contrib/registry/consul/v2" + consulClient "github.com/hashicorp/consul/api" + + // eureka + eurekaKratos "github.com/go-kratos/kratos/contrib/registry/eureka/v2" + + // nacos + nacosKratos "github.com/go-kratos/kratos/contrib/registry/nacos/v2" + nacosClients "github.com/nacos-group/nacos-sdk-go/clients" + nacosConstant "github.com/nacos-group/nacos-sdk-go/common/constant" + nacosVo "github.com/nacos-group/nacos-sdk-go/vo" + + // zookeeper + zookeeperKratos "github.com/go-kratos/kratos/contrib/registry/zookeeper/v2" + "github.com/go-zookeeper/zk" + + // kubernetes + k8sRegistry "github.com/go-kratos/kratos/contrib/registry/kubernetes/v2" + k8s "k8s.io/client-go/kubernetes" + k8sRest "k8s.io/client-go/rest" + k8sTools "k8s.io/client-go/tools/clientcmd" + k8sUtil "k8s.io/client-go/util/homedir" + + // servicecomb + servicecombClient "github.com/go-chassis/sc-client" + servicecombKratos "github.com/go-kratos/kratos/contrib/registry/servicecomb/v2" + + "kratos-ent-example/gen/api/go/common/conf" +) + +type RegistryType string + +const ( + RegistryTypeConsul RegistryType = "consul" + RegistryTypeEtcd RegistryType = "etcd" + RegistryTypeZooKeeper RegistryType = "zookeeper" + RegistryTypeNacos RegistryType = "nacos" + RegistryTypeKubernetes RegistryType = "kubernetes" + RegistryTypeEureka RegistryType = "eureka" + RegistryTypePolaris RegistryType = "polaris" + RegistryTypeServicecomb RegistryType = "servicecomb" +) + +// NewRegistry 创建一个注册客户端 +func NewRegistry(cfg *conf.Registry) registry.Registrar { + if cfg == nil { + return nil + } + + switch RegistryType(cfg.Type) { + case RegistryTypeConsul: + return NewConsulRegistry(cfg) + case RegistryTypeEtcd: + return NewEtcdRegistry(cfg) + case RegistryTypeZooKeeper: + return NewZooKeeperRegistry(cfg) + case RegistryTypeNacos: + return NewNacosRegistry(cfg) + case RegistryTypeKubernetes: + return NewKubernetesRegistry(cfg) + case RegistryTypeEureka: + return NewEurekaRegistry(cfg) + case RegistryTypePolaris: + return nil + case RegistryTypeServicecomb: + return NewServicecombRegistry(cfg) + } + + return nil +} + +// NewDiscovery 创建一个发现客户端 +func NewDiscovery(cfg *conf.Registry) registry.Discovery { + if cfg == nil { + return nil + } + + switch RegistryType(cfg.Type) { + case RegistryTypeConsul: + return NewConsulRegistry(cfg) + case RegistryTypeEtcd: + return NewEtcdRegistry(cfg) + case RegistryTypeZooKeeper: + return NewZooKeeperRegistry(cfg) + case RegistryTypeNacos: + return NewNacosRegistry(cfg) + case RegistryTypeKubernetes: + return NewKubernetesRegistry(cfg) + case RegistryTypeEureka: + return NewEurekaRegistry(cfg) + case RegistryTypePolaris: + return nil + case RegistryTypeServicecomb: + return NewServicecombRegistry(cfg) + } + + return nil +} + +// NewConsulRegistry 创建一个注册发现客户端 - Consul +func NewConsulRegistry(c *conf.Registry) *consulKratos.Registry { + cfg := consulClient.DefaultConfig() + cfg.Address = c.Consul.Address + cfg.Scheme = c.Consul.Scheme + + var cli *consulClient.Client + var err error + if cli, err = consulClient.NewClient(cfg); err != nil { + log.Fatal(err) + } + + reg := consulKratos.New(cli, consulKratos.WithHealthCheck(c.Consul.HealthCheck)) + + return reg +} + +// NewEtcdRegistry 创建一个注册发现客户端 - Etcd +func NewEtcdRegistry(c *conf.Registry) *etcdKratos.Registry { + cfg := etcdClient.Config{ + Endpoints: c.Etcd.Endpoints, + } + + var err error + var cli *etcdClient.Client + if cli, err = etcdClient.New(cfg); err != nil { + log.Fatal(err) + } + + reg := etcdKratos.New(cli) + + return reg +} + +// NewZooKeeperRegistry 创建一个注册发现客户端 - ZooKeeper +func NewZooKeeperRegistry(c *conf.Registry) *zookeeperKratos.Registry { + conn, _, err := zk.Connect(c.Zookeeper.Endpoints, c.Zookeeper.Timeout.AsDuration()) + if err != nil { + log.Fatal(err) + } + + reg := zookeeperKratos.New(conn) + if err != nil { + log.Fatal(err) + } + + return reg +} + +// NewNacosRegistry 创建一个注册发现客户端 - Nacos +func NewNacosRegistry(c *conf.Registry) *nacosKratos.Registry { + srvConf := []nacosConstant.ServerConfig{ + *nacosConstant.NewServerConfig(c.Nacos.Address, c.Nacos.Port), + } + + cliConf := nacosConstant.ClientConfig{ + NamespaceId: c.Nacos.NamespaceId, + TimeoutMs: uint64(c.Nacos.Timeout.AsDuration().Milliseconds()), // http请求超时时间,单位毫秒 + BeatInterval: c.Nacos.BeatInterval.AsDuration().Milliseconds(), // 心跳间隔时间,单位毫秒 + UpdateThreadNum: int(c.Nacos.UpdateThreadNum), // 更新服务的线程数 + LogLevel: c.Nacos.LogLevel, + CacheDir: c.Nacos.CacheDir, // 缓存目录 + LogDir: c.Nacos.LogDir, // 日志目录 + NotLoadCacheAtStart: c.Nacos.NotLoadCacheAtStart, // 在启动时不读取本地缓存数据,true--不读取,false--读取 + UpdateCacheWhenEmpty: c.Nacos.UpdateCacheWhenEmpty, // 当服务列表为空时是否更新本地缓存,true--更新,false--不更新 + } + + cli, err := nacosClients.NewNamingClient( + nacosVo.NacosClientParam{ + ClientConfig: &cliConf, + ServerConfigs: srvConf, + }, + ) + if err != nil { + log.Fatal(err) + } + + reg := nacosKratos.New(cli) + + return reg +} + +// NewKubernetesRegistry 创建一个注册发现客户端 - Kubernetes +func NewKubernetesRegistry(_ *conf.Registry) *k8sRegistry.Registry { + restConfig, err := k8sRest.InClusterConfig() + if err != nil { + home := k8sUtil.HomeDir() + kubeConfig := filepath.Join(home, ".kube", "config") + restConfig, err = k8sTools.BuildConfigFromFlags("", kubeConfig) + if err != nil { + log.Fatal(err) + return nil + } + } + + clientSet, err := k8s.NewForConfig(restConfig) + if err != nil { + log.Fatal(err) + return nil + } + + reg := k8sRegistry.NewRegistry(clientSet) + + return reg +} + +// NewEurekaRegistry 创建一个注册发现客户端 - Eureka +func NewEurekaRegistry(c *conf.Registry) *eurekaKratos.Registry { + var opts []eurekaKratos.Option + opts = append(opts, eurekaKratos.WithHeartbeat(c.Eureka.HeartbeatInterval.AsDuration())) + opts = append(opts, eurekaKratos.WithRefresh(c.Eureka.RefreshInterval.AsDuration())) + opts = append(opts, eurekaKratos.WithEurekaPath(c.Eureka.Path)) + + var err error + var reg *eurekaKratos.Registry + if reg, err = eurekaKratos.New(c.Eureka.Endpoints, opts...); err != nil { + log.Fatal(err) + } + + return reg +} + +// NewPolarisRegistry 创建一个注册发现客户端 - Polaris +//func NewPolarisRegistry(c *conf.Registry) *polarisKratos.Registry { +// var err error +// +// var consumer polarisApi.ConsumerAPI +// if consumer, err = polarisApi.NewConsumerAPI(); err != nil { +// log.Fatalf("fail to create consumerAPI, err is %v", err) +// } +// +// var provider polarisApi.ProviderAPI +// provider = polarisApi.NewProviderAPIByContext(consumer.SDKContext()) +// +// log.Infof("start to register instances, count %d", c.Polaris.InstanceCount) +// +// var resp *polarisModel.InstanceRegisterResponse +// for i := 0; i < (int)(c.Polaris.InstanceCount); i++ { +// registerRequest := &polarisApi.InstanceRegisterRequest{} +// registerRequest.Service = c.Polaris.Service +// registerRequest.Namespace = c.Polaris.Namespace +// registerRequest.Host = c.Polaris.Address +// registerRequest.Port = (int)(c.Polaris.Port) + i +// registerRequest.ServiceToken = c.Polaris.Token +// registerRequest.SetHealthy(true) +// if resp, err = provider.RegisterInstance(registerRequest); err != nil { +// log.Fatalf("fail to register instance %d, err is %v", i, err) +// } else { +// log.Infof("register instance %d response: instanceId %s", i, resp.InstanceID) +// } +// } +// +// reg := polarisKratos.NewRegistry(provider, consumer) +// +// return reg +//} + +// NewServicecombRegistry 创建一个注册发现客户端 - Servicecomb +func NewServicecombRegistry(c *conf.Registry) *servicecombKratos.Registry { + cfg := servicecombClient.Options{ + Endpoints: c.Servicecomb.Endpoints, + } + + var cli *servicecombClient.Client + var err error + if cli, err = servicecombClient.NewClient(cfg); err != nil { + log.Fatal(err) + } + + reg := servicecombKratos.NewRegistry(cli) + + return reg +} diff --git a/orm/ent/pkg/bootstrap/registry_test.go b/orm/ent/pkg/bootstrap/registry_test.go new file mode 100644 index 0000000..520be07 --- /dev/null +++ b/orm/ent/pkg/bootstrap/registry_test.go @@ -0,0 +1,77 @@ +package bootstrap + +import ( + "github.com/stretchr/testify/assert" + "kratos-ent-example/gen/api/go/common/conf" + "testing" +) + +func TestNewConsulRegistry(t *testing.T) { + var cfg conf.Registry + cfg.Consul.Scheme = "http" + cfg.Consul.Address = "127.0.0.1:8500" + cfg.Consul.HealthCheck = false + + reg := NewConsulRegistry(&cfg) + assert.Nil(t, reg) +} + +func TestNewEtcdRegistry(t *testing.T) { + var cfg conf.Registry + cfg.Etcd.Endpoints = []string{"127.0.0.1:2379"} + + reg := NewEtcdRegistry(&cfg) + assert.Nil(t, reg) +} + +func TestNewNacosRegistry(t *testing.T) { + var cfg conf.Registry + cfg.Nacos.Address = "127.0.0.1" + cfg.Nacos.Port = 8848 + + reg := NewNacosRegistry(&cfg) + assert.Nil(t, reg) +} + +func TestNewZooKeeperRegistry(t *testing.T) { + var cfg conf.Registry + cfg.Zookeeper.Endpoints = []string{"127.0.0.1:2181"} + + reg := NewZooKeeperRegistry(&cfg) + assert.Nil(t, reg) +} + +func TestNewKubernetesRegistry(t *testing.T) { + var cfg conf.Registry + reg := NewKubernetesRegistry(&cfg) + assert.Nil(t, reg) +} + +func TestNewEurekaRegistry(t *testing.T) { + var cfg conf.Registry + cfg.Eureka.Endpoints = []string{"https://127.0.0.1:18761"} + + reg := NewEurekaRegistry(&cfg) + assert.Nil(t, reg) +} + +func TestNewPolarisRegistry(t *testing.T) { + //var cfg conf.Registry + //cfg.Polaris.Address = "127.0.0.1" + //cfg.Polaris.Port = 8091 + //cfg.Polaris.InstanceCount = 5 + //cfg.Polaris.Namespace = "default" + //cfg.Polaris.Service = "DiscoverEchoServer" + //cfg.Polaris.Token = "" + // + //reg := NewPolarisRegistry(&cfg) + //assert.Nil(t, reg) +} + +func TestNewServicecombRegistry(t *testing.T) { + var cfg conf.Registry + cfg.Servicecomb.Endpoints = []string{"127.0.0.1:30100"} + + reg := NewServicecombRegistry(&cfg) + assert.Nil(t, reg) +} diff --git a/orm/ent/pkg/bootstrap/rest.go b/orm/ent/pkg/bootstrap/rest.go new file mode 100644 index 0000000..0b43cd0 --- /dev/null +++ b/orm/ent/pkg/bootstrap/rest.go @@ -0,0 +1,65 @@ +package bootstrap + +import ( + "github.com/go-kratos/aegis/ratelimit" + "github.com/go-kratos/aegis/ratelimit/bbr" + "github.com/go-kratos/kratos/v2/middleware" + midRateLimit "github.com/go-kratos/kratos/v2/middleware/ratelimit" + "github.com/go-kratos/kratos/v2/middleware/recovery" + "github.com/go-kratos/kratos/v2/middleware/tracing" + "github.com/go-kratos/kratos/v2/middleware/validate" + kratosRest "github.com/go-kratos/kratos/v2/transport/http" + + "github.com/gorilla/handlers" + + "kratos-ent-example/gen/api/go/common/conf" +) + +// CreateRestServer 创建REST服务端 +func CreateRestServer(cfg *conf.Bootstrap, m ...middleware.Middleware) *kratosRest.Server { + var opts = []kratosRest.ServerOption{ + kratosRest.Filter(handlers.CORS( + handlers.MaxAge(3600), + handlers.AllowedHeaders(cfg.Server.Rest.Cors.Headers), + handlers.AllowedMethods(cfg.Server.Rest.Cors.Methods), + handlers.AllowedOrigins(cfg.Server.Rest.Cors.Origins), + )), + } + + var ms []middleware.Middleware + if cfg.Server != nil && cfg.Server.Rest != nil && cfg.Server.Rest.Middleware != nil { + if cfg.Server.Rest.Middleware.GetEnableRecovery() { + ms = append(ms, recovery.Recovery()) + } + if cfg.Server.Rest.Middleware.GetEnableTracing() { + ms = append(ms, tracing.Server()) + } + if cfg.Server.Rest.Middleware.GetEnableValidate() { + ms = append(ms, validate.Validator()) + } + if cfg.Server.Rest.Middleware.GetEnableCircuitBreaker() { + } + if cfg.Server.Rest.Middleware.Limiter != nil { + var limiter ratelimit.Limiter + switch cfg.Server.Rest.Middleware.Limiter.GetName() { + case "bbr": + limiter = bbr.NewLimiter() + } + ms = append(ms, midRateLimit.Server(midRateLimit.WithLimiter(limiter))) + } + } + ms = append(ms, m...) + opts = append(opts, kratosRest.Middleware(ms...)) + + if cfg.Server.Rest.Network != "" { + opts = append(opts, kratosRest.Network(cfg.Server.Rest.Network)) + } + if cfg.Server.Rest.Addr != "" { + opts = append(opts, kratosRest.Address(cfg.Server.Rest.Addr)) + } + if cfg.Server.Rest.Timeout != nil { + opts = append(opts, kratosRest.Timeout(cfg.Server.Rest.Timeout.AsDuration())) + } + + return kratosRest.NewServer(opts...) +} diff --git a/orm/ent/pkg/bootstrap/service_info.go b/orm/ent/pkg/bootstrap/service_info.go new file mode 100644 index 0000000..41f5615 --- /dev/null +++ b/orm/ent/pkg/bootstrap/service_info.go @@ -0,0 +1,30 @@ +package bootstrap + +import "os" + +type ServiceInfo struct { + Name string + Version string + Id string + Metadata map[string]string +} + +func NewServiceInfo(name, version, id string) *ServiceInfo { + if id == "" { + id, _ = os.Hostname() + } + return &ServiceInfo{ + Name: name, + Version: version, + Id: id, + Metadata: map[string]string{}, + } +} + +func (s *ServiceInfo) GetInstanceId() string { + return s.Id + "." + s.Name +} + +func (s *ServiceInfo) SetMataData(k, v string) { + s.Metadata[k] = v +} diff --git a/orm/ent/pkg/bootstrap/tracer.go b/orm/ent/pkg/bootstrap/tracer.go new file mode 100644 index 0000000..73d4122 --- /dev/null +++ b/orm/ent/pkg/bootstrap/tracer.go @@ -0,0 +1,84 @@ +package bootstrap + +import ( + "errors" + + "go.opentelemetry.io/otel/exporters/jaeger" + "go.opentelemetry.io/otel/exporters/zipkin" + + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/sdk/resource" + traceSdk "go.opentelemetry.io/otel/sdk/trace" + semConv "go.opentelemetry.io/otel/semconv/v1.4.0" + "kratos-ent-example/gen/api/go/common/conf" +) + +// NewJaegerExporter 创建一个jaeger导出器 +func NewJaegerExporter(endpoint string) (traceSdk.SpanExporter, error) { + return jaeger.New(jaeger.WithCollectorEndpoint(jaeger.WithEndpoint(endpoint))) +} + +// NewZipkinExporter 创建一个zipkin导出器 +func NewZipkinExporter(endpoint string) (traceSdk.SpanExporter, error) { + return zipkin.New(endpoint) +} + +// NewTracerExporter 创建一个导出器,支持:jaeger和zipkin +func NewTracerExporter(exporterName, endpoint string) (traceSdk.SpanExporter, error) { + if exporterName == "" { + exporterName = "jaeger" + } + + switch exporterName { + case "jaeger": + return NewJaegerExporter(endpoint) + case "zipkin": + return NewZipkinExporter(endpoint) + default: + return nil, errors.New("exporter type not support") + } +} + +// NewTracerProvider 创建一个链路追踪器 +func NewTracerProvider(cfg *conf.Tracer, serviceInfo *ServiceInfo) error { + if cfg == nil { + return errors.New("tracer config is nil") + } + + if cfg.Sampler == 0 { + cfg.Sampler = 1.0 + } + + if cfg.Env == "" { + cfg.Env = "dev" + } + + opts := []traceSdk.TracerProviderOption{ + traceSdk.WithSampler(traceSdk.ParentBased(traceSdk.TraceIDRatioBased(cfg.Sampler))), + traceSdk.WithResource(resource.NewSchemaless( + semConv.ServiceNameKey.String(serviceInfo.Name), + semConv.ServiceVersionKey.String(serviceInfo.Version), + semConv.ServiceInstanceIDKey.String(serviceInfo.Id), + attribute.String("env", cfg.Env), + )), + } + + if len(cfg.Endpoint) > 0 { + exp, err := NewTracerExporter(cfg.Batcher, cfg.Endpoint) + if err != nil { + panic(err) + } + + opts = append(opts, traceSdk.WithBatcher(exp)) + } + + tp := traceSdk.NewTracerProvider(opts...) + if tp == nil { + return errors.New("create tracer provider failed") + } + + otel.SetTracerProvider(tp) + + return nil +} diff --git a/orm/ent/pkg/service/name.go b/orm/ent/pkg/service/name.go new file mode 100644 index 0000000..4f30d8b --- /dev/null +++ b/orm/ent/pkg/service/name.go @@ -0,0 +1,5 @@ +package service + +const ( + UserService = "user.service" // 账户服务 +) diff --git a/orm/gorm/.gitignore b/orm/gorm/.gitignore new file mode 100644 index 0000000..3b735ec --- /dev/null +++ b/orm/gorm/.gitignore @@ -0,0 +1,21 @@ +# If you prefer the allow list template instead of the deny list, see community template: +# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore +# +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ + +# Go workspace file +go.work diff --git a/orm/gorm/LICENSE b/orm/gorm/LICENSE new file mode 100644 index 0000000..0ceaadc --- /dev/null +++ b/orm/gorm/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Bobo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/orm/gorm/Makefile b/orm/gorm/Makefile new file mode 100644 index 0000000..82703b9 --- /dev/null +++ b/orm/gorm/Makefile @@ -0,0 +1,80 @@ +# Not Support Windows + +.PHONY: help wire conf ent build api openapi init all + +ifeq ($(OS),Windows_NT) + IS_WINDOWS:=1 +endif + +CURRENT_DIR := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST))))) +ROOT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST)))) + +SRCS_MK := $(foreach dir, app, $(wildcard $(dir)/*/*/Makefile)) + +# generate wire code +wire: + $(foreach dir, $(dir $(realpath $(SRCS_MK))),\ + cd $(dir);\ + make wire;\ + ) + +# generate config define code +conf: + $(foreach dir, $(dir $(realpath $(SRCS_MK))),\ + cd $(dir);\ + make conf;\ + ) + +# generate ent code +ent: + $(foreach dir, $(dir $(realpath $(SRCS_MK))),\ + cd $(dir);\ + make ent;\ + ) + +# generate protobuf api go code +api: + buf generate + +# generate OpenAPI v3 docs. +openapi: + buf generate --path api/admin/service/v1 --template api/admin/service/v1/buf.openapi.gen.yaml + buf generate --path api/front/service/v1 --template api/front/service/v1/buf.openapi.gen.yaml + +# initialize develop environment +init: + cd $(lastword $(dir $(realpath $(SRCS_MK))));\ + make init; + +# build all service applications +build: + $(foreach dir, $(dir $(realpath $(SRCS_MK))),\ + cd $(dir);\ + make build;\ + ) + +# generate & build all service applications +all: + $(foreach dir, $(dir $(realpath $(SRCS_MK))),\ + cd $(dir);\ + make app;\ + ) + +# show help +help: + @echo "" + @echo "Usage:" + @echo " make [target]" + @echo "" + @echo 'Targets:' + @awk '/^[a-zA-Z\-_0-9]+:/ { \ + helpMessage = match(lastLine, /^# (.*)/); \ + if (helpMessage) { \ + helpCommand = substr($$1, 0, index($$1, ":")-1); \ + helpMessage = substr(lastLine, RSTART + 2, RLENGTH); \ + printf "\033[36m%-22s\033[0m %s\n", helpCommand,helpMessage; \ + } \ + } \ + { lastLine = $$0 }' $(MAKEFILE_LIST) + +.DEFAULT_GOAL := help diff --git a/orm/gorm/README.md b/orm/gorm/README.md new file mode 100644 index 0000000..922d804 --- /dev/null +++ b/orm/gorm/README.md @@ -0,0 +1 @@ +# Kratos GORM ORM实例 diff --git a/orm/gorm/WORKSPACE b/orm/gorm/WORKSPACE new file mode 100644 index 0000000..09dd45e --- /dev/null +++ b/orm/gorm/WORKSPACE @@ -0,0 +1,143 @@ +# gazelle:repo bazel_gazelle +workspace(name = "com_github_tx7do_kratos_blog") + +######################################### +## 下载所需要的软件包 +######################################### + +load("//:DOWNLOAD.bzl", "download_package") + +download_package() + +######################################### +## Bazel Go语言 规则集 初始化 +######################################### + +load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") + +go_rules_dependencies() + +go_register_toolchains(version = "1.19.5") + +######################################### +## Bazel Gazelle 规则集 初始化 +######################################### + +load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") +load("//:repos.bzl", "go_dependencies") + +# gazelle:repository_macro repos.bzl%go_dependencies +go_dependencies() + +gazelle_dependencies() + +######################################### +## Bazel Docker 规则集 初始化 +######################################### + +load( + "@io_bazel_rules_docker//repositories:repositories.bzl", + container_repositories = "repositories", +) + +container_repositories() + +load("@io_bazel_rules_docker//repositories:deps.bzl", container_deps = "deps") + +container_deps() + +load("@io_bazel_rules_docker//container:pull.bzl", "container_pull") + +# 拉取Alpine Linux +# 该发行版使用musl libc,并且缺乏一些调试工具。 +container_pull( + name = "alpine_linux_amd64", + registry = "index.docker.io", + repository = "library/alpine", + tag = "latest", +) + +# 拉取Debian-Slim Linux +container_pull( + name = "slim_linux_amd64", + registry = "index.docker.io", + repository = "library/debian", + tag = "stable-slim", +) + +# 拉取Centos Linux +container_pull( + name = "centos_linux_amd64", + registry = "index.docker.io", + repository = "library/centos", + tag = "7", +) + +# 拉取Ubuntu Linux +container_pull( + name = "ubuntu_linux_amd64", + registry = "index.docker.io", + repository = "library/ubuntu", + tag = "latest", +) + +######################################### +## Bazel Kubernetes 规则集 初始化 +######################################### + +load("@io_bazel_rules_k8s//k8s:k8s.bzl", "k8s_repositories") + +k8s_repositories() + +######################################### +## Bazel pkg 规则集 初始化 +######################################### + +load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") + +rules_pkg_dependencies() + +######################################### +## Bazel protoc 初始化 +######################################### + +load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") + +protobuf_deps() + +######################################### +## Bazel Buf 规则集 初始化 +######################################### + +# load("@rules_buf//buf:repositories.bzl", "rules_buf_dependencies", "rules_buf_toolchains") +# load("@rules_buf//gazelle/buf:repositories.bzl", "gazelle_buf_dependencies") +# load("//:buf_deps.bzl", "buf_deps") + +# # gazelle:repository_macro buf_deps.bzl%buf_deps +# buf_deps() + +# rules_buf_dependencies() + +# rules_buf_toolchains(version = "v1.12.0") + +# gazelle_buf_dependencies() + +######################################### +## Bazel gPRC 规则集 初始化 +######################################### + +# load("@rules_proto_grpc//:repositories.bzl", "rules_proto_grpc_repos", "rules_proto_grpc_toolchains") + +# rules_proto_grpc_toolchains() + +# rules_proto_grpc_repos() + +######################################### +## Bazel Protobuf 规则集 初始化 +######################################### + +# load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") + +# rules_proto_dependencies() + +# rules_proto_toolchains() diff --git a/orm/gorm/api/buf.lock b/orm/gorm/api/buf.lock new file mode 100644 index 0000000..afdc004 --- /dev/null +++ b/orm/gorm/api/buf.lock @@ -0,0 +1,23 @@ +# Generated by buf. DO NOT EDIT. +version: v1 +deps: + - remote: buf.build + owner: envoyproxy + repository: protoc-gen-validate + commit: 6607b10f00ed4a3d98f906807131c44a + - remote: buf.build + owner: gogo + repository: protobuf + commit: 5461a3dfa9d941da82028ab185dc2a0e + - remote: buf.build + owner: googleapis + repository: googleapis + commit: 75b4300737fb4efca0831636be94e517 + - remote: buf.build + owner: kratos + repository: apis + commit: c2de25f14fa445a79a054214f31d17a8 + - remote: buf.build + owner: tx7do + repository: gnostic + commit: b9ecfa10359449f681e6e12b50b78f98 diff --git a/orm/gorm/api/buf.yaml b/orm/gorm/api/buf.yaml new file mode 100644 index 0000000..c332ac4 --- /dev/null +++ b/orm/gorm/api/buf.yaml @@ -0,0 +1,15 @@ +version: v1 +build: + excludes: [third_party] +deps: + - buf.build/googleapis/googleapis + - buf.build/envoyproxy/protoc-gen-validate + - buf.build/kratos/apis + - buf.build/tx7do/gnostic + - buf.build/gogo/protobuf +breaking: + use: + - FILE +lint: + use: + - DEFAULT diff --git a/orm/gorm/api/common/conf/bootstrap.proto b/orm/gorm/api/common/conf/bootstrap.proto new file mode 100644 index 0000000..849f96f --- /dev/null +++ b/orm/gorm/api/common/conf/bootstrap.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +package common.conf; + +option go_package = "kratos-gorm-example/gen/api/go/common/conf;conf"; + +import "common/conf/tracer.proto"; +import "common/conf/data.proto"; +import "common/conf/server.proto"; +import "common/conf/client.proto"; +import "common/conf/logger.proto"; +import "common/conf/registry.proto"; +import "common/conf/oss.proto"; +import "common/conf/config.proto"; + +// 引导信息 +message Bootstrap { + Server server = 1; + Client client = 2; + Data data = 3; + Tracer trace = 4; + Logger logger = 5; + Registry registry = 6; + RemoteConfig config = 7; + OSS oss = 8; +} diff --git a/orm/gorm/api/common/conf/client.proto b/orm/gorm/api/common/conf/client.proto new file mode 100644 index 0000000..38ed453 --- /dev/null +++ b/orm/gorm/api/common/conf/client.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +package common.conf; + +option go_package = "kratos-gorm-example/gen/api/go/common/conf;conf"; + +import "google/protobuf/duration.proto"; +import "common/conf/middleware.proto"; + +// 客户端 +message Client { + // REST + message REST { + google.protobuf.Duration timeout = 1; // 超时时间 + Middleware middleware = 2; + } + + // gPRC + message GRPC { + google.protobuf.Duration timeout = 1; // 超时时间 + Middleware middleware = 2; + } + + REST rest = 1; // REST服务 + GRPC grpc = 2; // gRPC服务 +} diff --git a/orm/gorm/api/common/conf/config.proto b/orm/gorm/api/common/conf/config.proto new file mode 100644 index 0000000..f3dc8bf --- /dev/null +++ b/orm/gorm/api/common/conf/config.proto @@ -0,0 +1,53 @@ +syntax = "proto3"; + +package common.conf; + +option go_package = "kratos-gorm-example/gen/api/go/common/conf;conf"; + +import "google/protobuf/duration.proto"; + +// 配置服务 +message RemoteConfig { + message Nacos { + string address = 1; // 服务端地址 + uint64 port = 2; // 服务端端口 + string key = 3; // + } + + message Etcd { + repeated string endpoints = 1; + google.protobuf.Duration timeout = 2; + string key = 3; // + } + + message Consul { + string scheme = 1; // 网络样式 + string address = 2; // 服务端地址 + string key = 3; // + } + + message Apollo { + string endpoint = 1; + string app_id = 2; + string cluster = 3; + string namespace = 4; + string secret = 5; + } + + message Kubernetes { + string namespace = 1; + } + + message Polaris { + + } + + string type = 1; + + Etcd etcd = 2; + Consul consul = 3; + Nacos nacos = 4; + Apollo apollo = 6; + Kubernetes kubernetes = 7; + Polaris polaris = 8; +} diff --git a/orm/gorm/api/common/conf/data.proto b/orm/gorm/api/common/conf/data.proto new file mode 100644 index 0000000..9f3af95 --- /dev/null +++ b/orm/gorm/api/common/conf/data.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; + +package common.conf; + +option go_package = "kratos-gorm-example/gen/api/go/common/conf;conf"; + +import "google/protobuf/duration.proto"; + +// 数据 +message Data { + // 数据库 + message Database { + string driver = 1; // 驱动名:mysql、postgresql、mongodb、sqlite…… + string source = 2; // 数据源(DSN字符串) + bool migrate = 3; // 数据迁移开关 + } + + // redis + message Redis { + string network = 1; // 网络 + string addr = 2; // 服务端地址 + string password = 3; // 密码 + int32 db = 4; // 数据库索引 + google.protobuf.Duration dial_timeout = 5; // 连接超时时间 + google.protobuf.Duration read_timeout = 6; // 读取超时时间 + google.protobuf.Duration write_timeout = 7; // 写入超时时间 + } + + Database database = 1; // 数据库 + Redis redis = 2; // Redis +} diff --git a/orm/gorm/api/common/conf/logger.proto b/orm/gorm/api/common/conf/logger.proto new file mode 100644 index 0000000..cba296d --- /dev/null +++ b/orm/gorm/api/common/conf/logger.proto @@ -0,0 +1,55 @@ +syntax = "proto3"; + +package common.conf; + +option go_package = "kratos-gorm-example/gen/api/go/common/conf;conf"; + +// 日志 +message Logger { + // Zap + message Zap { + string filename = 1; // + string level = 2; // + int32 max_size = 3; // + int32 max_age = 4; // + int32 max_backups = 5; // + } + + // logrus + message Logrus { + string level = 1; // 日志等级 + string formatter = 2; // 输出格式:text, json. + string timestamp_format = 3; // 定义时间戳格式,例如:"2006-01-02 15:04:05" + bool disable_colors = 4; // 不需要彩色日志 + bool disable_timestamp = 5; // 不需要时间戳 + } + + // Fluent + message Fluent { + string endpoint = 1; // 公网接入地址 + } + + // 阿里云 + message Aliyun { + string endpoint = 1; // 公网接入地址 + string project = 2; // + string access_key = 3; // 访问密钥ID + string access_secret = 4; // 访问密钥 + } + + // 腾讯 + message Tencent { + string endpoint = 1; // 公网接入地址 + string topic_id = 2; // + string access_key = 3; // 访问密钥ID + string access_secret = 4; // 访问密钥 + } + + string type = 1; + + Zap zap = 2; + Logrus logrus = 3; + Fluent fluent = 4; + Aliyun aliyun = 5; + Tencent tencent = 6; +} diff --git a/orm/gorm/api/common/conf/middleware.proto b/orm/gorm/api/common/conf/middleware.proto new file mode 100644 index 0000000..84fcd47 --- /dev/null +++ b/orm/gorm/api/common/conf/middleware.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; + +package common.conf; + +option go_package = "kratos-gorm-example/gen/api/go/common/conf;conf"; + +import "google/protobuf/duration.proto"; + +message Middleware { + // JWT校验 + message Auth { + string method = 1; // JWT签名的算法,支持算法:HS256 + string key = 2; // JWT 秘钥 + } + + // 限流器 + message RateLimiter { + string name = 1; // 限流器名字,支持:bbr。 + } + + // 性能指标 + message Metrics { + bool histogram = 1; // 直方图 + bool counter = 2; // 计数器 + bool gauge = 3; // 仪表盘 + bool summary = 4; // 摘要 + } + + bool enable_logging = 1; // 日志开关 + bool enable_recovery = 2; // 异常恢复 + bool enable_tracing = 3; // 链路追踪开关 + bool enable_validate = 4; // 参数校验开关 + bool enable_circuit_breaker = 5; // 熔断器 + + RateLimiter limiter = 6; + Metrics metrics = 7; + Auth auth = 8; +} diff --git a/orm/gorm/api/common/conf/oss.proto b/orm/gorm/api/common/conf/oss.proto new file mode 100644 index 0000000..e9dd238 --- /dev/null +++ b/orm/gorm/api/common/conf/oss.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package common.conf; + +option go_package = "kratos-gorm-example/gen/api/go/common/conf;conf"; + +message OSS { + // MinIO + message MinIO { + string endpoint = 1; // 对端端口 + string access_key = 2; // 访问密钥 + string secret_key = 3; // 密钥 + string token = 4; // 令牌 + bool use_ssl = 5; // 使用SSL + string upload_host = 6; // 上传链接的主机名 + string download_host = 7; // 下载链接的主机名 + } + + MinIO minio = 1; +} diff --git a/orm/gorm/api/common/conf/registry.proto b/orm/gorm/api/common/conf/registry.proto new file mode 100644 index 0000000..5699f21 --- /dev/null +++ b/orm/gorm/api/common/conf/registry.proto @@ -0,0 +1,82 @@ +syntax = "proto3"; + +package common.conf; + +option go_package = "kratos-gorm-example/gen/api/go/common/conf;conf"; + +import "google/protobuf/duration.proto"; + +// 注册发现中心 +message Registry { + // Consul + message Consul { + string scheme = 1; // 网络样式 + string address = 2; // 服务端地址 + bool health_check = 3; // 健康检查 + } + + // Etcd + message Etcd { + repeated string endpoints = 1; + } + + // ZooKeeper + message ZooKeeper { + repeated string endpoints = 1; + google.protobuf.Duration timeout = 2; + } + + // Nacos + message Nacos { + string address = 1; // 服务端地址 + uint64 port = 2; // 服务端端口 + string namespace_id = 3; // + string log_level = 4; // 日志等级 + string cache_dir = 5; // 缓存目录 + string log_dir = 6; // 日志目录 + int32 update_thread_num = 7; // 更新服务的线程数 + google.protobuf.Duration timeout = 8; // http请求超时时间,单位: 毫秒 + google.protobuf.Duration beat_interval = 9; // 心跳间隔时间,单位: 毫秒 + bool not_load_cache_at_start = 10; // 在启动时不读取本地缓存数据,true: 不读取,false: 读取 + bool update_cache_when_empty = 11; // 当服务列表为空时是否更新本地缓存,true: 更新,false: 不更新 + } + + // Kubernetes + message Kubernetes { + + } + + // Eureka + message Eureka { + repeated string endpoints = 1; + google.protobuf.Duration heartbeat_interval = 2; + google.protobuf.Duration refresh_interval = 3; + string path = 4; + } + + // Polaris + message Polaris { + string address = 1; // 服务端地址 + int32 port = 2; // 服务端端口 + int32 instance_count = 3; + string namespace = 4; + string service = 5; + string token = 6; + } + + // Servicecomb + message Servicecomb { + repeated string endpoints = 1; + } + + string type = 1; + + Consul consul = 2; // Consul + Etcd etcd = 3; // Etcd + ZooKeeper zookeeper = 4; // ZooKeeper + Nacos nacos = 5; // Nacos + Kubernetes kubernetes = 6; // Kubernetes + Eureka eureka = 7; // Eureka + Polaris polaris = 8; // Polaris + Servicecomb servicecomb = 9; // Servicecomb +} diff --git a/orm/gorm/api/common/conf/server.proto b/orm/gorm/api/common/conf/server.proto new file mode 100644 index 0000000..6269663 --- /dev/null +++ b/orm/gorm/api/common/conf/server.proto @@ -0,0 +1,75 @@ +syntax = "proto3"; + +package common.conf; + +option go_package = "kratos-gorm-example/gen/api/go/common/conf;conf"; + +import "google/protobuf/duration.proto"; +import "common/conf/middleware.proto"; + +// 服务器 +message Server { + // REST + message REST { + message CORS { + repeated string headers = 1; // + repeated string methods = 2; // + repeated string origins = 3; // + } + + string network = 1; // 网络 + string addr = 2; // 服务监听地址 + google.protobuf.Duration timeout = 3; // 超时时间 + CORS cors = 4; // 服务监听地址 + Middleware middleware = 5; // 中间件 + } + + // gPRC + message GRPC { + string network = 1; // 网络 + string addr = 2; // 服务监听地址 + google.protobuf.Duration timeout = 3; // 超时时间 + Middleware middleware = 4; + } + + // Websocket + message Websocket { + string network = 1; // 网络样式:http、https + string addr = 2; // 服务监听地址 + string path = 3; // 路径 + string codec = 4; // 编解码器 + google.protobuf.Duration timeout = 5; // 超时时间 + } + + // MQTT + message Mqtt { + string addr = 1; // 对端网络地址 + } + + // Kafka + message Kafka { + repeated string addrs = 1; // 对端网络地址 + } + + // RabbitMQ + message RabbitMQ { + repeated string addrs = 1; // 对端网络地址 + } + + // SSE + message SSE { + string network = 1; // 网络 + string addr = 2; // 服务监听地址 + google.protobuf.Duration timeout = 3; // 超时时间 + string path = 4; // 路径 + string codec = 5; // 编解码器 + } + + REST rest = 1; // REST服务 + GRPC grpc = 2; // gRPC服务 + Websocket websocket = 3; // Websocket服务 + Mqtt mqtt = 4; // MQTT服务 + Kafka kafka = 5; // Kafka服务 + RabbitMQ rabbitmq = 6; // RabbitMQ服务 + SSE sse = 7; // SSE服务 +} diff --git a/orm/gorm/api/common/conf/tracer.proto b/orm/gorm/api/common/conf/tracer.proto new file mode 100644 index 0000000..be4cb85 --- /dev/null +++ b/orm/gorm/api/common/conf/tracer.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; + +package common.conf; + +option go_package = "kratos-gorm-example/gen/api/go/common/conf;conf"; + +// 链路追踪 +message Tracer { + string batcher = 1; // jaeger或者zipkin + string endpoint = 2; // 端口 + double sampler = 3; // 采样率,默认:1.0 + string env = 4; // 运行环境:dev、debug、product +} diff --git a/orm/gorm/api/common/pagination/pagination.proto b/orm/gorm/api/common/pagination/pagination.proto new file mode 100644 index 0000000..7880718 --- /dev/null +++ b/orm/gorm/api/common/pagination/pagination.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; + +package pagination; +option go_package = "kratos-gorm-example/gen/api/go/common/pagination;pagination"; + +import "google/protobuf/any.proto"; + +// 排序类型 +enum SortOrder { + // 不排序 + UNSORTED = 0; + // 升序 + ASCENDING = 1; + // 降序 + DESCENDING = 2; +} + +// 分页通用请求 +message PagingRequest { + // 当前页 + optional int32 page = 1; + + // 每一页的行数 + optional int32 pageSize = 2 [json_name = "pageSize"]; + + // 查询参数 + map query = 3; + + // 排序 + map orderBy = 4 [json_name = "orderBy"]; + + // 是否不分页 + optional bool nopaging = 5; +} + +// 分页通用结果 +message PagingResponse { + // 总数 + int32 total = 1; + // 分页数据 + repeated google.protobuf.Any items = 2; +} diff --git a/orm/gorm/api/third_party/README.md b/orm/gorm/api/third_party/README.md new file mode 100644 index 0000000..bee229b --- /dev/null +++ b/orm/gorm/api/third_party/README.md @@ -0,0 +1,13 @@ +# Protobuf 第三方库 + +- [Krator Errors](https://github.com/go-kratos/kratos/v2/errors) +- [googleapis](https://google.golang.org/genproto/googleapis) +- [gnostic OpenAPI v3](https://github.com/google/gnostic/openapiv3) +- [protoc-gen-validate](https://github.com/envoyproxy/protoc-gen-validate) + +Protobuf使用[Buf.build](https://buf.build)进行管理编译,第三方库也使用Buf进行管理: + +- `buf.build/googleapis/googleapis` +- `buf.build/envoyproxy/protoc-gen-validate` +- `buf.build/kratos/apis` +- `buf.build/tx7do/gnostic` diff --git a/orm/gorm/api/third_party/buf.yaml b/orm/gorm/api/third_party/buf.yaml new file mode 100644 index 0000000..03b90d5 --- /dev/null +++ b/orm/gorm/api/third_party/buf.yaml @@ -0,0 +1,7 @@ +version: v1 +breaking: + use: + - FILE +lint: + use: + - DEFAULT diff --git a/orm/gorm/api/third_party/errors/errors.proto b/orm/gorm/api/third_party/errors/errors.proto new file mode 100644 index 0000000..edfb0d3 --- /dev/null +++ b/orm/gorm/api/third_party/errors/errors.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +package errors; + +option go_package = "github.com/go-kratos/kratos/v2/errors;errors"; +option java_multiple_files = true; +option java_package = "com.github.kratos.errors"; +option objc_class_prefix = "KratosErrors"; + +import "google/protobuf/descriptor.proto"; + +extend google.protobuf.EnumOptions { + int32 default_code = 1108; +} + +extend google.protobuf.EnumValueOptions { + int32 code = 1109; +} \ No newline at end of file diff --git a/orm/gorm/api/third_party/gnostic/openapi/discovery/v1/discovery.proto b/orm/gorm/api/third_party/gnostic/openapi/discovery/v1/discovery.proto new file mode 100644 index 0000000..64b604e --- /dev/null +++ b/orm/gorm/api/third_party/gnostic/openapi/discovery/v1/discovery.proto @@ -0,0 +1,269 @@ +// Copyright 2020 Google LLC. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// THIS FILE IS AUTOMATICALLY GENERATED. + +syntax = "proto3"; + +package gnostic.discovery.v1; + +import "google/protobuf/any.proto"; + +// This option lets the proto compiler generate Java code inside the package +// name (see below) instead of inside an outer class. It creates a simpler +// developer experience by reducing one-level of name nesting and be +// consistent with most programming languages that don't support outer classes. +option java_multiple_files = true; + +// The Java outer classname should be the filename in UpperCamelCase. This +// class is only used to hold proto descriptor, so developers don't need to +// work with it directly. +option java_outer_classname = "OpenAPIProto"; + +// The Java package name must be proto package name with proper prefix. +option java_package = "org.discovery_v1"; + +// A reasonable prefix for the Objective-C symbols generated from the package. +// It should at a minimum be 3 characters long, all uppercase, and convention +// is to use an abbreviation of the package name. Something short, but +// hopefully unique enough to not conflict with things that may come along in +// the future. 'GPB' is reserved for the protocol buffer implementation itself. +option objc_class_prefix = "OAS"; + +// The Go package name. +option go_package = "github.com/google/gnostic/discovery;discovery_v1"; + +message Annotations { + repeated string required = 1; +} + +message Any { + google.protobuf.Any value = 1; + string yaml = 2; +} + +message Auth { + Oauth2 oauth2 = 1; +} + +message Document { + string kind = 1; + string discovery_version = 2; + string id = 3; + string name = 4; + string version = 5; + string revision = 6; + string title = 7; + string description = 8; + Icons icons = 9; + string documentation_link = 10; + repeated string labels = 11; + string protocol = 12; + string base_url = 13; + string base_path = 14; + string root_url = 15; + string service_path = 16; + string batch_path = 17; + Parameters parameters = 18; + Auth auth = 19; + repeated string features = 20; + Schemas schemas = 21; + Methods methods = 22; + Resources resources = 23; + string etag = 24; + string owner_domain = 25; + string owner_name = 26; + bool version_module = 27; + string canonical_name = 28; + bool fully_encode_reserved_expansion = 29; + string package_path = 30; + string mtls_root_url = 31; +} + +// Icons that represent the API. +message Icons { + string x16 = 1; + string x32 = 2; +} + +message MediaUpload { + repeated string accept = 1; + string max_size = 2; + Protocols protocols = 3; + bool supports_subscription = 4; +} + +message Method { + string id = 1; + string path = 2; + string http_method = 3; + string description = 4; + Parameters parameters = 5; + repeated string parameter_order = 6; + Request request = 7; + Response response = 8; + repeated string scopes = 9; + bool supports_media_download = 10; + bool supports_media_upload = 11; + bool use_media_download_service = 12; + MediaUpload media_upload = 13; + bool supports_subscription = 14; + string flat_path = 15; + bool etag_required = 16; + string streaming_type = 17; +} + +message Methods { + repeated NamedMethod additional_properties = 1; +} + +// Automatically-generated message used to represent maps of Method as ordered (name,value) pairs. +message NamedMethod { + // Map key + string name = 1; + // Mapped value + Method value = 2; +} + +// Automatically-generated message used to represent maps of Parameter as ordered (name,value) pairs. +message NamedParameter { + // Map key + string name = 1; + // Mapped value + Parameter value = 2; +} + +// Automatically-generated message used to represent maps of Resource as ordered (name,value) pairs. +message NamedResource { + // Map key + string name = 1; + // Mapped value + Resource value = 2; +} + +// Automatically-generated message used to represent maps of Schema as ordered (name,value) pairs. +message NamedSchema { + // Map key + string name = 1; + // Mapped value + Schema value = 2; +} + +// Automatically-generated message used to represent maps of Scope as ordered (name,value) pairs. +message NamedScope { + // Map key + string name = 1; + // Mapped value + Scope value = 2; +} + +message Oauth2 { + Scopes scopes = 1; +} + +message Parameter { + string id = 1; + string type = 2; + string _ref = 3; + string description = 4; + string default = 5; + bool required = 6; + string format = 7; + string pattern = 8; + string minimum = 9; + string maximum = 10; + repeated string enum = 11; + repeated string enum_descriptions = 12; + bool repeated = 13; + string location = 14; + Schemas properties = 15; + Schema additional_properties = 16; + Schema items = 17; + Annotations annotations = 18; +} + +message Parameters { + repeated NamedParameter additional_properties = 1; +} + +message Protocols { + Simple simple = 1; + Resumable resumable = 2; +} + +message Request { + string _ref = 1; + string parameter_name = 2; +} + +message Resource { + Methods methods = 1; + Resources resources = 2; +} + +message Resources { + repeated NamedResource additional_properties = 1; +} + +message Response { + string _ref = 1; +} + +message Resumable { + bool multipart = 1; + string path = 2; +} + +message Schema { + string id = 1; + string type = 2; + string description = 3; + string default = 4; + bool required = 5; + string format = 6; + string pattern = 7; + string minimum = 8; + string maximum = 9; + repeated string enum = 10; + repeated string enum_descriptions = 11; + bool repeated = 12; + string location = 13; + Schemas properties = 14; + Schema additional_properties = 15; + Schema items = 16; + string _ref = 17; + Annotations annotations = 18; + bool read_only = 19; +} + +message Schemas { + repeated NamedSchema additional_properties = 1; +} + +message Scope { + string description = 1; +} + +message Scopes { + repeated NamedScope additional_properties = 1; +} + +message Simple { + bool multipart = 1; + string path = 2; +} + +message StringArray { + repeated string value = 1; +} diff --git a/orm/gorm/api/third_party/gnostic/openapi/v2/openapiv2.proto b/orm/gorm/api/third_party/gnostic/openapi/v2/openapiv2.proto new file mode 100644 index 0000000..ee5e7c0 --- /dev/null +++ b/orm/gorm/api/third_party/gnostic/openapi/v2/openapiv2.proto @@ -0,0 +1,665 @@ +// Copyright 2020 Google LLC. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// THIS FILE IS AUTOMATICALLY GENERATED. + +syntax = "proto3"; + +package gnostic.openapi.v2; + +import "google/protobuf/any.proto"; + +// This option lets the proto compiler generate Java code inside the package +// name (see below) instead of inside an outer class. It creates a simpler +// developer experience by reducing one-level of name nesting and be +// consistent with most programming languages that don't support outer classes. +option java_multiple_files = true; + +// The Java outer classname should be the filename in UpperCamelCase. This +// class is only used to hold proto descriptor, so developers don't need to +// work with it directly. +option java_outer_classname = "OpenAPIProto"; + +// The Java package name must be proto package name with proper prefix. +option java_package = "org.openapi_v2"; + +// A reasonable prefix for the Objective-C symbols generated from the package. +// It should at a minimum be 3 characters long, all uppercase, and convention +// is to use an abbreviation of the package name. Something short, but +// hopefully unique enough to not conflict with things that may come along in +// the future. 'GPB' is reserved for the protocol buffer implementation itself. +option objc_class_prefix = "OAS"; + +// The Go package name. +option go_package = "github.com/google/gnostic/openapiv2;openapi_v2"; + +message AdditionalPropertiesItem { + oneof oneof { + Schema schema = 1; + bool boolean = 2; + } +} + +message Any { + google.protobuf.Any value = 1; + string yaml = 2; +} + +message ApiKeySecurity { + string type = 1; + string name = 2; + string in = 3; + string description = 4; + repeated NamedAny vendor_extension = 5; +} + +message BasicAuthenticationSecurity { + string type = 1; + string description = 2; + repeated NamedAny vendor_extension = 3; +} + +message BodyParameter { + // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. + string description = 1; + // The name of the parameter. + string name = 2; + // Determines the location of the parameter. + string in = 3; + // Determines whether or not this parameter is required or optional. + bool required = 4; + Schema schema = 5; + repeated NamedAny vendor_extension = 6; +} + +// Contact information for the owners of the API. +message Contact { + // The identifying name of the contact person/organization. + string name = 1; + // The URL pointing to the contact information. + string url = 2; + // The email address of the contact person/organization. + string email = 3; + repeated NamedAny vendor_extension = 4; +} + +message Default { + repeated NamedAny additional_properties = 1; +} + +// One or more JSON objects describing the schemas being consumed and produced by the API. +message Definitions { + repeated NamedSchema additional_properties = 1; +} + +message Document { + // The Swagger version of this document. + string swagger = 1; + Info info = 2; + // The host (name or ip) of the API. Example: 'swagger.io' + string host = 3; + // The base path to the API. Example: '/api'. + string base_path = 4; + // The transfer protocol of the API. + repeated string schemes = 5; + // A list of MIME types accepted by the API. + repeated string consumes = 6; + // A list of MIME types the API can produce. + repeated string produces = 7; + Paths paths = 8; + Definitions definitions = 9; + ParameterDefinitions parameters = 10; + ResponseDefinitions responses = 11; + repeated SecurityRequirement security = 12; + SecurityDefinitions security_definitions = 13; + repeated Tag tags = 14; + ExternalDocs external_docs = 15; + repeated NamedAny vendor_extension = 16; +} + +message Examples { + repeated NamedAny additional_properties = 1; +} + +// information about external documentation +message ExternalDocs { + string description = 1; + string url = 2; + repeated NamedAny vendor_extension = 3; +} + +// A deterministic version of a JSON Schema object. +message FileSchema { + string format = 1; + string title = 2; + string description = 3; + Any default = 4; + repeated string required = 5; + string type = 6; + bool read_only = 7; + ExternalDocs external_docs = 8; + Any example = 9; + repeated NamedAny vendor_extension = 10; +} + +message FormDataParameterSubSchema { + // Determines whether or not this parameter is required or optional. + bool required = 1; + // Determines the location of the parameter. + string in = 2; + // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. + string description = 3; + // The name of the parameter. + string name = 4; + // allows sending a parameter by name only or with an empty value. + bool allow_empty_value = 5; + string type = 6; + string format = 7; + PrimitivesItems items = 8; + string collection_format = 9; + Any default = 10; + double maximum = 11; + bool exclusive_maximum = 12; + double minimum = 13; + bool exclusive_minimum = 14; + int64 max_length = 15; + int64 min_length = 16; + string pattern = 17; + int64 max_items = 18; + int64 min_items = 19; + bool unique_items = 20; + repeated Any enum = 21; + double multiple_of = 22; + repeated NamedAny vendor_extension = 23; +} + +message Header { + string type = 1; + string format = 2; + PrimitivesItems items = 3; + string collection_format = 4; + Any default = 5; + double maximum = 6; + bool exclusive_maximum = 7; + double minimum = 8; + bool exclusive_minimum = 9; + int64 max_length = 10; + int64 min_length = 11; + string pattern = 12; + int64 max_items = 13; + int64 min_items = 14; + bool unique_items = 15; + repeated Any enum = 16; + double multiple_of = 17; + string description = 18; + repeated NamedAny vendor_extension = 19; +} + +message HeaderParameterSubSchema { + // Determines whether or not this parameter is required or optional. + bool required = 1; + // Determines the location of the parameter. + string in = 2; + // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. + string description = 3; + // The name of the parameter. + string name = 4; + string type = 5; + string format = 6; + PrimitivesItems items = 7; + string collection_format = 8; + Any default = 9; + double maximum = 10; + bool exclusive_maximum = 11; + double minimum = 12; + bool exclusive_minimum = 13; + int64 max_length = 14; + int64 min_length = 15; + string pattern = 16; + int64 max_items = 17; + int64 min_items = 18; + bool unique_items = 19; + repeated Any enum = 20; + double multiple_of = 21; + repeated NamedAny vendor_extension = 22; +} + +message Headers { + repeated NamedHeader additional_properties = 1; +} + +// General information about the API. +message Info { + // A unique and precise title of the API. + string title = 1; + // A semantic version number of the API. + string version = 2; + // A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed. + string description = 3; + // The terms of service for the API. + string terms_of_service = 4; + Contact contact = 5; + License license = 6; + repeated NamedAny vendor_extension = 7; +} + +message ItemsItem { + repeated Schema schema = 1; +} + +message JsonReference { + string _ref = 1; + string description = 2; +} + +message License { + // The name of the license type. It's encouraged to use an OSI compatible license. + string name = 1; + // The URL pointing to the license. + string url = 2; + repeated NamedAny vendor_extension = 3; +} + +// Automatically-generated message used to represent maps of Any as ordered (name,value) pairs. +message NamedAny { + // Map key + string name = 1; + // Mapped value + Any value = 2; +} + +// Automatically-generated message used to represent maps of Header as ordered (name,value) pairs. +message NamedHeader { + // Map key + string name = 1; + // Mapped value + Header value = 2; +} + +// Automatically-generated message used to represent maps of Parameter as ordered (name,value) pairs. +message NamedParameter { + // Map key + string name = 1; + // Mapped value + Parameter value = 2; +} + +// Automatically-generated message used to represent maps of PathItem as ordered (name,value) pairs. +message NamedPathItem { + // Map key + string name = 1; + // Mapped value + PathItem value = 2; +} + +// Automatically-generated message used to represent maps of Response as ordered (name,value) pairs. +message NamedResponse { + // Map key + string name = 1; + // Mapped value + Response value = 2; +} + +// Automatically-generated message used to represent maps of ResponseValue as ordered (name,value) pairs. +message NamedResponseValue { + // Map key + string name = 1; + // Mapped value + ResponseValue value = 2; +} + +// Automatically-generated message used to represent maps of Schema as ordered (name,value) pairs. +message NamedSchema { + // Map key + string name = 1; + // Mapped value + Schema value = 2; +} + +// Automatically-generated message used to represent maps of SecurityDefinitionsItem as ordered (name,value) pairs. +message NamedSecurityDefinitionsItem { + // Map key + string name = 1; + // Mapped value + SecurityDefinitionsItem value = 2; +} + +// Automatically-generated message used to represent maps of string as ordered (name,value) pairs. +message NamedString { + // Map key + string name = 1; + // Mapped value + string value = 2; +} + +// Automatically-generated message used to represent maps of StringArray as ordered (name,value) pairs. +message NamedStringArray { + // Map key + string name = 1; + // Mapped value + StringArray value = 2; +} + +message NonBodyParameter { + oneof oneof { + HeaderParameterSubSchema header_parameter_sub_schema = 1; + FormDataParameterSubSchema form_data_parameter_sub_schema = 2; + QueryParameterSubSchema query_parameter_sub_schema = 3; + PathParameterSubSchema path_parameter_sub_schema = 4; + } +} + +message Oauth2AccessCodeSecurity { + string type = 1; + string flow = 2; + Oauth2Scopes scopes = 3; + string authorization_url = 4; + string token_url = 5; + string description = 6; + repeated NamedAny vendor_extension = 7; +} + +message Oauth2ApplicationSecurity { + string type = 1; + string flow = 2; + Oauth2Scopes scopes = 3; + string token_url = 4; + string description = 5; + repeated NamedAny vendor_extension = 6; +} + +message Oauth2ImplicitSecurity { + string type = 1; + string flow = 2; + Oauth2Scopes scopes = 3; + string authorization_url = 4; + string description = 5; + repeated NamedAny vendor_extension = 6; +} + +message Oauth2PasswordSecurity { + string type = 1; + string flow = 2; + Oauth2Scopes scopes = 3; + string token_url = 4; + string description = 5; + repeated NamedAny vendor_extension = 6; +} + +message Oauth2Scopes { + repeated NamedString additional_properties = 1; +} + +message Operation { + repeated string tags = 1; + // A brief summary of the operation. + string summary = 2; + // A longer description of the operation, GitHub Flavored Markdown is allowed. + string description = 3; + ExternalDocs external_docs = 4; + // A unique identifier of the operation. + string operation_id = 5; + // A list of MIME types the API can produce. + repeated string produces = 6; + // A list of MIME types the API can consume. + repeated string consumes = 7; + // The parameters needed to send a valid API call. + repeated ParametersItem parameters = 8; + Responses responses = 9; + // The transfer protocol of the API. + repeated string schemes = 10; + bool deprecated = 11; + repeated SecurityRequirement security = 12; + repeated NamedAny vendor_extension = 13; +} + +message Parameter { + oneof oneof { + BodyParameter body_parameter = 1; + NonBodyParameter non_body_parameter = 2; + } +} + +// One or more JSON representations for parameters +message ParameterDefinitions { + repeated NamedParameter additional_properties = 1; +} + +message ParametersItem { + oneof oneof { + Parameter parameter = 1; + JsonReference json_reference = 2; + } +} + +message PathItem { + string _ref = 1; + Operation get = 2; + Operation put = 3; + Operation post = 4; + Operation delete = 5; + Operation options = 6; + Operation head = 7; + Operation patch = 8; + // The parameters needed to send a valid API call. + repeated ParametersItem parameters = 9; + repeated NamedAny vendor_extension = 10; +} + +message PathParameterSubSchema { + // Determines whether or not this parameter is required or optional. + bool required = 1; + // Determines the location of the parameter. + string in = 2; + // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. + string description = 3; + // The name of the parameter. + string name = 4; + string type = 5; + string format = 6; + PrimitivesItems items = 7; + string collection_format = 8; + Any default = 9; + double maximum = 10; + bool exclusive_maximum = 11; + double minimum = 12; + bool exclusive_minimum = 13; + int64 max_length = 14; + int64 min_length = 15; + string pattern = 16; + int64 max_items = 17; + int64 min_items = 18; + bool unique_items = 19; + repeated Any enum = 20; + double multiple_of = 21; + repeated NamedAny vendor_extension = 22; +} + +// Relative paths to the individual endpoints. They must be relative to the 'basePath'. +message Paths { + repeated NamedAny vendor_extension = 1; + repeated NamedPathItem path = 2; +} + +message PrimitivesItems { + string type = 1; + string format = 2; + PrimitivesItems items = 3; + string collection_format = 4; + Any default = 5; + double maximum = 6; + bool exclusive_maximum = 7; + double minimum = 8; + bool exclusive_minimum = 9; + int64 max_length = 10; + int64 min_length = 11; + string pattern = 12; + int64 max_items = 13; + int64 min_items = 14; + bool unique_items = 15; + repeated Any enum = 16; + double multiple_of = 17; + repeated NamedAny vendor_extension = 18; +} + +message Properties { + repeated NamedSchema additional_properties = 1; +} + +message QueryParameterSubSchema { + // Determines whether or not this parameter is required or optional. + bool required = 1; + // Determines the location of the parameter. + string in = 2; + // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. + string description = 3; + // The name of the parameter. + string name = 4; + // allows sending a parameter by name only or with an empty value. + bool allow_empty_value = 5; + string type = 6; + string format = 7; + PrimitivesItems items = 8; + string collection_format = 9; + Any default = 10; + double maximum = 11; + bool exclusive_maximum = 12; + double minimum = 13; + bool exclusive_minimum = 14; + int64 max_length = 15; + int64 min_length = 16; + string pattern = 17; + int64 max_items = 18; + int64 min_items = 19; + bool unique_items = 20; + repeated Any enum = 21; + double multiple_of = 22; + repeated NamedAny vendor_extension = 23; +} + +message Response { + string description = 1; + SchemaItem schema = 2; + Headers headers = 3; + Examples examples = 4; + repeated NamedAny vendor_extension = 5; +} + +// One or more JSON representations for responses +message ResponseDefinitions { + repeated NamedResponse additional_properties = 1; +} + +message ResponseValue { + oneof oneof { + Response response = 1; + JsonReference json_reference = 2; + } +} + +// Response objects names can either be any valid HTTP status code or 'default'. +message Responses { + repeated NamedResponseValue response_code = 1; + repeated NamedAny vendor_extension = 2; +} + +// A deterministic version of a JSON Schema object. +message Schema { + string _ref = 1; + string format = 2; + string title = 3; + string description = 4; + Any default = 5; + double multiple_of = 6; + double maximum = 7; + bool exclusive_maximum = 8; + double minimum = 9; + bool exclusive_minimum = 10; + int64 max_length = 11; + int64 min_length = 12; + string pattern = 13; + int64 max_items = 14; + int64 min_items = 15; + bool unique_items = 16; + int64 max_properties = 17; + int64 min_properties = 18; + repeated string required = 19; + repeated Any enum = 20; + AdditionalPropertiesItem additional_properties = 21; + TypeItem type = 22; + ItemsItem items = 23; + repeated Schema all_of = 24; + Properties properties = 25; + string discriminator = 26; + bool read_only = 27; + Xml xml = 28; + ExternalDocs external_docs = 29; + Any example = 30; + repeated NamedAny vendor_extension = 31; +} + +message SchemaItem { + oneof oneof { + Schema schema = 1; + FileSchema file_schema = 2; + } +} + +message SecurityDefinitions { + repeated NamedSecurityDefinitionsItem additional_properties = 1; +} + +message SecurityDefinitionsItem { + oneof oneof { + BasicAuthenticationSecurity basic_authentication_security = 1; + ApiKeySecurity api_key_security = 2; + Oauth2ImplicitSecurity oauth2_implicit_security = 3; + Oauth2PasswordSecurity oauth2_password_security = 4; + Oauth2ApplicationSecurity oauth2_application_security = 5; + Oauth2AccessCodeSecurity oauth2_access_code_security = 6; + } +} + +message SecurityRequirement { + repeated NamedStringArray additional_properties = 1; +} + +message StringArray { + repeated string value = 1; +} + +message Tag { + string name = 1; + string description = 2; + ExternalDocs external_docs = 3; + repeated NamedAny vendor_extension = 4; +} + +message TypeItem { + repeated string value = 1; +} + +// Any property starting with x- is valid. +message VendorExtension { + repeated NamedAny additional_properties = 1; +} + +message Xml { + string name = 1; + string namespace = 2; + string prefix = 3; + bool attribute = 4; + bool wrapped = 5; + repeated NamedAny vendor_extension = 6; +} diff --git a/orm/gorm/api/third_party/gnostic/openapi/v3/README.md b/orm/gorm/api/third_party/gnostic/openapi/v3/README.md new file mode 100644 index 0000000..0b015bc --- /dev/null +++ b/orm/gorm/api/third_party/gnostic/openapi/v3/README.md @@ -0,0 +1,26 @@ +# OpenAPI v3 Protocol Buffer Models + +This directory contains a Protocol Buffer-language model and related code for +supporting OpenAPI v3. + +Gnostic applications and plugins can use OpenAPIv3.proto to generate Protocol +Buffer support code for their preferred languages. + +OpenAPIv3.go is used by Gnostic to read JSON and YAML OpenAPI descriptions into +the Protocol Buffer-based datastructures generated from OpenAPIv3.proto. + +OpenAPIv3.proto and OpenAPIv3.go are generated by the Gnostic compiler +generator, and OpenAPIv3.pb.go is generated by protoc, the Protocol Buffer +compiler, and protoc-gen-go, the Protocol Buffer Go code generation plugin. + +openapi-3.1.json is a JSON schema for OpenAPI 3.1 that is automatically +generated from the OpenAPI 3.1 specification. It is not an official JSON Schema +for OpenAPI. + +The schema-generator directory contains support code which generates +openapi-3.1.json from the OpenAPI 3.1 specification document (Markdown). + +### How to rebuild + +Run: +`COMPILE-PROTOS.sh` diff --git a/orm/gorm/api/third_party/gnostic/openapi/v3/annotations.proto b/orm/gorm/api/third_party/gnostic/openapi/v3/annotations.proto new file mode 100644 index 0000000..b855751 --- /dev/null +++ b/orm/gorm/api/third_party/gnostic/openapi/v3/annotations.proto @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package gnostic.openapi.v3; + +import "gnostic/openapi/v3/openapiv3.proto"; +import "google/protobuf/descriptor.proto"; + +// This option lets the proto compiler generate Java code inside the package +// name (see below) instead of inside an outer class. It creates a simpler +// developer experience by reducing one-level of name nesting and be +// consistent with most programming languages that don't support outer classes. +option java_multiple_files = true; + +// The Java outer classname should be the filename in UpperCamelCase. This +// class is only used to hold proto descriptor, so developers don't need to +// work with it directly. +option java_outer_classname = "AnnotationsProto"; + +// The Java package name must be proto package name with proper prefix. +option java_package = "org.openapi_v3"; + +// A reasonable prefix for the Objective-C symbols generated from the package. +// It should at a minimum be 3 characters long, all uppercase, and convention +// is to use an abbreviation of the package name. Something short, but +// hopefully unique enough to not conflict with things that may come along in +// the future. 'GPB' is reserved for the protocol buffer implementation itself. +option objc_class_prefix = "OAS"; + +// The Go package name. +option go_package = "github.com/google/gnostic/openapiv3;openapi_v3"; + +extend google.protobuf.FileOptions { + Document document = 1143; +} + +extend google.protobuf.MethodOptions { + Operation operation = 1143; +} + +extend google.protobuf.MessageOptions { + Schema schema = 1143; +} + +extend google.protobuf.FieldOptions { + Schema property = 1143; +} diff --git a/orm/gorm/api/third_party/gnostic/openapi/v3/openapiv3.proto b/orm/gorm/api/third_party/gnostic/openapi/v3/openapiv3.proto new file mode 100644 index 0000000..e783564 --- /dev/null +++ b/orm/gorm/api/third_party/gnostic/openapi/v3/openapiv3.proto @@ -0,0 +1,671 @@ +// Copyright 2020 Google LLC. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// THIS FILE IS AUTOMATICALLY GENERATED. + +syntax = "proto3"; + +package gnostic.openapi.v3; + +import "google/protobuf/any.proto"; + +// This option lets the proto compiler generate Java code inside the package +// name (see below) instead of inside an outer class. It creates a simpler +// developer experience by reducing one-level of name nesting and be +// consistent with most programming languages that don't support outer classes. +option java_multiple_files = true; + +// The Java outer classname should be the filename in UpperCamelCase. This +// class is only used to hold proto descriptor, so developers don't need to +// work with it directly. +option java_outer_classname = "OpenAPIProto"; + +// The Java package name must be proto package name with proper prefix. +option java_package = "org.openapi_v3"; + +// A reasonable prefix for the Objective-C symbols generated from the package. +// It should at a minimum be 3 characters long, all uppercase, and convention +// is to use an abbreviation of the package name. Something short, but +// hopefully unique enough to not conflict with things that may come along in +// the future. 'GPB' is reserved for the protocol buffer implementation itself. +option objc_class_prefix = "OAS"; + +// The Go package name. +option go_package = "github.com/google/gnostic/openapiv3;openapi_v3"; + +message AdditionalPropertiesItem { + oneof oneof { + SchemaOrReference schema_or_reference = 1; + bool boolean = 2; + } +} + +message Any { + google.protobuf.Any value = 1; + string yaml = 2; +} + +message AnyOrExpression { + oneof oneof { + Any any = 1; + Expression expression = 2; + } +} + +// A map of possible out-of band callbacks related to the parent operation. Each value in the map is a Path Item Object that describes a set of requests that may be initiated by the API provider and the expected responses. The key value used to identify the callback object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation. +message Callback { + repeated NamedPathItem path = 1; + repeated NamedAny specification_extension = 2; +} + +message CallbackOrReference { + oneof oneof { + Callback callback = 1; + Reference reference = 2; + } +} + +message CallbacksOrReferences { + repeated NamedCallbackOrReference additional_properties = 1; +} + +// Holds a set of reusable objects for different aspects of the OAS. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object. +message Components { + SchemasOrReferences schemas = 1; + ResponsesOrReferences responses = 2; + ParametersOrReferences parameters = 3; + ExamplesOrReferences examples = 4; + RequestBodiesOrReferences request_bodies = 5; + HeadersOrReferences headers = 6; + SecuritySchemesOrReferences security_schemes = 7; + LinksOrReferences links = 8; + CallbacksOrReferences callbacks = 9; + repeated NamedAny specification_extension = 10; +} + +// Contact information for the exposed API. +message Contact { + string name = 1; + string url = 2; + string email = 3; + repeated NamedAny specification_extension = 4; +} + +message DefaultType { + oneof oneof { + double number = 1; + bool boolean = 2; + string string = 3; + } +} + +// When request bodies or response payloads may be one of a number of different schemas, a `discriminator` object can be used to aid in serialization, deserialization, and validation. The discriminator is a specific object in a schema which is used to inform the consumer of the specification of an alternative schema based on the value associated with it. When using the discriminator, _inline_ schemas will not be considered. +message Discriminator { + string property_name = 1; + Strings mapping = 2; + repeated NamedAny specification_extension = 3; +} + +message Document { + string openapi = 1; + Info info = 2; + repeated Server servers = 3; + Paths paths = 4; + Components components = 5; + repeated SecurityRequirement security = 6; + repeated Tag tags = 7; + ExternalDocs external_docs = 8; + repeated NamedAny specification_extension = 9; +} + +// A single encoding definition applied to a single schema property. +message Encoding { + string content_type = 1; + HeadersOrReferences headers = 2; + string style = 3; + bool explode = 4; + bool allow_reserved = 5; + repeated NamedAny specification_extension = 6; +} + +message Encodings { + repeated NamedEncoding additional_properties = 1; +} + +message Example { + string summary = 1; + string description = 2; + Any value = 3; + string external_value = 4; + repeated NamedAny specification_extension = 5; +} + +message ExampleOrReference { + oneof oneof { + Example example = 1; + Reference reference = 2; + } +} + +message ExamplesOrReferences { + repeated NamedExampleOrReference additional_properties = 1; +} + +message Expression { + repeated NamedAny additional_properties = 1; +} + +// Allows referencing an external resource for extended documentation. +message ExternalDocs { + string description = 1; + string url = 2; + repeated NamedAny specification_extension = 3; +} + +// The Header Object follows the structure of the Parameter Object with the following changes: 1. `name` MUST NOT be specified, it is given in the corresponding `headers` map. 1. `in` MUST NOT be specified, it is implicitly in `header`. 1. All traits that are affected by the location MUST be applicable to a location of `header` (for example, `style`). +message Header { + string description = 1; + bool required = 2; + bool deprecated = 3; + bool allow_empty_value = 4; + string style = 5; + bool explode = 6; + bool allow_reserved = 7; + SchemaOrReference schema = 8; + Any example = 9; + ExamplesOrReferences examples = 10; + MediaTypes content = 11; + repeated NamedAny specification_extension = 12; +} + +message HeaderOrReference { + oneof oneof { + Header header = 1; + Reference reference = 2; + } +} + +message HeadersOrReferences { + repeated NamedHeaderOrReference additional_properties = 1; +} + +// The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience. +message Info { + string title = 1; + string description = 2; + string terms_of_service = 3; + Contact contact = 4; + License license = 5; + string version = 6; + repeated NamedAny specification_extension = 7; + string summary = 8; +} + +message ItemsItem { + repeated SchemaOrReference schema_or_reference = 1; +} + +// License information for the exposed API. +message License { + string name = 1; + string url = 2; + repeated NamedAny specification_extension = 3; +} + +// The `Link object` represents a possible design-time link for a response. The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations. Unlike _dynamic_ links (i.e. links provided **in** the response payload), the OAS linking mechanism does not require link information in the runtime response. For computing links, and providing instructions to execute them, a runtime expression is used for accessing values in an operation and using them as parameters while invoking the linked operation. +message Link { + string operation_ref = 1; + string operation_id = 2; + AnyOrExpression parameters = 3; + AnyOrExpression request_body = 4; + string description = 5; + Server server = 6; + repeated NamedAny specification_extension = 7; +} + +message LinkOrReference { + oneof oneof { + Link link = 1; + Reference reference = 2; + } +} + +message LinksOrReferences { + repeated NamedLinkOrReference additional_properties = 1; +} + +// Each Media Type Object provides schema and examples for the media type identified by its key. +message MediaType { + SchemaOrReference schema = 1; + Any example = 2; + ExamplesOrReferences examples = 3; + Encodings encoding = 4; + repeated NamedAny specification_extension = 5; +} + +message MediaTypes { + repeated NamedMediaType additional_properties = 1; +} + +// Automatically-generated message used to represent maps of Any as ordered (name,value) pairs. +message NamedAny { + // Map key + string name = 1; + // Mapped value + Any value = 2; +} + +// Automatically-generated message used to represent maps of CallbackOrReference as ordered (name,value) pairs. +message NamedCallbackOrReference { + // Map key + string name = 1; + // Mapped value + CallbackOrReference value = 2; +} + +// Automatically-generated message used to represent maps of Encoding as ordered (name,value) pairs. +message NamedEncoding { + // Map key + string name = 1; + // Mapped value + Encoding value = 2; +} + +// Automatically-generated message used to represent maps of ExampleOrReference as ordered (name,value) pairs. +message NamedExampleOrReference { + // Map key + string name = 1; + // Mapped value + ExampleOrReference value = 2; +} + +// Automatically-generated message used to represent maps of HeaderOrReference as ordered (name,value) pairs. +message NamedHeaderOrReference { + // Map key + string name = 1; + // Mapped value + HeaderOrReference value = 2; +} + +// Automatically-generated message used to represent maps of LinkOrReference as ordered (name,value) pairs. +message NamedLinkOrReference { + // Map key + string name = 1; + // Mapped value + LinkOrReference value = 2; +} + +// Automatically-generated message used to represent maps of MediaType as ordered (name,value) pairs. +message NamedMediaType { + // Map key + string name = 1; + // Mapped value + MediaType value = 2; +} + +// Automatically-generated message used to represent maps of ParameterOrReference as ordered (name,value) pairs. +message NamedParameterOrReference { + // Map key + string name = 1; + // Mapped value + ParameterOrReference value = 2; +} + +// Automatically-generated message used to represent maps of PathItem as ordered (name,value) pairs. +message NamedPathItem { + // Map key + string name = 1; + // Mapped value + PathItem value = 2; +} + +// Automatically-generated message used to represent maps of RequestBodyOrReference as ordered (name,value) pairs. +message NamedRequestBodyOrReference { + // Map key + string name = 1; + // Mapped value + RequestBodyOrReference value = 2; +} + +// Automatically-generated message used to represent maps of ResponseOrReference as ordered (name,value) pairs. +message NamedResponseOrReference { + // Map key + string name = 1; + // Mapped value + ResponseOrReference value = 2; +} + +// Automatically-generated message used to represent maps of SchemaOrReference as ordered (name,value) pairs. +message NamedSchemaOrReference { + // Map key + string name = 1; + // Mapped value + SchemaOrReference value = 2; +} + +// Automatically-generated message used to represent maps of SecuritySchemeOrReference as ordered (name,value) pairs. +message NamedSecuritySchemeOrReference { + // Map key + string name = 1; + // Mapped value + SecuritySchemeOrReference value = 2; +} + +// Automatically-generated message used to represent maps of ServerVariable as ordered (name,value) pairs. +message NamedServerVariable { + // Map key + string name = 1; + // Mapped value + ServerVariable value = 2; +} + +// Automatically-generated message used to represent maps of string as ordered (name,value) pairs. +message NamedString { + // Map key + string name = 1; + // Mapped value + string value = 2; +} + +// Automatically-generated message used to represent maps of StringArray as ordered (name,value) pairs. +message NamedStringArray { + // Map key + string name = 1; + // Mapped value + StringArray value = 2; +} + +// Configuration details for a supported OAuth Flow +message OauthFlow { + string authorization_url = 1; + string token_url = 2; + string refresh_url = 3; + Strings scopes = 4; + repeated NamedAny specification_extension = 5; +} + +// Allows configuration of the supported OAuth Flows. +message OauthFlows { + OauthFlow implicit = 1; + OauthFlow password = 2; + OauthFlow client_credentials = 3; + OauthFlow authorization_code = 4; + repeated NamedAny specification_extension = 5; +} + +message Object { + repeated NamedAny additional_properties = 1; +} + +// Describes a single API operation on a path. +message Operation { + repeated string tags = 1; + string summary = 2; + string description = 3; + ExternalDocs external_docs = 4; + string operation_id = 5; + repeated ParameterOrReference parameters = 6; + RequestBodyOrReference request_body = 7; + Responses responses = 8; + CallbacksOrReferences callbacks = 9; + bool deprecated = 10; + repeated SecurityRequirement security = 11; + repeated Server servers = 12; + repeated NamedAny specification_extension = 13; +} + +// Describes a single operation parameter. A unique parameter is defined by a combination of a name and location. +message Parameter { + string name = 1; + string in = 2; + string description = 3; + bool required = 4; + bool deprecated = 5; + bool allow_empty_value = 6; + string style = 7; + bool explode = 8; + bool allow_reserved = 9; + SchemaOrReference schema = 10; + Any example = 11; + ExamplesOrReferences examples = 12; + MediaTypes content = 13; + repeated NamedAny specification_extension = 14; +} + +message ParameterOrReference { + oneof oneof { + Parameter parameter = 1; + Reference reference = 2; + } +} + +message ParametersOrReferences { + repeated NamedParameterOrReference additional_properties = 1; +} + +// Describes the operations available on a single path. A Path Item MAY be empty, due to ACL constraints. The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available. +message PathItem { + string _ref = 1; + string summary = 2; + string description = 3; + Operation get = 4; + Operation put = 5; + Operation post = 6; + Operation delete = 7; + Operation options = 8; + Operation head = 9; + Operation patch = 10; + Operation trace = 11; + repeated Server servers = 12; + repeated ParameterOrReference parameters = 13; + repeated NamedAny specification_extension = 14; +} + +// Holds the relative paths to the individual endpoints and their operations. The path is appended to the URL from the `Server Object` in order to construct the full URL. The Paths MAY be empty, due to ACL constraints. +message Paths { + repeated NamedPathItem path = 1; + repeated NamedAny specification_extension = 2; +} + +message Properties { + repeated NamedSchemaOrReference additional_properties = 1; +} + +// A simple object to allow referencing other components in the specification, internally and externally. The Reference Object is defined by JSON Reference and follows the same structure, behavior and rules. For this specification, reference resolution is accomplished as defined by the JSON Reference specification and not by the JSON Schema specification. +message Reference { + string _ref = 1; + string summary = 2; + string description = 3; +} + +message RequestBodiesOrReferences { + repeated NamedRequestBodyOrReference additional_properties = 1; +} + +// Describes a single request body. +message RequestBody { + string description = 1; + MediaTypes content = 2; + bool required = 3; + repeated NamedAny specification_extension = 4; +} + +message RequestBodyOrReference { + oneof oneof { + RequestBody request_body = 1; + Reference reference = 2; + } +} + +// Describes a single response from an API Operation, including design-time, static `links` to operations based on the response. +message Response { + string description = 1; + HeadersOrReferences headers = 2; + MediaTypes content = 3; + LinksOrReferences links = 4; + repeated NamedAny specification_extension = 5; +} + +message ResponseOrReference { + oneof oneof { + Response response = 1; + Reference reference = 2; + } +} + +// A container for the expected responses of an operation. The container maps a HTTP response code to the expected response. The documentation is not necessarily expected to cover all possible HTTP response codes because they may not be known in advance. However, documentation is expected to cover a successful operation response and any known errors. The `default` MAY be used as a default response object for all HTTP codes that are not covered individually by the specification. The `Responses Object` MUST contain at least one response code, and it SHOULD be the response for a successful operation call. +message Responses { + ResponseOrReference default = 1; + repeated NamedResponseOrReference response_or_reference = 2; + repeated NamedAny specification_extension = 3; +} + +message ResponsesOrReferences { + repeated NamedResponseOrReference additional_properties = 1; +} + +// The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is an extended subset of the JSON Schema Specification Wright Draft 00. For more information about the properties, see JSON Schema Core and JSON Schema Validation. Unless stated otherwise, the property definitions follow the JSON Schema. +message Schema { + bool nullable = 1; + Discriminator discriminator = 2; + bool read_only = 3; + bool write_only = 4; + Xml xml = 5; + ExternalDocs external_docs = 6; + Any example = 7; + bool deprecated = 8; + string title = 9; + double multiple_of = 10; + double maximum = 11; + bool exclusive_maximum = 12; + double minimum = 13; + bool exclusive_minimum = 14; + int64 max_length = 15; + int64 min_length = 16; + string pattern = 17; + int64 max_items = 18; + int64 min_items = 19; + bool unique_items = 20; + int64 max_properties = 21; + int64 min_properties = 22; + repeated string required = 23; + repeated Any enum = 24; + string type = 25; + repeated SchemaOrReference all_of = 26; + repeated SchemaOrReference one_of = 27; + repeated SchemaOrReference any_of = 28; + Schema not = 29; + ItemsItem items = 30; + Properties properties = 31; + AdditionalPropertiesItem additional_properties = 32; + DefaultType default = 33; + string description = 34; + string format = 35; + repeated NamedAny specification_extension = 36; +} + +message SchemaOrReference { + oneof oneof { + Schema schema = 1; + Reference reference = 2; + } +} + +message SchemasOrReferences { + repeated NamedSchemaOrReference additional_properties = 1; +} + +// Lists the required security schemes to execute this operation. The name used for each property MUST correspond to a security scheme declared in the Security Schemes under the Components Object. Security Requirement Objects that contain multiple schemes require that all schemes MUST be satisfied for a request to be authorized. This enables support for scenarios where multiple query parameters or HTTP headers are required to convey security information. When a list of Security Requirement Objects is defined on the OpenAPI Object or Operation Object, only one of the Security Requirement Objects in the list needs to be satisfied to authorize the request. +message SecurityRequirement { + repeated NamedStringArray additional_properties = 1; +} + +// Defines a security scheme that can be used by the operations. Supported schemes are HTTP authentication, an API key (either as a header, a cookie parameter or as a query parameter), mutual TLS (use of a client certificate), OAuth2's common flows (implicit, password, application and access code) as defined in RFC6749, and OpenID Connect. Please note that currently (2019) the implicit flow is about to be deprecated OAuth 2.0 Security Best Current Practice. Recommended for most use case is Authorization Code Grant flow with PKCE. +message SecurityScheme { + string type = 1; + string description = 2; + string name = 3; + string in = 4; + string scheme = 5; + string bearer_format = 6; + OauthFlows flows = 7; + string open_id_connect_url = 8; + repeated NamedAny specification_extension = 9; +} + +message SecuritySchemeOrReference { + oneof oneof { + SecurityScheme security_scheme = 1; + Reference reference = 2; + } +} + +message SecuritySchemesOrReferences { + repeated NamedSecuritySchemeOrReference additional_properties = 1; +} + +// An object representing a Server. +message Server { + string url = 1; + string description = 2; + ServerVariables variables = 3; + repeated NamedAny specification_extension = 4; +} + +// An object representing a Server Variable for server URL template substitution. +message ServerVariable { + repeated string enum = 1; + string default = 2; + string description = 3; + repeated NamedAny specification_extension = 4; +} + +message ServerVariables { + repeated NamedServerVariable additional_properties = 1; +} + +// Any property starting with x- is valid. +message SpecificationExtension { + oneof oneof { + double number = 1; + bool boolean = 2; + string string = 3; + } +} + +message StringArray { + repeated string value = 1; +} + +message Strings { + repeated NamedString additional_properties = 1; +} + +// Adds metadata to a single tag that is used by the Operation Object. It is not mandatory to have a Tag Object per tag defined in the Operation Object instances. +message Tag { + string name = 1; + string description = 2; + ExternalDocs external_docs = 3; + repeated NamedAny specification_extension = 4; +} + +// A metadata object that allows for more fine-tuned XML model definitions. When using arrays, XML element names are *not* inferred (for singular/plural forms) and the `name` property SHOULD be used to add that information. See examples for expected behavior. +message Xml { + string name = 1; + string namespace = 2; + string prefix = 3; + bool attribute = 4; + bool wrapped = 5; + repeated NamedAny specification_extension = 6; +} diff --git a/orm/gorm/api/third_party/google/api/annotations.proto b/orm/gorm/api/third_party/google/api/annotations.proto new file mode 100644 index 0000000..d18aeb5 --- /dev/null +++ b/orm/gorm/api/third_party/google/api/annotations.proto @@ -0,0 +1,31 @@ +// Copyright 2015 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +import "google/api/http.proto"; +import "google/protobuf/descriptor.proto"; + +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "AnnotationsProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +extend google.protobuf.MethodOptions { + // See `HttpRule`. + HttpRule http = 72295728; +} diff --git a/orm/gorm/api/third_party/google/api/field_behavior.proto b/orm/gorm/api/third_party/google/api/field_behavior.proto new file mode 100644 index 0000000..c4abe3b --- /dev/null +++ b/orm/gorm/api/third_party/google/api/field_behavior.proto @@ -0,0 +1,90 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +import "google/protobuf/descriptor.proto"; + +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "FieldBehaviorProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +extend google.protobuf.FieldOptions { + // A designation of a specific field behavior (required, output only, etc.) + // in protobuf messages. + // + // Examples: + // + // string name = 1 [(google.api.field_behavior) = REQUIRED]; + // State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + // google.protobuf.Duration ttl = 1 + // [(google.api.field_behavior) = INPUT_ONLY]; + // google.protobuf.Timestamp expire_time = 1 + // [(google.api.field_behavior) = OUTPUT_ONLY, + // (google.api.field_behavior) = IMMUTABLE]; + repeated google.api.FieldBehavior field_behavior = 1052; +} + +// An indicator of the behavior of a given field (for example, that a field +// is required in requests, or given as output but ignored as input). +// This **does not** change the behavior in protocol buffers itself; it only +// denotes the behavior and may affect how API tooling handles the field. +// +// Note: This enum **may** receive new values in the future. +enum FieldBehavior { + // Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0; + + // Specifically denotes a field as optional. + // While all fields in protocol buffers are optional, this may be specified + // for emphasis if appropriate. + OPTIONAL = 1; + + // Denotes a field as required. + // This indicates that the field **must** be provided as part of the request, + // and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2; + + // Denotes a field as output only. + // This indicates that the field is provided in responses, but including the + // field in a request does nothing (the server *must* ignore it and + // *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3; + + // Denotes a field as input only. + // This indicates that the field is provided in requests, and the + // corresponding field is not included in output. + INPUT_ONLY = 4; + + // Denotes a field as immutable. + // This indicates that the field may be set once in a request to create a + // resource, but may not be changed thereafter. + IMMUTABLE = 5; + + // Denotes that a (repeated) field is an unordered list. + // This indicates that the service may provide the elements of the list + // in any arbitrary order, rather than the order the user originally + // provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6; + + // Denotes that this field returns a non-empty default value if not set. + // This indicates that if the user provides the empty value in a request, + // a non-empty value will be returned. The user will not be aware of what + // non-empty value to expect. + NON_EMPTY_DEFAULT = 7; +} diff --git a/orm/gorm/api/third_party/google/api/http.proto b/orm/gorm/api/third_party/google/api/http.proto new file mode 100644 index 0000000..2965740 --- /dev/null +++ b/orm/gorm/api/third_party/google/api/http.proto @@ -0,0 +1,375 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "HttpProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +// Defines the HTTP configuration for an API service. It contains a list of +// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method +// to one or more HTTP REST API methods. +message Http { + // A list of HTTP configuration rules that apply to individual API methods. + // + // **NOTE:** All service configuration rules follow "last one wins" order. + repeated HttpRule rules = 1; + + // When set to true, URL path parameters will be fully URI-decoded except in + // cases of single segment matches in reserved expansion, where "%2F" will be + // left encoded. + // + // The default behavior is to not decode RFC 6570 reserved characters in multi + // segment matches. + bool fully_decode_reserved_expansion = 2; +} + +// # gRPC Transcoding +// +// gRPC Transcoding is a feature for mapping between a gRPC method and one or +// more HTTP REST endpoints. It allows developers to build a single API service +// that supports both gRPC APIs and REST APIs. Many systems, including [Google +// APIs](https://github.com/googleapis/googleapis), +// [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC +// Gateway](https://github.com/grpc-ecosystem/grpc-gateway), +// and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature +// and use it for large scale production services. +// +// `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies +// how different portions of the gRPC request message are mapped to the URL +// path, URL query parameters, and HTTP request body. It also controls how the +// gRPC response message is mapped to the HTTP response body. `HttpRule` is +// typically specified as an `google.api.http` annotation on the gRPC method. +// +// Each mapping specifies a URL path template and an HTTP method. The path +// template may refer to one or more fields in the gRPC request message, as long +// as each field is a non-repeated field with a primitive (non-message) type. +// The path template controls how fields of the request message are mapped to +// the URL path. +// +// Example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get: "/v1/{name=messages/*}" +// }; +// } +// } +// message GetMessageRequest { +// string name = 1; // Mapped to URL path. +// } +// message Message { +// string text = 1; // The resource content. +// } +// +// This enables an HTTP REST to gRPC mapping as below: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` +// +// Any fields in the request message which are not bound by the path template +// automatically become HTTP query parameters if there is no HTTP request body. +// For example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get:"/v1/messages/{message_id}" +// }; +// } +// } +// message GetMessageRequest { +// message SubMessage { +// string subfield = 1; +// } +// string message_id = 1; // Mapped to URL path. +// int64 revision = 2; // Mapped to URL query parameter `revision`. +// SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. +// } +// +// This enables a HTTP JSON to RPC mapping as below: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | +// `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: +// "foo"))` +// +// Note that fields which are mapped to URL query parameters must have a +// primitive type or a repeated primitive type or a non-repeated message type. +// In the case of a repeated type, the parameter can be repeated in the URL +// as `...?param=A¶m=B`. In the case of a message type, each field of the +// message is mapped to a separate parameter, such as +// `...?foo.a=A&foo.b=B&foo.c=C`. +// +// For HTTP methods that allow a request body, the `body` field +// specifies the mapping. Consider a REST update method on the +// message resource collection: +// +// service Messaging { +// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { +// option (google.api.http) = { +// patch: "/v1/messages/{message_id}" +// body: "message" +// }; +// } +// } +// message UpdateMessageRequest { +// string message_id = 1; // mapped to the URL +// Message message = 2; // mapped to the body +// } +// +// The following HTTP JSON to RPC mapping is enabled, where the +// representation of the JSON in the request body is determined by +// protos JSON encoding: +// +// HTTP | gRPC +// -----|----- +// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: +// "123456" message { text: "Hi!" })` +// +// The special name `*` can be used in the body mapping to define that +// every field not bound by the path template should be mapped to the +// request body. This enables the following alternative definition of +// the update method: +// +// service Messaging { +// rpc UpdateMessage(Message) returns (Message) { +// option (google.api.http) = { +// patch: "/v1/messages/{message_id}" +// body: "*" +// }; +// } +// } +// message Message { +// string message_id = 1; +// string text = 2; +// } +// +// +// The following HTTP JSON to RPC mapping is enabled: +// +// HTTP | gRPC +// -----|----- +// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: +// "123456" text: "Hi!")` +// +// Note that when using `*` in the body mapping, it is not possible to +// have HTTP parameters, as all fields not bound by the path end in +// the body. This makes this option more rarely used in practice when +// defining REST APIs. The common usage of `*` is in custom methods +// which don't use the URL at all for transferring data. +// +// It is possible to define multiple HTTP methods for one RPC by using +// the `additional_bindings` option. Example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get: "/v1/messages/{message_id}" +// additional_bindings { +// get: "/v1/users/{user_id}/messages/{message_id}" +// } +// }; +// } +// } +// message GetMessageRequest { +// string message_id = 1; +// string user_id = 2; +// } +// +// This enables the following two alternative HTTP JSON to RPC mappings: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` +// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: +// "123456")` +// +// ## Rules for HTTP mapping +// +// 1. Leaf request fields (recursive expansion nested messages in the request +// message) are classified into three categories: +// - Fields referred by the path template. They are passed via the URL path. +// - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP +// request body. +// - All other fields are passed via the URL query parameters, and the +// parameter name is the field path in the request message. A repeated +// field can be represented as multiple query parameters under the same +// name. +// 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields +// are passed via URL path and HTTP request body. +// 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all +// fields are passed via URL path and URL query parameters. +// +// ### Path template syntax +// +// Template = "/" Segments [ Verb ] ; +// Segments = Segment { "/" Segment } ; +// Segment = "*" | "**" | LITERAL | Variable ; +// Variable = "{" FieldPath [ "=" Segments ] "}" ; +// FieldPath = IDENT { "." IDENT } ; +// Verb = ":" LITERAL ; +// +// The syntax `*` matches a single URL path segment. The syntax `**` matches +// zero or more URL path segments, which must be the last part of the URL path +// except the `Verb`. +// +// The syntax `Variable` matches part of the URL path as specified by its +// template. A variable template must not contain other variables. If a variable +// matches a single path segment, its template may be omitted, e.g. `{var}` +// is equivalent to `{var=*}`. +// +// The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` +// contains any reserved character, such characters should be percent-encoded +// before the matching. +// +// If a variable contains exactly one path segment, such as `"{var}"` or +// `"{var=*}"`, when such a variable is expanded into a URL path on the client +// side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The +// server side does the reverse decoding. Such variables show up in the +// [Discovery +// Document](https://developers.google.com/discovery/v1/reference/apis) as +// `{var}`. +// +// If a variable contains multiple path segments, such as `"{var=foo/*}"` +// or `"{var=**}"`, when such a variable is expanded into a URL path on the +// client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. +// The server side does the reverse decoding, except "%2F" and "%2f" are left +// unchanged. Such variables show up in the +// [Discovery +// Document](https://developers.google.com/discovery/v1/reference/apis) as +// `{+var}`. +// +// ## Using gRPC API Service Configuration +// +// gRPC API Service Configuration (service config) is a configuration language +// for configuring a gRPC service to become a user-facing product. The +// service config is simply the YAML representation of the `google.api.Service` +// proto message. +// +// As an alternative to annotating your proto file, you can configure gRPC +// transcoding in your service config YAML files. You do this by specifying a +// `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same +// effect as the proto annotation. This can be particularly useful if you +// have a proto that is reused in multiple services. Note that any transcoding +// specified in the service config will override any matching transcoding +// configuration in the proto. +// +// Example: +// +// http: +// rules: +// # Selects a gRPC method and applies HttpRule to it. +// - selector: example.v1.Messaging.GetMessage +// get: /v1/messages/{message_id}/{sub.subfield} +// +// ## Special notes +// +// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the +// proto to JSON conversion must follow the [proto3 +// specification](https://developers.google.com/protocol-buffers/docs/proto3#json). +// +// While the single segment variable follows the semantics of +// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String +// Expansion, the multi segment variable **does not** follow RFC 6570 Section +// 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion +// does not expand special characters like `?` and `#`, which would lead +// to invalid URLs. As the result, gRPC Transcoding uses a custom encoding +// for multi segment variables. +// +// The path variables **must not** refer to any repeated or mapped field, +// because client libraries are not capable of handling such variable expansion. +// +// The path variables **must not** capture the leading "/" character. The reason +// is that the most common use case "{var}" does not capture the leading "/" +// character. For consistency, all path variables must share the same behavior. +// +// Repeated message fields must not be mapped to URL query parameters, because +// no client library can support such complicated mapping. +// +// If an API needs to use a JSON array for request or response body, it can map +// the request or response body to a repeated field. However, some gRPC +// Transcoding implementations may not support this feature. +message HttpRule { + // Selects a method to which this rule applies. + // + // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + string selector = 1; + + // Determines the URL pattern is matched by this rules. This pattern can be + // used with any of the {get|put|post|delete|patch} methods. A custom method + // can be defined using the 'custom' field. + oneof pattern { + // Maps to HTTP GET. Used for listing and getting information about + // resources. + string get = 2; + + // Maps to HTTP PUT. Used for replacing a resource. + string put = 3; + + // Maps to HTTP POST. Used for creating a resource or performing an action. + string post = 4; + + // Maps to HTTP DELETE. Used for deleting a resource. + string delete = 5; + + // Maps to HTTP PATCH. Used for updating a resource. + string patch = 6; + + // The custom pattern is used for specifying an HTTP method that is not + // included in the `pattern` field, such as HEAD, or "*" to leave the + // HTTP method unspecified for this rule. The wild-card rule is useful + // for services that provide content to Web (HTML) clients. + CustomHttpPattern custom = 8; + } + + // The name of the request field whose value is mapped to the HTTP request + // body, or `*` for mapping all request fields not captured by the path + // pattern to the HTTP body, or omitted for not having any HTTP request body. + // + // NOTE: the referred field must be present at the top-level of the request + // message type. + string body = 7; + + // Optional. The name of the response field whose value is mapped to the HTTP + // response body. When omitted, the entire response message will be used + // as the HTTP response body. + // + // NOTE: The referred field must be present at the top-level of the response + // message type. + string response_body = 12; + + // Additional HTTP bindings for the selector. Nested bindings must + // not contain an `additional_bindings` field themselves (that is, + // the nesting may only be one level deep). + repeated HttpRule additional_bindings = 11; +} + +// A custom pattern is used for defining custom HTTP verb. +message CustomHttpPattern { + // The name of this custom HTTP verb. + string kind = 1; + + // The path matched by this custom verb. + string path = 2; +} diff --git a/orm/gorm/api/third_party/google/api/httpbody.proto b/orm/gorm/api/third_party/google/api/httpbody.proto new file mode 100644 index 0000000..950be8f --- /dev/null +++ b/orm/gorm/api/third_party/google/api/httpbody.proto @@ -0,0 +1,81 @@ +// Copyright 2015 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +import "google/protobuf/any.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "HttpBodyProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +// Message that represents an arbitrary HTTP body. It should only be used for +// payload formats that can't be represented as JSON, such as raw binary or +// an HTML page. +// +// +// This message can be used both in streaming and non-streaming API methods in +// the request as well as the response. +// +// It can be used as a top-level request field, which is convenient if one +// wants to extract parameters from either the URL or HTTP template into the +// request fields and also want access to the raw HTTP body. +// +// Example: +// +// message GetResourceRequest { +// // A unique request id. +// string request_id = 1; +// +// // The raw HTTP body is bound to this field. +// google.api.HttpBody http_body = 2; +// +// } +// +// service ResourceService { +// rpc GetResource(GetResourceRequest) +// returns (google.api.HttpBody); +// rpc UpdateResource(google.api.HttpBody) +// returns (google.protobuf.Empty); +// +// } +// +// Example with streaming methods: +// +// service CaldavService { +// rpc GetCalendar(stream google.api.HttpBody) +// returns (stream google.api.HttpBody); +// rpc UpdateCalendar(stream google.api.HttpBody) +// returns (stream google.api.HttpBody); +// +// } +// +// Use of this type only changes how the request and response bodies are +// handled, all other features will continue to work unchanged. +message HttpBody { + // The HTTP Content-Type header value specifying the content type of the body. + string content_type = 1; + + // The HTTP request/response body as raw binary. + bytes data = 2; + + // Application specific response metadata. Must be set in the first response + // for streaming APIs. + repeated google.protobuf.Any extensions = 3; +} diff --git a/orm/gorm/api/third_party/google/protobuf/any.proto b/orm/gorm/api/third_party/google/protobuf/any.proto new file mode 100644 index 0000000..c9be854 --- /dev/null +++ b/orm/gorm/api/third_party/google/protobuf/any.proto @@ -0,0 +1,155 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "github.com/golang/protobuf/ptypes/any"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "AnyProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// `Any` contains an arbitrary serialized protocol buffer message along with a +// URL that describes the type of the serialized message. +// +// Protobuf library provides support to pack/unpack Any values in the form +// of utility functions or additional generated methods of the Any type. +// +// Example 1: Pack and unpack a message in C++. +// +// Foo foo = ...; +// Any any; +// any.PackFrom(foo); +// ... +// if (any.UnpackTo(&foo)) { +// ... +// } +// +// Example 2: Pack and unpack a message in Java. +// +// Foo foo = ...; +// Any any = Any.pack(foo); +// ... +// if (any.is(Foo.class)) { +// foo = any.unpack(Foo.class); +// } +// +// Example 3: Pack and unpack a message in Python. +// +// foo = Foo(...) +// any = Any() +// any.Pack(foo) +// ... +// if any.Is(Foo.DESCRIPTOR): +// any.Unpack(foo) +// ... +// +// Example 4: Pack and unpack a message in Go +// +// foo := &pb.Foo{...} +// any, err := ptypes.MarshalAny(foo) +// ... +// foo := &pb.Foo{} +// if err := ptypes.UnmarshalAny(any, foo); err != nil { +// ... +// } +// +// The pack methods provided by protobuf library will by default use +// 'type.googleapis.com/full.type.name' as the type URL and the unpack +// methods only use the fully qualified type name after the last '/' +// in the type URL, for example "foo.bar.com/x/y.z" will yield type +// name "y.z". +// +// +// JSON +// ==== +// The JSON representation of an `Any` value uses the regular +// representation of the deserialized, embedded message, with an +// additional field `@type` which contains the type URL. Example: +// +// package google.profile; +// message Person { +// string first_name = 1; +// string last_name = 2; +// } +// +// { +// "@type": "type.googleapis.com/google.profile.Person", +// "firstName": , +// "lastName": +// } +// +// If the embedded message type is well-known and has a custom JSON +// representation, that representation will be embedded adding a field +// `value` which holds the custom JSON in addition to the `@type` +// field. Example (for message [google.protobuf.Duration][]): +// +// { +// "@type": "type.googleapis.com/google.protobuf.Duration", +// "value": "1.212s" +// } +// +message Any { + // A URL/resource name that uniquely identifies the type of the serialized + // protocol buffer message. This string must contain at least + // one "/" character. The last segment of the URL's path must represent + // the fully qualified name of the type (as in + // `path/google.protobuf.Duration`). The name should be in a canonical form + // (e.g., leading "." is not accepted). + // + // In practice, teams usually precompile into the binary all types that they + // expect it to use in the context of Any. However, for URLs which use the + // scheme `http`, `https`, or no scheme, one can optionally set up a type + // server that maps type URLs to message definitions as follows: + // + // * If no scheme is provided, `https` is assumed. + // * An HTTP GET on the URL must yield a [google.protobuf.Type][] + // value in binary format, or produce an error. + // * Applications are allowed to cache lookup results based on the + // URL, or have them precompiled into a binary to avoid any + // lookup. Therefore, binary compatibility needs to be preserved + // on changes to types. (Use versioned type names to manage + // breaking changes.) + // + // Note: this functionality is not currently available in the official + // protobuf release, and it is not used for type URLs beginning with + // type.googleapis.com. + // + // Schemes other than `http`, `https` (or the empty scheme) might be + // used with implementation specific semantics. + // + string type_url = 1; + + // Must be a valid serialized protocol buffer of the above specified type. + bytes value = 2; +} diff --git a/orm/gorm/api/third_party/google/protobuf/api.proto b/orm/gorm/api/third_party/google/protobuf/api.proto new file mode 100644 index 0000000..f37ee2f --- /dev/null +++ b/orm/gorm/api/third_party/google/protobuf/api.proto @@ -0,0 +1,210 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +import "google/protobuf/source_context.proto"; +import "google/protobuf/type.proto"; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "ApiProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option go_package = "google.golang.org/genproto/protobuf/api;api"; + +// Api is a light-weight descriptor for an API Interface. +// +// Interfaces are also described as "protocol buffer services" in some contexts, +// such as by the "service" keyword in a .proto file, but they are different +// from API Services, which represent a concrete implementation of an interface +// as opposed to simply a description of methods and bindings. They are also +// sometimes simply referred to as "APIs" in other contexts, such as the name of +// this message itself. See https://cloud.google.com/apis/design/glossary for +// detailed terminology. +message Api { + + // The fully qualified name of this interface, including package name + // followed by the interface's simple name. + string name = 1; + + // The methods of this interface, in unspecified order. + repeated Method methods = 2; + + // Any metadata attached to the interface. + repeated Option options = 3; + + // A version string for this interface. If specified, must have the form + // `major-version.minor-version`, as in `1.10`. If the minor version is + // omitted, it defaults to zero. If the entire version field is empty, the + // major version is derived from the package name, as outlined below. If the + // field is not empty, the version in the package name will be verified to be + // consistent with what is provided here. + // + // The versioning schema uses [semantic + // versioning](http://semver.org) where the major version number + // indicates a breaking change and the minor version an additive, + // non-breaking change. Both version numbers are signals to users + // what to expect from different versions, and should be carefully + // chosen based on the product plan. + // + // The major version is also reflected in the package name of the + // interface, which must end in `v`, as in + // `google.feature.v1`. For major versions 0 and 1, the suffix can + // be omitted. Zero major versions must only be used for + // experimental, non-GA interfaces. + // + // + string version = 4; + + // Source context for the protocol buffer service represented by this + // message. + SourceContext source_context = 5; + + // Included interfaces. See [Mixin][]. + repeated Mixin mixins = 6; + + // The source syntax of the service. + Syntax syntax = 7; +} + +// Method represents a method of an API interface. +message Method { + + // The simple name of this method. + string name = 1; + + // A URL of the input message type. + string request_type_url = 2; + + // If true, the request is streamed. + bool request_streaming = 3; + + // The URL of the output message type. + string response_type_url = 4; + + // If true, the response is streamed. + bool response_streaming = 5; + + // Any metadata attached to the method. + repeated Option options = 6; + + // The source syntax of this method. + Syntax syntax = 7; +} + +// Declares an API Interface to be included in this interface. The including +// interface must redeclare all the methods from the included interface, but +// documentation and options are inherited as follows: +// +// - If after comment and whitespace stripping, the documentation +// string of the redeclared method is empty, it will be inherited +// from the original method. +// +// - Each annotation belonging to the service config (http, +// visibility) which is not set in the redeclared method will be +// inherited. +// +// - If an http annotation is inherited, the path pattern will be +// modified as follows. Any version prefix will be replaced by the +// version of the including interface plus the [root][] path if +// specified. +// +// Example of a simple mixin: +// +// package google.acl.v1; +// service AccessControl { +// // Get the underlying ACL object. +// rpc GetAcl(GetAclRequest) returns (Acl) { +// option (google.api.http).get = "/v1/{resource=**}:getAcl"; +// } +// } +// +// package google.storage.v2; +// service Storage { +// rpc GetAcl(GetAclRequest) returns (Acl); +// +// // Get a data record. +// rpc GetData(GetDataRequest) returns (Data) { +// option (google.api.http).get = "/v2/{resource=**}"; +// } +// } +// +// Example of a mixin configuration: +// +// apis: +// - name: google.storage.v2.Storage +// mixins: +// - name: google.acl.v1.AccessControl +// +// The mixin construct implies that all methods in `AccessControl` are +// also declared with same name and request/response types in +// `Storage`. A documentation generator or annotation processor will +// see the effective `Storage.GetAcl` method after inherting +// documentation and annotations as follows: +// +// service Storage { +// // Get the underlying ACL object. +// rpc GetAcl(GetAclRequest) returns (Acl) { +// option (google.api.http).get = "/v2/{resource=**}:getAcl"; +// } +// ... +// } +// +// Note how the version in the path pattern changed from `v1` to `v2`. +// +// If the `root` field in the mixin is specified, it should be a +// relative path under which inherited HTTP paths are placed. Example: +// +// apis: +// - name: google.storage.v2.Storage +// mixins: +// - name: google.acl.v1.AccessControl +// root: acls +// +// This implies the following inherited HTTP annotation: +// +// service Storage { +// // Get the underlying ACL object. +// rpc GetAcl(GetAclRequest) returns (Acl) { +// option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; +// } +// ... +// } +message Mixin { + // The fully qualified name of the interface which is included. + string name = 1; + + // If non-empty specifies a path under which inherited HTTP paths + // are rooted. + string root = 2; +} diff --git a/orm/gorm/api/third_party/google/protobuf/descriptor.proto b/orm/gorm/api/third_party/google/protobuf/descriptor.proto new file mode 100644 index 0000000..a2102d7 --- /dev/null +++ b/orm/gorm/api/third_party/google/protobuf/descriptor.proto @@ -0,0 +1,885 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// The messages in this file describe the definitions found in .proto files. +// A valid .proto file can be translated directly to a FileDescriptorProto +// without any other information (e.g. without reading its imports). + + +syntax = "proto2"; + +package google.protobuf; + +option go_package = "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "DescriptorProtos"; +option csharp_namespace = "Google.Protobuf.Reflection"; +option objc_class_prefix = "GPB"; +option cc_enable_arenas = true; + +// descriptor.proto must be optimized for speed because reflection-based +// algorithms don't work during bootstrapping. +option optimize_for = SPEED; + +// The protocol compiler can output a FileDescriptorSet containing the .proto +// files it parses. +message FileDescriptorSet { + repeated FileDescriptorProto file = 1; +} + +// Describes a complete .proto file. +message FileDescriptorProto { + optional string name = 1; // file name, relative to root of source tree + optional string package = 2; // e.g. "foo", "foo.bar", etc. + + // Names of files imported by this file. + repeated string dependency = 3; + // Indexes of the public imported files in the dependency list above. + repeated int32 public_dependency = 10; + // Indexes of the weak imported files in the dependency list. + // For Google-internal migration only. Do not use. + repeated int32 weak_dependency = 11; + + // All top-level definitions in this file. + repeated DescriptorProto message_type = 4; + repeated EnumDescriptorProto enum_type = 5; + repeated ServiceDescriptorProto service = 6; + repeated FieldDescriptorProto extension = 7; + + optional FileOptions options = 8; + + // This field contains optional information about the original source code. + // You may safely remove this entire field without harming runtime + // functionality of the descriptors -- the information is needed only by + // development tools. + optional SourceCodeInfo source_code_info = 9; + + // The syntax of the proto file. + // The supported values are "proto2" and "proto3". + optional string syntax = 12; +} + +// Describes a message type. +message DescriptorProto { + optional string name = 1; + + repeated FieldDescriptorProto field = 2; + repeated FieldDescriptorProto extension = 6; + + repeated DescriptorProto nested_type = 3; + repeated EnumDescriptorProto enum_type = 4; + + message ExtensionRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. + + optional ExtensionRangeOptions options = 3; + } + repeated ExtensionRange extension_range = 5; + + repeated OneofDescriptorProto oneof_decl = 8; + + optional MessageOptions options = 7; + + // Range of reserved tag numbers. Reserved tag numbers may not be used by + // fields or extension ranges in the same message. Reserved ranges may + // not overlap. + message ReservedRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. + } + repeated ReservedRange reserved_range = 9; + // Reserved field names, which may not be used by fields in the same message. + // A given name may only be reserved once. + repeated string reserved_name = 10; +} + +message ExtensionRangeOptions { + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +// Describes a field within a message. +message FieldDescriptorProto { + enum Type { + // 0 is reserved for errors. + // Order is weird for historical reasons. + TYPE_DOUBLE = 1; + TYPE_FLOAT = 2; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + // negative values are likely. + TYPE_INT64 = 3; + TYPE_UINT64 = 4; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + // negative values are likely. + TYPE_INT32 = 5; + TYPE_FIXED64 = 6; + TYPE_FIXED32 = 7; + TYPE_BOOL = 8; + TYPE_STRING = 9; + // Tag-delimited aggregate. + // Group type is deprecated and not supported in proto3. However, Proto3 + // implementations should still be able to parse the group wire format and + // treat group fields as unknown fields. + TYPE_GROUP = 10; + TYPE_MESSAGE = 11; // Length-delimited aggregate. + + // New in version 2. + TYPE_BYTES = 12; + TYPE_UINT32 = 13; + TYPE_ENUM = 14; + TYPE_SFIXED32 = 15; + TYPE_SFIXED64 = 16; + TYPE_SINT32 = 17; // Uses ZigZag encoding. + TYPE_SINT64 = 18; // Uses ZigZag encoding. + } + + enum Label { + // 0 is reserved for errors + LABEL_OPTIONAL = 1; + LABEL_REQUIRED = 2; + LABEL_REPEATED = 3; + } + + optional string name = 1; + optional int32 number = 3; + optional Label label = 4; + + // If type_name is set, this need not be set. If both this and type_name + // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + optional Type type = 5; + + // For message and enum types, this is the name of the type. If the name + // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + // rules are used to find the type (i.e. first the nested types within this + // message are searched, then within the parent, on up to the root + // namespace). + optional string type_name = 6; + + // For extensions, this is the name of the type being extended. It is + // resolved in the same manner as type_name. + optional string extendee = 2; + + // For numeric types, contains the original text representation of the value. + // For booleans, "true" or "false". + // For strings, contains the default text contents (not escaped in any way). + // For bytes, contains the C escaped value. All bytes >= 128 are escaped. + // TODO(kenton): Base-64 encode? + optional string default_value = 7; + + // If set, gives the index of a oneof in the containing type's oneof_decl + // list. This field is a member of that oneof. + optional int32 oneof_index = 9; + + // JSON name of this field. The value is set by protocol compiler. If the + // user has set a "json_name" option on this field, that option's value + // will be used. Otherwise, it's deduced from the field's name by converting + // it to camelCase. + optional string json_name = 10; + + optional FieldOptions options = 8; +} + +// Describes a oneof. +message OneofDescriptorProto { + optional string name = 1; + optional OneofOptions options = 2; +} + +// Describes an enum type. +message EnumDescriptorProto { + optional string name = 1; + + repeated EnumValueDescriptorProto value = 2; + + optional EnumOptions options = 3; + + // Range of reserved numeric values. Reserved values may not be used by + // entries in the same enum. Reserved ranges may not overlap. + // + // Note that this is distinct from DescriptorProto.ReservedRange in that it + // is inclusive such that it can appropriately represent the entire int32 + // domain. + message EnumReservedRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Inclusive. + } + + // Range of reserved numeric values. Reserved numeric values may not be used + // by enum values in the same enum declaration. Reserved ranges may not + // overlap. + repeated EnumReservedRange reserved_range = 4; + + // Reserved enum value names, which may not be reused. A given name may only + // be reserved once. + repeated string reserved_name = 5; +} + +// Describes a value within an enum. +message EnumValueDescriptorProto { + optional string name = 1; + optional int32 number = 2; + + optional EnumValueOptions options = 3; +} + +// Describes a service. +message ServiceDescriptorProto { + optional string name = 1; + repeated MethodDescriptorProto method = 2; + + optional ServiceOptions options = 3; +} + +// Describes a method of a service. +message MethodDescriptorProto { + optional string name = 1; + + // Input and output type names. These are resolved in the same way as + // FieldDescriptorProto.type_name, but must refer to a message type. + optional string input_type = 2; + optional string output_type = 3; + + optional MethodOptions options = 4; + + // Identifies if client streams multiple client messages + optional bool client_streaming = 5 [default = false]; + // Identifies if server streams multiple server messages + optional bool server_streaming = 6 [default = false]; +} + + +// =================================================================== +// Options + +// Each of the definitions above may have "options" attached. These are +// just annotations which may cause code to be generated slightly differently +// or may contain hints for code that manipulates protocol messages. +// +// Clients may define custom options as extensions of the *Options messages. +// These extensions may not yet be known at parsing time, so the parser cannot +// store the values in them. Instead it stores them in a field in the *Options +// message called uninterpreted_option. This field must have the same name +// across all *Options messages. We then use this field to populate the +// extensions when we build a descriptor, at which point all protos have been +// parsed and so all extensions are known. +// +// Extension numbers for custom options may be chosen as follows: +// * For options which will only be used within a single application or +// organization, or for experimental options, use field numbers 50000 +// through 99999. It is up to you to ensure that you do not use the +// same number for multiple options. +// * For options which will be published and used publicly by multiple +// independent entities, e-mail protobuf-global-extension-registry@google.com +// to reserve extension numbers. Simply provide your project name (e.g. +// Objective-C plugin) and your project website (if available) -- there's no +// need to explain how you intend to use them. Usually you only need one +// extension number. You can declare multiple options with only one extension +// number by putting them in a sub-message. See the Custom Options section of +// the docs for examples: +// https://developers.google.com/protocol-buffers/docs/proto#options +// If this turns out to be popular, a web service will be set up +// to automatically assign option numbers. + +message FileOptions { + + // Sets the Java package where classes generated from this .proto will be + // placed. By default, the proto package is used, but this is often + // inappropriate because proto packages do not normally start with backwards + // domain names. + optional string java_package = 1; + + + // If set, all the classes from the .proto file are wrapped in a single + // outer class with the given name. This applies to both Proto1 + // (equivalent to the old "--one_java_file" option) and Proto2 (where + // a .proto always translates to a single class, but you may want to + // explicitly choose the class name). + optional string java_outer_classname = 8; + + // If set true, then the Java code generator will generate a separate .java + // file for each top-level message, enum, and service defined in the .proto + // file. Thus, these types will *not* be nested inside the outer class + // named by java_outer_classname. However, the outer class will still be + // generated to contain the file's getDescriptor() method as well as any + // top-level extensions defined in the file. + optional bool java_multiple_files = 10 [default = false]; + + // This option does nothing. + optional bool java_generate_equals_and_hash = 20 [deprecated=true]; + + // If set true, then the Java2 code generator will generate code that + // throws an exception whenever an attempt is made to assign a non-UTF-8 + // byte sequence to a string field. + // Message reflection will do the same. + // However, an extension field still accepts non-UTF-8 byte sequences. + // This option has no effect on when used with the lite runtime. + optional bool java_string_check_utf8 = 27 [default = false]; + + + // Generated classes can be optimized for speed or code size. + enum OptimizeMode { + SPEED = 1; // Generate complete code for parsing, serialization, + // etc. + CODE_SIZE = 2; // Use ReflectionOps to implement these methods. + LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. + } + optional OptimizeMode optimize_for = 9 [default = SPEED]; + + // Sets the Go package where structs generated from this .proto will be + // placed. If omitted, the Go package will be derived from the following: + // - The basename of the package import path, if provided. + // - Otherwise, the package statement in the .proto file, if present. + // - Otherwise, the basename of the .proto file, without extension. + optional string go_package = 11; + + + + + // Should generic services be generated in each language? "Generic" services + // are not specific to any particular RPC system. They are generated by the + // main code generators in each language (without additional plugins). + // Generic services were the only kind of service generation supported by + // early versions of google.protobuf. + // + // Generic services are now considered deprecated in favor of using plugins + // that generate code specific to your particular RPC system. Therefore, + // these default to false. Old code which depends on generic services should + // explicitly set them to true. + optional bool cc_generic_services = 16 [default = false]; + optional bool java_generic_services = 17 [default = false]; + optional bool py_generic_services = 18 [default = false]; + optional bool php_generic_services = 42 [default = false]; + + // Is this file deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for everything in the file, or it will be completely ignored; in the very + // least, this is a formalization for deprecating files. + optional bool deprecated = 23 [default = false]; + + // Enables the use of arenas for the proto messages in this file. This applies + // only to generated classes for C++. + optional bool cc_enable_arenas = 31 [default = false]; + + + // Sets the objective c class prefix which is prepended to all objective c + // generated classes from this .proto. There is no default. + optional string objc_class_prefix = 36; + + // Namespace for generated classes; defaults to the package. + optional string csharp_namespace = 37; + + // By default Swift generators will take the proto package and CamelCase it + // replacing '.' with underscore and use that to prefix the types/symbols + // defined. When this options is provided, they will use this value instead + // to prefix the types/symbols defined. + optional string swift_prefix = 39; + + // Sets the php class prefix which is prepended to all php generated classes + // from this .proto. Default is empty. + optional string php_class_prefix = 40; + + // Use this option to change the namespace of php generated classes. Default + // is empty. When this option is empty, the package name will be used for + // determining the namespace. + optional string php_namespace = 41; + + // Use this option to change the namespace of php generated metadata classes. + // Default is empty. When this option is empty, the proto file name will be + // used for determining the namespace. + optional string php_metadata_namespace = 44; + + // Use this option to change the package of ruby generated classes. Default + // is empty. When this option is not set, the package name will be used for + // determining the ruby package. + optional string ruby_package = 45; + + + // The parser stores options it doesn't recognize here. + // See the documentation for the "Options" section above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. + // See the documentation for the "Options" section above. + extensions 1000 to max; + + reserved 38; +} + +message MessageOptions { + // Set true to use the old proto1 MessageSet wire format for extensions. + // This is provided for backwards-compatibility with the MessageSet wire + // format. You should not use this for any other reason: It's less + // efficient, has fewer features, and is more complicated. + // + // The message must be defined exactly as follows: + // message Foo { + // option message_set_wire_format = true; + // extensions 4 to max; + // } + // Note that the message cannot have any defined fields; MessageSets only + // have extensions. + // + // All extensions of your type must be singular messages; e.g. they cannot + // be int32s, enums, or repeated messages. + // + // Because this is an option, the above two restrictions are not enforced by + // the protocol compiler. + optional bool message_set_wire_format = 1 [default = false]; + + // Disables the generation of the standard "descriptor()" accessor, which can + // conflict with a field of the same name. This is meant to make migration + // from proto1 easier; new code should avoid fields named "descriptor". + optional bool no_standard_descriptor_accessor = 2 [default = false]; + + // Is this message deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the message, or it will be completely ignored; in the very least, + // this is a formalization for deprecating messages. + optional bool deprecated = 3 [default = false]; + + // Whether the message is an automatically generated map entry type for the + // maps field. + // + // For maps fields: + // map map_field = 1; + // The parsed descriptor looks like: + // message MapFieldEntry { + // option map_entry = true; + // optional KeyType key = 1; + // optional ValueType value = 2; + // } + // repeated MapFieldEntry map_field = 1; + // + // Implementations may choose not to generate the map_entry=true message, but + // use a native map in the target language to hold the keys and values. + // The reflection APIs in such implementations still need to work as + // if the field is a repeated message field. + // + // NOTE: Do not set the option in .proto files. Always use the maps syntax + // instead. The option should only be implicitly set by the proto compiler + // parser. + optional bool map_entry = 7; + + reserved 8; // javalite_serializable + reserved 9; // javanano_as_lite + + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message FieldOptions { + // The ctype option instructs the C++ code generator to use a different + // representation of the field than it normally would. See the specific + // options below. This option is not yet implemented in the open source + // release -- sorry, we'll try to include it in a future version! + optional CType ctype = 1 [default = STRING]; + enum CType { + // Default mode. + STRING = 0; + + CORD = 1; + + STRING_PIECE = 2; + } + // The packed option can be enabled for repeated primitive fields to enable + // a more efficient representation on the wire. Rather than repeatedly + // writing the tag and type for each element, the entire array is encoded as + // a single length-delimited blob. In proto3, only explicit setting it to + // false will avoid using packed encoding. + optional bool packed = 2; + + // The jstype option determines the JavaScript type used for values of the + // field. The option is permitted only for 64 bit integral and fixed types + // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + // is represented as JavaScript string, which avoids loss of precision that + // can happen when a large value is converted to a floating point JavaScript. + // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + // use the JavaScript "number" type. The behavior of the default option + // JS_NORMAL is implementation dependent. + // + // This option is an enum to permit additional types to be added, e.g. + // goog.math.Integer. + optional JSType jstype = 6 [default = JS_NORMAL]; + enum JSType { + // Use the default type. + JS_NORMAL = 0; + + // Use JavaScript strings. + JS_STRING = 1; + + // Use JavaScript numbers. + JS_NUMBER = 2; + } + + // Should this field be parsed lazily? Lazy applies only to message-type + // fields. It means that when the outer message is initially parsed, the + // inner message's contents will not be parsed but instead stored in encoded + // form. The inner message will actually be parsed when it is first accessed. + // + // This is only a hint. Implementations are free to choose whether to use + // eager or lazy parsing regardless of the value of this option. However, + // setting this option true suggests that the protocol author believes that + // using lazy parsing on this field is worth the additional bookkeeping + // overhead typically needed to implement it. + // + // This option does not affect the public interface of any generated code; + // all method signatures remain the same. Furthermore, thread-safety of the + // interface is not affected by this option; const methods remain safe to + // call from multiple threads concurrently, while non-const methods continue + // to require exclusive access. + // + // + // Note that implementations may choose not to check required fields within + // a lazy sub-message. That is, calling IsInitialized() on the outer message + // may return true even if the inner message has missing required fields. + // This is necessary because otherwise the inner message would have to be + // parsed in order to perform the check, defeating the purpose of lazy + // parsing. An implementation which chooses not to check required fields + // must be consistent about it. That is, for any particular sub-message, the + // implementation must either *always* check its required fields, or *never* + // check its required fields, regardless of whether or not the message has + // been parsed. + optional bool lazy = 5 [default = false]; + + // Is this field deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for accessors, or it will be completely ignored; in the very least, this + // is a formalization for deprecating fields. + optional bool deprecated = 3 [default = false]; + + // For Google-internal migration only. Do not use. + optional bool weak = 10 [default = false]; + + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; + + reserved 4; // removed jtype +} + +message OneofOptions { + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message EnumOptions { + + // Set this option to true to allow mapping different tag names to the same + // value. + optional bool allow_alias = 2; + + // Is this enum deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum, or it will be completely ignored; in the very least, this + // is a formalization for deprecating enums. + optional bool deprecated = 3 [default = false]; + + reserved 5; // javanano_as_lite + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message EnumValueOptions { + // Is this enum value deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum value, or it will be completely ignored; in the very least, + // this is a formalization for deprecating enum values. + optional bool deprecated = 1 [default = false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message ServiceOptions { + + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + // Is this service deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the service, or it will be completely ignored; in the very least, + // this is a formalization for deprecating services. + optional bool deprecated = 33 [default = false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message MethodOptions { + + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + // Is this method deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the method, or it will be completely ignored; in the very least, + // this is a formalization for deprecating methods. + optional bool deprecated = 33 [default = false]; + + // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + // or neither? HTTP based RPC implementation may choose GET verb for safe + // methods, and PUT verb for idempotent methods instead of the default POST. + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0; + NO_SIDE_EFFECTS = 1; // implies idempotent + IDEMPOTENT = 2; // idempotent, but may have side effects + } + optional IdempotencyLevel idempotency_level = 34 + [default = IDEMPOTENCY_UNKNOWN]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + + +// A message representing a option the parser does not recognize. This only +// appears in options protos created by the compiler::Parser class. +// DescriptorPool resolves these when building Descriptor objects. Therefore, +// options protos in descriptor objects (e.g. returned by Descriptor::options(), +// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions +// in them. +message UninterpretedOption { + // The name of the uninterpreted option. Each string represents a segment in + // a dot-separated name. is_extension is true iff a segment represents an + // extension (denoted with parentheses in options specs in .proto files). + // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents + // "foo.(bar.baz).qux". + message NamePart { + required string name_part = 1; + required bool is_extension = 2; + } + repeated NamePart name = 2; + + // The value of the uninterpreted option, in whatever type the tokenizer + // identified it as during parsing. Exactly one of these should be set. + optional string identifier_value = 3; + optional uint64 positive_int_value = 4; + optional int64 negative_int_value = 5; + optional double double_value = 6; + optional bytes string_value = 7; + optional string aggregate_value = 8; +} + +// =================================================================== +// Optional source code info + +// Encapsulates information about the original source file from which a +// FileDescriptorProto was generated. +message SourceCodeInfo { + // A Location identifies a piece of source code in a .proto file which + // corresponds to a particular definition. This information is intended + // to be useful to IDEs, code indexers, documentation generators, and similar + // tools. + // + // For example, say we have a file like: + // message Foo { + // optional string foo = 1; + // } + // Let's look at just the field definition: + // optional string foo = 1; + // ^ ^^ ^^ ^ ^^^ + // a bc de f ghi + // We have the following locations: + // span path represents + // [a,i) [ 4, 0, 2, 0 ] The whole field definition. + // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + // + // Notes: + // - A location may refer to a repeated field itself (i.e. not to any + // particular index within it). This is used whenever a set of elements are + // logically enclosed in a single code segment. For example, an entire + // extend block (possibly containing multiple extension definitions) will + // have an outer location whose path refers to the "extensions" repeated + // field without an index. + // - Multiple locations may have the same path. This happens when a single + // logical declaration is spread out across multiple places. The most + // obvious example is the "extend" block again -- there may be multiple + // extend blocks in the same scope, each of which will have the same path. + // - A location's span is not always a subset of its parent's span. For + // example, the "extendee" of an extension declaration appears at the + // beginning of the "extend" block and is shared by all extensions within + // the block. + // - Just because a location's span is a subset of some other location's span + // does not mean that it is a descendant. For example, a "group" defines + // both a type and a field in a single declaration. Thus, the locations + // corresponding to the type and field and their components will overlap. + // - Code which tries to interpret locations should probably be designed to + // ignore those that it doesn't understand, as more types of locations could + // be recorded in the future. + repeated Location location = 1; + message Location { + // Identifies which part of the FileDescriptorProto was defined at this + // location. + // + // Each element is a field number or an index. They form a path from + // the root FileDescriptorProto to the place where the definition. For + // example, this path: + // [ 4, 3, 2, 7, 1 ] + // refers to: + // file.message_type(3) // 4, 3 + // .field(7) // 2, 7 + // .name() // 1 + // This is because FileDescriptorProto.message_type has field number 4: + // repeated DescriptorProto message_type = 4; + // and DescriptorProto.field has field number 2: + // repeated FieldDescriptorProto field = 2; + // and FieldDescriptorProto.name has field number 1: + // optional string name = 1; + // + // Thus, the above path gives the location of a field name. If we removed + // the last element: + // [ 4, 3, 2, 7 ] + // this path refers to the whole field declaration (from the beginning + // of the label to the terminating semicolon). + repeated int32 path = 1 [packed = true]; + + // Always has exactly three or four elements: start line, start column, + // end line (optional, otherwise assumed same as start line), end column. + // These are packed into a single field for efficiency. Note that line + // and column numbers are zero-based -- typically you will want to add + // 1 to each before displaying to a user. + repeated int32 span = 2 [packed = true]; + + // If this SourceCodeInfo represents a complete declaration, these are any + // comments appearing before and after the declaration which appear to be + // attached to the declaration. + // + // A series of line comments appearing on consecutive lines, with no other + // tokens appearing on those lines, will be treated as a single comment. + // + // leading_detached_comments will keep paragraphs of comments that appear + // before (but not connected to) the current element. Each paragraph, + // separated by empty lines, will be one comment element in the repeated + // field. + // + // Only the comment content is provided; comment markers (e.g. //) are + // stripped out. For block comments, leading whitespace and an asterisk + // will be stripped from the beginning of each line other than the first. + // Newlines are included in the output. + // + // Examples: + // + // optional int32 foo = 1; // Comment attached to foo. + // // Comment attached to bar. + // optional int32 bar = 2; + // + // optional string baz = 3; + // // Comment attached to baz. + // // Another line attached to baz. + // + // // Comment attached to qux. + // // + // // Another line attached to qux. + // optional double qux = 4; + // + // // Detached comment for corge. This is not leading or trailing comments + // // to qux or corge because there are blank lines separating it from + // // both. + // + // // Detached comment for corge paragraph 2. + // + // optional string corge = 5; + // /* Block comment attached + // * to corge. Leading asterisks + // * will be removed. */ + // /* Block comment attached to + // * grault. */ + // optional int32 grault = 6; + // + // // ignored detached comments. + optional string leading_comments = 3; + optional string trailing_comments = 4; + repeated string leading_detached_comments = 6; + } +} + +// Describes the relationship between generated code and its original source +// file. A GeneratedCodeInfo message is associated with only one generated +// source file, but may contain references to different source .proto files. +message GeneratedCodeInfo { + // An Annotation connects some span of text in generated code to an element + // of its generating .proto file. + repeated Annotation annotation = 1; + message Annotation { + // Identifies the element in the original source .proto file. This field + // is formatted the same as SourceCodeInfo.Location.path. + repeated int32 path = 1 [packed = true]; + + // Identifies the filesystem path to the original source .proto. + optional string source_file = 2; + + // Identifies the starting offset in bytes in the generated code + // that relates to the identified object. + optional int32 begin = 3; + + // Identifies the ending offset in bytes in the generated code that + // relates to the identified offset. The end offset should be one past + // the last relevant byte (so the length of the text = end - begin). + optional int32 end = 4; + } +} diff --git a/orm/gorm/api/third_party/google/protobuf/duration.proto b/orm/gorm/api/third_party/google/protobuf/duration.proto new file mode 100644 index 0000000..99cb102 --- /dev/null +++ b/orm/gorm/api/third_party/google/protobuf/duration.proto @@ -0,0 +1,116 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option go_package = "github.com/golang/protobuf/ptypes/duration"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "DurationProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// A Duration represents a signed, fixed-length span of time represented +// as a count of seconds and fractions of seconds at nanosecond +// resolution. It is independent of any calendar and concepts like "day" +// or "month". It is related to Timestamp in that the difference between +// two Timestamp values is a Duration and it can be added or subtracted +// from a Timestamp. Range is approximately +-10,000 years. +// +// # Examples +// +// Example 1: Compute Duration from two Timestamps in pseudo code. +// +// Timestamp start = ...; +// Timestamp end = ...; +// Duration duration = ...; +// +// duration.seconds = end.seconds - start.seconds; +// duration.nanos = end.nanos - start.nanos; +// +// if (duration.seconds < 0 && duration.nanos > 0) { +// duration.seconds += 1; +// duration.nanos -= 1000000000; +// } else if (duration.seconds > 0 && duration.nanos < 0) { +// duration.seconds -= 1; +// duration.nanos += 1000000000; +// } +// +// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. +// +// Timestamp start = ...; +// Duration duration = ...; +// Timestamp end = ...; +// +// end.seconds = start.seconds + duration.seconds; +// end.nanos = start.nanos + duration.nanos; +// +// if (end.nanos < 0) { +// end.seconds -= 1; +// end.nanos += 1000000000; +// } else if (end.nanos >= 1000000000) { +// end.seconds += 1; +// end.nanos -= 1000000000; +// } +// +// Example 3: Compute Duration from datetime.timedelta in Python. +// +// td = datetime.timedelta(days=3, minutes=10) +// duration = Duration() +// duration.FromTimedelta(td) +// +// # JSON Mapping +// +// In JSON format, the Duration type is encoded as a string rather than an +// object, where the string ends in the suffix "s" (indicating seconds) and +// is preceded by the number of seconds, with nanoseconds expressed as +// fractional seconds. For example, 3 seconds with 0 nanoseconds should be +// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should +// be expressed in JSON format as "3.000000001s", and 3 seconds and 1 +// microsecond should be expressed in JSON format as "3.000001s". +// +// +message Duration { + // Signed seconds of the span of time. Must be from -315,576,000,000 + // to +315,576,000,000 inclusive. Note: these bounds are computed from: + // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + int64 seconds = 1; + + // Signed fractions of a second at nanosecond resolution of the span + // of time. Durations less than one second are represented with a 0 + // `seconds` field and a positive or negative `nanos` field. For durations + // of one second or more, a non-zero value for the `nanos` field must be + // of the same sign as the `seconds` field. Must be from -999,999,999 + // to +999,999,999 inclusive. + int32 nanos = 2; +} diff --git a/orm/gorm/api/third_party/google/protobuf/empty.proto b/orm/gorm/api/third_party/google/protobuf/empty.proto new file mode 100644 index 0000000..03cacd2 --- /dev/null +++ b/orm/gorm/api/third_party/google/protobuf/empty.proto @@ -0,0 +1,52 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "github.com/golang/protobuf/ptypes/empty"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "EmptyProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option cc_enable_arenas = true; + +// A generic empty message that you can re-use to avoid defining duplicated +// empty messages in your APIs. A typical example is to use it as the request +// or the response type of an API method. For instance: +// +// service Foo { +// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +// } +// +// The JSON representation for `Empty` is empty JSON object `{}`. +message Empty {} diff --git a/orm/gorm/api/third_party/google/protobuf/field_mask.proto b/orm/gorm/api/third_party/google/protobuf/field_mask.proto new file mode 100644 index 0000000..baac874 --- /dev/null +++ b/orm/gorm/api/third_party/google/protobuf/field_mask.proto @@ -0,0 +1,245 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "FieldMaskProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option go_package = "google.golang.org/genproto/protobuf/field_mask;field_mask"; +option cc_enable_arenas = true; + +// `FieldMask` represents a set of symbolic field paths, for example: +// +// paths: "f.a" +// paths: "f.b.d" +// +// Here `f` represents a field in some root message, `a` and `b` +// fields in the message found in `f`, and `d` a field found in the +// message in `f.b`. +// +// Field masks are used to specify a subset of fields that should be +// returned by a get operation or modified by an update operation. +// Field masks also have a custom JSON encoding (see below). +// +// # Field Masks in Projections +// +// When used in the context of a projection, a response message or +// sub-message is filtered by the API to only contain those fields as +// specified in the mask. For example, if the mask in the previous +// example is applied to a response message as follows: +// +// f { +// a : 22 +// b { +// d : 1 +// x : 2 +// } +// y : 13 +// } +// z: 8 +// +// The result will not contain specific values for fields x,y and z +// (their value will be set to the default, and omitted in proto text +// output): +// +// +// f { +// a : 22 +// b { +// d : 1 +// } +// } +// +// A repeated field is not allowed except at the last position of a +// paths string. +// +// If a FieldMask object is not present in a get operation, the +// operation applies to all fields (as if a FieldMask of all fields +// had been specified). +// +// Note that a field mask does not necessarily apply to the +// top-level response message. In case of a REST get operation, the +// field mask applies directly to the response, but in case of a REST +// list operation, the mask instead applies to each individual message +// in the returned resource list. In case of a REST custom method, +// other definitions may be used. Where the mask applies will be +// clearly documented together with its declaration in the API. In +// any case, the effect on the returned resource/resources is required +// behavior for APIs. +// +// # Field Masks in Update Operations +// +// A field mask in update operations specifies which fields of the +// targeted resource are going to be updated. The API is required +// to only change the values of the fields as specified in the mask +// and leave the others untouched. If a resource is passed in to +// describe the updated values, the API ignores the values of all +// fields not covered by the mask. +// +// If a repeated field is specified for an update operation, new values will +// be appended to the existing repeated field in the target resource. Note that +// a repeated field is only allowed in the last position of a `paths` string. +// +// If a sub-message is specified in the last position of the field mask for an +// update operation, then new value will be merged into the existing sub-message +// in the target resource. +// +// For example, given the target message: +// +// f { +// b { +// d: 1 +// x: 2 +// } +// c: [1] +// } +// +// And an update message: +// +// f { +// b { +// d: 10 +// } +// c: [2] +// } +// +// then if the field mask is: +// +// paths: ["f.b", "f.c"] +// +// then the result will be: +// +// f { +// b { +// d: 10 +// x: 2 +// } +// c: [1, 2] +// } +// +// An implementation may provide options to override this default behavior for +// repeated and message fields. +// +// In order to reset a field's value to the default, the field must +// be in the mask and set to the default value in the provided resource. +// Hence, in order to reset all fields of a resource, provide a default +// instance of the resource and set all fields in the mask, or do +// not provide a mask as described below. +// +// If a field mask is not present on update, the operation applies to +// all fields (as if a field mask of all fields has been specified). +// Note that in the presence of schema evolution, this may mean that +// fields the client does not know and has therefore not filled into +// the request will be reset to their default. If this is unwanted +// behavior, a specific service may require a client to always specify +// a field mask, producing an error if not. +// +// As with get operations, the location of the resource which +// describes the updated values in the request message depends on the +// operation kind. In any case, the effect of the field mask is +// required to be honored by the API. +// +// ## Considerations for HTTP REST +// +// The HTTP kind of an update operation which uses a field mask must +// be set to PATCH instead of PUT in order to satisfy HTTP semantics +// (PUT must only be used for full updates). +// +// # JSON Encoding of Field Masks +// +// In JSON, a field mask is encoded as a single string where paths are +// separated by a comma. Fields name in each path are converted +// to/from lower-camel naming conventions. +// +// As an example, consider the following message declarations: +// +// message Profile { +// User user = 1; +// Photo photo = 2; +// } +// message User { +// string display_name = 1; +// string address = 2; +// } +// +// In proto a field mask for `Profile` may look as such: +// +// mask { +// paths: "user.display_name" +// paths: "photo" +// } +// +// In JSON, the same mask is represented as below: +// +// { +// mask: "user.displayName,photo" +// } +// +// # Field Masks and Oneof Fields +// +// Field masks treat fields in oneofs just as regular fields. Consider the +// following message: +// +// message SampleMessage { +// oneof test_oneof { +// string name = 4; +// SubMessage sub_message = 9; +// } +// } +// +// The field mask can be: +// +// mask { +// paths: "name" +// } +// +// Or: +// +// mask { +// paths: "sub_message" +// } +// +// Note that oneof type names ("test_oneof" in this case) cannot be used in +// paths. +// +// ## Field Mask Verification +// +// The implementation of any API method which has a FieldMask type field in the +// request should verify the included field paths, and return an +// `INVALID_ARGUMENT` error if any path is unmappable. +message FieldMask { + // The set of field mask paths. + repeated string paths = 1; +} diff --git a/orm/gorm/api/third_party/google/protobuf/source_context.proto b/orm/gorm/api/third_party/google/protobuf/source_context.proto new file mode 100644 index 0000000..f3b2c96 --- /dev/null +++ b/orm/gorm/api/third_party/google/protobuf/source_context.proto @@ -0,0 +1,48 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "SourceContextProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option go_package = "google.golang.org/genproto/protobuf/source_context;source_context"; + +// `SourceContext` represents information about the source of a +// protobuf element, like the file in which it is defined. +message SourceContext { + // The path-qualified name of the .proto file that contained the associated + // protobuf element. For example: `"google/protobuf/source_context.proto"`. + string file_name = 1; +} diff --git a/orm/gorm/api/third_party/google/protobuf/struct.proto b/orm/gorm/api/third_party/google/protobuf/struct.proto new file mode 100644 index 0000000..ed990e3 --- /dev/null +++ b/orm/gorm/api/third_party/google/protobuf/struct.proto @@ -0,0 +1,95 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option go_package = "github.com/golang/protobuf/ptypes/struct;structpb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "StructProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// `Struct` represents a structured data value, consisting of fields +// which map to dynamically typed values. In some languages, `Struct` +// might be supported by a native representation. For example, in +// scripting languages like JS a struct is represented as an +// object. The details of that representation are described together +// with the proto support for the language. +// +// The JSON representation for `Struct` is JSON object. +message Struct { + // Unordered map of dynamically typed values. + map fields = 1; +} + +// `Value` represents a dynamically typed value which can be either +// null, a number, a string, a boolean, a recursive struct value, or a +// list of values. A producer of value is expected to set one of that +// variants, absence of any variant indicates an error. +// +// The JSON representation for `Value` is JSON value. +message Value { + // The kind of value. + oneof kind { + // Represents a null value. + NullValue null_value = 1; + // Represents a double value. + double number_value = 2; + // Represents a string value. + string string_value = 3; + // Represents a boolean value. + bool bool_value = 4; + // Represents a structured value. + Struct struct_value = 5; + // Represents a repeated `Value`. + ListValue list_value = 6; + } +} + +// `NullValue` is a singleton enumeration to represent the null value for the +// `Value` type union. +// +// The JSON representation for `NullValue` is JSON `null`. +enum NullValue { + // Null value. + NULL_VALUE = 0; +} + +// `ListValue` is a wrapper around a repeated field of values. +// +// The JSON representation for `ListValue` is JSON array. +message ListValue { + // Repeated field of dynamically typed values. + repeated Value values = 1; +} diff --git a/orm/gorm/api/third_party/google/protobuf/timestamp.proto b/orm/gorm/api/third_party/google/protobuf/timestamp.proto new file mode 100644 index 0000000..cd35786 --- /dev/null +++ b/orm/gorm/api/third_party/google/protobuf/timestamp.proto @@ -0,0 +1,138 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option go_package = "github.com/golang/protobuf/ptypes/timestamp"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "TimestampProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// A Timestamp represents a point in time independent of any time zone or local +// calendar, encoded as a count of seconds and fractions of seconds at +// nanosecond resolution. The count is relative to an epoch at UTC midnight on +// January 1, 1970, in the proleptic Gregorian calendar which extends the +// Gregorian calendar backwards to year one. +// +// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap +// second table is needed for interpretation, using a [24-hour linear +// smear](https://developers.google.com/time/smear). +// +// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By +// restricting to that range, we ensure that we can convert to and from [RFC +// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. +// +// # Examples +// +// Example 1: Compute Timestamp from POSIX `time()`. +// +// Timestamp timestamp; +// timestamp.set_seconds(time(NULL)); +// timestamp.set_nanos(0); +// +// Example 2: Compute Timestamp from POSIX `gettimeofday()`. +// +// struct timeval tv; +// gettimeofday(&tv, NULL); +// +// Timestamp timestamp; +// timestamp.set_seconds(tv.tv_sec); +// timestamp.set_nanos(tv.tv_usec * 1000); +// +// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. +// +// FILETIME ft; +// GetSystemTimeAsFileTime(&ft); +// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; +// +// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z +// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. +// Timestamp timestamp; +// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); +// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); +// +// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. +// +// long millis = System.currentTimeMillis(); +// +// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) +// .setNanos((int) ((millis % 1000) * 1000000)).build(); +// +// +// Example 5: Compute Timestamp from current time in Python. +// +// timestamp = Timestamp() +// timestamp.GetCurrentTime() +// +// # JSON Mapping +// +// In JSON format, the Timestamp type is encoded as a string in the +// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the +// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" +// where {year} is always expressed using four digits while {month}, {day}, +// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional +// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), +// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone +// is required. A proto3 JSON serializer should always use UTC (as indicated by +// "Z") when printing the Timestamp type and a proto3 JSON parser should be +// able to accept both UTC and other timezones (as indicated by an offset). +// +// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past +// 01:30 UTC on January 15, 2017. +// +// In JavaScript, one can convert a Date object to this format using the +// standard +// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) +// method. In Python, a standard `datetime.datetime` object can be converted +// to this format using +// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with +// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use +// the Joda Time's [`ISODateTimeFormat.dateTime()`]( +// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D +// ) to obtain a formatter capable of generating timestamps in this format. +// +// +message Timestamp { + // Represents seconds of UTC time since Unix epoch + // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + // 9999-12-31T23:59:59Z inclusive. + int64 seconds = 1; + + // Non-negative fractions of a second at nanosecond resolution. Negative + // second values with fractions must still have non-negative nanos values + // that count forward in time. Must be from 0 to 999,999,999 + // inclusive. + int32 nanos = 2; +} diff --git a/orm/gorm/api/third_party/google/protobuf/type.proto b/orm/gorm/api/third_party/google/protobuf/type.proto new file mode 100644 index 0000000..e4b1d3a --- /dev/null +++ b/orm/gorm/api/third_party/google/protobuf/type.proto @@ -0,0 +1,187 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +import "google/protobuf/any.proto"; +import "google/protobuf/source_context.proto"; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option java_package = "com.google.protobuf"; +option java_outer_classname = "TypeProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option go_package = "google.golang.org/genproto/protobuf/ptype;ptype"; + +// A protocol buffer message type. +message Type { + // The fully qualified message name. + string name = 1; + // The list of fields. + repeated Field fields = 2; + // The list of types appearing in `oneof` definitions in this type. + repeated string oneofs = 3; + // The protocol buffer options. + repeated Option options = 4; + // The source context. + SourceContext source_context = 5; + // The source syntax. + Syntax syntax = 6; +} + +// A single field of a message type. +message Field { + // Basic field types. + enum Kind { + // Field type unknown. + TYPE_UNKNOWN = 0; + // Field type double. + TYPE_DOUBLE = 1; + // Field type float. + TYPE_FLOAT = 2; + // Field type int64. + TYPE_INT64 = 3; + // Field type uint64. + TYPE_UINT64 = 4; + // Field type int32. + TYPE_INT32 = 5; + // Field type fixed64. + TYPE_FIXED64 = 6; + // Field type fixed32. + TYPE_FIXED32 = 7; + // Field type bool. + TYPE_BOOL = 8; + // Field type string. + TYPE_STRING = 9; + // Field type group. Proto2 syntax only, and deprecated. + TYPE_GROUP = 10; + // Field type message. + TYPE_MESSAGE = 11; + // Field type bytes. + TYPE_BYTES = 12; + // Field type uint32. + TYPE_UINT32 = 13; + // Field type enum. + TYPE_ENUM = 14; + // Field type sfixed32. + TYPE_SFIXED32 = 15; + // Field type sfixed64. + TYPE_SFIXED64 = 16; + // Field type sint32. + TYPE_SINT32 = 17; + // Field type sint64. + TYPE_SINT64 = 18; + } + + // Whether a field is optional, required, or repeated. + enum Cardinality { + // For fields with unknown cardinality. + CARDINALITY_UNKNOWN = 0; + // For optional fields. + CARDINALITY_OPTIONAL = 1; + // For required fields. Proto2 syntax only. + CARDINALITY_REQUIRED = 2; + // For repeated fields. + CARDINALITY_REPEATED = 3; + }; + + // The field type. + Kind kind = 1; + // The field cardinality. + Cardinality cardinality = 2; + // The field number. + int32 number = 3; + // The field name. + string name = 4; + // The field type URL, without the scheme, for message or enumeration + // types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + string type_url = 6; + // The index of the field type in `Type.oneofs`, for message or enumeration + // types. The first type has index 1; zero means the type is not in the list. + int32 oneof_index = 7; + // Whether to use alternative packed wire representation. + bool packed = 8; + // The protocol buffer options. + repeated Option options = 9; + // The field JSON name. + string json_name = 10; + // The string value of the default value of this field. Proto2 syntax only. + string default_value = 11; +} + +// Enum type definition. +message Enum { + // Enum type name. + string name = 1; + // Enum value definitions. + repeated EnumValue enumvalue = 2; + // Protocol buffer options. + repeated Option options = 3; + // The source context. + SourceContext source_context = 4; + // The source syntax. + Syntax syntax = 5; +} + +// Enum value definition. +message EnumValue { + // Enum value name. + string name = 1; + // Enum value number. + int32 number = 2; + // Protocol buffer options. + repeated Option options = 3; +} + +// A protocol buffer option, which can be attached to a message, field, +// enumeration, etc. +message Option { + // The option's name. For protobuf built-in options (options defined in + // descriptor.proto), this is the short name. For example, `"map_entry"`. + // For custom options, it should be the fully-qualified name. For example, + // `"google.api.http"`. + string name = 1; + // The option's value packed in an Any message. If the value is a primitive, + // the corresponding wrapper type defined in google/protobuf/wrappers.proto + // should be used. If the value is an enum, it should be stored as an int32 + // value using the google.protobuf.Int32Value type. + Any value = 2; +} + +// The syntax in which a protocol buffer element is defined. +enum Syntax { + // Syntax `proto2`. + SYNTAX_PROTO2 = 0; + // Syntax `proto3`. + SYNTAX_PROTO3 = 1; +} diff --git a/orm/gorm/api/third_party/google/protobuf/wrappers.proto b/orm/gorm/api/third_party/google/protobuf/wrappers.proto new file mode 100644 index 0000000..9ee41e3 --- /dev/null +++ b/orm/gorm/api/third_party/google/protobuf/wrappers.proto @@ -0,0 +1,123 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Wrappers for primitive (non-message) types. These types are useful +// for embedding primitives in the `google.protobuf.Any` type and for places +// where we need to distinguish between the absence of a primitive +// typed field and its default value. +// +// These wrappers have no meaningful use within repeated fields as they lack +// the ability to detect presence on individual elements. +// These wrappers have no meaningful use within a map or a oneof since +// individual entries of a map or fields of a oneof can already detect presence. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option go_package = "github.com/golang/protobuf/ptypes/wrappers"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "WrappersProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// Wrapper message for `double`. +// +// The JSON representation for `DoubleValue` is JSON number. +message DoubleValue { + // The double value. + double value = 1; +} + +// Wrapper message for `float`. +// +// The JSON representation for `FloatValue` is JSON number. +message FloatValue { + // The float value. + float value = 1; +} + +// Wrapper message for `int64`. +// +// The JSON representation for `Int64Value` is JSON string. +message Int64Value { + // The int64 value. + int64 value = 1; +} + +// Wrapper message for `uint64`. +// +// The JSON representation for `UInt64Value` is JSON string. +message UInt64Value { + // The uint64 value. + uint64 value = 1; +} + +// Wrapper message for `int32`. +// +// The JSON representation for `Int32Value` is JSON number. +message Int32Value { + // The int32 value. + int32 value = 1; +} + +// Wrapper message for `uint32`. +// +// The JSON representation for `UInt32Value` is JSON number. +message UInt32Value { + // The uint32 value. + uint32 value = 1; +} + +// Wrapper message for `bool`. +// +// The JSON representation for `BoolValue` is JSON `true` and `false`. +message BoolValue { + // The bool value. + bool value = 1; +} + +// Wrapper message for `string`. +// +// The JSON representation for `StringValue` is JSON string. +message StringValue { + // The string value. + string value = 1; +} + +// Wrapper message for `bytes`. +// +// The JSON representation for `BytesValue` is JSON string. +message BytesValue { + // The bytes value. + bytes value = 1; +} diff --git a/orm/gorm/api/third_party/validate/README.md b/orm/gorm/api/third_party/validate/README.md new file mode 100644 index 0000000..f5c4274 --- /dev/null +++ b/orm/gorm/api/third_party/validate/README.md @@ -0,0 +1,3 @@ +# protoc-gen-validate (PGV) + +* https://github.com/envoyproxy/protoc-gen-validate diff --git a/orm/gorm/api/third_party/validate/validate.proto b/orm/gorm/api/third_party/validate/validate.proto new file mode 100644 index 0000000..b9b3fb2 --- /dev/null +++ b/orm/gorm/api/third_party/validate/validate.proto @@ -0,0 +1,862 @@ +syntax = "proto2"; +package validate; + +option go_package = "github.com/envoyproxy/protoc-gen-validate/validate"; +option java_package = "io.envoyproxy.pgv.validate"; + +import "google/protobuf/descriptor.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +// Validation rules applied at the message level +extend google.protobuf.MessageOptions { + // Disabled nullifies any validation rules for this message, including any + // message fields associated with it that do support validation. + optional bool disabled = 1071; + // Ignore skips generation of validation methods for this message. + optional bool ignored = 1072; +} + +// Validation rules applied at the oneof level +extend google.protobuf.OneofOptions { + // Required ensures that exactly one the field options in a oneof is set; + // validation fails if no fields in the oneof are set. + optional bool required = 1071; +} + +// Validation rules applied at the field level +extend google.protobuf.FieldOptions { + // Rules specify the validations to be performed on this field. By default, + // no validation is performed against a field. + optional FieldRules rules = 1071; +} + +// FieldRules encapsulates the rules for each type of field. Depending on the +// field, the correct set should be used to ensure proper validations. +message FieldRules { + optional MessageRules message = 17; + oneof type { + // Scalar Field Types + FloatRules float = 1; + DoubleRules double = 2; + Int32Rules int32 = 3; + Int64Rules int64 = 4; + UInt32Rules uint32 = 5; + UInt64Rules uint64 = 6; + SInt32Rules sint32 = 7; + SInt64Rules sint64 = 8; + Fixed32Rules fixed32 = 9; + Fixed64Rules fixed64 = 10; + SFixed32Rules sfixed32 = 11; + SFixed64Rules sfixed64 = 12; + BoolRules bool = 13; + StringRules string = 14; + BytesRules bytes = 15; + + // Complex Field Types + EnumRules enum = 16; + RepeatedRules repeated = 18; + MapRules map = 19; + + // Well-Known Field Types + AnyRules any = 20; + DurationRules duration = 21; + TimestampRules timestamp = 22; + } +} + +// FloatRules describes the constraints applied to `float` values +message FloatRules { + // Const specifies that this field must be exactly the specified value + optional float const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional float lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional float lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional float gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional float gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated float in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated float not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// DoubleRules describes the constraints applied to `double` values +message DoubleRules { + // Const specifies that this field must be exactly the specified value + optional double const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional double lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional double lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional double gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional double gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated double in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated double not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// Int32Rules describes the constraints applied to `int32` values +message Int32Rules { + // Const specifies that this field must be exactly the specified value + optional int32 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional int32 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional int32 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional int32 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional int32 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated int32 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated int32 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// Int64Rules describes the constraints applied to `int64` values +message Int64Rules { + // Const specifies that this field must be exactly the specified value + optional int64 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional int64 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional int64 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional int64 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional int64 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated int64 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated int64 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// UInt32Rules describes the constraints applied to `uint32` values +message UInt32Rules { + // Const specifies that this field must be exactly the specified value + optional uint32 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional uint32 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional uint32 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional uint32 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional uint32 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated uint32 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated uint32 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// UInt64Rules describes the constraints applied to `uint64` values +message UInt64Rules { + // Const specifies that this field must be exactly the specified value + optional uint64 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional uint64 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional uint64 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional uint64 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional uint64 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated uint64 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated uint64 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// SInt32Rules describes the constraints applied to `sint32` values +message SInt32Rules { + // Const specifies that this field must be exactly the specified value + optional sint32 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional sint32 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional sint32 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional sint32 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional sint32 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated sint32 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated sint32 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// SInt64Rules describes the constraints applied to `sint64` values +message SInt64Rules { + // Const specifies that this field must be exactly the specified value + optional sint64 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional sint64 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional sint64 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional sint64 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional sint64 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated sint64 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated sint64 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// Fixed32Rules describes the constraints applied to `fixed32` values +message Fixed32Rules { + // Const specifies that this field must be exactly the specified value + optional fixed32 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional fixed32 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional fixed32 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional fixed32 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional fixed32 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated fixed32 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated fixed32 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// Fixed64Rules describes the constraints applied to `fixed64` values +message Fixed64Rules { + // Const specifies that this field must be exactly the specified value + optional fixed64 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional fixed64 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional fixed64 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional fixed64 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional fixed64 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated fixed64 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated fixed64 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// SFixed32Rules describes the constraints applied to `sfixed32` values +message SFixed32Rules { + // Const specifies that this field must be exactly the specified value + optional sfixed32 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional sfixed32 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional sfixed32 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional sfixed32 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional sfixed32 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated sfixed32 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated sfixed32 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// SFixed64Rules describes the constraints applied to `sfixed64` values +message SFixed64Rules { + // Const specifies that this field must be exactly the specified value + optional sfixed64 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional sfixed64 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional sfixed64 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional sfixed64 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional sfixed64 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated sfixed64 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated sfixed64 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// BoolRules describes the constraints applied to `bool` values +message BoolRules { + // Const specifies that this field must be exactly the specified value + optional bool const = 1; +} + +// StringRules describe the constraints applied to `string` values +message StringRules { + // Const specifies that this field must be exactly the specified value + optional string const = 1; + + // Len specifies that this field must be the specified number of + // characters (Unicode code points). Note that the number of + // characters may differ from the number of bytes in the string. + optional uint64 len = 19; + + // MinLen specifies that this field must be the specified number of + // characters (Unicode code points) at a minimum. Note that the number of + // characters may differ from the number of bytes in the string. + optional uint64 min_len = 2; + + // MaxLen specifies that this field must be the specified number of + // characters (Unicode code points) at a maximum. Note that the number of + // characters may differ from the number of bytes in the string. + optional uint64 max_len = 3; + + // LenBytes specifies that this field must be the specified number of bytes + optional uint64 len_bytes = 20; + + // MinBytes specifies that this field must be the specified number of bytes + // at a minimum + optional uint64 min_bytes = 4; + + // MaxBytes specifies that this field must be the specified number of bytes + // at a maximum + optional uint64 max_bytes = 5; + + // Pattern specifes that this field must match against the specified + // regular expression (RE2 syntax). The included expression should elide + // any delimiters. + optional string pattern = 6; + + // Prefix specifies that this field must have the specified substring at + // the beginning of the string. + optional string prefix = 7; + + // Suffix specifies that this field must have the specified substring at + // the end of the string. + optional string suffix = 8; + + // Contains specifies that this field must have the specified substring + // anywhere in the string. + optional string contains = 9; + + // NotContains specifies that this field cannot have the specified substring + // anywhere in the string. + optional string not_contains = 23; + + // In specifies that this field must be equal to one of the specified + // values + repeated string in = 10; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated string not_in = 11; + + // WellKnown rules provide advanced constraints against common string + // patterns + oneof well_known { + // Email specifies that the field must be a valid email address as + // defined by RFC 5322 + bool email = 12; + + // Hostname specifies that the field must be a valid hostname as + // defined by RFC 1034. This constraint does not support + // internationalized domain names (IDNs). + bool hostname = 13; + + // Ip specifies that the field must be a valid IP (v4 or v6) address. + // Valid IPv6 addresses should not include surrounding square brackets. + bool ip = 14; + + // Ipv4 specifies that the field must be a valid IPv4 address. + bool ipv4 = 15; + + // Ipv6 specifies that the field must be a valid IPv6 address. Valid + // IPv6 addresses should not include surrounding square brackets. + bool ipv6 = 16; + + // Uri specifies that the field must be a valid, absolute URI as defined + // by RFC 3986 + bool uri = 17; + + // UriRef specifies that the field must be a valid URI as defined by RFC + // 3986 and may be relative or absolute. + bool uri_ref = 18; + + // Address specifies that the field must be either a valid hostname as + // defined by RFC 1034 (which does not support internationalized domain + // names or IDNs), or it can be a valid IP (v4 or v6). + bool address = 21; + + // Uuid specifies that the field must be a valid UUID as defined by + // RFC 4122 + bool uuid = 22; + + // WellKnownRegex specifies a common well known pattern defined as a regex. + KnownRegex well_known_regex = 24; + } + + // This applies to regexes HTTP_HEADER_NAME and HTTP_HEADER_VALUE to enable + // strict header validation. + // By default, this is true, and HTTP header validations are RFC-compliant. + // Setting to false will enable a looser validations that only disallows + // \r\n\0 characters, which can be used to bypass header matching rules. + optional bool strict = 25 [default = true]; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 26; +} + +// WellKnownRegex contain some well-known patterns. +enum KnownRegex { + UNKNOWN = 0; + + // HTTP header name as defined by RFC 7230. + HTTP_HEADER_NAME = 1; + + // HTTP header value as defined by RFC 7230. + HTTP_HEADER_VALUE = 2; +} + +// BytesRules describe the constraints applied to `bytes` values +message BytesRules { + // Const specifies that this field must be exactly the specified value + optional bytes const = 1; + + // Len specifies that this field must be the specified number of bytes + optional uint64 len = 13; + + // MinLen specifies that this field must be the specified number of bytes + // at a minimum + optional uint64 min_len = 2; + + // MaxLen specifies that this field must be the specified number of bytes + // at a maximum + optional uint64 max_len = 3; + + // Pattern specifes that this field must match against the specified + // regular expression (RE2 syntax). The included expression should elide + // any delimiters. + optional string pattern = 4; + + // Prefix specifies that this field must have the specified bytes at the + // beginning of the string. + optional bytes prefix = 5; + + // Suffix specifies that this field must have the specified bytes at the + // end of the string. + optional bytes suffix = 6; + + // Contains specifies that this field must have the specified bytes + // anywhere in the string. + optional bytes contains = 7; + + // In specifies that this field must be equal to one of the specified + // values + repeated bytes in = 8; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated bytes not_in = 9; + + // WellKnown rules provide advanced constraints against common byte + // patterns + oneof well_known { + // Ip specifies that the field must be a valid IP (v4 or v6) address in + // byte format + bool ip = 10; + + // Ipv4 specifies that the field must be a valid IPv4 address in byte + // format + bool ipv4 = 11; + + // Ipv6 specifies that the field must be a valid IPv6 address in byte + // format + bool ipv6 = 12; + } + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 14; +} + +// EnumRules describe the constraints applied to enum values +message EnumRules { + // Const specifies that this field must be exactly the specified value + optional int32 const = 1; + + // DefinedOnly specifies that this field must be only one of the defined + // values for this enum, failing on any undefined value. + optional bool defined_only = 2; + + // In specifies that this field must be equal to one of the specified + // values + repeated int32 in = 3; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated int32 not_in = 4; +} + +// MessageRules describe the constraints applied to embedded message values. +// For message-type fields, validation is performed recursively. +message MessageRules { + // Skip specifies that the validation rules of this field should not be + // evaluated + optional bool skip = 1; + + // Required specifies that this field must be set + optional bool required = 2; +} + +// RepeatedRules describe the constraints applied to `repeated` values +message RepeatedRules { + // MinItems specifies that this field must have the specified number of + // items at a minimum + optional uint64 min_items = 1; + + // MaxItems specifies that this field must have the specified number of + // items at a maximum + optional uint64 max_items = 2; + + // Unique specifies that all elements in this field must be unique. This + // contraint is only applicable to scalar and enum types (messages are not + // supported). + optional bool unique = 3; + + // Items specifies the contraints to be applied to each item in the field. + // Repeated message fields will still execute validation against each item + // unless skip is specified here. + optional FieldRules items = 4; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 5; +} + +// MapRules describe the constraints applied to `map` values +message MapRules { + // MinPairs specifies that this field must have the specified number of + // KVs at a minimum + optional uint64 min_pairs = 1; + + // MaxPairs specifies that this field must have the specified number of + // KVs at a maximum + optional uint64 max_pairs = 2; + + // NoSparse specifies values in this field cannot be unset. This only + // applies to map's with message value types. + optional bool no_sparse = 3; + + // Keys specifies the constraints to be applied to each key in the field. + optional FieldRules keys = 4; + + // Values specifies the constraints to be applied to the value of each key + // in the field. Message values will still have their validations evaluated + // unless skip is specified here. + optional FieldRules values = 5; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 6; +} + +// AnyRules describe constraints applied exclusively to the +// `google.protobuf.Any` well-known type +message AnyRules { + // Required specifies that this field must be set + optional bool required = 1; + + // In specifies that this field's `type_url` must be equal to one of the + // specified values. + repeated string in = 2; + + // NotIn specifies that this field's `type_url` must not be equal to any of + // the specified values. + repeated string not_in = 3; +} + +// DurationRules describe the constraints applied exclusively to the +// `google.protobuf.Duration` well-known type +message DurationRules { + // Required specifies that this field must be set + optional bool required = 1; + + // Const specifies that this field must be exactly the specified value + optional google.protobuf.Duration const = 2; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional google.protobuf.Duration lt = 3; + + // Lt specifies that this field must be less than the specified value, + // inclusive + optional google.protobuf.Duration lte = 4; + + // Gt specifies that this field must be greater than the specified value, + // exclusive + optional google.protobuf.Duration gt = 5; + + // Gte specifies that this field must be greater than the specified value, + // inclusive + optional google.protobuf.Duration gte = 6; + + // In specifies that this field must be equal to one of the specified + // values + repeated google.protobuf.Duration in = 7; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated google.protobuf.Duration not_in = 8; +} + +// TimestampRules describe the constraints applied exclusively to the +// `google.protobuf.Timestamp` well-known type +message TimestampRules { + // Required specifies that this field must be set + optional bool required = 1; + + // Const specifies that this field must be exactly the specified value + optional google.protobuf.Timestamp const = 2; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional google.protobuf.Timestamp lt = 3; + + // Lte specifies that this field must be less than the specified value, + // inclusive + optional google.protobuf.Timestamp lte = 4; + + // Gt specifies that this field must be greater than the specified value, + // exclusive + optional google.protobuf.Timestamp gt = 5; + + // Gte specifies that this field must be greater than the specified value, + // inclusive + optional google.protobuf.Timestamp gte = 6; + + // LtNow specifies that this must be less than the current time. LtNow + // can only be used with the Within rule. + optional bool lt_now = 7; + + // GtNow specifies that this must be greater than the current time. GtNow + // can only be used with the Within rule. + optional bool gt_now = 8; + + // Within specifies that this field must be within this duration of the + // current time. This constraint can be used alone or with the LtNow and + // GtNow rules. + optional google.protobuf.Duration within = 9; +} diff --git a/orm/gorm/api/user/service/v1/user.proto b/orm/gorm/api/user/service/v1/user.proto new file mode 100644 index 0000000..8458d82 --- /dev/null +++ b/orm/gorm/api/user/service/v1/user.proto @@ -0,0 +1,74 @@ +syntax = "proto3"; + +package user.service.v1; +option go_package = "kratos-gorm-example/gen/api/go/user/service/v1;v1"; + +import "gnostic/openapi/v3/annotations.proto"; +import "google/protobuf/empty.proto"; + +import "common/pagination/pagination.proto"; + +// 变量的命名一律使用小驼峰命名法,例如:firstName、lastName等。 + +// 用户服务 +service UserService { + // 查询用户列表 + rpc ListUser (pagination.PagingRequest) returns (ListUserResponse) {} + + // 查询用户详情 + rpc GetUser (GetUserRequest) returns (User) {} + + // 创建用户 + rpc CreateUser (CreateUserRequest) returns (User) {} + + // 更新用户 + rpc UpdateUser (UpdateUserRequest) returns (User) {} + + // 删除用户 + rpc DeleteUser (DeleteUserRequest) returns (google.protobuf.Empty) {} +} + +// 用户 +message User { + uint32 id = 1; + optional string userName = 2; + optional string nickName = 3; + optional string password = 4; + + optional string createTime = 10; + optional string updateTime = 11; + optional string deleteTime = 12; +} + +// 获取用户列表 - 答复 +message ListUserResponse { + repeated User items = 1; + int32 total = 2; +} + +// 获取用户数据 - 请求 +message GetUserRequest { + uint32 id = 1; +} +message GetUserByUserNameRequest { + string userName = 1; +} + +// 创建用户 - 请求 +message CreateUserRequest { + User user = 1; + uint32 operatorId = 2; +} + +// 更新用户 - 请求 +message UpdateUserRequest { + uint32 id = 1; + User user = 2; + uint32 operatorId = 3; +} + +// 删除用户 - 请求 +message DeleteUserRequest { + uint32 id = 1; + uint32 operatorId = 2; +} diff --git a/orm/gorm/api/user/service/v1/user_error.proto b/orm/gorm/api/user/service/v1/user_error.proto new file mode 100644 index 0000000..7284688 --- /dev/null +++ b/orm/gorm/api/user/service/v1/user_error.proto @@ -0,0 +1,33 @@ +syntax = "proto3"; + +package user.service.v1; +option go_package = "kratos-gorm-example/gen/api/go/user/service/v1;v1"; + +import "errors/errors.proto"; + +enum UserErrorReason { + option (errors.default_code) = 500; + + NOT_LOGGED_IN = 0 [(errors.code) = 401];// 401 + ACCESS_FORBIDDEN = 1 [(errors.code) = 403]; // 403 + RESOURCE_NOT_FOUND = 2 [(errors.code) = 404]; // 404 + METHOD_NOT_ALLOWED = 3 [(errors.code) = 405]; // 405 + REQUEST_TIMEOUT = 4 [(errors.code) = 408]; // 408 + INTERNAL_SERVER_ERROR = 5 [(errors.code) = 500]; // 500 + NOT_IMPLEMENTED = 6 [(errors.code) = 501]; // 501 + NETWORK_ERROR = 7 [(errors.code) = 502]; // 502 + SERVICE_UNAVAILABLE = 8 [(errors.code) = 503]; // 503 + NETWORK_TIMEOUT = 9 [(errors.code) = 504]; // 504 + REQUEST_NOT_SUPPORT = 10 [(errors.code) = 505]; // 505 + + USER_NOT_FOUND = 11 [(errors.code) = 600]; + INCORRECT_PASSWORD = 12 [(errors.code) = 599]; + USER_FREEZE = 13 [(errors.code) = 598]; + + INVALID_USERID = 14 [(errors.code) = 101];// 用户ID无效 + INVALID_PASSWORD = 15 [(errors.code) = 102];// 密码无效 + TOKEN_EXPIRED = 16 [(errors.code) = 103];// token过期 + INVALID_TOKEN = 17 [(errors.code) = 104];// token无效 + TOKEN_NOT_EXIST = 18 [(errors.code) = 105];// token不存在 + USER_NOT_EXIST = 19 [(errors.code) = 106];// 用户不存在 +} diff --git a/orm/gorm/app.mk b/orm/gorm/app.mk new file mode 100644 index 0000000..4a87da0 --- /dev/null +++ b/orm/gorm/app.mk @@ -0,0 +1,140 @@ +GOPATH ?= $(shell go env GOPATH) + +# Ensure GOPATH is set before running build process. +ifeq "$(GOPATH)" "" + $(error Please set the environment variable GOPATH before running `make`) +endif +FAIL_ON_STDOUT := awk '{ print } END { if (NR > 0) { exit 1 } }' + +GO := GO111MODULE=on go + +ARCH := "`uname -s`" +LINUX := "Linux" +MAC := "Darwin" + +ifeq ($(OS),Windows_NT) + IS_WINDOWS:=1 +endif + +APP_VERSION=$(shell git describe --tags --always) +APP_RELATIVE_PATH=$(shell a=`basename $$PWD` && cd .. && b=`basename $$PWD` && echo $$b/$$a) +APP_NAME=$(shell echo $(APP_RELATIVE_PATH) | sed -En "s/\//-/p") +APP_DOCKER_IMAGE=$(shell echo $(APP_NAME) |awk -F '@' '{print "kratos-gorm-example/" $$0 ":0.1.0"}') + + +.PHONY: init dep vendor build clean docker conf ent wire api openapi run test cover vet lint app + +# initialize develop environment +init: + @go install google.golang.org/protobuf/cmd/protoc-gen-go@latest + @go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest + @go install github.com/go-kratos/kratos/cmd/protoc-gen-go-http/v2@latest + @go install github.com/go-kratos/kratos/cmd/protoc-gen-go-errors/v2@latest + @go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@latest + @go install github.com/google/gnostic/cmd/protoc-gen-openapi@latest + @go install github.com/envoyproxy/protoc-gen-validate@latest + @go install github.com/bufbuild/buf/cmd/buf@latest + @go install github.com/google/gnostic@latest + @go install entgo.io/ent/cmd/ent@latest + @go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest + @go install github.com/go-kratos/kratos/cmd/kratos/v2@latest + +# download dependencies of module +dep: + @go mod download + +# create vendor +vendor: + @go mod vendor + +# build golang application +build: +ifeq ("$(wildcard ./bin/)","") + mkdir bin +endif + @go build -ldflags "-X main.Service.Version=$(APP_VERSION)" -o ./bin/ ./... + +# clean build files +clean: + @go clean + $(if $(IS_WINDOWS), del "coverage.out", rm -f "coverage.out") + +# build docker image +docker: + @docker build -t $(APP_DOCKER_IMAGE) . \ + -f ../../../.docker/Dockerfile \ + --build-arg APP_RELATIVE_PATH=$(APP_RELATIVE_PATH) GRPC_PORT=9000 REST_PORT=8000 + +# generate config define code +conf: + protoc --proto_path=./internal/conf/ \ + --proto_path=../../../api/third_party \ + --go_out=paths=source_relative:./internal/conf/ \ + ./internal/conf/conf.proto + +# generate ent code +ent: +ifneq ("$(wildcard ./internal/data/ent)","") + @go run -mod=mod entgo.io/ent/cmd/ent generate \ + --feature privacy \ + --feature sql/modifier \ + --feature entql \ + --feature sql/upsert \ + ./internal/data/ent/schema +endif + +# generate wire code +wire: + @go run -mod=mod github.com/google/wire/cmd/wire ./cmd/server + +# generate protobuf api go code +api: + @cd ../../../ && \ + buf generate + +# generate OpenAPI v3 doc +openapi: + @cd ../../../ && \ + buf generate --path api/admin/service/v1 --template api/admin/service/v1/buf.openapi.gen.yaml + +# run application +run: + @go run ./cmd/server -conf ./configs + +# run tests +test: + @go test ./... + +# run coverage tests +cover: + @go test -v ./... -coverprofile=coverage.out + +# run static analysis +vet: + @go vet + +# run lint +lint: + @golangci-lint run + +# build service app +app: api wire conf ent build + +# show help +help: + @echo "" + @echo "Usage:" + @echo " make [target]" + @echo "" + @echo 'Targets:' + @awk '/^[a-zA-Z\-_0-9]+:/ { \ + helpMessage = match(lastLine, /^# (.*)/); \ + if (helpMessage) { \ + helpCommand = substr($$1, 0, index($$1, ":")-1); \ + helpMessage = substr(lastLine, RSTART + 2, RLENGTH); \ + printf "\033[36m%-22s\033[0m %s\n", helpCommand,helpMessage; \ + } \ + } \ + { lastLine = $$0 }' $(MAKEFILE_LIST) + +.DEFAULT_GOAL := help diff --git a/orm/gorm/app/user/service/.gitignore b/orm/gorm/app/user/service/.gitignore new file mode 100644 index 0000000..5904cde --- /dev/null +++ b/orm/gorm/app/user/service/.gitignore @@ -0,0 +1,35 @@ +# Reference https://github.com/github/gitignore/blob/master/Go.gitignore +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +vendor/ + +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a + +# OS General +Thumbs.db +.DS_Store + +# project +*.cert +*.key +*.log +bin/ + +# Develop tools +.vscode/ +.idea/ +*.swp diff --git a/orm/gorm/app/user/service/LICENSE b/orm/gorm/app/user/service/LICENSE new file mode 100644 index 0000000..3bf33c3 --- /dev/null +++ b/orm/gorm/app/user/service/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 go-kratos + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/orm/gorm/app/user/service/Makefile b/orm/gorm/app/user/service/Makefile new file mode 100644 index 0000000..bc1a63c --- /dev/null +++ b/orm/gorm/app/user/service/Makefile @@ -0,0 +1 @@ +include ../../../app.mk \ No newline at end of file diff --git a/orm/gorm/app/user/service/README.md b/orm/gorm/app/user/service/README.md new file mode 100644 index 0000000..4546add --- /dev/null +++ b/orm/gorm/app/user/service/README.md @@ -0,0 +1 @@ +# User Service diff --git a/orm/gorm/app/user/service/cmd/server/main.go b/orm/gorm/app/user/service/cmd/server/main.go new file mode 100644 index 0000000..4fe8821 --- /dev/null +++ b/orm/gorm/app/user/service/cmd/server/main.go @@ -0,0 +1,50 @@ +package main + +import ( + "github.com/go-kratos/kratos/v2" + "github.com/go-kratos/kratos/v2/log" + "github.com/go-kratos/kratos/v2/registry" + "github.com/go-kratos/kratos/v2/transport/grpc" + + "kratos-gorm-example/pkg/bootstrap" + "kratos-gorm-example/pkg/service" +) + +// go build -ldflags "-X main.Service.Version=x.y.z" + +var ( + Service = bootstrap.NewServiceInfo( + service.UserService, + "1.0.0", + "", + ) +) + +func newApp(ll log.Logger, rr registry.Registrar, gs *grpc.Server) *kratos.App { + return kratos.New( + kratos.ID(Service.GetInstanceId()), + kratos.Name(Service.Name), + kratos.Version(Service.Version), + kratos.Metadata(Service.Metadata), + kratos.Logger(ll), + kratos.Server( + gs, + ), + kratos.Registrar(rr), + ) +} + +func main() { + // bootstrap + cfg, ll, reg := bootstrap.Bootstrap(Service) + + app, cleanup, err := initApp(ll, reg, cfg) + if err != nil { + panic(err) + } + defer cleanup() + + if err := app.Run(); err != nil { + panic(err) + } +} diff --git a/orm/gorm/app/user/service/cmd/server/wire.go b/orm/gorm/app/user/service/cmd/server/wire.go new file mode 100644 index 0000000..652b7f7 --- /dev/null +++ b/orm/gorm/app/user/service/cmd/server/wire.go @@ -0,0 +1,25 @@ +//go:build wireinject +// +build wireinject + +// The build tag makes sure the stub is not built in the final build. + +package main + +import ( + "github.com/google/wire" + + "github.com/go-kratos/kratos/v2" + "github.com/go-kratos/kratos/v2/log" + "github.com/go-kratos/kratos/v2/registry" + + "kratos-gorm-example/app/user/service/internal/biz" + "kratos-gorm-example/app/user/service/internal/data" + "kratos-gorm-example/app/user/service/internal/server" + "kratos-gorm-example/app/user/service/internal/service" + "kratos-gorm-example/gen/api/go/common/conf" +) + +// initApp init kratos application. +func initApp(log.Logger, registry.Registrar, *conf.Bootstrap) (*kratos.App, func(), error) { + panic(wire.Build(server.ProviderSet, data.ProviderSet, biz.ProviderSet, service.ProviderSet, newApp)) +} diff --git a/orm/gorm/app/user/service/cmd/server/wire_gen.go b/orm/gorm/app/user/service/cmd/server/wire_gen.go new file mode 100644 index 0000000..bd10c2b --- /dev/null +++ b/orm/gorm/app/user/service/cmd/server/wire_gen.go @@ -0,0 +1,38 @@ +// Code generated by Wire. DO NOT EDIT. + +//go:generate go run github.com/google/wire/cmd/wire +//go:build !wireinject +// +build !wireinject + +package main + +import ( + "github.com/go-kratos/kratos/v2" + "github.com/go-kratos/kratos/v2/log" + "github.com/go-kratos/kratos/v2/registry" + "kratos-gorm-example/app/user/service/internal/biz" + "kratos-gorm-example/app/user/service/internal/data" + "kratos-gorm-example/app/user/service/internal/server" + "kratos-gorm-example/app/user/service/internal/service" + "kratos-gorm-example/gen/api/go/common/conf" +) + +// Injectors from wire.go: + +// initApp init kratos application. +func initApp(logger log.Logger, registrar registry.Registrar, bootstrap *conf.Bootstrap) (*kratos.App, func(), error) { + db := data.NewGormClient(bootstrap, logger) + client := data.NewRedisClient(bootstrap, logger) + dataData, cleanup, err := data.NewData(db, client, logger) + if err != nil { + return nil, nil, err + } + userRepo := data.NewUserRepo(dataData, logger) + userUseCase := biz.NewUserUseCase(userRepo, logger) + userService := service.NewUserService(logger, userUseCase) + grpcServer := server.NewGRPCServer(bootstrap, logger, userService) + app := newApp(logger, registrar, grpcServer) + return app, func() { + cleanup() + }, nil +} diff --git a/orm/gorm/app/user/service/configs/bootstrap.yaml b/orm/gorm/app/user/service/configs/bootstrap.yaml new file mode 100644 index 0000000..f486c3a --- /dev/null +++ b/orm/gorm/app/user/service/configs/bootstrap.yaml @@ -0,0 +1,33 @@ +server: + grpc: + addr: "0.0.0.0:10800" + timeout: 10s + middleware: +client: + grpc: + timeout: 10s + middleware: + enable_logging: true + enable_recovery: true + enable_tracing: true + enable_validate: true + enable_circuit_breaker: true + auth: + method: "" + key: "some_api_key" +data: + database: + driver: "postgres" + source: "host=localhost port=5432 user=postgres password=123456 dbname=example sslmode=disable" + migrate: true + redis: + addr: "127.0.0.1:6379" + password: "123456" + dial_timeout: 10s + read_timeout: 0.4s + write_timeout: 0.6s +trace: + endpoint: "http://127.0.0.1:14268/api/traces" + batcher: "jaeger" + sampler: 1.0 + env: "dev" diff --git a/orm/gorm/app/user/service/configs/logger.yaml b/orm/gorm/app/user/service/configs/logger.yaml new file mode 100644 index 0000000..f06ee78 --- /dev/null +++ b/orm/gorm/app/user/service/configs/logger.yaml @@ -0,0 +1,31 @@ +logger: + type: std + + fluent: + endpoint: "tcp://127.0.0.1:24224" + + zap: + level: "debug" + filename: "./logs/info.log" + max_size: 1 + max_age: 30 + max_backups: 5 + + logrus: + level: "debug" + formatter: "text" + timestamp_format: "2006-01-02 15:04:05" + disable_colors: false + disable_timestamp: false + + aliyun: + endpoint: "" + project: "" + access_key: "" + access_secret: "" + + tencent: + endpoint: "" + topic_id: + access_key: "" + access_secret: "" diff --git a/orm/gorm/app/user/service/configs/registry.yaml b/orm/gorm/app/user/service/configs/registry.yaml new file mode 100644 index 0000000..347c2cb --- /dev/null +++ b/orm/gorm/app/user/service/configs/registry.yaml @@ -0,0 +1,50 @@ +registry: + type: "consul" + + consul: + address: "127.0.0.1:8500" + scheme: "http" + health_check: false + + etcd: + endpoints: + - "127.0.0.1:8500" + + zookeeper: + endpoints: + - "127.0.0.1:8500" + timeout: 10s + + nacos: + address: "localhost" + port: 8848 + namespace_id: "public" + log_level: "../../configs/cache" + cache_dir: "../../configs/log" + log_dir: "debug" + update_thread_num: 20 + timeout: 10s + beat_interval: 5s + not_load_cache_at_start: true + update_cache_when_empty: true + + kubernetes: + + eureka: + endpoints: + - "127.0.0.1:18761" + heartbeat_interval: 10s + refresh_interval: 10s + path: + + polaris: + address: + port: + instance_count: + namespace: + service: + token: + + servicecomb: + endpoints: + - "127.0.0.1:8500" diff --git a/orm/gorm/app/user/service/configs/remote.yaml b/orm/gorm/app/user/service/configs/remote.yaml new file mode 100644 index 0000000..1811603 --- /dev/null +++ b/orm/gorm/app/user/service/configs/remote.yaml @@ -0,0 +1,6 @@ +config: + type: "consul" + consul: + scheme: "http" + address: "127.0.0.1:8500" + key: "kratos-gorm-example/user/service" diff --git a/orm/gorm/app/user/service/internal/biz/README.md b/orm/gorm/app/user/service/internal/biz/README.md new file mode 100644 index 0000000..b49e819 --- /dev/null +++ b/orm/gorm/app/user/service/internal/biz/README.md @@ -0,0 +1 @@ +# Biz diff --git a/orm/gorm/app/user/service/internal/biz/init.go b/orm/gorm/app/user/service/internal/biz/init.go new file mode 100644 index 0000000..c1d6c21 --- /dev/null +++ b/orm/gorm/app/user/service/internal/biz/init.go @@ -0,0 +1,8 @@ +package biz + +import "github.com/google/wire" + +// ProviderSet is biz providers. +var ProviderSet = wire.NewSet( + NewUserUseCase, +) diff --git a/orm/gorm/app/user/service/internal/biz/user.go b/orm/gorm/app/user/service/internal/biz/user.go new file mode 100644 index 0000000..46b628d --- /dev/null +++ b/orm/gorm/app/user/service/internal/biz/user.go @@ -0,0 +1,72 @@ +package biz + +import ( + "context" + + "github.com/go-kratos/kratos/v2/log" + + "kratos-gorm-example/gen/api/go/common/pagination" + v1 "kratos-gorm-example/gen/api/go/user/service/v1" +) + +type UserRepo interface { + List(ctx context.Context, req *pagination.PagingRequest) (*v1.ListUserResponse, error) + Get(ctx context.Context, req *v1.GetUserRequest) (*v1.User, error) + Create(ctx context.Context, req *v1.CreateUserRequest) (*v1.User, error) + Update(ctx context.Context, req *v1.UpdateUserRequest) (*v1.User, error) + Delete(ctx context.Context, req *v1.DeleteUserRequest) (bool, error) +} + +type UserUseCase struct { + repo UserRepo + log *log.Helper +} + +func NewUserUseCase(repo UserRepo, logger log.Logger) *UserUseCase { + l := log.NewHelper(log.With(logger, "module", "user/usecase/user-service")) + return &UserUseCase{ + repo: repo, + log: l, + } +} + +func (uc *UserUseCase) Get(ctx context.Context, req *v1.GetUserRequest) (*v1.User, error) { + user, err := uc.repo.Get(ctx, req) + if user != nil { + user.Password = nil + } + return user, err +} + +func (uc *UserUseCase) List(ctx context.Context, req *pagination.PagingRequest) (*v1.ListUserResponse, error) { + resp, err := uc.repo.List(ctx, req) + if err != nil { + return nil, err + } + + for i := 0; i < len(resp.Items); i++ { + resp.Items[i].Password = nil + } + + return resp, err +} + +func (uc *UserUseCase) Create(ctx context.Context, req *v1.CreateUserRequest) (*v1.User, error) { + user, err := uc.repo.Create(ctx, req) + if user != nil { + user.Password = nil + } + return user, err +} + +func (uc *UserUseCase) Update(ctx context.Context, req *v1.UpdateUserRequest) (*v1.User, error) { + user, err := uc.repo.Update(ctx, req) + if user != nil { + user.Password = nil + } + return user, err +} + +func (uc *UserUseCase) Delete(ctx context.Context, req *v1.DeleteUserRequest) (bool, error) { + return uc.repo.Delete(ctx, req) +} diff --git a/orm/gorm/app/user/service/internal/data/README.md b/orm/gorm/app/user/service/internal/data/README.md new file mode 100644 index 0000000..1cda725 --- /dev/null +++ b/orm/gorm/app/user/service/internal/data/README.md @@ -0,0 +1 @@ +# Data diff --git a/orm/gorm/app/user/service/internal/data/data.go b/orm/gorm/app/user/service/internal/data/data.go new file mode 100644 index 0000000..c2667f9 --- /dev/null +++ b/orm/gorm/app/user/service/internal/data/data.go @@ -0,0 +1,91 @@ +package data + +import ( + "github.com/go-kratos/kratos/v2/log" + + "github.com/go-redis/redis/v8" + + "gorm.io/driver/clickhouse" + "gorm.io/driver/mysql" + "gorm.io/driver/postgres" + "gorm.io/driver/sqlite" + "gorm.io/driver/sqlserver" + + "gorm.io/gorm" + + "kratos-gorm-example/app/user/service/internal/data/models" + "kratos-gorm-example/gen/api/go/common/conf" + "kratos-gorm-example/pkg/bootstrap" +) + +// Data . +type Data struct { + log *log.Helper + db *gorm.DB + rdb *redis.Client +} + +// NewData . +func NewData(gormClient *gorm.DB, redisClient *redis.Client, logger log.Logger) (*Data, func(), error) { + l := log.NewHelper(log.With(logger, "module", "data/user-service")) + + d := &Data{ + db: gormClient, + rdb: redisClient, + log: l, + } + + return d, func() { + l.Info("message", "closing the data resources") + if err := d.rdb.Close(); err != nil { + l.Error(err) + } + }, nil +} + +// NewRedisClient 创建Redis客户端 +func NewRedisClient(cfg *conf.Bootstrap, logger log.Logger) *redis.Client { + l := log.NewHelper(log.With(logger, "module", "redis/data/user-service")) + return bootstrap.NewRedisClient(cfg, l) +} + +// NewGormClient 创建数据库客户端 +func NewGormClient(cfg *conf.Bootstrap, logger log.Logger) *gorm.DB { + l := log.NewHelper(log.With(logger, "module", "ent/data/user-service")) + + var driver gorm.Dialector + switch cfg.Data.Database.Driver { + default: + fallthrough + case "mysql": + driver = mysql.Open(cfg.Data.Database.Source) + break + case "postgres": + driver = postgres.Open(cfg.Data.Database.Source) + break + case "clickhouse": + driver = clickhouse.Open(cfg.Data.Database.Source) + break + case "sqlite": + driver = sqlite.Open(cfg.Data.Database.Source) + break + case "sqlserver": + driver = sqlserver.Open(cfg.Data.Database.Source) + break + } + + client, err := gorm.Open(driver, &gorm.Config{}) + if err != nil { + l.Fatalf("failed opening connection to db: %v", err) + } + + // 运行数据库迁移工具 + if cfg.Data.Database.Migrate { + if err := client.AutoMigrate( + &models.User{}, + ); err != nil { + l.Fatalf("failed creating schema resources: %v", err) + } + } + return client +} diff --git a/orm/gorm/app/user/service/internal/data/init.go b/orm/gorm/app/user/service/internal/data/init.go new file mode 100644 index 0000000..54fb9a6 --- /dev/null +++ b/orm/gorm/app/user/service/internal/data/init.go @@ -0,0 +1,13 @@ +package data + +import "github.com/google/wire" + +// ProviderSet is data providers. +var ProviderSet = wire.NewSet( + NewData, + + NewGormClient, + NewRedisClient, + + NewUserRepo, +) diff --git a/orm/gorm/app/user/service/internal/data/models/user.go b/orm/gorm/app/user/service/internal/data/models/user.go new file mode 100644 index 0000000..16eacb3 --- /dev/null +++ b/orm/gorm/app/user/service/internal/data/models/user.go @@ -0,0 +1,14 @@ +package models + +import "gorm.io/gorm" + +type User struct { + gorm.Model + UserName string `gorm:"column:username"` + NickName string `gorm:"column:nickname"` + Password string `gorm:"column:password"` +} + +func (u User) TableName() string { + return "users" +} diff --git a/orm/gorm/app/user/service/internal/data/user.go b/orm/gorm/app/user/service/internal/data/user.go new file mode 100644 index 0000000..8d31c37 --- /dev/null +++ b/orm/gorm/app/user/service/internal/data/user.go @@ -0,0 +1,132 @@ +package data + +import ( + "context" + + "github.com/go-kratos/kratos/v2/log" + "github.com/tx7do/kratos-utils/crypto" + util "github.com/tx7do/kratos-utils/time" + + "kratos-gorm-example/app/user/service/internal/biz" + "kratos-gorm-example/app/user/service/internal/data/models" + + "kratos-gorm-example/gen/api/go/common/pagination" + v1 "kratos-gorm-example/gen/api/go/user/service/v1" +) + +var _ biz.UserRepo = (*UserRepo)(nil) + +type UserRepo struct { + data *Data + log *log.Helper +} + +func NewUserRepo(data *Data, logger log.Logger) biz.UserRepo { + l := log.NewHelper(log.With(logger, "module", "user/repo/user-service")) + return &UserRepo{ + data: data, + log: l, + } +} + +func (r *UserRepo) convertModelToProto(in *models.User) *v1.User { + if in == nil { + return nil + } + return &v1.User{ + Id: uint32(in.ID), + UserName: &in.UserName, + NickName: &in.NickName, + Password: &in.Password, + CreateTime: util.TimeToTimeString(&in.CreatedAt), + UpdateTime: util.TimeToTimeString(&in.UpdatedAt), + } +} + +func (r *UserRepo) List(_ context.Context, req *pagination.PagingRequest) (*v1.ListUserResponse, error) { + var results []models.User + + result := r.data.db. + Limit(int(req.GetPageSize())). + Offset(int(req.GetPageSize() * (req.GetPage() - 1))). + Find(&results) + if result.Error != nil { + return nil, result.Error + } + + items := make([]*v1.User, 0, len(results)) + for _, res := range results { + item := r.convertModelToProto(&res) + items = append(items, item) + } + + var count int64 + result = r.data.db.Model(&models.User{}). + Count(&count) + if result.Error != nil { + return nil, result.Error + } + + return &v1.ListUserResponse{ + Total: int32(count), + Items: items, + }, nil +} + +func (r *UserRepo) Get(_ context.Context, req *v1.GetUserRequest) (*v1.User, error) { + res := &models.User{} + r.data.db.First(res, "id = ?", req.GetId()) + return r.convertModelToProto(res), nil +} + +func (r *UserRepo) Create(_ context.Context, req *v1.CreateUserRequest) (*v1.User, error) { + cryptoPassword, err := crypto.HashPassword(req.User.GetPassword()) + if err != nil { + return nil, err + } + + res := &models.User{ + UserName: req.User.GetUserName(), + NickName: req.User.GetNickName(), + Password: cryptoPassword, + } + + result := r.data.db.Create(res) + if result.Error != nil { + return nil, result.Error + } + + return r.convertModelToProto(res), err +} + +func (r *UserRepo) Update(_ context.Context, req *v1.UpdateUserRequest) (*v1.User, error) { + var cryptoPassword string + var err error + if req.User.Password != nil { + cryptoPassword, err = crypto.HashPassword(req.User.GetPassword()) + if err != nil { + return nil, err + } + } + + res := &models.User{ + UserName: req.User.GetUserName(), + NickName: req.User.GetNickName(), + Password: cryptoPassword, + } + + result := r.data.db.Model(res).Updates(res) + if result.Error != nil { + return nil, result.Error + } + + return r.convertModelToProto(res), err +} + +func (r *UserRepo) Delete(_ context.Context, req *v1.DeleteUserRequest) (bool, error) { + result := r.data.db.Delete(&models.User{}, req.GetId()) + if result.Error != nil { + return false, result.Error + } + return true, nil +} diff --git a/orm/gorm/app/user/service/internal/server/grpc.go b/orm/gorm/app/user/service/internal/server/grpc.go new file mode 100644 index 0000000..cdf81eb --- /dev/null +++ b/orm/gorm/app/user/service/internal/server/grpc.go @@ -0,0 +1,25 @@ +package server + +import ( + "github.com/go-kratos/kratos/v2/log" + "github.com/go-kratos/kratos/v2/middleware/logging" + "github.com/go-kratos/kratos/v2/transport/grpc" + + "kratos-gorm-example/app/user/service/internal/service" + + "kratos-gorm-example/gen/api/go/common/conf" + userV1 "kratos-gorm-example/gen/api/go/user/service/v1" + + "kratos-gorm-example/pkg/bootstrap" +) + +// NewGRPCServer new a gRPC server. +func NewGRPCServer(cfg *conf.Bootstrap, logger log.Logger, + userSvc *service.UserService, +) *grpc.Server { + srv := bootstrap.CreateGrpcServer(cfg, logging.Server(logger)) + + userV1.RegisterUserServiceServer(srv, userSvc) + + return srv +} diff --git a/orm/gorm/app/user/service/internal/server/init.go b/orm/gorm/app/user/service/internal/server/init.go new file mode 100644 index 0000000..b5aa82c --- /dev/null +++ b/orm/gorm/app/user/service/internal/server/init.go @@ -0,0 +1,8 @@ +package server + +import ( + "github.com/google/wire" +) + +// ProviderSet is server providers. +var ProviderSet = wire.NewSet(NewGRPCServer) diff --git a/orm/gorm/app/user/service/internal/service/README.md b/orm/gorm/app/user/service/internal/service/README.md new file mode 100644 index 0000000..2cbd151 --- /dev/null +++ b/orm/gorm/app/user/service/internal/service/README.md @@ -0,0 +1 @@ +# Service diff --git a/orm/gorm/app/user/service/internal/service/init.go b/orm/gorm/app/user/service/internal/service/init.go new file mode 100644 index 0000000..33cdc72 --- /dev/null +++ b/orm/gorm/app/user/service/internal/service/init.go @@ -0,0 +1,10 @@ +package service + +import ( + "github.com/google/wire" +) + +// ProviderSet is service providers. +var ProviderSet = wire.NewSet( + NewUserService, +) diff --git a/orm/gorm/app/user/service/internal/service/user.go b/orm/gorm/app/user/service/internal/service/user.go new file mode 100644 index 0000000..779b9bb --- /dev/null +++ b/orm/gorm/app/user/service/internal/service/user.go @@ -0,0 +1,53 @@ +package service + +import ( + "context" + + "github.com/go-kratos/kratos/v2/log" + "google.golang.org/protobuf/types/known/emptypb" + + "kratos-gorm-example/app/user/service/internal/biz" + + "kratos-gorm-example/gen/api/go/common/pagination" + v1 "kratos-gorm-example/gen/api/go/user/service/v1" +) + +type UserService struct { + v1.UnimplementedUserServiceServer + + uc *biz.UserUseCase + log *log.Helper +} + +func NewUserService(logger log.Logger, uc *biz.UserUseCase) *UserService { + l := log.NewHelper(log.With(logger, "module", "user/service/user-service")) + return &UserService{ + log: l, + uc: uc, + } +} + +func (s *UserService) ListUser(ctx context.Context, req *pagination.PagingRequest) (*v1.ListUserResponse, error) { + return s.uc.List(ctx, req) +} + +func (s *UserService) GetUser(ctx context.Context, req *v1.GetUserRequest) (*v1.User, error) { + return s.uc.Get(ctx, req) +} + +func (s *UserService) CreateUser(ctx context.Context, req *v1.CreateUserRequest) (*v1.User, error) { + return s.uc.Create(ctx, req) +} + +func (s *UserService) UpdateUser(ctx context.Context, req *v1.UpdateUserRequest) (*v1.User, error) { + return s.uc.Update(ctx, req) +} + +func (s *UserService) DeleteUser(ctx context.Context, req *v1.DeleteUserRequest) (*emptypb.Empty, error) { + _, err := s.uc.Delete(ctx, req) + if err != nil { + return nil, err + } + + return &emptypb.Empty{}, nil +} diff --git a/orm/gorm/buf.gen.yaml b/orm/gorm/buf.gen.yaml new file mode 100644 index 0000000..d2bd232 --- /dev/null +++ b/orm/gorm/buf.gen.yaml @@ -0,0 +1,37 @@ +# 配置protoc生成规则 +version: v1 +managed: + enabled: false +plugins: + # generate go struct code + #- plugin: buf.build/protocolbuffers/go + - name: go + out: gen/api/go + opt: paths=source_relative + + # generate grpc service code + #- plugin: buf.build/grpc/go + - name: go-grpc + out: gen/api/go + opt: + - paths=source_relative + + # generate rest service code + - name: go-http + out: gen/api/go + opt: + - paths=source_relative + + # generate kratos errors code + - name: go-errors + out: gen/api/go + opt: + - paths=source_relative + + # generate message validator code + #- plugin: buf.build/bufbuild/validate-go + - name: validate + out: gen/api/go + opt: + - paths=source_relative + - lang=go diff --git a/orm/gorm/buf.lock b/orm/gorm/buf.lock new file mode 100644 index 0000000..c91b581 --- /dev/null +++ b/orm/gorm/buf.lock @@ -0,0 +1,2 @@ +# Generated by buf. DO NOT EDIT. +version: v1 diff --git a/orm/gorm/buf.work.yaml b/orm/gorm/buf.work.yaml new file mode 100644 index 0000000..1cd0523 --- /dev/null +++ b/orm/gorm/buf.work.yaml @@ -0,0 +1,3 @@ +version: v1 +directories: + - api \ No newline at end of file diff --git a/orm/gorm/buf.yaml b/orm/gorm/buf.yaml new file mode 100644 index 0000000..1a51945 --- /dev/null +++ b/orm/gorm/buf.yaml @@ -0,0 +1,7 @@ +version: v1 +breaking: + use: + - FILE +lint: + use: + - DEFAULT diff --git a/orm/gorm/gen/api/go/common/conf/bootstrap.pb.go b/orm/gorm/gen/api/go/common/conf/bootstrap.pb.go new file mode 100644 index 0000000..3aa5155 --- /dev/null +++ b/orm/gorm/gen/api/go/common/conf/bootstrap.pb.go @@ -0,0 +1,260 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: common/conf/bootstrap.proto + +package conf + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 引导信息 +type Bootstrap struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Server *Server `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"` + Client *Client `protobuf:"bytes,2,opt,name=client,proto3" json:"client,omitempty"` + Data *Data `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + Trace *Tracer `protobuf:"bytes,4,opt,name=trace,proto3" json:"trace,omitempty"` + Logger *Logger `protobuf:"bytes,5,opt,name=logger,proto3" json:"logger,omitempty"` + Registry *Registry `protobuf:"bytes,6,opt,name=registry,proto3" json:"registry,omitempty"` + Config *RemoteConfig `protobuf:"bytes,7,opt,name=config,proto3" json:"config,omitempty"` + Oss *OSS `protobuf:"bytes,8,opt,name=oss,proto3" json:"oss,omitempty"` +} + +func (x *Bootstrap) Reset() { + *x = Bootstrap{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_bootstrap_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Bootstrap) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Bootstrap) ProtoMessage() {} + +func (x *Bootstrap) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_bootstrap_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Bootstrap.ProtoReflect.Descriptor instead. +func (*Bootstrap) Descriptor() ([]byte, []int) { + return file_common_conf_bootstrap_proto_rawDescGZIP(), []int{0} +} + +func (x *Bootstrap) GetServer() *Server { + if x != nil { + return x.Server + } + return nil +} + +func (x *Bootstrap) GetClient() *Client { + if x != nil { + return x.Client + } + return nil +} + +func (x *Bootstrap) GetData() *Data { + if x != nil { + return x.Data + } + return nil +} + +func (x *Bootstrap) GetTrace() *Tracer { + if x != nil { + return x.Trace + } + return nil +} + +func (x *Bootstrap) GetLogger() *Logger { + if x != nil { + return x.Logger + } + return nil +} + +func (x *Bootstrap) GetRegistry() *Registry { + if x != nil { + return x.Registry + } + return nil +} + +func (x *Bootstrap) GetConfig() *RemoteConfig { + if x != nil { + return x.Config + } + return nil +} + +func (x *Bootstrap) GetOss() *OSS { + if x != nil { + return x.Oss + } + return nil +} + +var File_common_conf_bootstrap_proto protoreflect.FileDescriptor + +var file_common_conf_bootstrap_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x62, 0x6f, + 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x18, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, + 0x66, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, + 0x6f, 0x6e, 0x66, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x6c, 0x6f, + 0x67, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, + 0x6f, 0x6e, 0x66, 0x2f, 0x6f, 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xee, 0x02, 0x0a, 0x09, 0x42, 0x6f, 0x6f, 0x74, + 0x73, 0x74, 0x72, 0x61, 0x70, 0x12, 0x2b, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, + 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x06, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, + 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, + 0x25, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, + 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x29, 0x0a, 0x05, 0x74, 0x72, 0x61, 0x63, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, + 0x6f, 0x6e, 0x66, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x72, 0x52, 0x05, 0x74, 0x72, 0x61, 0x63, + 0x65, 0x12, 0x2b, 0x0a, 0x06, 0x6c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, + 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x52, 0x06, 0x6c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x12, 0x31, + 0x0a, 0x08, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x52, 0x08, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, + 0x79, 0x12, 0x31, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, + 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x12, 0x22, 0x0a, 0x03, 0x6f, 0x73, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, + 0x4f, 0x53, 0x53, 0x52, 0x03, 0x6f, 0x73, 0x73, 0x42, 0x31, 0x5a, 0x2f, 0x6b, 0x72, 0x61, 0x74, + 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x72, 0x6d, 0x2d, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, + 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_common_conf_bootstrap_proto_rawDescOnce sync.Once + file_common_conf_bootstrap_proto_rawDescData = file_common_conf_bootstrap_proto_rawDesc +) + +func file_common_conf_bootstrap_proto_rawDescGZIP() []byte { + file_common_conf_bootstrap_proto_rawDescOnce.Do(func() { + file_common_conf_bootstrap_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_conf_bootstrap_proto_rawDescData) + }) + return file_common_conf_bootstrap_proto_rawDescData +} + +var file_common_conf_bootstrap_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_common_conf_bootstrap_proto_goTypes = []interface{}{ + (*Bootstrap)(nil), // 0: common.conf.Bootstrap + (*Server)(nil), // 1: common.conf.Server + (*Client)(nil), // 2: common.conf.Client + (*Data)(nil), // 3: common.conf.Data + (*Tracer)(nil), // 4: common.conf.Tracer + (*Logger)(nil), // 5: common.conf.Logger + (*Registry)(nil), // 6: common.conf.Registry + (*RemoteConfig)(nil), // 7: common.conf.RemoteConfig + (*OSS)(nil), // 8: common.conf.OSS +} +var file_common_conf_bootstrap_proto_depIdxs = []int32{ + 1, // 0: common.conf.Bootstrap.server:type_name -> common.conf.Server + 2, // 1: common.conf.Bootstrap.client:type_name -> common.conf.Client + 3, // 2: common.conf.Bootstrap.data:type_name -> common.conf.Data + 4, // 3: common.conf.Bootstrap.trace:type_name -> common.conf.Tracer + 5, // 4: common.conf.Bootstrap.logger:type_name -> common.conf.Logger + 6, // 5: common.conf.Bootstrap.registry:type_name -> common.conf.Registry + 7, // 6: common.conf.Bootstrap.config:type_name -> common.conf.RemoteConfig + 8, // 7: common.conf.Bootstrap.oss:type_name -> common.conf.OSS + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_common_conf_bootstrap_proto_init() } +func file_common_conf_bootstrap_proto_init() { + if File_common_conf_bootstrap_proto != nil { + return + } + file_common_conf_tracer_proto_init() + file_common_conf_data_proto_init() + file_common_conf_server_proto_init() + file_common_conf_client_proto_init() + file_common_conf_logger_proto_init() + file_common_conf_registry_proto_init() + file_common_conf_oss_proto_init() + file_common_conf_config_proto_init() + if !protoimpl.UnsafeEnabled { + file_common_conf_bootstrap_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Bootstrap); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_conf_bootstrap_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_conf_bootstrap_proto_goTypes, + DependencyIndexes: file_common_conf_bootstrap_proto_depIdxs, + MessageInfos: file_common_conf_bootstrap_proto_msgTypes, + }.Build() + File_common_conf_bootstrap_proto = out.File + file_common_conf_bootstrap_proto_rawDesc = nil + file_common_conf_bootstrap_proto_goTypes = nil + file_common_conf_bootstrap_proto_depIdxs = nil +} diff --git a/orm/gorm/gen/api/go/common/conf/bootstrap.pb.validate.go b/orm/gorm/gen/api/go/common/conf/bootstrap.pb.validate.go new file mode 100644 index 0000000..4a2b125 --- /dev/null +++ b/orm/gorm/gen/api/go/common/conf/bootstrap.pb.validate.go @@ -0,0 +1,367 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: common/conf/bootstrap.proto + +package conf + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on Bootstrap with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Bootstrap) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Bootstrap with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in BootstrapMultiError, or nil +// if none found. +func (m *Bootstrap) ValidateAll() error { + return m.validate(true) +} + +func (m *Bootstrap) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetServer()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Server", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Server", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetServer()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BootstrapValidationError{ + field: "Server", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetClient()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Client", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Client", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetClient()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BootstrapValidationError{ + field: "Client", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetData()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Data", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Data", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetData()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BootstrapValidationError{ + field: "Data", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetTrace()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Trace", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Trace", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTrace()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BootstrapValidationError{ + field: "Trace", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetLogger()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Logger", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Logger", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetLogger()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BootstrapValidationError{ + field: "Logger", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetRegistry()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Registry", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Registry", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRegistry()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BootstrapValidationError{ + field: "Registry", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetConfig()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Config", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Config", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BootstrapValidationError{ + field: "Config", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetOss()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Oss", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BootstrapValidationError{ + field: "Oss", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetOss()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BootstrapValidationError{ + field: "Oss", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return BootstrapMultiError(errors) + } + + return nil +} + +// BootstrapMultiError is an error wrapping multiple validation errors returned +// by Bootstrap.ValidateAll() if the designated constraints aren't met. +type BootstrapMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m BootstrapMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m BootstrapMultiError) AllErrors() []error { return m } + +// BootstrapValidationError is the validation error returned by +// Bootstrap.Validate if the designated constraints aren't met. +type BootstrapValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e BootstrapValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e BootstrapValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e BootstrapValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e BootstrapValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e BootstrapValidationError) ErrorName() string { return "BootstrapValidationError" } + +// Error satisfies the builtin error interface +func (e BootstrapValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sBootstrap.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = BootstrapValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = BootstrapValidationError{} diff --git a/orm/gorm/gen/api/go/common/conf/client.pb.go b/orm/gorm/gen/api/go/common/conf/client.pb.go new file mode 100644 index 0000000..05f30b6 --- /dev/null +++ b/orm/gorm/gen/api/go/common/conf/client.pb.go @@ -0,0 +1,325 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: common/conf/client.proto + +package conf + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 客户端 +type Client struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Rest *Client_REST `protobuf:"bytes,1,opt,name=rest,proto3" json:"rest,omitempty"` // REST服务 + Grpc *Client_GRPC `protobuf:"bytes,2,opt,name=grpc,proto3" json:"grpc,omitempty"` // gRPC服务 +} + +func (x *Client) Reset() { + *x = Client{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_client_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Client) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Client) ProtoMessage() {} + +func (x *Client) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_client_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Client.ProtoReflect.Descriptor instead. +func (*Client) Descriptor() ([]byte, []int) { + return file_common_conf_client_proto_rawDescGZIP(), []int{0} +} + +func (x *Client) GetRest() *Client_REST { + if x != nil { + return x.Rest + } + return nil +} + +func (x *Client) GetGrpc() *Client_GRPC { + if x != nil { + return x.Grpc + } + return nil +} + +// REST +type Client_REST struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timeout *durationpb.Duration `protobuf:"bytes,1,opt,name=timeout,proto3" json:"timeout,omitempty"` // 超时时间 + Middleware *Middleware `protobuf:"bytes,2,opt,name=middleware,proto3" json:"middleware,omitempty"` +} + +func (x *Client_REST) Reset() { + *x = Client_REST{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_client_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Client_REST) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Client_REST) ProtoMessage() {} + +func (x *Client_REST) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_client_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Client_REST.ProtoReflect.Descriptor instead. +func (*Client_REST) Descriptor() ([]byte, []int) { + return file_common_conf_client_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *Client_REST) GetTimeout() *durationpb.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +func (x *Client_REST) GetMiddleware() *Middleware { + if x != nil { + return x.Middleware + } + return nil +} + +// gPRC +type Client_GRPC struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timeout *durationpb.Duration `protobuf:"bytes,1,opt,name=timeout,proto3" json:"timeout,omitempty"` // 超时时间 + Middleware *Middleware `protobuf:"bytes,2,opt,name=middleware,proto3" json:"middleware,omitempty"` +} + +func (x *Client_GRPC) Reset() { + *x = Client_GRPC{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_client_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Client_GRPC) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Client_GRPC) ProtoMessage() {} + +func (x *Client_GRPC) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_client_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Client_GRPC.ProtoReflect.Descriptor instead. +func (*Client_GRPC) Descriptor() ([]byte, []int) { + return file_common_conf_client_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *Client_GRPC) GetTimeout() *durationpb.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +func (x *Client_GRPC) GetMiddleware() *Middleware { + if x != nil { + return x.Middleware + } + return nil +} + +var File_common_conf_client_proto protoreflect.FileDescriptor + +var file_common_conf_client_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, + 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd0, 0x02, 0x0a, 0x06, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x12, 0x2c, 0x0a, 0x04, 0x72, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x2e, 0x52, 0x45, 0x53, 0x54, 0x52, 0x04, 0x72, 0x65, 0x73, 0x74, 0x12, 0x2c, + 0x0a, 0x04, 0x67, 0x72, 0x70, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x2e, 0x47, 0x52, 0x50, 0x43, 0x52, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x74, 0x0a, 0x04, + 0x52, 0x45, 0x53, 0x54, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x37, 0x0a, 0x0a, 0x6d, 0x69, 0x64, + 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4d, 0x69, 0x64, 0x64, + 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x52, 0x0a, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, + 0x72, 0x65, 0x1a, 0x74, 0x0a, 0x04, 0x47, 0x52, 0x50, 0x43, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, + 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, + 0x37, 0x0a, 0x0a, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, + 0x66, 0x2e, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x52, 0x0a, 0x6d, 0x69, + 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x42, 0x31, 0x5a, 0x2f, 0x6b, 0x72, 0x61, 0x74, + 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x72, 0x6d, 0x2d, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, + 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_common_conf_client_proto_rawDescOnce sync.Once + file_common_conf_client_proto_rawDescData = file_common_conf_client_proto_rawDesc +) + +func file_common_conf_client_proto_rawDescGZIP() []byte { + file_common_conf_client_proto_rawDescOnce.Do(func() { + file_common_conf_client_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_conf_client_proto_rawDescData) + }) + return file_common_conf_client_proto_rawDescData +} + +var file_common_conf_client_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_common_conf_client_proto_goTypes = []interface{}{ + (*Client)(nil), // 0: common.conf.Client + (*Client_REST)(nil), // 1: common.conf.Client.REST + (*Client_GRPC)(nil), // 2: common.conf.Client.GRPC + (*durationpb.Duration)(nil), // 3: google.protobuf.Duration + (*Middleware)(nil), // 4: common.conf.Middleware +} +var file_common_conf_client_proto_depIdxs = []int32{ + 1, // 0: common.conf.Client.rest:type_name -> common.conf.Client.REST + 2, // 1: common.conf.Client.grpc:type_name -> common.conf.Client.GRPC + 3, // 2: common.conf.Client.REST.timeout:type_name -> google.protobuf.Duration + 4, // 3: common.conf.Client.REST.middleware:type_name -> common.conf.Middleware + 3, // 4: common.conf.Client.GRPC.timeout:type_name -> google.protobuf.Duration + 4, // 5: common.conf.Client.GRPC.middleware:type_name -> common.conf.Middleware + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_common_conf_client_proto_init() } +func file_common_conf_client_proto_init() { + if File_common_conf_client_proto != nil { + return + } + file_common_conf_middleware_proto_init() + if !protoimpl.UnsafeEnabled { + file_common_conf_client_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Client); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_client_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Client_REST); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_client_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Client_GRPC); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_conf_client_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_conf_client_proto_goTypes, + DependencyIndexes: file_common_conf_client_proto_depIdxs, + MessageInfos: file_common_conf_client_proto_msgTypes, + }.Build() + File_common_conf_client_proto = out.File + file_common_conf_client_proto_rawDesc = nil + file_common_conf_client_proto_goTypes = nil + file_common_conf_client_proto_depIdxs = nil +} diff --git a/orm/gorm/gen/api/go/common/conf/client.pb.validate.go b/orm/gorm/gen/api/go/common/conf/client.pb.validate.go new file mode 100644 index 0000000..8e47892 --- /dev/null +++ b/orm/gorm/gen/api/go/common/conf/client.pb.validate.go @@ -0,0 +1,506 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: common/conf/client.proto + +package conf + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on Client with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Client) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Client with the rules defined in the +// proto definition for this message. If any rules are violated, the result is +// a list of violation errors wrapped in ClientMultiError, or nil if none found. +func (m *Client) ValidateAll() error { + return m.validate(true) +} + +func (m *Client) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetRest()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ClientValidationError{ + field: "Rest", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ClientValidationError{ + field: "Rest", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRest()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClientValidationError{ + field: "Rest", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetGrpc()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ClientValidationError{ + field: "Grpc", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ClientValidationError{ + field: "Grpc", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetGrpc()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClientValidationError{ + field: "Grpc", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return ClientMultiError(errors) + } + + return nil +} + +// ClientMultiError is an error wrapping multiple validation errors returned by +// Client.ValidateAll() if the designated constraints aren't met. +type ClientMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ClientMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ClientMultiError) AllErrors() []error { return m } + +// ClientValidationError is the validation error returned by Client.Validate if +// the designated constraints aren't met. +type ClientValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ClientValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ClientValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ClientValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ClientValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ClientValidationError) ErrorName() string { return "ClientValidationError" } + +// Error satisfies the builtin error interface +func (e ClientValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sClient.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ClientValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ClientValidationError{} + +// Validate checks the field values on Client_REST with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Client_REST) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Client_REST with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Client_RESTMultiError, or +// nil if none found. +func (m *Client_REST) ValidateAll() error { + return m.validate(true) +} + +func (m *Client_REST) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetTimeout()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Client_RESTValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Client_RESTValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Client_RESTValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetMiddleware()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Client_RESTValidationError{ + field: "Middleware", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Client_RESTValidationError{ + field: "Middleware", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMiddleware()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Client_RESTValidationError{ + field: "Middleware", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return Client_RESTMultiError(errors) + } + + return nil +} + +// Client_RESTMultiError is an error wrapping multiple validation errors +// returned by Client_REST.ValidateAll() if the designated constraints aren't met. +type Client_RESTMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Client_RESTMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Client_RESTMultiError) AllErrors() []error { return m } + +// Client_RESTValidationError is the validation error returned by +// Client_REST.Validate if the designated constraints aren't met. +type Client_RESTValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Client_RESTValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Client_RESTValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Client_RESTValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Client_RESTValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Client_RESTValidationError) ErrorName() string { return "Client_RESTValidationError" } + +// Error satisfies the builtin error interface +func (e Client_RESTValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sClient_REST.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Client_RESTValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Client_RESTValidationError{} + +// Validate checks the field values on Client_GRPC with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Client_GRPC) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Client_GRPC with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Client_GRPCMultiError, or +// nil if none found. +func (m *Client_GRPC) ValidateAll() error { + return m.validate(true) +} + +func (m *Client_GRPC) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetTimeout()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Client_GRPCValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Client_GRPCValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Client_GRPCValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetMiddleware()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Client_GRPCValidationError{ + field: "Middleware", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Client_GRPCValidationError{ + field: "Middleware", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMiddleware()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Client_GRPCValidationError{ + field: "Middleware", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return Client_GRPCMultiError(errors) + } + + return nil +} + +// Client_GRPCMultiError is an error wrapping multiple validation errors +// returned by Client_GRPC.ValidateAll() if the designated constraints aren't met. +type Client_GRPCMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Client_GRPCMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Client_GRPCMultiError) AllErrors() []error { return m } + +// Client_GRPCValidationError is the validation error returned by +// Client_GRPC.Validate if the designated constraints aren't met. +type Client_GRPCValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Client_GRPCValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Client_GRPCValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Client_GRPCValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Client_GRPCValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Client_GRPCValidationError) ErrorName() string { return "Client_GRPCValidationError" } + +// Error satisfies the builtin error interface +func (e Client_GRPCValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sClient_GRPC.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Client_GRPCValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Client_GRPCValidationError{} diff --git a/orm/gorm/gen/api/go/common/conf/config.pb.go b/orm/gorm/gen/api/go/common/conf/config.pb.go new file mode 100644 index 0000000..e476262 --- /dev/null +++ b/orm/gorm/gen/api/go/common/conf/config.pb.go @@ -0,0 +1,687 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: common/conf/config.proto + +package conf + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 配置服务 +type RemoteConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Etcd *RemoteConfig_Etcd `protobuf:"bytes,2,opt,name=etcd,proto3" json:"etcd,omitempty"` + Consul *RemoteConfig_Consul `protobuf:"bytes,3,opt,name=consul,proto3" json:"consul,omitempty"` + Nacos *RemoteConfig_Nacos `protobuf:"bytes,4,opt,name=nacos,proto3" json:"nacos,omitempty"` + Apollo *RemoteConfig_Apollo `protobuf:"bytes,6,opt,name=apollo,proto3" json:"apollo,omitempty"` + Kubernetes *RemoteConfig_Kubernetes `protobuf:"bytes,7,opt,name=kubernetes,proto3" json:"kubernetes,omitempty"` + Polaris *RemoteConfig_Polaris `protobuf:"bytes,8,opt,name=polaris,proto3" json:"polaris,omitempty"` +} + +func (x *RemoteConfig) Reset() { + *x = RemoteConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_config_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoteConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoteConfig) ProtoMessage() {} + +func (x *RemoteConfig) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_config_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoteConfig.ProtoReflect.Descriptor instead. +func (*RemoteConfig) Descriptor() ([]byte, []int) { + return file_common_conf_config_proto_rawDescGZIP(), []int{0} +} + +func (x *RemoteConfig) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *RemoteConfig) GetEtcd() *RemoteConfig_Etcd { + if x != nil { + return x.Etcd + } + return nil +} + +func (x *RemoteConfig) GetConsul() *RemoteConfig_Consul { + if x != nil { + return x.Consul + } + return nil +} + +func (x *RemoteConfig) GetNacos() *RemoteConfig_Nacos { + if x != nil { + return x.Nacos + } + return nil +} + +func (x *RemoteConfig) GetApollo() *RemoteConfig_Apollo { + if x != nil { + return x.Apollo + } + return nil +} + +func (x *RemoteConfig) GetKubernetes() *RemoteConfig_Kubernetes { + if x != nil { + return x.Kubernetes + } + return nil +} + +func (x *RemoteConfig) GetPolaris() *RemoteConfig_Polaris { + if x != nil { + return x.Polaris + } + return nil +} + +type RemoteConfig_Nacos struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // 服务端地址 + Port uint64 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` // 服务端端口 + Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` // +} + +func (x *RemoteConfig_Nacos) Reset() { + *x = RemoteConfig_Nacos{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_config_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoteConfig_Nacos) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoteConfig_Nacos) ProtoMessage() {} + +func (x *RemoteConfig_Nacos) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_config_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoteConfig_Nacos.ProtoReflect.Descriptor instead. +func (*RemoteConfig_Nacos) Descriptor() ([]byte, []int) { + return file_common_conf_config_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *RemoteConfig_Nacos) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *RemoteConfig_Nacos) GetPort() uint64 { + if x != nil { + return x.Port + } + return 0 +} + +func (x *RemoteConfig_Nacos) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +type RemoteConfig_Etcd struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Endpoints []string `protobuf:"bytes,1,rep,name=endpoints,proto3" json:"endpoints,omitempty"` + Timeout *durationpb.Duration `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout,omitempty"` + Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` // +} + +func (x *RemoteConfig_Etcd) Reset() { + *x = RemoteConfig_Etcd{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_config_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoteConfig_Etcd) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoteConfig_Etcd) ProtoMessage() {} + +func (x *RemoteConfig_Etcd) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_config_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoteConfig_Etcd.ProtoReflect.Descriptor instead. +func (*RemoteConfig_Etcd) Descriptor() ([]byte, []int) { + return file_common_conf_config_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *RemoteConfig_Etcd) GetEndpoints() []string { + if x != nil { + return x.Endpoints + } + return nil +} + +func (x *RemoteConfig_Etcd) GetTimeout() *durationpb.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +func (x *RemoteConfig_Etcd) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +type RemoteConfig_Consul struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Scheme string `protobuf:"bytes,1,opt,name=scheme,proto3" json:"scheme,omitempty"` // 网络样式 + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // 服务端地址 + Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` // +} + +func (x *RemoteConfig_Consul) Reset() { + *x = RemoteConfig_Consul{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_config_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoteConfig_Consul) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoteConfig_Consul) ProtoMessage() {} + +func (x *RemoteConfig_Consul) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_config_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoteConfig_Consul.ProtoReflect.Descriptor instead. +func (*RemoteConfig_Consul) Descriptor() ([]byte, []int) { + return file_common_conf_config_proto_rawDescGZIP(), []int{0, 2} +} + +func (x *RemoteConfig_Consul) GetScheme() string { + if x != nil { + return x.Scheme + } + return "" +} + +func (x *RemoteConfig_Consul) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *RemoteConfig_Consul) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +type RemoteConfig_Apollo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` + AppId string `protobuf:"bytes,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + Cluster string `protobuf:"bytes,3,opt,name=cluster,proto3" json:"cluster,omitempty"` + Namespace string `protobuf:"bytes,4,opt,name=namespace,proto3" json:"namespace,omitempty"` + Secret string `protobuf:"bytes,5,opt,name=secret,proto3" json:"secret,omitempty"` +} + +func (x *RemoteConfig_Apollo) Reset() { + *x = RemoteConfig_Apollo{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_config_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoteConfig_Apollo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoteConfig_Apollo) ProtoMessage() {} + +func (x *RemoteConfig_Apollo) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_config_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoteConfig_Apollo.ProtoReflect.Descriptor instead. +func (*RemoteConfig_Apollo) Descriptor() ([]byte, []int) { + return file_common_conf_config_proto_rawDescGZIP(), []int{0, 3} +} + +func (x *RemoteConfig_Apollo) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +func (x *RemoteConfig_Apollo) GetAppId() string { + if x != nil { + return x.AppId + } + return "" +} + +func (x *RemoteConfig_Apollo) GetCluster() string { + if x != nil { + return x.Cluster + } + return "" +} + +func (x *RemoteConfig_Apollo) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *RemoteConfig_Apollo) GetSecret() string { + if x != nil { + return x.Secret + } + return "" +} + +type RemoteConfig_Kubernetes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` +} + +func (x *RemoteConfig_Kubernetes) Reset() { + *x = RemoteConfig_Kubernetes{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_config_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoteConfig_Kubernetes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoteConfig_Kubernetes) ProtoMessage() {} + +func (x *RemoteConfig_Kubernetes) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_config_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoteConfig_Kubernetes.ProtoReflect.Descriptor instead. +func (*RemoteConfig_Kubernetes) Descriptor() ([]byte, []int) { + return file_common_conf_config_proto_rawDescGZIP(), []int{0, 4} +} + +func (x *RemoteConfig_Kubernetes) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +type RemoteConfig_Polaris struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RemoteConfig_Polaris) Reset() { + *x = RemoteConfig_Polaris{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_config_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoteConfig_Polaris) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoteConfig_Polaris) ProtoMessage() {} + +func (x *RemoteConfig_Polaris) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_config_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoteConfig_Polaris.ProtoReflect.Descriptor instead. +func (*RemoteConfig_Polaris) Descriptor() ([]byte, []int) { + return file_common_conf_config_proto_rawDescGZIP(), []int{0, 5} +} + +var File_common_conf_config_proto protoreflect.FileDescriptor + +var file_common_conf_config_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcd, 0x06, 0x0a, 0x0c, 0x52, 0x65, 0x6d, 0x6f, + 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x32, 0x0a, 0x04, + 0x65, 0x74, 0x63, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x45, 0x74, 0x63, 0x64, 0x52, 0x04, 0x65, 0x74, 0x63, 0x64, + 0x12, 0x38, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x43, 0x6f, 0x6e, 0x73, + 0x75, 0x6c, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x12, 0x35, 0x0a, 0x05, 0x6e, 0x61, + 0x63, 0x6f, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x4e, 0x61, 0x63, 0x6f, 0x73, 0x52, 0x05, 0x6e, 0x61, 0x63, 0x6f, + 0x73, 0x12, 0x38, 0x0a, 0x06, 0x61, 0x70, 0x6f, 0x6c, 0x6c, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, + 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x41, 0x70, 0x6f, + 0x6c, 0x6c, 0x6f, 0x52, 0x06, 0x61, 0x70, 0x6f, 0x6c, 0x6c, 0x6f, 0x12, 0x44, 0x0a, 0x0a, 0x6b, + 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x4b, 0x75, 0x62, 0x65, 0x72, + 0x6e, 0x65, 0x74, 0x65, 0x73, 0x52, 0x0a, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, + 0x73, 0x12, 0x3b, 0x0a, 0x07, 0x70, 0x6f, 0x6c, 0x61, 0x72, 0x69, 0x73, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, + 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x50, 0x6f, + 0x6c, 0x61, 0x72, 0x69, 0x73, 0x52, 0x07, 0x70, 0x6f, 0x6c, 0x61, 0x72, 0x69, 0x73, 0x1a, 0x47, + 0x0a, 0x05, 0x4e, 0x61, 0x63, 0x6f, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x1a, 0x6b, 0x0a, 0x04, 0x45, 0x74, 0x63, 0x64, 0x12, + 0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x09, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x33, 0x0a, + 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, + 0x75, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x1a, 0x4c, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x12, 0x16, + 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x1a, 0x8b, 0x01, 0x0a, 0x06, 0x41, 0x70, 0x6f, 0x6c, 0x6c, 0x6f, 0x12, 0x1a, 0x0a, + 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, + 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, + 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, + 0x1a, 0x2a, 0x0a, 0x0a, 0x4b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x12, 0x1c, + 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x1a, 0x09, 0x0a, 0x07, + 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x69, 0x73, 0x42, 0x31, 0x5a, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, + 0x73, 0x2d, 0x67, 0x6f, 0x72, 0x6d, 0x2d, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x67, + 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_common_conf_config_proto_rawDescOnce sync.Once + file_common_conf_config_proto_rawDescData = file_common_conf_config_proto_rawDesc +) + +func file_common_conf_config_proto_rawDescGZIP() []byte { + file_common_conf_config_proto_rawDescOnce.Do(func() { + file_common_conf_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_conf_config_proto_rawDescData) + }) + return file_common_conf_config_proto_rawDescData +} + +var file_common_conf_config_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_common_conf_config_proto_goTypes = []interface{}{ + (*RemoteConfig)(nil), // 0: common.conf.RemoteConfig + (*RemoteConfig_Nacos)(nil), // 1: common.conf.RemoteConfig.Nacos + (*RemoteConfig_Etcd)(nil), // 2: common.conf.RemoteConfig.Etcd + (*RemoteConfig_Consul)(nil), // 3: common.conf.RemoteConfig.Consul + (*RemoteConfig_Apollo)(nil), // 4: common.conf.RemoteConfig.Apollo + (*RemoteConfig_Kubernetes)(nil), // 5: common.conf.RemoteConfig.Kubernetes + (*RemoteConfig_Polaris)(nil), // 6: common.conf.RemoteConfig.Polaris + (*durationpb.Duration)(nil), // 7: google.protobuf.Duration +} +var file_common_conf_config_proto_depIdxs = []int32{ + 2, // 0: common.conf.RemoteConfig.etcd:type_name -> common.conf.RemoteConfig.Etcd + 3, // 1: common.conf.RemoteConfig.consul:type_name -> common.conf.RemoteConfig.Consul + 1, // 2: common.conf.RemoteConfig.nacos:type_name -> common.conf.RemoteConfig.Nacos + 4, // 3: common.conf.RemoteConfig.apollo:type_name -> common.conf.RemoteConfig.Apollo + 5, // 4: common.conf.RemoteConfig.kubernetes:type_name -> common.conf.RemoteConfig.Kubernetes + 6, // 5: common.conf.RemoteConfig.polaris:type_name -> common.conf.RemoteConfig.Polaris + 7, // 6: common.conf.RemoteConfig.Etcd.timeout:type_name -> google.protobuf.Duration + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +} + +func init() { file_common_conf_config_proto_init() } +func file_common_conf_config_proto_init() { + if File_common_conf_config_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_common_conf_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoteConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoteConfig_Nacos); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoteConfig_Etcd); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoteConfig_Consul); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoteConfig_Apollo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoteConfig_Kubernetes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_config_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoteConfig_Polaris); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_conf_config_proto_rawDesc, + NumEnums: 0, + NumMessages: 7, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_conf_config_proto_goTypes, + DependencyIndexes: file_common_conf_config_proto_depIdxs, + MessageInfos: file_common_conf_config_proto_msgTypes, + }.Build() + File_common_conf_config_proto = out.File + file_common_conf_config_proto_rawDesc = nil + file_common_conf_config_proto_goTypes = nil + file_common_conf_config_proto_depIdxs = nil +} diff --git a/orm/gorm/gen/api/go/common/conf/config.pb.validate.go b/orm/gorm/gen/api/go/common/conf/config.pb.validate.go new file mode 100644 index 0000000..6a4e0a6 --- /dev/null +++ b/orm/gorm/gen/api/go/common/conf/config.pb.validate.go @@ -0,0 +1,978 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: common/conf/config.proto + +package conf + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on RemoteConfig with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *RemoteConfig) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on RemoteConfig with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in RemoteConfigMultiError, or +// nil if none found. +func (m *RemoteConfig) ValidateAll() error { + return m.validate(true) +} + +func (m *RemoteConfig) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Type + + if all { + switch v := interface{}(m.GetEtcd()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RemoteConfigValidationError{ + field: "Etcd", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RemoteConfigValidationError{ + field: "Etcd", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetEtcd()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RemoteConfigValidationError{ + field: "Etcd", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetConsul()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RemoteConfigValidationError{ + field: "Consul", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RemoteConfigValidationError{ + field: "Consul", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetConsul()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RemoteConfigValidationError{ + field: "Consul", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetNacos()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RemoteConfigValidationError{ + field: "Nacos", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RemoteConfigValidationError{ + field: "Nacos", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetNacos()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RemoteConfigValidationError{ + field: "Nacos", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetApollo()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RemoteConfigValidationError{ + field: "Apollo", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RemoteConfigValidationError{ + field: "Apollo", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetApollo()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RemoteConfigValidationError{ + field: "Apollo", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetKubernetes()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RemoteConfigValidationError{ + field: "Kubernetes", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RemoteConfigValidationError{ + field: "Kubernetes", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetKubernetes()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RemoteConfigValidationError{ + field: "Kubernetes", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetPolaris()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RemoteConfigValidationError{ + field: "Polaris", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RemoteConfigValidationError{ + field: "Polaris", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetPolaris()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RemoteConfigValidationError{ + field: "Polaris", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return RemoteConfigMultiError(errors) + } + + return nil +} + +// RemoteConfigMultiError is an error wrapping multiple validation errors +// returned by RemoteConfig.ValidateAll() if the designated constraints aren't met. +type RemoteConfigMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m RemoteConfigMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m RemoteConfigMultiError) AllErrors() []error { return m } + +// RemoteConfigValidationError is the validation error returned by +// RemoteConfig.Validate if the designated constraints aren't met. +type RemoteConfigValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RemoteConfigValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RemoteConfigValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RemoteConfigValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RemoteConfigValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RemoteConfigValidationError) ErrorName() string { return "RemoteConfigValidationError" } + +// Error satisfies the builtin error interface +func (e RemoteConfigValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRemoteConfig.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RemoteConfigValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RemoteConfigValidationError{} + +// Validate checks the field values on RemoteConfig_Nacos with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *RemoteConfig_Nacos) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on RemoteConfig_Nacos with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// RemoteConfig_NacosMultiError, or nil if none found. +func (m *RemoteConfig_Nacos) ValidateAll() error { + return m.validate(true) +} + +func (m *RemoteConfig_Nacos) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Address + + // no validation rules for Port + + // no validation rules for Key + + if len(errors) > 0 { + return RemoteConfig_NacosMultiError(errors) + } + + return nil +} + +// RemoteConfig_NacosMultiError is an error wrapping multiple validation errors +// returned by RemoteConfig_Nacos.ValidateAll() if the designated constraints +// aren't met. +type RemoteConfig_NacosMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m RemoteConfig_NacosMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m RemoteConfig_NacosMultiError) AllErrors() []error { return m } + +// RemoteConfig_NacosValidationError is the validation error returned by +// RemoteConfig_Nacos.Validate if the designated constraints aren't met. +type RemoteConfig_NacosValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RemoteConfig_NacosValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RemoteConfig_NacosValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RemoteConfig_NacosValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RemoteConfig_NacosValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RemoteConfig_NacosValidationError) ErrorName() string { + return "RemoteConfig_NacosValidationError" +} + +// Error satisfies the builtin error interface +func (e RemoteConfig_NacosValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRemoteConfig_Nacos.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RemoteConfig_NacosValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RemoteConfig_NacosValidationError{} + +// Validate checks the field values on RemoteConfig_Etcd with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *RemoteConfig_Etcd) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on RemoteConfig_Etcd with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// RemoteConfig_EtcdMultiError, or nil if none found. +func (m *RemoteConfig_Etcd) ValidateAll() error { + return m.validate(true) +} + +func (m *RemoteConfig_Etcd) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetTimeout()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RemoteConfig_EtcdValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RemoteConfig_EtcdValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RemoteConfig_EtcdValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for Key + + if len(errors) > 0 { + return RemoteConfig_EtcdMultiError(errors) + } + + return nil +} + +// RemoteConfig_EtcdMultiError is an error wrapping multiple validation errors +// returned by RemoteConfig_Etcd.ValidateAll() if the designated constraints +// aren't met. +type RemoteConfig_EtcdMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m RemoteConfig_EtcdMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m RemoteConfig_EtcdMultiError) AllErrors() []error { return m } + +// RemoteConfig_EtcdValidationError is the validation error returned by +// RemoteConfig_Etcd.Validate if the designated constraints aren't met. +type RemoteConfig_EtcdValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RemoteConfig_EtcdValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RemoteConfig_EtcdValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RemoteConfig_EtcdValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RemoteConfig_EtcdValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RemoteConfig_EtcdValidationError) ErrorName() string { + return "RemoteConfig_EtcdValidationError" +} + +// Error satisfies the builtin error interface +func (e RemoteConfig_EtcdValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRemoteConfig_Etcd.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RemoteConfig_EtcdValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RemoteConfig_EtcdValidationError{} + +// Validate checks the field values on RemoteConfig_Consul with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *RemoteConfig_Consul) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on RemoteConfig_Consul with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// RemoteConfig_ConsulMultiError, or nil if none found. +func (m *RemoteConfig_Consul) ValidateAll() error { + return m.validate(true) +} + +func (m *RemoteConfig_Consul) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Scheme + + // no validation rules for Address + + // no validation rules for Key + + if len(errors) > 0 { + return RemoteConfig_ConsulMultiError(errors) + } + + return nil +} + +// RemoteConfig_ConsulMultiError is an error wrapping multiple validation +// errors returned by RemoteConfig_Consul.ValidateAll() if the designated +// constraints aren't met. +type RemoteConfig_ConsulMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m RemoteConfig_ConsulMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m RemoteConfig_ConsulMultiError) AllErrors() []error { return m } + +// RemoteConfig_ConsulValidationError is the validation error returned by +// RemoteConfig_Consul.Validate if the designated constraints aren't met. +type RemoteConfig_ConsulValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RemoteConfig_ConsulValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RemoteConfig_ConsulValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RemoteConfig_ConsulValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RemoteConfig_ConsulValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RemoteConfig_ConsulValidationError) ErrorName() string { + return "RemoteConfig_ConsulValidationError" +} + +// Error satisfies the builtin error interface +func (e RemoteConfig_ConsulValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRemoteConfig_Consul.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RemoteConfig_ConsulValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RemoteConfig_ConsulValidationError{} + +// Validate checks the field values on RemoteConfig_Apollo with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *RemoteConfig_Apollo) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on RemoteConfig_Apollo with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// RemoteConfig_ApolloMultiError, or nil if none found. +func (m *RemoteConfig_Apollo) ValidateAll() error { + return m.validate(true) +} + +func (m *RemoteConfig_Apollo) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Endpoint + + // no validation rules for AppId + + // no validation rules for Cluster + + // no validation rules for Namespace + + // no validation rules for Secret + + if len(errors) > 0 { + return RemoteConfig_ApolloMultiError(errors) + } + + return nil +} + +// RemoteConfig_ApolloMultiError is an error wrapping multiple validation +// errors returned by RemoteConfig_Apollo.ValidateAll() if the designated +// constraints aren't met. +type RemoteConfig_ApolloMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m RemoteConfig_ApolloMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m RemoteConfig_ApolloMultiError) AllErrors() []error { return m } + +// RemoteConfig_ApolloValidationError is the validation error returned by +// RemoteConfig_Apollo.Validate if the designated constraints aren't met. +type RemoteConfig_ApolloValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RemoteConfig_ApolloValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RemoteConfig_ApolloValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RemoteConfig_ApolloValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RemoteConfig_ApolloValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RemoteConfig_ApolloValidationError) ErrorName() string { + return "RemoteConfig_ApolloValidationError" +} + +// Error satisfies the builtin error interface +func (e RemoteConfig_ApolloValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRemoteConfig_Apollo.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RemoteConfig_ApolloValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RemoteConfig_ApolloValidationError{} + +// Validate checks the field values on RemoteConfig_Kubernetes with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *RemoteConfig_Kubernetes) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on RemoteConfig_Kubernetes with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// RemoteConfig_KubernetesMultiError, or nil if none found. +func (m *RemoteConfig_Kubernetes) ValidateAll() error { + return m.validate(true) +} + +func (m *RemoteConfig_Kubernetes) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Namespace + + if len(errors) > 0 { + return RemoteConfig_KubernetesMultiError(errors) + } + + return nil +} + +// RemoteConfig_KubernetesMultiError is an error wrapping multiple validation +// errors returned by RemoteConfig_Kubernetes.ValidateAll() if the designated +// constraints aren't met. +type RemoteConfig_KubernetesMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m RemoteConfig_KubernetesMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m RemoteConfig_KubernetesMultiError) AllErrors() []error { return m } + +// RemoteConfig_KubernetesValidationError is the validation error returned by +// RemoteConfig_Kubernetes.Validate if the designated constraints aren't met. +type RemoteConfig_KubernetesValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RemoteConfig_KubernetesValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RemoteConfig_KubernetesValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RemoteConfig_KubernetesValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RemoteConfig_KubernetesValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RemoteConfig_KubernetesValidationError) ErrorName() string { + return "RemoteConfig_KubernetesValidationError" +} + +// Error satisfies the builtin error interface +func (e RemoteConfig_KubernetesValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRemoteConfig_Kubernetes.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RemoteConfig_KubernetesValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RemoteConfig_KubernetesValidationError{} + +// Validate checks the field values on RemoteConfig_Polaris with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *RemoteConfig_Polaris) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on RemoteConfig_Polaris with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// RemoteConfig_PolarisMultiError, or nil if none found. +func (m *RemoteConfig_Polaris) ValidateAll() error { + return m.validate(true) +} + +func (m *RemoteConfig_Polaris) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return RemoteConfig_PolarisMultiError(errors) + } + + return nil +} + +// RemoteConfig_PolarisMultiError is an error wrapping multiple validation +// errors returned by RemoteConfig_Polaris.ValidateAll() if the designated +// constraints aren't met. +type RemoteConfig_PolarisMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m RemoteConfig_PolarisMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m RemoteConfig_PolarisMultiError) AllErrors() []error { return m } + +// RemoteConfig_PolarisValidationError is the validation error returned by +// RemoteConfig_Polaris.Validate if the designated constraints aren't met. +type RemoteConfig_PolarisValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RemoteConfig_PolarisValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RemoteConfig_PolarisValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RemoteConfig_PolarisValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RemoteConfig_PolarisValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RemoteConfig_PolarisValidationError) ErrorName() string { + return "RemoteConfig_PolarisValidationError" +} + +// Error satisfies the builtin error interface +func (e RemoteConfig_PolarisValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRemoteConfig_Polaris.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RemoteConfig_PolarisValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RemoteConfig_PolarisValidationError{} diff --git a/orm/gorm/gen/api/go/common/conf/data.pb.go b/orm/gorm/gen/api/go/common/conf/data.pb.go new file mode 100644 index 0000000..7729f36 --- /dev/null +++ b/orm/gorm/gen/api/go/common/conf/data.pb.go @@ -0,0 +1,377 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: common/conf/data.proto + +package conf + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 数据 +type Data struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Database *Data_Database `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` // 数据库 + Redis *Data_Redis `protobuf:"bytes,2,opt,name=redis,proto3" json:"redis,omitempty"` // Redis +} + +func (x *Data) Reset() { + *x = Data{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_data_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Data) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Data) ProtoMessage() {} + +func (x *Data) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_data_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Data.ProtoReflect.Descriptor instead. +func (*Data) Descriptor() ([]byte, []int) { + return file_common_conf_data_proto_rawDescGZIP(), []int{0} +} + +func (x *Data) GetDatabase() *Data_Database { + if x != nil { + return x.Database + } + return nil +} + +func (x *Data) GetRedis() *Data_Redis { + if x != nil { + return x.Redis + } + return nil +} + +// 数据库 +type Data_Database struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Driver string `protobuf:"bytes,1,opt,name=driver,proto3" json:"driver,omitempty"` // 驱动名:mysql、postgresql、mongodb、sqlite…… + Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` // 数据源(DSN字符串) + Migrate bool `protobuf:"varint,3,opt,name=migrate,proto3" json:"migrate,omitempty"` // 数据迁移开关 +} + +func (x *Data_Database) Reset() { + *x = Data_Database{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_data_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Data_Database) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Data_Database) ProtoMessage() {} + +func (x *Data_Database) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_data_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Data_Database.ProtoReflect.Descriptor instead. +func (*Data_Database) Descriptor() ([]byte, []int) { + return file_common_conf_data_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *Data_Database) GetDriver() string { + if x != nil { + return x.Driver + } + return "" +} + +func (x *Data_Database) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + +func (x *Data_Database) GetMigrate() bool { + if x != nil { + return x.Migrate + } + return false +} + +// redis +type Data_Redis struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` // 网络 + Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` // 服务端地址 + Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` // 密码 + Db int32 `protobuf:"varint,4,opt,name=db,proto3" json:"db,omitempty"` // 数据库索引 + DialTimeout *durationpb.Duration `protobuf:"bytes,5,opt,name=dial_timeout,json=dialTimeout,proto3" json:"dial_timeout,omitempty"` // 连接超时时间 + ReadTimeout *durationpb.Duration `protobuf:"bytes,6,opt,name=read_timeout,json=readTimeout,proto3" json:"read_timeout,omitempty"` // 读取超时时间 + WriteTimeout *durationpb.Duration `protobuf:"bytes,7,opt,name=write_timeout,json=writeTimeout,proto3" json:"write_timeout,omitempty"` // 写入超时时间 +} + +func (x *Data_Redis) Reset() { + *x = Data_Redis{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_data_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Data_Redis) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Data_Redis) ProtoMessage() {} + +func (x *Data_Redis) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_data_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Data_Redis.ProtoReflect.Descriptor instead. +func (*Data_Redis) Descriptor() ([]byte, []int) { + return file_common_conf_data_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *Data_Redis) GetNetwork() string { + if x != nil { + return x.Network + } + return "" +} + +func (x *Data_Redis) GetAddr() string { + if x != nil { + return x.Addr + } + return "" +} + +func (x *Data_Redis) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +func (x *Data_Redis) GetDb() int32 { + if x != nil { + return x.Db + } + return 0 +} + +func (x *Data_Redis) GetDialTimeout() *durationpb.Duration { + if x != nil { + return x.DialTimeout + } + return nil +} + +func (x *Data_Redis) GetReadTimeout() *durationpb.Duration { + if x != nil { + return x.ReadTimeout + } + return nil +} + +func (x *Data_Redis) GetWriteTimeout() *durationpb.Duration { + if x != nil { + return x.WriteTimeout + } + return nil +} + +var File_common_conf_data_proto protoreflect.FileDescriptor + +var file_common_conf_data_proto_rawDesc = []byte{ + 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x64, 0x61, + 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe3, 0x03, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x36, + 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, + 0x61, 0x74, 0x61, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x08, 0x64, 0x61, + 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, + 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x64, 0x69, 0x73, 0x52, 0x05, + 0x72, 0x65, 0x64, 0x69, 0x73, 0x1a, 0x54, 0x0a, 0x08, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x07, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x1a, 0x9d, 0x02, 0x0a, 0x05, + 0x52, 0x65, 0x64, 0x69, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, + 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, + 0x64, 0x64, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, + 0x0e, 0x0a, 0x02, 0x64, 0x62, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x64, 0x62, 0x12, + 0x3c, 0x0a, 0x0c, 0x64, 0x69, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x0b, 0x64, 0x69, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3c, 0x0a, + 0x0c, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, + 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x77, + 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x77, + 0x72, 0x69, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x42, 0x31, 0x5a, 0x2f, 0x6b, + 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x72, 0x6d, 0x2d, 0x65, 0x78, 0x61, 0x6d, 0x70, + 0x6c, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_common_conf_data_proto_rawDescOnce sync.Once + file_common_conf_data_proto_rawDescData = file_common_conf_data_proto_rawDesc +) + +func file_common_conf_data_proto_rawDescGZIP() []byte { + file_common_conf_data_proto_rawDescOnce.Do(func() { + file_common_conf_data_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_conf_data_proto_rawDescData) + }) + return file_common_conf_data_proto_rawDescData +} + +var file_common_conf_data_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_common_conf_data_proto_goTypes = []interface{}{ + (*Data)(nil), // 0: common.conf.Data + (*Data_Database)(nil), // 1: common.conf.Data.Database + (*Data_Redis)(nil), // 2: common.conf.Data.Redis + (*durationpb.Duration)(nil), // 3: google.protobuf.Duration +} +var file_common_conf_data_proto_depIdxs = []int32{ + 1, // 0: common.conf.Data.database:type_name -> common.conf.Data.Database + 2, // 1: common.conf.Data.redis:type_name -> common.conf.Data.Redis + 3, // 2: common.conf.Data.Redis.dial_timeout:type_name -> google.protobuf.Duration + 3, // 3: common.conf.Data.Redis.read_timeout:type_name -> google.protobuf.Duration + 3, // 4: common.conf.Data.Redis.write_timeout:type_name -> google.protobuf.Duration + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_common_conf_data_proto_init() } +func file_common_conf_data_proto_init() { + if File_common_conf_data_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_common_conf_data_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Data); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_data_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Data_Database); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_data_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Data_Redis); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_conf_data_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_conf_data_proto_goTypes, + DependencyIndexes: file_common_conf_data_proto_depIdxs, + MessageInfos: file_common_conf_data_proto_msgTypes, + }.Build() + File_common_conf_data_proto = out.File + file_common_conf_data_proto_rawDesc = nil + file_common_conf_data_proto_goTypes = nil + file_common_conf_data_proto_depIdxs = nil +} diff --git a/orm/gorm/gen/api/go/common/conf/data.pb.validate.go b/orm/gorm/gen/api/go/common/conf/data.pb.validate.go new file mode 100644 index 0000000..e3b00b4 --- /dev/null +++ b/orm/gorm/gen/api/go/common/conf/data.pb.validate.go @@ -0,0 +1,492 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: common/conf/data.proto + +package conf + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on Data with the rules defined in the proto +// definition for this message. If any rules are violated, the first error +// encountered is returned, or nil if there are no violations. +func (m *Data) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Data with the rules defined in the +// proto definition for this message. If any rules are violated, the result is +// a list of violation errors wrapped in DataMultiError, or nil if none found. +func (m *Data) ValidateAll() error { + return m.validate(true) +} + +func (m *Data) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetDatabase()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, DataValidationError{ + field: "Database", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, DataValidationError{ + field: "Database", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDatabase()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DataValidationError{ + field: "Database", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetRedis()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, DataValidationError{ + field: "Redis", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, DataValidationError{ + field: "Redis", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRedis()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DataValidationError{ + field: "Redis", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return DataMultiError(errors) + } + + return nil +} + +// DataMultiError is an error wrapping multiple validation errors returned by +// Data.ValidateAll() if the designated constraints aren't met. +type DataMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m DataMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m DataMultiError) AllErrors() []error { return m } + +// DataValidationError is the validation error returned by Data.Validate if the +// designated constraints aren't met. +type DataValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DataValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DataValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DataValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DataValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DataValidationError) ErrorName() string { return "DataValidationError" } + +// Error satisfies the builtin error interface +func (e DataValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sData.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DataValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DataValidationError{} + +// Validate checks the field values on Data_Database with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Data_Database) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Data_Database with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Data_DatabaseMultiError, or +// nil if none found. +func (m *Data_Database) ValidateAll() error { + return m.validate(true) +} + +func (m *Data_Database) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Driver + + // no validation rules for Source + + // no validation rules for Migrate + + if len(errors) > 0 { + return Data_DatabaseMultiError(errors) + } + + return nil +} + +// Data_DatabaseMultiError is an error wrapping multiple validation errors +// returned by Data_Database.ValidateAll() if the designated constraints +// aren't met. +type Data_DatabaseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Data_DatabaseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Data_DatabaseMultiError) AllErrors() []error { return m } + +// Data_DatabaseValidationError is the validation error returned by +// Data_Database.Validate if the designated constraints aren't met. +type Data_DatabaseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Data_DatabaseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Data_DatabaseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Data_DatabaseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Data_DatabaseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Data_DatabaseValidationError) ErrorName() string { return "Data_DatabaseValidationError" } + +// Error satisfies the builtin error interface +func (e Data_DatabaseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sData_Database.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Data_DatabaseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Data_DatabaseValidationError{} + +// Validate checks the field values on Data_Redis with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Data_Redis) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Data_Redis with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Data_RedisMultiError, or +// nil if none found. +func (m *Data_Redis) ValidateAll() error { + return m.validate(true) +} + +func (m *Data_Redis) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Network + + // no validation rules for Addr + + // no validation rules for Password + + // no validation rules for Db + + if all { + switch v := interface{}(m.GetDialTimeout()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Data_RedisValidationError{ + field: "DialTimeout", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Data_RedisValidationError{ + field: "DialTimeout", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDialTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Data_RedisValidationError{ + field: "DialTimeout", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetReadTimeout()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Data_RedisValidationError{ + field: "ReadTimeout", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Data_RedisValidationError{ + field: "ReadTimeout", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetReadTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Data_RedisValidationError{ + field: "ReadTimeout", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetWriteTimeout()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Data_RedisValidationError{ + field: "WriteTimeout", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Data_RedisValidationError{ + field: "WriteTimeout", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetWriteTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Data_RedisValidationError{ + field: "WriteTimeout", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return Data_RedisMultiError(errors) + } + + return nil +} + +// Data_RedisMultiError is an error wrapping multiple validation errors +// returned by Data_Redis.ValidateAll() if the designated constraints aren't met. +type Data_RedisMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Data_RedisMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Data_RedisMultiError) AllErrors() []error { return m } + +// Data_RedisValidationError is the validation error returned by +// Data_Redis.Validate if the designated constraints aren't met. +type Data_RedisValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Data_RedisValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Data_RedisValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Data_RedisValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Data_RedisValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Data_RedisValidationError) ErrorName() string { return "Data_RedisValidationError" } + +// Error satisfies the builtin error interface +func (e Data_RedisValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sData_Redis.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Data_RedisValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Data_RedisValidationError{} diff --git a/orm/gorm/gen/api/go/common/conf/logger.pb.go b/orm/gorm/gen/api/go/common/conf/logger.pb.go new file mode 100644 index 0000000..29c261a --- /dev/null +++ b/orm/gorm/gen/api/go/common/conf/logger.pb.go @@ -0,0 +1,663 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: common/conf/logger.proto + +package conf + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 日志 +type Logger struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Zap *Logger_Zap `protobuf:"bytes,2,opt,name=zap,proto3" json:"zap,omitempty"` + Logrus *Logger_Logrus `protobuf:"bytes,3,opt,name=logrus,proto3" json:"logrus,omitempty"` + Fluent *Logger_Fluent `protobuf:"bytes,4,opt,name=fluent,proto3" json:"fluent,omitempty"` + Aliyun *Logger_Aliyun `protobuf:"bytes,5,opt,name=aliyun,proto3" json:"aliyun,omitempty"` + Tencent *Logger_Tencent `protobuf:"bytes,6,opt,name=tencent,proto3" json:"tencent,omitempty"` +} + +func (x *Logger) Reset() { + *x = Logger{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_logger_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Logger) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Logger) ProtoMessage() {} + +func (x *Logger) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_logger_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Logger.ProtoReflect.Descriptor instead. +func (*Logger) Descriptor() ([]byte, []int) { + return file_common_conf_logger_proto_rawDescGZIP(), []int{0} +} + +func (x *Logger) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Logger) GetZap() *Logger_Zap { + if x != nil { + return x.Zap + } + return nil +} + +func (x *Logger) GetLogrus() *Logger_Logrus { + if x != nil { + return x.Logrus + } + return nil +} + +func (x *Logger) GetFluent() *Logger_Fluent { + if x != nil { + return x.Fluent + } + return nil +} + +func (x *Logger) GetAliyun() *Logger_Aliyun { + if x != nil { + return x.Aliyun + } + return nil +} + +func (x *Logger) GetTencent() *Logger_Tencent { + if x != nil { + return x.Tencent + } + return nil +} + +// Zap +type Logger_Zap struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"` // + Level string `protobuf:"bytes,2,opt,name=level,proto3" json:"level,omitempty"` // + MaxSize int32 `protobuf:"varint,3,opt,name=max_size,json=maxSize,proto3" json:"max_size,omitempty"` // + MaxAge int32 `protobuf:"varint,4,opt,name=max_age,json=maxAge,proto3" json:"max_age,omitempty"` // + MaxBackups int32 `protobuf:"varint,5,opt,name=max_backups,json=maxBackups,proto3" json:"max_backups,omitempty"` // +} + +func (x *Logger_Zap) Reset() { + *x = Logger_Zap{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_logger_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Logger_Zap) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Logger_Zap) ProtoMessage() {} + +func (x *Logger_Zap) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_logger_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Logger_Zap.ProtoReflect.Descriptor instead. +func (*Logger_Zap) Descriptor() ([]byte, []int) { + return file_common_conf_logger_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *Logger_Zap) GetFilename() string { + if x != nil { + return x.Filename + } + return "" +} + +func (x *Logger_Zap) GetLevel() string { + if x != nil { + return x.Level + } + return "" +} + +func (x *Logger_Zap) GetMaxSize() int32 { + if x != nil { + return x.MaxSize + } + return 0 +} + +func (x *Logger_Zap) GetMaxAge() int32 { + if x != nil { + return x.MaxAge + } + return 0 +} + +func (x *Logger_Zap) GetMaxBackups() int32 { + if x != nil { + return x.MaxBackups + } + return 0 +} + +// logrus +type Logger_Logrus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Level string `protobuf:"bytes,1,opt,name=level,proto3" json:"level,omitempty"` // 日志等级 + Formatter string `protobuf:"bytes,2,opt,name=formatter,proto3" json:"formatter,omitempty"` // 输出格式:text, json. + TimestampFormat string `protobuf:"bytes,3,opt,name=timestamp_format,json=timestampFormat,proto3" json:"timestamp_format,omitempty"` // 定义时间戳格式,例如:"2006-01-02 15:04:05" + DisableColors bool `protobuf:"varint,4,opt,name=disable_colors,json=disableColors,proto3" json:"disable_colors,omitempty"` // 不需要彩色日志 + DisableTimestamp bool `protobuf:"varint,5,opt,name=disable_timestamp,json=disableTimestamp,proto3" json:"disable_timestamp,omitempty"` // 不需要时间戳 +} + +func (x *Logger_Logrus) Reset() { + *x = Logger_Logrus{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_logger_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Logger_Logrus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Logger_Logrus) ProtoMessage() {} + +func (x *Logger_Logrus) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_logger_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Logger_Logrus.ProtoReflect.Descriptor instead. +func (*Logger_Logrus) Descriptor() ([]byte, []int) { + return file_common_conf_logger_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *Logger_Logrus) GetLevel() string { + if x != nil { + return x.Level + } + return "" +} + +func (x *Logger_Logrus) GetFormatter() string { + if x != nil { + return x.Formatter + } + return "" +} + +func (x *Logger_Logrus) GetTimestampFormat() string { + if x != nil { + return x.TimestampFormat + } + return "" +} + +func (x *Logger_Logrus) GetDisableColors() bool { + if x != nil { + return x.DisableColors + } + return false +} + +func (x *Logger_Logrus) GetDisableTimestamp() bool { + if x != nil { + return x.DisableTimestamp + } + return false +} + +// Fluent +type Logger_Fluent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // 公网接入地址 +} + +func (x *Logger_Fluent) Reset() { + *x = Logger_Fluent{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_logger_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Logger_Fluent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Logger_Fluent) ProtoMessage() {} + +func (x *Logger_Fluent) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_logger_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Logger_Fluent.ProtoReflect.Descriptor instead. +func (*Logger_Fluent) Descriptor() ([]byte, []int) { + return file_common_conf_logger_proto_rawDescGZIP(), []int{0, 2} +} + +func (x *Logger_Fluent) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +// 阿里云 +type Logger_Aliyun struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // 公网接入地址 + Project string `protobuf:"bytes,2,opt,name=project,proto3" json:"project,omitempty"` // + AccessKey string `protobuf:"bytes,3,opt,name=access_key,json=accessKey,proto3" json:"access_key,omitempty"` // 访问密钥ID + AccessSecret string `protobuf:"bytes,4,opt,name=access_secret,json=accessSecret,proto3" json:"access_secret,omitempty"` // 访问密钥 +} + +func (x *Logger_Aliyun) Reset() { + *x = Logger_Aliyun{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_logger_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Logger_Aliyun) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Logger_Aliyun) ProtoMessage() {} + +func (x *Logger_Aliyun) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_logger_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Logger_Aliyun.ProtoReflect.Descriptor instead. +func (*Logger_Aliyun) Descriptor() ([]byte, []int) { + return file_common_conf_logger_proto_rawDescGZIP(), []int{0, 3} +} + +func (x *Logger_Aliyun) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +func (x *Logger_Aliyun) GetProject() string { + if x != nil { + return x.Project + } + return "" +} + +func (x *Logger_Aliyun) GetAccessKey() string { + if x != nil { + return x.AccessKey + } + return "" +} + +func (x *Logger_Aliyun) GetAccessSecret() string { + if x != nil { + return x.AccessSecret + } + return "" +} + +// 腾讯 +type Logger_Tencent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // 公网接入地址 + TopicId string `protobuf:"bytes,2,opt,name=topic_id,json=topicId,proto3" json:"topic_id,omitempty"` // + AccessKey string `protobuf:"bytes,3,opt,name=access_key,json=accessKey,proto3" json:"access_key,omitempty"` // 访问密钥ID + AccessSecret string `protobuf:"bytes,4,opt,name=access_secret,json=accessSecret,proto3" json:"access_secret,omitempty"` // 访问密钥 +} + +func (x *Logger_Tencent) Reset() { + *x = Logger_Tencent{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_logger_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Logger_Tencent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Logger_Tencent) ProtoMessage() {} + +func (x *Logger_Tencent) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_logger_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Logger_Tencent.ProtoReflect.Descriptor instead. +func (*Logger_Tencent) Descriptor() ([]byte, []int) { + return file_common_conf_logger_proto_rawDescGZIP(), []int{0, 4} +} + +func (x *Logger_Tencent) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +func (x *Logger_Tencent) GetTopicId() string { + if x != nil { + return x.TopicId + } + return "" +} + +func (x *Logger_Tencent) GetAccessKey() string { + if x != nil { + return x.AccessKey + } + return "" +} + +func (x *Logger_Tencent) GetAccessSecret() string { + if x != nil { + return x.AccessSecret + } + return "" +} + +var File_common_conf_logger_proto protoreflect.FileDescriptor + +var file_common_conf_logger_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x6c, 0x6f, + 0x67, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x22, 0x99, 0x07, 0x0a, 0x06, 0x4c, 0x6f, 0x67, 0x67, + 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x29, 0x0a, 0x03, 0x7a, 0x61, 0x70, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, + 0x66, 0x2e, 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x5a, 0x61, 0x70, 0x52, 0x03, 0x7a, 0x61, + 0x70, 0x12, 0x32, 0x0a, 0x06, 0x6c, 0x6f, 0x67, 0x72, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, + 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x72, 0x75, 0x73, 0x52, 0x06, 0x6c, + 0x6f, 0x67, 0x72, 0x75, 0x73, 0x12, 0x32, 0x0a, 0x06, 0x66, 0x6c, 0x75, 0x65, 0x6e, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, + 0x6f, 0x6e, 0x66, 0x2e, 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x46, 0x6c, 0x75, 0x65, 0x6e, + 0x74, 0x52, 0x06, 0x66, 0x6c, 0x75, 0x65, 0x6e, 0x74, 0x12, 0x32, 0x0a, 0x06, 0x61, 0x6c, 0x69, + 0x79, 0x75, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x41, + 0x6c, 0x69, 0x79, 0x75, 0x6e, 0x52, 0x06, 0x61, 0x6c, 0x69, 0x79, 0x75, 0x6e, 0x12, 0x35, 0x0a, + 0x07, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4c, 0x6f, 0x67, + 0x67, 0x65, 0x72, 0x2e, 0x54, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x52, 0x07, 0x74, 0x65, 0x6e, + 0x63, 0x65, 0x6e, 0x74, 0x1a, 0x8c, 0x01, 0x0a, 0x03, 0x5a, 0x61, 0x70, 0x12, 0x1a, 0x0a, 0x08, + 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, + 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x19, + 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x6d, 0x61, 0x78, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x61, 0x78, + 0x5f, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6d, 0x61, 0x78, 0x41, + 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, + 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6d, 0x61, 0x78, 0x42, 0x61, 0x63, 0x6b, + 0x75, 0x70, 0x73, 0x1a, 0xbb, 0x01, 0x0a, 0x06, 0x4c, 0x6f, 0x67, 0x72, 0x75, 0x73, 0x12, 0x14, + 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, + 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, + 0x65, 0x72, 0x12, 0x29, 0x0a, 0x10, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, + 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x25, 0x0a, + 0x0e, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x73, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x6f, + 0x6c, 0x6f, 0x72, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x10, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x1a, 0x24, 0x0a, 0x06, 0x46, 0x6c, 0x75, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x65, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x1a, 0x82, 0x01, 0x0a, 0x06, 0x41, 0x6c, 0x69, 0x79, + 0x75, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x18, + 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x1a, 0x84, 0x01, 0x0a, + 0x07, 0x54, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x49, 0x64, 0x12, + 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x23, + 0x0a, 0x0d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x63, + 0x72, 0x65, 0x74, 0x42, 0x31, 0x5a, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, + 0x72, 0x6d, 0x2d, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, + 0x66, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_common_conf_logger_proto_rawDescOnce sync.Once + file_common_conf_logger_proto_rawDescData = file_common_conf_logger_proto_rawDesc +) + +func file_common_conf_logger_proto_rawDescGZIP() []byte { + file_common_conf_logger_proto_rawDescOnce.Do(func() { + file_common_conf_logger_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_conf_logger_proto_rawDescData) + }) + return file_common_conf_logger_proto_rawDescData +} + +var file_common_conf_logger_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_common_conf_logger_proto_goTypes = []interface{}{ + (*Logger)(nil), // 0: common.conf.Logger + (*Logger_Zap)(nil), // 1: common.conf.Logger.Zap + (*Logger_Logrus)(nil), // 2: common.conf.Logger.Logrus + (*Logger_Fluent)(nil), // 3: common.conf.Logger.Fluent + (*Logger_Aliyun)(nil), // 4: common.conf.Logger.Aliyun + (*Logger_Tencent)(nil), // 5: common.conf.Logger.Tencent +} +var file_common_conf_logger_proto_depIdxs = []int32{ + 1, // 0: common.conf.Logger.zap:type_name -> common.conf.Logger.Zap + 2, // 1: common.conf.Logger.logrus:type_name -> common.conf.Logger.Logrus + 3, // 2: common.conf.Logger.fluent:type_name -> common.conf.Logger.Fluent + 4, // 3: common.conf.Logger.aliyun:type_name -> common.conf.Logger.Aliyun + 5, // 4: common.conf.Logger.tencent:type_name -> common.conf.Logger.Tencent + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_common_conf_logger_proto_init() } +func file_common_conf_logger_proto_init() { + if File_common_conf_logger_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_common_conf_logger_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Logger); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_logger_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Logger_Zap); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_logger_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Logger_Logrus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_logger_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Logger_Fluent); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_logger_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Logger_Aliyun); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_logger_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Logger_Tencent); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_conf_logger_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_conf_logger_proto_goTypes, + DependencyIndexes: file_common_conf_logger_proto_depIdxs, + MessageInfos: file_common_conf_logger_proto_msgTypes, + }.Build() + File_common_conf_logger_proto = out.File + file_common_conf_logger_proto_rawDesc = nil + file_common_conf_logger_proto_goTypes = nil + file_common_conf_logger_proto_depIdxs = nil +} diff --git a/orm/gorm/gen/api/go/common/conf/logger.pb.validate.go b/orm/gorm/gen/api/go/common/conf/logger.pb.validate.go new file mode 100644 index 0000000..45a32aa --- /dev/null +++ b/orm/gorm/gen/api/go/common/conf/logger.pb.validate.go @@ -0,0 +1,818 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: common/conf/logger.proto + +package conf + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on Logger with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Logger) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Logger with the rules defined in the +// proto definition for this message. If any rules are violated, the result is +// a list of violation errors wrapped in LoggerMultiError, or nil if none found. +func (m *Logger) ValidateAll() error { + return m.validate(true) +} + +func (m *Logger) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Type + + if all { + switch v := interface{}(m.GetZap()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, LoggerValidationError{ + field: "Zap", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, LoggerValidationError{ + field: "Zap", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetZap()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return LoggerValidationError{ + field: "Zap", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetLogrus()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, LoggerValidationError{ + field: "Logrus", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, LoggerValidationError{ + field: "Logrus", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetLogrus()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return LoggerValidationError{ + field: "Logrus", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetFluent()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, LoggerValidationError{ + field: "Fluent", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, LoggerValidationError{ + field: "Fluent", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetFluent()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return LoggerValidationError{ + field: "Fluent", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetAliyun()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, LoggerValidationError{ + field: "Aliyun", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, LoggerValidationError{ + field: "Aliyun", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetAliyun()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return LoggerValidationError{ + field: "Aliyun", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetTencent()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, LoggerValidationError{ + field: "Tencent", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, LoggerValidationError{ + field: "Tencent", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTencent()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return LoggerValidationError{ + field: "Tencent", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return LoggerMultiError(errors) + } + + return nil +} + +// LoggerMultiError is an error wrapping multiple validation errors returned by +// Logger.ValidateAll() if the designated constraints aren't met. +type LoggerMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m LoggerMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m LoggerMultiError) AllErrors() []error { return m } + +// LoggerValidationError is the validation error returned by Logger.Validate if +// the designated constraints aren't met. +type LoggerValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e LoggerValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e LoggerValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e LoggerValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e LoggerValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e LoggerValidationError) ErrorName() string { return "LoggerValidationError" } + +// Error satisfies the builtin error interface +func (e LoggerValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sLogger.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = LoggerValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = LoggerValidationError{} + +// Validate checks the field values on Logger_Zap with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Logger_Zap) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Logger_Zap with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Logger_ZapMultiError, or +// nil if none found. +func (m *Logger_Zap) ValidateAll() error { + return m.validate(true) +} + +func (m *Logger_Zap) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Filename + + // no validation rules for Level + + // no validation rules for MaxSize + + // no validation rules for MaxAge + + // no validation rules for MaxBackups + + if len(errors) > 0 { + return Logger_ZapMultiError(errors) + } + + return nil +} + +// Logger_ZapMultiError is an error wrapping multiple validation errors +// returned by Logger_Zap.ValidateAll() if the designated constraints aren't met. +type Logger_ZapMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Logger_ZapMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Logger_ZapMultiError) AllErrors() []error { return m } + +// Logger_ZapValidationError is the validation error returned by +// Logger_Zap.Validate if the designated constraints aren't met. +type Logger_ZapValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Logger_ZapValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Logger_ZapValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Logger_ZapValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Logger_ZapValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Logger_ZapValidationError) ErrorName() string { return "Logger_ZapValidationError" } + +// Error satisfies the builtin error interface +func (e Logger_ZapValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sLogger_Zap.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Logger_ZapValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Logger_ZapValidationError{} + +// Validate checks the field values on Logger_Logrus with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Logger_Logrus) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Logger_Logrus with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Logger_LogrusMultiError, or +// nil if none found. +func (m *Logger_Logrus) ValidateAll() error { + return m.validate(true) +} + +func (m *Logger_Logrus) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Level + + // no validation rules for Formatter + + // no validation rules for TimestampFormat + + // no validation rules for DisableColors + + // no validation rules for DisableTimestamp + + if len(errors) > 0 { + return Logger_LogrusMultiError(errors) + } + + return nil +} + +// Logger_LogrusMultiError is an error wrapping multiple validation errors +// returned by Logger_Logrus.ValidateAll() if the designated constraints +// aren't met. +type Logger_LogrusMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Logger_LogrusMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Logger_LogrusMultiError) AllErrors() []error { return m } + +// Logger_LogrusValidationError is the validation error returned by +// Logger_Logrus.Validate if the designated constraints aren't met. +type Logger_LogrusValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Logger_LogrusValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Logger_LogrusValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Logger_LogrusValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Logger_LogrusValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Logger_LogrusValidationError) ErrorName() string { return "Logger_LogrusValidationError" } + +// Error satisfies the builtin error interface +func (e Logger_LogrusValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sLogger_Logrus.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Logger_LogrusValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Logger_LogrusValidationError{} + +// Validate checks the field values on Logger_Fluent with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Logger_Fluent) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Logger_Fluent with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Logger_FluentMultiError, or +// nil if none found. +func (m *Logger_Fluent) ValidateAll() error { + return m.validate(true) +} + +func (m *Logger_Fluent) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Endpoint + + if len(errors) > 0 { + return Logger_FluentMultiError(errors) + } + + return nil +} + +// Logger_FluentMultiError is an error wrapping multiple validation errors +// returned by Logger_Fluent.ValidateAll() if the designated constraints +// aren't met. +type Logger_FluentMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Logger_FluentMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Logger_FluentMultiError) AllErrors() []error { return m } + +// Logger_FluentValidationError is the validation error returned by +// Logger_Fluent.Validate if the designated constraints aren't met. +type Logger_FluentValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Logger_FluentValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Logger_FluentValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Logger_FluentValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Logger_FluentValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Logger_FluentValidationError) ErrorName() string { return "Logger_FluentValidationError" } + +// Error satisfies the builtin error interface +func (e Logger_FluentValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sLogger_Fluent.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Logger_FluentValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Logger_FluentValidationError{} + +// Validate checks the field values on Logger_Aliyun with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Logger_Aliyun) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Logger_Aliyun with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Logger_AliyunMultiError, or +// nil if none found. +func (m *Logger_Aliyun) ValidateAll() error { + return m.validate(true) +} + +func (m *Logger_Aliyun) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Endpoint + + // no validation rules for Project + + // no validation rules for AccessKey + + // no validation rules for AccessSecret + + if len(errors) > 0 { + return Logger_AliyunMultiError(errors) + } + + return nil +} + +// Logger_AliyunMultiError is an error wrapping multiple validation errors +// returned by Logger_Aliyun.ValidateAll() if the designated constraints +// aren't met. +type Logger_AliyunMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Logger_AliyunMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Logger_AliyunMultiError) AllErrors() []error { return m } + +// Logger_AliyunValidationError is the validation error returned by +// Logger_Aliyun.Validate if the designated constraints aren't met. +type Logger_AliyunValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Logger_AliyunValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Logger_AliyunValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Logger_AliyunValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Logger_AliyunValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Logger_AliyunValidationError) ErrorName() string { return "Logger_AliyunValidationError" } + +// Error satisfies the builtin error interface +func (e Logger_AliyunValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sLogger_Aliyun.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Logger_AliyunValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Logger_AliyunValidationError{} + +// Validate checks the field values on Logger_Tencent with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Logger_Tencent) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Logger_Tencent with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Logger_TencentMultiError, +// or nil if none found. +func (m *Logger_Tencent) ValidateAll() error { + return m.validate(true) +} + +func (m *Logger_Tencent) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Endpoint + + // no validation rules for TopicId + + // no validation rules for AccessKey + + // no validation rules for AccessSecret + + if len(errors) > 0 { + return Logger_TencentMultiError(errors) + } + + return nil +} + +// Logger_TencentMultiError is an error wrapping multiple validation errors +// returned by Logger_Tencent.ValidateAll() if the designated constraints +// aren't met. +type Logger_TencentMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Logger_TencentMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Logger_TencentMultiError) AllErrors() []error { return m } + +// Logger_TencentValidationError is the validation error returned by +// Logger_Tencent.Validate if the designated constraints aren't met. +type Logger_TencentValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Logger_TencentValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Logger_TencentValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Logger_TencentValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Logger_TencentValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Logger_TencentValidationError) ErrorName() string { return "Logger_TencentValidationError" } + +// Error satisfies the builtin error interface +func (e Logger_TencentValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sLogger_Tencent.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Logger_TencentValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Logger_TencentValidationError{} diff --git a/orm/gorm/gen/api/go/common/conf/middleware.pb.go b/orm/gorm/gen/api/go/common/conf/middleware.pb.go new file mode 100644 index 0000000..3a92f98 --- /dev/null +++ b/orm/gorm/gen/api/go/common/conf/middleware.pb.go @@ -0,0 +1,457 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: common/conf/middleware.proto + +package conf + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + _ "google.golang.org/protobuf/types/known/durationpb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Middleware struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EnableLogging bool `protobuf:"varint,1,opt,name=enable_logging,json=enableLogging,proto3" json:"enable_logging,omitempty"` // 日志开关 + EnableRecovery bool `protobuf:"varint,2,opt,name=enable_recovery,json=enableRecovery,proto3" json:"enable_recovery,omitempty"` // 异常恢复 + EnableTracing bool `protobuf:"varint,3,opt,name=enable_tracing,json=enableTracing,proto3" json:"enable_tracing,omitempty"` // 链路追踪开关 + EnableValidate bool `protobuf:"varint,4,opt,name=enable_validate,json=enableValidate,proto3" json:"enable_validate,omitempty"` // 参数校验开关 + EnableCircuitBreaker bool `protobuf:"varint,5,opt,name=enable_circuit_breaker,json=enableCircuitBreaker,proto3" json:"enable_circuit_breaker,omitempty"` // 熔断器 + Limiter *Middleware_RateLimiter `protobuf:"bytes,6,opt,name=limiter,proto3" json:"limiter,omitempty"` + Metrics *Middleware_Metrics `protobuf:"bytes,7,opt,name=metrics,proto3" json:"metrics,omitempty"` + Auth *Middleware_Auth `protobuf:"bytes,8,opt,name=auth,proto3" json:"auth,omitempty"` +} + +func (x *Middleware) Reset() { + *x = Middleware{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_middleware_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Middleware) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Middleware) ProtoMessage() {} + +func (x *Middleware) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_middleware_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Middleware.ProtoReflect.Descriptor instead. +func (*Middleware) Descriptor() ([]byte, []int) { + return file_common_conf_middleware_proto_rawDescGZIP(), []int{0} +} + +func (x *Middleware) GetEnableLogging() bool { + if x != nil { + return x.EnableLogging + } + return false +} + +func (x *Middleware) GetEnableRecovery() bool { + if x != nil { + return x.EnableRecovery + } + return false +} + +func (x *Middleware) GetEnableTracing() bool { + if x != nil { + return x.EnableTracing + } + return false +} + +func (x *Middleware) GetEnableValidate() bool { + if x != nil { + return x.EnableValidate + } + return false +} + +func (x *Middleware) GetEnableCircuitBreaker() bool { + if x != nil { + return x.EnableCircuitBreaker + } + return false +} + +func (x *Middleware) GetLimiter() *Middleware_RateLimiter { + if x != nil { + return x.Limiter + } + return nil +} + +func (x *Middleware) GetMetrics() *Middleware_Metrics { + if x != nil { + return x.Metrics + } + return nil +} + +func (x *Middleware) GetAuth() *Middleware_Auth { + if x != nil { + return x.Auth + } + return nil +} + +// JWT校验 +type Middleware_Auth struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Method string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"` // JWT签名的算法,支持算法:HS256 + Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` // JWT 秘钥 +} + +func (x *Middleware_Auth) Reset() { + *x = Middleware_Auth{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_middleware_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Middleware_Auth) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Middleware_Auth) ProtoMessage() {} + +func (x *Middleware_Auth) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_middleware_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Middleware_Auth.ProtoReflect.Descriptor instead. +func (*Middleware_Auth) Descriptor() ([]byte, []int) { + return file_common_conf_middleware_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *Middleware_Auth) GetMethod() string { + if x != nil { + return x.Method + } + return "" +} + +func (x *Middleware_Auth) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +// 限流器 +type Middleware_RateLimiter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // 限流器名字,支持:bbr。 +} + +func (x *Middleware_RateLimiter) Reset() { + *x = Middleware_RateLimiter{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_middleware_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Middleware_RateLimiter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Middleware_RateLimiter) ProtoMessage() {} + +func (x *Middleware_RateLimiter) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_middleware_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Middleware_RateLimiter.ProtoReflect.Descriptor instead. +func (*Middleware_RateLimiter) Descriptor() ([]byte, []int) { + return file_common_conf_middleware_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *Middleware_RateLimiter) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// 性能指标 +type Middleware_Metrics struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Histogram bool `protobuf:"varint,1,opt,name=histogram,proto3" json:"histogram,omitempty"` // 直方图 + Counter bool `protobuf:"varint,2,opt,name=counter,proto3" json:"counter,omitempty"` // 计数器 + Gauge bool `protobuf:"varint,3,opt,name=gauge,proto3" json:"gauge,omitempty"` // 仪表盘 + Summary bool `protobuf:"varint,4,opt,name=summary,proto3" json:"summary,omitempty"` // 摘要 +} + +func (x *Middleware_Metrics) Reset() { + *x = Middleware_Metrics{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_middleware_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Middleware_Metrics) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Middleware_Metrics) ProtoMessage() {} + +func (x *Middleware_Metrics) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_middleware_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Middleware_Metrics.ProtoReflect.Descriptor instead. +func (*Middleware_Metrics) Descriptor() ([]byte, []int) { + return file_common_conf_middleware_proto_rawDescGZIP(), []int{0, 2} +} + +func (x *Middleware_Metrics) GetHistogram() bool { + if x != nil { + return x.Histogram + } + return false +} + +func (x *Middleware_Metrics) GetCounter() bool { + if x != nil { + return x.Counter + } + return false +} + +func (x *Middleware_Metrics) GetGauge() bool { + if x != nil { + return x.Gauge + } + return false +} + +func (x *Middleware_Metrics) GetSummary() bool { + if x != nil { + return x.Summary + } + return false +} + +var File_common_conf_middleware_proto protoreflect.FileDescriptor + +var file_common_conf_middleware_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x6d, 0x69, + 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd6, 0x04, 0x0a, 0x0a, + 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0d, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4c, 0x6f, 0x67, 0x67, 0x69, 0x6e, + 0x67, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x6f, + 0x76, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x65, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0d, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x72, 0x61, 0x63, 0x69, 0x6e, + 0x67, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x65, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x12, 0x34, 0x0a, 0x16, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x63, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74, 0x5f, 0x62, 0x72, 0x65, + 0x61, 0x6b, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x65, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x43, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74, 0x42, 0x72, 0x65, 0x61, 0x6b, 0x65, 0x72, + 0x12, 0x3d, 0x0a, 0x07, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, + 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x52, 0x07, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x12, + 0x39, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4d, + 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, + 0x73, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, 0x30, 0x0a, 0x04, 0x61, 0x75, + 0x74, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, + 0x65, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x52, 0x04, 0x61, 0x75, 0x74, 0x68, 0x1a, 0x30, 0x0a, 0x04, + 0x41, 0x75, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x1a, 0x21, + 0x0a, 0x0b, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x1a, 0x71, 0x0a, 0x07, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, 0x1c, 0x0a, 0x09, + 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x09, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x61, 0x75, 0x67, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x05, 0x67, 0x61, 0x75, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, + 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x6d, + 0x6d, 0x61, 0x72, 0x79, 0x42, 0x31, 0x5a, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x67, + 0x6f, 0x72, 0x6d, 0x2d, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, + 0x6e, 0x66, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_common_conf_middleware_proto_rawDescOnce sync.Once + file_common_conf_middleware_proto_rawDescData = file_common_conf_middleware_proto_rawDesc +) + +func file_common_conf_middleware_proto_rawDescGZIP() []byte { + file_common_conf_middleware_proto_rawDescOnce.Do(func() { + file_common_conf_middleware_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_conf_middleware_proto_rawDescData) + }) + return file_common_conf_middleware_proto_rawDescData +} + +var file_common_conf_middleware_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_common_conf_middleware_proto_goTypes = []interface{}{ + (*Middleware)(nil), // 0: common.conf.Middleware + (*Middleware_Auth)(nil), // 1: common.conf.Middleware.Auth + (*Middleware_RateLimiter)(nil), // 2: common.conf.Middleware.RateLimiter + (*Middleware_Metrics)(nil), // 3: common.conf.Middleware.Metrics +} +var file_common_conf_middleware_proto_depIdxs = []int32{ + 2, // 0: common.conf.Middleware.limiter:type_name -> common.conf.Middleware.RateLimiter + 3, // 1: common.conf.Middleware.metrics:type_name -> common.conf.Middleware.Metrics + 1, // 2: common.conf.Middleware.auth:type_name -> common.conf.Middleware.Auth + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_common_conf_middleware_proto_init() } +func file_common_conf_middleware_proto_init() { + if File_common_conf_middleware_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_common_conf_middleware_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Middleware); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_middleware_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Middleware_Auth); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_middleware_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Middleware_RateLimiter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_middleware_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Middleware_Metrics); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_conf_middleware_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_conf_middleware_proto_goTypes, + DependencyIndexes: file_common_conf_middleware_proto_depIdxs, + MessageInfos: file_common_conf_middleware_proto_msgTypes, + }.Build() + File_common_conf_middleware_proto = out.File + file_common_conf_middleware_proto_rawDesc = nil + file_common_conf_middleware_proto_goTypes = nil + file_common_conf_middleware_proto_depIdxs = nil +} diff --git a/orm/gorm/gen/api/go/common/conf/middleware.pb.validate.go b/orm/gorm/gen/api/go/common/conf/middleware.pb.validate.go new file mode 100644 index 0000000..1506940 --- /dev/null +++ b/orm/gorm/gen/api/go/common/conf/middleware.pb.validate.go @@ -0,0 +1,550 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: common/conf/middleware.proto + +package conf + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on Middleware with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Middleware) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Middleware with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in MiddlewareMultiError, or +// nil if none found. +func (m *Middleware) ValidateAll() error { + return m.validate(true) +} + +func (m *Middleware) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for EnableLogging + + // no validation rules for EnableRecovery + + // no validation rules for EnableTracing + + // no validation rules for EnableValidate + + // no validation rules for EnableCircuitBreaker + + if all { + switch v := interface{}(m.GetLimiter()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, MiddlewareValidationError{ + field: "Limiter", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, MiddlewareValidationError{ + field: "Limiter", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetLimiter()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return MiddlewareValidationError{ + field: "Limiter", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetMetrics()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, MiddlewareValidationError{ + field: "Metrics", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, MiddlewareValidationError{ + field: "Metrics", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMetrics()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return MiddlewareValidationError{ + field: "Metrics", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetAuth()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, MiddlewareValidationError{ + field: "Auth", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, MiddlewareValidationError{ + field: "Auth", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetAuth()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return MiddlewareValidationError{ + field: "Auth", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return MiddlewareMultiError(errors) + } + + return nil +} + +// MiddlewareMultiError is an error wrapping multiple validation errors +// returned by Middleware.ValidateAll() if the designated constraints aren't met. +type MiddlewareMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m MiddlewareMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m MiddlewareMultiError) AllErrors() []error { return m } + +// MiddlewareValidationError is the validation error returned by +// Middleware.Validate if the designated constraints aren't met. +type MiddlewareValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e MiddlewareValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e MiddlewareValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e MiddlewareValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e MiddlewareValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e MiddlewareValidationError) ErrorName() string { return "MiddlewareValidationError" } + +// Error satisfies the builtin error interface +func (e MiddlewareValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sMiddleware.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = MiddlewareValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = MiddlewareValidationError{} + +// Validate checks the field values on Middleware_Auth with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *Middleware_Auth) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Middleware_Auth with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// Middleware_AuthMultiError, or nil if none found. +func (m *Middleware_Auth) ValidateAll() error { + return m.validate(true) +} + +func (m *Middleware_Auth) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Method + + // no validation rules for Key + + if len(errors) > 0 { + return Middleware_AuthMultiError(errors) + } + + return nil +} + +// Middleware_AuthMultiError is an error wrapping multiple validation errors +// returned by Middleware_Auth.ValidateAll() if the designated constraints +// aren't met. +type Middleware_AuthMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Middleware_AuthMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Middleware_AuthMultiError) AllErrors() []error { return m } + +// Middleware_AuthValidationError is the validation error returned by +// Middleware_Auth.Validate if the designated constraints aren't met. +type Middleware_AuthValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Middleware_AuthValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Middleware_AuthValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Middleware_AuthValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Middleware_AuthValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Middleware_AuthValidationError) ErrorName() string { return "Middleware_AuthValidationError" } + +// Error satisfies the builtin error interface +func (e Middleware_AuthValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sMiddleware_Auth.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Middleware_AuthValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Middleware_AuthValidationError{} + +// Validate checks the field values on Middleware_RateLimiter with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *Middleware_RateLimiter) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Middleware_RateLimiter with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// Middleware_RateLimiterMultiError, or nil if none found. +func (m *Middleware_RateLimiter) ValidateAll() error { + return m.validate(true) +} + +func (m *Middleware_RateLimiter) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Name + + if len(errors) > 0 { + return Middleware_RateLimiterMultiError(errors) + } + + return nil +} + +// Middleware_RateLimiterMultiError is an error wrapping multiple validation +// errors returned by Middleware_RateLimiter.ValidateAll() if the designated +// constraints aren't met. +type Middleware_RateLimiterMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Middleware_RateLimiterMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Middleware_RateLimiterMultiError) AllErrors() []error { return m } + +// Middleware_RateLimiterValidationError is the validation error returned by +// Middleware_RateLimiter.Validate if the designated constraints aren't met. +type Middleware_RateLimiterValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Middleware_RateLimiterValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Middleware_RateLimiterValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Middleware_RateLimiterValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Middleware_RateLimiterValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Middleware_RateLimiterValidationError) ErrorName() string { + return "Middleware_RateLimiterValidationError" +} + +// Error satisfies the builtin error interface +func (e Middleware_RateLimiterValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sMiddleware_RateLimiter.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Middleware_RateLimiterValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Middleware_RateLimiterValidationError{} + +// Validate checks the field values on Middleware_Metrics with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *Middleware_Metrics) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Middleware_Metrics with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// Middleware_MetricsMultiError, or nil if none found. +func (m *Middleware_Metrics) ValidateAll() error { + return m.validate(true) +} + +func (m *Middleware_Metrics) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Histogram + + // no validation rules for Counter + + // no validation rules for Gauge + + // no validation rules for Summary + + if len(errors) > 0 { + return Middleware_MetricsMultiError(errors) + } + + return nil +} + +// Middleware_MetricsMultiError is an error wrapping multiple validation errors +// returned by Middleware_Metrics.ValidateAll() if the designated constraints +// aren't met. +type Middleware_MetricsMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Middleware_MetricsMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Middleware_MetricsMultiError) AllErrors() []error { return m } + +// Middleware_MetricsValidationError is the validation error returned by +// Middleware_Metrics.Validate if the designated constraints aren't met. +type Middleware_MetricsValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Middleware_MetricsValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Middleware_MetricsValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Middleware_MetricsValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Middleware_MetricsValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Middleware_MetricsValidationError) ErrorName() string { + return "Middleware_MetricsValidationError" +} + +// Error satisfies the builtin error interface +func (e Middleware_MetricsValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sMiddleware_Metrics.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Middleware_MetricsValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Middleware_MetricsValidationError{} diff --git a/orm/gorm/gen/api/go/common/conf/oss.pb.go b/orm/gorm/gen/api/go/common/conf/oss.pb.go new file mode 100644 index 0000000..47ce567 --- /dev/null +++ b/orm/gorm/gen/api/go/common/conf/oss.pb.go @@ -0,0 +1,269 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: common/conf/oss.proto + +package conf + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type OSS struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Minio *OSS_MinIO `protobuf:"bytes,1,opt,name=minio,proto3" json:"minio,omitempty"` +} + +func (x *OSS) Reset() { + *x = OSS{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_oss_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OSS) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OSS) ProtoMessage() {} + +func (x *OSS) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_oss_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OSS.ProtoReflect.Descriptor instead. +func (*OSS) Descriptor() ([]byte, []int) { + return file_common_conf_oss_proto_rawDescGZIP(), []int{0} +} + +func (x *OSS) GetMinio() *OSS_MinIO { + if x != nil { + return x.Minio + } + return nil +} + +// MinIO +type OSS_MinIO struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // 对端端口 + AccessKey string `protobuf:"bytes,2,opt,name=access_key,json=accessKey,proto3" json:"access_key,omitempty"` // 访问密钥 + SecretKey string `protobuf:"bytes,3,opt,name=secret_key,json=secretKey,proto3" json:"secret_key,omitempty"` // 密钥 + Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` // 令牌 + UseSsl bool `protobuf:"varint,5,opt,name=use_ssl,json=useSsl,proto3" json:"use_ssl,omitempty"` // 使用SSL + UploadHost string `protobuf:"bytes,6,opt,name=upload_host,json=uploadHost,proto3" json:"upload_host,omitempty"` // 上传链接的主机名 + DownloadHost string `protobuf:"bytes,7,opt,name=download_host,json=downloadHost,proto3" json:"download_host,omitempty"` // 下载链接的主机名 +} + +func (x *OSS_MinIO) Reset() { + *x = OSS_MinIO{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_oss_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OSS_MinIO) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OSS_MinIO) ProtoMessage() {} + +func (x *OSS_MinIO) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_oss_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OSS_MinIO.ProtoReflect.Descriptor instead. +func (*OSS_MinIO) Descriptor() ([]byte, []int) { + return file_common_conf_oss_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *OSS_MinIO) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +func (x *OSS_MinIO) GetAccessKey() string { + if x != nil { + return x.AccessKey + } + return "" +} + +func (x *OSS_MinIO) GetSecretKey() string { + if x != nil { + return x.SecretKey + } + return "" +} + +func (x *OSS_MinIO) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +func (x *OSS_MinIO) GetUseSsl() bool { + if x != nil { + return x.UseSsl + } + return false +} + +func (x *OSS_MinIO) GetUploadHost() string { + if x != nil { + return x.UploadHost + } + return "" +} + +func (x *OSS_MinIO) GetDownloadHost() string { + if x != nil { + return x.DownloadHost + } + return "" +} + +var File_common_conf_oss_proto protoreflect.FileDescriptor + +var file_common_conf_oss_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x6f, 0x73, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x63, 0x6f, 0x6e, 0x66, 0x22, 0x8c, 0x02, 0x0a, 0x03, 0x4f, 0x53, 0x53, 0x12, 0x2c, 0x0a, 0x05, + 0x6d, 0x69, 0x6e, 0x69, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4f, 0x53, 0x53, 0x2e, 0x4d, 0x69, + 0x6e, 0x49, 0x4f, 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x69, 0x6f, 0x1a, 0xd6, 0x01, 0x0a, 0x05, 0x4d, + 0x69, 0x6e, 0x49, 0x4f, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x12, + 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x5f, 0x73, 0x73, 0x6c, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x75, 0x73, 0x65, 0x53, 0x73, 0x6c, 0x12, 0x1f, 0x0a, + 0x0b, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x23, + 0x0a, 0x0d, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x48, + 0x6f, 0x73, 0x74, 0x42, 0x31, 0x5a, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, + 0x72, 0x6d, 0x2d, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, + 0x66, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_common_conf_oss_proto_rawDescOnce sync.Once + file_common_conf_oss_proto_rawDescData = file_common_conf_oss_proto_rawDesc +) + +func file_common_conf_oss_proto_rawDescGZIP() []byte { + file_common_conf_oss_proto_rawDescOnce.Do(func() { + file_common_conf_oss_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_conf_oss_proto_rawDescData) + }) + return file_common_conf_oss_proto_rawDescData +} + +var file_common_conf_oss_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_common_conf_oss_proto_goTypes = []interface{}{ + (*OSS)(nil), // 0: common.conf.OSS + (*OSS_MinIO)(nil), // 1: common.conf.OSS.MinIO +} +var file_common_conf_oss_proto_depIdxs = []int32{ + 1, // 0: common.conf.OSS.minio:type_name -> common.conf.OSS.MinIO + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_common_conf_oss_proto_init() } +func file_common_conf_oss_proto_init() { + if File_common_conf_oss_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_common_conf_oss_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OSS); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_oss_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OSS_MinIO); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_conf_oss_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_conf_oss_proto_goTypes, + DependencyIndexes: file_common_conf_oss_proto_depIdxs, + MessageInfos: file_common_conf_oss_proto_msgTypes, + }.Build() + File_common_conf_oss_proto = out.File + file_common_conf_oss_proto_rawDesc = nil + file_common_conf_oss_proto_goTypes = nil + file_common_conf_oss_proto_depIdxs = nil +} diff --git a/orm/gorm/gen/api/go/common/conf/oss.pb.validate.go b/orm/gorm/gen/api/go/common/conf/oss.pb.validate.go new file mode 100644 index 0000000..30a3abc --- /dev/null +++ b/orm/gorm/gen/api/go/common/conf/oss.pb.validate.go @@ -0,0 +1,276 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: common/conf/oss.proto + +package conf + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on OSS with the rules defined in the proto +// definition for this message. If any rules are violated, the first error +// encountered is returned, or nil if there are no violations. +func (m *OSS) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on OSS with the rules defined in the +// proto definition for this message. If any rules are violated, the result is +// a list of violation errors wrapped in OSSMultiError, or nil if none found. +func (m *OSS) ValidateAll() error { + return m.validate(true) +} + +func (m *OSS) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetMinio()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, OSSValidationError{ + field: "Minio", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, OSSValidationError{ + field: "Minio", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMinio()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return OSSValidationError{ + field: "Minio", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return OSSMultiError(errors) + } + + return nil +} + +// OSSMultiError is an error wrapping multiple validation errors returned by +// OSS.ValidateAll() if the designated constraints aren't met. +type OSSMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m OSSMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m OSSMultiError) AllErrors() []error { return m } + +// OSSValidationError is the validation error returned by OSS.Validate if the +// designated constraints aren't met. +type OSSValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e OSSValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e OSSValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e OSSValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e OSSValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e OSSValidationError) ErrorName() string { return "OSSValidationError" } + +// Error satisfies the builtin error interface +func (e OSSValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sOSS.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = OSSValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = OSSValidationError{} + +// Validate checks the field values on OSS_MinIO with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *OSS_MinIO) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on OSS_MinIO with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in OSS_MinIOMultiError, or nil +// if none found. +func (m *OSS_MinIO) ValidateAll() error { + return m.validate(true) +} + +func (m *OSS_MinIO) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Endpoint + + // no validation rules for AccessKey + + // no validation rules for SecretKey + + // no validation rules for Token + + // no validation rules for UseSsl + + // no validation rules for UploadHost + + // no validation rules for DownloadHost + + if len(errors) > 0 { + return OSS_MinIOMultiError(errors) + } + + return nil +} + +// OSS_MinIOMultiError is an error wrapping multiple validation errors returned +// by OSS_MinIO.ValidateAll() if the designated constraints aren't met. +type OSS_MinIOMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m OSS_MinIOMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m OSS_MinIOMultiError) AllErrors() []error { return m } + +// OSS_MinIOValidationError is the validation error returned by +// OSS_MinIO.Validate if the designated constraints aren't met. +type OSS_MinIOValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e OSS_MinIOValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e OSS_MinIOValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e OSS_MinIOValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e OSS_MinIOValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e OSS_MinIOValidationError) ErrorName() string { return "OSS_MinIOValidationError" } + +// Error satisfies the builtin error interface +func (e OSS_MinIOValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sOSS_MinIO.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = OSS_MinIOValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = OSS_MinIOValidationError{} diff --git a/orm/gorm/gen/api/go/common/conf/registry.pb.go b/orm/gorm/gen/api/go/common/conf/registry.pb.go new file mode 100644 index 0000000..ccbbe0d --- /dev/null +++ b/orm/gorm/gen/api/go/common/conf/registry.pb.go @@ -0,0 +1,972 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: common/conf/registry.proto + +package conf + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 注册发现中心 +type Registry struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Consul *Registry_Consul `protobuf:"bytes,2,opt,name=consul,proto3" json:"consul,omitempty"` // Consul + Etcd *Registry_Etcd `protobuf:"bytes,3,opt,name=etcd,proto3" json:"etcd,omitempty"` // Etcd + Zookeeper *Registry_ZooKeeper `protobuf:"bytes,4,opt,name=zookeeper,proto3" json:"zookeeper,omitempty"` // ZooKeeper + Nacos *Registry_Nacos `protobuf:"bytes,5,opt,name=nacos,proto3" json:"nacos,omitempty"` // Nacos + Kubernetes *Registry_Kubernetes `protobuf:"bytes,6,opt,name=kubernetes,proto3" json:"kubernetes,omitempty"` // Kubernetes + Eureka *Registry_Eureka `protobuf:"bytes,7,opt,name=eureka,proto3" json:"eureka,omitempty"` // Eureka + Polaris *Registry_Polaris `protobuf:"bytes,8,opt,name=polaris,proto3" json:"polaris,omitempty"` // Polaris + Servicecomb *Registry_Servicecomb `protobuf:"bytes,9,opt,name=servicecomb,proto3" json:"servicecomb,omitempty"` // Servicecomb +} + +func (x *Registry) Reset() { + *x = Registry{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_registry_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Registry) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Registry) ProtoMessage() {} + +func (x *Registry) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_registry_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Registry.ProtoReflect.Descriptor instead. +func (*Registry) Descriptor() ([]byte, []int) { + return file_common_conf_registry_proto_rawDescGZIP(), []int{0} +} + +func (x *Registry) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Registry) GetConsul() *Registry_Consul { + if x != nil { + return x.Consul + } + return nil +} + +func (x *Registry) GetEtcd() *Registry_Etcd { + if x != nil { + return x.Etcd + } + return nil +} + +func (x *Registry) GetZookeeper() *Registry_ZooKeeper { + if x != nil { + return x.Zookeeper + } + return nil +} + +func (x *Registry) GetNacos() *Registry_Nacos { + if x != nil { + return x.Nacos + } + return nil +} + +func (x *Registry) GetKubernetes() *Registry_Kubernetes { + if x != nil { + return x.Kubernetes + } + return nil +} + +func (x *Registry) GetEureka() *Registry_Eureka { + if x != nil { + return x.Eureka + } + return nil +} + +func (x *Registry) GetPolaris() *Registry_Polaris { + if x != nil { + return x.Polaris + } + return nil +} + +func (x *Registry) GetServicecomb() *Registry_Servicecomb { + if x != nil { + return x.Servicecomb + } + return nil +} + +// Consul +type Registry_Consul struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Scheme string `protobuf:"bytes,1,opt,name=scheme,proto3" json:"scheme,omitempty"` // 网络样式 + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // 服务端地址 + HealthCheck bool `protobuf:"varint,3,opt,name=health_check,json=healthCheck,proto3" json:"health_check,omitempty"` // 健康检查 +} + +func (x *Registry_Consul) Reset() { + *x = Registry_Consul{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_registry_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Registry_Consul) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Registry_Consul) ProtoMessage() {} + +func (x *Registry_Consul) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_registry_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Registry_Consul.ProtoReflect.Descriptor instead. +func (*Registry_Consul) Descriptor() ([]byte, []int) { + return file_common_conf_registry_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *Registry_Consul) GetScheme() string { + if x != nil { + return x.Scheme + } + return "" +} + +func (x *Registry_Consul) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *Registry_Consul) GetHealthCheck() bool { + if x != nil { + return x.HealthCheck + } + return false +} + +// Etcd +type Registry_Etcd struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Endpoints []string `protobuf:"bytes,1,rep,name=endpoints,proto3" json:"endpoints,omitempty"` +} + +func (x *Registry_Etcd) Reset() { + *x = Registry_Etcd{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_registry_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Registry_Etcd) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Registry_Etcd) ProtoMessage() {} + +func (x *Registry_Etcd) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_registry_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Registry_Etcd.ProtoReflect.Descriptor instead. +func (*Registry_Etcd) Descriptor() ([]byte, []int) { + return file_common_conf_registry_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *Registry_Etcd) GetEndpoints() []string { + if x != nil { + return x.Endpoints + } + return nil +} + +// ZooKeeper +type Registry_ZooKeeper struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Endpoints []string `protobuf:"bytes,1,rep,name=endpoints,proto3" json:"endpoints,omitempty"` + Timeout *durationpb.Duration `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout,omitempty"` +} + +func (x *Registry_ZooKeeper) Reset() { + *x = Registry_ZooKeeper{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_registry_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Registry_ZooKeeper) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Registry_ZooKeeper) ProtoMessage() {} + +func (x *Registry_ZooKeeper) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_registry_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Registry_ZooKeeper.ProtoReflect.Descriptor instead. +func (*Registry_ZooKeeper) Descriptor() ([]byte, []int) { + return file_common_conf_registry_proto_rawDescGZIP(), []int{0, 2} +} + +func (x *Registry_ZooKeeper) GetEndpoints() []string { + if x != nil { + return x.Endpoints + } + return nil +} + +func (x *Registry_ZooKeeper) GetTimeout() *durationpb.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +// Nacos +type Registry_Nacos struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // 服务端地址 + Port uint64 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` // 服务端端口 + NamespaceId string `protobuf:"bytes,3,opt,name=namespace_id,json=namespaceId,proto3" json:"namespace_id,omitempty"` // + LogLevel string `protobuf:"bytes,4,opt,name=log_level,json=logLevel,proto3" json:"log_level,omitempty"` // 日志等级 + CacheDir string `protobuf:"bytes,5,opt,name=cache_dir,json=cacheDir,proto3" json:"cache_dir,omitempty"` // 缓存目录 + LogDir string `protobuf:"bytes,6,opt,name=log_dir,json=logDir,proto3" json:"log_dir,omitempty"` // 日志目录 + UpdateThreadNum int32 `protobuf:"varint,7,opt,name=update_thread_num,json=updateThreadNum,proto3" json:"update_thread_num,omitempty"` // 更新服务的线程数 + Timeout *durationpb.Duration `protobuf:"bytes,8,opt,name=timeout,proto3" json:"timeout,omitempty"` // http请求超时时间,单位: 毫秒 + BeatInterval *durationpb.Duration `protobuf:"bytes,9,opt,name=beat_interval,json=beatInterval,proto3" json:"beat_interval,omitempty"` // 心跳间隔时间,单位: 毫秒 + NotLoadCacheAtStart bool `protobuf:"varint,10,opt,name=not_load_cache_at_start,json=notLoadCacheAtStart,proto3" json:"not_load_cache_at_start,omitempty"` // 在启动时不读取本地缓存数据,true: 不读取,false: 读取 + UpdateCacheWhenEmpty bool `protobuf:"varint,11,opt,name=update_cache_when_empty,json=updateCacheWhenEmpty,proto3" json:"update_cache_when_empty,omitempty"` // 当服务列表为空时是否更新本地缓存,true: 更新,false: 不更新 +} + +func (x *Registry_Nacos) Reset() { + *x = Registry_Nacos{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_registry_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Registry_Nacos) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Registry_Nacos) ProtoMessage() {} + +func (x *Registry_Nacos) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_registry_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Registry_Nacos.ProtoReflect.Descriptor instead. +func (*Registry_Nacos) Descriptor() ([]byte, []int) { + return file_common_conf_registry_proto_rawDescGZIP(), []int{0, 3} +} + +func (x *Registry_Nacos) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *Registry_Nacos) GetPort() uint64 { + if x != nil { + return x.Port + } + return 0 +} + +func (x *Registry_Nacos) GetNamespaceId() string { + if x != nil { + return x.NamespaceId + } + return "" +} + +func (x *Registry_Nacos) GetLogLevel() string { + if x != nil { + return x.LogLevel + } + return "" +} + +func (x *Registry_Nacos) GetCacheDir() string { + if x != nil { + return x.CacheDir + } + return "" +} + +func (x *Registry_Nacos) GetLogDir() string { + if x != nil { + return x.LogDir + } + return "" +} + +func (x *Registry_Nacos) GetUpdateThreadNum() int32 { + if x != nil { + return x.UpdateThreadNum + } + return 0 +} + +func (x *Registry_Nacos) GetTimeout() *durationpb.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +func (x *Registry_Nacos) GetBeatInterval() *durationpb.Duration { + if x != nil { + return x.BeatInterval + } + return nil +} + +func (x *Registry_Nacos) GetNotLoadCacheAtStart() bool { + if x != nil { + return x.NotLoadCacheAtStart + } + return false +} + +func (x *Registry_Nacos) GetUpdateCacheWhenEmpty() bool { + if x != nil { + return x.UpdateCacheWhenEmpty + } + return false +} + +// Kubernetes +type Registry_Kubernetes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Registry_Kubernetes) Reset() { + *x = Registry_Kubernetes{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_registry_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Registry_Kubernetes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Registry_Kubernetes) ProtoMessage() {} + +func (x *Registry_Kubernetes) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_registry_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Registry_Kubernetes.ProtoReflect.Descriptor instead. +func (*Registry_Kubernetes) Descriptor() ([]byte, []int) { + return file_common_conf_registry_proto_rawDescGZIP(), []int{0, 4} +} + +// Eureka +type Registry_Eureka struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Endpoints []string `protobuf:"bytes,1,rep,name=endpoints,proto3" json:"endpoints,omitempty"` + HeartbeatInterval *durationpb.Duration `protobuf:"bytes,2,opt,name=heartbeat_interval,json=heartbeatInterval,proto3" json:"heartbeat_interval,omitempty"` + RefreshInterval *durationpb.Duration `protobuf:"bytes,3,opt,name=refresh_interval,json=refreshInterval,proto3" json:"refresh_interval,omitempty"` + Path string `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"` +} + +func (x *Registry_Eureka) Reset() { + *x = Registry_Eureka{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_registry_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Registry_Eureka) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Registry_Eureka) ProtoMessage() {} + +func (x *Registry_Eureka) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_registry_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Registry_Eureka.ProtoReflect.Descriptor instead. +func (*Registry_Eureka) Descriptor() ([]byte, []int) { + return file_common_conf_registry_proto_rawDescGZIP(), []int{0, 5} +} + +func (x *Registry_Eureka) GetEndpoints() []string { + if x != nil { + return x.Endpoints + } + return nil +} + +func (x *Registry_Eureka) GetHeartbeatInterval() *durationpb.Duration { + if x != nil { + return x.HeartbeatInterval + } + return nil +} + +func (x *Registry_Eureka) GetRefreshInterval() *durationpb.Duration { + if x != nil { + return x.RefreshInterval + } + return nil +} + +func (x *Registry_Eureka) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +// Polaris +type Registry_Polaris struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // 服务端地址 + Port int32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` // 服务端端口 + InstanceCount int32 `protobuf:"varint,3,opt,name=instance_count,json=instanceCount,proto3" json:"instance_count,omitempty"` + Namespace string `protobuf:"bytes,4,opt,name=namespace,proto3" json:"namespace,omitempty"` + Service string `protobuf:"bytes,5,opt,name=service,proto3" json:"service,omitempty"` + Token string `protobuf:"bytes,6,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *Registry_Polaris) Reset() { + *x = Registry_Polaris{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_registry_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Registry_Polaris) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Registry_Polaris) ProtoMessage() {} + +func (x *Registry_Polaris) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_registry_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Registry_Polaris.ProtoReflect.Descriptor instead. +func (*Registry_Polaris) Descriptor() ([]byte, []int) { + return file_common_conf_registry_proto_rawDescGZIP(), []int{0, 6} +} + +func (x *Registry_Polaris) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *Registry_Polaris) GetPort() int32 { + if x != nil { + return x.Port + } + return 0 +} + +func (x *Registry_Polaris) GetInstanceCount() int32 { + if x != nil { + return x.InstanceCount + } + return 0 +} + +func (x *Registry_Polaris) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *Registry_Polaris) GetService() string { + if x != nil { + return x.Service + } + return "" +} + +func (x *Registry_Polaris) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +// Servicecomb +type Registry_Servicecomb struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Endpoints []string `protobuf:"bytes,1,rep,name=endpoints,proto3" json:"endpoints,omitempty"` +} + +func (x *Registry_Servicecomb) Reset() { + *x = Registry_Servicecomb{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_registry_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Registry_Servicecomb) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Registry_Servicecomb) ProtoMessage() {} + +func (x *Registry_Servicecomb) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_registry_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Registry_Servicecomb.ProtoReflect.Descriptor instead. +func (*Registry_Servicecomb) Descriptor() ([]byte, []int) { + return file_common_conf_registry_proto_rawDescGZIP(), []int{0, 7} +} + +func (x *Registry_Servicecomb) GetEndpoints() []string { + if x != nil { + return x.Endpoints + } + return nil +} + +var File_common_conf_registry_proto protoreflect.FileDescriptor + +var file_common_conf_registry_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x72, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc4, 0x0c, 0x0a, 0x08, 0x52, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x34, 0x0a, 0x06, 0x63, 0x6f, + 0x6e, 0x73, 0x75, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, + 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, + 0x12, 0x2e, 0x0a, 0x04, 0x65, 0x74, 0x63, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x45, 0x74, 0x63, 0x64, 0x52, 0x04, 0x65, 0x74, 0x63, 0x64, + 0x12, 0x3d, 0x0a, 0x09, 0x7a, 0x6f, 0x6f, 0x6b, 0x65, 0x65, 0x70, 0x65, 0x72, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, + 0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x5a, 0x6f, 0x6f, 0x4b, 0x65, + 0x65, 0x70, 0x65, 0x72, 0x52, 0x09, 0x7a, 0x6f, 0x6f, 0x6b, 0x65, 0x65, 0x70, 0x65, 0x72, 0x12, + 0x31, 0x0a, 0x05, 0x6e, 0x61, 0x63, 0x6f, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x4e, 0x61, 0x63, 0x6f, 0x73, 0x52, 0x05, 0x6e, 0x61, 0x63, + 0x6f, 0x73, 0x12, 0x40, 0x0a, 0x0a, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x4b, 0x75, + 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x52, 0x0a, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, + 0x65, 0x74, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x06, 0x65, 0x75, 0x72, 0x65, 0x6b, 0x61, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, + 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x45, 0x75, 0x72, 0x65, + 0x6b, 0x61, 0x52, 0x06, 0x65, 0x75, 0x72, 0x65, 0x6b, 0x61, 0x12, 0x37, 0x0a, 0x07, 0x70, 0x6f, + 0x6c, 0x61, 0x72, 0x69, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x72, 0x79, 0x2e, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x69, 0x73, 0x52, 0x07, 0x70, 0x6f, 0x6c, 0x61, + 0x72, 0x69, 0x73, 0x12, 0x43, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x63, 0x6f, + 0x6d, 0x62, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x63, 0x6f, 0x6d, 0x62, 0x52, 0x0b, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x63, 0x6f, 0x6d, 0x62, 0x1a, 0x5d, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x73, + 0x75, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x5f, 0x63, + 0x68, 0x65, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x68, 0x65, 0x61, 0x6c, + 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x1a, 0x24, 0x0a, 0x04, 0x45, 0x74, 0x63, 0x64, 0x12, + 0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x09, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x1a, 0x5e, 0x0a, + 0x09, 0x5a, 0x6f, 0x6f, 0x4b, 0x65, 0x65, 0x70, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x6e, + 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x65, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, + 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x1a, 0xb9, 0x03, + 0x0a, 0x05, 0x4e, 0x61, 0x63, 0x6f, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x5f, + 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x67, + 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, 0x64, + 0x69, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x63, 0x68, 0x65, 0x44, + 0x69, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x6c, 0x6f, 0x67, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x6c, 0x6f, 0x67, 0x44, 0x69, 0x72, 0x12, 0x2a, 0x0a, 0x11, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6e, 0x75, 0x6d, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x68, + 0x72, 0x65, 0x61, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, + 0x75, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d, + 0x62, 0x65, 0x61, 0x74, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, + 0x62, 0x65, 0x61, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x34, 0x0a, 0x17, + 0x6e, 0x6f, 0x74, 0x5f, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, 0x61, + 0x74, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x6e, + 0x6f, 0x74, 0x4c, 0x6f, 0x61, 0x64, 0x43, 0x61, 0x63, 0x68, 0x65, 0x41, 0x74, 0x53, 0x74, 0x61, + 0x72, 0x74, 0x12, 0x35, 0x0a, 0x17, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x63, + 0x68, 0x65, 0x5f, 0x77, 0x68, 0x65, 0x6e, 0x5f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x14, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x63, 0x68, 0x65, + 0x57, 0x68, 0x65, 0x6e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x0c, 0x0a, 0x0a, 0x4b, 0x75, 0x62, + 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x1a, 0xca, 0x01, 0x0a, 0x06, 0x45, 0x75, 0x72, 0x65, + 0x6b, 0x61, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, + 0x12, 0x48, 0x0a, 0x12, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x5f, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, + 0x61, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x44, 0x0a, 0x10, 0x72, 0x65, + 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x0f, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, + 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x70, 0x61, 0x74, 0x68, 0x1a, 0xac, 0x01, 0x0a, 0x07, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x69, 0x73, + 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, + 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x25, + 0x0a, 0x0e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x1a, 0x2b, 0x0a, 0x0b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x63, 0x6f, + 0x6d, 0x62, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, + 0x42, 0x31, 0x5a, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x72, 0x6d, 0x2d, + 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x3b, 0x63, + 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_common_conf_registry_proto_rawDescOnce sync.Once + file_common_conf_registry_proto_rawDescData = file_common_conf_registry_proto_rawDesc +) + +func file_common_conf_registry_proto_rawDescGZIP() []byte { + file_common_conf_registry_proto_rawDescOnce.Do(func() { + file_common_conf_registry_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_conf_registry_proto_rawDescData) + }) + return file_common_conf_registry_proto_rawDescData +} + +var file_common_conf_registry_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_common_conf_registry_proto_goTypes = []interface{}{ + (*Registry)(nil), // 0: common.conf.Registry + (*Registry_Consul)(nil), // 1: common.conf.Registry.Consul + (*Registry_Etcd)(nil), // 2: common.conf.Registry.Etcd + (*Registry_ZooKeeper)(nil), // 3: common.conf.Registry.ZooKeeper + (*Registry_Nacos)(nil), // 4: common.conf.Registry.Nacos + (*Registry_Kubernetes)(nil), // 5: common.conf.Registry.Kubernetes + (*Registry_Eureka)(nil), // 6: common.conf.Registry.Eureka + (*Registry_Polaris)(nil), // 7: common.conf.Registry.Polaris + (*Registry_Servicecomb)(nil), // 8: common.conf.Registry.Servicecomb + (*durationpb.Duration)(nil), // 9: google.protobuf.Duration +} +var file_common_conf_registry_proto_depIdxs = []int32{ + 1, // 0: common.conf.Registry.consul:type_name -> common.conf.Registry.Consul + 2, // 1: common.conf.Registry.etcd:type_name -> common.conf.Registry.Etcd + 3, // 2: common.conf.Registry.zookeeper:type_name -> common.conf.Registry.ZooKeeper + 4, // 3: common.conf.Registry.nacos:type_name -> common.conf.Registry.Nacos + 5, // 4: common.conf.Registry.kubernetes:type_name -> common.conf.Registry.Kubernetes + 6, // 5: common.conf.Registry.eureka:type_name -> common.conf.Registry.Eureka + 7, // 6: common.conf.Registry.polaris:type_name -> common.conf.Registry.Polaris + 8, // 7: common.conf.Registry.servicecomb:type_name -> common.conf.Registry.Servicecomb + 9, // 8: common.conf.Registry.ZooKeeper.timeout:type_name -> google.protobuf.Duration + 9, // 9: common.conf.Registry.Nacos.timeout:type_name -> google.protobuf.Duration + 9, // 10: common.conf.Registry.Nacos.beat_interval:type_name -> google.protobuf.Duration + 9, // 11: common.conf.Registry.Eureka.heartbeat_interval:type_name -> google.protobuf.Duration + 9, // 12: common.conf.Registry.Eureka.refresh_interval:type_name -> google.protobuf.Duration + 13, // [13:13] is the sub-list for method output_type + 13, // [13:13] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name +} + +func init() { file_common_conf_registry_proto_init() } +func file_common_conf_registry_proto_init() { + if File_common_conf_registry_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_common_conf_registry_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Registry); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_registry_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Registry_Consul); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_registry_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Registry_Etcd); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_registry_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Registry_ZooKeeper); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_registry_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Registry_Nacos); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_registry_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Registry_Kubernetes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_registry_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Registry_Eureka); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_registry_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Registry_Polaris); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_registry_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Registry_Servicecomb); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_conf_registry_proto_rawDesc, + NumEnums: 0, + NumMessages: 9, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_conf_registry_proto_goTypes, + DependencyIndexes: file_common_conf_registry_proto_depIdxs, + MessageInfos: file_common_conf_registry_proto_msgTypes, + }.Build() + File_common_conf_registry_proto = out.File + file_common_conf_registry_proto_rawDesc = nil + file_common_conf_registry_proto_goTypes = nil + file_common_conf_registry_proto_depIdxs = nil +} diff --git a/orm/gorm/gen/api/go/common/conf/registry.pb.validate.go b/orm/gorm/gen/api/go/common/conf/registry.pb.validate.go new file mode 100644 index 0000000..896b055 --- /dev/null +++ b/orm/gorm/gen/api/go/common/conf/registry.pb.validate.go @@ -0,0 +1,1358 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: common/conf/registry.proto + +package conf + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on Registry with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Registry) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Registry with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in RegistryMultiError, or nil +// if none found. +func (m *Registry) ValidateAll() error { + return m.validate(true) +} + +func (m *Registry) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Type + + if all { + switch v := interface{}(m.GetConsul()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Consul", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Consul", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetConsul()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RegistryValidationError{ + field: "Consul", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetEtcd()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Etcd", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Etcd", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetEtcd()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RegistryValidationError{ + field: "Etcd", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetZookeeper()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Zookeeper", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Zookeeper", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetZookeeper()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RegistryValidationError{ + field: "Zookeeper", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetNacos()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Nacos", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Nacos", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetNacos()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RegistryValidationError{ + field: "Nacos", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetKubernetes()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Kubernetes", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Kubernetes", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetKubernetes()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RegistryValidationError{ + field: "Kubernetes", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetEureka()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Eureka", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Eureka", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetEureka()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RegistryValidationError{ + field: "Eureka", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetPolaris()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Polaris", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Polaris", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetPolaris()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RegistryValidationError{ + field: "Polaris", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetServicecomb()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Servicecomb", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RegistryValidationError{ + field: "Servicecomb", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetServicecomb()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RegistryValidationError{ + field: "Servicecomb", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return RegistryMultiError(errors) + } + + return nil +} + +// RegistryMultiError is an error wrapping multiple validation errors returned +// by Registry.ValidateAll() if the designated constraints aren't met. +type RegistryMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m RegistryMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m RegistryMultiError) AllErrors() []error { return m } + +// RegistryValidationError is the validation error returned by +// Registry.Validate if the designated constraints aren't met. +type RegistryValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RegistryValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RegistryValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RegistryValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RegistryValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RegistryValidationError) ErrorName() string { return "RegistryValidationError" } + +// Error satisfies the builtin error interface +func (e RegistryValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRegistry.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RegistryValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RegistryValidationError{} + +// Validate checks the field values on Registry_Consul with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *Registry_Consul) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Registry_Consul with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// Registry_ConsulMultiError, or nil if none found. +func (m *Registry_Consul) ValidateAll() error { + return m.validate(true) +} + +func (m *Registry_Consul) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Scheme + + // no validation rules for Address + + // no validation rules for HealthCheck + + if len(errors) > 0 { + return Registry_ConsulMultiError(errors) + } + + return nil +} + +// Registry_ConsulMultiError is an error wrapping multiple validation errors +// returned by Registry_Consul.ValidateAll() if the designated constraints +// aren't met. +type Registry_ConsulMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Registry_ConsulMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Registry_ConsulMultiError) AllErrors() []error { return m } + +// Registry_ConsulValidationError is the validation error returned by +// Registry_Consul.Validate if the designated constraints aren't met. +type Registry_ConsulValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Registry_ConsulValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Registry_ConsulValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Registry_ConsulValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Registry_ConsulValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Registry_ConsulValidationError) ErrorName() string { return "Registry_ConsulValidationError" } + +// Error satisfies the builtin error interface +func (e Registry_ConsulValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRegistry_Consul.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Registry_ConsulValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Registry_ConsulValidationError{} + +// Validate checks the field values on Registry_Etcd with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Registry_Etcd) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Registry_Etcd with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Registry_EtcdMultiError, or +// nil if none found. +func (m *Registry_Etcd) ValidateAll() error { + return m.validate(true) +} + +func (m *Registry_Etcd) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return Registry_EtcdMultiError(errors) + } + + return nil +} + +// Registry_EtcdMultiError is an error wrapping multiple validation errors +// returned by Registry_Etcd.ValidateAll() if the designated constraints +// aren't met. +type Registry_EtcdMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Registry_EtcdMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Registry_EtcdMultiError) AllErrors() []error { return m } + +// Registry_EtcdValidationError is the validation error returned by +// Registry_Etcd.Validate if the designated constraints aren't met. +type Registry_EtcdValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Registry_EtcdValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Registry_EtcdValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Registry_EtcdValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Registry_EtcdValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Registry_EtcdValidationError) ErrorName() string { return "Registry_EtcdValidationError" } + +// Error satisfies the builtin error interface +func (e Registry_EtcdValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRegistry_Etcd.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Registry_EtcdValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Registry_EtcdValidationError{} + +// Validate checks the field values on Registry_ZooKeeper with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *Registry_ZooKeeper) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Registry_ZooKeeper with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// Registry_ZooKeeperMultiError, or nil if none found. +func (m *Registry_ZooKeeper) ValidateAll() error { + return m.validate(true) +} + +func (m *Registry_ZooKeeper) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetTimeout()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Registry_ZooKeeperValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Registry_ZooKeeperValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Registry_ZooKeeperValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return Registry_ZooKeeperMultiError(errors) + } + + return nil +} + +// Registry_ZooKeeperMultiError is an error wrapping multiple validation errors +// returned by Registry_ZooKeeper.ValidateAll() if the designated constraints +// aren't met. +type Registry_ZooKeeperMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Registry_ZooKeeperMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Registry_ZooKeeperMultiError) AllErrors() []error { return m } + +// Registry_ZooKeeperValidationError is the validation error returned by +// Registry_ZooKeeper.Validate if the designated constraints aren't met. +type Registry_ZooKeeperValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Registry_ZooKeeperValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Registry_ZooKeeperValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Registry_ZooKeeperValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Registry_ZooKeeperValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Registry_ZooKeeperValidationError) ErrorName() string { + return "Registry_ZooKeeperValidationError" +} + +// Error satisfies the builtin error interface +func (e Registry_ZooKeeperValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRegistry_ZooKeeper.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Registry_ZooKeeperValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Registry_ZooKeeperValidationError{} + +// Validate checks the field values on Registry_Nacos with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Registry_Nacos) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Registry_Nacos with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Registry_NacosMultiError, +// or nil if none found. +func (m *Registry_Nacos) ValidateAll() error { + return m.validate(true) +} + +func (m *Registry_Nacos) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Address + + // no validation rules for Port + + // no validation rules for NamespaceId + + // no validation rules for LogLevel + + // no validation rules for CacheDir + + // no validation rules for LogDir + + // no validation rules for UpdateThreadNum + + if all { + switch v := interface{}(m.GetTimeout()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Registry_NacosValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Registry_NacosValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Registry_NacosValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetBeatInterval()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Registry_NacosValidationError{ + field: "BeatInterval", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Registry_NacosValidationError{ + field: "BeatInterval", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetBeatInterval()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Registry_NacosValidationError{ + field: "BeatInterval", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for NotLoadCacheAtStart + + // no validation rules for UpdateCacheWhenEmpty + + if len(errors) > 0 { + return Registry_NacosMultiError(errors) + } + + return nil +} + +// Registry_NacosMultiError is an error wrapping multiple validation errors +// returned by Registry_Nacos.ValidateAll() if the designated constraints +// aren't met. +type Registry_NacosMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Registry_NacosMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Registry_NacosMultiError) AllErrors() []error { return m } + +// Registry_NacosValidationError is the validation error returned by +// Registry_Nacos.Validate if the designated constraints aren't met. +type Registry_NacosValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Registry_NacosValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Registry_NacosValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Registry_NacosValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Registry_NacosValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Registry_NacosValidationError) ErrorName() string { return "Registry_NacosValidationError" } + +// Error satisfies the builtin error interface +func (e Registry_NacosValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRegistry_Nacos.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Registry_NacosValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Registry_NacosValidationError{} + +// Validate checks the field values on Registry_Kubernetes with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *Registry_Kubernetes) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Registry_Kubernetes with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// Registry_KubernetesMultiError, or nil if none found. +func (m *Registry_Kubernetes) ValidateAll() error { + return m.validate(true) +} + +func (m *Registry_Kubernetes) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return Registry_KubernetesMultiError(errors) + } + + return nil +} + +// Registry_KubernetesMultiError is an error wrapping multiple validation +// errors returned by Registry_Kubernetes.ValidateAll() if the designated +// constraints aren't met. +type Registry_KubernetesMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Registry_KubernetesMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Registry_KubernetesMultiError) AllErrors() []error { return m } + +// Registry_KubernetesValidationError is the validation error returned by +// Registry_Kubernetes.Validate if the designated constraints aren't met. +type Registry_KubernetesValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Registry_KubernetesValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Registry_KubernetesValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Registry_KubernetesValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Registry_KubernetesValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Registry_KubernetesValidationError) ErrorName() string { + return "Registry_KubernetesValidationError" +} + +// Error satisfies the builtin error interface +func (e Registry_KubernetesValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRegistry_Kubernetes.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Registry_KubernetesValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Registry_KubernetesValidationError{} + +// Validate checks the field values on Registry_Eureka with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *Registry_Eureka) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Registry_Eureka with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// Registry_EurekaMultiError, or nil if none found. +func (m *Registry_Eureka) ValidateAll() error { + return m.validate(true) +} + +func (m *Registry_Eureka) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetHeartbeatInterval()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Registry_EurekaValidationError{ + field: "HeartbeatInterval", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Registry_EurekaValidationError{ + field: "HeartbeatInterval", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetHeartbeatInterval()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Registry_EurekaValidationError{ + field: "HeartbeatInterval", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetRefreshInterval()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Registry_EurekaValidationError{ + field: "RefreshInterval", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Registry_EurekaValidationError{ + field: "RefreshInterval", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRefreshInterval()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Registry_EurekaValidationError{ + field: "RefreshInterval", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for Path + + if len(errors) > 0 { + return Registry_EurekaMultiError(errors) + } + + return nil +} + +// Registry_EurekaMultiError is an error wrapping multiple validation errors +// returned by Registry_Eureka.ValidateAll() if the designated constraints +// aren't met. +type Registry_EurekaMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Registry_EurekaMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Registry_EurekaMultiError) AllErrors() []error { return m } + +// Registry_EurekaValidationError is the validation error returned by +// Registry_Eureka.Validate if the designated constraints aren't met. +type Registry_EurekaValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Registry_EurekaValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Registry_EurekaValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Registry_EurekaValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Registry_EurekaValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Registry_EurekaValidationError) ErrorName() string { return "Registry_EurekaValidationError" } + +// Error satisfies the builtin error interface +func (e Registry_EurekaValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRegistry_Eureka.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Registry_EurekaValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Registry_EurekaValidationError{} + +// Validate checks the field values on Registry_Polaris with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *Registry_Polaris) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Registry_Polaris with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// Registry_PolarisMultiError, or nil if none found. +func (m *Registry_Polaris) ValidateAll() error { + return m.validate(true) +} + +func (m *Registry_Polaris) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Address + + // no validation rules for Port + + // no validation rules for InstanceCount + + // no validation rules for Namespace + + // no validation rules for Service + + // no validation rules for Token + + if len(errors) > 0 { + return Registry_PolarisMultiError(errors) + } + + return nil +} + +// Registry_PolarisMultiError is an error wrapping multiple validation errors +// returned by Registry_Polaris.ValidateAll() if the designated constraints +// aren't met. +type Registry_PolarisMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Registry_PolarisMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Registry_PolarisMultiError) AllErrors() []error { return m } + +// Registry_PolarisValidationError is the validation error returned by +// Registry_Polaris.Validate if the designated constraints aren't met. +type Registry_PolarisValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Registry_PolarisValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Registry_PolarisValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Registry_PolarisValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Registry_PolarisValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Registry_PolarisValidationError) ErrorName() string { return "Registry_PolarisValidationError" } + +// Error satisfies the builtin error interface +func (e Registry_PolarisValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRegistry_Polaris.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Registry_PolarisValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Registry_PolarisValidationError{} + +// Validate checks the field values on Registry_Servicecomb with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *Registry_Servicecomb) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Registry_Servicecomb with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// Registry_ServicecombMultiError, or nil if none found. +func (m *Registry_Servicecomb) ValidateAll() error { + return m.validate(true) +} + +func (m *Registry_Servicecomb) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return Registry_ServicecombMultiError(errors) + } + + return nil +} + +// Registry_ServicecombMultiError is an error wrapping multiple validation +// errors returned by Registry_Servicecomb.ValidateAll() if the designated +// constraints aren't met. +type Registry_ServicecombMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Registry_ServicecombMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Registry_ServicecombMultiError) AllErrors() []error { return m } + +// Registry_ServicecombValidationError is the validation error returned by +// Registry_Servicecomb.Validate if the designated constraints aren't met. +type Registry_ServicecombValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Registry_ServicecombValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Registry_ServicecombValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Registry_ServicecombValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Registry_ServicecombValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Registry_ServicecombValidationError) ErrorName() string { + return "Registry_ServicecombValidationError" +} + +// Error satisfies the builtin error interface +func (e Registry_ServicecombValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRegistry_Servicecomb.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Registry_ServicecombValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Registry_ServicecombValidationError{} diff --git a/orm/gorm/gen/api/go/common/conf/server.pb.go b/orm/gorm/gen/api/go/common/conf/server.pb.go new file mode 100644 index 0000000..fbdb93d --- /dev/null +++ b/orm/gorm/gen/api/go/common/conf/server.pb.go @@ -0,0 +1,913 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: common/conf/server.proto + +package conf + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 服务器 +type Server struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Rest *Server_REST `protobuf:"bytes,1,opt,name=rest,proto3" json:"rest,omitempty"` // REST服务 + Grpc *Server_GRPC `protobuf:"bytes,2,opt,name=grpc,proto3" json:"grpc,omitempty"` // gRPC服务 + Websocket *Server_Websocket `protobuf:"bytes,3,opt,name=websocket,proto3" json:"websocket,omitempty"` // Websocket服务 + Mqtt *Server_Mqtt `protobuf:"bytes,4,opt,name=mqtt,proto3" json:"mqtt,omitempty"` // MQTT服务 + Kafka *Server_Kafka `protobuf:"bytes,5,opt,name=kafka,proto3" json:"kafka,omitempty"` // Kafka服务 + Rabbitmq *Server_RabbitMQ `protobuf:"bytes,6,opt,name=rabbitmq,proto3" json:"rabbitmq,omitempty"` // RabbitMQ服务 + Sse *Server_SSE `protobuf:"bytes,7,opt,name=sse,proto3" json:"sse,omitempty"` // SSE服务 +} + +func (x *Server) Reset() { + *x = Server{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_server_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Server) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Server) ProtoMessage() {} + +func (x *Server) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_server_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Server.ProtoReflect.Descriptor instead. +func (*Server) Descriptor() ([]byte, []int) { + return file_common_conf_server_proto_rawDescGZIP(), []int{0} +} + +func (x *Server) GetRest() *Server_REST { + if x != nil { + return x.Rest + } + return nil +} + +func (x *Server) GetGrpc() *Server_GRPC { + if x != nil { + return x.Grpc + } + return nil +} + +func (x *Server) GetWebsocket() *Server_Websocket { + if x != nil { + return x.Websocket + } + return nil +} + +func (x *Server) GetMqtt() *Server_Mqtt { + if x != nil { + return x.Mqtt + } + return nil +} + +func (x *Server) GetKafka() *Server_Kafka { + if x != nil { + return x.Kafka + } + return nil +} + +func (x *Server) GetRabbitmq() *Server_RabbitMQ { + if x != nil { + return x.Rabbitmq + } + return nil +} + +func (x *Server) GetSse() *Server_SSE { + if x != nil { + return x.Sse + } + return nil +} + +// REST +type Server_REST struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` // 网络 + Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` // 服务监听地址 + Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` // 超时时间 + Cors *Server_REST_CORS `protobuf:"bytes,4,opt,name=cors,proto3" json:"cors,omitempty"` // 服务监听地址 + Middleware *Middleware `protobuf:"bytes,5,opt,name=middleware,proto3" json:"middleware,omitempty"` // 中间件 +} + +func (x *Server_REST) Reset() { + *x = Server_REST{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_server_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Server_REST) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Server_REST) ProtoMessage() {} + +func (x *Server_REST) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_server_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Server_REST.ProtoReflect.Descriptor instead. +func (*Server_REST) Descriptor() ([]byte, []int) { + return file_common_conf_server_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *Server_REST) GetNetwork() string { + if x != nil { + return x.Network + } + return "" +} + +func (x *Server_REST) GetAddr() string { + if x != nil { + return x.Addr + } + return "" +} + +func (x *Server_REST) GetTimeout() *durationpb.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +func (x *Server_REST) GetCors() *Server_REST_CORS { + if x != nil { + return x.Cors + } + return nil +} + +func (x *Server_REST) GetMiddleware() *Middleware { + if x != nil { + return x.Middleware + } + return nil +} + +// gPRC +type Server_GRPC struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` // 网络 + Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` // 服务监听地址 + Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` // 超时时间 + Middleware *Middleware `protobuf:"bytes,4,opt,name=middleware,proto3" json:"middleware,omitempty"` +} + +func (x *Server_GRPC) Reset() { + *x = Server_GRPC{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_server_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Server_GRPC) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Server_GRPC) ProtoMessage() {} + +func (x *Server_GRPC) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_server_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Server_GRPC.ProtoReflect.Descriptor instead. +func (*Server_GRPC) Descriptor() ([]byte, []int) { + return file_common_conf_server_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *Server_GRPC) GetNetwork() string { + if x != nil { + return x.Network + } + return "" +} + +func (x *Server_GRPC) GetAddr() string { + if x != nil { + return x.Addr + } + return "" +} + +func (x *Server_GRPC) GetTimeout() *durationpb.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +func (x *Server_GRPC) GetMiddleware() *Middleware { + if x != nil { + return x.Middleware + } + return nil +} + +// Websocket +type Server_Websocket struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` // 网络样式:http、https + Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` // 服务监听地址 + Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` // 路径 + Codec string `protobuf:"bytes,4,opt,name=codec,proto3" json:"codec,omitempty"` // 编解码器 + Timeout *durationpb.Duration `protobuf:"bytes,5,opt,name=timeout,proto3" json:"timeout,omitempty"` // 超时时间 +} + +func (x *Server_Websocket) Reset() { + *x = Server_Websocket{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_server_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Server_Websocket) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Server_Websocket) ProtoMessage() {} + +func (x *Server_Websocket) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_server_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Server_Websocket.ProtoReflect.Descriptor instead. +func (*Server_Websocket) Descriptor() ([]byte, []int) { + return file_common_conf_server_proto_rawDescGZIP(), []int{0, 2} +} + +func (x *Server_Websocket) GetNetwork() string { + if x != nil { + return x.Network + } + return "" +} + +func (x *Server_Websocket) GetAddr() string { + if x != nil { + return x.Addr + } + return "" +} + +func (x *Server_Websocket) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *Server_Websocket) GetCodec() string { + if x != nil { + return x.Codec + } + return "" +} + +func (x *Server_Websocket) GetTimeout() *durationpb.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +// MQTT +type Server_Mqtt struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"` // 对端网络地址 +} + +func (x *Server_Mqtt) Reset() { + *x = Server_Mqtt{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_server_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Server_Mqtt) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Server_Mqtt) ProtoMessage() {} + +func (x *Server_Mqtt) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_server_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Server_Mqtt.ProtoReflect.Descriptor instead. +func (*Server_Mqtt) Descriptor() ([]byte, []int) { + return file_common_conf_server_proto_rawDescGZIP(), []int{0, 3} +} + +func (x *Server_Mqtt) GetAddr() string { + if x != nil { + return x.Addr + } + return "" +} + +// Kafka +type Server_Kafka struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Addrs []string `protobuf:"bytes,1,rep,name=addrs,proto3" json:"addrs,omitempty"` // 对端网络地址 +} + +func (x *Server_Kafka) Reset() { + *x = Server_Kafka{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_server_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Server_Kafka) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Server_Kafka) ProtoMessage() {} + +func (x *Server_Kafka) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_server_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Server_Kafka.ProtoReflect.Descriptor instead. +func (*Server_Kafka) Descriptor() ([]byte, []int) { + return file_common_conf_server_proto_rawDescGZIP(), []int{0, 4} +} + +func (x *Server_Kafka) GetAddrs() []string { + if x != nil { + return x.Addrs + } + return nil +} + +// RabbitMQ +type Server_RabbitMQ struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Addrs []string `protobuf:"bytes,1,rep,name=addrs,proto3" json:"addrs,omitempty"` // 对端网络地址 +} + +func (x *Server_RabbitMQ) Reset() { + *x = Server_RabbitMQ{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_server_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Server_RabbitMQ) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Server_RabbitMQ) ProtoMessage() {} + +func (x *Server_RabbitMQ) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_server_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Server_RabbitMQ.ProtoReflect.Descriptor instead. +func (*Server_RabbitMQ) Descriptor() ([]byte, []int) { + return file_common_conf_server_proto_rawDescGZIP(), []int{0, 5} +} + +func (x *Server_RabbitMQ) GetAddrs() []string { + if x != nil { + return x.Addrs + } + return nil +} + +// SSE +type Server_SSE struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` // 网络 + Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` // 服务监听地址 + Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` // 超时时间 + Path string `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"` // 路径 + Codec string `protobuf:"bytes,5,opt,name=codec,proto3" json:"codec,omitempty"` // 编解码器 +} + +func (x *Server_SSE) Reset() { + *x = Server_SSE{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_server_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Server_SSE) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Server_SSE) ProtoMessage() {} + +func (x *Server_SSE) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_server_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Server_SSE.ProtoReflect.Descriptor instead. +func (*Server_SSE) Descriptor() ([]byte, []int) { + return file_common_conf_server_proto_rawDescGZIP(), []int{0, 6} +} + +func (x *Server_SSE) GetNetwork() string { + if x != nil { + return x.Network + } + return "" +} + +func (x *Server_SSE) GetAddr() string { + if x != nil { + return x.Addr + } + return "" +} + +func (x *Server_SSE) GetTimeout() *durationpb.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +func (x *Server_SSE) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *Server_SSE) GetCodec() string { + if x != nil { + return x.Codec + } + return "" +} + +type Server_REST_CORS struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Headers []string `protobuf:"bytes,1,rep,name=headers,proto3" json:"headers,omitempty"` // + Methods []string `protobuf:"bytes,2,rep,name=methods,proto3" json:"methods,omitempty"` // + Origins []string `protobuf:"bytes,3,rep,name=origins,proto3" json:"origins,omitempty"` // +} + +func (x *Server_REST_CORS) Reset() { + *x = Server_REST_CORS{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_server_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Server_REST_CORS) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Server_REST_CORS) ProtoMessage() {} + +func (x *Server_REST_CORS) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_server_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Server_REST_CORS.ProtoReflect.Descriptor instead. +func (*Server_REST_CORS) Descriptor() ([]byte, []int) { + return file_common_conf_server_proto_rawDescGZIP(), []int{0, 0, 0} +} + +func (x *Server_REST_CORS) GetHeaders() []string { + if x != nil { + return x.Headers + } + return nil +} + +func (x *Server_REST_CORS) GetMethods() []string { + if x != nil { + return x.Methods + } + return nil +} + +func (x *Server_REST_CORS) GetOrigins() []string { + if x != nil { + return x.Origins + } + return nil +} + +var File_common_conf_server_proto protoreflect.FileDescriptor + +var file_common_conf_server_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, + 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc5, 0x09, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x12, 0x2c, 0x0a, 0x04, 0x72, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x2e, 0x52, 0x45, 0x53, 0x54, 0x52, 0x04, 0x72, 0x65, 0x73, 0x74, 0x12, 0x2c, + 0x0a, 0x04, 0x67, 0x72, 0x70, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x2e, 0x47, 0x52, 0x50, 0x43, 0x52, 0x04, 0x67, 0x72, 0x70, 0x63, 0x12, 0x3b, 0x0a, 0x09, + 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x2e, 0x57, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x09, + 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x2c, 0x0a, 0x04, 0x6d, 0x71, 0x74, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x4d, 0x71, 0x74, + 0x74, 0x52, 0x04, 0x6d, 0x71, 0x74, 0x74, 0x12, 0x2f, 0x0a, 0x05, 0x6b, 0x61, 0x66, 0x6b, 0x61, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x4b, 0x61, 0x66, 0x6b, + 0x61, 0x52, 0x05, 0x6b, 0x61, 0x66, 0x6b, 0x61, 0x12, 0x38, 0x0a, 0x08, 0x72, 0x61, 0x62, 0x62, + 0x69, 0x74, 0x6d, 0x71, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, + 0x52, 0x61, 0x62, 0x62, 0x69, 0x74, 0x4d, 0x51, 0x52, 0x08, 0x72, 0x61, 0x62, 0x62, 0x69, 0x74, + 0x6d, 0x71, 0x12, 0x29, 0x0a, 0x03, 0x73, 0x73, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x53, 0x45, 0x52, 0x03, 0x73, 0x73, 0x65, 0x1a, 0xab, 0x02, + 0x0a, 0x04, 0x52, 0x45, 0x53, 0x54, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x61, 0x64, 0x64, 0x72, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x31, 0x0a, 0x04, 0x63, 0x6f, 0x72, + 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x52, 0x45, 0x53, + 0x54, 0x2e, 0x43, 0x4f, 0x52, 0x53, 0x52, 0x04, 0x63, 0x6f, 0x72, 0x73, 0x12, 0x37, 0x0a, 0x0a, + 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4d, + 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x52, 0x0a, 0x6d, 0x69, 0x64, 0x64, 0x6c, + 0x65, 0x77, 0x61, 0x72, 0x65, 0x1a, 0x54, 0x0a, 0x04, 0x43, 0x4f, 0x52, 0x53, 0x12, 0x18, 0x0a, + 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, + 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, + 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x73, 0x1a, 0xa2, 0x01, 0x0a, 0x04, + 0x47, 0x52, 0x50, 0x43, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, + 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, + 0x64, 0x72, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, + 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x37, 0x0a, 0x0a, 0x6d, 0x69, 0x64, 0x64, 0x6c, + 0x65, 0x77, 0x61, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, + 0x77, 0x61, 0x72, 0x65, 0x52, 0x0a, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, + 0x1a, 0x98, 0x01, 0x0a, 0x09, 0x57, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x18, + 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x12, 0x0a, 0x04, + 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, + 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, + 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x1a, 0x1a, 0x0a, 0x04, 0x4d, + 0x71, 0x74, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x1a, 0x1d, 0x0a, 0x05, 0x4b, 0x61, 0x66, 0x6b, 0x61, + 0x12, 0x14, 0x0a, 0x05, 0x61, 0x64, 0x64, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x05, 0x61, 0x64, 0x64, 0x72, 0x73, 0x1a, 0x20, 0x0a, 0x08, 0x52, 0x61, 0x62, 0x62, 0x69, 0x74, + 0x4d, 0x51, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x64, 0x64, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x05, 0x61, 0x64, 0x64, 0x72, 0x73, 0x1a, 0x92, 0x01, 0x0a, 0x03, 0x53, 0x53, 0x45, + 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, + 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x33, + 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, + 0x6f, 0x75, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x42, 0x31, 0x5a, + 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x72, 0x6d, 0x2d, 0x65, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x3b, 0x63, 0x6f, 0x6e, 0x66, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_common_conf_server_proto_rawDescOnce sync.Once + file_common_conf_server_proto_rawDescData = file_common_conf_server_proto_rawDesc +) + +func file_common_conf_server_proto_rawDescGZIP() []byte { + file_common_conf_server_proto_rawDescOnce.Do(func() { + file_common_conf_server_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_conf_server_proto_rawDescData) + }) + return file_common_conf_server_proto_rawDescData +} + +var file_common_conf_server_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_common_conf_server_proto_goTypes = []interface{}{ + (*Server)(nil), // 0: common.conf.Server + (*Server_REST)(nil), // 1: common.conf.Server.REST + (*Server_GRPC)(nil), // 2: common.conf.Server.GRPC + (*Server_Websocket)(nil), // 3: common.conf.Server.Websocket + (*Server_Mqtt)(nil), // 4: common.conf.Server.Mqtt + (*Server_Kafka)(nil), // 5: common.conf.Server.Kafka + (*Server_RabbitMQ)(nil), // 6: common.conf.Server.RabbitMQ + (*Server_SSE)(nil), // 7: common.conf.Server.SSE + (*Server_REST_CORS)(nil), // 8: common.conf.Server.REST.CORS + (*durationpb.Duration)(nil), // 9: google.protobuf.Duration + (*Middleware)(nil), // 10: common.conf.Middleware +} +var file_common_conf_server_proto_depIdxs = []int32{ + 1, // 0: common.conf.Server.rest:type_name -> common.conf.Server.REST + 2, // 1: common.conf.Server.grpc:type_name -> common.conf.Server.GRPC + 3, // 2: common.conf.Server.websocket:type_name -> common.conf.Server.Websocket + 4, // 3: common.conf.Server.mqtt:type_name -> common.conf.Server.Mqtt + 5, // 4: common.conf.Server.kafka:type_name -> common.conf.Server.Kafka + 6, // 5: common.conf.Server.rabbitmq:type_name -> common.conf.Server.RabbitMQ + 7, // 6: common.conf.Server.sse:type_name -> common.conf.Server.SSE + 9, // 7: common.conf.Server.REST.timeout:type_name -> google.protobuf.Duration + 8, // 8: common.conf.Server.REST.cors:type_name -> common.conf.Server.REST.CORS + 10, // 9: common.conf.Server.REST.middleware:type_name -> common.conf.Middleware + 9, // 10: common.conf.Server.GRPC.timeout:type_name -> google.protobuf.Duration + 10, // 11: common.conf.Server.GRPC.middleware:type_name -> common.conf.Middleware + 9, // 12: common.conf.Server.Websocket.timeout:type_name -> google.protobuf.Duration + 9, // 13: common.conf.Server.SSE.timeout:type_name -> google.protobuf.Duration + 14, // [14:14] is the sub-list for method output_type + 14, // [14:14] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name +} + +func init() { file_common_conf_server_proto_init() } +func file_common_conf_server_proto_init() { + if File_common_conf_server_proto != nil { + return + } + file_common_conf_middleware_proto_init() + if !protoimpl.UnsafeEnabled { + file_common_conf_server_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Server); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_server_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Server_REST); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_server_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Server_GRPC); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_server_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Server_Websocket); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_server_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Server_Mqtt); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_server_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Server_Kafka); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_server_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Server_RabbitMQ); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_server_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Server_SSE); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_conf_server_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Server_REST_CORS); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_conf_server_proto_rawDesc, + NumEnums: 0, + NumMessages: 9, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_conf_server_proto_goTypes, + DependencyIndexes: file_common_conf_server_proto_depIdxs, + MessageInfos: file_common_conf_server_proto_msgTypes, + }.Build() + File_common_conf_server_proto = out.File + file_common_conf_server_proto_rawDesc = nil + file_common_conf_server_proto_goTypes = nil + file_common_conf_server_proto_depIdxs = nil +} diff --git a/orm/gorm/gen/api/go/common/conf/server.pb.validate.go b/orm/gorm/gen/api/go/common/conf/server.pb.validate.go new file mode 100644 index 0000000..5f9e65d --- /dev/null +++ b/orm/gorm/gen/api/go/common/conf/server.pb.validate.go @@ -0,0 +1,1361 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: common/conf/server.proto + +package conf + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on Server with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Server) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Server with the rules defined in the +// proto definition for this message. If any rules are violated, the result is +// a list of violation errors wrapped in ServerMultiError, or nil if none found. +func (m *Server) ValidateAll() error { + return m.validate(true) +} + +func (m *Server) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetRest()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ServerValidationError{ + field: "Rest", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ServerValidationError{ + field: "Rest", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRest()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ServerValidationError{ + field: "Rest", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetGrpc()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ServerValidationError{ + field: "Grpc", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ServerValidationError{ + field: "Grpc", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetGrpc()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ServerValidationError{ + field: "Grpc", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetWebsocket()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ServerValidationError{ + field: "Websocket", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ServerValidationError{ + field: "Websocket", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetWebsocket()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ServerValidationError{ + field: "Websocket", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetMqtt()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ServerValidationError{ + field: "Mqtt", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ServerValidationError{ + field: "Mqtt", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMqtt()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ServerValidationError{ + field: "Mqtt", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetKafka()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ServerValidationError{ + field: "Kafka", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ServerValidationError{ + field: "Kafka", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetKafka()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ServerValidationError{ + field: "Kafka", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetRabbitmq()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ServerValidationError{ + field: "Rabbitmq", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ServerValidationError{ + field: "Rabbitmq", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRabbitmq()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ServerValidationError{ + field: "Rabbitmq", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetSse()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ServerValidationError{ + field: "Sse", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ServerValidationError{ + field: "Sse", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetSse()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ServerValidationError{ + field: "Sse", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return ServerMultiError(errors) + } + + return nil +} + +// ServerMultiError is an error wrapping multiple validation errors returned by +// Server.ValidateAll() if the designated constraints aren't met. +type ServerMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ServerMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ServerMultiError) AllErrors() []error { return m } + +// ServerValidationError is the validation error returned by Server.Validate if +// the designated constraints aren't met. +type ServerValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ServerValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ServerValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ServerValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ServerValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ServerValidationError) ErrorName() string { return "ServerValidationError" } + +// Error satisfies the builtin error interface +func (e ServerValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sServer.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ServerValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ServerValidationError{} + +// Validate checks the field values on Server_REST with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Server_REST) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Server_REST with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Server_RESTMultiError, or +// nil if none found. +func (m *Server_REST) ValidateAll() error { + return m.validate(true) +} + +func (m *Server_REST) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Network + + // no validation rules for Addr + + if all { + switch v := interface{}(m.GetTimeout()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Server_RESTValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Server_RESTValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Server_RESTValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetCors()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Server_RESTValidationError{ + field: "Cors", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Server_RESTValidationError{ + field: "Cors", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetCors()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Server_RESTValidationError{ + field: "Cors", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetMiddleware()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Server_RESTValidationError{ + field: "Middleware", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Server_RESTValidationError{ + field: "Middleware", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMiddleware()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Server_RESTValidationError{ + field: "Middleware", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return Server_RESTMultiError(errors) + } + + return nil +} + +// Server_RESTMultiError is an error wrapping multiple validation errors +// returned by Server_REST.ValidateAll() if the designated constraints aren't met. +type Server_RESTMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Server_RESTMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Server_RESTMultiError) AllErrors() []error { return m } + +// Server_RESTValidationError is the validation error returned by +// Server_REST.Validate if the designated constraints aren't met. +type Server_RESTValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Server_RESTValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Server_RESTValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Server_RESTValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Server_RESTValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Server_RESTValidationError) ErrorName() string { return "Server_RESTValidationError" } + +// Error satisfies the builtin error interface +func (e Server_RESTValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sServer_REST.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Server_RESTValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Server_RESTValidationError{} + +// Validate checks the field values on Server_GRPC with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Server_GRPC) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Server_GRPC with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Server_GRPCMultiError, or +// nil if none found. +func (m *Server_GRPC) ValidateAll() error { + return m.validate(true) +} + +func (m *Server_GRPC) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Network + + // no validation rules for Addr + + if all { + switch v := interface{}(m.GetTimeout()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Server_GRPCValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Server_GRPCValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Server_GRPCValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetMiddleware()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Server_GRPCValidationError{ + field: "Middleware", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Server_GRPCValidationError{ + field: "Middleware", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMiddleware()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Server_GRPCValidationError{ + field: "Middleware", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return Server_GRPCMultiError(errors) + } + + return nil +} + +// Server_GRPCMultiError is an error wrapping multiple validation errors +// returned by Server_GRPC.ValidateAll() if the designated constraints aren't met. +type Server_GRPCMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Server_GRPCMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Server_GRPCMultiError) AllErrors() []error { return m } + +// Server_GRPCValidationError is the validation error returned by +// Server_GRPC.Validate if the designated constraints aren't met. +type Server_GRPCValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Server_GRPCValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Server_GRPCValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Server_GRPCValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Server_GRPCValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Server_GRPCValidationError) ErrorName() string { return "Server_GRPCValidationError" } + +// Error satisfies the builtin error interface +func (e Server_GRPCValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sServer_GRPC.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Server_GRPCValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Server_GRPCValidationError{} + +// Validate checks the field values on Server_Websocket with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *Server_Websocket) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Server_Websocket with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// Server_WebsocketMultiError, or nil if none found. +func (m *Server_Websocket) ValidateAll() error { + return m.validate(true) +} + +func (m *Server_Websocket) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Network + + // no validation rules for Addr + + // no validation rules for Path + + // no validation rules for Codec + + if all { + switch v := interface{}(m.GetTimeout()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Server_WebsocketValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Server_WebsocketValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Server_WebsocketValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return Server_WebsocketMultiError(errors) + } + + return nil +} + +// Server_WebsocketMultiError is an error wrapping multiple validation errors +// returned by Server_Websocket.ValidateAll() if the designated constraints +// aren't met. +type Server_WebsocketMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Server_WebsocketMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Server_WebsocketMultiError) AllErrors() []error { return m } + +// Server_WebsocketValidationError is the validation error returned by +// Server_Websocket.Validate if the designated constraints aren't met. +type Server_WebsocketValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Server_WebsocketValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Server_WebsocketValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Server_WebsocketValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Server_WebsocketValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Server_WebsocketValidationError) ErrorName() string { return "Server_WebsocketValidationError" } + +// Error satisfies the builtin error interface +func (e Server_WebsocketValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sServer_Websocket.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Server_WebsocketValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Server_WebsocketValidationError{} + +// Validate checks the field values on Server_Mqtt with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Server_Mqtt) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Server_Mqtt with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Server_MqttMultiError, or +// nil if none found. +func (m *Server_Mqtt) ValidateAll() error { + return m.validate(true) +} + +func (m *Server_Mqtt) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Addr + + if len(errors) > 0 { + return Server_MqttMultiError(errors) + } + + return nil +} + +// Server_MqttMultiError is an error wrapping multiple validation errors +// returned by Server_Mqtt.ValidateAll() if the designated constraints aren't met. +type Server_MqttMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Server_MqttMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Server_MqttMultiError) AllErrors() []error { return m } + +// Server_MqttValidationError is the validation error returned by +// Server_Mqtt.Validate if the designated constraints aren't met. +type Server_MqttValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Server_MqttValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Server_MqttValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Server_MqttValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Server_MqttValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Server_MqttValidationError) ErrorName() string { return "Server_MqttValidationError" } + +// Error satisfies the builtin error interface +func (e Server_MqttValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sServer_Mqtt.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Server_MqttValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Server_MqttValidationError{} + +// Validate checks the field values on Server_Kafka with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Server_Kafka) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Server_Kafka with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Server_KafkaMultiError, or +// nil if none found. +func (m *Server_Kafka) ValidateAll() error { + return m.validate(true) +} + +func (m *Server_Kafka) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return Server_KafkaMultiError(errors) + } + + return nil +} + +// Server_KafkaMultiError is an error wrapping multiple validation errors +// returned by Server_Kafka.ValidateAll() if the designated constraints aren't met. +type Server_KafkaMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Server_KafkaMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Server_KafkaMultiError) AllErrors() []error { return m } + +// Server_KafkaValidationError is the validation error returned by +// Server_Kafka.Validate if the designated constraints aren't met. +type Server_KafkaValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Server_KafkaValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Server_KafkaValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Server_KafkaValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Server_KafkaValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Server_KafkaValidationError) ErrorName() string { return "Server_KafkaValidationError" } + +// Error satisfies the builtin error interface +func (e Server_KafkaValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sServer_Kafka.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Server_KafkaValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Server_KafkaValidationError{} + +// Validate checks the field values on Server_RabbitMQ with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *Server_RabbitMQ) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Server_RabbitMQ with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// Server_RabbitMQMultiError, or nil if none found. +func (m *Server_RabbitMQ) ValidateAll() error { + return m.validate(true) +} + +func (m *Server_RabbitMQ) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return Server_RabbitMQMultiError(errors) + } + + return nil +} + +// Server_RabbitMQMultiError is an error wrapping multiple validation errors +// returned by Server_RabbitMQ.ValidateAll() if the designated constraints +// aren't met. +type Server_RabbitMQMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Server_RabbitMQMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Server_RabbitMQMultiError) AllErrors() []error { return m } + +// Server_RabbitMQValidationError is the validation error returned by +// Server_RabbitMQ.Validate if the designated constraints aren't met. +type Server_RabbitMQValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Server_RabbitMQValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Server_RabbitMQValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Server_RabbitMQValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Server_RabbitMQValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Server_RabbitMQValidationError) ErrorName() string { return "Server_RabbitMQValidationError" } + +// Error satisfies the builtin error interface +func (e Server_RabbitMQValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sServer_RabbitMQ.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Server_RabbitMQValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Server_RabbitMQValidationError{} + +// Validate checks the field values on Server_SSE with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Server_SSE) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Server_SSE with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in Server_SSEMultiError, or +// nil if none found. +func (m *Server_SSE) ValidateAll() error { + return m.validate(true) +} + +func (m *Server_SSE) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Network + + // no validation rules for Addr + + if all { + switch v := interface{}(m.GetTimeout()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Server_SSEValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Server_SSEValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Server_SSEValidationError{ + field: "Timeout", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for Path + + // no validation rules for Codec + + if len(errors) > 0 { + return Server_SSEMultiError(errors) + } + + return nil +} + +// Server_SSEMultiError is an error wrapping multiple validation errors +// returned by Server_SSE.ValidateAll() if the designated constraints aren't met. +type Server_SSEMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Server_SSEMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Server_SSEMultiError) AllErrors() []error { return m } + +// Server_SSEValidationError is the validation error returned by +// Server_SSE.Validate if the designated constraints aren't met. +type Server_SSEValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Server_SSEValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Server_SSEValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Server_SSEValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Server_SSEValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Server_SSEValidationError) ErrorName() string { return "Server_SSEValidationError" } + +// Error satisfies the builtin error interface +func (e Server_SSEValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sServer_SSE.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Server_SSEValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Server_SSEValidationError{} + +// Validate checks the field values on Server_REST_CORS with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *Server_REST_CORS) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Server_REST_CORS with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// Server_REST_CORSMultiError, or nil if none found. +func (m *Server_REST_CORS) ValidateAll() error { + return m.validate(true) +} + +func (m *Server_REST_CORS) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return Server_REST_CORSMultiError(errors) + } + + return nil +} + +// Server_REST_CORSMultiError is an error wrapping multiple validation errors +// returned by Server_REST_CORS.ValidateAll() if the designated constraints +// aren't met. +type Server_REST_CORSMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Server_REST_CORSMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Server_REST_CORSMultiError) AllErrors() []error { return m } + +// Server_REST_CORSValidationError is the validation error returned by +// Server_REST_CORS.Validate if the designated constraints aren't met. +type Server_REST_CORSValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Server_REST_CORSValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Server_REST_CORSValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Server_REST_CORSValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Server_REST_CORSValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Server_REST_CORSValidationError) ErrorName() string { return "Server_REST_CORSValidationError" } + +// Error satisfies the builtin error interface +func (e Server_REST_CORSValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sServer_REST_CORS.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Server_REST_CORSValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Server_REST_CORSValidationError{} diff --git a/orm/gorm/gen/api/go/common/conf/tracer.pb.go b/orm/gorm/gen/api/go/common/conf/tracer.pb.go new file mode 100644 index 0000000..525654f --- /dev/null +++ b/orm/gorm/gen/api/go/common/conf/tracer.pb.go @@ -0,0 +1,174 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: common/conf/tracer.proto + +package conf + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 链路追踪 +type Tracer struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Batcher string `protobuf:"bytes,1,opt,name=batcher,proto3" json:"batcher,omitempty"` // jaeger或者zipkin + Endpoint string `protobuf:"bytes,2,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // 端口 + Sampler float64 `protobuf:"fixed64,3,opt,name=sampler,proto3" json:"sampler,omitempty"` // 采样率,默认:1.0 + Env string `protobuf:"bytes,4,opt,name=env,proto3" json:"env,omitempty"` // 运行环境:dev、debug、product +} + +func (x *Tracer) Reset() { + *x = Tracer{} + if protoimpl.UnsafeEnabled { + mi := &file_common_conf_tracer_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Tracer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Tracer) ProtoMessage() {} + +func (x *Tracer) ProtoReflect() protoreflect.Message { + mi := &file_common_conf_tracer_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Tracer.ProtoReflect.Descriptor instead. +func (*Tracer) Descriptor() ([]byte, []int) { + return file_common_conf_tracer_proto_rawDescGZIP(), []int{0} +} + +func (x *Tracer) GetBatcher() string { + if x != nil { + return x.Batcher + } + return "" +} + +func (x *Tracer) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +func (x *Tracer) GetSampler() float64 { + if x != nil { + return x.Sampler + } + return 0 +} + +func (x *Tracer) GetEnv() string { + if x != nil { + return x.Env + } + return "" +} + +var File_common_conf_tracer_proto protoreflect.FileDescriptor + +var file_common_conf_tracer_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x74, 0x72, + 0x61, 0x63, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x22, 0x6a, 0x0a, 0x06, 0x54, 0x72, 0x61, 0x63, 0x65, + 0x72, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x62, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x65, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x72, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x65, 0x6e, 0x76, 0x42, 0x31, 0x5a, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, + 0x72, 0x6d, 0x2d, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, + 0x66, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_common_conf_tracer_proto_rawDescOnce sync.Once + file_common_conf_tracer_proto_rawDescData = file_common_conf_tracer_proto_rawDesc +) + +func file_common_conf_tracer_proto_rawDescGZIP() []byte { + file_common_conf_tracer_proto_rawDescOnce.Do(func() { + file_common_conf_tracer_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_conf_tracer_proto_rawDescData) + }) + return file_common_conf_tracer_proto_rawDescData +} + +var file_common_conf_tracer_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_common_conf_tracer_proto_goTypes = []interface{}{ + (*Tracer)(nil), // 0: common.conf.Tracer +} +var file_common_conf_tracer_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_common_conf_tracer_proto_init() } +func file_common_conf_tracer_proto_init() { + if File_common_conf_tracer_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_common_conf_tracer_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Tracer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_conf_tracer_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_conf_tracer_proto_goTypes, + DependencyIndexes: file_common_conf_tracer_proto_depIdxs, + MessageInfos: file_common_conf_tracer_proto_msgTypes, + }.Build() + File_common_conf_tracer_proto = out.File + file_common_conf_tracer_proto_rawDesc = nil + file_common_conf_tracer_proto_goTypes = nil + file_common_conf_tracer_proto_depIdxs = nil +} diff --git a/orm/gorm/gen/api/go/common/conf/tracer.pb.validate.go b/orm/gorm/gen/api/go/common/conf/tracer.pb.validate.go new file mode 100644 index 0000000..128fad2 --- /dev/null +++ b/orm/gorm/gen/api/go/common/conf/tracer.pb.validate.go @@ -0,0 +1,142 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: common/conf/tracer.proto + +package conf + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on Tracer with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Tracer) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Tracer with the rules defined in the +// proto definition for this message. If any rules are violated, the result is +// a list of violation errors wrapped in TracerMultiError, or nil if none found. +func (m *Tracer) ValidateAll() error { + return m.validate(true) +} + +func (m *Tracer) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Batcher + + // no validation rules for Endpoint + + // no validation rules for Sampler + + // no validation rules for Env + + if len(errors) > 0 { + return TracerMultiError(errors) + } + + return nil +} + +// TracerMultiError is an error wrapping multiple validation errors returned by +// Tracer.ValidateAll() if the designated constraints aren't met. +type TracerMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m TracerMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m TracerMultiError) AllErrors() []error { return m } + +// TracerValidationError is the validation error returned by Tracer.Validate if +// the designated constraints aren't met. +type TracerValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e TracerValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e TracerValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e TracerValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e TracerValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e TracerValidationError) ErrorName() string { return "TracerValidationError" } + +// Error satisfies the builtin error interface +func (e TracerValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sTracer.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = TracerValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = TracerValidationError{} diff --git a/orm/gorm/gen/api/go/common/pagination/pagination.pb.go b/orm/gorm/gen/api/go/common/pagination/pagination.pb.go new file mode 100644 index 0000000..6fa1615 --- /dev/null +++ b/orm/gorm/gen/api/go/common/pagination/pagination.pb.go @@ -0,0 +1,352 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: common/pagination/pagination.proto + +package pagination + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 排序类型 +type SortOrder int32 + +const ( + // 不排序 + SortOrder_UNSORTED SortOrder = 0 + // 升序 + SortOrder_ASCENDING SortOrder = 1 + // 降序 + SortOrder_DESCENDING SortOrder = 2 +) + +// Enum value maps for SortOrder. +var ( + SortOrder_name = map[int32]string{ + 0: "UNSORTED", + 1: "ASCENDING", + 2: "DESCENDING", + } + SortOrder_value = map[string]int32{ + "UNSORTED": 0, + "ASCENDING": 1, + "DESCENDING": 2, + } +) + +func (x SortOrder) Enum() *SortOrder { + p := new(SortOrder) + *p = x + return p +} + +func (x SortOrder) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SortOrder) Descriptor() protoreflect.EnumDescriptor { + return file_common_pagination_pagination_proto_enumTypes[0].Descriptor() +} + +func (SortOrder) Type() protoreflect.EnumType { + return &file_common_pagination_pagination_proto_enumTypes[0] +} + +func (x SortOrder) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SortOrder.Descriptor instead. +func (SortOrder) EnumDescriptor() ([]byte, []int) { + return file_common_pagination_pagination_proto_rawDescGZIP(), []int{0} +} + +// 分页通用请求 +type PagingRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 当前页 + Page *int32 `protobuf:"varint,1,opt,name=page,proto3,oneof" json:"page,omitempty"` + // 每一页的行数 + PageSize *int32 `protobuf:"varint,2,opt,name=pageSize,proto3,oneof" json:"pageSize,omitempty"` + // 查询参数 + Query map[string]string `protobuf:"bytes,3,rep,name=query,proto3" json:"query,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // 排序 + OrderBy map[string]string `protobuf:"bytes,4,rep,name=orderBy,proto3" json:"orderBy,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // 是否不分页 + Nopaging *bool `protobuf:"varint,5,opt,name=nopaging,proto3,oneof" json:"nopaging,omitempty"` +} + +func (x *PagingRequest) Reset() { + *x = PagingRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_common_pagination_pagination_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PagingRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PagingRequest) ProtoMessage() {} + +func (x *PagingRequest) ProtoReflect() protoreflect.Message { + mi := &file_common_pagination_pagination_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PagingRequest.ProtoReflect.Descriptor instead. +func (*PagingRequest) Descriptor() ([]byte, []int) { + return file_common_pagination_pagination_proto_rawDescGZIP(), []int{0} +} + +func (x *PagingRequest) GetPage() int32 { + if x != nil && x.Page != nil { + return *x.Page + } + return 0 +} + +func (x *PagingRequest) GetPageSize() int32 { + if x != nil && x.PageSize != nil { + return *x.PageSize + } + return 0 +} + +func (x *PagingRequest) GetQuery() map[string]string { + if x != nil { + return x.Query + } + return nil +} + +func (x *PagingRequest) GetOrderBy() map[string]string { + if x != nil { + return x.OrderBy + } + return nil +} + +func (x *PagingRequest) GetNopaging() bool { + if x != nil && x.Nopaging != nil { + return *x.Nopaging + } + return false +} + +// 分页通用结果 +type PagingResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 总数 + Total int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + // 分页数据 + Items []*anypb.Any `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` +} + +func (x *PagingResponse) Reset() { + *x = PagingResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_common_pagination_pagination_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PagingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PagingResponse) ProtoMessage() {} + +func (x *PagingResponse) ProtoReflect() protoreflect.Message { + mi := &file_common_pagination_pagination_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PagingResponse.ProtoReflect.Descriptor instead. +func (*PagingResponse) Descriptor() ([]byte, []int) { + return file_common_pagination_pagination_proto_rawDescGZIP(), []int{1} +} + +func (x *PagingResponse) GetTotal() int32 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *PagingResponse) GetItems() []*anypb.Any { + if x != nil { + return x.Items + } + return nil +} + +var File_common_pagination_pagination_proto protoreflect.FileDescriptor + +var file_common_pagination_pagination_proto_rawDesc = []byte{ + 0x0a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x81, 0x03, 0x0a, 0x0d, + 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, + 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x04, 0x70, + 0x61, 0x67, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, + 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x48, 0x01, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, + 0x53, 0x69, 0x7a, 0x65, 0x88, 0x01, 0x01, 0x12, 0x3a, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x12, 0x40, 0x0a, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x79, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, + 0x4f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x6f, 0x72, + 0x64, 0x65, 0x72, 0x42, 0x79, 0x12, 0x1f, 0x0a, 0x08, 0x6e, 0x6f, 0x70, 0x61, 0x67, 0x69, 0x6e, + 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x48, 0x02, 0x52, 0x08, 0x6e, 0x6f, 0x70, 0x61, 0x67, + 0x69, 0x6e, 0x67, 0x88, 0x01, 0x01, 0x1a, 0x38, 0x0a, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x1a, 0x3a, 0x0a, 0x0c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x07, 0x0a, 0x05, + 0x5f, 0x70, 0x61, 0x67, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, + 0x7a, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6e, 0x6f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x22, + 0x52, 0x0a, 0x0e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x2a, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x69, 0x74, + 0x65, 0x6d, 0x73, 0x2a, 0x38, 0x0a, 0x09, 0x53, 0x6f, 0x72, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, + 0x12, 0x0c, 0x0a, 0x08, 0x55, 0x4e, 0x53, 0x4f, 0x52, 0x54, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, + 0x0a, 0x09, 0x41, 0x53, 0x43, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0e, 0x0a, + 0x0a, 0x44, 0x45, 0x53, 0x43, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x42, 0x3d, 0x5a, + 0x3b, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x72, 0x6d, 0x2d, 0x65, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x3b, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_common_pagination_pagination_proto_rawDescOnce sync.Once + file_common_pagination_pagination_proto_rawDescData = file_common_pagination_pagination_proto_rawDesc +) + +func file_common_pagination_pagination_proto_rawDescGZIP() []byte { + file_common_pagination_pagination_proto_rawDescOnce.Do(func() { + file_common_pagination_pagination_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_pagination_pagination_proto_rawDescData) + }) + return file_common_pagination_pagination_proto_rawDescData +} + +var file_common_pagination_pagination_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_common_pagination_pagination_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_common_pagination_pagination_proto_goTypes = []interface{}{ + (SortOrder)(0), // 0: pagination.SortOrder + (*PagingRequest)(nil), // 1: pagination.PagingRequest + (*PagingResponse)(nil), // 2: pagination.PagingResponse + nil, // 3: pagination.PagingRequest.QueryEntry + nil, // 4: pagination.PagingRequest.OrderByEntry + (*anypb.Any)(nil), // 5: google.protobuf.Any +} +var file_common_pagination_pagination_proto_depIdxs = []int32{ + 3, // 0: pagination.PagingRequest.query:type_name -> pagination.PagingRequest.QueryEntry + 4, // 1: pagination.PagingRequest.orderBy:type_name -> pagination.PagingRequest.OrderByEntry + 5, // 2: pagination.PagingResponse.items:type_name -> google.protobuf.Any + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_common_pagination_pagination_proto_init() } +func file_common_pagination_pagination_proto_init() { + if File_common_pagination_pagination_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_common_pagination_pagination_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PagingRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_pagination_pagination_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PagingResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_common_pagination_pagination_proto_msgTypes[0].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_pagination_pagination_proto_rawDesc, + NumEnums: 1, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_pagination_pagination_proto_goTypes, + DependencyIndexes: file_common_pagination_pagination_proto_depIdxs, + EnumInfos: file_common_pagination_pagination_proto_enumTypes, + MessageInfos: file_common_pagination_pagination_proto_msgTypes, + }.Build() + File_common_pagination_pagination_proto = out.File + file_common_pagination_pagination_proto_rawDesc = nil + file_common_pagination_pagination_proto_goTypes = nil + file_common_pagination_pagination_proto_depIdxs = nil +} diff --git a/orm/gorm/gen/api/go/common/pagination/pagination.pb.validate.go b/orm/gorm/gen/api/go/common/pagination/pagination.pb.validate.go new file mode 100644 index 0000000..7c5aed9 --- /dev/null +++ b/orm/gorm/gen/api/go/common/pagination/pagination.pb.validate.go @@ -0,0 +1,288 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: common/pagination/pagination.proto + +package pagination + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on PagingRequest with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *PagingRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on PagingRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in PagingRequestMultiError, or +// nil if none found. +func (m *PagingRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *PagingRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Query + + // no validation rules for OrderBy + + if m.Page != nil { + // no validation rules for Page + } + + if m.PageSize != nil { + // no validation rules for PageSize + } + + if m.Nopaging != nil { + // no validation rules for Nopaging + } + + if len(errors) > 0 { + return PagingRequestMultiError(errors) + } + + return nil +} + +// PagingRequestMultiError is an error wrapping multiple validation errors +// returned by PagingRequest.ValidateAll() if the designated constraints +// aren't met. +type PagingRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m PagingRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m PagingRequestMultiError) AllErrors() []error { return m } + +// PagingRequestValidationError is the validation error returned by +// PagingRequest.Validate if the designated constraints aren't met. +type PagingRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e PagingRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e PagingRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e PagingRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e PagingRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e PagingRequestValidationError) ErrorName() string { return "PagingRequestValidationError" } + +// Error satisfies the builtin error interface +func (e PagingRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sPagingRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = PagingRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = PagingRequestValidationError{} + +// Validate checks the field values on PagingResponse with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *PagingResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on PagingResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in PagingResponseMultiError, +// or nil if none found. +func (m *PagingResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *PagingResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Total + + for idx, item := range m.GetItems() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, PagingResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, PagingResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return PagingResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return PagingResponseMultiError(errors) + } + + return nil +} + +// PagingResponseMultiError is an error wrapping multiple validation errors +// returned by PagingResponse.ValidateAll() if the designated constraints +// aren't met. +type PagingResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m PagingResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m PagingResponseMultiError) AllErrors() []error { return m } + +// PagingResponseValidationError is the validation error returned by +// PagingResponse.Validate if the designated constraints aren't met. +type PagingResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e PagingResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e PagingResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e PagingResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e PagingResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e PagingResponseValidationError) ErrorName() string { return "PagingResponseValidationError" } + +// Error satisfies the builtin error interface +func (e PagingResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sPagingResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = PagingResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = PagingResponseValidationError{} diff --git a/orm/gorm/gen/api/go/user/service/v1/user.pb.go b/orm/gorm/gen/api/go/user/service/v1/user.pb.go new file mode 100644 index 0000000..406d338 --- /dev/null +++ b/orm/gorm/gen/api/go/user/service/v1/user.pb.go @@ -0,0 +1,695 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: user/service/v1/user.proto + +package v1 + +import ( + _ "github.com/google/gnostic/openapiv3" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + pagination "kratos-gorm-example/gen/api/go/common/pagination" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 用户 +type User struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + UserName *string `protobuf:"bytes,2,opt,name=userName,proto3,oneof" json:"userName,omitempty"` + NickName *string `protobuf:"bytes,3,opt,name=nickName,proto3,oneof" json:"nickName,omitempty"` + Password *string `protobuf:"bytes,4,opt,name=password,proto3,oneof" json:"password,omitempty"` + CreateTime *string `protobuf:"bytes,10,opt,name=createTime,proto3,oneof" json:"createTime,omitempty"` + UpdateTime *string `protobuf:"bytes,11,opt,name=updateTime,proto3,oneof" json:"updateTime,omitempty"` + DeleteTime *string `protobuf:"bytes,12,opt,name=deleteTime,proto3,oneof" json:"deleteTime,omitempty"` +} + +func (x *User) Reset() { + *x = User{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_user_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *User) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*User) ProtoMessage() {} + +func (x *User) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_user_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use User.ProtoReflect.Descriptor instead. +func (*User) Descriptor() ([]byte, []int) { + return file_user_service_v1_user_proto_rawDescGZIP(), []int{0} +} + +func (x *User) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *User) GetUserName() string { + if x != nil && x.UserName != nil { + return *x.UserName + } + return "" +} + +func (x *User) GetNickName() string { + if x != nil && x.NickName != nil { + return *x.NickName + } + return "" +} + +func (x *User) GetPassword() string { + if x != nil && x.Password != nil { + return *x.Password + } + return "" +} + +func (x *User) GetCreateTime() string { + if x != nil && x.CreateTime != nil { + return *x.CreateTime + } + return "" +} + +func (x *User) GetUpdateTime() string { + if x != nil && x.UpdateTime != nil { + return *x.UpdateTime + } + return "" +} + +func (x *User) GetDeleteTime() string { + if x != nil && x.DeleteTime != nil { + return *x.DeleteTime + } + return "" +} + +// 获取用户列表 - 答复 +type ListUserResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Items []*User `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` + Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` +} + +func (x *ListUserResponse) Reset() { + *x = ListUserResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_user_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListUserResponse) ProtoMessage() {} + +func (x *ListUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_user_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListUserResponse.ProtoReflect.Descriptor instead. +func (*ListUserResponse) Descriptor() ([]byte, []int) { + return file_user_service_v1_user_proto_rawDescGZIP(), []int{1} +} + +func (x *ListUserResponse) GetItems() []*User { + if x != nil { + return x.Items + } + return nil +} + +func (x *ListUserResponse) GetTotal() int32 { + if x != nil { + return x.Total + } + return 0 +} + +// 获取用户数据 - 请求 +type GetUserRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GetUserRequest) Reset() { + *x = GetUserRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_user_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserRequest) ProtoMessage() {} + +func (x *GetUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_user_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserRequest.ProtoReflect.Descriptor instead. +func (*GetUserRequest) Descriptor() ([]byte, []int) { + return file_user_service_v1_user_proto_rawDescGZIP(), []int{2} +} + +func (x *GetUserRequest) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +type GetUserByUserNameRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserName string `protobuf:"bytes,1,opt,name=userName,proto3" json:"userName,omitempty"` +} + +func (x *GetUserByUserNameRequest) Reset() { + *x = GetUserByUserNameRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_user_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUserByUserNameRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserByUserNameRequest) ProtoMessage() {} + +func (x *GetUserByUserNameRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_user_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserByUserNameRequest.ProtoReflect.Descriptor instead. +func (*GetUserByUserNameRequest) Descriptor() ([]byte, []int) { + return file_user_service_v1_user_proto_rawDescGZIP(), []int{3} +} + +func (x *GetUserByUserNameRequest) GetUserName() string { + if x != nil { + return x.UserName + } + return "" +} + +// 创建用户 - 请求 +type CreateUserRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` + OperatorId uint32 `protobuf:"varint,2,opt,name=operatorId,proto3" json:"operatorId,omitempty"` +} + +func (x *CreateUserRequest) Reset() { + *x = CreateUserRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_user_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateUserRequest) ProtoMessage() {} + +func (x *CreateUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_user_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead. +func (*CreateUserRequest) Descriptor() ([]byte, []int) { + return file_user_service_v1_user_proto_rawDescGZIP(), []int{4} +} + +func (x *CreateUserRequest) GetUser() *User { + if x != nil { + return x.User + } + return nil +} + +func (x *CreateUserRequest) GetOperatorId() uint32 { + if x != nil { + return x.OperatorId + } + return 0 +} + +// 更新用户 - 请求 +type UpdateUserRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + User *User `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` + OperatorId uint32 `protobuf:"varint,3,opt,name=operatorId,proto3" json:"operatorId,omitempty"` +} + +func (x *UpdateUserRequest) Reset() { + *x = UpdateUserRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_user_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUserRequest) ProtoMessage() {} + +func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_user_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateUserRequest.ProtoReflect.Descriptor instead. +func (*UpdateUserRequest) Descriptor() ([]byte, []int) { + return file_user_service_v1_user_proto_rawDescGZIP(), []int{5} +} + +func (x *UpdateUserRequest) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateUserRequest) GetUser() *User { + if x != nil { + return x.User + } + return nil +} + +func (x *UpdateUserRequest) GetOperatorId() uint32 { + if x != nil { + return x.OperatorId + } + return 0 +} + +// 删除用户 - 请求 +type DeleteUserRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + OperatorId uint32 `protobuf:"varint,2,opt,name=operatorId,proto3" json:"operatorId,omitempty"` +} + +func (x *DeleteUserRequest) Reset() { + *x = DeleteUserRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_v1_user_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteUserRequest) ProtoMessage() {} + +func (x *DeleteUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_service_v1_user_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteUserRequest.ProtoReflect.Descriptor instead. +func (*DeleteUserRequest) Descriptor() ([]byte, []int) { + return file_user_service_v1_user_proto_rawDescGZIP(), []int{6} +} + +func (x *DeleteUserRequest) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *DeleteUserRequest) GetOperatorId() uint32 { + if x != nil { + return x.OperatorId + } + return 0 +} + +var File_user_service_v1_user_proto protoreflect.FileDescriptor + +var file_user_service_v1_user_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, + 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x75, 0x73, + 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x24, 0x67, + 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x33, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbc, 0x02, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, + 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x00, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1f, + 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x01, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, + 0x1f, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x02, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x88, 0x01, 0x01, + 0x12, 0x23, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, + 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, + 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x48, 0x04, 0x52, 0x0a, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x64, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x48, 0x05, + 0x52, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, + 0x0b, 0x0a, 0x09, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x0b, 0x0a, 0x09, + 0x5f, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x70, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x54, 0x69, 0x6d, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, + 0x69, 0x6d, 0x65, 0x22, 0x55, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, 0x69, + 0x74, 0x65, 0x6d, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x20, 0x0a, 0x0e, 0x47, 0x65, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, 0x36, 0x0a, 0x18, + 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, + 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, + 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x5e, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x04, 0x75, 0x73, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, + 0x75, 0x73, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, + 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x6f, 0x72, 0x49, 0x64, 0x22, 0x6e, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x29, 0x0a, 0x04, 0x75, 0x73, 0x65, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, + 0x75, 0x73, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, + 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x6f, 0x72, 0x49, 0x64, 0x22, 0x43, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x32, 0x80, 0x03, 0x0a, 0x0b, 0x55, 0x73, + 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4a, 0x0a, 0x08, 0x4c, 0x69, 0x73, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x21, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, + 0x12, 0x1f, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x0a, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x22, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, + 0x73, 0x65, 0x72, 0x12, 0x22, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x00, + 0x12, 0x4a, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x22, + 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x42, 0x33, 0x5a, 0x31, + 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x72, 0x6d, 0x2d, 0x65, 0x78, 0x61, 0x6d, + 0x70, 0x6c, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x75, + 0x73, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x76, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_user_service_v1_user_proto_rawDescOnce sync.Once + file_user_service_v1_user_proto_rawDescData = file_user_service_v1_user_proto_rawDesc +) + +func file_user_service_v1_user_proto_rawDescGZIP() []byte { + file_user_service_v1_user_proto_rawDescOnce.Do(func() { + file_user_service_v1_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_user_service_v1_user_proto_rawDescData) + }) + return file_user_service_v1_user_proto_rawDescData +} + +var file_user_service_v1_user_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_user_service_v1_user_proto_goTypes = []interface{}{ + (*User)(nil), // 0: user.service.v1.User + (*ListUserResponse)(nil), // 1: user.service.v1.ListUserResponse + (*GetUserRequest)(nil), // 2: user.service.v1.GetUserRequest + (*GetUserByUserNameRequest)(nil), // 3: user.service.v1.GetUserByUserNameRequest + (*CreateUserRequest)(nil), // 4: user.service.v1.CreateUserRequest + (*UpdateUserRequest)(nil), // 5: user.service.v1.UpdateUserRequest + (*DeleteUserRequest)(nil), // 6: user.service.v1.DeleteUserRequest + (*pagination.PagingRequest)(nil), // 7: pagination.PagingRequest + (*emptypb.Empty)(nil), // 8: google.protobuf.Empty +} +var file_user_service_v1_user_proto_depIdxs = []int32{ + 0, // 0: user.service.v1.ListUserResponse.items:type_name -> user.service.v1.User + 0, // 1: user.service.v1.CreateUserRequest.user:type_name -> user.service.v1.User + 0, // 2: user.service.v1.UpdateUserRequest.user:type_name -> user.service.v1.User + 7, // 3: user.service.v1.UserService.ListUser:input_type -> pagination.PagingRequest + 2, // 4: user.service.v1.UserService.GetUser:input_type -> user.service.v1.GetUserRequest + 4, // 5: user.service.v1.UserService.CreateUser:input_type -> user.service.v1.CreateUserRequest + 5, // 6: user.service.v1.UserService.UpdateUser:input_type -> user.service.v1.UpdateUserRequest + 6, // 7: user.service.v1.UserService.DeleteUser:input_type -> user.service.v1.DeleteUserRequest + 1, // 8: user.service.v1.UserService.ListUser:output_type -> user.service.v1.ListUserResponse + 0, // 9: user.service.v1.UserService.GetUser:output_type -> user.service.v1.User + 0, // 10: user.service.v1.UserService.CreateUser:output_type -> user.service.v1.User + 0, // 11: user.service.v1.UserService.UpdateUser:output_type -> user.service.v1.User + 8, // 12: user.service.v1.UserService.DeleteUser:output_type -> google.protobuf.Empty + 8, // [8:13] is the sub-list for method output_type + 3, // [3:8] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_user_service_v1_user_proto_init() } +func file_user_service_v1_user_proto_init() { + if File_user_service_v1_user_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_user_service_v1_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*User); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_user_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListUserResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_user_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUserRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_user_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUserByUserNameRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_user_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateUserRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_user_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateUserRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_service_v1_user_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteUserRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_user_service_v1_user_proto_msgTypes[0].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_user_service_v1_user_proto_rawDesc, + NumEnums: 0, + NumMessages: 7, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_user_service_v1_user_proto_goTypes, + DependencyIndexes: file_user_service_v1_user_proto_depIdxs, + MessageInfos: file_user_service_v1_user_proto_msgTypes, + }.Build() + File_user_service_v1_user_proto = out.File + file_user_service_v1_user_proto_rawDesc = nil + file_user_service_v1_user_proto_goTypes = nil + file_user_service_v1_user_proto_depIdxs = nil +} diff --git a/orm/gorm/gen/api/go/user/service/v1/user.pb.validate.go b/orm/gorm/gen/api/go/user/service/v1/user.pb.validate.go new file mode 100644 index 0000000..8f7ce37 --- /dev/null +++ b/orm/gorm/gen/api/go/user/service/v1/user.pb.validate.go @@ -0,0 +1,876 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: user/service/v1/user.proto + +package v1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on User with the rules defined in the proto +// definition for this message. If any rules are violated, the first error +// encountered is returned, or nil if there are no violations. +func (m *User) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on User with the rules defined in the +// proto definition for this message. If any rules are violated, the result is +// a list of violation errors wrapped in UserMultiError, or nil if none found. +func (m *User) ValidateAll() error { + return m.validate(true) +} + +func (m *User) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if m.UserName != nil { + // no validation rules for UserName + } + + if m.NickName != nil { + // no validation rules for NickName + } + + if m.Password != nil { + // no validation rules for Password + } + + if m.CreateTime != nil { + // no validation rules for CreateTime + } + + if m.UpdateTime != nil { + // no validation rules for UpdateTime + } + + if m.DeleteTime != nil { + // no validation rules for DeleteTime + } + + if len(errors) > 0 { + return UserMultiError(errors) + } + + return nil +} + +// UserMultiError is an error wrapping multiple validation errors returned by +// User.ValidateAll() if the designated constraints aren't met. +type UserMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UserMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m UserMultiError) AllErrors() []error { return m } + +// UserValidationError is the validation error returned by User.Validate if the +// designated constraints aren't met. +type UserValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UserValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UserValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UserValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UserValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UserValidationError) ErrorName() string { return "UserValidationError" } + +// Error satisfies the builtin error interface +func (e UserValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUser.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UserValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UserValidationError{} + +// Validate checks the field values on ListUserResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *ListUserResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ListUserResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ListUserResponseMultiError, or nil if none found. +func (m *ListUserResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *ListUserResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + for idx, item := range m.GetItems() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ListUserResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ListUserResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ListUserResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + // no validation rules for Total + + if len(errors) > 0 { + return ListUserResponseMultiError(errors) + } + + return nil +} + +// ListUserResponseMultiError is an error wrapping multiple validation errors +// returned by ListUserResponse.ValidateAll() if the designated constraints +// aren't met. +type ListUserResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ListUserResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ListUserResponseMultiError) AllErrors() []error { return m } + +// ListUserResponseValidationError is the validation error returned by +// ListUserResponse.Validate if the designated constraints aren't met. +type ListUserResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ListUserResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ListUserResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ListUserResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ListUserResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ListUserResponseValidationError) ErrorName() string { return "ListUserResponseValidationError" } + +// Error satisfies the builtin error interface +func (e ListUserResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sListUserResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ListUserResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ListUserResponseValidationError{} + +// Validate checks the field values on GetUserRequest with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *GetUserRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetUserRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in GetUserRequestMultiError, +// or nil if none found. +func (m *GetUserRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *GetUserRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if len(errors) > 0 { + return GetUserRequestMultiError(errors) + } + + return nil +} + +// GetUserRequestMultiError is an error wrapping multiple validation errors +// returned by GetUserRequest.ValidateAll() if the designated constraints +// aren't met. +type GetUserRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetUserRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetUserRequestMultiError) AllErrors() []error { return m } + +// GetUserRequestValidationError is the validation error returned by +// GetUserRequest.Validate if the designated constraints aren't met. +type GetUserRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetUserRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetUserRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetUserRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetUserRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetUserRequestValidationError) ErrorName() string { return "GetUserRequestValidationError" } + +// Error satisfies the builtin error interface +func (e GetUserRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetUserRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetUserRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetUserRequestValidationError{} + +// Validate checks the field values on GetUserByUserNameRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *GetUserByUserNameRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetUserByUserNameRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// GetUserByUserNameRequestMultiError, or nil if none found. +func (m *GetUserByUserNameRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *GetUserByUserNameRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for UserName + + if len(errors) > 0 { + return GetUserByUserNameRequestMultiError(errors) + } + + return nil +} + +// GetUserByUserNameRequestMultiError is an error wrapping multiple validation +// errors returned by GetUserByUserNameRequest.ValidateAll() if the designated +// constraints aren't met. +type GetUserByUserNameRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetUserByUserNameRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetUserByUserNameRequestMultiError) AllErrors() []error { return m } + +// GetUserByUserNameRequestValidationError is the validation error returned by +// GetUserByUserNameRequest.Validate if the designated constraints aren't met. +type GetUserByUserNameRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetUserByUserNameRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetUserByUserNameRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetUserByUserNameRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetUserByUserNameRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetUserByUserNameRequestValidationError) ErrorName() string { + return "GetUserByUserNameRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e GetUserByUserNameRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetUserByUserNameRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetUserByUserNameRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetUserByUserNameRequestValidationError{} + +// Validate checks the field values on CreateUserRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *CreateUserRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on CreateUserRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// CreateUserRequestMultiError, or nil if none found. +func (m *CreateUserRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *CreateUserRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetUser()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CreateUserRequestValidationError{ + field: "User", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CreateUserRequestValidationError{ + field: "User", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetUser()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateUserRequestValidationError{ + field: "User", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for OperatorId + + if len(errors) > 0 { + return CreateUserRequestMultiError(errors) + } + + return nil +} + +// CreateUserRequestMultiError is an error wrapping multiple validation errors +// returned by CreateUserRequest.ValidateAll() if the designated constraints +// aren't met. +type CreateUserRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m CreateUserRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m CreateUserRequestMultiError) AllErrors() []error { return m } + +// CreateUserRequestValidationError is the validation error returned by +// CreateUserRequest.Validate if the designated constraints aren't met. +type CreateUserRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CreateUserRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CreateUserRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CreateUserRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CreateUserRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CreateUserRequestValidationError) ErrorName() string { + return "CreateUserRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e CreateUserRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCreateUserRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CreateUserRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CreateUserRequestValidationError{} + +// Validate checks the field values on UpdateUserRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *UpdateUserRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on UpdateUserRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// UpdateUserRequestMultiError, or nil if none found. +func (m *UpdateUserRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *UpdateUserRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if all { + switch v := interface{}(m.GetUser()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UpdateUserRequestValidationError{ + field: "User", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UpdateUserRequestValidationError{ + field: "User", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetUser()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpdateUserRequestValidationError{ + field: "User", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for OperatorId + + if len(errors) > 0 { + return UpdateUserRequestMultiError(errors) + } + + return nil +} + +// UpdateUserRequestMultiError is an error wrapping multiple validation errors +// returned by UpdateUserRequest.ValidateAll() if the designated constraints +// aren't met. +type UpdateUserRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UpdateUserRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m UpdateUserRequestMultiError) AllErrors() []error { return m } + +// UpdateUserRequestValidationError is the validation error returned by +// UpdateUserRequest.Validate if the designated constraints aren't met. +type UpdateUserRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UpdateUserRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UpdateUserRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UpdateUserRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UpdateUserRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UpdateUserRequestValidationError) ErrorName() string { + return "UpdateUserRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e UpdateUserRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUpdateUserRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UpdateUserRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UpdateUserRequestValidationError{} + +// Validate checks the field values on DeleteUserRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *DeleteUserRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on DeleteUserRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// DeleteUserRequestMultiError, or nil if none found. +func (m *DeleteUserRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *DeleteUserRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + // no validation rules for OperatorId + + if len(errors) > 0 { + return DeleteUserRequestMultiError(errors) + } + + return nil +} + +// DeleteUserRequestMultiError is an error wrapping multiple validation errors +// returned by DeleteUserRequest.ValidateAll() if the designated constraints +// aren't met. +type DeleteUserRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m DeleteUserRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m DeleteUserRequestMultiError) AllErrors() []error { return m } + +// DeleteUserRequestValidationError is the validation error returned by +// DeleteUserRequest.Validate if the designated constraints aren't met. +type DeleteUserRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DeleteUserRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DeleteUserRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DeleteUserRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DeleteUserRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DeleteUserRequestValidationError) ErrorName() string { + return "DeleteUserRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e DeleteUserRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDeleteUserRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DeleteUserRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DeleteUserRequestValidationError{} diff --git a/orm/gorm/gen/api/go/user/service/v1/user_error.pb.go b/orm/gorm/gen/api/go/user/service/v1/user_error.pb.go new file mode 100644 index 0000000..f6806b1 --- /dev/null +++ b/orm/gorm/gen/api/go/user/service/v1/user_error.pb.go @@ -0,0 +1,220 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: user/service/v1/user_error.proto + +package v1 + +import ( + _ "github.com/go-kratos/kratos/v2/errors" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type UserErrorReason int32 + +const ( + UserErrorReason_NOT_LOGGED_IN UserErrorReason = 0 // 401 + UserErrorReason_ACCESS_FORBIDDEN UserErrorReason = 1 // 403 + UserErrorReason_RESOURCE_NOT_FOUND UserErrorReason = 2 // 404 + UserErrorReason_METHOD_NOT_ALLOWED UserErrorReason = 3 // 405 + UserErrorReason_REQUEST_TIMEOUT UserErrorReason = 4 // 408 + UserErrorReason_INTERNAL_SERVER_ERROR UserErrorReason = 5 // 500 + UserErrorReason_NOT_IMPLEMENTED UserErrorReason = 6 // 501 + UserErrorReason_NETWORK_ERROR UserErrorReason = 7 // 502 + UserErrorReason_SERVICE_UNAVAILABLE UserErrorReason = 8 // 503 + UserErrorReason_NETWORK_TIMEOUT UserErrorReason = 9 // 504 + UserErrorReason_REQUEST_NOT_SUPPORT UserErrorReason = 10 // 505 + UserErrorReason_USER_NOT_FOUND UserErrorReason = 11 + UserErrorReason_INCORRECT_PASSWORD UserErrorReason = 12 + UserErrorReason_USER_FREEZE UserErrorReason = 13 + UserErrorReason_INVALID_USERID UserErrorReason = 14 // 用户ID无效 + UserErrorReason_INVALID_PASSWORD UserErrorReason = 15 // 密码无效 + UserErrorReason_TOKEN_EXPIRED UserErrorReason = 16 // token过期 + UserErrorReason_INVALID_TOKEN UserErrorReason = 17 // token无效 + UserErrorReason_TOKEN_NOT_EXIST UserErrorReason = 18 // token不存在 + UserErrorReason_USER_NOT_EXIST UserErrorReason = 19 // 用户不存在 +) + +// Enum value maps for UserErrorReason. +var ( + UserErrorReason_name = map[int32]string{ + 0: "NOT_LOGGED_IN", + 1: "ACCESS_FORBIDDEN", + 2: "RESOURCE_NOT_FOUND", + 3: "METHOD_NOT_ALLOWED", + 4: "REQUEST_TIMEOUT", + 5: "INTERNAL_SERVER_ERROR", + 6: "NOT_IMPLEMENTED", + 7: "NETWORK_ERROR", + 8: "SERVICE_UNAVAILABLE", + 9: "NETWORK_TIMEOUT", + 10: "REQUEST_NOT_SUPPORT", + 11: "USER_NOT_FOUND", + 12: "INCORRECT_PASSWORD", + 13: "USER_FREEZE", + 14: "INVALID_USERID", + 15: "INVALID_PASSWORD", + 16: "TOKEN_EXPIRED", + 17: "INVALID_TOKEN", + 18: "TOKEN_NOT_EXIST", + 19: "USER_NOT_EXIST", + } + UserErrorReason_value = map[string]int32{ + "NOT_LOGGED_IN": 0, + "ACCESS_FORBIDDEN": 1, + "RESOURCE_NOT_FOUND": 2, + "METHOD_NOT_ALLOWED": 3, + "REQUEST_TIMEOUT": 4, + "INTERNAL_SERVER_ERROR": 5, + "NOT_IMPLEMENTED": 6, + "NETWORK_ERROR": 7, + "SERVICE_UNAVAILABLE": 8, + "NETWORK_TIMEOUT": 9, + "REQUEST_NOT_SUPPORT": 10, + "USER_NOT_FOUND": 11, + "INCORRECT_PASSWORD": 12, + "USER_FREEZE": 13, + "INVALID_USERID": 14, + "INVALID_PASSWORD": 15, + "TOKEN_EXPIRED": 16, + "INVALID_TOKEN": 17, + "TOKEN_NOT_EXIST": 18, + "USER_NOT_EXIST": 19, + } +) + +func (x UserErrorReason) Enum() *UserErrorReason { + p := new(UserErrorReason) + *p = x + return p +} + +func (x UserErrorReason) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (UserErrorReason) Descriptor() protoreflect.EnumDescriptor { + return file_user_service_v1_user_error_proto_enumTypes[0].Descriptor() +} + +func (UserErrorReason) Type() protoreflect.EnumType { + return &file_user_service_v1_user_error_proto_enumTypes[0] +} + +func (x UserErrorReason) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use UserErrorReason.Descriptor instead. +func (UserErrorReason) EnumDescriptor() ([]byte, []int) { + return file_user_service_v1_user_error_proto_rawDescGZIP(), []int{0} +} + +var File_user_service_v1_user_error_proto protoreflect.FileDescriptor + +var file_user_service_v1_user_error_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, + 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x0f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x76, 0x31, 0x1a, 0x13, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2f, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2a, 0xb7, 0x04, 0x0a, 0x0f, 0x55, 0x73, 0x65, + 0x72, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x0d, + 0x4e, 0x4f, 0x54, 0x5f, 0x4c, 0x4f, 0x47, 0x47, 0x45, 0x44, 0x5f, 0x49, 0x4e, 0x10, 0x00, 0x1a, + 0x04, 0xa8, 0x45, 0x91, 0x03, 0x12, 0x1a, 0x0a, 0x10, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, + 0x46, 0x4f, 0x52, 0x42, 0x49, 0x44, 0x44, 0x45, 0x4e, 0x10, 0x01, 0x1a, 0x04, 0xa8, 0x45, 0x93, + 0x03, 0x12, 0x1c, 0x0a, 0x12, 0x52, 0x45, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x4e, 0x4f, + 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x02, 0x1a, 0x04, 0xa8, 0x45, 0x94, 0x03, 0x12, + 0x1c, 0x0a, 0x12, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x41, 0x4c, + 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x10, 0x03, 0x1a, 0x04, 0xa8, 0x45, 0x95, 0x03, 0x12, 0x19, 0x0a, + 0x0f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x54, 0x49, 0x4d, 0x45, 0x4f, 0x55, 0x54, + 0x10, 0x04, 0x1a, 0x04, 0xa8, 0x45, 0x98, 0x03, 0x12, 0x1f, 0x0a, 0x15, 0x49, 0x4e, 0x54, 0x45, + 0x52, 0x4e, 0x41, 0x4c, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x5f, 0x45, 0x52, 0x52, 0x4f, + 0x52, 0x10, 0x05, 0x1a, 0x04, 0xa8, 0x45, 0xf4, 0x03, 0x12, 0x19, 0x0a, 0x0f, 0x4e, 0x4f, 0x54, + 0x5f, 0x49, 0x4d, 0x50, 0x4c, 0x45, 0x4d, 0x45, 0x4e, 0x54, 0x45, 0x44, 0x10, 0x06, 0x1a, 0x04, + 0xa8, 0x45, 0xf5, 0x03, 0x12, 0x17, 0x0a, 0x0d, 0x4e, 0x45, 0x54, 0x57, 0x4f, 0x52, 0x4b, 0x5f, + 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x07, 0x1a, 0x04, 0xa8, 0x45, 0xf6, 0x03, 0x12, 0x1d, 0x0a, + 0x13, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x41, 0x56, 0x41, 0x49, 0x4c, + 0x41, 0x42, 0x4c, 0x45, 0x10, 0x08, 0x1a, 0x04, 0xa8, 0x45, 0xf7, 0x03, 0x12, 0x19, 0x0a, 0x0f, + 0x4e, 0x45, 0x54, 0x57, 0x4f, 0x52, 0x4b, 0x5f, 0x54, 0x49, 0x4d, 0x45, 0x4f, 0x55, 0x54, 0x10, + 0x09, 0x1a, 0x04, 0xa8, 0x45, 0xf8, 0x03, 0x12, 0x1d, 0x0a, 0x13, 0x52, 0x45, 0x51, 0x55, 0x45, + 0x53, 0x54, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x53, 0x55, 0x50, 0x50, 0x4f, 0x52, 0x54, 0x10, 0x0a, + 0x1a, 0x04, 0xa8, 0x45, 0xf9, 0x03, 0x12, 0x18, 0x0a, 0x0e, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x4e, + 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x0b, 0x1a, 0x04, 0xa8, 0x45, 0xd8, 0x04, + 0x12, 0x1c, 0x0a, 0x12, 0x49, 0x4e, 0x43, 0x4f, 0x52, 0x52, 0x45, 0x43, 0x54, 0x5f, 0x50, 0x41, + 0x53, 0x53, 0x57, 0x4f, 0x52, 0x44, 0x10, 0x0c, 0x1a, 0x04, 0xa8, 0x45, 0xd7, 0x04, 0x12, 0x15, + 0x0a, 0x0b, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x46, 0x52, 0x45, 0x45, 0x5a, 0x45, 0x10, 0x0d, 0x1a, + 0x04, 0xa8, 0x45, 0xd6, 0x04, 0x12, 0x17, 0x0a, 0x0e, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, + 0x5f, 0x55, 0x53, 0x45, 0x52, 0x49, 0x44, 0x10, 0x0e, 0x1a, 0x03, 0xa8, 0x45, 0x65, 0x12, 0x19, + 0x0a, 0x10, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x50, 0x41, 0x53, 0x53, 0x57, 0x4f, + 0x52, 0x44, 0x10, 0x0f, 0x1a, 0x03, 0xa8, 0x45, 0x66, 0x12, 0x16, 0x0a, 0x0d, 0x54, 0x4f, 0x4b, + 0x45, 0x4e, 0x5f, 0x45, 0x58, 0x50, 0x49, 0x52, 0x45, 0x44, 0x10, 0x10, 0x1a, 0x03, 0xa8, 0x45, + 0x67, 0x12, 0x16, 0x0a, 0x0d, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x54, 0x4f, 0x4b, + 0x45, 0x4e, 0x10, 0x11, 0x1a, 0x03, 0xa8, 0x45, 0x68, 0x12, 0x18, 0x0a, 0x0f, 0x54, 0x4f, 0x4b, + 0x45, 0x4e, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x58, 0x49, 0x53, 0x54, 0x10, 0x12, 0x1a, 0x03, + 0xa8, 0x45, 0x69, 0x12, 0x17, 0x0a, 0x0e, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, + 0x45, 0x58, 0x49, 0x53, 0x54, 0x10, 0x13, 0x1a, 0x03, 0xa8, 0x45, 0x6a, 0x1a, 0x04, 0xa0, 0x45, + 0xf4, 0x03, 0x42, 0x33, 0x5a, 0x31, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x72, + 0x6d, 0x2d, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_user_service_v1_user_error_proto_rawDescOnce sync.Once + file_user_service_v1_user_error_proto_rawDescData = file_user_service_v1_user_error_proto_rawDesc +) + +func file_user_service_v1_user_error_proto_rawDescGZIP() []byte { + file_user_service_v1_user_error_proto_rawDescOnce.Do(func() { + file_user_service_v1_user_error_proto_rawDescData = protoimpl.X.CompressGZIP(file_user_service_v1_user_error_proto_rawDescData) + }) + return file_user_service_v1_user_error_proto_rawDescData +} + +var file_user_service_v1_user_error_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_user_service_v1_user_error_proto_goTypes = []interface{}{ + (UserErrorReason)(0), // 0: user.service.v1.UserErrorReason +} +var file_user_service_v1_user_error_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_user_service_v1_user_error_proto_init() } +func file_user_service_v1_user_error_proto_init() { + if File_user_service_v1_user_error_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_user_service_v1_user_error_proto_rawDesc, + NumEnums: 1, + NumMessages: 0, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_user_service_v1_user_error_proto_goTypes, + DependencyIndexes: file_user_service_v1_user_error_proto_depIdxs, + EnumInfos: file_user_service_v1_user_error_proto_enumTypes, + }.Build() + File_user_service_v1_user_error_proto = out.File + file_user_service_v1_user_error_proto_rawDesc = nil + file_user_service_v1_user_error_proto_goTypes = nil + file_user_service_v1_user_error_proto_depIdxs = nil +} diff --git a/orm/gorm/gen/api/go/user/service/v1/user_error.pb.validate.go b/orm/gorm/gen/api/go/user/service/v1/user_error.pb.validate.go new file mode 100644 index 0000000..644a37c --- /dev/null +++ b/orm/gorm/gen/api/go/user/service/v1/user_error.pb.validate.go @@ -0,0 +1,36 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: user/service/v1/user_error.proto + +package v1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) diff --git a/orm/gorm/gen/api/go/user/service/v1/user_error_errors.pb.go b/orm/gorm/gen/api/go/user/service/v1/user_error_errors.pb.go new file mode 100644 index 0000000..b8245a6 --- /dev/null +++ b/orm/gorm/gen/api/go/user/service/v1/user_error_errors.pb.go @@ -0,0 +1,286 @@ +// Code generated by protoc-gen-go-errors. DO NOT EDIT. + +package v1 + +import ( + fmt "fmt" + errors "github.com/go-kratos/kratos/v2/errors" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the kratos package it is being compiled against. +const _ = errors.SupportPackageIsVersion1 + +// 401 +func IsNotLoggedIn(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_NOT_LOGGED_IN.String() && e.Code == 401 +} + +// 401 +func ErrorNotLoggedIn(format string, args ...interface{}) *errors.Error { + return errors.New(401, UserErrorReason_NOT_LOGGED_IN.String(), fmt.Sprintf(format, args...)) +} + +// 403 +func IsAccessForbidden(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_ACCESS_FORBIDDEN.String() && e.Code == 403 +} + +// 403 +func ErrorAccessForbidden(format string, args ...interface{}) *errors.Error { + return errors.New(403, UserErrorReason_ACCESS_FORBIDDEN.String(), fmt.Sprintf(format, args...)) +} + +// 404 +func IsResourceNotFound(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_RESOURCE_NOT_FOUND.String() && e.Code == 404 +} + +// 404 +func ErrorResourceNotFound(format string, args ...interface{}) *errors.Error { + return errors.New(404, UserErrorReason_RESOURCE_NOT_FOUND.String(), fmt.Sprintf(format, args...)) +} + +// 405 +func IsMethodNotAllowed(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_METHOD_NOT_ALLOWED.String() && e.Code == 405 +} + +// 405 +func ErrorMethodNotAllowed(format string, args ...interface{}) *errors.Error { + return errors.New(405, UserErrorReason_METHOD_NOT_ALLOWED.String(), fmt.Sprintf(format, args...)) +} + +// 408 +func IsRequestTimeout(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_REQUEST_TIMEOUT.String() && e.Code == 408 +} + +// 408 +func ErrorRequestTimeout(format string, args ...interface{}) *errors.Error { + return errors.New(408, UserErrorReason_REQUEST_TIMEOUT.String(), fmt.Sprintf(format, args...)) +} + +// 500 +func IsInternalServerError(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_INTERNAL_SERVER_ERROR.String() && e.Code == 500 +} + +// 500 +func ErrorInternalServerError(format string, args ...interface{}) *errors.Error { + return errors.New(500, UserErrorReason_INTERNAL_SERVER_ERROR.String(), fmt.Sprintf(format, args...)) +} + +// 501 +func IsNotImplemented(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_NOT_IMPLEMENTED.String() && e.Code == 501 +} + +// 501 +func ErrorNotImplemented(format string, args ...interface{}) *errors.Error { + return errors.New(501, UserErrorReason_NOT_IMPLEMENTED.String(), fmt.Sprintf(format, args...)) +} + +// 502 +func IsNetworkError(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_NETWORK_ERROR.String() && e.Code == 502 +} + +// 502 +func ErrorNetworkError(format string, args ...interface{}) *errors.Error { + return errors.New(502, UserErrorReason_NETWORK_ERROR.String(), fmt.Sprintf(format, args...)) +} + +// 503 +func IsServiceUnavailable(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_SERVICE_UNAVAILABLE.String() && e.Code == 503 +} + +// 503 +func ErrorServiceUnavailable(format string, args ...interface{}) *errors.Error { + return errors.New(503, UserErrorReason_SERVICE_UNAVAILABLE.String(), fmt.Sprintf(format, args...)) +} + +// 504 +func IsNetworkTimeout(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_NETWORK_TIMEOUT.String() && e.Code == 504 +} + +// 504 +func ErrorNetworkTimeout(format string, args ...interface{}) *errors.Error { + return errors.New(504, UserErrorReason_NETWORK_TIMEOUT.String(), fmt.Sprintf(format, args...)) +} + +// 505 +func IsRequestNotSupport(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_REQUEST_NOT_SUPPORT.String() && e.Code == 505 +} + +// 505 +func ErrorRequestNotSupport(format string, args ...interface{}) *errors.Error { + return errors.New(505, UserErrorReason_REQUEST_NOT_SUPPORT.String(), fmt.Sprintf(format, args...)) +} + +func IsUserNotFound(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_USER_NOT_FOUND.String() && e.Code == 600 +} + +func ErrorUserNotFound(format string, args ...interface{}) *errors.Error { + return errors.New(600, UserErrorReason_USER_NOT_FOUND.String(), fmt.Sprintf(format, args...)) +} + +func IsIncorrectPassword(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_INCORRECT_PASSWORD.String() && e.Code == 599 +} + +func ErrorIncorrectPassword(format string, args ...interface{}) *errors.Error { + return errors.New(599, UserErrorReason_INCORRECT_PASSWORD.String(), fmt.Sprintf(format, args...)) +} + +func IsUserFreeze(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_USER_FREEZE.String() && e.Code == 598 +} + +func ErrorUserFreeze(format string, args ...interface{}) *errors.Error { + return errors.New(598, UserErrorReason_USER_FREEZE.String(), fmt.Sprintf(format, args...)) +} + +// 用户ID无效 +func IsInvalidUserid(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_INVALID_USERID.String() && e.Code == 101 +} + +// 用户ID无效 +func ErrorInvalidUserid(format string, args ...interface{}) *errors.Error { + return errors.New(101, UserErrorReason_INVALID_USERID.String(), fmt.Sprintf(format, args...)) +} + +// 密码无效 +func IsInvalidPassword(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_INVALID_PASSWORD.String() && e.Code == 102 +} + +// 密码无效 +func ErrorInvalidPassword(format string, args ...interface{}) *errors.Error { + return errors.New(102, UserErrorReason_INVALID_PASSWORD.String(), fmt.Sprintf(format, args...)) +} + +// token过期 +func IsTokenExpired(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_TOKEN_EXPIRED.String() && e.Code == 103 +} + +// token过期 +func ErrorTokenExpired(format string, args ...interface{}) *errors.Error { + return errors.New(103, UserErrorReason_TOKEN_EXPIRED.String(), fmt.Sprintf(format, args...)) +} + +// token无效 +func IsInvalidToken(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_INVALID_TOKEN.String() && e.Code == 104 +} + +// token无效 +func ErrorInvalidToken(format string, args ...interface{}) *errors.Error { + return errors.New(104, UserErrorReason_INVALID_TOKEN.String(), fmt.Sprintf(format, args...)) +} + +// token不存在 +func IsTokenNotExist(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_TOKEN_NOT_EXIST.String() && e.Code == 105 +} + +// token不存在 +func ErrorTokenNotExist(format string, args ...interface{}) *errors.Error { + return errors.New(105, UserErrorReason_TOKEN_NOT_EXIST.String(), fmt.Sprintf(format, args...)) +} + +// 用户不存在 +func IsUserNotExist(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == UserErrorReason_USER_NOT_EXIST.String() && e.Code == 106 +} + +// 用户不存在 +func ErrorUserNotExist(format string, args ...interface{}) *errors.Error { + return errors.New(106, UserErrorReason_USER_NOT_EXIST.String(), fmt.Sprintf(format, args...)) +} diff --git a/orm/gorm/gen/api/go/user/service/v1/user_grpc.pb.go b/orm/gorm/gen/api/go/user/service/v1/user_grpc.pb.go new file mode 100644 index 0000000..be4646f --- /dev/null +++ b/orm/gorm/gen/api/go/user/service/v1/user_grpc.pb.go @@ -0,0 +1,269 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: user/service/v1/user.proto + +package v1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" + pagination "kratos-gorm-example/gen/api/go/common/pagination" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + UserService_ListUser_FullMethodName = "/user.service.v1.UserService/ListUser" + UserService_GetUser_FullMethodName = "/user.service.v1.UserService/GetUser" + UserService_CreateUser_FullMethodName = "/user.service.v1.UserService/CreateUser" + UserService_UpdateUser_FullMethodName = "/user.service.v1.UserService/UpdateUser" + UserService_DeleteUser_FullMethodName = "/user.service.v1.UserService/DeleteUser" +) + +// UserServiceClient is the client API for UserService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type UserServiceClient interface { + // 查询用户列表 + ListUser(ctx context.Context, in *pagination.PagingRequest, opts ...grpc.CallOption) (*ListUserResponse, error) + // 查询用户详情 + GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*User, error) + // 创建用户 + CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*User, error) + // 更新用户 + UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*User, error) + // 删除用户 + DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type userServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient { + return &userServiceClient{cc} +} + +func (c *userServiceClient) ListUser(ctx context.Context, in *pagination.PagingRequest, opts ...grpc.CallOption) (*ListUserResponse, error) { + out := new(ListUserResponse) + err := c.cc.Invoke(ctx, UserService_ListUser_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*User, error) { + out := new(User) + err := c.cc.Invoke(ctx, UserService_GetUser_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*User, error) { + out := new(User) + err := c.cc.Invoke(ctx, UserService_CreateUser_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*User, error) { + out := new(User) + err := c.cc.Invoke(ctx, UserService_UpdateUser_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, UserService_DeleteUser_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// UserServiceServer is the server API for UserService service. +// All implementations must embed UnimplementedUserServiceServer +// for forward compatibility +type UserServiceServer interface { + // 查询用户列表 + ListUser(context.Context, *pagination.PagingRequest) (*ListUserResponse, error) + // 查询用户详情 + GetUser(context.Context, *GetUserRequest) (*User, error) + // 创建用户 + CreateUser(context.Context, *CreateUserRequest) (*User, error) + // 更新用户 + UpdateUser(context.Context, *UpdateUserRequest) (*User, error) + // 删除用户 + DeleteUser(context.Context, *DeleteUserRequest) (*emptypb.Empty, error) + mustEmbedUnimplementedUserServiceServer() +} + +// UnimplementedUserServiceServer must be embedded to have forward compatible implementations. +type UnimplementedUserServiceServer struct { +} + +func (UnimplementedUserServiceServer) ListUser(context.Context, *pagination.PagingRequest) (*ListUserResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListUser not implemented") +} +func (UnimplementedUserServiceServer) GetUser(context.Context, *GetUserRequest) (*User, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented") +} +func (UnimplementedUserServiceServer) CreateUser(context.Context, *CreateUserRequest) (*User, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateUser not implemented") +} +func (UnimplementedUserServiceServer) UpdateUser(context.Context, *UpdateUserRequest) (*User, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateUser not implemented") +} +func (UnimplementedUserServiceServer) DeleteUser(context.Context, *DeleteUserRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteUser not implemented") +} +func (UnimplementedUserServiceServer) mustEmbedUnimplementedUserServiceServer() {} + +// UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to UserServiceServer will +// result in compilation errors. +type UnsafeUserServiceServer interface { + mustEmbedUnimplementedUserServiceServer() +} + +func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer) { + s.RegisterService(&UserService_ServiceDesc, srv) +} + +func _UserService_ListUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(pagination.PagingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).ListUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_ListUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).ListUser(ctx, req.(*pagination.PagingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).GetUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_GetUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).GetUser(ctx, req.(*GetUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).CreateUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_CreateUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).CreateUser(ctx, req.(*CreateUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_UpdateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).UpdateUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_UpdateUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).UpdateUser(ctx, req.(*UpdateUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_DeleteUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).DeleteUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_DeleteUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).DeleteUser(ctx, req.(*DeleteUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// UserService_ServiceDesc is the grpc.ServiceDesc for UserService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var UserService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "user.service.v1.UserService", + HandlerType: (*UserServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListUser", + Handler: _UserService_ListUser_Handler, + }, + { + MethodName: "GetUser", + Handler: _UserService_GetUser_Handler, + }, + { + MethodName: "CreateUser", + Handler: _UserService_CreateUser_Handler, + }, + { + MethodName: "UpdateUser", + Handler: _UserService_UpdateUser_Handler, + }, + { + MethodName: "DeleteUser", + Handler: _UserService_DeleteUser_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "user/service/v1/user.proto", +} diff --git a/orm/gorm/go.mod b/orm/gorm/go.mod new file mode 100644 index 0000000..a4ee56a --- /dev/null +++ b/orm/gorm/go.mod @@ -0,0 +1,203 @@ +module kratos-gorm-example + +go 1.20 + +require ( + github.com/go-chassis/sc-client v0.7.0 + github.com/go-kratos/aegis v0.2.0 + github.com/go-kratos/kratos/contrib/config/apollo/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/config/consul/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/config/etcd/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/config/kubernetes/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/config/nacos/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/log/aliyun/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/log/fluent/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/log/logrus/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/log/tencent/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/log/zap/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/registry/etcd/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/registry/eureka/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/registry/kubernetes/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/registry/nacos/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/registry/servicecomb/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/contrib/registry/zookeeper/v2 v2.0.0-20230519061918-96480c11ee42 + github.com/go-kratos/kratos/v2 v2.6.3 + github.com/go-redis/redis/extra/redisotel/v8 v8.11.5 + github.com/go-redis/redis/v8 v8.11.5 + github.com/go-zookeeper/zk v1.0.3 + github.com/google/gnostic v0.6.9 + github.com/google/subcommands v1.2.0 + github.com/google/wire v0.5.0 + github.com/gorilla/handlers v1.5.1 + github.com/hashicorp/consul/api v1.20.0 + github.com/minio/minio-go/v7 v7.0.53 + github.com/nacos-group/nacos-sdk-go v1.1.4 + github.com/olekukonko/tablewriter v0.0.5 + github.com/sirupsen/logrus v1.9.2 + github.com/spf13/cobra v1.7.0 + github.com/stretchr/testify v1.8.4 + github.com/tx7do/kratos-utils v0.0.0-20230523004815-97a553d22f52 + go.etcd.io/etcd/client/v3 v3.5.9 + go.opentelemetry.io/otel v1.16.0 + go.opentelemetry.io/otel/exporters/jaeger v1.16.0 + go.opentelemetry.io/otel/exporters/zipkin v1.16.0 + go.opentelemetry.io/otel/sdk v1.16.0 + go.uber.org/zap v1.24.0 + golang.org/x/tools v0.9.1 + google.golang.org/grpc v1.56.1 + google.golang.org/protobuf v1.31.0 + gopkg.in/natefinch/lumberjack.v2 v2.2.1 + gorm.io/driver/clickhouse v0.5.1 + gorm.io/driver/mysql v1.5.1 + gorm.io/driver/postgres v1.5.2 + gorm.io/driver/sqlite v1.5.2 + gorm.io/driver/sqlserver v1.5.1 + gorm.io/gorm v1.25.2 + k8s.io/client-go v0.27.2 +) + +require ( + github.com/ClickHouse/ch-go v0.53.0 // indirect + github.com/ClickHouse/clickhouse-go/v2 v2.8.3 // indirect + github.com/aliyun/alibaba-cloud-sdk-go v1.61.18 // indirect + github.com/aliyun/aliyun-log-go-sdk v0.1.44 // indirect + github.com/andybalholm/brotli v1.0.5 // indirect + github.com/apolloconfig/agollo/v4 v4.3.0 // indirect + github.com/armon/go-metrics v0.3.10 // indirect + github.com/buger/jsonparser v1.1.1 // indirect + github.com/cenkalti/backoff v2.2.1+incompatible // indirect + github.com/cenkalti/backoff/v4 v4.2.0 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/coreos/go-semver v0.3.0 // indirect + github.com/coreos/go-systemd/v22 v22.3.2 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/deckarep/golang-set v1.7.1 // indirect + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect + github.com/dustin/go-humanize v1.0.1 // indirect + github.com/emicklei/go-restful/v3 v3.9.0 // indirect + github.com/fatih/color v1.13.0 // indirect + github.com/felixge/httpsnoop v1.0.1 // indirect + github.com/fluent/fluent-logger-golang v1.9.0 // indirect + github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/go-chassis/cari v0.6.0 // indirect + github.com/go-chassis/foundation v0.4.0 // indirect + github.com/go-chassis/openlog v1.1.3 // indirect + github.com/go-errors/errors v1.0.1 // indirect + github.com/go-faster/city v1.0.1 // indirect + github.com/go-faster/errors v0.6.1 // indirect + github.com/go-kit/kit v0.10.0 // indirect + github.com/go-logfmt/logfmt v0.5.1 // indirect + github.com/go-logr/logr v1.2.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-ole/go-ole v1.2.6 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.1 // indirect + github.com/go-openapi/swag v0.22.3 // indirect + github.com/go-playground/form/v4 v4.2.1 // indirect + github.com/go-redis/redis/extra/rediscmd/v8 v8.11.5 // indirect + github.com/go-sql-driver/mysql v1.7.1 // indirect + github.com/gofrs/uuid v4.2.0+incompatible // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect + github.com/golang-sql/sqlexp v0.1.0 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/google/go-cmp v0.5.9 // indirect + github.com/google/gofuzz v1.2.0 // indirect + github.com/google/uuid v1.3.0 // indirect + github.com/gorilla/mux v1.8.0 // indirect + github.com/gorilla/websocket v1.5.0 // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect + github.com/hashicorp/go-hclog v1.2.0 // indirect + github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-rootcerts v1.0.2 // indirect + github.com/hashicorp/go-version v1.6.0 // indirect + github.com/hashicorp/golang-lru v0.5.4 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/serf v0.10.1 // indirect + github.com/imdario/mergo v0.3.15 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/jackc/pgpassfile v1.0.0 // indirect + github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect + github.com/jackc/pgx/v5 v5.3.1 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/jinzhu/now v1.1.5 // indirect + github.com/jmespath/go-jmespath v0.4.0 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/karlseguin/ccache/v2 v2.0.8 // indirect + github.com/klauspost/compress v1.16.5 // indirect + github.com/klauspost/cpuid/v2 v2.2.4 // indirect + github.com/lufia/plan9stats v0.0.0-20230110061619-bbe2e5e100de // indirect + github.com/magiconair/properties v1.8.6 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.17 // indirect + github.com/mattn/go-runewidth v0.0.9 // indirect + github.com/mattn/go-sqlite3 v1.14.17 // indirect + github.com/microsoft/go-mssqldb v1.1.0 // indirect + github.com/minio/md5-simd v1.1.2 // indirect + github.com/minio/sha256-simd v1.0.0 // indirect + github.com/mitchellh/go-homedir v1.1.0 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/openzipkin/zipkin-go v0.4.1 // indirect + github.com/patrickmn/go-cache v2.1.0+incompatible // indirect + github.com/paulmach/orb v0.9.0 // indirect + github.com/pelletier/go-toml v1.9.4 // indirect + github.com/pelletier/go-toml/v2 v2.0.0-beta.8 // indirect + github.com/philhofer/fwd v1.1.1 // indirect + github.com/pierrec/lz4 v2.6.1+incompatible // indirect + github.com/pierrec/lz4/v4 v4.1.17 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b // indirect + github.com/rs/xid v1.4.0 // indirect + github.com/segmentio/asm v1.2.0 // indirect + github.com/shirou/gopsutil/v3 v3.23.2 // indirect + github.com/shopspring/decimal v1.3.1 // indirect + github.com/spf13/afero v1.9.2 // indirect + github.com/spf13/cast v1.4.1 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/spf13/viper v1.11.0 // indirect + github.com/subosito/gotenv v1.2.0 // indirect + github.com/tencentcloud/tencentcloud-cls-sdk-go v1.0.2 // indirect + github.com/tinylib/msgp v1.1.6 // indirect + github.com/tklauser/go-sysconf v0.3.11 // indirect + github.com/tklauser/numcpus v0.6.0 // indirect + github.com/yusufpapurcu/wmi v1.2.2 // indirect + go.etcd.io/etcd/api/v3 v3.5.9 // indirect + go.etcd.io/etcd/client/pkg/v3 v3.5.9 // indirect + go.opentelemetry.io/otel/metric v1.16.0 // indirect + go.opentelemetry.io/otel/trace v1.16.0 // indirect + go.uber.org/atomic v1.11.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/crypto v0.10.0 // indirect + golang.org/x/mod v0.10.0 // indirect + golang.org/x/net v0.11.0 // indirect + golang.org/x/oauth2 v0.7.0 // indirect + golang.org/x/sync v0.3.0 // indirect + golang.org/x/sys v0.9.0 // indirect + golang.org/x/term v0.9.0 // indirect + golang.org/x/text v0.10.0 // indirect + golang.org/x/time v0.1.0 // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + k8s.io/api v0.27.2 // indirect + k8s.io/apimachinery v0.27.2 // indirect + k8s.io/klog/v2 v2.90.1 // indirect + k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect + k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect + sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect + sigs.k8s.io/yaml v1.3.0 // indirect +) diff --git a/orm/gorm/go.sum b/orm/gorm/go.sum new file mode 100644 index 0000000..b93ed39 --- /dev/null +++ b/orm/gorm/go.sum @@ -0,0 +1,2916 @@ +bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= +bazil.org/fuse v0.0.0-20200407214033-5883e5a4b512/go.mod h1:FbcW6z/2VytnFDhZfumh8Ss8zxHE6qpMP5sHTRe0EaM= +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= +cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= +cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= +cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= +cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= +cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= +cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= +cloud.google.com/go v0.100.1/go.mod h1:fs4QogzfH5n2pBXBP9vRiU+eCny7lD2vmFZy79Iuw1U= +cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= +cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= +cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= +cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= +cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= +cloud.google.com/go v0.107.0/go.mod h1:wpc2eNrD7hXUTy8EKS10jkxpZBjASrORK7goS+3YX2I= +cloud.google.com/go/accessapproval v1.4.0/go.mod h1:zybIuC3KpDOvotz59lFe5qxRZx6C75OtwbisN56xYB4= +cloud.google.com/go/accessapproval v1.5.0/go.mod h1:HFy3tuiGvMdcd/u+Cu5b9NkO1pEICJ46IR82PoUdplw= +cloud.google.com/go/accesscontextmanager v1.3.0/go.mod h1:TgCBehyr5gNMz7ZaH9xubp+CE8dkrszb4oK9CWyvD4o= +cloud.google.com/go/accesscontextmanager v1.4.0/go.mod h1:/Kjh7BBu/Gh83sv+K60vN9QE5NJcd80sU33vIe2IFPE= +cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= +cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= +cloud.google.com/go/aiplatform v1.27.0/go.mod h1:Bvxqtl40l0WImSb04d0hXFU7gDOiq9jQmorivIiWcKg= +cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= +cloud.google.com/go/analytics v0.12.0/go.mod h1:gkfj9h6XRf9+TS4bmuhPEShsh3hH8PAZzm/41OOhQd4= +cloud.google.com/go/apigateway v1.3.0/go.mod h1:89Z8Bhpmxu6AmUxuVRg/ECRGReEdiP3vQtk4Z1J9rJk= +cloud.google.com/go/apigateway v1.4.0/go.mod h1:pHVY9MKGaH9PQ3pJ4YLzoj6U5FUDeDFBllIz7WmzJoc= +cloud.google.com/go/apigeeconnect v1.3.0/go.mod h1:G/AwXFAKo0gIXkPTVfZDd2qA1TxBXJ3MgMRBQkIi9jc= +cloud.google.com/go/apigeeconnect v1.4.0/go.mod h1:kV4NwOKqjvt2JYR0AoIWo2QGfoRtn/pkS3QlHp0Ni04= +cloud.google.com/go/appengine v1.4.0/go.mod h1:CS2NhuBuDXM9f+qscZ6V86m1MIIqPj3WC/UoEuR1Sno= +cloud.google.com/go/appengine v1.5.0/go.mod h1:TfasSozdkFI0zeoxW3PTBLiNqRmzraodCWatWI9Dmak= +cloud.google.com/go/area120 v0.5.0/go.mod h1:DE/n4mp+iqVyvxHN41Vf1CR602GiHQjFPusMFW6bGR4= +cloud.google.com/go/area120 v0.6.0/go.mod h1:39yFJqWVgm0UZqWTOdqkLhjoC7uFfgXRC8g/ZegeAh0= +cloud.google.com/go/artifactregistry v1.6.0/go.mod h1:IYt0oBPSAGYj/kprzsBjZ/4LnG/zOcHyFHjWPCi6SAQ= +cloud.google.com/go/artifactregistry v1.7.0/go.mod h1:mqTOFOnGZx8EtSqK/ZWcsm/4U8B77rbcLP6ruDU2Ixk= +cloud.google.com/go/artifactregistry v1.8.0/go.mod h1:w3GQXkJX8hiKN0v+at4b0qotwijQbYUqF2GWkZzAhC0= +cloud.google.com/go/artifactregistry v1.9.0/go.mod h1:2K2RqvA2CYvAeARHRkLDhMDJ3OXy26h3XW+3/Jh2uYc= +cloud.google.com/go/asset v1.5.0/go.mod h1:5mfs8UvcM5wHhqtSv8J1CtxxaQq3AdBxxQi2jGW/K4o= +cloud.google.com/go/asset v1.7.0/go.mod h1:YbENsRK4+xTiL+Ofoj5Ckf+O17kJtgp3Y3nn4uzZz5s= +cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjbytpUaW0= +cloud.google.com/go/asset v1.9.0/go.mod h1:83MOE6jEJBMqFKadM9NLRcs80Gdw76qGuHn8m3h8oHQ= +cloud.google.com/go/asset v1.10.0/go.mod h1:pLz7uokL80qKhzKr4xXGvBQXnzHn5evJAEAtZiIb0wY= +cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= +cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= +cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= +cloud.google.com/go/assuredworkloads v1.8.0/go.mod h1:AsX2cqyNCOvEQC8RMPnoc0yEarXQk6WEKkxYfL6kGIo= +cloud.google.com/go/assuredworkloads v1.9.0/go.mod h1:kFuI1P78bplYtT77Tb1hi0FMxM0vVpRC7VVoJC3ZoT0= +cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= +cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= +cloud.google.com/go/automl v1.7.0/go.mod h1:RL9MYCCsJEOmt0Wf3z9uzG0a7adTT1fe+aObgSpkCt8= +cloud.google.com/go/automl v1.8.0/go.mod h1:xWx7G/aPEe/NP+qzYXktoBSDfjO+vnKMGgsApGJJquM= +cloud.google.com/go/baremetalsolution v0.3.0/go.mod h1:XOrocE+pvK1xFfleEnShBlNAXf+j5blPPxrhjKgnIFc= +cloud.google.com/go/baremetalsolution v0.4.0/go.mod h1:BymplhAadOO/eBa7KewQ0Ppg4A4Wplbn+PsFKRLo0uI= +cloud.google.com/go/batch v0.3.0/go.mod h1:TR18ZoAekj1GuirsUsR1ZTKN3FC/4UDnScjT8NXImFE= +cloud.google.com/go/batch v0.4.0/go.mod h1:WZkHnP43R/QCGQsZ+0JyG4i79ranE2u8xvjq/9+STPE= +cloud.google.com/go/beyondcorp v0.2.0/go.mod h1:TB7Bd+EEtcw9PCPQhCJtJGjk/7TC6ckmnSFS+xwTfm4= +cloud.google.com/go/beyondcorp v0.3.0/go.mod h1:E5U5lcrcXMsCuoDNyGrpyTm/hn7ne941Jz2vmksAxW8= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA= +cloud.google.com/go/bigquery v1.43.0/go.mod h1:ZMQcXHsl+xmU1z36G2jNGZmKp9zNY5BUua5wDgmNCfw= +cloud.google.com/go/bigquery v1.44.0/go.mod h1:0Y33VqXTEsbamHJvJHdFmtqHvMIY28aK1+dFsvaChGc= +cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY= +cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s= +cloud.google.com/go/billing v1.6.0/go.mod h1:WoXzguj+BeHXPbKfNWkqVtDdzORazmCjraY+vrxcyvI= +cloud.google.com/go/billing v1.7.0/go.mod h1:q457N3Hbj9lYwwRbnlD7vUpyjq6u5U1RAOArInEiD5Y= +cloud.google.com/go/binaryauthorization v1.1.0/go.mod h1:xwnoWu3Y84jbuHa0zd526MJYmtnVXn0syOjaJgy4+dM= +cloud.google.com/go/binaryauthorization v1.2.0/go.mod h1:86WKkJHtRcv5ViNABtYMhhNWRrD1Vpi//uKEy7aYEfI= +cloud.google.com/go/binaryauthorization v1.3.0/go.mod h1:lRZbKgjDIIQvzYQS1p99A7/U1JqvqeZg0wiI5tp6tg0= +cloud.google.com/go/binaryauthorization v1.4.0/go.mod h1:tsSPQrBd77VLplV70GUhBf/Zm3FsKmgSqgm4UmiDItk= +cloud.google.com/go/certificatemanager v1.3.0/go.mod h1:n6twGDvcUBFu9uBgt4eYvvf3sQ6My8jADcOVwHmzadg= +cloud.google.com/go/certificatemanager v1.4.0/go.mod h1:vowpercVFyqs8ABSmrdV+GiFf2H/ch3KyudYQEMM590= +cloud.google.com/go/channel v1.8.0/go.mod h1:W5SwCXDJsq/rg3tn3oG0LOxpAo6IMxNa09ngphpSlnk= +cloud.google.com/go/channel v1.9.0/go.mod h1:jcu05W0my9Vx4mt3/rEHpfxc9eKi9XwsdDL8yBMbKUk= +cloud.google.com/go/cloudbuild v1.3.0/go.mod h1:WequR4ULxlqvMsjDEEEFnOG5ZSRSgWOywXYDb1vPE6U= +cloud.google.com/go/cloudbuild v1.4.0/go.mod h1:5Qwa40LHiOXmz3386FrjrYM93rM/hdRr7b53sySrTqA= +cloud.google.com/go/clouddms v1.3.0/go.mod h1:oK6XsCDdW4Ib3jCCBugx+gVjevp2TMXFtgxvPSee3OM= +cloud.google.com/go/clouddms v1.4.0/go.mod h1:Eh7sUGCC+aKry14O1NRljhjyrr0NFC0G2cjwX0cByRk= +cloud.google.com/go/cloudtasks v1.5.0/go.mod h1:fD92REy1x5woxkKEkLdvavGnPJGEn8Uic9nWuLzqCpY= +cloud.google.com/go/cloudtasks v1.6.0/go.mod h1:C6Io+sxuke9/KNRkbQpihnW93SWDU3uXt92nu85HkYI= +cloud.google.com/go/cloudtasks v1.7.0/go.mod h1:ImsfdYWwlWNJbdgPIIGJWC+gemEGTBK/SunNQQNCAb4= +cloud.google.com/go/cloudtasks v1.8.0/go.mod h1:gQXUIwCSOI4yPVK7DgTVFiiP0ZW/eQkydWzwVMdHxrI= +cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= +cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= +cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= +cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= +cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= +cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= +cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= +cloud.google.com/go/compute v1.12.0/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= +cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= +cloud.google.com/go/compute v1.13.0/go.mod h1:5aPTS0cUNMIc1CE546K+Th6weJUNQErARyZtRXDJ8GE= +cloud.google.com/go/compute v1.14.0/go.mod h1:YfLtxrj9sU4Yxv+sXzZkyPjEyPBZfXHUvjxega5vAdo= +cloud.google.com/go/compute v1.15.1/go.mod h1:bjjoF/NtFUrkD/urWfdHaKuOPDR5nWIs63rR+SXhcpA= +cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU= +cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +cloud.google.com/go/contactcenterinsights v1.3.0/go.mod h1:Eu2oemoePuEFc/xKFPjbTuPSj0fYJcPls9TFlPNnHHY= +cloud.google.com/go/contactcenterinsights v1.4.0/go.mod h1:L2YzkGbPsv+vMQMCADxJoT9YiTTnSEd6fEvCeHTYVck= +cloud.google.com/go/container v1.6.0/go.mod h1:Xazp7GjJSeUYo688S+6J5V+n/t+G5sKBTFkKNudGRxg= +cloud.google.com/go/container v1.7.0/go.mod h1:Dp5AHtmothHGX3DwwIHPgq45Y8KmNsgN3amoYfxVkLo= +cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= +cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= +cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= +cloud.google.com/go/datacatalog v1.5.0/go.mod h1:M7GPLNQeLfWqeIm3iuiruhPzkt65+Bx8dAKvScX8jvs= +cloud.google.com/go/datacatalog v1.6.0/go.mod h1:+aEyF8JKg+uXcIdAmmaMUmZ3q1b/lKLtXCmXdnc0lbc= +cloud.google.com/go/datacatalog v1.7.0/go.mod h1:9mEl4AuDYWw81UGc41HonIHH7/sn52H0/tc8f8ZbZIE= +cloud.google.com/go/datacatalog v1.8.0/go.mod h1:KYuoVOv9BM8EYz/4eMFxrr4DUKhGIOXxZoKYF5wdISM= +cloud.google.com/go/dataflow v0.6.0/go.mod h1:9QwV89cGoxjjSR9/r7eFDqqjtvbKxAK2BaYU6PVk9UM= +cloud.google.com/go/dataflow v0.7.0/go.mod h1:PX526vb4ijFMesO1o202EaUmouZKBpjHsTlCtB4parQ= +cloud.google.com/go/dataform v0.3.0/go.mod h1:cj8uNliRlHpa6L3yVhDOBrUXH+BPAO1+KFMQQNSThKo= +cloud.google.com/go/dataform v0.4.0/go.mod h1:fwV6Y4Ty2yIFL89huYlEkwUPtS7YZinZbzzj5S9FzCE= +cloud.google.com/go/dataform v0.5.0/go.mod h1:GFUYRe8IBa2hcomWplodVmUx/iTL0FrsauObOM3Ipr0= +cloud.google.com/go/datafusion v1.4.0/go.mod h1:1Zb6VN+W6ALo85cXnM1IKiPw+yQMKMhB9TsTSRDo/38= +cloud.google.com/go/datafusion v1.5.0/go.mod h1:Kz+l1FGHB0J+4XF2fud96WMmRiq/wj8N9u007vyXZ2w= +cloud.google.com/go/datalabeling v0.5.0/go.mod h1:TGcJ0G2NzcsXSE/97yWjIZO0bXj0KbVlINXMG9ud42I= +cloud.google.com/go/datalabeling v0.6.0/go.mod h1:WqdISuk/+WIGeMkpw/1q7bK/tFEZxsrFJOJdY2bXvTQ= +cloud.google.com/go/dataplex v1.3.0/go.mod h1:hQuRtDg+fCiFgC8j0zV222HvzFQdRd+SVX8gdmFcZzA= +cloud.google.com/go/dataplex v1.4.0/go.mod h1:X51GfLXEMVJ6UN47ESVqvlsRplbLhcsAt0kZCCKsU0A= +cloud.google.com/go/dataproc v1.7.0/go.mod h1:CKAlMjII9H90RXaMpSxQ8EU6dQx6iAYNPcYPOkSbi8s= +cloud.google.com/go/dataproc v1.8.0/go.mod h1:5OW+zNAH0pMpw14JVrPONsxMQYMBqJuzORhIBfBn9uI= +cloud.google.com/go/dataqna v0.5.0/go.mod h1:90Hyk596ft3zUQ8NkFfvICSIfHFh1Bc7C4cK3vbhkeo= +cloud.google.com/go/dataqna v0.6.0/go.mod h1:1lqNpM7rqNLVgWBJyk5NF6Uen2PHym0jtVJonplVsDA= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/datastore v1.10.0/go.mod h1:PC5UzAmDEkAmkfaknstTYbNpgE49HAgW2J1gcgUfmdM= +cloud.google.com/go/datastream v1.2.0/go.mod h1:i/uTP8/fZwgATHS/XFu0TcNUhuA0twZxxQ3EyCUQMwo= +cloud.google.com/go/datastream v1.3.0/go.mod h1:cqlOX8xlyYF/uxhiKn6Hbv6WjwPPuI9W2M9SAXwaLLQ= +cloud.google.com/go/datastream v1.4.0/go.mod h1:h9dpzScPhDTs5noEMQVWP8Wx8AFBRyS0s8KWPx/9r0g= +cloud.google.com/go/datastream v1.5.0/go.mod h1:6TZMMNPwjUqZHBKPQ1wwXpb0d5VDVPl2/XoS5yi88q4= +cloud.google.com/go/deploy v1.4.0/go.mod h1:5Xghikd4VrmMLNaF6FiRFDlHb59VM59YoDQnOUdsH/c= +cloud.google.com/go/deploy v1.5.0/go.mod h1:ffgdD0B89tToyW/U/D2eL0jN2+IEV/3EMuXHA0l4r+s= +cloud.google.com/go/dialogflow v1.15.0/go.mod h1:HbHDWs33WOGJgn6rfzBW1Kv807BE3O1+xGbn59zZWI4= +cloud.google.com/go/dialogflow v1.16.1/go.mod h1:po6LlzGfK+smoSmTBnbkIZY2w8ffjz/RcGSS+sh1el0= +cloud.google.com/go/dialogflow v1.17.0/go.mod h1:YNP09C/kXA1aZdBgC/VtXX74G/TKn7XVCcVumTflA+8= +cloud.google.com/go/dialogflow v1.18.0/go.mod h1:trO7Zu5YdyEuR+BhSNOqJezyFQ3aUzz0njv7sMx/iek= +cloud.google.com/go/dialogflow v1.19.0/go.mod h1:JVmlG1TwykZDtxtTXujec4tQ+D8SBFMoosgy+6Gn0s0= +cloud.google.com/go/dlp v1.6.0/go.mod h1:9eyB2xIhpU0sVwUixfBubDoRwP+GjeUoxxeueZmqvmM= +cloud.google.com/go/dlp v1.7.0/go.mod h1:68ak9vCiMBjbasxeVD17hVPxDEck+ExiHavX8kiHG+Q= +cloud.google.com/go/documentai v1.7.0/go.mod h1:lJvftZB5NRiFSX4moiye1SMxHx0Bc3x1+p9e/RfXYiU= +cloud.google.com/go/documentai v1.8.0/go.mod h1:xGHNEB7CtsnySCNrCFdCyyMz44RhFEEX2Q7UD0c5IhU= +cloud.google.com/go/documentai v1.9.0/go.mod h1:FS5485S8R00U10GhgBC0aNGrJxBP8ZVpEeJ7PQDZd6k= +cloud.google.com/go/documentai v1.10.0/go.mod h1:vod47hKQIPeCfN2QS/jULIvQTugbmdc0ZvxxfQY1bg4= +cloud.google.com/go/domains v0.6.0/go.mod h1:T9Rz3GasrpYk6mEGHh4rymIhjlnIuB4ofT1wTxDeT4Y= +cloud.google.com/go/domains v0.7.0/go.mod h1:PtZeqS1xjnXuRPKE/88Iru/LdfoRyEHYA9nFQf4UKpg= +cloud.google.com/go/edgecontainer v0.1.0/go.mod h1:WgkZ9tp10bFxqO8BLPqv2LlfmQF1X8lZqwW4r1BTajk= +cloud.google.com/go/edgecontainer v0.2.0/go.mod h1:RTmLijy+lGpQ7BXuTDa4C4ssxyXT34NIuHIgKuP4s5w= +cloud.google.com/go/errorreporting v0.3.0/go.mod h1:xsP2yaAp+OAW4OIm60An2bbLpqIhKXdWR/tawvl7QzU= +cloud.google.com/go/essentialcontacts v1.3.0/go.mod h1:r+OnHa5jfj90qIfZDO/VztSFqbQan7HV75p8sA+mdGI= +cloud.google.com/go/essentialcontacts v1.4.0/go.mod h1:8tRldvHYsmnBCHdFpvU+GL75oWiBKl80BiqlFh9tp+8= +cloud.google.com/go/eventarc v1.7.0/go.mod h1:6ctpF3zTnaQCxUjHUdcfgcA1A2T309+omHZth7gDfmc= +cloud.google.com/go/eventarc v1.8.0/go.mod h1:imbzxkyAU4ubfsaKYdQg04WS1NvncblHEup4kvF+4gw= +cloud.google.com/go/filestore v1.3.0/go.mod h1:+qbvHGvXU1HaKX2nD0WEPo92TP/8AQuCVEBXNY9z0+w= +cloud.google.com/go/filestore v1.4.0/go.mod h1:PaG5oDfo9r224f8OYXURtAsY+Fbyq/bLYoINEK8XQAI= +cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= +cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= +cloud.google.com/go/firestore v1.9.0/go.mod h1:HMkjKHNTtRyZNiMzu7YAsLr9K3X2udY2AMwDaMEQiiE= +cloud.google.com/go/functions v1.6.0/go.mod h1:3H1UA3qiIPRWD7PeZKLvHZ9SaQhR26XIJcC0A5GbvAk= +cloud.google.com/go/functions v1.7.0/go.mod h1:+d+QBcWM+RsrgZfV9xo6KfA1GlzJfxcfZcRPEhDDfzg= +cloud.google.com/go/functions v1.8.0/go.mod h1:RTZ4/HsQjIqIYP9a9YPbU+QFoQsAlYgrwOXJWHn1POY= +cloud.google.com/go/functions v1.9.0/go.mod h1:Y+Dz8yGguzO3PpIjhLTbnqV1CWmgQ5UwtlpzoyquQ08= +cloud.google.com/go/gaming v1.5.0/go.mod h1:ol7rGcxP/qHTRQE/RO4bxkXq+Fix0j6D4LFPzYTIrDM= +cloud.google.com/go/gaming v1.6.0/go.mod h1:YMU1GEvA39Qt3zWGyAVA9bpYz/yAhTvaQ1t2sK4KPUA= +cloud.google.com/go/gaming v1.7.0/go.mod h1:LrB8U7MHdGgFG851iHAfqUdLcKBdQ55hzXy9xBJz0+w= +cloud.google.com/go/gaming v1.8.0/go.mod h1:xAqjS8b7jAVW0KFYeRUxngo9My3f33kFmua++Pi+ggM= +cloud.google.com/go/gkebackup v0.2.0/go.mod h1:XKvv/4LfG829/B8B7xRkk8zRrOEbKtEam6yNfuQNH60= +cloud.google.com/go/gkebackup v0.3.0/go.mod h1:n/E671i1aOQvUxT541aTkCwExO/bTer2HDlj4TsBRAo= +cloud.google.com/go/gkeconnect v0.5.0/go.mod h1:c5lsNAg5EwAy7fkqX/+goqFsU1Da/jQFqArp+wGNr/o= +cloud.google.com/go/gkeconnect v0.6.0/go.mod h1:Mln67KyU/sHJEBY8kFZ0xTeyPtzbq9StAVvEULYK16A= +cloud.google.com/go/gkehub v0.9.0/go.mod h1:WYHN6WG8w9bXU0hqNxt8rm5uxnk8IH+lPY9J2TV7BK0= +cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y977wO+hBH0= +cloud.google.com/go/gkemulticloud v0.3.0/go.mod h1:7orzy7O0S+5kq95e4Hpn7RysVA7dPs8W/GgfUtsPbrA= +cloud.google.com/go/gkemulticloud v0.4.0/go.mod h1:E9gxVBnseLWCk24ch+P9+B2CoDFJZTyIgLKSalC7tuI= +cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= +cloud.google.com/go/gsuiteaddons v1.3.0/go.mod h1:EUNK/J1lZEZO8yPtykKxLXI6JSVN2rg9bN8SXOa0bgM= +cloud.google.com/go/gsuiteaddons v1.4.0/go.mod h1:rZK5I8hht7u7HxFQcFei0+AtfS9uSushomRlg+3ua1o= +cloud.google.com/go/iam v0.1.0/go.mod h1:vcUNEa0pEm0qRVpmWepWaFMIAI8/hjB9mO8rNCJtF6c= +cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= +cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= +cloud.google.com/go/iam v0.6.0/go.mod h1:+1AH33ueBne5MzYccyMHtEKqLE4/kJOibtffMHDMFMc= +cloud.google.com/go/iam v0.7.0/go.mod h1:H5Br8wRaDGNc8XP3keLc4unfUUZeyH3Sfl9XpQEYOeg= +cloud.google.com/go/iam v0.8.0/go.mod h1:lga0/y3iH6CX7sYqypWJ33hf7kkfXJag67naqGESjkE= +cloud.google.com/go/iap v1.4.0/go.mod h1:RGFwRJdihTINIe4wZ2iCP0zF/qu18ZwyKxrhMhygBEc= +cloud.google.com/go/iap v1.5.0/go.mod h1:UH/CGgKd4KyohZL5Pt0jSKE4m3FR51qg6FKQ/z/Ix9A= +cloud.google.com/go/ids v1.1.0/go.mod h1:WIuwCaYVOzHIj2OhN9HAwvW+DBdmUAdcWlFxRl+KubM= +cloud.google.com/go/ids v1.2.0/go.mod h1:5WXvp4n25S0rA/mQWAg1YEEBBq6/s+7ml1RDCW1IrcY= +cloud.google.com/go/iot v1.3.0/go.mod h1:r7RGh2B61+B8oz0AGE+J72AhA0G7tdXItODWsaA2oLs= +cloud.google.com/go/iot v1.4.0/go.mod h1:dIDxPOn0UvNDUMD8Ger7FIaTuvMkj+aGk94RPP0iV+g= +cloud.google.com/go/kms v1.4.0/go.mod h1:fajBHndQ+6ubNw6Ss2sSd+SWvjL26RNo/dr7uxsnnOA= +cloud.google.com/go/kms v1.5.0/go.mod h1:QJS2YY0eJGBg3mnDfuaCyLauWwBJiHRboYxJ++1xJNg= +cloud.google.com/go/kms v1.6.0/go.mod h1:Jjy850yySiasBUDi6KFUwUv2n1+o7QZFyuUJg6OgjA0= +cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= +cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= +cloud.google.com/go/language v1.7.0/go.mod h1:DJ6dYN/W+SQOjF8e1hLQXMF21AkH2w9wiPzPCJa2MIE= +cloud.google.com/go/language v1.8.0/go.mod h1:qYPVHf7SPoNNiCL2Dr0FfEFNil1qi3pQEyygwpgVKB8= +cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= +cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= +cloud.google.com/go/logging v1.6.1/go.mod h1:5ZO0mHHbvm8gEmeEUHrmDlTDSu5imF6MUP9OfilNXBw= +cloud.google.com/go/longrunning v0.1.1/go.mod h1:UUFxuDWkv22EuY93jjmDMFT5GPQKeFVJBIF6QlTqdsE= +cloud.google.com/go/longrunning v0.3.0/go.mod h1:qth9Y41RRSUE69rDcOn6DdK3HfQfsUI0YSmW3iIlLJc= +cloud.google.com/go/managedidentities v1.3.0/go.mod h1:UzlW3cBOiPrzucO5qWkNkh0w33KFtBJU281hacNvsdE= +cloud.google.com/go/managedidentities v1.4.0/go.mod h1:NWSBYbEMgqmbZsLIyKvxrYbtqOsxY1ZrGM+9RgDqInM= +cloud.google.com/go/maps v0.1.0/go.mod h1:BQM97WGyfw9FWEmQMpZ5T6cpovXXSd1cGmFma94eubI= +cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= +cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= +cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= +cloud.google.com/go/memcache v1.5.0/go.mod h1:dk3fCK7dVo0cUU2c36jKb4VqKPS22BTkf81Xq617aWM= +cloud.google.com/go/memcache v1.6.0/go.mod h1:XS5xB0eQZdHtTuTF9Hf8eJkKtR3pVRCcvJwtm68T3rA= +cloud.google.com/go/memcache v1.7.0/go.mod h1:ywMKfjWhNtkQTxrWxCkCFkoPjLHPW6A7WOTVI8xy3LY= +cloud.google.com/go/metastore v1.5.0/go.mod h1:2ZNrDcQwghfdtCwJ33nM0+GrBGlVuh8rakL3vdPY3XY= +cloud.google.com/go/metastore v1.6.0/go.mod h1:6cyQTls8CWXzk45G55x57DVQ9gWg7RiH65+YgPsNh9s= +cloud.google.com/go/metastore v1.7.0/go.mod h1:s45D0B4IlsINu87/AsWiEVYbLaIMeUSoxlKKDqBGFS8= +cloud.google.com/go/metastore v1.8.0/go.mod h1:zHiMc4ZUpBiM7twCIFQmJ9JMEkDSyZS9U12uf7wHqSI= +cloud.google.com/go/monitoring v1.7.0/go.mod h1:HpYse6kkGo//7p6sT0wsIC6IBDET0RhIsnmlA53dvEk= +cloud.google.com/go/monitoring v1.8.0/go.mod h1:E7PtoMJ1kQXWxPjB6mv2fhC5/15jInuulFdYYtlcvT4= +cloud.google.com/go/networkconnectivity v1.4.0/go.mod h1:nOl7YL8odKyAOtzNX73/M5/mGZgqqMeryi6UPZTk/rA= +cloud.google.com/go/networkconnectivity v1.5.0/go.mod h1:3GzqJx7uhtlM3kln0+x5wyFvuVH1pIBJjhCpjzSt75o= +cloud.google.com/go/networkconnectivity v1.6.0/go.mod h1:OJOoEXW+0LAxHh89nXd64uGG+FbQoeH8DtxCHVOMlaM= +cloud.google.com/go/networkconnectivity v1.7.0/go.mod h1:RMuSbkdbPwNMQjB5HBWD5MpTBnNm39iAVpC3TmsExt8= +cloud.google.com/go/networkmanagement v1.4.0/go.mod h1:Q9mdLLRn60AsOrPc8rs8iNV6OHXaGcDdsIQe1ohekq8= +cloud.google.com/go/networkmanagement v1.5.0/go.mod h1:ZnOeZ/evzUdUsnvRt792H0uYEnHQEMaz+REhhzJRcf4= +cloud.google.com/go/networksecurity v0.5.0/go.mod h1:xS6fOCoqpVC5zx15Z/MqkfDwH4+m/61A3ODiDV1xmiQ= +cloud.google.com/go/networksecurity v0.6.0/go.mod h1:Q5fjhTr9WMI5mbpRYEbiexTzROf7ZbDzvzCrNl14nyU= +cloud.google.com/go/notebooks v1.2.0/go.mod h1:9+wtppMfVPUeJ8fIWPOq1UnATHISkGXGqTkxeieQ6UY= +cloud.google.com/go/notebooks v1.3.0/go.mod h1:bFR5lj07DtCPC7YAAJ//vHskFBxA5JzYlH68kXVdk34= +cloud.google.com/go/notebooks v1.4.0/go.mod h1:4QPMngcwmgb6uw7Po99B2xv5ufVoIQ7nOGDyL4P8AgA= +cloud.google.com/go/notebooks v1.5.0/go.mod h1:q8mwhnP9aR8Hpfnrc5iN5IBhrXUy8S2vuYs+kBJ/gu0= +cloud.google.com/go/optimization v1.1.0/go.mod h1:5po+wfvX5AQlPznyVEZjGJTMr4+CAkJf2XSTQOOl9l4= +cloud.google.com/go/optimization v1.2.0/go.mod h1:Lr7SOHdRDENsh+WXVmQhQTrzdu9ybg0NecjHidBq6xs= +cloud.google.com/go/orchestration v1.3.0/go.mod h1:Sj5tq/JpWiB//X/q3Ngwdl5K7B7Y0KZ7bfv0wL6fqVA= +cloud.google.com/go/orchestration v1.4.0/go.mod h1:6W5NLFWs2TlniBphAViZEVhrXRSMgUGDfW7vrWKvsBk= +cloud.google.com/go/orgpolicy v1.4.0/go.mod h1:xrSLIV4RePWmP9P3tBl8S93lTmlAxjm06NSm2UTmKvE= +cloud.google.com/go/orgpolicy v1.5.0/go.mod h1:hZEc5q3wzwXJaKrsx5+Ewg0u1LxJ51nNFlext7Tanwc= +cloud.google.com/go/osconfig v1.7.0/go.mod h1:oVHeCeZELfJP7XLxcBGTMBvRO+1nQ5tFG9VQTmYS2Fs= +cloud.google.com/go/osconfig v1.8.0/go.mod h1:EQqZLu5w5XA7eKizepumcvWx+m8mJUhEwiPqWiZeEdg= +cloud.google.com/go/osconfig v1.9.0/go.mod h1:Yx+IeIZJ3bdWmzbQU4fxNl8xsZ4amB+dygAwFPlvnNo= +cloud.google.com/go/osconfig v1.10.0/go.mod h1:uMhCzqC5I8zfD9zDEAfvgVhDS8oIjySWh+l4WK6GnWw= +cloud.google.com/go/oslogin v1.4.0/go.mod h1:YdgMXWRaElXz/lDk1Na6Fh5orF7gvmJ0FGLIs9LId4E= +cloud.google.com/go/oslogin v1.5.0/go.mod h1:D260Qj11W2qx/HVF29zBg+0fd6YCSjSqLUkY/qEenQU= +cloud.google.com/go/oslogin v1.6.0/go.mod h1:zOJ1O3+dTU8WPlGEkFSh7qeHPPSoxrcMbbK1Nm2iX70= +cloud.google.com/go/oslogin v1.7.0/go.mod h1:e04SN0xO1UNJ1M5GP0vzVBFicIe4O53FOfcixIqTyXo= +cloud.google.com/go/phishingprotection v0.5.0/go.mod h1:Y3HZknsK9bc9dMi+oE8Bim0lczMU6hrX0UpADuMefr0= +cloud.google.com/go/phishingprotection v0.6.0/go.mod h1:9Y3LBLgy0kDTcYET8ZH3bq/7qni15yVUoAxiFxnlSUA= +cloud.google.com/go/policytroubleshooter v1.3.0/go.mod h1:qy0+VwANja+kKrjlQuOzmlvscn4RNsAc0e15GGqfMxg= +cloud.google.com/go/policytroubleshooter v1.4.0/go.mod h1:DZT4BcRw3QoO8ota9xw/LKtPa8lKeCByYeKTIf/vxdE= +cloud.google.com/go/privatecatalog v0.5.0/go.mod h1:XgosMUvvPyxDjAVNDYxJ7wBW8//hLDDYmnsNcMGq1K0= +cloud.google.com/go/privatecatalog v0.6.0/go.mod h1:i/fbkZR0hLN29eEWiiwue8Pb+GforiEIBnV9yrRUOKI= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/pubsub v1.26.0/go.mod h1:QgBH3U/jdJy/ftjPhTkyXNj543Tin1pRYcdcPRnFIRI= +cloud.google.com/go/pubsub v1.27.1/go.mod h1:hQN39ymbV9geqBnfQq6Xf63yNhUAhv9CZhzp5O6qsW0= +cloud.google.com/go/pubsublite v1.5.0/go.mod h1:xapqNQ1CuLfGi23Yda/9l4bBCKz/wC3KIJ5gKcxveZg= +cloud.google.com/go/recaptchaenterprise v1.3.1/go.mod h1:OdD+q+y4XGeAlxRaMn1Y7/GveP6zmq76byL6tjPE7d4= +cloud.google.com/go/recaptchaenterprise/v2 v2.1.0/go.mod h1:w9yVqajwroDNTfGuhmOjPDN//rZGySaf6PtFVcSCa7o= +cloud.google.com/go/recaptchaenterprise/v2 v2.2.0/go.mod h1:/Zu5jisWGeERrd5HnlS3EUGb/D335f9k51B/FVil0jk= +cloud.google.com/go/recaptchaenterprise/v2 v2.3.0/go.mod h1:O9LwGCjrhGHBQET5CA7dd5NwwNQUErSgEDit1DLNTdo= +cloud.google.com/go/recaptchaenterprise/v2 v2.4.0/go.mod h1:Am3LHfOuBstrLrNCBrlI5sbwx9LBg3te2N6hGvHn2mE= +cloud.google.com/go/recaptchaenterprise/v2 v2.5.0/go.mod h1:O8LzcHXN3rz0j+LBC91jrwI3R+1ZSZEWrfL7XHgNo9U= +cloud.google.com/go/recommendationengine v0.5.0/go.mod h1:E5756pJcVFeVgaQv3WNpImkFP8a+RptV6dDLGPILjvg= +cloud.google.com/go/recommendationengine v0.6.0/go.mod h1:08mq2umu9oIqc7tDy8sx+MNJdLG0fUi3vaSVbztHgJ4= +cloud.google.com/go/recommender v1.5.0/go.mod h1:jdoeiBIVrJe9gQjwd759ecLJbxCDED4A6p+mqoqDvTg= +cloud.google.com/go/recommender v1.6.0/go.mod h1:+yETpm25mcoiECKh9DEScGzIRyDKpZ0cEhWGo+8bo+c= +cloud.google.com/go/recommender v1.7.0/go.mod h1:XLHs/W+T8olwlGOgfQenXBTbIseGclClff6lhFVe9Bs= +cloud.google.com/go/recommender v1.8.0/go.mod h1:PkjXrTT05BFKwxaUxQmtIlrtj0kph108r02ZZQ5FE70= +cloud.google.com/go/redis v1.7.0/go.mod h1:V3x5Jq1jzUcg+UNsRvdmsfuFnit1cfe3Z/PGyq/lm4Y= +cloud.google.com/go/redis v1.8.0/go.mod h1:Fm2szCDavWzBk2cDKxrkmWBqoCiL1+Ctwq7EyqBCA/A= +cloud.google.com/go/redis v1.9.0/go.mod h1:HMYQuajvb2D0LvMgZmLDZW8V5aOC/WxstZHiy4g8OiA= +cloud.google.com/go/redis v1.10.0/go.mod h1:ThJf3mMBQtW18JzGgh41/Wld6vnDDc/F/F35UolRZPM= +cloud.google.com/go/resourcemanager v1.3.0/go.mod h1:bAtrTjZQFJkiWTPDb1WBjzvc6/kifjj4QBYuKCCoqKA= +cloud.google.com/go/resourcemanager v1.4.0/go.mod h1:MwxuzkumyTX7/a3n37gmsT3py7LIXwrShilPh3P1tR0= +cloud.google.com/go/resourcesettings v1.3.0/go.mod h1:lzew8VfESA5DQ8gdlHwMrqZs1S9V87v3oCnKCWoOuQU= +cloud.google.com/go/resourcesettings v1.4.0/go.mod h1:ldiH9IJpcrlC3VSuCGvjR5of/ezRrOxFtpJoJo5SmXg= +cloud.google.com/go/retail v1.8.0/go.mod h1:QblKS8waDmNUhghY2TI9O3JLlFk8jybHeV4BF19FrE4= +cloud.google.com/go/retail v1.9.0/go.mod h1:g6jb6mKuCS1QKnH/dpu7isX253absFl6iE92nHwlBUY= +cloud.google.com/go/retail v1.10.0/go.mod h1:2gDk9HsL4HMS4oZwz6daui2/jmKvqShXKQuB2RZ+cCc= +cloud.google.com/go/retail v1.11.0/go.mod h1:MBLk1NaWPmh6iVFSz9MeKG/Psyd7TAgm6y/9L2B4x9Y= +cloud.google.com/go/run v0.2.0/go.mod h1:CNtKsTA1sDcnqqIFR3Pb5Tq0usWxJJvsWOCPldRU3Do= +cloud.google.com/go/run v0.3.0/go.mod h1:TuyY1+taHxTjrD0ZFk2iAR+xyOXEA0ztb7U3UNA0zBo= +cloud.google.com/go/scheduler v1.4.0/go.mod h1:drcJBmxF3aqZJRhmkHQ9b3uSSpQoltBPGPxGAWROx6s= +cloud.google.com/go/scheduler v1.5.0/go.mod h1:ri073ym49NW3AfT6DZi21vLZrG07GXr5p3H1KxN5QlI= +cloud.google.com/go/scheduler v1.6.0/go.mod h1:SgeKVM7MIwPn3BqtcBntpLyrIJftQISRrYB5ZtT+KOk= +cloud.google.com/go/scheduler v1.7.0/go.mod h1:jyCiBqWW956uBjjPMMuX09n3x37mtyPJegEWKxRsn44= +cloud.google.com/go/secretmanager v1.6.0/go.mod h1:awVa/OXF6IiyaU1wQ34inzQNc4ISIDIrId8qE5QGgKA= +cloud.google.com/go/secretmanager v1.8.0/go.mod h1:hnVgi/bN5MYHd3Gt0SPuTPPp5ENina1/LxM+2W9U9J4= +cloud.google.com/go/secretmanager v1.9.0/go.mod h1:b71qH2l1yHmWQHt9LC80akm86mX8AL6X1MA01dW8ht4= +cloud.google.com/go/security v1.5.0/go.mod h1:lgxGdyOKKjHL4YG3/YwIL2zLqMFCKs0UbQwgyZmfJl4= +cloud.google.com/go/security v1.7.0/go.mod h1:mZklORHl6Bg7CNnnjLH//0UlAlaXqiG7Lb9PsPXLfD0= +cloud.google.com/go/security v1.8.0/go.mod h1:hAQOwgmaHhztFhiQ41CjDODdWP0+AE1B3sX4OFlq+GU= +cloud.google.com/go/security v1.9.0/go.mod h1:6Ta1bO8LXI89nZnmnsZGp9lVoVWXqsVbIq/t9dzI+2Q= +cloud.google.com/go/security v1.10.0/go.mod h1:QtOMZByJVlibUT2h9afNDWRZ1G96gVywH8T5GUSb9IA= +cloud.google.com/go/securitycenter v1.13.0/go.mod h1:cv5qNAqjY84FCN6Y9z28WlkKXyWsgLO832YiWwkCWcU= +cloud.google.com/go/securitycenter v1.14.0/go.mod h1:gZLAhtyKv85n52XYWt6RmeBdydyxfPeTrpToDPw4Auc= +cloud.google.com/go/securitycenter v1.15.0/go.mod h1:PeKJ0t8MoFmmXLXWm41JidyzI3PJjd8sXWaVqg43WWk= +cloud.google.com/go/securitycenter v1.16.0/go.mod h1:Q9GMaLQFUD+5ZTabrbujNWLtSLZIZF7SAR0wWECrjdk= +cloud.google.com/go/servicecontrol v1.4.0/go.mod h1:o0hUSJ1TXJAmi/7fLJAedOovnujSEvjKCAFNXPQ1RaU= +cloud.google.com/go/servicecontrol v1.5.0/go.mod h1:qM0CnXHhyqKVuiZnGKrIurvVImCs8gmqWsDoqe9sU1s= +cloud.google.com/go/servicedirectory v1.4.0/go.mod h1:gH1MUaZCgtP7qQiI+F+A+OpeKF/HQWgtAddhTbhL2bs= +cloud.google.com/go/servicedirectory v1.5.0/go.mod h1:QMKFL0NUySbpZJ1UZs3oFAmdvVxhhxB6eJ/Vlp73dfg= +cloud.google.com/go/servicedirectory v1.6.0/go.mod h1:pUlbnWsLH9c13yGkxCmfumWEPjsRs1RlmJ4pqiNjVL4= +cloud.google.com/go/servicedirectory v1.7.0/go.mod h1:5p/U5oyvgYGYejufvxhgwjL8UVXjkuw7q5XcG10wx1U= +cloud.google.com/go/servicemanagement v1.4.0/go.mod h1:d8t8MDbezI7Z2R1O/wu8oTggo3BI2GKYbdG4y/SJTco= +cloud.google.com/go/servicemanagement v1.5.0/go.mod h1:XGaCRe57kfqu4+lRxaFEAuqmjzF0r+gWHjWqKqBvKFo= +cloud.google.com/go/serviceusage v1.3.0/go.mod h1:Hya1cozXM4SeSKTAgGXgj97GlqUvF5JaoXacR1JTP/E= +cloud.google.com/go/serviceusage v1.4.0/go.mod h1:SB4yxXSaYVuUBYUml6qklyONXNLt83U0Rb+CXyhjEeU= +cloud.google.com/go/shell v1.3.0/go.mod h1:VZ9HmRjZBsjLGXusm7K5Q5lzzByZmJHf1d0IWHEN5X4= +cloud.google.com/go/shell v1.4.0/go.mod h1:HDxPzZf3GkDdhExzD/gs8Grqk+dmYcEjGShZgYa9URw= +cloud.google.com/go/spanner v1.41.0/go.mod h1:MLYDBJR/dY4Wt7ZaMIQ7rXOTLjYrmxLE/5ve9vFfWos= +cloud.google.com/go/speech v1.6.0/go.mod h1:79tcr4FHCimOp56lwC01xnt/WPJZc4v3gzyT7FoBkCM= +cloud.google.com/go/speech v1.7.0/go.mod h1:KptqL+BAQIhMsj1kOP2la5DSEEerPDuOP/2mmkhHhZQ= +cloud.google.com/go/speech v1.8.0/go.mod h1:9bYIl1/tjsAnMgKGHKmBZzXKEkGgtU+MpdDPTE9f7y0= +cloud.google.com/go/speech v1.9.0/go.mod h1:xQ0jTcmnRFFM2RfX/U+rk6FQNUF6DQlydUSyoooSpco= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= +cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= +cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= +cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= +cloud.google.com/go/storagetransfer v1.5.0/go.mod h1:dxNzUopWy7RQevYFHewchb29POFv3/AaBgnhqzqiK0w= +cloud.google.com/go/storagetransfer v1.6.0/go.mod h1:y77xm4CQV/ZhFZH75PLEXY0ROiS7Gh6pSKrM8dJyg6I= +cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= +cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= +cloud.google.com/go/talent v1.3.0/go.mod h1:CmcxwJ/PKfRgd1pBjQgU6W3YBwiewmUzQYH5HHmSCmM= +cloud.google.com/go/talent v1.4.0/go.mod h1:ezFtAgVuRf8jRsvyE6EwmbTK5LKciD4KVnHuDEFmOOA= +cloud.google.com/go/texttospeech v1.4.0/go.mod h1:FX8HQHA6sEpJ7rCMSfXuzBcysDAuWusNNNvN9FELDd8= +cloud.google.com/go/texttospeech v1.5.0/go.mod h1:oKPLhR4n4ZdQqWKURdwxMy0uiTS1xU161C8W57Wkea4= +cloud.google.com/go/tpu v1.3.0/go.mod h1:aJIManG0o20tfDQlRIej44FcwGGl/cD0oiRyMKG19IQ= +cloud.google.com/go/tpu v1.4.0/go.mod h1:mjZaX8p0VBgllCzF6wcU2ovUXN9TONFLd7iz227X2Xg= +cloud.google.com/go/trace v1.3.0/go.mod h1:FFUE83d9Ca57C+K8rDl/Ih8LwOzWIV1krKgxg6N0G28= +cloud.google.com/go/trace v1.4.0/go.mod h1:UG0v8UBqzusp+z63o7FK74SdFE+AXpCLdFb1rshXG+Y= +cloud.google.com/go/translate v1.3.0/go.mod h1:gzMUwRjvOqj5i69y/LYLd8RrNQk+hOmIXTi9+nb3Djs= +cloud.google.com/go/translate v1.4.0/go.mod h1:06Dn/ppvLD6WvA5Rhdp029IX2Mi3Mn7fpMRLPvXT5Wg= +cloud.google.com/go/video v1.8.0/go.mod h1:sTzKFc0bUSByE8Yoh8X0mn8bMymItVGPfTuUBUyRgxk= +cloud.google.com/go/video v1.9.0/go.mod h1:0RhNKFRF5v92f8dQt0yhaHrEuH95m068JYOvLZYnJSw= +cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= +cloud.google.com/go/videointelligence v1.7.0/go.mod h1:k8pI/1wAhjznARtVT9U1llUaFNPh7muw8QyOUpavru4= +cloud.google.com/go/videointelligence v1.8.0/go.mod h1:dIcCn4gVDdS7yte/w+koiXn5dWVplOZkE+xwG9FgK+M= +cloud.google.com/go/videointelligence v1.9.0/go.mod h1:29lVRMPDYHikk3v8EdPSaL8Ku+eMzDljjuvRs105XoU= +cloud.google.com/go/vision v1.2.0/go.mod h1:SmNwgObm5DpFBme2xpyOyasvBc1aPdjvMk2bBk0tKD0= +cloud.google.com/go/vision/v2 v2.2.0/go.mod h1:uCdV4PpN1S0jyCyq8sIM42v2Y6zOLkZs+4R9LrGYwFo= +cloud.google.com/go/vision/v2 v2.3.0/go.mod h1:UO61abBx9QRMFkNBbf1D8B1LXdS2cGiiCRx0vSpZoUo= +cloud.google.com/go/vision/v2 v2.4.0/go.mod h1:VtI579ll9RpVTrdKdkMzckdnwMyX2JILb+MhPqRbPsY= +cloud.google.com/go/vision/v2 v2.5.0/go.mod h1:MmaezXOOE+IWa+cS7OhRRLK2cNv1ZL98zhqFFZaaH2E= +cloud.google.com/go/vmmigration v1.2.0/go.mod h1:IRf0o7myyWFSmVR1ItrBSFLFD/rJkfDCUTO4vLlJvsE= +cloud.google.com/go/vmmigration v1.3.0/go.mod h1:oGJ6ZgGPQOFdjHuocGcLqX4lc98YQ7Ygq8YQwHh9A7g= +cloud.google.com/go/vmwareengine v0.1.0/go.mod h1:RsdNEf/8UDvKllXhMz5J40XxDrNJNN4sagiox+OI208= +cloud.google.com/go/vpcaccess v1.4.0/go.mod h1:aQHVbTWDYUR1EbTApSVvMq1EnT57ppDmQzZ3imqIk4w= +cloud.google.com/go/vpcaccess v1.5.0/go.mod h1:drmg4HLk9NkZpGfCmZ3Tz0Bwnm2+DKqViEpeEpOq0m8= +cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xXZmFiHmGE= +cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= +cloud.google.com/go/webrisk v1.6.0/go.mod h1:65sW9V9rOosnc9ZY7A7jsy1zoHS5W9IAXv6dGqhMQMc= +cloud.google.com/go/webrisk v1.7.0/go.mod h1:mVMHgEYH0r337nmt1JyLthzMr6YxwN1aAIEc2fTcq7A= +cloud.google.com/go/websecurityscanner v1.3.0/go.mod h1:uImdKm2wyeXQevQJXeh8Uun/Ym1VqworNDlBXQevGMo= +cloud.google.com/go/websecurityscanner v1.4.0/go.mod h1:ebit/Fp0a+FWu5j4JOmJEV8S8CzdTkAS77oDsiSqYWQ= +cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= +cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= +cloud.google.com/go/workflows v1.8.0/go.mod h1:ysGhmEajwZxGn1OhGOGKsTXc5PyxOc0vfKf5Af+to4M= +cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT3ujaO/WwSA= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8/go.mod h1:CzsSbkDixRphAF5hS6wbMKq0eI6ccJRb7/A0M6JBnwg= +github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0/go.mod h1:OQeznEEkTZ9OrhHJoDD8ZDq51FHgXjqtP9z6bEwBq9U= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= +github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= +github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= +github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= +github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= +github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= +github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= +github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= +github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= +github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= +github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= +github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= +github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= +github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= +github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= +github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= +github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= +github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= +github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/ClickHouse/ch-go v0.52.1/go.mod h1:B9htMJ0hii/zrC2hljUKdnagRBuLqtRG/GrU3jqCwRk= +github.com/ClickHouse/ch-go v0.53.0 h1:gD9oP15FW+1oTTYyVzmuVfM+bk5cB5wqdscBIIw/mRA= +github.com/ClickHouse/ch-go v0.53.0/go.mod h1:B9htMJ0hii/zrC2hljUKdnagRBuLqtRG/GrU3jqCwRk= +github.com/ClickHouse/clickhouse-go v1.5.4/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI= +github.com/ClickHouse/clickhouse-go/v2 v2.8.3 h1:R6na3RNq/4vEEwfwkxQYrWOf21T9HMhGmE8mhkhq7TI= +github.com/ClickHouse/clickhouse-go/v2 v2.8.3/go.mod h1:teXfZNM90iQ99Jnuht+dxQXCuhDZ8nvvMoTJOFrcmcg= +github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= +github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= +github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= +github.com/Microsoft/go-winio v0.4.16-0.20201130162521-d1ffc52c7331/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= +github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= +github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= +github.com/Microsoft/go-winio v0.4.17-0.20210324224401-5516f17a5958/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= +github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= +github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= +github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= +github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= +github.com/Microsoft/hcsshim v0.8.7-0.20190325164909-8abdbb8205e4/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= +github.com/Microsoft/hcsshim v0.8.7/go.mod h1:OHd7sQqRFrYd3RmSgbgji+ctCwkbq2wbEYNSzOYtcBQ= +github.com/Microsoft/hcsshim v0.8.9/go.mod h1:5692vkUqntj1idxauYlpoINNKeqCiG6Sg38RRsjT5y8= +github.com/Microsoft/hcsshim v0.8.14/go.mod h1:NtVKoYxQuTLx6gEq0L96c9Ju4JbRJ4nY2ow3VK6a9Lg= +github.com/Microsoft/hcsshim v0.8.15/go.mod h1:x38A4YbHbdxJtc0sF6oIz+RG0npwSCAvn69iY6URG00= +github.com/Microsoft/hcsshim v0.8.16/go.mod h1:o5/SZqmR7x9JNKsW3pu+nqHm0MF8vbA+VxGOoXdC600= +github.com/Microsoft/hcsshim v0.8.20/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwTOcER2fw4I4= +github.com/Microsoft/hcsshim v0.8.21/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwTOcER2fw4I4= +github.com/Microsoft/hcsshim v0.8.23/go.mod h1:4zegtUJth7lAvFyc6cH2gGQ5B3OFQim01nnU2M8jKDg= +github.com/Microsoft/hcsshim v0.9.2/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc= +github.com/Microsoft/hcsshim v0.9.4/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc= +github.com/Microsoft/hcsshim/test v0.0.0-20201218223536-d3e5debf77da/go.mod h1:5hlzMzRKMLyo42nCZ9oml8AdTlq/0cvIaBv6tK1RehU= +github.com/Microsoft/hcsshim/test v0.0.0-20210227013316-43a75bb4edd3/go.mod h1:mw7qgWloBUl75W/gVH3cQszUg1+gUITj7D6NY7ywVnY= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/Shonminh/apollo-client v0.4.0/go.mod h1:Jk6K99uIGxQm7Uyy1gCQTvM/kc1YLp4Qo9/jtGkEXvI= +github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= +github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= +github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= +github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0= +github.com/alexflint/go-filemutex v1.1.0/go.mod h1:7P4iRhttt/nUvUOrYIhcpMzv2G6CY9UnI16Z+UJqRyk= +github.com/aliyun/alibaba-cloud-sdk-go v1.61.18 h1:zOVTBdCKFd9JbCKz9/nt+FovbjPFmb7mUnp8nH9fQBA= +github.com/aliyun/alibaba-cloud-sdk-go v1.61.18/go.mod h1:v8ESoHo4SyHmuB4b1tJqDHxfTGEciD+yhvOU/5s1Rfk= +github.com/aliyun/aliyun-log-go-sdk v0.1.44 h1:K3+CXPnHZYNepVUGyTSx3SJ7v3zg57yFs6AQRY1MB+U= +github.com/aliyun/aliyun-log-go-sdk v0.1.44/go.mod h1:1QQ59pEJiVVXqKgbHcU6FWIgxT5RKBt+CT8AiQ2bEts= +github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= +github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apolloconfig/agollo/v4 v4.3.0 h1:AarIBtpDE76jIevHUOzzgT9eLB5HPvIQ8oL+OpScOPU= +github.com/apolloconfig/agollo/v4 v4.3.0/go.mod h1:SuvTjtg0p4UlSzSbik+ibLRr6oR1xRsfy65QzP3GEAs= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-metrics v0.3.10 h1:FR+drcQStOe+32sYyJYyZ7FIdgoGGBnwLl+flodp8Uo= +github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= +github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= +github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= +github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= +github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= +github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= +github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwjwegp5jy4= +github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= +github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= +github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= +github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= +github.com/buger/jsonparser v0.0.0-20180808090653-f4dd9f5a6b44/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= +github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= +github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= +github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= +github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= +github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= +github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= +github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= +github.com/cenkalti/backoff v2.0.0+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= +github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= +github.com/cenkalti/backoff/v4 v4.1.2/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= +github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= +github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4= +github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g= +github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= +github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= +github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= +github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= +github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg= +github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLIdUjrmSXlK9pkrsDlLHbO8jiB8X8JnOc= +github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= +github.com/cilium/ebpf v0.4.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= +github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= +github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA= +github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= +github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= +github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58 h1:F1EaeKL/ta07PY/k9Os/UFtwERei2/XzGemhpGnBKNg= +github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= +github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= +github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= +github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= +github.com/containerd/aufs v0.0.0-20200908144142-dab0cbea06f4/go.mod h1:nukgQABAEopAHvB6j7cnP5zJ+/3aVcE7hCYqvIwAHyE= +github.com/containerd/aufs v0.0.0-20201003224125-76a6863f2989/go.mod h1:AkGGQs9NM2vtYHaUen+NljV0/baGCAPELGm2q9ZXpWU= +github.com/containerd/aufs v0.0.0-20210316121734-20793ff83c97/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= +github.com/containerd/aufs v1.0.0/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= +github.com/containerd/btrfs v0.0.0-20201111183144-404b9149801e/go.mod h1:jg2QkJcsabfHugurUvvPhS3E08Oxiuh5W/g1ybB4e0E= +github.com/containerd/btrfs v0.0.0-20210316141732-918d888fb676/go.mod h1:zMcX3qkXTAi9GI50+0HOeuV8LU2ryCE/V2vG/ZBiTss= +github.com/containerd/btrfs v1.0.0/go.mod h1:zMcX3qkXTAi9GI50+0HOeuV8LU2ryCE/V2vG/ZBiTss= +github.com/containerd/cgroups v0.0.0-20190717030353-c4b9ac5c7601/go.mod h1:X9rLEHIqSf/wfK8NsPqxJmeZgW4pcfzdXITDrUSJ6uI= +github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko= +github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM= +github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo= +github.com/containerd/cgroups v0.0.0-20200824123100-0b889c03f102/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo= +github.com/containerd/cgroups v0.0.0-20210114181951-8a68de567b68/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= +github.com/containerd/cgroups v1.0.1/go.mod h1:0SJrPIenamHDcZhEcJMNBB85rHcUsw4f25ZfBiPYRkU= +github.com/containerd/cgroups v1.0.3/go.mod h1:/ofk34relqNjSGyqPrmEULrO4Sc8LJhvJmWbUCUKqj8= +github.com/containerd/cgroups v1.0.4/go.mod h1:nLNQtsF7Sl2HxNebu77i1R0oDlhiTG+kO4JTrUzo6IA= +github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= +github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= +github.com/containerd/console v0.0.0-20191206165004-02ecf6a7291e/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE= +github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw= +github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= +github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= +github.com/containerd/containerd v1.2.10/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.3.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.3.1-0.20191213020239-082f7e3aed57/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.4.0-beta.2.0.20200729163537-40b22ef07410/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.4.1/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.4.3/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.4.9/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.5.0-beta.1/go.mod h1:5HfvG1V2FsKesEGQ17k5/T7V960Tmcumvqn8Mc+pCYQ= +github.com/containerd/containerd v1.5.0-beta.3/go.mod h1:/wr9AVtEM7x9c+n0+stptlo/uBBoBORwEx6ardVcmKU= +github.com/containerd/containerd v1.5.0-beta.4/go.mod h1:GmdgZd2zA2GYIBZ0w09ZvgqEq8EfBp/m3lcVZIvPHhI= +github.com/containerd/containerd v1.5.0-rc.0/go.mod h1:V/IXoMqNGgBlabz3tHD2TWDoTJseu1FGOKuoA4nNb2s= +github.com/containerd/containerd v1.5.1/go.mod h1:0DOxVqwDy2iZvrZp2JUx/E+hS0UNTVn7dJnIOwtYR4g= +github.com/containerd/containerd v1.5.7/go.mod h1:gyvv6+ugqY25TiXxcZC3L5yOeYgEw0QMhscqVp1AR9c= +github.com/containerd/containerd v1.5.8/go.mod h1:YdFSv5bTFLpG2HIYmfqDpSYYTDX+mc5qtSuYx1YUb/s= +github.com/containerd/containerd v1.6.1/go.mod h1:1nJz5xCZPusx6jJU8Frfct988y0NpumIq9ODB0kLtoE= +github.com/containerd/containerd v1.6.8/go.mod h1:By6p5KqPK0/7/CgO/A6t/Gz+CUYUu2zf1hUaaymVXB0= +github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= +github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= +github.com/containerd/continuity v0.0.0-20191127005431-f65d91d395eb/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= +github.com/containerd/continuity v0.0.0-20200710164510-efbc4488d8fe/go.mod h1:cECdGN1O8G9bgKTlLhuPJimka6Xb/Gg7vYzCTNVxhvo= +github.com/containerd/continuity v0.0.0-20201208142359-180525291bb7/go.mod h1:kR3BEg7bDFaEddKm54WSmrol1fKWDU1nKYkgrcgZT7Y= +github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ= +github.com/containerd/continuity v0.1.0/go.mod h1:ICJu0PwR54nI0yPEnJ6jcS+J7CZAUXrLh8lPo2knzsM= +github.com/containerd/continuity v0.2.2/go.mod h1:pWygW9u7LtS1o4N/Tn0FoCFDIXZ7rxcMX7HX1Dmibvk= +github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= +github.com/containerd/fifo v0.0.0-20180307165137-3d5202aec260/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= +github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= +github.com/containerd/fifo v0.0.0-20200410184934-f15a3290365b/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0= +github.com/containerd/fifo v0.0.0-20201026212402-0724c46b320c/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0= +github.com/containerd/fifo v0.0.0-20210316144830-115abcc95a1d/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= +github.com/containerd/fifo v1.0.0/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= +github.com/containerd/go-cni v1.0.1/go.mod h1:+vUpYxKvAF72G9i1WoDOiPGRtQpqsNW/ZHtSlv++smU= +github.com/containerd/go-cni v1.0.2/go.mod h1:nrNABBHzu0ZwCug9Ije8hL2xBCYh/pjfMb1aZGrrohk= +github.com/containerd/go-cni v1.1.0/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= +github.com/containerd/go-cni v1.1.3/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= +github.com/containerd/go-cni v1.1.6/go.mod h1:BWtoWl5ghVymxu6MBjg79W9NZrCRyHIdUtk4cauMe34= +github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= +github.com/containerd/go-runc v0.0.0-20190911050354-e029b79d8cda/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= +github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328/go.mod h1:PpyHrqVs8FTi9vpyHwPwiNEGaACDxT/N/pLcvMSRA9g= +github.com/containerd/go-runc v0.0.0-20201020171139-16b287bc67d0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= +github.com/containerd/go-runc v1.0.0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= +github.com/containerd/imgcrypt v1.0.1/go.mod h1:mdd8cEPW7TPgNG4FpuP3sGBiQ7Yi/zak9TYCG3juvb0= +github.com/containerd/imgcrypt v1.0.4-0.20210301171431-0ae5c75f59ba/go.mod h1:6TNsg0ctmizkrOgXRNQjAPFWpMYRWuiB6dSF4Pfa5SA= +github.com/containerd/imgcrypt v1.1.1-0.20210312161619-7ed62a527887/go.mod h1:5AZJNI6sLHJljKuI9IHnw1pWqo/F0nGDOuR9zgTs7ow= +github.com/containerd/imgcrypt v1.1.1/go.mod h1:xpLnwiQmEUJPvQoAapeb2SNCxz7Xr6PJrXQb0Dpc4ms= +github.com/containerd/imgcrypt v1.1.3/go.mod h1:/TPA1GIDXMzbj01yd8pIbQiLdQxed5ue1wb8bP7PQu4= +github.com/containerd/imgcrypt v1.1.4/go.mod h1:LorQnPtzL/T0IyCeftcsMEO7AqxUDbdO8j/tSUpgxvo= +github.com/containerd/nri v0.0.0-20201007170849-eb1350a75164/go.mod h1:+2wGSDGFYfE5+So4M5syatU0N0f0LbWpuqyMi4/BE8c= +github.com/containerd/nri v0.0.0-20210316161719-dbaa18c31c14/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= +github.com/containerd/nri v0.1.0/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= +github.com/containerd/stargz-snapshotter/estargz v0.4.1/go.mod h1:x7Q9dg9QYb4+ELgxmo4gBUeJB0tl5dqH1Sdz0nJU1QM= +github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= +github.com/containerd/ttrpc v0.0.0-20190828172938-92c8520ef9f8/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= +github.com/containerd/ttrpc v0.0.0-20191028202541-4f1b8fe65a5c/go.mod h1:LPm1u0xBw8r8NOKoOdNMeVHSawSsltak+Ihv+etqsE8= +github.com/containerd/ttrpc v1.0.1/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= +github.com/containerd/ttrpc v1.0.2/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= +github.com/containerd/ttrpc v1.1.0/go.mod h1:XX4ZTnoOId4HklF4edwc4DcqskFZuvXB1Evzy5KFQpQ= +github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= +github.com/containerd/typeurl v0.0.0-20190911142611-5eb25027c9fd/go.mod h1:GeKYzf2pQcqv7tJ0AoCuuhtnqhva5LNU3U+OyKxxJpk= +github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg= +github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s= +github.com/containerd/zfs v0.0.0-20200918131355-0a33824f23a2/go.mod h1:8IgZOBdv8fAgXddBT4dBXJPtxyRsejFIpXoklgxgEjw= +github.com/containerd/zfs v0.0.0-20210301145711-11e8f1707f62/go.mod h1:A9zfAbMlQwE+/is6hi0Xw8ktpL+6glmqZYtevJgaB8Y= +github.com/containerd/zfs v0.0.0-20210315114300-dde8f0fda960/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= +github.com/containerd/zfs v0.0.0-20210324211415-d5c4544f0433/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= +github.com/containerd/zfs v1.0.0/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= +github.com/containernetworking/cni v0.7.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= +github.com/containernetworking/cni v0.8.0/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= +github.com/containernetworking/cni v0.8.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= +github.com/containernetworking/cni v1.0.1/go.mod h1:AKuhXbN5EzmD4yTNtfSsX3tPcmtrBI6QcRV0NiNt15Y= +github.com/containernetworking/cni v1.1.1/go.mod h1:sDpYKmGVENF3s6uvMvGgldDWeG8dMxakj/u+i9ht9vw= +github.com/containernetworking/plugins v0.8.6/go.mod h1:qnw5mN19D8fIwkqW7oHHYDHVlzhJpcY6TQxn/fUyDDM= +github.com/containernetworking/plugins v0.9.1/go.mod h1:xP/idU2ldlzN6m4p5LmGiwRDjeJr6FLK6vuiUwoH7P8= +github.com/containernetworking/plugins v1.0.1/go.mod h1:QHCfGpaTwYTbbH+nZXKVTxNBDZcxSOplJT5ico8/FLE= +github.com/containernetworking/plugins v1.1.1/go.mod h1:Sr5TH/eBsGLXK/h71HeLfX19sZPp3ry5uHSkI4LPxV8= +github.com/containers/ocicrypt v1.0.1/go.mod h1:MeJDzk1RJHv89LjsH0Sp5KTY3ZYkjXO/C+bKAeWFIrc= +github.com/containers/ocicrypt v1.1.0/go.mod h1:b8AOe0YR67uU8OqfVNcznfFpAzu3rdgUV4GP9qXPfu4= +github.com/containers/ocicrypt v1.1.1/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= +github.com/containers/ocicrypt v1.1.2/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= +github.com/containers/ocicrypt v1.1.3/go.mod h1:xpdkbVAuaH3WzbEabUd5yDsl9SwJA5pABH85425Es2g= +github.com/coocood/freecache v1.0.1/go.mod h1:ePwxCDzOYvARfHdr1pByNct1at3CoKnsipOHwKlNbzI= +github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-iptables v0.4.5/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= +github.com/coreos/go-iptables v0.5.0/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= +github.com/coreos/go-iptables v0.6.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFETJConOQ//Q= +github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20161114122254-48702e0da86b/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= +github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= +github.com/coreos/go-systemd/v22 v22.3.2 h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI= +github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= +github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= +github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c/go.mod h1:Ct2BUK8SB0YC1SMSibvLzxjeJLnrYEVLULFNiHY9YfQ= +github.com/d2g/dhcp4client v1.0.0/go.mod h1:j0hNfjhrt2SxUOw55nL0ATM/z4Yt3t2Kd1mW34z5W5s= +github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5/go.mod h1:Eo87+Kg/IX2hfWJfwxMzLyuSZyxSoAug2nGa1G2QAi8= +github.com/d2g/hardwareaddr v0.0.0-20190221164911-e7d9fbe030e4/go.mod h1:bMl4RjIciD2oAxI7DmWRx6gbeqrkoLqv3MV0vzNad+I= +github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deckarep/golang-set v1.7.1 h1:SCQV0S6gTtp6itiFrTqI+pfmJ4LN85S1YzhDf9rTHJQ= +github.com/deckarep/golang-set v1.7.1/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= +github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= +github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/dmarkham/enumer v1.5.7/go.mod h1:eAawajOQnFBxf0NndBKgbqJImkHytg3eFEngUovqgo8= +github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= +github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= +github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= +github.com/dnephin/pflag v1.0.7/go.mod h1:uxE91IoWURlOiTUIA8Mq5ZZkAv3dPUfZNaT80Zm7OQE= +github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/distribution v0.0.0-20190905152932-14b96e55d84c/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY= +github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v20.10.17+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v20.10.22+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-events v0.0.0-20170721190031-9461782956ad/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= +github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= +github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI= +github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= +github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= +github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= +github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful v2.12.0+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= +github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= +github.com/envoyproxy/go-control-plane v0.10.3/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34= +github.com/envoyproxy/go-control-plane v0.11.2-0.20230627204322-7d0032219fcb h1:kxNVXsNro/lpR5WD+P1FI/yUHn2G03Glber3k8cQL2Y= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= +github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w= +github.com/envoyproxy/protoc-gen-validate v0.10.1 h1:c0g45+xCJhdgFGw7a5QAfdS4byAbud7miNWJ1WwEVf8= +github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239/go.mod h1:Gdwt2ce0yfBxPvZrHkprdPPTTS3N5rwmLE8T22KBXlw= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= +github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0= +github.com/fluent/fluent-logger-golang v1.9.0 h1:zUdY44CHX2oIUc7VTNZc+4m+ORuO/mldQDA7czhWXEg= +github.com/fluent/fluent-logger-golang v1.9.0/go.mod h1:2/HCT/jTy78yGyeNGQLGQsjF3zzzAuy6Xlk6FCMV5eU= +github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= +github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= +github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= +github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= +github.com/frankban/quicktest v1.10.2/go.mod h1:K+q6oSqb0W0Ininfk863uOk1lMy69l/P6txr3mVT54s= +github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= +github.com/frankban/quicktest v1.14.0 h1:+cqqvzZV87b4adx/5ayVOaYZ2CrvM4ejQvUdBzPPUss= +github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA= +github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= +github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= +github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= +github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= +github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= +github.com/go-chassis/cari v0.0.0-20201210041921-7b6fbef2df11/go.mod h1:MgtsEI0AM4Ush6Lyw27z9Gk4nQ/8GWTSXrFzupawWDM= +github.com/go-chassis/cari v0.4.0/go.mod h1:av/19fqwEP4eOC8unL/z67AAbFDwXUCko6SKa4Avrd8= +github.com/go-chassis/cari v0.5.0/go.mod h1:av/19fqwEP4eOC8unL/z67AAbFDwXUCko6SKa4Avrd8= +github.com/go-chassis/cari v0.5.1-0.20210823023004-74041d1363c4/go.mod h1:av/19fqwEP4eOC8unL/z67AAbFDwXUCko6SKa4Avrd8= +github.com/go-chassis/cari v0.6.0 h1:cwBchwt9L8JOyO6QkzXFAsseMJ10zVSiVK8eDLD0HkA= +github.com/go-chassis/cari v0.6.0/go.mod h1:mSDRCOQXGmlD69A6NG0hsv0UP1xbVPtL6HCGI6X1tqs= +github.com/go-chassis/foundation v0.2.2-0.20201210043510-9f6d3de40234/go.mod h1:2PjwqpVwYEVaAldl5A58a08viH8p27pNeYaiE3ZxOBA= +github.com/go-chassis/foundation v0.2.2/go.mod h1:2PjwqpVwYEVaAldl5A58a08viH8p27pNeYaiE3ZxOBA= +github.com/go-chassis/foundation v0.3.0/go.mod h1:2PjwqpVwYEVaAldl5A58a08viH8p27pNeYaiE3ZxOBA= +github.com/go-chassis/foundation v0.4.0 h1:z0xETnSxF+vRXWjoIhOdzt6rywjZ4sB++utEl4YgWEY= +github.com/go-chassis/foundation v0.4.0/go.mod h1:6NsIUaHghTFRGfCBcZN011zl196F6OR5QvD9N+P4oWU= +github.com/go-chassis/go-archaius v1.5.1/go.mod h1:QPwvvtBxvwiC48rmydoAqxopqOr93RCQ6syWsIkXPXQ= +github.com/go-chassis/go-chassis/v2 v2.3.0/go.mod h1:iyJ2DWSkqfnCmad/0Il9nXWHaob7RcwPGlIDRNxccH0= +github.com/go-chassis/go-restful-swagger20 v1.0.3/go.mod h1:eW62fYuzlNFDvIacB6AV8bhUDCTy4myfTCv0bT9Gbb0= +github.com/go-chassis/kie-client v0.0.0-20201210060018-938c7680a9ab/go.mod h1:UTdbtyN5ge/v9DmQzdVRxQP7z51Q4z6hyl+W6ZpUHFM= +github.com/go-chassis/openlog v1.1.2/go.mod h1:+eYCADVxWyJkwsFMUBrMxyQlNqW+UUsCxvR2LrYZUaA= +github.com/go-chassis/openlog v1.1.3 h1:XqIOvZ8YPJ9o9lLtLBskQNNWolK5kC6a4Sv7r4s9sZ4= +github.com/go-chassis/openlog v1.1.3/go.mod h1:+eYCADVxWyJkwsFMUBrMxyQlNqW+UUsCxvR2LrYZUaA= +github.com/go-chassis/sc-client v0.6.1-0.20210615014358-a45e9090c751/go.mod h1:TBS9g7OaIeu1OR/9tVPJEl6BgHFcYEdbuJlgVDQczbc= +github.com/go-chassis/sc-client v0.7.0 h1:c2LSdbFMuZ3RcbDu7So//kFCzjDCkzdQ0CNKhm8Dy7I= +github.com/go-chassis/sc-client v0.7.0/go.mod h1:DmclCLMhyNpYN42ae0f5AgiF4lTrpG6NyJJgmyAgC+E= +github.com/go-chassis/seclog v1.3.0/go.mod h1:a/zGvX5BRiwtq/O0fRqS6VWjrBaXYtqFJBx3EX9xzSE= +github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w= +github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/go-faster/city v1.0.1 h1:4WAxSZ3V2Ws4QRDrscLEDcibJY8uf41H6AhXDrNDcGw= +github.com/go-faster/city v1.0.1/go.mod h1:jKcUJId49qdW3L1qKHH/3wPeUstCVpVSXTM6vO3VcTw= +github.com/go-faster/errors v0.6.1 h1:nNIPOBkprlKzkThvS/0YaX8Zs9KewLCOSFQS5BU06FI= +github.com/go-faster/errors v0.6.1/go.mod h1:5MGV2/2T9yvlrbhe9pD9LO5Z/2zCSq2T8j+Jpi2LAyY= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.10.0 h1:dXFJfIHVvUcpSgDOV+Ne6t7jXri8Tfv2uOLHUZ2XNuo= +github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-kratos/aegis v0.1.2/go.mod h1:jYeSQ3Gesba478zEnujOiG5QdsyF3Xk/8owFUeKcHxw= +github.com/go-kratos/aegis v0.2.0 h1:dObzCDWn3XVjUkgxyBp6ZeWtx/do0DPZ7LY3yNSJLUQ= +github.com/go-kratos/aegis v0.2.0/go.mod h1:v0R2m73WgEEYB3XYu6aE2WcMwsZkJ/Rzuf5eVccm7bI= +github.com/go-kratos/kratos/contrib/config/apollo/v2 v2.0.0-20230519061918-96480c11ee42 h1:TvlB9uURr9gDmK3co24MrKMdAUzvVdEdcw+kdpasdGQ= +github.com/go-kratos/kratos/contrib/config/apollo/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:kQOEU+48HDXQyY+niLA3fAczwbEWbR6PIlpuoZoJewk= +github.com/go-kratos/kratos/contrib/config/consul/v2 v2.0.0-20230519061918-96480c11ee42 h1:rjzOgpwmC60uAFbo7V9PR0phfimNaWtSys2mYlo6fak= +github.com/go-kratos/kratos/contrib/config/consul/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:GumeFOPxBX0blR5I4T5C8Yw6VCf6dBNt9Ey2DmWbU2U= +github.com/go-kratos/kratos/contrib/config/etcd/v2 v2.0.0-20230519061918-96480c11ee42 h1:TwgumYYDlsgjCAJzQhR+IHqs8uvALWO/2zaIImxBJ4k= +github.com/go-kratos/kratos/contrib/config/etcd/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:Wxqd0+tez5dT4MIPJuVKYW2bEAZgzxuRkFUOPFQ5Myw= +github.com/go-kratos/kratos/contrib/config/kubernetes/v2 v2.0.0-20230519061918-96480c11ee42 h1:Fjf8mvuH3jd234U4EJ736d+Fgtvpaw4ZycscwVkqLaA= +github.com/go-kratos/kratos/contrib/config/kubernetes/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:JUzy8mAhZFpC0boXnK5eQQofzFzkigWulUjDf9zA/qk= +github.com/go-kratos/kratos/contrib/config/nacos/v2 v2.0.0-20230519061918-96480c11ee42 h1:3e82mLP1l7bOPI3lcf4b6s9kfrXaKjEfSIV3UK582UA= +github.com/go-kratos/kratos/contrib/config/nacos/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:MGczIUxDu+YAZWmuKQW5vES9eISFGJW9bbYcJ2VzQJA= +github.com/go-kratos/kratos/contrib/log/aliyun/v2 v2.0.0-20230519061918-96480c11ee42 h1:mvYeZ6gpNJMYvjr5ChkbQPuaSQZ/u0+ZBS0a54B8CgE= +github.com/go-kratos/kratos/contrib/log/aliyun/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:QNxIxFC3lDB+MNdiI1YU9O2F0RgsVE4pZP0sPpLwoLs= +github.com/go-kratos/kratos/contrib/log/fluent/v2 v2.0.0-20230519061918-96480c11ee42 h1:E+dZxXwGOwTH2/Nvwqpg7FMFc29IPP81lw/vmaceJn0= +github.com/go-kratos/kratos/contrib/log/fluent/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:9QgXn9PQ0IWWoXVlzb/GWVURsUutH1DkUJb4SCAa9ys= +github.com/go-kratos/kratos/contrib/log/logrus/v2 v2.0.0-20230519061918-96480c11ee42 h1:h89CTUYx/SyXkmFfIeQYNW8tjU4NkhtTO/GkMlD+CV4= +github.com/go-kratos/kratos/contrib/log/logrus/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:0apSUuIR6tr7/MlCDJ+qPO6Cy7aMtXEmL3Sh5tekd1w= +github.com/go-kratos/kratos/contrib/log/tencent/v2 v2.0.0-20230519061918-96480c11ee42 h1:lWdKU1pwNW2HufJyFh2QepEZzxbmDEj604mHwwSxpYI= +github.com/go-kratos/kratos/contrib/log/tencent/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:JUJcHcSvO41khLdgPRuoJa/bQcR6X0dL82hiBCbtHEM= +github.com/go-kratos/kratos/contrib/log/zap/v2 v2.0.0-20230519061918-96480c11ee42 h1:asznZDDYQzItDQCBeFxKGex11vyC6BU1JgZP+Wgt8ZM= +github.com/go-kratos/kratos/contrib/log/zap/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:mpWmmltg+ju0bFzUJGMo8+0Bx6mpfZ4ULTNC/VrATq0= +github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20230519061918-96480c11ee42 h1:VJhnXurxo13Jyk4EVQXzYO/3u/scDG2/QtRNuxznn7s= +github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:BI0LIs3jJw80l2onjjWDEn4TiHKrGJ0p9ORMGCIc1ko= +github.com/go-kratos/kratos/contrib/registry/etcd/v2 v2.0.0-20230519061918-96480c11ee42 h1:/OYtpk4jMOKrBtkFVCNsapqqjt5e0Hous+FXII8NwJs= +github.com/go-kratos/kratos/contrib/registry/etcd/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:Hw3swhxfr0NPYgEpsAkB4mwGZfVdz6XbeMMHkNXnjgk= +github.com/go-kratos/kratos/contrib/registry/eureka/v2 v2.0.0-20230519061918-96480c11ee42 h1:OFUR80Dx7n1gPPoF9qCwZrf2DuTIXz9Wn/oX0c7tWEY= +github.com/go-kratos/kratos/contrib/registry/eureka/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:Ak+GOAcZxa8c56+bh/5M9MXyiMibegr3dsLDzKSGn+E= +github.com/go-kratos/kratos/contrib/registry/kubernetes/v2 v2.0.0-20230519061918-96480c11ee42 h1:DEd6CA4UJDL0g/QFUCpNFedKgMr4vUczIgGUgqgJUG8= +github.com/go-kratos/kratos/contrib/registry/kubernetes/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:+eYCeF0F7Z6W6CjwftKnPYgoroxd3D1gacyr/PQ5fuc= +github.com/go-kratos/kratos/contrib/registry/nacos/v2 v2.0.0-20230519061918-96480c11ee42 h1:0B7m0Io2reL+yhg6fxxh2diJ0SaKYGxYMR85nkyxVro= +github.com/go-kratos/kratos/contrib/registry/nacos/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:6T9lKFjPyENu96KnNvVcVLlpy79mB5a0XwAA5cM2Kug= +github.com/go-kratos/kratos/contrib/registry/servicecomb/v2 v2.0.0-20230519061918-96480c11ee42 h1:DOV4MfEzElIctdTQHft8w2QAqzw1mqSmjHkmupBByLs= +github.com/go-kratos/kratos/contrib/registry/servicecomb/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:kPTtQIB8F0vBXJiGk7ZbGOBFmRUVPCJFQtP/oh8RZKA= +github.com/go-kratos/kratos/contrib/registry/zookeeper/v2 v2.0.0-20230519061918-96480c11ee42 h1:oVYxPHx3O8pGKxrZPJEKzBV0vIqNRraCvA91hI7wQ+4= +github.com/go-kratos/kratos/contrib/registry/zookeeper/v2 v2.0.0-20230519061918-96480c11ee42/go.mod h1:ODxlfT8vbQe/r/FOlsanc0HUoyWfOK5nBbXd/MnoOYY= +github.com/go-kratos/kratos/v2 v2.3.1/go.mod h1:5acyLj4EgY428AJnZl2EwCrMV1OVlttQFBum+SghMiA= +github.com/go-kratos/kratos/v2 v2.6.2/go.mod h1:xTeAeI9iYBP8MauISfxmRGSmKdDTLRQ3rbarKYmt6P4= +github.com/go-kratos/kratos/v2 v2.6.3 h1:zuejN8CnszyMnbLWd7ObCN9rLuKucJe2/2P6hHpePDc= +github.com/go-kratos/kratos/v2 v2.6.3/go.mod h1:nlBMkZueZps7UaP3GdbqG8V8N/eAX0jh019OKSm4xew= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= +github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.1/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/stdr v1.2.0/go.mod h1:YkVgnZu1ZjjL7xTxrfm/LLZBfkhTqSR1ydtm6jTKKwI= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= +github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= +github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= +github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= +github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= +github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= +github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= +github.com/go-openapi/jsonreference v0.20.1 h1:FBLnyygC4/IZZr893oiomc9XaghoveYTrLC1F86HID8= +github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= +github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= +github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= +github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= +github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/form/v4 v4.2.0/go.mod h1:q1a2BY+AQUUzhl6xA/6hBetay6dEIhMHjgvJiGo6K7U= +github.com/go-playground/form/v4 v4.2.1 h1:HjdRDKO0fftVMU5epjPW2SOREcZ6/wLUzEobqUGJuPw= +github.com/go-playground/form/v4 v4.2.1/go.mod h1:q1a2BY+AQUUzhl6xA/6hBetay6dEIhMHjgvJiGo6K7U= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/validator v9.31.0+incompatible/go.mod h1:yrEkQXlcI+PugkyDjY2bRrL/UBU4f3rvrgkN3V8JEig= +github.com/go-redis/redis/extra/rediscmd/v8 v8.11.5 h1:ftG8tp8SG81xyuL2woNEx5t2RZ8mOJuC2+tumi+/NR8= +github.com/go-redis/redis/extra/rediscmd/v8 v8.11.5/go.mod h1:s9f/6bSbS5r/jC2ozpWhWZ2GsoHDNf6iL+kZKnZnasc= +github.com/go-redis/redis/extra/redisotel/v8 v8.11.5 h1:BqyYJgvdSr2S/6O2l7zmCj26ocUTxDLgagsGIRfkS+Q= +github.com/go-redis/redis/extra/redisotel/v8 v8.11.5/go.mod h1:LlDT9RRdBgOrMGvFjT/m1+GrZAmRlBaMcM3UXHPWf8g= +github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= +github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= +github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= +github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= +github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= +github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-zookeeper/zk v1.0.3 h1:7M2kwOsc//9VeeFiPtf+uSJlVpU66x9Ba5+8XK7/TDg= +github.com/go-zookeeper/zk v1.0.3/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= +github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= +github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= +github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= +github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= +github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= +github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= +github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= +github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= +github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= +github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= +github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= +github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= +github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= +github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= +github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= +github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= +github.com/godbus/dbus v0.0.0-20151105175453-c7fdd8b5cd55/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= +github.com/godbus/dbus v0.0.0-20180201030542-885f9cc04c9c/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= +github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= +github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0= +github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= +github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= +github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= +github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/golang-jwt/jwt/v4 v4.4.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v4 v4.4.3/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0ktxqI+Sida1w446QrXBRJ0nee3SNZlA= +github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= +github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A= +github.com/golang-sql/sqlexp v0.1.0/go.mod h1:J4ad9Vo8ZCWQ2GMrC4UCQy1JpCbwU9m3EOqtpKwwwHI= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= +github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= +github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= +github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= +github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= +github.com/google/gnostic v0.6.9 h1:ZK/5VhkoX835RikCHpSUJV9a+S3e1zLh59YnyWeBW+0= +github.com/google/gnostic v0.6.9/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-containerregistry v0.5.1/go.mod h1:Ct15B4yir3PLOP5jsy0GNeYVaIZs/MK/Jz5any1wFW0= +github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= +github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= +github.com/google/subcommands v1.2.0 h1:vWQspBTo2nEqTUFita5/KeEWlUL8kQObDFbub/EN9oE= +github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/wire v0.5.0 h1:I7ELFeVBr3yfPIcc8+MWvrjk+3VjbcSzoXm3JVa+jD8= +github.com/google/wire v0.5.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU= +github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= +github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= +github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= +github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= +github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= +github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= +github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= +github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= +github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= +github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= +github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= +github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= +github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= +github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= +github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= +github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= +github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= +github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= +github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= +github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= +github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= +github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.4.3-0.20210424162022-e8629af678b7/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= +github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= +github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= +github.com/hashicorp/consul/api v1.20.0 h1:9IHTjNVSZ7MIwjlW3N3a7iGiykCMDpxZu8jsxFJh0yc= +github.com/hashicorp/consul/api v1.20.0/go.mod h1:nR64eD44KQ59Of/ECwt2vUmIK2DKsDzAwTmwmLl8Wpo= +github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= +github.com/hashicorp/consul/sdk v0.13.1 h1:EygWVWWMczTzXGpO93awkHFzfUka6hLYJ0qhETd+6lY= +github.com/hashicorp/consul/sdk v0.13.1/go.mod h1:SW/mM4LbKfqmMvcFu8v+eiQQ7oitXEFeiBe9StxERb0= +github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM= +github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.3.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= +github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI= +github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc= +github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= +github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.0.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= +github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= +github.com/hashicorp/memberlist v0.5.0 h1:EtYPN8DpAURiapus508I4n9CzHs2W+8NZGbmmR/prTM= +github.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4mHgHUZ8lrOI0= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= +github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= +github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY= +github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= +github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= +github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/intel/goresctrl v0.2.0/go.mod h1:+CZdzouYFn5EsxgqAQTEzMfwKwuc0fVdMrT9FCCAVRQ= +github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= +github.com/j-keck/arping v1.0.2/go.mod h1:aJbELhR92bSk7tp79AWM/ftfc90EfEi2bQJrbBFOsPw= +github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= +github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= +github.com/jackc/pgx/v5 v5.3.1 h1:Fcr8QJ1ZeLi5zsPZqQeUZhNhxfkkKBOgJuYkJHoBOtU= +github.com/jackc/pgx/v5 v5.3.1/go.mod h1:t3JDKnCBlYIc0ewLF0Q7B8MXmoIaBOZj/ic7iHozM/8= +github.com/jackc/puddle/v2 v2.1.2/go.mod h1:2lpufsF5mRHO6SuZkm0fNYxM6SWHfvyFj62KwNzgels= +github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= +github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM= +github.com/jcmturner/gofork v1.7.6/go.mod h1:1622LH6i/EZqLloHfE7IeZ0uEJwMSUyQ/nDd82IeqRo= +github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg= +github.com/jcmturner/gokrb5/v8 v8.4.4/go.mod h1:1btQEpgT6k+unzCwX1KdWMEwPPkkgBtP+F6aCACiMrs= +github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= +github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869/go.mod h1:cJ6Cj7dQo+O6GJNiMx+Pa94qKj+TG8ONdKHgMNIyyag= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= +github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= +github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/karlseguin/ccache/v2 v2.0.8 h1:lT38cE//uyf6KcFok0rlgXtGFBWxkI6h/qg4tbFyDnA= +github.com/karlseguin/ccache/v2 v2.0.8/go.mod h1:2BDThcfQMf/c0jnZowt16eW405XIqZPavt+HoYEtcxQ= +github.com/karlseguin/expect v1.0.2-0.20190806010014-778a5f0c6003 h1:vJ0Snvo+SLMY72r5J4sEfkuE7AFbixEP2qRbEcum/wA= +github.com/karlseguin/expect v1.0.2-0.20190806010014-778a5f0c6003/go.mod h1:zNBxMY8P21owkeogJELCLeHIt+voOSduHYTFUbwRAV8= +github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= +github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/compress v1.15.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4= +github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= +github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= +github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/lestrrat/go-envload v0.0.0-20180220120943-6ed08b54a570/go.mod h1:BLt8L9ld7wVsvEWQbuLrUZnCMnUmLZ+CGDzKtclrTlE= +github.com/lestrrat/go-file-rotatelogs v0.0.0-20180223000712-d3151e2a480f/go.mod h1:UGmTpUd3rjbtfIpwAPrcfmGf/Z1HS95TATB+m57TPB8= +github.com/lestrrat/go-strftime v0.0.0-20180220042222-ba3bf9c1d042/go.mod h1:TPpsiPUEh0zFL1Snz4crhMlBe60PYxRHr5oFF3rRYg0= +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= +github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= +github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo= +github.com/little-cui/etcdadpt v0.3.2/go.mod h1:HnRRpIrVEVNWobkiCvG2EHLWKKZ+L047EcI29ma2zA4= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= +github.com/lufia/plan9stats v0.0.0-20230110061619-bbe2e5e100de h1:V53FWzU6KAZVi1tPp5UIsMoUWJ2/PNwYIDXnu7QuBCE= +github.com/lufia/plan9stats v0.0.0-20230110061619-bbe2e5e100de/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= +github.com/lyft/protoc-gen-star v0.6.1/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= +github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= +github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= +github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= +github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= +github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= +github.com/mattn/go-shellwords v1.0.6/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= +github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= +github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/go-sqlite3 v1.14.17 h1:mCRHCLDUBXgpKAqIKsaAaAsrAlbkeomtRFKXh2L6YIM= +github.com/mattn/go-sqlite3 v1.14.17/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY= +github.com/microsoft/go-mssqldb v1.1.0 h1:jsV+tpvcPTbNNKW0o3kiCD69kOHICsfjZ2VcVu2lKYc= +github.com/microsoft/go-mssqldb v1.1.0/go.mod h1:LzkFdl4z2Ck+Hi+ycGOTbL56VEfgoyA2DvYejrNGbRk= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= +github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY= +github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= +github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= +github.com/miekg/pkcs11 v1.1.1/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= +github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= +github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= +github.com/minio/minio-go/v7 v7.0.53 h1:qtPyQ+b0Cc1ums3LsnVMAYULPNdAGz8qdX8R2zl9XMU= +github.com/minio/minio-go/v7 v7.0.53/go.mod h1:IbbodHyjUAguneyucUaahv+VMNs/EOTV9du7A7/Z3HU= +github.com/minio/sha256-simd v1.0.0 h1:v1ta+49hkWZyvaKwrQB8elexRqm6Y0aMLjCNsrYxo6g= +github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM= +github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= +github.com/mkevac/debugcharts v0.0.0-20191222103121-ae1c48aa8615/go.mod h1:Ad7oeElCZqA1Ufj0U9/liOF4BtVepxRcTvr2ey7zTvM= +github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= +github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= +github.com/moby/sys/mount v0.3.3/go.mod h1:PBaEorSNTLG5t/+4EgukEQVlAvVEc6ZjTySwKdqp5K0= +github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= +github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= +github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= +github.com/moby/sys/mountinfo v0.6.2/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI= +github.com/moby/sys/signal v0.6.0/go.mod h1:GQ6ObYZfqacOwTtlXvcmh9A26dVRul/hbOZn88Kg8Tg= +github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ= +github.com/moby/sys/symlink v0.2.0/go.mod h1:7uZVF2dqJjG/NsClqul95CqKOBRQyYSNnJ6BMgR/gFs= +github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= +github.com/moby/term v0.0.0-20210610120745-9d4ed1856297/go.mod h1:vgPCkQMyxTZ7IDy8SXRufE172gr8+K/JE/7hHFxHW3A= +github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= +github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= +github.com/montanaflynn/stats v0.7.0/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= +github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= +github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= +github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/nacos-group/nacos-sdk-go v1.0.9/go.mod h1:hlAPn3UdzlxIlSILAyOXKxjFSvDJ9oLzTJ9hLAK1KzA= +github.com/nacos-group/nacos-sdk-go v1.1.4 h1:qyrZ7HTWM4aeymFfqnbgNRERh7TWuER10pCB7ddRcTY= +github.com/nacos-group/nacos-sdk-go v1.1.4/go.mod h1:cBv9wy5iObs7khOqov1ERFQrCuTR4ILpgaiaVMxEmGI= +github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= +github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= +github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= +github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= +github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= +github.com/networkplumbing/go-nft v0.2.0/go.mod h1:HnnM+tYvlGAsMU7yoYwXEVLLiDW9gdMmb5HoGcwpuQs= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= +github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= +github.com/onsi/ginkgo v0.0.0-20151202141238-7f8ab55aaf3b/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= +github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU= +github.com/onsi/ginkgo/v2 v2.1.6/go.mod h1:MEH45j8TBi6u9BMogfbp0stKC5cdGjumZj5Y7AG4VIk= +github.com/onsi/ginkgo/v2 v2.3.0/go.mod h1:Eew0uilEqZmIEZr8JrvYlvOM7Rr6xzTmMV8AyFNU9d0= +github.com/onsi/ginkgo/v2 v2.4.0/go.mod h1:iHkDK1fKGcBoEHT5W7YBq4RFWaQulw+caOMkAt4OrFo= +github.com/onsi/ginkgo/v2 v2.9.1 h1:zie5Ly042PD3bsCvsSOPvRnFwyo3rKe64TJlD6nu0mk= +github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= +github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= +github.com/onsi/gomega v1.20.1/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= +github.com/onsi/gomega v1.21.1/go.mod h1:iYAIXgPSaDHak0LCMA+AWBpIKBr8WZicMxnE8luStNc= +github.com/onsi/gomega v1.22.1/go.mod h1:x6n7VNe4hw0vkyYUM4mjIXx3JbLiPaBPNgB7PRQ1tuM= +github.com/onsi/gomega v1.23.0/go.mod h1:Z/NWtiqwBrwUt4/2loMmHL63EDLnYHmVbuBpDr2vQAg= +github.com/onsi/gomega v1.27.4 h1:Z2AnStgsdSayCMDiCU42qIz+HLqEPcgiOCXjAU/w+8E= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= +github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= +github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= +github.com/opencontainers/go-digest v1.0.0-rc1.0.20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= +github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= +github.com/opencontainers/image-spec v1.0.0/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= +github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= +github.com/opencontainers/runc v1.0.0-rc8.0.20190926000215-3e425f80a8c9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= +github.com/opencontainers/runc v1.0.0-rc9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= +github.com/opencontainers/runc v1.0.0-rc93/go.mod h1:3NOsor4w32B2tC0Zbl8Knk4Wg84SM2ImC1fxBuqJ/H0= +github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= +github.com/opencontainers/runc v1.1.0/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc= +github.com/opencontainers/runc v1.1.2/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc= +github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= +github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/runtime-spec v1.0.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/runtime-spec v1.0.2-0.20190207185410-29686dbc5559/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs= +github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqiriPsEqVhc+svHE= +github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo= +github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= +github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= +github.com/opencontainers/selinux v1.10.1/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= +github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= +github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= +github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= +github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= +github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/openzipkin/zipkin-go v0.4.1 h1:kNd/ST2yLLWhaWrkgchya40TJabe8Hioj9udfPcEO5A= +github.com/openzipkin/zipkin-go v0.4.1/go.mod h1:qY0VqDSN1pOBN94dBc6w2GJlWLiovAyg7Qt6/I9HecM= +github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pascaldekloe/name v1.0.0/go.mod h1:Z//MfYJnH4jVpQ9wkclwu2I2MkHmXTlT9wR5UZScttM= +github.com/pascaldekloe/name v1.0.1/go.mod h1:Z//MfYJnH4jVpQ9wkclwu2I2MkHmXTlT9wR5UZScttM= +github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= +github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= +github.com/paulmach/orb v0.9.0 h1:MwA1DqOKtvCgm7u9RZ/pnYejTeDJPnr0+0oFajBbJqk= +github.com/paulmach/orb v0.9.0/go.mod h1:SudmOk85SXtmXAB3sLGyJ6tZy/8pdfrV0o6ef98Xc30= +github.com/paulmach/protoscan v0.2.1/go.mod h1:SpcSwydNLrxUGSDvXvO0P7g7AuhJ7lcKfDlhJCDw2gY= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= +github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc= +github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= +github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pelletier/go-toml/v2 v2.0.0-beta.8 h1:dy81yyLYJDwMTifq24Oi/IslOslRrDSb3jwDggjz3Z0= +github.com/pelletier/go-toml/v2 v2.0.0-beta.8/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= +github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= +github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/philhofer/fwd v1.1.1 h1:GdGcTjf5RNAxwS4QLsiMzJYj5KEvPJD3Abr261yRQXQ= +github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= +github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4 v2.6.0+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM= +github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4/v4 v4.1.17 h1:kV4Ip+/hUBC+8T6+2EgburRtkE9ef4nbY3f4dFhGjMc= +github.com/pierrec/lz4/v4 v4.1.17/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= +github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b h1:0LFwY6Q3gMACTjAbMZBjXAqTOzOwFaj2Ld6cjeQ7Rig= +github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= +github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= +github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= +github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= +github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= +github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= +github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.0-20190522114515-bc1a522cf7b1/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= +github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rs/xid v1.4.0 h1:qd7wPTDkN6KQx2VmMBLrpHkiyQwgFXRnkOLacUiaSNY= +github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= +github.com/safchain/ethtool v0.0.0-20210803160452-9aa261dae9b1/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= +github.com/sagikazarmark/crypt v0.5.0/go.mod h1:l+nzl7KWh51rpzp2h7t4MZWyiEWdhNpOAnclKvg+mdA= +github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= +github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= +github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= +github.com/seccomp/libseccomp-golang v0.9.2-0.20210429002308-3879420cc921/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= +github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= +github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys= +github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs= +github.com/shirou/gopsutil v2.19.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/shirou/gopsutil/v3 v3.21.8/go.mod h1:YWp/H8Qs5fVmf17v7JNZzA0mPJ+mS2e9JdiUF9LlKzQ= +github.com/shirou/gopsutil/v3 v3.23.2 h1:PAWSuiAszn7IhPMBtXsbSCafej7PqUOvY6YywlQUExU= +github.com/shirou/gopsutil/v3 v3.23.2/go.mod h1:gv0aQw33GLo3pG8SiWKiQrbDzbRY1K80RyZJ7V4Th1M= +github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= +github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= +github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= +github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.9.2 h1:oxx1eChJGI6Uks2ZC4W1zpLlVgqB8ner4EuQwV4Ik1Y= +github.com/sirupsen/logrus v1.9.2/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= +github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= +github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= +github.com/spf13/afero v1.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw= +github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= +github.com/spf13/cast v1.2.0/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA= +github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= +github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= +github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= +github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= +github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/spf13/viper v1.11.0 h1:7OX/1FS6n7jHD1zGrZTM7WtY13ZELRyosK4k93oPr44= +github.com/spf13/viper v1.11.0/go.mod h1:djo0X/bA5+tYVoCn+C7cAYJGcVn/qYLFTG8gdUsX7Zk= +github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8= +github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= +github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= +github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= +github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= +github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= +github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= +github.com/tebeka/strftime v0.1.3/go.mod h1:7wJm3dZlpr4l/oVK0t1HYIc4rMzQ2XJlOMIUJUJH6XQ= +github.com/tencentcloud/tencentcloud-cls-sdk-go v1.0.2 h1:29QoDxUqlFWd0Pgyt4lqGTGMNvJGxVQ3lRx1haRaPnw= +github.com/tencentcloud/tencentcloud-cls-sdk-go v1.0.2/go.mod h1:WU+0TXfVbSctEsUUf4KmIKnfr+tknbjcsnx/TrEIPH4= +github.com/testcontainers/testcontainers-go v0.14.0/go.mod h1:hSRGJ1G8Q5Bw2gXgPulJOLlEBaYJHeBSOkQM5JLG+JQ= +github.com/tevid/gohamcrest v1.1.1 h1:ou+xSqlIw1xfGTg1uq1nif/htZ2S3EzRqLm2BP+tYU0= +github.com/tevid/gohamcrest v1.1.1/go.mod h1:3UvtWlqm8j5JbwYZh80D/PVBt0mJ1eJiYgZMibh0H/k= +github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/tinylib/msgp v1.1.6 h1:i+SbKraHhnrf9M5MYmvQhFnbLhAXSDWF8WWsuyRdocw= +github.com/tinylib/msgp v1.1.6/go.mod h1:75BAfg2hauQhs3qedfdDZmWAPcFMAvJE5b9rGOMufyw= +github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs= +github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= +github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM= +github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI= +github.com/tklauser/numcpus v0.3.0/go.mod h1:yFGUr7TUHQRAhyqBcEg0Ge34zDBAsIvJJcyE6boqnA8= +github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= +github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYms= +github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4= +github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/toolkits/concurrent v0.0.0-20150624120057-a4371d70e3e3/go.mod h1:QDlpd3qS71vYtakd2hmdpqhJ9nwv6mD6A30bQ1BPBFE= +github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c/go.mod h1:hzIxponao9Kjc7aWznkXaL4U4TWaDSs8zcsY4Ka08nM= +github.com/twmb/murmur3 v1.1.6/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ= +github.com/tx7do/kratos-utils v0.0.0-20230523004815-97a553d22f52 h1:83y6QqHY9gX8OCzvLICySkEwAsPflT7jmGNJxVL3jYA= +github.com/tx7do/kratos-utils v0.0.0-20230523004815-97a553d22f52/go.mod h1:iDoQXF+37VqMnJ8UJcxGyBr2qxixiUiUGXlQvYoCzkY= +github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk= +github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= +github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= +github.com/vishvananda/netlink v1.1.1-0.20210330154013-f5de75959ad5/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= +github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc/go.mod h1:ZjcWmFBXmLKZu9Nxj3WKYEafiSqer2rnvPr0en9UNpI= +github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= +github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= +github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= +github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= +github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI= +github.com/wsxiaoys/terminal v0.0.0-20160513160801-0940f3fc43a0 h1:3UeQBvD0TFrlVjOeLOBz+CPAI8dnbqNSVwUwRrkp7vQ= +github.com/wsxiaoys/terminal v0.0.0-20160513160801-0940f3fc43a0/go.mod h1:IXCdmsXIht47RaVFLEdVnh1t+pgYtTAhQGj73kz+2DM= +github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= +github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= +github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= +github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= +github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= +github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= +github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= +github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= +github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= +github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= +go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= +go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= +go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= +go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/api/v3 v3.5.2/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= +go.etcd.io/etcd/api/v3 v3.5.8/go.mod h1:uyAal843mC8uUVSLWz6eHa/d971iDGnCRpmKd2Z+X8k= +go.etcd.io/etcd/api/v3 v3.5.9 h1:4wSsluwyTbGGmyjJktOf3wFQoTBIURXHnq9n/G/JQHs= +go.etcd.io/etcd/api/v3 v3.5.9/go.mod h1:uyAal843mC8uUVSLWz6eHa/d971iDGnCRpmKd2Z+X8k= +go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/pkg/v3 v3.5.2/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/pkg/v3 v3.5.8/go.mod h1:y+CzeSmkMpWN2Jyu1npecjB9BBnABxGM4pN8cGuJeL4= +go.etcd.io/etcd/client/pkg/v3 v3.5.9 h1:oidDC4+YEuSIQbsR94rY9gur91UPL6DnxDCIYd2IGsE= +go.etcd.io/etcd/client/pkg/v3 v3.5.9/go.mod h1:y+CzeSmkMpWN2Jyu1npecjB9BBnABxGM4pN8cGuJeL4= +go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= +go.etcd.io/etcd/client/v2 v2.305.2/go.mod h1:2D7ZejHVMIfog1221iLSYlQRzrtECw3kz4I4VAQm3qI= +go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lLS/oTh0= +go.etcd.io/etcd/client/v3 v3.5.8/go.mod h1:idZYIPVkttBJBiRigkB5EM0MmEyx8jcl18zCV3F5noc= +go.etcd.io/etcd/client/v3 v3.5.9 h1:r5xghnU7CwbUxD/fbUtRyJGaYNfDun8sp/gTr1hew6E= +go.etcd.io/etcd/client/v3 v3.5.9/go.mod h1:i/Eo5LrZ5IKqpbtpPDuaUnDOUv471oDg8cjQaUr2MbA= +go.etcd.io/etcd/pkg/v3 v3.5.0/go.mod h1:UzJGatBQ1lXChBkQF0AuAtkRQMYnHubxAEYIrC3MSsE= +go.etcd.io/etcd/raft/v3 v3.5.0/go.mod h1:UFOHSIvO/nKwd4lhkwabrTD3cqW5yVyYYf/KlD00Szc= +go.etcd.io/etcd/server/v3 v3.5.0/go.mod h1:3Ah5ruV+M+7RZr0+Y/5mNLwC+eQlni+mQmOVdCRJoS4= +go.mongodb.org/mongo-driver v1.5.1/go.mod h1:gRXCHX4Jo7J0IJ1oDQyUxF7jfy19UfxniMS4xxMmUqw= +go.mongodb.org/mongo-driver v1.11.1/go.mod h1:s7p5vEtfbeR1gYi6pnj3c3/urpbLv2T5Sfd6Rp2HBB8= +go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk= +go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.28.0/go.mod h1:vEhqr0m4eTc+DWxfsXoXue2GBgV2uUwVznkGIHW/e5w= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0/go.mod h1:2AboqHi0CiIZU0qwhtUfCYD1GeUzvvIXWNkhDt7ZMG4= +go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= +go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs= +go.opentelemetry.io/otel v1.4.1/go.mod h1:StM6F/0fSwpd8dKWDCdRr7uRvEPYdW0hBSlbdTiUde4= +go.opentelemetry.io/otel v1.5.0/go.mod h1:Jm/m+rNp/z0eqJc74H7LPwQ3G87qkU/AnnAydAjSAHk= +go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk= +go.opentelemetry.io/otel v1.13.0/go.mod h1:FH3RtdZCzRkJYFTCsAKDy9l/XYjMdNv6QrkFFB8DvVg= +go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU= +go.opentelemetry.io/otel v1.16.0 h1:Z7GVAX/UkAXPKsy94IU+i6thsQS4nb7LviLpnaNeW8s= +go.opentelemetry.io/otel v1.16.0/go.mod h1:vl0h9NUa1D5s1nv3A5vZOYWn8av4K8Ml6JDeHrT/bx4= +go.opentelemetry.io/otel/exporters/jaeger v1.16.0 h1:YhxxmXZ011C0aDZKoNw+juVWAmEfv/0W2XBOv9aHTaA= +go.opentelemetry.io/otel/exporters/jaeger v1.16.0/go.mod h1:grYbBo/5afWlPpdPZYhyn78Bk04hnvxn2+hvxQhKIQM= +go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM= +go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.3.0/go.mod h1:VpP4/RMn8bv8gNo9uK7/IMY4mtWLELsS+JIP0inH0h4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.3.0/go.mod h1:hO1KLR7jcKaDDKDkvI9dP/FIhpmna5lkqPUQdEjFAM8= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.3.0/go.mod h1:keUU7UfnwWTWpJ+FWnyqmogPa82nuU5VUANFq49hlMY= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.3.0/go.mod h1:QNX1aly8ehqqX1LEa6YniTU7VY9I6R3X/oPxhGdTceE= +go.opentelemetry.io/otel/exporters/zipkin v1.16.0 h1:WdMSH6vIJ+myJfr/HB/pjsYoJWQP0Wz/iJ1haNO5hX4= +go.opentelemetry.io/otel/exporters/zipkin v1.16.0/go.mod h1:QjDOKdylighHJBc7pf4Vo6fdhtiEJEqww/3Df8TOWjo= +go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= +go.opentelemetry.io/otel/metric v0.36.0/go.mod h1:wKVw57sd2HdSZAzyfOM9gTqqE8v7CbqWsYL6AyrH9qk= +go.opentelemetry.io/otel/metric v1.16.0 h1:RbrpwVG1Hfv85LgnZ7+txXioPDoh6EdbZHo26Q3hqOo= +go.opentelemetry.io/otel/metric v1.16.0/go.mod h1:QE47cpOmkwipPiefDwo2wDzwJrlfxxNYodqc4xnGCo4= +go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= +go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= +go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1teNrup8yzs= +go.opentelemetry.io/otel/sdk v1.4.1/go.mod h1:NBwHDgDIBYjwK2WNu1OPgsIc2IJzmBXNnvIJxJc8BpE= +go.opentelemetry.io/otel/sdk v1.7.0/go.mod h1:uTEOTwaqIVuTGiJN7ii13Ibp75wJmYUDe374q6cZwUU= +go.opentelemetry.io/otel/sdk v1.13.0/go.mod h1:YLKPx5+6Vx/o1TCUYYs+bpymtkmazOMT6zoRrC7AQ7I= +go.opentelemetry.io/otel/sdk v1.16.0 h1:Z1Ok1YsijYL0CSJpHt4cS3wDDh7p572grzNrBMiMWgE= +go.opentelemetry.io/otel/sdk v1.16.0/go.mod h1:tMsIuKXuuIWPBAOrH+eHtvhTL+SntFtXF9QD68aP6p4= +go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE= +go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE= +go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= +go.opentelemetry.io/otel/trace v1.3.0/go.mod h1:c/VDhno8888bvQYmbYLqe41/Ldmr/KKunbvWM4/fEjk= +go.opentelemetry.io/otel/trace v1.4.1/go.mod h1:iYEVbroFCNut9QkwEczV9vMRPHNKSSwYZjulEtsmhFc= +go.opentelemetry.io/otel/trace v1.5.0/go.mod h1:sq55kfhjXYr1zVSyexg0w1mpa03AYXR5eyTkB9NPPdE= +go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU= +go.opentelemetry.io/otel/trace v1.13.0/go.mod h1:muCvmmO9KKpvuXSf3KKAXXB2ygNYHQ+ZfI5X08d3tds= +go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= +go.opentelemetry.io/otel/trace v1.16.0 h1:8JRpaObFoW0pxuVPapkgH8UhHQj+bJW8jJsCZEu5MQs= +go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.opentelemetry.io/proto/otlp v0.11.0/go.mod h1:QpEjXPrNQzrFDZgoTo49dgHR9RYRSrg3NAKnUGl9YpQ= +go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= +go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= +go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/ratelimit v0.1.0/go.mod h1:2X8KaoNd1J0lZV+PxJk/5+DGbO/tpwLR1m++a7FnB/Y= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= +go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= +go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY= +go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= +go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= +golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181009213950-7c1a557ab941/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= +golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= +golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= +golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= +golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= +golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= +golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220923202941-7f9b1623fab7/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190522044717-8097e1b27ff5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190812073006-9eafafc0a87e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191220220014-0732a990476f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200817155316-9781c653f443/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200922070232-aee5d888a860/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201117170446-d9b008d0a637/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201202213521-69691e467435/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220405210540-1e041c57c461/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= +golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.9.0 h1:GRRCnKYhdQrD8kfRAdQ6Zcw1P0OcELxGLKJvtjVMZ28= +golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= +golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= +golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20220922220347-f3bd1da661af/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.1.0 h1:xYY+Bajn2a7VBmTM5GikTmnK8ZuX8YgnQCqZpbBNtmA= +golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190706070813-72ffa07ba3db/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20200916195026-c9a70fc28ce3/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= +golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= +golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= +golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= +golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= +google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= +google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= +google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= +google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= +google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= +google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= +google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= +google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= +google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= +google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= +google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= +google.golang.org/api v0.77.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= +google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= +google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= +google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= +google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= +google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI= +google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.99.0/go.mod h1:1YOf74vkVndF7pG6hIHuINsM7eWwpVTAfNMNiL91A08= +google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= +google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo= +google.golang.org/api v0.103.0/go.mod h1:hGtW6nK1AC+d9si/UBhw8Xli+QMOf6xyNAyJw4qU9w0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190522204451-c2c4e71fbf69/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= +google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200117163144-32f20d992d24/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= +google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= +google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220722212130-b98a9ff5e252/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= +google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220817144833-d7fd3f11b9b1/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220829144015-23454907ede3/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220829175752-36a9c930ecbf/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220913154956-18f8339a66a5/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220914142337-ca0e39ece12f/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220916172020-2692e8806bfa/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220919141832-68c03719ef51/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006/go.mod h1:ht8XFiar2npT/g4vkk7O0WYS1sHOHbdujxbEp7CJWbw= +google.golang.org/genproto v0.0.0-20220926165614-551eb538f295/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= +google.golang.org/genproto v0.0.0-20220926220553-6981cbe3cfce/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= +google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqwhZAwq4wsRUaVG555sVgsNmIjRtO7t/JH29U= +google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= +google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= +google.golang.org/genproto v0.0.0-20221024153911-1573dae28c9c/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= +google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= +google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo= +google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221117204609-8f9c96812029/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd/go.mod h1:cTsE614GARnxrLsqKREzmNYJACSWWpAWdNMwnD7c2BE= +google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc h1:8DyZCyvI8mE1IdLy/60bS+52xfymkE72wv1asokgtao= +google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= +google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc h1:kVKPf/IiYSBWEWtkIn6wZXwWGCnLKcC8oWfZvXjsGnM= +google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= +google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= +google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= +google.golang.org/grpc v1.56.1 h1:z0dNfjIl0VpaZ9iSVjA6daGatAYwPGstTjt5vkRMFkQ= +google.golang.org/grpc v1.56.1/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= +gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= +gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= +gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= +gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= +gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= +gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= +gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gorm.io/driver/clickhouse v0.5.1 h1:OJwu7RLRzeXXJjvfBciGC8RCwL2+OF/qFGlYGpiL81g= +gorm.io/driver/clickhouse v0.5.1/go.mod h1:rOHobfWCy8WZa29PQ1V20ij6w0mizPMxODvQpuUEMaU= +gorm.io/driver/mysql v1.5.1 h1:WUEH5VF9obL/lTtzjmML/5e6VfFR/788coz2uaVCAZw= +gorm.io/driver/mysql v1.5.1/go.mod h1:Jo3Xu7mMhCyj8dlrb3WoCaRd1FhsVh+yMXb1jUInf5o= +gorm.io/driver/postgres v1.5.2 h1:ytTDxxEv+MplXOfFe3Lzm7SjG09fcdb3Z/c056DTBx0= +gorm.io/driver/postgres v1.5.2/go.mod h1:fmpX0m2I1PKuR7mKZiEluwrP3hbs+ps7JIGMUBpCgl8= +gorm.io/driver/sqlite v1.5.2 h1:TpQ+/dqCY4uCigCFyrfnrJnrW9zjpelWVoEVNy5qJkc= +gorm.io/driver/sqlite v1.5.2/go.mod h1:qxAuCol+2r6PannQDpOP1FP6ag3mKi4esLnB/jHed+4= +gorm.io/driver/sqlserver v1.5.1 h1:wpyW/pR26U94uaujltiFGXY7fd2Jw5hC9PB1ZF/Y5s4= +gorm.io/driver/sqlserver v1.5.1/go.mod h1:AYHzzte2msKTmYBYsSIq8ZUsznLJwBdkB2wpI+kt0nM= +gorm.io/gorm v1.24.6/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= +gorm.io/gorm v1.25.1/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= +gorm.io/gorm v1.25.2 h1:gs1o6Vsa+oVKG/a9ElL3XgyGfghFfkKA2SInQaCyMho= +gorm.io/gorm v1.25.2/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= +gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +gotest.tools/gotestsum v1.8.2/go.mod h1:6JHCiN6TEjA7Kaz23q1bH0e2Dc3YJjDUZ0DmctFZf+w= +gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= +gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= +gotest.tools/v3 v3.3.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +k8s.io/api v0.17.0/go.mod h1:npsyOePkeP0CPwyGfXDHxvypiYMJxBWAMpQxCaJ4ZxI= +k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= +k8s.io/api v0.20.4/go.mod h1:++lNL1AJMkDymriNniQsWRkMDzRaX2Y/POTUi8yvqYQ= +k8s.io/api v0.20.6/go.mod h1:X9e8Qag6JV/bL5G6bU8sdVRltWKmdHsFUGS3eVndqE8= +k8s.io/api v0.22.5/go.mod h1:mEhXyLaSD1qTOf40rRiKXkc+2iCem09rWLlFwhCEiAs= +k8s.io/api v0.24.3/go.mod h1:elGR/XSZrS7z7cSZPzVWaycpJuGIw57j9b95/1PdJNI= +k8s.io/api v0.26.3/go.mod h1:PXsqwPMXBSBcL1lJ9CYDKy7kIReUydukS5JiRlxC3qE= +k8s.io/api v0.27.2 h1:+H17AJpUMvl+clT+BPnKf0E3ksMAzoBBg7CntpSuADo= +k8s.io/api v0.27.2/go.mod h1:ENmbocXfBT2ADujUXcBhHV55RIT31IIEvkntP6vZKS4= +k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= +k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= +k8s.io/apimachinery v0.20.4/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= +k8s.io/apimachinery v0.20.6/go.mod h1:ejZXtW1Ra6V1O5H8xPBGz+T3+4gfkTCeExAHKU57MAc= +k8s.io/apimachinery v0.22.1/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= +k8s.io/apimachinery v0.22.5/go.mod h1:xziclGKwuuJ2RM5/rSFQSYAj0zdbci3DH8kj+WvyN0U= +k8s.io/apimachinery v0.24.3/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= +k8s.io/apimachinery v0.26.3/go.mod h1:ats7nN1LExKHvJ9TmwootT00Yz05MuYqPXEXaVeOy5I= +k8s.io/apimachinery v0.27.2 h1:vBjGaKKieaIreI+oQwELalVG4d8f3YAMNpWLzDXkxeg= +k8s.io/apimachinery v0.27.2/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E= +k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= +k8s.io/apiserver v0.20.4/go.mod h1:Mc80thBKOyy7tbvFtB4kJv1kbdD0eIH8k8vianJcbFM= +k8s.io/apiserver v0.20.6/go.mod h1:QIJXNt6i6JB+0YQRNcS0hdRHJlMhflFmsBDeSgT1r8Q= +k8s.io/apiserver v0.22.5/go.mod h1:s2WbtgZAkTKt679sYtSudEQrTGWUSQAPe6MupLnlmaQ= +k8s.io/client-go v0.17.0/go.mod h1:TYgR6EUHs6k45hb6KWjVD6jFZvJV4gHDikv/It0xz+k= +k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= +k8s.io/client-go v0.20.4/go.mod h1:LiMv25ND1gLUdBeYxBIwKpkSC5IsozMMmOOeSJboP+k= +k8s.io/client-go v0.20.6/go.mod h1:nNQMnOvEUEsOzRRFIIkdmYOjAZrC8bgq0ExboWSU1I0= +k8s.io/client-go v0.22.5/go.mod h1:cs6yf/61q2T1SdQL5Rdcjg9J1ElXSwbjSrW2vFImM4Y= +k8s.io/client-go v0.24.3/go.mod h1:AAovolf5Z9bY1wIg2FZ8LPQlEdKHjLI7ZD4rw920BJw= +k8s.io/client-go v0.26.3/go.mod h1:ZPNu9lm8/dbRIPAgteN30RSXea6vrCpFvq+MateTUuQ= +k8s.io/client-go v0.27.2 h1:vDLSeuYvCHKeoQRhCXjxXO45nHVv2Ip4Fe0MfioMrhE= +k8s.io/client-go v0.27.2/go.mod h1:tY0gVmUsHrAmjzHX9zs7eCjxcBsf8IiNe7KQ52biTcQ= +k8s.io/code-generator v0.19.7/go.mod h1:lwEq3YnLYb/7uVXLorOJfxg+cUu2oihFhHZ0n9NIla0= +k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk= +k8s.io/component-base v0.20.4/go.mod h1:t4p9EdiagbVCJKrQ1RsA5/V4rFQNDfRlevJajlGwgjI= +k8s.io/component-base v0.20.6/go.mod h1:6f1MPBAeI+mvuts3sIdtpjljHWBQ2cIy38oBIWMYnrM= +k8s.io/component-base v0.22.5/go.mod h1:VK3I+TjuF9eaa+Ln67dKxhGar5ynVbwnGrUiNF4MqCI= +k8s.io/cri-api v0.17.3/go.mod h1:X1sbHmuXhwaHs9xxYffLqJogVsnI+f6cPRcgPel7ywM= +k8s.io/cri-api v0.20.1/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= +k8s.io/cri-api v0.20.4/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= +k8s.io/cri-api v0.20.6/go.mod h1:ew44AjNXwyn1s0U4xCKGodU7J1HzBeZ1MpGrpa5r8Yc= +k8s.io/cri-api v0.23.1/go.mod h1:REJE3PSU0h/LOV1APBrupxrEJqnoxZC8KWzkBUHwrK4= +k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= +k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= +k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= +k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= +k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= +k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.60.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw= +k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= +k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= +k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= +k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= +k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= +k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42/go.mod h1:Z/45zLw8lUo4wdiUkI+v/ImEGAvu3WatcZl3lPMR4Rk= +k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4= +k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg= +k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg= +k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= +k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20221107191617-1a15be271d1d/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY= +k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.22/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= +sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2/go.mod h1:B+TnT182UBxE84DiCz4CVE26eOSDAeYCpfDnC2kdKMY= +sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= +sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= +sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= +sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= +sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/orm/gorm/pkg/README.md b/orm/gorm/pkg/README.md new file mode 100644 index 0000000..d28623c --- /dev/null +++ b/orm/gorm/pkg/README.md @@ -0,0 +1 @@ +# common used packages \ No newline at end of file diff --git a/orm/gorm/pkg/bootstrap/bootstrap.go b/orm/gorm/pkg/bootstrap/bootstrap.go new file mode 100644 index 0000000..4484d7e --- /dev/null +++ b/orm/gorm/pkg/bootstrap/bootstrap.go @@ -0,0 +1,35 @@ +package bootstrap + +import ( + "github.com/go-kratos/kratos/v2/log" + "github.com/go-kratos/kratos/v2/registry" + + "kratos-gorm-example/gen/api/go/common/conf" +) + +// Bootstrap 应用引导启动 +func Bootstrap(serviceInfo *ServiceInfo) (*conf.Bootstrap, log.Logger, registry.Registrar) { + // inject command flags + Flags := NewCommandFlags() + Flags.Init() + + // load configs + cfg := LoadBootstrapConfig(Flags.Conf) + if cfg == nil { + panic("load config failed") + } + + // init logger + ll := NewLoggerProvider(cfg.Logger, serviceInfo) + + // init registrar + reg := NewRegistry(cfg.Registry) + + // init tracer + err := NewTracerProvider(cfg.Trace, serviceInfo) + if err != nil { + panic(err) + } + + return cfg, ll, reg +} diff --git a/orm/gorm/pkg/bootstrap/cli.go b/orm/gorm/pkg/bootstrap/cli.go new file mode 100644 index 0000000..eda1386 --- /dev/null +++ b/orm/gorm/pkg/bootstrap/cli.go @@ -0,0 +1,14 @@ +package bootstrap + +// FIX: missing go.sum entry for module providing package XXXXXXXXXXXXXXXXXXXXX + +import ( + // wire + _ "github.com/google/subcommands" + _ "golang.org/x/tools/go/ast/astutil" + _ "golang.org/x/tools/go/packages" + + // ent + _ "github.com/olekukonko/tablewriter" + _ "github.com/spf13/cobra" +) diff --git a/orm/gorm/pkg/bootstrap/config.go b/orm/gorm/pkg/bootstrap/config.go new file mode 100644 index 0000000..015c5f4 --- /dev/null +++ b/orm/gorm/pkg/bootstrap/config.go @@ -0,0 +1,323 @@ +package bootstrap + +import ( + "os" + "path/filepath" + "strings" + + "google.golang.org/grpc" + + "github.com/go-kratos/kratos/v2/config" + "github.com/go-kratos/kratos/v2/log" + + // file + fileKratos "github.com/go-kratos/kratos/v2/config/file" + + // etcd + etcdKratos "github.com/go-kratos/kratos/contrib/config/etcd/v2" + etcdClient "go.etcd.io/etcd/client/v3" + + // consul + consulKratos "github.com/go-kratos/kratos/contrib/config/consul/v2" + consulApi "github.com/hashicorp/consul/api" + + // nacos + nacosKratos "github.com/go-kratos/kratos/contrib/config/nacos/v2" + nacosClients "github.com/nacos-group/nacos-sdk-go/clients" + nacosConstant "github.com/nacos-group/nacos-sdk-go/common/constant" + nacosVo "github.com/nacos-group/nacos-sdk-go/vo" + + // apollo + apolloKratos "github.com/go-kratos/kratos/contrib/config/apollo/v2" + + // kubernetes + k8sKratos "github.com/go-kratos/kratos/contrib/config/kubernetes/v2" + k8sUtil "k8s.io/client-go/util/homedir" + + "kratos-gorm-example/gen/api/go/common/conf" +) + +const remoteConfigSourceConfigFile = "remote.yaml" + +// NewConfigProvider 创建一个配置 +func NewConfigProvider(configPath string) config.Config { + err, rc := LoadRemoteConfigSourceConfigs(configPath) + if err != nil { + log.Error("LoadRemoteConfigSourceConfigs: ", err.Error()) + } + if rc != nil { + return config.New( + config.WithSource( + NewFileConfigSource(configPath), + NewRemoteConfigSource(rc), + ), + ) + } else { + return config.New( + config.WithSource( + NewFileConfigSource(configPath), + ), + ) + } +} + +// LoadBootstrapConfig 加载程序引导配置 +func LoadBootstrapConfig(configPath string) *conf.Bootstrap { + cfg := NewConfigProvider(configPath) + if err := cfg.Load(); err != nil { + panic(err) + } + + var bc conf.Bootstrap + if err := cfg.Scan(&bc); err != nil { + panic(err) + } + + if bc.Server == nil { + bc.Server = &conf.Server{} + _ = cfg.Scan(&bc.Server) + } + + if bc.Client == nil { + bc.Client = &conf.Client{} + _ = cfg.Scan(&bc.Client) + } + + if bc.Data == nil { + bc.Data = &conf.Data{} + _ = cfg.Scan(&bc.Data) + } + + if bc.Trace == nil { + bc.Trace = &conf.Tracer{} + _ = cfg.Scan(&bc.Trace) + } + + if bc.Logger == nil { + bc.Logger = &conf.Logger{} + _ = cfg.Scan(&bc.Logger) + } + + if bc.Registry == nil { + bc.Registry = &conf.Registry{} + _ = cfg.Scan(&bc.Registry) + } + + if bc.Oss == nil { + bc.Oss = &conf.OSS{} + _ = cfg.Scan(&bc.Oss) + } + + return &bc +} + +func pathExists(path string) bool { + _, err := os.Stat(path) + if err == nil { + return true + } + if os.IsNotExist(err) { + return false + } + return false +} + +// LoadRemoteConfigSourceConfigs 加载远程配置源的本地配置 +func LoadRemoteConfigSourceConfigs(configPath string) (error, *conf.RemoteConfig) { + configPath = configPath + "/" + remoteConfigSourceConfigFile + if !pathExists(configPath) { + return nil, nil + } + + cfg := config.New( + config.WithSource( + NewFileConfigSource(configPath), + ), + ) + defer func(cfg config.Config) { + err := cfg.Close() + if err != nil { + panic(err) + } + }(cfg) + + var err error + + if err = cfg.Load(); err != nil { + return err, nil + } + + var rc conf.Bootstrap + if err = cfg.Scan(&rc); err != nil { + return err, nil + } + + return nil, rc.Config +} + +type ConfigType string + +const ( + ConfigTypeLocalFile ConfigType = "file" + ConfigTypeNacos ConfigType = "nacos" + ConfigTypeConsul ConfigType = "consul" + ConfigTypeEtcd ConfigType = "etcd" + ConfigTypeApollo ConfigType = "apollo" + ConfigTypeKubernetes ConfigType = "kubernetes" + ConfigTypePolaris ConfigType = "polaris" +) + +// NewRemoteConfigSource 创建一个远程配置源 +func NewRemoteConfigSource(c *conf.RemoteConfig) config.Source { + switch ConfigType(c.Type) { + default: + fallthrough + case ConfigTypeLocalFile: + return nil + case ConfigTypeNacos: + return NewNacosConfigSource(c) + case ConfigTypeConsul: + return NewConsulConfigSource(c) + case ConfigTypeEtcd: + return NewEtcdConfigSource(c) + case ConfigTypeApollo: + return NewApolloConfigSource(c) + case ConfigTypeKubernetes: + return NewKubernetesConfigSource(c) + case ConfigTypePolaris: + return NewPolarisConfigSource(c) + } +} + +// getConfigKey 获取合法的配置名 +func getConfigKey(configKey string, useBackslash bool) string { + if useBackslash { + return strings.Replace(configKey, `.`, `/`, -1) + } else { + return configKey + } +} + +// NewFileConfigSource 创建一个本地文件配置源 +func NewFileConfigSource(filePath string) config.Source { + return fileKratos.NewSource(filePath) +} + +// NewNacosConfigSource 创建一个远程配置源 - Nacos +func NewNacosConfigSource(c *conf.RemoteConfig) config.Source { + srvConf := []nacosConstant.ServerConfig{ + *nacosConstant.NewServerConfig(c.Nacos.Address, c.Nacos.Port), + } + + cliConf := nacosConstant.ClientConfig{ + TimeoutMs: 10 * 1000, // http请求超时时间,单位毫秒 + BeatInterval: 5 * 1000, // 心跳间隔时间,单位毫秒 + UpdateThreadNum: 20, // 更新服务的线程数 + LogLevel: "debug", + CacheDir: "../../configs/cache", // 缓存目录 + LogDir: "../../configs/log", // 日志目录 + NotLoadCacheAtStart: true, // 在启动时不读取本地缓存数据,true--不读取,false--读取 + UpdateCacheWhenEmpty: true, // 当服务列表为空时是否更新本地缓存,true--更新,false--不更新 + } + + nacosClient, err := nacosClients.NewConfigClient( + nacosVo.NacosClientParam{ + ClientConfig: &cliConf, + ServerConfigs: srvConf, + }, + ) + if err != nil { + log.Fatal(err) + } + + return nacosKratos.NewConfigSource(nacosClient, + nacosKratos.WithGroup(getConfigKey(c.Nacos.Key, false)), + nacosKratos.WithDataID("bootstrap.yaml"), + ) +} + +// NewEtcdConfigSource 创建一个远程配置源 - Etcd +func NewEtcdConfigSource(c *conf.RemoteConfig) config.Source { + cfg := etcdClient.Config{ + Endpoints: c.Etcd.Endpoints, + DialTimeout: c.Etcd.Timeout.AsDuration(), + DialOptions: []grpc.DialOption{grpc.WithBlock()}, + } + + cli, err := etcdClient.New(cfg) + if err != nil { + panic(err) + } + + source, err := etcdKratos.New(cli, etcdKratos.WithPath(getConfigKey(c.Etcd.Key, true))) + if err != nil { + log.Fatal(err) + } + + return source +} + +// NewConsulConfigSource 创建一个远程配置源 - Consul +func NewConsulConfigSource(c *conf.RemoteConfig) config.Source { + cfg := consulApi.DefaultConfig() + cfg.Address = c.Consul.Address + cfg.Scheme = c.Consul.Scheme + + cli, err := consulApi.NewClient(cfg) + if err != nil { + log.Fatal(err) + } + + source, err := consulKratos.New(cli, + consulKratos.WithPath(getConfigKey(c.Consul.Key, true)), + ) + if err != nil { + log.Fatal(err) + } + + return source +} + +// NewApolloConfigSource 创建一个远程配置源 - Apollo +func NewApolloConfigSource(c *conf.RemoteConfig) config.Source { + source := apolloKratos.NewSource( + apolloKratos.WithAppID(c.Apollo.AppId), + apolloKratos.WithCluster(c.Apollo.Cluster), + apolloKratos.WithEndpoint(c.Apollo.Endpoint), + apolloKratos.WithNamespace(c.Apollo.Namespace), + apolloKratos.WithSecret(c.Apollo.Secret), + apolloKratos.WithEnableBackup(), + ) + return source +} + +// NewKubernetesConfigSource 创建一个远程配置源 - Kubernetes +func NewKubernetesConfigSource(c *conf.RemoteConfig) config.Source { + source := k8sKratos.NewSource( + k8sKratos.Namespace(c.Kubernetes.Namespace), + k8sKratos.LabelSelector(""), + k8sKratos.KubeConfig(filepath.Join(k8sUtil.HomeDir(), ".kube", "config")), + ) + return source +} + +// NewPolarisConfigSource 创建一个远程配置源 - Polaris +func NewPolarisConfigSource(_ *conf.RemoteConfig) config.Source { + //configApi, err := polarisApi.NewConfigAPI() + //if err != nil { + // log.Fatal(err) + //} + // + //var opts []polarisKratos.Option + //opts = append(opts, polarisKratos.WithNamespace("default")) + //opts = append(opts, polarisKratos.WithFileGroup("default")) + //opts = append(opts, polarisKratos.WithFileName("default.yaml")) + // + //source, err := polarisKratos.New(configApi, opts...) + //if err != nil { + // log.Fatal(err) + //} + // + //return source + return nil +} diff --git a/orm/gorm/pkg/bootstrap/daemon.go b/orm/gorm/pkg/bootstrap/daemon.go new file mode 100644 index 0000000..477048f --- /dev/null +++ b/orm/gorm/pkg/bootstrap/daemon.go @@ -0,0 +1,39 @@ +package bootstrap + +import ( + "fmt" + "os" + "os/exec" +) + +func stripSlice(slice []string, element string) []string { + for i := 0; i < len(slice); { + if slice[i] == element && i != len(slice)-1 { + slice = append(slice[:i], slice[i+1:]...) + } else if slice[i] == element && i == len(slice)-1 { + slice = slice[:i] + } else { + i++ + } + } + return slice +} + +func subProcess(args []string) *exec.Cmd { + cmd := exec.Command(args[0], args[1:]...) + cmd.Stdin = os.Stdin + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + err := cmd.Start() + if err != nil { + _, _ = fmt.Fprintf(os.Stderr, "[-] Error: %s\n", err) + } + return cmd +} + +// BeDaemon 将当前进程转为守护进程 +func BeDaemon(arg string) { + subProcess(stripSlice(os.Args, arg)) + fmt.Printf("[*] Daemon running in PID: %d PPID: %d\n", os.Getpid(), os.Getppid()) + os.Exit(0) +} diff --git a/orm/gorm/pkg/bootstrap/flag.go b/orm/gorm/pkg/bootstrap/flag.go new file mode 100644 index 0000000..eaead94 --- /dev/null +++ b/orm/gorm/pkg/bootstrap/flag.go @@ -0,0 +1,35 @@ +package bootstrap + +import "flag" + +type CommandFlags struct { + Conf string // 引导配置文件路径,默认为:../../configs + Env string // 开发环境:dev、debug…… + ConfigHost string // 远程配置服务端地址 + ConfigType string // 远程配置服务端类型 + Daemon bool // 是否转为守护进程 +} + +func NewCommandFlags() *CommandFlags { + return &CommandFlags{ + Conf: "", + Env: "", + ConfigHost: "", + ConfigType: "", + Daemon: false, + } +} + +func (f *CommandFlags) Init() { + flag.StringVar(&f.Conf, "conf", "../../configs", "config path, eg: -conf ../../configs") + flag.StringVar(&f.Env, "env", "dev", "runtime environment, eg: -env dev") + flag.StringVar(&f.ConfigHost, "chost", "127.0.0.1:8500", "config server host, eg: -chost 127.0.0.1:8500") + flag.StringVar(&f.ConfigType, "ctype", "consul", "config server host, eg: -ctype consul") + flag.BoolVar(&f.Daemon, "d", false, "run app as a daemon with -d=true.") + + if f.Daemon { + BeDaemon("-d") + } + + flag.Parse() +} diff --git a/orm/gorm/pkg/bootstrap/grpc.go b/orm/gorm/pkg/bootstrap/grpc.go new file mode 100644 index 0000000..86dd9f1 --- /dev/null +++ b/orm/gorm/pkg/bootstrap/grpc.go @@ -0,0 +1,69 @@ +package bootstrap + +import ( + "context" + "time" + + "google.golang.org/grpc" + "google.golang.org/protobuf/types/known/durationpb" + + "github.com/go-kratos/kratos/v2/log" + "github.com/go-kratos/kratos/v2/middleware" + "github.com/go-kratos/kratos/v2/middleware/recovery" + "github.com/go-kratos/kratos/v2/middleware/tracing" + "github.com/go-kratos/kratos/v2/registry" + kratosGrpc "github.com/go-kratos/kratos/v2/transport/grpc" + + "kratos-gorm-example/gen/api/go/common/conf" +) + +const defaultTimeout = 5 * time.Second + +// CreateGrpcClient 创建GRPC客户端 +func CreateGrpcClient(ctx context.Context, r registry.Discovery, serviceName string, timeoutDuration *durationpb.Duration) grpc.ClientConnInterface { + timeout := defaultTimeout + if timeoutDuration != nil { + timeout = timeoutDuration.AsDuration() + } + + endpoint := "discovery:///" + serviceName + + conn, err := kratosGrpc.DialInsecure( + ctx, + kratosGrpc.WithEndpoint(endpoint), + kratosGrpc.WithDiscovery(r), + kratosGrpc.WithTimeout(timeout), + kratosGrpc.WithMiddleware( + tracing.Client(), + recovery.Recovery(), + ), + ) + if err != nil { + log.Fatalf("dial grpc client [%s] failed: %s", serviceName, err.Error()) + } + + return conn +} + +// CreateGrpcServer 创建GRPC服务端 +func CreateGrpcServer(cfg *conf.Bootstrap, m ...middleware.Middleware) *kratosGrpc.Server { + var opts []kratosGrpc.ServerOption + + var ms []middleware.Middleware + ms = append(ms, recovery.Recovery()) + ms = append(ms, tracing.Server()) + ms = append(ms, m...) + opts = append(opts, kratosGrpc.Middleware(ms...)) + + if cfg.Server.Grpc.Network != "" { + opts = append(opts, kratosGrpc.Network(cfg.Server.Grpc.Network)) + } + if cfg.Server.Grpc.Addr != "" { + opts = append(opts, kratosGrpc.Address(cfg.Server.Grpc.Addr)) + } + if cfg.Server.Grpc.Timeout != nil { + opts = append(opts, kratosGrpc.Timeout(cfg.Server.Grpc.Timeout.AsDuration())) + } + + return kratosGrpc.NewServer(opts...) +} diff --git a/orm/gorm/pkg/bootstrap/logger.go b/orm/gorm/pkg/bootstrap/logger.go new file mode 100644 index 0000000..8d207d2 --- /dev/null +++ b/orm/gorm/pkg/bootstrap/logger.go @@ -0,0 +1,180 @@ +package bootstrap + +import ( + "os" + + "github.com/sirupsen/logrus" + + "go.uber.org/zap" + "go.uber.org/zap/zapcore" + "gopkg.in/natefinch/lumberjack.v2" + + aliyunLogger "github.com/go-kratos/kratos/contrib/log/aliyun/v2" + fluentLogger "github.com/go-kratos/kratos/contrib/log/fluent/v2" + logrusLogger "github.com/go-kratos/kratos/contrib/log/logrus/v2" + tencentLogger "github.com/go-kratos/kratos/contrib/log/tencent/v2" + zapLogger "github.com/go-kratos/kratos/contrib/log/zap/v2" + + "github.com/go-kratos/kratos/v2/log" + "github.com/go-kratos/kratos/v2/middleware/tracing" + + "kratos-gorm-example/gen/api/go/common/conf" +) + +type LoggerType string + +const ( + LoggerTypeStd LoggerType = "std" + LoggerTypeFluent LoggerType = "fluent" + LoggerTypeLogrus LoggerType = "logrus" + LoggerTypeZap LoggerType = "zap" + LoggerTypeAliyun LoggerType = "aliyun" + LoggerTypeTencent LoggerType = "tencent" +) + +// NewLoggerProvider 创建一个新的日志记录器提供者 +func NewLoggerProvider(cfg *conf.Logger, serviceInfo *ServiceInfo) log.Logger { + l := NewLogger(cfg) + + return log.With( + l, + "service.id", serviceInfo.Id, + "service.name", serviceInfo.Name, + "service.version", serviceInfo.Version, + "ts", log.DefaultTimestamp, + "caller", log.DefaultCaller, + "trace_id", tracing.TraceID(), + "span_id", tracing.SpanID(), + ) +} + +// NewLogger 创建一个新的日志记录器 +func NewLogger(cfg *conf.Logger) log.Logger { + if cfg == nil { + return NewStdLogger() + } + + switch LoggerType(cfg.Type) { + default: + fallthrough + case LoggerTypeStd: + return NewStdLogger() + case LoggerTypeFluent: + return NewFluentLogger(cfg) + case LoggerTypeZap: + return NewZapLogger(cfg) + case LoggerTypeLogrus: + return NewLogrusLogger(cfg) + case LoggerTypeAliyun: + return NewAliyunLogger(cfg) + case LoggerTypeTencent: + return NewTencentLogger(cfg) + } +} + +// NewStdLogger 创建一个新的日志记录器 - Kratos内置,控制台输出 +func NewStdLogger() log.Logger { + l := log.NewStdLogger(os.Stdout) + return l +} + +// NewZapLogger 创建一个新的日志记录器 - Zap +func NewZapLogger(cfg *conf.Logger) log.Logger { + encoderConfig := zap.NewProductionEncoderConfig() + encoderConfig.EncodeTime = zapcore.ISO8601TimeEncoder + encoderConfig.TimeKey = "time" + encoderConfig.EncodeLevel = zapcore.CapitalLevelEncoder + encoderConfig.EncodeDuration = zapcore.SecondsDurationEncoder + encoderConfig.EncodeCaller = zapcore.ShortCallerEncoder + jsonEncoder := zapcore.NewJSONEncoder(encoderConfig) + + lumberJackLogger := &lumberjack.Logger{ + Filename: cfg.Zap.Filename, + MaxSize: int(cfg.Zap.MaxSize), + MaxBackups: int(cfg.Zap.MaxBackups), + MaxAge: int(cfg.Zap.MaxAge), + } + writeSyncer := zapcore.AddSync(lumberJackLogger) + + var lvl = new(zapcore.Level) + if err := lvl.UnmarshalText([]byte(cfg.Zap.Level)); err != nil { + return nil + } + + core := zapcore.NewCore(jsonEncoder, writeSyncer, lvl) + logger := zap.New(core).WithOptions() + + wrapped := zapLogger.NewLogger(logger) + + return wrapped +} + +// NewLogrusLogger 创建一个新的日志记录器 - Logrus +func NewLogrusLogger(cfg *conf.Logger) log.Logger { + loggerLevel, err := logrus.ParseLevel(cfg.Logrus.Level) + if err != nil { + loggerLevel = logrus.InfoLevel + } + + var loggerFormatter logrus.Formatter + switch cfg.Logrus.Formatter { + default: + fallthrough + case "text": + loggerFormatter = &logrus.TextFormatter{ + DisableColors: cfg.Logrus.DisableColors, + DisableTimestamp: cfg.Logrus.DisableTimestamp, + TimestampFormat: cfg.Logrus.TimestampFormat, + } + break + case "json": + loggerFormatter = &logrus.JSONFormatter{ + DisableTimestamp: cfg.Logrus.DisableTimestamp, + TimestampFormat: cfg.Logrus.TimestampFormat, + } + break + } + + logger := logrus.New() + logger.Level = loggerLevel + logger.Formatter = loggerFormatter + + wrapped := logrusLogger.NewLogger(logger) + return wrapped +} + +// NewFluentLogger 创建一个新的日志记录器 - Fluent +func NewFluentLogger(cfg *conf.Logger) log.Logger { + wrapped, err := fluentLogger.NewLogger(cfg.Fluent.Endpoint) + if err != nil { + panic("create fluent logger failed") + return nil + } + return wrapped +} + +// NewAliyunLogger 创建一个新的日志记录器 - Aliyun +func NewAliyunLogger(cfg *conf.Logger) log.Logger { + wrapped := aliyunLogger.NewAliyunLog( + aliyunLogger.WithProject(cfg.Aliyun.Project), + aliyunLogger.WithEndpoint(cfg.Aliyun.Endpoint), + aliyunLogger.WithAccessKey(cfg.Aliyun.AccessKey), + aliyunLogger.WithAccessSecret(cfg.Aliyun.AccessSecret), + ) + return wrapped +} + +// NewTencentLogger 创建一个新的日志记录器 - Tencent +func NewTencentLogger(cfg *conf.Logger) log.Logger { + wrapped, err := tencentLogger.NewLogger( + tencentLogger.WithTopicID(cfg.Tencent.TopicId), + tencentLogger.WithEndpoint(cfg.Tencent.Endpoint), + tencentLogger.WithAccessKey(cfg.Tencent.AccessKey), + tencentLogger.WithAccessSecret(cfg.Tencent.AccessSecret), + ) + if err != nil { + panic(err) + return nil + } + return wrapped +} diff --git a/orm/gorm/pkg/bootstrap/oss.go b/orm/gorm/pkg/bootstrap/oss.go new file mode 100644 index 0000000..74a8c3c --- /dev/null +++ b/orm/gorm/pkg/bootstrap/oss.go @@ -0,0 +1,25 @@ +package bootstrap + +import ( + "github.com/go-kratos/kratos/v2/log" + "github.com/minio/minio-go/v7" + + "github.com/minio/minio-go/v7/pkg/credentials" + + "kratos-gorm-example/gen/api/go/common/conf" +) + +func NewMinIoClient(conf *conf.OSS) *minio.Client { + impl, err := minio.New(conf.Minio.Endpoint, + &minio.Options{ + Creds: credentials.NewStaticV4(conf.Minio.AccessKey, conf.Minio.SecretKey, conf.Minio.Token), + Secure: conf.Minio.UseSsl, + }, + ) + if err != nil { + log.Fatal("failed opening connection to minio", err) + return nil + } + + return impl +} diff --git a/orm/gorm/pkg/bootstrap/redis.go b/orm/gorm/pkg/bootstrap/redis.go new file mode 100644 index 0000000..7a4c070 --- /dev/null +++ b/orm/gorm/pkg/bootstrap/redis.go @@ -0,0 +1,29 @@ +package bootstrap + +import ( + "github.com/go-kratos/kratos/v2/log" + + "github.com/go-redis/redis/extra/redisotel/v8" + "github.com/go-redis/redis/v8" + + "kratos-gorm-example/gen/api/go/common/conf" +) + +// NewRedisClient 创建Redis客户端 +func NewRedisClient(cfg *conf.Bootstrap, logger *log.Helper) *redis.Client { + rdb := redis.NewClient(&redis.Options{ + Addr: cfg.Data.Redis.Addr, + Password: cfg.Data.Redis.Password, + DB: int(cfg.Data.Redis.Db), + DialTimeout: cfg.Data.Redis.DialTimeout.AsDuration(), + WriteTimeout: cfg.Data.Redis.WriteTimeout.AsDuration(), + ReadTimeout: cfg.Data.Redis.ReadTimeout.AsDuration(), + }) + if rdb == nil { + logger.Fatalf("failed opening connection to redis") + return nil + } + rdb.AddHook(redisotel.NewTracingHook()) + + return rdb +} diff --git a/orm/gorm/pkg/bootstrap/registry.go b/orm/gorm/pkg/bootstrap/registry.go new file mode 100644 index 0000000..9b8eaa5 --- /dev/null +++ b/orm/gorm/pkg/bootstrap/registry.go @@ -0,0 +1,284 @@ +package bootstrap + +import ( + "github.com/go-kratos/kratos/v2/log" + "github.com/go-kratos/kratos/v2/registry" + "path/filepath" + + // etcd + etcdKratos "github.com/go-kratos/kratos/contrib/registry/etcd/v2" + etcdClient "go.etcd.io/etcd/client/v3" + + // consul + consulKratos "github.com/go-kratos/kratos/contrib/registry/consul/v2" + consulClient "github.com/hashicorp/consul/api" + + // eureka + eurekaKratos "github.com/go-kratos/kratos/contrib/registry/eureka/v2" + + // nacos + nacosKratos "github.com/go-kratos/kratos/contrib/registry/nacos/v2" + nacosClients "github.com/nacos-group/nacos-sdk-go/clients" + nacosConstant "github.com/nacos-group/nacos-sdk-go/common/constant" + nacosVo "github.com/nacos-group/nacos-sdk-go/vo" + + // zookeeper + zookeeperKratos "github.com/go-kratos/kratos/contrib/registry/zookeeper/v2" + "github.com/go-zookeeper/zk" + + // kubernetes + k8sRegistry "github.com/go-kratos/kratos/contrib/registry/kubernetes/v2" + k8s "k8s.io/client-go/kubernetes" + k8sRest "k8s.io/client-go/rest" + k8sTools "k8s.io/client-go/tools/clientcmd" + k8sUtil "k8s.io/client-go/util/homedir" + + // servicecomb + servicecombClient "github.com/go-chassis/sc-client" + servicecombKratos "github.com/go-kratos/kratos/contrib/registry/servicecomb/v2" + + "kratos-gorm-example/gen/api/go/common/conf" +) + +type RegistryType string + +const ( + RegistryTypeConsul RegistryType = "consul" + RegistryTypeEtcd RegistryType = "etcd" + RegistryTypeZooKeeper RegistryType = "zookeeper" + RegistryTypeNacos RegistryType = "nacos" + RegistryTypeKubernetes RegistryType = "kubernetes" + RegistryTypeEureka RegistryType = "eureka" + RegistryTypePolaris RegistryType = "polaris" + RegistryTypeServicecomb RegistryType = "servicecomb" +) + +// NewRegistry 创建一个注册客户端 +func NewRegistry(cfg *conf.Registry) registry.Registrar { + if cfg == nil { + return nil + } + + switch RegistryType(cfg.Type) { + case RegistryTypeConsul: + return NewConsulRegistry(cfg) + case RegistryTypeEtcd: + return NewEtcdRegistry(cfg) + case RegistryTypeZooKeeper: + return NewZooKeeperRegistry(cfg) + case RegistryTypeNacos: + return NewNacosRegistry(cfg) + case RegistryTypeKubernetes: + return NewKubernetesRegistry(cfg) + case RegistryTypeEureka: + return NewEurekaRegistry(cfg) + case RegistryTypePolaris: + return nil + case RegistryTypeServicecomb: + return NewServicecombRegistry(cfg) + } + + return nil +} + +// NewDiscovery 创建一个发现客户端 +func NewDiscovery(cfg *conf.Registry) registry.Discovery { + if cfg == nil { + return nil + } + + switch RegistryType(cfg.Type) { + case RegistryTypeConsul: + return NewConsulRegistry(cfg) + case RegistryTypeEtcd: + return NewEtcdRegistry(cfg) + case RegistryTypeZooKeeper: + return NewZooKeeperRegistry(cfg) + case RegistryTypeNacos: + return NewNacosRegistry(cfg) + case RegistryTypeKubernetes: + return NewKubernetesRegistry(cfg) + case RegistryTypeEureka: + return NewEurekaRegistry(cfg) + case RegistryTypePolaris: + return nil + case RegistryTypeServicecomb: + return NewServicecombRegistry(cfg) + } + + return nil +} + +// NewConsulRegistry 创建一个注册发现客户端 - Consul +func NewConsulRegistry(c *conf.Registry) *consulKratos.Registry { + cfg := consulClient.DefaultConfig() + cfg.Address = c.Consul.Address + cfg.Scheme = c.Consul.Scheme + + var cli *consulClient.Client + var err error + if cli, err = consulClient.NewClient(cfg); err != nil { + log.Fatal(err) + } + + reg := consulKratos.New(cli, consulKratos.WithHealthCheck(c.Consul.HealthCheck)) + + return reg +} + +// NewEtcdRegistry 创建一个注册发现客户端 - Etcd +func NewEtcdRegistry(c *conf.Registry) *etcdKratos.Registry { + cfg := etcdClient.Config{ + Endpoints: c.Etcd.Endpoints, + } + + var err error + var cli *etcdClient.Client + if cli, err = etcdClient.New(cfg); err != nil { + log.Fatal(err) + } + + reg := etcdKratos.New(cli) + + return reg +} + +// NewZooKeeperRegistry 创建一个注册发现客户端 - ZooKeeper +func NewZooKeeperRegistry(c *conf.Registry) *zookeeperKratos.Registry { + conn, _, err := zk.Connect(c.Zookeeper.Endpoints, c.Zookeeper.Timeout.AsDuration()) + if err != nil { + log.Fatal(err) + } + + reg := zookeeperKratos.New(conn) + if err != nil { + log.Fatal(err) + } + + return reg +} + +// NewNacosRegistry 创建一个注册发现客户端 - Nacos +func NewNacosRegistry(c *conf.Registry) *nacosKratos.Registry { + srvConf := []nacosConstant.ServerConfig{ + *nacosConstant.NewServerConfig(c.Nacos.Address, c.Nacos.Port), + } + + cliConf := nacosConstant.ClientConfig{ + NamespaceId: c.Nacos.NamespaceId, + TimeoutMs: uint64(c.Nacos.Timeout.AsDuration().Milliseconds()), // http请求超时时间,单位毫秒 + BeatInterval: c.Nacos.BeatInterval.AsDuration().Milliseconds(), // 心跳间隔时间,单位毫秒 + UpdateThreadNum: int(c.Nacos.UpdateThreadNum), // 更新服务的线程数 + LogLevel: c.Nacos.LogLevel, + CacheDir: c.Nacos.CacheDir, // 缓存目录 + LogDir: c.Nacos.LogDir, // 日志目录 + NotLoadCacheAtStart: c.Nacos.NotLoadCacheAtStart, // 在启动时不读取本地缓存数据,true--不读取,false--读取 + UpdateCacheWhenEmpty: c.Nacos.UpdateCacheWhenEmpty, // 当服务列表为空时是否更新本地缓存,true--更新,false--不更新 + } + + cli, err := nacosClients.NewNamingClient( + nacosVo.NacosClientParam{ + ClientConfig: &cliConf, + ServerConfigs: srvConf, + }, + ) + if err != nil { + log.Fatal(err) + } + + reg := nacosKratos.New(cli) + + return reg +} + +// NewKubernetesRegistry 创建一个注册发现客户端 - Kubernetes +func NewKubernetesRegistry(_ *conf.Registry) *k8sRegistry.Registry { + restConfig, err := k8sRest.InClusterConfig() + if err != nil { + home := k8sUtil.HomeDir() + kubeConfig := filepath.Join(home, ".kube", "config") + restConfig, err = k8sTools.BuildConfigFromFlags("", kubeConfig) + if err != nil { + log.Fatal(err) + return nil + } + } + + clientSet, err := k8s.NewForConfig(restConfig) + if err != nil { + log.Fatal(err) + return nil + } + + reg := k8sRegistry.NewRegistry(clientSet) + + return reg +} + +// NewEurekaRegistry 创建一个注册发现客户端 - Eureka +func NewEurekaRegistry(c *conf.Registry) *eurekaKratos.Registry { + var opts []eurekaKratos.Option + opts = append(opts, eurekaKratos.WithHeartbeat(c.Eureka.HeartbeatInterval.AsDuration())) + opts = append(opts, eurekaKratos.WithRefresh(c.Eureka.RefreshInterval.AsDuration())) + opts = append(opts, eurekaKratos.WithEurekaPath(c.Eureka.Path)) + + var err error + var reg *eurekaKratos.Registry + if reg, err = eurekaKratos.New(c.Eureka.Endpoints, opts...); err != nil { + log.Fatal(err) + } + + return reg +} + +// NewPolarisRegistry 创建一个注册发现客户端 - Polaris +//func NewPolarisRegistry(c *conf.Registry) *polarisKratos.Registry { +// var err error +// +// var consumer polarisApi.ConsumerAPI +// if consumer, err = polarisApi.NewConsumerAPI(); err != nil { +// log.Fatalf("fail to create consumerAPI, err is %v", err) +// } +// +// var provider polarisApi.ProviderAPI +// provider = polarisApi.NewProviderAPIByContext(consumer.SDKContext()) +// +// log.Infof("start to register instances, count %d", c.Polaris.InstanceCount) +// +// var resp *polarisModel.InstanceRegisterResponse +// for i := 0; i < (int)(c.Polaris.InstanceCount); i++ { +// registerRequest := &polarisApi.InstanceRegisterRequest{} +// registerRequest.Service = c.Polaris.Service +// registerRequest.Namespace = c.Polaris.Namespace +// registerRequest.Host = c.Polaris.Address +// registerRequest.Port = (int)(c.Polaris.Port) + i +// registerRequest.ServiceToken = c.Polaris.Token +// registerRequest.SetHealthy(true) +// if resp, err = provider.RegisterInstance(registerRequest); err != nil { +// log.Fatalf("fail to register instance %d, err is %v", i, err) +// } else { +// log.Infof("register instance %d response: instanceId %s", i, resp.InstanceID) +// } +// } +// +// reg := polarisKratos.NewRegistry(provider, consumer) +// +// return reg +//} + +// NewServicecombRegistry 创建一个注册发现客户端 - Servicecomb +func NewServicecombRegistry(c *conf.Registry) *servicecombKratos.Registry { + cfg := servicecombClient.Options{ + Endpoints: c.Servicecomb.Endpoints, + } + + var cli *servicecombClient.Client + var err error + if cli, err = servicecombClient.NewClient(cfg); err != nil { + log.Fatal(err) + } + + reg := servicecombKratos.NewRegistry(cli) + + return reg +} diff --git a/orm/gorm/pkg/bootstrap/registry_test.go b/orm/gorm/pkg/bootstrap/registry_test.go new file mode 100644 index 0000000..3bbac20 --- /dev/null +++ b/orm/gorm/pkg/bootstrap/registry_test.go @@ -0,0 +1,77 @@ +package bootstrap + +import ( + "github.com/stretchr/testify/assert" + "kratos-gorm-example/gen/api/go/common/conf" + "testing" +) + +func TestNewConsulRegistry(t *testing.T) { + var cfg conf.Registry + cfg.Consul.Scheme = "http" + cfg.Consul.Address = "127.0.0.1:8500" + cfg.Consul.HealthCheck = false + + reg := NewConsulRegistry(&cfg) + assert.Nil(t, reg) +} + +func TestNewEtcdRegistry(t *testing.T) { + var cfg conf.Registry + cfg.Etcd.Endpoints = []string{"127.0.0.1:2379"} + + reg := NewEtcdRegistry(&cfg) + assert.Nil(t, reg) +} + +func TestNewNacosRegistry(t *testing.T) { + var cfg conf.Registry + cfg.Nacos.Address = "127.0.0.1" + cfg.Nacos.Port = 8848 + + reg := NewNacosRegistry(&cfg) + assert.Nil(t, reg) +} + +func TestNewZooKeeperRegistry(t *testing.T) { + var cfg conf.Registry + cfg.Zookeeper.Endpoints = []string{"127.0.0.1:2181"} + + reg := NewZooKeeperRegistry(&cfg) + assert.Nil(t, reg) +} + +func TestNewKubernetesRegistry(t *testing.T) { + var cfg conf.Registry + reg := NewKubernetesRegistry(&cfg) + assert.Nil(t, reg) +} + +func TestNewEurekaRegistry(t *testing.T) { + var cfg conf.Registry + cfg.Eureka.Endpoints = []string{"https://127.0.0.1:18761"} + + reg := NewEurekaRegistry(&cfg) + assert.Nil(t, reg) +} + +func TestNewPolarisRegistry(t *testing.T) { + //var cfg conf.Registry + //cfg.Polaris.Address = "127.0.0.1" + //cfg.Polaris.Port = 8091 + //cfg.Polaris.InstanceCount = 5 + //cfg.Polaris.Namespace = "default" + //cfg.Polaris.Service = "DiscoverEchoServer" + //cfg.Polaris.Token = "" + // + //reg := NewPolarisRegistry(&cfg) + //assert.Nil(t, reg) +} + +func TestNewServicecombRegistry(t *testing.T) { + var cfg conf.Registry + cfg.Servicecomb.Endpoints = []string{"127.0.0.1:30100"} + + reg := NewServicecombRegistry(&cfg) + assert.Nil(t, reg) +} diff --git a/orm/gorm/pkg/bootstrap/rest.go b/orm/gorm/pkg/bootstrap/rest.go new file mode 100644 index 0000000..75a86fd --- /dev/null +++ b/orm/gorm/pkg/bootstrap/rest.go @@ -0,0 +1,65 @@ +package bootstrap + +import ( + "github.com/go-kratos/aegis/ratelimit" + "github.com/go-kratos/aegis/ratelimit/bbr" + "github.com/go-kratos/kratos/v2/middleware" + midRateLimit "github.com/go-kratos/kratos/v2/middleware/ratelimit" + "github.com/go-kratos/kratos/v2/middleware/recovery" + "github.com/go-kratos/kratos/v2/middleware/tracing" + "github.com/go-kratos/kratos/v2/middleware/validate" + kratosRest "github.com/go-kratos/kratos/v2/transport/http" + + "github.com/gorilla/handlers" + + "kratos-gorm-example/gen/api/go/common/conf" +) + +// CreateRestServer 创建REST服务端 +func CreateRestServer(cfg *conf.Bootstrap, m ...middleware.Middleware) *kratosRest.Server { + var opts = []kratosRest.ServerOption{ + kratosRest.Filter(handlers.CORS( + handlers.MaxAge(3600), + handlers.AllowedHeaders(cfg.Server.Rest.Cors.Headers), + handlers.AllowedMethods(cfg.Server.Rest.Cors.Methods), + handlers.AllowedOrigins(cfg.Server.Rest.Cors.Origins), + )), + } + + var ms []middleware.Middleware + if cfg.Server != nil && cfg.Server.Rest != nil && cfg.Server.Rest.Middleware != nil { + if cfg.Server.Rest.Middleware.GetEnableRecovery() { + ms = append(ms, recovery.Recovery()) + } + if cfg.Server.Rest.Middleware.GetEnableTracing() { + ms = append(ms, tracing.Server()) + } + if cfg.Server.Rest.Middleware.GetEnableValidate() { + ms = append(ms, validate.Validator()) + } + if cfg.Server.Rest.Middleware.GetEnableCircuitBreaker() { + } + if cfg.Server.Rest.Middleware.Limiter != nil { + var limiter ratelimit.Limiter + switch cfg.Server.Rest.Middleware.Limiter.GetName() { + case "bbr": + limiter = bbr.NewLimiter() + } + ms = append(ms, midRateLimit.Server(midRateLimit.WithLimiter(limiter))) + } + } + ms = append(ms, m...) + opts = append(opts, kratosRest.Middleware(ms...)) + + if cfg.Server.Rest.Network != "" { + opts = append(opts, kratosRest.Network(cfg.Server.Rest.Network)) + } + if cfg.Server.Rest.Addr != "" { + opts = append(opts, kratosRest.Address(cfg.Server.Rest.Addr)) + } + if cfg.Server.Rest.Timeout != nil { + opts = append(opts, kratosRest.Timeout(cfg.Server.Rest.Timeout.AsDuration())) + } + + return kratosRest.NewServer(opts...) +} diff --git a/orm/gorm/pkg/bootstrap/service_info.go b/orm/gorm/pkg/bootstrap/service_info.go new file mode 100644 index 0000000..41f5615 --- /dev/null +++ b/orm/gorm/pkg/bootstrap/service_info.go @@ -0,0 +1,30 @@ +package bootstrap + +import "os" + +type ServiceInfo struct { + Name string + Version string + Id string + Metadata map[string]string +} + +func NewServiceInfo(name, version, id string) *ServiceInfo { + if id == "" { + id, _ = os.Hostname() + } + return &ServiceInfo{ + Name: name, + Version: version, + Id: id, + Metadata: map[string]string{}, + } +} + +func (s *ServiceInfo) GetInstanceId() string { + return s.Id + "." + s.Name +} + +func (s *ServiceInfo) SetMataData(k, v string) { + s.Metadata[k] = v +} diff --git a/orm/gorm/pkg/bootstrap/tracer.go b/orm/gorm/pkg/bootstrap/tracer.go new file mode 100644 index 0000000..32e05c2 --- /dev/null +++ b/orm/gorm/pkg/bootstrap/tracer.go @@ -0,0 +1,84 @@ +package bootstrap + +import ( + "errors" + + "go.opentelemetry.io/otel/exporters/jaeger" + "go.opentelemetry.io/otel/exporters/zipkin" + + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/sdk/resource" + traceSdk "go.opentelemetry.io/otel/sdk/trace" + semConv "go.opentelemetry.io/otel/semconv/v1.4.0" + "kratos-gorm-example/gen/api/go/common/conf" +) + +// NewJaegerExporter 创建一个jaeger导出器 +func NewJaegerExporter(endpoint string) (traceSdk.SpanExporter, error) { + return jaeger.New(jaeger.WithCollectorEndpoint(jaeger.WithEndpoint(endpoint))) +} + +// NewZipkinExporter 创建一个zipkin导出器 +func NewZipkinExporter(endpoint string) (traceSdk.SpanExporter, error) { + return zipkin.New(endpoint) +} + +// NewTracerExporter 创建一个导出器,支持:jaeger和zipkin +func NewTracerExporter(exporterName, endpoint string) (traceSdk.SpanExporter, error) { + if exporterName == "" { + exporterName = "jaeger" + } + + switch exporterName { + case "jaeger": + return NewJaegerExporter(endpoint) + case "zipkin": + return NewZipkinExporter(endpoint) + default: + return nil, errors.New("exporter type not support") + } +} + +// NewTracerProvider 创建一个链路追踪器 +func NewTracerProvider(cfg *conf.Tracer, serviceInfo *ServiceInfo) error { + if cfg == nil { + return errors.New("tracer config is nil") + } + + if cfg.Sampler == 0 { + cfg.Sampler = 1.0 + } + + if cfg.Env == "" { + cfg.Env = "dev" + } + + opts := []traceSdk.TracerProviderOption{ + traceSdk.WithSampler(traceSdk.ParentBased(traceSdk.TraceIDRatioBased(cfg.Sampler))), + traceSdk.WithResource(resource.NewSchemaless( + semConv.ServiceNameKey.String(serviceInfo.Name), + semConv.ServiceVersionKey.String(serviceInfo.Version), + semConv.ServiceInstanceIDKey.String(serviceInfo.Id), + attribute.String("env", cfg.Env), + )), + } + + if len(cfg.Endpoint) > 0 { + exp, err := NewTracerExporter(cfg.Batcher, cfg.Endpoint) + if err != nil { + panic(err) + } + + opts = append(opts, traceSdk.WithBatcher(exp)) + } + + tp := traceSdk.NewTracerProvider(opts...) + if tp == nil { + return errors.New("create tracer provider failed") + } + + otel.SetTracerProvider(tp) + + return nil +} diff --git a/orm/gorm/pkg/service/name.go b/orm/gorm/pkg/service/name.go new file mode 100644 index 0000000..4f30d8b --- /dev/null +++ b/orm/gorm/pkg/service/name.go @@ -0,0 +1,5 @@ +package service + +const ( + UserService = "user.service" // 账户服务 +) diff --git a/orm/gorm/tests/user.http b/orm/gorm/tests/user.http new file mode 100644 index 0000000..14aefca --- /dev/null +++ b/orm/gorm/tests/user.http @@ -0,0 +1,22 @@ +### 用户列表 +GRPC localhost:10800/user.service.v1.UserService/ListUser + +### 获取一个用户 +GRPC localhost:10800/user.service.v1.UserService/GetUser + +{ + "id": 1 +} + +### 创建一个用户 +GRPC localhost:10800/user.service.v1.UserService/CreateUser + +### 更新一个用户 +GRPC localhost:10800/user.service.v1.UserService/UpdateUser + +### 删除一个用户 +GRPC localhost:10800/user.service.v1.UserService/DeleteUser + +{ + "id": 1 +}